Git Product home page Git Product logo

node-quickbase's Introduction

tflanagan's github stats

node-quickbase's People

Contributors

emlama avatar evanrh avatar logisticregression avatar tflanagan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-quickbase's Issues

bluebird inclusion leads to large memory usage increase

While chasing down some memory usages in an internal system we've got, I came across the quickbase library holding onto a ton of data that was no longer relevant. It turns out to be some sort of issue with bluebird that I didn't feel like tracking down.
Screenshot of the memory usage for the curious

My question is why is bluebird needed in the first place when Promise already exists? If you look at the screenshot, the first two snapshots are with bluebird included and the last two are with the bluebird inclusion commented out. Memory usage drops by almost 50%.

If bluebird is needed for some specific reason, could we get a version of the quickbase library to import that doesn't include that extra library?

Axios Cross-Site Request Forgery Vulnerability

Issue:
Current version of node-quickbase is using [email protected]. This throws an audit warning rated at moderate severity.

Solution:
Upgrade node-quickbase to a newer version of axios.

Workaround:
Install [email protected], which is not an option.

Comments:
Is there any reason why Axios can't be used at the latest version, which is up to 1.6.8 on npm?

Wrap-up:
Thanks for the great library! I use it all the time, since my organization leverages Quickbase heavily.

Error parsing XML on production

Hello!

Im using Quickbase library with VUE.js
here is my request code
image
in dev env its working nice, but when i build project and push it to Quickbase pages i have this error

image

When i use my local build its working good too.

So i think quickbase returns bad xml and library can't parse it.

how i can solve it?

lodash.merge security vulnerability

Hi guys! It looks like node-quickbase is using a version of lodash.merge with a major security vulnerability (described here). Would you mind bumping lodash.merge to at least ^4.6.2 and issuing a quick minor version fix?

character encoding

