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,203 @@
1
+ import { ApiKeySecurityMiddleware, ConflictError, Cursor, ExtensionId, ExtensionVersionId, ExtensionVersionRef, ForbiddenError, GatewayTimeoutError, InternalError, ResourceNotFoundError, 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/extensions.ts
5
+ const ExtensionBundle = /* @__PURE__ */ Schema.Struct({
6
+ sha256: Schema.String,
7
+ sizeBytes: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" }))
8
+ }).annotate({ identifier: "ExtensionBundle" });
9
+ const ExtensionVersion = /* @__PURE__ */ Schema.Struct({
10
+ id: ExtensionVersionId,
11
+ version: Schema.String,
12
+ runtime: Schema.Union([Schema.Literal("hosted"), Schema.Literal("webhook")]),
13
+ bundle: Schema.Union([ExtensionBundle, Schema.Null]),
14
+ publishedAt: Schema.String,
15
+ manifest: Schema.Struct({
16
+ name: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9-]{1,62}[a-z0-9]$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z][a-z0-9-]{1,62}[a-z0-9]$" })),
17
+ displayName: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(80).annotate({ expected: "a string with at most 80 code points" })).check(Schema.isMaxLength(80).annotate({ expected: "a value with a length of at most 80" })),
18
+ description: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(500).annotate({ expected: "a string with at most 500 code points" })).check(Schema.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" })), Schema.Null])),
19
+ version: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^\\d{1,6}\\.\\d{1,6}\\.\\d{1,6}(?:-[0-9A-Za-z.-]{1,64})?$", "u")).annotate({ expected: "a string matching the RegExp ^\\d{1,6}\\.\\d{1,6}\\.\\d{1,6}(?:-[0-9A-Za-z.-]{1,64})?$" })),
20
+ runtime: Schema.Union([Schema.Literal("hosted"), Schema.Literal("webhook")]),
21
+ events: Schema.Array(Schema.Union([
22
+ Schema.Literal("mailbox.message.received"),
23
+ Schema.Literal("mailbox.message.sent"),
24
+ Schema.Literal("mailbox.action.pending_approval"),
25
+ Schema.Literal("mailbox.message.quarantined"),
26
+ Schema.Literal("mailbox.message.released"),
27
+ Schema.Literal("mailbox.message.discarded")
28
+ ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
29
+ permissions: Schema.Array(Schema.Union([
30
+ Schema.Literal("read"),
31
+ Schema.Literal("update"),
32
+ Schema.Literal("send"),
33
+ Schema.Literal("quarantine.read")
34
+ ]))
35
+ })
36
+ }).annotate({ identifier: "ExtensionVersion" });
37
+ const ExtensionVersionSummary = /* @__PURE__ */ Schema.Struct({
38
+ id: ExtensionVersionId,
39
+ version: Schema.String,
40
+ runtime: Schema.Union([Schema.Literal("hosted"), Schema.Literal("webhook")]),
41
+ bundle: Schema.Union([ExtensionBundle, Schema.Null]),
42
+ publishedAt: Schema.String
43
+ }).annotate({ identifier: "ExtensionVersionSummary" });
44
+ const Extension = /* @__PURE__ */ Schema.Struct({
45
+ id: ExtensionId,
46
+ name: Schema.String,
47
+ displayName: Schema.String,
48
+ description: Schema.Union([Schema.String, Schema.Null]),
49
+ runtime: Schema.Union([Schema.Literal("hosted"), Schema.Literal("webhook")]),
50
+ latestVersion: ExtensionVersionRef,
51
+ createdAt: Schema.String,
52
+ updatedAt: Schema.String
53
+ }).annotate({ identifier: "Extension" });
54
+ const ExtensionVersionPage = /* @__PURE__ */ Schema.Struct({
55
+ items: Schema.Array(ExtensionVersionSummary),
56
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
57
+ }).annotate({ identifier: "ExtensionVersionPage" });
58
+ const ExtensionPage = /* @__PURE__ */ Schema.Struct({
59
+ items: Schema.Array(Extension),
60
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
61
+ }).annotate({ identifier: "ExtensionPage" });
62
+ const PublishExtensionVersionResponse = /* @__PURE__ */ Schema.Struct({
63
+ extension: Extension,
64
+ version: ExtensionVersion
65
+ }).annotate({ identifier: "PublishExtensionVersionResponse" });
66
+ const ExtensionsListQuery = /* @__PURE__ */ Schema.Struct({
67
+ limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
68
+ cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null])),
69
+ after: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
70
+ before: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
71
+ });
72
+ const ExtensionsList200 = ExtensionPage;
73
+ const ExtensionsList401 = UnauthorizedError;
74
+ const ExtensionsList403 = ForbiddenError;
75
+ const ExtensionsList404 = ResourceNotFoundError;
76
+ const ExtensionsList422 = ValidationError;
77
+ const ExtensionsList500 = InternalError;
78
+ const ExtensionsList504 = GatewayTimeoutError;
79
+ const ExtensionsPublishRequestJson = /* @__PURE__ */ Schema.Struct({
80
+ manifest: Schema.Struct({
81
+ name: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9-]{1,62}[a-z0-9]$", "u")).annotate({ expected: "a string matching the RegExp ^[a-z][a-z0-9-]{1,62}[a-z0-9]$" })),
82
+ displayName: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(80).annotate({ expected: "a string with at most 80 code points" })).check(Schema.isMaxLength(80).annotate({ expected: "a value with a length of at most 80" })),
83
+ description: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(500).annotate({ expected: "a string with at most 500 code points" })).check(Schema.isMaxLength(500).annotate({ expected: "a value with a length of at most 500" })), Schema.Null])),
84
+ version: Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^\\d{1,6}\\.\\d{1,6}\\.\\d{1,6}(?:-[0-9A-Za-z.-]{1,64})?$", "u")).annotate({ expected: "a string matching the RegExp ^\\d{1,6}\\.\\d{1,6}\\.\\d{1,6}(?:-[0-9A-Za-z.-]{1,64})?$" })),
85
+ runtime: Schema.Union([Schema.Literal("hosted"), Schema.Literal("webhook")]),
86
+ events: Schema.Array(Schema.Union([
87
+ Schema.Literal("mailbox.message.received"),
88
+ Schema.Literal("mailbox.message.sent"),
89
+ Schema.Literal("mailbox.action.pending_approval"),
90
+ Schema.Literal("mailbox.message.quarantined"),
91
+ Schema.Literal("mailbox.message.released"),
92
+ Schema.Literal("mailbox.message.discarded")
93
+ ])).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })),
94
+ permissions: Schema.Array(Schema.Union([
95
+ Schema.Literal("read"),
96
+ Schema.Literal("update"),
97
+ Schema.Literal("send"),
98
+ Schema.Literal("quarantine.read")
99
+ ]))
100
+ }),
101
+ bundle: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
102
+ });
103
+ const ExtensionsPublish201 = PublishExtensionVersionResponse;
104
+ const ExtensionsPublish401 = UnauthorizedError;
105
+ const ExtensionsPublish403 = ForbiddenError;
106
+ const ExtensionsPublish404 = ResourceNotFoundError;
107
+ const ExtensionsPublish409 = ConflictError;
108
+ const ExtensionsPublish422 = ValidationError;
109
+ const ExtensionsPublish500 = InternalError;
110
+ const ExtensionsPublish504 = GatewayTimeoutError;
111
+ const ExtensionsGetPathParams = /* @__PURE__ */ Schema.Struct({ id: Schema.String.annotate({ description: "The extension's id (`ext_…`) or its name." }).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" })).check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })) });
112
+ const ExtensionsGet200 = Extension;
113
+ const ExtensionsGet401 = UnauthorizedError;
114
+ const ExtensionsGet403 = ForbiddenError;
115
+ const ExtensionsGet404 = ResourceNotFoundError;
116
+ const ExtensionsGet422 = ValidationError;
117
+ const ExtensionsGet500 = InternalError;
118
+ const ExtensionsGet504 = GatewayTimeoutError;
119
+ const ExtensionsListVersionsPathParams = /* @__PURE__ */ Schema.Struct({ id: Schema.String.annotate({ description: "The extension's id (`ext_…`) or its name." }).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" })).check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })) });
120
+ const ExtensionsListVersionsQuery = /* @__PURE__ */ Schema.Struct({
121
+ limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
122
+ cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
123
+ });
124
+ const ExtensionsListVersions200 = ExtensionVersionPage;
125
+ const ExtensionsListVersions401 = UnauthorizedError;
126
+ const ExtensionsListVersions403 = ForbiddenError;
127
+ const ExtensionsListVersions404 = ResourceNotFoundError;
128
+ const ExtensionsListVersions422 = ValidationError;
129
+ const ExtensionsListVersions500 = InternalError;
130
+ const ExtensionsListVersions504 = GatewayTimeoutError;
131
+ const ExtensionsGetVersionPathParams = /* @__PURE__ */ Schema.Struct({
132
+ id: Schema.String.annotate({ description: "The extension's id (`ext_…`) or its name." }).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(64).annotate({ expected: "a string with at most 64 code points" })).check(Schema.isMaxLength(64).annotate({ expected: "a value with a length of at most 64" })),
133
+ versionId: Schema.String.annotate({ description: "The version's id (`extver_…`) or its version string, such as `1.0.0`." }).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(85).annotate({ expected: "a string with at most 85 code points" })).check(Schema.isMaxLength(85).annotate({ expected: "a value with a length of at most 85" }))
134
+ });
135
+ const ExtensionsGetVersion200 = ExtensionVersion;
136
+ const ExtensionsGetVersion401 = UnauthorizedError;
137
+ const ExtensionsGetVersion403 = ForbiddenError;
138
+ const ExtensionsGetVersion404 = ResourceNotFoundError;
139
+ const ExtensionsGetVersion422 = ValidationError;
140
+ const ExtensionsGetVersion500 = InternalError;
141
+ const ExtensionsGetVersion504 = GatewayTimeoutError;
142
+ var ExtensionsGroup = class extends HttpApiGroup.make("Extensions").add(HttpApiEndpoint.get("extensionsList", "/v1/extensions", {
143
+ query: ExtensionsListQuery,
144
+ success: ExtensionsList200,
145
+ error: [
146
+ ExtensionsList401.pipe(HttpApiSchema.status(401)),
147
+ ExtensionsList403.pipe(HttpApiSchema.status(403)),
148
+ ExtensionsList404.pipe(HttpApiSchema.status(404)),
149
+ ExtensionsList422.pipe(HttpApiSchema.status(422)),
150
+ ExtensionsList500,
151
+ ExtensionsList504.pipe(HttpApiSchema.status(504))
152
+ ]
153
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "extensions.list").annotate(OpenApi.Summary, "List extensions").annotate(OpenApi.Description, "Returns the organization's published extensions with their latest version, newest first, filterable by creation time (`after`, `before`). Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("extensionsPublish", "/v1/extensions", {
154
+ payload: ExtensionsPublishRequestJson,
155
+ success: ExtensionsPublish201.pipe(HttpApiSchema.status(201)),
156
+ error: [
157
+ ExtensionsPublish401.pipe(HttpApiSchema.status(401)),
158
+ ExtensionsPublish403.pipe(HttpApiSchema.status(403)),
159
+ ExtensionsPublish404.pipe(HttpApiSchema.status(404)),
160
+ ExtensionsPublish409.pipe(HttpApiSchema.status(409)),
161
+ ExtensionsPublish422.pipe(HttpApiSchema.status(422)),
162
+ ExtensionsPublish500,
163
+ ExtensionsPublish504.pipe(HttpApiSchema.status(504))
164
+ ]
165
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "extensions.publish").annotate(OpenApi.Summary, "Publish an extension version").annotate(OpenApi.Description, "Publishes one version from its manifest and returns it with status 201, creating the extension named by the manifest on its first version. A hosted manifest carries its bundle. Publishing a version again with the same manifest and bundle returns it; a different one conflicts, so bump the manifest's version. Only a person can publish, not an API key."), HttpApiEndpoint.get("extensionsGet", "/v1/extensions/:id", {
166
+ params: ExtensionsGetPathParams,
167
+ success: ExtensionsGet200,
168
+ error: [
169
+ ExtensionsGet401.pipe(HttpApiSchema.status(401)),
170
+ ExtensionsGet403.pipe(HttpApiSchema.status(403)),
171
+ ExtensionsGet404.pipe(HttpApiSchema.status(404)),
172
+ ExtensionsGet422.pipe(HttpApiSchema.status(422)),
173
+ ExtensionsGet500,
174
+ ExtensionsGet504.pipe(HttpApiSchema.status(504))
175
+ ]
176
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "extensions.get").annotate(OpenApi.Summary, "Get an extension").annotate(OpenApi.Description, "Returns one extension by its id or name. Its versions are `GET /v1/extensions/{id}/versions`."), HttpApiEndpoint.get("extensionsListVersions", "/v1/extensions/:id/versions", {
177
+ params: ExtensionsListVersionsPathParams,
178
+ query: ExtensionsListVersionsQuery,
179
+ success: ExtensionsListVersions200,
180
+ error: [
181
+ ExtensionsListVersions401.pipe(HttpApiSchema.status(401)),
182
+ ExtensionsListVersions403.pipe(HttpApiSchema.status(403)),
183
+ ExtensionsListVersions404.pipe(HttpApiSchema.status(404)),
184
+ ExtensionsListVersions422.pipe(HttpApiSchema.status(422)),
185
+ ExtensionsListVersions500,
186
+ ExtensionsListVersions504.pipe(HttpApiSchema.status(504))
187
+ ]
188
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "extensions.listVersions").annotate(OpenApi.Summary, "List an extension's versions").annotate(OpenApi.Description, "Returns summaries of an extension's published versions, newest first. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page. Read a version's manifest with `GET /v1/extensions/{id}/versions/{versionId}`."), HttpApiEndpoint.get("extensionsGetVersion", "/v1/extensions/:id/versions/:versionId", {
189
+ params: ExtensionsGetVersionPathParams,
190
+ success: ExtensionsGetVersion200,
191
+ error: [
192
+ ExtensionsGetVersion401.pipe(HttpApiSchema.status(401)),
193
+ ExtensionsGetVersion403.pipe(HttpApiSchema.status(403)),
194
+ ExtensionsGetVersion404.pipe(HttpApiSchema.status(404)),
195
+ ExtensionsGetVersion422.pipe(HttpApiSchema.status(422)),
196
+ ExtensionsGetVersion500,
197
+ ExtensionsGetVersion504.pipe(HttpApiSchema.status(504))
198
+ ]
199
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "extensions.getVersion").annotate(OpenApi.Summary, "Get an extension version").annotate(OpenApi.Description, "Returns one version, by its id or version string, with the manifest it was published with.")).annotate(OpenApi.Description, "Code that receives mailbox events and acts through the mailbox API") {};
200
+ //#endregion
201
+ export { Extension, ExtensionBundle, ExtensionPage, ExtensionVersion, ExtensionVersionPage, ExtensionVersionSummary, ExtensionsGet200, ExtensionsGet401, ExtensionsGet403, ExtensionsGet404, ExtensionsGet422, ExtensionsGet500, ExtensionsGet504, ExtensionsGetPathParams, ExtensionsGetVersion200, ExtensionsGetVersion401, ExtensionsGetVersion403, ExtensionsGetVersion404, ExtensionsGetVersion422, ExtensionsGetVersion500, ExtensionsGetVersion504, ExtensionsGetVersionPathParams, ExtensionsGroup, ExtensionsList200, ExtensionsList401, ExtensionsList403, ExtensionsList404, ExtensionsList422, ExtensionsList500, ExtensionsList504, ExtensionsListQuery, ExtensionsListVersions200, ExtensionsListVersions401, ExtensionsListVersions403, ExtensionsListVersions404, ExtensionsListVersions422, ExtensionsListVersions500, ExtensionsListVersions504, ExtensionsListVersionsPathParams, ExtensionsListVersionsQuery, ExtensionsPublish201, ExtensionsPublish401, ExtensionsPublish403, ExtensionsPublish404, ExtensionsPublish409, ExtensionsPublish422, ExtensionsPublish500, ExtensionsPublish504, ExtensionsPublishRequestJson, PublishExtensionVersionResponse };
202
+
203
+ //# sourceMappingURL=extensions.js.map
@@ -0,0 +1,116 @@
1
+ import type * as EffectBrand from "effect/Brand";
2
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
3
+ import * as Schema from "effect/Schema";
4
+ import { ApiKeySecurityMiddleware, FeedbackContext, ForbiddenError, GatewayTimeoutError, InternalError, UnauthorizedError, ValidationError } from "./shared";
5
+ export type FeedbackId = string & EffectBrand.Brand<"FeedbackId">;
6
+ export declare const FeedbackId: Schema.brand<Schema.String, "FeedbackId">;
7
+ export type FeedbackReceipt = {
8
+ readonly id: FeedbackId;
9
+ readonly createdAt: string;
10
+ };
11
+ export declare const FeedbackReceipt: Schema.Struct<{
12
+ readonly id: Schema.brand<Schema.String, "FeedbackId">;
13
+ readonly createdAt: Schema.String;
14
+ }>;
15
+ export type FeedbackSendRequestJson = {
16
+ readonly message: string;
17
+ readonly category?: "bug" | "confusing" | "missing" | "other" | null;
18
+ readonly context?: FeedbackContext | null;
19
+ };
20
+ export declare const FeedbackSendRequestJson: Schema.Struct<{
21
+ readonly message: Schema.String;
22
+ readonly category: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"bug">, Schema.Literal<"confusing">, Schema.Literal<"missing">, Schema.Literal<"other">]>, Schema.Null]>>;
23
+ readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
24
+ readonly operation: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
25
+ readonly resourceId: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
26
+ }>, Schema.Null]>>;
27
+ }>;
28
+ export type FeedbackSend201 = FeedbackReceipt;
29
+ export declare const FeedbackSend201: Schema.Struct<{
30
+ readonly id: Schema.brand<Schema.String, "FeedbackId">;
31
+ readonly createdAt: Schema.String;
32
+ }>;
33
+ export type FeedbackSend401 = UnauthorizedError;
34
+ export declare const FeedbackSend401: typeof UnauthorizedError;
35
+ export type FeedbackSend403 = ForbiddenError;
36
+ export declare const FeedbackSend403: typeof ForbiddenError;
37
+ export type FeedbackSend422 = ValidationError;
38
+ export declare const FeedbackSend422: typeof ValidationError;
39
+ export type FeedbackSend500 = InternalError;
40
+ export declare const FeedbackSend500: typeof InternalError;
41
+ export type FeedbackSend504 = GatewayTimeoutError;
42
+ export declare const FeedbackSend504: typeof GatewayTimeoutError;
43
+ declare const FeedbackGroup_base: HttpApiGroup.HttpApiGroup<"Feedback", HttpApiEndpoint.HttpApiEndpoint<"feedbackSend", "POST", "/v1/feedback", never, never, Schema.toCodecJson<Schema.Struct<{
44
+ readonly message: Schema.String;
45
+ readonly category: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"bug">, Schema.Literal<"confusing">, Schema.Literal<"missing">, Schema.Literal<"other">]>, Schema.Null]>>;
46
+ readonly context: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
47
+ readonly operation: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
48
+ readonly resourceId: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
49
+ }>, Schema.Null]>>;
50
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
51
+ readonly id: Schema.brand<Schema.String, "FeedbackId">;
52
+ readonly createdAt: Schema.String;
53
+ }>>, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<ForbiddenError, {
54
+ readonly _tag: "ForbiddenError";
55
+ readonly message: string;
56
+ }, readonly [Schema.Struct<{
57
+ readonly _tag: Schema.tag<"ForbiddenError">;
58
+ readonly message: Schema.String;
59
+ }>], {
60
+ readonly _tag: "ForbiddenError";
61
+ readonly message: string;
62
+ }>, Schema.Struct<{
63
+ readonly _tag: Schema.tag<"ForbiddenError">;
64
+ readonly message: Schema.String;
65
+ }>, never, never> | Schema.decodeTo<Schema.declareConstructor<GatewayTimeoutError, {
66
+ readonly _tag: "GatewayTimeoutError";
67
+ readonly message: string;
68
+ readonly retryAfterSeconds: number;
69
+ }, readonly [Schema.Struct<{
70
+ readonly _tag: Schema.tag<"GatewayTimeoutError">;
71
+ readonly message: Schema.String;
72
+ readonly retryAfterSeconds: Schema.Finite;
73
+ }>], {
74
+ readonly _tag: "GatewayTimeoutError";
75
+ readonly message: string;
76
+ readonly retryAfterSeconds: number;
77
+ }>, Schema.Struct<{
78
+ readonly _tag: Schema.tag<"GatewayTimeoutError">;
79
+ readonly message: Schema.String;
80
+ readonly retryAfterSeconds: Schema.Finite;
81
+ }>, never, never> | Schema.decodeTo<Schema.declareConstructor<UnauthorizedError, {
82
+ readonly _tag: "UnauthorizedError";
83
+ readonly message: string;
84
+ }, readonly [Schema.Struct<{
85
+ readonly _tag: Schema.tag<"UnauthorizedError">;
86
+ readonly message: Schema.String;
87
+ }>], {
88
+ readonly _tag: "UnauthorizedError";
89
+ readonly message: string;
90
+ }>, Schema.Struct<{
91
+ readonly _tag: Schema.tag<"UnauthorizedError">;
92
+ readonly message: Schema.String;
93
+ }>, never, never> | Schema.decodeTo<Schema.declareConstructor<ValidationError, {
94
+ readonly _tag: "ValidationError";
95
+ readonly message: string;
96
+ readonly fields?: {
97
+ readonly [x: string]: readonly string[];
98
+ } | null;
99
+ }, readonly [Schema.Struct<{
100
+ readonly _tag: Schema.tag<"ValidationError">;
101
+ readonly message: Schema.String;
102
+ readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
103
+ }>], {
104
+ readonly _tag: "ValidationError";
105
+ readonly message: string;
106
+ readonly fields?: {
107
+ readonly [x: string]: readonly string[];
108
+ } | null;
109
+ }>, Schema.Struct<{
110
+ readonly _tag: Schema.tag<"ValidationError">;
111
+ readonly message: Schema.String;
112
+ readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
113
+ }>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never>, false>;
114
+ export declare class FeedbackGroup extends FeedbackGroup_base {
115
+ }
116
+ export {};
@@ -0,0 +1,43 @@
1
+ import { ApiKeySecurityMiddleware, FeedbackContext, ForbiddenError, GatewayTimeoutError, InternalError, 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/feedback.ts
5
+ const FeedbackId = /* @__PURE__ */ Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^fdbk_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
6
+ expected: "a string matching the RegExp ^fdbk_[0-9a-hjkmnp-tv-z]{16,24}$",
7
+ identifier: "FeedbackId"
8
+ })).pipe(Schema.brand("FeedbackId"));
9
+ const FeedbackReceipt = /* @__PURE__ */ Schema.Struct({
10
+ id: FeedbackId,
11
+ createdAt: Schema.String
12
+ }).annotate({ identifier: "FeedbackReceipt" });
13
+ const FeedbackSendRequestJson = /* @__PURE__ */ Schema.Struct({
14
+ message: Schema.String.annotate({ description: "What happened and what you expected, in plain language (at most 4000 characters)." }).check(Schema.isMaxCodePoints(4e3).annotate({ expected: "a string with at most 4000 code points" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("\\S", "u")).annotate({ expected: "a string matching the RegExp \\S" })).check(Schema.isMaxLength(4e3).annotate({ expected: "a value with a length of at most 4000" })),
15
+ category: Schema.optionalKey(Schema.Union([Schema.Union([
16
+ Schema.Literal("bug"),
17
+ Schema.Literal("confusing"),
18
+ Schema.Literal("missing"),
19
+ Schema.Literal("other")
20
+ ]).annotate({ description: "`bug`: the API behaved wrongly. `confusing`: a response, error, or doc was hard to act on. `missing`: a capability or field you needed does not exist. `other`: anything else." }), Schema.Null])),
21
+ context: Schema.optionalKey(Schema.Union([FeedbackContext, Schema.Null]))
22
+ });
23
+ const FeedbackSend201 = FeedbackReceipt;
24
+ const FeedbackSend401 = UnauthorizedError;
25
+ const FeedbackSend403 = ForbiddenError;
26
+ const FeedbackSend422 = ValidationError;
27
+ const FeedbackSend500 = InternalError;
28
+ const FeedbackSend504 = GatewayTimeoutError;
29
+ var FeedbackGroup = class extends HttpApiGroup.make("Feedback").add(HttpApiEndpoint.post("feedbackSend", "/v1/feedback", {
30
+ payload: FeedbackSendRequestJson,
31
+ success: FeedbackSend201.pipe(HttpApiSchema.status(201)),
32
+ error: [
33
+ FeedbackSend401.pipe(HttpApiSchema.status(401)),
34
+ FeedbackSend403.pipe(HttpApiSchema.status(403)),
35
+ FeedbackSend422.pipe(HttpApiSchema.status(422)),
36
+ FeedbackSend500,
37
+ FeedbackSend504.pipe(HttpApiSchema.status(504))
38
+ ]
39
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "feedback.send").annotate(OpenApi.Summary, "Send feedback").annotate(OpenApi.Description, "Tells Samva what was confusing, broken, or missing in the API. Programs and coding agents can call it the moment something goes wrong, naming the operation and resource involved. Samva's team reads every report; the answer is a receipt, not a reply.")).annotate(OpenApi.Description, "Reports to Samva about the API itself.") {};
40
+ //#endregion
41
+ export { FeedbackGroup, FeedbackId, FeedbackReceipt, FeedbackSend201, FeedbackSend401, FeedbackSend403, FeedbackSend422, FeedbackSend500, FeedbackSend504, FeedbackSendRequestJson };
42
+
43
+ //# sourceMappingURL=feedback.js.map
@@ -0,0 +1,61 @@
1
+ import { HttpApi } from "effect/http-api";
2
+ import { AnalyticsGroup } from "./analytics";
3
+ import { APIKeysGroup } from "./api-keys";
4
+ import { AttachmentsGroup } from "./attachments";
5
+ import { BrandsGroup } from "./brands";
6
+ import { CampaignsGroup } from "./campaigns";
7
+ import { ContactEventsGroup } from "./contact-events";
8
+ import { ContactGroupsGroup } from "./contact-groups";
9
+ import { ContactsGroup } from "./contacts";
10
+ import { ConversationsGroup } from "./conversations";
11
+ import { CustomFieldsGroup } from "./custom-fields";
12
+ import { EmailGroup } from "./email";
13
+ import { EventsGroup } from "./events";
14
+ import { ExtensionInstallationsGroup } from "./extension-installations";
15
+ import { ExtensionsGroup } from "./extensions";
16
+ import { FeedbackGroup } from "./feedback";
17
+ import { JourneysGroup } from "./journeys";
18
+ import { MailboxesGroup } from "./mailboxes";
19
+ import { MediaGroup } from "./media";
20
+ import { MessagesGroup } from "./messages";
21
+ import { NamespacesGroup } from "./namespaces";
22
+ import { OperationsGroup } from "./operations";
23
+ import { OrganizationsGroup } from "./organizations";
24
+ import { ScheduledMessagesGroup } from "./scheduled-messages";
25
+ import { SubscriptionsGroup } from "./subscriptions";
26
+ import { TemplatesGroup } from "./templates";
27
+ import { UnsubscribeGroupsGroup } from "./unsubscribe-groups";
28
+ import { WebhooksGroup } from "./webhooks";
29
+ import { WhoamiGroup } from "./whoami";
30
+ export * from "./shared";
31
+ export * from "./analytics";
32
+ export * from "./api-keys";
33
+ export * from "./attachments";
34
+ export * from "./brands";
35
+ export * from "./campaigns";
36
+ export * from "./contact-groups";
37
+ export * from "./contacts";
38
+ export * from "./contact-events";
39
+ export * from "./conversations";
40
+ export * from "./custom-fields";
41
+ export * from "./email";
42
+ export * from "./events";
43
+ export * from "./extension-installations";
44
+ export * from "./extensions";
45
+ export * from "./feedback";
46
+ export * from "./journeys";
47
+ export * from "./mailboxes";
48
+ export * from "./media";
49
+ export * from "./messages";
50
+ export * from "./scheduled-messages";
51
+ export * from "./namespaces";
52
+ export * from "./operations";
53
+ export * from "./organizations";
54
+ export * from "./subscriptions";
55
+ export * from "./templates";
56
+ export * from "./unsubscribe-groups";
57
+ export * from "./webhooks";
58
+ export * from "./whoami";
59
+ declare const SamvaApi_base: HttpApi.HttpApi<"SamvaApi", typeof AnalyticsGroup | typeof APIKeysGroup | typeof AttachmentsGroup | typeof BrandsGroup | typeof CampaignsGroup | typeof ContactEventsGroup | typeof ContactGroupsGroup | typeof ContactsGroup | typeof ConversationsGroup | typeof CustomFieldsGroup | typeof EmailGroup | typeof EventsGroup | typeof ExtensionInstallationsGroup | typeof ExtensionsGroup | typeof FeedbackGroup | typeof JourneysGroup | typeof MailboxesGroup | typeof MediaGroup | typeof MessagesGroup | typeof NamespacesGroup | typeof OperationsGroup | typeof OrganizationsGroup | typeof ScheduledMessagesGroup | typeof SubscriptionsGroup | typeof TemplatesGroup | typeof UnsubscribeGroupsGroup | typeof WebhooksGroup | typeof WhoamiGroup>;
60
+ export declare class SamvaApi extends SamvaApi_base {
61
+ }