Coder Social home page Coder Social logo

merchisdk / sdk Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 5.97 MB

libraries in different languages for talking to api.merchi.co

License: GNU General Public License v3.0

PHP 17.70% Python 81.71% Shell 0.25% HTML 0.33%
python php sales crm crm-sdk crm-integration javascript merchi

sdk's Introduction

sdk's People

Contributors

amtron avatar danielcollins avatar s3341458 avatar unitix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

dakshag

sdk's Issues

Sweep: refactor getQueryStringValue so it would not crash in nodejs runtime

in sdk/javascript/merchi.js (788:41) there is a function getQueryStringValue, call this function in nodejs runtime will cause error "TypeError: Cannot read properties of undefined (reading 'search')", refactor this function so it can be run in the node js runtime with no error return "undefined"

Checklist
  • sdk/javascript/merchi.js ✅ Commit b8e2293
• Add a check at the start of the `getQueryStringValue` function to see if the `window` object is defined. You can do this with an `if` statement like so: `if (typeof window === 'undefined')`. • If the `window` object is not defined, return `undefined` immediately. This will prevent the rest of the function from executing and trying to access `window.location.search`.

misconfigured eslint in travis ci

currently:
./node_modules/eslint/bin/eslint.js 'src/**.ts'

suppose to be:
./node_modules/eslint/bin/eslint.js 'src/*/**.ts'

notice this when I was working on #252

Sweep: change colour internal tags from number to string

the colour attribute of internal tags in python, typescript and javasript sdk are miss assigned to integer, change them into string

Checklist
  • Modify python/internal_tags.py149c1d1
  • Modify javascript/internal_tag.js ! No changes made
  • Modify typescript/src/entities/internal_tag.ts9745494

Flowchart

Sweep: write JS sdk documentation Job entity

Please write SDK documentation for the invoice, job, user entities inside the javascript sdk; please explain the get, create, save and delete methods.

Checklist
  • javascript/invoice.js ✅ Commit be2957f
• At the top of the file, add a comment explaining the purpose of the invoice entity. • Before the get method, add a comment explaining what the method does, the parameters it accepts, and the value it returns. • Repeat the above step for the create, save, and delete methods. • Consider providing examples of how to use the methods.
  • javascript/job.js ❌ Failed
• At the top of the file, add a comment explaining the purpose of the job entity. • Before the get method, add a comment explaining what the method does, the parameters it accepts, and the value it returns. • Repeat the above step for the create, save, and delete methods. • Consider providing examples of how to use the methods.
  • javascript/user.js ❌ Failed
• At the top of the file, add a comment explaining the purpose of the user entity. • Before the get method, add a comment explaining what the method does, the parameters it accepts, and the value it returns. • Repeat the above step for the create, save, and delete methods. • Consider providing examples of how to use the methods.

typescript SDK patch entity with multiple files fileIndex remains 0

tested this out on job.clientFiles:
create 2 new Merchi files and add them to the job.clientFiles.
Do job.save; the first file will be created and linked with the job twice.
This is because the fileIndex in ./typescript/src/entity.ts on line 598 isn't being incremented.

syntax checks runs too slow.

I need the syntax check be as fast as possible currently took more than 5 min to run syntax check on my computer. needs to be less than at maximum 30 seconds

inconsistent json name

ProductComment.json_name = "production_comment"
ComponentTag.json_name = "ComponentTag"

ProductComments.json_name = "productionComments"
PhoneNumbers.json_name = "phone_numbers"

I start to suspect if python sdk is working at all.

reduce the code for "not embed check"

I see something like

if (this.featureImage === undefined) {
throw new Error("featureImage is undefined, did you forget to embed it?");
}
if (this.images === undefined) {
throw new Error("images is undefined, did you forget to embed it?");
}

Hope we can reduce some code for this.

notice some 'unused import' in some files

eg
in sdk/python/draft_comments.py
I saw "import sdk.python.users", I did not see any real usage of this import.
Is there any purpose on that or it is just a purely mistake.

Sweep: unify json_name to camel case for python entities

in sdk/python in some of entities the json_name is lower case like "lower_case" but we want them all camel case like "camelCase"
eg. in sdk/python/payment_devices.py the json_name of PaymentDevice entity is 'paymentDevice' which is correct, however, in sdk/python/email_addresses.py the json name of EmailAddress is lower name.

Now I want you to read all the files in sdk/python if you find json_name of a entity is given as lower case, convert it to camel case.

Checklist
  • python/email_addresses.py ✅ Commit 810a5a2
• Change the `json_name` attribute of the `EmailAddress` class to 'emailAddress'.
  • python/payment_devices.py ❌ Failed
• No changes needed as the `json_name` attribute of the `PaymentDevice` class is already in camel case.
  • python/payments.py ❌ Failed
• Change the `json_name` attribute of the `Payment` class to 'payment'.
  • python/addresses.py ❌ Failed
• Change the `json_name` attribute of the `Address` class to 'address'.
  • python/util/name_protocol.py ❌ Failed
• No changes needed as this file contains utility functions and does not define any entities.

letsencrypt breaks limit rate

similar errors happens both on staging and production

acme.messages.Error: urn:ietf:params:acme:error:rateLimited :: There were too many requests of a given type :: Error creating new order :: too many certificates already issued for exact set of domains: *.staging.merchi.co,staging.merchi.co: see https://letsencrypt.org/docs/rate-limits/

TS SDK delete method breaks job.

If you try to delete a job it breaks because there is no response to serialise.

In the case of the job, it would help if the job was returned in the response.

bump up eslint version

I notice a issue, where my editor always tried to convert '' to "", which does not follow the eslint rules.

after debug it a little bit I notice it is because global eslint failed as "ESLint configuration of global 'global' in .eslintrc.js is invalid" due to we are using an outdated eslint while my editor are running. a more update eslint.

So for only the 'prettier' was used.

this bug does not influence #252 as it is done by run eslint in node modules

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.