@viu/emporix-sdk 2.18.0 → 2.19.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @viu/emporix-sdk
2
2
 
3
+ ## 2.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#139](https://github.com/viuteam/emporix-sdk/pull/139) [`1b17743`](https://github.com/viuteam/emporix-sdk/commit/1b17743719e03146c1a66a8ebd3f02c25dd48590) Thanks [@amnael1](https://github.com/amnael1)! - Sync with the Emporix changelog (2026-06-18). New indexing reindex-jobs API:
8
+ `indexing.createReindexJob`, `indexing.listReindexJobs`, `indexing.getReindexJob`
9
+ (replacing the now-deprecated `indexing.reindex`). Deprecated `ragIndexer.reindex`
10
+ (use `indexing.createReindexJob({ entityType: "PRODUCT", rag: true })`), the whole
11
+ `SepaExportService` and `PickPackService`, and the deprecated approval price fields.
12
+ Availability is now fetched + vendored through the codegen pipeline. Adds upstream
13
+ version tracking: `specs/.sync-manifest.json` (written by `fetch-specs`) plus
14
+ `docs/emporix-upstream-changelog.md`.
15
+
3
16
  ## 2.18.0
4
17
 
5
18
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/errors.ts","../src/services/availability.ts"],"names":[],"mappings":";;;AACA,IAAM,kBAAA,uBAAyB,GAAA,CAAI;AAAA,EACjC,cAAA;AAAA,EAAgB,eAAA;AAAA,EAAiB,OAAA;AAAA,EAAS,eAAA;AAAA,EAAiB,WAAA;AAAA,EAC3D,QAAA;AAAA,EAAU,eAAA;AAAA,EAAiB,eAAA;AAAA,EAAiB;AAC9C,CAAC,CAAA;AAED,SAAS,MAAM,IAAA,EAAwB;AACrC,EAAA,IAAI,MAAM,OAAA,CAAQ,IAAI,GAAG,OAAO,IAAA,CAAK,IAAI,KAAK,CAAA;AAC9C,EAAA,IAAI,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,EAAU;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AAAA,MACrD,IAAA,EAAM,UAAA;AAAA,MACN,UAAA,EAAY;AAAA;AAAA,KACb,CAAA;AACD,IAAA,MAAM,IAAA,uBAAW,GAAA,EAA0B;AAC3C,IAAA,KAAA,MAAW,CAAA,IAAK,OAAO,IAAI,CAAA,CAAE,WAAW,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,SAAA,EAAW,CAAC,CAAA;AAC/D,IAAA,OAAO,UAAA,CAAW,GAAA;AAAA,MAChB,CAAC,EAAA,KACC,IAAA,CAAK,GAAA,CAAI,EAAE,CAAA,IAAK;AAAA,QACd,SAAA,EAAW,EAAA;AAAA,QACX,IAAA,EAAM,QAAA;AAAA,QACN,SAAA,EAAW,OAAA,CAAQ,IAAA,CAAK,0BAA0B;AAAA;AACpD,KACJ;AAAA,EACF;AACF","file":"availability.cjs","sourcesContent":["/** Keys whose values are stripped from any serialised error body. */\nconst REDACTED_BODY_KEYS = new Set([\n \"access_token\", \"refresh_token\", \"token\", \"customertoken\", \"saastoken\",\n \"secret\", \"client_secret\", \"authorization\", \"password\",\n]);\n\nfunction scrub(body: unknown): unknown {\n if (Array.isArray(body)) return body.map(scrub);\n if (body && typeof body === \"object\") {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(body as Record<string, unknown>)) {\n out[k] = REDACTED_BODY_KEYS.has(k.toLowerCase()) ? \"***redacted***\" : scrub(v);\n }\n return out;\n }\n return body;\n}\n\n/** Base class for every error thrown by the SDK. */\nexport class EmporixError extends Error {\n readonly status: number | undefined;\n readonly body: unknown;\n constructor(message: string, status?: number, body?: unknown) {\n super(message);\n this.name = new.target.name;\n this.status = status;\n this.body = body;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n /** Safe serialisation — token-like body fields are redacted. */\n toJSON(): Record<string, unknown> {\n return { name: this.name, message: this.message, status: this.status, body: scrub(this.body) };\n }\n}\n\n/** 401 — authentication failed or token expired. */\nexport class EmporixAuthError extends EmporixError {}\n/** 403 — authenticated but not permitted. */\nexport class EmporixForbiddenError extends EmporixError {}\n/** 404 — resource not found. */\nexport class EmporixNotFoundError extends EmporixError {}\n/** 400/422 — request validation failed. */\nexport class EmporixValidationError extends EmporixError {}\n/** 5xx — server-side failure. */\nexport class EmporixServerError extends EmporixError {}\n/** Request aborted by the configured connect/read timeout. No HTTP status. */\nexport class EmporixTimeoutError extends EmporixError {}\n/** DNS/TLS/connection-level failure before or during the exchange. No HTTP status. */\nexport class EmporixNetworkError extends EmporixError {}\n\n/**\n * 403 with a `missing scope: <name>` hint in the body's `details` array.\n * Subclasses {@link EmporixForbiddenError} so existing 403 catches still work.\n */\nexport class EmporixInsufficientScopeError extends EmporixForbiddenError {\n readonly requiredScope: string | undefined;\n constructor(message: string, status: number, body: unknown, requiredScope?: string) {\n super(message, status, body);\n this.requiredScope = requiredScope;\n }\n}\n\nconst SCOPE_HINT_RE = /missing scope[: ]+([a-z0-9._-]+)/i;\n\nfunction extractRequiredScope(body: unknown): string | undefined {\n if (body && typeof body === \"object\" && \"details\" in body) {\n const details = (body as { details?: unknown }).details;\n if (Array.isArray(details)) {\n for (const d of details) {\n if (typeof d === \"string\") {\n const m = d.match(SCOPE_HINT_RE);\n if (m) return m[1];\n }\n }\n }\n }\n return undefined;\n}\n\n/** Maps an HTTP status to the matching {@link EmporixError} subclass. */\nexport function errorFromResponse(status: number, message: string, body: unknown): EmporixError {\n if (status === 401) return new EmporixAuthError(message, status, body);\n if (status === 403) {\n const scope = extractRequiredScope(body);\n if (scope) return new EmporixInsufficientScopeError(message, status, body, scope);\n return new EmporixForbiddenError(message, status, body);\n }\n if (status === 404) return new EmporixNotFoundError(message, status, body);\n if (status === 400 || status === 422) return new EmporixValidationError(message, status, body);\n if (status >= 500) return new EmporixServerError(message, status, body);\n return new EmporixError(message, status, body);\n}\n","import type { ClientContext } from \"../core/context\";\nimport type { AuthContext } from \"../core/auth\";\nimport { EmporixNotFoundError } from \"../core/errors\";\nimport type { AvailabilityWithBundle } from \"../generated/availability\";\n\n/**\n * Site-aware product availability. Mirrors the Emporix Availability Service\n * `AvailabilityWithBundle` shape (the single-product GET and the batch search\n * both return the bundle-aware variant). There is no restock-date field.\n */\nexport type Availability = AvailabilityWithBundle;\n\n/** Shared options for {@link AvailabilityService} reads. */\nexport interface AvailabilityOptions {\n /**\n * When `true`, a product with no availability record resolves to a default\n * `{ available: true }` instead of throwing (single `get`) / being marked\n * unavailable (`getMany`). Off by default — opt in for tenants that sell\n * without stock management.\n */\n defaultAvailableOnNotFound?: boolean;\n}\n\nconst ANON: AuthContext = { kind: \"anonymous\" };\n\n/**\n * Reads product availability per site. Default auth is anonymous (like\n * `PriceService.matchByContext`); pass a customer/raw/service context to use a\n * different token. Requires the `availability.availability_view` scope on\n * whichever token is used.\n */\nexport class AvailabilityService {\n static readonly channel = \"availability\" as const;\n constructor(private readonly ctx: ClientContext) {}\n\n /**\n * Single product. Resolves the availability record, or — when\n * `opts.defaultAvailableOnNotFound` is set — a default available record on 404.\n */\n async get(\n productId: string,\n siteCode: string,\n auth: AuthContext = ANON,\n opts: AvailabilityOptions = {},\n ): Promise<Availability> {\n try {\n return await this.ctx.http.request<Availability>({\n method: \"GET\",\n path: `/availability/${this.ctx.tenant}/availability/${encodeURIComponent(\n productId,\n )}/${encodeURIComponent(siteCode)}`,\n auth,\n });\n } catch (err) {\n if (err instanceof EmporixNotFoundError && opts.defaultAvailableOnNotFound) {\n return { productId, site: siteCode, available: true };\n }\n throw err;\n }\n }\n\n /**\n * Batch read via `POST .../availability/search` (one request). Products with\n * no availability record are absent from the response; each is synthesized as\n * `{ available: false }` (or `{ available: true }` when\n * `opts.defaultAvailableOnNotFound` is set). The result preserves input order\n * and length. An empty `productIds` resolves to `[]` without a request.\n */\n async getMany(\n productIds: string[],\n siteCode: string,\n auth: AuthContext = ANON,\n opts: AvailabilityOptions = {},\n ): Promise<Availability[]> {\n if (productIds.length === 0) return [];\n const found = await this.ctx.http.request<Availability[]>({\n method: \"POST\",\n path: `/availability/${this.ctx.tenant}/availability/search`,\n auth,\n query: { site: siteCode, pageSize: productIds.length },\n body: productIds,\n idempotent: true, // pure read over POST — safe to replay on 5xx/429\n });\n const byId = new Map<string, Availability>();\n for (const a of found) if (a.productId) byId.set(a.productId, a);\n return productIds.map(\n (id) =>\n byId.get(id) ?? {\n productId: id,\n site: siteCode,\n available: Boolean(opts.defaultAvailableOnNotFound),\n },\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/errors.ts","../src/services/availability.ts"],"names":[],"mappings":";;;AACA,IAAM,kBAAA,uBAAyB,GAAA,CAAI;AAAA,EACjC,cAAA;AAAA,EAAgB,eAAA;AAAA,EAAiB,OAAA;AAAA,EAAS,eAAA;AAAA,EAAiB,WAAA;AAAA,EAC3D,QAAA;AAAA,EAAU,eAAA;AAAA,EAAiB,eAAA;AAAA,EAAiB;AAC9C,CAAC,CAAA;AAED,SAAS,MAAM,IAAA,EAAwB;AACrC,EAAA,IAAI,MAAM,OAAA,CAAQ,IAAI,GAAG,OAAO,IAAA,CAAK,IAAI,KAAK,CAAA;AAC9C,EAAA,IAAI,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,EAAU;AACpC,IAAA,MAAM,MAA+B,EAAC;AACtC,IAAA,KAAA,MAAW,CAAC,CAAA,EAAG,CAAC,KAAK,MAAA,CAAO,OAAA,CAAQ,IAA+B,CAAA,EAAG;AACpE,MAAA,GAAA,CAAI,CAAC,CAAA,GAAI,kBAAA,CAAmB,GAAA,CAAI,CAAA,CAAE,aAAa,CAAA,GAAI,gBAAA,GAAmB,KAAA,CAAM,CAAC,CAAA;AAAA,IAC/E;AACA,IAAA,OAAO,GAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAA;AACT;AAGO,IAAM,YAAA,GAAN,cAA2B,KAAA,CAAM;AAAA,EAC7B,MAAA;AAAA,EACA,IAAA;AAAA,EACT,WAAA,CAAY,OAAA,EAAiB,MAAA,EAAiB,IAAA,EAAgB;AAC5D,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,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** Keys whose values are stripped from any serialised error body. */\nconst REDACTED_BODY_KEYS = new Set([\n \"access_token\", \"refresh_token\", \"token\", \"customertoken\", \"saastoken\",\n \"secret\", \"client_secret\", \"authorization\", \"password\",\n]);\n\nfunction scrub(body: unknown): unknown {\n if (Array.isArray(body)) return body.map(scrub);\n if (body && typeof body === \"object\") {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(body as Record<string, unknown>)) {\n out[k] = REDACTED_BODY_KEYS.has(k.toLowerCase()) ? \"***redacted***\" : scrub(v);\n }\n return out;\n }\n return body;\n}\n\n/** Base class for every error thrown by the SDK. */\nexport class EmporixError extends Error {\n readonly status: number | undefined;\n readonly body: unknown;\n constructor(message: string, status?: number, body?: unknown) {\n super(message);\n this.name = new.target.name;\n this.status = status;\n this.body = body;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n /** Safe serialisation — token-like body fields are redacted. */\n toJSON(): Record<string, unknown> {\n return { name: this.name, message: this.message, status: this.status, body: scrub(this.body) };\n }\n}\n\n/** 401 — authentication failed or token expired. */\nexport class EmporixAuthError extends EmporixError {}\n/** 403 — authenticated but not permitted. */\nexport class EmporixForbiddenError extends EmporixError {}\n/** 404 — resource not found. */\nexport class EmporixNotFoundError extends EmporixError {}\n/** 400/422 — request validation failed. */\nexport class EmporixValidationError extends EmporixError {}\n/** 5xx — server-side failure. */\nexport class EmporixServerError extends EmporixError {}\n/** Request aborted by the configured connect/read timeout. No HTTP status. */\nexport class EmporixTimeoutError extends EmporixError {}\n/** DNS/TLS/connection-level failure before or during the exchange. No HTTP status. */\nexport class EmporixNetworkError extends EmporixError {}\n\n/**\n * 403 with a `missing scope: <name>` hint in the body's `details` array.\n * Subclasses {@link EmporixForbiddenError} so existing 403 catches still work.\n */\nexport class EmporixInsufficientScopeError extends EmporixForbiddenError {\n readonly requiredScope: string | undefined;\n constructor(message: string, status: number, body: unknown, requiredScope?: string) {\n super(message, status, body);\n this.requiredScope = requiredScope;\n }\n}\n\nconst SCOPE_HINT_RE = /missing scope[: ]+([a-z0-9._-]+)/i;\n\nfunction extractRequiredScope(body: unknown): string | undefined {\n if (body && typeof body === \"object\" && \"details\" in body) {\n const details = (body as { details?: unknown }).details;\n if (Array.isArray(details)) {\n for (const d of details) {\n if (typeof d === \"string\") {\n const m = d.match(SCOPE_HINT_RE);\n if (m) return m[1];\n }\n }\n }\n }\n return undefined;\n}\n\n/** Maps an HTTP status to the matching {@link EmporixError} subclass. */\nexport function errorFromResponse(status: number, message: string, body: unknown): EmporixError {\n if (status === 401) return new EmporixAuthError(message, status, body);\n if (status === 403) {\n const scope = extractRequiredScope(body);\n if (scope) return new EmporixInsufficientScopeError(message, status, body, scope);\n return new EmporixForbiddenError(message, status, body);\n }\n if (status === 404) return new EmporixNotFoundError(message, status, body);\n if (status === 400 || status === 422) return new EmporixValidationError(message, status, body);\n if (status >= 500) return new EmporixServerError(message, status, body);\n return new EmporixError(message, status, body);\n}\n","import type { ClientContext } from \"../core/context\";\nimport type { AuthContext } from \"../core/auth\";\nimport { EmporixNotFoundError } from \"../core/errors\";\nimport type { Availability } from \"./availability-types\";\n\nexport type { Availability } from \"./availability-types\";\n\n/** Shared options for {@link AvailabilityService} reads. */\nexport interface AvailabilityOptions {\n /**\n * When `true`, a product with no availability record resolves to a default\n * `{ available: true }` instead of throwing (single `get`) / being marked\n * unavailable (`getMany`). Off by default — opt in for tenants that sell\n * without stock management.\n */\n defaultAvailableOnNotFound?: boolean;\n}\n\nconst ANON: AuthContext = { kind: \"anonymous\" };\n\n/**\n * Reads product availability per site. Default auth is anonymous (like\n * `PriceService.matchByContext`); pass a customer/raw/service context to use a\n * different token. Requires the `availability.availability_view` scope on\n * whichever token is used.\n */\nexport class AvailabilityService {\n static readonly channel = \"availability\" as const;\n constructor(private readonly ctx: ClientContext) {}\n\n /**\n * Single product. Resolves the availability record, or — when\n * `opts.defaultAvailableOnNotFound` is set — a default available record on 404.\n */\n async get(\n productId: string,\n siteCode: string,\n auth: AuthContext = ANON,\n opts: AvailabilityOptions = {},\n ): Promise<Availability> {\n try {\n return await this.ctx.http.request<Availability>({\n method: \"GET\",\n path: `/availability/${this.ctx.tenant}/availability/${encodeURIComponent(\n productId,\n )}/${encodeURIComponent(siteCode)}`,\n auth,\n });\n } catch (err) {\n if (err instanceof EmporixNotFoundError && opts.defaultAvailableOnNotFound) {\n return { productId, site: siteCode, available: true };\n }\n throw err;\n }\n }\n\n /**\n * Batch read via `POST .../availability/search` (one request). Products with\n * no availability record are absent from the response; each is synthesized as\n * `{ available: false }` (or `{ available: true }` when\n * `opts.defaultAvailableOnNotFound` is set). The result preserves input order\n * and length. An empty `productIds` resolves to `[]` without a request.\n */\n async getMany(\n productIds: string[],\n siteCode: string,\n auth: AuthContext = ANON,\n opts: AvailabilityOptions = {},\n ): Promise<Availability[]> {\n if (productIds.length === 0) return [];\n const found = await this.ctx.http.request<Availability[]>({\n method: \"POST\",\n path: `/availability/${this.ctx.tenant}/availability/search`,\n auth,\n query: { site: siteCode, pageSize: productIds.length },\n body: productIds,\n idempotent: true, // pure read over POST — safe to replay on 5xx/429\n });\n const byId = new Map<string, Availability>();\n for (const a of found) if (a.productId) byId.set(a.productId, a);\n return productIds.map(\n (id) =>\n byId.get(id) ?? {\n productId: id,\n site: siteCode,\n available: Boolean(opts.defaultAvailableOnNotFound),\n },\n );\n }\n}\n"]}
@@ -1,55 +1,141 @@
1
1
  import { C as ClientContext, b as AuthContext } from './context-DhoFgoKf.cjs';
