samva 0.45.0 → 0.46.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 (67) hide show
  1. package/AGENTS.md +7 -0
  2. package/README.md +24 -0
  3. package/dist/client/sdk.gen.d.ts +438 -5
  4. package/dist/client/sdk.gen.js +1544 -229
  5. package/dist/client/types.gen.d.ts +8124 -5612
  6. package/dist/effect/accounts.d.ts +50 -0
  7. package/dist/effect/accounts.js +22 -0
  8. package/dist/effect/agents.d.ts +9 -0
  9. package/dist/effect/agents.js +1 -1
  10. package/dist/effect/approval-requests.d.ts +42 -0
  11. package/dist/effect/approval-requests.js +18 -0
  12. package/dist/effect/campaigns.d.ts +160 -160
  13. package/dist/effect/generated/accounts.d.ts +1002 -0
  14. package/dist/effect/generated/accounts.js +198 -0
  15. package/dist/effect/generated/agents.d.ts +84 -0
  16. package/dist/effect/generated/agents.js +1 -0
  17. package/dist/effect/generated/analytics.d.ts +6 -0
  18. package/dist/effect/generated/analytics.js +4 -2
  19. package/dist/effect/generated/approval-requests.d.ts +777 -0
  20. package/dist/effect/generated/approval-requests.js +135 -0
  21. package/dist/effect/generated/campaigns.d.ts +17 -17
  22. package/dist/effect/generated/campaigns.js +6 -6
  23. package/dist/effect/generated/conversations.d.ts +20 -20
  24. package/dist/effect/generated/conversations.js +10 -10
  25. package/dist/effect/generated/events.js +1 -1
  26. package/dist/effect/generated/index.d.ts +11 -1
  27. package/dist/effect/generated/integrations-catalog.d.ts +671 -0
  28. package/dist/effect/generated/integrations-catalog.js +217 -0
  29. package/dist/effect/generated/integrations.d.ts +1401 -0
  30. package/dist/effect/generated/integrations.js +246 -0
  31. package/dist/effect/generated/mailboxes.d.ts +8157 -4241
  32. package/dist/effect/generated/mailboxes.js +677 -52
  33. package/dist/effect/generated/messages.d.ts +8 -8
  34. package/dist/effect/generated/messages.js +4 -4
  35. package/dist/effect/generated/scheduled-messages.d.ts +50 -50
  36. package/dist/effect/generated/scheduled-messages.js +17 -17
  37. package/dist/effect/generated/shared.d.ts +661 -511
  38. package/dist/effect/generated/shared.js +212 -179
  39. package/dist/effect/generated/template-share-links.d.ts +733 -0
  40. package/dist/effect/generated/template-share-links.js +165 -0
  41. package/dist/effect/generated/templates.d.ts +39 -22
  42. package/dist/effect/generated/templates.js +19 -16
  43. package/dist/effect/generated-metadata.d.ts +248 -0
  44. package/dist/effect/generated-metadata.js +705 -555
  45. package/dist/effect/index.d.ts +5 -0
  46. package/dist/effect/index.js +6 -1
  47. package/dist/effect/integrations-catalog.d.ts +38 -0
  48. package/dist/effect/integrations-catalog.js +16 -0
  49. package/dist/effect/integrations.d.ts +165 -0
  50. package/dist/effect/integrations.js +24 -0
  51. package/dist/effect/mailboxes.d.ts +373 -191
  52. package/dist/effect/mailboxes.js +31 -1
  53. package/dist/effect/scheduled-messages.d.ts +350 -350
  54. package/dist/effect/template-share-links.d.ts +18 -0
  55. package/dist/effect/template-share-links.js +20 -0
  56. package/dist/effect/templates.d.ts +4 -3
  57. package/dist/index.js +2 -2
  58. package/dist/package.js +1 -1
  59. package/dist/promises/client.d.ts +11 -1
  60. package/dist/promises/client.js +13 -3
  61. package/dist/promises/errors.gen.d.ts +22 -2
  62. package/dist/promises/errors.gen.js +54 -1
  63. package/dist/promises/index.js +2 -2
  64. package/dist/promises/types.gen.d.ts +1 -1
  65. package/dist/service-map.d.ts +203 -0
  66. package/dist/service-map.js +103 -0
  67. package/package.json +22 -2
