@settlemint/dalp-sdk 3.1.25 → 3.1.26-main.37113215468

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 (123) hide show
  1. package/README.md +239 -172
  2. package/dist/auth/client.d.ts +103 -0
  3. package/dist/auth/invite-step-up.d.ts +2 -0
  4. package/dist/auth/live.d.ts +47 -0
  5. package/dist/auth/native-passkey.d.ts +9 -0
  6. package/dist/{auth-permissions.d.ts → auth/permissions.d.ts} +0 -8
  7. package/dist/{auth-wallet-plugins.d.ts → auth/wallet-plugins.d.ts} +68 -6
  8. package/dist/auth-surface.d.ts +2 -0
  9. package/dist/auth.d.ts +8 -115
  10. package/dist/auth.js +525 -0
  11. package/dist/chunk-16xvy8xj.js +271 -0
  12. package/dist/chunk-4f4kjtt0.js +149 -0
  13. package/dist/chunk-b03ycwb7.js +68 -0
  14. package/dist/chunk-ghgcmyhk.js +5 -0
  15. package/dist/chunk-h241xecg.js +1625 -0
  16. package/dist/chunk-hqz56e6q.js +4 -0
  17. package/dist/chunk-k3ntysxx.js +57 -0
  18. package/dist/chunk-pjjrxre1.js +36 -0
  19. package/dist/chunk-qvtjb3dz.js +102 -0
  20. package/dist/chunk-w361dpdk.js +5 -0
  21. package/dist/client/conditional-request.d.ts +8 -0
  22. package/dist/client/factory.d.ts +4 -0
  23. package/dist/client/query-serializer.d.ts +1 -0
  24. package/dist/client/request-compression.d.ts +12 -0
  25. package/dist/client/ssr-fetch.d.ts +10 -0
  26. package/dist/client/step-up-challenge.d.ts +10 -0
  27. package/dist/effect.d.ts +38 -0
  28. package/dist/effect.js +87 -0
  29. package/dist/errors/api-error.d.ts +35 -0
  30. package/dist/errors/error-codes.d.ts +21 -0
  31. package/dist/errors/find-current-error.d.ts +2 -0
  32. package/dist/errors/sdk-error.d.ts +52 -0
  33. package/dist/errors/sdk-error.js +8 -0
  34. package/dist/generated/api-types.d.ts +69961 -0
  35. package/dist/generated/console-routes.d.ts +12 -0
  36. package/dist/generated/error-catalog.d.ts +9 -0
  37. package/dist/generated/error-codes.d.ts +9 -0
  38. package/dist/generated/response-scalars.d.ts +9 -0
  39. package/dist/generated/response-schemas.d.ts +9 -0
  40. package/dist/generated/route-error-codes.d.ts +9 -0
  41. package/dist/generated/routes.d.ts +12 -0
  42. package/dist/index.d.ts +28 -45
  43. package/dist/index.js +150 -96216
  44. package/dist/proxy/builder.d.ts +17 -0
  45. package/dist/proxy/client-core.d.ts +28 -0
  46. package/dist/proxy/client.d.ts +5 -0
  47. package/dist/proxy/fetch-executor.d.ts +6 -0
  48. package/dist/proxy/flat-args.d.ts +24 -0
  49. package/dist/proxy/response-decode.d.ts +37 -0
  50. package/dist/proxy/sse.d.ts +11 -0
  51. package/dist/proxy/step-up-challenge.d.ts +4 -0
  52. package/dist/proxy/tanstack.d.ts +6 -0
  53. package/dist/proxy/transport.d.ts +63 -0
  54. package/dist/react-query.d.ts +2 -0
  55. package/dist/react-query.js +12 -0
  56. package/dist/readonly-deep.d.ts +3 -0
  57. package/dist/routes/console.d.ts +14 -0
  58. package/dist/routes/console.js +25 -0
  59. package/dist/routes/index.d.ts +4 -0
  60. package/dist/routes/index.js +10 -0
  61. package/dist/routes/types.d.ts +72 -0
  62. package/dist/runtime-exports.d.ts +4 -0
  63. package/dist/runtime-exports.js +16 -0
  64. package/dist/runtime.d.ts +11 -0
  65. package/dist/scalars/big-decimal.d.ts +4 -0
  66. package/dist/scalars/ethereum-address.d.ts +5 -0
  67. package/dist/scalars/exchange-rates.d.ts +13 -0
  68. package/dist/scalars/index.d.ts +10 -0
  69. package/dist/scalars/index.js +102 -0
  70. package/dist/scalars/organization-id.d.ts +5 -0
  71. package/dist/scalars/token-decimals.d.ts +4 -0
  72. package/dist/secret.d.ts +12 -0
  73. package/dist/sign-webhook-receipt.d.ts +16 -0
  74. package/dist/sign-webhook-receipt.js +26 -0
  75. package/dist/transport/cookie-store.d.ts +9 -0
  76. package/dist/transport/sse-lifecycle.d.ts +24 -0
  77. package/dist/types.d.ts +37 -114
  78. package/dist/url.d.ts +0 -1
  79. package/dist/verify-webhook.d.ts +17 -28
  80. package/dist/verify-webhook.js +8 -0
  81. package/dist/version.d.ts +0 -3
  82. package/dist/wait-for-transaction.d.ts +44 -86
  83. package/dist/wait-for-transaction.js +151 -0
  84. package/dist/webhook-events.d.ts +543 -33
  85. package/package.json +110 -34
  86. package/dist/api-types.generated.d.ts +0 -14160
  87. package/dist/api-types.generated.d.ts.map +0 -1
  88. package/dist/auth-permissions.d.ts.map +0 -1
  89. package/dist/auth-wallet-plugins.d.ts.map +0 -1
  90. package/dist/auth.d.ts.map +0 -1
  91. package/dist/bundler.d.ts +0 -217
  92. package/dist/bundler.d.ts.map +0 -1
  93. package/dist/chunk-xm8h1dzh.js +0 -33
  94. package/dist/client.d.ts +0 -19
  95. package/dist/client.d.ts.map +0 -1
  96. package/dist/contract-errors.d.ts +0 -4156
  97. package/dist/contract-errors.d.ts.map +0 -1
  98. package/dist/contract.d.ts +0 -22
  99. package/dist/contract.d.ts.map +0 -1
  100. package/dist/cookie-store.d.ts +0 -10
  101. package/dist/cookie-store.d.ts.map +0 -1
  102. package/dist/dapi-errors.d.ts +0 -654
  103. package/dist/dapi-errors.d.ts.map +0 -1
  104. package/dist/errors.d.ts +0 -637
  105. package/dist/errors.d.ts.map +0 -1
  106. package/dist/index.d.ts.map +0 -1
  107. package/dist/platform.d.ts +0 -41
  108. package/dist/platform.d.ts.map +0 -1
  109. package/dist/plugins/index.d.ts +0 -13
  110. package/dist/plugins/index.d.ts.map +0 -1
  111. package/dist/plugins/index.js +0 -10
  112. package/dist/sdk-error.d.ts +0 -74
  113. package/dist/sdk-error.d.ts.map +0 -1
  114. package/dist/serializers.d.ts +0 -41
  115. package/dist/serializers.d.ts.map +0 -1
  116. package/dist/types.d.ts.map +0 -1
  117. package/dist/url.d.ts.map +0 -1
  118. package/dist/verify-webhook.d.ts.map +0 -1
  119. package/dist/version.d.ts.map +0 -1
  120. package/dist/version.generated.d.ts +0 -8
  121. package/dist/version.generated.d.ts.map +0 -1
  122. package/dist/wait-for-transaction.d.ts.map +0 -1
  123. package/dist/webhook-events.d.ts.map +0 -1
