@clossir-tech/ts-sdk 0.10.1 → 0.10.3

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 (190) hide show
  1. package/README.md +32 -19
  2. package/esm/funcs/{kyc-post-kyc-webhook-by-provider.d.ts → assets-get-assets-by-asset-id.d.ts} +4 -4
  3. package/esm/funcs/assets-get-assets-by-asset-id.d.ts.map +1 -0
  4. package/esm/funcs/assets-get-assets-by-asset-id.js +106 -0
  5. package/esm/funcs/assets-get-assets-by-asset-id.js.map +1 -0
  6. package/esm/funcs/assets-get-assets.d.ts +18 -0
  7. package/esm/funcs/assets-get-assets.d.ts.map +1 -0
  8. package/esm/funcs/assets-get-assets.js +109 -0
  9. package/esm/funcs/assets-get-assets.js.map +1 -0
  10. package/esm/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.js +1 -1
  11. package/esm/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.js.map +1 -1
  12. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.js +1 -3
  13. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.js.map +1 -1
  14. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.d.ts +1 -1
  15. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.js +2 -2
  16. package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.js.map +1 -1
  17. package/esm/funcs/assets-post-orgs-by-org-id-assets.js +1 -1
  18. package/esm/funcs/assets-post-orgs-by-org-id-assets.js.map +1 -1
  19. package/esm/funcs/auth-post-auth-switch-org.d.ts +20 -0
  20. package/esm/funcs/auth-post-auth-switch-org.d.ts.map +1 -0
  21. package/esm/funcs/auth-post-auth-switch-org.js +90 -0
  22. package/esm/funcs/auth-post-auth-switch-org.js.map +1 -0
  23. package/esm/funcs/auth-post-auth-verify-email.d.ts +1 -1
  24. package/esm/funcs/auth-post-auth-verify-email.js +1 -1
  25. package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.d.ts +1 -1
  26. package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.js +2 -2
  27. package/esm/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.js.map +1 -1
  28. package/esm/funcs/compliance-post-compliance-check.js +1 -3
  29. package/esm/funcs/compliance-post-compliance-check.js.map +1 -1
  30. package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js +1 -1
  31. package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js.map +1 -1
  32. package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.d.ts +20 -0
  33. package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.d.ts.map +1 -0
  34. package/esm/funcs/{kyc-post-kyc-webhook-by-provider.js → kyb-get-orgs-by-org-id-kyb-status.js} +25 -20
  35. package/esm/funcs/kyb-get-orgs-by-org-id-kyb-status.js.map +1 -0
  36. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.d.ts +20 -0
  37. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.d.ts.map +1 -0
  38. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.js +96 -0
  39. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-access-token.js.map +1 -0
  40. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.d.ts +20 -0
  41. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.d.ts.map +1 -0
  42. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.js +96 -0
  43. package/esm/funcs/kyb-post-orgs-by-org-id-kyb-initiate.js.map +1 -0
  44. package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.d.ts +1 -1
  45. package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.js +2 -2
  46. package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.js.map +1 -1
  47. package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.js +1 -1
  48. package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.js.map +1 -1
  49. package/esm/funcs/organizations-post-orgs-by-org-id-members.d.ts +1 -1
  50. package/esm/funcs/organizations-post-orgs-by-org-id-members.js +1 -1
  51. package/esm/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.js +1 -1
  52. package/esm/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.js.map +1 -1
  53. package/esm/funcs/transfers-post-transfers.d.ts +1 -1
  54. package/esm/funcs/transfers-post-transfers.js +2 -2
  55. package/esm/funcs/transfers-post-transfers.js.map +1 -1
  56. package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js +3 -1
  57. package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js.map +1 -1
  58. package/esm/lib/config.d.ts +2 -2
  59. package/esm/lib/config.js +2 -2
  60. package/esm/models/operations/get-assets-by-asset-id.d.ts +85 -0
  61. package/esm/models/operations/get-assets-by-asset-id.d.ts.map +1 -0
  62. package/esm/models/operations/get-assets-by-asset-id.js +119 -0
  63. package/esm/models/operations/get-assets-by-asset-id.js.map +1 -0
  64. package/esm/models/operations/get-assets.d.ts +112 -0
  65. package/esm/models/operations/get-assets.d.ts.map +1 -0
  66. package/esm/models/operations/get-assets.js +100 -0
  67. package/esm/models/operations/get-assets.js.map +1 -0
  68. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.d.ts +4 -4
  69. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.d.ts.map +1 -1
  70. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.js +4 -5
  71. package/esm/models/operations/get-orgs-by-org-id-assets-by-asset-id.js.map +1 -1
  72. package/esm/models/operations/get-orgs-by-org-id-kyb-status.d.ts +33 -0
  73. package/esm/models/operations/get-orgs-by-org-id-kyb-status.d.ts.map +1 -0
  74. package/esm/models/operations/get-orgs-by-org-id-kyb-status.js +28 -0
  75. package/esm/models/operations/get-orgs-by-org-id-kyb-status.js.map +1 -0
  76. package/esm/models/operations/index.d.ts +6 -1
  77. package/esm/models/operations/index.d.ts.map +1 -1
  78. package/esm/models/operations/index.js +6 -1
  79. package/esm/models/operations/index.js.map +1 -1
  80. package/esm/models/operations/post-auth-switch-org.d.ts +212 -0
  81. package/esm/models/operations/post-auth-switch-org.d.ts.map +1 -0
  82. package/esm/models/operations/post-auth-switch-org.js +206 -0
  83. package/esm/models/operations/post-auth-switch-org.js.map +1 -0
  84. package/esm/models/operations/post-auth-verify-email.d.ts +26 -2
  85. package/esm/models/operations/post-auth-verify-email.d.ts.map +1 -1
  86. package/esm/models/operations/post-auth-verify-email.js +18 -1
  87. package/esm/models/operations/post-auth-verify-email.js.map +1 -1
  88. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.d.ts +2 -8
  89. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.d.ts.map +1 -1
  90. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js +2 -6
  91. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.js.map +1 -1
  92. package/esm/models/operations/post-orgs-by-org-id-assets.d.ts +5 -0
  93. package/esm/models/operations/post-orgs-by-org-id-assets.d.ts.map +1 -1
  94. package/esm/models/operations/post-orgs-by-org-id-assets.js +2 -0
  95. package/esm/models/operations/post-orgs-by-org-id-assets.js.map +1 -1
  96. package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.d.ts +36 -0
  97. package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.d.ts.map +1 -0
  98. package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.js +34 -0
  99. package/esm/models/operations/post-orgs-by-org-id-kyb-access-token.js.map +1 -0
  100. package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.d.ts +30 -0
  101. package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.d.ts.map +1 -0
  102. package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.js +25 -0
  103. package/esm/models/operations/post-orgs-by-org-id-kyb-initiate.js.map +1 -0
  104. package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.d.ts +5 -0
  105. package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.d.ts.map +1 -1
  106. package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.js +1 -0
  107. package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.js.map +1 -1
  108. package/esm/models/operations/post-orgs-by-org-id-members.d.ts +20 -0
  109. package/esm/models/operations/post-orgs-by-org-id-members.d.ts.map +1 -1
  110. package/esm/models/operations/post-orgs-by-org-id-members.js.map +1 -1
  111. package/esm/sdk/assets.d.ts +15 -1
  112. package/esm/sdk/assets.d.ts.map +1 -1
  113. package/esm/sdk/assets.js +21 -1
  114. package/esm/sdk/assets.js.map +1 -1
  115. package/esm/sdk/auth.d.ts +8 -1
  116. package/esm/sdk/auth.d.ts.map +1 -1
  117. package/esm/sdk/auth.js +11 -1
  118. package/esm/sdk/auth.js.map +1 -1
  119. package/esm/sdk/bridge.d.ts +1 -1
  120. package/esm/sdk/bridge.js +1 -1
  121. package/esm/sdk/kyb.d.ts +26 -0
  122. package/esm/sdk/kyb.d.ts.map +1 -0
  123. package/esm/sdk/kyb.js +38 -0
  124. package/esm/sdk/kyb.js.map +1 -0
  125. package/esm/sdk/kyc.d.ts +0 -7
  126. package/esm/sdk/kyc.d.ts.map +1 -1
  127. package/esm/sdk/kyc.js +0 -10
  128. package/esm/sdk/kyc.js.map +1 -1
  129. package/esm/sdk/markets.d.ts +1 -1
  130. package/esm/sdk/markets.js +1 -1
  131. package/esm/sdk/organizations.d.ts +1 -1
  132. package/esm/sdk/organizations.js +1 -1
  133. package/esm/sdk/sdk.d.ts +3 -0
  134. package/esm/sdk/sdk.d.ts.map +1 -1
  135. package/esm/sdk/sdk.js +5 -0
  136. package/esm/sdk/sdk.js.map +1 -1
  137. package/esm/sdk/transfers.d.ts +1 -1
  138. package/esm/sdk/transfers.js +1 -1
  139. package/jsr.json +1 -1
  140. package/package.json +3 -3
  141. package/src/funcs/assets-get-assets-by-asset-id.ts +203 -0
  142. package/src/funcs/assets-get-assets.ts +205 -0
  143. package/src/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.ts +1 -1
  144. package/src/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.ts +5 -3
  145. package/src/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.ts +2 -2
  146. package/src/funcs/assets-post-orgs-by-org-id-assets.ts +1 -1
  147. package/src/funcs/auth-post-auth-switch-org.ts +180 -0
  148. package/src/funcs/auth-post-auth-verify-email.ts +1 -1
  149. package/src/funcs/bridge-post-orgs-by-org-id-assets-by-asset-id-bridge.ts +2 -2
  150. package/src/funcs/compliance-post-compliance-check.ts +5 -3
  151. package/src/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.ts +1 -1
  152. package/src/funcs/{kyc-post-kyc-webhook-by-provider.ts → kyb-get-orgs-by-org-id-kyb-status.ts} +31 -28
  153. package/src/funcs/kyb-post-orgs-by-org-id-kyb-access-token.ts +194 -0
  154. package/src/funcs/kyb-post-orgs-by-org-id-kyb-initiate.ts +194 -0
  155. package/src/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.ts +2 -2
  156. package/src/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.ts +1 -1
  157. package/src/funcs/organizations-post-orgs-by-org-id-members.ts +1 -1
  158. package/src/funcs/timeseries-get-orgs-by-org-id-holdings-by-user-id.ts +1 -1
  159. package/src/funcs/transfers-post-transfers.ts +2 -2
  160. package/src/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deploy.ts +3 -0
  161. package/src/lib/config.ts +2 -2
  162. package/src/models/operations/get-assets-by-asset-id.ts +253 -0
  163. package/src/models/operations/get-assets.ts +250 -0
  164. package/src/models/operations/get-orgs-by-org-id-assets-by-asset-id.ts +17 -9
  165. package/src/models/operations/get-orgs-by-org-id-kyb-status.ts +78 -0
  166. package/src/models/operations/index.ts +6 -1
  167. package/src/models/operations/post-auth-switch-org.ts +549 -0
  168. package/src/models/operations/post-auth-verify-email.ts +56 -5
  169. package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-vault-deploy.ts +19 -26
  170. package/src/models/operations/post-orgs-by-org-id-assets.ts +7 -0
  171. package/src/models/operations/post-orgs-by-org-id-kyb-access-token.ts +93 -0
  172. package/src/models/operations/post-orgs-by-org-id-kyb-initiate.ts +73 -0
  173. package/src/models/operations/post-orgs-by-org-id-members-by-user-id-attest.ts +6 -0
  174. package/src/models/operations/post-orgs-by-org-id-members.ts +20 -0
  175. package/src/sdk/assets.ts +41 -1
  176. package/src/sdk/auth.ts +19 -1
  177. package/src/sdk/bridge.ts +1 -1
  178. package/src/sdk/kyb.ts +63 -0
  179. package/src/sdk/kyc.ts +0 -20
  180. package/src/sdk/markets.ts +1 -1
  181. package/src/sdk/organizations.ts +1 -1
  182. package/src/sdk/sdk.ts +6 -0
  183. package/src/sdk/transfers.ts +1 -1
  184. package/esm/funcs/kyc-post-kyc-webhook-by-provider.d.ts.map +0 -1
  185. package/esm/funcs/kyc-post-kyc-webhook-by-provider.js.map +0 -1
  186. package/esm/models/operations/post-kyc-webhook-by-provider.d.ts +0 -93
  187. package/esm/models/operations/post-kyc-webhook-by-provider.d.ts.map +0 -1
  188. package/esm/models/operations/post-kyc-webhook-by-provider.js +0 -45
  189. package/esm/models/operations/post-kyc-webhook-by-provider.js.map +0 -1
  190. package/src/models/operations/post-kyc-webhook-by-provider.ts +0 -169
