@futdevpro/fsm-dynamo 1.20.57 → 1.20.59

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.
Files changed (29) hide show
  1. package/build/_collections/utils/operation-authz.util.d.ts +44 -0
  2. package/build/_collections/utils/operation-authz.util.d.ts.map +1 -0
  3. package/build/_collections/utils/operation-authz.util.js +109 -0
  4. package/build/_collections/utils/operation-authz.util.js.map +1 -0
  5. package/build/_enums/operation-auth.type-enum.d.ts +19 -0
  6. package/build/_enums/operation-auth.type-enum.d.ts.map +1 -0
  7. package/build/_enums/operation-auth.type-enum.js +23 -0
  8. package/build/_enums/operation-auth.type-enum.js.map +1 -0
  9. package/build/_models/control-models/operation-context.control-model.d.ts +57 -0
  10. package/build/_models/control-models/operation-context.control-model.d.ts.map +1 -0
  11. package/build/_models/control-models/operation-context.control-model.js +115 -0
  12. package/build/_models/control-models/operation-context.control-model.js.map +1 -0
  13. package/build/_models/control-models/operation-settings.control-model.d.ts +3 -0
  14. package/build/_models/control-models/operation-settings.control-model.d.ts.map +1 -1
  15. package/build/_models/control-models/operation-settings.control-model.js +12 -0
  16. package/build/_models/control-models/operation-settings.control-model.js.map +1 -1
  17. package/build/_models/interfaces/operation-authz-result.interface.d.ts +23 -0
  18. package/build/_models/interfaces/operation-authz-result.interface.d.ts.map +1 -0
  19. package/build/_models/interfaces/operation-authz-result.interface.js +3 -0
  20. package/build/_models/interfaces/operation-authz-result.interface.js.map +1 -0
  21. package/build/_models/interfaces/operation-authz.interface.d.ts +28 -0
  22. package/build/_models/interfaces/operation-authz.interface.d.ts.map +1 -0
  23. package/build/_models/interfaces/operation-authz.interface.js +3 -0
  24. package/build/_models/interfaces/operation-authz.interface.js.map +1 -0
  25. package/build/index.d.ts +5 -0
  26. package/build/index.d.ts.map +1 -1
  27. package/build/index.js +5 -0
  28. package/build/index.js.map +1 -1
  29. package/package.json +1 -1
