@factify/sdk 0.3.13 → 0.3.14-rc.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.
- package/README.md +13 -0
- package/dist/commonjs/funcs/organizationsInvitesAccept.d.ts +18 -0
- package/dist/commonjs/funcs/organizationsInvitesAccept.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesAccept.js +131 -0
- package/dist/commonjs/funcs/organizationsInvitesAccept.js.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesCreate.d.ts +18 -0
- package/dist/commonjs/funcs/organizationsInvitesCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesCreate.js +127 -0
- package/dist/commonjs/funcs/organizationsInvitesCreate.js.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesList.d.ts +21 -0
- package/dist/commonjs/funcs/organizationsInvitesList.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesList.js +161 -0
- package/dist/commonjs/funcs/organizationsInvitesList.js.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesResend.d.ts +18 -0
- package/dist/commonjs/funcs/organizationsInvitesResend.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesResend.js +131 -0
- package/dist/commonjs/funcs/organizationsInvitesResend.js.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesRevoke.d.ts +18 -0
- package/dist/commonjs/funcs/organizationsInvitesRevoke.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsInvitesRevoke.js +131 -0
- package/dist/commonjs/funcs/organizationsInvitesRevoke.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/components/acceptorganizationinviteresponse.d.ts +17 -0
- package/dist/commonjs/models/components/acceptorganizationinviteresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/acceptorganizationinviteresponse.js +51 -0
- package/dist/commonjs/models/components/acceptorganizationinviteresponse.js.map +1 -0
- package/dist/commonjs/models/components/createorganizationinviteresponse.d.ts +20 -0
- package/dist/commonjs/models/components/createorganizationinviteresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/createorganizationinviteresponse.js +51 -0
- package/dist/commonjs/models/components/createorganizationinviteresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +7 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +7 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/listorganizationinvitesresponse.d.ts +25 -0
- package/dist/commonjs/models/components/listorganizationinvitesresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/listorganizationinvitesresponse.js +54 -0
- package/dist/commonjs/models/components/listorganizationinvitesresponse.js.map +1 -0
- package/dist/commonjs/models/components/organizationinvite.d.ts +60 -0
- package/dist/commonjs/models/components/organizationinvite.d.ts.map +1 -0
- package/dist/commonjs/models/components/organizationinvite.js +71 -0
- package/dist/commonjs/models/components/organizationinvite.js.map +1 -0
- package/dist/commonjs/models/components/organizationinvitestatus.d.ts +21 -0
- package/dist/commonjs/models/components/organizationinvitestatus.d.ts.map +1 -0
- package/dist/commonjs/models/components/organizationinvitestatus.js +55 -0
- package/dist/commonjs/models/components/organizationinvitestatus.js.map +1 -0
- package/dist/commonjs/models/components/resendorganizationinviteresponse.d.ts +20 -0
- package/dist/commonjs/models/components/resendorganizationinviteresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/resendorganizationinviteresponse.js +51 -0
- package/dist/commonjs/models/components/resendorganizationinviteresponse.js.map +1 -0
- package/dist/commonjs/models/components/revokeorganizationinviteresponse.d.ts +20 -0
- package/dist/commonjs/models/components/revokeorganizationinviteresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/revokeorganizationinviteresponse.js +51 -0
- package/dist/commonjs/models/components/revokeorganizationinviteresponse.js.map +1 -0
- package/dist/commonjs/models/operations/acceptorganizationinvite.d.ts +60 -0
- package/dist/commonjs/models/operations/acceptorganizationinvite.d.ts.map +1 -0
- package/dist/commonjs/models/operations/acceptorganizationinvite.js +85 -0
- package/dist/commonjs/models/operations/acceptorganizationinvite.js.map +1 -0
- package/dist/commonjs/models/operations/createorganizationinvite.d.ts +67 -0
- package/dist/commonjs/models/operations/createorganizationinvite.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createorganizationinvite.js +89 -0
- package/dist/commonjs/models/operations/createorganizationinvite.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +5 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +5 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listorganizationinvites.d.ts +82 -0
- package/dist/commonjs/models/operations/listorganizationinvites.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listorganizationinvites.js +86 -0
- package/dist/commonjs/models/operations/listorganizationinvites.js.map +1 -0
- package/dist/commonjs/models/operations/resendorganizationinvite.d.ts +53 -0
- package/dist/commonjs/models/operations/resendorganizationinvite.d.ts.map +1 -0
- package/dist/commonjs/models/operations/resendorganizationinvite.js +83 -0
- package/dist/commonjs/models/operations/resendorganizationinvite.js.map +1 -0
- package/dist/commonjs/models/operations/revokeorganizationinvite.d.ts +53 -0
- package/dist/commonjs/models/operations/revokeorganizationinvite.d.ts.map +1 -0
- package/dist/commonjs/models/operations/revokeorganizationinvite.js +83 -0
- package/dist/commonjs/models/operations/revokeorganizationinvite.js.map +1 -0
- package/dist/commonjs/sdk/invites.d.ts +43 -0
- package/dist/commonjs/sdk/invites.d.ts.map +1 -0
- package/dist/commonjs/sdk/invites.js +63 -0
- package/dist/commonjs/sdk/invites.js.map +1 -0
- package/dist/commonjs/sdk/organizations.d.ts +3 -0
- package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
- package/dist/commonjs/sdk/organizations.js +4 -0
- package/dist/commonjs/sdk/organizations.js.map +1 -1
- package/dist/esm/funcs/organizationsInvitesAccept.d.ts +18 -0
- package/dist/esm/funcs/organizationsInvitesAccept.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsInvitesAccept.js +95 -0
- package/dist/esm/funcs/organizationsInvitesAccept.js.map +1 -0
- package/dist/esm/funcs/organizationsInvitesCreate.d.ts +18 -0
- package/dist/esm/funcs/organizationsInvitesCreate.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsInvitesCreate.js +91 -0
- package/dist/esm/funcs/organizationsInvitesCreate.js.map +1 -0
- package/dist/esm/funcs/organizationsInvitesList.d.ts +21 -0
- package/dist/esm/funcs/organizationsInvitesList.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsInvitesList.js +125 -0
- package/dist/esm/funcs/organizationsInvitesList.js.map +1 -0
- package/dist/esm/funcs/organizationsInvitesResend.d.ts +18 -0
- package/dist/esm/funcs/organizationsInvitesResend.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsInvitesResend.js +95 -0
- package/dist/esm/funcs/organizationsInvitesResend.js.map +1 -0
- package/dist/esm/funcs/organizationsInvitesRevoke.d.ts +18 -0
- package/dist/esm/funcs/organizationsInvitesRevoke.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsInvitesRevoke.js +95 -0
- package/dist/esm/funcs/organizationsInvitesRevoke.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/components/acceptorganizationinviteresponse.d.ts +17 -0
- package/dist/esm/models/components/acceptorganizationinviteresponse.d.ts.map +1 -0
- package/dist/esm/models/components/acceptorganizationinviteresponse.js +14 -0
- package/dist/esm/models/components/acceptorganizationinviteresponse.js.map +1 -0
- package/dist/esm/models/components/createorganizationinviteresponse.d.ts +20 -0
- package/dist/esm/models/components/createorganizationinviteresponse.d.ts.map +1 -0
- package/dist/esm/models/components/createorganizationinviteresponse.js +14 -0
- package/dist/esm/models/components/createorganizationinviteresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +7 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +7 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/listorganizationinvitesresponse.d.ts +25 -0
- package/dist/esm/models/components/listorganizationinvitesresponse.d.ts.map +1 -0
- package/dist/esm/models/components/listorganizationinvitesresponse.js +17 -0
- package/dist/esm/models/components/listorganizationinvitesresponse.js.map +1 -0
- package/dist/esm/models/components/organizationinvite.d.ts +60 -0
- package/dist/esm/models/components/organizationinvite.d.ts.map +1 -0
- package/dist/esm/models/components/organizationinvite.js +34 -0
- package/dist/esm/models/components/organizationinvite.js.map +1 -0
- package/dist/esm/models/components/organizationinvitestatus.d.ts +21 -0
- package/dist/esm/models/components/organizationinvitestatus.d.ts.map +1 -0
- package/dist/esm/models/components/organizationinvitestatus.js +19 -0
- package/dist/esm/models/components/organizationinvitestatus.js.map +1 -0
- package/dist/esm/models/components/resendorganizationinviteresponse.d.ts +20 -0
- package/dist/esm/models/components/resendorganizationinviteresponse.d.ts.map +1 -0
- package/dist/esm/models/components/resendorganizationinviteresponse.js +14 -0
- package/dist/esm/models/components/resendorganizationinviteresponse.js.map +1 -0
- package/dist/esm/models/components/revokeorganizationinviteresponse.d.ts +20 -0
- package/dist/esm/models/components/revokeorganizationinviteresponse.d.ts.map +1 -0
- package/dist/esm/models/components/revokeorganizationinviteresponse.js +14 -0
- package/dist/esm/models/components/revokeorganizationinviteresponse.js.map +1 -0
- package/dist/esm/models/operations/acceptorganizationinvite.d.ts +60 -0
- package/dist/esm/models/operations/acceptorganizationinvite.d.ts.map +1 -0
- package/dist/esm/models/operations/acceptorganizationinvite.js +46 -0
- package/dist/esm/models/operations/acceptorganizationinvite.js.map +1 -0
- package/dist/esm/models/operations/createorganizationinvite.d.ts +67 -0
- package/dist/esm/models/operations/createorganizationinvite.d.ts.map +1 -0
- package/dist/esm/models/operations/createorganizationinvite.js +50 -0
- package/dist/esm/models/operations/createorganizationinvite.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +5 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +5 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listorganizationinvites.d.ts +82 -0
- package/dist/esm/models/operations/listorganizationinvites.d.ts.map +1 -0
- package/dist/esm/models/operations/listorganizationinvites.js +48 -0
- package/dist/esm/models/operations/listorganizationinvites.js.map +1 -0
- package/dist/esm/models/operations/resendorganizationinvite.d.ts +53 -0
- package/dist/esm/models/operations/resendorganizationinvite.d.ts.map +1 -0
- package/dist/esm/models/operations/resendorganizationinvite.js +44 -0
- package/dist/esm/models/operations/resendorganizationinvite.js.map +1 -0
- package/dist/esm/models/operations/revokeorganizationinvite.d.ts +53 -0
- package/dist/esm/models/operations/revokeorganizationinvite.d.ts.map +1 -0
- package/dist/esm/models/operations/revokeorganizationinvite.js +44 -0
- package/dist/esm/models/operations/revokeorganizationinvite.js.map +1 -0
- package/dist/esm/sdk/invites.d.ts +43 -0
- package/dist/esm/sdk/invites.d.ts.map +1 -0
- package/dist/esm/sdk/invites.js +59 -0
- package/dist/esm/sdk/invites.js.map +1 -0
- package/dist/esm/sdk/organizations.d.ts +3 -0
- package/dist/esm/sdk/organizations.d.ts.map +1 -1
- package/dist/esm/sdk/organizations.js +4 -0
- package/dist/esm/sdk/organizations.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/openapi.json +912 -1
- package/package.json +1 -1
- package/src/funcs/organizationsInvitesAccept.ts +188 -0
- package/src/funcs/organizationsInvitesCreate.ts +184 -0
- package/src/funcs/organizationsInvitesList.ts +256 -0
- package/src/funcs/organizationsInvitesResend.ts +188 -0
- package/src/funcs/organizationsInvitesRevoke.ts +188 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/acceptorganizationinviteresponse.ts +37 -0
- package/src/models/components/createorganizationinviteresponse.ts +43 -0
- package/src/models/components/index.ts +7 -0
- package/src/models/components/listorganizationinvitesresponse.ts +50 -0
- package/src/models/components/organizationinvite.ts +105 -0
- package/src/models/components/organizationinvitestatus.ts +35 -0
- package/src/models/components/resendorganizationinviteresponse.ts +43 -0
- package/src/models/components/revokeorganizationinviteresponse.ts +43 -0
- package/src/models/operations/acceptorganizationinvite.ts +142 -0
- package/src/models/operations/createorganizationinvite.ts +156 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/listorganizationinvites.ts +158 -0
- package/src/models/operations/resendorganizationinvite.ts +134 -0
- package/src/models/operations/revokeorganizationinvite.ts +134 -0
- package/src/sdk/invites.ts +102 -0
- package/src/sdk/organizations.ts +6 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { FactifyCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { FactifyError } from "../models/errors/factifyerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Resend an invitation email
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Resend an invitation email to the recipient. Useful if the original email was lost or expired. Requires permission to invite organization members.
|
|
34
|
+
*/
|
|
35
|
+
export function organizationsInvitesResend(
|
|
36
|
+
client: FactifyCore,
|
|
37
|
+
request: operations.ResendOrganizationInviteRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.ResendOrganizationInviteResponse,
|
|
42
|
+
| errors.ErrorT
|
|
43
|
+
| FactifyError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: FactifyCore,
|
|
62
|
+
request: operations.ResendOrganizationInviteRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.ResendOrganizationInviteResponse,
|
|
68
|
+
| errors.ErrorT
|
|
69
|
+
| FactifyError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) =>
|
|
84
|
+
z.parse(operations.ResendOrganizationInviteRequest$outboundSchema, value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = encodeJSON("body", payload.body, { explode: true });
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
invite_id: encodeSimple("invite_id", payload.invite_id, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
organization_id: encodeSimple("organization_id", payload.organization_id, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const path = pathToFunc(
|
|
105
|
+
"/v1beta/organizations/{organization_id}/invites/{invite_id}:resend",
|
|
106
|
+
)(pathParams);
|
|
107
|
+
|
|
108
|
+
const headers = new Headers(compactMap({
|
|
109
|
+
"Content-Type": "application/json",
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
114
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "resendOrganizationInvite",
|
|
121
|
+
oAuth2Scopes: null,
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: client._options.bearerAuth,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| { strategy: "none" },
|
|
129
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const requestRes = client._createRequest(context, {
|
|
133
|
+
security: requestSecurity,
|
|
134
|
+
method: "POST",
|
|
135
|
+
baseURL: options?.serverURL,
|
|
136
|
+
path: path,
|
|
137
|
+
headers: headers,
|
|
138
|
+
body: body,
|
|
139
|
+
userAgent: client._options.userAgent,
|
|
140
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
141
|
+
}, options);
|
|
142
|
+
if (!requestRes.ok) {
|
|
143
|
+
return [requestRes, { status: "invalid" }];
|
|
144
|
+
}
|
|
145
|
+
const req = requestRes.value;
|
|
146
|
+
|
|
147
|
+
const doResult = await client._do(req, {
|
|
148
|
+
context,
|
|
149
|
+
errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "5XX"],
|
|
150
|
+
retryConfig: context.retryConfig,
|
|
151
|
+
retryCodes: context.retryCodes,
|
|
152
|
+
});
|
|
153
|
+
if (!doResult.ok) {
|
|
154
|
+
return [doResult, { status: "request-error", request: req }];
|
|
155
|
+
}
|
|
156
|
+
const response = doResult.value;
|
|
157
|
+
|
|
158
|
+
const responseFields = {
|
|
159
|
+
HttpMeta: { Response: response, Request: req },
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const [result] = await M.match<
|
|
163
|
+
operations.ResendOrganizationInviteResponse,
|
|
164
|
+
| errors.ErrorT
|
|
165
|
+
| FactifyError
|
|
166
|
+
| ResponseValidationError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| InvalidRequestError
|
|
171
|
+
| UnexpectedClientError
|
|
172
|
+
| SDKValidationError
|
|
173
|
+
>(
|
|
174
|
+
M.json(200, operations.ResendOrganizationInviteResponse$inboundSchema, {
|
|
175
|
+
key: "ResendOrganizationInviteResponse",
|
|
176
|
+
}),
|
|
177
|
+
M.jsonErr([400, 401, 403, 404], errors.ErrorT$inboundSchema),
|
|
178
|
+
M.jsonErr(429, errors.ErrorT$inboundSchema, { hdrs: true }),
|
|
179
|
+
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
180
|
+
M.fail("4XX"),
|
|
181
|
+
M.fail("5XX"),
|
|
182
|
+
)(response, req, { extraFields: responseFields });
|
|
183
|
+
if (!result.ok) {
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { FactifyCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { FactifyError } from "../models/errors/factifyerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Revoke an invitation
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Revoke a pending invitation, preventing the recipient from joining. Requires permission to manage organization members.
|
|
34
|
+
*/
|
|
35
|
+
export function organizationsInvitesRevoke(
|
|
36
|
+
client: FactifyCore,
|
|
37
|
+
request: operations.RevokeOrganizationInviteRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.RevokeOrganizationInviteResponse,
|
|
42
|
+
| errors.ErrorT
|
|
43
|
+
| FactifyError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: FactifyCore,
|
|
62
|
+
request: operations.RevokeOrganizationInviteRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.RevokeOrganizationInviteResponse,
|
|
68
|
+
| errors.ErrorT
|
|
69
|
+
| FactifyError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) =>
|
|
84
|
+
z.parse(operations.RevokeOrganizationInviteRequest$outboundSchema, value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = encodeJSON("body", payload.body, { explode: true });
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
invite_id: encodeSimple("invite_id", payload.invite_id, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
organization_id: encodeSimple("organization_id", payload.organization_id, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const path = pathToFunc(
|
|
105
|
+
"/v1beta/organizations/{organization_id}/invites/{invite_id}:revoke",
|
|
106
|
+
)(pathParams);
|
|
107
|
+
|
|
108
|
+
const headers = new Headers(compactMap({
|
|
109
|
+
"Content-Type": "application/json",
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
114
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "revokeOrganizationInvite",
|
|
121
|
+
oAuth2Scopes: null,
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: client._options.bearerAuth,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| { strategy: "none" },
|
|
129
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const requestRes = client._createRequest(context, {
|
|
133
|
+
security: requestSecurity,
|
|
134
|
+
method: "POST",
|
|
135
|
+
baseURL: options?.serverURL,
|
|
136
|
+
path: path,
|
|
137
|
+
headers: headers,
|
|
138
|
+
body: body,
|
|
139
|
+
userAgent: client._options.userAgent,
|
|
140
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
141
|
+
}, options);
|
|
142
|
+
if (!requestRes.ok) {
|
|
143
|
+
return [requestRes, { status: "invalid" }];
|
|
144
|
+
}
|
|
145
|
+
const req = requestRes.value;
|
|
146
|
+
|
|
147
|
+
const doResult = await client._do(req, {
|
|
148
|
+
context,
|
|
149
|
+
errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "5XX"],
|
|
150
|
+
retryConfig: context.retryConfig,
|
|
151
|
+
retryCodes: context.retryCodes,
|
|
152
|
+
});
|
|
153
|
+
if (!doResult.ok) {
|
|
154
|
+
return [doResult, { status: "request-error", request: req }];
|
|
155
|
+
}
|
|
156
|
+
const response = doResult.value;
|
|
157
|
+
|
|
158
|
+
const responseFields = {
|
|
159
|
+
HttpMeta: { Response: response, Request: req },
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const [result] = await M.match<
|
|
163
|
+
operations.RevokeOrganizationInviteResponse,
|
|
164
|
+
| errors.ErrorT
|
|
165
|
+
| FactifyError
|
|
166
|
+
| ResponseValidationError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| InvalidRequestError
|
|
171
|
+
| UnexpectedClientError
|
|
172
|
+
| SDKValidationError
|
|
173
|
+
>(
|
|
174
|
+
M.json(200, operations.RevokeOrganizationInviteResponse$inboundSchema, {
|
|
175
|
+
key: "RevokeOrganizationInviteResponse",
|
|
176
|
+
}),
|
|
177
|
+
M.jsonErr([400, 401, 403, 404], errors.ErrorT$inboundSchema),
|
|
178
|
+
M.jsonErr(429, errors.ErrorT$inboundSchema, { hdrs: true }),
|
|
179
|
+
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
180
|
+
M.fail("4XX"),
|
|
181
|
+
M.fail("5XX"),
|
|
182
|
+
)(response, req, { extraFields: responseFields });
|
|
183
|
+
if (!result.ok) {
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "1.0.0",
|
|
68
|
-
sdkVersion: "0.3.
|
|
69
|
-
genVersion: "2.
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.3.
|
|
68
|
+
sdkVersion: "0.3.14-rc.3",
|
|
69
|
+
genVersion: "2.801.2",
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.3.14-rc.3 2.801.2 1.0.0 @factify/sdk",
|
|
71
71
|
} as const;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import { Organization, Organization$inboundSchema } from "./organization.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* AcceptOrganizationInviteResponse contains the organization the user joined.
|
|
13
|
+
*/
|
|
14
|
+
export type AcceptOrganizationInviteResponse = {
|
|
15
|
+
/**
|
|
16
|
+
* Organization represents a Factify organization.
|
|
17
|
+
*/
|
|
18
|
+
organization: Organization;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const AcceptOrganizationInviteResponse$inboundSchema: z.ZodMiniType<
|
|
23
|
+
AcceptOrganizationInviteResponse,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
organization: Organization$inboundSchema,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export function acceptOrganizationInviteResponseFromJSON(
|
|
30
|
+
jsonString: string,
|
|
31
|
+
): SafeParseResult<AcceptOrganizationInviteResponse, SDKValidationError> {
|
|
32
|
+
return safeParse(
|
|
33
|
+
jsonString,
|
|
34
|
+
(x) => AcceptOrganizationInviteResponse$inboundSchema.parse(JSON.parse(x)),
|
|
35
|
+
`Failed to parse 'AcceptOrganizationInviteResponse' from JSON`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
OrganizationInvite,
|
|
11
|
+
OrganizationInvite$inboundSchema,
|
|
12
|
+
} from "./organizationinvite.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* CreateOrganizationInviteResponse contains the created invitation.
|
|
16
|
+
*/
|
|
17
|
+
export type CreateOrganizationInviteResponse = {
|
|
18
|
+
/**
|
|
19
|
+
* OrganizationInvite represents an invitation to join an organization.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* accepted_fields_consistency // accepted_at and accepted_by must both be set or both be unset
|
|
23
|
+
*/
|
|
24
|
+
invite: OrganizationInvite;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const CreateOrganizationInviteResponse$inboundSchema: z.ZodMiniType<
|
|
29
|
+
CreateOrganizationInviteResponse,
|
|
30
|
+
unknown
|
|
31
|
+
> = z.object({
|
|
32
|
+
invite: OrganizationInvite$inboundSchema,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export function createOrganizationInviteResponseFromJSON(
|
|
36
|
+
jsonString: string,
|
|
37
|
+
): SafeParseResult<CreateOrganizationInviteResponse, SDKValidationError> {
|
|
38
|
+
return safeParse(
|
|
39
|
+
jsonString,
|
|
40
|
+
(x) => CreateOrganizationInviteResponse$inboundSchema.parse(JSON.parse(x)),
|
|
41
|
+
`Failed to parse 'CreateOrganizationInviteResponse' from JSON`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
export * from "./acceptorganizationinviteresponse.js";
|
|
5
6
|
export * from "./accesslevel.js";
|
|
6
7
|
export * from "./apikey.js";
|
|
7
8
|
export * from "./createapikeyrequest.js";
|
|
8
9
|
export * from "./createapikeyresponse.js";
|
|
9
10
|
export * from "./createdocumentrequest.js";
|
|
10
11
|
export * from "./createdocumentresponse.js";
|
|
12
|
+
export * from "./createorganizationinviteresponse.js";
|
|
11
13
|
export * from "./createorganizationrequest.js";
|
|
12
14
|
export * from "./createorganizationresponse.js";
|
|
13
15
|
export * from "./createversionrequest.js";
|
|
@@ -22,13 +24,18 @@ export * from "./httpmetadata.js";
|
|
|
22
24
|
export * from "./listapikeysresponse.js";
|
|
23
25
|
export * from "./listdocumentpoliciesresponse.js";
|
|
24
26
|
export * from "./listdocumentsresponse.js";
|
|
27
|
+
export * from "./listorganizationinvitesresponse.js";
|
|
25
28
|
export * from "./listorganizationsresponse.js";
|
|
26
29
|
export * from "./listversionsresponse.js";
|
|
27
30
|
export * from "./organization.js";
|
|
31
|
+
export * from "./organizationinvite.js";
|
|
32
|
+
export * from "./organizationinvitestatus.js";
|
|
28
33
|
export * from "./pagination.js";
|
|
29
34
|
export * from "./policy.js";
|
|
30
35
|
export * from "./processingstatus.js";
|
|
36
|
+
export * from "./resendorganizationinviteresponse.js";
|
|
31
37
|
export * from "./revokeapikeyresponse.js";
|
|
38
|
+
export * from "./revokeorganizationinviteresponse.js";
|
|
32
39
|
export * from "./security.js";
|
|
33
40
|
export * from "./updatedocumentresponse.js";
|
|
34
41
|
export * from "./user.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
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/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
OrganizationInvite,
|
|
12
|
+
OrganizationInvite$inboundSchema,
|
|
13
|
+
} from "./organizationinvite.js";
|
|
14
|
+
import { Pagination, Pagination$inboundSchema } from "./pagination.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* ListOrganizationInvitesResponse contains a page of invitations.
|
|
18
|
+
*/
|
|
19
|
+
export type ListOrganizationInvitesResponse = {
|
|
20
|
+
/**
|
|
21
|
+
* List of invitations.
|
|
22
|
+
*/
|
|
23
|
+
items?: Array<OrganizationInvite> | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Pagination contains cursor-based pagination metadata.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Follows Google AIP-158 for pagination field naming.
|
|
29
|
+
*/
|
|
30
|
+
pagination: Pagination;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const ListOrganizationInvitesResponse$inboundSchema: z.ZodMiniType<
|
|
35
|
+
ListOrganizationInvitesResponse,
|
|
36
|
+
unknown
|
|
37
|
+
> = z.object({
|
|
38
|
+
items: types.optional(z.array(OrganizationInvite$inboundSchema)),
|
|
39
|
+
pagination: Pagination$inboundSchema,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export function listOrganizationInvitesResponseFromJSON(
|
|
43
|
+
jsonString: string,
|
|
44
|
+
): SafeParseResult<ListOrganizationInvitesResponse, SDKValidationError> {
|
|
45
|
+
return safeParse(
|
|
46
|
+
jsonString,
|
|
47
|
+
(x) => ListOrganizationInvitesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
48
|
+
`Failed to parse 'ListOrganizationInvitesResponse' from JSON`,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
OrganizationInviteStatus,
|
|
13
|
+
OrganizationInviteStatus$inboundSchema,
|
|
14
|
+
} from "./organizationinvitestatus.js";
|
|
15
|
+
import { User, User$inboundSchema } from "./user.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* OrganizationInvite represents an invitation to join an organization.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* accepted_fields_consistency // accepted_at and accepted_by must both be set or both be unset
|
|
22
|
+
*/
|
|
23
|
+
export type OrganizationInvite = {
|
|
24
|
+
/**
|
|
25
|
+
* When the invitation was accepted (if accepted).
|
|
26
|
+
*/
|
|
27
|
+
acceptedAt?: Date | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* User represents a user or service account.
|
|
30
|
+
*/
|
|
31
|
+
acceptedBy?: User | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* When the invitation was created.
|
|
34
|
+
*/
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
/**
|
|
37
|
+
* Email address of the recipient.
|
|
38
|
+
*/
|
|
39
|
+
email: string;
|
|
40
|
+
/**
|
|
41
|
+
* When the invitation expires.
|
|
42
|
+
*/
|
|
43
|
+
expiresAt: Date;
|
|
44
|
+
/**
|
|
45
|
+
* Unique identifier for the invitation.
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
/**
|
|
49
|
+
* Custom message from sender to recipient (if provided).
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* Max 2000 bytes to support ~500 multibyte characters.
|
|
53
|
+
*/
|
|
54
|
+
message?: string | null | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Organization the invitation is for.
|
|
57
|
+
*/
|
|
58
|
+
organizationId: string;
|
|
59
|
+
/**
|
|
60
|
+
* User represents a user or service account.
|
|
61
|
+
*/
|
|
62
|
+
sender: User;
|
|
63
|
+
/**
|
|
64
|
+
* OrganizationInviteStatus represents the state of an organization invitation.
|
|
65
|
+
*/
|
|
66
|
+
status: OrganizationInviteStatus;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
export const OrganizationInvite$inboundSchema: z.ZodMiniType<
|
|
71
|
+
OrganizationInvite,
|
|
72
|
+
unknown
|
|
73
|
+
> = z.pipe(
|
|
74
|
+
z.object({
|
|
75
|
+
accepted_at: types.optional(types.date()),
|
|
76
|
+
accepted_by: types.optional(User$inboundSchema),
|
|
77
|
+
created_at: types.date(),
|
|
78
|
+
email: types.string(),
|
|
79
|
+
expires_at: types.date(),
|
|
80
|
+
id: types.string(),
|
|
81
|
+
message: z.optional(z.nullable(types.string())),
|
|
82
|
+
organization_id: types.string(),
|
|
83
|
+
sender: User$inboundSchema,
|
|
84
|
+
status: OrganizationInviteStatus$inboundSchema,
|
|
85
|
+
}),
|
|
86
|
+
z.transform((v) => {
|
|
87
|
+
return remap$(v, {
|
|
88
|
+
"accepted_at": "acceptedAt",
|
|
89
|
+
"accepted_by": "acceptedBy",
|
|
90
|
+
"created_at": "createdAt",
|
|
91
|
+
"expires_at": "expiresAt",
|
|
92
|
+
"organization_id": "organizationId",
|
|
93
|
+
});
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
export function organizationInviteFromJSON(
|
|
98
|
+
jsonString: string,
|
|
99
|
+
): SafeParseResult<OrganizationInvite, SDKValidationError> {
|
|
100
|
+
return safeParse(
|
|
101
|
+
jsonString,
|
|
102
|
+
(x) => OrganizationInvite$inboundSchema.parse(JSON.parse(x)),
|
|
103
|
+
`Failed to parse 'OrganizationInvite' from JSON`,
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* OrganizationInviteStatus represents the state of an organization invitation.
|
|
11
|
+
*/
|
|
12
|
+
export const OrganizationInviteStatus = {
|
|
13
|
+
OrganizationInviteStatusUnspecified: "ORGANIZATION_INVITE_STATUS_UNSPECIFIED",
|
|
14
|
+
OrganizationInviteStatusPending: "ORGANIZATION_INVITE_STATUS_PENDING",
|
|
15
|
+
OrganizationInviteStatusAccepted: "ORGANIZATION_INVITE_STATUS_ACCEPTED",
|
|
16
|
+
OrganizationInviteStatusExpired: "ORGANIZATION_INVITE_STATUS_EXPIRED",
|
|
17
|
+
OrganizationInviteStatusRevoked: "ORGANIZATION_INVITE_STATUS_REVOKED",
|
|
18
|
+
} as const;
|
|
19
|
+
/**
|
|
20
|
+
* OrganizationInviteStatus represents the state of an organization invitation.
|
|
21
|
+
*/
|
|
22
|
+
export type OrganizationInviteStatus = OpenEnum<
|
|
23
|
+
typeof OrganizationInviteStatus
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const OrganizationInviteStatus$inboundSchema: z.ZodMiniType<
|
|
28
|
+
OrganizationInviteStatus,
|
|
29
|
+
unknown
|
|
30
|
+
> = openEnums.inboundSchema(OrganizationInviteStatus);
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const OrganizationInviteStatus$outboundSchema: z.ZodMiniType<
|
|
33
|
+
string,
|
|
34
|
+
OrganizationInviteStatus
|
|
35
|
+
> = openEnums.outboundSchema(OrganizationInviteStatus);
|