@@ -1,3 +1,68 @@
1
+ import type { DalpAuthResult } from "./client.ts";
2
+ export type WalletAuthOperation<TInput, TData> = (input: TInput, options?: unknown) => Promise<DalpAuthResult<TData>>;
3
+ export interface DalpWalletAuthClient {
4
+ readonly wallet: {
5
+ readonly pincode: {
6
+ readonly enable: WalletAuthOperation<{
7
+ readonly pincode: string;
8
+ readonly password?: string;
9
+ }, {
10
+ readonly success: boolean;
11
+ }>;
12
+ readonly update: WalletAuthOperation<{
13
+ readonly newPincode: string;
14
+ readonly password: string;
15
+ }, {
16
+ readonly success: boolean;
17
+ }>;
18
+ readonly disable: WalletAuthOperation<{
19
+ readonly password: string;
20
+ }, {
21
+ readonly success: boolean;
22
+ }>;
23
+ readonly reset: WalletAuthOperation<{
24
+ readonly newPincode: string;
25
+ readonly recoveryCode: string;
26
+ }, {
27
+ readonly success: boolean;
28
+ readonly recoveryCodes?: ReadonlyArray<string>;
29
+ }>;
30
+ };
31
+ readonly twoFactor: {
32
+ readonly enable: WalletAuthOperation<{
33
+ readonly issuer?: string;
34
+ readonly password?: string;
35
+ }, {
36
+ readonly totpURI: string;
37
+ }>;
38
+ readonly verify: WalletAuthOperation<{
39
+ readonly code: string;
40
+ }, {
41
+ readonly status: boolean;
42
+ }>;
43
+ readonly disable: WalletAuthOperation<{
44
+ readonly password: string;
45
+ }, {
46
+ readonly status: boolean;
47
+ }>;
48
+ };
49
+ readonly secretCodes: {
50
+ readonly generate: WalletAuthOperation<{
51
+ readonly password?: string;
52
+ }, {
53
+ readonly rotated: boolean;
54
+ readonly secretCodes: ReadonlyArray<string>;
55
+ readonly verificationId: string;
56
+ }>;
57
+ readonly confirm: WalletAuthOperation<{
58
+ readonly stored: boolean;
59
+ readonly verificationId: string;
60
+ }, {
61
+ readonly success: boolean;
62
+ }>;
63
+ };
64
+ };
65
+ }
1
66
  export declare const walletPincodeClient: () => {
2
67
  id: "wallet-pincode";
3
68
  $InferServerPlugin: {
@@ -78,9 +143,6 @@ export declare const walletSecretCodesClient: () => {
78
143
  signal: "$sessionSignal";
79
144
  }[];
80
145
  };
81
- type StripLeadingSlash<T extends string> = T extends `/${infer Rest}` ? Rest : never;
82
- type WalletPluginPathMethodKeys = keyof ReturnType<typeof walletPincodeClient>["pathMethods"] | keyof ReturnType<typeof walletTwoFactorClient>["pathMethods"] | keyof ReturnType<typeof walletSecretCodesClient>["pathMethods"];
83
- /** CLI coverage keys for DALP wallet Better Auth plugin endpoints (no leading slash). */
84
- export type WalletAuthEndpointPath = StripLeadingSlash<WalletPluginPathMethodKeys & string>;
85
- export {};
86
- //# sourceMappingURL=auth-wallet-plugins.d.ts.map
146
+ export type StripLeadingSlash<T extends string> = T extends `/${infer Rest}` ? Rest : never;
147
+ export type WalletPluginPathMethodKeys = keyof ReturnType<typeof walletPincodeClient>["pathMethods"] | keyof ReturnType<typeof walletTwoFactorClient>["pathMethods"] | keyof ReturnType<typeof walletSecretCodesClient>["pathMethods"];
148
+ export type WalletAuthEndpointPath = StripLeadingSlash<WalletPluginPathMethodKeys>;
@@ -0,0 +1,2 @@
1
+ export type DalpAuthSurface = "console" | "portal";
2
+ export declare const DALP_AUTH_SURFACE_HEADER = "X-Dalp-Auth-Surface";
package/dist/auth.d.ts CHANGED
@@ -1,115 +1,8 @@
1
- import { DalpCookieStore } from "./cookie-store.js";
2
- export interface DalpAuthClientConfig {
3
- /** Base URL of the DALP API (e.g., `"https://dalp.example.com"`). */
4
- url: string;
5
- /** API key used for Better Auth API-key-authenticated operations. */
6
- apiKey?: string;
7
- /** Better Auth session token sent as an Authorization bearer token. */
8
- sessionToken?: string;
9
- /** Cookie header value for explicit Node/browser-session handoff. */
10
- cookie?: string;
11
- /** Cookie store for Node-side session persistence across Better Auth calls. */
12
- cookieStore?: DalpCookieStore;
13
- /**
14
- * Organization ID for multi-tenant setups.
15
- * Sent as `x-organization-id` when provided.
16
- */
17
- organizationId?: string;
18
- /**
19
- * Additional headers merged into every Better Auth request.
20
- * Can override defaults like `User-Agent` but cannot override configured security headers.
21
- */
22
- headers?: Record<string, string>;
23
- /**
24
- * Custom `fetch` implementation.
25
- * Use this to inject logging, proxy configuration, or test doubles.
26
- */
27
- fetch?: typeof globalThis.fetch;
28
- }
29
- export interface DalpAuthError {
30
- code?: string;
31
- message?: string;
32
- status?: number;
33
- statusText?: string;
34
- [key: string]: unknown;
35
- }
36
- export interface DalpAuthResult<TData = unknown, TError = DalpAuthError> {
37
- data: TData | null;
38
- error: TError | null;
39
- }
40
- export type DalpAuthOperation<TInput = Record<string, unknown>, TData = unknown> = (input?: TInput, options?: unknown) => Promise<DalpAuthResult<TData>>;
41
- export interface DalpAuthClient {
42
- signIn: Record<string, DalpAuthOperation> & {
43
- email: DalpAuthOperation;
44
- };
45
- signUp: Record<string, DalpAuthOperation> & {
46
- email: DalpAuthOperation;
47
- };
48
- getSession: DalpAuthOperation;
49
- listSessions: DalpAuthOperation;
50
- revokeSession: DalpAuthOperation;
51
- revokeOtherSessions: DalpAuthOperation;
52
- apiKey: Record<string, DalpAuthOperation> & {
53
- create: DalpAuthOperation;
54
- list: DalpAuthOperation;
55
- delete: DalpAuthOperation;
56
- };
57
- organization: Record<string, DalpAuthOperation> & {
58
- create: DalpAuthOperation;
59
- list: DalpAuthOperation;
60
- setActive: DalpAuthOperation;
61
- inviteMember: DalpAuthOperation;
62
- acceptInvitation: DalpAuthOperation;
63
- listMembers: DalpAuthOperation;
64
- addMember: DalpAuthOperation;
65
- removeMember: DalpAuthOperation;
66
- };
67
- admin: Record<string, DalpAuthOperation> & {
68
- listUsers: DalpAuthOperation;
69
- createUser: DalpAuthOperation;
70
- removeUser: DalpAuthOperation;
71
- setRole: DalpAuthOperation;
72
- };
73
- device: Record<string, DalpAuthOperation> & {
74
- code: DalpAuthOperation;
75
- token: DalpAuthOperation;
76
- approve: DalpAuthOperation;
77
- deny: DalpAuthOperation;
78
- };
79
- passkey: Record<string, DalpAuthOperation>;
80
- twoFactor: Record<string, DalpAuthOperation> & {
81
- enable: DalpAuthOperation;
82
- disable: DalpAuthOperation;
83
- verifyTotp: DalpAuthOperation;
84
- verifyBackupCode: DalpAuthOperation;
85
- generateBackupCodes: DalpAuthOperation;
86
- };
87
- wallet: {
88
- pincode: {
89
- enable: DalpAuthOperation;
90
- disable: DalpAuthOperation;
91
- update: DalpAuthOperation;
92
- reset: DalpAuthOperation;
93
- };
94
- twoFactor: {
95
- enable: DalpAuthOperation;
96
- disable: DalpAuthOperation;
97
- verify: DalpAuthOperation;
98
- };
99
- secretCodes: {
100
- generate: DalpAuthOperation;
101
- confirm: DalpAuthOperation;
102
- };
103
- passkey: {
104
- register: DalpAuthOperation;
105
- complete: DalpAuthOperation;
106
- disable: DalpAuthOperation;
107
- challenge: DalpAuthOperation;
108
- verify: DalpAuthOperation;
109
- };
110
- };
111
- $fetch: (path: string, options?: Record<string, unknown>) => Promise<unknown>;
112
- $ERROR_CODES: Record<string, unknown>;
113
- }
114
- export declare function createDalpAuthClient(config: DalpAuthClientConfig): DalpAuthClient;
115
- //# sourceMappingURL=auth.d.ts.map
1
+ export { createDalpAuthClient, makeDalpAuthClient } from "./auth/live.ts";
2
+ export type { DalpAuthClient } from "./auth/live.ts";
3
+ export { decodeDalpAuthClientConfig } from "./auth/client.ts";
4
+ export type { DalpAuthSurface } from "./auth-surface.ts";
5
+ export type { DalpAuthClientConfig, DalpCliAuthClient, DalpAuthError, DalpAuthOperation, DalpAuthResult, DalpOrganizationInvitation, DalpOrganizationInvitationsQuery, DalpOrganizationMember, DalpOrganizationMembersQuery, DecodedDalpAuthClientConfig, } from "./auth/client.ts";
6
+ export type { DalpPasskeyCeremony } from "./auth/native-passkey.ts";
7
+ export type { DalpRuntime } from "./runtime.ts";
8
+ export type { WalletAuthEndpointPath } from "./auth/wallet-plugins.ts";