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.
Files changed (167) hide show
  1. package/AGENTS.md +9 -1
  2. package/README.md +57 -1
  3. package/dist/{rolldown-runtime-D7D4PA-g.js → _virtual/_rolldown/runtime.js} +1 -1
  4. package/dist/client/client/client.gen.js +174 -0
  5. package/dist/client/client/utils.gen.js +177 -0
  6. package/dist/client/client.gen.js +8 -0
  7. package/dist/client/core/auth.gen.js +12 -0
  8. package/dist/client/core/bodySerializer.gen.js +6 -0
  9. package/dist/client/core/params.gen.js +77 -0
  10. package/dist/client/core/pathSerializer.gen.js +82 -0
  11. package/dist/client/core/serverSentEvents.gen.js +96 -0
  12. package/dist/client/core/utils.gen.js +78 -0
  13. package/dist/client/sdk.gen.d.ts +174 -3
  14. package/dist/{promises-KrA2nSLg.js → client/sdk.gen.js} +464 -2289
  15. package/dist/client/types.gen.d.ts +1126 -11
  16. package/dist/client-attribution.js +9 -0
  17. package/dist/effect/analytics.d.ts +6 -6
  18. package/dist/effect/analytics.js +11 -9
  19. package/dist/effect/api-keys.d.ts +13 -13
  20. package/dist/effect/api-keys.js +13 -12
  21. package/dist/effect/attachments.d.ts +4 -4
  22. package/dist/effect/attachments.js +9 -7
  23. package/dist/effect/brands.d.ts +7 -7
  24. package/dist/effect/brands.js +12 -10
  25. package/dist/effect/campaigns.d.ts +18 -18
  26. package/dist/effect/campaigns.js +17 -15
  27. package/dist/effect/categories.d.ts +2 -2
  28. package/dist/effect/categories.js +95 -1
  29. package/dist/effect/client.d.ts +1 -1
  30. package/dist/effect/client.js +4 -5
  31. package/dist/effect/contact-groups.d.ts +14 -14
  32. package/dist/effect/contact-groups.js +15 -13
  33. package/dist/effect/contacts.d.ts +77 -25
  34. package/dist/effect/contacts.js +27 -22
  35. package/dist/effect/conversations.d.ts +17 -17
  36. package/dist/effect/conversations.js +18 -16
  37. package/dist/effect/custom-fields.d.ts +4 -4
  38. package/dist/effect/custom-fields.js +9 -7
  39. package/dist/effect/email.d.ts +78 -77
  40. package/dist/effect/email.js +68 -65
  41. package/dist/effect/errors.d.ts +2 -0
  42. package/dist/effect/errors.js +3 -0
  43. package/dist/effect/events.d.ts +121 -0
  44. package/dist/effect/events.js +17 -0
  45. package/dist/effect/extension-installations.d.ts +11 -11
  46. package/dist/effect/extension-installations.js +14 -12
  47. package/dist/effect/extensions.d.ts +9 -9
  48. package/dist/effect/extensions.js +10 -8
  49. package/dist/effect/feedback.d.ts +2 -2
  50. package/dist/effect/feedback.js +6 -5
  51. package/dist/effect/generated/analytics.d.ts +715 -0
  52. package/dist/effect/generated/analytics.js +188 -0
  53. package/dist/effect/generated/api-keys.d.ts +1627 -0
  54. package/dist/effect/generated/api-keys.js +249 -0
  55. package/dist/effect/generated/attachments.d.ts +554 -0
  56. package/dist/effect/generated/attachments.js +125 -0
  57. package/dist/effect/generated/brands.d.ts +1118 -0
  58. package/dist/effect/generated/brands.js +155 -0
  59. package/dist/effect/generated/campaigns.d.ts +3783 -0
  60. package/dist/effect/generated/campaigns.js +491 -0
  61. package/dist/effect/generated/contact-events.d.ts +158 -0
  62. package/dist/effect/generated/contact-events.js +37 -0
  63. package/dist/effect/generated/contact-groups.d.ts +1445 -0
  64. package/dist/effect/generated/contact-groups.js +419 -0
  65. package/dist/effect/generated/contacts.d.ts +3789 -0
  66. package/dist/effect/generated/contacts.js +709 -0
  67. package/dist/effect/generated/conversations.d.ts +2870 -0
  68. package/dist/effect/generated/conversations.js +461 -0
  69. package/dist/effect/generated/custom-fields.d.ts +562 -0
  70. package/dist/effect/generated/custom-fields.js +162 -0
  71. package/dist/effect/generated/email.d.ts +10622 -0
  72. package/dist/effect/generated/email.js +2347 -0
  73. package/dist/effect/generated/events.d.ts +463 -0
  74. package/dist/effect/generated/events.js +70 -0
  75. package/dist/effect/generated/extension-installations.d.ts +1786 -0
  76. package/dist/effect/generated/extension-installations.js +382 -0
  77. package/dist/effect/generated/extensions.d.ts +927 -0
  78. package/dist/effect/generated/extensions.js +203 -0
  79. package/dist/effect/generated/feedback.d.ts +116 -0
  80. package/dist/effect/generated/feedback.js +43 -0
  81. package/dist/effect/generated/index.d.ts +61 -0
  82. package/dist/effect/generated/journeys.d.ts +6135 -0
  83. package/dist/effect/generated/journeys.js +464 -0
  84. package/dist/effect/generated/mailboxes.d.ts +13641 -0
  85. package/dist/effect/generated/mailboxes.js +2312 -0
  86. package/dist/effect/generated/media.d.ts +741 -0
  87. package/dist/effect/generated/media.js +181 -0
  88. package/dist/effect/generated/messages.d.ts +2355 -0
  89. package/dist/effect/generated/messages.js +671 -0
  90. package/dist/effect/generated/namespaces.d.ts +654 -0
  91. package/dist/effect/generated/namespaces.js +135 -0
  92. package/dist/effect/generated/operations.d.ts +514 -0
  93. package/dist/effect/generated/operations.js +80 -0
  94. package/dist/effect/generated/organizations.d.ts +1111 -0
  95. package/dist/effect/generated/organizations.js +231 -0
  96. package/dist/effect/generated/scheduled-messages.d.ts +1798 -0
  97. package/dist/effect/generated/scheduled-messages.js +190 -0
  98. package/dist/effect/generated/shared.d.ts +3250 -0
  99. package/dist/effect/generated/shared.js +1053 -0
  100. package/dist/effect/generated/subscriptions.d.ts +188 -0
  101. package/dist/effect/generated/subscriptions.js +61 -0
  102. package/dist/effect/generated/templates.d.ts +8177 -0
  103. package/dist/effect/generated/templates.js +2214 -0
  104. package/dist/effect/generated/unsubscribe-groups.d.ts +1153 -0
  105. package/dist/effect/generated/unsubscribe-groups.js +267 -0
  106. package/dist/effect/generated/webhooks.d.ts +1697 -0
  107. package/dist/effect/generated/webhooks.js +500 -0
  108. package/dist/effect/generated/whoami.d.ts +291 -0
  109. package/dist/effect/generated/whoami.js +54 -0
  110. package/dist/effect/generated-metadata.d.ts +1627 -0
  111. package/dist/effect/generated-metadata.js +919 -0
  112. package/dist/effect/index.d.ts +3 -2
  113. package/dist/effect/index.js +33 -31
  114. package/dist/effect/internal/client.d.ts +10 -7
  115. package/dist/effect/internal/client.js +69 -0
  116. package/dist/effect/internal/email-sender.d.ts +17 -0
  117. package/dist/effect/internal/email-sender.js +21 -0
  118. package/dist/effect/internal/mailbox-events.js +33 -0
  119. package/dist/effect/internal/operation.d.ts +12 -72
  120. package/dist/effect/internal/operation.js +116 -0
  121. package/dist/effect/internal/send.d.ts +60 -0
  122. package/dist/effect/internal/send.js +56 -0
  123. package/dist/effect/journeys.d.ts +2153 -0
  124. package/dist/effect/journeys.js +39 -0
  125. package/dist/effect/mailboxes.d.ts +80 -80
  126. package/dist/effect/mailboxes.js +135 -3
  127. package/dist/effect/media.d.ts +5 -5
  128. package/dist/effect/media.js +10 -8
  129. package/dist/effect/messages.d.ts +16 -16
  130. package/dist/effect/messages.js +15 -12
  131. package/dist/effect/namespaces.d.ts +7 -7
  132. package/dist/effect/namespaces.js +10 -8
  133. package/dist/effect/operations.d.ts +5 -5
  134. package/dist/effect/operations.js +8 -6
  135. package/dist/effect/organizations.d.ts +7 -7
  136. package/dist/effect/organizations.js +12 -10
  137. package/dist/effect/pagination.js +39 -0
  138. package/dist/effect/retry.js +3 -3
  139. package/dist/effect/runtime.js +25 -0
  140. package/dist/effect/scheduled-messages.d.ts +7 -7
  141. package/dist/effect/scheduled-messages.js +10 -8
  142. package/dist/effect/subscriptions.d.ts +1 -1
  143. package/dist/effect/subscriptions.js +5 -4
  144. package/dist/effect/templates.d.ts +40 -40
  145. package/dist/effect/templates.js +39 -37
  146. package/dist/effect/unsubscribe-groups.d.ts +11 -11
  147. package/dist/effect/unsubscribe-groups.js +14 -12
  148. package/dist/effect/webhooks.d.ts +23 -23
  149. package/dist/effect/webhooks.js +16 -14
  150. package/dist/effect/whoami.d.ts +1 -1
  151. package/dist/effect/whoami.js +5 -4
  152. package/dist/index.js +4 -3
  153. package/dist/{inline-attachments-Cegg6tTF.js → inline-attachments.js} +13 -7
  154. package/dist/{mailbox-events-VKR4f3qq.js → mailbox-events.js} +2 -2
  155. package/dist/{normalize-B79uJIeb.js → normalize.js} +2 -2
  156. package/dist/package.js +6 -0
  157. package/dist/promises/errors.gen.js +1340 -0
  158. package/dist/promises/index.d.ts +7 -3
  159. package/dist/promises/index.js +288 -3
  160. package/dist/promises/types.gen.d.ts +1 -1
  161. package/dist/service-map.d.ts +85 -0
  162. package/dist/{operation-BTXjPrwf.js → service-map.js} +58 -219
  163. package/package.json +17 -3
  164. package/dist/categories-DV51kr2H.js +0 -187
  165. package/dist/client-BMUew5Wp.js +0 -13794
  166. package/dist/effect/generated.d.ts +0 -64004
  167. package/dist/mailboxes-Thp5z0oX.js +0 -161
