@pintahub/shopify-api 2.5.4 → 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.
Files changed (72) hide show
  1. package/dist/classes/AdminAPI.js +2 -2
  2. package/dist/classes/admin/metaobjects/GetListFAQs.js +1 -1
  3. package/dist/classes/admin/metaobjects/faqs/_parseFAQs.js +1 -1
  4. package/dist/fragments/cart.d.ts +1 -1
  5. package/dist/fragments/cart.js +1 -0
  6. package/dist/input/MediaContentType.js +1 -1
  7. package/dist/input/WeightUnit.js +1 -1
  8. package/package.json +2 -2
  9. package/dist/actions/admin/GetProduct.d.ts +0 -10
  10. package/dist/actions/admin/GetProduct.js +0 -74
  11. package/dist/actions/admin/SearchProducts.d.ts +0 -12
  12. package/dist/actions/admin/SearchProducts.js +0 -45
  13. package/dist/actions/admin/products/GetProduct.d.ts +0 -10
  14. package/dist/actions/admin/products/GetProduct.js +0 -74
  15. package/dist/actions/admin/products/SearchProducts.d.ts +0 -12
  16. package/dist/actions/admin/products/SearchProducts.js +0 -45
  17. package/dist/actions/storefront/getProductByHandle.d.ts +0 -11
  18. package/dist/actions/storefront/getProductByHandle.js +0 -39
  19. package/dist/classes/ActionBase.d.ts +0 -2
  20. package/dist/classes/ActionBase.js +0 -6
  21. package/dist/classes/ShopifyAPI.d.ts +0 -3
  22. package/dist/classes/ShopifyAPI.js +0 -8
  23. package/dist/classes/admin/files/GetOrder.d.ts +0 -10
  24. package/dist/classes/admin/files/GetOrder.js +0 -52
  25. package/dist/classes/admin/orders/GetProduct.d.ts +0 -10
  26. package/dist/classes/admin/orders/GetProduct.js +0 -80
  27. package/dist/classes/admin/orders-v2/GetOrder.d.ts +0 -10
  28. package/dist/classes/admin/orders-v2/GetOrder.js +0 -52
  29. package/dist/classes/admin/orders-v2/SearchOrders.d.ts +0 -14
  30. package/dist/classes/admin/orders-v2/SearchOrders.js +0 -50
  31. package/dist/classes/admin/orders-v2/index.d.ts +0 -13
  32. package/dist/classes/admin/orders-v2/index.js +0 -34
  33. package/dist/classes/admin/pages/SearchPages.d.ts +0 -11
  34. package/dist/classes/admin/pages/SearchPages.js +0 -24
  35. package/dist/classes/admin/pages/index.d.ts +0 -10
  36. package/dist/classes/admin/pages/index.js +0 -28
  37. package/dist/classes/admin/payments/GetMenu.d.ts +0 -23
  38. package/dist/classes/admin/payments/GetMenu.js +0 -58
  39. package/dist/classes/admin/payments/SearchMenus.d.ts +0 -13
  40. package/dist/classes/admin/payments/SearchMenus.js +0 -47
  41. package/dist/classes/admin/products/CreateVariant.d.ts +0 -12
  42. package/dist/classes/admin/products/CreateVariant.js +0 -56
  43. package/dist/classes/admin/products/GetProductPublications.d.ts +0 -10
  44. package/dist/classes/admin/products/GetProductPublications.js +0 -104
  45. package/dist/classes/admin/products-v2/UpdateVariant.d.ts +0 -15
  46. package/dist/classes/admin/products-v2/UpdateVariant.js +0 -54
  47. package/dist/classes/admin/shop/GetPolicyPage.d.ts +0 -10
  48. package/dist/classes/admin/shop/GetPolicyPage.js +0 -47
  49. package/dist/classes/rest/orders/SearchOrderItems.d.ts +0 -12
  50. package/dist/classes/rest/orders/SearchOrderItems.js +0 -29
  51. package/dist/classes/rest/orders/SearchOrders.d.ts +0 -14
  52. package/dist/classes/rest/orders/SearchOrders.js +0 -49
  53. package/dist/classes/rest/orders/orders/GetOrder.d.ts +0 -10
  54. package/dist/classes/rest/orders/orders/GetOrder.js +0 -52
  55. package/dist/classes/rest/orders/orders/SearchOrders.d.ts +0 -14
  56. package/dist/classes/rest/orders/orders/SearchOrders.js +0 -49
  57. package/dist/classes/rest/orders/orders/index.d.ts +0 -13
  58. package/dist/classes/rest/orders/orders/index.js +0 -34
  59. package/dist/classes/rest/products/GetOrder.d.ts +0 -12
  60. package/dist/classes/rest/products/GetOrder.js +0 -29
  61. package/dist/classes/rest/products/index.d.ts +0 -10
  62. package/dist/classes/rest/products/index.js +0 -28
  63. package/dist/classes/storefront/cart/GetPage.d.ts +0 -10
  64. package/dist/classes/storefront/cart/GetPage.js +0 -43
  65. package/dist/classes/storefront/posts/GetProduct.d.ts +0 -10
  66. package/dist/classes/storefront/posts/GetProduct.js +0 -94
  67. package/dist/classes/storefront/products/SearchProducts.d.ts +0 -12
  68. package/dist/classes/storefront/products/SearchProducts.js +0 -47
  69. package/dist/utils/parseCleanId.d.ts +0 -0
  70. package/dist/utils/parseCleanId.js +0 -1
  71. package/dist/utils.d.ts +0 -0
  72. package/dist/utils.js +0 -1
