@haatlabs-core/shopify 0.29.2 → 0.30.1

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.
@@ -15,6 +15,7 @@ export * from './product-shape.js';
15
15
  export * from './product-create.js';
16
16
  export * from './product-basics.js';
17
17
  export * from './billing.js';
18
+ export * from './shop.js';
18
19
  export * from './store-tokens.js';
19
20
  export * from './top-level-id.js';
20
21
  export { DEFAULT_RESERVE_SHARE, MAX_THROTTLE_WAIT_MS, createProcessShopifyThrottle, nextShopifyStart, processShopifyThrottle, } from './throttle.js';
package/dist/cjs/index.js CHANGED
@@ -42,6 +42,7 @@ __reExport(index_exports, require("./product-shape.js"), module.exports);
42
42
  __reExport(index_exports, require("./product-create.js"), module.exports);
43
43
  __reExport(index_exports, require("./product-basics.js"), module.exports);
44
44
  __reExport(index_exports, require("./billing.js"), module.exports);
45
+ __reExport(index_exports, require("./shop.js"), module.exports);
45
46
  __reExport(index_exports, require("./store-tokens.js"), module.exports);
46
47
  __reExport(index_exports, require("./top-level-id.js"), module.exports);
47
48
  var import_throttle = require("./throttle.js");
@@ -69,6 +70,7 @@ var import_throttle = require("./throttle.js");
69
70
  ...require("./product-create.js"),
70
71
  ...require("./product-basics.js"),
71
72
  ...require("./billing.js"),
73
+ ...require("./shop.js"),
72
74
  ...require("./store-tokens.js"),
73
75
  ...require("./top-level-id.js")
74
76
  });
@@ -0,0 +1,3 @@
1
+ import type { GraphQLRequester } from './types.js';
2
+ /** The shop's billing country (ISO alpha-2), as Shopify has it; null without one. */
3
+ export declare function shopCountry(client: GraphQLRequester): Promise<string | null>;
@@ -0,0 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var shop_exports = {};
19
+ __export(shop_exports, {
20
+ shopCountry: () => shopCountry
21
+ });
22
+ module.exports = __toCommonJS(shop_exports);
23
+ const SHOP_COUNTRY_QUERY = `query ShopCountry { shop { billingAddress { countryCodeV2 } } }`;
24
+ async function shopCountry(client) {
25
+ const result = await client.request(SHOP_COUNTRY_QUERY);
26
+ const code = result.shop?.billingAddress?.countryCodeV2;
27
+ return typeof code === "string" && code.length === 2 ? code : null;
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ shopCountry
32
+ });
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './product-shape.js';
15
15
  export * from './product-create.js';
16
16
  export * from './product-basics.js';
17
17
  export * from './billing.js';
18
+ export * from './shop.js';
18
19
  export * from './store-tokens.js';
19
20
  export * from './top-level-id.js';
20
21
  export { DEFAULT_RESERVE_SHARE, MAX_THROTTLE_WAIT_MS, createProcessShopifyThrottle, nextShopifyStart, processShopifyThrottle, } from './throttle.js';
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ export * from './product-shape.js';
15
15
  export * from './product-create.js';
16
16
  export * from './product-basics.js';
17
17
  export * from './billing.js';
18
+ export * from './shop.js';
18
19
  export * from './store-tokens.js';
19
20
  export * from './top-level-id.js';
20
21
  export { DEFAULT_RESERVE_SHARE, MAX_THROTTLE_WAIT_MS, createProcessShopifyThrottle, nextShopifyStart, processShopifyThrottle, } from './throttle.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,eAAe,CAAC"}
package/dist/shop.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { GraphQLRequester } from './types.js';
2
+ /** The shop's billing country (ISO alpha-2), as Shopify has it; null without one. */
3
+ export declare function shopCountry(client: GraphQLRequester): Promise<string | null>;
package/dist/shop.js ADDED
@@ -0,0 +1,8 @@
1
+ const SHOP_COUNTRY_QUERY = `query ShopCountry { shop { billingAddress { countryCodeV2 } } }`;
2
+ /** The shop's billing country (ISO alpha-2), as Shopify has it; null without one. */
3
+ export async function shopCountry(client) {
4
+ const result = await client.request(SHOP_COUNTRY_QUERY);
5
+ const code = result.shop?.billingAddress?.countryCodeV2;
6
+ return typeof code === 'string' && code.length === 2 ? code : null;
7
+ }
8
+ //# sourceMappingURL=shop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shop.js","sourceRoot":"","sources":["../src/shop.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,iEAAiE,CAAC;AAE7F,qFAAqF;AACrF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAwB;IACxD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAEhC,kBAAkB,CAAC,CAAC;IACvB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,cAAc,EAAE,aAAa,CAAC;IACxD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haatlabs-core/shopify",
3
- "version": "0.29.2",
3
+ "version": "0.30.1",
4
4
  "description": "Shopify for Node apps: OAuth, session tokens, the Admin GraphQL client, products, webhooks and billing.",
5
5
  "keywords": [
6
6
  "haatlabs",
@@ -73,7 +73,7 @@
73
73
  ]
74
74
  },
75
75
  "dependencies": {
76
- "@haatlabs-core/errors": "0.29.2"
76
+ "@haatlabs-core/errors": "0.30.1"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@nestjs/common": "12.1.2",
@@ -83,8 +83,8 @@
83
83
  "jose": "^6.2.12",
84
84
  "reflect-metadata": "^0.2.2",
85
85
  "rxjs": "^7.8.2",
86
- "@haatlabs-core/tsconfig": "0.29.2",
87
- "@haatlabs-core/vitest-config": "0.29.2"
86
+ "@haatlabs-core/tsconfig": "0.30.1",
87
+ "@haatlabs-core/vitest-config": "0.30.1"
88
88
  },
89
89
  "scripts": {
90
90
  "build": "rm -rf dist && tsc -p tsconfig.build.json && node ../../scripts/build-cjs.mjs",