@haatlabs-core/provider-amazon 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 +5 -0
- package/dist/cjs/contracts.d.ts +6 -0
- package/dist/cjs/contracts.js +31 -0
- package/dist/cjs/source.d.ts +2 -2
- package/dist/contracts.d.ts +6 -0
- package/dist/contracts.js +11 -0
- package/dist/contracts.js.map +1 -0
- package/dist/source.d.ts +2 -2
- package/package.json +22 -7
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# @haatlabs-core/provider-amazon
|
|
2
2
|
|
|
3
|
+
**`@haatlabs-core/provider-amazon/contracts`** (0.12.1): the error codes
|
|
4
|
+
(`PROVIDER_AMAZON_ERRORS`), the sources' schemas and types (`ProductRefSchema`,
|
|
5
|
+
`SourceInfoSchema`, `ProductSource`...), the marketplaces and the link and text helpers:
|
|
6
|
+
everything but `createAmazonSource`, with nothing of Node. A project's contracts, which its pages load, import from here and never the root, which is for Node.
|
|
7
|
+
|
|
3
8
|
## Install
|
|
4
9
|
|
|
5
10
|
pnpm add @haatlabs-core/provider-amazon
|
|
@@ -0,0 +1,31 @@
|
|
|
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("./schemas.js"), module.exports);
|
|
19
|
+
__reExport(contracts_exports, require("./source.js"), module.exports);
|
|
20
|
+
__reExport(contracts_exports, require("./text.js"), module.exports);
|
|
21
|
+
__reExport(contracts_exports, require("./links.js"), module.exports);
|
|
22
|
+
__reExport(contracts_exports, require("./markets.js"), module.exports);
|
|
23
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
24
|
+
0 && (module.exports = {
|
|
25
|
+
...require("./errors.js"),
|
|
26
|
+
...require("./schemas.js"),
|
|
27
|
+
...require("./source.js"),
|
|
28
|
+
...require("./text.js"),
|
|
29
|
+
...require("./links.js"),
|
|
30
|
+
...require("./markets.js")
|
|
31
|
+
});
|
package/dist/cjs/source.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CallContext } from '@haatlabs-core/providers';
|
|
1
|
+
import type { CallContext } from '@haatlabs-core/providers/contracts';
|
|
2
2
|
import type { AutocompleteQuery, ProductRef, SearchPage, SearchQuery, SourceInfo, SourceProduct } from './schemas.js';
|
|
3
|
-
export type { CallContext } from '@haatlabs-core/providers';
|
|
3
|
+
export type { CallContext } from '@haatlabs-core/providers/contracts';
|
|
4
4
|
export interface SourceHealth {
|
|
5
5
|
healthy: boolean;
|
|
6
6
|
detail?: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// What a project's contracts, which its browser code also loads, may take from this package:
|
|
2
|
+
// its error codes, the sources' schemas and types, the marketplaces, and reading a link.
|
|
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 './schemas.js';
|
|
7
|
+
export * from './source.js';
|
|
8
|
+
export * from './text.js';
|
|
9
|
+
export * from './links.js';
|
|
10
|
+
export * from './markets.js';
|
|
11
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,yFAAyF;AACzF,2FAA2F;AAC3F,gCAAgC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
package/dist/source.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CallContext } from '@haatlabs-core/providers';
|
|
1
|
+
import type { CallContext } from '@haatlabs-core/providers/contracts';
|
|
2
2
|
import type { AutocompleteQuery, ProductRef, SearchPage, SearchQuery, SourceInfo, SourceProduct } from './schemas.js';
|
|
3
|
-
export type { CallContext } from '@haatlabs-core/providers';
|
|
3
|
+
export type { CallContext } from '@haatlabs-core/providers/contracts';
|
|
4
4
|
export interface SourceHealth {
|
|
5
5
|
healthy: boolean;
|
|
6
6
|
detail?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haatlabs-core/provider-amazon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Amazon search, products and suggestions 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
|
"./fixtures": {
|
|
39
49
|
"import": {
|
|
40
50
|
"types": "./dist/fixtures/index.d.ts",
|
|
@@ -56,10 +66,15 @@
|
|
|
56
66
|
}
|
|
57
67
|
}
|
|
58
68
|
},
|
|
69
|
+
"haatlabs": {
|
|
70
|
+
"browser": [
|
|
71
|
+
"./contracts"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
59
74
|
"dependencies": {
|
|
60
|
-
"@haatlabs-core/errors": "0.
|
|
61
|
-
"@haatlabs-core/providers": "0.
|
|
62
|
-
"@haatlabs-core/services": "0.
|
|
75
|
+
"@haatlabs-core/errors": "0.12.1",
|
|
76
|
+
"@haatlabs-core/providers": "0.12.1",
|
|
77
|
+
"@haatlabs-core/services": "0.12.1"
|
|
63
78
|
},
|
|
64
79
|
"peerDependencies": {
|
|
65
80
|
"zod": "^4.6.5"
|
|
@@ -67,9 +82,9 @@
|
|
|
67
82
|
"devDependencies": {
|
|
68
83
|
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
69
84
|
"zod": "^4.6.5",
|
|
70
|
-
"@haatlabs-core/observability": "0.
|
|
71
|
-
"@haatlabs-core/
|
|
72
|
-
"@haatlabs-core/
|
|
85
|
+
"@haatlabs-core/observability": "0.12.1",
|
|
86
|
+
"@haatlabs-core/tsconfig": "0.12.1",
|
|
87
|
+
"@haatlabs-core/vitest-config": "0.12.1"
|
|
73
88
|
},
|
|
74
89
|
"scripts": {
|
|
75
90
|
"build": "rm -rf dist && tsc -p tsconfig.build.json && node ../../scripts/build-cjs.mjs",
|