samva 0.15.0 → 0.17.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 (128) hide show
  1. package/AGENTS.md +4 -1
  2. package/README.md +46 -1
  3. package/dist/analytics-CaqPRsry.js +207 -0
  4. package/dist/api-keys-Ce1Y4_Ip.js +274 -0
  5. package/dist/attachments-DYqVIraC.js +140 -0
  6. package/dist/brands-ZwuOGIWO.js +175 -0
  7. package/dist/campaigns-DZlz1E9E.js +522 -0
  8. package/dist/categories-CA4XIQAb.js +1011 -0
  9. package/dist/client/sdk.gen.d.ts +234 -49
  10. package/dist/client/types.gen.d.ts +1521 -348
  11. package/dist/client-DOzUrdTE.js +1115 -0
  12. package/dist/contact-groups-BLbFXnjq.js +446 -0
  13. package/dist/contacts-BbsoXXB4.js +787 -0
  14. package/dist/conversations-_sRHueML.js +494 -0
  15. package/dist/custom-fields-BHWbwlKn.js +176 -0
  16. package/dist/effect/analytics.js +2 -21
  17. package/dist/effect/api-keys.d.ts +1 -0
  18. package/dist/effect/api-keys.js +2 -25
  19. package/dist/effect/attachments.js +2 -17
  20. package/dist/effect/brands.d.ts +1 -1
  21. package/dist/effect/brands.js +3 -24
  22. package/dist/effect/campaigns.js +2 -33
  23. package/dist/effect/categories.js +1 -1
  24. package/dist/effect/client.d.ts +1 -1
  25. package/dist/effect/client.js +3 -4
  26. package/dist/effect/contact-groups.js +2 -29
  27. package/dist/effect/contacts.d.ts +52 -0
  28. package/dist/effect/contacts.js +2 -47
  29. package/dist/effect/conversations.js +2 -35
  30. package/dist/effect/custom-fields.js +2 -17
  31. package/dist/effect/email.d.ts +3 -20
  32. package/dist/effect/email.js +2 -141
  33. package/dist/effect/events.d.ts +121 -0
  34. package/dist/effect/events.js +3 -0
  35. package/dist/effect/extension-installations.js +2 -27
  36. package/dist/effect/extensions.js +2 -19
  37. package/dist/effect/feedback.d.ts +1 -1
  38. package/dist/effect/feedback.js +3 -13
  39. package/dist/effect/generated/analytics.d.ts +715 -0
  40. package/dist/effect/generated/api-keys.d.ts +1627 -0
  41. package/dist/effect/generated/attachments.d.ts +554 -0
  42. package/dist/effect/generated/brands.d.ts +1118 -0
  43. package/dist/effect/generated/campaigns.d.ts +3783 -0
  44. package/dist/effect/generated/contact-events.d.ts +158 -0
  45. package/dist/effect/generated/contact-groups.d.ts +1445 -0
  46. package/dist/effect/generated/contacts.d.ts +3789 -0
  47. package/dist/effect/generated/conversations.d.ts +2870 -0
  48. package/dist/effect/generated/custom-fields.d.ts +562 -0
  49. package/dist/effect/generated/email.d.ts +10622 -0
  50. package/dist/effect/generated/events.d.ts +463 -0
  51. package/dist/effect/generated/extension-installations.d.ts +1786 -0
  52. package/dist/effect/generated/extensions.d.ts +927 -0
  53. package/dist/effect/generated/feedback.d.ts +116 -0
  54. package/dist/effect/generated/index.d.ts +61 -0
  55. package/dist/effect/generated/journeys.d.ts +6135 -0
  56. package/dist/effect/generated/mailboxes.d.ts +13641 -0
  57. package/dist/effect/generated/media.d.ts +741 -0
  58. package/dist/effect/generated/messages.d.ts +2355 -0
  59. package/dist/effect/generated/namespaces.d.ts +654 -0
  60. package/dist/effect/generated/operations.d.ts +514 -0
  61. package/dist/effect/generated/organizations.d.ts +1111 -0
  62. package/dist/effect/generated/scheduled-messages.d.ts +1798 -0
  63. package/dist/effect/generated/shared.d.ts +3250 -0
  64. package/dist/effect/generated/subscriptions.d.ts +188 -0
  65. package/dist/effect/generated/templates.d.ts +8177 -0
  66. package/dist/effect/generated/unsubscribe-groups.d.ts +1153 -0
  67. package/dist/effect/generated/webhooks.d.ts +1697 -0
  68. package/dist/effect/generated/whoami.d.ts +291 -0
  69. package/dist/effect/generated-metadata.d.ts +1631 -0
  70. package/dist/effect/index.d.ts +4 -1
  71. package/dist/effect/index.js +29 -26
  72. package/dist/effect/internal/client.d.ts +10 -7
  73. package/dist/effect/internal/email-sender.d.ts +17 -0
  74. package/dist/effect/internal/operation.d.ts +12 -72
  75. package/dist/effect/internal/send.d.ts +60 -0
  76. package/dist/effect/journeys.d.ts +2153 -0
  77. package/dist/effect/journeys.js +2 -0
  78. package/dist/effect/mailboxes.d.ts +255 -205
  79. package/dist/effect/mailboxes.js +2 -2
  80. package/dist/effect/media.js +3 -1
  81. package/dist/effect/messages.d.ts +2 -2
  82. package/dist/effect/messages.js +3 -1
  83. package/dist/effect/namespaces.js +2 -19
  84. package/dist/effect/operations.js +2 -15
  85. package/dist/effect/organizations.js +2 -23
  86. package/dist/effect/retry.js +1 -1
  87. package/dist/effect/scheduled-messages.js +2 -19
  88. package/dist/effect/subscriptions.js +2 -9
  89. package/dist/effect/templates.d.ts +1 -1
  90. package/dist/effect/templates.js +3 -78
  91. package/dist/effect/unsubscribe-groups.js +2 -27
  92. package/dist/effect/webhooks.d.ts +9 -9
  93. package/dist/effect/webhooks.js +3 -33
  94. package/dist/effect/whoami.d.ts +46 -0
  95. package/dist/effect/whoami.js +2 -0
  96. package/dist/email-R0NAA9PW.js +2498 -0
  97. package/dist/events-CxbTUHYT.js +82 -0
  98. package/dist/extension-installations-CD94LPmk.js +407 -0
  99. package/dist/extensions-BKyNQLvu.js +220 -0
  100. package/dist/feedback-Bpa09JOS.js +52 -0
  101. package/dist/index.js +3 -3
  102. package/dist/{inline-attachments-UxLeyytJ.js → inline-attachments-Bi1hDltp.js} +2 -2
  103. package/dist/journeys-CARo_BJT.js +499 -0
  104. package/dist/mailboxes-BRDn7BIK.js +2470 -0
  105. package/dist/media-VrrtNnft.js +181 -0
  106. package/dist/namespaces-CcvEbG-y.js +152 -0
  107. package/dist/{operation-BZ5Xov-x.js → operation-n_IYgNVK.js} +85 -102
  108. package/dist/operations-CmB3FHwf.js +93 -0
  109. package/dist/organizations-A-plufWc.js +252 -0
  110. package/dist/promises/errors.gen.d.ts +12 -2
  111. package/dist/promises/index.d.ts +9 -3
  112. package/dist/promises/index.js +3 -3
  113. package/dist/promises/types.gen.d.ts +1 -1
  114. package/dist/{promises-Cd6Jamqk.js → promises---Kbh-7z.js} +745 -195
  115. package/dist/runtime-P0l1_2-C.js +25 -0
  116. package/dist/scheduled-messages-DkKZRRaN.js +207 -0
  117. package/dist/send-Bxc0XfGE.js +722 -0
  118. package/dist/service-map.d.ts +101 -15
  119. package/dist/subscriptions-DEXYtMXg.js +67 -0
  120. package/dist/templates-DZomxsG7.js +2289 -0
  121. package/dist/unsubscribe-groups-Iqk4Isf9.js +291 -0
  122. package/dist/webhooks-CPXuu8Xf.js +530 -0
  123. package/dist/whoami-Ccz0jwlt.js +59 -0
  124. package/package.json +17 -3
  125. package/dist/categories-BGUBFdH9.js +0 -183
  126. package/dist/client-CDg7zJs0.js +0 -13726
  127. package/dist/effect/generated.d.ts +0 -64059
  128. package/dist/mailboxes-BH_JPmOE.js +0 -159
