@sneat/extension-docus-contract 0.0.1

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.
@@ -0,0 +1,32 @@
1
+ import { standardDocTypesByID } from '@sneat/extension-assetus-contract';
2
+
3
+ // Display title + emoji for each document type.
4
+ //
5
+ // The legacy @sneat/mod-assetus-core standardDocTypesByID carried `title` and
6
+ // `emoji` on every entry; the live @sneat/extension-assetus IDocTypeDef is
7
+ // validation-only ({ id, fields }) and dropped these presentation fields (and
8
+ // renamed birth_certificate/marriage_certificate -> birth_cert/marriage_cert).
9
+ // This map re-supplies the labels docus renders so the migration is
10
+ // presentation-neutral. TODO: fold title/emoji back into the lib's IDocTypeDef
11
+ // and delete this map.
12
+ const docTypePresentation = {
13
+ other: { title: 'Other' },
14
+ passport: { title: 'Passport', emoji: '🛂' },
15
+ driving_license: { title: 'Driving license', emoji: '🚗' },
16
+ birth_cert: { title: 'Birth certificate', emoji: '👼' },
17
+ marriage_cert: { title: 'Marriage certificate', emoji: '💍' },
18
+ };
19
+ // The live doc types, each decorated with its display title + emoji, in the
20
+ // lib's declaration order.
21
+ const docTypeListItems = Object.values(standardDocTypesByID).map((def) => ({
22
+ id: def.id,
23
+ title: docTypePresentation[def.id]?.title ?? def.id,
24
+ emoji: docTypePresentation[def.id]?.emoji,
25
+ }));
26
+
27
+ /**
28
+ * Generated bundle index. Do not edit.
29
+ */
30
+
31
+ export { docTypeListItems };
32
+ //# sourceMappingURL=sneat-extension-docus-contract.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sneat-extension-docus-contract.mjs","sources":["../../../../../../libs/extensions/docus/contract/src/lib/dbo/doc-type-presentation.ts","../../../../../../libs/extensions/docus/contract/src/sneat-extension-docus-contract.ts"],"sourcesContent":["import { standardDocTypesByID } from '@sneat/extension-assetus-contract';\n\n// Display title + emoji for each document type.\n//\n// The legacy @sneat/mod-assetus-core standardDocTypesByID carried `title` and\n// `emoji` on every entry; the live @sneat/extension-assetus IDocTypeDef is\n// validation-only ({ id, fields }) and dropped these presentation fields (and\n// renamed birth_certificate/marriage_certificate -> birth_cert/marriage_cert).\n// This map re-supplies the labels docus renders so the migration is\n// presentation-neutral. TODO: fold title/emoji back into the lib's IDocTypeDef\n// and delete this map.\nconst docTypePresentation: Record<string, { title: string; emoji?: string }> = {\n other: { title: 'Other' },\n passport: { title: 'Passport', emoji: '🛂' },\n driving_license: { title: 'Driving license', emoji: '🚗' },\n birth_cert: { title: 'Birth certificate', emoji: '👼' },\n marriage_cert: { title: 'Marriage certificate', emoji: '💍' },\n};\n\nexport interface IDocTypeListItem {\n readonly id: string;\n readonly title: string;\n readonly emoji?: string;\n}\n\n// The live doc types, each decorated with its display title + emoji, in the\n// lib's declaration order.\nexport const docTypeListItems: readonly IDocTypeListItem[] = Object.values(\n standardDocTypesByID,\n).map((def) => ({\n id: def.id,\n title: docTypePresentation[def.id]?.title ?? def.id,\n emoji: docTypePresentation[def.id]?.emoji,\n}));\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAmB,GAAsD;AAC7E,IAAA,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;IACzB,QAAQ,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE;IAC5C,eAAe,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE;IAC1D,UAAU,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE;IACvD,aAAa,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE;CAC9D;AAQD;AACA;AACO,MAAM,gBAAgB,GAAgC,MAAM,CAAC,MAAM,CACxE,oBAAoB,CACrB,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACd,EAAE,EAAE,GAAG,CAAC,EAAE;AACV,IAAA,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,IAAI,GAAG,CAAC,EAAE;IACnD,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK;AAC1C,CAAA,CAAC;;ACjCF;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@sneat/extension-docus-contract",
3
+ "version": "0.0.1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "peerDependencies": {
8
+ "@sneat/extension-assetus-contract": "0.0.5",
9
+ "vitest": "^4.0.9"
10
+ },
11
+ "sideEffects": false,
12
+ "module": "fesm2022/sneat-extension-docus-contract.mjs",
13
+ "typings": "types/sneat-extension-docus-contract.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/sneat-extension-docus-contract.d.ts",
20
+ "default": "./fesm2022/sneat-extension-docus-contract.mjs"
21
+ }
22
+ },
23
+ "type": "module",
24
+ "dependencies": {
25
+ "tslib": "^2.3.0"
26
+ }
27
+ }
@@ -0,0 +1,9 @@
1
+ interface IDocTypeListItem {
2
+ readonly id: string;
3
+ readonly title: string;
4
+ readonly emoji?: string;
5
+ }
6
+ declare const docTypeListItems: readonly IDocTypeListItem[];
7
+
8
+ export { docTypeListItems };
9
+ export type { IDocTypeListItem };