@things-factory/auth-ui 10.1.256 → 10.1.258
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/bootstrap.js +2 -2
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/access-decision-popup.d.ts +9 -8
- package/dist-client/components/access-decision-popup.js +46 -58
- package/dist-client/components/access-decision-popup.js.map +1 -1
- package/dist-client/components/access-request-popup.d.ts +13 -8
- package/dist-client/components/access-request-popup.js +78 -102
- package/dist-client/components/access-request-popup.js.map +1 -1
- package/dist-client/components/app-binding-detail.d.ts +7 -5
- package/dist-client/components/app-binding-detail.js +62 -82
- package/dist-client/components/app-binding-detail.js.map +1 -1
- package/dist-client/components/appliance-editor.d.ts +10 -9
- package/dist-client/components/appliance-editor.js +87 -138
- package/dist-client/components/appliance-editor.js.map +1 -1
- package/dist-client/components/application-editor.d.ts +7 -5
- package/dist-client/components/application-editor.js +58 -92
- package/dist-client/components/application-editor.js.map +1 -1
- package/dist-client/components/my-login-history.js +18 -40
- package/dist-client/components/my-login-history.js.map +1 -1
- package/dist-client/components/my-passkeys.d.ts +4 -3
- package/dist-client/components/my-passkeys.js +29 -51
- package/dist-client/components/my-passkeys.js.map +1 -1
- package/dist-client/components/my-roles.d.ts +3 -4
- package/dist-client/components/my-roles.js +36 -55
- package/dist-client/components/my-roles.js.map +1 -1
- package/dist-client/components/partner-role-editor.js +27 -50
- package/dist-client/components/partner-role-editor.js.map +1 -1
- package/dist-client/components/profile-component.d.ts +2 -2
- package/dist-client/components/profile-component.js +18 -26
- package/dist-client/components/profile-component.js.map +1 -1
- package/dist-client/components/role-template-picker.d.ts +3 -3
- package/dist-client/components/role-template-picker.js +28 -42
- package/dist-client/components/role-template-picker.js.map +1 -1
- package/dist-client/components/user-detail.d.ts +23 -22
- package/dist-client/components/user-detail.js +125 -179
- package/dist-client/components/user-detail.js.map +1 -1
- package/dist-client/components/user-invite.d.ts +8 -6
- package/dist-client/components/user-invite.js +106 -141
- package/dist-client/components/user-invite.js.map +1 -1
- package/dist-client/components/user-popups-standard.test.js +1 -1
- package/dist-client/components/user-popups-standard.test.js.map +1 -1
- package/dist-client/components/user-role-editor.js +72 -122
- package/dist-client/components/user-role-editor.js.map +1 -1
- package/dist-client/entity360/person-360.d.ts +8 -11
- package/dist-client/entity360/person-360.js +49 -68
- package/dist-client/entity360/person-360.js.map +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-page.js +13 -25
- package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
- package/dist-client/identity-confirmation/identity-confirmation.d.ts +13 -14
- package/dist-client/identity-confirmation/identity-confirmation.js +39 -45
- package/dist-client/identity-confirmation/identity-confirmation.js.map +1 -1
- package/dist-client/pages/audit/audit-page.d.ts +4 -4
- package/dist-client/pages/audit/audit-page.js +28 -39
- package/dist-client/pages/audit/audit-page.js.map +1 -1
- package/dist-client/pages/domain-link/domain-link-management.js +1 -1
- package/dist-client/pages/domain-link/domain-link-management.js.map +1 -1
- package/dist-client/pages/partner/partner-management.js +30 -68
- package/dist-client/pages/partner/partner-management.js.map +1 -1
- package/dist-client/pages/role/role-extra-removal.test.d.mts +1 -0
- package/dist-client/pages/role/role-extra-removal.test.mjs +73 -0
- package/dist-client/pages/role/role-extra-removal.test.mjs.map +1 -0
- package/dist-client/pages/role/role-list-page.js +20 -22
- package/dist-client/pages/role/role-list-page.js.map +1 -1
- package/dist-client/pages/role/role-privilege-page.d.ts +36 -8
- package/dist-client/pages/role/role-privilege-page.js +216 -158
- package/dist-client/pages/role/role-privilege-page.js.map +1 -1
- package/dist-client/pages/role/role-task-review.test.js +20 -16
- package/dist-client/pages/role/role-task-review.test.js.map +1 -1
- package/dist-client/pages/role/role-template-gap.test.js +8 -3
- package/dist-client/pages/role/role-template-gap.test.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/helps/auth/roles.en.md +13 -49
- package/helps/auth/roles.ko.md +13 -32
- package/package.json +11 -10
- package/tests/page-state.test.ts +2 -1
- package/tests/password-rule-shown.test.ts +2 -2
- package/tests/person-360-sections.test.ts +9 -5
- package/translations/en.json +5 -1
- package/translations/es.json +5 -1
- package/translations/ja.json +5 -1
- package/translations/ko.json +5 -1
- package/translations/ms.json +5 -1
- package/translations/zh.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role-task-review.test.js","sourceRoot":"","sources":["../../../client/pages/role/role-task-review.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACjC,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB;;;;;GAKG;AAEH,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,wBAAwB,CAAC,EAAE,OAAO,CAAC,CAAA;AACpF,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;AAEjF,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA;AAC9F,MAAM,KAAK,GAAG,OAAO,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAA;AACpE,MAAM,QAAQ,GAAG,OAAO,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,CAAA;AAC/E,MAAM,IAAI,GAAG,OAAO,CAAC,+BAA+B,EAAE,2BAA2B,CAAC,CAAA;AAClF,MAAM,OAAO,GAAG,OAAO,CAAC,gCAAgC,EAAE,
|
|
1
|
+
{"version":3,"file":"role-task-review.test.js","sourceRoot":"","sources":["../../../client/pages/role/role-task-review.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;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AkB,CAAC,CAAA;QACvC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,sFAAsF,CAAC,CAAA;QAC3G,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,wHAAwH,CAAC,CAAA;QAC7I,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,kEAAkE,CAAC,CAAA;QACxF,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,+EAA+E,CAAC,CAAA;QACpG,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,uGAAuG,CAAC,CAAA;IACnI,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;QAC9F,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,8DAA8D,CAAC,CAAA;IACtF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { readFileSync } from 'fs'\nimport path from 'path'\n\n/**\n * The role privilege page reads a role by task and against its base template (ADR-0139 decision 11; ADR-0075\n * decision 1, amended 2026-10-26). What is computed - all, some, none, wider, missing - is tested in auth-base (`tests/role-task.test.ts`,\n * `tests/role-template-gap-db.test.ts`); this holds what the screen does with it. The page needs a DOM, so the test\n * reads its source with comments stripped.\n */\n\nconst source = readFileSync(path.join(__dirname, 'role-privilege-page.ts'), 'utf-8')\nconst code = source.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').replace(/^\\s*\\/\\/.*$/gm, '')\n\nconst between = (from: string, to: string) => code.slice(code.indexOf(from), code.indexOf(to))\nconst tasks = between('private renderTasks(', 'private renderTask(')\nconst template = between('private renderTemplate(', 'private renderSentences(')\nconst pick = between('private async fetchTemplates(', 'private async addMissing(')\nconst setBase = between('private async setBaseTemplate(', 'private async removeExtra(')\nconst add = between('private async addMissing(', '\\n private cellCount(')\nconst editButton = between('private taskEditButton(', 'private async editTask(')\nconst edit = between('private async editTask(', 'private renderTask(')\n\ndescribe('the role by task and against a template', () => {\n it('★ asks the server for the coverage with the role - the screen keeps no copy of the tasks', () => {\n expect(code).toMatch(/taskCoverage\\s*\\{\\s*tasks\\s*\\{\\s*taskId/)\n expect(code).not.toMatch(/registerRoleTask|ROLE_TASKS/)\n })\n\n it('★ edits by task through the rule - what is added is what the role lacks, what is taken off spares other whole tasks', () => {\n expect(edit).toMatch(/pairsToRemove\\(task, this\\.coverage\\.tasks\\)/)\n expect(edit).toMatch(/pairsToAdd\\(task\\)/)\n expect(tasks).not.toMatch(/createRoleFromTemplate/)\n })\n\n it('★ shows the privileges before saving, and offers no task edit over unsaved changes or on an inherited role', () => {\n expect(edit).toMatch(/if \\(!roleId \\|\\| this\\.dirty \\|\\| !this\\.savable\\) return/)\n expect(edit.indexOf('OxPrompt.open(')).toBeLessThan(edit.indexOf('await this.onSave()'))\n /* A confirmation for a role the screen moved on from, or read again, changes nothing (ADR-0190). */\n expect(edit).toMatch(/if \\(!confirmed \\|\\| this\\.shownRoleId !== roleId \\|\\| this\\.coverage !== coverage \\|\\| this\\.dirty \\|\\| !this\\.savable\\) return/)\n expect(editButton).toMatch(/if \\(this\\.inherited \\|\\| task\\.status === 'broken'\\) return nothing/)\n /* Every change of the role's privileges waits while one is out (savable, ADR-0190). */\n expect(editButton).toMatch(/const disabled = this\\.dirty \\|\\| !this\\.savable/)\n })\n\n it('★ keeps the tasks the role holds nothing of folded, and what no task names apart', () => {\n expect(tasks).toMatch(/task\\.status === 'none'/)\n expect(tasks).toMatch(/this\\.showUnheldTasks\\s*\\?/)\n expect(tasks).toMatch(/this\\.coverage\\.unclassified/)\n })\n\n it('★ lays the role against its stored base, never a template found by the role\\'s name', () => {\n expect(code).toMatch(/templateId\\s+domain\\s*\\{/)\n expect(code).not.toMatch(/one\\.name === this\\.subject/)\n /* Read while the comparison is open, for the role shown and only when it has a base (ADR-0190). */\n expect(code).toMatch(/return this\\.view === 'template' && roleId && this\\.subject\\.templateId/)\n expect(code).toMatch(/templateGap \\{/)\n })\n\n it('★ saves the picked base at once through updateRole, touching no privilege, and not on an inherited role', () => {\n expect(template).toMatch(/@change=\\$\\{\\(event: Event\\) => this\\.setBaseTemplate\\(/)\n /* One change at a time (ADR-0190): the choice is locked while one is out, and shows the base saved. */\n expect(template).toMatch(/<select \\.value=\\$\\{live\\(baseId\\)\\} \\?disabled=\\$\\{this\\.inherited \\|\\| this\\.saving \\|\\| this\\.baseSave\\.pending\\}/)\n expect(setBase).toMatch(/if \\(!roleId \\|\\| this\\.inherited \\|\\| this\\.saving \\|\\| this\\.baseSave\\.pending\\) return/)\n expect(setBase).toMatch(/this\\.baseSave\\.run\\(\\{ id: roleId, patch: \\{ templateId: templateId \\|\\| null \\} \\}\\)/)\n expect(setBase).not.toMatch(/privileges/)\n })\n\n it('★ says so when the base is a template this installation does not declare', () => {\n expect(template).toMatch(/baseId && !template \\? html`<div note attention>\\$\\{i18next\\.t\\('text\\.base template not in this installation'\\)\\}/)\n })\n\n it('★ shows extra privileges with an explicit removal action', () => {\n expect(template).toMatch(/label\\.wider than the template/)\n expect(template).toMatch(/gap\\.extra\\b/)\n expect(template.slice(template.indexOf('label.wider than the template'))).toMatch(/this\\.removeExtra\\(\\)/)\n })\n\n it('★ adds what is missing onto this role by its name, after showing it, and not over unsaved changes', () => {\n expect(add).toMatch(/OxPrompt\\.open\\(/)\n expect(add).toMatch(/if \\(!gap\\?\\.missingCount \\|\\| !roleId \\|\\| this\\.dirty \\|\\| !this\\.savable\\) return/)\n expect(add).toMatch(/if \\(!confirmed \\|\\| this\\.shownRoleId !== roleId \\|\\| this\\.gap !== gap \\|\\| this\\.dirty \\|\\| !this\\.savable\\) return/)\n expect(code).toMatch(/createRoleFromTemplate\\(templateId: \\$templateId, name: \\$name\\)/)\n expect(add).toMatch(/this\\.templateTopUp\\.run\\(\\{ templateId: gap\\.templateId, name: roleName \\}\\)/)\n expect(template).toMatch(/\\?disabled=\\$\\{this\\.dirty \\|\\| !this\\.savable \\|\\| Boolean\\(template\\?\\.definitionErrors\\.length\\)\\}/)\n })\n\n it('names a task in the words of the module that declares it, the id when there are none', () => {\n expect(code).toMatch(/i18next\\.t\\(`task\\.\\$\\{id\\}\\.name`, \\{ defaultValue: id \\}\\)/)\n })\n})\n"]}
|
|
@@ -12,15 +12,20 @@ const cell = code.slice(code.indexOf('private templateGapCell('), code.indexOf('
|
|
|
12
12
|
const add = code.slice(code.indexOf('private async addFromTemplate('), code.indexOf('async createBlankRole('));
|
|
13
13
|
describe('the role list and its template gap', () => {
|
|
14
14
|
it('★ asks the server for the gap with the list', () => {
|
|
15
|
-
expect(code).toMatch(/templateGap\s*\{\s*templateId\s+templateName\s+missingCount\s+missing\s*\{\s*category\s+axes/);
|
|
15
|
+
expect(code).toMatch(/templateGap\s*\{\s*templateId\s+templateName\s+extraCount\s+missingCount\s+missing\s*\{\s*category\s+axes/);
|
|
16
16
|
});
|
|
17
|
-
it('★ draws nothing for an inherited role, a role with no template, or one
|
|
18
|
-
expect(cell).toMatch(/if \(!gap \|\| !gap\.missingCount \|\| this\.isInherited\(record\)\)\s*\{\s*return nothing/);
|
|
17
|
+
it('★ draws nothing for an inherited role, a role with no template, or one with no differences', () => {
|
|
18
|
+
expect(cell).toMatch(/if \(!gap \|\| \(!gap\.missingCount && !gap\.extraCount\) \|\| this\.isInherited\(record\)\)\s*\{\s*return nothing/);
|
|
19
19
|
});
|
|
20
20
|
it('★ offers a visible button, not a number to press', () => {
|
|
21
21
|
expect(cell).toMatch(/<md-text-button/);
|
|
22
22
|
expect(cell).toMatch(/this\.addFromTemplate\(record\)/);
|
|
23
23
|
});
|
|
24
|
+
it('shows extra counts and opens the template comparison for review', () => {
|
|
25
|
+
expect(cell).toMatch(/gap\.extraCount/);
|
|
26
|
+
expect(cell).toContain('?view=template');
|
|
27
|
+
expect(cell).toContain('button.review extra privileges');
|
|
28
|
+
});
|
|
24
29
|
it('★ shows what will be added before adding it, and adds through the template top-up', () => {
|
|
25
30
|
expect(add).toMatch(/OxPrompt\.open\(/);
|
|
26
31
|
expect(add).toMatch(/text\.add template privileges/);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role-template-gap.test.js","sourceRoot":"","sources":["../../../client/pages/role/role-template-gap.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACjC,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB;;;;;GAKG;AAEH,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAA;AAC/E,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;AAEjF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAA;AACjH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gCAAgC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAA;AAE9G,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAClD,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"role-template-gap.test.js","sourceRoot":"","sources":["../../../client/pages/role/role-template-gap.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACjC,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB;;;;;GAKG;AAEH,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAA;AAC/E,MAAM,IAAI,GAAG,M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E;QAC3F,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;QACvC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAA;QACpD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,yFAAyF,CAAC,CAAA;IAChH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { readFileSync } from 'fs'\nimport path from 'path'\n\n/**\n * The role list says what each role lacks against its template, and the administrator adds it\n * (ADR-0075 decision 1). The gap itself is computed and tested in auth-base\n * (`tests/role-template-gap-db.test.ts`); this holds what the screen does with it. The page needs a\n * DOM, so the test reads its source with comments stripped.\n */\n\nconst source = readFileSync(path.join(__dirname, 'role-list-page.ts'), 'utf-8')\nconst code = source.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').replace(/^\\s*\\/\\/.*$/gm, '')\n\nconst cell = code.slice(code.indexOf('private templateGapCell('), code.indexOf('private async addFromTemplate('))\nconst add = code.slice(code.indexOf('private async addFromTemplate('), code.indexOf('async createBlankRole('))\n\ndescribe('the role list and its template gap', () => {\n it('★ asks the server for the gap with the list', () => {\n expect(code).toMatch(/templateGap\\s*\\{\\s*templateId\\s+templateName\\s+extraCount\\s+missingCount\\s+missing\\s*\\{\\s*category\\s+axes/)\n })\n\n it('★ draws nothing for an inherited role, a role with no template, or one with no differences', () => {\n expect(cell).toMatch(/if \\(!gap \\|\\| \\(!gap\\.missingCount && !gap\\.extraCount\\) \\|\\| this\\.isInherited\\(record\\)\\)\\s*\\{\\s*return nothing/)\n })\n\n it('★ offers a visible button, not a number to press', () => {\n expect(cell).toMatch(/<md-text-button/)\n expect(cell).toMatch(/this\\.addFromTemplate\\(record\\)/)\n })\n\n it('shows extra counts and opens the template comparison for review', () => {\n expect(cell).toMatch(/gap\\.extraCount/)\n expect(cell).toContain('?view=template')\n expect(cell).toContain('button.review extra privileges')\n })\n\n it('★ shows what will be added before adding it, and adds through the template top-up', () => {\n expect(add).toMatch(/OxPrompt\\.open\\(/)\n expect(add).toMatch(/text\\.add template privileges/)\n expect(add).toMatch(/if \\(confirmed\\)\\s*\\{\\s*await this\\.createFromTemplate\\(gap\\.templateId, record\\.name\\)/)\n })\n})\n"]}
|