@bizon/amazon-ids 2.6.0 → 2.9.0

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
@@ -40,7 +40,9 @@ getMarketplaceById('ATVPDKIKX0DER')
40
40
  mwsDomain: 'mws.amazonservices.com',
41
41
  advertisingApiDomain: 'advertising-api.amazon.com',
42
42
  imagesDomain: 'images-na.ssl-images-amazon.com',
43
- vendorId: 'ATVPDKIKX0DER'
43
+ vendorId: 'ATVPDKIKX0DER',
44
+ sellerCentralDomain: 'sellercentral.amazon.com',
45
+ vendorCentralDomain: 'vendorcentral.amazon.com'
44
46
  }
45
47
  */
46
48
  ```
@@ -77,7 +79,9 @@ getMarketplaceByCode('DE')
77
79
  mwsDomain: 'mws-eu.amazonservices.com',
78
80
  advertisingApiDomain: 'advertising-api-eu.amazon.com',
79
81
  imagesDomain: 'images-eu.ssl-images-amazon.com',
80
- vendorId: 'A3JWKAKR8XB7XF'
82
+ vendorId: 'A3JWKAKR8XB7XF',
83
+ sellerCentralDomain: 'sellercentral-europe.amazon.com',
84
+ vendorCentralDomain: 'vendorcentral.amazon.de'
81
85
  }
82
86
  */
83
87
  ```
@@ -98,7 +102,9 @@ getMarketplaceByDomain('Amazon.com.mx')
98
102
  domain: 'amazon.com.mx',
99
103
  mwsDomain: 'mws.amazonservices.com.mx',
100
104
  imagesDomain: 'images-na.ssl-images-amazon.com',
101
- vendorId: 'AVDBXBAVVSXLQ'
105
+ vendorId: 'AVDBXBAVVSXLQ',
106
+ sellerCentralDomain: 'sellercentral.amazon.com.mx',
107
+ vendorCentralDomain: 'vendorcentral.amazon.com.mx'
102
108
  }
103
109
  */
