@workwae/sdk 0.0.0-stage → 0.1.0-alpha.1

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 (56) hide show
  1. package/README.md +233 -2
  2. package/client.d.ts +36 -0
  3. package/contract/accounts/models.d.ts +726 -0
  4. package/contract/accounts/routes.d.ts +1318 -0
  5. package/contract/ai/models.d.ts +30 -0
  6. package/contract/ai/routes.d.ts +89 -0
  7. package/contract/audit-log/models.d.ts +107 -0
  8. package/contract/audit-log/routes.d.ts +72 -0
  9. package/contract/calendar/models.d.ts +837 -0
  10. package/contract/calendar/routes.d.ts +1299 -0
  11. package/contract/connect/models.d.ts +272 -0
  12. package/contract/connect/routes.d.ts +531 -0
  13. package/contract/contacts/models.d.ts +269 -0
  14. package/contract/contacts/routes.d.ts +634 -0
  15. package/contract/errors.d.ts +108 -0
  16. package/contract/events/models.d.ts +2364 -0
  17. package/contract/events/routes.d.ts +107 -0
  18. package/contract/exports/models.d.ts +67 -0
  19. package/contract/exports/routes.d.ts +196 -0
  20. package/contract/identities/models.d.ts +100 -0
  21. package/contract/identities/routes.d.ts +249 -0
  22. package/contract/limits.d.ts +170 -0
  23. package/contract/mail/models.d.ts +528 -0
  24. package/contract/mail/routes.d.ts +749 -0
  25. package/contract/meetings/models.d.ts +232 -0
  26. package/contract/meetings/routes.d.ts +386 -0
  27. package/contract/oauth-apps/models.d.ts +92 -0
  28. package/contract/oauth-apps/routes.d.ts +187 -0
  29. package/contract/org-connections/models.d.ts +383 -0
  30. package/contract/org-connections/routes.d.ts +830 -0
  31. package/contract/primitives.d.ts +140 -0
  32. package/contract/public.d.ts +26 -0
  33. package/contract/reasons.d.ts +711 -0
  34. package/contract/router.d.ts +9773 -0
  35. package/contract/send/models.d.ts +750 -0
  36. package/contract/send/routes.d.ts +1239 -0
  37. package/contract/settings/models.d.ts +103 -0
  38. package/contract/settings/routes.d.ts +110 -0
  39. package/contract/suppressions/models.d.ts +231 -0
  40. package/contract/suppressions/routes.d.ts +317 -0
  41. package/contract/templates/models.d.ts +169 -0
  42. package/contract/templates/routes.d.ts +281 -0
  43. package/contract/threads/models.d.ts +117 -0
  44. package/contract/threads/routes.d.ts +336 -0
  45. package/contract/usage/models.d.ts +213 -0
  46. package/contract/usage/routes.d.ts +81 -0
  47. package/contract/webhooks/models.d.ts +879 -0
  48. package/contract/webhooks/routes.d.ts +839 -0
  49. package/contract/webhooks/signing.d.ts +35 -0
  50. package/errors.d.ts +15 -0
  51. package/index.d.ts +6 -0
  52. package/index.js +4334 -0
  53. package/index.js.map +59 -0
  54. package/package.json +45 -4
  55. package/pagination.d.ts +40 -0
  56. package/webhooks.d.ts +28 -0
