@capxul/sdk 0.2.0-alpha.4 → 1.0.0-alpha.10

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 (47) hide show
  1. package/README.md +5 -308
  2. package/dist/InMemoryAuthCacheAdapter-v5W-XB5M.mjs +457 -0
  3. package/dist/InMemoryAuthCacheAdapter-v5W-XB5M.mjs.map +1 -0
  4. package/dist/index-CTXgQ_xR.d.mts +158 -0
  5. package/dist/index-CTXgQ_xR.d.mts.map +1 -0
  6. package/dist/index.d.mts +2574 -0
  7. package/dist/index.d.mts.map +1 -0
  8. package/dist/index.mjs +7974 -0
  9. package/dist/index.mjs.map +1 -0
  10. package/dist/node/index.d.mts +55 -0
  11. package/dist/node/index.d.mts.map +1 -0
  12. package/dist/node/index.mjs +158 -0
  13. package/dist/node/index.mjs.map +1 -0
  14. package/dist/ports/safe-deployment.d.mts +2 -0
  15. package/dist/ports/safe-deployment.mjs +38 -0
  16. package/dist/ports/safe-deployment.mjs.map +1 -0
  17. package/dist/safe-deployment-D3k9yndM.d.mts +136 -0
  18. package/dist/safe-deployment-D3k9yndM.d.mts.map +1 -0
  19. package/dist/signer-D9fUJp8o.d.mts +147 -0
  20. package/dist/signer-D9fUJp8o.d.mts.map +1 -0
  21. package/package.json +42 -71
  22. package/CHANGELOG.md +0 -274
  23. package/LICENSE +0 -44
  24. package/dist/client-CbUeJoM9.d.ts +0 -1335
  25. package/dist/client-UEm2oZbZ.d.cts +0 -1335
  26. package/dist/client.cjs +0 -4042
  27. package/dist/client.d.cts +0 -6
  28. package/dist/client.d.ts +0 -6
  29. package/dist/client.js +0 -4040
  30. package/dist/errors-CwhCWGxm.d.ts +0 -70
  31. package/dist/errors-rqxuUhQP.d.cts +0 -70
  32. package/dist/errors.cjs +0 -35
  33. package/dist/errors.d.cts +0 -2
  34. package/dist/errors.d.ts +0 -2
  35. package/dist/errors.js +0 -31
  36. package/dist/index.cjs +0 -4273
  37. package/dist/index.d.cts +0 -461
  38. package/dist/index.d.ts +0 -461
  39. package/dist/index.js +0 -4234
  40. package/dist/next-action-CTGl8wpy.d.cts +0 -177
  41. package/dist/next-action-CTGl8wpy.d.ts +0 -177
  42. package/dist/types-BD4VAQb5.d.ts +0 -1205
  43. package/dist/types-HlwCIjgQ.d.cts +0 -1205
  44. package/dist/webhooks.cjs +0 -118
  45. package/dist/webhooks.d.cts +0 -33
  46. package/dist/webhooks.d.ts +0 -33
  47. package/dist/webhooks.js +0 -116
