moltin / moltin-request Goto Github PK
View Code? Open in Web Editor NEW๐ฎ Minimal Elastic Path Commerce Cloud API request library for Node
Home Page: http://documentation.elasticpath.com/
License: MIT License
๐ฎ Minimal Elastic Path Commerce Cloud API request library for Node
Home Page: http://documentation.elasticpath.com/
License: MIT License
If I try specifying a host, I get an error.
Example:
const client = new MoltinClient({
client_id: 'some id',
host: 'api.moltin.com',
});
client
.get('products')
.then(console.log)
.catch(console.error);
I get this error:
error: TypeError: Only absolute URLs are supported
at getNodeRequestOptions (/Users/user/dev/some-project/functions/node_modules/node-fetch/lib/index.js:1299:9)
at /Users/user/dev/some-project/functions/node_modules/node-fetch/lib/index.js:1404:19
at new Promise (<anonymous>)
at MoltinClient.fetch (/Users/user/dev/some-project/functions/node_modules/node-fetch/lib/index.js:1401:9)
at MoltinClient.fetch (/Users/user/dev/some-project/functions/node_modules/cross-fetch/dist/node-ponyfill.js:10:20)
at MoltinClient.<anonymous> (/Users/user/dev/some-project/functions/node_modules/@moltin/request/dist/index.js:136:51)
at step (/Users/user/dev/some-project/functions/node_modules/@moltin/request/dist/index.js:43:23)
at Object.next (/Users/user/dev/some-project/functions/node_modules/@moltin/request/dist/index.js:24:53)
at /Users/user/dev/some-project/functions/node_modules/@moltin/request/dist/index.js:18:71
at new Promise (<anonymous>)
Using version 2.0.0 with the following code:
import { MoltinClient } from '@moltin/request'
const client = new MoltinClient({
client_id: process.env.MOLTIN_CLIENT_ID,
client_secret: process.env.MOLTIN_CLIENT_SECRET
})
After upgrading to the latest version I'm having trouble doing get-requests. It looks like a body is attached to the request which makes it fail. Here's the error I'm getting:
TypeError: Request with GET/HEAD method cannot have body
at new Request (/user_code/node_modules/@moltin/request/node_modules/node-fetch/lib/index.js:1191:10)
at /user_code/node_modules/@moltin/request/node_modules/node-fetch/lib/index.js:1369:19
at Object.fetch (/user_code/node_modules/@moltin/request/node_modules/node-fetch/lib/index.js:1367:9)
at Object.fetch (/user_code/node_modules/@moltin/request/node_modules/cross-fetch/dist/node-ponyfill.js:10:20)
at createClient. (/user_code/node_modules/@moltin/request/dist/index.js:89:46)
at step (/user_code/node_modules/@moltin/request/dist/index.js:43:23)
at Object.next (/user_code/node_modules/@moltin/request/dist/index.js:24:53)
at fulfilled (/user_code/node_modules/@moltin/request/dist/index.js:15:58)
at process._tickDomainCallback (internal/process/next_tick.js:135:7) }"
I want to create a whishlist to my customers,
I follow this steps and I am stack in the #8 step. How to get: CUSTOMER_FLOW_ID
Even when I add the wishlist it is not shown in the customers custome field there is no field added.
And one other think. Please add array filed in filed type in the flows filed I think this will solve a lot of problems.
And, We are waiting more tutorials from your youtube channel.
Thanks!
This issue provides visibility into Renovate updates and their statuses. Learn more
These updates are awaiting their schedule. Click on a checkbox to get an update now.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@types/jest
, jest
, ts-jest
)Moltin permits sending data when the request is of type DELETE
.
The delete
method should be updated to permit the use of https://docs.moltin.com/carts-and-checkout/promotions/delete-promotion-codes properly.
I have a Blob object and I want to send it to server.
Here is my code based on your docs:
`
const formData = new FormData();
formData.append("file_name", productName);
formData.append("public", "true");
formData.append("mime_type", "image/png");
canvas.toBlob(blob => {
formData.append("file", blob, productName);
});
const headers = {
"Content-Type": "image/png"
};
const data = {
body: formData
};
moltin
.post("files", data, headers)
.then(data => console.log(data))
.catch(err => console.error(err));
`
I am always getting {status: 500, title: "InternalError", detail: "Cannot read property 'file' of undefined", request_id: "xxx..."}
Any solution please!
Thanks in advance!
It would have been nice if valid access tokens somehow were stored, and used in subsequent requests.https://github.com/moltin/moltin-request/blob/master/src/index.ts#L38.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.