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

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 (65) hide show
  1. package/README.md +233 -2
  2. package/client.d.ts +36 -0
  3. package/contract/accounts/models.d.ts +766 -0
  4. package/contract/accounts/routes.d.ts +1480 -0
  5. package/contract/ai/models.d.ts +29 -0
  6. package/contract/ai/routes.d.ts +98 -0
  7. package/contract/audit-log/models.d.ts +121 -0
  8. package/contract/audit-log/routes.d.ts +81 -0
  9. package/contract/calendar/models.d.ts +1012 -0
  10. package/contract/calendar/routes.d.ts +1843 -0
  11. package/contract/connect/models.d.ts +284 -0
  12. package/contract/connect/routes.d.ts +570 -0
  13. package/contract/contacts/models.d.ts +259 -0
  14. package/contract/contacts/routes.d.ts +648 -0
  15. package/contract/email-validation/models.d.ts +119 -0
  16. package/contract/email-validation/routes.d.ts +106 -0
  17. package/contract/errors.d.ts +116 -0
  18. package/contract/events/models.d.ts +2424 -0
  19. package/contract/events/routes.d.ts +117 -0
  20. package/contract/exports/models.d.ts +67 -0
  21. package/contract/exports/routes.d.ts +206 -0
  22. package/contract/identities/models.d.ts +98 -0
  23. package/contract/identities/routes.d.ts +318 -0
  24. package/contract/limits.d.ts +118 -0
  25. package/contract/mail/models.d.ts +571 -0
  26. package/contract/mail/routes.d.ts +1189 -0
  27. package/contract/mcp-keys/models.d.ts +125 -0
  28. package/contract/mcp-keys/routes.d.ts +151 -0
  29. package/contract/meetings/models.d.ts +227 -0
  30. package/contract/meetings/routes.d.ts +405 -0
  31. package/contract/oauth-apps/models.d.ts +86 -0
  32. package/contract/oauth-apps/routes.d.ts +195 -0
  33. package/contract/org-connections/models.d.ts +427 -0
  34. package/contract/org-connections/routes.d.ts +1107 -0
  35. package/contract/plans/credit-packs.d.ts +30 -0
  36. package/contract/plans/models.d.ts +208 -0
  37. package/contract/primitives.d.ts +85 -0
  38. package/contract/public.d.ts +32 -0
  39. package/contract/reasons.d.ts +1222 -0
  40. package/contract/router.d.ts +12986 -0
  41. package/contract/scheduling/models.d.ts +405 -0
  42. package/contract/scheduling/routes.d.ts +756 -0
  43. package/contract/send/models.d.ts +787 -0
  44. package/contract/send/routes.d.ts +1488 -0
  45. package/contract/settings/models.d.ts +163 -0
  46. package/contract/settings/routes.d.ts +162 -0
  47. package/contract/suppressions/models.d.ts +224 -0
  48. package/contract/suppressions/routes.d.ts +365 -0
  49. package/contract/templates/models.d.ts +155 -0
  50. package/contract/templates/routes.d.ts +305 -0
  51. package/contract/threads/models.d.ts +112 -0
  52. package/contract/threads/routes.d.ts +376 -0
  53. package/contract/tracking-domain/models.d.ts +41 -0
  54. package/contract/tracking-domain/routes.d.ts +193 -0
  55. package/contract/usage/models.d.ts +185 -0
  56. package/contract/usage/routes.d.ts +109 -0
  57. package/contract/webhooks/models.d.ts +894 -0
  58. package/contract/webhooks/routes.d.ts +882 -0
  59. package/contract/webhooks/signing.d.ts +19 -0
  60. package/errors.d.ts +15 -0
  61. package/index.d.ts +6 -0
  62. package/index.js +1 -0
  63. package/package.json +44 -4
  64. package/pagination.d.ts +40 -0
  65. package/webhooks.d.ts +28 -0
