prezense 0.0.0-stage → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounts.js +111 -0
- package/alerts.js +77 -0
- package/analytics.js +241 -0
- package/bundles.js +14 -0
- package/cart.js +214 -0
- package/cli.js +156 -0
- package/collections.js +30 -0
- package/currency.js +92 -0
- package/fraud.js +59 -0
- package/gift_cards.js +35 -0
- package/graphql.js +68 -0
- package/index.js +2 -0
- package/locations.js +33 -0
- package/loyalty.js +78 -0
- package/media.js +87 -0
- package/orders.js +166 -0
- package/package.json +15 -5
- package/pages.js +41 -0
- package/personalization.js +13 -0
- package/post_purchase.js +37 -0
- package/prezanse.js +156 -0
- package/products.js +107 -0
- package/promotions.js +42 -0
- package/reviews.js +53 -0
- package/search.js +18 -0
- package/shipping.js +32 -0
- package/trending.js +26 -0
- package/README.md +0 -3
package/shipping.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { operation, text, textList } from './graphql.js';
|
|
2
|
+
|
|
3
|
+
// Every value goes in as a GraphQL variable (graphql.js), never spliced into
|
|
4
|
+
// the query text.
|
|
5
|
+
|
|
6
|
+
export class Shipping {
|
|
7
|
+
constructor(client) {
|
|
8
|
+
this.client = client;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async rates({ cartID, carrierName, serviceCodes, data }) {
|
|
12
|
+
const args = {
|
|
13
|
+
cartID: ['String!', text(cartID)],
|
|
14
|
+
carrierName: ['String!', text(carrierName)],
|
|
15
|
+
serviceCodes: ['[String!]!', textList(serviceCodes)],
|
|
16
|
+
};
|
|
17
|
+
return this.client.sendRequest(operation('mutation', 'shippingRates', args, data), 'shippingRates');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async validateRates({ cartID, data }) {
|
|
21
|
+
const args = { cartID: ['String!', text(cartID)] };
|
|
22
|
+
return this.client.sendRequest(operation('query', 'validateShippingRates', args, data), 'validateShippingRates');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async saveShippingOption({ cartID, serviceCode, data }) {
|
|
26
|
+
const args = {
|
|
27
|
+
cartID: ['String!', text(cartID)],
|
|
28
|
+
serviceCode: ['String!', text(serviceCode)],
|
|
29
|
+
};
|
|
30
|
+
return this.client.sendRequest(operation('mutation', 'saveCustomerShippingOption', args, data), 'saveCustomerShippingOption');
|
|
31
|
+
}
|
|
32
|
+
}
|
package/trending.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { operation, text, number, bool } from './graphql.js';
|
|
2
|
+
|
|
3
|
+
// Every value goes in as a GraphQL variable (graphql.js), never spliced into
|
|
4
|
+
// the query text. Arguments left out fall back to the server's defaults.
|
|
5
|
+
|
|
6
|
+
export class Trending {
|
|
7
|
+
constructor(client) {
|
|
8
|
+
this.client = client;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async products({ timeWindow, category, limit, minScore, includeProductDetails, data }) {
|
|
12
|
+
const args = {
|
|
13
|
+
timeWindow: ['String!', text(timeWindow)],
|
|
14
|
+
category: ['String', text(category)],
|
|
15
|
+
limit: ['Int', number(limit)],
|
|
16
|
+
minScore: ['Float', number(minScore)],
|
|
17
|
+
includeProductDetails: ['Boolean!', bool(includeProductDetails)],
|
|
18
|
+
};
|
|
19
|
+
return this.client.sendRequest(operation('query', 'getTrendingProducts', args, data), 'getTrendingProducts');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async stats({ timeWindow, data }) {
|
|
23
|
+
const args = { timeWindow: ['String!', text(timeWindow)] };
|
|
24
|
+
return this.client.sendRequest(operation('query', 'getTrendingStats', args, data), 'getTrendingStats');
|
|
25
|
+
}
|
|
26
|
+
}
|
package/README.md
DELETED