@things-factory/auth-base 10.1.254 → 10.1.256

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ import { EntityManager } from 'typeorm';
2
+ export interface WorkDoor {
3
+ /** The translation key that names the work - `work.<module>.<what>`. */
4
+ work: string;
5
+ /** The GraphQL mutation fields that do it. */
6
+ fields: readonly string[];
7
+ }
8
+ /** Declares a module's mutations that are a piece of work. A field is one work only. */
9
+ export declare function registerWorkDoors(doors: readonly WorkDoor[]): void;
10
+ /** The work a mutation field is declared as, if any. */
11
+ export declare const workOfField: (field: string) => string;
12
+ export interface WorkDone {
13
+ /** When the request was made. */
14
+ at: Date;
15
+ /** The work's translation key. */
16
+ work: string;
17
+ /** The request it was done in. */
18
+ requestId: string;
19
+ }
20
+ /** Each declared piece of work a person did in [from, to) - one per request and work, the requests that went through. */
21
+ export declare function workDoneBy(tx: EntityManager, domain: {
22
+ id: string;
23
+ }, actorId: string, from: Date, to: Date): Promise<WorkDone[]>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workOfField = void 0;
4
+ exports.registerWorkDoors = registerWorkDoors;
5
+ exports.workDoneBy = workDoneBy;
6
+ const typeorm_1 = require("typeorm");
7
+ const audit_action_js_1 = require("./audit-action.js");
8
+ const audit_request_js_1 = require("./audit-request.js");
9
+ const WORK = new Map();
10
+ /** Declares a module's mutations that are a piece of work. A field is one work only. */
11
+ function registerWorkDoors(doors) {
12
+ for (const door of doors)
13
+ for (const field of door.fields) {
14
+ const held = WORK.get(field);
15
+ if (held && held !== door.work)
16
+ throw new Error(`The mutation "${field}" is declared as the work "${held}" and "${door.work}".`);
17
+ WORK.set(field, door.work);
18
+ }
19
+ }
20
+ /** The work a mutation field is declared as, if any. */
21
+ const workOfField = (field) => WORK.get(field);
22
+ exports.workOfField = workOfField;
23
+ /** Each declared piece of work a person did in [from, to) - one per request and work, the requests that went through. */
24
+ async function workDoneBy(tx, domain, actorId, from, to) {
25
+ if (!WORK.size)
26
+ return [];
27
+ const requests = await tx.getRepository(audit_request_js_1.AuditRequest).find({
28
+ where: { domain: { id: domain.id }, actor: { id: actorId }, operationType: 'mutation', createdAt: (0, typeorm_1.Between)(from, new Date(to.getTime() - 1)) },
29
+ order: { createdAt: 'ASC' }
30
+ });
31
+ const declared = requests
32
+ .map(request => ({ request, works: [...new Set(String(request.fields ?? '').split(',').map(field => WORK.get(field.trim())).filter(Boolean))] }))
33
+ .filter(one => one.works.length);
34
+ if (!declared.length)
35
+ return [];
36
+ const results = await tx.getRepository(audit_action_js_1.AuditAction).find({ where: { requestId: (0, typeorm_1.In)(declared.map(one => one.request.id)), kind: 'door.result' } });
37
+ const went = new Set(results.filter(one => one.outcome === 'ok').map(one => one.requestId));
38
+ const failed = new Set(results.filter(one => one.outcome === 'error').map(one => one.requestId));
39
+ return declared
40
+ .filter(one => went.has(one.request.id) && !failed.has(one.request.id))
41
+ .flatMap(one => one.works.map(work => ({ at: one.request.createdAt, work, requestId: one.request.id })));
42
+ }
43
+ //# sourceMappingURL=audit-work.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-work.js","sourceRoot":"","sources":["../../../server/service/audit/audit-work.ts"],"names":[],"mappings":";;;AAwBA,8CAOC;AAeD,gCAgBC;AA9DD,qCAAoD;AAEpD,uDAA+C;AAC/C,yDAAiD;AAkBjD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkB,CAAA;AAEtC,wFAAwF;AACxF,SAAgB,iBAAiB,CAAC,KAA0B;IAC1D,KAAK,MAAM,IAAI,IAAI,KAAK;QACtB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAC5B,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI;gBAAE,MAAM,IAAI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OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;AAC5G,CAAC","sourcesContent":["import { Between, EntityManager, In } from 'typeorm'\n\nimport { AuditAction } from './audit-action.js'\nimport { AuditRequest } from './audit-request.js'\n\n/*\n * Work done through the system's doors (ADR-0185 decision 6, Q5) - read from the audit, never kept twice. A module\n * declares which of its mutations are a piece of work and under what name (\"the bank lines kept\", \"the payroll worked\n * on\"); a report of one's week reads, from the audit, how many times a person did each on each day. A mutation no\n * module declared - a save of one's own draft, a read - is not work here; nor is one that failed.\n *\n * The name is a translation key of the declaring module: the screen says it in the reader's words.\n */\n\nexport interface WorkDoor {\n /** The translation key that names the work - `work.<module>.<what>`. */\n work: string\n /** The GraphQL mutation fields that do it. */\n fields: readonly string[]\n}\n\nconst WORK = new Map<string, string>()\n\n/** Declares a module's mutations that are a piece of work. A field is one work only. */\nexport function registerWorkDoors(doors: readonly WorkDoor[]) {\n for (const door of doors)\n for (const field of door.fields) {\n const held = WORK.get(field)\n if (held && held !== door.work) throw new Error(`The mutation \"${field}\" is declared as the work \"${held}\" and \"${door.work}\".`)\n WORK.set(field, door.work)\n }\n}\n\n/** The work a mutation field is declared as, if any. */\nexport const workOfField = (field: string) => WORK.get(field)\n\nexport interface WorkDone {\n /** When the request was made. */\n at: Date\n /** The work's translation key. */\n work: string\n /** The request it was done in. */\n requestId: string\n}\n\n/** Each declared piece of work a person did in [from, to) - one per request and work, the requests that went through. */\nexport async function workDoneBy(tx: EntityManager, domain: { id: string }, actorId: string, from: Date, to: Date): Promise<WorkDone[]> {\n if (!WORK.size) return []\n const requests = await tx.getRepository(AuditRequest).find({\n where: { domain: { id: domain.id }, actor: { id: actorId }, operationType: 'mutation', createdAt: Between(from, new Date(to.getTime() - 1)) } as any,\n order: { createdAt: 'ASC' } as any\n })\n const declared = requests\n .map(request => ({ request, works: [...new Set(String(request.fields ?? '').split(',').map(field => WORK.get(field.trim())).filter(Boolean))] as string[] }))\n .filter(one => one.works.length)\n if (!declared.length) return []\n const results = await tx.getRepository(AuditAction).find({ where: { requestId: In(declared.map(one => one.request.id)), kind: 'door.result' } as any })\n const went = new Set(results.filter(one => one.outcome === 'ok').map(one => one.requestId))\n const failed = new Set(results.filter(one => one.outcome === 'error').map(one => one.requestId))\n return declared\n .filter(one => went.has(one.request.id) && !failed.has(one.request.id))\n .flatMap(one => one.works.map(work => ({ at: one.request.createdAt, work, requestId: one.request.id })))\n}\n"]}
@@ -22,6 +22,7 @@ export * from './audit/audit-action.js';
22
22
  export { registerAuditKind } from './audit/audit-kinds.js';