Hi - I'm guessing this is an issue with quickbase and not with this module, but I thought I would ask here anyway! I'm having issues updating quickbase fields with non-Western characters. When I update a field with this module and then view it in quickbase (after changing my browser's character encoding settings to UTF-8), some of the characters display correctly, but others show as question marks. I tried changing the module's encoding setting to UTF-8, but this actually made it worse (now ALL the non-Western characters display incorrectly). Is there another charset I can use that will fix this? Or is this a larger issue with quickbase (I know they don't really support other languages). Thanks!

Proxy Support

I am unable to connect to quickbase with the following error:

/home/test/node/node_modules/quickbase/QuickBase.js:281
this.queries[query].response = {status: status, results: results};
^
TypeError: Cannot read property '0' of undefined
at ClientRequest.quickbase._return (/home/hoakes/E2E/node/node_modules/quickbase/QuickBase.js:281:15)
at ClientRequest. (/home/hoakes/E2E/node/node_modules/quickbase/QuickBase.js:264:17)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1547:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at Socket.onerror (tls.js:1445:17)
at Socket.EventEmitter.emit (events.js:117:20)
at net.js:440:14
at process._tickCallback (node.js:419:13)

I have verified I can access the qb url via cURL. I am behind an http proxy, but I have the proxy set in my environment variables.

any help would be appreciated.

QuickBase Dev Tools : Records || .toJson([fidsToConvrert])

Please see the below example.

The example does not show where the project variable is declared or what it is intended to represent.

Should there be a load function?
Is there a set DBName?

Not sure what is required to make this work.

======================================================
.toJson([fidsToConvrert])

project.set('projectName', 'Some Example Project');
project.set('completed', false);
project.set('finishDate', moment(1587355200000));
project.set('elapsedTime', moment.duration(10800000));
project.set('$tableRow', $('.some-tr-row'));

task.set('taskName', 'Some Task');

project.set('tasks', [
task
]);

project.toJson();

AddRecord & EditRecord bug: The API request successfully adds/edits the record as expected but it returns an empty response

Has anyone else run into this?

I need to store the record ID of the record I am adding. Until I figure out why the API request is returning a blank response, I am using webhooks to catch when a record is added and field matching it to the record without a record ID in my application. This approach is obviously not ideal. I would appreciate some help figuring out why AddRecord and EditRecord are returning empty responses. My code for AddRecord is pasted below:

quickbase.api('API_AddRecord',{
            dbid: external.content.api.dbid,
            fields: external.clone.fields,
            disprec: true,
            msInUTC: false,
            ignoreError: false,
            udata: "Record added by Qipo"
        }).then((results) => {
            console.log("DEBUG: results returned from Quickbase.AddRecord: ",results);
            resolve(results);
            /* results = {
             * 	action: 'API_AddRecord',
             * 	errcode: 0,
             * 	errtext: 'No error',
             * 	rid: 21,
             * 	update_id: 1206177014451
             * }
             */
        }).catch( (error) => {
            console.log("QuickbaseAPI.AddRecord Error: ",error);
            reject(new Error(error));
        });

deepmerge dependency

deepmerge did not used to be a dependency the user needed to install, but now it is. Just wondering if this is intentional?

Incorrect documentation on disprec and fform

Thanks for this library–it's a huge timesaver!
I found that some bits of the documentation are correct: The references to API_AddRecord imply that specifying disprec: false and fform: false in options is the correct way to set those values. However, Quickbase appears to base its response solely on the presence of those options, not the value. Setting those to false (or presumably any value) is effectively the same as setting them to 1–the response is a redirect to the form of the newly added record.

What do you think the best way of documenting those parameters is?

Push to Version 1.0.0

Push to Version 1.0.0

With the ever increasing use of this library [Thanks guys! :)] in Node, and now the browser, getting a stable API is becoming more of an issue.

With that in mind, I would like to release 1.0.0 marking a line in the sand in terms of backwards compatibility and intended use.

If anyone has anything to add to this list before I release 1.0.0, please feel free to comment/submit a PR.

General To Do

  • Convert to Promises
  • Clean up Actions
  • Create functions for each API Action
  • Testing API Functions
  • Create functions for each API Option
  • Testing API Options
  • Rewrite mergeObjects to be less of a behemoth
  • Add LICENSE file
    Speaking of the LICENSE, is anyone concerned with the use of APACHE 2.0?
  • Proxy Support #1 #8 (comment) (https://github.com/tflanagan/node-quickbase/tree/proxy)

Future...

  • ES6 Branch

Testing API Functions

Test each API function looking for sensible return objects from XML -> JSON and then cleanXML. This will help find bugs in cleanXML and keep the output standardized as much as possible.

  • API_AddField
  • API_AddGroupToRole
  • API_AddRecord
  • API_AddReplaceDBPage
  • API_AddSubGroup
  • API_AddUserToGroup
  • API_AddUserToRole
  • API_Authenticate
  • API_ChangeGroupInfo
  • API_ChangeManager
  • API_ChangeRecordOwner
  • API_ChangeUserRole
  • API_CloneDatabase
  • API_CopyGroup
  • API_CopyMasterDetail
  • API_CreateDatabase
  • API_CreateGroup
  • API_CreateTable
  • API_DeleteDatabase
  • API_DeleteField
  • API_DeleteGroup
  • API_DeleteRecord
  • API_DoQuery
  • API_DoQueryCount
  • API_EditRecord
  • API_FieldAddChoices
  • API_FieldRemoveChoices
  • API_FindDBByName
  • API_GenAddRecordForm
  • API_GenResultsTable
  • API_GetAncestorInfo
  • API_GetAppDTMInfo
  • API_GetDBPage
  • API_GetDBInfo
  • API_GetDBVar
  • API_GetGroupRole
  • API_GetNumRecords
  • API_GetSchema
  • API_GetRecordAsHTML
  • API_GetRecordInfo
  • API_GetRoleInfo
  • API_GetUserInfo
  • API_GetUserRole
  • API_GetUsersInGroup
  • API_GrantedDBs
  • API_GrantedDBsForGroup
  • API_GrantedGroups
  • API_ImportFromCSV
  • API_ProvisionUser
  • API_PurgeRecords
  • API_RemoveGroupFromRole
  • API_RemoveSubgroup
  • API_RemoveUserFromGroup
  • API_RemoveUserFromRole
  • API_RenameApp
  • API_RunImport
  • API_SendInvitation
  • API_SetDBVar
  • API_SetFieldProperties
  • API_SetKeyField
  • API_SignOut
  • API_UploadFile
  • API_UserRoles

Testing API Options

Ensure that the same option name for different API Functions have the same behavior

  • accountId
    API Calls: API_ChangeGroupInfo, API_CreateGroup
  • add_to_forms
    API Calls: API_AddField
  • adminOnly
    API Calls: API_GrantedDBs
  • adminonly
    API Calls: API_GrantedGroups
  • allow_new_choices
    API Calls: API_SetFieldProperties
  • allowAdminAccess
    API Calls: API_AddUserToGroup
  • allowHTML
    API Calls: API_SetFieldProperties
  • allRoles
    API Calls: API_RemoveGroupFromRole
  • appears_by_default
    API Calls: API_SetFieldProperties
  • append-only
    API Calls: API_SetFieldProperties
  • blank_is_zero
    API Calls: API_SetFieldProperties
  • bold
    API Calls: API_SetFieldProperties
  • choice
    API Calls: API_FieldAddChoices, API_FieldRemoveChoices
  • choices
    API Calls: API_SetFieldProperties
  • clist
    API Calls: API_DoQuery, API_GenResultsTable, API_ImportFromCSV
  • clist_output
    API Calls: API_ImportFromCSV
  • comma_start
    API Calls: API_SetFieldProperties
  • copyfid
    API Calls: API_CopyMasterDetail
  • createapptoken
    API Calls: API_CreateDatabase
  • currency_format
    API Calls: API_SetFieldProperties
  • currency_symbol
    API Calls: API_SetFieldProperties
  • dbdesc
    API Calls: API_CreateDatabase
  • dbname
    API Calls: API_CreateDatabase, API_FindDBByName
  • decimal_places
    API Calls: API_SetFieldProperties
  • default_today
    API Calls: API_SetFieldProperties
  • default_value
    API Calls: API_SetFieldProperties
  • description
    API Calls: API_ChangeGroupInfo, API_CopyGroup, API_CreateGroup
  • destrid
    API Calls: API_CopyMasterDetail
  • dfid
    API Calls: API_GetRecordAsHTML
  • display_as_button
    API Calls: API_SetFieldProperties
  • display_dow
    API Calls: API_SetFieldProperties
  • display_month
    API Calls: API_SetFieldProperties
  • display_relative
    API Calls: API_SetFieldProperties
  • display_time
    API Calls: API_SetFieldProperties
  • display_zone
    API Calls: API_SetFieldProperties
  • disprec
    API Calls: API_AddRecord, API_EditRecord
  • does_average
    API Calls: API_SetFieldProperties
  • does_total
    API Calls: API_SetFieldProperties
  • doesdatacopy
    API Calls: API_SetFieldProperties
  • email
    API Calls: API_GetUserInfo, API_ProvisionUser
  • excludefiles
    API Calls: API_CloneDatabase
  • excludeparents
    API Calls: API_GrantedDBs
  • fform
    API Calls: API_AddRecord, API_EditRecord
  • fid
    API Calls: API_DeleteField, API_FieldAddChoices, API_FieldRemoveChoices, API_SetFieldProperties, API_SetKeyField
  • field
    API Calls: API_AddRecord, API_EditRecord, API_GenAddRecordForm, API_UploadFile
  • fieldhelp
    API Calls: API_SetFieldProperties
  • find_enabled
    API Calls: API_SetFieldProperties
  • fmt
    API Calls: API_DoQuery
  • fname
    API Calls: API_ProvisionUser
  • formula
    API Calls: API_SetFieldProperties
  • gacct
    API Calls: API_CopyGroup
  • gid
    API Calls: API_AddGroupToRole, API_AddSubGroup, API_AddUserToGroup, API_ChangeGroupInfo, API_CopyGroup, API_DeleteGroup, API_GetGroupRole, API_GetUsersInGroup, API_GrantedDBsForGroup, API_RemoveGroupFromRole, API_RemoveSubgroup, API_RemoveUserFromGroup
  • has_extension
    API Calls: API_SetFieldProperties
  • hours
    API Calls: API_Authenticate
  • id
    API Calls: API_RunImport
  • ignoreError
    API Calls: API_AddRecord, API_EditRecord
  • inclgrps
    API Calls: API_GetUserRole
  • includeAllMgrs
    API Calls: API_GetUsersInGroup
  • includeancestors
    API Calls: API_GrantedDBs
  • includeRids
    API Calls: API_DoQuery
  • jht
    API Calls: API_GenResultsTable
  • jsa
    API Calls: API_GenResultsTable
  • keepData
    API Calls: API_CloneDatabase
  • key
    API Calls: API_ChangeRecordOwner, API_DeleteRecord, API_EditRecord, API_GetRecordInfo
  • label
    API Calls: API_AddField, API_SetFieldProperties
  • lname
    API Calls: API_ProvisionUser
  • maxlength
    API Calls: API_SetFieldProperties
  • mode
    API Calls: API_AddField
  • msInUTC
    API Calls: API_AddRecord, API_EditRecord, API_ImportFromCSV
  • name
    API Calls: API_ChangeGroupInfo, API_CopyGroup, API_CreateGroup
  • newappname
    API Calls: API_RenameApp
  • newdbdesc
    API Calls: API_CloneDatabase
  • newdbname
    API Calls: API_CloneDatabase
  • newmgr
    API Calls: API_ChangeManager
  • newowner
    API Calls: API_ChangeRecordOwner
  • newroleid
    API Calls: API_ChangeUserRole
  • no_wrap
    API Calls: API_SetFieldProperties
  • numberfmt
    API Calls: API_SetFieldProperties
  • options
    API Calls: API_DoQuery, API_GenResultsTable
  • pagebody
    API Calls: API_AddReplaceDBPage
  • pageid
    API Calls: API_AddReplaceDBPage
  • pageID
    API Calls: API_GetDBPage
  • pagename
    API Calls: API_AddReplaceDBPage
  • pagetype
    API Calls: API_AddReplaceDBPage
  • ParentsOnly
    API Calls: API_FindDBByName
  • password
    API Calls: API_Authenticate
  • pnoun
    API Calls: API_CreateTable
  • qid
    API Calls: API_DoQuery, API_GenResultsTable, API_PurgeRecords
  • qname
    API Calls: API_DoQuery, API_GenResultsTable, API_PurgeRecords
  • query
    API Calls: API_DoQuery, API_DoQueryCount, API_GenResultsTable, API_PurgeRecords
  • records_csv
    API Calls: API_ImportFromCSV
  • recurse
    API Calls: API_CopyMasterDetail
  • relfids
    API Calls: API_CopyMasterDetail
  • required
    API Calls: API_SetFieldProperties
  • returnpercentage
    API Calls: API_DoQuery
  • rid
    API Calls: API_ChangeRecordOwner, API_DeleteRecord, API_EditRecord, API_GetRecordAsHTML, API_GetRecordInfo, API_UploadFile
  • roleid
    API Calls: API_AddGroupToRole, API_AddUserToRole, API_ChangeUserRole, API_ProvisionUser, API_RemoveGroupFromRole, API_RemoveUserFromRole
  • skipfirst
    API Calls: API_ImportFromCSV
  • slist
    API Calls: API_DoQuery, API_GenResultsTable
  • sort_as_given
    API Calls: API_SetFieldProperties
  • sourcerid
    API Calls: API_CopyMasterDetail
  • subgroupid
    API Calls: API_AddSubGroup, API_RemoveSubgroup
  • tname
    API Calls: API_CreateTable
  • type
    API Calls: API_AddField
  • unique
    API Calls: API_SetFieldProperties
  • update_id
    API Calls: API_EditRecord
  • userid
    API Calls: API_AddUserToGroup, API_AddUserToRole, API_ChangeUserRole, API_GetUserRole, API_GrantedGroups, API_RemoveUserFromGroup, API_RemoveUserFromRole, API_SendInvitation
  • username
    API Calls: API_Authenticate
  • usersandroles
    API Calls: API_CloneDatabase
  • usertext
    API Calls: API_SendInvitation
  • value
    API Calls: API_SetDBVar
  • varname
    API Calls: API_GetDBVar, API_SetDBVar
  • width
    API Calls: API_SetFieldProperties
  • withembeddedtables
    API Calls: API_GrantedDBs

XML Parsing RTF Fields

With the new Rich Text Fields, XML Parsing is broken. QuickBase sends the XML response with <BR/> not escaped so when xml2js parses it, you have output like this:

{ _: 'Some text',
BR: [ '', ''] }

The BR tags need to be escaped.

Push 4.2.0 to npm

Can you push 4.2.0 to npm? I was wanting to implement copyApp but keep my project tied to the npm package.

Thank you.

Using Node-Quickbase with angular

Could you explain how this module would work in a stack project using express and angular? Is it, in its current form, capable of doing this? Disregarding the issue of cross domain access.

appToken Error

The Initialization documentation says that appToken parameter is not required, but whenever initiate with only a userToken and make an API call I get an error like:
"Invalid Application Token: An Application Token must be supplied."

Is proxy-support enabled ?

Hi I am using this node module to integrate with quick base and it works great! Thank you!

My application is behind a corporate proxy and want to know if proxy support has been added.

Plans on adding the webhook API?

Hi @tflanagan , just curious about your planned next steps with this library. Do you plan on adding the webhook API calls at some point? Is there any underlying technical reason they aren't there now? Any tips on how my team and I might build this library out to include those methods? Happy to submit a PR once we do!

Upserting a file attachment not working

I am moving data between two tables in a QB application. One of the fields is a File Attachment. I am able to download the file, but when I upsert to the new table I get an error that required data is missing. If I make the destination table's file attachment field not required, the upsert records save. Also, I have confirmed the file is downloading successfully and I used that output as was able to recreate a POST request to save to the destination table

Relavant schema (destination):

ID Name Type
10 Charter File attachment
20 Related Team Numeric

Application code snippet:

 qb.downloadFile({
      "tableId":"foo",
      "fieldId":"10",
      "recordId":"123",
      "versionNumber":1
  }).then(file => {
     qb.upsert({
          "tableId": "bar",
          "data": [{
             "10": {"value": {"filename":"test.pptx","data":file}},
             "20": {"value": 584}
          }]
   })

Unable to set fmt to unstructured

Hello-

I am trying to get my results in a non-structured format. I attempted to override the default by setting fmt = '' but this does not seem to be working:

var qb = new quickbase({
realm: settings.qbRealm,
appToken: settings.qbAppToken,
flags: {
fmt: ''
}
});

Is there another way to remove this flag?

thanks,
Howie

Updating a record

So this should be an easy one - I just can't figure it out. I'm migrating from version 2.something to 4.2.2 and I can't find in the documentation how to update a record. quickbase.upsertRecords seems like a possibility - but I don't see a place for a record ID. Is it like mongoDb/mongoose where you run a query, then something like 'record.set('fieldID', 'value')', then something like 'record.save()'? Or am I just not seeing the right funtion/method? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.