@clossir-tech/ts-sdk 0.9.9 → 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 (83) 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/o-auth-post-oauth-revoke.d.ts +3 -2
  15. package/esm/funcs/o-auth-post-oauth-revoke.d.ts.map +1 -1
  16. package/esm/funcs/o-auth-post-oauth-revoke.js +6 -2
  17. package/esm/funcs/o-auth-post-oauth-revoke.js.map +1 -1
  18. package/esm/lib/config.d.ts +2 -2
  19. package/esm/lib/config.js +2 -2
  20. package/esm/lib/config.js.map +1 -1
  21. package/esm/models/errors/index.d.ts +1 -0
  22. package/esm/models/errors/index.d.ts.map +1 -1
  23. package/esm/models/errors/index.js +1 -0
  24. package/esm/models/errors/index.js.map +1 -1
  25. package/esm/models/errors/post-oauth-revoke.d.ts +278 -0
  26. package/esm/models/errors/post-oauth-revoke.d.ts.map +1 -0
  27. package/esm/models/errors/post-oauth-revoke.js +298 -0
  28. package/esm/models/errors/post-oauth-revoke.js.map +1 -0
  29. package/esm/models/operations/index.d.ts +0 -2
  30. package/esm/models/operations/index.d.ts.map +1 -1
  31. package/esm/models/operations/index.js +0 -2
  32. package/esm/models/operations/index.js.map +1 -1
  33. package/esm/models/operations/post-attestations.d.ts +6 -2
  34. package/esm/models/operations/post-attestations.d.ts.map +1 -1
  35. package/esm/models/operations/post-attestations.js.map +1 -1
  36. package/esm/models/operations/post-oauth-revoke.d.ts +10 -0
  37. package/esm/models/operations/post-oauth-revoke.d.ts.map +1 -1
  38. package/esm/models/operations/post-oauth-revoke.js +4 -0
  39. package/esm/models/operations/post-oauth-revoke.js.map +1 -1
  40. package/esm/sdk/auth.d.ts +2 -2
  41. package/esm/sdk/auth.js +2 -2
  42. package/esm/sdk/kyc.d.ts +0 -14
  43. package/esm/sdk/kyc.d.ts.map +1 -1
  44. package/esm/sdk/kyc.js +0 -20
  45. package/esm/sdk/kyc.js.map +1 -1
  46. package/esm/sdk/o-auth.d.ts +1 -1
  47. package/esm/sdk/o-auth.js +1 -1
  48. package/jsr.json +1 -1
  49. package/package.json +3 -3
  50. package/src/funcs/attestations-delete-attestations-by-id.ts +4 -1
  51. package/src/funcs/attestations-post-attestations.ts +3 -0
  52. package/src/funcs/auth-post-auth-accept-invite.ts +9 -3
  53. package/src/funcs/auth-post-auth-logout.ts +13 -2
  54. package/src/funcs/o-auth-post-oauth-revoke.ts +27 -2
  55. package/src/lib/config.ts +2 -2
  56. package/src/models/errors/index.ts +1 -0
  57. package/src/models/errors/post-oauth-revoke.ts +493 -0
  58. package/src/models/operations/index.ts +0 -2
  59. package/src/models/operations/post-attestations.ts +6 -2
  60. package/src/models/operations/post-oauth-revoke.ts +14 -0
  61. package/src/sdk/auth.ts +2 -2
  62. package/src/sdk/kyc.ts +0 -36
  63. package/src/sdk/o-auth.ts +1 -1
  64. package/esm/funcs/kyc-post-kyc-mock-approve.d.ts +0 -20
  65. package/esm/funcs/kyc-post-kyc-mock-approve.d.ts.map +0 -1
  66. package/esm/funcs/kyc-post-kyc-mock-approve.js +0 -90
  67. package/esm/funcs/kyc-post-kyc-mock-approve.js.map +0 -1
  68. package/esm/funcs/kyc-post-kyc-mock-reject.d.ts +0 -20
  69. package/esm/funcs/kyc-post-kyc-mock-reject.d.ts.map +0 -1
  70. package/esm/funcs/kyc-post-kyc-mock-reject.js +0 -90
  71. package/esm/funcs/kyc-post-kyc-mock-reject.js.map +0 -1
  72. package/esm/models/operations/post-kyc-mock-approve.d.ts +0 -75
  73. package/esm/models/operations/post-kyc-mock-approve.d.ts.map +0 -1
  74. package/esm/models/operations/post-kyc-mock-approve.js +0 -60
  75. package/esm/models/operations/post-kyc-mock-approve.js.map +0 -1
  76. package/esm/models/operations/post-kyc-mock-reject.d.ts +0 -41
  77. package/esm/models/operations/post-kyc-mock-reject.d.ts.map +0 -1
  78. package/esm/models/operations/post-kyc-mock-reject.js +0 -24
  79. package/esm/models/operations/post-kyc-mock-reject.js.map +0 -1
  80. package/src/funcs/kyc-post-kyc-mock-approve.ts +0 -180
  81. package/src/funcs/kyc-post-kyc-mock-reject.ts +0 -180
  82. package/src/models/operations/post-kyc-mock-approve.ts +0 -179
  83. package/src/models/operations/post-kyc-mock-reject.ts +0 -80
