@acorex-platform/module-identifier-management-client 0.0.15
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/fesm2022/acorex-platform-module-identifier-management-client-contracts.mjs +192 -0
- package/fesm2022/acorex-platform-module-identifier-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-identifier-management-client.mjs +642 -0
- package/fesm2022/acorex-platform-module-identifier-management-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-identifier-management-client-contracts.d.ts +46 -0
- package/types/acorex-platform-module-identifier-management-client.d.ts +259 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';
|
|
2
|
+
export { IDENTIFIER_RULE_ENTITY } from '@acorex-platform/framework-shared/core';
|
|
3
|
+
import { createAllQueryView, entityMasterCrudActions, entityMasterDeleteAction } from '@acorex-platform/framework-shared/entity';
|
|
4
|
+
|
|
5
|
+
const AXMPermissionsKeys = {
|
|
6
|
+
IdentifierManagement: {
|
|
7
|
+
Management: 'IdentifierManagement:Permission:Management',
|
|
8
|
+
IdentifierRules: 'IdentifierManagement:Permission:IdentifierRules',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const AXPIdentifierManagementMenuKeys = {
|
|
13
|
+
Root: 'IdentifierManagement:Menu',
|
|
14
|
+
IdentifierRules: 'IdentifierManagement:Menu:IdentifierRules',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#region ---- Identifier rule contracts ----
|
|
18
|
+
//#endregion
|
|
19
|
+
|
|
20
|
+
const config = {
|
|
21
|
+
i18n: 'identifier-management',
|
|
22
|
+
module: 'IdentifierManagement',
|
|
23
|
+
};
|
|
24
|
+
const RootConfig = {
|
|
25
|
+
config,
|
|
26
|
+
module: {
|
|
27
|
+
module: 'identifier-management',
|
|
28
|
+
name: config.module,
|
|
29
|
+
title: `@${config.i18n}:module.title`,
|
|
30
|
+
icon: 'fa-light fa-hashtag',
|
|
31
|
+
},
|
|
32
|
+
entities: {
|
|
33
|
+
identifierRule: {
|
|
34
|
+
name: 'IdentifierRule',
|
|
35
|
+
source: `${config.module}.IdentifierRule`,
|
|
36
|
+
title: `@${config.i18n}:entities.identifier-rule.title`,
|
|
37
|
+
titlePlural: `@${config.i18n}:entities.identifier-rule.plural`,
|
|
38
|
+
icon: 'fa-light fa-barcode',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
//#region ---- Identifier rule domain model ----
|
|
44
|
+
//#endregion
|
|
45
|
+
|
|
46
|
+
//#region ---- Identifier rule entity ----
|
|
47
|
+
async function identifierRuleFactory() {
|
|
48
|
+
const i18n = `${RootConfig.config.i18n}:entities.identifier-rule`;
|
|
49
|
+
const entityDef = {
|
|
50
|
+
module: RootConfig.module.name,
|
|
51
|
+
name: RootConfig.entities.identifierRule.name,
|
|
52
|
+
title: RootConfig.entities.identifierRule.title,
|
|
53
|
+
icon: RootConfig.entities.identifierRule.icon,
|
|
54
|
+
plugins: [
|
|
55
|
+
{ name: 'clone' },
|
|
56
|
+
{ name: 'disable' },
|
|
57
|
+
{
|
|
58
|
+
name: 'unique-fields',
|
|
59
|
+
options: { fields: 'name', scope: 'global' },
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
formats: {
|
|
63
|
+
individual: RootConfig.entities.identifierRule.title,
|
|
64
|
+
plural: RootConfig.entities.identifierRule.titlePlural,
|
|
65
|
+
searchResult: { title: '{{ title }}', description: '{{ entity }} · {{ pattern }}' },
|
|
66
|
+
},
|
|
67
|
+
groups: [
|
|
68
|
+
{ id: 'basic-info', title: `@${i18n}.groups.basic-info` },
|
|
69
|
+
{ id: 'pattern', title: `@${i18n}.groups.pattern` },
|
|
70
|
+
{ id: 'scope', title: `@${i18n}.groups.scope` },
|
|
71
|
+
],
|
|
72
|
+
properties: [
|
|
73
|
+
{
|
|
74
|
+
name: 'name',
|
|
75
|
+
title: '@general:terms.common.name',
|
|
76
|
+
groupId: 'basic-info',
|
|
77
|
+
schema: {
|
|
78
|
+
dataType: 'string',
|
|
79
|
+
readonly: '{{ !!context.eval("id") }}',
|
|
80
|
+
interface: { type: AXPWidgetsList.Editors.TextBox },
|
|
81
|
+
},
|
|
82
|
+
validations: [{ rule: 'required' }, { rule: 'variable-name' }],
|
|
83
|
+
options: {
|
|
84
|
+
sort: { enabled: true },
|
|
85
|
+
filter: { inline: { enabled: true }, advance: { enabled: true } },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'title',
|
|
90
|
+
title: '@general:terms.common.title',
|
|
91
|
+
groupId: 'basic-info',
|
|
92
|
+
schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.TextBox } },
|
|
93
|
+
validations: [{ rule: 'required' }],
|
|
94
|
+
options: {
|
|
95
|
+
sort: { enabled: true },
|
|
96
|
+
filter: { inline: { enabled: true }, advance: { enabled: true } },
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'entity',
|
|
101
|
+
title: `@${i18n}.fields.entity.title`,
|
|
102
|
+
groupId: 'basic-info',
|
|
103
|
+
schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.TextBox } },
|
|
104
|
+
validations: [{ rule: 'required' }],
|
|
105
|
+
options: {
|
|
106
|
+
filter: { inline: { enabled: true }, advance: { enabled: true } },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'pattern',
|
|
111
|
+
title: `@${i18n}.fields.pattern.title`,
|
|
112
|
+
groupId: 'pattern',
|
|
113
|
+
schema: {
|
|
114
|
+
dataType: 'string',
|
|
115
|
+
interface: {
|
|
116
|
+
type: AXPWidgetsList.Advanced.CodeEditor,
|
|
117
|
+
options: { language: 'plaintext', lineNumbers: true },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
validations: [{ rule: 'required' }],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'scopeConfig',
|
|
124
|
+
title: `@${i18n}.fields.scope-config.title`,
|
|
125
|
+
groupId: 'scope',
|
|
126
|
+
schema: {
|
|
127
|
+
dataType: 'object',
|
|
128
|
+
interface: {
|
|
129
|
+
type: AXPWidgetsList.Advanced.CodeEditor,
|
|
130
|
+
options: { language: 'json', lineNumbers: true, placeholder: '{}' },
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
columns: [{ name: 'name' }, { name: 'title' }, { name: 'entity' }, { name: 'pattern' }],
|
|
136
|
+
interfaces: {
|
|
137
|
+
master: {
|
|
138
|
+
create: {
|
|
139
|
+
sections: [{ id: 'basic-info' }, { id: 'pattern' }, { id: 'scope' }],
|
|
140
|
+
properties: [
|
|
141
|
+
{ name: 'name', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },
|
|
142
|
+
{ name: 'title', layout: { positions: { lg: { colSpan: 6, order: 2 } } } },
|
|
143
|
+
{ name: 'entity', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },
|
|
144
|
+
{ name: 'pattern', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },
|
|
145
|
+
{ name: 'scopeConfig', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
update: {
|
|
149
|
+
sections: [{ id: 'basic-info' }, { id: 'pattern' }, { id: 'scope' }],
|
|
150
|
+
properties: [
|
|
151
|
+
{ name: 'name', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },
|
|
152
|
+
{ name: 'title', layout: { positions: { lg: { colSpan: 6, order: 2 } } } },
|
|
153
|
+
{ name: 'entity', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },
|
|
154
|
+
{ name: 'pattern', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },
|
|
155
|
+
{ name: 'scopeConfig', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
single: {
|
|
159
|
+
title: '{{title}}',
|
|
160
|
+
sections: [
|
|
161
|
+
{ id: 'basic-info', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
162
|
+
{ id: 'pattern', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
163
|
+
{ id: 'scope', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
164
|
+
],
|
|
165
|
+
properties: [
|
|
166
|
+
{ name: 'name', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },
|
|
167
|
+
{ name: 'title', layout: { positions: { lg: { colSpan: 6, order: 2 } } } },
|
|
168
|
+
{ name: 'entity', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },
|
|
169
|
+
{ name: 'pattern', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },
|
|
170
|
+
{ name: 'scopeConfig', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },
|
|
171
|
+
],
|
|
172
|
+
actions: [entityMasterDeleteAction()],
|
|
173
|
+
},
|
|
174
|
+
list: {
|
|
175
|
+
actions: [...entityMasterCrudActions()],
|
|
176
|
+
views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
return entityDef;
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
|
|
185
|
+
//#region ---- Contracts barrel ----
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Generated bundle index. Do not edit.
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
export { AXMPermissionsKeys, AXPIdentifierManagementMenuKeys, RootConfig, identifierRuleFactory };
|
|
192
|
+
//# sourceMappingURL=acorex-platform-module-identifier-management-client-contracts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-identifier-management-client-contracts.mjs","sources":["../../../../libs/modules/identifier-management/contracts/src/permission.keys.ts","../../../../libs/modules/identifier-management/contracts/src/menu.keys.ts","../../../../libs/modules/identifier-management/contracts/src/identifier-rule.types.ts","../../../../libs/modules/identifier-management/contracts/src/root-config.ts","../../../../libs/modules/identifier-management/contracts/src/entities/identifier-rule/identifier-rule.types.ts","../../../../libs/modules/identifier-management/contracts/src/entities/identifier-rule/identifier-rule.entity.ts","../../../../libs/modules/identifier-management/contracts/src/index.ts","../../../../libs/modules/identifier-management/contracts/src/acorex-platform-module-identifier-management-client-contracts.ts"],"sourcesContent":["export const AXMPermissionsKeys = {\n IdentifierManagement: {\n Management: 'IdentifierManagement:Permission:Management',\n IdentifierRules: 'IdentifierManagement:Permission:IdentifierRules',\n },\n};\n","export const AXPIdentifierManagementMenuKeys = {\n Root: 'IdentifierManagement:Menu',\n IdentifierRules: 'IdentifierManagement:Menu:IdentifierRules',\n} as const;\n","//#region ---- Identifier rule contracts ----\n\nexport type { AXPIdentifierRule } from '@acorex-platform/framework-shared/core';\n\nexport { IDENTIFIER_RULE_ENTITY } from '@acorex-platform/framework-shared/core';\n\n//#endregion\n","const config = {\n i18n: 'identifier-management',\n module: 'IdentifierManagement',\n} as const;\n\nexport const RootConfig = {\n config,\n module: {\n module: 'identifier-management',\n name: config.module,\n title: `@${config.i18n}:module.title`,\n icon: 'fa-light fa-hashtag',\n },\n entities: {\n identifierRule: {\n name: 'IdentifierRule',\n source: `${config.module}.IdentifierRule`,\n title: `@${config.i18n}:entities.identifier-rule.title`,\n titlePlural: `@${config.i18n}:entities.identifier-rule.plural`,\n icon: 'fa-light fa-barcode',\n },\n },\n} as const;\n","\n//#region ---- Identifier rule domain model ----\n\nimport { AXPIdentifierRule } from \"../../identifier-rule.types\";\n\nexport interface AXMIdentifierManagementIdentifierRuleEntityModel extends AXPIdentifierRule {\n id: string;\n}\n\n//#endregion\n","import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';\nimport {\n AXPEntity,\n createAllQueryView,\n entityMasterCrudActions,\n entityMasterDeleteAction,\n} from '@acorex-platform/framework-shared/entity';\nimport { RootConfig } from '../../root-config';\n\n//#region ---- Identifier rule entity ----\n\nexport async function identifierRuleFactory(): Promise<AXPEntity | null> {\n const i18n = `${RootConfig.config.i18n}:entities.identifier-rule`;\n\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.identifierRule.name,\n title: RootConfig.entities.identifierRule.title,\n icon: RootConfig.entities.identifierRule.icon,\n plugins: [\n { name: 'clone' },\n { name: 'disable' },\n {\n name: 'unique-fields',\n options: { fields: 'name', scope: 'global' },\n },\n ],\n formats: {\n individual: RootConfig.entities.identifierRule.title,\n plural: RootConfig.entities.identifierRule.titlePlural,\n searchResult: { title: '{{ title }}', description: '{{ entity }} · {{ pattern }}' },\n },\n groups: [\n { id: 'basic-info', title: `@${i18n}.groups.basic-info` },\n { id: 'pattern', title: `@${i18n}.groups.pattern` },\n { id: 'scope', title: `@${i18n}.groups.scope` },\n ],\n properties: [\n {\n name: 'name',\n title: '@general:terms.common.name',\n groupId: 'basic-info',\n schema: {\n dataType: 'string',\n readonly: '{{ !!context.eval(\"id\") }}',\n interface: { type: AXPWidgetsList.Editors.TextBox },\n },\n validations: [{ rule: 'required' }, { rule: 'variable-name' }],\n options: {\n sort: { enabled: true },\n filter: { inline: { enabled: true }, advance: { enabled: true } },\n },\n },\n {\n name: 'title',\n title: '@general:terms.common.title',\n groupId: 'basic-info',\n schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.TextBox } },\n validations: [{ rule: 'required' }],\n options: {\n sort: { enabled: true },\n filter: { inline: { enabled: true }, advance: { enabled: true } },\n },\n },\n {\n name: 'entity',\n title: `@${i18n}.fields.entity.title`,\n groupId: 'basic-info',\n schema: { dataType: 'string', interface: { type: AXPWidgetsList.Editors.TextBox } },\n validations: [{ rule: 'required' }],\n options: {\n filter: { inline: { enabled: true }, advance: { enabled: true } },\n },\n },\n {\n name: 'pattern',\n title: `@${i18n}.fields.pattern.title`,\n groupId: 'pattern',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsList.Advanced.CodeEditor,\n options: { language: 'plaintext', lineNumbers: true },\n },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'scopeConfig',\n title: `@${i18n}.fields.scope-config.title`,\n groupId: 'scope',\n schema: {\n dataType: 'object',\n interface: {\n type: AXPWidgetsList.Advanced.CodeEditor,\n options: { language: 'json', lineNumbers: true, placeholder: '{}' },\n },\n },\n },\n ],\n columns: [{ name: 'name' }, { name: 'title' }, { name: 'entity' }, { name: 'pattern' }],\n interfaces: {\n master: {\n create: {\n sections: [{ id: 'basic-info' }, { id: 'pattern' }, { id: 'scope' }],\n properties: [\n { name: 'name', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 6, order: 2 } } } },\n { name: 'entity', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n { name: 'pattern', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },\n { name: 'scopeConfig', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },\n ],\n },\n update: {\n sections: [{ id: 'basic-info' }, { id: 'pattern' }, { id: 'scope' }],\n properties: [\n { name: 'name', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 6, order: 2 } } } },\n { name: 'entity', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n { name: 'pattern', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },\n { name: 'scopeConfig', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },\n ],\n },\n single: {\n title: '{{title}}',\n sections: [\n { id: 'basic-info', layout: { positions: { lg: { colSpan: 12 } } } },\n { id: 'pattern', layout: { positions: { lg: { colSpan: 12 } } } },\n { id: 'scope', layout: { positions: { lg: { colSpan: 12 } } } },\n ],\n properties: [\n { name: 'name', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 6, order: 2 } } } },\n { name: 'entity', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n { name: 'pattern', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },\n { name: 'scopeConfig', layout: { positions: { lg: { colSpan: 12, order: 1 } } } },\n ],\n actions: [entityMasterDeleteAction()],\n },\n list: {\n actions: [...entityMasterCrudActions()],\n views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })],\n },\n },\n },\n };\n\n return entityDef;\n}\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './permission.keys';\n\nexport * from './menu.keys';\n\nexport * from './identifier-rule.types';\n\nexport { IDENTIFIER_RULE_ENTITY } from './identifier-rule.types';\n\nexport * from './root-config';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAO,MAAM,kBAAkB,GAAG;AAChC,IAAA,oBAAoB,EAAE;AACpB,QAAA,UAAU,EAAE,4CAA4C;AACxD,QAAA,eAAe,EAAE,iDAAiD;AACnE,KAAA;;;ACJI,MAAM,+BAA+B,GAAG;AAC7C,IAAA,IAAI,EAAE,2BAA2B;AACjC,IAAA,eAAe,EAAE,2CAA2C;;;ACF9D;AAMA;;ACNA,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,uBAAuB;AAC7B,IAAA,MAAM,EAAE,sBAAsB;CACtB;AAEH,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,MAAM,EAAE,uBAAuB;QAC/B,IAAI,EAAE,MAAM,CAAC,MAAM;AACnB,QAAA,KAAK,EAAE,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAA,aAAA,CAAe;AACrC,QAAA,IAAI,EAAE,qBAAqB;AAC5B,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,gBAAgB;AACtB,YAAA,MAAM,EAAE,CAAA,EAAG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AE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;wBAC7E,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;AAClF,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,wBAAwB,EAAE,CAAC;AACtC,iBAAA;AACD,gBAAA,IAAI,EAAE;AACJ,oBAAA,OAAO,EAAE,CAAC,GAAG,uBAAuB,EAAE,CAAC;oBACvC,KAAK,EAAE,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACxE,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;AAEA;;ACtJA;;ACAA;;AAEG;;;;"}
|
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Injectable, NgModule } from '@angular/core';
|
|
3
|
+
import { AXPEntityService, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_DEFINITION_LOADER, AXPEntityStorageService } from '@acorex-platform/framework-client/layout/entity';
|
|
4
|
+
import { AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER, AXPDataGenerator } from '@acorex-platform/framework-client/core';
|
|
5
|
+
import { RootConfig, AXMPermissionsKeys, AXPIdentifierManagementMenuKeys, IDENTIFIER_RULE_ENTITY } from '@acorex-platform/module-identifier-management-client/contracts';
|
|
6
|
+
import { AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXPSearchCommandProvider } from '@acorex-platform/framework-client/common';
|
|
7
|
+
import { AXPSessionService, AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/auth';
|
|
8
|
+
import { AXPCommonMenuKeys } from '@acorex-platform/module-common-client/contracts';
|
|
9
|
+
import { get } from 'lodash';
|
|
10
|
+
|
|
11
|
+
//#region ---- Imports ----
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ---- Manifest Definition ----
|
|
14
|
+
/**
|
|
15
|
+
* Identifier Management Module Manifest.
|
|
16
|
+
* Defines module metadata, features, and provider references.
|
|
17
|
+
*/
|
|
18
|
+
const IdentifierManagementManifest = {
|
|
19
|
+
name: RootConfig.module.name,
|
|
20
|
+
version: '1.0.0',
|
|
21
|
+
title: RootConfig.module.title,
|
|
22
|
+
icon: RootConfig.module.icon,
|
|
23
|
+
i18n: RootConfig.config.i18n,
|
|
24
|
+
required: true,
|
|
25
|
+
// Module dependencies (optional)
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
//#region ---- Imports ----
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ---- Main Port (UI) ----
|
|
32
|
+
class AXPIdentifierService {
|
|
33
|
+
}
|
|
34
|
+
const AXP_IDENTIFIER_SERVICE = new InjectionToken('AXP_IDENTIFIER_SERVICE');
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region ---- DI Tokens ----
|
|
37
|
+
/** @deprecated Rules are loaded from {@link IDENTIFIER_RULE_ENTITY} entity storage. */
|
|
38
|
+
const AXP_IDENTIFIER_RULES = new InjectionToken('AXP_IDENTIFIER_RULES');
|
|
39
|
+
//#endregion
|
|
40
|
+
|
|
41
|
+
class AXMIdentifierEvaluatorScopeProvider {
|
|
42
|
+
constructor() {
|
|
43
|
+
this.identifierService = inject(AXP_IDENTIFIER_SERVICE);
|
|
44
|
+
this.sessionService = inject(AXPSessionService);
|
|
45
|
+
}
|
|
46
|
+
async provide(context) {
|
|
47
|
+
context.addScope('identifier', {
|
|
48
|
+
peek: async (id) => {
|
|
49
|
+
const identifier = await this.identifierService.peek({
|
|
50
|
+
id,
|
|
51
|
+
tenantId: this.sessionService.tenant?.id,
|
|
52
|
+
appId: this.sessionService.application?.id,
|
|
53
|
+
});
|
|
54
|
+
return identifier.code;
|
|
55
|
+
},
|
|
56
|
+
generate: async (id) => {
|
|
57
|
+
const identifier = await this.identifierService.generate({
|
|
58
|
+
id,
|
|
59
|
+
tenantId: this.sessionService.tenant?.id,
|
|
60
|
+
appId: this.sessionService.application?.id,
|
|
61
|
+
});
|
|
62
|
+
return identifier.code;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const IDENTIFIER_DEFAULT_VALUE = (rule) => `{{ identifier.peek("${rule}") }}`;
|
|
69
|
+
const identifierPlugin = {
|
|
70
|
+
name: 'identifier',
|
|
71
|
+
order: 40,
|
|
72
|
+
apply: (ctx, options) => {
|
|
73
|
+
if (!options?.field || !options?.rule)
|
|
74
|
+
return;
|
|
75
|
+
const defaultValue = IDENTIFIER_DEFAULT_VALUE(options.rule);
|
|
76
|
+
const entity = ctx.entity;
|
|
77
|
+
// Direct property: update in-place
|
|
78
|
+
const propHandle = ctx.properties.find(options.field);
|
|
79
|
+
const existingProp = propHandle.get();
|
|
80
|
+
if (existingProp) {
|
|
81
|
+
propHandle.update((p) => {
|
|
82
|
+
const next = { ...p };
|
|
83
|
+
next.schema = { ...(next.schema ?? {}) };
|
|
84
|
+
next.schema.defaultValue = defaultValue;
|
|
85
|
+
return next;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else if (options.field.includes('.')) {
|
|
89
|
+
// Nested path (e.g. party.code): use generic propertyOverrides extension
|
|
90
|
+
entity.extensions ??= {};
|
|
91
|
+
entity.extensions.propertyOverrides ??= {};
|
|
92
|
+
entity.extensions.propertyOverrides[options.field] = {
|
|
93
|
+
schema: { ...(entity.extensions.propertyOverrides[options.field]?.schema ?? {}), defaultValue },
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
entity.extensions ??= {};
|
|
97
|
+
entity.extensions.identifier = { field: options.field, rule: options.rule };
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
class AXMPermissionDefinitionProvider {
|
|
102
|
+
async define(context) {
|
|
103
|
+
const keys = AXMPermissionsKeys.IdentifierManagement;
|
|
104
|
+
context
|
|
105
|
+
.addGroup(RootConfig.module.name, '@identifier-management:permissions.manage.title', '@identifier-management:permissions.manage.description')
|
|
106
|
+
.addPermission(keys.IdentifierRules, '@identifier-management:entities.identifier-rule.permissions.manage.title', '@identifier-management:entities.identifier-rule.permissions.manage.description')
|
|
107
|
+
.endPermission()
|
|
108
|
+
.endGroup();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
class AXMMenuProvider {
|
|
113
|
+
constructor() {
|
|
114
|
+
this.entityService = inject(AXPEntityService);
|
|
115
|
+
}
|
|
116
|
+
async provide(context) {
|
|
117
|
+
const module = RootConfig.module;
|
|
118
|
+
context.find(AXPCommonMenuKeys.Platform).addItems([
|
|
119
|
+
{
|
|
120
|
+
name: AXPIdentifierManagementMenuKeys.IdentifierRules,
|
|
121
|
+
text: RootConfig.entities.identifierRule.titlePlural,
|
|
122
|
+
path: this.entityService.createPath(module.name, RootConfig.entities.identifierRule.name),
|
|
123
|
+
icon: RootConfig.entities.identifierRule.icon,
|
|
124
|
+
priority: 4,
|
|
125
|
+
policy: {
|
|
126
|
+
features: [module.name],
|
|
127
|
+
permissions: [AXMPermissionsKeys.IdentifierManagement.IdentifierRules],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
class AXMEntityProvider {
|
|
135
|
+
preload() {
|
|
136
|
+
const module = RootConfig.module.name;
|
|
137
|
+
return Array.from(Object.values(RootConfig.entities)).map((entity) => ({
|
|
138
|
+
module: module,
|
|
139
|
+
entity: entity.name,
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
async get(moduleName, entityName) {
|
|
143
|
+
if (moduleName == RootConfig.module.name) {
|
|
144
|
+
switch (entityName) {
|
|
145
|
+
case RootConfig.entities.identifierRule.name:
|
|
146
|
+
return (await import('@acorex-platform/module-identifier-management-client/contracts')).identifierRuleFactory();
|
|
147
|
+
default:
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
async list() {
|
|
154
|
+
const m = RootConfig.module.name;
|
|
155
|
+
const entities = Object.values(RootConfig.entities);
|
|
156
|
+
return Promise.resolve(entities.map((e) => ({ name: e.name, module: m })));
|
|
157
|
+
}
|
|
158
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMEntityProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
159
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMEntityProvider }); }
|
|
160
|
+
}
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMEntityProvider, decorators: [{
|
|
162
|
+
type: Injectable
|
|
163
|
+
}] });
|
|
164
|
+
|
|
165
|
+
class AXMSettingProvider {
|
|
166
|
+
async provide(context) {
|
|
167
|
+
// context
|
|
168
|
+
// // Add Form Template Group
|
|
169
|
+
// .addGroup('form-template', 'Form Template', 'Settings related to form templates.', RootConfig.module.icon)
|
|
170
|
+
// // Start Interface Section
|
|
171
|
+
// .addSection('interface', 'UI Interface', 'Customize the user interface for forms.')
|
|
172
|
+
// .addSetting({
|
|
173
|
+
// key: 'history-panel',
|
|
174
|
+
// title: 'Show History Panel',
|
|
175
|
+
// scope: 'U',
|
|
176
|
+
// isInherited: true,
|
|
177
|
+
// defaultValue: false,
|
|
178
|
+
// widget: {
|
|
179
|
+
// type: AXPWidgetsCatalog.toggle,
|
|
180
|
+
// },
|
|
181
|
+
// description: 'Enable or disable the history panel for forms.',
|
|
182
|
+
// validationRules: [
|
|
183
|
+
// {
|
|
184
|
+
// rule: 'required',
|
|
185
|
+
// },
|
|
186
|
+
// ],
|
|
187
|
+
// })
|
|
188
|
+
// .endSection()
|
|
189
|
+
// .endGroup();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
class AXMIdentifierManagementModule {
|
|
194
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMIdentifierManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
195
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXMIdentifierManagementModule }); }
|
|
196
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMIdentifierManagementModule, providers: [
|
|
197
|
+
// Module-specific providers (not part of manifest system)
|
|
198
|
+
{
|
|
199
|
+
provide: AXP_ENTITY_ACTION_PLUGIN,
|
|
200
|
+
useValue: identifierPlugin,
|
|
201
|
+
multi: true,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,
|
|
205
|
+
useClass: AXMIdentifierEvaluatorScopeProvider,
|
|
206
|
+
multi: true,
|
|
207
|
+
},
|
|
208
|
+
// Module Manifest Provider
|
|
209
|
+
{
|
|
210
|
+
provide: AXP_MODULE_MANIFEST_PROVIDER,
|
|
211
|
+
useValue: IdentifierManagementManifest,
|
|
212
|
+
multi: true,
|
|
213
|
+
},
|
|
214
|
+
// Provider references (now using tokens)
|
|
215
|
+
{
|
|
216
|
+
provide: AXP_PERMISSION_DEFINITION_PROVIDER,
|
|
217
|
+
useClass: AXMPermissionDefinitionProvider,
|
|
218
|
+
multi: true,
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
provide: AXP_MENU_PROVIDER,
|
|
222
|
+
useClass: AXMMenuProvider,
|
|
223
|
+
multi: true,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
provide: AXP_ENTITY_DEFINITION_LOADER,
|
|
227
|
+
useClass: AXMEntityProvider,
|
|
228
|
+
multi: true,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
|
232
|
+
useClass: AXMSettingProvider,
|
|
233
|
+
multi: true,
|
|
234
|
+
},
|
|
235
|
+
] }); }
|
|
236
|
+
}
|
|
237
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMIdentifierManagementModule, decorators: [{
|
|
238
|
+
type: NgModule,
|
|
239
|
+
args: [{
|
|
240
|
+
imports: [],
|
|
241
|
+
exports: [],
|
|
242
|
+
declarations: [],
|
|
243
|
+
providers: [
|
|
244
|
+
// Module-specific providers (not part of manifest system)
|
|
245
|
+
{
|
|
246
|
+
provide: AXP_ENTITY_ACTION_PLUGIN,
|
|
247
|
+
useValue: identifierPlugin,
|
|
248
|
+
multi: true,
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,
|
|
252
|
+
useClass: AXMIdentifierEvaluatorScopeProvider,
|
|
253
|
+
multi: true,
|
|
254
|
+
},
|
|
255
|
+
// Module Manifest Provider
|
|
256
|
+
{
|
|
257
|
+
provide: AXP_MODULE_MANIFEST_PROVIDER,
|
|
258
|
+
useValue: IdentifierManagementManifest,
|
|
259
|
+
multi: true,
|
|
260
|
+
},
|
|
261
|
+
// Provider references (now using tokens)
|
|
262
|
+
{
|
|
263
|
+
provide: AXP_PERMISSION_DEFINITION_PROVIDER,
|
|
264
|
+
useClass: AXMPermissionDefinitionProvider,
|
|
265
|
+
multi: true,
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
provide: AXP_MENU_PROVIDER,
|
|
269
|
+
useClass: AXMMenuProvider,
|
|
270
|
+
multi: true,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
provide: AXP_ENTITY_DEFINITION_LOADER,
|
|
274
|
+
useClass: AXMEntityProvider,
|
|
275
|
+
multi: true,
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
|
279
|
+
useClass: AXMSettingProvider,
|
|
280
|
+
multi: true,
|
|
281
|
+
},
|
|
282
|
+
]
|
|
283
|
+
}]
|
|
284
|
+
}] });
|
|
285
|
+
|
|
286
|
+
class AXMSearchCommandProvider extends AXPSearchCommandProvider {
|
|
287
|
+
constructor() {
|
|
288
|
+
super(...arguments);
|
|
289
|
+
this.commands = [
|
|
290
|
+
// {
|
|
291
|
+
// group: 'command',
|
|
292
|
+
// title: 'New Form Template',
|
|
293
|
+
// icon: RootConfig.entities.template.icon,
|
|
294
|
+
// description: 'Create a new form template for designing reusable forms.', // Added description
|
|
295
|
+
// commands: {
|
|
296
|
+
// 'create-entity': {
|
|
297
|
+
// entity: `${RootConfig.module.name}.${RootConfig.entities.template.name}`,
|
|
298
|
+
// },
|
|
299
|
+
// },
|
|
300
|
+
// }
|
|
301
|
+
];
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
//#region ---- Identifier rule repository ----
|
|
306
|
+
/**
|
|
307
|
+
|
|
308
|
+
* Loads identifier rules from {@link IDENTIFIER_RULE_ENTITY} entity storage (mock or API).
|
|
309
|
+
|
|
310
|
+
*/
|
|
311
|
+
class AXPIdentifierRuleRepository {
|
|
312
|
+
constructor() {
|
|
313
|
+
this.storage = inject(AXPEntityStorageService);
|
|
314
|
+
}
|
|
315
|
+
async findById(id) {
|
|
316
|
+
const rules = await this.listAll();
|
|
317
|
+
return rules.find((rule) => rule.name === id && !rule.isDisabled);
|
|
318
|
+
}
|
|
319
|
+
async listEnabled() {
|
|
320
|
+
const rules = await this.listAll();
|
|
321
|
+
return rules.filter((rule) => !rule.isDisabled);
|
|
322
|
+
}
|
|
323
|
+
async listAll() {
|
|
324
|
+
try {
|
|
325
|
+
const response = await this.storage.query(IDENTIFIER_RULE_ENTITY, { skip: 0, take: 1000 });
|
|
326
|
+
const items = response.items ?? [];
|
|
327
|
+
return items
|
|
328
|
+
.map((item) => this.mapEntityToRule(item))
|
|
329
|
+
.filter((rule) => rule != null);
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
return [];
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
mapEntityToRule(record) {
|
|
336
|
+
if (!record || typeof record !== 'object') {
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
const nameRaw = get(record, 'name') ?? get(record, 'id');
|
|
340
|
+
const pattern = get(record, 'pattern');
|
|
341
|
+
if (typeof nameRaw !== 'string' || typeof pattern !== 'string') {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
const scopeConfig = get(record, 'scopeConfig');
|
|
345
|
+
const enabledLegacy = get(record, 'enabled');
|
|
346
|
+
const isDisabledRaw = get(record, 'isDisabled');
|
|
347
|
+
const isDisabled = typeof isDisabledRaw === 'boolean'
|
|
348
|
+
? isDisabledRaw
|
|
349
|
+
: enabledLegacy === false;
|
|
350
|
+
return {
|
|
351
|
+
name: nameRaw,
|
|
352
|
+
title: String(get(record, 'title') ?? nameRaw),
|
|
353
|
+
entity: String(get(record, 'entity') ?? ''),
|
|
354
|
+
pattern,
|
|
355
|
+
isDisabled,
|
|
356
|
+
scopeConfig: scopeConfig && typeof scopeConfig === 'object'
|
|
357
|
+
? scopeConfig
|
|
358
|
+
: {},
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPIdentifierRuleRepository, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
362
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPIdentifierRuleRepository, providedIn: 'root' }); }
|
|
363
|
+
}
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPIdentifierRuleRepository, decorators: [{
|
|
365
|
+
type: Injectable,
|
|
366
|
+
args: [{ providedIn: 'root' }]
|
|
367
|
+
}] });
|
|
368
|
+
|
|
369
|
+
//#region ---- Token Contracts ----
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region ---- DI Tokens ----
|
|
372
|
+
const AXP_TOKEN_HANDLERS = new InjectionToken('AXP_TOKEN_HANDLERS');
|
|
373
|
+
//#endregion
|
|
374
|
+
|
|
375
|
+
//#region ---- Imports ----
|
|
376
|
+
//#endregion
|
|
377
|
+
class AXPTokenRegistryService {
|
|
378
|
+
constructor() {
|
|
379
|
+
//#region ---- Fields ----
|
|
380
|
+
this.handlers = new Map();
|
|
381
|
+
this.providerHandlers = inject(AXP_TOKEN_HANDLERS, { optional: true }) ?? [];
|
|
382
|
+
}
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region ---- Public API ----
|
|
385
|
+
register(handler) {
|
|
386
|
+
const existing = this.handlers.get(handler.name);
|
|
387
|
+
if (!existing || (handler.priority ?? 0) > (existing.priority ?? 0)) {
|
|
388
|
+
this.handlers.set(handler.name, handler);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
unregister(name) {
|
|
392
|
+
this.handlers.delete(name);
|
|
393
|
+
}
|
|
394
|
+
get(name) {
|
|
395
|
+
// provider-provided take precedence by priority
|
|
396
|
+
const fromProviders = this.providerHandlers
|
|
397
|
+
.filter((h) => h.name === name)
|
|
398
|
+
.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0))[0];
|
|
399
|
+
if (fromProviders)
|
|
400
|
+
return fromProviders;
|
|
401
|
+
return this.handlers.get(name);
|
|
402
|
+
}
|
|
403
|
+
list() {
|
|
404
|
+
const map = new Map();
|
|
405
|
+
const put = (h) => {
|
|
406
|
+
const prev = map.get(h.name);
|
|
407
|
+
if (!prev || (h.priority ?? 0) > (prev.priority ?? 0))
|
|
408
|
+
map.set(h.name, h);
|
|
409
|
+
};
|
|
410
|
+
this.providerHandlers.forEach(put);
|
|
411
|
+
Array.from(this.handlers.values()).forEach(put);
|
|
412
|
+
return Array.from(map.values()).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
413
|
+
}
|
|
414
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPTokenRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
415
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPTokenRegistryService, providedIn: 'root' }); }
|
|
416
|
+
}
|
|
417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPTokenRegistryService, decorators: [{
|
|
418
|
+
type: Injectable,
|
|
419
|
+
args: [{ providedIn: 'root' }]
|
|
420
|
+
}] });
|
|
421
|
+
|
|
422
|
+
//#region ---- Imports ----
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region ---- Simple Pattern Engine Impl ----
|
|
425
|
+
const TOKEN_REGEX = /\{([^{}]+)\}/g; // matches {token[:args]}
|
|
426
|
+
class AXPSimplePatternEngine {
|
|
427
|
+
constructor() {
|
|
428
|
+
this.registry = inject(AXPTokenRegistryService);
|
|
429
|
+
}
|
|
430
|
+
compile(pattern) {
|
|
431
|
+
const tokens = [];
|
|
432
|
+
let match;
|
|
433
|
+
let index = 0;
|
|
434
|
+
let lastIndex = 0;
|
|
435
|
+
while ((match = TOKEN_REGEX.exec(pattern)) !== null) {
|
|
436
|
+
// push any literal text before this token
|
|
437
|
+
const literal = pattern.slice(lastIndex, match.index);
|
|
438
|
+
if (literal) {
|
|
439
|
+
tokens.push({ type: 'literal', text: literal });
|
|
440
|
+
}
|
|
441
|
+
const raw = match[0];
|
|
442
|
+
const inner = match[1];
|
|
443
|
+
const [name, ...args] = inner.split(':');
|
|
444
|
+
const token = {
|
|
445
|
+
name: name.trim(),
|
|
446
|
+
args: args.length ? inner.substring(inner.indexOf(':') + 1).split(':') : [],
|
|
447
|
+
raw,
|
|
448
|
+
index: index++,
|
|
449
|
+
};
|
|
450
|
+
const handler = this.registry.get(token.name);
|
|
451
|
+
if (!handler) {
|
|
452
|
+
throw new Error(`Unknown token: ${token.name}`);
|
|
453
|
+
}
|
|
454
|
+
handler.validate?.(token);
|
|
455
|
+
tokens.push(token);
|
|
456
|
+
lastIndex = match.index + raw.length;
|
|
457
|
+
}
|
|
458
|
+
// trailing literal
|
|
459
|
+
const tail = pattern.slice(lastIndex);
|
|
460
|
+
if (tail) {
|
|
461
|
+
tokens.push({ type: 'literal', text: tail });
|
|
462
|
+
}
|
|
463
|
+
return { pattern, tokens };
|
|
464
|
+
}
|
|
465
|
+
async evaluate(compiled, ctx) {
|
|
466
|
+
let built = '';
|
|
467
|
+
for (const frag of compiled.tokens) {
|
|
468
|
+
if (frag.type === 'literal') {
|
|
469
|
+
built += frag.text;
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
const token = frag;
|
|
473
|
+
ctx.cache.set('__acc__', built);
|
|
474
|
+
const handler = this.registry.get(token.name);
|
|
475
|
+
if (!handler) {
|
|
476
|
+
throw new Error(`Unknown token at eval: ${token.name}`);
|
|
477
|
+
}
|
|
478
|
+
const fragment = await handler.eval(token, ctx);
|
|
479
|
+
built += fragment;
|
|
480
|
+
}
|
|
481
|
+
return built;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
//#endregion
|
|
485
|
+
|
|
486
|
+
//#region ---- Imports ----
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region ---- Utility Functions ----
|
|
489
|
+
function buildScopeHash(parts) {
|
|
490
|
+
return parts.filter(Boolean).join('|');
|
|
491
|
+
}
|
|
492
|
+
function padNumber(num, size) {
|
|
493
|
+
const s = String(num);
|
|
494
|
+
if (s.length >= size)
|
|
495
|
+
return s;
|
|
496
|
+
return '0'.repeat(size - s.length) + s;
|
|
497
|
+
}
|
|
498
|
+
function uuid() {
|
|
499
|
+
return AXPDataGenerator.uuid();
|
|
500
|
+
}
|
|
501
|
+
//#endregion
|
|
502
|
+
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region ---- Built-in Token Handlers (Injectable) ----
|
|
505
|
+
class DateToken {
|
|
506
|
+
constructor() {
|
|
507
|
+
this.name = 'date';
|
|
508
|
+
this.meta = { title: 'Date', description: 'Formats current date', argHints: ['YYYY', 'YYYYMM', 'YYYYMMDD'] };
|
|
509
|
+
}
|
|
510
|
+
async eval(token, ctx) {
|
|
511
|
+
const fmt = token.args[0] ?? 'YYYYMMDD';
|
|
512
|
+
const d = ctx.services.clock?.now() ?? ctx.now;
|
|
513
|
+
const y = String(d.getFullYear());
|
|
514
|
+
const m = padNumber(d.getMonth() + 1, 2);
|
|
515
|
+
const day = padNumber(d.getDate(), 2);
|
|
516
|
+
switch (fmt) {
|
|
517
|
+
case 'YYYY':
|
|
518
|
+
return y;
|
|
519
|
+
case 'YYYYMM':
|
|
520
|
+
return y + m;
|
|
521
|
+
case 'YYYYMMDD':
|
|
522
|
+
default:
|
|
523
|
+
return y + m + day;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateToken, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
527
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateToken }); }
|
|
528
|
+
}
|
|
529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateToken, decorators: [{
|
|
530
|
+
type: Injectable
|
|
531
|
+
}] });
|
|
532
|
+
class ConstToken {
|
|
533
|
+
constructor() {
|
|
534
|
+
this.name = 'const';
|
|
535
|
+
this.meta = { title: 'Constant', description: 'Fixed literal value' };
|
|
536
|
+
}
|
|
537
|
+
async eval(token) {
|
|
538
|
+
return token.args.join(':');
|
|
539
|
+
}
|
|
540
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConstToken, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
541
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConstToken }); }
|
|
542
|
+
}
|
|
543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConstToken, decorators: [{
|
|
544
|
+
type: Injectable
|
|
545
|
+
}] });
|
|
546
|
+
class FieldToken {
|
|
547
|
+
constructor() {
|
|
548
|
+
this.name = 'field';
|
|
549
|
+
this.meta = { title: 'Field', description: 'Reads a value from request.payload' };
|
|
550
|
+
}
|
|
551
|
+
async eval(token, ctx) {
|
|
552
|
+
const key = token.args[0];
|
|
553
|
+
if (!key)
|
|
554
|
+
return '';
|
|
555
|
+
const value = ctx.request.payload?.[key];
|
|
556
|
+
return value == null ? '' : String(value);
|
|
557
|
+
}
|
|
558
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FieldToken, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
559
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FieldToken }); }
|
|
560
|
+
}
|
|
561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FieldToken, decorators: [{
|
|
562
|
+
type: Injectable
|
|
563
|
+
}] });
|
|
564
|
+
class TenantToken {
|
|
565
|
+
constructor() {
|
|
566
|
+
this.name = 'tenant';
|
|
567
|
+
this.meta = { title: 'Tenant', description: 'Tenant scope identifier' };
|
|
568
|
+
}
|
|
569
|
+
async eval(_t, ctx) {
|
|
570
|
+
return ctx.request.tenantId ?? '';
|
|
571
|
+
}
|
|
572
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TenantToken, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
573
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TenantToken }); }
|
|
574
|
+
}
|
|
575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TenantToken, decorators: [{
|
|
576
|
+
type: Injectable
|
|
577
|
+
}] });
|
|
578
|
+
class AppToken {
|
|
579
|
+
constructor() {
|
|
580
|
+
this.name = 'app';
|
|
581
|
+
this.meta = { title: 'App', description: 'Application scope identifier' };
|
|
582
|
+
}
|
|
583
|
+
async eval(_t, ctx) {
|
|
584
|
+
return ctx.request.appId ?? '';
|
|
585
|
+
}
|
|
586
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AppToken, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
587
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AppToken }); }
|
|
588
|
+
}
|
|
589
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AppToken, decorators: [{
|
|
590
|
+
type: Injectable
|
|
591
|
+
}] });
|
|
592
|
+
class SeqToken {
|
|
593
|
+
constructor() {
|
|
594
|
+
this.name = 'seq';
|
|
595
|
+
this.meta = { title: 'Sequence', description: 'Auto-increment sequence', argHints: ['pad'] };
|
|
596
|
+
}
|
|
597
|
+
async eval(token, ctx) {
|
|
598
|
+
const pad = Number(token.args[0] ?? '0') || 0;
|
|
599
|
+
const consume = ctx.evaluationMode === 'commit';
|
|
600
|
+
const ruleId = ctx.cache.get('ruleId');
|
|
601
|
+
const n = await ctx.services.sequence.next(ctx.cache.get('scopeHash'), ruleId, { pad, consume });
|
|
602
|
+
return pad ? padNumber(n, pad) : String(n);
|
|
603
|
+
}
|
|
604
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SeqToken, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
605
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SeqToken }); }
|
|
606
|
+
}
|
|
607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SeqToken, decorators: [{
|
|
608
|
+
type: Injectable
|
|
609
|
+
}] });
|
|
610
|
+
class CheckToken {
|
|
611
|
+
constructor() {
|
|
612
|
+
this.name = 'check';
|
|
613
|
+
this.meta = { title: 'Checksum', description: 'Checksum of the string built so far', argHints: ['luhn|mod11'] };
|
|
614
|
+
}
|
|
615
|
+
async eval(token, ctx) {
|
|
616
|
+
const algo = token.args[0] ?? 'luhn';
|
|
617
|
+
const acc = String(ctx.cache.get('__acc__') ?? '');
|
|
618
|
+
return ctx.services.checksum.compute(algo, acc);
|
|
619
|
+
}
|
|
620
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CheckToken, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
621
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CheckToken }); }
|
|
622
|
+
}
|
|
623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CheckToken, decorators: [{
|
|
624
|
+
type: Injectable
|
|
625
|
+
}] });
|
|
626
|
+
|
|
627
|
+
const AXP_DEFAULT_TOKEN_PROVIDERS = [
|
|
628
|
+
{ provide: AXP_TOKEN_HANDLERS, useClass: DateToken, multi: true },
|
|
629
|
+
{ provide: AXP_TOKEN_HANDLERS, useClass: ConstToken, multi: true },
|
|
630
|
+
{ provide: AXP_TOKEN_HANDLERS, useClass: FieldToken, multi: true },
|
|
631
|
+
{ provide: AXP_TOKEN_HANDLERS, useClass: TenantToken, multi: true },
|
|
632
|
+
{ provide: AXP_TOKEN_HANDLERS, useClass: AppToken, multi: true },
|
|
633
|
+
{ provide: AXP_TOKEN_HANDLERS, useClass: SeqToken, multi: true },
|
|
634
|
+
{ provide: AXP_TOKEN_HANDLERS, useClass: CheckToken, multi: true },
|
|
635
|
+
];
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Generated bundle index. Do not edit.
|
|
639
|
+
*/
|
|
640
|
+
|
|
641
|
+
export { AXMEntityProvider, AXMIdentifierManagementModule, AXMMenuProvider, AXMSearchCommandProvider, AXMSettingProvider, AXPIdentifierRuleRepository, AXPIdentifierService, AXPSimplePatternEngine, AXPTokenRegistryService, AXP_DEFAULT_TOKEN_PROVIDERS, AXP_IDENTIFIER_RULES, AXP_IDENTIFIER_SERVICE, AXP_TOKEN_HANDLERS, AppToken, CheckToken, ConstToken, DateToken, FieldToken, SeqToken, TenantToken, buildScopeHash, padNumber, uuid };
|
|
642
|
+
//# sourceMappingURL=acorex-platform-module-identifier-management-client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-identifier-management-client.mjs","sources":["../../../../libs/modules/identifier-management/client/src/lib/manifest.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/core/identifier.types.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/identifier-evaluator-scope.provider.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/identifier.plugin.ts","../../../../libs/modules/identifier-management/client/src/lib/permission-definition.provider.ts","../../../../libs/modules/identifier-management/client/src/lib/menu.provider.ts","../../../../libs/modules/identifier-management/client/src/lib/entity.provider.ts","../../../../libs/modules/identifier-management/client/src/lib/setting.provider.ts","../../../../libs/modules/identifier-management/client/src/lib/identifier-management.module.ts","../../../../libs/modules/identifier-management/client/src/lib/search-command.provider.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/core/identifier-rule.repository.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/core/tokens.types.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/core/token-registry.service.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/core/engine.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/core/utils.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/core/tokens-default.ts","../../../../libs/modules/identifier-management/client/src/lib/features/shared/core/tokens-default.providers.ts","../../../../libs/modules/identifier-management/client/src/acorex-platform-module-identifier-management-client.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/module-identifier-management-client/contracts';\n\n//#endregion\n\n//#region ---- Manifest Definition ----\n\n/**\n * Identifier Management Module Manifest.\n * Defines module metadata, features, and provider references.\n */\nexport const IdentifierManagementManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n required: true,\n\n // Module dependencies (optional)\n};\n\n//#endregion\n\n","//#region ---- Imports ----\n\nimport { InjectionToken } from '@angular/core';\nimport type { AXPIdentifierRule } from '@acorex-platform/module-identifier-management-client/contracts';\n\n//#endregion\n\n//#region ---- Public Types: Requests & Results ----\n\nexport interface AXPIdentifierRequest {\n /** Identifier id, e.g. 'employee-code' */\n id: string;\n /** Optional tenant partition */\n tenantId?: string;\n /** Optional application partition */\n appId?: string;\n /** Arbitrary payload for tokens to read from */\n payload?: Record<string, unknown>;\n}\n\nexport interface AXPIdentifierResult {\n code: string;\n ruleId: string;\n scopeHash: string;\n consumed: boolean;\n meta?: Record<string, unknown>;\n}\n\nexport interface AXPIdentifierPeekResult extends AXPIdentifierResult {\n consumed: false;\n commitToken: string; // opaque token for safe finalization\n}\n\n//#endregion\n\n//#region ---- Rule Definition ----\n\nexport type { AXPIdentifierRule };\n\n//#endregion\n\n//#region ---- Main Port (UI) ----\n\nexport abstract class AXPIdentifierService {\n abstract generate(req: AXPIdentifierRequest): Promise<AXPIdentifierResult>;\n abstract peek(req: AXPIdentifierRequest): Promise<AXPIdentifierPeekResult>;\n abstract validate(code: string, entity: string, tenantId?: string): Promise<boolean>;\n abstract commitWithToken(token: string): Promise<AXPIdentifierResult>;\n /** Optional helper for manual codes; stricter and may reject if not next sequence */\n abstract commitByCode(req: AXPIdentifierRequest, code: string): Promise<AXPIdentifierResult>;\n}\n\n\nexport const AXP_IDENTIFIER_SERVICE = new InjectionToken<AXPIdentifierService>('AXP_IDENTIFIER_SERVICE');\n\n//#endregion\n\n//#region ---- DI Tokens ----\n\n/** @deprecated Rules are loaded from {@link IDENTIFIER_RULE_ENTITY} entity storage. */\nexport const AXP_IDENTIFIER_RULES = new InjectionToken<AXPIdentifierRule[]>(\n 'AXP_IDENTIFIER_RULES'\n);\n\n//#endregion\n\n\n","import { AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from \"@acorex-platform/framework-client/core\";\nimport { inject } from \"@angular/core\";\nimport { AXP_IDENTIFIER_SERVICE } from \"./core/identifier.types\";\nimport { AXPSessionService } from \"@acorex-platform/framework-client/auth\";\n\nexport class AXMIdentifierEvaluatorScopeProvider implements AXPExpressionEvaluatorScopeProvider {\n\n protected identifierService = inject(AXP_IDENTIFIER_SERVICE);\n protected sessionService = inject(AXPSessionService);\n\n async provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void> {\n context.addScope('identifier', {\n peek: async (id: string) => {\n const identifier = await this.identifierService.peek({\n id,\n tenantId: this.sessionService.tenant?.id,\n appId: this.sessionService.application?.id,\n });\n return identifier.code;\n },\n generate: async (id: string) => {\n const identifier = await this.identifierService.generate({\n id,\n tenantId: this.sessionService.tenant?.id,\n appId: this.sessionService.application?.id,\n });\n return identifier.code;\n }\n })\n }\n}","import { AXPEntityActionPlugin } from \"@acorex-platform/framework-client/layout/entity\";\n\nconst IDENTIFIER_DEFAULT_VALUE = (rule: string) => `{{ identifier.peek(\"${rule}\") }}`;\n\nexport const identifierPlugin: AXPEntityActionPlugin = {\n name: 'identifier',\n order: 40,\n apply: (ctx, options: { field: string; rule: string }) => {\n if (!options?.field || !options?.rule) return;\n\n const defaultValue = IDENTIFIER_DEFAULT_VALUE(options.rule);\n const entity = ctx.entity as any;\n\n // Direct property: update in-place\n const propHandle = ctx.properties.find(options.field);\n const existingProp = propHandle.get();\n if (existingProp) {\n propHandle.update((p) => {\n const next = { ...p } as any;\n next.schema = { ...(next.schema ?? {}) };\n next.schema.defaultValue = defaultValue;\n return next;\n });\n } else if (options.field.includes('.')) {\n // Nested path (e.g. party.code): use generic propertyOverrides extension\n entity.extensions ??= {};\n entity.extensions.propertyOverrides ??= {};\n entity.extensions.propertyOverrides[options.field] = {\n schema: { ...(entity.extensions.propertyOverrides[options.field]?.schema ?? {}), defaultValue },\n };\n }\n\n entity.extensions ??= {};\n entity.extensions.identifier = { field: options.field, rule: options.rule };\n },\n};\n\n","import {\n AXPPermissionDefinitionProvider,\n AXPPermissionDefinitionProviderContext,\n} from '@acorex-platform/framework-client/auth';\nimport { AXMPermissionsKeys, RootConfig } from '@acorex-platform/module-identifier-management-client/contracts';\n\nexport class AXMPermissionDefinitionProvider implements AXPPermissionDefinitionProvider {\n async define(context: AXPPermissionDefinitionProviderContext): Promise<void> {\n const keys = AXMPermissionsKeys.IdentifierManagement;\n\n context\n .addGroup(\n RootConfig.module.name,\n '@identifier-management:permissions.manage.title',\n '@identifier-management:permissions.manage.description',\n )\n .addPermission(\n keys.IdentifierRules,\n '@identifier-management:entities.identifier-rule.permissions.manage.title',\n '@identifier-management:entities.identifier-rule.permissions.manage.description',\n )\n .endPermission()\n .endGroup();\n }\n}\n","import { AXPCommonMenuKeys } from '@acorex-platform/module-common-client/contracts';\nimport {\n AXPIdentifierManagementMenuKeys,\n AXMPermissionsKeys,\n RootConfig,\n} from '@acorex-platform/module-identifier-management-client/contracts';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { inject } from '@angular/core';\n\nexport class AXMMenuProvider implements AXPMenuProvider {\n private entityService = inject(AXPEntityService);\n\n async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n\n context.find(AXPCommonMenuKeys.Platform).addItems([\n {\n name: AXPIdentifierManagementMenuKeys.IdentifierRules,\n text: RootConfig.entities.identifierRule.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.identifierRule.name),\n icon: RootConfig.entities.identifierRule.icon,\n priority: 4,\n policy: {\n features: [module.name],\n permissions: [AXMPermissionsKeys.IdentifierManagement.IdentifierRules],\n },\n },\n ]);\n }\n}\n","\nimport { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport {\n AXPEntityDefinitionLoader,\n AXPEntityDefinitionPreloader,\n AXPEntityPreloadEntity,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { Injectable } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-identifier-management-client/contracts';\n\n@Injectable()\nexport class AXMEntityProvider implements AXPEntityDefinitionLoader, AXPEntityDefinitionPreloader {\n public preload(): AXPEntityPreloadEntity[] {\n const module = RootConfig.module.name;\n return Array.from(Object.values(RootConfig.entities)).map((entity: { name: string }) => ({\n module: module,\n entity: entity.name,\n }));\n }\n\n async get(moduleName: string, entityName: string): Promise<AXPEntity | null> {\n if (moduleName == RootConfig.module.name) {\n switch (entityName) {\n case RootConfig.entities.identifierRule.name:\n return (await import('@acorex-platform/module-identifier-management-client/contracts')).identifierRuleFactory();\n default:\n break;\n }\n }\n return null;\n }\n\n async list(): Promise<{ name: string; module: string }[]> {\n const m = RootConfig.module.name;\n const entities = Object.values(RootConfig.entities) as { name: string }[];\n return Promise.resolve(entities.map((e) => ({ name: e.name, module: m })));\n }\n}\n","import { AXPSettingDefinitionProvider, AXPSettingDefinitionProviderContext } from '@acorex-platform/framework-client/common';\n\nexport class AXMSettingProvider implements AXPSettingDefinitionProvider {\n async provide(context: AXPSettingDefinitionProviderContext): Promise<void> {\n // context\n // // Add Form Template Group\n // .addGroup('form-template', 'Form Template', 'Settings related to form templates.', RootConfig.module.icon)\n // // Start Interface Section\n // .addSection('interface', 'UI Interface', 'Customize the user interface for forms.')\n // .addSetting({\n // key: 'history-panel',\n // title: 'Show History Panel',\n // scope: 'U',\n // isInherited: true,\n // defaultValue: false,\n // widget: {\n // type: AXPWidgetsCatalog.toggle,\n // },\n // description: 'Enable or disable the history panel for forms.',\n // validationRules: [\n // {\n // rule: 'required',\n // },\n // ],\n // })\n // .endSection()\n // .endGroup();\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_DEFINITION_LOADER } from '@acorex-platform/framework-client/layout/entity';\nimport { AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER } from '@acorex-platform/framework-client/core';\nimport { IdentifierManagementManifest } from './manifest';\nimport { AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/common';\nimport { AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/auth';\nimport { AXMIdentifierEvaluatorScopeProvider } from './features/shared/identifier-evaluator-scope.provider';\nimport { identifierPlugin } from \"./features/shared/identifier.plugin\";\nimport { AXMPermissionDefinitionProvider } from './permission-definition.provider';\nimport { AXMMenuProvider } from './menu.provider';\nimport { AXMEntityProvider } from './entity.provider';\nimport { AXMSettingProvider } from './setting.provider';\n\n@NgModule({\n imports: [],\n exports: [],\n declarations: [],\n providers: [\n // Module-specific providers (not part of manifest system)\n {\n provide: AXP_ENTITY_ACTION_PLUGIN,\n useValue: identifierPlugin,\n multi: true,\n },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXMIdentifierEvaluatorScopeProvider,\n multi: true,\n },\n // Module Manifest Provider\n {\n provide: AXP_MODULE_MANIFEST_PROVIDER,\n useValue: IdentifierManagementManifest,\n multi: true,\n },\n // Provider references (now using tokens)\n {\n provide: AXP_PERMISSION_DEFINITION_PROVIDER,\n useClass: AXMPermissionDefinitionProvider,\n multi: true,\n },\n {\n provide: AXP_MENU_PROVIDER,\n useClass: AXMMenuProvider,\n multi: true,\n },\n {\n provide: AXP_ENTITY_DEFINITION_LOADER,\n useClass: AXMEntityProvider,\n multi: true,\n },\n {\n provide: AXP_SETTING_DEFINITION_PROVIDER,\n useClass: AXMSettingProvider,\n multi: true,\n },\n ]\n})\nexport class AXMIdentifierManagementModule { }\n","import { AXPSearchCommandProvider, AXPSearchResult } from '@acorex-platform/framework-client/common';\n\nexport class AXMSearchCommandProvider extends AXPSearchCommandProvider {\n commands: AXPSearchResult[] = [\n // {\n // group: 'command',\n // title: 'New Form Template',\n // icon: RootConfig.entities.template.icon,\n // description: 'Create a new form template for designing reusable forms.', // Added description\n // commands: {\n // 'create-entity': {\n // entity: `${RootConfig.module.name}.${RootConfig.entities.template.name}`,\n // },\n // },\n // }\n ];\n}\n","import { AXPEntityStorageService } from '@acorex-platform/framework-client/layout/entity';\r\r\nimport {\r\r\n IDENTIFIER_RULE_ENTITY,\r\r\n type AXPIdentifierRule,\r\r\n} from '@acorex-platform/module-identifier-management-client/contracts';\r\r\nimport { inject, Injectable } from '@angular/core';\r\r\nimport { get } from 'lodash';\r\r\n\r\r\n//#region ---- Identifier rule repository ----\r\r\n\r\r\n/**\r\r\n * Loads identifier rules from {@link IDENTIFIER_RULE_ENTITY} entity storage (mock or API).\r\r\n */\r\r\n@Injectable({ providedIn: 'root' })\r\r\nexport class AXPIdentifierRuleRepository {\r\r\n private readonly storage = inject(AXPEntityStorageService);\r\r\n\r\r\n async findById(id: string): Promise<AXPIdentifierRule | undefined> {\r\r\n const rules = await this.listAll();\r\r\n return rules.find((rule) => rule.name === id && !rule.isDisabled);\r\r\n }\r\r\n\r\r\n async listEnabled(): Promise<AXPIdentifierRule[]> {\r\r\n const rules = await this.listAll();\r\r\n return rules.filter((rule) => !rule.isDisabled);\r\r\n }\r\r\n\r\r\n private async listAll(): Promise<AXPIdentifierRule[]> {\r\r\n try {\r\r\n const response = await this.storage.query(IDENTIFIER_RULE_ENTITY, { skip: 0, take: 1000 });\r\r\n const items = response.items ?? [];\r\r\n return items\r\r\n .map((item) => this.mapEntityToRule(item))\r\r\n .filter((rule): rule is AXPIdentifierRule => rule != null);\r\r\n } catch {\r\r\n return [];\r\r\n }\r\r\n }\r\r\n\r\r\n private mapEntityToRule(record: unknown): AXPIdentifierRule | null {\r\r\n if (!record || typeof record !== 'object') {\r\r\n return null;\r\r\n }\r\r\n const nameRaw = get(record, 'name') ?? get(record, 'id');\r\r\n const pattern = get(record, 'pattern');\r\r\n if (typeof nameRaw !== 'string' || typeof pattern !== 'string') {\r\r\n return null;\r\r\n }\r\r\n const scopeConfig = get(record, 'scopeConfig');\r\r\n const enabledLegacy = get(record, 'enabled');\r\r\n const isDisabledRaw = get(record, 'isDisabled');\r\r\n const isDisabled =\r\r\n typeof isDisabledRaw === 'boolean'\r\r\n ? isDisabledRaw\r\r\n : enabledLegacy === false;\r\r\n\r\r\n return {\r\r\n name: nameRaw,\r\r\n title: String(get(record, 'title') ?? nameRaw),\r\r\n entity: String(get(record, 'entity') ?? ''),\r\r\n pattern,\r\r\n isDisabled,\r\r\n scopeConfig:\r\r\n scopeConfig && typeof scopeConfig === 'object'\r\r\n ? (scopeConfig as AXPIdentifierRule['scopeConfig'])\r\r\n : {},\r\r\n };\r\r\n }\r\r\n}\r\r\n\r\r\n//#endregion\r\r\n","//#region ---- Token Contracts ----\n\nimport { AXPIdentifierRequest } from './identifier.types';\nimport { InjectionToken } from '@angular/core';\n\nexport interface AXPPatternToken {\n name: string;\n args: string[];\n raw: string;\n index: number;\n}\n\nexport interface AXPEvalServices {\n sequence: AXPSequenceProvider;\n checksum: AXPChecksumProvider;\n lookup?: AXPLookupProvider;\n policy?: AXPPolicyProvider;\n clock?: AXPClockProvider;\n}\n\nexport interface AXPEvalContext {\n pattern: string;\n request: AXPIdentifierRequest;\n cache: Map<string, unknown>;\n now: Date;\n services: AXPEvalServices;\n evaluationMode: 'preview' | 'commit';\n}\n\nexport interface AXPTokenHandler {\n readonly name: string;\n readonly priority?: number;\n validate?(token: AXPPatternToken): void | never;\n eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string>;\n meta?: {\n title?: string;\n description?: string;\n category?: string;\n examples?: string[];\n argHints?: string[];\n version?: string;\n };\n}\n\nexport interface AXPTokenRegistry {\n register(handler: AXPTokenHandler): void;\n unregister(name: string): void;\n get(name: string): AXPTokenHandler | undefined;\n list(): AXPTokenHandler[];\n}\n\n//#endregion\n\n//#region ---- Sequence & Utilities ----\n\nexport interface AXPSequenceProvider {\n next(scopeHash: string, ruleId: string, options?: { pad?: number; consume?: boolean }): Promise<number>;\n}\n\nexport interface AXPChecksumProvider {\n compute(algo: 'luhn' | 'mod11', input: string): string;\n}\n\nexport interface AXPLookupProvider {\n get(key: string, params?: Record<string, unknown>): Promise<string | undefined>;\n}\n\nexport interface AXPPolicyProvider {\n isAllowed(tokenName: string, request: AXPIdentifierRequest): boolean;\n}\n\nexport interface AXPClockProvider {\n now(): Date;\n}\n\n//#endregion\n\n//#region ---- DI Tokens ----\n\nexport const AXP_TOKEN_HANDLERS = new InjectionToken<AXPTokenHandler[]>(\n 'AXP_TOKEN_HANDLERS'\n);\n\n//#endregion\n\n\n","//#region ---- Imports ----\n\nimport { Injectable, inject } from '@angular/core';\nimport { AXPTokenHandler, AXPTokenRegistry, AXP_TOKEN_HANDLERS } from './tokens.types';\n\n//#endregion\n\n@Injectable({ providedIn: 'root' })\nexport class AXPTokenRegistryService implements AXPTokenRegistry {\n //#region ---- Fields ----\n\n private readonly handlers = new Map<string, AXPTokenHandler>();\n private readonly providerHandlers = inject(AXP_TOKEN_HANDLERS, { optional: true }) ?? [];\n\n //#endregion\n\n //#region ---- Public API ----\n\n register(handler: AXPTokenHandler): void {\n const existing = this.handlers.get(handler.name);\n if (!existing || (handler.priority ?? 0) > (existing.priority ?? 0)) {\n this.handlers.set(handler.name, handler);\n }\n }\n\n unregister(name: string): void {\n this.handlers.delete(name);\n }\n\n get(name: string): AXPTokenHandler | undefined {\n // provider-provided take precedence by priority\n const fromProviders = this.providerHandlers\n .filter((h) => h.name === name)\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0))[0];\n if (fromProviders) return fromProviders;\n return this.handlers.get(name);\n }\n\n list(): AXPTokenHandler[] {\n const map = new Map<string, AXPTokenHandler>();\n const put = (h: AXPTokenHandler) => {\n const prev = map.get(h.name);\n if (!prev || (h.priority ?? 0) > (prev.priority ?? 0)) map.set(h.name, h);\n };\n this.providerHandlers.forEach(put);\n Array.from(this.handlers.values()).forEach(put);\n return Array.from(map.values()).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }\n\n //#endregion\n}\n\n\n","//#region ---- Imports ----\n\nimport { AXPEvalContext, AXPPatternToken } from './tokens.types';\nimport { inject } from '@angular/core';\nimport { AXPTokenRegistryService } from './token-registry.service';\n\n//#endregion\n\n//#region ---- Engine Contracts ----\n\nexport type AXPCompiledFragment = AXPPatternToken | { type: 'literal'; text: string };\n\nexport interface AXPCompiledPattern {\n pattern: string;\n tokens: AXPCompiledFragment[];\n}\n\nexport interface AXPPatternEngine {\n compile(pattern: string): AXPCompiledPattern;\n evaluate(compiled: AXPCompiledPattern, ctx: AXPEvalContext): Promise<string>;\n}\n\n//#endregion\n\n//#region ---- Simple Pattern Engine Impl ----\n\nconst TOKEN_REGEX = /\\{([^{}]+)\\}/g; // matches {token[:args]}\n\nexport class AXPSimplePatternEngine implements AXPPatternEngine {\n private readonly registry = inject(AXPTokenRegistryService);\n\n compile(pattern: string): AXPCompiledPattern {\n const tokens: AXPCompiledFragment[] = [];\n let match: RegExpExecArray | null;\n let index = 0;\n let lastIndex = 0;\n while ((match = TOKEN_REGEX.exec(pattern)) !== null) {\n // push any literal text before this token\n const literal = pattern.slice(lastIndex, match.index);\n if (literal) {\n tokens.push({ type: 'literal', text: literal });\n }\n const raw = match[0];\n const inner = match[1];\n const [name, ...args] = inner.split(':');\n const token: AXPPatternToken = {\n name: name.trim(),\n args: args.length ? inner.substring(inner.indexOf(':') + 1).split(':') : [],\n raw,\n index: index++,\n };\n const handler = this.registry.get(token.name);\n if (!handler) {\n throw new Error(`Unknown token: ${token.name}`);\n }\n handler.validate?.(token);\n tokens.push(token);\n lastIndex = match.index + raw.length;\n }\n // trailing literal\n const tail = pattern.slice(lastIndex);\n if (tail) {\n tokens.push({ type: 'literal', text: tail });\n }\n return { pattern, tokens };\n }\n\n async evaluate(compiled: AXPCompiledPattern, ctx: AXPEvalContext): Promise<string> {\n let built = '';\n for (const frag of compiled.tokens) {\n if ((frag as any).type === 'literal') {\n built += (frag as any).text as string;\n continue;\n }\n const token = frag as AXPPatternToken;\n ctx.cache.set('__acc__', built);\n const handler = this.registry.get(token.name);\n if (!handler) {\n throw new Error(`Unknown token at eval: ${token.name}`);\n }\n const fragment = await handler.eval(token, ctx);\n built += fragment;\n }\n return built;\n }\n}\n\n//#endregion\n\n\n","//#region ---- Imports ----\n\nimport {AXPDataGenerator} from '@acorex-platform/framework-client/core';\n\n//#endregion\n\n//#region ---- Utility Functions ----\n\nexport function buildScopeHash(parts: Array<string | undefined>): string {\n return parts.filter(Boolean).join('|');\n}\n\nexport function padNumber(num: number, size: number): string {\n const s = String(num);\n if (s.length >= size) return s;\n return '0'.repeat(size - s.length) + s;\n}\n\nexport function uuid(): string {\n return AXPDataGenerator.uuid();\n}\n\n//#endregion\n\n","//#region ---- Imports ----\n\nimport { AXPEvalContext, AXPPatternToken, AXPTokenHandler } from './tokens.types';\nimport { padNumber } from './utils';\nimport { Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ---- Built-in Token Handlers (Injectable) ----\n\n@Injectable()\nexport class DateToken implements AXPTokenHandler {\n readonly name = 'date';\n readonly meta = { title: 'Date', description: 'Formats current date', argHints: ['YYYY', 'YYYYMM', 'YYYYMMDD'] };\n async eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string> {\n const fmt = token.args[0] ?? 'YYYYMMDD';\n const d = ctx.services.clock?.now() ?? ctx.now;\n const y = String(d.getFullYear());\n const m = padNumber(d.getMonth() + 1, 2);\n const day = padNumber(d.getDate(), 2);\n switch (fmt) {\n case 'YYYY':\n return y;\n case 'YYYYMM':\n return y + m;\n case 'YYYYMMDD':\n default:\n return y + m + day;\n }\n }\n}\n\n@Injectable()\nexport class ConstToken implements AXPTokenHandler {\n readonly name = 'const';\n readonly meta = { title: 'Constant', description: 'Fixed literal value' };\n async eval(token: AXPPatternToken): Promise<string> {\n return token.args.join(':');\n }\n}\n\n@Injectable()\nexport class FieldToken implements AXPTokenHandler {\n readonly name = 'field';\n readonly meta = { title: 'Field', description: 'Reads a value from request.payload' };\n async eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string> {\n const key = token.args[0];\n if (!key) return '';\n const value = ctx.request.payload?.[key];\n return value == null ? '' : String(value);\n }\n}\n\n@Injectable()\nexport class TenantToken implements AXPTokenHandler {\n readonly name = 'tenant';\n readonly meta = { title: 'Tenant', description: 'Tenant scope identifier' };\n async eval(_t: AXPPatternToken, ctx: AXPEvalContext): Promise<string> {\n return ctx.request.tenantId ?? '';\n }\n}\n\n@Injectable()\nexport class AppToken implements AXPTokenHandler {\n readonly name = 'app';\n readonly meta = { title: 'App', description: 'Application scope identifier' };\n async eval(_t: AXPPatternToken, ctx: AXPEvalContext): Promise<string> {\n return ctx.request.appId ?? '';\n }\n}\n\n@Injectable()\nexport class SeqToken implements AXPTokenHandler {\n readonly name = 'seq';\n readonly meta = { title: 'Sequence', description: 'Auto-increment sequence', argHints: ['pad'] };\n async eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string> {\n const pad = Number(token.args[0] ?? '0') || 0;\n const consume = ctx.evaluationMode === 'commit';\n const ruleId = ctx.cache.get('ruleId') as string;\n const n = await ctx.services.sequence.next(ctx.cache.get('scopeHash') as string, ruleId, { pad, consume });\n return pad ? padNumber(n, pad) : String(n);\n }\n}\n\n@Injectable()\nexport class CheckToken implements AXPTokenHandler {\n readonly name = 'check';\n readonly meta = { title: 'Checksum', description: 'Checksum of the string built so far', argHints: ['luhn|mod11'] };\n async eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string> {\n const algo = (token.args[0] as 'luhn' | 'mod11') ?? 'luhn';\n const acc = String(ctx.cache.get('__acc__') ?? '');\n return ctx.services.checksum.compute(algo, acc);\n }\n}\n\n//#endregion\n","import { Provider } from '@angular/core';\nimport { AXP_TOKEN_HANDLERS } from './tokens.types';\nimport { AppToken, CheckToken, ConstToken, DateToken, FieldToken, SeqToken, TenantToken } from './tokens-default';\n\nexport const AXP_DEFAULT_TOKEN_PROVIDERS: Provider[] = [\n { provide: AXP_TOKEN_HANDLERS, useClass: DateToken, multi: true },\n { provide: AXP_TOKEN_HANDLERS, useClass: ConstToken, multi: true },\n { provide: AXP_TOKEN_HANDLERS, useClass: FieldToken, multi: true },\n { provide: AXP_TOKEN_HANDLERS, useClass: TenantToken, multi: true },\n { provide: AXP_TOKEN_HANDLERS, useClass: AppToken, multi: true },\n { provide: AXP_TOKEN_HANDLERS, useClass: SeqToken, multi: true },\n { provide: AXP_TOKEN_HANDLERS, useClass: CheckToken, multi: true },\n];\n\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],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E,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE;IAClE,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE;IACnE,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE;IAChE,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE;IAChE,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE;;;ACXtE;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@acorex-platform/module-identifier-management-client",
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"peerDependencies": {
|
|
6
|
+
"@angular/common": "^21.0.0",
|
|
7
|
+
"@angular/core": "^21.0.0"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"module": "fesm2022/acorex-platform-module-identifier-management-client.mjs",
|
|
13
|
+
"typings": "types/acorex-platform-module-identifier-management-client.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/acorex-platform-module-identifier-management-client.d.ts",
|
|
20
|
+
"default": "./fesm2022/acorex-platform-module-identifier-management-client.mjs"
|
|
21
|
+
},
|
|
22
|
+
"./contracts": {
|
|
23
|
+
"types": "./types/acorex-platform-module-identifier-management-client-contracts.d.ts",
|
|
24
|
+
"default": "./fesm2022/acorex-platform-module-identifier-management-client-contracts.mjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"type": "module"
|
|
28
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AXPIdentifierRule } from '@acorex-platform/framework-shared/core';
|
|
2
|
+
export { AXPIdentifierRule, IDENTIFIER_RULE_ENTITY } from '@acorex-platform/framework-shared/core';
|
|
3
|
+
import { AXPEntity } from '@acorex-platform/framework-shared/entity';
|
|
4
|
+
|
|
5
|
+
declare const AXMPermissionsKeys: {
|
|
6
|
+
IdentifierManagement: {
|
|
7
|
+
Management: string;
|
|
8
|
+
IdentifierRules: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
declare const AXPIdentifierManagementMenuKeys: {
|
|
13
|
+
readonly Root: "IdentifierManagement:Menu";
|
|
14
|
+
readonly IdentifierRules: "IdentifierManagement:Menu:IdentifierRules";
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare const RootConfig: {
|
|
18
|
+
readonly config: {
|
|
19
|
+
readonly i18n: "identifier-management";
|
|
20
|
+
readonly module: "IdentifierManagement";
|
|
21
|
+
};
|
|
22
|
+
readonly module: {
|
|
23
|
+
readonly module: "identifier-management";
|
|
24
|
+
readonly name: "IdentifierManagement";
|
|
25
|
+
readonly title: "@identifier-management:module.title";
|
|
26
|
+
readonly icon: "fa-light fa-hashtag";
|
|
27
|
+
};
|
|
28
|
+
readonly entities: {
|
|
29
|
+
readonly identifierRule: {
|
|
30
|
+
readonly name: "IdentifierRule";
|
|
31
|
+
readonly source: "IdentifierManagement.IdentifierRule";
|
|
32
|
+
readonly title: "@identifier-management:entities.identifier-rule.title";
|
|
33
|
+
readonly titlePlural: "@identifier-management:entities.identifier-rule.plural";
|
|
34
|
+
readonly icon: "fa-light fa-barcode";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
interface AXMIdentifierManagementIdentifierRuleEntityModel extends AXPIdentifierRule {
|
|
40
|
+
id: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare function identifierRuleFactory(): Promise<AXPEntity | null>;
|
|
44
|
+
|
|
45
|
+
export { AXMPermissionsKeys, AXPIdentifierManagementMenuKeys, RootConfig, identifierRuleFactory };
|
|
46
|
+
export type { AXMIdentifierManagementIdentifierRuleEntityModel };
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
3
|
+
import { AXPEntity } from '@acorex-platform/framework-shared/entity';
|
|
4
|
+
import { AXPEntityDefinitionLoader, AXPEntityDefinitionPreloader, AXPEntityPreloadEntity } from '@acorex-platform/framework-client/layout/entity';
|
|
5
|
+
import { AXPMenuProvider, AXPMenuProviderContext, AXPSearchCommandProvider, AXPSearchResult, AXPSettingDefinitionProvider, AXPSettingDefinitionProviderContext } from '@acorex-platform/framework-client/common';
|
|
6
|
+
import { AXPIdentifierRule } from '@acorex-platform/module-identifier-management-client/contracts';
|
|
7
|
+
export { AXPIdentifierRule } from '@acorex-platform/module-identifier-management-client/contracts';
|
|
8
|
+
|
|
9
|
+
declare class AXMIdentifierManagementModule {
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMIdentifierManagementModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXMIdentifierManagementModule, never, never, never>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXMIdentifierManagementModule>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare class AXMEntityProvider implements AXPEntityDefinitionLoader, AXPEntityDefinitionPreloader {
|
|
16
|
+
preload(): AXPEntityPreloadEntity[];
|
|
17
|
+
get(moduleName: string, entityName: string): Promise<AXPEntity | null>;
|
|
18
|
+
list(): Promise<{
|
|
19
|
+
name: string;
|
|
20
|
+
module: string;
|
|
21
|
+
}[]>;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMEntityProvider, never>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMEntityProvider>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare class AXMMenuProvider implements AXPMenuProvider {
|
|
27
|
+
private entityService;
|
|
28
|
+
provide(context: AXPMenuProviderContext): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare class AXMSearchCommandProvider extends AXPSearchCommandProvider {
|
|
32
|
+
commands: AXPSearchResult[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class AXMSettingProvider implements AXPSettingDefinitionProvider {
|
|
36
|
+
provide(context: AXPSettingDefinitionProviderContext): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface AXPIdentifierRequest {
|
|
40
|
+
/** Identifier id, e.g. 'employee-code' */
|
|
41
|
+
id: string;
|
|
42
|
+
/** Optional tenant partition */
|
|
43
|
+
tenantId?: string;
|
|
44
|
+
/** Optional application partition */
|
|
45
|
+
appId?: string;
|
|
46
|
+
/** Arbitrary payload for tokens to read from */
|
|
47
|
+
payload?: Record<string, unknown>;
|
|
48
|
+
}
|
|
49
|
+
interface AXPIdentifierResult {
|
|
50
|
+
code: string;
|
|
51
|
+
ruleId: string;
|
|
52
|
+
scopeHash: string;
|
|
53
|
+
consumed: boolean;
|
|
54
|
+
meta?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
interface AXPIdentifierPeekResult extends AXPIdentifierResult {
|
|
57
|
+
consumed: false;
|
|
58
|
+
commitToken: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare abstract class AXPIdentifierService {
|
|
62
|
+
abstract generate(req: AXPIdentifierRequest): Promise<AXPIdentifierResult>;
|
|
63
|
+
abstract peek(req: AXPIdentifierRequest): Promise<AXPIdentifierPeekResult>;
|
|
64
|
+
abstract validate(code: string, entity: string, tenantId?: string): Promise<boolean>;
|
|
65
|
+
abstract commitWithToken(token: string): Promise<AXPIdentifierResult>;
|
|
66
|
+
/** Optional helper for manual codes; stricter and may reject if not next sequence */
|
|
67
|
+
abstract commitByCode(req: AXPIdentifierRequest, code: string): Promise<AXPIdentifierResult>;
|
|
68
|
+
}
|
|
69
|
+
declare const AXP_IDENTIFIER_SERVICE: InjectionToken<AXPIdentifierService>;
|
|
70
|
+
/** @deprecated Rules are loaded from {@link IDENTIFIER_RULE_ENTITY} entity storage. */
|
|
71
|
+
declare const AXP_IDENTIFIER_RULES: InjectionToken<AXPIdentifierRule[]>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
|
|
75
|
+
* Loads identifier rules from {@link IDENTIFIER_RULE_ENTITY} entity storage (mock or API).
|
|
76
|
+
|
|
77
|
+
*/
|
|
78
|
+
declare class AXPIdentifierRuleRepository {
|
|
79
|
+
private readonly storage;
|
|
80
|
+
findById(id: string): Promise<AXPIdentifierRule | undefined>;
|
|
81
|
+
listEnabled(): Promise<AXPIdentifierRule[]>;
|
|
82
|
+
private listAll;
|
|
83
|
+
private mapEntityToRule;
|
|
84
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPIdentifierRuleRepository, never>;
|
|
85
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPIdentifierRuleRepository>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface AXPPatternToken {
|
|
89
|
+
name: string;
|
|
90
|
+
args: string[];
|
|
91
|
+
raw: string;
|
|
92
|
+
index: number;
|
|
93
|
+
}
|
|
94
|
+
interface AXPEvalServices {
|
|
95
|
+
sequence: AXPSequenceProvider;
|
|
96
|
+
checksum: AXPChecksumProvider;
|
|
97
|
+
lookup?: AXPLookupProvider;
|
|
98
|
+
policy?: AXPPolicyProvider;
|
|
99
|
+
clock?: AXPClockProvider;
|
|
100
|
+
}
|
|
101
|
+
interface AXPEvalContext {
|
|
102
|
+
pattern: string;
|
|
103
|
+
request: AXPIdentifierRequest;
|
|
104
|
+
cache: Map<string, unknown>;
|
|
105
|
+
now: Date;
|
|
106
|
+
services: AXPEvalServices;
|
|
107
|
+
evaluationMode: 'preview' | 'commit';
|
|
108
|
+
}
|
|
109
|
+
interface AXPTokenHandler {
|
|
110
|
+
readonly name: string;
|
|
111
|
+
readonly priority?: number;
|
|
112
|
+
validate?(token: AXPPatternToken): void | never;
|
|
113
|
+
eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string>;
|
|
114
|
+
meta?: {
|
|
115
|
+
title?: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
category?: string;
|
|
118
|
+
examples?: string[];
|
|
119
|
+
argHints?: string[];
|
|
120
|
+
version?: string;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
interface AXPTokenRegistry {
|
|
124
|
+
register(handler: AXPTokenHandler): void;
|
|
125
|
+
unregister(name: string): void;
|
|
126
|
+
get(name: string): AXPTokenHandler | undefined;
|
|
127
|
+
list(): AXPTokenHandler[];
|
|
128
|
+
}
|
|
129
|
+
interface AXPSequenceProvider {
|
|
130
|
+
next(scopeHash: string, ruleId: string, options?: {
|
|
131
|
+
pad?: number;
|
|
132
|
+
consume?: boolean;
|
|
133
|
+
}): Promise<number>;
|
|
134
|
+
}
|
|
135
|
+
interface AXPChecksumProvider {
|
|
136
|
+
compute(algo: 'luhn' | 'mod11', input: string): string;
|
|
137
|
+
}
|
|
138
|
+
interface AXPLookupProvider {
|
|
139
|
+
get(key: string, params?: Record<string, unknown>): Promise<string | undefined>;
|
|
140
|
+
}
|
|
141
|
+
interface AXPPolicyProvider {
|
|
142
|
+
isAllowed(tokenName: string, request: AXPIdentifierRequest): boolean;
|
|
143
|
+
}
|
|
144
|
+
interface AXPClockProvider {
|
|
145
|
+
now(): Date;
|
|
146
|
+
}
|
|
147
|
+
declare const AXP_TOKEN_HANDLERS: InjectionToken<AXPTokenHandler[]>;
|
|
148
|
+
|
|
149
|
+
type AXPCompiledFragment = AXPPatternToken | {
|
|
150
|
+
type: 'literal';
|
|
151
|
+
text: string;
|
|
152
|
+
};
|
|
153
|
+
interface AXPCompiledPattern {
|
|
154
|
+
pattern: string;
|
|
155
|
+
tokens: AXPCompiledFragment[];
|
|
156
|
+
}
|
|
157
|
+
interface AXPPatternEngine {
|
|
158
|
+
compile(pattern: string): AXPCompiledPattern;
|
|
159
|
+
evaluate(compiled: AXPCompiledPattern, ctx: AXPEvalContext): Promise<string>;
|
|
160
|
+
}
|
|
161
|
+
declare class AXPSimplePatternEngine implements AXPPatternEngine {
|
|
162
|
+
private readonly registry;
|
|
163
|
+
compile(pattern: string): AXPCompiledPattern;
|
|
164
|
+
evaluate(compiled: AXPCompiledPattern, ctx: AXPEvalContext): Promise<string>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare class AXPTokenRegistryService implements AXPTokenRegistry {
|
|
168
|
+
private readonly handlers;
|
|
169
|
+
private readonly providerHandlers;
|
|
170
|
+
register(handler: AXPTokenHandler): void;
|
|
171
|
+
unregister(name: string): void;
|
|
172
|
+
get(name: string): AXPTokenHandler | undefined;
|
|
173
|
+
list(): AXPTokenHandler[];
|
|
174
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPTokenRegistryService, never>;
|
|
175
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPTokenRegistryService>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare class DateToken implements AXPTokenHandler {
|
|
179
|
+
readonly name = "date";
|
|
180
|
+
readonly meta: {
|
|
181
|
+
title: string;
|
|
182
|
+
description: string;
|
|
183
|
+
argHints: string[];
|
|
184
|
+
};
|
|
185
|
+
eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string>;
|
|
186
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DateToken, never>;
|
|
187
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DateToken>;
|
|
188
|
+
}
|
|
189
|
+
declare class ConstToken implements AXPTokenHandler {
|
|
190
|
+
readonly name = "const";
|
|
191
|
+
readonly meta: {
|
|
192
|
+
title: string;
|
|
193
|
+
description: string;
|
|
194
|
+
};
|
|
195
|
+
eval(token: AXPPatternToken): Promise<string>;
|
|
196
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConstToken, never>;
|
|
197
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ConstToken>;
|
|
198
|
+
}
|
|
199
|
+
declare class FieldToken implements AXPTokenHandler {
|
|
200
|
+
readonly name = "field";
|
|
201
|
+
readonly meta: {
|
|
202
|
+
title: string;
|
|
203
|
+
description: string;
|
|
204
|
+
};
|
|
205
|
+
eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string>;
|
|
206
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldToken, never>;
|
|
207
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FieldToken>;
|
|
208
|
+
}
|
|
209
|
+
declare class TenantToken implements AXPTokenHandler {
|
|
210
|
+
readonly name = "tenant";
|
|
211
|
+
readonly meta: {
|
|
212
|
+
title: string;
|
|
213
|
+
description: string;
|
|
214
|
+
};
|
|
215
|
+
eval(_t: AXPPatternToken, ctx: AXPEvalContext): Promise<string>;
|
|
216
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TenantToken, never>;
|
|
217
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TenantToken>;
|
|
218
|
+
}
|
|
219
|
+
declare class AppToken implements AXPTokenHandler {
|
|
220
|
+
readonly name = "app";
|
|
221
|
+
readonly meta: {
|
|
222
|
+
title: string;
|
|
223
|
+
description: string;
|
|
224
|
+
};
|
|
225
|
+
eval(_t: AXPPatternToken, ctx: AXPEvalContext): Promise<string>;
|
|
226
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppToken, never>;
|
|
227
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AppToken>;
|
|
228
|
+
}
|
|
229
|
+
declare class SeqToken implements AXPTokenHandler {
|
|
230
|
+
readonly name = "seq";
|
|
231
|
+
readonly meta: {
|
|
232
|
+
title: string;
|
|
233
|
+
description: string;
|
|
234
|
+
argHints: string[];
|
|
235
|
+
};
|
|
236
|
+
eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string>;
|
|
237
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SeqToken, never>;
|
|
238
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SeqToken>;
|
|
239
|
+
}
|
|
240
|
+
declare class CheckToken implements AXPTokenHandler {
|
|
241
|
+
readonly name = "check";
|
|
242
|
+
readonly meta: {
|
|
243
|
+
title: string;
|
|
244
|
+
description: string;
|
|
245
|
+
argHints: string[];
|
|
246
|
+
};
|
|
247
|
+
eval(token: AXPPatternToken, ctx: AXPEvalContext): Promise<string>;
|
|
248
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckToken, never>;
|
|
249
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CheckToken>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
declare const AXP_DEFAULT_TOKEN_PROVIDERS: Provider[];
|
|
253
|
+
|
|
254
|
+
declare function buildScopeHash(parts: Array<string | undefined>): string;
|
|
255
|
+
declare function padNumber(num: number, size: number): string;
|
|
256
|
+
declare function uuid(): string;
|
|
257
|
+
|
|
258
|
+
export { AXMEntityProvider, AXMIdentifierManagementModule, AXMMenuProvider, AXMSearchCommandProvider, AXMSettingProvider, AXPIdentifierRuleRepository, AXPIdentifierService, AXPSimplePatternEngine, AXPTokenRegistryService, AXP_DEFAULT_TOKEN_PROVIDERS, AXP_IDENTIFIER_RULES, AXP_IDENTIFIER_SERVICE, AXP_TOKEN_HANDLERS, AppToken, CheckToken, ConstToken, DateToken, FieldToken, SeqToken, TenantToken, buildScopeHash, padNumber, uuid };
|
|
259
|
+
export type { AXPChecksumProvider, AXPClockProvider, AXPCompiledFragment, AXPCompiledPattern, AXPEvalContext, AXPEvalServices, AXPIdentifierPeekResult, AXPIdentifierRequest, AXPIdentifierResult, AXPLookupProvider, AXPPatternEngine, AXPPatternToken, AXPPolicyProvider, AXPSequenceProvider, AXPTokenHandler, AXPTokenRegistry };
|