23
23
  export { recordAuditAction, noteAuditAction, flushAudit, type AuditActionInput } from './audit/audit-recorder.js';
24
24
  export { purgeExpiredAudit, startAuditRetention } from './audit/audit-retention.js';
25
+ export { registerWorkDoors, workOfField, workDoneBy, type WorkDoor, type WorkDone } from './audit/audit-work.js';
25
26
  export * from './web-auth-credential/web-auth-credential.js';
26
27
  export * from './domain-link/domain-link.js';
27
28
  export * from './domain-owner/domain-owner.js';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.schema = exports.subscribers = exports.entities = exports.startAuditRetention = exports.purgeExpiredAudit = exports.flushAudit = exports.noteAuditAction = exports.recordAuditAction = exports.registerAuditKind = exports.privilegeRejection = exports.privilegeOfField = exports.declarePrivileges = void 0;
3
+ exports.schema = exports.subscribers = exports.entities = exports.workDoneBy = exports.workOfField = exports.registerWorkDoors = exports.startAuditRetention = exports.purgeExpiredAudit = exports.flushAudit = exports.noteAuditAction = exports.recordAuditAction = exports.registerAuditKind = exports.privilegeRejection = exports.privilegeOfField = exports.declarePrivileges = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  /* IMPORT ENTITIES AND RESOLVERS */
6
6
  const index_js_1 = require("./access-request/index.js");
