@viu/emporix-sdk 2.18.0 → 2.20.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 +35 -0
- package/dist/availability.cjs.map +1 -1
- package/dist/availability.d.cts +95 -9
- package/dist/availability.d.ts +95 -9
- package/dist/availability.js +1 -1
- package/dist/cart.d.cts +1 -1
- package/dist/cart.d.ts +1 -1
- package/dist/category.cjs +12 -0
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +12 -2
- package/dist/category.d.ts +12 -2
- package/dist/category.js +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/{chunk-K3VQLW3P.js → chunk-IVCCGJN5.js} +2 -2
- package/dist/chunk-IVCCGJN5.js.map +1 -0
- package/dist/{chunk-6XND7SYV.js → chunk-ZNLHLFQM.js} +14 -2
- package/dist/chunk-ZNLHLFQM.js.map +1 -0
- package/dist/companies.d.cts +1 -1
- package/dist/companies.d.ts +1 -1
- package/dist/contacts.d.cts +1 -1
- package/dist/contacts.d.ts +1 -1
- package/dist/{context-DhoFgoKf.d.cts → context-Dawv2AtS.d.cts} +16 -0
- package/dist/{context-DhoFgoKf.d.ts → context-Dawv2AtS.d.ts} +16 -0
- package/dist/customer-groups.d.cts +1 -1
- package/dist/customer-groups.d.ts +1 -1
- package/dist/customer.d.cts +1 -1
- package/dist/customer.d.ts +1 -1
- package/dist/index.cjs +501 -297
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +439 -35
- package/dist/index.d.ts +439 -35
- package/dist/index.js +198 -6
- package/dist/index.js.map +1 -1
- package/dist/locations.d.cts +1 -1
- package/dist/locations.d.ts +1 -1
- package/dist/media.d.cts +17 -2
- package/dist/media.d.ts +17 -2
- package/dist/orders.d.cts +10 -27
- package/dist/orders.d.ts +10 -27
- package/dist/payment.d.cts +1 -1
- package/dist/payment.d.ts +1 -1
- package/dist/price.d.cts +5 -18
- package/dist/price.d.ts +5 -18
- package/dist/product.d.cts +7 -1
- package/dist/product.d.ts +7 -1
- package/dist/segment.d.cts +1 -1
- package/dist/segment.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-6XND7SYV.js.map +0 -1
- package/dist/chunk-K3VQLW3P.js.map +0 -1
|
@@ -3,6 +3,7 @@ import { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
|
3
3
|
|
|
4
4
|
// src/services/category.ts
|
|
5
5
|
var ANON = { kind: "anonymous" };
|
|
6
|
+
var SERVICE = { kind: "service" };
|
|
6
7
|
var CategoryService = class {
|
|
7
8
|
constructor(ctx) {
|
|
8
9
|
this.ctx = ctx;
|
|
@@ -63,6 +64,17 @@ var CategoryService = class {
|
|
|
63
64
|
auth
|
|
64
65
|
});
|
|
65
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Rebuild a category tree from its root (`POST /category-trees/{rootCategoryId}/rebuild`).
|
|
69
|
+
* Admin write — defaults to the service token. Returns the rebuilt tree.
|
|
70
|
+
*/
|
|
71
|
+
async rebuildTree(rootCategoryId, auth = SERVICE) {
|
|
72
|
+
return this.ctx.http.request({
|
|
73
|
+
method: "POST",
|
|
74
|
+
path: `/category/${this.ctx.tenant}/category-trees/${encodeURIComponent(rootCategoryId)}/rebuild`,
|
|
75
|
+
auth
|
|
76
|
+
});
|
|
77
|
+
}
|
|
66
78
|
/**
|
|
67
79
|
* Direct child categories of a category (for hierarchy drill-down). Mirrors
|
|
68
80
|
* {@link productsIn}: reads the category's **assignments** and keeps the
|
|
@@ -144,5 +156,5 @@ var CategoryService = class {
|
|
|
144
156
|
};
|
|
145
157
|
|
|
146
158
|
export { CategoryService };
|
|
147
|
-
//# sourceMappingURL=chunk-
|
|
148
|
-
//# sourceMappingURL=chunk-
|
|
159
|
+
//# sourceMappingURL=chunk-ZNLHLFQM.js.map
|
|
160
|
+
//# sourceMappingURL=chunk-ZNLHLFQM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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AAI,SACtC;AAAA;AACH,KACF;AACA,IAAA,OAAO,MAAM,IAAA,EAAK;AAAA,EACpB;AACF","file":"chunk-ZNLHLFQM.js","sourcesContent":["import type { ClientContext, PaginatedItems } from \"../core/context\";\nimport { iterateAll } from \"../core/context\";\nimport type { AuthContext } from \"../core/auth\";\nimport { resolveQuery, type QueryFor } from \"../core/query\";\nimport type { Product } from \"./product\";\nimport type { Category as GeneratedCategory, CategoryTree } from \"../generated/category\";\n\nconst ANON: AuthContext = { kind: \"anonymous\" };\nconst SERVICE: AuthContext = { kind: \"service\" };\n\n/** A category as returned by the Category service (all generated fields). */\nexport type Category = GeneratedCategory;\n\n/** The category tree as returned by the Category service. */\nexport type CategoryNode = CategoryTree;\n\n/** Category reads. Default auth: anonymous. */\nexport class CategoryService {\n static readonly channel = \"category\" as const;\n constructor(private readonly ctx: ClientContext) {}\n\n /** Fetches one category by id. */\n async get(categoryId: string, auth: AuthContext = ANON): Promise<Category> {\n return this.ctx.http.request<Category>({\n method: \"GET\",\n path: `/category/${this.ctx.tenant}/categories/${categoryId}`,\n auth,\n });\n }\n\n /** One page of categories. */\n async list(\n params: { pageNumber?: number; pageSize?: number } = {},\n auth: AuthContext = ANON,\n ): Promise<PaginatedItems<Category>> {\n const pageNumber = params.pageNumber ?? 1;\n const pageSize = params.pageSize ?? 50;\n const items = await this.ctx.http.request<Category[]>({\n method: \"GET\",\n path: `/category/${this.ctx.tenant}/categories`,\n query: { pageNumber, pageSize },\n auth,\n });\n return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };\n }\n\n /**\n * Searches categories by a `q` filter — a raw Emporix DSL string or a built\n * filter (e.g. `@viu/emporix-mixins`' `mixinQuery(...)`). Category does not\n * support `compoundLogicalQuery`, so `or()` filters are rejected.\n */\n async search(\n query: QueryFor<\"CATEGORY\">,\n params: { pageNumber?: number; pageSize?: number } = {},\n auth: AuthContext = ANON,\n ): Promise<PaginatedItems<Category>> {\n const q = resolveQuery(query, { compoundLogicalQuery: false });\n const pageNumber = params.pageNumber ?? 1;\n const pageSize = params.pageSize ?? 50;\n const items = await this.ctx.http.request<Category[]>({\n method: \"GET\",\n path: `/category/${this.ctx.tenant}/categories`,\n query: { q, pageNumber, pageSize },\n auth,\n });\n return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };\n }\n\n /** Async-iterates every category across pages. */\n listAll(params: { pageSize?: number } = {}, auth: AuthContext = ANON): AsyncIterable<Category> {\n const pageSize = params.pageSize ?? 50;\n return iterateAll<Category>((pageNumber) => this.list({ pageNumber, pageSize }, auth));\n }\n\n /**\n * The catalogue's **root categories** — the published category trees\n * (`GET /category-trees`). Use these for top-level storefront navigation;\n * drill into a node's children with {@link subcategories}.\n */\n async tree(auth: AuthContext = ANON): Promise<Category[]> {\n return this.ctx.http.request<Category[]>({\n method: \"GET\",\n path: `/category/${this.ctx.tenant}/category-trees`,\n auth,\n });\n }\n\n /**\n * Rebuild a category tree from its root (`POST /category-trees/{rootCategoryId}/rebuild`).\n * Admin write — defaults to the service token. Returns the rebuilt tree.\n */\n async rebuildTree(rootCategoryId: string, auth: AuthContext = SERVICE): Promise<CategoryNode> {\n return this.ctx.http.request<CategoryNode>({\n method: \"POST\",\n path: `/category/${this.ctx.tenant}/category-trees/${encodeURIComponent(rootCategoryId)}/rebuild`,\n auth,\n });\n }\n\n /**\n * Direct child categories of a category (for hierarchy drill-down). Mirrors\n * {@link productsIn}: reads the category's **assignments** and keeps the\n * `CATEGORY` references, resolving them to full categories. Returns an empty\n * array when the category has no child categories.\n */\n async subcategories(\n categoryId: string,\n params: { pageNumber?: number; pageSize?: number } = {},\n auth: AuthContext = ANON,\n ): Promise<Category[]> {\n const pageNumber = params.pageNumber ?? 1;\n const pageSize = params.pageSize ?? 50;\n const assignments = await this.ctx.http.request<Array<{ ref?: { id?: string; type?: string } }>>({\n method: \"GET\",\n path: `/category/${this.ctx.tenant}/categories/${categoryId}/assignments`,\n query: { pageNumber, pageSize },\n auth,\n });\n const categoryIds = assignments\n .map((a) => (a.ref?.type?.toUpperCase() === \"CATEGORY\" ? a.ref.id : undefined))\n .filter((id): id is string => Boolean(id));\n if (categoryIds.length === 0) return [];\n return this.searchByIds(categoryIds, {}, auth);\n }\n\n /**\n * One page of products in a category. The category service exposes products\n * as **assignments** (`/categories/{id}/assignments`) — references, not full\n * products — so this fetches a page of assignments, keeps the `PRODUCT`\n * references, and resolves them to full products via `/products/search`.\n * `hasNextPage` reflects the assignments page (the source of truth for\n * pagination).\n */\n async productsIn(\n categoryId: string,\n params: { pageNumber?: number; pageSize?: number } = {},\n auth: AuthContext = ANON,\n ): Promise<PaginatedItems<Product>> {\n const pageNumber = params.pageNumber ?? 1;\n const pageSize = params.pageSize ?? 50;\n const assignments = await this.ctx.http.request<Array<{ ref?: { id?: string; type?: string } }>>({\n method: \"GET\",\n path: `/category/${this.ctx.tenant}/categories/${categoryId}/assignments`,\n query: { pageNumber, pageSize },\n auth,\n });\n const hasNextPage = assignments.length === pageSize;\n const productIds = assignments\n .map((a) => (a.ref?.type?.toUpperCase() === \"PRODUCT\" ? a.ref.id : undefined))\n .filter((id): id is string => Boolean(id));\n if (productIds.length === 0) {\n return { items: [], pageNumber, pageSize, hasNextPage };\n }\n const items = await this.ctx.http.request<Product[]>({\n method: \"POST\",\n path: `/product/${this.ctx.tenant}/products/search`,\n query: { pageSize: productIds.length },\n auth,\n body: { q: `id:(${productIds.join(\",\")})` },\n idempotent: true, // pure read over POST — safe to replay on 5xx/429\n });\n return { items, pageNumber, pageSize, hasNextPage };\n }\n\n /**\n * Bulk fetch by id. POSTs `/categories/search` with `q=\"id:(id1,id2,…)\"`,\n * chunking when the list is larger than `options.chunkSize` (default\n * 100). An empty list short-circuits with no HTTP call. **Order is not\n * guaranteed** across chunks — re-index by `id` if order matters.\n */\n async searchByIds(\n ids: string[],\n options: { chunkSize?: number } = {},\n auth: AuthContext = ANON,\n ): Promise<Category[]> {\n if (ids.length === 0) return [];\n const chunkSize = options.chunkSize ?? 100;\n const chunks: string[][] = [];\n for (let i = 0; i < ids.length; i += chunkSize) {\n chunks.push(ids.slice(i, i + chunkSize));\n }\n const pages = await Promise.all(\n chunks.map((chunk) =>\n this.ctx.http.request<Category[]>({\n method: \"POST\",\n path: `/category/${this.ctx.tenant}/categories/search`,\n query: { pageSize: chunk.length },\n auth,\n body: { q: `id:(${chunk.join(\",\")})` },\n }),\n ),\n );\n return pages.flat();\n }\n}\n"]}
|
package/dist/companies.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-Dawv2AtS.cjs';
|
|
2
2
|
import { L as LegalEntity, e as LegalEntityCreate, f as LegalEntityUpdate } from './types.gen-C_wOXYZB.cjs';
|
|
3
3
|
export { A as AccountLimit, d as CustomerGroup, g as LegalInfo } from './types.gen-C_wOXYZB.cjs';
|
|
4
4
|
|
package/dist/companies.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-Dawv2AtS.js';
|
|
2
2
|
import { L as LegalEntity, e as LegalEntityCreate, f as LegalEntityUpdate } from './types.gen-C_wOXYZB.js';
|
|
3
3
|
export { A as AccountLimit, d as CustomerGroup, g as LegalInfo } from './types.gen-C_wOXYZB.js';
|
|
4
4
|
|
package/dist/contacts.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-Dawv2AtS.cjs';
|
|
2
2
|
import { C as ContactAssignment, a as ContactAssignmentCreate, b as ContactAssignmentUpdate } from './types.gen-C_wOXYZB.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/contacts.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-Dawv2AtS.js';
|
|
2
2
|
import { C as ContactAssignment, a as ContactAssignmentCreate, b as ContactAssignmentUpdate } from './types.gen-C_wOXYZB.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -314,6 +314,13 @@ declare class DefaultTokenProvider implements TokenProvider {
|
|
|
314
314
|
private fetchAnonymous;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
+
/** One Server-Sent Events frame. `data` is the concatenated data lines. */
|
|
318
|
+
interface SseEvent {
|
|
319
|
+
event?: string;
|
|
320
|
+
data: string;
|
|
321
|
+
id?: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
317
324
|
/** A single HTTP request through the SDK. */
|
|
318
325
|
interface RequestOptions {
|
|
319
326
|
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
@@ -380,6 +387,15 @@ declare class HttpClient {
|
|
|
380
387
|
requestRaw(o: RequestOptions, extra?: {
|
|
381
388
|
redirect?: "follow" | "manual" | "error";
|
|
382
389
|
}): Promise<Response>;
|
|
390
|
+
/**
|
|
391
|
+
* Open a Server-Sent Events stream (`text/event-stream`) and yield parsed
|
|
392
|
+
* events. Unlike {@link request}, no overall read budget applies (streams are
|
|
393
|
+
* long-lived) — only `connectMs` bounds time-to-headers, and the consumer
|
|
394
|
+
* breaking the iterator aborts the fetch. Like {@link requestRaw}, it does
|
|
395
|
+
* NOT retry or re-auth on 401; a non-2xx maps to a typed error before the
|
|
396
|
+
* stream begins.
|
|
397
|
+
*/
|
|
398
|
+
requestStream(o: RequestOptions): AsyncIterable<SseEvent>;
|
|
383
399
|
}
|
|
384
400
|
|
|
385
401
|
/** Shared dependencies every service facade receives. */
|
|
@@ -314,6 +314,13 @@ declare class DefaultTokenProvider implements TokenProvider {
|
|
|
314
314
|
private fetchAnonymous;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
+
/** One Server-Sent Events frame. `data` is the concatenated data lines. */
|
|
318
|
+
interface SseEvent {
|
|
319
|
+
event?: string;
|
|
320
|
+
data: string;
|
|
321
|
+
id?: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
317
324
|
/** A single HTTP request through the SDK. */
|
|
318
325
|
interface RequestOptions {
|
|
319
326
|
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
@@ -380,6 +387,15 @@ declare class HttpClient {
|
|
|
380
387
|
requestRaw(o: RequestOptions, extra?: {
|
|
381
388
|
redirect?: "follow" | "manual" | "error";
|
|
382
389
|
}): Promise<Response>;
|
|
390
|
+
/**
|
|
391
|
+
* Open a Server-Sent Events stream (`text/event-stream`) and yield parsed
|
|
392
|
+
* events. Unlike {@link request}, no overall read budget applies (streams are
|
|
393
|
+
* long-lived) — only `connectMs` bounds time-to-headers, and the consumer
|
|
394
|
+
* breaking the iterator aborts the fetch. Like {@link requestRaw}, it does
|
|
395
|
+
* NOT retry or re-auth on 401; a non-2xx maps to a typed error before the
|
|
396
|
+
* stream begins.
|
|
397
|
+
*/
|
|
398
|
+
requestStream(o: RequestOptions): AsyncIterable<SseEvent>;
|
|
383
399
|
}
|
|
384
400
|
|
|
385
401
|
/** Shared dependencies every service facade receives. */
|
package/dist/customer.d.cts
CHANGED
package/dist/customer.d.ts
CHANGED