@@ -0,0 +1,194 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { ClossirCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/http-client-errors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
24
+ import { SDKError } from "../models/errors/sdk-error.js";
25
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Get KYB SDK access token
32
+ *
33
+ * @remarks
34
+ * Generate a Sumsub WebSDK access token for the org's company applicant. Response includes Cache-Control: no-store. Requires direct admin membership. JWT only.
35
+ *
36
+ * If set, this operation will use {@link Security.bearerAuth} from the global security.
37
+ */
38
+ export function kybPostOrgsByOrgIdKYBAccessToken(
39
+ client: ClossirCore,
40
+ orgId: string,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ operations.PostOrgsByOrgIdKybAccessTokenResponse,
45
+ | errors.ProblemDetailsError
46
+ | SDKError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ orgId,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: ClossirCore,
65
+ orgId: string,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ operations.PostOrgsByOrgIdKybAccessTokenResponse,
71
+ | errors.ProblemDetailsError
72
+ | SDKError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const input: operations.PostOrgsByOrgIdKybAccessTokenRequest = {
85
+ orgId: orgId,
86
+ };
87
+
88
+ const parsed = safeParse(
89
+ input,
90
+ (value) =>
91
+ z.parse(
92
+ operations.PostOrgsByOrgIdKybAccessTokenRequest$outboundSchema,
93
+ value,
94
+ ),
95
+ "Input validation failed",
96
+ );
97
+ if (!parsed.ok) {
98
+ return [parsed, { status: "invalid" }];
99
+ }
100
+ const payload = parsed.value;
101
+ const body = null;
102
+
103
+ const pathParams = {
104
+ orgId: encodeSimple("orgId", payload.orgId, {
105
+ explode: false,
106
+ charEncoding: "percent",
107
+ }),
108
+ };
109
+ const path = pathToFunc("/orgs/{orgId}/kyb/access-token")(pathParams);
110
+
111
+ const headers = new Headers(compactMap({
112
+ Accept: "application/json",
113
+ }));
114
+
115
+ const secConfig = await extractSecurity(client._options.bearerAuth);
116
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
117
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
118
+
119
+ const context = {
120
+ options: client._options,
121
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
122
+ operationID: "postOrgsByOrgIdKybAccess-token",
123
+ oAuth2Scopes: null,
124
+
125
+ resolvedSecurity: requestSecurity,
126
+
127
+ securitySource: client._options.bearerAuth,
128
+ retryConfig: options?.retries
129
+ || client._options.retryConfig
130
+ || { strategy: "none" },
131
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
132
+ };
133
+
134
+ const requestRes = client._createRequest(context, {
135
+ security: requestSecurity,
136
+ method: "POST",
137
+ baseURL: options?.serverURL,
138
+ path: path,
139
+ headers: headers,
140
+ body: body,
141
+ userAgent: client._options.userAgent,
142
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
143
+ }, options);
144
+ if (!requestRes.ok) {
145
+ return [requestRes, { status: "invalid" }];
146
+ }
147
+ const req = requestRes.value;
148
+
149
+ const doResult = await client._do(req, {
150
+ context,
151
+ isErrorStatusCode: (statusCode: number) =>
152
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
153
+ retryConfig: context.retryConfig,
154
+ retryCodes: context.retryCodes,
155
+ });
156
+ if (!doResult.ok) {
157
+ return [doResult, { status: "request-error", request: req }];
158
+ }
159
+ const response = doResult.value;
160
+
161
+ const responseFields = {
162
+ HttpMeta: { Response: response, Request: req },
163
+ };
164
+
165
+ const [result] = await M.match<
166
+ operations.PostOrgsByOrgIdKybAccessTokenResponse,
167
+ | errors.ProblemDetailsError
168
+ | SDKError
169
+ | ResponseValidationError
170
+ | ConnectionError
171
+ | RequestAbortedError
172
+ | RequestTimeoutError
173
+ | InvalidRequestError
174
+ | UnexpectedClientError
175
+ | SDKValidationError
176
+ >(
177
+ M.json(200, operations.PostOrgsByOrgIdKybAccessTokenResponse$inboundSchema),
178
+ M.jsonErr(
179
+ [401, 403, 409, 428, 429],
180
+ errors.ProblemDetailsError$inboundSchema,
181
+ { ctype: "application/problem+json" },
182
+ ),
183
+ M.jsonErr([500, 502], errors.ProblemDetailsError$inboundSchema, {
184
+ ctype: "application/problem+json",
185
+ }),
186
+ M.fail("4XX"),
187
+ M.fail("5XX"),
188
+ )(response, req, { extraFields: responseFields });
189
+ if (!result.ok) {
190
+ return [result, { status: "complete", request: req, response }];
191
+ }
192
+
193
+ return [result, { status: "complete", request: req, response }];
194
+ }
@@ -0,0 +1,194 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { ClossirCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/http-client-errors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
24
+ import { SDKError } from "../models/errors/sdk-error.js";
25
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Initiate org KYB verification
32
+ *
33
+ * @remarks
34
+ * Create the org's Sumsub company applicant and org_verifications row. Idempotent: returns existing row if already initiated. Requires direct admin membership. JWT only.
35
+ *
36
+ * If set, this operation will use {@link Security.bearerAuth} from the global security.
37
+ */
38
+ export function kybPostOrgsByOrgIdKYBInitiate(
39
+ client: ClossirCore,
40
+ orgId: string,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ operations.PostOrgsByOrgIdKybInitiateResponse,
45
+ | errors.ProblemDetailsError
46
+ | SDKError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ orgId,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: ClossirCore,
65
+ orgId: string,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ operations.PostOrgsByOrgIdKybInitiateResponse,
71
+ | errors.ProblemDetailsError
72
+ | SDKError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const input: operations.PostOrgsByOrgIdKybInitiateRequest = {
85
+ orgId: orgId,
86
+ };
87
+
88
+ const parsed = safeParse(
89
+ input,
90
+ (value) =>
91
+ z.parse(
92
+ operations.PostOrgsByOrgIdKybInitiateRequest$outboundSchema,
93
+ value,
94
+ ),
95
+ "Input validation failed",
96
+ );
97
+ if (!parsed.ok) {
98
+ return [parsed, { status: "invalid" }];
99
+ }
100
+ const payload = parsed.value;
101
+ const body = null;
102
+
103
+ const pathParams = {
104
+ orgId: encodeSimple("orgId", payload.orgId, {
105
+ explode: false,
106
+ charEncoding: "percent",
107
+ }),
108
+ };
109
+ const path = pathToFunc("/orgs/{orgId}/kyb/initiate")(pathParams);
110
+
111
+ const headers = new Headers(compactMap({
112
+ Accept: "application/json",
113
+ }));
114
+
115
+ const secConfig = await extractSecurity(client._options.bearerAuth);
116
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
117
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
118
+
119
+ const context = {
120
+ options: client._options,
121
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
122
+ operationID: "postOrgsByOrgIdKybInitiate",
123
+ oAuth2Scopes: null,
124
+
125
+ resolvedSecurity: requestSecurity,
126
+
127
+ securitySource: client._options.bearerAuth,
128
+ retryConfig: options?.retries
129
+ || client._options.retryConfig
130
+ || { strategy: "none" },
131
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
132
+ };
133
+
134
+ const requestRes = client._createRequest(context, {
135
+ security: requestSecurity,
136
+ method: "POST",
137
+ baseURL: options?.serverURL,
138
+ path: path,
139
+ headers: headers,
140
+ body: body,
141
+ userAgent: client._options.userAgent,
142
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
143
+ }, options);
144
+ if (!requestRes.ok) {
145
+ return [requestRes, { status: "invalid" }];
146
+ }
147
+ const req = requestRes.value;
148
+
149
+ const doResult = await client._do(req, {
150
+ context,
151
+ isErrorStatusCode: (statusCode: number) =>
152
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
153
+ retryConfig: context.retryConfig,
154
+ retryCodes: context.retryCodes,
155
+ });
156
+ if (!doResult.ok) {
157
+ return [doResult, { status: "request-error", request: req }];
158
+ }
159
+ const response = doResult.value;
160
+
161
+ const responseFields = {
162
+ HttpMeta: { Response: response, Request: req },
163
+ };
164
+
165
+ const [result] = await M.match<
166
+ operations.PostOrgsByOrgIdKybInitiateResponse,
167
+ | errors.ProblemDetailsError
168
+ | SDKError
169
+ | ResponseValidationError
170
+ | ConnectionError
171
+ | RequestAbortedError
172
+ | RequestTimeoutError
173
+ | InvalidRequestError
174
+ | UnexpectedClientError
175
+ | SDKValidationError
176
+ >(
177
+ M.json(200, operations.PostOrgsByOrgIdKybInitiateResponse$inboundSchema),
178
+ M.jsonErr(
179
+ [401, 403, 409, 428, 429],
180
+ errors.ProblemDetailsError$inboundSchema,
181
+ { ctype: "application/problem+json" },
182
+ ),
183
+ M.jsonErr([500, 502], errors.ProblemDetailsError$inboundSchema, {
184
+ ctype: "application/problem+json",
185
+ }),
186
+ M.fail("4XX"),
187
+ M.fail("5XX"),
188
+ )(response, req, { extraFields: responseFields });
189
+ if (!result.ok) {
190
+ return [result, { status: "complete", request: req, response }];
191
+ }
192
+
193
+ return [result, { status: "complete", request: req, response }];
194
+ }
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Deploy a market for an asset
32
32
  *
33
33
  * @remarks
34
- * Triggers on-chain deployment of a compliance-gated secondary market for a deployed asset. If the asset is not yet deployed on the target chain, the system will auto-bridge the asset first, then automatically deploy the market once the bridge completes — no extra user interaction needed. The deployment is processed asynchronously via CQRS — returns 202 Accepted immediately. Fee collection is configured with the org wallet as fee collector and Signum protocol wallet for protocol fees. Poll the market detail endpoint for deployment status updates.
34
+ * Triggers on-chain deployment of a compliance-gated secondary market for a deployed asset. If the asset is not yet deployed on the target chain, the system will auto-bridge the asset first, then automatically deploy the market once the bridge completes — no extra user interaction needed. Returns 409 with title chain_frozen if the target chain is frozen (it takes no new markets). The deployment is processed asynchronously via CQRS — returns 202 Accepted immediately. Fee collection is configured with the org wallet as fee collector and Signum protocol wallet for protocol fees. Poll the market detail endpoint for deployment status updates.
35
35
  */
36
36
  export function marketsPostOrgsByOrgIdAssetsByAssetIdMarkets(
37
37
  client: ClossirCore,
@@ -206,7 +206,7 @@ async function $do(
206
206
  operations.PostOrgsByOrgIdAssetsByAssetIdMarketsResponse$inboundSchema,
207
207
  ),
208
208
  M.jsonErr(
209
- [400, 403, 404, 409, 428],
209
+ [400, 403, 404, 409, 422, 428],
210
210
  errors.ProblemDetailsError$inboundSchema,
211
211
  { ctype: "application/problem+json" },
212
212
  ),
@@ -206,7 +206,7 @@ async function $do(
206
206
  operations.PostOrgsByOrgIdMembersByUserIdAttestResponse$inboundSchema,
207
207
  ),
208
208
  M.jsonErr(
209
- [400, 401, 403, 404, 409, 428],
209
+ [400, 401, 403, 404, 409, 422, 428],
210
210
  errors.ProblemDetailsError$inboundSchema,
211
211
  { ctype: "application/problem+json" },
212
212
  ),
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Add member to organization
32
32
  *
33
33
  * @remarks
34
- * Adds an existing user to the organization with the specified role. You can provide either user_id (for existing users) or wallet_address (to invite by wallet). When using wallet_address, if no user exists for that wallet, a placeholder user is created and the wallet is linked. Default role is 'client'. For client/investor users, use role 'client' — these users will not have API access. Requires org membership (JWT) or API key with write:org permission.
34
+ * Adds an existing user to the organization with the specified role. Identify the user by user_id; to add someone without an account, invite them by email (POST /orgs/{orgId}/members/invite). wallet_address is deprecated and no longer adds members: a wallet linked to an existing co-member returns 409, and any other wallet returns 400 `wallet_not_linked`. No user or wallet link is ever created by this endpoint. Default role is 'client'. For client/investor users, use role 'client' — these users will not have API access. Requires org membership (JWT) or API key with write:org permission.
35
35
  */
36
36
  export function organizationsPostOrgsByOrgIdMembers(
37
37
  client: ClossirCore,
@@ -181,7 +181,7 @@ async function $do(
181
181
  200,
182
182
  operations.GetOrgsByOrgIdHoldingsByUserIdResponse$inboundSchema,
183
183
  ),
184
- M.jsonErr([403, 428], errors.ProblemDetailsError$inboundSchema, {
184
+ M.jsonErr([403, 404, 428], errors.ProblemDetailsError$inboundSchema, {
185
185
  ctype: "application/problem+json",
186
186
  }),
187
187
  M.jsonErr(503, errors.ProblemDetailsError$inboundSchema, {
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Create transfer (async)
32
32
  *
33
33
  * @remarks
34
- * Queues a token transfer via LayerZero (CQRS pattern). Runs the full 8-rule compliance check (transfer_restricted, allow_pep, max_risk_score, blocked_countries, accredited_investor_required, lockup_period_days, max_transaction_amount, cooling_off_period_hours) against the asset's compliance_rules before accepting. Creates a pending record in transfer_queue and publishes a command to Kafka. Returns 202 Accepted immediately. Returns 403 Forbidden with a reason and rejection code if any rule fails.
34
+ * Queues a token transfer via LayerZero (CQRS pattern). Runs the full 8-rule compliance check (transfer_restricted, allow_pep, max_risk_score, blocked_countries, accredited_investor_required, lockup_period_days, max_transaction_amount, cooling_off_period_hours) against the asset's compliance_rules before accepting. Creates a pending record in transfer_queue and publishes a command to Kafka. Returns 202 Accepted immediately. Returns 403 Forbidden with a reason and rejection code if any rule fails. Returns 422 self_custody_unsupported when the sender wallet has no server-side signer (self-custody).
35
35
  *
36
36
  * If set, this operation will use {@link Security.bearerAuth} from the global security.
37
37
  */
@@ -163,7 +163,7 @@ async function $do(
163
163
  >(
164
164
  M.json(202, operations.PostTransfersResponse$inboundSchema),
165
165
  M.jsonErr(
166
- [400, 401, 403, 404, 409, 428, 429],
166
+ [400, 401, 403, 404, 409, 422, 428, 429],
167
167
  errors.ProblemDetailsError$inboundSchema,
168
168
  { ctype: "application/problem+json" },
169
169
  ),
@@ -192,6 +192,9 @@ async function $do(
192
192
  errors.ProblemDetailsError$inboundSchema,
193
193
  { ctype: "application/problem+json" },
194
194
  ),
195
+ M.jsonErr(503, errors.ProblemDetailsError$inboundSchema, {
196
+ ctype: "application/problem+json",
197
+ }),
195
198
  M.fail("4XX"),
196
199
  M.fail("5XX"),
197
200
  )(response, req, { extraFields: responseFields });
package/src/lib/config.ts CHANGED
@@ -65,8 +65,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "2.0.0",
68
- sdkVersion: "0.10.1",
68
+ sdkVersion: "0.10.3",
69
69
  genVersion: "2.916.4",
70
70
  userAgent:
71
- "speakeasy-sdk/typescript 0.10.1 2.916.4 2.0.0 @clossir-tech/ts-sdk",
71
+ "speakeasy-sdk/typescript 0.10.3 2.916.4 2.0.0 @clossir-tech/ts-sdk",
72
72
  } as const;