@fabricorg/platform-host 8.3.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -0
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1174,6 +1174,14 @@ export interface ActionExecutionAuthorizationInput extends ActionAuthorizationIn
|
|
|
1174
1174
|
invocation: Readonly<ActionInvocationRecord>;
|
|
1175
1175
|
executionReason: ActionExecutionReason;
|
|
1176
1176
|
}
|
|
1177
|
+
/** Trusted authorization input for deciding a parked approval. */
|
|
1178
|
+
export interface ActionApprovalAuthorizationInput extends ActionAuthorizationInput {
|
|
1179
|
+
decision: ActionApprovalDecision;
|
|
1180
|
+
/** The parked invocation being decided. */
|
|
1181
|
+
actionInvocationId: string;
|
|
1182
|
+
/** The durable (post-redaction) invocation record as read before the decision transition. */
|
|
1183
|
+
invocation: Readonly<ActionInvocationRecord>;
|
|
1184
|
+
}
|
|
1177
1185
|
/**
|
|
1178
1186
|
* Input to `resolvePolicies`. Carries the invocation identity and the
|
|
1179
1187
|
* schema-parsed durable (post-redaction) parameters so a resolver can choose
|
|
@@ -1193,9 +1201,7 @@ export interface PlatformHostAuthorization {
|
|
|
1193
1201
|
*/
|
|
1194
1202
|
authorizeExecution?(input: ActionExecutionAuthorizationInput): Promise<boolean>;
|
|
1195
1203
|
/** Optional distinct authorization boundary for human/system approval decisions. */
|
|
1196
|
-
authorizeApproval?(input:
|
|
1197
|
-
decision: ActionApprovalDecision;
|
|
1198
|
-
}): Promise<boolean>;
|
|
1204
|
+
authorizeApproval?(input: ActionApprovalAuthorizationInput): Promise<boolean>;
|
|
1199
1205
|
/**
|
|
1200
1206
|
* Authorization for `requeueOutboxDeadLetter`. There is no action to fall
|
|
1201
1207
|
* back to, so when this is absent every requeue is refused as
|
package/dist/index.d.ts
CHANGED
|
@@ -1174,6 +1174,14 @@ export interface ActionExecutionAuthorizationInput extends ActionAuthorizationIn
|
|
|
1174
1174
|
invocation: Readonly<ActionInvocationRecord>;
|
|
1175
1175
|
executionReason: ActionExecutionReason;
|
|
1176
1176
|
}
|
|
1177
|
+
/** Trusted authorization input for deciding a parked approval. */
|
|
1178
|
+
export interface ActionApprovalAuthorizationInput extends ActionAuthorizationInput {
|
|
1179
|
+
decision: ActionApprovalDecision;
|
|
1180
|
+
/** The parked invocation being decided. */
|
|
1181
|
+
actionInvocationId: string;
|
|
1182
|
+
/** The durable (post-redaction) invocation record as read before the decision transition. */
|
|
1183
|
+
invocation: Readonly<ActionInvocationRecord>;
|
|
1184
|
+
}
|
|
1177
1185
|
/**
|
|
1178
1186
|
* Input to `resolvePolicies`. Carries the invocation identity and the
|
|
1179
1187
|
* schema-parsed durable (post-redaction) parameters so a resolver can choose
|
|
@@ -1193,9 +1201,7 @@ export interface PlatformHostAuthorization {
|
|
|
1193
1201
|
*/
|
|
1194
1202
|
authorizeExecution?(input: ActionExecutionAuthorizationInput): Promise<boolean>;
|
|
1195
1203
|
/** Optional distinct authorization boundary for human/system approval decisions. */
|
|
1196
|
-
authorizeApproval?(input:
|
|
1197
|
-
decision: ActionApprovalDecision;
|
|
1198
|
-
}): Promise<boolean>;
|
|
1204
|
+
authorizeApproval?(input: ActionApprovalAuthorizationInput): Promise<boolean>;
|
|
1199
1205
|
/**
|
|
1200
1206
|
* Authorization for `requeueOutboxDeadLetter`. There is no action to fall
|
|
1201
1207
|
* back to, so when this is absent every requeue is refused as
|
package/dist/index.js
CHANGED
|
@@ -3440,7 +3440,9 @@ function createGovernedActionHost(options) {
|
|
|
3440
3440
|
const entitled = await options.authorization.checkEntitlement(approvalAuthorizationInput);
|
|
3441
3441
|
const authorized = options.authorization.authorizeApproval ? await options.authorization.authorizeApproval({
|
|
3442
3442
|
...approvalAuthorizationInput,
|
|
3443
|
-
|
|
3443
|
+
actionInvocationId,
|
|
3444
|
+
decision,
|
|
3445
|
+
invocation: structuredClone(invocation)
|
|
3444
3446
|
}) : await options.authorization.authorize(approvalAuthorizationInput);
|
|
3445
3447
|
if (!entitled || !authorized) return {
|
|
3446
3448
|
...actionResult(invocation),
|