@attlaz/client 1.119.0 → 1.121.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/dist/Client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { OAuthClientToken } from './Http/OAuthClientToken.js';
2
2
  import { ITransport, ParseErrorHandler } from './Http/Transport/ITransport.js';
3
3
  import { OAuthClient, TokenChangeHandler } from './Http/Transport/OAuthClient.js';
4
- import { ApiInformation } from './Model/ApiInformation.js';
4
+ import { ApiInfo } from './Model/ApiInformation.js';
5
5
  import { AccessTokenEndpoint } from './Service/AccessTokenEndpoint.js';
6
6
  import { AdapterConnectionEndpoint } from './Service/AdapterConnectionEndpoint.js';
7
7
  import { ConnectionBundleEndpoint } from './Service/ConnectionBundleEndpoint.js';
@@ -112,7 +112,8 @@ export declare class Client {
112
112
  * rejected. Pass null to stop observing. OAuth-only; a custom transport has no token.
113
113
  */
114
114
  setTokenChangeHandler(handler: TokenChangeHandler | null): void;
115
- getApiInformation(): Promise<ApiInformation>;
115
+ /** The gateway first, then every API it routes to. A non-administrator is shown the gateway alone. */
116
+ getApiInformation(): Promise<ApiInfo[]>;
116
117
  getAdapterEndpoint(): AdapterEndpoint;
117
118
  getAdapterConnectionEndpoint(): AdapterConnectionEndpoint;
118
119
  getConnectionBundleEndpoint(): ConnectionBundleEndpoint;
package/dist/Client.js CHANGED
@@ -211,14 +211,13 @@ export class Client {
211
211
  setTokenChangeHandler(handler) {
212
212
  this.httpClient.setTokenChangeHandler(handler);
213
213
  }
214
+ /** The gateway first, then every API it routes to. A non-administrator is shown the gateway alone. */
214
215
  async getApiInformation() {
215
216
  const result = await this.httpClient.request('/system/info', null, 'GET', true);
216
- // The gateway is the first entry, and the only one a non-administrator is shown.
217
- const gateway = result.apis?.[0];
218
- if (gateway === undefined || gateway.version === null) {
217
+ if (result.apis === undefined || result.apis.length === 0) {
219
218
  throw new Error('Unable to get API information: invalid response');
220
219
  }
221
- return { version: gateway.version, apis: result.apis ?? [] };
220
+ return result.apis;
222
221
  }
223
222
  /* Endpoints */
224
223
  getAdapterEndpoint() {
@@ -2,7 +2,9 @@ import { StockStatus } from './StockStatus.js';
2
2
  import { ApiRecord } from '../../Model/ApiRecord.js';
3
3
  /**
4
4
  * A competitor's product as tracked by Market Pulse — the `/pulse/vendors/:vendorId/products`
5
- * resource. `identifier` is the product's stable id on the competitor's site (the upsert key).
5
+ * resource. `identifier` is the product's stable id on the competitor's site (the upsert key);
6
+ * `variantGroup` is shared by siblings and is not an id of its own. Axis names and values are the
7
+ * vendor's own words, unnormalised.
6
8
  */
7
9
  export declare class VendorProduct {
8
10
  id: string | null;
@@ -14,6 +16,15 @@ export declare class VendorProduct {
14
16
  brand: string | null;
15
17
  url: string | null;
16
18
  sku: string | null;
19
+ manufacturerPartNumber: string | null;
20
+ variantGroup: string | null;
21
+ variantAxes: {
22
+ name: string;
23
+ value: string;
24
+ code?: string | null;
25
+ unit?: string | null;
26
+ numericValue?: number | null;
27
+ }[] | null;
17
28
  currency: string | null;
18
29
  price: number | null;
19
30
  originalPrice: number | null;
@@ -1,7 +1,9 @@
1
1
  import { parseStockStatus } from './StockStatus.js';
2
2
  /**
3
3
  * A competitor's product as tracked by Market Pulse — the `/pulse/vendors/:vendorId/products`
4
- * resource. `identifier` is the product's stable id on the competitor's site (the upsert key).
4
+ * resource. `identifier` is the product's stable id on the competitor's site (the upsert key);
5
+ * `variantGroup` is shared by siblings and is not an id of its own. Axis names and values are the
6
+ * vendor's own words, unnormalised.
5
7
  */
6
8
  export class VendorProduct {
7
9
  id = null;
@@ -13,6 +15,9 @@ export class VendorProduct {
13
15
  brand = null;
14
16
  url = null;
15
17
  sku = null;
18
+ manufacturerPartNumber = null;
19
+ variantGroup = null;
20
+ variantAxes = null;
16
21
  currency = null;
17
22
  price = null;
18
23
  originalPrice = null;
@@ -43,6 +48,9 @@ export class VendorProduct {
43
48
  product.brand = raw.brand ?? null;
44
49
  product.url = raw.url ?? null;
45
50
  product.sku = raw.sku ?? null;
51
+ product.manufacturerPartNumber = raw.manufacturer_part_number ?? null;
52
+ product.variantGroup = raw.variant_group ?? null;
53
+ product.variantAxes = raw.variant_axes ?? null;
46
54
  product.currency = raw.currency ?? null;
47
55
  product.price = toNumber(raw.price);
48
56
  product.originalPrice = toNumber(raw.original_price);
@@ -56,6 +56,9 @@ export class VendorProductEndpoint extends Endpoint {
56
56
  identifier: product.identifier,
57
57
  gtin: product.gtin,
58
58
  sku: product.sku,
59
+ manufacturer_part_number: product.manufacturerPartNumber,
60
+ variant_group: product.variantGroup,
61
+ variant_axes: product.variantAxes,
59
62
  brand: product.brand,
60
63
  url: product.url,
61
64
  currency: product.currency,
@@ -81,6 +84,8 @@ export class VendorProductEndpoint extends Endpoint {
81
84
  { op: 'add', path: 'gtin', value: product.gtin },
82
85
  { op: 'add', path: 'image', value: product.image },
83
86
  { op: 'add', path: 'sku', value: product.sku },
87
+ { op: 'add', path: 'manufacturer_part_number', value: product.manufacturerPartNumber },
88
+ { op: 'add', path: 'variant_group', value: product.variantGroup },
84
89
  { op: 'add', path: 'currency', value: product.currency },
85
90
  { op: 'add', path: 'properties', value: product.properties },
86
91
  ];
@@ -16,14 +16,3 @@ export type ApiInfo = {
16
16
  }[];
17
17
  error: string | null;
18
18
  };
19
- /**
20
- * What the endpoint is running.
21
- *
22
- * `apis` lists the gateway first, then every API it routes to — but only an administrator is shown
23
- * more than the gateway, so a normal caller gets a single entry.
24
- */
25
- export type ApiInformation = {
26
- /** The gateway's version — what `version` meant before `apis` existed. */
27
- version: string;
28
- apis: ApiInfo[];
29
- };
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export type { TokenChangeHandler } from './Http/Transport/OAuthClient.js';
15
15
  export { OAuthClientOptions } from './Http/OAuthClientOptions.js';
16
16
  export { OAuthClientToken } from './Http/OAuthClientToken.js';
17
17
  export { ClientError } from './Http/ClientError.js';
18
- export { ApiInfo, ApiInformation } from './Model/ApiInformation.js';
18
+ export { ApiInfo } from './Model/ApiInformation.js';
19
19
  export { ApiError } from './Model/Error/ApiError.js';
20
20
  export type { ParseErrorHandler } from './Http/Transport/ITransport.js';
21
21
  export { HttpStatus } from './Http/HttpStatus.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.118.0";
1
+ export declare const VERSION = "1.120.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.118.0";
1
+ export const VERSION = "1.120.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attlaz/client",
3
- "version": "1.119.0",
3
+ "version": "1.121.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",