@@ -1,70 +0,0 @@
1
- import { N as NextAction, O as OperationId, C as CorrelationId } from './next-action-CTGl8wpy.js';
2
-
3
- type CapxulErrorCode = "NOT_AUTHENTICATED" | "EMAIL_DELIVERY_FAILED" | "PROFILE_NOT_FOUND" | "SMART_ACCOUNT_MISSING" | "PLAYER_NOT_FOUND" | "ACCOUNT_NOT_FOUND" | "PROVIDER_ERROR" | "INVALID_INPUT" | "ENV_MISSING" | "NOT_IMPLEMENTED" | "VERIFICATION_REQUIRED" | "INSUFFICIENT_BALANCE" | "INVALID_RECIPIENT" | "TRANSACTION_FAILED" | "RATE_LIMITED" | "NETWORK_ERROR" | "UNKNOWN" | "PERMISSION_DENIED" | "API_KEY_INVALID" | "API_KEY_EXPIRED" | "IDEMPOTENCY_CONFLICT" | "NOT_FOUND" | "OPERATION_CANCELED" | "OPERATION_TIMEOUT" | "ACTION_REQUIRED" | "KYC_REQUIRED" | "POLICY_DENIED" | "SAFE_NOT_READY" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED" | "RECONCILIATION_FAILED" | "INTERNAL_ERROR" | "QUOTE_EXPIRED" | "QUOTE_NOT_FOUND";
4
- type CapxulErrorDetails = Record<string, unknown> & {
5
- nextAction?: NextAction;
6
- };
7
- type CapxulErrorEnvelope = {
8
- error: {
9
- code: CapxulErrorCode;
10
- message: string;
11
- operationId?: OperationId;
12
- correlationId?: CorrelationId;
13
- retryable?: boolean;
14
- details?: CapxulErrorDetails;
15
- };
16
- };
17
-
18
- /**
19
- * Unified error class surfaced by every SDK method.
20
- *
21
- * Parameterized on `Codes` so individual method signatures can narrow
22
- * to the subset of `CapxulErrorCode` they actually produce (per
23
- * CANON.md §4.39 + §4.44 + sdk-surface.md §3a). The default
24
- * `Codes = CapxulErrorCode` is the global catalog from
25
- * `@repo/platform-kernel` — 34 values aligned with the wire
26
- * `ErrorEnvelope.error.code` enum.
27
- */
28
- declare class CapxulError<Codes extends CapxulErrorCode = CapxulErrorCode> extends Error {
29
- readonly code: Codes;
30
- readonly details?: CapxulErrorDetails;
31
- readonly operationId?: OperationId;
32
- readonly correlationId?: CorrelationId;
33
- readonly retryable?: boolean;
34
- constructor(init: {
35
- code: Codes;
36
- message: string;
37
- cause?: unknown;
38
- details?: CapxulErrorDetails;
39
- operationId?: OperationId;
40
- correlationId?: CorrelationId;
41
- retryable?: boolean;
42
- });
43
- }
44
- /**
45
- * Direct tuple-return shape per CANON.md §4.39: every SDK mutation or
46
- * read returns `[null, value]` on success or `[CapxulError<Codes>, null]`
47
- * on failure. The tuple is `readonly` so callers can destructure
48
- * without worrying about mutation.
49
- */
50
- type CapxulResult<T, Codes extends CapxulErrorCode = CapxulErrorCode> = readonly [null, T] | readonly [CapxulError<Codes>, null];
51
- /**
52
- * Internal helper. Returns a concrete `CapxulError<"NOT_IMPLEMENTED">`
53
- * suitable for `throw` from non-tuple surfaces (e.g. `verifyWebhook`).
54
- */
55
- declare function notImplemented(method: string): CapxulError<"NOT_IMPLEMENTED">;
56
- /**
57
- * Scaffold-only stub helper for every tuple-return SDK method. Returns
58
- * the failed tuple `[CapxulError<Codes>, null]` carrying a
59
- * `NOT_IMPLEMENTED` error.
60
- *
61
- * The `as CapxulError<Codes>` cast is intentionally unsound: runtime
62
- * `code` is `"NOT_IMPLEMENTED"` even though the method's narrowed
63
- * `Codes` union may not list it. This goes away in Slice F when real
64
- * HTTP bodies replace every call site. Until then, callers shouldn't
65
- * switch on the runtime `code` inside tests — the scaffold's contract
66
- * is strictly type-level.
67
- */
68
- declare function stub<T, Codes extends CapxulErrorCode = CapxulErrorCode>(method: string): CapxulResult<T, Codes>;
69
-
70
- export { CapxulError as C, type CapxulErrorCode as a, type CapxulErrorDetails as b, type CapxulErrorEnvelope as c, type CapxulResult as d, notImplemented as n, stub as s };
@@ -1,70 +0,0 @@
1
- import { N as NextAction, O as OperationId, C as CorrelationId } from './next-action-CTGl8wpy.cjs';
2
-
3
- type CapxulErrorCode = "NOT_AUTHENTICATED" | "EMAIL_DELIVERY_FAILED" | "PROFILE_NOT_FOUND" | "SMART_ACCOUNT_MISSING" | "PLAYER_NOT_FOUND" | "ACCOUNT_NOT_FOUND" | "PROVIDER_ERROR" | "INVALID_INPUT" | "ENV_MISSING" | "NOT_IMPLEMENTED" | "VERIFICATION_REQUIRED" | "INSUFFICIENT_BALANCE" | "INVALID_RECIPIENT" | "TRANSACTION_FAILED" | "RATE_LIMITED" | "NETWORK_ERROR" | "UNKNOWN" | "PERMISSION_DENIED" | "API_KEY_INVALID" | "API_KEY_EXPIRED" | "IDEMPOTENCY_CONFLICT" | "NOT_FOUND" | "OPERATION_CANCELED" | "OPERATION_TIMEOUT" | "ACTION_REQUIRED" | "KYC_REQUIRED" | "POLICY_DENIED" | "SAFE_NOT_READY" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED" | "RECONCILIATION_FAILED" | "INTERNAL_ERROR" | "QUOTE_EXPIRED" | "QUOTE_NOT_FOUND";
4
- type CapxulErrorDetails = Record<string, unknown> & {
5
- nextAction?: NextAction;
6
- };
7
- type CapxulErrorEnvelope = {
8
- error: {
9
- code: CapxulErrorCode;
10
- message: string;
11
- operationId?: OperationId;
12
- correlationId?: CorrelationId;
13
- retryable?: boolean;
14
- details?: CapxulErrorDetails;
15
- };
16
- };
17
-
18
- /**
19
- * Unified error class surfaced by every SDK method.
20
- *
21
- * Parameterized on `Codes` so individual method signatures can narrow
22
- * to the subset of `CapxulErrorCode` they actually produce (per
23
- * CANON.md §4.39 + §4.44 + sdk-surface.md §3a). The default
24
- * `Codes = CapxulErrorCode` is the global catalog from
25
- * `@repo/platform-kernel` — 34 values aligned with the wire
26
- * `ErrorEnvelope.error.code` enum.
27
- */
28
- declare class CapxulError<Codes extends CapxulErrorCode = CapxulErrorCode> extends Error {
29
- readonly code: Codes;
30
- readonly details?: CapxulErrorDetails;
31
- readonly operationId?: OperationId;
32
- readonly correlationId?: CorrelationId;
33
- readonly retryable?: boolean;
34
- constructor(init: {
35
- code: Codes;
36
- message: string;
37
- cause?: unknown;
38
- details?: CapxulErrorDetails;
39
- operationId?: OperationId;
40
- correlationId?: CorrelationId;
41
- retryable?: boolean;
42
- });
43
- }
44
- /**
45
- * Direct tuple-return shape per CANON.md §4.39: every SDK mutation or
46
- * read returns `[null, value]` on success or `[CapxulError<Codes>, null]`
47
- * on failure. The tuple is `readonly` so callers can destructure
48
- * without worrying about mutation.
49
- */
50
- type CapxulResult<T, Codes extends CapxulErrorCode = CapxulErrorCode> = readonly [null, T] | readonly [CapxulError<Codes>, null];
51
- /**
52
- * Internal helper. Returns a concrete `CapxulError<"NOT_IMPLEMENTED">`
53
- * suitable for `throw` from non-tuple surfaces (e.g. `verifyWebhook`).
54
- */
55
- declare function notImplemented(method: string): CapxulError<"NOT_IMPLEMENTED">;
56
- /**
57
- * Scaffold-only stub helper for every tuple-return SDK method. Returns
58
- * the failed tuple `[CapxulError<Codes>, null]` carrying a
59
- * `NOT_IMPLEMENTED` error.
60
- *
61
- * The `as CapxulError<Codes>` cast is intentionally unsound: runtime
62
- * `code` is `"NOT_IMPLEMENTED"` even though the method's narrowed
63
- * `Codes` union may not list it. This goes away in Slice F when real
64
- * HTTP bodies replace every call site. Until then, callers shouldn't
65
- * switch on the runtime `code` inside tests — the scaffold's contract
66
- * is strictly type-level.
67
- */
68
- declare function stub<T, Codes extends CapxulErrorCode = CapxulErrorCode>(method: string): CapxulResult<T, Codes>;
69
-
70
- export { CapxulError as C, type CapxulErrorCode as a, type CapxulErrorDetails as b, type CapxulErrorEnvelope as c, type CapxulResult as d, notImplemented as n, stub as s };
package/dist/errors.cjs DELETED
@@ -1,35 +0,0 @@
1
- 'use strict';
2
-
3
- // src/errors.ts
4
- var CapxulError = class extends Error {
5
- code;
6
- details;
7
- operationId;
8
- correlationId;
9
- retryable;
10
- constructor(init) {
11
- super(
12
- init.message,
13
- init.cause !== void 0 ? { cause: init.cause } : void 0
14
- );
15
- this.name = "CapxulError";
16
- this.code = init.code;
17
- this.details = init.details;
18
- this.operationId = init.operationId;
19
- this.correlationId = init.correlationId;
20
- this.retryable = init.retryable;
21
- }
22
- };
23
- function notImplemented(method) {
24
- return new CapxulError({
25
- code: "NOT_IMPLEMENTED",
26
- message: `${method} is not yet implemented in @capxul/sdk (Slice C scaffold).`
27
- });
28
- }
29
- function stub(method) {
30
- return [notImplemented(method), null];
31
- }
32
-
33
- exports.CapxulError = CapxulError;
34
- exports.notImplemented = notImplemented;
35
- exports.stub = stub;
package/dist/errors.d.cts DELETED
@@ -1,2 +0,0 @@
1
- import './next-action-CTGl8wpy.cjs';
2
- export { C as CapxulError, d as CapxulResult, n as notImplemented, s as stub } from './errors-rqxuUhQP.cjs';
package/dist/errors.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import './next-action-CTGl8wpy.js';
2
- export { C as CapxulError, d as CapxulResult, n as notImplemented, s as stub } from './errors-CwhCWGxm.js';
package/dist/errors.js DELETED
@@ -1,31 +0,0 @@
1
- // src/errors.ts
2
- var CapxulError = class extends Error {
3
- code;
4
- details;
5
- operationId;
6
- correlationId;
7
- retryable;
8
- constructor(init) {
9
- super(
10
- init.message,
11
- init.cause !== void 0 ? { cause: init.cause } : void 0
12
- );
13
- this.name = "CapxulError";
14
- this.code = init.code;
15
- this.details = init.details;
16
- this.operationId = init.operationId;
17
- this.correlationId = init.correlationId;
18
- this.retryable = init.retryable;
19
- }
20
- };
21
- function notImplemented(method) {
22
- return new CapxulError({
23
- code: "NOT_IMPLEMENTED",
24
- message: `${method} is not yet implemented in @capxul/sdk (Slice C scaffold).`
25
- });
26
- }
27
- function stub(method) {
28
- return [notImplemented(method), null];
29
- }
30
-
31
- export { CapxulError, notImplemented, stub };