@@ -61,6 +61,10 @@ Object.defineProperty(exports, "flushAudit", { enumerable: true, get: function (
61
61
  var audit_retention_js_1 = require("./audit/audit-retention.js");
62
62
  Object.defineProperty(exports, "purgeExpiredAudit", { enumerable: true, get: function () { return audit_retention_js_1.purgeExpiredAudit; } });
63
63
  Object.defineProperty(exports, "startAuditRetention", { enumerable: true, get: function () { return audit_retention_js_1.startAuditRetention; } });
64
+ var audit_work_js_1 = require("./audit/audit-work.js");
65
+ Object.defineProperty(exports, "registerWorkDoors", { enumerable: true, get: function () { return audit_work_js_1.registerWorkDoors; } });
66
+ Object.defineProperty(exports, "workOfField", { enumerable: true, get: function () { return audit_work_js_1.workOfField; } });
67
+ Object.defineProperty(exports, "workDoneBy", { enumerable: true, get: function () { return audit_work_js_1.workDoneBy; } });
64
68
  tslib_1.__exportStar(require("./web-auth-credential/web-auth-credential.js"), exports);
65
69
  tslib_1.__exportStar(require("./domain-link/domain-link.js"), exports);
66
70
  tslib_1.__exportStar(require("./domain-owner/domain-owner.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,mCAAmC;AACnC,wDAAkH;AAClH,8DAGwC;AACxC,uDAA+G;AAC/G,qDAAwE;AACxE,mDAAqG;AACrG,qDAA2G;AAC3G,0DAAkF;AAClF,sDAA2G;AAC3G,+CAIyB;AACzB,6DAAsE;AACtE,+FAAsG;AACtG,kDAA+F;AAC/F,2DAAiF;AACjF,oDAAqG;AACrG,+EAA2G;AAC3G,qDAA6C;AAC7C,+CAAsF;AACtF,wDAA6E;AAC7E,+CAAsF;AACtF,6DAAqF;AACrF,8DAA+H;AAC/H,sDAAwG;AACxG,uDAA4G;AAE5G,yBAAyB;AACzB,yFAA8D;AAC9D,2EAAgD;AAChD,uEAA4C;AAC5C,mEAAwC;AACxC,mEAAwC;AACxC,yDAA8B;AAC9B,wEAA6C;AAC7C,gHAAgH;AAChH,6EAAwG;AAA/F,2HAAA,iBAAiB,OAAA;AAAE,0HAAA,gBAAgB,OAAA;AAC5C,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C;KACpC;IAED,6FAA6F;IAC7F,UAAU,EAAV,2BAAU;IAEV,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,oBAA2B;QAC9B,GAAG,oBAAqB;QACxB,GAAG,oBAAoB;QACvB,GAAG,oBAAkB;QACrB,GAAG,qBAAkB;QACrB,GAAG,qBAAa;QAChB,GAAG,qBAAqB;QACxB,GAAG,qBAAa;QAChB,GAAG,qBAAgB;QACnB,GAAG,oBAAmB;QACtB,GAAG,oBAAkB;QACrB,GAAG,oBAAuB;QAC1B,GAAG,oBAAc;QACjB,GAAG,qBAAkB;QACrB,GAAG,qBAAoB;QACvB,GAAG,oBAAsB;QACzB,GAAG,qBAA0B;KAC9B;IACD,UAAU,EAAE;QACV,SAAS,EAAE,mDAA0B;KACtC;CACF,CAAA","sourcesContent":["/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as AccessRequestEntities, resolvers as AccessRequestResolvers } from './access-request/index.js'\nimport {\n entities as UsersAuthProvidersEntities,\n resolvers as UsersAuthProvidersResolvers\n} from './users-auth-providers/index.js'\nimport { entities as AuthProviderEntities, resolvers as AuthProviderResolvers } from './auth-provider/index.js'\nimport { resolvers as AppbindingResolver } from './app-binding/index.js'\nimport { entities as ApplianceEntities, resolvers as ApplianceResolvers } from './appliance/index.js'\nimport { entities as ApplicationEntities, resolvers as ApplicationResolvers } from './application/index.js'\nimport { resolvers as DomainGeneratorResolver } from './domain-generator/index.js'\nimport { entities as GrantedRoleEntities, resolvers as GrantedRoleResolver } from './granted-role/index.js'\nimport {\n entities as AuditEntities,\n resolvers as AuditResolvers,\n subscribers as AuditSubscribers\n} from './audit/index.js'\nimport { auditTargetDirectiveTypeDefs } from './audit/audit-target.js'\nimport { recentConfirmationDirectiveTypeDefs } from './identity-confirmation/identity-confirmation.js'\nimport { entities as PartnerEntities, resolvers as PartnerResolvers } from './partner/index.js'\nimport { entities as PasswordHistoryEntities } from './password-history/index.js'\nimport { entities as PrivilegeEntities, resolvers as PrivilegeResolvers } from './privilege/index.js'\nimport { privilegeDirectiveResolver, privilegeDirectiveTypeDefs } from './privilege/privilege-directive.js'\nimport { openFields } from './open-fields.js'\nimport { entities as RoleEntities, resolvers as RoleResolvers } from './role/index.js'\nimport { resolvers as RoleTemplateResolvers } from './role-template/index.js'\nimport { entities as UserEntities, resolvers as UserResolvers } from './user/index.js'\nimport { entities as VerificationTokenEntities } from './verification-token/index.js'\nimport { entities as WebAuthCredentialEntities, resolvers as WebAuthCredentialResolvers } from './web-auth-credential/index.js'\nimport { entities as DomainLinkEntities, resolvers as DomainLinkResolver } from './domain-link/index.js'\nimport { entities as DomainOwnerEntities, resolvers as DomainOwnerResolvers } from './domain-owner/index.js'\n\n/* EXPORT ENTITY TYPES */\nexport * from './users-auth-providers/users-auth-providers.js'\nexport * from './auth-provider/auth-provider.js'\nexport * from './application/application.js'\nexport * from './appliance/appliance.js'\nexport * from './privilege/privilege.js'\nexport * from './role/role.js'\nexport * from './privilege/privilege-axis.js'\n/* What a field asks for, by name — for another entrance to the same door (operato-twin ADR-0072 decision 5). */\nexport { declarePrivileges, privilegeOfField, type FieldGate } from './privilege/privilege-directive.js'\n/* Other entrances report AUTH's refusal without copying its cause or localized wording. */\nexport { privilegeRejection } from './privilege/privilege-rejection.js'\n/* How a module declares the fields it leaves open — see `privilege/open-field-rule.ts`. */\nexport { type OpenFieldsDeclaration } from './privilege/open-field-rule.js'\nexport * from './role-template/role-template.js'\nexport * from './role-template/role-task.js'\nexport * from './role-template/role-template-types.js'\nexport * from './user/user.js'\nexport * from './partner/partner.js'\nexport * from './granted-role/granted-role.js'\nexport * from './app-binding/app-binding.js'\nexport * from './password-history/password-history.js'\nexport * from './verification-token/verification-token.js'\nexport * from './audit/audit-request.js'\nexport * from './audit/audit-action.js'\nexport { registerAuditKind } from './audit/audit-kinds.js'\nexport { recordAuditAction, noteAuditAction, flushAudit, type AuditActionInput } from './audit/audit-recorder.js'\nexport { purgeExpiredAudit, startAuditRetention } from './audit/audit-retention.js'\nexport * from './web-auth-credential/web-auth-credential.js'\nexport * from './domain-link/domain-link.js'\nexport * from './domain-owner/domain-owner.js'\nexport * from './access-request/access-request.js'\n\n/* EXPORT TYPES */\nexport * from './app-binding/app-binding-types.js'\nexport * from './appliance/appliance-types.js'\nexport * from './application/application-types.js'\nexport * from './domain-generator/domain-generator-types.js'\nexport * from './partner/partner-types.js'\nexport * from './privilege/privilege-types.js'\nexport * from './role/role-types.js'\nexport * from './user/user-types.js'\nexport * from './domain-link/domain-link-types.js'\nexport * from './access-request/access-request-types.js'\n\nexport const entities = [\n /* ENTITIES */\n ...UsersAuthProvidersEntities,\n ...AuthProviderEntities,\n ...ApplicationEntities,\n ...ApplianceEntities,\n ...PrivilegeEntities,\n ...RoleEntities,\n ...UserEntities,\n ...PartnerEntities,\n ...GrantedRoleEntities,\n ...PasswordHistoryEntities,\n ...VerificationTokenEntities,\n ...AuditEntities,\n ...WebAuthCredentialEntities,\n ...DomainLinkEntities,\n ...DomainOwnerEntities,\n ...AccessRequestEntities\n]\n\n/* The audit of who may do what, written where it is saved (ADR-0141 §3.3). */\nexport const subscribers = [...AuditSubscribers]\n\nexport const schema = {\n typeDefs: {\n privilegeDirectiveTypeDefs,\n auditTargetDirectiveTypeDefs,\n recentConfirmationDirectiveTypeDefs\n },\n\n /* The fields that carry no @privilege, and why — `open-fields.ts`, read by the directive. */\n openFields,\n\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...UsersAuthProvidersResolvers,\n ...AuthProviderResolvers,\n ...ApplicationResolvers,\n ...ApplianceResolvers,\n ...PrivilegeResolvers,\n ...RoleResolvers,\n ...RoleTemplateResolvers,\n ...UserResolvers,\n ...PartnerResolvers,\n ...GrantedRoleResolver,\n ...AppbindingResolver,\n ...DomainGeneratorResolver,\n ...AuditResolvers,\n ...DomainLinkResolver,\n ...DomainOwnerResolvers,\n ...AccessRequestResolvers,\n ...WebAuthCredentialResolvers\n ],\n directives: {\n privilege: privilegeDirectiveResolver\n }\n}\n"]}
1
+ {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MPORT ENTITIES AND RESOLVERS */\nimport { entities as AccessRequestEntities, resolvers as AccessRequestResolvers } from './access-request/index.js'\nimport {\n entities as UsersAuthProvidersEntities,\n resolvers as UsersAuthProvidersResolvers\n} from './users-auth-providers/index.js'\nimport { entities as AuthProviderEntities, resolvers as AuthProviderResolvers } from './auth-provider/index.js'\nimport { resolvers as AppbindingResolver } from './app-binding/index.js'\nimport { entities as ApplianceEntities, resolvers as ApplianceResolvers } from './appliance/index.js'\nimport { entities as ApplicationEntities, resolvers as ApplicationResolvers } from './application/index.js'\nimport { resolvers as DomainGeneratorResolver } from './domain-generator/index.js'\nimport { entities as GrantedRoleEntities, resolvers as GrantedRoleResolver } from './granted-role/index.js'\nimport {\n entities as AuditEntities,\n resolvers as AuditResolvers,\n subscribers as AuditSubscribers\n} from './audit/index.js'\nimport { auditTargetDirectiveTypeDefs } from './audit/audit-target.js'\nimport { recentConfirmationDirectiveTypeDefs } from './identity-confirmation/identity-confirmation.js'\nimport { entities as PartnerEntities, resolvers as PartnerResolvers } from './partner/index.js'\nimport { entities as PasswordHistoryEntities } from './password-history/index.js'\nimport { entities as PrivilegeEntities, resolvers as PrivilegeResolvers } from './privilege/index.js'\nimport { privilegeDirectiveResolver, privilegeDirectiveTypeDefs } from './privilege/privilege-directive.js'\nimport { openFields } from './open-fields.js'\nimport { entities as RoleEntities, resolvers as RoleResolvers } from './role/index.js'\nimport { resolvers as RoleTemplateResolvers } from './role-template/index.js'\nimport { entities as UserEntities, resolvers as UserResolvers } from './user/index.js'\nimport { entities as VerificationTokenEntities } from './verification-token/index.js'\nimport { entities as WebAuthCredentialEntities, resolvers as WebAuthCredentialResolvers } from './web-auth-credential/index.js'\nimport { entities as DomainLinkEntities, resolvers as DomainLinkResolver } from './domain-link/index.js'\nimport { entities as DomainOwnerEntities, resolvers as DomainOwnerResolvers } from './domain-owner/index.js'\n\n/* EXPORT ENTITY TYPES */\nexport * from './users-auth-providers/users-auth-providers.js'\nexport * from './auth-provider/auth-provider.js'\nexport * from './application/application.js'\nexport * from './appliance/appliance.js'\nexport * from './privilege/privilege.js'\nexport * from './role/role.js'\nexport * from './privilege/privilege-axis.js'\n/* What a field asks for, by name — for another entrance to the same door (operato-twin ADR-0072 decision 5). */\nexport { declarePrivileges, privilegeOfField, type FieldGate } from './privilege/privilege-directive.js'\n/* Other entrances report AUTH's refusal without copying its cause or localized wording. */\nexport { privilegeRejection } from './privilege/privilege-rejection.js'\n/* How a module declares the fields it leaves open — see `privilege/open-field-rule.ts`. */\nexport { type OpenFieldsDeclaration } from './privilege/open-field-rule.js'\nexport * from './role-template/role-template.js'\nexport * from './role-template/role-task.js'\nexport * from './role-template/role-template-types.js'\nexport * from './user/user.js'\nexport * from './partner/partner.js'\nexport * from './granted-role/granted-role.js'\nexport * from './app-binding/app-binding.js'\nexport * from './password-history/password-history.js'\nexport * from './verification-token/verification-token.js'\nexport * from './audit/audit-request.js'\nexport * from './audit/audit-action.js'\nexport { registerAuditKind } from './audit/audit-kinds.js'\nexport { recordAuditAction, noteAuditAction, flushAudit, type AuditActionInput } from './audit/audit-recorder.js'\nexport { purgeExpiredAudit, startAuditRetention } from './audit/audit-retention.js'\nexport { registerWorkDoors, workOfField, workDoneBy, type WorkDoor, type WorkDone } from './audit/audit-work.js'\nexport * from './web-auth-credential/web-auth-credential.js'\nexport * from './domain-link/domain-link.js'\nexport * from './domain-owner/domain-owner.js'\nexport * from './access-request/access-request.js'\n\n/* EXPORT TYPES */\nexport * from './app-binding/app-binding-types.js'\nexport * from './appliance/appliance-types.js'\nexport * from './application/application-types.js'\nexport * from './domain-generator/domain-generator-types.js'\nexport * from './partner/partner-types.js'\nexport * from './privilege/privilege-types.js'\nexport * from './role/role-types.js'\nexport * from './user/user-types.js'\nexport * from './domain-link/domain-link-types.js'\nexport * from './access-request/access-request-types.js'\n\nexport const entities = [\n /* ENTITIES */\n ...UsersAuthProvidersEntities,\n ...AuthProviderEntities,\n ...ApplicationEntities,\n ...ApplianceEntities,\n ...PrivilegeEntities,\n ...RoleEntities,\n ...UserEntities,\n ...PartnerEntities,\n ...GrantedRoleEntities,\n ...PasswordHistoryEntities,\n ...VerificationTokenEntities,\n ...AuditEntities,\n ...WebAuthCredentialEntities,\n ...DomainLinkEntities,\n ...DomainOwnerEntities,\n ...AccessRequestEntities\n]\n\n/* The audit of who may do what, written where it is saved (ADR-0141 §3.3). */\nexport const subscribers = [...AuditSubscribers]\n\nexport const schema = {\n typeDefs: {\n privilegeDirectiveTypeDefs,\n auditTargetDirectiveTypeDefs,\n recentConfirmationDirectiveTypeDefs\n },\n\n /* The fields that carry no @privilege, and why — `open-fields.ts`, read by the directive. */\n openFields,\n\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...UsersAuthProvidersResolvers,\n ...AuthProviderResolvers,\n ...ApplicationResolvers,\n ...ApplianceResolvers,\n ...PrivilegeResolvers,\n ...RoleResolvers,\n ...RoleTemplateResolvers,\n ...UserResolvers,\n ...PartnerResolvers,\n ...GrantedRoleResolver,\n ...AppbindingResolver,\n ...DomainGeneratorResolver,\n ...AuditResolvers,\n ...DomainLinkResolver,\n ...DomainOwnerResolvers,\n ...AccessRequestResolvers,\n ...WebAuthCredentialResolvers\n ],\n directives: {\n privilege: privilegeDirectiveResolver\n }\n}\n"]}