@pintahub/shopify-api 2.5.6 → 2.5.8

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.
Files changed (79) hide show
  1. package/dist/classes/ShopAppAPI.d.ts +10 -0
  2. package/dist/classes/ShopAppAPI.js +62 -0
  3. package/dist/classes/admin/metaobjects/GetListFAQs.js +1 -1
  4. package/dist/classes/admin/metaobjects/faqs/_parseFAQs.js +1 -1
  5. package/dist/classes/shop/graphql/StoreReviews.d.ts +1 -0
  6. package/dist/classes/shop/graphql/StoreReviews.js +82 -0
  7. package/dist/fragments/cart.d.ts +1 -1
  8. package/dist/fragments/cart.js +1 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +1 -0
  11. package/dist/input/MediaContentType.js +1 -1
  12. package/dist/input/WeightUnit.js +1 -1
  13. package/dist/interfaces/ShopAppOptions.d.ts +4 -0
  14. package/dist/interfaces/ShopAppOptions.js +2 -0
  15. package/package.json +3 -3
  16. package/dist/actions/admin/GetProduct.d.ts +0 -10
  17. package/dist/actions/admin/GetProduct.js +0 -74
  18. package/dist/actions/admin/SearchProducts.d.ts +0 -12
  19. package/dist/actions/admin/SearchProducts.js +0 -45
  20. package/dist/actions/admin/products/GetProduct.d.ts +0 -10
  21. package/dist/actions/admin/products/GetProduct.js +0 -74
  22. package/dist/actions/admin/products/SearchProducts.d.ts +0 -12
  23. package/dist/actions/admin/products/SearchProducts.js +0 -45
  24. package/dist/actions/storefront/getProductByHandle.d.ts +0 -11
  25. package/dist/actions/storefront/getProductByHandle.js +0 -39
  26. package/dist/classes/ActionBase.d.ts +0 -2
  27. package/dist/classes/ActionBase.js +0 -6
  28. package/dist/classes/ShopifyAPI.d.ts +0 -3
  29. package/dist/classes/ShopifyAPI.js +0 -8
  30. package/dist/classes/admin/files/GetOrder.d.ts +0 -10
  31. package/dist/classes/admin/files/GetOrder.js +0 -52
  32. package/dist/classes/admin/orders/GetProduct.d.ts +0 -10
  33. package/dist/classes/admin/orders/GetProduct.js +0 -80
  34. package/dist/classes/admin/orders-v2/GetOrder.d.ts +0 -10
  35. package/dist/classes/admin/orders-v2/GetOrder.js +0 -52
  36. package/dist/classes/admin/orders-v2/SearchOrders.d.ts +0 -14
  37. package/dist/classes/admin/orders-v2/SearchOrders.js +0 -50
  38. package/dist/classes/admin/orders-v2/index.d.ts +0 -13
  39. package/dist/classes/admin/orders-v2/index.js +0 -34
  40. package/dist/classes/admin/pages/SearchPages.d.ts +0 -11
  41. package/dist/classes/admin/pages/SearchPages.js +0 -24
  42. package/dist/classes/admin/pages/index.d.ts +0 -10
  43. package/dist/classes/admin/pages/index.js +0 -28
  44. package/dist/classes/admin/payments/GetMenu.d.ts +0 -23
  45. package/dist/classes/admin/payments/GetMenu.js +0 -58
  46. package/dist/classes/admin/payments/SearchMenus.d.ts +0 -13
  47. package/dist/classes/admin/payments/SearchMenus.js +0 -47
  48. package/dist/classes/admin/products/CreateVariant.d.ts +0 -12
  49. package/dist/classes/admin/products/CreateVariant.js +0 -56
  50. package/dist/classes/admin/products/GetProductPublications.d.ts +0 -10
  51. package/dist/classes/admin/products/GetProductPublications.js +0 -104
  52. package/dist/classes/admin/products-v2/UpdateVariant.d.ts +0 -15
  53. package/dist/classes/admin/products-v2/UpdateVariant.js +0 -54
  54. package/dist/classes/admin/shop/GetPolicyPage.d.ts +0 -10
  55. package/dist/classes/admin/shop/GetPolicyPage.js +0 -47
  56. package/dist/classes/rest/orders/SearchOrderItems.d.ts +0 -12
  57. package/dist/classes/rest/orders/SearchOrderItems.js +0 -29
  58. package/dist/classes/rest/orders/SearchOrders.d.ts +0 -14
  59. package/dist/classes/rest/orders/SearchOrders.js +0 -49
  60. package/dist/classes/rest/orders/orders/GetOrder.d.ts +0 -10
  61. package/dist/classes/rest/orders/orders/GetOrder.js +0 -52
  62. package/dist/classes/rest/orders/orders/SearchOrders.d.ts +0 -14
  63. package/dist/classes/rest/orders/orders/SearchOrders.js +0 -49
  64. package/dist/classes/rest/orders/orders/index.d.ts +0 -13
  65. package/dist/classes/rest/orders/orders/index.js +0 -34
  66. package/dist/classes/rest/products/GetOrder.d.ts +0 -12
  67. package/dist/classes/rest/products/GetOrder.js +0 -29
  68. package/dist/classes/rest/products/index.d.ts +0 -10
  69. package/dist/classes/rest/products/index.js +0 -28
  70. package/dist/classes/storefront/cart/GetPage.d.ts +0 -10
  71. package/dist/classes/storefront/cart/GetPage.js +0 -43
  72. package/dist/classes/storefront/posts/GetProduct.d.ts +0 -10
  73. package/dist/classes/storefront/posts/GetProduct.js +0 -94
  74. package/dist/classes/storefront/products/SearchProducts.d.ts +0 -12
  75. package/dist/classes/storefront/products/SearchProducts.js +0 -47
  76. package/dist/utils/parseCleanId.d.ts +0 -0
  77. package/dist/utils/parseCleanId.js +0 -1
  78. package/dist/utils.d.ts +0 -0
  79. package/dist/utils.js +0 -1