@@ -0,0 +1,446 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
+ import { D as Cursor, Jt as UnauthorizedError, K as ForbiddenError, Lt as ResourceNotFoundError, Mt as OrganizationId, Y as InternalError, _ as ContactGroupId, en as ValidationError, et as JsonValue, q as GatewayTimeoutError, s as ApiKeySecurityMiddleware, v as ContactId, y as ContactIdentity } from "./client-DOzUrdTE.js";
3
+ import { n as forGroup } from "./operation-n_IYgNVK.js";
4
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
5
+ import * as Schema from "effect/Schema";
6
+ //#region src/effect/generated/contact-groups.ts
7
+ const ContactGroupPage = /* @__PURE__ */ Schema.Struct({
8
+ items: Schema.Array(Schema.Struct({
9
+ id: ContactGroupId,
10
+ organizationId: OrganizationId,
11
+ name: Schema.String,
12
+ description: Schema.Union([Schema.String, Schema.Null]),
13
+ type: Schema.Union([
14
+ Schema.Literal("static"),
15
+ Schema.Literal("dynamic"),
16
+ Schema.Literal("smart")
17
+ ]),
18
+ criteria: Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]),
19
+ color: Schema.Union([Schema.Union([
20
+ Schema.Literal("clay"),
21
+ Schema.Literal("sand"),
22
+ Schema.Literal("moss"),
23
+ Schema.Literal("sky"),
24
+ Schema.Literal("plum"),
25
+ Schema.Literal("rose")
26
+ ]), Schema.Null]).annotate({ description: "The list's label color, one of six families, or null for the neutral chip. Customer-chosen and purely presentational; it carries no meaning the API enforces." }),
27
+ icon: Schema.Union([Schema.String, Schema.Null]),
28
+ parentGroupId: Schema.Union([ContactGroupId, Schema.Null]),
29
+ contactCount: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
30
+ lastCalculatedAt: Schema.Union([Schema.String, Schema.Null]),
31
+ isActive: Schema.Boolean,
32
+ createdAt: Schema.String,
33
+ updatedAt: Schema.String
34
+ })),
35
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
36
+ }).annotate({ identifier: "ContactGroupPage" });
37
+ const ContactGroupMemberPage = /* @__PURE__ */ Schema.Struct({
38
+ items: Schema.Array(Schema.Struct({
39
+ id: Schema.String,
40
+ organizationId: OrganizationId,
41
+ groupId: ContactGroupId,
42
+ contactId: ContactId,
43
+ role: Schema.Union([
44
+ Schema.Literal("member"),
45
+ Schema.Literal("moderator"),
46
+ Schema.Literal("admin")
47
+ ]),
48
+ joinedAt: Schema.String,
49
+ joinedBy: Schema.Union([ContactId, Schema.Null]),
50
+ expiresAt: Schema.Union([Schema.String, Schema.Null]),
51
+ contact: Schema.Union([Schema.Struct({
52
+ id: ContactId,
53
+ name: Schema.String,
54
+ displayName: Schema.Union([Schema.String, Schema.Null]),
55
+ type: Schema.String,
56
+ identities: Schema.optionalKey(Schema.Union([Schema.Array(ContactIdentity), Schema.Null]))
57
+ }), Schema.Null])
58
+ })),
59
+ nextCursor: Schema.Union([Schema.String, Schema.Null])
60
+ }).annotate({ identifier: "ContactGroupMemberPage" });
61
+ const ContactGroupsListQuery = /* @__PURE__ */ Schema.Struct({
62
+ limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
63
+ cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null])),
64
+ type: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Union([
65
+ Schema.Literal("static"),
66
+ Schema.Literal("dynamic"),
67
+ Schema.Literal("smart")
68
+ ]), Schema.Array(Schema.Union([
69
+ Schema.Literal("static"),
70
+ Schema.Literal("dynamic"),
71
+ Schema.Literal("smart")
72
+ ]))]), Schema.Null])),
73
+ isActive: Schema.optionalKey(Schema.Union([Schema.String.annotate({ contentMediaType: "application/json" }), Schema.Null]))
74
+ });
75
+ const ContactGroupsList200 = ContactGroupPage;
76
+ const ContactGroupsList401 = UnauthorizedError;
77
+ const ContactGroupsList403 = ForbiddenError;
78
+ const ContactGroupsList422 = ValidationError;
79
+ const ContactGroupsList500 = InternalError;
80
+ const ContactGroupsList504 = GatewayTimeoutError;
81
+ const ContactGroupsCreateRequestJson = /* @__PURE__ */ Schema.Struct({
82
+ name: Schema.String,
83
+ description: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
84
+ type: Schema.optionalKey(Schema.Union([Schema.Union([
85
+ Schema.Literal("static"),
86
+ Schema.Literal("dynamic"),
87
+ Schema.Literal("smart")
88
+ ]), Schema.Null])),
89
+ criteria: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]), Schema.Null])),
90
+ color: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Union([
91
+ Schema.Literal("clay"),
92
+ Schema.Literal("sand"),
93
+ Schema.Literal("moss"),
94
+ Schema.Literal("sky"),
95
+ Schema.Literal("plum"),
96
+ Schema.Literal("rose")
97
+ ]), Schema.Null]).annotate({ description: "The list's label color, one of six families, or null for the neutral chip. Customer-chosen and purely presentational; it carries no meaning the API enforces." }), Schema.Null])),
98
+ icon: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
99
+ parentGroupId: Schema.optionalKey(Schema.Union([Schema.Union([ContactGroupId, Schema.Null]), Schema.Null])),
100
+ isActive: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
101
+ });
102
+ const ContactGroupsCreate201 = /* @__PURE__ */ Schema.Struct({
103
+ id: ContactGroupId,
104
+ organizationId: OrganizationId,
105
+ name: Schema.String,
106
+ description: Schema.Union([Schema.String, Schema.Null]),
107
+ type: Schema.Union([
108
+ Schema.Literal("static"),
109
+ Schema.Literal("dynamic"),
110
+ Schema.Literal("smart")
111
+ ]),
112
+ criteria: Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]),
113
+ color: Schema.Union([Schema.Union([
114
+ Schema.Literal("clay"),
115
+ Schema.Literal("sand"),
116
+ Schema.Literal("moss"),
117
+ Schema.Literal("sky"),
118
+ Schema.Literal("plum"),
119
+ Schema.Literal("rose")
120
+ ]), Schema.Null]).annotate({ description: "The list's label color, one of six families, or null for the neutral chip. Customer-chosen and purely presentational; it carries no meaning the API enforces." }),
121
+ icon: Schema.Union([Schema.String, Schema.Null]),
122
+ parentGroupId: Schema.Union([ContactGroupId, Schema.Null]),
123
+ contactCount: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
124
+ lastCalculatedAt: Schema.Union([Schema.String, Schema.Null]),
125
+ isActive: Schema.Boolean,
126
+ createdAt: Schema.String,
127
+ updatedAt: Schema.String
128
+ });
129
+ const ContactGroupsCreate401 = UnauthorizedError;
130
+ const ContactGroupsCreate403 = ForbiddenError;
131
+ const ContactGroupsCreate422 = ValidationError;
132
+ const ContactGroupsCreate500 = InternalError;
133
+ const ContactGroupsCreate504 = GatewayTimeoutError;
134
+ const ContactGroupsGetByIdPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
135
+ const ContactGroupsGetById200 = /* @__PURE__ */ Schema.Struct({
136
+ id: ContactGroupId,
137
+ organizationId: OrganizationId,
138
+ name: Schema.String,
139
+ description: Schema.Union([Schema.String, Schema.Null]),
140
+ type: Schema.Union([
141
+ Schema.Literal("static"),
142
+ Schema.Literal("dynamic"),
143
+ Schema.Literal("smart")
144
+ ]),
145
+ criteria: Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]),
146
+ color: Schema.Union([Schema.Union([
147
+ Schema.Literal("clay"),
148
+ Schema.Literal("sand"),
149
+ Schema.Literal("moss"),
150
+ Schema.Literal("sky"),
151
+ Schema.Literal("plum"),
152
+ Schema.Literal("rose")
153
+ ]), Schema.Null]).annotate({ description: "The list's label color, one of six families, or null for the neutral chip. Customer-chosen and purely presentational; it carries no meaning the API enforces." }),
154
+ icon: Schema.Union([Schema.String, Schema.Null]),
155
+ parentGroupId: Schema.Union([ContactGroupId, Schema.Null]),
156
+ contactCount: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
157
+ lastCalculatedAt: Schema.Union([Schema.String, Schema.Null]),
158
+ isActive: Schema.Boolean,
159
+ createdAt: Schema.String,
160
+ updatedAt: Schema.String
161
+ });
162
+ const ContactGroupsGetById401 = UnauthorizedError;
163
+ const ContactGroupsGetById403 = ForbiddenError;
164
+ const ContactGroupsGetById404 = ResourceNotFoundError;
165
+ const ContactGroupsGetById422 = ValidationError;
166
+ const ContactGroupsGetById500 = InternalError;
167
+ const ContactGroupsGetById504 = GatewayTimeoutError;
168
+ const ContactGroupsRemovePathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
169
+ const ContactGroupsRemove200 = /* @__PURE__ */ Schema.Struct({ success: Schema.Boolean });
170
+ const ContactGroupsRemove401 = UnauthorizedError;
171
+ const ContactGroupsRemove403 = ForbiddenError;
172
+ const ContactGroupsRemove404 = ResourceNotFoundError;
173
+ const ContactGroupsRemove422 = ValidationError;
174
+ const ContactGroupsRemove500 = InternalError;
175
+ const ContactGroupsRemove504 = GatewayTimeoutError;
176
+ const ContactGroupsUpdatePathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
177
+ const ContactGroupsUpdateRequestJson = /* @__PURE__ */ Schema.Struct({
178
+ name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
179
+ description: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
180
+ type: Schema.optionalKey(Schema.Union([Schema.Union([
181
+ Schema.Literal("static"),
182
+ Schema.Literal("dynamic"),
183
+ Schema.Literal("smart")
184
+ ]), Schema.Null])),
185
+ criteria: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]), Schema.Null])),
186
+ color: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Union([
187
+ Schema.Literal("clay"),
188
+ Schema.Literal("sand"),
189
+ Schema.Literal("moss"),
190
+ Schema.Literal("sky"),
191
+ Schema.Literal("plum"),
192
+ Schema.Literal("rose")
193
+ ]), Schema.Null]).annotate({ description: "The list's label color, one of six families, or null for the neutral chip. Customer-chosen and purely presentational; it carries no meaning the API enforces." }), Schema.Null])),
194
+ icon: Schema.optionalKey(Schema.Union([Schema.Union([Schema.String, Schema.Null]), Schema.Null])),
195
+ parentGroupId: Schema.optionalKey(Schema.Union([Schema.Union([ContactGroupId, Schema.Null]), Schema.Null])),
196
+ isActive: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]))
197
+ });
198
+ const ContactGroupsUpdate200 = /* @__PURE__ */ Schema.Struct({
199
+ id: ContactGroupId,
200
+ organizationId: OrganizationId,
201
+ name: Schema.String,
202
+ description: Schema.Union([Schema.String, Schema.Null]),
203
+ type: Schema.Union([
204
+ Schema.Literal("static"),
205
+ Schema.Literal("dynamic"),
206
+ Schema.Literal("smart")
207
+ ]),
208
+ criteria: Schema.Union([Schema.Record(Schema.String, JsonValue), Schema.Null]),
209
+ color: Schema.Union([Schema.Union([
210
+ Schema.Literal("clay"),
211
+ Schema.Literal("sand"),
212
+ Schema.Literal("moss"),
213
+ Schema.Literal("sky"),
214
+ Schema.Literal("plum"),
215
+ Schema.Literal("rose")
216
+ ]), Schema.Null]).annotate({ description: "The list's label color, one of six families, or null for the neutral chip. Customer-chosen and purely presentational; it carries no meaning the API enforces." }),
217
+ icon: Schema.Union([Schema.String, Schema.Null]),
218
+ parentGroupId: Schema.Union([ContactGroupId, Schema.Null]),
219
+ contactCount: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
220
+ lastCalculatedAt: Schema.Union([Schema.String, Schema.Null]),
221
+ isActive: Schema.Boolean,
222
+ createdAt: Schema.String,
223
+ updatedAt: Schema.String
224
+ });
225
+ const ContactGroupsUpdate401 = UnauthorizedError;
226
+ const ContactGroupsUpdate403 = ForbiddenError;
227
+ const ContactGroupsUpdate404 = ResourceNotFoundError;
228
+ const ContactGroupsUpdate422 = ValidationError;
229
+ const ContactGroupsUpdate500 = InternalError;
230
+ const ContactGroupsUpdate504 = GatewayTimeoutError;
231
+ const ContactGroupsEvaluateDynamicPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
232
+ const ContactGroupsEvaluateDynamic200 = /* @__PURE__ */ Schema.Struct({
233
+ added: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
234
+ removed: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
235
+ total: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
236
+ });
237
+ const ContactGroupsEvaluateDynamic401 = UnauthorizedError;
238
+ const ContactGroupsEvaluateDynamic403 = ForbiddenError;
239
+ const ContactGroupsEvaluateDynamic404 = ResourceNotFoundError;
240
+ const ContactGroupsEvaluateDynamic422 = ValidationError;
241
+ const ContactGroupsEvaluateDynamic500 = InternalError;
242
+ const ContactGroupsEvaluateDynamic504 = GatewayTimeoutError;
243
+ const ContactGroupsGetMembersPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
244
+ const ContactGroupsGetMembersQuery = /* @__PURE__ */ Schema.Struct({
245
+ limit: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
246
+ cursor: Schema.optionalKey(Schema.Union([Cursor, Schema.Null]))
247
+ });
248
+ const ContactGroupsGetMembers200 = ContactGroupMemberPage;
249
+ const ContactGroupsGetMembers401 = UnauthorizedError;
250
+ const ContactGroupsGetMembers403 = ForbiddenError;
251
+ const ContactGroupsGetMembers404 = ResourceNotFoundError;
252
+ const ContactGroupsGetMembers422 = ValidationError;
253
+ const ContactGroupsGetMembers500 = InternalError;
254
+ const ContactGroupsGetMembers504 = GatewayTimeoutError;
255
+ const ContactGroupsAddMembersPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
256
+ const ContactGroupsAddMembersRequestJson = /* @__PURE__ */ Schema.Struct({
257
+ contactIds: Schema.TupleWithRest(Schema.Tuple([ContactId]), [ContactId]),
258
+ role: Schema.optionalKey(Schema.Union([Schema.Union([
259
+ Schema.Literal("member"),
260
+ Schema.Literal("moderator"),
261
+ Schema.Literal("admin")
262
+ ]), Schema.Null]))
263
+ });
264
+ const ContactGroupsAddMembers200 = /* @__PURE__ */ Schema.Struct({
265
+ added: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
266
+ skipped: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }))
267
+ });
268
+ const ContactGroupsAddMembers401 = UnauthorizedError;
269
+ const ContactGroupsAddMembers403 = ForbiddenError;
270
+ const ContactGroupsAddMembers404 = ResourceNotFoundError;
271
+ const ContactGroupsAddMembers422 = ValidationError;
272
+ const ContactGroupsAddMembers500 = InternalError;
273
+ const ContactGroupsAddMembers504 = GatewayTimeoutError;
274
+ const ContactGroupsRemoveMembersPathParams = /* @__PURE__ */ Schema.Struct({ id: ContactGroupId });
275
+ const ContactGroupsRemoveMembersRequestJson = /* @__PURE__ */ Schema.Struct({ contactIds: Schema.TupleWithRest(Schema.Tuple([ContactId]), [ContactId]) });
276
+ const ContactGroupsRemoveMembers200 = /* @__PURE__ */ Schema.Struct({ removed: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })) });
277
+ const ContactGroupsRemoveMembers401 = UnauthorizedError;
278
+ const ContactGroupsRemoveMembers403 = ForbiddenError;
279
+ const ContactGroupsRemoveMembers404 = ResourceNotFoundError;
280
+ const ContactGroupsRemoveMembers422 = ValidationError;
281
+ const ContactGroupsRemoveMembers500 = InternalError;
282
+ const ContactGroupsRemoveMembers504 = GatewayTimeoutError;
283
+ const ContactGroupsPreviewRequestJson = /* @__PURE__ */ Schema.Struct({ criteria: Schema.Struct({
284
+ tags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
285
+ channels: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
286
+ match: Schema.optionalKey(Schema.Union([Schema.Union([Schema.Literal("all"), Schema.Literal("any")]), Schema.Null])),
287
+ conditions: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Struct({
288
+ field: Schema.String,
289
+ operator: Schema.String,
290
+ value: JsonValue
291
+ })), Schema.Null]))
292
+ }) });
293
+ const ContactGroupsPreview200 = /* @__PURE__ */ Schema.Struct({
294
+ count: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })),
295
+ sample: Schema.Array(Schema.Struct({
296
+ id: ContactId,
297
+ name: Schema.String,
298
+ status: Schema.String
299
+ }))
300
+ });
301
+ const ContactGroupsPreview401 = UnauthorizedError;
302
+ const ContactGroupsPreview403 = ForbiddenError;
303
+ const ContactGroupsPreview422 = ValidationError;
304
+ const ContactGroupsPreview500 = InternalError;
305
+ const ContactGroupsPreview504 = GatewayTimeoutError;
306
+ var ContactGroupsGroup = class extends HttpApiGroup.make("Contact Groups").add(HttpApiEndpoint.get("contactGroupsList", "/v1/contact-groups", {
307
+ query: ContactGroupsListQuery,
308
+ success: ContactGroupsList200,
309
+ error: [
310
+ ContactGroupsList401.pipe(HttpApiSchema.status(401)),
311
+ ContactGroupsList403.pipe(HttpApiSchema.status(403)),
312
+ ContactGroupsList422.pipe(HttpApiSchema.status(422)),
313
+ ContactGroupsList500,
314
+ ContactGroupsList504.pipe(HttpApiSchema.status(504))
315
+ ]
316
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.list").annotate(OpenApi.Summary, "List contact groups").annotate(OpenApi.Description, "Returns the organization's contact groups, newest first, filterable by type and active state. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("contactGroupsCreate", "/v1/contact-groups", {
317
+ payload: ContactGroupsCreateRequestJson,
318
+ success: ContactGroupsCreate201.pipe(HttpApiSchema.status(201)),
319
+ error: [
320
+ ContactGroupsCreate401.pipe(HttpApiSchema.status(401)),
321
+ ContactGroupsCreate403.pipe(HttpApiSchema.status(403)),
322
+ ContactGroupsCreate422.pipe(HttpApiSchema.status(422)),
323
+ ContactGroupsCreate500,
324
+ ContactGroupsCreate504.pipe(HttpApiSchema.status(504))
325
+ ]
326
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.create").annotate(OpenApi.Summary, "Create a contact group").annotate(OpenApi.Description, "Creates a new contact group and returns it with a 201 status."), HttpApiEndpoint.get("contactGroupsGetById", "/v1/contact-groups/:id", {
327
+ params: ContactGroupsGetByIdPathParams,
328
+ success: ContactGroupsGetById200,
329
+ error: [
330
+ ContactGroupsGetById401.pipe(HttpApiSchema.status(401)),
331
+ ContactGroupsGetById403.pipe(HttpApiSchema.status(403)),
332
+ ContactGroupsGetById404.pipe(HttpApiSchema.status(404)),
333
+ ContactGroupsGetById422.pipe(HttpApiSchema.status(422)),
334
+ ContactGroupsGetById500,
335
+ ContactGroupsGetById504.pipe(HttpApiSchema.status(504))
336
+ ]
337
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.getById").annotate(OpenApi.Summary, "Get a contact group").annotate(OpenApi.Description, "Returns a single contact group by its ID."), HttpApiEndpoint.delete("contactGroupsRemove", "/v1/contact-groups/:id", {
338
+ params: ContactGroupsRemovePathParams,
339
+ success: ContactGroupsRemove200,
340
+ error: [
341
+ ContactGroupsRemove401.pipe(HttpApiSchema.status(401)),
342
+ ContactGroupsRemove403.pipe(HttpApiSchema.status(403)),
343
+ ContactGroupsRemove404.pipe(HttpApiSchema.status(404)),
344
+ ContactGroupsRemove422.pipe(HttpApiSchema.status(422)),
345
+ ContactGroupsRemove500,
346
+ ContactGroupsRemove504.pipe(HttpApiSchema.status(504))
347
+ ]
348
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.remove").annotate(OpenApi.Summary, "Delete a contact group").annotate(OpenApi.Description, "Permanently deletes a contact group by its ID."), HttpApiEndpoint.patch("contactGroupsUpdate", "/v1/contact-groups/:id", {
349
+ params: ContactGroupsUpdatePathParams,
350
+ payload: ContactGroupsUpdateRequestJson,
351
+ success: ContactGroupsUpdate200,
352
+ error: [
353
+ ContactGroupsUpdate401.pipe(HttpApiSchema.status(401)),
354
+ ContactGroupsUpdate403.pipe(HttpApiSchema.status(403)),
355
+ ContactGroupsUpdate404.pipe(HttpApiSchema.status(404)),
356
+ ContactGroupsUpdate422.pipe(HttpApiSchema.status(422)),
357
+ ContactGroupsUpdate500,
358
+ ContactGroupsUpdate504.pipe(HttpApiSchema.status(504))
359
+ ]
360
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.update").annotate(OpenApi.Summary, "Update a contact group").annotate(OpenApi.Description, "Updates an existing contact group's fields and returns the updated group."), HttpApiEndpoint.post("contactGroupsEvaluateDynamic", "/v1/contact-groups/:id/evaluate", {
361
+ params: ContactGroupsEvaluateDynamicPathParams,
362
+ success: ContactGroupsEvaluateDynamic200,
363
+ error: [
364
+ ContactGroupsEvaluateDynamic401.pipe(HttpApiSchema.status(401)),
365
+ ContactGroupsEvaluateDynamic403.pipe(HttpApiSchema.status(403)),
366
+ ContactGroupsEvaluateDynamic404.pipe(HttpApiSchema.status(404)),
367
+ ContactGroupsEvaluateDynamic422.pipe(HttpApiSchema.status(422)),
368
+ ContactGroupsEvaluateDynamic500,
369
+ ContactGroupsEvaluateDynamic504.pipe(HttpApiSchema.status(504))
370
+ ]
371
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.evaluateDynamic").annotate(OpenApi.Summary, "Evaluate a dynamic contact group").annotate(OpenApi.Description, "Recomputes a dynamic contact group's membership from its criteria, returning counts of added, removed, and total members."), HttpApiEndpoint.get("contactGroupsGetMembers", "/v1/contact-groups/:id/members", {
372
+ params: ContactGroupsGetMembersPathParams,
373
+ query: ContactGroupsGetMembersQuery,
374
+ success: ContactGroupsGetMembers200,
375
+ error: [
376
+ ContactGroupsGetMembers401.pipe(HttpApiSchema.status(401)),
377
+ ContactGroupsGetMembers403.pipe(HttpApiSchema.status(403)),
378
+ ContactGroupsGetMembers404.pipe(HttpApiSchema.status(404)),
379
+ ContactGroupsGetMembers422.pipe(HttpApiSchema.status(422)),
380
+ ContactGroupsGetMembers500,
381
+ ContactGroupsGetMembers504.pipe(HttpApiSchema.status(504))
382
+ ]
383
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.getMembers").annotate(OpenApi.Summary, "List members of a contact group").annotate(OpenApi.Description, "Returns a contact group's members, most recently joined first. Pass `nextCursor` back as `cursor` for the next page; it is null on the last page."), HttpApiEndpoint.post("contactGroupsAddMembers", "/v1/contact-groups/:id/members", {
384
+ params: ContactGroupsAddMembersPathParams,
385
+ payload: ContactGroupsAddMembersRequestJson,
386
+ success: ContactGroupsAddMembers200,
387
+ error: [
388
+ ContactGroupsAddMembers401.pipe(HttpApiSchema.status(401)),
389
+ ContactGroupsAddMembers403.pipe(HttpApiSchema.status(403)),
390
+ ContactGroupsAddMembers404.pipe(HttpApiSchema.status(404)),
391
+ ContactGroupsAddMembers422.pipe(HttpApiSchema.status(422)),
392
+ ContactGroupsAddMembers500,
393
+ ContactGroupsAddMembers504.pipe(HttpApiSchema.status(504))
394
+ ]
395
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.addMembers").annotate(OpenApi.Summary, "Add members to a contact group").annotate(OpenApi.Description, "Adds one or more contacts to a contact group, returning counts of added and skipped members."), HttpApiEndpoint.delete("contactGroupsRemoveMembers", "/v1/contact-groups/:id/members", {
396
+ params: ContactGroupsRemoveMembersPathParams,
397
+ payload: ContactGroupsRemoveMembersRequestJson,
398
+ success: ContactGroupsRemoveMembers200,
399
+ error: [
400
+ ContactGroupsRemoveMembers401.pipe(HttpApiSchema.status(401)),
401
+ ContactGroupsRemoveMembers403.pipe(HttpApiSchema.status(403)),
402
+ ContactGroupsRemoveMembers404.pipe(HttpApiSchema.status(404)),
403
+ ContactGroupsRemoveMembers422.pipe(HttpApiSchema.status(422)),
404
+ ContactGroupsRemoveMembers500,
405
+ ContactGroupsRemoveMembers504.pipe(HttpApiSchema.status(504))
406
+ ]
407
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.removeMembers").annotate(OpenApi.Summary, "Remove members from a contact group").annotate(OpenApi.Description, "Removes one or more contacts from a contact group, returning the count of removed members."), HttpApiEndpoint.post("contactGroupsPreview", "/v1/contact-groups/preview", {
408
+ payload: ContactGroupsPreviewRequestJson,
409
+ success: ContactGroupsPreview200,
410
+ error: [
411
+ ContactGroupsPreview401.pipe(HttpApiSchema.status(401)),
412
+ ContactGroupsPreview403.pipe(HttpApiSchema.status(403)),
413
+ ContactGroupsPreview422.pipe(HttpApiSchema.status(422)),
414
+ ContactGroupsPreview500,
415
+ ContactGroupsPreview504.pipe(HttpApiSchema.status(504))
416
+ ]
417
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "contactGroups.preview").annotate(OpenApi.Summary, "Preview contact group criteria").annotate(OpenApi.Description, "Evaluates group criteria without persisting, returning the matching contact count and a sample of matches.")).annotate(OpenApi.Description, "Segment management — static and dynamic groups with membership operations") {};
418
+ //#endregion
419
+ //#region src/effect/contact-groups.ts
420
+ var contact_groups_exports = /* @__PURE__ */ __exportAll({
421
+ addMembers: () => addMembers,
422
+ create: () => create,
423
+ evaluateDynamic: () => evaluateDynamic,
424
+ getById: () => getById,
425
+ getMembers: () => getMembers,
426
+ list: () => list,
427
+ preview: () => preview,
428
+ remove: () => remove,
429
+ removeMembers: () => removeMembers,
430
+ update: () => update
431
+ });
432
+ const make = forGroup(ContactGroupsGroup);
433
+ const list = make("contactGroupsList");
434
+ const create = make("contactGroupsCreate");
435
+ const getById = make("contactGroupsGetById");
436
+ const update = make("contactGroupsUpdate");
437
+ const remove = make("contactGroupsRemove");
438
+ const preview = make("contactGroupsPreview");
439
+ const evaluateDynamic = make("contactGroupsEvaluateDynamic");
440
+ const getMembers = make("contactGroupsGetMembers");
441
+ const addMembers = make("contactGroupsAddMembers");
442
+ const removeMembers = make("contactGroupsRemoveMembers");
443
+ //#endregion
444
+ export { getById as a, preview as c, update as d, evaluateDynamic as i, remove as l, contact_groups_exports as n, getMembers as o, create as r, list as s, addMembers as t, removeMembers as u };
445
+
446
+ //# sourceMappingURL=contact-groups-BLbFXnjq.js.map