@clossir-tech/ts-sdk 0.9.8 → 0.10.0

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 (121) hide show
  1. package/README.md +18 -17
  2. package/esm/funcs/attestations-delete-attestations-by-id.js +3 -1
  3. package/esm/funcs/attestations-delete-attestations-by-id.js.map +1 -1
  4. package/esm/funcs/attestations-post-attestations.js +3 -1
  5. package/esm/funcs/attestations-post-attestations.js.map +1 -1
  6. package/esm/funcs/auth-post-auth-accept-invite.d.ts +1 -1
  7. package/esm/funcs/auth-post-auth-accept-invite.d.ts.map +1 -1
  8. package/esm/funcs/auth-post-auth-accept-invite.js +8 -3
  9. package/esm/funcs/auth-post-auth-accept-invite.js.map +1 -1
  10. package/esm/funcs/auth-post-auth-logout.d.ts +3 -2
  11. package/esm/funcs/auth-post-auth-logout.d.ts.map +1 -1
  12. package/esm/funcs/auth-post-auth-logout.js +8 -2
  13. package/esm/funcs/auth-post-auth-logout.js.map +1 -1
  14. package/esm/funcs/auth-post-auth-refresh.js +1 -1
  15. package/esm/funcs/auth-post-auth-refresh.js.map +1 -1
  16. package/esm/funcs/auth-post-auth-reset-password.js +1 -1
  17. package/esm/funcs/auth-post-auth-reset-password.js.map +1 -1
  18. package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.d.ts +1 -1
  19. package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js +1 -1
  20. package/esm/funcs/o-auth-post-oauth-revoke.d.ts +3 -2
  21. package/esm/funcs/o-auth-post-oauth-revoke.d.ts.map +1 -1
  22. package/esm/funcs/o-auth-post-oauth-revoke.js +6 -2
  23. package/esm/funcs/o-auth-post-oauth-revoke.js.map +1 -1
  24. package/esm/funcs/organizations-get-orgs.d.ts +2 -2
  25. package/esm/funcs/organizations-get-orgs.d.ts.map +1 -1
  26. package/esm/funcs/organizations-get-orgs.js +26 -5
  27. package/esm/funcs/organizations-get-orgs.js.map +1 -1
  28. package/esm/funcs/organizations-post-orgs-by-org-id-members-invite.js +1 -1
  29. package/esm/funcs/organizations-post-orgs-by-org-id-members-invite.js.map +1 -1
  30. package/esm/funcs/organizations-post-orgs-by-org-id-members.js +2 -0
  31. package/esm/funcs/organizations-post-orgs-by-org-id-members.js.map +1 -1
  32. package/esm/lib/config.d.ts +2 -2
  33. package/esm/lib/config.js +2 -2
  34. package/esm/lib/config.js.map +1 -1
  35. package/esm/models/errors/index.d.ts +1 -0
  36. package/esm/models/errors/index.d.ts.map +1 -1
  37. package/esm/models/errors/index.js +1 -0
  38. package/esm/models/errors/index.js.map +1 -1
  39. package/esm/models/errors/post-oauth-revoke.d.ts +278 -0
  40. package/esm/models/errors/post-oauth-revoke.d.ts.map +1 -0
  41. package/esm/models/errors/post-oauth-revoke.js +298 -0
  42. package/esm/models/errors/post-oauth-revoke.js.map +1 -0
  43. package/esm/models/operations/get-orgs.d.ts +48 -0
  44. package/esm/models/operations/get-orgs.d.ts.map +1 -1
  45. package/esm/models/operations/get-orgs.js +27 -0
  46. package/esm/models/operations/get-orgs.js.map +1 -1
  47. package/esm/models/operations/index.d.ts +0 -2
  48. package/esm/models/operations/index.d.ts.map +1 -1
  49. package/esm/models/operations/index.js +0 -2
  50. package/esm/models/operations/index.js.map +1 -1
  51. package/esm/models/operations/post-attestations.d.ts +6 -2
  52. package/esm/models/operations/post-attestations.d.ts.map +1 -1
  53. package/esm/models/operations/post-attestations.js.map +1 -1
  54. package/esm/models/operations/post-oauth-revoke.d.ts +10 -0
  55. package/esm/models/operations/post-oauth-revoke.d.ts.map +1 -1
  56. package/esm/models/operations/post-oauth-revoke.js +4 -0
  57. package/esm/models/operations/post-oauth-revoke.js.map +1 -1
  58. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-compliance-policy.d.ts +43 -1
  59. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-compliance-policy.d.ts.map +1 -1
  60. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js +29 -0
  61. package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js.map +1 -1
  62. package/esm/sdk/auth.d.ts +2 -2
  63. package/esm/sdk/auth.js +2 -2
  64. package/esm/sdk/compliance.d.ts +1 -1
  65. package/esm/sdk/compliance.js +1 -1
  66. package/esm/sdk/kyc.d.ts +0 -14
  67. package/esm/sdk/kyc.d.ts.map +1 -1
  68. package/esm/sdk/kyc.js +0 -20
  69. package/esm/sdk/kyc.js.map +1 -1
  70. package/esm/sdk/o-auth.d.ts +1 -1
  71. package/esm/sdk/o-auth.js +1 -1
  72. package/esm/sdk/organizations.d.ts +2 -2
  73. package/esm/sdk/organizations.d.ts.map +1 -1
  74. package/esm/sdk/organizations.js +3 -3
  75. package/esm/sdk/organizations.js.map +1 -1
  76. package/jsr.json +1 -1
  77. package/package.json +3 -3
  78. package/src/funcs/attestations-delete-attestations-by-id.ts +4 -1
  79. package/src/funcs/attestations-post-attestations.ts +3 -0
  80. package/src/funcs/auth-post-auth-accept-invite.ts +9 -3
  81. package/src/funcs/auth-post-auth-logout.ts +13 -2
  82. package/src/funcs/auth-post-auth-refresh.ts +1 -1
  83. package/src/funcs/auth-post-auth-reset-password.ts +1 -1
  84. package/src/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.ts +1 -1
  85. package/src/funcs/o-auth-post-oauth-revoke.ts +27 -2
  86. package/src/funcs/organizations-get-orgs.ts +37 -2
  87. package/src/funcs/organizations-post-orgs-by-org-id-members-invite.ts +1 -1
  88. package/src/funcs/organizations-post-orgs-by-org-id-members.ts +3 -0
  89. package/src/lib/config.ts +2 -2
  90. package/src/models/errors/index.ts +1 -0
  91. package/src/models/errors/post-oauth-revoke.ts +493 -0
  92. package/src/models/operations/get-orgs.ts +91 -0
  93. package/src/models/operations/index.ts +0 -2
  94. package/src/models/operations/post-attestations.ts +6 -2
  95. package/src/models/operations/post-oauth-revoke.ts +14 -0
  96. package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-compliance-policy.ts +56 -1
  97. package/src/sdk/auth.ts +2 -2
  98. package/src/sdk/compliance.ts +1 -1
  99. package/src/sdk/kyc.ts +0 -36
  100. package/src/sdk/o-auth.ts +1 -1
  101. package/src/sdk/organizations.ts +5 -1
  102. package/esm/funcs/kyc-post-kyc-mock-approve.d.ts +0 -20
  103. package/esm/funcs/kyc-post-kyc-mock-approve.d.ts.map +0 -1
  104. package/esm/funcs/kyc-post-kyc-mock-approve.js +0 -90
  105. package/esm/funcs/kyc-post-kyc-mock-approve.js.map +0 -1
  106. package/esm/funcs/kyc-post-kyc-mock-reject.d.ts +0 -20
  107. package/esm/funcs/kyc-post-kyc-mock-reject.d.ts.map +0 -1
  108. package/esm/funcs/kyc-post-kyc-mock-reject.js +0 -90
  109. package/esm/funcs/kyc-post-kyc-mock-reject.js.map +0 -1
  110. package/esm/models/operations/post-kyc-mock-approve.d.ts +0 -75
  111. package/esm/models/operations/post-kyc-mock-approve.d.ts.map +0 -1
  112. package/esm/models/operations/post-kyc-mock-approve.js +0 -60
  113. package/esm/models/operations/post-kyc-mock-approve.js.map +0 -1
  114. package/esm/models/operations/post-kyc-mock-reject.d.ts +0 -41
  115. package/esm/models/operations/post-kyc-mock-reject.d.ts.map +0 -1
  116. package/esm/models/operations/post-kyc-mock-reject.js +0 -24
  117. package/esm/models/operations/post-kyc-mock-reject.js.map +0 -1
  118. package/src/funcs/kyc-post-kyc-mock-approve.ts +0 -180
  119. package/src/funcs/kyc-post-kyc-mock-reject.ts +0 -180
  120. package/src/models/operations/post-kyc-mock-approve.ts +0 -179
  121. package/src/models/operations/post-kyc-mock-reject.ts +0 -80