@@ -0,0 +1,217 @@
1
+ import { ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, IntegrationKey, IntegrationStatus, InternalError, JsonObject, MalformedRequestError, UnauthorizedError, ValidationError } from "./shared.js";
2
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
3
+ import * as Schema from "effect/Schema";
4
+ // src/effect/generated/integrations-catalog.ts
5
+ const IntegrationCatalogSearchEntry = /* @__PURE__ */ (() => Schema.Struct({
6
+ key: IntegrationKey,
7
+ kind: Schema.Union([
8
+ Schema.Literal("mcp"),
9
+ Schema.Literal("openapi"),
10
+ Schema.Literal("graphql")
11
+ ]),
12
+ name: Schema.String,
13
+ description: Schema.String,
14
+ domain: Schema.Union([Schema.String, Schema.Null]),
15
+ category: Schema.Union([
16
+ Schema.Literal("commerce"),
17
+ Schema.Literal("payments"),
18
+ Schema.Literal("shipping"),
19
+ Schema.Literal("calendar"),
20
+ Schema.Literal("crm"),
21
+ Schema.Literal("helpdesk"),
22
+ Schema.Literal("knowledge"),
23
+ Schema.Literal("forms"),
24
+ Schema.Literal("accounting"),
25
+ Schema.Literal("reviews"),
26
+ Schema.Literal("productivity"),
27
+ Schema.Literal("dns"),
28
+ Schema.Literal("channel"),
29
+ Schema.Literal("other")
30
+ ]),
31
+ icon: Schema.Union([Schema.String, Schema.Null]),
32
+ logo: Schema.optionalKey(Schema.Struct({
33
+ file: Schema.String.check(Schema.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" })),
34
+ monochrome: Schema.optionalKey(Schema.Boolean)
35
+ })),
36
+ featured: Schema.Boolean,
37
+ connectSpec: Schema.Struct({
38
+ provider: IntegrationKey,
39
+ auth: Schema.Union([
40
+ Schema.Literal("discover"),
41
+ Schema.Literal("oauth"),
42
+ Schema.Literal("none"),
43
+ Schema.Literal("apiKey")
44
+ ]),
45
+ inputs: Schema.Record(Schema.String, Schema.Struct({
46
+ label: Schema.String.check(Schema.isMaxCodePoints(256).annotate({ expected: "a string with at most 256 code points" })).check(Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" })),
47
+ description: Schema.String.check(Schema.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })),
48
+ pattern: Schema.String.check(Schema.isMaxCodePoints(512).annotate({ expected: "a string with at most 512 code points" })).check(Schema.isMaxLength(512).annotate({ expected: "a value with a length of at most 512" })),
49
+ maxLength: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(2048).annotate({ expected: "a value less than or equal to 2048" })),
50
+ example: Schema.String.check(Schema.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })),
51
+ default: Schema.optionalKey(Schema.String.check(Schema.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" }))),
52
+ kind: Schema.optionalKey(Schema.Union([Schema.Literal("hostnameLabel"), Schema.Literal("httpsUrl")]))
53
+ })).check(Schema.isPropertyNames(Schema.String.check(Schema.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema.isPattern(new globalThis.RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u")).annotate({ expected: "a string matching the RegExp ^[a-zA-Z][a-zA-Z0-9_-]*$" }))).annotate({ expected: "an object with property names matching the schema" })),
54
+ credentials: Schema.Record(Schema.String, Schema.Struct({ label: Schema.String }))
55
+ }),
56
+ connectState: Schema.Union([
57
+ Schema.Literal("ready"),
58
+ Schema.Literal("checkedAtConnect"),
59
+ Schema.Literal("unavailable")
60
+ ]),
61
+ reason: Schema.Union([Schema.String, Schema.Null])
62
+ }).annotate({ identifier: "IntegrationCatalogSearchEntry" }))();
63
+ const IntegrationCatalogConnection = /* @__PURE__ */ (() => Schema.Struct({
64
+ id: Schema.String,
65
+ account: Schema.Union([Schema.String, Schema.Null]),
66
+ status: IntegrationStatus
67
+ }).annotate({ identifier: "IntegrationCatalogConnection" }))();
68
+ const IntegrationCatalogSearchPage = /* @__PURE__ */ (() => Schema.Struct({
69
+ items: Schema.Array(IntegrationCatalogSearchEntry),
70
+ total: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })),
71
+ nextOffset: Schema.Union([Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })), Schema.Null])
72
+ }).annotate({ identifier: "IntegrationCatalogSearchPage" }))();
73
+ const IntegrationCatalogEntry = /* @__PURE__ */ (() => Schema.Struct({
74
+ id: Schema.String.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" })),
75
+ name: Schema.String,
76
+ category: Schema.Union([
77
+ Schema.Literal("commerce"),
78
+ Schema.Literal("payments"),
79
+ Schema.Literal("shipping"),
80
+ Schema.Literal("calendar"),
81
+ Schema.Literal("crm"),
82
+ Schema.Literal("helpdesk"),
83
+ Schema.Literal("knowledge"),
84
+ Schema.Literal("forms"),
85
+ Schema.Literal("accounting"),
86
+ Schema.Literal("reviews"),
87
+ Schema.Literal("productivity"),
88
+ Schema.Literal("dns"),
89
+ Schema.Literal("channel"),
90
+ Schema.Literal("other")
91
+ ]),
92
+ blurb: Schema.String,
93
+ connect: Schema.Union([
94
+ Schema.Literal("account"),
95
+ Schema.Literal("dns"),
96
+ Schema.Literal("channelLink")
97
+ ]),
98
+ inviteOnly: Schema.optionalKey(Schema.String),
99
+ app: Schema.optionalKey(Schema.Union([IntegrationKey, Schema.Null])),
100
+ href: Schema.optionalKey(Schema.Union([Schema.Literal("/whatsapp"), Schema.Null])),
101
+ connections: Schema.Array(IntegrationCatalogConnection),
102
+ usedBy: Schema.Struct({
103
+ agents: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" })),
104
+ journeys: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" }))
105
+ })
106
+ }).annotate({ identifier: "IntegrationCatalogEntry" }))();
107
+ const IntegrationCatalogResponse = /* @__PURE__ */ (() => Schema.Struct({ entries: Schema.Array(IntegrationCatalogEntry) }).annotate({ identifier: "IntegrationCatalogResponse" }))();
108
+ const IntegrationCatalogList200 = IntegrationCatalogResponse;
109
+ const IntegrationCatalogList400 = MalformedRequestError;
110
+ const IntegrationCatalogList401 = UnauthorizedError;
111
+ const IntegrationCatalogList403 = ForbiddenError;
112
+ const IntegrationCatalogList422 = ValidationError;
113
+ const IntegrationCatalogList500 = InternalError;
114
+ const IntegrationCatalogList504 = GatewayTimeoutError;
115
+ const IntegrationCatalogPrepareRequestJson = /* @__PURE__ */ (() => Schema.Struct({
116
+ provider: IntegrationKey,
117
+ input: Schema.optionalKey(JsonObject)
118
+ }))();
119
+ const IntegrationCatalogPrepare200 = /* @__PURE__ */ (() => Schema.Struct({
120
+ connectSpec: Schema.Struct({
121
+ provider: IntegrationKey,
122
+ auth: Schema.Union([
123
+ Schema.Literal("discover"),
124
+ Schema.Literal("oauth"),
125
+ Schema.Literal("none"),
126
+ Schema.Literal("apiKey")
127
+ ]),
128
+ inputs: Schema.Record(Schema.String, Schema.Struct({
129
+ label: Schema.String.check(Schema.isMaxCodePoints(256).annotate({ expected: "a string with at most 256 code points" })).check(Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" })),
130
+ description: Schema.String.check(Schema.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })),
131
+ pattern: Schema.String.check(Schema.isMaxCodePoints(512).annotate({ expected: "a string with at most 512 code points" })).check(Schema.isMaxLength(512).annotate({ expected: "a value with a length of at most 512" })),
132
+ maxLength: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(2048).annotate({ expected: "a value less than or equal to 2048" })),
133
+ example: Schema.String.check(Schema.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" })),
134
+ default: Schema.optionalKey(Schema.String.check(Schema.isMaxCodePoints(2048).annotate({ expected: "a string with at most 2048 code points" })).check(Schema.isMaxLength(2048).annotate({ expected: "a value with a length of at most 2048" }))),
135
+ kind: Schema.optionalKey(Schema.Union([Schema.Literal("hostnameLabel"), Schema.Literal("httpsUrl")]))
136
+ })).check(Schema.isPropertyNames(Schema.String.check(Schema.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema.isPattern(new globalThis.RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u")).annotate({ expected: "a string matching the RegExp ^[a-zA-Z][a-zA-Z0-9_-]*$" }))).annotate({ expected: "an object with property names matching the schema" })),
137
+ credentials: Schema.Record(Schema.String, Schema.Struct({ label: Schema.String }))
138
+ }),
139
+ hosts: Schema.Array(Schema.String),
140
+ connectState: Schema.Union([
141
+ Schema.Literal("ready"),
142
+ Schema.Literal("checkedAtConnect"),
143
+ Schema.Literal("unavailable")
144
+ ]),
145
+ reason: Schema.Union([Schema.String, Schema.Null])
146
+ }))();
147
+ const IntegrationCatalogPrepare400 = MalformedRequestError;
148
+ const IntegrationCatalogPrepare401 = UnauthorizedError;
149
+ const IntegrationCatalogPrepare403 = ForbiddenError;
150
+ const IntegrationCatalogPrepare422 = ValidationError;
151
+ const IntegrationCatalogPrepare500 = InternalError;
152
+ const IntegrationCatalogPrepare504 = GatewayTimeoutError;
153
+ const IntegrationCatalogSearchQuery = /* @__PURE__ */ (() => Schema.Struct({
154
+ key: Schema.optionalKey(IntegrationKey),
155
+ query: Schema.optionalKey(Schema.String.check(Schema.isMaxCodePoints(256).annotate({ expected: "a string with at most 256 code points" })).check(Schema.isMaxLength(256).annotate({ expected: "a value with a length of at most 256" }))),
156
+ category: Schema.optionalKey(Schema.Union([
157
+ Schema.Literal("commerce"),
158
+ Schema.Literal("payments"),
159
+ Schema.Literal("shipping"),
160
+ Schema.Literal("calendar"),
161
+ Schema.Literal("crm"),
162
+ Schema.Literal("helpdesk"),
163
+ Schema.Literal("knowledge"),
164
+ Schema.Literal("forms"),
165
+ Schema.Literal("accounting"),
166
+ Schema.Literal("reviews"),
167
+ Schema.Literal("productivity"),
168
+ Schema.Literal("dns"),
169
+ Schema.Literal("channel"),
170
+ Schema.Literal("other")
171
+ ])),
172
+ offset: Schema.optionalKey(Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" })).check(Schema.isLessThanOrEqualTo(9007199254740991).annotate({ expected: "a value less than or equal to 9007199254740991" }))),
173
+ limit: Schema.optionalKey(Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isGreaterThanOrEqualTo(1).annotate({ expected: "a value greater than or equal to 1" })).check(Schema.isLessThanOrEqualTo(100).annotate({ expected: "a value less than or equal to 100" })))
174
+ }))();
175
+ const IntegrationCatalogSearch200 = IntegrationCatalogSearchPage;
176
+ const IntegrationCatalogSearch400 = MalformedRequestError;
177
+ const IntegrationCatalogSearch401 = UnauthorizedError;
178
+ const IntegrationCatalogSearch403 = ForbiddenError;
179
+ const IntegrationCatalogSearch422 = ValidationError;
180
+ const IntegrationCatalogSearch500 = InternalError;
181
+ const IntegrationCatalogSearch504 = GatewayTimeoutError;
182
+ var IntegrationsCatalogGroup = class extends HttpApiGroup.make("Integrations catalog").add(HttpApiEndpoint.get("integrationCatalogList", "/v1/integrations/catalog", {
183
+ success: IntegrationCatalogList200,
184
+ error: [
185
+ IntegrationCatalogList400.pipe(HttpApiSchema.status(400)),
186
+ IntegrationCatalogList401.pipe(HttpApiSchema.status(401)),
187
+ IntegrationCatalogList403.pipe(HttpApiSchema.status(403)),
188
+ IntegrationCatalogList422.pipe(HttpApiSchema.status(422)),
189
+ IntegrationCatalogList500,
190
+ IntegrationCatalogList504.pipe(HttpApiSchema.status(504))
191
+ ]
192
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "integrationCatalog.list").annotate(OpenApi.Summary, "List the integrations catalog").annotate(OpenApi.Description, "Returns the providers this organization can connect, each with its connections and the agents and journeys that use them."), HttpApiEndpoint.post("integrationCatalogPrepare", "/v1/integrations/catalog/prepare", {
193
+ payload: IntegrationCatalogPrepareRequestJson,
194
+ success: IntegrationCatalogPrepare200,
195
+ error: [
196
+ IntegrationCatalogPrepare400.pipe(HttpApiSchema.status(400)),
197
+ IntegrationCatalogPrepare401.pipe(HttpApiSchema.status(401)),
198
+ IntegrationCatalogPrepare403.pipe(HttpApiSchema.status(403)),
199
+ IntegrationCatalogPrepare422.pipe(HttpApiSchema.status(422)),
200
+ IntegrationCatalogPrepare500,
201
+ IntegrationCatalogPrepare504.pipe(HttpApiSchema.status(504))
202
+ ]
203
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "integrationCatalog.prepare").annotate(OpenApi.Summary, "Prepare an integration connection").annotate(OpenApi.Description, "Resolves what connecting a catalog provider needs: the inputs and credentials it asks for, the hosts its API and OAuth credentials reach, and whether it can connect. Pass input for server inputs such as an API description URL. An unavailable provider carries a reason."), HttpApiEndpoint.get("integrationCatalogSearch", "/v1/integrations/catalog/search", {
204
+ query: IntegrationCatalogSearchQuery,
205
+ success: IntegrationCatalogSearch200,
206
+ error: [
207
+ IntegrationCatalogSearch400.pipe(HttpApiSchema.status(400)),
208
+ IntegrationCatalogSearch401.pipe(HttpApiSchema.status(401)),
209
+ IntegrationCatalogSearch403.pipe(HttpApiSchema.status(403)),
210
+ IntegrationCatalogSearch422.pipe(HttpApiSchema.status(422)),
211
+ IntegrationCatalogSearch500,
212
+ IntegrationCatalogSearch504.pipe(HttpApiSchema.status(504))
213
+ ]
214
+ }).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "integrationCatalog.search").annotate(OpenApi.Summary, "Search the integrations catalog").annotate(OpenApi.Description, "Searches the providers this organization can connect, by key, text or category. Each entry carries its connection requirements and whether it can connect. Follow nextOffset until it is null.")).annotate(OpenApi.Description, "Providers an organization can connect") {};
215
+ export { IntegrationCatalogConnection, IntegrationCatalogEntry, IntegrationCatalogList200, IntegrationCatalogList400, IntegrationCatalogList401, IntegrationCatalogList403, IntegrationCatalogList422, IntegrationCatalogList500, IntegrationCatalogList504, IntegrationCatalogPrepare200, IntegrationCatalogPrepare400, IntegrationCatalogPrepare401, IntegrationCatalogPrepare403, IntegrationCatalogPrepare422, IntegrationCatalogPrepare500, IntegrationCatalogPrepare504, IntegrationCatalogPrepareRequestJson, IntegrationCatalogResponse, IntegrationCatalogSearch200, IntegrationCatalogSearch400, IntegrationCatalogSearch401, IntegrationCatalogSearch403, IntegrationCatalogSearch422, IntegrationCatalogSearch500, IntegrationCatalogSearch504, IntegrationCatalogSearchEntry, IntegrationCatalogSearchPage, IntegrationCatalogSearchQuery, IntegrationsCatalogGroup };
216
+
217
+ //# sourceMappingURL=integrations-catalog.js.map