@voyantjs/legal 0.15.0 → 0.17.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/contracts/routes.d.ts +15 -15
- package/dist/contracts/routes.d.ts.map +1 -1
- package/dist/contracts/service-contracts.d.ts +1 -1
- package/dist/contracts/service-series.d.ts +1 -1
- package/dist/contracts/service-templates.d.ts +2 -2
- package/dist/contracts/service.d.ts +4 -4
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/policies/routes.d.ts +2 -2
- package/dist/policies/service-core.d.ts +2 -2
- package/dist/policies/service.d.ts +2 -2
- package/package.json +9 -9
|
@@ -12,10 +12,10 @@ type Env = {
|
|
|
12
12
|
export type ContractDocumentGenerator = Parameters<typeof contractsService.generateContractDocument>[3]["generator"];
|
|
13
13
|
export interface ContractsRouteOptions {
|
|
14
14
|
documentGenerator?: ContractDocumentGenerator;
|
|
15
|
-
resolveDocumentGenerator?: (bindings: unknown) => ContractDocumentGenerator | undefined;
|
|
16
|
-
resolveDocumentDownloadUrl?: (bindings:
|
|
15
|
+
resolveDocumentGenerator?: (bindings: Record<string, unknown>) => ContractDocumentGenerator | undefined;
|
|
16
|
+
resolveDocumentDownloadUrl?: (bindings: Record<string, unknown>, storageKey: string) => Promise<string | null> | string | null;
|
|
17
17
|
eventBus?: EventBus;
|
|
18
|
-
resolveEventBus?: (bindings: unknown) => EventBus | undefined;
|
|
18
|
+
resolveEventBus?: (bindings: Record<string, unknown>) => EventBus | undefined;
|
|
19
19
|
}
|
|
20
20
|
export declare function createContractsAdminRoutes(options?: ContractsRouteOptions): import("hono/hono-base").HonoBase<Env, {
|
|
21
21
|
"/templates": {
|
|
@@ -81,13 +81,13 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
81
81
|
input: {};
|
|
82
82
|
output: {
|
|
83
83
|
data: {
|
|
84
|
-
id: string;
|
|
85
84
|
name: string;
|
|
85
|
+
id: string;
|
|
86
|
+
description: string | null;
|
|
86
87
|
createdAt: string;
|
|
87
88
|
updatedAt: string;
|
|
88
89
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
89
90
|
slug: string;
|
|
90
|
-
description: string | null;
|
|
91
91
|
active: boolean;
|
|
92
92
|
body: string;
|
|
93
93
|
language: string;
|
|
@@ -355,8 +355,8 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
355
355
|
input: {};
|
|
356
356
|
output: {
|
|
357
357
|
data: {
|
|
358
|
-
id: string;
|
|
359
358
|
name: string;
|
|
359
|
+
id: string;
|
|
360
360
|
prefix: string;
|
|
361
361
|
createdAt: string;
|
|
362
362
|
updatedAt: string;
|
|
@@ -1120,8 +1120,8 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
1120
1120
|
renderedBody: string;
|
|
1121
1121
|
attachment: {
|
|
1122
1122
|
metadata: import("hono/utils/types").JSONValue;
|
|
1123
|
-
id: string;
|
|
1124
1123
|
name: string;
|
|
1124
|
+
id: string;
|
|
1125
1125
|
createdAt: string;
|
|
1126
1126
|
kind: string;
|
|
1127
1127
|
mimeType: string | null;
|
|
@@ -1199,8 +1199,8 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
1199
1199
|
renderedBody: string;
|
|
1200
1200
|
attachment: {
|
|
1201
1201
|
metadata: import("hono/utils/types").JSONValue;
|
|
1202
|
-
id: string;
|
|
1203
1202
|
name: string;
|
|
1203
|
+
id: string;
|
|
1204
1204
|
createdAt: string;
|
|
1205
1205
|
kind: string;
|
|
1206
1206
|
mimeType: string | null;
|
|
@@ -1294,8 +1294,8 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
1294
1294
|
output: {
|
|
1295
1295
|
data: {
|
|
1296
1296
|
metadata: import("hono/utils/types").JSONValue;
|
|
1297
|
-
id: string;
|
|
1298
1297
|
name: string;
|
|
1298
|
+
id: string;
|
|
1299
1299
|
createdAt: string;
|
|
1300
1300
|
kind: string;
|
|
1301
1301
|
mimeType: string | null;
|
|
@@ -1472,13 +1472,13 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1472
1472
|
input: {};
|
|
1473
1473
|
output: {
|
|
1474
1474
|
data: {
|
|
1475
|
-
id: string;
|
|
1476
1475
|
name: string;
|
|
1476
|
+
id: string;
|
|
1477
|
+
description: string | null;
|
|
1477
1478
|
createdAt: string;
|
|
1478
1479
|
updatedAt: string;
|
|
1479
1480
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
1480
1481
|
slug: string;
|
|
1481
|
-
description: string | null;
|
|
1482
1482
|
active: boolean;
|
|
1483
1483
|
body: string;
|
|
1484
1484
|
language: string;
|
|
@@ -1746,8 +1746,8 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1746
1746
|
input: {};
|
|
1747
1747
|
output: {
|
|
1748
1748
|
data: {
|
|
1749
|
-
id: string;
|
|
1750
1749
|
name: string;
|
|
1750
|
+
id: string;
|
|
1751
1751
|
prefix: string;
|
|
1752
1752
|
createdAt: string;
|
|
1753
1753
|
updatedAt: string;
|
|
@@ -2511,8 +2511,8 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
2511
2511
|
renderedBody: string;
|
|
2512
2512
|
attachment: {
|
|
2513
2513
|
metadata: import("hono/utils/types").JSONValue;
|
|
2514
|
-
id: string;
|
|
2515
2514
|
name: string;
|
|
2515
|
+
id: string;
|
|
2516
2516
|
createdAt: string;
|
|
2517
2517
|
kind: string;
|
|
2518
2518
|
mimeType: string | null;
|
|
@@ -2590,8 +2590,8 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
2590
2590
|
renderedBody: string;
|
|
2591
2591
|
attachment: {
|
|
2592
2592
|
metadata: import("hono/utils/types").JSONValue;
|
|
2593
|
-
id: string;
|
|
2594
2593
|
name: string;
|
|
2594
|
+
id: string;
|
|
2595
2595
|
createdAt: string;
|
|
2596
2596
|
kind: string;
|
|
2597
2597
|
mimeType: string | null;
|
|
@@ -2685,8 +2685,8 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
2685
2685
|
output: {
|
|
2686
2686
|
data: {
|
|
2687
2687
|
metadata: import("hono/utils/types").JSONValue;
|
|
2688
|
-
id: string;
|
|
2689
2688
|
name: string;
|
|
2689
|
+
id: string;
|
|
2690
2690
|
createdAt: string;
|
|
2691
2691
|
kind: string;
|
|
2692
2692
|
mimeType: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/contracts/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAQjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAoB/C,KAAK,GAAG,GAAG;IACT,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,SAAS,EAAE;QACT,SAAS,EAAE,eAAe,CAAA;QAC1B,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAChD,OAAO,gBAAgB,CAAC,wBAAwB,CACjD,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;AAEjB,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,CAAC,EAAE,yBAAyB,CAAA;IAC7C,wBAAwB,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/contracts/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gB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,GAAG,OAAO,oBAAoB,CAAA;AAC9D,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAA"}
|
|
@@ -1217,8 +1217,8 @@ export declare const contractRecordsService: {
|
|
|
1217
1217
|
} | null>;
|
|
1218
1218
|
createAttachment(db: PostgresJsDatabase, contractId: string, data: CreateContractAttachmentInput): Promise<{
|
|
1219
1219
|
metadata: unknown;
|
|
1220
|
-
id: string;
|
|
1221
1220
|
name: string;
|
|
1221
|
+
id: string;
|
|
1222
1222
|
createdAt: Date;
|
|
1223
1223
|
kind: string;
|
|
1224
1224
|
mimeType: string | null;
|
|
@@ -50,8 +50,8 @@ export declare const contractSeriesService: {
|
|
|
50
50
|
updatedAt: Date;
|
|
51
51
|
} | null>;
|
|
52
52
|
createSeries(db: PostgresJsDatabase, data: CreateContractNumberSeriesInput): Promise<{
|
|
53
|
-
id: string;
|
|
54
53
|
name: string;
|
|
54
|
+
id: string;
|
|
55
55
|
prefix: string;
|
|
56
56
|
createdAt: Date;
|
|
57
57
|
updatedAt: Date;
|
|
@@ -71,13 +71,13 @@ export declare const contractTemplatesService: {
|
|
|
71
71
|
updatedAt: Date;
|
|
72
72
|
} | null>;
|
|
73
73
|
createTemplate(db: PostgresJsDatabase, data: CreateContractTemplateInput): Promise<{
|
|
74
|
-
id: string;
|
|
75
74
|
name: string;
|
|
75
|
+
id: string;
|
|
76
|
+
description: string | null;
|
|
76
77
|
createdAt: Date;
|
|
77
78
|
updatedAt: Date;
|
|
78
79
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
79
80
|
slug: string;
|
|
80
|
-
description: string | null;
|
|
81
81
|
active: boolean;
|
|
82
82
|
body: string;
|
|
83
83
|
language: string;
|
|
@@ -1229,8 +1229,8 @@ export declare const contractsService: {
|
|
|
1229
1229
|
} | null>;
|
|
1230
1230
|
createAttachment(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, contractId: string, data: import("./service-shared.js").CreateContractAttachmentInput): Promise<{
|
|
1231
1231
|
metadata: unknown;
|
|
1232
|
-
id: string;
|
|
1233
1232
|
name: string;
|
|
1233
|
+
id: string;
|
|
1234
1234
|
createdAt: Date;
|
|
1235
1235
|
kind: string;
|
|
1236
1236
|
mimeType: string | null;
|
|
@@ -1297,8 +1297,8 @@ export declare const contractsService: {
|
|
|
1297
1297
|
updatedAt: Date;
|
|
1298
1298
|
} | null>;
|
|
1299
1299
|
createSeries(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./service-shared.js").CreateContractNumberSeriesInput): Promise<{
|
|
1300
|
-
id: string;
|
|
1301
1300
|
name: string;
|
|
1301
|
+
id: string;
|
|
1302
1302
|
prefix: string;
|
|
1303
1303
|
createdAt: Date;
|
|
1304
1304
|
updatedAt: Date;
|
|
@@ -1393,13 +1393,13 @@ export declare const contractsService: {
|
|
|
1393
1393
|
updatedAt: Date;
|
|
1394
1394
|
} | null>;
|
|
1395
1395
|
createTemplate(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./service-shared.js").CreateContractTemplateInput): Promise<{
|
|
1396
|
-
id: string;
|
|
1397
1396
|
name: string;
|
|
1397
|
+
id: string;
|
|
1398
|
+
description: string | null;
|
|
1398
1399
|
createdAt: Date;
|
|
1399
1400
|
updatedAt: Date;
|
|
1400
1401
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
1401
1402
|
slug: string;
|
|
1402
|
-
description: string | null;
|
|
1403
1403
|
active: boolean;
|
|
1404
1404
|
body: string;
|
|
1405
1405
|
language: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Module } from "@voyantjs/core";
|
|
2
|
+
import type { AnyDrizzleDb } from "@voyantjs/db";
|
|
2
3
|
import type { HonoModule } from "@voyantjs/hono/module";
|
|
3
|
-
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
4
4
|
import { type ContractsRouteOptions } from "./contracts/routes.js";
|
|
5
5
|
import { type AutoGenerateContractOptions } from "./contracts/service-auto-generate.js";
|
|
6
6
|
export declare const legalLinkable: {
|
|
@@ -15,9 +15,12 @@ export interface CreateLegalHonoModuleOptions extends ContractsRouteOptions {
|
|
|
15
15
|
/**
|
|
16
16
|
* Required when `autoGenerateContractOnConfirmed.enabled` is true. The
|
|
17
17
|
* `booking.confirmed` subscriber fires outside request scope, so it
|
|
18
|
-
* needs its own db handle from runtime bindings.
|
|
18
|
+
* needs its own db handle from runtime bindings. Returns `AnyDrizzleDb`
|
|
19
|
+
* (the `PostgresJsDatabase | NeonHttpDatabase` union from
|
|
20
|
+
* `@voyantjs/db`) so consumers don't need to cast through `unknown` when
|
|
21
|
+
* wiring a Hyperdrive/Neon client.
|
|
19
22
|
*/
|
|
20
|
-
resolveDb?: (bindings: Record<string, unknown>) =>
|
|
23
|
+
resolveDb?: (bindings: Record<string, unknown>) => AnyDrizzleDb;
|
|
21
24
|
/**
|
|
22
25
|
* Opt-in auto-generate on `booking.confirmed`. When enabled + a
|
|
23
26
|
* `templateSlug` is supplied + a `documentGenerator` is resolvable, every
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAQvD,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,sCAAsC,CAAA;AAI7C,eAAO,MAAM,aAAa;;;;;;CAGzB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,MAGzB,CAAA;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,YAAY,CAAA;IAC/D;;;;;;OAMG;IACH,+BAA+B,CAAC,EAAE,2BAA2B,CAAA;CAC9D;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,4BAAiC,GAAG,UAAU,CAyE5F;AAED,eAAO,MAAM,eAAe,EAAE,UAAoC,CAAA;AAElE,cAAc,sBAAsB,CAAA;AACpC,OAAO,EACL,0BAA0B,EAC1B,qCAAqC,EACrC,KAAK,qBAAqB,GAC3B,MAAM,8BAA8B,CAAA;AACrC,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,8BAA8B,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,GAChC,MAAM,sCAAsC,CAAA;AAC7C,cAAc,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,9 @@ export function createLegalHonoModule(options = {}) {
|
|
|
43
43
|
const generator = runtime.documentGenerator;
|
|
44
44
|
eventBus.subscribe("booking.confirmed", async (event) => {
|
|
45
45
|
try {
|
|
46
|
+
// The resolver may return either drizzle flavor; the queries
|
|
47
|
+
// autoGenerateContractForBooking runs are compatible with both
|
|
48
|
+
// at runtime, so we narrow at this internal boundary.
|
|
46
49
|
const db = resolveDb(bindings);
|
|
47
50
|
const result = await autoGenerateContractForBooking(db, event.data, auto, {
|
|
48
51
|
generator,
|
|
@@ -37,12 +37,12 @@ export declare const policiesAdminRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
37
37
|
output: {
|
|
38
38
|
data: {
|
|
39
39
|
metadata: import("hono/utils/types").JSONValue;
|
|
40
|
-
id: string;
|
|
41
40
|
name: string;
|
|
41
|
+
id: string;
|
|
42
|
+
description: string | null;
|
|
42
43
|
createdAt: string;
|
|
43
44
|
updatedAt: string;
|
|
44
45
|
slug: string;
|
|
45
|
-
description: string | null;
|
|
46
46
|
language: string;
|
|
47
47
|
kind: "other" | "cancellation" | "payment" | "terms_and_conditions" | "privacy" | "refund" | "commission" | "guarantee";
|
|
48
48
|
currentVersionId: string | null;
|
|
@@ -44,12 +44,12 @@ export declare const policiesCoreService: {
|
|
|
44
44
|
} | null>;
|
|
45
45
|
createPolicy(db: PostgresJsDatabase, data: CreatePolicyInput): Promise<{
|
|
46
46
|
metadata: unknown;
|
|
47
|
-
id: string;
|
|
48
47
|
name: string;
|
|
48
|
+
id: string;
|
|
49
|
+
description: string | null;
|
|
49
50
|
createdAt: Date;
|
|
50
51
|
updatedAt: Date;
|
|
51
52
|
slug: string;
|
|
52
|
-
description: string | null;
|
|
53
53
|
language: string;
|
|
54
54
|
kind: "other" | "cancellation" | "payment" | "terms_and_conditions" | "privacy" | "refund" | "commission" | "guarantee";
|
|
55
55
|
currentVersionId: string | null;
|
|
@@ -44,12 +44,12 @@ export declare const policiesService: {
|
|
|
44
44
|
} | null>;
|
|
45
45
|
createPolicy(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./service-shared.js").CreatePolicyInput): Promise<{
|
|
46
46
|
metadata: unknown;
|
|
47
|
-
id: string;
|
|
48
47
|
name: string;
|
|
48
|
+
id: string;
|
|
49
|
+
description: string | null;
|
|
49
50
|
createdAt: Date;
|
|
50
51
|
updatedAt: Date;
|
|
51
52
|
slug: string;
|
|
52
|
-
description: string | null;
|
|
53
53
|
language: string;
|
|
54
54
|
kind: "other" | "cancellation" | "payment" | "terms_and_conditions" | "privacy" | "refund" | "commission" | "guarantee";
|
|
55
55
|
currentVersionId: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/legal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"drizzle-orm": "^0.45.2",
|
|
54
54
|
"hono": "^4.12.10",
|
|
55
55
|
"zod": "^4.3.6",
|
|
56
|
-
"@voyantjs/bookings": "0.
|
|
57
|
-
"@voyantjs/core": "0.
|
|
58
|
-
"@voyantjs/crm": "0.
|
|
59
|
-
"@voyantjs/db": "0.
|
|
60
|
-
"@voyantjs/hono": "0.
|
|
61
|
-
"@voyantjs/suppliers": "0.
|
|
62
|
-
"@voyantjs/utils": "0.
|
|
63
|
-
"@voyantjs/voyant-storage": "0.
|
|
56
|
+
"@voyantjs/bookings": "0.17.0",
|
|
57
|
+
"@voyantjs/core": "0.17.0",
|
|
58
|
+
"@voyantjs/crm": "0.17.0",
|
|
59
|
+
"@voyantjs/db": "0.17.0",
|
|
60
|
+
"@voyantjs/hono": "0.17.0",
|
|
61
|
+
"@voyantjs/suppliers": "0.17.0",
|
|
62
|
+
"@voyantjs/utils": "0.17.0",
|
|
63
|
+
"@voyantjs/voyant-storage": "0.17.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"typescript": "^6.0.2",
|