@@ -19,6 +19,7 @@ import {
19
19
  RequestTimeoutError,
20
20
  UnexpectedClientError,
21
21
  } from "../models/errors/http-client-errors.js";
22
+ import * as errors from "../models/errors/index.js";
22
23
  import { ResponseValidationError } from "../models/errors/response-validation-error.js";
23
24
  import { SDKError } from "../models/errors/sdk-error.js";
24
25
  import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
@@ -30,7 +31,7 @@ import { Result } from "../types/fp.js";
30
31
  * Logout user
31
32
  *
32
33
  * @remarks
33
- * Revoke the access token, session, and optionally the refresh token.
34
+ * Revoke the access token, session, and optionally the refresh token. Returns 500 when a revoke was attempted and failed; retry the logout. Returns 503 when an auth lookup fails (emitted by the root error handler).
34
35
  *
35
36
  * If set, this operation will use {@link Security.bearerAuth} from the global security.
36
37
  */
@@ -41,6 +42,7 @@ export function authPostAuthLogout(
41
42
  ): APIPromise<
42
43
  Result<
43
44
  operations.PostAuthLogoutResponse,
45
+ | errors.ProblemDetailsError
44
46
  | SDKError
45
47
  | ResponseValidationError
46
48
  | ConnectionError
@@ -66,6 +68,7 @@ async function $do(
66
68
  [
67
69
  Result<
68
70
  operations.PostAuthLogoutResponse,
71
+ | errors.ProblemDetailsError
69
72
  | SDKError
70
73
  | ResponseValidationError
71
74
  | ConnectionError
@@ -142,8 +145,13 @@ async function $do(
142
145
  }
143
146
  const response = doResult.value;
144
147
 
148
+ const responseFields = {
149
+ HttpMeta: { Response: response, Request: req },
150
+ };
151
+
145
152
  const [result] = await M.match<
146
153
  operations.PostAuthLogoutResponse,
154
+ | errors.ProblemDetailsError
147
155
  | SDKError
148
156
  | ResponseValidationError
149
157
  | ConnectionError
@@ -154,9 +162,12 @@ async function $do(
154
162
  | SDKValidationError
155
163
  >(
156
164
  M.json(200, operations.PostAuthLogoutResponse$inboundSchema),
165
+ M.jsonErr([500, 503], errors.ProblemDetailsError$inboundSchema, {
166
+ ctype: "application/problem+json",
167
+ }),
157
168
  M.fail("4XX"),
158
169
  M.fail("5XX"),
159
- )(response, req);
170
+ )(response, req, { extraFields: responseFields });
160
171
  if (!result.ok) {
161
172
  return [result, { status: "complete", request: req, response }];
162
173
  }
@@ -157,7 +157,7 @@ async function $do(
157
157
  M.jsonErr([401, 403, 429], errors.ProblemDetailsError$inboundSchema, {
158
158
  ctype: "application/problem+json",
159
159
  }),
160
- M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
160
+ M.jsonErr([500, 503], errors.ProblemDetailsError$inboundSchema, {
161
161
  ctype: "application/problem+json",
162
162
  }),
163
163
  M.fail("4XX"),
@@ -158,7 +158,7 @@ async function $do(
158
158
  M.jsonErr([400, 422, 429], errors.ProblemDetailsError$inboundSchema, {
159
159
  ctype: "application/problem+json",
160
160
  }),
161
- M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
161
+ M.jsonErr([500, 503], errors.ProblemDetailsError$inboundSchema, {
162
162
  ctype: "application/problem+json",
163
163
  }),
164
164
  M.fail("4XX"),
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Update asset compliance policy
32
32
  *
33
33
  * @remarks
34
- * Updates the compliance policy for an asset. Stores changes in the database immediately. If chain_eid is provided and the asset is deployed on that chain, also queues an on-chain policy registration via CQRS (returns 202). Supports regulation presets (RegD 506b/c, RegS, RegA+ Tier 2) via the regulation_type field.
34
+ * Updates the compliance policy for an asset. Stores changes in the database immediately. If chain_eid is provided and the asset is deployed on that chain, also queues an on-chain policy registration via CQRS (returns 202). Supports regulation presets (RegD 506b/c, RegS, RegA+ Tier 2) via the regulation_type field. The onChainSyncOutcome field names which on-chain path ran — queued, not_requested, chain_not_deployed, no_contract_address, no_deployer_wallet or publish_failed — so a caller can tell the five non-queued outcomes apart. The local policy update is committed in every one of them, including publish_failed.
35
35
  */
36
36
  export function compliancePostOrgsByOrgIdAssetsByAssetIdCompliancePolicy(
37
37
  client: ClossirCore,
@@ -18,6 +18,7 @@ import {
18
18
  RequestTimeoutError,
19
19
  UnexpectedClientError,
20
20
  } from "../models/errors/http-client-errors.js";
21
+ import * as errors from "../models/errors/index.js";
21
22
  import { ResponseValidationError } from "../models/errors/response-validation-error.js";
22
23
  import { SDKError } from "../models/errors/sdk-error.js";
23
24
  import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
@@ -29,7 +30,7 @@ import { Result } from "../types/fp.js";
29
30
  * Revoke token
30
31
  *
31
32
  * @remarks
32
- * Revoke an access or refresh token. Always returns success per RFC 7009.
33
+ * Revoke an access or refresh token. Requires client authentication (client_secret_basic, client_secret_post, or client_id for public clients). A refresh token is revoked only for the client it was issued to. Unknown tokens, and tokens of another client, return 200 per RFC 7009 §2.2; 503 temporarily_unavailable (retryable) when the revocation could not be recorded.
33
34
  */
34
35
  export function oAuthPostOauthRevoke(
35
36
  client: ClossirCore,
@@ -38,6 +39,11 @@ export function oAuthPostOauthRevoke(
38
39
  ): APIPromise<
39
40
  Result<
40
41
  operations.PostOauthRevokeResponse,
42
+ | errors.PostOauthRevokeBadRequestError
43
+ | errors.PostOauthRevokeUnauthorizedError
44
+ | errors.PostOauthRevokeTooManyRequestsError
45
+ | errors.PostOauthRevokeInternalServerError
46
+ | errors.ServiceUnavailableError
41
47
  | SDKError
42
48
  | ResponseValidationError
43
49
  | ConnectionError
@@ -63,6 +69,11 @@ async function $do(
63
69
  [
64
70
  Result<
65
71
  operations.PostOauthRevokeResponse,
72
+ | errors.PostOauthRevokeBadRequestError
73
+ | errors.PostOauthRevokeUnauthorizedError
74
+ | errors.PostOauthRevokeTooManyRequestsError
75
+ | errors.PostOauthRevokeInternalServerError
76
+ | errors.ServiceUnavailableError
66
77
  | SDKError
67
78
  | ResponseValidationError
68
79
  | ConnectionError
@@ -134,8 +145,17 @@ async function $do(
134
145
  }
135
146
  const response = doResult.value;
136
147
 
148
+ const responseFields = {
149
+ HttpMeta: { Response: response, Request: req },
150
+ };
151
+
137
152
  const [result] = await M.match<
138
153
  operations.PostOauthRevokeResponse,
154
+ | errors.PostOauthRevokeBadRequestError
155
+ | errors.PostOauthRevokeUnauthorizedError
156
+ | errors.PostOauthRevokeTooManyRequestsError
157
+ | errors.PostOauthRevokeInternalServerError
158
+ | errors.ServiceUnavailableError
139
159
  | SDKError
140
160
  | ResponseValidationError
141
161
  | ConnectionError
@@ -146,9 +166,14 @@ async function $do(
146
166
  | SDKValidationError
147
167
  >(
148
168
  M.json(200, operations.PostOauthRevokeResponse$inboundSchema),
169
+ M.jsonErr(400, errors.PostOauthRevokeBadRequestError$inboundSchema),
170
+ M.jsonErr(401, errors.PostOauthRevokeUnauthorizedError$inboundSchema),
171
+ M.jsonErr(429, errors.PostOauthRevokeTooManyRequestsError$inboundSchema),
172
+ M.jsonErr(500, errors.PostOauthRevokeInternalServerError$inboundSchema),
173
+ M.jsonErr(503, errors.ServiceUnavailableError$inboundSchema),
149
174
  M.fail("4XX"),
150
175
  M.fail("5XX"),
151
- )(response, req);
176
+ )(response, req, { extraFields: responseFields });
152
177
  if (!result.ok) {
153
178
  return [result, { status: "complete", request: req, response }];
154
179
  }
@@ -2,10 +2,13 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ import * as z from "zod/v4-mini";
5
6
  import { ClossirCore } from "../core.js";
7
+ import { encodeFormQuery } from "../lib/encodings.js";
6
8
  import { matchStatusCode } from "../lib/http.js";
7
9
  import * as M from "../lib/matchers.js";
8
10
  import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
9
12
  import { RequestOptions } from "../lib/sdks.js";
10
13
  import { resolveSecurity } from "../lib/security.js";
11
14
  import { pathToFunc } from "../lib/url.js";
@@ -28,11 +31,13 @@ import { Result } from "../types/fp.js";
28
31
  * List organizations
29
32
  *
30
33
  * @remarks
31
- * Returns organizations accessible to the authenticated user. With JWT auth, returns the user's org. With API key, returns the org associated with the key. Without auth, returns a limited public listing.
34
+ * Returns a paginated list of organizations the caller may see. With a user JWT: every root organization in which the user holds an active membership. With an API key (requires the `orgs:read` permission): only the organization the key belongs to. Unauthenticated requests are rejected with 401; there is no public listing. Use `page` (1-based) and `limit` (default 50, max 200).
32
35
  */
33
36
  export function organizationsGetOrgs(
34
37
  client: ClossirCore,
35
38
  security: operations.GetOrgsSecurity,
39
+ page?: string | undefined,
40
+ limit?: string | undefined,
36
41
  options?: RequestOptions,
37
42
  ): APIPromise<
38
43
  Result<
@@ -51,6 +56,8 @@ export function organizationsGetOrgs(
51
56
  return new APIPromise($do(
52
57
  client,
53
58
  security,
59
+ page,
60
+ limit,
54
61
  options,
55
62
  ));
56
63
  }
@@ -58,6 +65,8 @@ export function organizationsGetOrgs(
58
65
  async function $do(
59
66
  client: ClossirCore,
60
67
  security: operations.GetOrgsSecurity,
68
+ page?: string | undefined,
69
+ limit?: string | undefined,
61
70
  options?: RequestOptions,
62
71
  ): Promise<
63
72
  [
@@ -76,8 +85,29 @@ async function $do(
76
85
  APICall,
77
86
  ]
78
87
  > {
88
+ const input: operations.GetOrgsRequest = {
89
+ page: page,
90
+ limit: limit,
91
+ };
92
+
93
+ const parsed = safeParse(
94
+ input,
95
+ (value) => z.parse(operations.GetOrgsRequest$outboundSchema, value),
96
+ "Input validation failed",
97
+ );
98
+ if (!parsed.ok) {
99
+ return [parsed, { status: "invalid" }];
100
+ }
101
+ const payload = parsed.value;
102
+ const body = null;
103
+
79
104
  const path = pathToFunc("/orgs/")();
80
105
 
106
+ const query = encodeFormQuery({
107
+ "limit": payload.limit,
108
+ "page": payload.page,
109
+ });
110
+
81
111
  const headers = new Headers(compactMap({
82
112
  Accept: "application/json",
83
113
  }));
@@ -120,6 +150,8 @@ async function $do(
120
150
  baseURL: options?.serverURL,
121
151
  path: path,
122
152
  headers: headers,
153
+ query: query,
154
+ body: body,
123
155
  userAgent: client._options.userAgent,
124
156
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
125
157
  }, options);
@@ -157,7 +189,10 @@ async function $do(
157
189
  | SDKValidationError
158
190
  >(
159
191
  M.json(200, operations.GetOrgsResponse$inboundSchema),
160
- M.jsonErr([403, 428], errors.ProblemDetailsError$inboundSchema, {
192
+ M.jsonErr([401, 403, 428], errors.ProblemDetailsError$inboundSchema, {
193
+ ctype: "application/problem+json",
194
+ }),
195
+ M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
161
196
  ctype: "application/problem+json",
162
197
  }),
163
198
  M.fail("4XX"),
@@ -199,7 +199,7 @@ async function $do(
199
199
  errors.ProblemDetailsError$inboundSchema,
200
200
  { ctype: "application/problem+json" },
201
201
  ),
202
- M.jsonErr(502, errors.ProblemDetailsError$inboundSchema, {
202
+ M.jsonErr([500, 502], errors.ProblemDetailsError$inboundSchema, {
203
203
  ctype: "application/problem+json",
204
204
  }),
205
205
  M.fail("4XX"),
@@ -194,6 +194,9 @@ async function $do(
194
194
  M.jsonErr([400, 403, 409, 428], errors.ProblemDetailsError$inboundSchema, {
195
195
  ctype: "application/problem+json",
196
196
  }),
197
+ M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
198
+ ctype: "application/problem+json",
199
+ }),
197
200
  M.fail("4XX"),
198
201
  M.fail("5XX"),
199
202
  )(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.9.8",
68
+ sdkVersion: "0.10.0",
69
69
  genVersion: "2.916.4",
70
70
  userAgent:
71
- "speakeasy-sdk/typescript 0.9.8 2.916.4 2.0.0 @clossir-tech/ts-sdk",
71
+ "speakeasy-sdk/typescript 0.10.0 2.916.4 2.0.0 @clossir-tech/ts-sdk",
72
72
  } as const;
@@ -7,6 +7,7 @@ export * from "./get-oauth-authorize.js";
7
7
  export * from "./get-oauth-userinfo.js";
8
8
  export * from "./http-client-errors.js";
9
9
  export * from "./post-oauth-authorize-callback.js";
10
+ export * from "./post-oauth-revoke.js";
10
11
  export * from "./post-oauth-token.js";
11
12
  export * from "./problem-details-error.js";
12
13
  export * from "./response-validation-error.js";