@capxul/sdk 0.1.0-alpha.3 → 0.1.0-alpha.6

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.
@@ -1,5 +1,5 @@
1
1
  import * as types from '@repo/api-contract/gen/types';
2
- import { Y as PublicId, A as AccountId, S as SafeId, d as OrganizationId, c as KycProfileId, b as ExternalAccountId, f as SubAccountId, B as BalanceLedgerEntryId, a as ApiKeyId, h as TreasuryId, M as MemberId, K as KybProfileId, N as NextAction, P as PaymentId, g as TransferId, k as WithdrawalId, D as DocumentId, W as WebhookEndpointId, j as WebhookEventId, V as VirtualAccountId, i as VirtualCardId, O as OperationId, C as CorrelationId } from './next-action-DkrwXYay.js';
2
+ import { Y as PublicId, A as AccountId, S as SafeId, d as OrganizationId, c as KycProfileId, b as ExternalAccountId, O as OperationId, C as CorrelationId, f as SubAccountId, B as BalanceLedgerEntryId, a as ApiKeyId, h as TreasuryId, M as MemberId, K as KybProfileId, N as NextAction, P as PaymentId, g as TransferId, k as WithdrawalId, D as DocumentId, W as WebhookEndpointId, j as WebhookEventId, V as VirtualAccountId, i as VirtualCardId } from './next-action-DkrwXYay.js';
3
3
 
4
4
  /**
5
5
  * SDK surface types.
@@ -131,7 +131,18 @@ type Treasury = Rebrand<types.Treasury, TreasuryId> & {
131
131
  };
132
132
  type KycProfile = Rebrand<types.KycProfile, KycProfileId>;
133
133
  type KybProfile = Rebrand<types.KybProfile, KybProfileId>;
134
- type ExternalAccount = Rebrand<types.ExternalAccount, ExternalAccountId>;
134
+ /**
135
+ * Trust-chain operation summary is sourced from the wire's nested
136
+ * `operation: OperationSummary` field (see resources.mdx §canonical
137
+ * operation envelope). The wire surfaces `correlationId` as a plain
138
+ * string; we override the nested field with the kernel-branded SDK
139
+ * `OperationSummary` so callers get `CorrelationId` / `OperationId`
140
+ * brands. Required at the resource boundary (matches Withdrawal /
141
+ * Payment / Transfer / Organization).
142
+ */
143
+ type ExternalAccount = Override<Rebrand<types.ExternalAccount, ExternalAccountId>, {
144
+ readonly operation: OperationSummary;
145
+ }>;
135
146
  type ExternalAccountKind = types.ExternalAccountKind;
136
147
  type PageInfo = types.PageInfo;