@@ -23,10 +23,10 @@ class AdminAPI {
23
23
  this.product = new products_1.AdminProductAPI(this.client);
24
24
  this.order = new orders_1.AdminOrderAPI(this.client);
25
25
  }
26
- this.menus = new menus_1.AdminMenuAPI(this._createClient('2025-01'));
26
+ this.menus = new menus_1.AdminMenuAPI(this._createClient('2026-01'));
27
27
  this.products = new products_v2_1.AdminProductsAPI(this._createClient('2025-01'));
28
28
  this.customers = new customers_1.AdminCustomersAPI(this._createClient('2026-01'));
29
- this.collections = new collections_v2_1.AdminCollectionAPI(this._createClient('2025-01'));
29
+ this.collections = new collections_v2_1.AdminCollectionAPI(this._createClient('2026-01'));
30
30
  this.files = new files_1.AdminFileAPI(this._createClient('2025-01'));
31
31
  this.metaobject = new metaobjects_1.AdminMetaObjectAPI(this._createClient('2026-01'));
32
32
  this.metaobjects = new metaobjects_1.AdminMetaObjectAPI(this._createClient('2026-01'));
@@ -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 = (pages = []) => __awaiter(void 0, void 0, void 0, function* () {
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* () {
@@ -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";
@@ -39,6 +39,7 @@ fragment cart on Cart {
39
39
  currencyCode
40
40
  }
41
41
  image {
42
+ id
42
43
  url(transform: {maxWidth: 300})
43
44
  altText
44
45
  width
@@ -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 = exports.MediaContentType || (exports.MediaContentType = {}));
10
+ })(MediaContentType || (exports.MediaContentType = MediaContentType = {}));
@@ -7,4 +7,4 @@ var WeightUnit;
7
7
  WeightUnit["KILOGRAMS"] = "KILOGRAMS";
8
8
  WeightUnit["OUNCES"] = "OUNCES";
9
9
  WeightUnit["POUNDS"] = "POUNDS";
10
- })(WeightUnit = exports.WeightUnit || (exports.WeightUnit = {}));
10
+ })(WeightUnit || (exports.WeightUnit = WeightUnit = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pintahub/shopify-api",
3
- "version": "2.5.4",
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.10.4",
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,2 +0,0 @@
1
- export declare abstract class ActionBase {
2
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionBase = void 0;
4
- class ActionBase {
5
- }
6
- exports.ActionBase = ActionBase;
@@ -1,3 +0,0 @@
1
- export declare class ShopifyAPI {
2
- constructor();
3
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShopifyAPI = void 0;
4
- class ShopifyAPI {
5
- constructor() {
6
- }
7
- }
8
- exports.ShopifyAPI = ShopifyAPI;
@@ -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
- }