@@ -1,180 +0,0 @@
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 { encodeJSON } 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
- * Mock reject (dev only)
32
- *
33
- * @remarks
34
- * Manually reject KYC verification in mock mode. Only available when KYC_PROVIDER=mock.
35
- *
36
- * If set, this operation will use {@link Security.bearerAuth} from the global security.
37
- */
38
- export function kycPostKYCMockReject(
39
- client: ClossirCore,
40
- request: operations.PostKycMockRejectRequest,
41
- options?: RequestOptions,
42
- ): APIPromise<
43
- Result<
44
- operations.PostKycMockRejectResponse,
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
- request,
59
- options,
60
- ));
61
- }
62
-
63
- async function $do(
64
- client: ClossirCore,
65
- request: operations.PostKycMockRejectRequest,
66
- options?: RequestOptions,
67
- ): Promise<
68
- [
69
- Result<
70
- operations.PostKycMockRejectResponse,
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 parsed = safeParse(
85
- request,
86
- (value) =>
87
- z.parse(operations.PostKycMockRejectRequest$outboundSchema, value),
88
- "Input validation failed",
89
- );
90
- if (!parsed.ok) {
91
- return [parsed, { status: "invalid" }];
92
- }
93
- const payload = parsed.value;
94
- const body = encodeJSON("body", payload, { explode: true });
95
-
96
- const path = pathToFunc("/kyc/mock/reject")();
97
-
98
- const headers = new Headers(compactMap({
99
- "Content-Type": "application/json",
100
- Accept: "application/json",
101
- }));
102
-
103
- const secConfig = await extractSecurity(client._options.bearerAuth);
104
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
105
- const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
106
-
107
- const context = {
108
- options: client._options,
109
- baseURL: options?.serverURL ?? client._baseURL ?? "",
110
- operationID: "postKycMockReject",
111
- oAuth2Scopes: null,
112
-
113
- resolvedSecurity: requestSecurity,
114
-
115
- securitySource: client._options.bearerAuth,
116
- retryConfig: options?.retries
117
- || client._options.retryConfig
118
- || { strategy: "none" },
119
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
120
- };
121
-
122
- const requestRes = client._createRequest(context, {
123
- security: requestSecurity,
124
- method: "POST",
125
- baseURL: options?.serverURL,
126
- path: path,
127
- headers: headers,
128
- body: body,
129
- userAgent: client._options.userAgent,
130
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
131
- }, options);
132
- if (!requestRes.ok) {
133
- return [requestRes, { status: "invalid" }];
134
- }
135
- const req = requestRes.value;
136
-
137
- const doResult = await client._do(req, {
138
- context,
139
- isErrorStatusCode: (statusCode: number) =>
140
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
141
- retryConfig: context.retryConfig,
142
- retryCodes: context.retryCodes,
143
- });
144
- if (!doResult.ok) {
145
- return [doResult, { status: "request-error", request: req }];
146
- }
147
- const response = doResult.value;
148
-
149
- const responseFields = {
150
- HttpMeta: { Response: response, Request: req },
151
- };
152
-
153
- const [result] = await M.match<
154
- operations.PostKycMockRejectResponse,
155
- | errors.ProblemDetailsError
156
- | SDKError
157
- | ResponseValidationError
158
- | ConnectionError
159
- | RequestAbortedError
160
- | RequestTimeoutError
161
- | InvalidRequestError
162
- | UnexpectedClientError
163
- | SDKValidationError
164
- >(
165
- M.json(200, operations.PostKycMockRejectResponse$inboundSchema),
166
- M.jsonErr([400, 401, 404, 428], errors.ProblemDetailsError$inboundSchema, {
167
- ctype: "application/problem+json",
168
- }),
169
- M.jsonErr(500, errors.ProblemDetailsError$inboundSchema, {
170
- ctype: "application/problem+json",
171
- }),
172
- M.fail("4XX"),
173
- M.fail("5XX"),
174
- )(response, req, { extraFields: responseFields });
175
- if (!result.ok) {
176
- return [result, { status: "complete", request: req, response }];
177
- }
178
-
179
- return [result, { status: "complete", request: req, response }];
180
- }
@@ -1,179 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { ClosedEnum } from "../../types/enums.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import * as types from "../../types/primitives.js";
10
- import { smartUnion } from "../../types/smart-union.js";
11
- import { SDKValidationError } from "../errors/sdk-validation-error.js";
12
-
13
- export const PostKycMockApproveLevelInstitutional = {
14
- Institutional: "institutional",
15
- } as const;
16
- export type PostKycMockApproveLevelInstitutional = ClosedEnum<
17
- typeof PostKycMockApproveLevelInstitutional
18
- >;
19
-
20
- export const PostKycMockApproveLevelEnhanced = {
21
- Enhanced: "enhanced",
22
- } as const;
23
- export type PostKycMockApproveLevelEnhanced = ClosedEnum<
24
- typeof PostKycMockApproveLevelEnhanced
25
- >;
26
-
27
- export const PostKycMockApproveLevelStandard = {
28
- Standard: "standard",
29
- } as const;
30
- export type PostKycMockApproveLevelStandard = ClosedEnum<
31
- typeof PostKycMockApproveLevelStandard
32
- >;
33
-
34
- export const PostKycMockApproveLevelBasic = {
35
- Basic: "basic",
36
- } as const;
37
- export type PostKycMockApproveLevelBasic = ClosedEnum<
38
- typeof PostKycMockApproveLevelBasic
39
- >;
40
-
41
- /**
42
- * Verification level
43
- */
44
- export type PostKycMockApproveLevelUnion =
45
- | PostKycMockApproveLevelBasic
46
- | PostKycMockApproveLevelStandard
47
- | PostKycMockApproveLevelEnhanced
48
- | PostKycMockApproveLevelInstitutional;
49
-
50
- export type PostKycMockApproveRequest = {
51
- /**
52
- * Verification level
53
- */
54
- level?:
55
- | PostKycMockApproveLevelBasic
56
- | PostKycMockApproveLevelStandard
57
- | PostKycMockApproveLevelEnhanced
58
- | PostKycMockApproveLevelInstitutional
59
- | undefined;
60
- };
61
-
62
- /**
63
- * Response
64
- */
65
- export type PostKycMockApproveResponse = {
66
- /**
67
- * User ID
68
- */
69
- userId: string;
70
- /**
71
- * Updated status
72
- */
73
- status: string;
74
- /**
75
- * Verification level
76
- */
77
- level: string;
78
- /**
79
- * Rejection reason
80
- */
81
- rejectionReason?: string | undefined;
82
- };
83
-
84
- /** @internal */
85
- export const PostKycMockApproveLevelInstitutional$outboundSchema: z.ZodMiniEnum<
86
- typeof PostKycMockApproveLevelInstitutional
87
- > = z.enum(PostKycMockApproveLevelInstitutional);
88
-
89
- /** @internal */
90
- export const PostKycMockApproveLevelEnhanced$outboundSchema: z.ZodMiniEnum<
91
- typeof PostKycMockApproveLevelEnhanced
92
- > = z.enum(PostKycMockApproveLevelEnhanced);
93
-
94
- /** @internal */
95
- export const PostKycMockApproveLevelStandard$outboundSchema: z.ZodMiniEnum<
96
- typeof PostKycMockApproveLevelStandard
97
- > = z.enum(PostKycMockApproveLevelStandard);
98
-
99
- /** @internal */
100
- export const PostKycMockApproveLevelBasic$outboundSchema: z.ZodMiniEnum<
101
- typeof PostKycMockApproveLevelBasic
102
- > = z.enum(PostKycMockApproveLevelBasic);
103
-
104
- /** @internal */
105
- export type PostKycMockApproveLevelUnion$Outbound =
106
- | string
107
- | string
108
- | string
109
- | string;
110
-
111
- /** @internal */
112
- export const PostKycMockApproveLevelUnion$outboundSchema: z.ZodMiniType<
113
- PostKycMockApproveLevelUnion$Outbound,
114
- PostKycMockApproveLevelUnion
115
- > = smartUnion([
116
- PostKycMockApproveLevelBasic$outboundSchema,
117
- PostKycMockApproveLevelStandard$outboundSchema,
118
- PostKycMockApproveLevelEnhanced$outboundSchema,
119
- PostKycMockApproveLevelInstitutional$outboundSchema,
120
- ]);
121
-
122
- export function postKycMockApproveLevelUnionToJSON(
123
- postKycMockApproveLevelUnion: PostKycMockApproveLevelUnion,
124
- ): string {
125
- return JSON.stringify(
126
- PostKycMockApproveLevelUnion$outboundSchema.parse(
127
- postKycMockApproveLevelUnion,
128
- ),
129
- );
130
- }
131
-
132
- /** @internal */
133
- export type PostKycMockApproveRequest$Outbound = {
134
- level?: string | string | string | string | undefined;
135
- };
136
-
137
- /** @internal */
138
- export const PostKycMockApproveRequest$outboundSchema: z.ZodMiniType<
139
- PostKycMockApproveRequest$Outbound,
140
- PostKycMockApproveRequest
141
- > = z.object({
142
- level: z.optional(
143
- smartUnion([
144
- PostKycMockApproveLevelBasic$outboundSchema,
145
- PostKycMockApproveLevelStandard$outboundSchema,
146
- PostKycMockApproveLevelEnhanced$outboundSchema,
147
- PostKycMockApproveLevelInstitutional$outboundSchema,
148
- ]),
149
- ),
150
- });
151
-
152
- export function postKycMockApproveRequestToJSON(
153
- postKycMockApproveRequest: PostKycMockApproveRequest,
154
- ): string {
155
- return JSON.stringify(
156
- PostKycMockApproveRequest$outboundSchema.parse(postKycMockApproveRequest),
157
- );
158
- }
159
-
160
- /** @internal */
161
- export const PostKycMockApproveResponse$inboundSchema: z.ZodMiniType<
162
- PostKycMockApproveResponse,
163
- unknown
164
- > = z.object({
165
- userId: types.string(),
166
- status: types.string(),
167
- level: types.string(),
168
- rejectionReason: types.optional(types.string()),
169
- });
170
-
171
- export function postKycMockApproveResponseFromJSON(
172
- jsonString: string,
173
- ): SafeParseResult<PostKycMockApproveResponse, SDKValidationError> {
174
- return safeParse(
175
- jsonString,
176
- (x) => PostKycMockApproveResponse$inboundSchema.parse(JSON.parse(x)),
177
- `Failed to parse 'PostKycMockApproveResponse' from JSON`,
178
- );
179
- }
@@ -1,80 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import * as types from "../../types/primitives.js";
9
- import { SDKValidationError } from "../errors/sdk-validation-error.js";
10
-
11
- export type PostKycMockRejectRequest = {
12
- /**
13
- * Rejection reason
14
- */
15
- reason?: string | undefined;
16
- };
17
-
18
- /**
19
- * Response
20
- */
21
- export type PostKycMockRejectResponse = {
22
- /**
23
- * User ID
24
- */
25
- userId: string;
26
- /**
27
- * Updated status
28
- */
29
- status: string;
30
- /**
31
- * Verification level
32
- */
33
- level: string;
34
- /**
35
- * Rejection reason
36
- */
37
- rejectionReason?: string | undefined;
38
- };
39
-
40
- /** @internal */
41
- export type PostKycMockRejectRequest$Outbound = {
42
- reason?: string | undefined;
43
- };
44
-
45
- /** @internal */
46
- export const PostKycMockRejectRequest$outboundSchema: z.ZodMiniType<
47
- PostKycMockRejectRequest$Outbound,
48
- PostKycMockRejectRequest
49
- > = z.object({
50
- reason: z.optional(z.string()),
51
- });
52
-
53
- export function postKycMockRejectRequestToJSON(
54
- postKycMockRejectRequest: PostKycMockRejectRequest,
55
- ): string {
56
- return JSON.stringify(
57
- PostKycMockRejectRequest$outboundSchema.parse(postKycMockRejectRequest),
58
- );
59
- }
60
-
61
- /** @internal */
62
- export const PostKycMockRejectResponse$inboundSchema: z.ZodMiniType<
63
- PostKycMockRejectResponse,
64
- unknown
65
- > = z.object({
66
- userId: types.string(),
67
- status: types.string(),
68
- level: types.string(),
69
- rejectionReason: types.optional(types.string()),
70
- });
71
-
72
- export function postKycMockRejectResponseFromJSON(
73
- jsonString: string,
74
- ): SafeParseResult<PostKycMockRejectResponse, SDKValidationError> {
75
- return safeParse(
76
- jsonString,
77
- (x) => PostKycMockRejectResponse$inboundSchema.parse(JSON.parse(x)),
78
- `Failed to parse 'PostKycMockRejectResponse' from JSON`,
79
- );
80
- }