samva 0.16.0 → 0.18.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.
- package/AGENTS.md +9 -1
- package/README.md +57 -1
- package/dist/{rolldown-runtime-D7D4PA-g.js → _virtual/_rolldown/runtime.js} +1 -1
- package/dist/client/client/client.gen.js +174 -0
- package/dist/client/client/utils.gen.js +177 -0
- package/dist/client/client.gen.js +8 -0
- package/dist/client/core/auth.gen.js +12 -0
- package/dist/client/core/bodySerializer.gen.js +6 -0
- package/dist/client/core/params.gen.js +77 -0
- package/dist/client/core/pathSerializer.gen.js +82 -0
- package/dist/client/core/serverSentEvents.gen.js +96 -0
- package/dist/client/core/utils.gen.js +78 -0
- package/dist/client/sdk.gen.d.ts +174 -3
- package/dist/{promises-KrA2nSLg.js → client/sdk.gen.js} +464 -2289
- package/dist/client/types.gen.d.ts +1126 -11
- package/dist/client-attribution.js +9 -0
- package/dist/effect/analytics.d.ts +6 -6
- package/dist/effect/analytics.js +11 -9
- package/dist/effect/api-keys.d.ts +13 -13
- package/dist/effect/api-keys.js +13 -12
- package/dist/effect/attachments.d.ts +4 -4
- package/dist/effect/attachments.js +9 -7
- package/dist/effect/brands.d.ts +7 -7
- package/dist/effect/brands.js +12 -10
- package/dist/effect/campaigns.d.ts +18 -18
- package/dist/effect/campaigns.js +17 -15
- package/dist/effect/categories.d.ts +2 -2
- package/dist/effect/categories.js +95 -1
- package/dist/effect/client.d.ts +1 -1
- package/dist/effect/client.js +4 -5
- package/dist/effect/contact-groups.d.ts +14 -14
- package/dist/effect/contact-groups.js +15 -13
- package/dist/effect/contacts.d.ts +77 -25
- package/dist/effect/contacts.js +27 -22
- package/dist/effect/conversations.d.ts +17 -17
- package/dist/effect/conversations.js +18 -16
- package/dist/effect/custom-fields.d.ts +4 -4
- package/dist/effect/custom-fields.js +9 -7
- package/dist/effect/email.d.ts +78 -77
- package/dist/effect/email.js +68 -65
- package/dist/effect/errors.d.ts +2 -0
- package/dist/effect/errors.js +3 -0
- package/dist/effect/events.d.ts +121 -0
- package/dist/effect/events.js +17 -0
- package/dist/effect/extension-installations.d.ts +11 -11
- package/dist/effect/extension-installations.js +14 -12
- package/dist/effect/extensions.d.ts +9 -9
- package/dist/effect/extensions.js +10 -8
- package/dist/effect/feedback.d.ts +2 -2
- package/dist/effect/feedback.js +6 -5
- package/dist/effect/generated/analytics.d.ts +715 -0
- package/dist/effect/generated/analytics.js +188 -0
- package/dist/effect/generated/api-keys.d.ts +1627 -0
- package/dist/effect/generated/api-keys.js +249 -0
- package/dist/effect/generated/attachments.d.ts +554 -0
- package/dist/effect/generated/attachments.js +125 -0
- package/dist/effect/generated/brands.d.ts +1118 -0
- package/dist/effect/generated/brands.js +155 -0
- package/dist/effect/generated/campaigns.d.ts +3783 -0
- package/dist/effect/generated/campaigns.js +491 -0
- package/dist/effect/generated/contact-events.d.ts +158 -0
- package/dist/effect/generated/contact-events.js +37 -0
- package/dist/effect/generated/contact-groups.d.ts +1445 -0
- package/dist/effect/generated/contact-groups.js +419 -0
- package/dist/effect/generated/contacts.d.ts +3789 -0
- package/dist/effect/generated/contacts.js +709 -0
- package/dist/effect/generated/conversations.d.ts +2870 -0
- package/dist/effect/generated/conversations.js +461 -0
- package/dist/effect/generated/custom-fields.d.ts +562 -0
- package/dist/effect/generated/custom-fields.js +162 -0
- package/dist/effect/generated/email.d.ts +10622 -0
- package/dist/effect/generated/email.js +2347 -0
- package/dist/effect/generated/events.d.ts +463 -0
- package/dist/effect/generated/events.js +70 -0
- package/dist/effect/generated/extension-installations.d.ts +1786 -0
- package/dist/effect/generated/extension-installations.js +382 -0
- package/dist/effect/generated/extensions.d.ts +927 -0
- package/dist/effect/generated/extensions.js +203 -0
- package/dist/effect/generated/feedback.d.ts +116 -0
- package/dist/effect/generated/feedback.js +43 -0
- package/dist/effect/generated/index.d.ts +61 -0
- package/dist/effect/generated/journeys.d.ts +6135 -0
- package/dist/effect/generated/journeys.js +464 -0
- package/dist/effect/generated/mailboxes.d.ts +13641 -0
- package/dist/effect/generated/mailboxes.js +2312 -0
- package/dist/effect/generated/media.d.ts +741 -0
- package/dist/effect/generated/media.js +181 -0
- package/dist/effect/generated/messages.d.ts +2355 -0
- package/dist/effect/generated/messages.js +671 -0
- package/dist/effect/generated/namespaces.d.ts +654 -0
- package/dist/effect/generated/namespaces.js +135 -0
- package/dist/effect/generated/operations.d.ts +514 -0
- package/dist/effect/generated/operations.js +80 -0
- package/dist/effect/generated/organizations.d.ts +1111 -0
- package/dist/effect/generated/organizations.js +231 -0
- package/dist/effect/generated/scheduled-messages.d.ts +1798 -0
- package/dist/effect/generated/scheduled-messages.js +190 -0
- package/dist/effect/generated/shared.d.ts +3250 -0
- package/dist/effect/generated/shared.js +1053 -0
- package/dist/effect/generated/subscriptions.d.ts +188 -0
- package/dist/effect/generated/subscriptions.js +61 -0
- package/dist/effect/generated/templates.d.ts +8177 -0
- package/dist/effect/generated/templates.js +2214 -0
- package/dist/effect/generated/unsubscribe-groups.d.ts +1153 -0
- package/dist/effect/generated/unsubscribe-groups.js +267 -0
- package/dist/effect/generated/webhooks.d.ts +1697 -0
- package/dist/effect/generated/webhooks.js +500 -0
- package/dist/effect/generated/whoami.d.ts +291 -0
- package/dist/effect/generated/whoami.js +54 -0
- package/dist/effect/generated-metadata.d.ts +1627 -0
- package/dist/effect/generated-metadata.js +919 -0
- package/dist/effect/index.d.ts +3 -2
- package/dist/effect/index.js +33 -31
- package/dist/effect/internal/client.d.ts +10 -7
- package/dist/effect/internal/client.js +69 -0
- package/dist/effect/internal/email-sender.d.ts +17 -0
- package/dist/effect/internal/email-sender.js +21 -0
- package/dist/effect/internal/mailbox-events.js +33 -0
- package/dist/effect/internal/operation.d.ts +12 -72
- package/dist/effect/internal/operation.js +116 -0
- package/dist/effect/internal/send.d.ts +60 -0
- package/dist/effect/internal/send.js +56 -0
- package/dist/effect/journeys.d.ts +2153 -0
- package/dist/effect/journeys.js +39 -0
- package/dist/effect/mailboxes.d.ts +80 -80
- package/dist/effect/mailboxes.js +135 -3
- package/dist/effect/media.d.ts +5 -5
- package/dist/effect/media.js +10 -8
- package/dist/effect/messages.d.ts +16 -16
- package/dist/effect/messages.js +15 -12
- package/dist/effect/namespaces.d.ts +7 -7
- package/dist/effect/namespaces.js +10 -8
- package/dist/effect/operations.d.ts +5 -5
- package/dist/effect/operations.js +8 -6
- package/dist/effect/organizations.d.ts +7 -7
- package/dist/effect/organizations.js +12 -10
- package/dist/effect/pagination.js +39 -0
- package/dist/effect/retry.js +3 -3
- package/dist/effect/runtime.js +25 -0
- package/dist/effect/scheduled-messages.d.ts +7 -7
- package/dist/effect/scheduled-messages.js +10 -8
- package/dist/effect/subscriptions.d.ts +1 -1
- package/dist/effect/subscriptions.js +5 -4
- package/dist/effect/templates.d.ts +40 -40
- package/dist/effect/templates.js +39 -37
- package/dist/effect/unsubscribe-groups.d.ts +11 -11
- package/dist/effect/unsubscribe-groups.js +14 -12
- package/dist/effect/webhooks.d.ts +23 -23
- package/dist/effect/webhooks.js +16 -14
- package/dist/effect/whoami.d.ts +1 -1
- package/dist/effect/whoami.js +5 -4
- package/dist/index.js +4 -3
- package/dist/{inline-attachments-Cegg6tTF.js → inline-attachments.js} +13 -7
- package/dist/{mailbox-events-VKR4f3qq.js → mailbox-events.js} +2 -2
- package/dist/{normalize-B79uJIeb.js → normalize.js} +2 -2
- package/dist/package.js +6 -0
- package/dist/promises/errors.gen.js +1340 -0
- package/dist/promises/index.d.ts +7 -3
- package/dist/promises/index.js +288 -3
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/service-map.d.ts +85 -0
- package/dist/{operation-BTXjPrwf.js → service-map.js} +58 -219
- package/package.json +17 -3
- package/dist/categories-DV51kr2H.js +0 -187
- package/dist/client-BMUew5Wp.js +0 -13794
- package/dist/effect/generated.d.ts +0 -64004
- package/dist/mailboxes-Thp5z0oX.js +0 -161
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, OrganizationId, UnauthorizedError, ValidationError } from "./shared";
|
|
4
|
+
export type WhoamiUser = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly email: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const WhoamiUser: Schema.Struct<{
|
|
10
|
+
readonly id: Schema.String;
|
|
11
|
+
readonly name: Schema.String;
|
|
12
|
+
readonly email: Schema.String;
|
|
13
|
+
}>;
|
|
14
|
+
export type WhoamiOrganization = {
|
|
15
|
+
readonly id: OrganizationId;
|
|
16
|
+
readonly slug: string;
|
|
17
|
+
readonly name: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const WhoamiOrganization: Schema.Struct<{
|
|
20
|
+
readonly id: Schema.brand<Schema.String, "OrganizationId">;
|
|
21
|
+
readonly slug: Schema.String;
|
|
22
|
+
readonly name: Schema.String;
|
|
23
|
+
}>;
|
|
24
|
+
export type WhoamiUserCredential = {
|
|
25
|
+
readonly type: "user";
|
|
26
|
+
readonly user: WhoamiUser;
|
|
27
|
+
readonly role: "member" | "admin" | "owner";
|
|
28
|
+
};
|
|
29
|
+
export declare const WhoamiUserCredential: Schema.Struct<{
|
|
30
|
+
readonly type: Schema.Literal<"user">;
|
|
31
|
+
readonly user: Schema.Struct<{
|
|
32
|
+
readonly id: Schema.String;
|
|
33
|
+
readonly name: Schema.String;
|
|
34
|
+
readonly email: Schema.String;
|
|
35
|
+
}>;
|
|
36
|
+
readonly role: Schema.Union<readonly [Schema.Literal<"member">, Schema.Literal<"admin">, Schema.Literal<"owner">]>;
|
|
37
|
+
}>;
|
|
38
|
+
export type WhoamiApiKeyCredential = {
|
|
39
|
+
readonly type: "apiKey";
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly start: string | null;
|
|
43
|
+
readonly access: ApiKeyAccess;
|
|
44
|
+
};
|
|
45
|
+
export declare const WhoamiApiKeyCredential: Schema.Struct<{
|
|
46
|
+
readonly type: Schema.Literal<"apiKey">;
|
|
47
|
+
readonly id: Schema.String;
|
|
48
|
+
readonly name: Schema.String;
|
|
49
|
+
readonly start: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
50
|
+
readonly access: Schema.Union<readonly [Schema.Struct<{
|
|
51
|
+
readonly mode: Schema.Literal<"full">;
|
|
52
|
+
}>, Schema.Struct<{
|
|
53
|
+
readonly mode: Schema.Literal<"restricted">;
|
|
54
|
+
readonly resources: Schema.Struct<{
|
|
55
|
+
readonly messages: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
56
|
+
readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
57
|
+
readonly domains: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
58
|
+
readonly phoneNumbers: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
59
|
+
readonly contacts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
60
|
+
readonly conversations: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
61
|
+
readonly templates: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
62
|
+
readonly webhooks: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
63
|
+
readonly apiKeys: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
64
|
+
readonly organization: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
65
|
+
readonly billing: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
66
|
+
readonly analytics: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
67
|
+
}>;
|
|
68
|
+
readonly mailboxes: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
69
|
+
readonly permissions: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>, readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>;
|
|
70
|
+
readonly mailboxIds: Schema.optionalKey<Schema.Union<readonly [Schema.TupleWithRest<Schema.Tuple<readonly [Schema.brand<Schema.String, "MailboxId">]>, readonly [Schema.brand<Schema.String, "MailboxId">]>, Schema.Null]>>;
|
|
71
|
+
readonly sendMode: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"send">, Schema.Literal<"approval">]>, Schema.Null]>>;
|
|
72
|
+
}>, Schema.Null]>>;
|
|
73
|
+
readonly namespaceId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "NamespaceId">, Schema.Null]>>;
|
|
74
|
+
}>]>;
|
|
75
|
+
}>;
|
|
76
|
+
export type Whoami = {
|
|
77
|
+
readonly organization: WhoamiOrganization;
|
|
78
|
+
readonly credential: WhoamiApiKeyCredential | WhoamiUserCredential;
|
|
79
|
+
};
|
|
80
|
+
export declare const Whoami: Schema.Struct<{
|
|
81
|
+
readonly organization: Schema.Struct<{
|
|
82
|
+
readonly id: Schema.brand<Schema.String, "OrganizationId">;
|
|
83
|
+
readonly slug: Schema.String;
|
|
84
|
+
readonly name: Schema.String;
|
|
85
|
+
}>;
|
|
86
|
+
readonly credential: Schema.Union<readonly [Schema.Struct<{
|
|
87
|
+
readonly type: Schema.Literal<"apiKey">;
|
|
88
|
+
readonly id: Schema.String;
|
|
89
|
+
readonly name: Schema.String;
|
|
90
|
+
readonly start: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
91
|
+
readonly access: Schema.Union<readonly [Schema.Struct<{
|
|
92
|
+
readonly mode: Schema.Literal<"full">;
|
|
93
|
+
}>, Schema.Struct<{
|
|
94
|
+
readonly mode: Schema.Literal<"restricted">;
|
|
95
|
+
readonly resources: Schema.Struct<{
|
|
96
|
+
readonly messages: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
97
|
+
readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
98
|
+
readonly domains: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
99
|
+
readonly phoneNumbers: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
100
|
+
readonly contacts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
101
|
+
readonly conversations: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
102
|
+
readonly templates: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
103
|
+
readonly webhooks: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
104
|
+
readonly apiKeys: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
105
|
+
readonly organization: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
106
|
+
readonly billing: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
107
|
+
readonly analytics: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
108
|
+
}>;
|
|
109
|
+
readonly mailboxes: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
110
|
+
readonly permissions: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>, readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>;
|
|
111
|
+
readonly mailboxIds: Schema.optionalKey<Schema.Union<readonly [Schema.TupleWithRest<Schema.Tuple<readonly [Schema.brand<Schema.String, "MailboxId">]>, readonly [Schema.brand<Schema.String, "MailboxId">]>, Schema.Null]>>;
|
|
112
|
+
readonly sendMode: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"send">, Schema.Literal<"approval">]>, Schema.Null]>>;
|
|
113
|
+
}>, Schema.Null]>>;
|
|
114
|
+
readonly namespaceId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "NamespaceId">, Schema.Null]>>;
|
|
115
|
+
}>]>;
|
|
116
|
+
}>, Schema.Struct<{
|
|
117
|
+
readonly type: Schema.Literal<"user">;
|
|
118
|
+
readonly user: Schema.Struct<{
|
|
119
|
+
readonly id: Schema.String;
|
|
120
|
+
readonly name: Schema.String;
|
|
121
|
+
readonly email: Schema.String;
|
|
122
|
+
}>;
|
|
123
|
+
readonly role: Schema.Union<readonly [Schema.Literal<"member">, Schema.Literal<"admin">, Schema.Literal<"owner">]>;
|
|
124
|
+
}>]>;
|
|
125
|
+
}>;
|
|
126
|
+
export type WhoamiGet200 = Whoami;
|
|
127
|
+
export declare const WhoamiGet200: Schema.Struct<{
|
|
128
|
+
readonly organization: Schema.Struct<{
|
|
129
|
+
readonly id: Schema.brand<Schema.String, "OrganizationId">;
|
|
130
|
+
readonly slug: Schema.String;
|
|
131
|
+
readonly name: Schema.String;
|
|
132
|
+
}>;
|
|
133
|
+
readonly credential: Schema.Union<readonly [Schema.Struct<{
|
|
134
|
+
readonly type: Schema.Literal<"apiKey">;
|
|
135
|
+
readonly id: Schema.String;
|
|
136
|
+
readonly name: Schema.String;
|
|
137
|
+
readonly start: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
138
|
+
readonly access: Schema.Union<readonly [Schema.Struct<{
|
|
139
|
+
readonly mode: Schema.Literal<"full">;
|
|
140
|
+
}>, Schema.Struct<{
|
|
141
|
+
readonly mode: Schema.Literal<"restricted">;
|
|
142
|
+
readonly resources: Schema.Struct<{
|
|
143
|
+
readonly messages: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
144
|
+
readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
145
|
+
readonly domains: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
146
|
+
readonly phoneNumbers: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
147
|
+
readonly contacts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
148
|
+
readonly conversations: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
149
|
+
readonly templates: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
150
|
+
readonly webhooks: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
151
|
+
readonly apiKeys: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
152
|
+
readonly organization: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
153
|
+
readonly billing: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
154
|
+
readonly analytics: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
155
|
+
}>;
|
|
156
|
+
readonly mailboxes: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
157
|
+
readonly permissions: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>, readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>;
|
|
158
|
+
readonly mailboxIds: Schema.optionalKey<Schema.Union<readonly [Schema.TupleWithRest<Schema.Tuple<readonly [Schema.brand<Schema.String, "MailboxId">]>, readonly [Schema.brand<Schema.String, "MailboxId">]>, Schema.Null]>>;
|
|
159
|
+
readonly sendMode: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"send">, Schema.Literal<"approval">]>, Schema.Null]>>;
|
|
160
|
+
}>, Schema.Null]>>;
|
|
161
|
+
readonly namespaceId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "NamespaceId">, Schema.Null]>>;
|
|
162
|
+
}>]>;
|
|
163
|
+
}>, Schema.Struct<{
|
|
164
|
+
readonly type: Schema.Literal<"user">;
|
|
165
|
+
readonly user: Schema.Struct<{
|
|
166
|
+
readonly id: Schema.String;
|
|
167
|
+
readonly name: Schema.String;
|
|
168
|
+
readonly email: Schema.String;
|
|
169
|
+
}>;
|
|
170
|
+
readonly role: Schema.Union<readonly [Schema.Literal<"member">, Schema.Literal<"admin">, Schema.Literal<"owner">]>;
|
|
171
|
+
}>]>;
|
|
172
|
+
}>;
|
|
173
|
+
export type WhoamiGet401 = UnauthorizedError;
|
|
174
|
+
export declare const WhoamiGet401: typeof UnauthorizedError;
|
|
175
|
+
export type WhoamiGet403 = ForbiddenError;
|
|
176
|
+
export declare const WhoamiGet403: typeof ForbiddenError;
|
|
177
|
+
export type WhoamiGet422 = ValidationError;
|
|
178
|
+
export declare const WhoamiGet422: typeof ValidationError;
|
|
179
|
+
export type WhoamiGet500 = InternalError;
|
|
180
|
+
export declare const WhoamiGet500: typeof InternalError;
|
|
181
|
+
export type WhoamiGet504 = GatewayTimeoutError;
|
|
182
|
+
export declare const WhoamiGet504: typeof GatewayTimeoutError;
|
|
183
|
+
declare const WhoamiGroup_base: HttpApiGroup.HttpApiGroup<"Whoami", HttpApiEndpoint.HttpApiEndpoint<"whoamiGet", "GET", "/v1/whoami", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
184
|
+
readonly organization: Schema.Struct<{
|
|
185
|
+
readonly id: Schema.brand<Schema.String, "OrganizationId">;
|
|
186
|
+
readonly slug: Schema.String;
|
|
187
|
+
readonly name: Schema.String;
|
|
188
|
+
}>;
|
|
189
|
+
readonly credential: Schema.Union<readonly [Schema.Struct<{
|
|
190
|
+
readonly type: Schema.Literal<"apiKey">;
|
|
191
|
+
readonly id: Schema.String;
|
|
192
|
+
readonly name: Schema.String;
|
|
193
|
+
readonly start: Schema.Union<readonly [Schema.String, Schema.Null]>;
|
|
194
|
+
readonly access: Schema.Union<readonly [Schema.Struct<{
|
|
195
|
+
readonly mode: Schema.Literal<"full">;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly mode: Schema.Literal<"restricted">;
|
|
198
|
+
readonly resources: Schema.Struct<{
|
|
199
|
+
readonly messages: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
200
|
+
readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
201
|
+
readonly domains: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
202
|
+
readonly phoneNumbers: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
203
|
+
readonly contacts: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
204
|
+
readonly conversations: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
205
|
+
readonly templates: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
206
|
+
readonly webhooks: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
207
|
+
readonly apiKeys: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
208
|
+
readonly organization: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
209
|
+
readonly billing: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
210
|
+
readonly analytics: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"write">]>, Schema.Null]>>;
|
|
211
|
+
}>;
|
|
212
|
+
readonly mailboxes: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
213
|
+
readonly permissions: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>, readonly [Schema.Union<readonly [Schema.Literal<"read">, Schema.Literal<"update">, Schema.Literal<"send">, Schema.Literal<"quarantine.read">]>]>;
|
|
214
|
+
readonly mailboxIds: Schema.optionalKey<Schema.Union<readonly [Schema.TupleWithRest<Schema.Tuple<readonly [Schema.brand<Schema.String, "MailboxId">]>, readonly [Schema.brand<Schema.String, "MailboxId">]>, Schema.Null]>>;
|
|
215
|
+
readonly sendMode: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"send">, Schema.Literal<"approval">]>, Schema.Null]>>;
|
|
216
|
+
}>, Schema.Null]>>;
|
|
217
|
+
readonly namespaceId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "NamespaceId">, Schema.Null]>>;
|
|
218
|
+
}>]>;
|
|
219
|
+
}>, Schema.Struct<{
|
|
220
|
+
readonly type: Schema.Literal<"user">;
|
|
221
|
+
readonly user: Schema.Struct<{
|
|
222
|
+
readonly id: Schema.String;
|
|
223
|
+
readonly name: Schema.String;
|
|
224
|
+
readonly email: Schema.String;
|
|
225
|
+
}>;
|
|
226
|
+
readonly role: Schema.Union<readonly [Schema.Literal<"member">, Schema.Literal<"admin">, Schema.Literal<"owner">]>;
|
|
227
|
+
}>]>;
|
|
228
|
+
}>>, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<ForbiddenError, {
|
|
229
|
+
readonly _tag: "ForbiddenError";
|
|
230
|
+
readonly message: string;
|
|
231
|
+
}, readonly [Schema.Struct<{
|
|
232
|
+
readonly _tag: Schema.tag<"ForbiddenError">;
|
|
233
|
+
readonly message: Schema.String;
|
|
234
|
+
}>], {
|
|
235
|
+
readonly _tag: "ForbiddenError";
|
|
236
|
+
readonly message: string;
|
|
237
|
+
}>, Schema.Struct<{
|
|
238
|
+
readonly _tag: Schema.tag<"ForbiddenError">;
|
|
239
|
+
readonly message: Schema.String;
|
|
240
|
+
}>, never, never> | Schema.decodeTo<Schema.declareConstructor<GatewayTimeoutError, {
|
|
241
|
+
readonly _tag: "GatewayTimeoutError";
|
|
242
|
+
readonly message: string;
|
|
243
|
+
readonly retryAfterSeconds: number;
|
|
244
|
+
}, readonly [Schema.Struct<{
|
|
245
|
+
readonly _tag: Schema.tag<"GatewayTimeoutError">;
|
|
246
|
+
readonly message: Schema.String;
|
|
247
|
+
readonly retryAfterSeconds: Schema.Finite;
|
|
248
|
+
}>], {
|
|
249
|
+
readonly _tag: "GatewayTimeoutError";
|
|
250
|
+
readonly message: string;
|
|
251
|
+
readonly retryAfterSeconds: number;
|
|
252
|
+
}>, Schema.Struct<{
|
|
253
|
+
readonly _tag: Schema.tag<"GatewayTimeoutError">;
|
|
254
|
+
readonly message: Schema.String;
|
|
255
|
+
readonly retryAfterSeconds: Schema.Finite;
|
|
256
|
+
}>, never, never> | Schema.decodeTo<Schema.declareConstructor<UnauthorizedError, {
|
|
257
|
+
readonly _tag: "UnauthorizedError";
|
|
258
|
+
readonly message: string;
|
|
259
|
+
}, readonly [Schema.Struct<{
|
|
260
|
+
readonly _tag: Schema.tag<"UnauthorizedError">;
|
|
261
|
+
readonly message: Schema.String;
|
|
262
|
+
}>], {
|
|
263
|
+
readonly _tag: "UnauthorizedError";
|
|
264
|
+
readonly message: string;
|
|
265
|
+
}>, Schema.Struct<{
|
|
266
|
+
readonly _tag: Schema.tag<"UnauthorizedError">;
|
|
267
|
+
readonly message: Schema.String;
|
|
268
|
+
}>, never, never> | Schema.decodeTo<Schema.declareConstructor<ValidationError, {
|
|
269
|
+
readonly _tag: "ValidationError";
|
|
270
|
+
readonly message: string;
|
|
271
|
+
readonly fields?: {
|
|
272
|
+
readonly [x: string]: readonly string[];
|
|
273
|
+
} | null;
|
|
274
|
+
}, readonly [Schema.Struct<{
|
|
275
|
+
readonly _tag: Schema.tag<"ValidationError">;
|
|
276
|
+
readonly message: Schema.String;
|
|
277
|
+
readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
|
|
278
|
+
}>], {
|
|
279
|
+
readonly _tag: "ValidationError";
|
|
280
|
+
readonly message: string;
|
|
281
|
+
readonly fields?: {
|
|
282
|
+
readonly [x: string]: readonly string[];
|
|
283
|
+
} | null;
|
|
284
|
+
}>, Schema.Struct<{
|
|
285
|
+
readonly _tag: Schema.tag<"ValidationError">;
|
|
286
|
+
readonly message: Schema.String;
|
|
287
|
+
readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
|
|
288
|
+
}>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never>, false>;
|
|
289
|
+
export declare class WhoamiGroup extends WhoamiGroup_base {
|
|
290
|
+
}
|
|
291
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, OrganizationId, UnauthorizedError, ValidationError } from "./shared.js";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
//#region src/effect/generated/whoami.ts
|
|
5
|
+
const WhoamiUser = /* @__PURE__ */ Schema.Struct({
|
|
6
|
+
id: Schema.String,
|
|
7
|
+
name: Schema.String,
|
|
8
|
+
email: Schema.String
|
|
9
|
+
}).annotate({ identifier: "WhoamiUser" });
|
|
10
|
+
const WhoamiOrganization = /* @__PURE__ */ Schema.Struct({
|
|
11
|
+
id: OrganizationId,
|
|
12
|
+
slug: Schema.String,
|
|
13
|
+
name: Schema.String
|
|
14
|
+
}).annotate({ identifier: "WhoamiOrganization" });
|
|
15
|
+
const WhoamiUserCredential = /* @__PURE__ */ Schema.Struct({
|
|
16
|
+
type: Schema.Literal("user"),
|
|
17
|
+
user: WhoamiUser,
|
|
18
|
+
role: Schema.Union([
|
|
19
|
+
Schema.Literal("member"),
|
|
20
|
+
Schema.Literal("admin"),
|
|
21
|
+
Schema.Literal("owner")
|
|
22
|
+
])
|
|
23
|
+
}).annotate({ identifier: "WhoamiUserCredential" });
|
|
24
|
+
const WhoamiApiKeyCredential = /* @__PURE__ */ Schema.Struct({
|
|
25
|
+
type: Schema.Literal("apiKey"),
|
|
26
|
+
id: Schema.String,
|
|
27
|
+
name: Schema.String,
|
|
28
|
+
start: Schema.Union([Schema.String, Schema.Null]),
|
|
29
|
+
access: ApiKeyAccess
|
|
30
|
+
}).annotate({ identifier: "WhoamiApiKeyCredential" });
|
|
31
|
+
const Whoami = /* @__PURE__ */ Schema.Struct({
|
|
32
|
+
organization: WhoamiOrganization,
|
|
33
|
+
credential: Schema.Union([WhoamiApiKeyCredential, WhoamiUserCredential])
|
|
34
|
+
}).annotate({ identifier: "Whoami" });
|
|
35
|
+
const WhoamiGet200 = Whoami;
|
|
36
|
+
const WhoamiGet401 = UnauthorizedError;
|
|
37
|
+
const WhoamiGet403 = ForbiddenError;
|
|
38
|
+
const WhoamiGet422 = ValidationError;
|
|
39
|
+
const WhoamiGet500 = InternalError;
|
|
40
|
+
const WhoamiGet504 = GatewayTimeoutError;
|
|
41
|
+
var WhoamiGroup = class extends HttpApiGroup.make("Whoami").add(HttpApiEndpoint.get("whoamiGet", "/v1/whoami", {
|
|
42
|
+
success: WhoamiGet200,
|
|
43
|
+
error: [
|
|
44
|
+
WhoamiGet401.pipe(HttpApiSchema.status(401)),
|
|
45
|
+
WhoamiGet403.pipe(HttpApiSchema.status(403)),
|
|
46
|
+
WhoamiGet422.pipe(HttpApiSchema.status(422)),
|
|
47
|
+
WhoamiGet500,
|
|
48
|
+
WhoamiGet504.pipe(HttpApiSchema.status(504))
|
|
49
|
+
]
|
|
50
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "whoami.get").annotate(OpenApi.Summary, "Get the calling credential").annotate(OpenApi.Description, "Returns the organization the request acts in and the credential it presents: an API key with its name, prefix, and access, or a signed-in user with their role. Any valid credential may call it, whatever its grants.")).annotate(OpenApi.Description, "The organization and credential behind the request.") {};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Whoami, WhoamiApiKeyCredential, WhoamiGet200, WhoamiGet401, WhoamiGet403, WhoamiGet422, WhoamiGet500, WhoamiGet504, WhoamiGroup, WhoamiOrganization, WhoamiUser, WhoamiUserCredential };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=whoami.js.map
|