@@ -0,0 +1,44 @@
1
+ import { DyFM_OperationContext_ControlModel } from '../../_models/control-models/operation-context.control-model';
2
+ import { DyFM_OperationSettings_ControlModel } from '../../_models/control-models/operation-settings.control-model';
3
+ import { DyFM_OperationAuthz_Result } from '../../_models/interfaces/operation-authz-result.interface';
4
+ /**
5
+ * Transport-independent authorization checks of an operation call (HP-DOPL MP-1.4).
6
+ *
7
+ * Two phases, because ownership needs the loaded entity:
8
+ * 1. `check` / `assert` — identity + API key scope, BEFORE the operation runs;
9
+ * 2. `checkOwnership` / `assertOwnership` — inside `run`, once the target entity is loaded.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * DyFM_OperationAuthz_Util.assert(operation, ctx);
14
+ * const task: Task = await loadTask(id);
15
+ * DyFM_OperationAuthz_Util.assertOwnership(operation, ctx, task);
16
+ * ```
17
+ */
18
+ export declare class DyFM_OperationAuthz_Util {
19
+ /**
20
+ * Checks the identity and API key scope requirements of the operation.
21
+ * @param operation - the operation being called
22
+ * @param ctx - the call context built by the transport adapter
23
+ */
24
+ static check(operation: DyFM_OperationSettings_ControlModel<unknown, unknown[], unknown>, ctx: DyFM_OperationContext_ControlModel): DyFM_OperationAuthz_Result;
25
+ /**
26
+ * Same as `check`, but throws a coded `DyFM_Error` (with `status`) on denial.
27
+ * @returns the allowed result, so a `warning` can still be surfaced by the adapter
28
+ */
29
+ static assert(operation: DyFM_OperationSettings_ControlModel<unknown, unknown[], unknown>, ctx: DyFM_OperationContext_ControlModel): DyFM_OperationAuthz_Result;
30
+ /**
31
+ * Checks that the caller owns the loaded target entity, when the operation declares `authz.ownership`.
32
+ * @param operation - the operation being called
33
+ * @param ctx - the call context; its `clientUserId` is the owner identity (never `issuer`)
34
+ * @param target - the loaded entity the operation acts on
35
+ */
36
+ static checkOwnership(operation: DyFM_OperationSettings_ControlModel<unknown, unknown[], unknown>, ctx: DyFM_OperationContext_ControlModel, target: object): DyFM_OperationAuthz_Result;
37
+ /** Same as `checkOwnership`, but throws a coded `DyFM_Error` (with `status`) on denial. */
38
+ static assertOwnership(operation: DyFM_OperationSettings_ControlModel<unknown, unknown[], unknown>, ctx: DyFM_OperationContext_ControlModel, target: object): DyFM_OperationAuthz_Result;
39
+ /** Builds a denial result. */
40
+ private static deny;
41
+ /** Converts a denial into a thrown `DyFM_Error`; the identity is logged by requestId only. */
42
+ private static throwIfDenied;
43
+ }
44
+ //# sourceMappingURL=operation-authz.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-authz.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/operation-authz.util.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kCAAkC,EACnC,MAAM,8DAA8D,CAAC;AAEtE,OAAO,EACL,mCAAmC,EACpC,MAAM,+DAA+D,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AAGvG;;;;;;;;;;;;;GAaG;AACH,qBAAa,wBAAwB;IACnC;;;;OAIG;IACH,MAAM,CAAC,KAAK,CACV,SAAS,EAAE,mCAAmC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAC3E,GAAG,EAAE,kCAAkC,GACtC,0BAA0B;IAyC7B;;;OAGG;IACH,MAAM,CAAC,MAAM,CACX,SAAS,EAAE,mCAAmC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAC3E,GAAG,EAAE,kCAAkC,GACtC,0BAA0B;IAM7B;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CACnB,SAAS,EAAE,mCAAmC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAC3E,GAAG,EAAE,kCAAkC,EACvC,MAAM,EAAE,MAAM,GACb,0BAA0B;IA6B7B,2FAA2F;IAC3F,MAAM,CAAC,eAAe,CACpB,SAAS,EAAE,mCAAmC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAC3E,GAAG,EAAE,kCAAkC,EACvC,MAAM,EAAE,MAAM,GACb,0BAA0B;IAM7B,8BAA8B;IAC9B,OAAO,CAAC,MAAM,CAAC,IAAI;IAInB,8FAA8F;IAC9F,OAAO,CAAC,MAAM,CAAC,aAAa;CAoB7B"}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyFM_OperationAuthz_Util = void 0;
4
+ const operation_auth_type_enum_1 = require("../../_enums/operation-auth.type-enum");
5
+ const operation_context_control_model_1 = require("../../_models/control-models/operation-context.control-model");
6
+ const error_control_model_1 = require("../../_models/control-models/error.control-model");
7
+ /**
8
+ * Transport-independent authorization checks of an operation call (HP-DOPL MP-1.4).
9
+ *
10
+ * Two phases, because ownership needs the loaded entity:
11
+ * 1. `check` / `assert` — identity + API key scope, BEFORE the operation runs;
12
+ * 2. `checkOwnership` / `assertOwnership` — inside `run`, once the target entity is loaded.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * DyFM_OperationAuthz_Util.assert(operation, ctx);
17
+ * const task: Task = await loadTask(id);
18
+ * DyFM_OperationAuthz_Util.assertOwnership(operation, ctx, task);
19
+ * ```
20
+ */
21
+ class DyFM_OperationAuthz_Util {
22
+ /**
23
+ * Checks the identity and API key scope requirements of the operation.
24
+ * @param operation - the operation being called
25
+ * @param ctx - the call context built by the transport adapter
26
+ */
27
+ static check(operation, ctx) {
28
+ const issuerRequired = operation?.authz?.issuerRequired !== false;
29
+ const authKind = ctx?.authKind ?? operation_auth_type_enum_1.DyFM_OperationAuth_Type.none;
30
+ // a missing identity is 401, the caller may retry with credentials
31
+ if (issuerRequired && (authKind === operation_auth_type_enum_1.DyFM_OperationAuth_Type.none || !ctx?.issuer)) {
32
+ return DyFM_OperationAuthz_Util.deny('DyFM-OPZ-UNA', 401, `operation "${operation?.name}" requires an authenticated caller`);
33
+ }
34
+ // scopes only restrict API keys; a token call is not scope-limited
35
+ if (authKind !== operation_auth_type_enum_1.DyFM_OperationAuth_Type.apiKey) {
36
+ return { allowed: true };
37
+ }
38
+ // legacy key (created before scopes): full access, but the adapter must surface the warning
39
+ if (operation_context_control_model_1.DyFM_OperationContext_ControlModel.isLegacyApiKey(ctx)) {
40
+ return { allowed: true, warning: 'legacy-api-key' };
41
+ }
42
+ const requiredScope = operation?.authz?.apiKeyScope;
43
+ // least privilege: a scoped key can not reach an operation that belongs to no scope
44
+ if (!requiredScope) {
45
+ return DyFM_OperationAuthz_Util.deny('DyFM-OPZ-NSC', 403, `operation "${operation?.name}" declares no apiKeyScope, a scoped API key can not call it`);
46
+ }
47
+ // exact match only — no wildcard until it is an explicit decision
48
+ if (!(ctx.apiKeyScopes ?? []).includes(requiredScope)) {
49
+ return DyFM_OperationAuthz_Util.deny('DyFM-OPZ-SCP', 403, `API key lacks scope "${requiredScope}" for operation "${operation?.name}"`);
50
+ }
51
+ return { allowed: true };
52
+ }
53
+ /**
54
+ * Same as `check`, but throws a coded `DyFM_Error` (with `status`) on denial.
55
+ * @returns the allowed result, so a `warning` can still be surfaced by the adapter
56
+ */
57
+ static assert(operation, ctx) {
58
+ return DyFM_OperationAuthz_Util.throwIfDenied(DyFM_OperationAuthz_Util.check(operation, ctx), operation, ctx);
59
+ }
60
+ /**
61
+ * Checks that the caller owns the loaded target entity, when the operation declares `authz.ownership`.
62
+ * @param operation - the operation being called
63
+ * @param ctx - the call context; its `clientUserId` is the owner identity (never `issuer`)
64
+ * @param target - the loaded entity the operation acts on
65
+ */
66
+ static checkOwnership(operation, ctx, target) {
67
+ const ownershipField = operation?.authz?.ownership;
68
+ // no ownership declared: nothing to check
69
+ if (!ownershipField) {
70
+ return { allowed: true };
71
+ }
72
+ // a declared ownership check without a caller identity must fail closed, not pass
73
+ if (!ctx?.clientUserId) {
74
+ return DyFM_OperationAuthz_Util.deny('DyFM-OPZ-OWN', 403, `operation "${operation?.name}" requires the caller's clientUserId for the ownership check`);
75
+ }
76
+ const owner = target ? Reflect.get(target, ownershipField) : undefined;
77
+ // strict equality: an entity without owner is not owned by anybody
78
+ if (owner === undefined || owner === null || String(owner) !== ctx.clientUserId) {
79
+ return DyFM_OperationAuthz_Util.deny('DyFM-OPZ-OWN', 403, `caller does not own the target of operation "${operation?.name}" (field: ${ownershipField})`);
80
+ }
81
+ return { allowed: true };
82
+ }
83
+ /** Same as `checkOwnership`, but throws a coded `DyFM_Error` (with `status`) on denial. */
84
+ static assertOwnership(operation, ctx, target) {
85
+ return DyFM_OperationAuthz_Util.throwIfDenied(DyFM_OperationAuthz_Util.checkOwnership(operation, ctx, target), operation, ctx);
86
+ }
87
+ /** Builds a denial result. */
88
+ static deny(errorCode, status, reason) {
89
+ return { allowed: false, errorCode: errorCode, status: status, reason: reason };
90
+ }
91
+ /** Converts a denial into a thrown `DyFM_Error`; the identity is logged by requestId only. */
92
+ static throwIfDenied(result, operation, ctx) {
93
+ if (result.allowed) {
94
+ return result;
95
+ }
96
+ throw new error_control_model_1.DyFM_Error({
97
+ errorCode: result.errorCode,
98
+ status: result.status,
99
+ message: `Operation authorization failed: ${result.reason}`,
100
+ additionalContent: {
101
+ operation: operation?.name,
102
+ requestId: ctx?.requestId,
103
+ authKind: ctx?.authKind,
104
+ },
105
+ });
106
+ }
107
+ }
108
+ exports.DyFM_OperationAuthz_Util = DyFM_OperationAuthz_Util;
109
+ //# sourceMappingURL=operation-authz.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-authz.util.js","sourceRoot":"","sources":["../../../src/_collections/utils/operation-authz.util.ts"],"names":[],"mappings":";;;AAAA,oFAAgF;AAChF,kHAEsE;AACtE,0FAA8E;AAO9E;;;;;;;;;;;;;GAaG;AACH,MAAa,wBAAwB;IACnC;;;;OAIG;IACH,MAAM,CAAC,KAAK,CACV,SAA2E,EAC3E,GAAuC;QAEvC,MAAM,cAAc,GAAY,SAAS,EAAE,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC;QAC3E,MAAM,QAAQ,GAA4B,GAAG,EAAE,QAAQ,IAAI,kDAAuB,CAAC,IAAI,CAAC;QAExF,mEAAmE;QACnE,IAAI,cAAc,IAAI,CAAC,QA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KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAClF,CAAC;IAED,8FAA8F;IACtF,MAAM,CAAC,aAAa,CAC1B,MAAkC,EAClC,SAA2E,EAC3E,GAAuC;QAEvC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,IAAI,gCAAU,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,mCAAmC,MAAM,CAAC,MAAM,EAAE;YAC3D,iBAAiB,EAAE;gBACjB,SAAS,EAAE,SAAS,EAAE,IAAI;gBAC1B,SAAS,EAAE,GAAG,EAAE,SAAS;gBACzB,QAAQ,EAAE,GAAG,EAAE,QAAQ;aACxB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA3ID,4DA2IC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * How the caller of an operation authenticated.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * if (ctx.authKind === DyFM_OperationAuth_Type.apiKey) {
7
+ * // scope checks apply
8
+ * }
9
+ * ```
10
+ */
11
+ export declare enum DyFM_OperationAuth_Type {
12
+ /** Anonymous call: no authenticated identity. */
13
+ none = "none",
14
+ /** Authenticated with a user (session/JWT) token. */
15
+ token = "token",
16
+ /** Authenticated with an API key; `apiKeyScopes` may restrict what it can call. */
17
+ apiKey = "api-key"
18
+ }
19
+ //# sourceMappingURL=operation-auth.type-enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-auth.type-enum.d.ts","sourceRoot":"","sources":["../../src/_enums/operation-auth.type-enum.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,oBAAY,uBAAuB;IACjC,iDAAiD;IACjD,IAAI,SAAS;IACb,qDAAqD;IACrD,KAAK,UAAU;IACf,mFAAmF;IACnF,MAAM,YAAY;CACnB"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyFM_OperationAuth_Type = void 0;
4
+ /**
5
+ * How the caller of an operation authenticated.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * if (ctx.authKind === DyFM_OperationAuth_Type.apiKey) {
10
+ * // scope checks apply
11
+ * }
12
+ * ```
13
+ */
14
+ var DyFM_OperationAuth_Type;
15
+ (function (DyFM_OperationAuth_Type) {
16
+ /** Anonymous call: no authenticated identity. */
17
+ DyFM_OperationAuth_Type["none"] = "none";
18
+ /** Authenticated with a user (session/JWT) token. */
19
+ DyFM_OperationAuth_Type["token"] = "token";
20
+ /** Authenticated with an API key; `apiKeyScopes` may restrict what it can call. */
21
+ DyFM_OperationAuth_Type["apiKey"] = "api-key";
22
+ })(DyFM_OperationAuth_Type || (exports.DyFM_OperationAuth_Type = DyFM_OperationAuth_Type = {}));
23
+ //# sourceMappingURL=operation-auth.type-enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-auth.type-enum.js","sourceRoot":"","sources":["../../src/_enums/operation-auth.type-enum.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;GASG;AACH,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,iDAAiD;IACjD,wCAAa,CAAA;IACb,qDAAqD;IACrD,0CAAe,CAAA;IACf,mFAAmF;IACnF,6CAAkB,CAAA;AACpB,CAAC,EAPW,uBAAuB,uCAAvB,uBAAuB,QAOlC"}
@@ -0,0 +1,57 @@
1
+ import { DyFM_OperationAuth_Type } from '../../_enums/operation-auth.type-enum';
2
+ import { DyFM_Operation_Exposure } from '../interfaces/operation-exposure.interface';
3
+ /**
4
+ * Transport-independent context of ONE operation call (HP-DOPL MP-1.3).
5
+ *
6
+ * The REST, MCP and CLI adapters build this object from their own request shape, so the operation's
7
+ * `run(ctx, ...inputs)` never sees Express, JSON-RPC or commander objects.
8
+ *
9
+ * 🔴 `issuer` is ALWAYS the accountId, NEVER a user id (`fdp-issuer-is-account-id`). The service's own
10
+ * user id — the content-ownership identity — travels separately in `clientUserId`.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const ctx: DyFM_Operation_Context = new DyFM_Operation_Context({
15
+ * transport: 'mcp',
16
+ * authKind: DyFM_OperationAuth_Type.apiKey,
17
+ * issuer: accountId,
18
+ * clientUserId: userId,
19
+ * apiKeyScopes: [ 'task:read' ],
20
+ * });
21
+ * ```
22
+ */
23
+ export declare class DyFM_OperationContext_ControlModel {
24
+ /** Transport the call arrived on. */
25
+ transport?: keyof DyFM_Operation_Exposure;
26
+ /** How the caller authenticated (default: `none`). */
27
+ authKind?: DyFM_OperationAuth_Type;
28
+ /** The authenticated FDP accountId — never a user id. Required unless `authKind` is `none`. */
29
+ issuer?: string;
30
+ /** The service's own user id of the caller (content ownership); resolved server-side, never from input. */
31
+ clientUserId?: string;
32
+ /**
33
+ * Scopes granted to the API key. Only valid with `authKind: apiKey`.
34
+ * `undefined` marks a LEGACY key without scopes (full access with a warning, decision D-6);
35
+ * an empty array means the key grants nothing.
36
+ */
37
+ apiKeyScopes?: string[];
38
+ /** When `true`, the operation must validate and report, but not persist anything (default: `false`). */
39
+ dryRun?: boolean;
40
+ /** Optimistic-concurrency token (etag) the caller expects the target to still have. */
41
+ ifMatch?: string;
42
+ /** Correlation id of the call; generated when not given. */
43
+ requestId?: string;
44
+ /**
45
+ * Validates the identity combination and applies the defaults.
46
+ * @param input - the call context; throws a coded `DyFM_Error` when the identity combination is invalid
47
+ */
48
+ constructor(input?: DyFM_OperationContext_ControlModel);
49
+ /** `true` when the call uses an API key created before scopes existed (legacy full access, D-6). */
50
+ static isLegacyApiKey(ctx: DyFM_OperationContext_ControlModel): boolean;
51
+ /** Checks for a non-blank string. */
52
+ private static isFilled;
53
+ /** Builds the construction error with a stable error code and the construction location. */
54
+ private static invalid;
55
+ }
56
+ export { DyFM_OperationContext_ControlModel as DyFM_Operation_Context };
57
+ //# sourceMappingURL=operation-context.control-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-context.control-model.d.ts","sourceRoot":"","sources":["../../../src/_models/control-models/operation-context.control-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAKrF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,kCAAkC;IAK7C,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,uBAAuB,CAAC;IAC1C,sDAAsD;IACtD,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,+FAA+F;IAC/F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2GAA2G;IAC3G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,wGAAwG;IACxG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;gBACS,KAAK,CAAC,EAAE,kCAAkC;IAgEtD,oGAAoG;IACpG,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,kCAAkC,GAAG,OAAO;IAIvE,qCAAqC;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB,4FAA4F;IAC5F,OAAO,CAAC,MAAM,CAAC,OAAO;CAOvB;AAED,OAAO,EACL,kCAAkC,IAAI,sBAAsB,EAC7D,CAAC"}
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyFM_Operation_Context = exports.DyFM_OperationContext_ControlModel = void 0;
4
+ const stack_util_1 = require("../../_collections/utils/stack.util");
5
+ const uuid_util_1 = require("../../_collections/utils/uuid.util");
6
+ const operation_auth_type_enum_1 = require("../../_enums/operation-auth.type-enum");
7
+ const error_control_model_1 = require("./error.control-model");
8
+ /**
9
+ * Transport-independent context of ONE operation call (HP-DOPL MP-1.3).
10
+ *
11
+ * The REST, MCP and CLI adapters build this object from their own request shape, so the operation's
12
+ * `run(ctx, ...inputs)` never sees Express, JSON-RPC or commander objects.
13
+ *
14
+ * 🔴 `issuer` is ALWAYS the accountId, NEVER a user id (`fdp-issuer-is-account-id`). The service's own
15
+ * user id — the content-ownership identity — travels separately in `clientUserId`.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const ctx: DyFM_Operation_Context = new DyFM_Operation_Context({
20
+ * transport: 'mcp',
21
+ * authKind: DyFM_OperationAuth_Type.apiKey,
22
+ * issuer: accountId,
23
+ * clientUserId: userId,
24
+ * apiKeyScopes: [ 'task:read' ],
25
+ * });
26
+ * ```
27
+ */
28
+ class DyFM_OperationContext_ControlModel {
29
+ static {
30
+ Object.defineProperty(this, 'name', { value: 'DyFM_Operation_Context' });
31
+ }
32
+ /** Transport the call arrived on. */
33
+ transport;
34
+ /** How the caller authenticated (default: `none`). */
35
+ authKind;
36
+ /** The authenticated FDP accountId — never a user id. Required unless `authKind` is `none`. */
37
+ issuer;
38
+ /** The service's own user id of the caller (content ownership); resolved server-side, never from input. */
39
+ clientUserId;
40
+ /**
41
+ * Scopes granted to the API key. Only valid with `authKind: apiKey`.
42
+ * `undefined` marks a LEGACY key without scopes (full access with a warning, decision D-6);
43
+ * an empty array means the key grants nothing.
44
+ */
45
+ apiKeyScopes;
46
+ /** When `true`, the operation must validate and report, but not persist anything (default: `false`). */
47
+ dryRun;
48
+ /** Optimistic-concurrency token (etag) the caller expects the target to still have. */
49
+ ifMatch;
50
+ /** Correlation id of the call; generated when not given. */
51
+ requestId;
52
+ /**
53
+ * Validates the identity combination and applies the defaults.
54
+ * @param input - the call context; throws a coded `DyFM_Error` when the identity combination is invalid
55
+ */
56
+ constructor(input) {
57
+ const set = input ?? {};
58
+ // the construction location identifies the faulty adapter in the error
59
+ const stackLocation = (0, stack_util_1.DyFM_getConstructionStackLocation)();
60
+ const authKind = set.authKind ?? operation_auth_type_enum_1.DyFM_OperationAuth_Type.none;
61
+ // authKind must be a known value
62
+ if (!Object.values(operation_auth_type_enum_1.DyFM_OperationAuth_Type).includes(authKind)) {
63
+ throw DyFM_OperationContext_ControlModel.invalid('DyFM-OPC-AUT', `unknown authKind (got: ${JSON.stringify(set.authKind)})`, stackLocation);
64
+ }
65
+ // transport must be one of the exposure keys
66
+ if (set.transport !== undefined && !['rest', 'mcp', 'cli'].includes(set.transport)) {
67
+ throw DyFM_OperationContext_ControlModel.invalid('DyFM-OPC-TRN', `unknown transport (got: ${JSON.stringify(set.transport)})`, stackLocation);
68
+ }
69
+ const authenticated = authKind !== operation_auth_type_enum_1.DyFM_OperationAuth_Type.none;
70
+ // an authenticated call without an accountId is an adapter defect, not an anonymous call
71
+ if (authenticated && !DyFM_OperationContext_ControlModel.isFilled(set.issuer)) {
72
+ throw DyFM_OperationContext_ControlModel.invalid('DyFM-OPC-ISS', `authKind "${authKind}" requires the issuer (accountId)`, stackLocation);
73
+ }
74
+ // an anonymous call must not carry an identity
75
+ if (!authenticated && (set.issuer !== undefined || set.clientUserId !== undefined)) {
76
+ throw DyFM_OperationContext_ControlModel.invalid('DyFM-OPC-ANO', 'authKind "none" can not carry an issuer or a clientUserId', stackLocation);
77
+ }
78
+ // scopes belong to API keys only; every scope must be a non-empty string
79
+ if (set.apiKeyScopes !== undefined) {
80
+ if (authKind !== operation_auth_type_enum_1.DyFM_OperationAuth_Type.apiKey) {
81
+ throw DyFM_OperationContext_ControlModel.invalid('DyFM-OPC-SCP', `apiKeyScopes are only valid with authKind "api-key" (got: "${authKind}")`, stackLocation);
82
+ }
83
+ if (!Array.isArray(set.apiKeyScopes) ||
84
+ !set.apiKeyScopes.every((scope) => DyFM_OperationContext_ControlModel.isFilled(scope))) {
85
+ throw DyFM_OperationContext_ControlModel.invalid('DyFM-OPC-SCP', 'apiKeyScopes must be an array of non-empty strings', stackLocation);
86
+ }
87
+ }
88
+ Object.assign(this, set);
89
+ this.authKind = authKind;
90
+ this.dryRun = set.dryRun === true;
91
+ this.requestId = DyFM_OperationContext_ControlModel.isFilled(set.requestId) ?
92
+ set.requestId : uuid_util_1.DyFM_UUID.generate();
93
+ // a copy, so a later mutation of the adapter's array can not widen the granted scopes
94
+ this.apiKeyScopes = set.apiKeyScopes ? [...set.apiKeyScopes] : undefined;
95
+ }
96
+ /** `true` when the call uses an API key created before scopes existed (legacy full access, D-6). */
97
+ static isLegacyApiKey(ctx) {
98
+ return ctx?.authKind === operation_auth_type_enum_1.DyFM_OperationAuth_Type.apiKey && ctx.apiKeyScopes === undefined;
99
+ }
100
+ /** Checks for a non-blank string. */
101
+ static isFilled(value) {
102
+ return typeof value === 'string' && !!value.trim();
103
+ }
104
+ /** Builds the construction error with a stable error code and the construction location. */
105
+ static invalid(errorCode, reason, stackLocation) {
106
+ return new error_control_model_1.DyFM_Error({
107
+ errorCode: errorCode,
108
+ message: `DyFM_Operation_Context construction failed: ${reason}`,
109
+ additionalContent: { stackLocation: stackLocation },
110
+ });
111
+ }
112
+ }
113
+ exports.DyFM_OperationContext_ControlModel = DyFM_OperationContext_ControlModel;
114
+ exports.DyFM_Operation_Context = DyFM_OperationContext_ControlModel;
115
+ //# sourceMappingURL=operation-context.control-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-context.control-model.js","sourceRoot":"","sources":["../../../src/_models/control-models/operation-context.control-model.ts"],"names":[],"mappings":";;;AAAA,oEAAwF;AACxF,kEAA+D;AAC/D,oFAAgF;AAGhF,+DAAmD;AAGnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,kCAAkC;IAC7C;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,qCAAqC;IACrC,SAAS,CAAiC;IAC1C,s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AI,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAE,GAAG,GAAG,CAAC,YAAY,CAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,CAAC;IAED,oGAAoG;IACpG,MAAM,CAAC,cAAc,CAAC,GAAuC;QAC3D,OAAO,GAAG,EAAE,QAAQ,KAAK,kDAAuB,CAAC,MAAM,IAAI,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC;IAC5F,CAAC;IAED,qCAAqC;IAC7B,MAAM,CAAC,QAAQ,CAAC,KAAyB;QAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACrD,CAAC;IAED,4FAA4F;IACpF,MAAM,CAAC,OAAO,CAAC,SAAiB,EAAE,MAAc,EAAE,aAAqB;QAC7E,OAAO,IAAI,gCAAU,CAAC;YACpB,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,+CAA+C,MAAM,EAAE;YAChE,iBAAiB,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE;SACpD,CAAC,CAAC;IACL,CAAC;CACF;AAhHD,gFAgHC;AAGuC,oEAAsB"}
@@ -1,3 +1,4 @@
1
+ import { DyFM_Operation_Authz } from '../interfaces/operation-authz.interface';
1
2
  import { DyFM_Operation_Exposure } from '../interfaces/operation-exposure.interface';
