cx-amazon-sp-api 0.1.3 → 0.1.5
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/package.json
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cx-amazon-sp-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Reads and updates your own Amazon store.",
|
|
5
|
-
"author": "ComChatX",
|
|
6
5
|
"license": "MIT",
|
|
6
|
+
"author": "ComChatX",
|
|
7
|
+
"homepage": "https://github.com/comchatx/cx-amazon-sp-api#readme",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/
|
|
10
|
-
"directory": "src/source-packages/cx-amazon-sp-api"
|
|
10
|
+
"url": "git+https://github.com/comchatx/cx-amazon-sp-api.git"
|
|
11
11
|
},
|
|
12
|
+
"bugs": "https://github.com/comchatx/cx-amazon-sp-api/issues",
|
|
12
13
|
"keywords": [
|
|
13
14
|
"pi-package"
|
|
14
15
|
],
|
|
16
|
+
"type": "module",
|
|
15
17
|
"pi": {
|
|
16
18
|
"skills": [
|
|
17
19
|
"./skills"
|
|
18
20
|
]
|
|
19
21
|
},
|
|
22
|
+
"files": [
|
|
23
|
+
"skills"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"test": "vitest run"
|
|
28
|
+
},
|
|
20
29
|
"comchatx": {
|
|
21
30
|
"name": "Amazon SP-API",
|
|
22
31
|
"about": "读取并更新你自己的亚马逊店铺。",
|
|
@@ -42,5 +51,11 @@
|
|
|
42
51
|
"help": "https://developer-docs.amazon/sp-api/docs/self-authorization",
|
|
43
52
|
"aspects": {}
|
|
44
53
|
}
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
57
|
+
"@types/node": "26.2.0",
|
|
58
|
+
"typescript": "7.0.2",
|
|
59
|
+
"vitest": "4.1.11"
|
|
45
60
|
}
|
|
46
61
|
}
|
|
@@ -19,7 +19,7 @@ Amazon's reference: <https://developer-docs.amazon.com/sp-api>, models at <https
|
|
|
19
19
|
| `https://sellingpartnerapi-eu.amazon.com` | `https://sandbox.sellingpartnerapi-eu.amazon.com` | `eu` |
|
|
20
20
|
| `https://sellingpartnerapi-fe.amazon.com` | `https://sandbox.sellingpartnerapi-fe.amazon.com` | `fe` |
|
|
21
21
|
|
|
22
|
-
The platform holds the client pair, `client_id` and `client_secret`, and the seller's connections, each a store, its region and its `refresh_token`; the box holds none. A call goes on its origin region's connection; where the region holds several, `--header x-cx-store=<store>` names one, and Amazon never sees it. Without the client pair or that connection, the door refuses `key_required`, naming what is missing, before anything is sent. A request naming `x-amz-access-token` is refused
|
|
22
|
+
The platform holds the client pair, `client_id` and `client_secret`, and the seller's connections, each a store, its region and its `refresh_token`; the box holds none. A call goes on its origin region's connection; where the region holds several, `--header x-cx-store=<store>` names one, and Amazon never sees it. Without the client pair or that connection, the door refuses `key_required`, naming what is missing, before anything is sent. A request naming `x-amz-access-token` is refused.
|
|
23
23
|
|
|
24
24
|
## Two headers
|
|
25
25
|
|
|
@@ -30,7 +30,7 @@ Amazon's developer page lists three scopes for a client-credentials trade: `sell
|
|
|
30
30
|
- A reply outside 2xx that the door returns lands with its status, its headers and as much of its body as came, and the call ends `failed`, exit 1: the line reads `the source answered HTTP 403`, with the status and the reply's opening under it; a returned `429` is `provider_rate_limit`. A redirect is followed nowhere and nothing of it lands: a read ends `failed`, a change reads `sent, outcome unknown`. `x-amzn-RequestId` and `x-amzn-RateLimit-Limit` are among the receipt's headers.
|
|
31
31
|
- A reply cut short ends `failed`, exit 1, whatever its status: the bytes that came land, and the line ends `reply cut short`. Where a 2xx reply broke off, Amazon had answered 2xx: the line reads `the source answered HTTP 200`, with `HTTP 200: the reply broke off after 86 bytes` under it, the status and the count of bytes kept.
|
|
32
32
|
- A step or a reply that stalls past the gate's wait is not returned: the call keeps the gate's own ending, in the gate's words, as it does where the door throws. Stalled, a change with no reply begun reads `sent, outcome unknown`, one whose step stalled among them, though that request never left; a read ends `failed`; and a reply whose head arrived ends `failed (provider_unavailable)`, a `429` too: the line is the gate's sentence and then the status, as `HTTP 429`, which `--json` holds as `http_status`.
|
|
33
|
-
-
|
|
33
|
+
- A reply and a failure's words land as Amazon wrote them, a token in them included; of a reply's headers, those that carry authority — cookies and authentication challenges — are left out.
|
|
34
34
|
- The box keeps an ask's attempt open until it has recorded how it ended: a reply's landing, or an ending with nothing to land. Until then an identical ask is the same attempt: two in flight together are one call to Amazon, and one asked again after a landing that went unrecorded is answered the first reply where the gate kept it, under the same `request_id`, with nothing traded or sent. After that an identical ask is a new call, and a change asked twice is sent twice.
|
|
35
35
|
- Amazon's rates are per operation and stated in each model; the door adds no wait, keeps no schedule and retries nothing of its own. A `429` is Amazon's answer that the operation's rate is spent: ask again after a wait, doubling the wait at each `429` from about a second, with a random part of up to half of it added so that two calls waiting together do not ask again together, and stop after five.
|
|
36
36
|
|