@haatlabs-core/provider-shopify 0.11.3 → 0.12.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.
package/README.md CHANGED
@@ -10,6 +10,8 @@ loopback or link-local address is refused before anything is sent to it.
10
10
  the store's currency; a search names its store (`store`).
11
11
  - `@haatlabs-core/provider-shopify/refs`: `shopifyRef`, `parseShopifyRefId`, `parseShopifyLink`,
12
12
  with no Node built-ins, for browsers too.
13
+ - `@haatlabs-core/provider-shopify/contracts` (0.12.1): `PROVIDER_SHOPIFY_ERRORS` and the refs above,
14
+ with nothing of Node, for a project's contracts.
13
15
  - `@haatlabs-core/provider-shopify/testing`: `startFakeShopifyStore()`, a store on 127.0.0.1 for
14
16
  tests that read through the real source.
15
17
 
@@ -0,0 +1,2 @@
1
+ export * from './errors.js';
2
+ export * from './refs.js';
@@ -0,0 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var contracts_exports = {};
16
+ module.exports = __toCommonJS(contracts_exports);
17
+ __reExport(contracts_exports, require("./errors.js"), module.exports);
18
+ __reExport(contracts_exports, require("./refs.js"), module.exports);
19
+ // Annotate the CommonJS export names for ESM import in node:
20
+ 0 && (module.exports = {
21
+ ...require("./errors.js"),
22
+ ...require("./refs.js")
23
+ });
@@ -24,9 +24,9 @@ __export(errors_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(errors_exports);
26
26
  var import_errors = require("@haatlabs-core/errors");
27
- var import_provider_amazon = require("@haatlabs-core/provider-amazon");
27
+ var import_contracts = require("@haatlabs-core/provider-amazon/contracts");
28
28
  const PROVIDER_SHOPIFY_ERRORS = {
29
- ...import_provider_amazon.PROVIDER_AMAZON_ERRORS,
29
+ ...import_contracts.PROVIDER_AMAZON_ERRORS,
30
30
  // The site answers, but not with a Shopify catalogue (not Shopify, password page, headless).
31
31
  SOURCE_NOT_SHOPIFY: { httpStatus: 404, transient: false }
32
32
  };
@@ -1,4 +1,4 @@
1
- import type { ProductRef } from '@haatlabs-core/provider-amazon';
1
+ import type { ProductRef } from '@haatlabs-core/provider-amazon/contracts';
2
2
  export declare const SHOPIFY_SOURCE_ID = "shopify";
3
3
  /** Shopify has no markets: every store is one place, named in the product id. */
4
4
  export declare const SHOPIFY_MARKET = "WORLD";
@@ -0,0 +1,2 @@
1
+ export * from './errors.js';
2
+ export * from './refs.js';
@@ -0,0 +1,7 @@
1
+ // What a project's contracts, which its browser code also loads, may take from this package:
2
+ // its error codes and its product references.
3
+ // Nothing here loads a Node built-in or a server client: scripts/check-browser.mjs bundles
4
+ // it for a browser and runs it.
5
+ export * from './errors.js';
6
+ export * from './refs.js';
7
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,8CAA8C;AAC9C,2FAA2F;AAC3F,gCAAgC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
package/dist/errors.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { domainErrors } from '@haatlabs-core/errors';
2
- import { PROVIDER_AMAZON_ERRORS } from '@haatlabs-core/provider-amazon';
2
+ import { PROVIDER_AMAZON_ERRORS } from '@haatlabs-core/provider-amazon/contracts';
3
3
  /** The codes this package throws: the sources' shared ones, and one of Shopify's own. */
4
4
  export const PROVIDER_SHOPIFY_ERRORS = {
5
5
  ...PROVIDER_AMAZON_ERRORS,
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,yFAAyF;AACzF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,GAAG,sBAAsB;IACzB,6FAA6F;IAC7F,kBAAkB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE;CACjD,CAAC;AAEX,MAAM,OAAO,GAAG,YAAY,CAAC,uBAAuB,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC,KAAK,CAAC;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;AAGvD,MAAM,CAAC,MAAM,WAAW,GACtB,yEAAyE,CAAC"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,yFAAyF;AACzF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,GAAG,sBAAsB;IACzB,6FAA6F;IAC7F,kBAAkB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE;CACjD,CAAC;AAEX,MAAM,OAAO,GAAG,YAAY,CAAC,uBAAuB,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC,KAAK,CAAC;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;AAGvD,MAAM,CAAC,MAAM,WAAW,GACtB,yEAAyE,CAAC"}
package/dist/refs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ProductRef } from '@haatlabs-core/provider-amazon';
1
+ import type { ProductRef } from '@haatlabs-core/provider-amazon/contracts';
2
2
  export declare const SHOPIFY_SOURCE_ID = "shopify";
3
3
  /** Shopify has no markets: every store is one place, named in the product id. */
4
4
  export declare const SHOPIFY_MARKET = "WORLD";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haatlabs-core/provider-shopify",
3
- "version": "0.11.3",
3
+ "version": "0.12.1",
4
4
  "description": "Any Shopify store's public products as a ProductSource.",
5
5
  "keywords": [
6
6
  "haatlabs",
@@ -35,6 +35,16 @@
35
35
  "default": "./dist/cjs/index.js"
36
36
  }
37
37
  },
38
+ "./contracts": {
39
+ "import": {
40
+ "types": "./dist/contracts.d.ts",
41
+ "default": "./dist/contracts.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/cjs/contracts.d.ts",
45
+ "default": "./dist/cjs/contracts.js"
46
+ }
47
+ },
38
48
  "./refs": {
39
49
  "import": {
40
50
  "types": "./dist/refs.d.ts",
@@ -66,18 +76,24 @@
66
76
  }
67
77
  }
68
78
  },
79
+ "haatlabs": {
80
+ "browser": [
81
+ "./contracts",
82
+ "./refs"
83
+ ]
84
+ },
69
85
  "dependencies": {
70
- "@haatlabs-core/errors": "0.11.3",
71
- "@haatlabs-core/provider-amazon": "0.11.3",
72
- "@haatlabs-core/providers": "0.11.3"
86
+ "@haatlabs-core/errors": "0.12.1",
87
+ "@haatlabs-core/providers": "0.12.1",
88
+ "@haatlabs-core/provider-amazon": "0.12.1"
73
89
  },
74
90
  "peerDependencies": {
75
91
  "zod": "^4.6.5"
76
92
  },
77
93
  "devDependencies": {
78
94
  "zod": "^4.6.5",
79
- "@haatlabs-core/tsconfig": "0.11.3",
80
- "@haatlabs-core/vitest-config": "0.11.3"
95
+ "@haatlabs-core/vitest-config": "0.12.1",
96
+ "@haatlabs-core/tsconfig": "0.12.1"
81
97
  },
82
98
  "scripts": {
83
99
  "build": "rm -rf dist && tsc -p tsconfig.build.json && node ../../scripts/build-cjs.mjs",