@voyantjs/legal 0.6.8 → 0.6.9
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/index.d.ts +2 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/routes.d.ts +2 -32
- package/dist/contracts/routes.d.ts.map +1 -1
- package/dist/contracts/routes.js +3 -5
- package/dist/contracts/schema.d.ts +0 -51
- package/dist/contracts/schema.d.ts.map +1 -1
- package/dist/contracts/schema.js +1 -7
- package/dist/contracts/service-contracts.js +2 -2
- package/dist/contracts/service-documents.js +2 -2
- package/dist/contracts/service-series.d.ts +0 -4
- package/dist/contracts/service-series.d.ts.map +1 -1
- package/dist/contracts/service-templates.d.ts +1 -43
- package/dist/contracts/service-templates.d.ts.map +1 -1
- package/dist/contracts/service-templates.js +1 -3
- package/dist/contracts/service.d.ts +1 -47
- package/dist/contracts/service.d.ts.map +1 -1
- package/dist/contracts/template-authoring.d.ts +24 -0
- package/dist/contracts/template-authoring.d.ts.map +1 -0
- package/dist/contracts/template-authoring.js +291 -0
- package/dist/contracts/validation.d.ts +2 -24
- package/dist/contracts/validation.d.ts.map +1 -1
- package/dist/contracts/validation.js +1 -5
- package/dist/policies/index.d.ts +1 -1
- package/dist/policies/index.d.ts.map +1 -1
- package/dist/policies/index.js +1 -1
- package/dist/policies/routes.d.ts +139 -147
- package/dist/policies/routes.d.ts.map +1 -1
- package/dist/policies/routes.js +25 -25
- package/dist/policies/schema.d.ts +0 -18
- package/dist/policies/schema.d.ts.map +1 -1
- package/dist/policies/schema.js +0 -2
- package/dist/policies/service-core.d.ts +0 -41
- package/dist/policies/service-core.d.ts.map +1 -1
- package/dist/policies/service-core.js +0 -1
- package/dist/policies/service.d.ts +0 -41
- package/dist/policies/service.d.ts.map +1 -1
- package/dist/policies/validation.d.ts +0 -15
- package/dist/policies/validation.d.ts.map +1 -1
- package/dist/policies/validation.js +0 -2
- package/package.json +8 -8
|
@@ -12,5 +12,7 @@ export { contractAttachments, contractNumberSeries, contractSignatures, contract
|
|
|
12
12
|
export { allocateContractNumber, contractsService, renderTemplate, validateTemplateVariables, } from "./service.js";
|
|
13
13
|
export type { ContractDocumentGeneratedEvent, ContractDocumentGeneratorContext, ContractDocumentRuntimeOptions, GeneratedContractDocumentArtifact, GeneratedContractDocumentRecord, StorageBackedContractDocumentGeneratorOptions, StorageBackedContractDocumentSerializer, StorageBackedContractDocumentUpload, } from "./service-documents.js";
|
|
14
14
|
export { createPdfContractDocumentGenerator, createStorageBackedContractDocumentGenerator, defaultPdfContractDocumentSerializer, defaultStorageBackedContractDocumentSerializer, } from "./service-documents.js";
|
|
15
|
+
export type { ContractTemplateLiquidSnippet, ContractTemplateVariableCategory, ContractTemplateVariableDefinition, ContractTemplateVariableType, } from "./template-authoring.js";
|
|
16
|
+
export { contractTemplateLiquidSnippets, contractTemplateVariableCatalog, } from "./template-authoring.js";
|
|
15
17
|
export { contractBodyFormatSchema, contractListQuerySchema, contractNumberResetStrategySchema, contractScopeSchema, contractSignatureMethodSchema, contractStatusSchema, contractTemplateListQuerySchema, generateContractDocumentInputSchema, generatedContractDocumentAttachmentSchema, generatedContractDocumentResultSchema, insertContractAttachmentSchema, insertContractNumberSeriesSchema, insertContractSchema, insertContractSignatureSchema, insertContractTemplateSchema, insertContractTemplateVersionSchema, renderTemplateInputSchema, updateContractAttachmentSchema, updateContractNumberSeriesSchema, updateContractSchema, updateContractTemplateSchema, } from "./validation.js";
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExD,YAAY,EACV,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAA;A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":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExD,YAAY,EACV,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAErF,eAAO,MAAM,gBAAgB,EAAE,kBAK9B,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,kBAKtC,CAAA;AAED,eAAO,MAAM,iBAAiB;;;CAG7B,CAAA;AAED,YAAY,EACV,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,yBAAyB,GAC1B,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,8BAA8B,EAC9B,gCAAgC,EAChC,8BAA8B,EAC9B,iCAAiC,EACjC,+BAA+B,EAC/B,6CAA6C,EAC7C,uCAAuC,EACvC,mCAAmC,GACpC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,kCAAkC,EAClC,4CAA4C,EAC5C,oCAAoC,EACpC,8CAA8C,GAC/C,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EACV,6BAA6B,EAC7B,gCAAgC,EAChC,kCAAkC,EAClC,4BAA4B,GAC7B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,iCAAiC,EACjC,mBAAmB,EACnB,6BAA6B,EAC7B,oBAAoB,EACpB,+BAA+B,EAC/B,mCAAmC,EACnC,yCAAyC,EACzC,qCAAqC,EACrC,8BAA8B,EAC9B,gCAAgC,EAChC,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,mCAAmC,EACnC,yBAAyB,EACzB,8BAA8B,EAC9B,gCAAgC,EAChC,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA"}
|
package/dist/contracts/index.js
CHANGED
|
@@ -18,4 +18,5 @@ export const contractsLinkable = {
|
|
|
18
18
|
export { contractAttachments, contractNumberSeries, contractSignatures, contracts, contractTemplates, contractTemplateVersions, } from "./schema.js";
|
|
19
19
|
export { allocateContractNumber, contractsService, renderTemplate, validateTemplateVariables, } from "./service.js";
|
|
20
20
|
export { createPdfContractDocumentGenerator, createStorageBackedContractDocumentGenerator, defaultPdfContractDocumentSerializer, defaultStorageBackedContractDocumentSerializer, } from "./service-documents.js";
|
|
21
|
+
export { contractTemplateLiquidSnippets, contractTemplateVariableCatalog, } from "./template-authoring.js";
|
|
21
22
|
export { contractBodyFormatSchema, contractListQuerySchema, contractNumberResetStrategySchema, contractScopeSchema, contractSignatureMethodSchema, contractStatusSchema, contractTemplateListQuerySchema, generateContractDocumentInputSchema, generatedContractDocumentAttachmentSchema, generatedContractDocumentResultSchema, insertContractAttachmentSchema, insertContractNumberSeriesSchema, insertContractSchema, insertContractSignatureSchema, insertContractTemplateSchema, insertContractTemplateVersionSchema, renderTemplateInputSchema, updateContractAttachmentSchema, updateContractNumberSeriesSchema, updateContractSchema, updateContractTemplateSchema, } from "./validation.js";
|
|
@@ -29,7 +29,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
29
29
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
30
30
|
language: string;
|
|
31
31
|
description: string | null;
|
|
32
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
33
32
|
body: string;
|
|
34
33
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
35
34
|
currentVersionId: string | null;
|
|
@@ -64,7 +63,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
64
63
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
65
64
|
language: string;
|
|
66
65
|
description: string | null;
|
|
67
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
68
66
|
body: string;
|
|
69
67
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
70
68
|
currentVersionId: string | null;
|
|
@@ -92,7 +90,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
92
90
|
description: string | null;
|
|
93
91
|
language: string;
|
|
94
92
|
active: boolean;
|
|
95
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
96
93
|
body: string;
|
|
97
94
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
98
95
|
currentVersionId: string | null;
|
|
@@ -129,7 +126,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
129
126
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
130
127
|
language: string;
|
|
131
128
|
description: string | null;
|
|
132
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
133
129
|
body: string;
|
|
134
130
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
135
131
|
currentVersionId: string | null;
|
|
@@ -169,7 +165,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
169
165
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
170
166
|
language: string;
|
|
171
167
|
description: string | null;
|
|
172
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
173
168
|
body: string;
|
|
174
169
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
175
170
|
currentVersionId: string | null;
|
|
@@ -230,7 +225,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
230
225
|
output: {
|
|
231
226
|
data: {
|
|
232
227
|
rendered: string;
|
|
233
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
234
228
|
};
|
|
235
229
|
};
|
|
236
230
|
outputFormat: "json";
|
|
@@ -250,7 +244,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
250
244
|
id: string;
|
|
251
245
|
templateId: string;
|
|
252
246
|
version: number;
|
|
253
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
254
247
|
body: string;
|
|
255
248
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
256
249
|
changelog: string | null;
|
|
@@ -285,11 +278,10 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
285
278
|
data: {
|
|
286
279
|
id: string;
|
|
287
280
|
createdAt: string;
|
|
288
|
-
|
|
281
|
+
createdBy: string | null;
|
|
289
282
|
body: string;
|
|
290
283
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
291
284
|
changelog: string | null;
|
|
292
|
-
createdBy: string | null;
|
|
293
285
|
templateId: string;
|
|
294
286
|
version: number;
|
|
295
287
|
};
|
|
@@ -322,7 +314,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
322
314
|
id: string;
|
|
323
315
|
templateId: string;
|
|
324
316
|
version: number;
|
|
325
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
326
317
|
body: string;
|
|
327
318
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
328
319
|
changelog: string | null;
|
|
@@ -341,7 +332,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
341
332
|
output: {
|
|
342
333
|
data: {
|
|
343
334
|
id: string;
|
|
344
|
-
code: string;
|
|
345
335
|
name: string;
|
|
346
336
|
prefix: string;
|
|
347
337
|
separator: string;
|
|
@@ -371,7 +361,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
371
361
|
createdAt: string;
|
|
372
362
|
updatedAt: string;
|
|
373
363
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
374
|
-
code: string;
|
|
375
364
|
active: boolean;
|
|
376
365
|
separator: string;
|
|
377
366
|
padLength: number;
|
|
@@ -406,7 +395,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
406
395
|
output: {
|
|
407
396
|
data: {
|
|
408
397
|
id: string;
|
|
409
|
-
code: string;
|
|
410
398
|
name: string;
|
|
411
399
|
prefix: string;
|
|
412
400
|
separator: string;
|
|
@@ -446,7 +434,6 @@ export declare function createContractsAdminRoutes(options?: ContractsRouteOptio
|
|
|
446
434
|
output: {
|
|
447
435
|
data: {
|
|
448
436
|
id: string;
|
|
449
|
-
code: string;
|
|
450
437
|
name: string;
|
|
451
438
|
prefix: string;
|
|
452
439
|
separator: string;
|
|
@@ -1433,7 +1420,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1433
1420
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
1434
1421
|
language: string;
|
|
1435
1422
|
description: string | null;
|
|
1436
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
1437
1423
|
body: string;
|
|
1438
1424
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
1439
1425
|
currentVersionId: string | null;
|
|
@@ -1468,7 +1454,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1468
1454
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
1469
1455
|
language: string;
|
|
1470
1456
|
description: string | null;
|
|
1471
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
1472
1457
|
body: string;
|
|
1473
1458
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
1474
1459
|
currentVersionId: string | null;
|
|
@@ -1496,7 +1481,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1496
1481
|
description: string | null;
|
|
1497
1482
|
language: string;
|
|
1498
1483
|
active: boolean;
|
|
1499
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
1500
1484
|
body: string;
|
|
1501
1485
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
1502
1486
|
currentVersionId: string | null;
|
|
@@ -1533,7 +1517,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1533
1517
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
1534
1518
|
language: string;
|
|
1535
1519
|
description: string | null;
|
|
1536
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
1537
1520
|
body: string;
|
|
1538
1521
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
1539
1522
|
currentVersionId: string | null;
|
|
@@ -1573,7 +1556,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1573
1556
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
1574
1557
|
language: string;
|
|
1575
1558
|
description: string | null;
|
|
1576
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
1577
1559
|
body: string;
|
|
1578
1560
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
1579
1561
|
currentVersionId: string | null;
|
|
@@ -1634,7 +1616,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1634
1616
|
output: {
|
|
1635
1617
|
data: {
|
|
1636
1618
|
rendered: string;
|
|
1637
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
1638
1619
|
};
|
|
1639
1620
|
};
|
|
1640
1621
|
outputFormat: "json";
|
|
@@ -1654,7 +1635,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1654
1635
|
id: string;
|
|
1655
1636
|
templateId: string;
|
|
1656
1637
|
version: number;
|
|
1657
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
1658
1638
|
body: string;
|
|
1659
1639
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
1660
1640
|
changelog: string | null;
|
|
@@ -1689,11 +1669,10 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1689
1669
|
data: {
|
|
1690
1670
|
id: string;
|
|
1691
1671
|
createdAt: string;
|
|
1692
|
-
|
|
1672
|
+
createdBy: string | null;
|
|
1693
1673
|
body: string;
|
|
1694
1674
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
1695
1675
|
changelog: string | null;
|
|
1696
|
-
createdBy: string | null;
|
|
1697
1676
|
templateId: string;
|
|
1698
1677
|
version: number;
|
|
1699
1678
|
};
|
|
@@ -1726,7 +1705,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1726
1705
|
id: string;
|
|
1727
1706
|
templateId: string;
|
|
1728
1707
|
version: number;
|
|
1729
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
1730
1708
|
body: string;
|
|
1731
1709
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
1732
1710
|
changelog: string | null;
|
|
@@ -1745,7 +1723,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1745
1723
|
output: {
|
|
1746
1724
|
data: {
|
|
1747
1725
|
id: string;
|
|
1748
|
-
code: string;
|
|
1749
1726
|
name: string;
|
|
1750
1727
|
prefix: string;
|
|
1751
1728
|
separator: string;
|
|
@@ -1775,7 +1752,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1775
1752
|
createdAt: string;
|
|
1776
1753
|
updatedAt: string;
|
|
1777
1754
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
1778
|
-
code: string;
|
|
1779
1755
|
active: boolean;
|
|
1780
1756
|
separator: string;
|
|
1781
1757
|
padLength: number;
|
|
@@ -1810,7 +1786,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1810
1786
|
output: {
|
|
1811
1787
|
data: {
|
|
1812
1788
|
id: string;
|
|
1813
|
-
code: string;
|
|
1814
1789
|
name: string;
|
|
1815
1790
|
prefix: string;
|
|
1816
1791
|
separator: string;
|
|
@@ -1850,7 +1825,6 @@ export declare const contractsAdminRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1850
1825
|
output: {
|
|
1851
1826
|
data: {
|
|
1852
1827
|
id: string;
|
|
1853
|
-
code: string;
|
|
1854
1828
|
name: string;
|
|
1855
1829
|
prefix: string;
|
|
1856
1830
|
separator: string;
|
|
@@ -2844,7 +2818,6 @@ export declare function createContractsPublicRoutes(): import("hono/hono-base").
|
|
|
2844
2818
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
2845
2819
|
language: string;
|
|
2846
2820
|
description: string | null;
|
|
2847
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
2848
2821
|
body: string;
|
|
2849
2822
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
2850
2823
|
currentVersionId: string | null;
|
|
@@ -2879,7 +2852,6 @@ export declare function createContractsPublicRoutes(): import("hono/hono-base").
|
|
|
2879
2852
|
output: {
|
|
2880
2853
|
data: {
|
|
2881
2854
|
rendered: string;
|
|
2882
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
2883
2855
|
};
|
|
2884
2856
|
};
|
|
2885
2857
|
outputFormat: "json";
|
|
@@ -3012,7 +2984,6 @@ export declare const contractsPublicRoutes: import("hono/hono-base").HonoBase<En
|
|
|
3012
2984
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
3013
2985
|
language: string;
|
|
3014
2986
|
description: string | null;
|
|
3015
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
3016
2987
|
body: string;
|
|
3017
2988
|
variableSchema: import("hono/utils/types").JSONValue;
|
|
3018
2989
|
currentVersionId: string | null;
|
|
@@ -3047,7 +3018,6 @@ export declare const contractsPublicRoutes: import("hono/hono-base").HonoBase<En
|
|
|
3047
3018
|
output: {
|
|
3048
3019
|
data: {
|
|
3049
3020
|
rendered: string;
|
|
3050
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
3051
3021
|
};
|
|
3052
3022
|
};
|
|
3053
3023
|
outputFormat: "json";
|
|
@@ -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,CAAC,QAAQ,EAAE,OAAO,KAAK,yBAAyB,GAAG,SAAS,CAAA;IACvF,0BAA0B,CAAC,EAAE,CAC3B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3C,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,QAAQ,GAAG,SAAS,CAAA;CAC9D;AAkCD,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,qBAA0B
|
|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;;oBAAgC,CAAA;AAElE,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAA;AAC9D,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAA"}
|
package/dist/contracts/routes.js
CHANGED
|
@@ -64,9 +64,8 @@ export function createContractsAdminRoutes(options = {}) {
|
|
|
64
64
|
if (!template)
|
|
65
65
|
return c.json({ error: "Template not found" }, 404);
|
|
66
66
|
const body = input.body ?? template.body;
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
return c.json({ data: { rendered, bodyFormat } });
|
|
67
|
+
const rendered = contractsService.renderPreview({ ...input, body });
|
|
68
|
+
return c.json({ data: { rendered } });
|
|
70
69
|
})
|
|
71
70
|
.get("/templates/:id/versions", async (c) => {
|
|
72
71
|
const rows = await contractsService.listTemplateVersions(c.get("db"), c.req.param("id"));
|
|
@@ -295,9 +294,8 @@ export function createContractsPublicRoutes() {
|
|
|
295
294
|
const rendered = contractsService.renderPreview({
|
|
296
295
|
variables: input.variables,
|
|
297
296
|
body: template.body,
|
|
298
|
-
bodyFormat: template.bodyFormat,
|
|
299
297
|
});
|
|
300
|
-
return c.json({ data: { rendered
|
|
298
|
+
return c.json({ data: { rendered } });
|
|
301
299
|
})
|
|
302
300
|
.get("/:id", async (c) => {
|
|
303
301
|
const row = await contractsService.getContractById(c.get("db"), c.req.param("id"));
|
|
@@ -109,23 +109,6 @@ export declare const contractTemplates: import("drizzle-orm/pg-core").PgTableWit
|
|
|
109
109
|
identity: undefined;
|
|
110
110
|
generated: undefined;
|
|
111
111
|
}, {}, {}>;
|
|
112
|
-
bodyFormat: import("drizzle-orm/pg-core").PgColumn<{
|
|
113
|
-
name: "body_format";
|
|
114
|
-
tableName: "contract_templates";
|
|
115
|
-
dataType: "string";
|
|
116
|
-
columnType: "PgEnumColumn";
|
|
117
|
-
data: "markdown" | "html" | "lexical_json";
|
|
118
|
-
driverParam: string;
|
|
119
|
-
notNull: true;
|
|
120
|
-
hasDefault: true;
|
|
121
|
-
isPrimaryKey: false;
|
|
122
|
-
isAutoincrement: false;
|
|
123
|
-
hasRuntimeDefault: false;
|
|
124
|
-
enumValues: ["markdown", "html", "lexical_json"];
|
|
125
|
-
baseColumn: never;
|
|
126
|
-
identity: undefined;
|
|
127
|
-
generated: undefined;
|
|
128
|
-
}, {}, {}>;
|
|
129
112
|
body: import("drizzle-orm/pg-core").PgColumn<{
|
|
130
113
|
name: "body";
|
|
131
114
|
tableName: "contract_templates";
|
|
@@ -288,23 +271,6 @@ export declare const contractTemplateVersions: import("drizzle-orm/pg-core").PgT
|
|
|
288
271
|
identity: undefined;
|
|
289
272
|
generated: undefined;
|
|
290
273
|
}, {}, {}>;
|
|
291
|
-
bodyFormat: import("drizzle-orm/pg-core").PgColumn<{
|
|
292
|
-
name: "body_format";
|
|
293
|
-
tableName: "contract_template_versions";
|
|
294
|
-
dataType: "string";
|
|
295
|
-
columnType: "PgEnumColumn";
|
|
296
|
-
data: "markdown" | "html" | "lexical_json";
|
|
297
|
-
driverParam: string;
|
|
298
|
-
notNull: true;
|
|
299
|
-
hasDefault: true;
|
|
300
|
-
isPrimaryKey: false;
|
|
301
|
-
isAutoincrement: false;
|
|
302
|
-
hasRuntimeDefault: false;
|
|
303
|
-
enumValues: ["markdown", "html", "lexical_json"];
|
|
304
|
-
baseColumn: never;
|
|
305
|
-
identity: undefined;
|
|
306
|
-
generated: undefined;
|
|
307
|
-
}, {}, {}>;
|
|
308
274
|
body: import("drizzle-orm/pg-core").PgColumn<{
|
|
309
275
|
name: "body";
|
|
310
276
|
tableName: "contract_template_versions";
|
|
@@ -416,23 +382,6 @@ export declare const contractNumberSeries: import("drizzle-orm/pg-core").PgTable
|
|
|
416
382
|
identity: undefined;
|
|
417
383
|
generated: undefined;
|
|
418
384
|
}, {}, {}>;
|
|
419
|
-
code: import("drizzle-orm/pg-core").PgColumn<{
|
|
420
|
-
name: "code";
|
|
421
|
-
tableName: "contract_number_series";
|
|
422
|
-
dataType: "string";
|
|
423
|
-
columnType: "PgText";
|
|
424
|
-
data: string;
|
|
425
|
-
driverParam: string;
|
|
426
|
-
notNull: true;
|
|
427
|
-
hasDefault: false;
|
|
428
|
-
isPrimaryKey: false;
|
|
429
|
-
isAutoincrement: false;
|
|
430
|
-
hasRuntimeDefault: false;
|
|
431
|
-
enumValues: [string, ...string[]];
|
|
432
|
-
baseColumn: never;
|
|
433
|
-
identity: undefined;
|
|
434
|
-
generated: undefined;
|
|
435
|
-
}, {}, {}>;
|
|
436
385
|
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
437
386
|
name: "name";
|
|
438
387
|
tableName: "contract_number_series";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/contracts/schema.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB,+FAM5B,CAAA;AAEF,eAAO,MAAM,kBAAkB,4GAQ7B,CAAA;AAEF,eAAO,MAAM,2BAA2B,qFAKtC,CAAA;AAEF,eAAO,MAAM,+BAA+B,sEAI1C,CAAA;AAEF,eAAO,MAAM,sBAAsB,4EAIjC,CAAA;AAIF,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/contracts/schema.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB,+FAM5B,CAAA;AAEF,eAAO,MAAM,kBAAkB,4GAQ7B,CAAA;AAEF,eAAO,MAAM,2BAA2B,qFAKtC,CAAA;AAEF,eAAO,MAAM,+BAA+B,sEAI1C,CAAA;AAEF,eAAO,MAAM,sBAAsB,4EAIjC,CAAA;AAIF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAqB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAA;AAI3E,eAAO,MAAM,0BAA0B;;EAEpC,CAAA;AAEH,eAAO,MAAM,iCAAiC;;;EAS7C,CAAA;AAED,eAAO,MAAM,6BAA6B;;EAEvC,CAAA;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;EAiB5B,CAAA;AAEH,eAAO,MAAM,2BAA2B;;;EAMrC,CAAA;AAEH,eAAO,MAAM,4BAA4B;;EAKtC,CAAA"}
|
package/dist/contracts/schema.js
CHANGED
|
@@ -44,7 +44,6 @@ export const contractTemplates = pgTable("contract_templates", {
|
|
|
44
44
|
scope: contractScopeEnum("scope").notNull(),
|
|
45
45
|
language: text("language").notNull().default("en"),
|
|
46
46
|
description: text("description"),
|
|
47
|
-
bodyFormat: contractBodyFormatEnum("body_format").notNull().default("markdown"),
|
|
48
47
|
body: text("body").notNull(),
|
|
49
48
|
variableSchema: jsonb("variable_schema"),
|
|
50
49
|
currentVersionId: typeIdRef("current_version_id"),
|
|
@@ -68,7 +67,6 @@ export const contractTemplateVersions = pgTable("contract_template_versions", {
|
|
|
68
67
|
.notNull()
|
|
69
68
|
.references(() => contractTemplates.id, { onDelete: "cascade" }),
|
|
70
69
|
version: integer("version").notNull(),
|
|
71
|
-
bodyFormat: contractBodyFormatEnum("body_format").notNull().default("markdown"),
|
|
72
70
|
body: text("body").notNull(),
|
|
73
71
|
variableSchema: jsonb("variable_schema"),
|
|
74
72
|
changelog: text("changelog"),
|
|
@@ -81,7 +79,6 @@ export const contractTemplateVersions = pgTable("contract_template_versions", {
|
|
|
81
79
|
// ---------- contract_number_series ----------
|
|
82
80
|
export const contractNumberSeries = pgTable("contract_number_series", {
|
|
83
81
|
id: typeId("contract_number_series"),
|
|
84
|
-
code: text("code").notNull().unique(),
|
|
85
82
|
name: text("name").notNull(),
|
|
86
83
|
prefix: text("prefix").notNull().default(""),
|
|
87
84
|
separator: text("separator").notNull().default(""),
|
|
@@ -94,7 +91,6 @@ export const contractNumberSeries = pgTable("contract_number_series", {
|
|
|
94
91
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
95
92
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
96
93
|
}, (table) => [
|
|
97
|
-
uniqueIndex("uq_contract_number_series_code").on(table.code),
|
|
98
94
|
index("idx_contract_number_series_scope").on(table.scope),
|
|
99
95
|
index("idx_contract_number_series_active").on(table.active),
|
|
100
96
|
index("idx_contract_number_series_scope_updated").on(table.scope, table.updatedAt),
|
|
@@ -128,9 +124,7 @@ export const contracts = pgTable("contracts", {
|
|
|
128
124
|
expiresAt: timestamp("expires_at", { withTimezone: true }),
|
|
129
125
|
voidedAt: timestamp("voided_at", { withTimezone: true }),
|
|
130
126
|
language: text("language").notNull().default("en"),
|
|
131
|
-
renderedBodyFormat: contractBodyFormatEnum("rendered_body_format")
|
|
132
|
-
.notNull()
|
|
133
|
-
.default("markdown"),
|
|
127
|
+
renderedBodyFormat: contractBodyFormatEnum("rendered_body_format").notNull().default("html"),
|
|
134
128
|
renderedBody: text("rendered_body"),
|
|
135
129
|
variables: jsonb("variables"),
|
|
136
130
|
metadata: jsonb("metadata"),
|
|
@@ -88,8 +88,8 @@ export const contractRecordsService = {
|
|
|
88
88
|
.limit(1);
|
|
89
89
|
if (version) {
|
|
90
90
|
const vars = contract.variables ?? {};
|
|
91
|
-
renderedBody = renderTemplate(version.body,
|
|
92
|
-
renderedBodyFormat =
|
|
91
|
+
renderedBody = renderTemplate(version.body, "html", vars);
|
|
92
|
+
renderedBodyFormat = "html";
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
let contractNumber = contract.contractNumber;
|
|
@@ -148,8 +148,8 @@ async function ensureRenderedContract(db, contractId, issueIfDraft) {
|
|
|
148
148
|
let renderedBodyFormat = contract.renderedBodyFormat;
|
|
149
149
|
if ((!renderedBody || !renderedBodyFormat) && templateVersion) {
|
|
150
150
|
const variables = contract.variables ?? {};
|
|
151
|
-
renderedBody = renderTemplate(templateVersion.body,
|
|
152
|
-
renderedBodyFormat =
|
|
151
|
+
renderedBody = renderTemplate(templateVersion.body, "html", variables);
|
|
152
|
+
renderedBodyFormat = "html";
|
|
153
153
|
const [updated] = await db
|
|
154
154
|
.update(contracts)
|
|
155
155
|
.set({
|
|
@@ -3,7 +3,6 @@ import type { CreateContractNumberSeriesInput, UpdateContractNumberSeriesInput }
|
|
|
3
3
|
export declare const contractSeriesService: {
|
|
4
4
|
listSeries(db: PostgresJsDatabase): Promise<{
|
|
5
5
|
id: string;
|
|
6
|
-
code: string;
|
|
7
6
|
name: string;
|
|
8
7
|
prefix: string;
|
|
9
8
|
separator: string;
|
|
@@ -18,7 +17,6 @@ export declare const contractSeriesService: {
|
|
|
18
17
|
}[]>;
|
|
19
18
|
getSeriesById(db: PostgresJsDatabase, id: string): Promise<{
|
|
20
19
|
id: string;
|
|
21
|
-
code: string;
|
|
22
20
|
name: string;
|
|
23
21
|
prefix: string;
|
|
24
22
|
separator: string;
|
|
@@ -38,7 +36,6 @@ export declare const contractSeriesService: {
|
|
|
38
36
|
createdAt: Date;
|
|
39
37
|
updatedAt: Date;
|
|
40
38
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
41
|
-
code: string;
|
|
42
39
|
active: boolean;
|
|
43
40
|
separator: string;
|
|
44
41
|
padLength: number;
|
|
@@ -48,7 +45,6 @@ export declare const contractSeriesService: {
|
|
|
48
45
|
} | null>;
|
|
49
46
|
updateSeries(db: PostgresJsDatabase, id: string, data: UpdateContractNumberSeriesInput): Promise<{
|
|
50
47
|
id: string;
|
|
51
|
-
code: string;
|
|
52
48
|
name: string;
|
|
53
49
|
prefix: string;
|
|
54
50
|
separator: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-series.d.ts","sourceRoot":"","sources":["../../src/contracts/service-series.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,KAAK,EACV,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,qBAAqB,CAAA;AAE5B,eAAO,MAAM,qBAAqB;mBACX,kBAAkB
|
|
1
|
+
{"version":3,"file":"service-series.d.ts","sourceRoot":"","sources":["../../src/contracts/service-series.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,KAAK,EACV,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,qBAAqB,CAAA;AAE5B,eAAO,MAAM,qBAAqB;mBACX,kBAAkB;;;;;;;;;;;;;;sBAGf,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;qBAQ/B,kBAAkB,QAAQ,+BAA+B;;;;;;;;;;;;;;qBAIzD,kBAAkB,MAAM,MAAM,QAAQ,+BAA+B;;;;;;;;;;;;;;qBAQrE,kBAAkB,MAAM,MAAM;;;CAOtD,CAAA"}
|
|
@@ -9,7 +9,6 @@ export declare const contractTemplatesService: {
|
|
|
9
9
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
10
10
|
language: string;
|
|
11
11
|
description: string | null;
|
|
12
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
13
12
|
body: string;
|
|
14
13
|
variableSchema: unknown;
|
|
15
14
|
currentVersionId: string | null;
|
|
@@ -28,7 +27,6 @@ export declare const contractTemplatesService: {
|
|
|
28
27
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
29
28
|
language: string;
|
|
30
29
|
description: string | null;
|
|
31
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
32
30
|
body: string;
|
|
33
31
|
variableSchema: unknown;
|
|
34
32
|
currentVersionId: string | null;
|
|
@@ -47,7 +45,6 @@ export declare const contractTemplatesService: {
|
|
|
47
45
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
48
46
|
language: string;
|
|
49
47
|
description: string | null;
|
|
50
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
51
48
|
body: string;
|
|
52
49
|
variableSchema: unknown;
|
|
53
50
|
currentVersionId: string | null;
|
|
@@ -65,7 +62,6 @@ export declare const contractTemplatesService: {
|
|
|
65
62
|
description: string | null;
|
|
66
63
|
language: string;
|
|
67
64
|
active: boolean;
|
|
68
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
69
65
|
body: string;
|
|
70
66
|
variableSchema: unknown;
|
|
71
67
|
currentVersionId: string | null;
|
|
@@ -77,7 +73,6 @@ export declare const contractTemplatesService: {
|
|
|
77
73
|
scope: "customer" | "partner" | "supplier" | "other" | "channel";
|
|
78
74
|
language: string;
|
|
79
75
|
description: string | null;
|
|
80
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
81
76
|
body: string;
|
|
82
77
|
variableSchema: unknown;
|
|
83
78
|
currentVersionId: string | null;
|
|
@@ -140,23 +135,6 @@ export declare const contractTemplatesService: {
|
|
|
140
135
|
identity: undefined;
|
|
141
136
|
generated: undefined;
|
|
142
137
|
}, {}, {}>;
|
|
143
|
-
bodyFormat: import("drizzle-orm/pg-core").PgColumn<{
|
|
144
|
-
name: "body_format";
|
|
145
|
-
tableName: "contract_template_versions";
|
|
146
|
-
dataType: "string";
|
|
147
|
-
columnType: "PgEnumColumn";
|
|
148
|
-
data: "markdown" | "html" | "lexical_json";
|
|
149
|
-
driverParam: string;
|
|
150
|
-
notNull: true;
|
|
151
|
-
hasDefault: true;
|
|
152
|
-
isPrimaryKey: false;
|
|
153
|
-
isAutoincrement: false;
|
|
154
|
-
hasRuntimeDefault: false;
|
|
155
|
-
enumValues: ["markdown", "html", "lexical_json"];
|
|
156
|
-
baseColumn: never;
|
|
157
|
-
identity: undefined;
|
|
158
|
-
generated: undefined;
|
|
159
|
-
}, {}, {}>;
|
|
160
138
|
body: import("drizzle-orm/pg-core").PgColumn<{
|
|
161
139
|
name: "body";
|
|
162
140
|
tableName: "contract_template_versions";
|
|
@@ -246,7 +224,6 @@ export declare const contractTemplatesService: {
|
|
|
246
224
|
id: string;
|
|
247
225
|
templateId: string;
|
|
248
226
|
version: number;
|
|
249
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
250
227
|
body: string;
|
|
251
228
|
variableSchema: unknown;
|
|
252
229
|
changelog: string | null;
|
|
@@ -304,23 +281,6 @@ export declare const contractTemplatesService: {
|
|
|
304
281
|
identity: undefined;
|
|
305
282
|
generated: undefined;
|
|
306
283
|
}, {}, {}>;
|
|
307
|
-
bodyFormat: import("drizzle-orm/pg-core").PgColumn<{
|
|
308
|
-
name: "body_format";
|
|
309
|
-
tableName: "contract_template_versions";
|
|
310
|
-
dataType: "string";
|
|
311
|
-
columnType: "PgEnumColumn";
|
|
312
|
-
data: "markdown" | "html" | "lexical_json";
|
|
313
|
-
driverParam: string;
|
|
314
|
-
notNull: true;
|
|
315
|
-
hasDefault: true;
|
|
316
|
-
isPrimaryKey: false;
|
|
317
|
-
isAutoincrement: false;
|
|
318
|
-
hasRuntimeDefault: false;
|
|
319
|
-
enumValues: ["markdown", "html", "lexical_json"];
|
|
320
|
-
baseColumn: never;
|
|
321
|
-
identity: undefined;
|
|
322
|
-
generated: undefined;
|
|
323
|
-
}, {}, {}>;
|
|
324
284
|
body: import("drizzle-orm/pg-core").PgColumn<{
|
|
325
285
|
name: "body";
|
|
326
286
|
tableName: "contract_template_versions";
|
|
@@ -411,7 +371,6 @@ export declare const contractTemplatesService: {
|
|
|
411
371
|
id: string;
|
|
412
372
|
templateId: string;
|
|
413
373
|
version: number;
|
|
414
|
-
bodyFormat: "markdown" | "html" | "lexical_json";
|
|
415
374
|
body: string;
|
|
416
375
|
variableSchema: unknown;
|
|
417
376
|
changelog: string | null;
|
|
@@ -421,11 +380,10 @@ export declare const contractTemplatesService: {
|
|
|
421
380
|
createTemplateVersion(db: PostgresJsDatabase, templateId: string, data: CreateContractTemplateVersionInput): Promise<{
|
|
422
381
|
id: string;
|
|
423
382
|
createdAt: Date;
|
|
424
|
-
|
|
383
|
+
createdBy: string | null;
|
|
425
384
|
body: string;
|
|
426
385
|
variableSchema: unknown;
|
|
427
386
|
changelog: string | null;
|
|
428
|
-
createdBy: string | null;
|
|
429
387
|
templateId: string;
|
|
430
388
|
version: number;
|
|
431
389
|
} | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-templates.d.ts","sourceRoot":"","sources":["../../src/contracts/service-templates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EAEvC,KAAK,mBAAmB,EAExB,KAAK,2BAA2B,EACjC,MAAM,qBAAqB,CAAA;AAE5B,eAAO,MAAM,wBAAwB;sBACX,kBAAkB,SAAS,yBAAyB
|
|
1
|
+
{"version":3,"file":"service-templates.d.ts","sourceRoot":"","sources":["../../src/contracts/service-templates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EAEvC,KAAK,mBAAmB,EAExB,KAAK,2BAA2B,EACjC,MAAM,qBAAqB,CAAA;AAE5B,eAAO,MAAM,wBAAwB;sBACX,kBAAkB,SAAS,yBAAyB;;;;;;;;;;;;;;;;;;;wBA6BlD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;2BASlD,kBAAkB,SACf;QACL,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;QAChE,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;KAC7B;;;;;;;;;;;;;;uBAgCsB,kBAAkB,QAAQ,2BAA2B;;;;;;;;;;;;;;uBAIrD,kBAAkB,MAAM,MAAM,QAAQ,2BAA2B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