@capxul/sandbox 4.20.0-beta.28 → 4.20.0-beta.29

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 (2) hide show
  1. package/dist/main.mjs +61 -4
  2. package/package.json +4 -4
package/dist/main.mjs CHANGED
@@ -16086,7 +16086,9 @@ const OrganizationPaymentExecutionItemSchema = Struct({
16086
16086
  "invoice",
16087
16087
  "payroll",
16088
16088
  "reimbursement"
16089
- ]))
16089
+ ])),
16090
+ /** When the recipient gets it: instant (the default), or held until a date or over a period. */
16091
+ timing: optional(PaymentTiming)
16090
16092
  }).check(makeFilter((value) => is(PaymentDocumentOptionsSchema)(value)));
16091
16093
  const PrepareOrganizationPaymentExecutionInputSchema = Struct({
16092
16094
  orgId: nonEmpty("orgId"),
@@ -16196,11 +16198,20 @@ const PreparedPaymentCommandExecutionSchema = Struct({
16196
16198
  //#region ../../packages/protocol/src/accounts/approval-schema.ts
16197
16199
  const APPROVAL_ID_RE = /^approval_[0-9A-HJKMNP-TV-Z]{26}$/u;
16198
16200
  const ApprovalIdSchema = String$1.pipe(refine((value) => APPROVAL_ID_RE.test(value), { message: "must be approval_ plus a ULID" }));
16199
- /** What is being approved. */
16201
+ /**
16202
+ * What is being approved. A `permission_change` creates, changes, assigns,
16203
+ * revokes or replaces an Organization's Permissions; an `invitation` sets up
16204
+ * the rights an invitation offers. Neither moves money. A `payment_cancel`
16205
+ * returns a held Payment to whoever funded it; a `payment_redirect` sends it
16206
+ * to someone else.
16207
+ */
16200
16208
  const APPROVAL_KINDS = [
16201
16209
  "payment",
16202
16210
  "payroll_run",
16211
+ "payment_cancel",
16212
+ "payment_redirect",
16203
16213
  "permission_change",
16214
+ "invitation",
16204
16215
  "bank_payout"
16205
16216
  ];
16206
16217
  /**
@@ -16424,8 +16435,7 @@ const approvals = {
16424
16435
  errors: [
16425
16436
  ...CALL$10,
16426
16437
  ...DEFECTS,
16427
- "WRONG_STATE",
16428
- "NOT_IMPLEMENTED"
16438
+ "WRONG_STATE"
16429
16439
  ]
16430
16440
  }),
16431
16441
  /** The approval as the person reads it, with its state judged against its expiry. */
@@ -17007,6 +17017,15 @@ const PermissionSchema = Struct({
17007
17017
  limitRaw: optional(WeiAmountSchema$1),
17008
17018
  allowanceKey: optional(AllowanceKeySchema)
17009
17019
  });
17020
+ /**
17021
+ * A refilling Budget's refill (#2439): how much each one adds, every how many
17022
+ * days, and when the next one is due.
17023
+ */
17024
+ const BudgetNextRefillSchema = Struct({
17025
+ amount: AssetAmountSchema,
17026
+ everyDays: Finite,
17027
+ nextAt: EpochMsSchema$1
17028
+ });
17010
17029
  const PermissionAssignmentSchema = Struct({
17011
17030
  permissionAssignmentId: PermissionAssignmentIdSchema,
17012
17031
  permissionId: PermissionIdSchema,
@@ -19832,6 +19851,30 @@ const authorities = {
19832
19851
  "ROLE_PERMISSION_DENIED"
19833
19852
  ]
19834
19853
  }),
19854
+ /**
19855
+ * What one active Budget can still spend now: its Roles allowance, read on
19856
+ * chain at the latest block as the payment gate reads it. `left` is null for
19857
+ * a Budget with no allowance (no cap). `refill` names a refilling Budget's
19858
+ * refill and when the next one is due; null for a one-off or uncapped Budget
19859
+ * (#2439). For a participant of the Organization.
19860
+ */
19861
+ budgetLeft: Operation.action("permissions.authorities.budgetLeft", {
19862
+ input: Struct({
19863
+ orgId: OrgId,
19864
+ budgetId: PermissionIdSchema
19865
+ }),
19866
+ output: Struct({
19867
+ budgetId: PermissionIdSchema,
19868
+ left: NullOr(AssetAmountSchema),
19869
+ refill: optionalKey(NullOr(BudgetNextRefillSchema))
19870
+ }),
19871
+ errors: [
19872
+ ...CALL$2,
19873
+ ...DEFECTS,
19874
+ ...CHAIN$1,
19875
+ "ROLE_PERMISSION_DENIED"
19876
+ ]
19877
+ }),
19835
19878
  /** Whether the caller's Account may spend this amount from this Budget right now. */
19836
19879
  authorize: Operation.query("permissions.authorities.authorize", {
19837
19880
  input: MoneyAuthorizationRequestSchema,
@@ -20722,6 +20765,7 @@ const ORGANIZATION_OPERATIONS = {
20722
20765
  payment: "org.payment",
20723
20766
  permissions: {
20724
20767
  assign: "org.permissions.assign",
20768
+ budgetLeft: "org.permissions.budgetLeft",
20725
20769
  change: "org.permissions.change",
20726
20770
  create: "org.permissions.create",
20727
20771
  get: "org.permissions.get",
@@ -20968,6 +21012,9 @@ emitChanged: "payroll.groups.emitChanged" }
20968
21012
  },
20969
21013
  /** Permissions' internal functions; its public rows join from `OPERATIONS`. */
20970
21014
  permissions: {
21015
+ authorities: {
21016
+ /** The Budget-left read's participant check and the Budget's stored allowance. */
21017
+ loadBudgetLeft: "permissions.authorities.loadBudgetLeft" },
20971
21018
  commands: {
20972
21019
  /** The prepare action's transaction: authorize, plan and save the command. */
20973
21020
  prepareIntent: "permissions.commands.prepareIntent",
@@ -22129,6 +22176,14 @@ Struct({
22129
22176
  account_kind: optional(AccountKindSchema)
22130
22177
  })
22131
22178
  });
22179
+ Struct({
22180
+ name: Literal("ui_approval_sign_in_required"),
22181
+ props: Struct({
22182
+ ...TelemetryEnvelopeProps,
22183
+ approval_id: String$1,
22184
+ reason: Literals(["signed_out", "wrong_account"])
22185
+ })
22186
+ });
22132
22187
  Struct({
22133
22188
  name: Literal("payroll_group_changed"),
22134
22189
  props: Struct({
@@ -22384,6 +22439,8 @@ const CLI_COMMAND_NAMES = [
22384
22439
  "payment.get",
22385
22440
  "payment.wait",
22386
22441
  "payment.retry",
22442
+ "payment.cancel",
22443
+ "payment.redirect",
22387
22444
  "inbox",
22388
22445
  CAPXUL_OPERATIONS.inbox.list,
22389
22446
  "inbox.get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sandbox",
3
- "version": "4.20.0-beta.28",
3
+ "version": "4.20.0-beta.29",
4
4
  "private": false,
5
5
  "description": "Capxul sandbox CLI for canonical quickstart keys and testnet faucet funds.",
6
6
  "keywords": [
@@ -42,9 +42,9 @@
42
42
  "typescript": "npm:@typescript/typescript6@6.0.2",
43
43
  "vite": "npm:@voidzero-dev/vite-plus-core@1.0.0",
44
44
  "vite-plus": "1.0.0",
45
- "@capxul/observability": "4.20.0-beta.28",
46
- "@capxul/protocol": "0.2.0-beta.2",
47
- "@capxul/sdk": "4.20.0-beta.28",
45
+ "@capxul/observability": "4.20.0-beta.29",
46
+ "@capxul/protocol": "0.2.0-beta.3",
47
+ "@capxul/sdk": "4.20.0-beta.29",
48
48
  "@capxul/typescript-config": "0.0.0"
49
49
  },
50
50
  "scripts": {