samva 0.45.1 → 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.
- package/AGENTS.md +7 -0
- package/README.md +24 -0
- package/dist/client/sdk.gen.d.ts +438 -5
- package/dist/client/sdk.gen.js +1544 -229
- package/dist/client/types.gen.d.ts +8120 -5616
- package/dist/effect/accounts.d.ts +50 -0
- package/dist/effect/accounts.js +22 -0
- package/dist/effect/agents.d.ts +9 -0
- package/dist/effect/agents.js +1 -1
- package/dist/effect/approval-requests.d.ts +42 -0
- package/dist/effect/approval-requests.js +18 -0
- package/dist/effect/campaigns.d.ts +160 -160
- package/dist/effect/generated/accounts.d.ts +1002 -0
- package/dist/effect/generated/accounts.js +198 -0
- package/dist/effect/generated/agents.d.ts +84 -0
- package/dist/effect/generated/agents.js +1 -0
- package/dist/effect/generated/approval-requests.d.ts +777 -0
- package/dist/effect/generated/approval-requests.js +135 -0
- package/dist/effect/generated/campaigns.d.ts +17 -17
- package/dist/effect/generated/campaigns.js +6 -6
- package/dist/effect/generated/conversations.d.ts +20 -20
- package/dist/effect/generated/conversations.js +10 -10
- package/dist/effect/generated/events.js +1 -1
- package/dist/effect/generated/index.d.ts +11 -1
- package/dist/effect/generated/integrations-catalog.d.ts +671 -0
- package/dist/effect/generated/integrations-catalog.js +217 -0
- package/dist/effect/generated/integrations.d.ts +1401 -0
- package/dist/effect/generated/integrations.js +246 -0
- package/dist/effect/generated/mailboxes.d.ts +8157 -4241
- package/dist/effect/generated/mailboxes.js +677 -52
- package/dist/effect/generated/messages.d.ts +8 -8
- package/dist/effect/generated/messages.js +4 -4
- package/dist/effect/generated/scheduled-messages.d.ts +50 -50
- package/dist/effect/generated/scheduled-messages.js +17 -17
- package/dist/effect/generated/shared.d.ts +661 -511
- package/dist/effect/generated/shared.js +212 -179
- package/dist/effect/generated/template-share-links.d.ts +733 -0
- package/dist/effect/generated/template-share-links.js +165 -0
- package/dist/effect/generated/templates.d.ts +39 -22
- package/dist/effect/generated/templates.js +19 -16
- package/dist/effect/generated-metadata.d.ts +248 -0
- package/dist/effect/generated-metadata.js +705 -555
- package/dist/effect/index.d.ts +5 -0
- package/dist/effect/index.js +6 -1
- package/dist/effect/integrations-catalog.d.ts +38 -0
- package/dist/effect/integrations-catalog.js +16 -0
- package/dist/effect/integrations.d.ts +165 -0
- package/dist/effect/integrations.js +24 -0
- package/dist/effect/mailboxes.d.ts +373 -191
- package/dist/effect/mailboxes.js +31 -1
- package/dist/effect/scheduled-messages.d.ts +350 -350
- package/dist/effect/template-share-links.d.ts +18 -0
- package/dist/effect/template-share-links.js +20 -0
- package/dist/effect/templates.d.ts +4 -3
- package/dist/index.js +2 -2
- package/dist/package.js +1 -1
- package/dist/promises/client.d.ts +11 -1
- package/dist/promises/client.js +13 -3
- package/dist/promises/errors.gen.d.ts +22 -2
- package/dist/promises/errors.gen.js +54 -1
- package/dist/promises/index.js +2 -2
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/service-map.d.ts +203 -0
- package/dist/service-map.js +103 -0
- package/package.json +22 -2
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { ApiKeySecurityMiddleware, ContactId, ForbiddenError, GatewayTimeoutError, IntegrationAccountId, IntegrationId, IntegrationKey, IntegrationReturnTo, InternalError, JsonObject, MalformedRequestError, OrganizationId, ResourceNotFoundError, UnauthorizedError, UserId, 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/accounts.ts
|
|
5
|
+
const AccountStatus = /* @__PURE__ */ (() => Schema.Union([
|
|
6
|
+
Schema.Literal("pending"),
|
|
7
|
+
Schema.Literal("connected"),
|
|
8
|
+
Schema.Literal("needsReconnect")
|
|
9
|
+
]).annotate({ identifier: "AccountStatus" }))();
|
|
10
|
+
const AccountInfo = /* @__PURE__ */ (() => Schema.Struct({
|
|
11
|
+
externalId: Schema.optionalKey(Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }))),
|
|
12
|
+
displayName: Schema.optionalKey(Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }))),
|
|
13
|
+
email: Schema.optionalKey(Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" }))),
|
|
14
|
+
timeZone: Schema.optionalKey(Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })))
|
|
15
|
+
}).annotate({ identifier: "AccountInfo" }))();
|
|
16
|
+
const AccountHealthStatus = /* @__PURE__ */ (() => Schema.Union([
|
|
17
|
+
Schema.Literal("pending"),
|
|
18
|
+
Schema.Literal("healthy"),
|
|
19
|
+
Schema.Literal("needsReconnect"),
|
|
20
|
+
Schema.Literal("forbidden"),
|
|
21
|
+
Schema.Literal("unavailable")
|
|
22
|
+
]).annotate({ identifier: "AccountHealthStatus" }))();
|
|
23
|
+
const DeleteAccountResponse = /* @__PURE__ */ (() => Schema.Struct({
|
|
24
|
+
id: IntegrationAccountId,
|
|
25
|
+
deleted: Schema.Literal(true)
|
|
26
|
+
}).annotate({ identifier: "DeleteAccountResponse" }))();
|
|
27
|
+
const ConnectAccountResponse = /* @__PURE__ */ (() => Schema.Struct({
|
|
28
|
+
accountId: IntegrationAccountId,
|
|
29
|
+
authorizationUrl: Schema.Union([Schema.String, Schema.Null])
|
|
30
|
+
}).annotate({ identifier: "ConnectAccountResponse" }))();
|
|
31
|
+
const IntegrationAccount = /* @__PURE__ */ (() => Schema.Struct({
|
|
32
|
+
provider: IntegrationKey,
|
|
33
|
+
input: JsonObject,
|
|
34
|
+
id: IntegrationAccountId,
|
|
35
|
+
webhooks: Schema.optionalKey(Schema.Array(Schema.Struct({
|
|
36
|
+
app: Schema.String,
|
|
37
|
+
url: Schema.String,
|
|
38
|
+
events: Schema.Array(Schema.String),
|
|
39
|
+
signatureHeader: Schema.String,
|
|
40
|
+
deliveryIdHeader: Schema.String,
|
|
41
|
+
secretSetup: Schema.String
|
|
42
|
+
}))),
|
|
43
|
+
status: AccountStatus,
|
|
44
|
+
info: AccountInfo,
|
|
45
|
+
grantedScopes: Schema.Array(Schema.String),
|
|
46
|
+
connectedBy: Schema.Union([UserId, Schema.Null]),
|
|
47
|
+
connectedAt: Schema.Union([Schema.String, Schema.Null]),
|
|
48
|
+
createdAt: Schema.String,
|
|
49
|
+
updatedAt: Schema.String
|
|
50
|
+
}).annotate({ identifier: "IntegrationAccount" }))();
|
|
51
|
+
const IntegrationAccountHealth = /* @__PURE__ */ (() => Schema.Struct({
|
|
52
|
+
accountId: IntegrationAccountId,
|
|
53
|
+
status: AccountHealthStatus,
|
|
54
|
+
checkedAt: Schema.String
|
|
55
|
+
}).annotate({ identifier: "IntegrationAccountHealth" }))();
|
|
56
|
+
const IntegrationAccountList = /* @__PURE__ */ (() => Schema.Struct({ items: Schema.Array(IntegrationAccount) }).annotate({ identifier: "IntegrationAccountList" }))();
|
|
57
|
+
const AccountsList200 = IntegrationAccountList;
|
|
58
|
+
const AccountsList400 = MalformedRequestError;
|
|
59
|
+
const AccountsList401 = UnauthorizedError;
|
|
60
|
+
const AccountsList403 = ForbiddenError;
|
|
61
|
+
const AccountsList422 = ValidationError;
|
|
62
|
+
const AccountsList500 = InternalError;
|
|
63
|
+
const AccountsList504 = GatewayTimeoutError;
|
|
64
|
+
const AccountsGetPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: IntegrationAccountId }))();
|
|
65
|
+
const AccountsGet200 = IntegrationAccount;
|
|
66
|
+
const AccountsGet400 = MalformedRequestError;
|
|
67
|
+
const AccountsGet401 = UnauthorizedError;
|
|
68
|
+
const AccountsGet403 = ForbiddenError;
|
|
69
|
+
const AccountsGet404 = ResourceNotFoundError;
|
|
70
|
+
const AccountsGet422 = ValidationError;
|
|
71
|
+
const AccountsGet500 = InternalError;
|
|
72
|
+
const AccountsGet504 = GatewayTimeoutError;
|
|
73
|
+
const AccountsRemovePathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: IntegrationAccountId }))();
|
|
74
|
+
const AccountsRemove200 = DeleteAccountResponse;
|
|
75
|
+
const AccountsRemove400 = MalformedRequestError;
|
|
76
|
+
const AccountsRemove401 = UnauthorizedError;
|
|
77
|
+
const AccountsRemove403 = ForbiddenError;
|
|
78
|
+
const AccountsRemove404 = ResourceNotFoundError;
|
|
79
|
+
const AccountsRemove422 = ValidationError;
|
|
80
|
+
const AccountsRemove500 = InternalError;
|
|
81
|
+
const AccountsRemove504 = GatewayTimeoutError;
|
|
82
|
+
const AccountsCheckPathParams = /* @__PURE__ */ (() => Schema.Struct({ accountId: IntegrationAccountId }))();
|
|
83
|
+
const AccountsCheck200 = IntegrationAccountHealth;
|
|
84
|
+
const AccountsCheck400 = MalformedRequestError;
|
|
85
|
+
const AccountsCheck401 = UnauthorizedError;
|
|
86
|
+
const AccountsCheck403 = ForbiddenError;
|
|
87
|
+
const AccountsCheck404 = ResourceNotFoundError;
|
|
88
|
+
const AccountsCheck422 = ValidationError;
|
|
89
|
+
const AccountsCheck500 = InternalError;
|
|
90
|
+
const AccountsCheck504 = GatewayTimeoutError;
|
|
91
|
+
const AccountsConnectRequestJson = /* @__PURE__ */ (() => Schema.Struct({
|
|
92
|
+
provider: IntegrationKey,
|
|
93
|
+
input: Schema.optionalKey(JsonObject),
|
|
94
|
+
credentials: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),
|
|
95
|
+
app: Schema.optionalKey(IntegrationKey),
|
|
96
|
+
accountId: Schema.optionalKey(IntegrationAccountId),
|
|
97
|
+
expectedHosts: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
98
|
+
returnTo: IntegrationReturnTo
|
|
99
|
+
}))();
|
|
100
|
+
const AccountsConnect201 = ConnectAccountResponse;
|
|
101
|
+
const AccountsConnect400 = MalformedRequestError;
|
|
102
|
+
const AccountsConnect401 = UnauthorizedError;
|
|
103
|
+
const AccountsConnect403 = ForbiddenError;
|
|
104
|
+
const AccountsConnect404 = ResourceNotFoundError;
|
|
105
|
+
const AccountsConnect422 = ValidationError;
|
|
106
|
+
const AccountsConnect500 = InternalError;
|
|
107
|
+
const AccountsConnect504 = GatewayTimeoutError;
|
|
108
|
+
const AccountsListContactConnectionsQuery = /* @__PURE__ */ (() => Schema.Struct({ provider: Schema.optionalKey(IntegrationKey) }))();
|
|
109
|
+
const AccountsListContactConnections200 = /* @__PURE__ */ (() => Schema.Struct({ items: Schema.Array(Schema.Struct({
|
|
110
|
+
organizationId: OrganizationId,
|
|
111
|
+
integrationId: IntegrationId,
|
|
112
|
+
contactId: ContactId,
|
|
113
|
+
accountId: IntegrationAccountId,
|
|
114
|
+
provider: Schema.optionalKey(IntegrationKey),
|
|
115
|
+
info: AccountInfo,
|
|
116
|
+
lastUsedAt: Schema.String,
|
|
117
|
+
idleExpiresAt: Schema.String,
|
|
118
|
+
createdAt: Schema.String
|
|
119
|
+
})) }))();
|
|
120
|
+
const AccountsListContactConnections400 = MalformedRequestError;
|
|
121
|
+
const AccountsListContactConnections401 = UnauthorizedError;
|
|
122
|
+
const AccountsListContactConnections403 = ForbiddenError;
|
|
123
|
+
const AccountsListContactConnections422 = ValidationError;
|
|
124
|
+
const AccountsListContactConnections500 = InternalError;
|
|
125
|
+
const AccountsListContactConnections504 = GatewayTimeoutError;
|
|
126
|
+
var AccountsGroup = class extends HttpApiGroup.make("Accounts").add(HttpApiEndpoint.get("accountsList", "/v1/accounts", {
|
|
127
|
+
success: AccountsList200,
|
|
128
|
+
error: [
|
|
129
|
+
AccountsList400.pipe(HttpApiSchema.status(400)),
|
|
130
|
+
AccountsList401.pipe(HttpApiSchema.status(401)),
|
|
131
|
+
AccountsList403.pipe(HttpApiSchema.status(403)),
|
|
132
|
+
AccountsList422.pipe(HttpApiSchema.status(422)),
|
|
133
|
+
AccountsList500,
|
|
134
|
+
AccountsList504.pipe(HttpApiSchema.status(504))
|
|
135
|
+
]
|
|
136
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "accounts.list").annotate(OpenApi.Summary, "List accounts").annotate(OpenApi.Description, "Returns the organization's connected provider accounts, newest first."), HttpApiEndpoint.get("accountsGet", "/v1/accounts/:accountId", {
|
|
137
|
+
params: AccountsGetPathParams,
|
|
138
|
+
success: AccountsGet200,
|
|
139
|
+
error: [
|
|
140
|
+
AccountsGet400.pipe(HttpApiSchema.status(400)),
|
|
141
|
+
AccountsGet401.pipe(HttpApiSchema.status(401)),
|
|
142
|
+
AccountsGet403.pipe(HttpApiSchema.status(403)),
|
|
143
|
+
AccountsGet404.pipe(HttpApiSchema.status(404)),
|
|
144
|
+
AccountsGet422.pipe(HttpApiSchema.status(422)),
|
|
145
|
+
AccountsGet500,
|
|
146
|
+
AccountsGet504.pipe(HttpApiSchema.status(504))
|
|
147
|
+
]
|
|
148
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "accounts.get").annotate(OpenApi.Summary, "Get an account").annotate(OpenApi.Description, "Returns one account with its status and granted scopes. A Shopify account missing requested scopes, including read_products and read_legal_policies, needs reconnecting."), HttpApiEndpoint.delete("accountsRemove", "/v1/accounts/:accountId", {
|
|
149
|
+
params: AccountsRemovePathParams,
|
|
150
|
+
success: AccountsRemove200,
|
|
151
|
+
error: [
|
|
152
|
+
AccountsRemove400.pipe(HttpApiSchema.status(400)),
|
|
153
|
+
AccountsRemove401.pipe(HttpApiSchema.status(401)),
|
|
154
|
+
AccountsRemove403.pipe(HttpApiSchema.status(403)),
|
|
155
|
+
AccountsRemove404.pipe(HttpApiSchema.status(404)),
|
|
156
|
+
AccountsRemove422.pipe(HttpApiSchema.status(422)),
|
|
157
|
+
AccountsRemove500,
|
|
158
|
+
AccountsRemove504.pipe(HttpApiSchema.status(504))
|
|
159
|
+
]
|
|
160
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "accounts.remove").annotate(OpenApi.Summary, "Disconnect an account").annotate(OpenApi.Description, "Revokes Samva's access at the provider and deletes the account with the integrations that link it, and their grants from every agent's draft. A published agent version that granted them can no longer use them; publish the agent to drop the grants."), HttpApiEndpoint.post("accountsCheck", "/v1/accounts/:accountId/check", {
|
|
161
|
+
params: AccountsCheckPathParams,
|
|
162
|
+
success: AccountsCheck200,
|
|
163
|
+
error: [
|
|
164
|
+
AccountsCheck400.pipe(HttpApiSchema.status(400)),
|
|
165
|
+
AccountsCheck401.pipe(HttpApiSchema.status(401)),
|
|
166
|
+
AccountsCheck403.pipe(HttpApiSchema.status(403)),
|
|
167
|
+
AccountsCheck404.pipe(HttpApiSchema.status(404)),
|
|
168
|
+
AccountsCheck422.pipe(HttpApiSchema.status(422)),
|
|
169
|
+
AccountsCheck500,
|
|
170
|
+
AccountsCheck504.pipe(HttpApiSchema.status(504))
|
|
171
|
+
]
|
|
172
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "accounts.check").annotate(OpenApi.Summary, "Check an account").annotate(OpenApi.Description, "Checks the saved credential on demand. A provider outage does not require reconnecting; refused access or missing requested scopes does."), HttpApiEndpoint.post("accountsConnect", "/v1/accounts/connect", {
|
|
173
|
+
payload: AccountsConnectRequestJson,
|
|
174
|
+
success: AccountsConnect201.pipe(HttpApiSchema.status(201)),
|
|
175
|
+
error: [
|
|
176
|
+
AccountsConnect400.pipe(HttpApiSchema.status(400)),
|
|
177
|
+
AccountsConnect401.pipe(HttpApiSchema.status(401)),
|
|
178
|
+
AccountsConnect403.pipe(HttpApiSchema.status(403)),
|
|
179
|
+
AccountsConnect404.pipe(HttpApiSchema.status(404)),
|
|
180
|
+
AccountsConnect422.pipe(HttpApiSchema.status(422)),
|
|
181
|
+
AccountsConnect500,
|
|
182
|
+
AccountsConnect504.pipe(HttpApiSchema.status(504))
|
|
183
|
+
]
|
|
184
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "accounts.connect").annotate(OpenApi.Summary, "Connect an account").annotate(OpenApi.Description, "Connects a provider account. OAuth returns an authorization URL; credential connections return null after validation. Name an app to ask for its scopes and install it when the connection finishes. Pass accountId to reconnect an account for renewed access or additional scopes. Connecting or reconnecting Shopify with read_products and read_legal_policies creates its Shopify store knowledge source."), HttpApiEndpoint.get("accountsListContactConnections", "/v1/accounts/contact-connections", {
|
|
185
|
+
query: AccountsListContactConnectionsQuery,
|
|
186
|
+
success: AccountsListContactConnections200,
|
|
187
|
+
error: [
|
|
188
|
+
AccountsListContactConnections400.pipe(HttpApiSchema.status(400)),
|
|
189
|
+
AccountsListContactConnections401.pipe(HttpApiSchema.status(401)),
|
|
190
|
+
AccountsListContactConnections403.pipe(HttpApiSchema.status(403)),
|
|
191
|
+
AccountsListContactConnections422.pipe(HttpApiSchema.status(422)),
|
|
192
|
+
AccountsListContactConnections500,
|
|
193
|
+
AccountsListContactConnections504.pipe(HttpApiSchema.status(504))
|
|
194
|
+
]
|
|
195
|
+
}).middleware(ApiKeySecurityMiddleware).annotate(OpenApi.Identifier, "accounts.listContactConnections").annotate(OpenApi.Summary, "List contact connections").annotate(OpenApi.Description, "Lists the contact credentials connected for this organization. An administrator can disconnect each account by accountId.")).annotate(OpenApi.Description, "Provider accounts connected for integrations") {};
|
|
196
|
+
export { AccountHealthStatus, AccountInfo, AccountStatus, AccountsCheck200, AccountsCheck400, AccountsCheck401, AccountsCheck403, AccountsCheck404, AccountsCheck422, AccountsCheck500, AccountsCheck504, AccountsCheckPathParams, AccountsConnect201, AccountsConnect400, AccountsConnect401, AccountsConnect403, AccountsConnect404, AccountsConnect422, AccountsConnect500, AccountsConnect504, AccountsConnectRequestJson, AccountsGet200, AccountsGet400, AccountsGet401, AccountsGet403, AccountsGet404, AccountsGet422, AccountsGet500, AccountsGet504, AccountsGetPathParams, AccountsGroup, AccountsList200, AccountsList400, AccountsList401, AccountsList403, AccountsList422, AccountsList500, AccountsList504, AccountsListContactConnections200, AccountsListContactConnections400, AccountsListContactConnections401, AccountsListContactConnections403, AccountsListContactConnections422, AccountsListContactConnections500, AccountsListContactConnections504, AccountsListContactConnectionsQuery, AccountsRemove200, AccountsRemove400, AccountsRemove401, AccountsRemove403, AccountsRemove404, AccountsRemove422, AccountsRemove500, AccountsRemove504, AccountsRemovePathParams, ConnectAccountResponse, DeleteAccountResponse, IntegrationAccount, IntegrationAccountHealth, IntegrationAccountList };
|
|
197
|
+
|
|
198
|
+
//# sourceMappingURL=accounts.js.map
|