2
3
  import { DyFM_OperationInput_Settings } from '../interfaces/operation-input-settings.interface';
3
4
  import { DyFM_DataModel_Params } from './data-model-params.control-model';
@@ -39,6 +40,8 @@ export declare class DyFM_OperationSettings_ControlModel<T_Result = unknown, T_I
39
40
  bodyParams?: DyFM_DataModel_Params<any>;
40
41
  /** Transports the operation is exposed on; missing flags default to `true`. */
41
42
  expose?: DyFM_Operation_Exposure;
43
+ /** Declarative authorization; `issuerRequired` defaults to `true`. */
44
+ authz?: DyFM_Operation_Authz;
42
45
  /** Source location of the construction, for debugging duplicated or misconfigured operations. */
43
46
  stackLocation?: string;
44
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"operation-settings.control-model.d.ts","sourceRoot":"","sources":["../../../src/_models/control-models/operation-settings.control-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAEhG,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAU1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,mCAAmC,CAC9C,QAAQ,GAAG,OAAO,EAClB,QAAQ,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,EACtC,MAAM,GAAG,SAAS;IAMlB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,MAAM,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAM;IAC3D,oEAAoE;IACpE,UAAU,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;IACxC,+EAA+E;IAC/E,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,iGAAiG;IACjG,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;gBAED,GAAG,EAAE,mCAAmC,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC;IAuFtE,mEAAmE;IACnE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAKzC,4FAA4F;IAC5F,OAAO,CAAC,MAAM,CAAC,OAAO;CAOvB;AAED,OAAO,EACL,mCAAmC,IAAI,uBAAuB,EAC/D,CAAC"}
1
+ {"version":3,"file":"operation-settings.control-model.d.ts","sourceRoot":"","sources":["../../../src/_models/control-models/operation-settings.control-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  /** Transports the operation is exposed on; missing flags default to `true`. */
51
51
  expose;
52
+ /** Declarative authorization; `issuerRequired` defaults to `true`. */
53
+ authz;
52
54
  /** Source location of the construction, for debugging duplicated or misconfigured operations. */
53
55
  stackLocation;
54
56
  /**
@@ -91,6 +93,15 @@ class DyFM_OperationSettings_ControlModel {
91
93
  throw DyFM_OperationSettings_ControlModel.invalid('DyFM-OPS-INT', `input "${inputName}" has an invalid type (got: ${JSON.stringify(input?.type)}) (${label})`, stackLocation);
92
94
  }
93
95
  });
96
+ // authz: the declared fields must be usable, and ownership needs an authenticated caller
97
+ const authz = { issuerRequired: true, ...set.authz };
98
+ if ((authz.ownership !== undefined && !DyFM_operationInputName.test(authz.ownership)) ||
99
+ (authz.apiKeyScope !== undefined && (typeof authz.apiKeyScope !== 'string' || !authz.apiKeyScope.trim()))) {
100
+ throw DyFM_OperationSettings_ControlModel.invalid('DyFM-OPS-AZF', `authz.ownership must be a field name and authz.apiKeyScope a non-empty string (${label})`, stackLocation);
101
+ }
102
+ if (authz.ownership !== undefined && authz.issuerRequired === false) {
103
+ throw DyFM_OperationSettings_ControlModel.invalid('DyFM-OPS-AZO', `authz.ownership can not be combined with issuerRequired: false (${label})`, stackLocation);
104
+ }
94
105
  Object.assign(this, set);
95
106
  this.domain = set.domain;
96
107
  this.action = set.action;
@@ -99,6 +110,7 @@ class DyFM_OperationSettings_ControlModel {
99
110
  this.inputs = inputs;
100
111
  // a missing expose flag means: exposed on that transport
101
112
  this.expose = { rest: true, mcp: true, cli: true, ...set.expose };
113
+ this.authz = authz;
102
114
  this.stackLocation = stackLocation;
103
115
  }
104
116
  /** Checks the `name` format: dot-separated kebab-case segments. */
@@ -1 +1 @@
1
- {"version":3,"file":"operation-settings.control-model.js","sourceRoot":"","sources":["../../../src/_models/control-models/operation-settings.control-model.ts"],"names":[],"mappings":";;;AAAA,oEAAwF;AACxF,oFAAgF;AAKhF,+DAAmD;AAGnD,gFAAgF;AAChF,MAAM,0BAA0B,GAAW,+B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,CAAC;IAED,4FAA4F;IACpF,MAAM,CAAC,OAAO,CAAC,SAAiB,EAAE,MAAc,EAAE,aAAqB;QAC7E,OAAO,IAAI,gCAAU,CAAC;YACpB,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,gDAAgD,MAAM,EAAE;YACjE,iBAAiB,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE;SACpD,CAAC,CAAC;IACL,CAAC;CACF;AApID,kFAoIC;AAGwC,sEAAuB"}
1
+ {"version":3,"file":"operation-settings.control-model.js","sourceRoot":"","sources":["../../../src/_models/control-models/operation-settings.control-model.ts"],"names":[],"mappings":";;;AAAA,oEAAwF;AACxF,oFAAgF;AAMhF,+DAAmD;AAGnD,gFAAgF;AAChF,MAAM,0BAA0B,GAAW,+BAA+B,CAAC;AAE3E,6FAA6F;AAC7F,MAAM,uBAAuB,GAAW,wBAAwB,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,mCAAmC;IAK9C;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,gEAAgE;IAChE,IAAI,CAAU;IACd,qDAAqD;IACrD,MAAM,CAAS;IACf,0FAA0F;IAC1F,MAAM,CAAS;IACf,wFAAwF;IACxF,WAAW,CAAS;IACpB,qDAAqD;IACrD,MAAM,GAAkD,EAAE,CAAC;IAC3D,oEAAoE;IACpE,UAAU,CAA8B;IACxC,+EAA+E;IAC/E,MAAM,CAA2B;IACjC,sEAAsE;IACtE,KAAK,CAAwB;IAC7B,iGAAiG;IACjG,aAAa,CAAU;IAEvB;;;OAGG;IACH,YACE,GAAoE;QAEpE,0EAA0E;QAC1E,MAAM,aAAa,GAAW,GAAG,EAAE,aAAa,IAAI,IAAA,8CAAiC,GAAE,CAAC;QAExF,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,mCAAmC,CAAC,OAAO,CAC/C,c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,CAAC;IAClG,CAAC;IAED,4FAA4F;IACpF,MAAM,CAAC,OAAO,CAAC,SAAiB,EAAE,MAAc,EAAE,aAAqB;QAC7E,OAAO,IAAI,gCAAU,CAAC;YACpB,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,gDAAgD,MAAM,EAAE;YACjE,iBAAiB,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE;SACpD,CAAC,CAAC;IACL,CAAC;CACF;AA1JD,kFA0JC;AAGwC,sEAAuB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Outcome of an operation authorization check; `allowed: false` always carries a code and a status.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const result: DyFM_OperationAuthz_Result = DyFM_OperationAuthz_Util.check(operation, ctx);
7
+ * if (!result.allowed) {
8
+ * res.status(result.status).send(result.errorCode);
9
+ * }
10
+ * ```
11
+ */
12
+ export interface DyFM_OperationAuthz_Result {
13
+ allowed: boolean;
14
+ /** Stable error code of the denial (`DyFM-OPZ-*`). */
15
+ errorCode?: string;
16
+ /** HTTP-equivalent status of the denial: 401 (not authenticated) or 403 (not permitted). */
17
+ status?: 401 | 403;
18
+ /** Human-readable reason of the denial. */
19
+ reason?: string;
20
+ /** Set when the call is allowed only through the legacy, scope-less API key path (D-6). */
21
+ warning?: 'legacy-api-key';
22
+ }
23
+ //# sourceMappingURL=operation-authz-result.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-authz-result.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/operation-authz-result.interface.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACnB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=operation-authz-result.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-authz-result.interface.js","sourceRoot":"","sources":["../../../src/_models/interfaces/operation-authz-result.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Declarative authorization of an operation, checked by `DyFM_OperationAuthz_Util` in the same way on
3
+ * every transport (REST, MCP, CLI).
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const authz: DyFM_Operation_Authz = {
8
+ * ownership: 'userId',
9
+ * apiKeyScope: 'task:write',
10
+ * };
11
+ * ```
12
+ */
13
+ export interface DyFM_Operation_Authz {
14
+ /** The caller must be authenticated (default: `true` — an operation is public only when stated). */
15
+ issuerRequired?: boolean;
16
+ /**
17
+ * Field name on the target entity that holds its owner's `clientUserId` (e.g. `userId`).
18
+ * When set, the entity may only be touched by its owner. The owner is compared with
19
+ * `ctx.clientUserId`, never with `ctx.issuer` (`fdp-issuer-is-account-id`).
20
+ */
21
+ ownership?: string;
22
+ /**
23
+ * Scope an API key must grant to call the operation (e.g. `task:write`).
24
+ * A scoped API key can not call an operation that declares no scope.
25
+ */
26
+ apiKeyScope?: string;
27
+ }
28
+ //# sourceMappingURL=operation-authz.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-authz.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/operation-authz.interface.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAoB;IACnC,oGAAoG;IACpG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=operation-authz.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-authz.interface.js","sourceRoot":"","sources":["../../../src/_models/interfaces/operation-authz.interface.ts"],"names":[],"mappings":""}
package/build/index.d.ts CHANGED
@@ -19,6 +19,7 @@ export * from './_collections/utils/string-case.util';
19
19
  export * from './_collections/utils/time.util';
20
20
  export * from './_collections/utils/type-cloning-facility.util';
21
21
  export * from './_collections/utils/utilities.util';
22
+ export * from './_collections/utils/operation-authz.util';
22
23
  export * from './_collections/utils/uuid.util';
23
24
  export * from './_collections/utils/math/box-bounds.util';
24
25
  export * from './_collections/utils/math/math.util';
@@ -34,6 +35,7 @@ export * from './_enums/environment-flag.enum';
34
35
  export * from './_enums/error-level.enum';
35
36
  export * from './_enums/error-status.enum';
36
37
  export * from './_enums/log-style.enum';
38
+ export * from './_enums/operation-auth.type-enum';
37
39
  export * from './_enums/server-connection-status.enum';
38
40
  export * from './_enums/http/http-call-type.enum';
39
41
  export * from './_enums/http/http-event-type.enum';
@@ -44,6 +46,7 @@ export * from './_enums/time/relative-date.enum';
44
46
  export * from './_models/control-models/data-model-params.control-model';
45
47
  export * from './_models/control-models/data-property-params.control-model';
46
48
  export * from './_models/control-models/error.control-model';
49
+ export * from './_models/control-models/operation-context.control-model';
47
50
  export * from './_models/control-models/operation-settings.control-model';
48
51
  export * from './_models/control-models/poll.control-model';
49
52
  export * from './_models/control-models/range-value.control-model';
@@ -56,6 +59,8 @@ export * from './_models/data-models/errors.data-model';
56
59
  export * from './_models/data-models/metadata.data-model';
57
60
  export * from './_models/interfaces/box-bounds.interface';
58
61
  export * from './_models/interfaces/error-defaults.interface';
62
+ export * from './_models/interfaces/operation-authz-result.interface';
63
+ export * from './_models/interfaces/operation-authz.interface';
59
64
  export * from './_models/interfaces/operation-exposure.interface';
60
65
  export * from './_models/interfaces/operation-input-settings.interface';
61
66
  export * from './_models/interfa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AAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAG1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uDAAuD,CAAC;AACtE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mDAAmD,CAAC;AAClE,cAAc,yDAAyD,CAAC;AACxE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wDAAwD,CAAC;AACvE,cAAc,wCAAwC,CAAC;AAGvD,cAAc,gEAAgE,CAAC;AAC/E,cAAc,4DAA4D,CAAC;AAG3E,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC"}
package/build/index.js CHANGED
@@ -25,6 +25,7 @@ tslib_1.__exportStar(require("./_collections/utils/string-case.util"), exports);
25
25
  tslib_1.__exportStar(require("./_collections/utils/time.util"), exports);
26
26
  tslib_1.__exportStar(require("./_collections/utils/type-cloning-facility.util"), exports);
27
27
  tslib_1.__exportStar(require("./_collections/utils/utilities.util"), exports);
28
+ tslib_1.__exportStar(require("./_collections/utils/operation-authz.util"), exports);
28
29
  tslib_1.__exportStar(require("./_collections/utils/uuid.util"), exports);
29
30
  // collections/utils/MATH
30
31
  tslib_1.__exportStar(require("./_collections/utils/math/box-bounds.util"), exports);
@@ -43,6 +44,7 @@ tslib_1.__exportStar(require("./_enums/environment-flag.enum"), exports);
43
44
  tslib_1.__exportStar(require("./_enums/error-level.enum"), exports);
44
45
  tslib_1.__exportStar(require("./_enums/error-status.enum"), exports);
45
46
  tslib_1.__exportStar(require("./_enums/log-style.enum"), exports);
47
+ tslib_1.__exportStar(require("./_enums/operation-auth.type-enum"), exports);
46
48
  tslib_1.__exportStar(require("./_enums/server-connection-status.enum"), exports);
47
49
  // enums/HTTP
48
50
  tslib_1.__exportStar(require("./_enums/http/http-call-type.enum"), exports);
@@ -57,6 +59,7 @@ tslib_1.__exportStar(require("./_enums/time/relative-date.enum"), exports);
57
59
  tslib_1.__exportStar(require("./_models/control-models/data-model-params.control-model"), exports);
58
60
  tslib_1.__exportStar(require("./_models/control-models/data-property-params.control-model"), exports);
59
61
  tslib_1.__exportStar(require("./_models/control-models/error.control-model"), exports);
62
+ tslib_1.__exportStar(require("./_models/control-models/operation-context.control-model"), exports);
60
63
  tslib_1.__exportStar(require("./_models/control-models/operation-settings.control-model"), exports);
61
64
  tslib_1.__exportStar(require("./_models/control-models/poll.control-model"), exports);
62
65
  tslib_1.__exportStar(require("./_models/control-models/range-value.control-model"), exports);
@@ -72,6 +75,8 @@ tslib_1.__exportStar(require("./_models/data-models/metadata.data-model"), expor
72
75
  // models/INTERFACES
73
76
  tslib_1.__exportStar(require("./_models/interfaces/box-bounds.interface"), exports);
74
77
  tslib_1.__exportStar(require("./_models/interfaces/error-defaults.interface"), exports);
78
+ tslib_1.__exportStar(require("./_models/interfaces/operation-authz-result.interface"), exports);
79
+ tslib_1.__exportStar(require("./_models/interfaces/operation-authz.interface"), exports);
75
80
  tslib_1.__exportStar(require("./_models/interfaces/operation-exposure.interface"), exports);
76
81
  tslib_1.__exportStar(require("./_models/interfaces/operation-input-settings.interface"), exports);
77
82
  tslib_1.__exportStar(require("./_models/interfaces/paged.interface"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,cAAc;AACd,wBAAwB;AACxB,oFAA0D;AAC1D,wFAA8D;AAC9D,yFAA+D;AAC/D,iFAAuD;AACvD,+EAAqD;AAErD,oBAAoB;AACpB,0EAAgD;AAChD,0EAAgD;AAChD,yEAA+C;AAC/C,0FAAgE;AAChE,sFAA4D;AAC5D,wEAA8C;AAC9C,+EAAqD;AACrD,gFAAsD;AACtD,2EAAiD;AACjD,gFAAsD;AACtD,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EAA6C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/fsm-dynamo",
3
- "version": "1.20.57",
3
+ "version": "1.20.59",
4
4
  "description": "Full Stack Model Collection for Dynamic (NodeJS-Typescript) Framework called Dynamo, by Future Development Ltd.",
5
5
  "DyBu_settings": {
6
6
  "packageType": "full-stack-package",