@voyant-travel/inventory 0.1.0 → 0.3.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/action-ledger.d.ts +9 -9
- package/dist/authoring/extension.d.ts +4 -4
- package/dist/authoring/spec.d.ts +16 -16
- package/dist/booking-extension.d.ts +1 -1
- package/dist/extras/routes.d.ts +27 -27
- package/dist/extras/schema.d.ts +2 -2
- package/dist/extras/service.d.ts +8 -8
- package/dist/extras/validation.d.ts +11 -11
- package/dist/extras.d.ts +31 -31
- package/dist/interface.d.ts +102 -102
- package/dist/routes-brochure.d.ts +56 -0
- package/dist/routes-brochure.d.ts.map +1 -0
- package/dist/routes-brochure.js +73 -0
- package/dist/routes-brochure.test.d.ts +2 -0
- package/dist/routes-brochure.test.d.ts.map +1 -0
- package/dist/routes-brochure.test.js +92 -0
- package/dist/routes-catalog.d.ts +8 -8
- package/dist/routes-configuration.d.ts +1 -1
- package/dist/routes-core.d.ts +14 -14
- package/dist/routes-itinerary.d.ts +24 -24
- package/dist/routes-media.d.ts +12 -12
- package/dist/routes-merchandising.d.ts +19 -19
- package/dist/routes-options.d.ts +7 -7
- package/dist/routes-public.d.ts +12 -12
- package/dist/routes-translations.d.ts +5 -5
- package/dist/routes.d.ts +90 -90
- package/dist/schema-core.d.ts +2 -2
- package/dist/schema-itinerary.d.ts +1 -1
- package/dist/schema-settings.d.ts +1 -1
- package/dist/service-catalog.d.ts +4 -4
- package/dist/service-configuration.d.ts +1 -1
- package/dist/service-core.d.ts +6 -6
- package/dist/service-destinations.d.ts +8 -8
- package/dist/service-itinerary-history.d.ts +1 -1
- package/dist/service-itinerary.d.ts +15 -15
- package/dist/service-media.d.ts +10 -10
- package/dist/service-merchandising.d.ts +9 -9
- package/dist/service-option-translations.d.ts +8 -8
- package/dist/service-options.d.ts +8 -8
- package/dist/service-public.d.ts +12 -12
- package/dist/service-taxonomy.d.ts +8 -8
- package/dist/service.d.ts +86 -86
- package/dist/tasks/brochures.d.ts +2 -2
- package/package.json +16 -11
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product brochure generation route, owned by `@voyant-travel/inventory`.
|
|
3
|
+
*
|
|
4
|
+
* POST /:id/brochure/generate — generate + store a product brochure PDF
|
|
5
|
+
*
|
|
6
|
+
* The route registers a RELATIVE path; a deployment mounts the returned `Hono`
|
|
7
|
+
* at `/v1/admin/products`. The brochure task (`generateAndStoreProductBrochure`)
|
|
8
|
+
* already lives in this package; this factory only wires it to an HTTP surface.
|
|
9
|
+
*
|
|
10
|
+
* The deployment supplies the storage-backed specifics via `options`:
|
|
11
|
+
* - `resolveStorage(c)` — the R2-backed `StorageProvider` to upload into (or
|
|
12
|
+
* `null` when storage isn't configured → 503),
|
|
13
|
+
* - `resolvePrinter(c)` — an optional PDF printer (e.g. a browser-rendering
|
|
14
|
+
* service); when omitted the default pdf-lib printer is used,
|
|
15
|
+
* - `template` / `keyPrefix` / `maxSizeBytes` overrides.
|
|
16
|
+
*
|
|
17
|
+
* Keeping these injected means inventory never imports the deployment's R2
|
|
18
|
+
* binding or cloud client.
|
|
19
|
+
*/
|
|
20
|
+
import type { StorageProvider } from "@voyant-travel/storage";
|
|
21
|
+
import { type Context, Hono } from "hono";
|
|
22
|
+
import type { Env } from "./route-env.js";
|
|
23
|
+
import { type ProductBrochurePrinter, type ProductBrochureTemplateDefinition } from "./tasks/index.js";
|
|
24
|
+
/**
|
|
25
|
+
* Deployment-supplied options for the product brochure route. Structural only —
|
|
26
|
+
* the injected functions encapsulate the deployment's storage binding and
|
|
27
|
+
* (optional) PDF renderer so this package stays free of those static imports.
|
|
28
|
+
*/
|
|
29
|
+
export interface ProductBrochureRoutesOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the storage provider to upload the generated brochure into, or
|
|
32
|
+
* `null` when storage isn't configured (the route then responds `503`).
|
|
33
|
+
*/
|
|
34
|
+
resolveStorage(c: Context): StorageProvider | null;
|
|
35
|
+
/**
|
|
36
|
+
* Resolve an optional PDF printer for this request (e.g. a browser-rendering
|
|
37
|
+
* service). When omitted, the brochure task falls back to its built-in
|
|
38
|
+
* pdf-lib printer.
|
|
39
|
+
*/
|
|
40
|
+
resolvePrinter?(c: Context): ProductBrochurePrinter | null;
|
|
41
|
+
/**
|
|
42
|
+
* The brochure template. Defaults to {@link createDefaultProductBrochureTemplate}.
|
|
43
|
+
*/
|
|
44
|
+
template?: ProductBrochureTemplateDefinition;
|
|
45
|
+
/** Storage key prefix builder. Defaults to `brochures/products/:id`. */
|
|
46
|
+
keyPrefix?(productId: string): string;
|
|
47
|
+
/** Max generated PDF size in bytes before rejecting with 413. */
|
|
48
|
+
maxSizeBytes?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Build the product brochure route (relative path; mount at
|
|
52
|
+
* `/v1/admin/products`). Storage + the optional printer are injected via
|
|
53
|
+
* `options`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createProductBrochureRoutes(options: ProductBrochureRoutesOptions): Hono<Env>;
|
|
56
|
+
//# sourceMappingURL=routes-brochure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-brochure.d.ts","sourceRoot":"","sources":["../src/routes-brochure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAGzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,iCAAiC,EACvC,MAAM,kBAAkB,CAAA;AAKzB;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAAA;IAClD;;;;OAIG;IACH,cAAc,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,sBAAsB,GAAG,IAAI,CAAA;IAC1D;;OAEG;IACH,QAAQ,CAAC,EAAE,iCAAiC,CAAA;IAC5C,wEAAwE;IACxE,SAAS,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;IACrC,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI,CAAC,GAAG,CAAC,CAiD5F"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product brochure generation route, owned by `@voyant-travel/inventory`.
|
|
3
|
+
*
|
|
4
|
+
* POST /:id/brochure/generate — generate + store a product brochure PDF
|
|
5
|
+
*
|
|
6
|
+
* The route registers a RELATIVE path; a deployment mounts the returned `Hono`
|
|
7
|
+
* at `/v1/admin/products`. The brochure task (`generateAndStoreProductBrochure`)
|
|
8
|
+
* already lives in this package; this factory only wires it to an HTTP surface.
|
|
9
|
+
*
|
|
10
|
+
* The deployment supplies the storage-backed specifics via `options`:
|
|
11
|
+
* - `resolveStorage(c)` — the R2-backed `StorageProvider` to upload into (or
|
|
12
|
+
* `null` when storage isn't configured → 503),
|
|
13
|
+
* - `resolvePrinter(c)` — an optional PDF printer (e.g. a browser-rendering
|
|
14
|
+
* service); when omitted the default pdf-lib printer is used,
|
|
15
|
+
* - `template` / `keyPrefix` / `maxSizeBytes` overrides.
|
|
16
|
+
*
|
|
17
|
+
* Keeping these injected means inventory never imports the deployment's R2
|
|
18
|
+
* binding or cloud client.
|
|
19
|
+
*/
|
|
20
|
+
import { Hono } from "hono";
|
|
21
|
+
import { emitProductContentChanged } from "./events.js";
|
|
22
|
+
import { createDefaultProductBrochureTemplate, generateAndStoreProductBrochure, } from "./tasks/index.js";
|
|
23
|
+
/** 5 MiB cap on a generated brochure PDF before it's rejected with 413. */
|
|
24
|
+
const DEFAULT_MAX_BROCHURE_PDF_BYTES = 5 * 1024 * 1024;
|
|
25
|
+
/**
|
|
26
|
+
* Build the product brochure route (relative path; mount at
|
|
27
|
+
* `/v1/admin/products`). Storage + the optional printer are injected via
|
|
28
|
+
* `options`.
|
|
29
|
+
*/
|
|
30
|
+
export function createProductBrochureRoutes(options) {
|
|
31
|
+
const hono = new Hono();
|
|
32
|
+
const maxSizeBytes = options.maxSizeBytes ?? DEFAULT_MAX_BROCHURE_PDF_BYTES;
|
|
33
|
+
hono.post("/:id/brochure/generate", async (c) => {
|
|
34
|
+
const storage = options.resolveStorage(c);
|
|
35
|
+
if (!storage) {
|
|
36
|
+
return c.json({ error: "Storage not configured" }, 503);
|
|
37
|
+
}
|
|
38
|
+
const productId = c.req.param("id");
|
|
39
|
+
if (!productId)
|
|
40
|
+
return c.json({ error: "id route param is required" }, 400);
|
|
41
|
+
const printer = options.resolvePrinter?.(c) ?? null;
|
|
42
|
+
const keyPrefix = options.keyPrefix?.(productId) ?? `brochures/products/${productId}`;
|
|
43
|
+
let generated;
|
|
44
|
+
try {
|
|
45
|
+
generated = await generateAndStoreProductBrochure(c.get("db"), productId, {
|
|
46
|
+
storage,
|
|
47
|
+
template: options.template ?? createDefaultProductBrochureTemplate(),
|
|
48
|
+
...(printer ? { printer } : {}),
|
|
49
|
+
keyPrefix,
|
|
50
|
+
filename: ({ productId: generatedProductId, filename }) => `brochure-${generatedProductId}-${Date.now()}-${filename}`,
|
|
51
|
+
maxSizeBytes,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
56
|
+
if (message.includes("Generated brochure is too large")) {
|
|
57
|
+
return c.json({ error: message }, 413);
|
|
58
|
+
}
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
|
61
|
+
await emitProductContentChanged(c.get("eventBus"), { id: productId, axis: "media" });
|
|
62
|
+
return c.json({
|
|
63
|
+
data: generated.brochure,
|
|
64
|
+
metadata: {
|
|
65
|
+
filename: generated.filename,
|
|
66
|
+
sizeBytes: generated.sizeBytes,
|
|
67
|
+
storageKey: generated.storageKey,
|
|
68
|
+
url: generated.url,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
return hono;
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-brochure.test.d.ts","sourceRoot":"","sources":["../src/routes-brochure.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// @vitest-environment node
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
|
+
const brochures = vi.hoisted(() => ({
|
|
5
|
+
generateAndStoreProductBrochure: vi.fn(),
|
|
6
|
+
createDefaultProductBrochureTemplate: vi.fn(() => ({ id: "default" })),
|
|
7
|
+
}));
|
|
8
|
+
vi.mock("./tasks/index.js", () => brochures);
|
|
9
|
+
import { createProductBrochureRoutes } from "./routes-brochure.js";
|
|
10
|
+
function storageStub() {
|
|
11
|
+
return {
|
|
12
|
+
name: "stub",
|
|
13
|
+
upload: vi.fn(async () => ({ key: "k", url: "/u" })),
|
|
14
|
+
delete: vi.fn(async () => { }),
|
|
15
|
+
signedUrl: vi.fn(async () => "/signed"),
|
|
16
|
+
get: vi.fn(async () => null),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function mountApp(resolveStorage, db = {}) {
|
|
20
|
+
const app = new Hono();
|
|
21
|
+
app.use("*", async (c, next) => {
|
|
22
|
+
c.set("db", db);
|
|
23
|
+
await next();
|
|
24
|
+
});
|
|
25
|
+
app.route("/v1/admin/products", createProductBrochureRoutes({ resolveStorage }));
|
|
26
|
+
return app;
|
|
27
|
+
}
|
|
28
|
+
describe("product brochure routes", () => {
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
vi.clearAllMocks();
|
|
31
|
+
});
|
|
32
|
+
it("responds 503 when storage is unconfigured", async () => {
|
|
33
|
+
const app = mountApp(() => null);
|
|
34
|
+
const response = await app.request("/v1/admin/products/prod_1/brochure/generate", {
|
|
35
|
+
method: "POST",
|
|
36
|
+
});
|
|
37
|
+
expect(response.status).toBe(503);
|
|
38
|
+
expect(brochures.generateAndStoreProductBrochure).not.toHaveBeenCalled();
|
|
39
|
+
});
|
|
40
|
+
it("generates + stores a brochure and returns metadata", async () => {
|
|
41
|
+
brochures.generateAndStoreProductBrochure.mockResolvedValue({
|
|
42
|
+
brochure: { id: "brch_1" },
|
|
43
|
+
filename: "brochure-prod_1.pdf",
|
|
44
|
+
sizeBytes: 1234,
|
|
45
|
+
storageKey: "brochures/products/prod_1/brochure-prod_1.pdf",
|
|
46
|
+
url: "/api/v1/media/brochures/products/prod_1/brochure-prod_1.pdf",
|
|
47
|
+
});
|
|
48
|
+
const storage = storageStub();
|
|
49
|
+
const app = mountApp(() => storage);
|
|
50
|
+
const response = await app.request("/v1/admin/products/prod_1/brochure/generate", {
|
|
51
|
+
method: "POST",
|
|
52
|
+
});
|
|
53
|
+
expect(response.status).toBe(200);
|
|
54
|
+
const body = (await response.json());
|
|
55
|
+
expect(body.data.id).toBe("brch_1");
|
|
56
|
+
expect(body.metadata.sizeBytes).toBe(1234);
|
|
57
|
+
expect(brochures.generateAndStoreProductBrochure).toHaveBeenCalledWith(expect.anything(), "prod_1", expect.objectContaining({
|
|
58
|
+
storage,
|
|
59
|
+
keyPrefix: "brochures/products/prod_1",
|
|
60
|
+
maxSizeBytes: 5 * 1024 * 1024,
|
|
61
|
+
}));
|
|
62
|
+
});
|
|
63
|
+
it("maps an oversized brochure to 413", async () => {
|
|
64
|
+
brochures.generateAndStoreProductBrochure.mockRejectedValue(new Error("Generated brochure is too large (9000000 bytes). Max allowed is 5242880 bytes."));
|
|
65
|
+
const app = mountApp(() => storageStub());
|
|
66
|
+
const response = await app.request("/v1/admin/products/prod_1/brochure/generate", {
|
|
67
|
+
method: "POST",
|
|
68
|
+
});
|
|
69
|
+
expect(response.status).toBe(413);
|
|
70
|
+
});
|
|
71
|
+
it("passes an injected printer through to the task", async () => {
|
|
72
|
+
brochures.generateAndStoreProductBrochure.mockResolvedValue({
|
|
73
|
+
brochure: { id: "brch_1" },
|
|
74
|
+
filename: "f.pdf",
|
|
75
|
+
sizeBytes: 1,
|
|
76
|
+
storageKey: "brochures/products/prod_1/f.pdf",
|
|
77
|
+
url: "/u",
|
|
78
|
+
});
|
|
79
|
+
const printer = vi.fn();
|
|
80
|
+
const app = new Hono();
|
|
81
|
+
app.use("*", async (c, next) => {
|
|
82
|
+
c.set("db", {});
|
|
83
|
+
await next();
|
|
84
|
+
});
|
|
85
|
+
app.route("/v1/admin/products", createProductBrochureRoutes({
|
|
86
|
+
resolveStorage: () => storageStub(),
|
|
87
|
+
resolvePrinter: () => printer,
|
|
88
|
+
}));
|
|
89
|
+
await app.request("/v1/admin/products/prod_1/brochure/generate", { method: "POST" });
|
|
90
|
+
expect(brochures.generateAndStoreProductBrochure).toHaveBeenCalledWith(expect.anything(), "prod_1", expect.objectContaining({ printer }));
|
|
91
|
+
});
|
|
92
|
+
});
|
package/dist/routes-catalog.d.ts
CHANGED
|
@@ -71,15 +71,15 @@ export declare const productCatalogRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
71
71
|
data: {
|
|
72
72
|
id: string;
|
|
73
73
|
name: string;
|
|
74
|
-
active: boolean;
|
|
75
|
-
description: string | null;
|
|
76
74
|
createdAt: string;
|
|
75
|
+
description: string | null;
|
|
76
|
+
active: boolean;
|
|
77
77
|
updatedAt: string;
|
|
78
|
+
code: string;
|
|
79
|
+
sortOrder: number;
|
|
78
80
|
metadata: {
|
|
79
81
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
80
82
|
} | null;
|
|
81
|
-
code: string;
|
|
82
|
-
sortOrder: number;
|
|
83
83
|
} | undefined;
|
|
84
84
|
};
|
|
85
85
|
outputFormat: "json";
|
|
@@ -226,17 +226,17 @@ export declare const productCatalogRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
226
226
|
data: {
|
|
227
227
|
id: string;
|
|
228
228
|
name: string;
|
|
229
|
-
|
|
229
|
+
createdAt: string;
|
|
230
230
|
description: string | null;
|
|
231
|
+
active: boolean;
|
|
231
232
|
customerPaymentPolicy: import("hono/utils/types").JSONValue;
|
|
232
|
-
createdAt: string;
|
|
233
233
|
updatedAt: string;
|
|
234
|
+
sortOrder: number;
|
|
235
|
+
slug: string;
|
|
234
236
|
metadata: {
|
|
235
237
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
236
238
|
} | null;
|
|
237
|
-
sortOrder: number;
|
|
238
239
|
parentId: string | null;
|
|
239
|
-
slug: string;
|
|
240
240
|
} | undefined;
|
|
241
241
|
};
|
|
242
242
|
outputFormat: "json";
|
|
@@ -554,9 +554,9 @@ export declare const productConfigurationRoutes: import("hono/hono-base").HonoBa
|
|
|
554
554
|
createdAt: string;
|
|
555
555
|
updatedAt: string;
|
|
556
556
|
productId: string;
|
|
557
|
+
notes: string | null;
|
|
557
558
|
capability: "on_request" | "private" | "instant_confirmation" | "pickup_available" | "dropoff_available" | "guided" | "shared" | "digital_ticket" | "voucher_required" | "external_inventory" | "multi_day" | "accommodation" | "transport";
|
|
558
559
|
enabled: boolean;
|
|
559
|
-
notes: string | null;
|
|
560
560
|
};
|
|
561
561
|
};
|
|
562
562
|
outputFormat: "json";
|
package/dist/routes-core.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare const productCoreRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
36
36
|
exclusionsHtml: string | null;
|
|
37
37
|
termsHtml: string | null;
|
|
38
38
|
termsShowOnContract: boolean;
|
|
39
|
-
bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary"
|
|
39
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
40
40
|
capacityMode: "free_sale" | "limited" | "on_request";
|
|
41
41
|
timezone: string | null;
|
|
42
42
|
defaultLanguageTag: string | null;
|
|
@@ -77,12 +77,13 @@ export declare const productCoreRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
77
77
|
id: string;
|
|
78
78
|
name: string;
|
|
79
79
|
status: "draft" | "active" | "archived";
|
|
80
|
+
createdAt: string;
|
|
80
81
|
description: string | null;
|
|
81
82
|
inclusionsHtml: string | null;
|
|
82
83
|
exclusionsHtml: string | null;
|
|
83
84
|
termsHtml: string | null;
|
|
84
85
|
termsShowOnContract: boolean;
|
|
85
|
-
bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary"
|
|
86
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
86
87
|
capacityMode: "free_sale" | "limited" | "on_request";
|
|
87
88
|
timezone: string | null;
|
|
88
89
|
defaultLanguageTag: string | null;
|
|
@@ -103,7 +104,6 @@ export declare const productCoreRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
103
104
|
taxClassId: string | null;
|
|
104
105
|
customerPaymentPolicy: import("hono/utils/types").JSONValue;
|
|
105
106
|
tags: string[] | null;
|
|
106
|
-
createdAt: string;
|
|
107
107
|
updatedAt: string;
|
|
108
108
|
};
|
|
109
109
|
};
|
|
@@ -145,7 +145,7 @@ export declare const productCoreRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
145
145
|
exclusionsHtml: string | null;
|
|
146
146
|
termsHtml: string | null;
|
|
147
147
|
termsShowOnContract: boolean;
|
|
148
|
-
bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary"
|
|
148
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
149
149
|
capacityMode: "free_sale" | "limited" | "on_request";
|
|
150
150
|
timezone: string | null;
|
|
151
151
|
defaultLanguageTag: string | null;
|
|
@@ -195,27 +195,27 @@ export declare const productCoreRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
195
195
|
};
|
|
196
196
|
output: {
|
|
197
197
|
data: {
|
|
198
|
-
principalSubtype: string | null;
|
|
199
|
-
sessionId: string | null;
|
|
200
|
-
apiTokenId: string | null;
|
|
201
|
-
callerType: string | null;
|
|
202
|
-
organizationId: string | null;
|
|
203
|
-
workflowRunId: string | null;
|
|
204
|
-
workflowStepId: string | null;
|
|
205
198
|
id: string;
|
|
206
|
-
status: "requested" | "awaiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "reversed" | "compensated" | "expired" | "cancelled" | "superseded";
|
|
207
199
|
actionName: string;
|
|
208
200
|
actionVersion: string;
|
|
209
|
-
actionKind: "
|
|
201
|
+
actionKind: "read" | "create" | "update" | "delete" | "execute" | "approve" | "reject" | "reverse" | "compensate" | "duplicate";
|
|
202
|
+
status: "requested" | "awaiting_approval" | "approved" | "denied" | "succeeded" | "failed" | "reversed" | "compensated" | "expired" | "cancelled" | "superseded";
|
|
210
203
|
evaluatedRisk: "low" | "medium" | "high" | "critical";
|
|
211
204
|
actorType: string | null;
|
|
212
205
|
principalType: "user" | "api_key" | "agent" | "workflow" | "system";
|
|
213
206
|
principalId: string;
|
|
207
|
+
principalSubtype: string | null;
|
|
208
|
+
sessionId: string | null;
|
|
209
|
+
apiTokenId: string | null;
|
|
214
210
|
internalRequest: boolean;
|
|
215
211
|
delegatedByPrincipalType: "user" | "api_key" | "agent" | "workflow" | "system" | null;
|
|
216
212
|
delegatedByPrincipalId: string | null;
|
|
217
213
|
delegationId: string | null;
|
|
214
|
+
callerType: string | null;
|
|
215
|
+
organizationId: string | null;
|
|
218
216
|
routeOrToolName: string | null;
|
|
217
|
+
workflowRunId: string | null;
|
|
218
|
+
workflowStepId: string | null;
|
|
219
219
|
correlationId: string | null;
|
|
220
220
|
causationActionId: string | null;
|
|
221
221
|
idempotencyScope: string | null;
|
|
@@ -272,7 +272,7 @@ export declare const productCoreRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
272
272
|
exclusionsHtml: string | null;
|
|
273
273
|
termsHtml: string | null;
|
|
274
274
|
termsShowOnContract: boolean;
|
|
275
|
-
bookingMode: "date" | "date_time" | "open" | "stay" | "transfer" | "itinerary"
|
|
275
|
+
bookingMode: "date" | "other" | "date_time" | "open" | "stay" | "transfer" | "itinerary";
|
|
276
276
|
capacityMode: "free_sale" | "limited" | "on_request";
|
|
277
277
|
timezone: string | null;
|
|
278
278
|
defaultLanguageTag: string | null;
|
|
@@ -202,13 +202,13 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
202
202
|
output: {
|
|
203
203
|
data: {
|
|
204
204
|
id: string;
|
|
205
|
-
description: string | null;
|
|
206
205
|
createdAt: string;
|
|
206
|
+
description: string | null;
|
|
207
207
|
updatedAt: string;
|
|
208
|
+
itineraryId: string;
|
|
209
|
+
dayNumber: number;
|
|
208
210
|
title: string | null;
|
|
209
211
|
location: string | null;
|
|
210
|
-
dayNumber: number;
|
|
211
|
-
itineraryId: string;
|
|
212
212
|
};
|
|
213
213
|
};
|
|
214
214
|
outputFormat: "json";
|
|
@@ -261,13 +261,13 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
261
261
|
output: {
|
|
262
262
|
data: {
|
|
263
263
|
id: string;
|
|
264
|
-
description: string | null;
|
|
265
264
|
createdAt: string;
|
|
265
|
+
description: string | null;
|
|
266
266
|
updatedAt: string;
|
|
267
|
+
itineraryId: string;
|
|
268
|
+
dayNumber: number;
|
|
267
269
|
title: string | null;
|
|
268
270
|
location: string | null;
|
|
269
|
-
dayNumber: number;
|
|
270
|
-
itineraryId: string;
|
|
271
271
|
};
|
|
272
272
|
};
|
|
273
273
|
outputFormat: "json";
|
|
@@ -358,7 +358,7 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
358
358
|
id: string;
|
|
359
359
|
dayId: string;
|
|
360
360
|
supplierServiceId: string | null;
|
|
361
|
-
serviceType: "
|
|
361
|
+
serviceType: "other" | "transfer" | "accommodation" | "experience" | "guide" | "meal";
|
|
362
362
|
name: string;
|
|
363
363
|
description: string | null;
|
|
364
364
|
countryCode: string | null;
|
|
@@ -401,17 +401,17 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
401
401
|
data: {
|
|
402
402
|
id: string;
|
|
403
403
|
name: string;
|
|
404
|
+
createdAt: string;
|
|
404
405
|
description: string | null;
|
|
405
406
|
costAmountCents: number;
|
|
406
|
-
createdAt: string;
|
|
407
|
-
notes: string | null;
|
|
408
407
|
sortOrder: number | null;
|
|
409
|
-
countryCode: string | null;
|
|
410
408
|
dayId: string;
|
|
411
|
-
serviceType: "transfer" | "other" | "accommodation" | "experience" | "guide" | "meal";
|
|
412
409
|
supplierServiceId: string | null;
|
|
410
|
+
serviceType: "other" | "transfer" | "accommodation" | "experience" | "guide" | "meal";
|
|
411
|
+
countryCode: string | null;
|
|
413
412
|
costCurrency: string;
|
|
414
413
|
quantity: number;
|
|
414
|
+
notes: string | null;
|
|
415
415
|
};
|
|
416
416
|
};
|
|
417
417
|
outputFormat: "json";
|
|
@@ -450,7 +450,7 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
450
450
|
id: string;
|
|
451
451
|
dayId: string;
|
|
452
452
|
supplierServiceId: string | null;
|
|
453
|
-
serviceType: "
|
|
453
|
+
serviceType: "other" | "transfer" | "accommodation" | "experience" | "guide" | "meal";
|
|
454
454
|
name: string;
|
|
455
455
|
description: string | null;
|
|
456
456
|
countryCode: string | null;
|
|
@@ -555,13 +555,13 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
555
555
|
output: {
|
|
556
556
|
data: {
|
|
557
557
|
id: string;
|
|
558
|
-
description: string | null;
|
|
559
558
|
createdAt: string;
|
|
559
|
+
description: string | null;
|
|
560
560
|
updatedAt: string;
|
|
561
561
|
title: string | null;
|
|
562
|
-
languageTag: string;
|
|
563
|
-
dayId: string;
|
|
564
562
|
location: string | null;
|
|
563
|
+
dayId: string;
|
|
564
|
+
languageTag: string;
|
|
565
565
|
};
|
|
566
566
|
};
|
|
567
567
|
outputFormat: "json";
|
|
@@ -574,10 +574,10 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
574
574
|
input: {
|
|
575
575
|
param: {
|
|
576
576
|
id: string;
|
|
577
|
-
} & {
|
|
578
|
-
translationId: string;
|
|
579
577
|
} & {
|
|
580
578
|
dayId: string;
|
|
579
|
+
} & {
|
|
580
|
+
translationId: string;
|
|
581
581
|
};
|
|
582
582
|
};
|
|
583
583
|
output: {
|
|
@@ -589,10 +589,10 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
589
589
|
input: {
|
|
590
590
|
param: {
|
|
591
591
|
id: string;
|
|
592
|
-
} & {
|
|
593
|
-
translationId: string;
|
|
594
592
|
} & {
|
|
595
593
|
dayId: string;
|
|
594
|
+
} & {
|
|
595
|
+
translationId: string;
|
|
596
596
|
};
|
|
597
597
|
};
|
|
598
598
|
output: {
|
|
@@ -617,10 +617,10 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
617
617
|
input: {
|
|
618
618
|
param: {
|
|
619
619
|
id: string;
|
|
620
|
-
} & {
|
|
621
|
-
translationId: string;
|
|
622
620
|
} & {
|
|
623
621
|
dayId: string;
|
|
622
|
+
} & {
|
|
623
|
+
translationId: string;
|
|
624
624
|
};
|
|
625
625
|
};
|
|
626
626
|
output: {
|
|
@@ -632,10 +632,10 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
632
632
|
input: {
|
|
633
633
|
param: {
|
|
634
634
|
id: string;
|
|
635
|
-
} & {
|
|
636
|
-
translationId: string;
|
|
637
635
|
} & {
|
|
638
636
|
dayId: string;
|
|
637
|
+
} & {
|
|
638
|
+
translationId: string;
|
|
639
639
|
};
|
|
640
640
|
};
|
|
641
641
|
output: {
|
|
@@ -747,8 +747,8 @@ export declare const productItineraryRoutes: import("hono/hono-base").HonoBase<E
|
|
|
747
747
|
id: string;
|
|
748
748
|
createdAt: string;
|
|
749
749
|
productId: string;
|
|
750
|
-
content: string;
|
|
751
750
|
authorId: string;
|
|
751
|
+
content: string;
|
|
752
752
|
};
|
|
753
753
|
};
|
|
754
754
|
outputFormat: "json";
|
package/dist/routes-media.d.ts
CHANGED
|
@@ -171,14 +171,14 @@ export declare const productMediaRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
171
171
|
sortOrder: number;
|
|
172
172
|
dayId: string | null;
|
|
173
173
|
mediaType: "image" | "video" | "document";
|
|
174
|
-
isBrochure: boolean;
|
|
175
|
-
isBrochureCurrent: boolean;
|
|
176
174
|
url: string;
|
|
177
175
|
storageKey: string | null;
|
|
178
176
|
mimeType: string | null;
|
|
179
177
|
fileSize: number | null;
|
|
180
178
|
altText: string | null;
|
|
181
179
|
isCover: boolean;
|
|
180
|
+
isBrochure: boolean;
|
|
181
|
+
isBrochureCurrent: boolean;
|
|
182
182
|
brochureVersion: number | null;
|
|
183
183
|
};
|
|
184
184
|
};
|
|
@@ -292,14 +292,14 @@ export declare const productMediaRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
292
292
|
sortOrder: number;
|
|
293
293
|
dayId: string | null;
|
|
294
294
|
mediaType: "image" | "video" | "document";
|
|
295
|
-
isBrochure: boolean;
|
|
296
|
-
isBrochureCurrent: boolean;
|
|
297
295
|
url: string;
|
|
298
296
|
storageKey: string | null;
|
|
299
297
|
mimeType: string | null;
|
|
300
298
|
fileSize: number | null;
|
|
301
299
|
altText: string | null;
|
|
302
300
|
isCover: boolean;
|
|
301
|
+
isBrochure: boolean;
|
|
302
|
+
isBrochureCurrent: boolean;
|
|
303
303
|
brochureVersion: number | null;
|
|
304
304
|
};
|
|
305
305
|
};
|
|
@@ -336,14 +336,14 @@ export declare const productMediaRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
336
336
|
sortOrder: number;
|
|
337
337
|
dayId: string | null;
|
|
338
338
|
mediaType: "image" | "video" | "document";
|
|
339
|
-
isBrochure: boolean;
|
|
340
|
-
isBrochureCurrent: boolean;
|
|
341
339
|
url: string;
|
|
342
340
|
storageKey: string | null;
|
|
343
341
|
mimeType: string | null;
|
|
344
342
|
fileSize: number | null;
|
|
345
343
|
altText: string | null;
|
|
346
344
|
isCover: boolean;
|
|
345
|
+
isBrochure: boolean;
|
|
346
|
+
isBrochureCurrent: boolean;
|
|
347
347
|
brochureVersion: number | null;
|
|
348
348
|
};
|
|
349
349
|
};
|
|
@@ -432,14 +432,14 @@ export declare const productMediaRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
432
432
|
sortOrder: number;
|
|
433
433
|
dayId: string | null;
|
|
434
434
|
mediaType: "image" | "video" | "document";
|
|
435
|
-
isBrochure: boolean;
|
|
436
|
-
isBrochureCurrent: boolean;
|
|
437
435
|
url: string;
|
|
438
436
|
storageKey: string | null;
|
|
439
437
|
mimeType: string | null;
|
|
440
438
|
fileSize: number | null;
|
|
441
439
|
altText: string | null;
|
|
442
440
|
isCover: boolean;
|
|
441
|
+
isBrochure: boolean;
|
|
442
|
+
isBrochureCurrent: boolean;
|
|
443
443
|
brochureVersion: number | null;
|
|
444
444
|
};
|
|
445
445
|
};
|
|
@@ -512,14 +512,14 @@ export declare const productMediaRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
512
512
|
sortOrder: number;
|
|
513
513
|
dayId: string | null;
|
|
514
514
|
mediaType: "image" | "video" | "document";
|
|
515
|
-
isBrochure: boolean;
|
|
516
|
-
isBrochureCurrent: boolean;
|
|
517
515
|
url: string;
|
|
518
516
|
storageKey: string | null;
|
|
519
517
|
mimeType: string | null;
|
|
520
518
|
fileSize: number | null;
|
|
521
519
|
altText: string | null;
|
|
522
520
|
isCover: boolean;
|
|
521
|
+
isBrochure: boolean;
|
|
522
|
+
isBrochureCurrent: boolean;
|
|
523
523
|
brochureVersion: number | null;
|
|
524
524
|
};
|
|
525
525
|
};
|
|
@@ -615,14 +615,14 @@ export declare const productMediaRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
615
615
|
sortOrder: number;
|
|
616
616
|
dayId: string | null;
|
|
617
617
|
mediaType: "image" | "video" | "document";
|
|
618
|
-
isBrochure: boolean;
|
|
619
|
-
isBrochureCurrent: boolean;
|
|
620
618
|
url: string;
|
|
621
619
|
storageKey: string | null;
|
|
622
620
|
mimeType: string | null;
|
|
623
621
|
fileSize: number | null;
|
|
624
622
|
altText: string | null;
|
|
625
623
|
isCover: boolean;
|
|
624
|
+
isBrochure: boolean;
|
|
625
|
+
isBrochureCurrent: boolean;
|
|
626
626
|
brochureVersion: number | null;
|
|
627
627
|
};
|
|
628
628
|
};
|