2
2
 
3
- type DistributionChannel = 'ASSORTMENT' | 'HOME_DELIVERY' | 'PICKUP';
3
+ /**
4
+ * Availability details.
5
+ */
4
6
  type Availability$1 = {
7
+ /**
8
+ * Unique identifier of the availability.
9
+ *
10
+ * **Note**: The value should be provided in the `site`:`productId` format.
11
+ */
5
12
  id?: string;
13
+ /**
14
+ * Site code, defined when the site is created. The value should match the `site` query/path parameter value.
15
+ */
6
16
  site?: string;
17
+ /**
18
+ * Stock level of the product, expressed as a number.
19
+ */
7
20
  stockLevel?: number;
21
+ /**
22
+ * Flag indicating whether the product is available.
23
+ */
8
24
  available?: boolean;
25
+ /**
26
+ * Unique identifier of the product, generated when the product is created through the Product Service.
27
+ */
9
28
  productId?: string;
29
+ /**
30
+ * Id of a vendor to which the availability belongs.
31
+ */
10
32
  vendorId?: string;
33
+ /**
34
+ * Popularity of the product, expressed as a number.
35
+ */
11
36
  popularity?: number;
12
37
  distributionChannel?: DistributionChannel;
38
+ /**
39
+ * The field contains mixins values.
40
+ */
13
41
  mixins?: {
14
42
  [key: string]: unknown;
15
43
  };
16
44
  metadata?: {
17
- createdAt?: string;
18
- modifiedAt?: string;
45
+ /**
46
+ * Links to the mixin schemas.
47
+ */
19
48
  mixins?: {
20
49
  [key: string]: string;
21
50
  };
51
+ /**
52
+ * Date and time when the availability was created.
53
+ */
54
+ createdAt?: string;
55
+ /**
56
+ * Date and time when the availability was last updated.
57
+ */
58
+ modifiedAt?: string;
22
59
  };
23
60
  };
