@pintahub/shopify-api 2.5.6 → 2.5.7
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/dist/classes/admin/metaobjects/GetListFAQs.js +1 -1
- package/dist/classes/admin/metaobjects/faqs/_parseFAQs.js +1 -1
- package/dist/fragments/cart.d.ts +1 -1
- package/dist/fragments/cart.js +1 -0
- package/dist/input/MediaContentType.js +1 -1
- package/dist/input/WeightUnit.js +1 -1
- package/package.json +2 -2
- package/dist/actions/admin/GetProduct.d.ts +0 -10
- package/dist/actions/admin/GetProduct.js +0 -74
- package/dist/actions/admin/SearchProducts.d.ts +0 -12
- package/dist/actions/admin/SearchProducts.js +0 -45
- package/dist/actions/admin/products/GetProduct.d.ts +0 -10
- package/dist/actions/admin/products/GetProduct.js +0 -74
- package/dist/actions/admin/products/SearchProducts.d.ts +0 -12
- package/dist/actions/admin/products/SearchProducts.js +0 -45
- package/dist/actions/storefront/getProductByHandle.d.ts +0 -11
- package/dist/actions/storefront/getProductByHandle.js +0 -39
- package/dist/classes/ActionBase.d.ts +0 -2
- package/dist/classes/ActionBase.js +0 -6
- package/dist/classes/ShopifyAPI.d.ts +0 -3
- package/dist/classes/ShopifyAPI.js +0 -8
- package/dist/classes/admin/files/GetOrder.d.ts +0 -10
- package/dist/classes/admin/files/GetOrder.js +0 -52
- package/dist/classes/admin/orders/GetProduct.d.ts +0 -10
- package/dist/classes/admin/orders/GetProduct.js +0 -80
- package/dist/classes/admin/orders-v2/GetOrder.d.ts +0 -10
- package/dist/classes/admin/orders-v2/GetOrder.js +0 -52
- package/dist/classes/admin/orders-v2/SearchOrders.d.ts +0 -14
- package/dist/classes/admin/orders-v2/SearchOrders.js +0 -50
- package/dist/classes/admin/orders-v2/index.d.ts +0 -13
- package/dist/classes/admin/orders-v2/index.js +0 -34
- package/dist/classes/admin/pages/SearchPages.d.ts +0 -11
- package/dist/classes/admin/pages/SearchPages.js +0 -24
- package/dist/classes/admin/pages/index.d.ts +0 -10
- package/dist/classes/admin/pages/index.js +0 -28
- package/dist/classes/admin/payments/GetMenu.d.ts +0 -23
- package/dist/classes/admin/payments/GetMenu.js +0 -58
- package/dist/classes/admin/payments/SearchMenus.d.ts +0 -13
- package/dist/classes/admin/payments/SearchMenus.js +0 -47
- package/dist/classes/admin/products/CreateVariant.d.ts +0 -12
- package/dist/classes/admin/products/CreateVariant.js +0 -56
- package/dist/classes/admin/products/GetProductPublications.d.ts +0 -10
- package/dist/classes/admin/products/GetProductPublications.js +0 -104
- package/dist/classes/admin/products-v2/UpdateVariant.d.ts +0 -15
- package/dist/classes/admin/products-v2/UpdateVariant.js +0 -54
- package/dist/classes/admin/shop/GetPolicyPage.d.ts +0 -10
- package/dist/classes/admin/shop/GetPolicyPage.js +0 -47
- package/dist/classes/rest/orders/SearchOrderItems.d.ts +0 -12
- package/dist/classes/rest/orders/SearchOrderItems.js +0 -29
- package/dist/classes/rest/orders/SearchOrders.d.ts +0 -14
- package/dist/classes/rest/orders/SearchOrders.js +0 -49
- package/dist/classes/rest/orders/orders/GetOrder.d.ts +0 -10
- package/dist/classes/rest/orders/orders/GetOrder.js +0 -52
- package/dist/classes/rest/orders/orders/SearchOrders.d.ts +0 -14
- package/dist/classes/rest/orders/orders/SearchOrders.js +0 -49
- package/dist/classes/rest/orders/orders/index.d.ts +0 -13
- package/dist/classes/rest/orders/orders/index.js +0 -34
- package/dist/classes/rest/products/GetOrder.d.ts +0 -12
- package/dist/classes/rest/products/GetOrder.js +0 -29
- package/dist/classes/rest/products/index.d.ts +0 -10
- package/dist/classes/rest/products/index.js +0 -28
- package/dist/classes/storefront/cart/GetPage.d.ts +0 -10
- package/dist/classes/storefront/cart/GetPage.js +0 -43
- package/dist/classes/storefront/posts/GetProduct.d.ts +0 -10
- package/dist/classes/storefront/posts/GetProduct.js +0 -94
- package/dist/classes/storefront/products/SearchProducts.d.ts +0 -12
- package/dist/classes/storefront/products/SearchProducts.js +0 -47
- package/dist/utils/parseCleanId.d.ts +0 -0
- package/dist/utils/parseCleanId.js +0 -1
- package/dist/utils.d.ts +0 -0
- package/dist/utils.js +0 -1
|
@@ -15,8 +15,8 @@ const _parseFAQs_1 = require("./faqs/_parseFAQs");
|
|
|
15
15
|
const handleErrors_1 = require("../../../utils/handleErrors");
|
|
16
16
|
class GetListFAQs extends ActionBuilder_1.ActionBuilder {
|
|
17
17
|
run(args) {
|
|
18
|
-
var _a;
|
|
19
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
var _a;
|
|
20
20
|
const query = `
|
|
21
21
|
{
|
|
22
22
|
metaobjects(type: "faq", first: 100) {
|
|
@@ -40,7 +40,7 @@ const _parsePage = (page) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
40
40
|
const body = yield (0, _parseContentObjToHTML_1._parseContentObjToHTML)(vContent, type);
|
|
41
41
|
return Object.assign(Object.assign({}, rest), { title: vTitle, body });
|
|
42
42
|
});
|
|
43
|
-
const _parseFAQs = (
|
|
43
|
+
const _parseFAQs = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (pages = []) {
|
|
44
44
|
if (!pages || !pages.length)
|
|
45
45
|
return [];
|
|
46
46
|
const vPages = yield pMap(pages, (page) => __awaiter(void 0, void 0, void 0, function* () {
|
package/dist/fragments/cart.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const cartFragment = "\nfragment cart on Cart {\n id\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n totalQuantity\n lines(first: 250, reverse: false) {\n nodes {\n id\n quantity\n attributes {\n value\n key\n }\n merchandise {\n ... on ProductVariant {\n title\n selectedOptions {\n name\n value\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n image {\n url(transform: {maxWidth: 300})\n altText\n width\n height\n }\n product {\n id\n title\n handle\n }\n id\n }\n }\n discountAllocations {\n discountedAmount {\n amount\n currencyCode\n }\n ... on CartAutomaticDiscountAllocation {\n __typename\n title\n }\n }\n }\n }\n discountAllocations {\n discountedAmount {\n amount\n currencyCode\n }\n ... on CartAutomaticDiscountAllocation {\n __typename\n title\n }\n }\n buyerIdentity {\n countryCode\n }\n checkoutUrl\n}\n";
|
|
1
|
+
export declare const cartFragment = "\nfragment cart on Cart {\n id\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n totalQuantity\n lines(first: 250, reverse: false) {\n nodes {\n id\n quantity\n attributes {\n value\n key\n }\n merchandise {\n ... on ProductVariant {\n title\n selectedOptions {\n name\n value\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n image {\n id\n url(transform: {maxWidth: 300})\n altText\n width\n height\n }\n product {\n id\n title\n handle\n }\n id\n }\n }\n discountAllocations {\n discountedAmount {\n amount\n currencyCode\n }\n ... on CartAutomaticDiscountAllocation {\n __typename\n title\n }\n }\n }\n }\n discountAllocations {\n discountedAmount {\n amount\n currencyCode\n }\n ... on CartAutomaticDiscountAllocation {\n __typename\n title\n }\n }\n buyerIdentity {\n countryCode\n }\n checkoutUrl\n}\n";
|
package/dist/fragments/cart.js
CHANGED
|
@@ -7,4 +7,4 @@ var MediaContentType;
|
|
|
7
7
|
MediaContentType["IMAGE"] = "IMAGE";
|
|
8
8
|
MediaContentType["MODEL_3D"] = "MODEL_3D";
|
|
9
9
|
MediaContentType["VIDEO"] = "VIDEO";
|
|
10
|
-
})(MediaContentType
|
|
10
|
+
})(MediaContentType || (exports.MediaContentType = MediaContentType = {}));
|
package/dist/input/WeightUnit.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pintahub/shopify-api",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/bluebird": "^3.5.42",
|
|
13
|
-
"@types/node": "^20
|
|
13
|
+
"@types/node": "^20",
|
|
14
14
|
"bluebird": "^3.7.2",
|
|
15
15
|
"dotenv": "^16.3.1"
|
|
16
16
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
-
import { ActionBuilder } from "../../classes/ActionBuilder";
|
|
3
|
-
export interface GetProductInput extends Record<string, any> {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface GetProductOutput extends Record<string, any> {
|
|
7
|
-
}
|
|
8
|
-
export declare class GetProduct extends ActionBuilder<AdminApiClient, GetProductInput, GetProductOutput> {
|
|
9
|
-
run(args: GetProductInput): Promise<GetProductOutput>;
|
|
10
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GetProduct = void 0;
|
|
13
|
-
const ActionBuilder_1 = require("../../classes/ActionBuilder");
|
|
14
|
-
const getGlobalID_1 = require("../../utils/getGlobalID");
|
|
15
|
-
class GetProduct extends ActionBuilder_1.ActionBuilder {
|
|
16
|
-
run(args) {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const { id } = args;
|
|
19
|
-
const globalId = (0, getGlobalID_1.getGlobalID)(id, 'Product');
|
|
20
|
-
const query = `
|
|
21
|
-
{
|
|
22
|
-
product(id: "${globalId}") {
|
|
23
|
-
id
|
|
24
|
-
handle
|
|
25
|
-
publishedAt
|
|
26
|
-
updatedAt
|
|
27
|
-
status
|
|
28
|
-
featuredImage {
|
|
29
|
-
altText
|
|
30
|
-
url(transform: {preferredContentType: PNG, maxWidth: 1024})
|
|
31
|
-
width
|
|
32
|
-
height
|
|
33
|
-
}
|
|
34
|
-
productType
|
|
35
|
-
title
|
|
36
|
-
priceRangeV2 {
|
|
37
|
-
maxVariantPrice {
|
|
38
|
-
amount
|
|
39
|
-
currencyCode
|
|
40
|
-
}
|
|
41
|
-
minVariantPrice {
|
|
42
|
-
amount
|
|
43
|
-
currencyCode
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
tags
|
|
47
|
-
productCategory {
|
|
48
|
-
productTaxonomyNode {
|
|
49
|
-
fullName
|
|
50
|
-
name
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
collections(first: 100) {
|
|
54
|
-
nodes {
|
|
55
|
-
id
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
metafields(first: 100) {
|
|
59
|
-
nodes {
|
|
60
|
-
key
|
|
61
|
-
value
|
|
62
|
-
type
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
68
|
-
const { data } = yield this.client.request(query);
|
|
69
|
-
const { product } = Object.assign({}, data);
|
|
70
|
-
return Object.assign({}, product);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.GetProduct = GetProduct;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
-
import { ActionBuilder } from "../../classes/ActionBuilder";
|
|
3
|
-
export interface SearchProductsInput extends Record<string, any> {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface SearchProductsOutput extends Record<string, any> {
|
|
7
|
-
items: any[];
|
|
8
|
-
pageInfo: any;
|
|
9
|
-
}
|
|
10
|
-
export declare class SearchProducts extends ActionBuilder<AdminApiClient, SearchProductsInput, SearchProductsOutput> {
|
|
11
|
-
run(args?: SearchProductsInput): Promise<SearchProductsOutput>;
|
|
12
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SearchProducts = void 0;
|
|
13
|
-
const ActionBuilder_1 = require("../../classes/ActionBuilder");
|
|
14
|
-
class SearchProducts extends ActionBuilder_1.ActionBuilder {
|
|
15
|
-
run(args) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const query = `
|
|
18
|
-
{
|
|
19
|
-
products(
|
|
20
|
-
first: 100
|
|
21
|
-
sortKey: UPDATED_AT
|
|
22
|
-
reverse: true
|
|
23
|
-
) {
|
|
24
|
-
nodes {
|
|
25
|
-
id
|
|
26
|
-
}
|
|
27
|
-
pageInfo {
|
|
28
|
-
hasNextPage
|
|
29
|
-
endCursor
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
const { data } = yield this.client.request(query);
|
|
35
|
-
const { products } = Object.assign({}, data);
|
|
36
|
-
const { nodes, pageInfo } = Object.assign({}, products);
|
|
37
|
-
const items = Array.isArray(nodes) ? nodes : [];
|
|
38
|
-
return {
|
|
39
|
-
items,
|
|
40
|
-
pageInfo
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.SearchProducts = SearchProducts;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
-
import { ActionBuilder } from "../../../classes/ActionBuilder";
|
|
3
|
-
export interface GetProductInput extends Record<string, any> {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface GetProductOutput extends Record<string, any> {
|
|
7
|
-
}
|
|
8
|
-
export declare class GetProduct extends ActionBuilder<AdminApiClient, GetProductInput, GetProductOutput> {
|
|
9
|
-
run(args: GetProductInput): Promise<GetProductOutput>;
|
|
10
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GetProduct = void 0;
|
|
13
|
-
const ActionBuilder_1 = require("../../../classes/ActionBuilder");
|
|
14
|
-
const getGlobalID_1 = require("../../../utils/getGlobalID");
|
|
15
|
-
class GetProduct extends ActionBuilder_1.ActionBuilder {
|
|
16
|
-
run(args) {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const { id } = args;
|
|
19
|
-
const globalId = (0, getGlobalID_1.getGlobalID)(id, 'Product');
|
|
20
|
-
const query = `
|
|
21
|
-
{
|
|
22
|
-
product(id: "${globalId}") {
|
|
23
|
-
id
|
|
24
|
-
handle
|
|
25
|
-
publishedAt
|
|
26
|
-
updatedAt
|
|
27
|
-
status
|
|
28
|
-
featuredImage {
|
|
29
|
-
altText
|
|
30
|
-
url(transform: {preferredContentType: PNG, maxWidth: 1024})
|
|
31
|
-
width
|
|
32
|
-
height
|
|
33
|
-
}
|
|
34
|
-
productType
|
|
35
|
-
title
|
|
36
|
-
priceRangeV2 {
|
|
37
|
-
maxVariantPrice {
|
|
38
|
-
amount
|
|
39
|
-
currencyCode
|
|
40
|
-
}
|
|
41
|
-
minVariantPrice {
|
|
42
|
-
amount
|
|
43
|
-
currencyCode
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
tags
|
|
47
|
-
productCategory {
|
|
48
|
-
productTaxonomyNode {
|
|
49
|
-
fullName
|
|
50
|
-
name
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
collections(first: 100) {
|
|
54
|
-
nodes {
|
|
55
|
-
id
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
metafields(first: 100) {
|
|
59
|
-
nodes {
|
|
60
|
-
key
|
|
61
|
-
value
|
|
62
|
-
type
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
68
|
-
const { data } = yield this.client.request(query);
|
|
69
|
-
const { product } = Object.assign({}, data);
|
|
70
|
-
return Object.assign({}, product);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.GetProduct = GetProduct;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
-
import { ActionBuilder } from "../../../classes/ActionBuilder";
|
|
3
|
-
export interface SearchProductsInput extends Record<string, any> {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface SearchProductsOutput extends Record<string, any> {
|
|
7
|
-
items: any[];
|
|
8
|
-
pageInfo: any;
|
|
9
|
-
}
|
|
10
|
-
export declare class SearchProducts extends ActionBuilder<AdminApiClient, SearchProductsInput, SearchProductsOutput> {
|
|
11
|
-
run(args?: SearchProductsInput): Promise<SearchProductsOutput>;
|
|
12
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SearchProducts = void 0;
|
|
13
|
-
const ActionBuilder_1 = require("../../../classes/ActionBuilder");
|
|
14
|
-
class SearchProducts extends ActionBuilder_1.ActionBuilder {
|
|
15
|
-
run(args) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const query = `
|
|
18
|
-
{
|
|
19
|
-
products(
|
|
20
|
-
first: 100
|
|
21
|
-
sortKey: UPDATED_AT
|
|
22
|
-
reverse: true
|
|
23
|
-
) {
|
|
24
|
-
nodes {
|
|
25
|
-
id
|
|
26
|
-
}
|
|
27
|
-
pageInfo {
|
|
28
|
-
hasNextPage
|
|
29
|
-
endCursor
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
const { data } = yield this.client.request(query);
|
|
35
|
-
const { products } = Object.assign({}, data);
|
|
36
|
-
const { nodes, pageInfo } = Object.assign({}, products);
|
|
37
|
-
const items = Array.isArray(nodes) ? nodes : [];
|
|
38
|
-
return {
|
|
39
|
-
items,
|
|
40
|
-
pageInfo
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.SearchProducts = SearchProducts;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ActionBuilder } from "../../classes/ActionBuilder";
|
|
2
|
-
import { StorefrontApiClient } from "@shopify/storefront-api-client/dist/ts/types";
|
|
3
|
-
export interface GetProductInput extends Record<string, any> {
|
|
4
|
-
handle: string;
|
|
5
|
-
}
|
|
6
|
-
export interface GetProductOutput extends Record<string, any> {
|
|
7
|
-
product: any;
|
|
8
|
-
}
|
|
9
|
-
export declare class GetProductByHandle extends ActionBuilder<StorefrontApiClient, GetProductInput, GetProductOutput> {
|
|
10
|
-
run(args: GetProductInput): Promise<GetProductOutput>;
|
|
11
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GetProductByHandle = void 0;
|
|
13
|
-
const ActionBuilder_1 = require("../../classes/ActionBuilder");
|
|
14
|
-
class GetProductByHandle extends ActionBuilder_1.ActionBuilder {
|
|
15
|
-
run(args) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const productQuery = `
|
|
18
|
-
query ($handle: String) {
|
|
19
|
-
product(handle: $handle) {
|
|
20
|
-
id
|
|
21
|
-
title
|
|
22
|
-
handle
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
const { handle } = args;
|
|
27
|
-
const { data } = yield this.client.request(productQuery, {
|
|
28
|
-
variables: {
|
|
29
|
-
handle
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const { product } = Object.assign({}, data);
|
|
33
|
-
return {
|
|
34
|
-
product,
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.GetProductByHandle = GetProductByHandle;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
-
import { ActionBuilder } from "../../ActionBuilder";
|
|
3
|
-
export interface GetOrderInput extends Record<string, any> {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface GetOrderOutput extends Record<string, any> {
|
|
7
|
-
}
|
|
8
|
-
export declare class GetOrder extends ActionBuilder<AdminApiClient, GetOrderInput, GetOrderOutput> {
|
|
9
|
-
run(args: GetOrderInput): Promise<GetOrderOutput>;
|
|
10
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GetOrder = void 0;
|
|
13
|
-
const ActionBuilder_1 = require("../../ActionBuilder");
|
|
14
|
-
const getGlobalID_1 = require("../../../utils/getGlobalID");
|
|
15
|
-
const handleErrors_1 = require("../../../utils/handleErrors");
|
|
16
|
-
class GetOrder extends ActionBuilder_1.ActionBuilder {
|
|
17
|
-
run(args) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const { id } = args;
|
|
20
|
-
const globalId = (0, getGlobalID_1.getGlobalID)(id, 'Order');
|
|
21
|
-
const query = `
|
|
22
|
-
{
|
|
23
|
-
order(id: "${globalId}") {
|
|
24
|
-
id
|
|
25
|
-
createdAt
|
|
26
|
-
updatedAt
|
|
27
|
-
name
|
|
28
|
-
email
|
|
29
|
-
phone
|
|
30
|
-
shippingAddress {
|
|
31
|
-
name
|
|
32
|
-
countryCodeV2
|
|
33
|
-
}
|
|
34
|
-
displayFulfillmentStatus
|
|
35
|
-
displayFinancialStatus
|
|
36
|
-
totalPriceSet {
|
|
37
|
-
shopMoney {
|
|
38
|
-
amount
|
|
39
|
-
currencyCode
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
45
|
-
const { data, errors, extensions } = yield this.client.request(query);
|
|
46
|
-
yield (0, handleErrors_1.handleErrors)(errors);
|
|
47
|
-
const { order } = Object.assign({}, data);
|
|
48
|
-
return Object.assign({}, order);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.GetOrder = GetOrder;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
2
|
-
import { ActionBuilder } from "../../ActionBuilder";
|
|
3
|
-
export interface GetProductInput extends Record<string, any> {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface GetProductOutput extends Record<string, any> {
|
|
7
|
-
}
|
|
8
|
-
export declare class GetProduct extends ActionBuilder<AdminApiClient, GetProductInput, GetProductOutput> {
|
|
9
|
-
run(args: GetProductInput): Promise<GetProductOutput>;
|
|
10
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GetProduct = void 0;
|
|
13
|
-
const ActionBuilder_1 = require("../../ActionBuilder");
|
|
14
|
-
const getGlobalID_1 = require("../../../utils/getGlobalID");
|
|
15
|
-
const handleErrors_1 = require("../../../utils/handleErrors");
|
|
16
|
-
class GetProduct extends ActionBuilder_1.ActionBuilder {
|
|
17
|
-
run(args) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const { id } = args;
|
|
20
|
-
const globalId = (0, getGlobalID_1.getGlobalID)(id, 'Product');
|
|
21
|
-
const query = `
|
|
22
|
-
{
|
|
23
|
-
product(id: "${globalId}") {
|
|
24
|
-
id
|
|
25
|
-
handle
|
|
26
|
-
publishedAt
|
|
27
|
-
updatedAt
|
|
28
|
-
status
|
|
29
|
-
featuredImage {
|
|
30
|
-
altText
|
|
31
|
-
url(transform: {preferredContentType: PNG, maxWidth: 1200})
|
|
32
|
-
width
|
|
33
|
-
height
|
|
34
|
-
}
|
|
35
|
-
priceRangeV2 {
|
|
36
|
-
maxVariantPrice {
|
|
37
|
-
amount
|
|
38
|
-
currencyCode
|
|
39
|
-
}
|
|
40
|
-
minVariantPrice {
|
|
41
|
-
amount
|
|
42
|
-
currencyCode
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
productType
|
|
46
|
-
title
|
|
47
|
-
description
|
|
48
|
-
descriptionHtml
|
|
49
|
-
tags
|
|
50
|
-
productCategory {
|
|
51
|
-
productTaxonomyNode {
|
|
52
|
-
fullName
|
|
53
|
-
name
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
collections(first: 100) {
|
|
57
|
-
nodes {
|
|
58
|
-
id
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
metafields(first: 100) {
|
|
62
|
-
nodes {
|
|
63
|
-
key
|
|
64
|
-
value
|
|
65
|
-
type
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
`;
|
|
71
|
-
const { data, errors, extensions } = yield this.client.request(query);
|
|
72
|
-
yield (0, handleErrors_1.handleErrors)(errors);
|
|
73
|
-
const { product } = Object.assign({}, data);
|
|
74
|
-
return Object.assign({
|
|
75
|
-
status: 'DELETED'
|
|
76
|
-
}, product);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.GetProduct = GetProduct;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/graphql/types";
|
|
2
|
-
import { ActionBuilder } from "../../ActionBuilder";
|
|
3
|
-
export interface GetOrderInput extends Record<string, any> {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface GetOrderOutput extends Record<string, any> {
|
|
7
|
-
}
|
|
8
|
-
export declare class GetOrder extends ActionBuilder<AdminApiClient, GetOrderInput, GetOrderOutput> {
|
|
9
|
-
run(args: GetOrderInput): Promise<GetOrderOutput>;
|
|
10
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GetOrder = void 0;
|
|
13
|
-
const ActionBuilder_1 = require("../../ActionBuilder");
|
|
14
|
-
const getGlobalID_1 = require("../../../utils/getGlobalID");
|
|
15
|
-
const handleErrors_1 = require("../../../utils/handleErrors");
|
|
16
|
-
class GetOrder extends ActionBuilder_1.ActionBuilder {
|
|
17
|
-
run(args) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const { id } = args;
|
|
20
|
-
const globalId = (0, getGlobalID_1.getGlobalID)(id, 'Order');
|
|
21
|
-
const query = `
|
|
22
|
-
{
|
|
23
|
-
order(id: "${globalId}") {
|
|
24
|
-
id
|
|
25
|
-
createdAt
|
|
26
|
-
updatedAt
|
|
27
|
-
name
|
|
28
|
-
email
|
|
29
|
-
phone
|
|
30
|
-
shippingAddress {
|
|
31
|
-
name
|
|
32
|
-
countryCodeV2
|
|
33
|
-
}
|
|
34
|
-
displayFulfillmentStatus
|
|
35
|
-
displayFinancialStatus
|
|
36
|
-
totalPriceSet {
|
|
37
|
-
shopMoney {
|
|
38
|
-
amount
|
|
39
|
-
currencyCode
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
45
|
-
const { data, errors, extensions } = yield this.client.request(query);
|
|
46
|
-
yield (0, handleErrors_1.handleErrors)(errors);
|
|
47
|
-
const { order } = Object.assign({}, data);
|
|
48
|
-
return Object.assign({}, order);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.GetOrder = GetOrder;
|