@@ -1,104 +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
- 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
- descriptionHtml
37
- priceRangeV2 {
38
- maxVariantPrice {
39
- amount
40
- currencyCode
41
- }
42
- minVariantPrice {
43
- amount
44
- currencyCode
45
- }
46
- }
47
- tags
48
- productCategory {
49
- productTaxonomyNode {
50
- fullName
51
- name
52
- }
53
- }
54
- collections(first: 100) {
55
- nodes {
56
- id
57
- }
58
- }
59
- options {
60
- values
61
- name
62
- }
63
- metafields(first: 100) {
64
- nodes {
65
- key
66
- value
67
- type
68
- }
69
- }
70
- images(first: 20) {
71
- nodes {
72
- id
73
- url(transform: {maxWidth: 1000, crop: CENTER, preferredContentType: WEBP})
74
- height
75
- altText
76
- width
77
- }
78
- }
79
- variants(first: 250) {
80
- nodes {
81
- id
82
- availableForSale
83
- selectedOptions {
84
- name
85
- value
86
- }
87
- price
88
- compareAtPrice
89
- image {
90
- id
91
- }
92
- }
93
- }
94
- }
95
- }
96
- `;
97
- const { data } = yield this.client.request(query);
98
- console.log('data', data);
99
- const { product } = Object.assign({}, data);
100
- return Object.assign({}, product);
101
- });
102
- }
103
- }
104
- exports.GetProduct = GetProduct;
@@ -1,15 +0,0 @@
1
- import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/graphql/types";
2
- import { ActionBuilder } from "../../ActionBuilder";
3
- import { InventoryItemInput } from "../../../input/InventoryItemInput";
4
- export interface UpdateVariantInput extends Record<string, any> {
5
- id: string;
6
- compareAtPrice?: string;
7
- price?: string;
8
- inventoryItem?: InventoryItemInput;
9
- }
10
- export interface UpdateVariantOutput extends Record<string, any> {
11
- id: string;
12
- }
13
- export declare class UpdateVariant extends ActionBuilder<AdminApiClient, UpdateVariantInput, UpdateVariantOutput> {
14
- run(args: UpdateVariantInput): Promise<UpdateVariantOutput>;
15
- }
@@ -1,54 +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.UpdateVariant = void 0;
13
- const ActionBuilder_1 = require("../../ActionBuilder");
14
- const getGlobalID_1 = require("../../../utils/getGlobalID");
15
- const handleErrors_1 = require("../../../utils/handleErrors");
16
- class UpdateVariant 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, 'ProductVariant');
21
- const vArgs = Object.assign({}, args, { id: globalId });
22
- const query = `
23
- mutation productVariantUpdate($input: ProductVariantInput!) {
24
- productVariantUpdate(input: $input) {
25
- productVariant {
26
- id
27
- productId
28
- compareAtPrice
29
- price
30
- mediaId
31
- options
32
- position
33
- taxable
34
- }
35
- userErrors {
36
- message
37
- field
38
- }
39
- }
40
- }
41
- `;
42
- const { data, errors } = yield this.client.request(query, {
43
- variables: {
44
- input: vArgs
45
- }
46
- });
47
- yield (0, handleErrors_1.handleErrors)(errors);
48
- const { productVariantUpdate } = Object.assign({}, data);
49
- const { productVariant } = Object.assign({}, productVariantUpdate);
50
- return Object.assign({}, productVariant);
51
- });
52
- }
53
- }
54
- exports.UpdateVariant = UpdateVariant;
@@ -1,10 +0,0 @@
1
- import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
2
- import { ActionBuilder } from "../../ActionBuilder";
3
- export interface GetPolicyPageInput extends Record<string, any> {
4
- handle: string;
5
- }
6
- export interface GetPolicyPageOutput extends Record<string, any> {
7
- }
8
- export declare class GetPolicyPage extends ActionBuilder<AdminApiClient, GetPolicyPageInput, GetPolicyPageOutput> {
9
- run(args: GetPolicyPageInput): Promise<GetPolicyPageOutput>;
10
- }
@@ -1,47 +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.GetPolicyPage = void 0;
13
- const ActionBuilder_1 = require("../../ActionBuilder");
14
- const mapPages = {
15
- 'privacy-policy': 'privacyPolicy',
16
- 'terms-of-service': 'termsOfService',
17
- 'refund-policy': 'refundPolicy',
18
- 'shipping-policy': 'shippingPolicy',
19
- };
20
- class GetPolicyPage extends ActionBuilder_1.ActionBuilder {
21
- run(args) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const { handle } = args;
24
- const vHandle = (handle || '').toLowerCase().trim();
25
- const page = mapPages[vHandle];
26
- if (!page) {
27
- throw new Error(`Invalid page handle: ${handle}`);
28
- }
29
- const query = `
30
- {
31
- shop {
32
- ${page} {
33
- body
34
- title
35
- }
36
- }
37
- }
38
- `;
39
- const { data, errors } = yield this.client.request(query);
40
- console.log('data', data);
41
- console.log('data', errors);
42
- const { shop } = Object.assign({}, data);
43
- return Object.assign({}, shop);
44
- });
45
- }
46
- }
47
- exports.GetPolicyPage = GetPolicyPage;
@@ -1,12 +0,0 @@
1
- import { ActionBuilder } from "../../ActionBuilder";
2
- import { AxiosInstance } from "axios";
3
- export interface SearchOrderItemsInput extends Record<string, any> {
4
- id: string;
5
- }
6
- export interface SearchOrderItemsOutput extends Record<string, any> {
7
- id: number;
8
- order_status_url: string;
9
- }
10
- export declare class GetOrder extends ActionBuilder<AxiosInstance, SearchOrderItemsInput, SearchOrderItemsOutput> {
11
- run(args: SearchOrderItemsInput): Promise<SearchOrderItemsOutput>;
12
- }
@@ -1,29 +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 parseOnlyId_1 = require("../../../utils/parseOnlyId");
15
- class GetOrder extends ActionBuilder_1.ActionBuilder {
16
- run(args) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const { id } = args;
19
- const cleanId = (0, parseOnlyId_1.parseOnlyId)(id);
20
- const { data } = yield this.client({
21
- url: `orders/${cleanId}.json`,
22
- method: 'GET'
23
- });
24
- const { order } = Object.assign({}, data);
25
- return Object.assign({}, order);
26
- });
27
- }
28
- }
29
- exports.GetOrder = GetOrder;
@@ -1,14 +0,0 @@
1
- import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
2
- import { ActionBuilder } from "../../ActionBuilder";
3
- import { PageInfo } from "../../../interfaces/PageInfo";
4
- export interface SearchOrdersInput extends Record<string, any> {
5
- after?: string;
6
- limit?: number;
7
- }
8
- export interface SearchOrdersOutput extends Record<string, any> {
9
- items: any[];
10
- pageInfo: PageInfo;
11
- }
12
- export declare class SearchOrders extends ActionBuilder<AdminApiClient, SearchOrdersInput, SearchOrdersOutput> {
13
- run(args?: SearchOrdersInput): Promise<SearchOrdersOutput>;
14
- }
@@ -1,49 +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.SearchOrders = void 0;
13
- const ActionBuilder_1 = require("../../ActionBuilder");
14
- const handleErrors_1 = require("../../../utils/handleErrors");
15
- class SearchOrders extends ActionBuilder_1.ActionBuilder {
16
- run(args) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const { after, limit } = Object.assign({}, args);
19
- const vLimit = !!limit ? parseInt(limit + '', 10) : 10;
20
- const query = `
21
- {
22
- orders(
23
- first: ${vLimit},
24
- reverse: true,
25
- ${after ? `after: "${after}"` : ''}
26
- ) {
27
- nodes {
28
- id
29
- }
30
- pageInfo {
31
- hasNextPage
32
- endCursor
33
- }
34
- }
35
- }
36
- `;
37
- const { data, errors, extensions } = yield this.client.request(query);
38
- yield (0, handleErrors_1.handleErrors)(errors);
39
- const { orders } = Object.assign({}, data);
40
- const { nodes, pageInfo } = Object.assign({}, orders);
41
- const items = Array.isArray(nodes) ? nodes : [];
42
- return {
43
- items,
44
- pageInfo
45
- };
46
- });
47
- }
48
- }
49
- exports.SearchOrders = SearchOrders;
@@ -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,14 +0,0 @@
1
- import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
2
- import { ActionBuilder } from "../../ActionBuilder";
3
- import { PageInfo } from "../../../interfaces/PageInfo";
4
- export interface SearchOrdersInput extends Record<string, any> {
5
- after?: string;
6
- limit?: number;
7
- }
8
- export interface SearchOrdersOutput extends Record<string, any> {
9
- items: any[];
10
- pageInfo: PageInfo;
11
- }
12
- export declare class SearchOrders extends ActionBuilder<AdminApiClient, SearchOrdersInput, SearchOrdersOutput> {
13
- run(args?: SearchOrdersInput): Promise<SearchOrdersOutput>;
14
- }
@@ -1,49 +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.SearchOrders = void 0;
13
- const ActionBuilder_1 = require("../../ActionBuilder");
14
- const handleErrors_1 = require("../../../utils/handleErrors");
15
- class SearchOrders extends ActionBuilder_1.ActionBuilder {
16
- run(args) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const { after, limit } = Object.assign({}, args);
19
- const vLimit = !!limit ? parseInt(limit + '', 10) : 10;
20
- const query = `
21
- {
22
- orders(
23
- first: ${vLimit},
24
- reverse: true,
25
- ${after ? `after: "${after}"` : ''}
26
- ) {
27
- nodes {
28
- id
29
- }
30
- pageInfo {
31
- hasNextPage
32
- endCursor
33
- }
34
- }
35
- }
36
- `;
37
- const { data, errors, extensions } = yield this.client.request(query);
38
- yield (0, handleErrors_1.handleErrors)(errors);
39
- const { orders } = Object.assign({}, data);
40
- const { nodes, pageInfo } = Object.assign({}, orders);
41
- const items = Array.isArray(nodes) ? nodes : [];
42
- return {
43
- items,
44
- pageInfo
45
- };
46
- });
47
- }
48
- }
49
- exports.SearchOrders = SearchOrders;
@@ -1,13 +0,0 @@
1
- import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
2
- import { APIBase } from "../../APIBase";
3
- import { SearchOrdersInput, SearchOrdersOutput } from "./SearchOrders";
4
- import { GetOrderInput, GetOrderOutput } from "./GetOrder";
5
- export interface AdminOrderAPIInterface {
6
- search(args?: SearchOrdersInput): Promise<SearchOrdersOutput>;
7
- get(args: GetOrderInput): Promise<GetOrderOutput>;
8
- }
9
- export declare class AdminOrderAPI extends APIBase<AdminApiClient> implements AdminOrderAPIInterface {
10
- private _runAction;
11
- search(args?: SearchOrdersInput): Promise<SearchOrdersOutput>;
12
- get(args?: GetOrderInput): Promise<GetOrderOutput>;
13
- }
@@ -1,34 +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.AdminOrderAPI = void 0;
13
- const APIBase_1 = require("../../APIBase");
14
- const SearchOrders_1 = require("./SearchOrders");
15
- const GetOrder_1 = require("./GetOrder");
16
- class AdminOrderAPI extends APIBase_1.APIBase {
17
- _runAction(Action, args) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- const action = new Action(this.client);
20
- return action.run(args);
21
- });
22
- }
23
- search(args) {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- return this._runAction(SearchOrders_1.SearchOrders, args);
26
- });
27
- }
28
- get(args) {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- return this._runAction(GetOrder_1.GetOrder, args);
31
- });
32
- }
33
- }
34
- exports.AdminOrderAPI = AdminOrderAPI;
@@ -1,12 +0,0 @@
1
- import { ActionBuilder } from "../../ActionBuilder";
2
- import { AxiosInstance } from "axios";
3
- export interface GetOrderInput extends Record<string, any> {
4
- id: string;
5
- }
6
- export interface GetOrderOutput extends Record<string, any> {
7
- id: number;
8
- order_status_url: string;
9
- }
10
- export declare class GetOrder extends ActionBuilder<AxiosInstance, GetOrderInput, GetOrderOutput> {
11
- run(args: GetOrderInput): Promise<GetOrderOutput>;
12
- }
@@ -1,29 +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 parseOnlyId_1 = require("../../../utils/parseOnlyId");
15
- class GetOrder extends ActionBuilder_1.ActionBuilder {
16
- run(args) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const { id } = args;
19
- const cleanId = (0, parseOnlyId_1.parseOnlyId)(id);
20
- const { data } = yield this.client({
21
- url: `orders/${cleanId}.json`,
22
- method: 'GET'
23
- });
24
- const { order } = Object.assign({}, data);
25
- return Object.assign({}, order);
26
- });
27
- }
28
- }
29
- exports.GetOrder = GetOrder;
@@ -1,10 +0,0 @@
1
- import { APIBase } from "../../APIBase";
2
- import { GetOrderInput, GetOrderOutput } from "./GetOrder";
3
- import { AxiosInstance } from "axios";
4
- export interface RestOrderAPIInterface {
5
- get(args: GetOrderInput): Promise<GetOrderOutput>;
6
- }
7
- export declare class RestOrderAPI extends APIBase<AxiosInstance> implements RestOrderAPIInterface {
8
- private _runAction;
9
- get(args?: GetOrderInput): Promise<GetOrderOutput>;
10
- }
@@ -1,28 +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.RestOrderAPI = void 0;
13
- const APIBase_1 = require("../../APIBase");
14
- const GetOrder_1 = require("./GetOrder");
15
- class RestOrderAPI extends APIBase_1.APIBase {
16
- _runAction(Action, args) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const action = new Action(this.client);
19
- return action.run(args);
20
- });
21
- }
22
- get(args) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- return this._runAction(GetOrder_1.GetOrder, args);
25
- });
26
- }
27
- }
28
- exports.RestOrderAPI = RestOrderAPI;
@@ -1,10 +0,0 @@
1
- import { ActionBuilder } from "../../ActionBuilder";
2
- import { StorefrontApiClient } from "@shopify/storefront-api-client/dist/ts/types";
3
- export interface GetPageInput extends Record<string, any> {
4
- id: string;
5
- }
6
- export interface GetPageOutput extends Record<string, any> {
7
- }
8
- export declare class GetPage extends ActionBuilder<StorefrontApiClient, GetPageInput, GetPageOutput> {
9
- run(args: GetPageInput): Promise<GetPageOutput>;
10
- }
@@ -1,43 +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.GetPage = void 0;
13
- const ActionBuilder_1 = require("../../ActionBuilder");
14
- const getGlobalID_1 = require("../../../utils/getGlobalID");
15
- class GetPage extends ActionBuilder_1.ActionBuilder {
16
- run(args) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const query = `
19
- query ($id: ID){
20
- page(id: $id) {
21
- body
22
- handle
23
- id
24
- title
25
- onlineStoreUrl
26
- bodySummary
27
- updatedAt
28
- }
29
- }
30
- `;
31
- const { id } = args;
32
- const globalId = (0, getGlobalID_1.getGlobalID)(id);
33
- const { data } = yield this.client.request(query, {
34
- variables: {
35
- id: globalId
36
- }
37
- });
38
- const { page } = Object.assign({}, data);
39
- return Object.assign({}, page);
40
- });
41
- }
42
- }
43
- exports.GetPage = GetPage;