@@ -0,0 +1,272 @@
1
+ import * as z from "zod";
2
+ /** How an OAuth-connected mailbox is read: the provider's API, or IMAP and SMTP with XOAUTH2. */
3
+ export declare const MailAccess: z.ZodEnum<{
4
+ imap: "imap";
5
+ api: "api";
6
+ }>;
7
+ export type MailAccess = z.infer<typeof MailAccess>;
8
+ export declare const ConnectOptions: z.ZodObject<{
9
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
10
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
11
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
12
+ none: "none";
13
+ cache: "cache";
14
+ full: "full";
15
+ }>>;
16
+ mailAccess: z.ZodOptional<z.ZodEnum<{
17
+ imap: "imap";
18
+ api: "api";
19
+ }>>;
20
+ sharedMailboxesEnabled: z.ZodOptional<z.ZodBoolean>;
21
+ }, z.core.$strip>;
22
+ export type ConnectOptions = z.infer<typeof ConnectOptions>;
23
+ /** What a hosted connect page offers: an OAuth sign-in, or the IMAP/SMTP form. */
24
+ export declare const ConnectProvider: z.ZodEnum<{
25
+ google: "google";
26
+ microsoft: "microsoft";
27
+ imap: "imap";
28
+ }>;
29
+ export type ConnectProvider = z.infer<typeof ConnectProvider>;
30
+ /** Where a hosted session (account or meeting connect) stands. */
31
+ export declare const ConnectSessionStatus: z.ZodEnum<{
32
+ pending: "pending";
33
+ completed: "completed";
34
+ failed: "failed";
35
+ }>;
36
+ export type ConnectSessionStatus = z.infer<typeof ConnectSessionStatus>;
37
+ /**
38
+ * Why a connect flow failed: the `error` a connect redirect carries (status=error, OAuth and
39
+ * meeting sign-ins, administrator consent, the hosted IMAP form's plan and billing failures) and
40
+ * a failed session's `error`. Not an API reason: these travel in redirect URLs. Every code an
41
+ * OAuth failure carries is one (the API checks this where they flow into a redirect).
42
+ */
43
+ export declare const ConnectErrorCode: z.ZodEnum<{
44
+ session_used: "session_used";
45
+ session_expired: "session_expired";
46
+ provider_not_allowed: "provider_not_allowed";
47
+ access_denied: "access_denied";
48
+ access_token_rejected: "access_token_rejected";
49
+ provider_error: "provider_error";
50
+ provider_unavailable: "provider_unavailable";
51
+ provider_not_configured: "provider_not_configured";
52
+ unsupported_provider: "unsupported_provider";
53
+ token_exchange_failed: "token_exchange_failed";
54
+ invalid_client: "invalid_client";
55
+ invalid_grant: "invalid_grant";
56
+ missing_refresh_token: "missing_refresh_token";
57
+ scope_denied: "scope_denied";
58
+ identity_failed: "identity_failed";
59
+ identity_unavailable: "identity_unavailable";
60
+ credential_conflict: "credential_conflict";
61
+ credential_missing: "credential_missing";
62
+ delegate_missing: "delegate_missing";
63
+ account_exists: "account_exists";
64
+ account_mismatch: "account_mismatch";
65
+ account_not_found: "account_not_found";
66
+ unknown_oauth_app: "unknown_oauth_app";
67
+ oauth_app_mismatch: "oauth_app_mismatch";
68
+ oauth_app_secret_unreadable: "oauth_app_secret_unreadable";
69
+ google_imap_requires_own_app: "google_imap_requires_own_app";
70
+ unknown_meeting_app: "unknown_meeting_app";
71
+ meeting_app_mismatch: "meeting_app_mismatch";
72
+ meeting_app_secret_unreadable: "meeting_app_secret_unreadable";
73
+ consent_failed: "consent_failed";
74
+ consent_required: "consent_required";
75
+ consent_revoked: "consent_revoked";
76
+ consent_unverified: "consent_unverified";
77
+ directory_already_connected: "directory_already_connected";
78
+ directory_mismatch: "directory_mismatch";
79
+ directory_unavailable: "directory_unavailable";
80
+ invalid_certificate: "invalid_certificate";
81
+ invalid_service_account_key: "invalid_service_account_key";
82
+ org_connection_not_found: "org_connection_not_found";
83
+ org_connection_secret_unreadable: "org_connection_secret_unreadable";
84
+ plan_limit_accounts: "plan_limit_accounts";
85
+ plan_module_unavailable: "plan_module_unavailable";
86
+ billing_past_due: "billing_past_due";
87
+ internal_error: "internal_error";
88
+ }>;
89
+ export type ConnectErrorCode = z.infer<typeof ConnectErrorCode>;
90
+ export declare const ConnectSessionPublic: z.ZodObject<{
91
+ tenantName: z.ZodString;
92
+ providers: z.ZodArray<z.ZodEnum<{
93
+ google: "google";
94
+ microsoft: "microsoft";
95
+ imap: "imap";
96
+ }>>;
97
+ microsoftCloud: z.ZodEnum<{
98
+ global: "global";
99
+ "gcc-high": "gcc-high";
100
+ dod: "dod";
101
+ china: "china";
102
+ }>;
103
+ status: z.ZodEnum<{
104
+ pending: "pending";
105
+ completed: "completed";
106
+ failed: "failed";
107
+ }>;
108
+ reauthEmail: z.ZodNullable<z.ZodString>;
109
+ loginHint: z.ZodNullable<z.ZodString>;
110
+ expiresAt: z.ZodPreprocess<z.ZodDate, Date>;
111
+ }, z.core.$strip>;
112
+ export type ConnectSessionPublic = z.infer<typeof ConnectSessionPublic>;
113
+ /** A hosted connect session as its creator sees it: where it stands, and what it connected. */
114
+ export declare const ConnectSession: z.ZodObject<{
115
+ id: z.ZodUUID;
116
+ status: z.ZodEnum<{
117
+ pending: "pending";
118
+ completed: "completed";
119
+ failed: "failed";
120
+ }>;
121
+ error: z.ZodNullable<z.ZodEnum<{
122
+ session_used: "session_used";
123
+ session_expired: "session_expired";
124
+ provider_not_allowed: "provider_not_allowed";
125
+ access_denied: "access_denied";
126
+ access_token_rejected: "access_token_rejected";
127
+ provider_error: "provider_error";
128
+ provider_unavailable: "provider_unavailable";
129
+ provider_not_configured: "provider_not_configured";
130
+ unsupported_provider: "unsupported_provider";
131
+ token_exchange_failed: "token_exchange_failed";
132
+ invalid_client: "invalid_client";
133
+ invalid_grant: "invalid_grant";
134
+ missing_refresh_token: "missing_refresh_token";
135
+ scope_denied: "scope_denied";
136
+ identity_failed: "identity_failed";
137
+ identity_unavailable: "identity_unavailable";
138
+ credential_conflict: "credential_conflict";
139
+ credential_missing: "credential_missing";
140
+ delegate_missing: "delegate_missing";
141
+ account_exists: "account_exists";
142
+ account_mismatch: "account_mismatch";
143
+ account_not_found: "account_not_found";
144
+ unknown_oauth_app: "unknown_oauth_app";
145
+ oauth_app_mismatch: "oauth_app_mismatch";
146
+ oauth_app_secret_unreadable: "oauth_app_secret_unreadable";
147
+ google_imap_requires_own_app: "google_imap_requires_own_app";
148
+ unknown_meeting_app: "unknown_meeting_app";
149
+ meeting_app_mismatch: "meeting_app_mismatch";
150
+ meeting_app_secret_unreadable: "meeting_app_secret_unreadable";
151
+ consent_failed: "consent_failed";
152
+ consent_required: "consent_required";
153
+ consent_revoked: "consent_revoked";
154
+ consent_unverified: "consent_unverified";
155
+ directory_already_connected: "directory_already_connected";
156
+ directory_mismatch: "directory_mismatch";
157
+ directory_unavailable: "directory_unavailable";
158
+ invalid_certificate: "invalid_certificate";
159
+ invalid_service_account_key: "invalid_service_account_key";
160
+ org_connection_not_found: "org_connection_not_found";
161
+ org_connection_secret_unreadable: "org_connection_secret_unreadable";
162
+ plan_limit_accounts: "plan_limit_accounts";
163
+ plan_module_unavailable: "plan_module_unavailable";
164
+ billing_past_due: "billing_past_due";
165
+ internal_error: "internal_error";
166
+ }>>;
167
+ accountId: z.ZodNullable<z.ZodUUID>;
168
+ email: z.ZodNullable<z.ZodString>;
169
+ expiresAt: z.ZodPreprocess<z.ZodDate, Date>;
170
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
171
+ }, z.core.$strip>;
172
+ export type ConnectSession = z.infer<typeof ConnectSession>;
173
+ /** The `state` a redirect flow echoes back. */
174
+ export declare const RedirectState: z.ZodString;
175
+ /** How long a hosted session stays usable. */
176
+ export declare const SessionTtlSeconds: z.ZodDefault<z.ZodNumber>;
177
+ export declare const CreateConnectSession: z.ZodObject<{
178
+ redirectUri: z.ZodOptional<z.ZodURL>;
179
+ providers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
180
+ google: "google";
181
+ microsoft: "microsoft";
182
+ imap: "imap";
183
+ }>>>;
184
+ microsoftCloud: z.ZodDefault<z.ZodEnum<{
185
+ global: "global";
186
+ "gcc-high": "gcc-high";
187
+ dod: "dod";
188
+ china: "china";
189
+ }>>;
190
+ oauthAppIds: z.ZodOptional<z.ZodObject<{
191
+ google: z.ZodOptional<z.ZodUUID>;
192
+ microsoft: z.ZodOptional<z.ZodUUID>;
193
+ }, z.core.$strip>>;
194
+ externalRef: z.ZodOptional<z.ZodString>;
195
+ loginHint: z.ZodOptional<z.ZodEmail>;
196
+ state: z.ZodOptional<z.ZodString>;
197
+ accountId: z.ZodOptional<z.ZodUUID>;
198
+ options: z.ZodOptional<z.ZodObject<{
199
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
200
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
201
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
202
+ none: "none";
203
+ cache: "cache";
204
+ full: "full";
205
+ }>>;
206
+ mailAccess: z.ZodOptional<z.ZodEnum<{
207
+ imap: "imap";
208
+ api: "api";
209
+ }>>;
210
+ sharedMailboxesEnabled: z.ZodOptional<z.ZodBoolean>;
211
+ }, z.core.$strip>>;
212
+ ttlSeconds: z.ZodDefault<z.ZodNumber>;
213
+ }, z.core.$strip>;
214
+ export type CreateConnectSession = z.infer<typeof CreateConnectSession>;
215
+ /** A hosted session's page, to send its owner to. */
216
+ export declare const SessionLink: z.ZodObject<{
217
+ id: z.ZodUUID;
218
+ url: z.ZodURL;
219
+ expiresAt: z.ZodPreprocess<z.ZodDate, Date>;
220
+ }, z.core.$strip>;
221
+ export type SessionLink = z.infer<typeof SessionLink>;
222
+ export declare const ConnectSessionIdInput: z.ZodObject<{
223
+ sessionId: z.ZodUUID;
224
+ }, z.core.$strip>;
225
+ export type ConnectSessionIdInput = z.infer<typeof ConnectSessionIdInput>;
226
+ export declare const StartOAuthRequest: z.ZodObject<{
227
+ provider: z.ZodEnum<{
228
+ google: "google";
229
+ microsoft: "microsoft";
230
+ }>;
231
+ redirectUri: z.ZodURL;
232
+ microsoftCloud: z.ZodDefault<z.ZodEnum<{
233
+ global: "global";
234
+ "gcc-high": "gcc-high";
235
+ dod: "dod";
236
+ china: "china";
237
+ }>>;
238
+ oauthAppId: z.ZodOptional<z.ZodUUID>;
239
+ externalRef: z.ZodOptional<z.ZodString>;
240
+ state: z.ZodOptional<z.ZodString>;
241
+ accountId: z.ZodOptional<z.ZodUUID>;
242
+ options: z.ZodOptional<z.ZodObject<{
243
+ calendarEnabled: z.ZodOptional<z.ZodBoolean>;
244
+ contactsEnabled: z.ZodOptional<z.ZodBoolean>;
245
+ bodyStorage: z.ZodOptional<z.ZodEnum<{
246
+ none: "none";
247
+ cache: "cache";
248
+ full: "full";
249
+ }>>;
250
+ mailAccess: z.ZodOptional<z.ZodEnum<{
251
+ imap: "imap";
252
+ api: "api";
253
+ }>>;
254
+ sharedMailboxesEnabled: z.ZodOptional<z.ZodBoolean>;
255
+ }, z.core.$strip>>;
256
+ }, z.core.$strip>;
257
+ export type StartOAuthRequest = z.infer<typeof StartOAuthRequest>;
258
+ /** Where to send the user to start the headless OAuth flow. */
259
+ export declare const OAuthAuthorization: z.ZodObject<{
260
+ authorizeUrl: z.ZodURL;
261
+ }, z.core.$strip>;
262
+ export type OAuthAuthorization = z.infer<typeof OAuthAuthorization>;
263
+ /** A hosted page's session, by the token in its URL. */
264
+ export declare const SessionTokenInput: z.ZodObject<{
265
+ token: z.ZodString;
266
+ }, z.core.$strip>;
267
+ export type SessionTokenInput = z.infer<typeof SessionTokenInput>;
268
+ /** Where the hosted page sends the browser next (the tenant's redirectUri). */
269
+ export declare const HostedImapResult: z.ZodObject<{
270
+ redirectUrl: z.ZodURL;
271
+ }, z.core.$strip>;
272
+ export type HostedImapResult = z.infer<typeof HostedImapResult>;