@silencelaboratories/walletprovider-sdk 4.2.1 → 4.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/dist/policy.d.ts CHANGED
@@ -201,19 +201,42 @@ export interface ConditionGroup {
201
201
  * Either a single condition or a group of conditions
202
202
  */
203
203
  export type ConditionOrGroup = Condition | ConditionGroup;
204
- /** One external provider operation referenced by a policy rule. */
204
+ /** One configured external-check operation referenced by a policy rule. */
205
205
  export interface ExternalCheck {
206
+ /** Policy-defined identifier for this external check. Must be unique across all rules in the policy. */
206
207
  check_id: string;
208
+ /** Integration identifier resolved by the party's integration registry. */
207
209
  integration_id: string;
210
+ /** Operation to execute for the referenced integration. */
208
211
  operation: string;
209
- /** End-to-end provider timeout in milliseconds. */
212
+ /** Maximum duration allowed for this check, in milliseconds. */
210
213
  duration_ms: number;
211
214
  }
212
- /** Boolean group of external checks attached to one rule. */
215
+ /** External checks combined with boolean logic for one policy rule. */
213
216
  export interface ExternalCheckGroup {
217
+ /** Logic applied only within this external-check group. */
214
218
  logic: Logic;
219
+ /** Checks in policy evaluation order. */
215
220
  checks: ExternalCheck[];
216
221
  }
222
+ /**
223
+ * A half-open validity window `[from, to)` in **unix seconds**
224
+ *
225
+ * On a {@link Policy}, evaluation outside the window denies every
226
+ * transaction. On a {@link Rule}, the rule is skipped entirely outside its
227
+ * window — neither allow nor deny — so an expired `deny` rule stops denying.
228
+ * Absent means always in force.
229
+ */
230
+ export declare class EffectiveTime {
231
+ /** Active from this unix second, inclusive. Absent = no lower bound. */
232
+ from?: number;
233
+ /** Active until this unix second, exclusive. Absent = no upper bound. */
234
+ to?: number;
235
+ constructor({ from, to }?: {
236
+ from?: number;
237
+ to?: number;
238
+ });
239
+ }
217
240
  /**
218
241
  * A rule contains conditions that must be satisfied
219
242
  */
@@ -232,6 +255,8 @@ export declare class Rule {
232
255
  conditions: ConditionOrGroup[];
233
256
  /** Optional external predicates evaluated after the local conditions pass. */
234
257
  external_checks?: ExternalCheckGroup;
258
+ /** Optional validity window. Outside it this rule is skipped entirely. */
259
+ effective_time?: EffectiveTime;
235
260
  /**
236
261
  * Creates a new Rule instance.
237
262
  *
@@ -242,9 +267,10 @@ export declare class Rule {
242
267
  * @param action - (Optional) The action to take if the rule is matched (Allow/Deny). Defaults to Allow.
243
268
  * @param logic - (Optional) The logic operator (AND/OR) to apply to the conditions. Defaults to AND.
244
269
  * @param external_checks - (Optional) External checks evaluated when the local conditions pass.
270
+ * @param effective_time - (Optional) Validity window for this rule.
245
271
  * @throws Will throw an error if no conditions are provided or chain_type is missing.
246
272
  */
247
- constructor({ description, chain_type, conditions, issuer, action, logic, external_checks, }: {
273
+ constructor({ description, chain_type, conditions, issuer, action, logic, external_checks, effective_time, }: {
248
274
  description: string;
249
275
  chain_type: ChainType;
250
276
  conditions: ConditionOrGroup[];
@@ -252,6 +278,7 @@ export declare class Rule {
252
278
  action?: Action;
253
279
  logic?: Logic;
254
280
  external_checks?: ExternalCheckGroup;
281
+ effective_time?: EffectiveTime;
255
282
  });
256
283
  }
257
284
  /**
@@ -264,18 +291,22 @@ export declare class Policy {
264
291
  description: string;
265
292
  /** Ordered list of rules to evaluate */
266
293
  rules: Rule[];
294
+ /** Optional validity window. Outside it every transaction is denied. */
295
+ effective_time?: EffectiveTime;
267
296
  /**
268
297
  * Creates a new Policy instance.
269
298
  *
270
299
  * @param version - The version of the policy schema. Defaults to '1.0'.
271
300
  * @param description - A human-readable description of the policy.
272
301
  * @param rules - An array of Rule objects that define the policy.
302
+ * @param effective_time - (Optional) Validity window for the policy.
273
303
  * @throws Will throw an error if no rules are provided.
274
304
  */
275
- constructor({ version, description, rules }: {
305
+ constructor({ version, description, rules, effective_time, }: {
276
306
  version: string;
277
307
  description: string;
278
308
  rules: Rule[];
309
+ effective_time?: EffectiveTime;
279
310
  });
280
311
  toCanonicalJSON(): string;
281
312
  }
@@ -287,13 +318,16 @@ export declare namespace StateControllerAggregationMethod {
287
318
  /** Whether this aggregation can be applied to a stateful condition's transaction attribute. */
288
319
  function supportsAttribute(method: StateControllerAggregationMethod, attr: string): boolean;
289
320
  }
290
- export type StateControllerFixedInterval = 'day' | 'week' | 'month';
321
+ export type StateControllerFixedInterval = 'minute' | 'hour' | 'day' | 'week' | 'month';
291
322
  export type StateControllerWindowConfig = {
292
323
  type: 'rolling';
293
- seconds: number;
294
- } | {
295
- type: 'fixed';
296
324
  interval: StateControllerFixedInterval;
325
+ /**
326
+ * Number of `interval` units in the rolling window, e.g.
327
+ * `{ interval: 'day', count: 3 }` is a rolling 3-day window.
328
+ * Must be a positive integer.
329
+ */
330
+ count: number;
297
331
  };
298
332
  export interface StateControllerPartitionField {
299
333
  transaction_type: TransactionType;
@@ -1,20 +1,28 @@
1
- /** RFC 6901 JSON Pointer allowlists for a provider request. */
1
+ /** Selects which fields may be disclosed to an external-check provider. */
2
2
  export interface PayloadProjection {
3
+ /** RFC 6901 JSON Pointers into the transaction; omission excludes this section. */
3
4
  transaction?: string[];
5
+ /** RFC 6901 JSON Pointers into the policy integration context; omission excludes this section. */
4
6
  context?: string[];
5
7
  }
6
- /** One operation exposed by a deployment-managed policy integration. */
8
+ /** A policy-selectable external-check operation; an integration may expose several. */
7
9
  export interface OperationCatalogEntry {
10
+ /** Operation name referenced by policy rules. */
8
11
  operation: string;
12
+ /** Human-readable description for policy authors. */
9
13
  description: string;
14
+ /** Fields permitted in requests for this operation. */
10
15
  payload_projection: PayloadProjection;
11
16
  }
12
- /** One integration available to policy authors. */
17
+ /** One provider integration and the operations it exposes to policy authors. */
13
18
  export interface IntegrationCatalogEntry {
19
+ /** Integration identifier referenced by policy rules. */
14
20
  integration_id: string;
21
+ /** Operations supported by this integration. */
15
22
  operations: OperationCatalogEntry[];
16
23
  }
17
- /** Public policy integration catalog returned by the wallet provider service. */
24
+ /** Policy-facing integration catalog; provider endpoints are omitted. */
18
25
  export interface IntegrationCatalogResponse {
26
+ /** Integrations available for policy external checks. */
19
27
  integrations: IntegrationCatalogEntry[];
20
28
  }
@@ -60,7 +60,7 @@ export declare class SignSetupOpts implements EoaAuthPayload {
60
60
  key_id: string;
61
61
  message: string;
62
62
  signAlg: string;
63
- policy_integration_context?: string;
63
+ policy_integration_context?: string | undefined;
64
64
  });
65
65
  get eoaRequestSchema(): {
66
66
  Request: {