@@ -0,0 +1,29 @@
1
+ import * as z from "zod";
2
+ export declare const AiDraftFormat: z.ZodEnum<{
3
+ text: "text";
4
+ markdown: "markdown";
5
+ }>;
6
+ export type AiDraftFormat = z.infer<typeof AiDraftFormat>;
7
+ export declare const AiDraftContext: z.ZodObject<{
8
+ accountId: z.ZodOptional<z.ZodUUID>;
9
+ replyToMessageId: z.ZodOptional<z.ZodUUID>;
10
+ currentDraft: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ export type AiDraftContext = z.infer<typeof AiDraftContext>;
13
+ export declare const CreateAiDraft: z.ZodObject<{
14
+ instructions: z.ZodString;
15
+ context: z.ZodOptional<z.ZodObject<{
16
+ accountId: z.ZodOptional<z.ZodUUID>;
17
+ replyToMessageId: z.ZodOptional<z.ZodUUID>;
18
+ currentDraft: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>>;
20
+ format: z.ZodEnum<{
21
+ text: "text";
22
+ markdown: "markdown";
23
+ }>;
24
+ }, z.core.$strip>;
25
+ export type CreateAiDraft = z.infer<typeof CreateAiDraft>;
26
+ export declare const AiDraft: z.ZodObject<{
27
+ text: z.ZodString;
28
+ }, z.core.$strip>;
29
+ export type AiDraft = z.infer<typeof AiDraft>;
@@ -0,0 +1,98 @@
1
+ export declare const ai: {
2
+ draft: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
3
+ instructions: import("zod").ZodString;
4
+ context: import("zod").ZodOptional<import("zod").ZodObject<{
5
+ accountId: import("zod").ZodOptional<import("zod").ZodUUID>;
6
+ replyToMessageId: import("zod").ZodOptional<import("zod").ZodUUID>;
7
+ currentDraft: import("zod").ZodOptional<import("zod").ZodString>;
8
+ }, import("zod/v4/core").$strip>>;
9
+ format: import("zod").ZodEnum<{
10
+ text: "text";
11
+ markdown: "markdown";
12
+ }>;
13
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
14
+ text: import("zod").ZodString;
15
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
16
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
17
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
18
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
19
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
20
+ readonly role_forbidden: "The member's role does not allow the operation.";
21
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
22
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
23
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
24
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
25
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
26
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
27
+ readonly payload_too_large: "The request body is larger than the API accepts.";
28
+ readonly internal_error: "An unexpected failure on our side.";
29
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
30
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
31
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
32
+ }>>, {
33
+ unknown_account: import("../errors.js").DeclaredError<"unknown_account">;
34
+ mail_disabled: {
35
+ status: 409;
36
+ message: string;
37
+ };
38
+ provider_not_found: {
39
+ status: 404;
40
+ message: string;
41
+ };
42
+ provider_forbidden: {
43
+ status: 403;
44
+ message: string;
45
+ };
46
+ ai_disabled: {
47
+ status: 400;
48
+ message: string;
49
+ };
50
+ ai_unavailable: {
51
+ status: 502;
52
+ message: string;
53
+ };
54
+ ai_suspended: {
55
+ status: 502;
56
+ message: string;
57
+ };
58
+ ai_refused: {
59
+ status: 400;
60
+ message: string;
61
+ };
62
+ unknown_message: {
63
+ status: 422;
64
+ message: string;
65
+ };
66
+ provider_unavailable: {
67
+ status: 502;
68
+ message: string;
69
+ };
70
+ provider_throttled: {
71
+ status: 429;
72
+ message: string;
73
+ };
74
+ account_paused: {
75
+ status: 409;
76
+ message: string;
77
+ };
78
+ account_disabled: {
79
+ status: 409;
80
+ message: string;
81
+ };
82
+ account_reauth_required: {
83
+ status: 409;
84
+ message: string;
85
+ };
86
+ account_misconfigured: {
87
+ status: 409;
88
+ message: string;
89
+ };
90
+ plan_required: import("../errors.js").DeclaredError<"plan_required">;
91
+ spend_cap_reached: import("../errors.js").DeclaredError<"spend_cap_reached">;
92
+ plan_limit_ai: import("../errors.js").DeclaredError<"plan_limit_ai">;
93
+ plan_module_unavailable: {
94
+ status: 403;
95
+ message: string;
96
+ };
97
+ }>, Record<never, never>>;
98
+ };
@@ -0,0 +1,121 @@
1
+ import * as z from "zod";
2
+ export declare const AuditActorType: z.ZodEnum<{
3
+ user: "user";
4
+ apiKey: "apiKey";
5
+ accountToken: "accountToken";
6
+ connectSession: "connectSession";
7
+ scimCredential: "scimCredential";
8
+ }>;
9
+ export type AuditActorType = z.infer<typeof AuditActorType>;
10
+ export declare const AuditActor: z.ZodObject<{
11
+ type: z.ZodEnum<{
12
+ user: "user";
13
+ apiKey: "apiKey";
14
+ accountToken: "accountToken";
15
+ connectSession: "connectSession";
16
+ scimCredential: "scimCredential";
17
+ }>;
18
+ id: z.ZodUUID;
19
+ label: z.ZodNullable<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export type AuditActor = z.infer<typeof AuditActor>;
22
+ export declare const AuditSurface: z.ZodEnum<{
23
+ auth: "auth";
24
+ v1: "v1";
25
+ rpc: "rpc";
26
+ mcp: "mcp";
27
+ }>;
28
+ export type AuditSurface = z.infer<typeof AuditSurface>;
29
+ export declare const AuditOutcome: z.ZodEnum<{
30
+ success: "success";
31
+ failure: "failure";
32
+ }>;
33
+ export type AuditOutcome = z.infer<typeof AuditOutcome>;
34
+ export declare const AuditEntry: z.ZodObject<{
35
+ id: z.ZodUUID;
36
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
37
+ actor: z.ZodObject<{
38
+ type: z.ZodEnum<{
39
+ user: "user";
40
+ apiKey: "apiKey";
41
+ accountToken: "accountToken";
42
+ connectSession: "connectSession";
43
+ scimCredential: "scimCredential";
44
+ }>;
45
+ id: z.ZodUUID;
46
+ label: z.ZodNullable<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ action: z.ZodString;
49
+ surface: z.ZodEnum<{
50
+ auth: "auth";
51
+ v1: "v1";
52
+ rpc: "rpc";
53
+ mcp: "mcp";
54
+ }>;
55
+ targets: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
56
+ z.ZodString,
57
+ z.ZodArray<z.ZodString>
58
+ ]>>;
59
+ ip: z.ZodNullable<z.ZodString>;
60
+ userAgent: z.ZodNullable<z.ZodString>;
61
+ status: z.ZodNumber;
62
+ errorReason: z.ZodNullable<z.ZodString>;
63
+ requestId: z.ZodNullable<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ export type AuditEntry = z.infer<typeof AuditEntry>;
66
+ export declare const AuditEntryPage: z.ZodObject<{
67
+ items: z.ZodArray<z.ZodObject<{
68
+ id: z.ZodUUID;
69
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
70
+ actor: z.ZodObject<{
71
+ type: z.ZodEnum<{
72
+ user: "user";
73
+ apiKey: "apiKey";
74
+ accountToken: "accountToken";
75
+ connectSession: "connectSession";
76
+ scimCredential: "scimCredential";
77
+ }>;
78
+ id: z.ZodUUID;
79
+ label: z.ZodNullable<z.ZodString>;
80
+ }, z.core.$strip>;
81
+ action: z.ZodString;
82
+ surface: z.ZodEnum<{
83
+ auth: "auth";
84
+ v1: "v1";
85
+ rpc: "rpc";
86
+ mcp: "mcp";
87
+ }>;
88
+ targets: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
89
+ z.ZodString,
90
+ z.ZodArray<z.ZodString>
91
+ ]>>;
92
+ ip: z.ZodNullable<z.ZodString>;
93
+ userAgent: z.ZodNullable<z.ZodString>;
94
+ status: z.ZodNumber;
95
+ errorReason: z.ZodNullable<z.ZodString>;
96
+ requestId: z.ZodNullable<z.ZodString>;
97
+ }, z.core.$strip>>;
98
+ nextCursor: z.ZodNullable<z.ZodString>;
99
+ }, z.core.$strip>;
100
+ export type AuditEntryPage = z.infer<typeof AuditEntryPage>;
101
+ export declare const ListAuditLogQuery: z.ZodObject<{
102
+ actorType: z.ZodOptional<z.ZodEnum<{
103
+ user: "user";
104
+ apiKey: "apiKey";
105
+ accountToken: "accountToken";
106
+ connectSession: "connectSession";
107
+ scimCredential: "scimCredential";
108
+ }>>;
109
+ actorId: z.ZodOptional<z.ZodUUID>;
110
+ action: z.ZodOptional<z.ZodString>;
111
+ accountId: z.ZodOptional<z.ZodUUID>;
112
+ outcome: z.ZodOptional<z.ZodEnum<{
113
+ success: "success";
114
+ failure: "failure";
115
+ }>>;
116
+ from: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
117
+ to: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
118
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
119
+ cursor: z.ZodOptional<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export type ListAuditLogQuery = z.infer<typeof ListAuditLogQuery>;
@@ -0,0 +1,81 @@
1
+ export declare const auditLog: {
2
+ list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
3
+ actorType: import("zod").ZodOptional<import("zod").ZodEnum<{
4
+ user: "user";
5
+ apiKey: "apiKey";
6
+ accountToken: "accountToken";
7
+ connectSession: "connectSession";
8
+ scimCredential: "scimCredential";
9
+ }>>;
10
+ actorId: import("zod").ZodOptional<import("zod").ZodUUID>;
11
+ action: import("zod").ZodOptional<import("zod").ZodString>;
12
+ accountId: import("zod").ZodOptional<import("zod").ZodUUID>;
13
+ outcome: import("zod").ZodOptional<import("zod").ZodEnum<{
14
+ success: "success";
15
+ failure: "failure";
16
+ }>>;
17
+ from: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodDate, string | Date>>;
18
+ to: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodDate, string | Date>>;
19
+ limit: import("zod").ZodDefault<import("zod").ZodCoercedNumber<unknown>>;
20
+ cursor: import("zod").ZodOptional<import("zod").ZodString>;
21
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
22
+ items: import("zod").ZodArray<import("zod").ZodObject<{
23
+ id: import("zod").ZodUUID;
24
+ createdAt: import("zod").ZodPreprocess<import("zod").ZodDate, Date>;
25
+ actor: import("zod").ZodObject<{
26
+ type: import("zod").ZodEnum<{
27
+ user: "user";
28
+ apiKey: "apiKey";
29
+ accountToken: "accountToken";
30
+ connectSession: "connectSession";
31
+ scimCredential: "scimCredential";
32
+ }>;
33
+ id: import("zod").ZodUUID;
34
+ label: import("zod").ZodNullable<import("zod").ZodString>;
35
+ }, import("zod/v4/core").$strip>;
36
+ action: import("zod").ZodString;
37
+ surface: import("zod").ZodEnum<{
38
+ auth: "auth";
39
+ v1: "v1";
40
+ rpc: "rpc";
41
+ mcp: "mcp";
42
+ }>;
43
+ targets: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [
44
+ import("zod").ZodString,
45
+ import("zod").ZodArray<import("zod").ZodString>
46
+ ]>>;
47
+ ip: import("zod").ZodNullable<import("zod").ZodString>;
48
+ userAgent: import("zod").ZodNullable<import("zod").ZodString>;
49
+ status: import("zod").ZodNumber;
50
+ errorReason: import("zod").ZodNullable<import("zod").ZodString>;
51
+ requestId: import("zod").ZodNullable<import("zod").ZodString>;
52
+ }, import("zod/v4/core").$strip>>;
53
+ nextCursor: import("zod").ZodNullable<import("zod").ZodString>;
54
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, import("../errors.js").DeclaredErrors<{
55
+ readonly invalid_input: "The request does not match the operation's input schema (a malformed body included); data.issues names each problem.";
56
+ readonly unauthenticated: "No usable credential: none was sent, or it is malformed, unknown, revoked or an expired account token.";
57
+ readonly api_key_expired: "The API key is past its expiry (or the grace of the rotation that replaced it).";
58
+ readonly missing_scope: "The API key lacks the scope the operation needs.";
59
+ readonly role_forbidden: "The member's role does not allow the operation.";
60
+ readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
61
+ readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
62
+ readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
63
+ readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
64
+ readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
65
+ readonly overloaded: "The API is shedding load; retry after Retry-After.";
66
+ readonly payload_too_large: "The request body is larger than the API accepts.";
67
+ readonly internal_error: "An unexpected failure on our side.";
68
+ readonly invalid_idempotency_key: "POST only: the Idempotency-Key header is not 1 to 255 printable ASCII characters.";
69
+ readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
70
+ readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
71
+ }>>, {
72
+ invalid_range: {
73
+ status: 400;
74
+ message: string;
75
+ };
76
+ invalid_cursor: {
77
+ status: 400;
78
+ message: string;
79
+ };
80
+ }>, Record<never, never>>;
81
+ };