61
+ /**
62
+ * Availability details.
63
+ */
24
64
  type AvailabilityWithBundle = {
65
+ /**
66
+ * Unique identifier of the availability.
67
+ *
68
+ * **Note**: The value should be provided in the `site`:`productId` format.
69
+ */
25
70
  id?: string;
71
+ /**
72
+ * Site code, defined when the site is created. The value should match the `site` query/path parameter value.
73
+ */
26
74
  site?: string;
75
+ /**
76
+ * Stock level of the product, expressed as a number.
77
+ */
27
78
  stockLevel?: number;
79
+ /**
80
+ * Flag indicating whether the product is available.
81
+ */
28
82
  available?: boolean;
83
+ /**
84
+ * Unique identifier of the product, generated when the product is created through the Product Service.
85
+ */
29
86
  productId?: string;
87
+ /**
88
+ * Id of a vendor to which the availability belongs.
89
+ */
30
90
  vendorId?: string;
91
+ /**
92
+ * Popularity of the product, expressed as a number.
93
+ */
31
94
  popularity?: number;
32
95
  distributionChannel?: DistributionChannel;
33
96
  bundleAvailabilities?: AvailabilityList;
97
+ /**
98
+ * The field contains mixins values.
99
+ */
34
100
  mixins?: {
35
101
  [key: string]: unknown;
36
102
  };
37
103
  metadata?: {
38
- createdAt?: string;
39
- modifiedAt?: string;
104
+ /**
105
+ * Links to the mixin schemas.
106
+ */
40
107
  mixins?: {
41
108
  [key: string]: string;
42
109
  };
110
+ /**
111
+ * Date and time when the availability was created.
112
+ */
113
+ createdAt?: string;
114
+ /**
115
+ * Date and time when the availability was last updated.
116
+ */
117
+ modifiedAt?: string;
43
118
  };
44
119
  };