104
110
  ```
@@ -118,10 +124,7 @@ getMarketplacesByMwsDomain('mws.amazonservices.com')
118
124
  name: 'United States',
119
125
  region: 'na',
120
126
  domain: 'amazon.com',
121
- mwsDomain: 'mws.amazonservices.com',
122
- advertisingApiDomain: 'advertising-api.amazon.com',
123
- imagesDomain: 'images-na.ssl-images-amazon.com',
124
- vendorId: 'ATVPDKIKX0DER'
127
+
125
128
  },
126
129
  {
127
130
  code: 'br',
@@ -129,9 +132,7 @@ getMarketplacesByMwsDomain('mws.amazonservices.com')
129
132
  name: 'Brazil',
130
133
  region: 'na',
131
134
  domain: 'amazon.com.br',
132
- mwsDomain: 'mws.amazonservices.com',
133
- imagesDomain: 'images-na.ssl-images-amazon.com',
134
- vendorId: 'A1ZZFT5FULY4LN'
135
+
135
136
  }
136
137
  ]
137
138
  */
@@ -154,10 +155,7 @@ getMarketplacesByMwsRegion('na')
154
155
  name: 'United States',
155
156
  region: 'na',
156
157
  domain: 'amazon.com',
157
- mwsDomain: 'mws.amazonservices.com',
158
- advertisingApiDomain: 'advertising-api.amazon.com',
159
- imagesDomain: 'images-na.ssl-images-amazon.com',
160
- vendorId: 'ATVPDKIKX0DER'
158
+
161
159
  },
162
160
  {
163
161
  code: 'br',
@@ -165,9 +163,7 @@ getMarketplacesByMwsRegion('na')
165
163
  name: 'Brazil',
166
164
  region: 'na',
167
165
  domain: 'amazon.com.br',
168
- mwsDomain: 'mws.amazonservices.com',
169
- imagesDomain: 'images-na.ssl-images-amazon.com',
170
- vendorId: 'A1ZZFT5FULY4LN'
166
+
171
167
  }
172
168
  ]
173
169
  */
package/package.json CHANGED
@@ -1,29 +1,42 @@
1
1
  {
2
2
  "name": "@bizon/amazon-ids",
3
- "version": "2.6.0",
3
+ "version": "2.9.0",
4
4
  "description": "Collection of Amazon identifiers",
5
- "main": "index.js",
6
5
  "repository": "https://github.com/bizon/amazon-ids",
7
6
  "author": "Bertrand Marron <bertrand.marron@gmail.com>",
8
7
  "license": "MIT",
9
- "scripts": {
10
- "test": "jest"
11
- },
12
8
  "files": [
13
- "index.js",
14
- "index.d.ts",
15
- "marketplaces.json"
9
+ "dist"
16
10
  ],
17
- "types": "index.d.ts",
11
+ "source": "./src/index.ts",
12
+ "exports": {
13
+ "require": "./dist/amazon-ids.js",
14
+ "default": "./dist/amazon-ids.modern.js"
15
+ },
16
+ "main": "./dist/amazon-ids.js",
17
+ "module": "./dist/amazon-ids.esm.js",
18
+ "types": "./dist/index.d.ts",
19
+ "unpkg": "./dist/amazon-ids.umd.js",
20
+ "scripts": {
21
+ "test": "jest",
22
+ "check:ts": "tsc --noEmit",
23
+ "build": "microbundle",
24
+ "dev": "microbundle watch"
25
+ },
18
26
  "dependencies": {
19
- "memoizee": "^0.4.14"
27
+ "mem": "^8.1.1"
20
28
  },
21
29
  "devDependencies": {
22
- "@semantic-release/git": "^9.0.0",
23
- "jest": "^27.0.1",
24
- "jest-junit": "^12.2.0",
25
- "semantic-release": "^17.4.5",
26
- "xo": "^0.44.0"
30
+ "@bizon/semantic-release-config": "^1.1.0",
31
+ "@tsconfig/node14": "^1.0.1",
32
+ "@types/jest": "^27.0.3",
33
+ "jest": "^27.4.5",
34
+ "jest-junit": "^13.0.0",
35
+ "microbundle": "^0.14.2",
36
+ "semantic-release": "^18.0.1",
37
+ "ts-jest": "^27.1.2",
38
+ "typescript": "^4.5.4",
39
+ "xo": "^0.47.0"
27
40
  },
28
41
  "keywords": [
29
42
  "amazon",
@@ -32,13 +45,11 @@
32
45
  "marketplaces"
33
46
  ],
34
47
  "jest": {
48
+ "preset": "ts-jest",
35
49
  "testEnvironment": "node",
36
- "testMatch": [
37
- "<rootDir>/__tests__/**/*.js"
38
- ],
39
50
  "collectCoverage": true,
40
51
  "collectCoverageFrom": [
41
- "index.js"
52
+ "src/**/*.ts"
42
53
  ],
43
54
  "coverageReporters": [
44
55
  "lcov",
@@ -49,29 +60,15 @@
49
60
  "semicolon": false,
50
61
  "space": 2,
51
62
  "rules": {
63
+ "import/extensions": "off",
52
64
  "unicorn/prefer-module": "off"
53
65
  },
54
- "overrides": [
55
- {
56
- "files": "__tests__/**/*.js",
57
- "envs": [
58
- "jest"
59
- ]
60
- }
61
- ]
66
+ "prettier": true
67
+ },
68
+ "prettier": {
69
+ "printWidth": 100
62
70
  },
63
71
  "release": {
64
- "plugins": [
65
- "@semantic-release/commit-analyzer",
66
- "@semantic-release/release-notes-generator",
67
- "@semantic-release/github",
68
- "@semantic-release/npm",
69
- [
70
- "@semantic-release/git",
71
- {
72
- "message": "chore(release): ${nextRelease.gitTag}"
73
- }
74
- ]
75
- ]
72
+ "extends": "@bizon/semantic-release-config"
76
73
  }
77
74
  }
package/index.d.ts DELETED
@@ -1,51 +0,0 @@
1
- export declare interface Marketplace {
2
- code: string;
3
- id: string;
4
- name: string;
5
- region: string;
6
- domain?: string;
7
- mwsDomain?: string;
8
- advertisingApiDomain?: string;
9
- imagesDomain?: string;
10
- vendorId?: string;
11
- }
12
-
13
- /**
14
- * All the available marketplaces
15
- */
16
- export declare const marketplaces: Marketplace[]
17
-
18
- /**
19
- * Get a marketplace by its id
20
- * @param id The marketplace's id
21
- * @returns The marketplace
22
- */
23
- export declare function getMarketplaceById(id: string): Marketplace | undefined
24
-
25
- /**
26
- * Get a marketplace by its code
27
- * @param code The marketplace's code
28
- * @returns The markerplace
29
- */
30
- export declare function getMarketplaceByCode(code: string): Marketplace | undefined
31
-
32
- /**
33
- * Get a marketplace by its domain
34
- * @param domain The marketplace's domain
35
- * @returns The marketplace
36
- */
37
- export declare function getMarketplaceByDomain(domain: string): Marketplace | undefined
38
-
39
- /**
40
- * Get several marketplaces by a MWS domain
41
- * @param domain The MWS domain
42
- * @returns The marketplaces
43
- */
44
- export declare function getMarketplacesByMwsDomain(domain: string): Marketplace[]
45
-
46
- /**
47
- * Get several marketplaces by a MWS region
48
- * @param mwsRegion The MWS region
49
- * @returns The marketplaces
50
- */
51
- export declare function getMarketplacesByMwsRegion(mwsRegion: string): Marketplace[]
package/index.js DELETED
@@ -1,50 +0,0 @@
1
- const memoize = require('memoizee')
2
-
3
- const marketplaces = require('./marketplaces.json')
4
-
5
- const mwsRegionDomains = {
6
- // Generic MWS regions:
7
- na: 'mws.amazonservices.com',
8
- eu: 'mws-eu.amazonservices.com',
9
- fe: 'mws-fe.amazonservices.com',
10
-
11
- // Country specific MWS regions:
12
- ca: 'mws.amazonservices.ca',
13
- mx: 'mws.amazonservices.com.mx',
14
- ae: 'mws.amazonservices.ae',
15
- in: 'mws.amazonservices.in',
16
- jp: 'mws.amazonservices.jp',
17
- au: 'mws.amazonservices.com.au',
18
- }
19
-
20
- exports.marketplaces = marketplaces
21
-
22
- exports.getMarketplaceById = memoize(id => marketplaces.find(marketplace => marketplace.id === id))
23
-
24
- exports.getMarketplaceByCode = memoize(code => {
25
- code = code.toLowerCase()
26
-
27
- return marketplaces.find(marketplace => marketplace.code === code)
28
- })
29
-
30
- exports.getMarketplaceByDomain = memoize(domain => {
31
- domain = domain.toLowerCase()
32
-
33
- if (domain.startsWith('www.')) {
34
- domain = domain.slice(4)
35
- }
36
-
37
- return marketplaces.find(marketplace => marketplace.domain === domain)
38
- })
39
-
40
- exports.getMarketplacesByMwsDomain = memoize(domain => marketplaces.filter(marketplace => marketplace.mwsDomain === domain))
41
-
42
- exports.getMarketplacesByMwsRegion = memoize(mwsRegion => {
43
- const mwsDomain = mwsRegionDomains[String(mwsRegion).toLowerCase()]
44
-
45
- if (!mwsDomain) {
46
- return []
47
- }
48
-
49
- return this.getMarketplacesByMwsDomain(mwsDomain)
50
- })
package/marketplaces.json DELETED
@@ -1,256 +0,0 @@
1
- [
2
- {
3
- "code": "de",
4
- "id": "A1PA6795UKMFR9",
5
- "name": "Germany",
6
- "region": "eu",
7
- "domain": "amazon.de",
8
- "mwsDomain": "mws-eu.amazonservices.com",
9
- "advertisingApiDomain": "advertising-api-eu.amazon.com",
10
- "imagesDomain": "images-eu.ssl-images-amazon.com",
11
- "vendorId": "A3JWKAKR8XB7XF"
12
- },
13
- {
14
- "code": "de-non-amazon",
15
- "id": "A38D8NSA03LJTC",
16
- "name": "Germany - Non-Amazon",
17
- "region": "eu"
18
- },
19
- {
20
- "code": "es",
21
- "id": "A1RKKUPIHCS9HS",
22
- "name": "Spain",
23
- "region": "eu",
24
- "domain": "amazon.es",
25
- "mwsDomain": "mws-eu.amazonservices.com",
26
- "advertisingApiDomain": "advertising-api-eu.amazon.com",
27
- "imagesDomain": "images-eu.ssl-images-amazon.com",
28
- "vendorId": "A1AT7YVPFBWXBL"
29
- },
30
- {
31
- "code": "es-non-amazon",
32
- "id": "AFQLKURYRPEL8",
33
- "name": "Spain - Non-Amazon",
34
- "region": "eu"
35
- },
36
- {
37
- "code": "fr",
38
- "id": "A13V1IB3VIYZZH",
39
- "name": "France",
40
- "region": "eu",
41
- "domain": "amazon.fr",
42
- "mwsDomain": "mws-eu.amazonservices.com",
43
- "advertisingApiDomain": "advertising-api-eu.amazon.com",
44
- "imagesDomain": "images-eu.ssl-images-amazon.com",
45
- "vendorId": "A1X6FK5RDHNB96"
46
- },
47
- {
48
- "code": "fr-non-amazon",
49
- "id": "A1ZFFQZ3HTUKT9",
50
- "name": "France - Non-Amazon",
51
- "region": "eu"
52
- },
53
- {
54
- "code": "it",
55
- "id": "APJ6JRA9NG5V4",
56
- "name": "Italy",
57
- "region": "eu",
58
- "domain": "amazon.it",
59
- "mwsDomain": "mws-eu.amazonservices.com",
60
- "advertisingApiDomain": "advertising-api-eu.amazon.com",
61
- "imagesDomain": "images-eu.ssl-images-amazon.com",
62
- "vendorId": "A11IL2PNWYJU7H"
63
- },
64
- {
65
- "code": "it-non-amazon",
66
- "id": "A62U237T8HV6N",
67
- "name": "Italy - Non-Amazon",
68
- "region": "eu"
69
- },
70
- {
71
- "code": "uk",
72
- "id": "A1F83G8C2ARO7P",
73
- "name": "United Kingdom",
74
- "region": "eu",
75
- "domain": "amazon.co.uk",
76
- "mwsDomain": "mws-eu.amazonservices.com",
77
- "advertisingApiDomain": "advertising-api-eu.amazon.com",
78
- "imagesDomain": "images-eu.ssl-images-amazon.com",
79
- "vendorId": "A3P5ROKL5A1OLE"
80
- },
81
- {
82
- "code": "uk-non-amazon",
83
- "id": "AZMDEXL2RVFNN",
84
- "name": "United Kingdom - Non-Amazon",
85
- "region": "eu"
86
- },
87
- {
88
- "code": "tr",
89
- "id": "A33AVAJ2PDY3EV",
90
- "name": "Turkey",
91
- "region": "eu",
92
- "domain": "amazon.com.tr",
93
- "mwsDomain": "mws-eu.amazonservices.com",
94
- "imagesDomain": "images-eu.ssl-images-amazon.com",
95
- "vendorId": "A1UNQM1SR2CHM"
96
- },
97
- {
98
- "code": "eg",
99
- "id": "ARBP9OOSHTCHU",
100
- "name": "Egypt",
101
- "region": "eu",
102
- "mwsDomain": "mws-eu.amazonservices.com",
103
- "imagesDomain": "images-eu.ssl-images-amazon.com"
104
- },
105
- {
106
- "code": "sa",
107
- "id": "A17E79C6D8DWNP",
108
- "name": "Saudi Arabia",
109
- "region": "eu",
110
- "domain": "amazon.sa",
111
- "mwsDomain": "mws-eu.amazonservices.com",
112
- "imagesDomain": "images-eu.ssl-images-amazon.com",
113
- "vendorId": "A2XPWB6MYN7ZDK"
114
- },
115
- {
116
- "code": "nl",
117
- "id": "A1805IZSGTT6HS",
118
- "name": "Netherlands",
119
- "region": "eu",
120
- "domain": "amazon.nl",
121
- "mwsDomain": "mws-eu.amazonservices.com",
122
- "imagesDomain": "images-eu.ssl-images-amazon.com",
123
- "vendorId": "A17D2BRD4YMT0X"
124
- },
125
- {
126
- "code": "se",
127
- "id": "A2NODRKZP88ZB9",
128
- "name": "Sweden",
129
- "region": "eu",
130
- "domain": "amazon.se",
131
- "mwsDomain": "mws-eu.amazonservices.com",
132
- "imagesDomain": "images-eu.ssl-images-amazon.com",
133
- "vendorId": "ANU9KP01APNAG"
134
- },
135
- {
136
- "code": "pl",
137
- "id": "A1C3SOZRARQ6R3",
138
- "name": "Poland",
139
- "region": "eu",
140
- "domain": "amazon.pl",
141
- "mwsDomain": "mws-eu.amazonservices.com",
142
- "imagesDomain": "images-eu.ssl-images-amazon.com",
143
- "vendorId": "A2R2221NX79QZP"
144
- },
145
- {
146
- "code": "ca",
147
- "id": "A2EUQ1WTGCTBG2",
148
- "name": "Canada",
149
- "region": "na",
150
- "domain": "amazon.ca",
151
- "mwsDomain": "mws.amazonservices.ca",
152
- "advertisingApiDomain": "advertising-api.amazon.com",
153
- "imagesDomain": "images-na.ssl-images-amazon.com",
154
- "vendorId": "A3DWYIK6Y9EEQB"
155
- },
156
- {
157
- "code": "ca-non-amazon",
158
- "id": "A1MQXOICRS2Z7M",
159
- "name": "Canada - Non-Amazon",
160
- "region": "na"
161
- },
162
- {
163
- "code": "mx",
164
- "id": "A1AM78C64UM0Y8",
165
- "name": "Mexico",
166
- "region": "na",
167
- "domain": "amazon.com.mx",
168
- "mwsDomain": "mws.amazonservices.com.mx",
169
- "imagesDomain": "images-na.ssl-images-amazon.com",
170
- "vendorId": "AVDBXBAVVSXLQ"
171
- },
172
- {
173
- "code": "mx-non-amazon",
174
- "id": "A3H6HPSLHAK3XG",
175
- "name": "Mexico - Non-Amazon",
176
- "region": "na"
177
- },
178
- {
179
- "code": "us",
180
- "id": "ATVPDKIKX0DER",
181
- "name": "United States",
182
- "region": "na",
183
- "domain": "amazon.com",
184
- "mwsDomain": "mws.amazonservices.com",
185
- "advertisingApiDomain": "advertising-api.amazon.com",
186
- "imagesDomain": "images-na.ssl-images-amazon.com",
187
- "vendorId": "ATVPDKIKX0DER"
188
- },
189
- {
190
- "code": "us-non-amazon",
191
- "id": "A2ZV50J4W1RKNI",
192
- "name": "United States - Non-Amazon",
193
- "region": "na"
194
- },
195
- {
196
- "code": "br",
197
- "id": "A2Q3Y263D00KWC",
198
- "name": "Brazil",
199
- "region": "na",
200
- "domain": "amazon.com.br",
201
- "mwsDomain": "mws.amazonservices.com",
202
- "imagesDomain": "images-na.ssl-images-amazon.com",
203
- "vendorId": "A1ZZFT5FULY4LN"
204
- },
205
- {
206
- "code": "ae",
207
- "id": "A2VIGQ35RCS4UG",
208
- "name": "United Arab Emirates",
209
- "region": "eu",
210
- "domain": "amazon.ae",
211
- "mwsDomain": "mws.amazonservices.ae",
212
- "advertisingApiDomain": "advertising-api-eu.amazon.com",
213
- "imagesDomain": "images-eu.ssl-images-amazon.com",
214
- "vendorId": "A2KKU8J8O8784X"
215
- },
216
- {
217
- "code": "in",
218
- "id": "A21TJRUUN4KGV",
219
- "name": "India",
220
- "region": "eu",
221
- "domain": "amazon.in",
222
- "mwsDomain": "mws.amazonservices.in",
223
- "imagesDomain": "images-eu.ssl-images-amazon.com"
224
- },
225
- {
226
- "code": "au",
227
- "id": "A39IBJ37TRP1C6",
228
- "name": "Australia",
229
- "region": "fe",
230
- "domain": "amazon.com.au",
231
- "mwsDomain": "mws.amazonservices.com.au",
232
- "advertisingApiDomain": "advertising-api-fe.amazon.com",
233
- "imagesDomain": "images-fe.ssl-images-amazon.com",
234
- "vendorId": "ANEGB3WVEVKZB"
235
- },
236
- {
237
- "code": "jp",
238
- "id": "A1VC38T7YXB528",
239
- "name": "Japan",
240
- "region": "fe",
241
- "domain": "amazon.co.jp",
242
- "mwsDomain": "mws.amazonservices.jp",
243
- "advertisingApiDomain": "advertising-api-fe.amazon.com",
244
- "imagesDomain": "images-fe.ssl-images-amazon.com",
245
- "vendorId": "AN1VRQENFRJN5"
246
- },
247
- {
248
- "code": "sg",
249
- "id": "A19VAU5U5O7RUS",
250
- "name": "Singapore",
251
- "region": "fe",
252
- "domain": "amazon.sg",
253
- "mwsDomain": "mws-fe.amazonservices.com",
254
- "imagesDomain": "images-fe.ssl-images-amazon.com"
255
- }
256
- ]