@@ -0,0 +1,249 @@
1
+ import { SensitiveString } from "../runtime.js";
2
+ import { ApiKeyAccess, ApiKeyId, ApiKeySecurityMiddleware, BillingProviderError, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, MailboxSendMode, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SuccessResponse, UnauthorizedError, ValidationError } from "./shared.js";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
4
+ import * as Schema from "effect/Schema";
5
+ //#region src/effect/generated/api-keys.ts
6
+ const ApiKeyOwner = /* @__PURE__ */ Schema.Struct({
7
+ id: Schema.String,
8
+ name: Schema.String,
9
+ email: Schema.String
10
+ }).annotate({ identifier: "ApiKeyOwner" });
11
+ const ApiKeyActivityPage = /* @__PURE__ */ Schema.Struct({
12
+ items: Schema.Array(Schema.Struct({
13
+ id: Schema.String,
14
+ timestamp: Schema.String,
15
+ method: Schema.String,
16
+ endpoint: Schema.String,
17
+ statusCode: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(100).annotate({ expected: "a value greater than or equal to 100" })).check(Schema.isLessThanOrEqualTo(599).annotate({ expected: "a value less than or equal to 599" })),
18
+ latency: Schema.Finite.check(Schema.isFinite().annotate({ expected: "a finite number" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
19
+ })),
20
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
21
+ }).annotate({ identifier: "ApiKeyActivityPage" });
22
+ const ApiKeyMailboxAccessUpdate = /* @__PURE__ */ Schema.Struct({ sendMode: MailboxSendMode }).annotate({ identifier: "ApiKeyMailboxAccessUpdate" });
23
+ const ApiKey = /* @__PURE__ */ Schema.Struct({
24
+ id: Schema.String,
25
+ name: Schema.String,
26
+ key: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
27
+ start: Schema.Union([Schema.String, Schema.Null]),
28
+ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
29
+ createdAt: Schema.String,
30
+ expiresAt: Schema.Union([Schema.String, Schema.Null]),
31
+ lastUsedAt: Schema.Union([Schema.String, Schema.Null]),
32
+ isActive: Schema.Boolean,
33
+ access: ApiKeyAccess,
34
+ owner: Schema.Union([ApiKeyOwner, Schema.Null])
35
+ }).annotate({ identifier: "ApiKey" });
36
+ const ApiKeyWithSecret = /* @__PURE__ */ Schema.Struct({
37
+ id: Schema.String,
38
+ name: Schema.String,
39
+ key: SensitiveString,
40
+ start: Schema.Union([Schema.String, Schema.Null]),
41
+ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
42
+ createdAt: Schema.String,
43
+ expiresAt: Schema.Union([Schema.String, Schema.Null]),
44
+ lastUsedAt: Schema.Union([Schema.String, Schema.Null]),
45
+ isActive: Schema.Boolean,
46
+ access: ApiKeyAccess,
47
+ owner: Schema.Union([ApiKeyOwner, Schema.Null])
48
+ }).annotate({ identifier: "ApiKeyWithSecret" });
49
+ const ApiKeyPage = /* @__PURE__ */ Schema.Struct({
50
+ items: Schema.Array(ApiKey),
51
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
52
+ }).annotate({ identifier: "ApiKeyPage" });
53
+ const ApiKeysListQuery = /* @__PURE__ */ Schema.Struct({
54
+ limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
55
+ cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null])),
56
+ status: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("active"), Schema.Literal("revoked")]), Schema.Null])),
57
+ search: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
58
+ });
59
+ const ApiKeysList200 = ApiKeyPage;
60
+ const ApiKeysList401 = UnauthorizedError;
61
+ const ApiKeysList403 = ForbiddenError;
62
+ const ApiKeysList422 = ValidationError;
63
+ const ApiKeysList500 = InternalError;
64
+ const ApiKeysList504 = GatewayTimeoutError;
65
+ const ApiKeysCreateRequestJson = /* @__PURE__ */ Schema.Struct({
66
+ name: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(32).annotate({ expected: "a string with at most 32 code points" })).check(Schema.isMaxLength(32).annotate({ expected: "a value with a length of at most 32" })),
67
+ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
68
+ expiresAt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
69
+ access: Schema.optionalKey(Schema.Union([ApiKeyAccess, Schema.Null]).annotate({ description: "Defaults to full access. A restricted API key creating a key defaults to its own grants and cannot issue full access." }))
70
+ });
71
+ const ApiKeysCreate201 = ApiKeyWithSecret;
72
+ const ApiKeysCreate401 = UnauthorizedError;
73
+ const ApiKeysCreate402 = PaymentRequiredError;
74
+ const ApiKeysCreate403 = ForbiddenError;
75
+ const ApiKeysCreate404 = ResourceNotFoundError;
76
+ const ApiKeysCreate422 = ValidationError;
77
+ const ApiKeysCreate429 = RateLimitedError;
78
+ const ApiKeysCreate500 = InternalError;
79
+ const ApiKeysCreate502 = BillingProviderError;
80
+ const ApiKeysCreate504 = GatewayTimeoutError;
81
+ const ApiKeysGetPathParams = /* @__PURE__ */ Schema.Struct({ id: ApiKeyId });
82
+ const ApiKeysGet200 = ApiKey;
83
+ const ApiKeysGet401 = UnauthorizedError;
84
+ const ApiKeysGet403 = ForbiddenError;
85
+ const ApiKeysGet404 = ResourceNotFoundError;
86
+ const ApiKeysGet422 = ValidationError;
87
+ const ApiKeysGet500 = InternalError;
88
+ const ApiKeysGet504 = GatewayTimeoutError;
89
+ const ApiKeysUpdatePathParams = /* @__PURE__ */ Schema.Struct({ id: ApiKeyId });
90
+ const ApiKeysUpdateRequestJson = /* @__PURE__ */ Schema.Struct({
91
+ name: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(32).annotate({ expected: "a string with at most 32 code points" })).check(Schema.isMaxLength(32).annotate({ expected: "a value with a length of at most 32" })), Schema.Null])),
92
+ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
93
+ mailboxes: Schema.optionalKey(Schema.Union([ApiKeyMailboxAccessUpdate, Schema.Null]).annotate({ description: "Changes the mailbox send mode of a key that holds mailbox access. Only a person can change it; the change applies to the key's next request." }))
94
+ });
95
+ const ApiKeysUpdate200 = ApiKey;
96
+ const ApiKeysUpdate401 = UnauthorizedError;
97
+ const ApiKeysUpdate403 = ForbiddenError;
98
+ const ApiKeysUpdate404 = ResourceNotFoundError;
99
+ const ApiKeysUpdate422 = ValidationError;
100
+ const ApiKeysUpdate500 = InternalError;
101
+ const ApiKeysUpdate504 = GatewayTimeoutError;
102
+ const ApiKeysGetActivityPathParams = /* @__PURE__ */ Schema.Struct({ id: ApiKeyId });
103
+ const ApiKeysGetActivityQuery = /* @__PURE__ */ Schema.Struct({
104
+ limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
105
+ cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
106
+ });
107
+ const ApiKeysGetActivity200 = ApiKeyActivityPage;
108
+ const ApiKeysGetActivity401 = UnauthorizedError;
109
+ const ApiKeysGetActivity403 = ForbiddenError;
110
+ const ApiKeysGetActivity404 = ResourceNotFoundError;
111
+ const ApiKeysGetActivity422 = ValidationError;
112
+ const ApiKeysGetActivity500 = InternalError;
113
+ const ApiKeysGetActivity504 = GatewayTimeoutError;
114
+ const ApiKeysRevokePathParams = /* @__PURE__ */ Schema.Struct({ id: ApiKeyId });
115
+ const ApiKeysRevoke200 = SuccessResponse;
116
+ const ApiKeysRevoke401 = UnauthorizedError;
117
+ const ApiKeysRevoke403 = ForbiddenError;
118
+ const ApiKeysRevoke404 = ResourceNotFoundError;
119
+ const ApiKeysRevoke422 = ValidationError;
120
+ const ApiKeysRevoke500 = InternalError;
121
+ const ApiKeysRevoke502 = BillingProviderError;
122
+ const ApiKeysRevoke504 = GatewayTimeoutError;
123
+ const ApiKeysRotatePathParams = /* @__PURE__ */ Schema.Struct({ id: ApiKeyId });
124
+ const ApiKeysRotate200 = ApiKeyWithSecret;
125
+ const ApiKeysRotate401 = UnauthorizedError;
126
+ const ApiKeysRotate403 = ForbiddenError;
127
+ const ApiKeysRotate404 = ResourceNotFoundError;
128
+ const ApiKeysRotate422 = ValidationError;
129
+ const ApiKeysRotate500 = InternalError;
130
+ const ApiKeysRotate504 = GatewayTimeoutError;
131
+ const ApiKeysGetStatsPathParams = /* @__PURE__ */ Schema.Struct({ id: ApiKeyId });
132
+ const ApiKeysGetStatsQuery = /* @__PURE__ */ Schema.Struct({
133
+ after: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
134
+ before: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
135
+ });
136
+ const ApiKeysGetStats200 = /* @__PURE__ */ Schema.Struct({
137
+ totalRequests: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
138
+ successfulRequests: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
139
+ failedRequests: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
140
+ dailyVolume: Schema.Array(Schema.Struct({
141
+ date: Schema.String,
142
+ requests: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
143
+ }))
144
+ });
145
+ const ApiKeysGetStats401 = UnauthorizedError;
146
+ const ApiKeysGetStats403 = ForbiddenError;
147
+ const ApiKeysGetStats404 = ResourceNotFoundError;
148
+ const ApiKeysGetStats422 = ValidationError;
149
+ const ApiKeysGetStats500 = InternalError;
150
+ const ApiKeysGetStats504 = GatewayTimeoutError;
151
+ var APIKeysGroup = class extends HttpApiGroup.make("API Keys").add(HttpApiEndpoint.get("apiKeysList", "/v1/api-keys", {
152
+ query: ApiKeysListQuery,
153
+ success: ApiKeysList200,
154
+ error: [
155
+ ApiKeysList401.pipe(HttpApiSchema.status(401)),
156
+ ApiKeysList403.pipe(HttpApiSchema.status(403)),
157
+ ApiKeysList422.pipe(HttpApiSchema.status(422)),
158
+ ApiKeysList500,
159
+ ApiKeysList504.pipe(HttpApiSchema.status(504))
160
+ ]
161
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.list").annotate(OpenApi.Summary, "List API keys").annotate(OpenApi.Description, "Returns the organization's API keys, newest first, filterable by status and a search term matched against name and description. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("apiKeysCreate", "/v1/api-keys", {
162
+ payload: ApiKeysCreateRequestJson,
163
+ success: ApiKeysCreate201.pipe(HttpApiSchema.status(201)),
164
+ error: [
165
+ ApiKeysCreate401.pipe(HttpApiSchema.status(401)),
166
+ ApiKeysCreate402.pipe(HttpApiSchema.status(402)),
167
+ ApiKeysCreate403.pipe(HttpApiSchema.status(403)),
168
+ ApiKeysCreate404.pipe(HttpApiSchema.status(404)),
169
+ ApiKeysCreate422.pipe(HttpApiSchema.status(422)),
170
+ ApiKeysCreate429.pipe(HttpApiSchema.status(429)),
171
+ ApiKeysCreate500,
172
+ ApiKeysCreate502.pipe(HttpApiSchema.status(502)),
173
+ ApiKeysCreate504.pipe(HttpApiSchema.status(504))
174
+ ]
175
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.create").annotate(OpenApi.Summary, "Create an API key").annotate(OpenApi.Description, "Creates a new API key for the organization and returns the created key, including the plaintext secret, with a 201 response."), HttpApiEndpoint.get("apiKeysGet", "/v1/api-keys/:id", {
176
+ params: ApiKeysGetPathParams,
177
+ success: ApiKeysGet200,
178
+ error: [
179
+ ApiKeysGet401.pipe(HttpApiSchema.status(401)),
180
+ ApiKeysGet403.pipe(HttpApiSchema.status(403)),
181
+ ApiKeysGet404.pipe(HttpApiSchema.status(404)),
182
+ ApiKeysGet422.pipe(HttpApiSchema.status(422)),
183
+ ApiKeysGet500,
184
+ ApiKeysGet504.pipe(HttpApiSchema.status(504))
185
+ ]
186
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.get").annotate(OpenApi.Summary, "Get an API key").annotate(OpenApi.Description, "Returns the API key with the given ID, including its metadata and access."), HttpApiEndpoint.patch("apiKeysUpdate", "/v1/api-keys/:id", {
187
+ params: ApiKeysUpdatePathParams,
188
+ payload: ApiKeysUpdateRequestJson,
189
+ success: ApiKeysUpdate200,
190
+ error: [
191
+ ApiKeysUpdate401.pipe(HttpApiSchema.status(401)),
192
+ ApiKeysUpdate403.pipe(HttpApiSchema.status(403)),
193
+ ApiKeysUpdate404.pipe(HttpApiSchema.status(404)),
194
+ ApiKeysUpdate422.pipe(HttpApiSchema.status(422)),
195
+ ApiKeysUpdate500,
196
+ ApiKeysUpdate504.pipe(HttpApiSchema.status(504))
197
+ ]
198
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.update").annotate(OpenApi.Summary, "Update an API key").annotate(OpenApi.Description, "Updates an API key's settings and returns the updated key. A field left out keeps its value."), HttpApiEndpoint.get("apiKeysGetActivity", "/v1/api-keys/:id/activity", {
199
+ params: ApiKeysGetActivityPathParams,
200
+ query: ApiKeysGetActivityQuery,
201
+ success: ApiKeysGetActivity200,
202
+ error: [
203
+ ApiKeysGetActivity401.pipe(HttpApiSchema.status(401)),
204
+ ApiKeysGetActivity403.pipe(HttpApiSchema.status(403)),
205
+ ApiKeysGetActivity404.pipe(HttpApiSchema.status(404)),
206
+ ApiKeysGetActivity422.pipe(HttpApiSchema.status(422)),
207
+ ApiKeysGetActivity500,
208
+ ApiKeysGetActivity504.pipe(HttpApiSchema.status(504))
209
+ ]
210
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.getActivity").annotate(OpenApi.Summary, "List API key activity").annotate(OpenApi.Description, "Returns the sends attributed to an API key, newest first. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("apiKeysRevoke", "/v1/api-keys/:id/revoke", {
211
+ params: ApiKeysRevokePathParams,
212
+ success: ApiKeysRevoke200,
213
+ error: [
214
+ ApiKeysRevoke401.pipe(HttpApiSchema.status(401)),
215
+ ApiKeysRevoke403.pipe(HttpApiSchema.status(403)),
216
+ ApiKeysRevoke404.pipe(HttpApiSchema.status(404)),
217
+ ApiKeysRevoke422.pipe(HttpApiSchema.status(422)),
218
+ ApiKeysRevoke500,
219
+ ApiKeysRevoke502.pipe(HttpApiSchema.status(502)),
220
+ ApiKeysRevoke504.pipe(HttpApiSchema.status(504))
221
+ ]
222
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.revoke").annotate(OpenApi.Summary, "Revoke an API key").annotate(OpenApi.Description, "Deactivates an API key so it can no longer authenticate requests. Revocation is final: a revoked key never authenticates again. Its record stays listable, so the messages it sent stay attributed to it."), HttpApiEndpoint.post("apiKeysRotate", "/v1/api-keys/:id/rotate", {
223
+ params: ApiKeysRotatePathParams,
224
+ success: ApiKeysRotate200,
225
+ error: [
226
+ ApiKeysRotate401.pipe(HttpApiSchema.status(401)),
227
+ ApiKeysRotate403.pipe(HttpApiSchema.status(403)),
228
+ ApiKeysRotate404.pipe(HttpApiSchema.status(404)),
229
+ ApiKeysRotate422.pipe(HttpApiSchema.status(422)),
230
+ ApiKeysRotate500,
231
+ ApiKeysRotate504.pipe(HttpApiSchema.status(504))
232
+ ]
233
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.rotate").annotate(OpenApi.Summary, "Rotate an API key").annotate(OpenApi.Description, "Issues a replacement with the same owner, name, and access, then deactivates the existing key. Returns the new key, including the plaintext secret."), HttpApiEndpoint.get("apiKeysGetStats", "/v1/api-keys/:id/stats", {
234
+ params: ApiKeysGetStatsPathParams,
235
+ query: ApiKeysGetStatsQuery,
236
+ success: ApiKeysGetStats200,
237
+ error: [
238
+ ApiKeysGetStats401.pipe(HttpApiSchema.status(401)),
239
+ ApiKeysGetStats403.pipe(HttpApiSchema.status(403)),
240
+ ApiKeysGetStats404.pipe(HttpApiSchema.status(404)),
241
+ ApiKeysGetStats422.pipe(HttpApiSchema.status(422)),
242
+ ApiKeysGetStats500,
243
+ ApiKeysGetStats504.pipe(HttpApiSchema.status(504))
244
+ ]
245
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "apiKeys.getStats").annotate(OpenApi.Summary, "Get API key send statistics").annotate(OpenApi.Description, "Returns aggregate send counts and daily volume attributed to an API key between `after` and `before`, a window of at most 90 days that defaults to the last 30 days.")).annotate(OpenApi.Description, "API key management, rotation, and usage statistics") {};
246
+ //#endregion
247
+ export { APIKeysGroup, ApiKey, ApiKeyActivityPage, ApiKeyMailboxAccessUpdate, ApiKeyOwner, ApiKeyPage, ApiKeyWithSecret, ApiKeysCreate201, ApiKeysCreate401, ApiKeysCreate402, ApiKeysCreate403, ApiKeysCreate404, ApiKeysCreate422, ApiKeysCreate429, ApiKeysCreate500, ApiKeysCreate502, ApiKeysCreate504, ApiKeysCreateRequestJson, ApiKeysGet200, ApiKeysGet401, ApiKeysGet403, ApiKeysGet404, ApiKeysGet422, ApiKeysGet500, ApiKeysGet504, ApiKeysGetActivity200, ApiKeysGetActivity401, ApiKeysGetActivity403, ApiKeysGetActivity404, ApiKeysGetActivity422, ApiKeysGetActivity500, ApiKeysGetActivity504, ApiKeysGetActivityPathParams, ApiKeysGetActivityQuery, ApiKeysGetPathParams, ApiKeysGetStats200, ApiKeysGetStats401, ApiKeysGetStats403, ApiKeysGetStats404, ApiKeysGetStats422, ApiKeysGetStats500, ApiKeysGetStats504, ApiKeysGetStatsPathParams, ApiKeysGetStatsQuery, ApiKeysList200, ApiKeysList401, ApiKeysList403, ApiKeysList422, ApiKeysList500, ApiKeysList504, ApiKeysListQuery, ApiKeysRevoke200, ApiKeysRevoke401, ApiKeysRevoke403, ApiKeysRevoke404, ApiKeysRevoke422, ApiKeysRevoke500, ApiKeysRevoke502, ApiKeysRevoke504, ApiKeysRevokePathParams, ApiKeysRotate200, ApiKeysRotate401, ApiKeysRotate403, ApiKeysRotate404, ApiKeysRotate422, ApiKeysRotate500, ApiKeysRotate504, ApiKeysRotatePathParams, ApiKeysUpdate200, ApiKeysUpdate401, ApiKeysUpdate403, ApiKeysUpdate404, ApiKeysUpdate422, ApiKeysUpdate500, ApiKeysUpdate504, ApiKeysUpdatePathParams, ApiKeysUpdateRequestJson };
248
+
249
+ //# sourceMappingURL=api-keys.js.map