45
120
  type AvailabilityList = Array<Availability$1>;
121
+ /**
122
+ * Name of the product distribution channel.
123
+ */
124
+ type DistributionChannel = 'ASSORTMENT' | 'HOME_DELIVERY' | 'PICKUP';
46
125
 
47
126
  /**
48
- * Site-aware product availability. Mirrors the Emporix Availability Service
49
- * `AvailabilityWithBundle` shape (the single-product GET and the batch search
50
- * both return the bundle-aware variant). There is no restock-date field.
127
+ * Public types for the Availability Service — stable names aliased over the
128
+ * generated `availability` types. The single-product GET and the batch search
129
+ * both return the bundle-aware variant; there is no restock-date field.
130
+ *
131
+ * Note: only the availability *location-management* endpoints are deprecated
132
+ * upstream (removal 2026-09-01); the SDK does not wrap those. The product
133
+ * availability endpoints used here are current.
51
134
  */
135
+
136
+ /** A product's availability record (bundle-aware). */
52
137
  type Availability = AvailabilityWithBundle;
138
+
53
139
  /** Shared options for {@link AvailabilityService} reads. */
54
140
  interface AvailabilityOptions {
55
141
  /**
@@ -1,55 +1,141 @@
1
1
  import { C as ClientContext, b as AuthContext } from './context-DhoFgoKf.js';
2
2
 
3
- type DistributionChannel = 'ASSORTMENT' | 'HOME_DELIVERY' | 'PICKUP';
3
+ /**
4
+ * Availability details.
5
+ */
4
6
  type Availability$1 = {
7
+ /**
8
+ * Unique identifier of the availability.
9
+ *
10
+ * **Note**: The value should be provided in the `site`:`productId` format.
11
+ */
5
12
  id?: string;
13
+ /**
14
+ * Site code, defined when the site is created. The value should match the `site` query/path parameter value.
15
+ */
6
16
  site?: string;
17
+ /**
18
+ * Stock level of the product, expressed as a number.
19
+ */
7
20
  stockLevel?: number;
21
+ /**
22
+ * Flag indicating whether the product is available.
23
+ */
8
24
  available?: boolean;
25
+ /**
26
+ * Unique identifier of the product, generated when the product is created through the Product Service.
27
+ */
9
28
  productId?: string;
29
+ /**
30
+ * Id of a vendor to which the availability belongs.
31
+ */
10
32
  vendorId?: string;
33
+ /**
34
+ * Popularity of the product, expressed as a number.
35
+ */
11
36
  popularity?: number;
12
37
  distributionChannel?: DistributionChannel;
38
+ /**
39
+ * The field contains mixins values.
40
+ */
13
41
  mixins?: {
14
42
  [key: string]: unknown;
15
43
  };
16
44
  metadata?: {
17
- createdAt?: string;
18
- modifiedAt?: string;
45
+ /**
46
+ * Links to the mixin schemas.
47
+ */
19
48
  mixins?: {
20
49
  [key: string]: string;
21
50
  };
51
+ /**
52
+ * Date and time when the availability was created.
53
+ */
54
+ createdAt?: string;
55
+ /**
56
+ * Date and time when the availability was last updated.
57
+ */
58
+ modifiedAt?: string;
22
59
  };
23
60
  };
61
+ /**
62
+ * Availability details.
63
+ */
24
64
  type AvailabilityWithBundle = {
65
+ /**
66
+ * Unique identifier of the availability.
67
+ *
68
+ * **Note**: The value should be provided in the `site`:`productId` format.
69
+ */
25
70
  id?: string;
71
+ /**
72
+ * Site code, defined when the site is created. The value should match the `site` query/path parameter value.
73
+ */
26
74
  site?: string;
75
+ /**
76
+ * Stock level of the product, expressed as a number.
77
+ */
27
78
  stockLevel?: number;
79
+ /**
80
+ * Flag indicating whether the product is available.
81
+ */
28
82
  available?: boolean;
83
+ /**
84
+ * Unique identifier of the product, generated when the product is created through the Product Service.
85
+ */
29
86
  productId?: string;
87
+ /**
88
+ * Id of a vendor to which the availability belongs.
89
+ */
30
90
  vendorId?: string;
91
+ /**
92
+ * Popularity of the product, expressed as a number.
93
+ */
31
94
  popularity?: number;
32
95
  distributionChannel?: DistributionChannel;
33
96
  bundleAvailabilities?: AvailabilityList;
97
+ /**
98
+ * The field contains mixins values.
99
+ */
34
100
  mixins?: {
35
101
  [key: string]: unknown;
36
102
  };
37
103
  metadata?: {
38
- createdAt?: string;
39
- modifiedAt?: string;
104
+ /**
105
+ * Links to the mixin schemas.
106
+ */
40
107
  mixins?: {
41
108
  [key: string]: string;
42
109
  };
110
+ /**
111
+ * Date and time when the availability was created.
112
+ */
113
+ createdAt?: string;
114
+ /**
115
+ * Date and time when the availability was last updated.
116
+ */
117
+ modifiedAt?: string;
43
118
  };
44
119
  };
45
120
  type AvailabilityList = Array<Availability$1>;
121
+ /**
122
+ * Name of the product distribution channel.
123
+ */
124
+ type DistributionChannel = 'ASSORTMENT' | 'HOME_DELIVERY' | 'PICKUP';
46
125
 
47
126
  /**
48
- * Site-aware product availability. Mirrors the Emporix Availability Service
49
- * `AvailabilityWithBundle` shape (the single-product GET and the batch search
50
- * both return the bundle-aware variant). There is no restock-date field.
127
+ * Public types for the Availability Service — stable names aliased over the
128
+ * generated `availability` types. The single-product GET and the batch search
129
+ * both return the bundle-aware variant; there is no restock-date field.
130
+ *
131
+ * Note: only the availability *location-management* endpoints are deprecated
132
+ * upstream (removal 2026-09-01); the SDK does not wrap those. The product
133
+ * availability endpoints used here are current.
51
134
  */
135
+
136
+ /** A product's availability record (bundle-aware). */
52
137
  type Availability = AvailabilityWithBundle;
138
+
53
139
  /** Shared options for {@link AvailabilityService} reads. */
54
140
  interface AvailabilityOptions {
55
141
  /**
@@ -1,4 +1,4 @@
1
- export { AvailabilityService } from './chunk-K3VQLW3P.js';
1
+ export { AvailabilityService } from './chunk-IVCCGJN5.js';
2
2
  import './chunk-UWGGF4MC.js';
3
3
  //# sourceMappingURL=availability.js.map
4
4
  //# sourceMappingURL=availability.js.map
@@ -59,5 +59,5 @@ var AvailabilityService = class {
59
59
  };
60
60
 
61
61
  export { AvailabilityService };
62
- //# sourceMappingURL=chunk-K3VQLW3P.js.map
63
- //# sourceMappingURL=chunk-K3VQLW3P.js.map
62
+ //# sourceMappingURL=chunk-IVCCGJN5.js.map
63
+ //# sourceMappingURL=chunk-IVCCGJN5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../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AA,EAAQ,MAAA;AAAA,MACR,IAAA,EAAM,CAAA,cAAA,EAAiB,IAAA,CAAK,GAAA,CAAI,MAAM,CAAA,oBAAA,CAAA;AAAA,MACtC,IAAA;AAAA,MACA,OAAO,EAAE,IAAA,EAAM,QAAA,EAAU,QAAA,EAAU,WAAW,MAAA,EAAO;AAAA,MACrD,IAAA,EAAM,UAAA;AAAA,MACN,UAAA,EAAY;AAAA;AAAA,KACb,CAAA;AACD,IAAA,MAAM,IAAA,uBAAW,GAAA,EAA0B;AAC3C,IAAA,KAAA,MAAW,CAAA,IAAK,OAAO,IAAI,CAAA,CAAE,WAAW,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,SAAA,EAAW,CAAC,CAAA;AAC/D,IAAA,OAAO,UAAA,CAAW,GAAA;AAAA,MAChB,CAAC,EAAA,KACC,IAAA,CAAK,GAAA,CAAI,EAAE,CAAA,IAAK;AAAA,QACd,SAAA,EAAW,EAAA;AAAA,QACX,IAAA,EAAM,QAAA;AAAA,QACN,SAAA,EAAW,OAAA,CAAQ,IAAA,CAAK,0BAA0B;AAAA;AACpD,KACJ;AAAA,EACF;AACF","file":"chunk-IVCCGJN5.js","sourcesContent":["import type { ClientContext } from \"../core/context\";\nimport type { AuthContext } from \"../core/auth\";\nimport { EmporixNotFoundError } from \"../core/errors\";\nimport type { Availability } from \"./availability-types\";\n\nexport type { Availability } from \"./availability-types\";\n\n/** Shared options for {@link AvailabilityService} reads. */\nexport interface AvailabilityOptions {\n /**\n * When `true`, a product with no availability record resolves to a default\n * `{ available: true }` instead of throwing (single `get`) / being marked\n * unavailable (`getMany`). Off by default — opt in for tenants that sell\n * without stock management.\n */\n defaultAvailableOnNotFound?: boolean;\n}\n\nconst ANON: AuthContext = { kind: \"anonymous\" };\n\n/**\n * Reads product availability per site. Default auth is anonymous (like\n * `PriceService.matchByContext`); pass a customer/raw/service context to use a\n * different token. Requires the `availability.availability_view` scope on\n * whichever token is used.\n */\nexport class AvailabilityService {\n static readonly channel = \"availability\" as const;\n constructor(private readonly ctx: ClientContext) {}\n\n /**\n * Single product. Resolves the availability record, or — when\n * `opts.defaultAvailableOnNotFound` is set — a default available record on 404.\n */\n async get(\n productId: string,\n siteCode: string,\n auth: AuthContext = ANON,\n opts: AvailabilityOptions = {},\n ): Promise<Availability> {\n try {\n return await this.ctx.http.request<Availability>({\n method: \"GET\",\n path: `/availability/${this.ctx.tenant}/availability/${encodeURIComponent(\n productId,\n )}/${encodeURIComponent(siteCode)}`,\n auth,\n });\n } catch (err) {\n if (err instanceof EmporixNotFoundError && opts.defaultAvailableOnNotFound) {\n return { productId, site: siteCode, available: true };\n }\n throw err;\n }\n }\n\n /**\n * Batch read via `POST .../availability/search` (one request). Products with\n * no availability record are absent from the response; each is synthesized as\n * `{ available: false }` (or `{ available: true }` when\n * `opts.defaultAvailableOnNotFound` is set). The result preserves input order\n * and length. An empty `productIds` resolves to `[]` without a request.\n */\n async getMany(\n productIds: string[],\n siteCode: string,\n auth: AuthContext = ANON,\n opts: AvailabilityOptions = {},\n ): Promise<Availability[]> {\n if (productIds.length === 0) return [];\n const found = await this.ctx.http.request<Availability[]>({\n method: \"POST\",\n path: `/availability/${this.ctx.tenant}/availability/search`,\n auth,\n query: { site: siteCode, pageSize: productIds.length },\n body: productIds,\n idempotent: true, // pure read over POST — safe to replay on 5xx/429\n });\n const byId = new Map<string, Availability>();\n for (const a of found) if (a.productId) byId.set(a.productId, a);\n return productIds.map(\n (id) =>\n byId.get(id) ?? {\n productId: id,\n site: siteCode,\n available: Boolean(opts.defaultAvailableOnNotFound),\n },\n );\n }\n}\n"]}
package/dist/index.cjs CHANGED
@@ -783,7 +783,7 @@ var HttpClient = class {
783
783
  };
784
784
 
785
785
  // package.json
786
- var version = "2.18.0";
786
+ var version = "2.19.0";
787
787
 
788
788
  // src/version.ts
789
789
  var SDK_VERSION = version;
@@ -2842,6 +2842,8 @@ var RagIndexerService = class {
2842
2842
  * Schedule a full asynchronous re-index for `type` (default `"PRODUCT"`).
2843
2843
  * Resolves once the rebuild is *scheduled* (HTTP 204); there is no progress
2844
2844
  * to await or poll. Costly — avoid calling on a hot path.
2845
+ * @deprecated since 2026-06-18, removal 2026-12-01 — use the indexing service:
2846
+ * `client.indexing.createReindexJob({ entityType: "PRODUCT", rag: true })`.
2845
2847
  */
2846
2848
  async reindex(type = "PRODUCT", auth2 = SERVICE5) {
2847
2849
  await this.ctx.http.request({
@@ -4802,7 +4804,47 @@ var IndexingService = class {
4802
4804
  auth: auth2
4803
4805
  });
4804
4806
  }
4805
- /** Trigger a reindex. */
4807
+ /**
4808
+ * Create a reindex job (replaces {@link reindex}). A `FULL` reindex of the
4809
+ * given `entityType`; set `rag: true` to also rebuild the RAG vector index
4810
+ * (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
4811
+ * `entityType` is already `IN_PROGRESS`, that running job (`200`).
4812
+ */
4813
+ async createReindexJob(input, auth2 = SERVICE21) {
4814
+ return this.ctx.http.request({
4815
+ method: "POST",
4816
+ path: `${this.base()}/reindex-jobs`,
4817
+ auth: auth2,
4818
+ body: input
4819
+ });
4820
+ }
4821
+ /** List reindex jobs (paginated). */
4822
+ async listReindexJobs(opts = {}, auth2 = SERVICE21) {
4823
+ const pageNumber = opts.pageNumber ?? 1;
4824
+ const pageSize = opts.pageSize ?? 50;
4825
+ const query = { pageNumber, pageSize };
4826
+ if (opts.q !== void 0) query.q = opts.q;
4827
+ const items = await this.ctx.http.request({
4828
+ method: "GET",
4829
+ path: `${this.base()}/reindex-jobs`,
4830
+ query,
4831
+ auth: auth2
4832
+ });
4833
+ return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
4834
+ }
4835
+ /** Fetch one reindex job by id. */
4836
+ async getReindexJob(reindexJobId, auth2 = SERVICE21) {
4837
+ return this.ctx.http.request({
4838
+ method: "GET",
4839
+ path: `${this.base()}/reindex-jobs/${encodeURIComponent(reindexJobId)}`,
4840
+ auth: auth2
4841
+ });
4842
+ }
4843
+ /**
4844
+ * Trigger a reindex.
4845
+ * @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
4846
+ * (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
4847
+ */
4806
4848
  async reindex(input, auth2 = SERVICE21) {
4807
4849
  await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
4808
4850
  }