137
148
  type List<T> = {
@@ -155,7 +166,15 @@ type Payment = WithStatus<WirePaymentWithBrand, PaymentStatus>;
155
166
  type CreatePaymentResult = WithStatus<WirePaymentWithBrand, "processing" | "action_required" | "failed">;
156
167
  type PaymentParty = types.PaymentParty;
157
168
  type WireWithdrawalWithBrand = Rebrand<types.Withdrawal, WithdrawalId>;
158
- type WithdrawalStatus = PaymentStatus;
169
+ /**
170
+ * Canon-aligned superset (resources.mdx §withdrawal lifecycle note).
171
+ * Wider than `OperationStatus` because `submitted → completed` is a
172
+ * withdrawal-specific transition driven by external reconciliation
173
+ * the operation envelope cannot witness directly. Slice 1 of
174
+ * Withdrawals v1 (#440) widened this from `PaymentStatus` to match
175
+ * canon.
176
+ */
177
+ type WithdrawalStatus = "draft" | "action_required" | "processing" | "submitted" | "completed" | "failed" | "canceled";
159
178
  type Withdrawal = WithStatus<WireWithdrawalWithBrand, WithdrawalStatus>;
160
179
  type CreateWithdrawalResult = WithStatus<WireWithdrawalWithBrand, "processing" | "action_required" | "failed">;
161
180
  type WireTransferWithBrand = Rebrand<types.Transfer, TransferId>;
@@ -1,5 +1,5 @@
1
1
  import * as types from '@repo/api-contract/gen/types';
2
- import { Y as PublicId, A as AccountId, S as SafeId, d as OrganizationId, c as KycProfileId, b as ExternalAccountId, f as SubAccountId, B as BalanceLedgerEntryId, a as ApiKeyId, h as TreasuryId, M as MemberId, K as KybProfileId, N as NextAction, P as PaymentId, g as TransferId, k as WithdrawalId, D as DocumentId, W as WebhookEndpointId, j as WebhookEventId, V as VirtualAccountId, i as VirtualCardId, O as OperationId, C as CorrelationId } from './next-action-DkrwXYay.cjs';
2
+ import { Y as PublicId, A as AccountId, S as SafeId, d as OrganizationId, c as KycProfileId, b as ExternalAccountId, O as OperationId, C as CorrelationId, f as SubAccountId, B as BalanceLedgerEntryId, a as ApiKeyId, h as TreasuryId, M as MemberId, K as KybProfileId, N as NextAction, P as PaymentId, g as TransferId, k as WithdrawalId, D as DocumentId, W as WebhookEndpointId, j as WebhookEventId, V as VirtualAccountId, i as VirtualCardId } from './next-action-DkrwXYay.cjs';
3
3
 
4
4
  /**
5
5
  * SDK surface types.
@@ -131,7 +131,18 @@ type Treasury = Rebrand<types.Treasury, TreasuryId> & {
131
131
  };
132
132
  type KycProfile = Rebrand<types.KycProfile, KycProfileId>;
133
133
  type KybProfile = Rebrand<types.KybProfile, KybProfileId>;
134
- type ExternalAccount = Rebrand<types.ExternalAccount, ExternalAccountId>;
134
+ /**
135
+ * Trust-chain operation summary is sourced from the wire's nested
136
+ * `operation: OperationSummary` field (see resources.mdx §canonical
137
+ * operation envelope). The wire surfaces `correlationId` as a plain
138
+ * string; we override the nested field with the kernel-branded SDK
139
+ * `OperationSummary` so callers get `CorrelationId` / `OperationId`
140
+ * brands. Required at the resource boundary (matches Withdrawal /
141
+ * Payment / Transfer / Organization).
142
+ */
143
+ type ExternalAccount = Override<Rebrand<types.ExternalAccount, ExternalAccountId>, {
144
+ readonly operation: OperationSummary;
145
+ }>;
135
146
  type ExternalAccountKind = types.ExternalAccountKind;
136
147
  type PageInfo = types.PageInfo;
137
148
  type List<T> = {
@@ -155,7 +166,15 @@ type Payment = WithStatus<WirePaymentWithBrand, PaymentStatus>;
155
166
  type CreatePaymentResult = WithStatus<WirePaymentWithBrand, "processing" | "action_required" | "failed">;
156
167
  type PaymentParty = types.PaymentParty;
157
168
  type WireWithdrawalWithBrand = Rebrand<types.Withdrawal, WithdrawalId>;
158
- type WithdrawalStatus = PaymentStatus;
169
+ /**
170
+ * Canon-aligned superset (resources.mdx §withdrawal lifecycle note).
171
+ * Wider than `OperationStatus` because `submitted → completed` is a
172
+ * withdrawal-specific transition driven by external reconciliation
173
+ * the operation envelope cannot witness directly. Slice 1 of
174
+ * Withdrawals v1 (#440) widened this from `PaymentStatus` to match
175
+ * canon.
176
+ */
177
+ type WithdrawalStatus = "draft" | "action_required" | "processing" | "submitted" | "completed" | "failed" | "canceled";
159
178
  type Withdrawal = WithStatus<WireWithdrawalWithBrand, WithdrawalStatus>;
160
179
  type CreateWithdrawalResult = WithStatus<WireWithdrawalWithBrand, "processing" | "action_required" | "failed">;
161
180
  type WireTransferWithBrand = Rebrand<types.Transfer, TransferId>;
@@ -1,4 +1,4 @@
1
- import { Z as WebhookEvent } from './types-z4VLz9rS.cjs';
1
+ import { Z as WebhookEvent } from './types-X02RbQ2u.cjs';
2
2
  import '@repo/api-contract/gen/types';
3
3
  import './next-action-DkrwXYay.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Z as WebhookEvent } from './types-BE3tVIOI.js';
1
+ import { Z as WebhookEvent } from './types-CYvLP5pP.js';
2
2
  import '@repo/api-contract/gen/types';
3
3
  import './next-action-DkrwXYay.js';
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sdk",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.6",
4
4
  "description": "Headless TypeScript client for Capxul's /v1/* HTTP contract.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -71,10 +71,10 @@
71
71
  "vitest": "^4.1.2",
72
72
  "zod": "^4.3.6",
73
73
  "@repo/api-contract": "0.0.0",
74
- "@repo/config": "0.0.0",
75
74
  "@repo/backend": "0.0.0",
76
75
  "@repo/observability": "0.0.0",
77
76
  "@repo/platform-kernel": "0.0.0",
77
+ "@repo/config": "0.0.0",
78
78
  "@repo/typescript-config": "0.0.0"
79
79
  },
80
80
  "scripts": {