@coffer-org/plugin-documents 1.1.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.
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@coffer-org/sdk/plugin").PluginManifest;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAKA,wBAWG"}
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ import { defineVault } from '@coffer-org/sdk/vault';
2
+ import { definePlugin } from '@coffer-org/sdk/plugin';
3
+ import personal_document from './personal_document/index.js';
4
+ import personIdentity from './person_identity/index.js';
5
+ export default definePlugin({
6
+ id: 'documents',
7
+ version: '1.0.0',
8
+ dependsOn: ['people'],
9
+ vaults: [
10
+ {
11
+ meta: defineVault({ id: 'documents', label: 'documents.vault.label', icon: 'lucide:id-card' }),
12
+ modules: [personal_document],
13
+ },
14
+ ],
15
+ extends_: [personIdentity],
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAExD,eAAe,YAAY,CAAC;IAC1B,EAAE,EAAE,WAAW;IACf,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;YAC9F,OAAO,EAAE,CAAC,iBAAiB,CAAC;SAC7B;KACF;IACD,QAAQ,EAAE,CAAC,cAAc,CAAC;CAC3B,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@coffer-org/sdk/extend").ExtendDef;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/person_identity/index.ts"],"names":[],"mappings":";AAQA,wBAqBG"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Extend: канон ідентичності людини (не прив'язано до фізичного документа).
3
+ * Прив'язується до people/person. На відміну від personal_document (дані,
4
+ * розпізнані з конкретного фізичного документа) — це канонічні значення.
5
+ */
6
+ import { defineExtend } from '@coffer-org/sdk/extend';
7
+ import { field } from '@coffer-org/sdk/fields';
8
+ export default defineExtend({
9
+ id: 'person_identity',
10
+ label: 'documents.person_identity.label',
11
+ icon: 'lucide:globe',
12
+ attachTo: [{ vault: 'people', module: 'person' }],
13
+ claude: `Канон ідентичності людини (не прив'язано до фізичного документа).
14
+ nationality — ISO alpha-2. variants — ім'я/прізвище мовами (field.group multiple: lang+name+surname).`,
15
+ fields: [
16
+ field.select({ key: 'nationality', label: 'documents.person_identity.fields.nationality', options: 'countries' }),
17
+ field.group({
18
+ key: 'variants',
19
+ label: 'documents.person_identity.fields.variants',
20
+ multiple: true,
21
+ unique: ['lang'],
22
+ fields: [
23
+ field.select({ key: 'lang', label: 'documents.person_identity.variants.lang', options: 'languages' }),
24
+ field.string({ key: 'name', label: 'documents.person_identity.variants.name' }),
25
+ field.string({ key: 'surname', label: 'documents.person_identity.variants.surname' }),
26
+ ],
27
+ }),
28
+ ],
29
+ });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/person_identity/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,eAAe,YAAY,CAAC;IAC1B,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,iCAAiC;IACxC,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACjD,MAAM,EAAE;sGAC4F;IACpG,MAAM,EAAE;QACN,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,8CAA8C,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;QACjH,KAAK,CAAC,KAAK,CAAC;YACV,GAAG,EAAE,UAAU;YACf,KAAK,EAAE,2CAA2C;YAClD,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,MAAM,EAAE;gBACN,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,yCAAyC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;gBACrG,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,yCAAyC,EAAE,CAAC;gBAC/E,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,4CAA4C,EAAE,CAAC;aACtF;SACF,CAAC;KACH;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@coffer-org/sdk/module").ModuleDef;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/personal_document/index.ts"],"names":[],"mappings":";AAGA,wBA8DG"}
@@ -0,0 +1,66 @@
1
+ import { defineModule } from '@coffer-org/sdk/module';
2
+ import { field } from '@coffer-org/sdk/fields';
3
+ export default defineModule({
4
+ module: 'personal_document',
5
+ vault: 'documents',
6
+ label: 'documents.personal_document.label',
7
+ icon: 'lucide:id-card',
8
+ views: {
9
+ table: ['owner', 'type', 'surname', 'expires'],
10
+ },
11
+ fields: [
12
+ field.title({ key: 'name', label: 'core.fields.name' }),
13
+ field.image({ key: 'logo', label: 'documents.personal_document.fields.logo' }),
14
+ field.text({ key: 'description', label: 'documents.personal_document.fields.description', max: 1000 }),
15
+ field.string({ key: 'surname', label: 'documents.personal_document.fields.surname', config: { max: 100 } }),
16
+ field.string({ key: 'given_names', label: 'documents.personal_document.fields.given_names', config: { max: 200 } }),
17
+ field.select({
18
+ key: 'sex',
19
+ label: 'documents.personal_document.fields.sex',
20
+ options: [
21
+ { value: 'M', title: 'documents.personal_document.options.sex.M' },
22
+ { value: 'F', title: 'documents.personal_document.options.sex.F' },
23
+ ],
24
+ }),
25
+ field.date({ key: 'birth_date', label: 'documents.personal_document.fields.birth_date' }),
26
+ field.select({ key: 'nationality', label: 'documents.personal_document.fields.nationality', options: 'countries' }),
27
+ field.string({ key: 'number', label: 'documents.personal_document.fields.number', config: { max: 50 } }),
28
+ field.string({ key: 'record_no', label: 'documents.personal_document.fields.record_no', config: { max: 50 } }),
29
+ field.date({ key: 'issued', label: 'documents.personal_document.fields.issued' }),
30
+ field.date({ key: 'expires', label: 'documents.personal_document.fields.expires' }),
31
+ field.string({ key: 'authority', label: 'documents.personal_document.fields.authority', config: { max: 200 } }),
32
+ field.select({
33
+ key: 'country_code',
34
+ label: 'documents.personal_document.fields.country_code',
35
+ options: 'countries',
36
+ }),
37
+ field.string({ key: 'storage', label: 'documents.personal_document.fields.storage', config: { max: 200 } }),
38
+ field.string({ key: 'mrz', label: 'documents.personal_document.fields.mrz', config: { max: 200 } }),
39
+ field.int({ key: 'remind_days', label: 'documents.personal_document.fields.remind_days', config: { min: 0 } }),
40
+ field.relation({
41
+ key: 'owner',
42
+ label: 'documents.personal_document.fields.owner',
43
+ vault: 'people',
44
+ module: 'person',
45
+ }),
46
+ field.image({ key: 'photos', label: 'documents.personal_document.fields.photos', multiple: true }),
47
+ field.text({ key: 'notes', label: 'documents.personal_document.fields.notes', max: 1000 }),
48
+ field.select({
49
+ key: 'type',
50
+ label: 'core.fields.type',
51
+ required: true,
52
+ options: [
53
+ { value: 'P', title: 'documents.personal_document.options.type.P' },
54
+ { value: 'PA', title: 'documents.personal_document.options.type.PA' },
55
+ { value: 'TP', title: 'documents.personal_document.options.type.TP' },
56
+ { value: 'ID', title: 'documents.personal_document.options.type.ID' },
57
+ { value: 'DL', title: 'documents.personal_document.options.type.DL' },
58
+ { value: 'BR', title: 'documents.personal_document.options.type.BR' },
59
+ { value: 'MC', title: 'documents.personal_document.options.type.MC' },
60
+ { value: 'OT', title: 'documents.personal_document.options.type.OT' },
61
+ ],
62
+ }),
63
+ field.tags({ key: 'tags', label: 'documents.personal_document.fields.tags' }),
64
+ ],
65
+ });
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/personal_document/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,eAAe,YAAY,CAAC;IAC1B,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,mCAAmC;IAC1C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;KAC/C;IACD,MAAM,EAAE;QACN,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;QACvD,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,yCAAyC,EAAE,CAAC;QAC9E,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,KA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,EAAE,KAAK,EAAE,4CAA4C,EAAE;gBACnE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,6CAA6C,EAAE;gBACrE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,6CAA6C,EAAE;gBACrE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,6CAA6C,EAAE;gBACrE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,6CAA6C,EAAE;gBACrE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,6CAA6C,EAAE;gBACrE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,6CAA6C,EAAE;gBACrE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,6CAA6C,EAAE;aACtE;SACF,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,yCAAyC,EAAE,CAAC;KAC9E;CACF,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@coffer-org/plugin-documents",
3
+ "version": "1.1.0",
4
+ "type": "module",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsc -b tsconfig.build.json",
16
+ "prepack": "npm run build && node ../../scripts/swap-exports.mjs dist",
17
+ "postpack": "node ../../scripts/swap-exports.mjs src"
18
+ },
19
+ "dependencies": {
20
+ "@coffer-org/sdk": "^1.1.0"
21
+ }
22
+ }