samva 0.2.0 → 0.4.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 +1 -1
- package/README.md +14 -3
- package/dist/client/sdk.gen.d.ts +321 -129
- package/dist/client/types.gen.d.ts +1818 -777
- package/dist/{client-BqkU-sFv.js → client-BmZK_uCt.js} +2699 -1839
- package/dist/client-attribution-BslSOa_8.js +9 -0
- package/dist/client-attribution.d.ts +2 -0
- package/dist/effect/api-keys.d.ts +51 -51
- package/dist/effect/api-keys.js +1 -1
- package/dist/effect/campaigns.d.ts +320 -1005
- package/dist/effect/campaigns.js +1 -1
- package/dist/effect/categories.d.ts +6 -6
- package/dist/effect/client.js +1 -1
- package/dist/effect/contacts.d.ts +292 -314
- package/dist/effect/contacts.js +1 -1
- package/dist/effect/conversations.d.ts +305 -437
- package/dist/effect/conversations.js +1 -1
- package/dist/effect/design.d.ts +74 -74
- package/dist/effect/design.js +1 -1
- package/dist/effect/email.d.ts +233 -265
- package/dist/effect/email.js +2 -2
- package/dist/effect/generated.d.ts +13410 -14526
- package/dist/effect/index.d.ts +1 -0
- package/dist/effect/index.js +3 -2
- package/dist/effect/internal/client.d.ts +1 -1
- package/dist/effect/internal/operation.d.ts +32 -129
- package/dist/effect/media.d.ts +80 -0
- package/dist/effect/media.js +19 -0
- package/dist/effect/messages.d.ts +90 -307
- package/dist/effect/messages.js +1 -1
- package/dist/effect/operations.d.ts +17 -17
- package/dist/effect/operations.js +1 -1
- package/dist/effect/organizations.d.ts +162 -180
- package/dist/effect/organizations.js +1 -1
- package/dist/effect/runtime.d.ts +0 -2
- package/dist/effect/scheduled-messages.d.ts +242 -639
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/templates.d.ts +1376 -2033
- package/dist/effect/templates.js +40 -30
- package/dist/effect/webhooks.d.ts +53 -54
- package/dist/effect/webhooks.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{normalize-LkWl4HUF.js → normalize-BiIJnycv.js} +6 -15
- package/dist/normalize.d.ts +3 -33
- package/dist/{operation-Ccqh_yxb.js → operation-B1knNlxk.js} +83 -38
- package/dist/promises/index.d.ts +13 -21
- package/dist/promises/index.js +1 -1
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-Dgv8UmCC.js → promises-n1opem5V.js} +572 -184
- package/dist/service-map.d.ts +96 -44
- package/package.json +23 -19
package/dist/effect/templates.js
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { n as make } from "../operation-
|
|
3
|
-
import { s as CreateTemplatePayload, x as UpdateTemplatePayload } from "../client-
|
|
2
|
+
import { n as make } from "../operation-B1knNlxk.js";
|
|
3
|
+
import { s as CreateTemplatePayload, x as UpdateTemplatePayload } from "../client-BmZK_uCt.js";
|
|
4
4
|
//#region src/effect/templates.ts
|
|
5
5
|
var templates_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
CreatePayload: () => CreateTemplatePayload,
|
|
7
7
|
UpdatePayload: () => UpdateTemplatePayload,
|
|
8
|
-
addFamilyChannel: () => addFamilyChannel,
|
|
9
|
-
approve: () => approve,
|
|
10
8
|
attachFamilyMember: () => attachFamilyMember,
|
|
11
|
-
|
|
9
|
+
attachWorkspaceResource: () => attachWorkspaceResource,
|
|
10
|
+
checkWorkspace: () => checkWorkspace,
|
|
12
11
|
create: () => create,
|
|
13
12
|
createFamily: () => createFamily,
|
|
14
13
|
createFamilyFromTemplate: () => createFamilyFromTemplate,
|
|
15
14
|
deleteFamily: () => deleteFamily,
|
|
16
15
|
detachFamilyMember: () => detachFamilyMember,
|
|
16
|
+
diffWorkspace: () => diffWorkspace,
|
|
17
17
|
getById: () => getById,
|
|
18
|
-
getDocument: () => getDocument,
|
|
19
18
|
getFamily: () => getFamily,
|
|
19
|
+
getGitRepository: () => getGitRepository,
|
|
20
|
+
getInputContract: () => getInputContract,
|
|
21
|
+
getPublication: () => getPublication,
|
|
22
|
+
issueGitCredential: () => issueGitCredential,
|
|
20
23
|
list: () => list,
|
|
21
24
|
listDashboard: () => listDashboard,
|
|
22
|
-
listDocumentVersions: () => listDocumentVersions,
|
|
23
25
|
listFamilies: () => listFamilies,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
listInputContracts: () => listInputContracts,
|
|
27
|
+
openWorkspace: () => openWorkspace,
|
|
28
|
+
patchWorkspace: () => patchWorkspace,
|
|
29
|
+
publish: () => publish,
|
|
30
|
+
reconcileWorkspace: () => reconcileWorkspace,
|
|
26
31
|
remove: () => remove,
|
|
32
|
+
removeWorkspaceResource: () => removeWorkspaceResource,
|
|
27
33
|
renameFamily: () => renameFamily,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
update: () => update
|
|
34
|
+
renderWorkspaceFixture: () => renderWorkspaceFixture,
|
|
35
|
+
resolveWorkspaceConflict: () => resolveWorkspaceConflict,
|
|
36
|
+
restoreWorkspace: () => restoreWorkspace,
|
|
37
|
+
saveWorkspace: () => saveWorkspace,
|
|
38
|
+
update: () => update,
|
|
39
|
+
workspaceHistory: () => workspaceHistory
|
|
35
40
|
});
|
|
36
41
|
const list = make("templatesList");
|
|
37
42
|
const create = make("templatesCreate");
|
|
@@ -44,23 +49,28 @@ const renameFamily = make("templatesRenameFamily");
|
|
|
44
49
|
const createFamilyFromTemplate = make("templatesCreateFamilyFromTemplate");
|
|
45
50
|
const attachFamilyMember = make("templatesAttachFamilyMember");
|
|
46
51
|
const detachFamilyMember = make("templatesDetachFamilyMember");
|
|
47
|
-
const addFamilyChannel = make("templatesAddFamilyChannel");
|
|
48
52
|
const getById = make("templatesGetById");
|
|
49
53
|
const remove = make("templatesRemove");
|
|
50
54
|
const update = make("templatesUpdate");
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
55
|
+
const openWorkspace = make("templatesOpenWorkspace");
|
|
56
|
+
const getGitRepository = make("templatesGetGitRepository");
|
|
57
|
+
const issueGitCredential = make("templatesIssueGitCredential");
|
|
58
|
+
const patchWorkspace = make("templatesPatchWorkspace");
|
|
59
|
+
const resolveWorkspaceConflict = make("templatesResolveWorkspaceConflict");
|
|
60
|
+
const attachWorkspaceResource = make("templatesAttachWorkspaceResource");
|
|
61
|
+
const removeWorkspaceResource = make("templatesRemoveWorkspaceResource");
|
|
62
|
+
const reconcileWorkspace = make("templatesReconcileWorkspace");
|
|
63
|
+
const restoreWorkspace = make("templatesRestoreWorkspace");
|
|
64
|
+
const saveWorkspace = make("templatesSaveWorkspace");
|
|
65
|
+
const checkWorkspace = make("templatesCheckWorkspace");
|
|
66
|
+
const renderWorkspaceFixture = make("templatesRenderWorkspaceFixture");
|
|
67
|
+
const publish = make("templatesPublish");
|
|
68
|
+
const getPublication = make("templatesGetPublication");
|
|
69
|
+
const listInputContracts = make("templatesListInputContracts");
|
|
70
|
+
const getInputContract = make("templatesGetInputContract");
|
|
71
|
+
const diffWorkspace = make("templatesDiffWorkspace");
|
|
72
|
+
const workspaceHistory = make("templatesWorkspaceHistory");
|
|
63
73
|
//#endregion
|
|
64
|
-
export { CreateTemplatePayload as CreatePayload, UpdateTemplatePayload as UpdatePayload,
|
|
74
|
+
export { CreateTemplatePayload as CreatePayload, UpdateTemplatePayload as UpdatePayload, attachFamilyMember, attachWorkspaceResource, checkWorkspace, create, createFamily, createFamilyFromTemplate, deleteFamily, detachFamilyMember, diffWorkspace, getById, getFamily, getGitRepository, getInputContract, getPublication, issueGitCredential, list, listDashboard, listFamilies, listInputContracts, openWorkspace, patchWorkspace, publish, reconcileWorkspace, remove, removeWorkspaceResource, renameFamily, renderWorkspaceFixture, resolveWorkspaceConflict, restoreWorkspace, saveWorkspace, templates_exports as t, update, workspaceHistory };
|
|
65
75
|
|
|
66
76
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export { CreateWebhookPayload as CreatePayload, TestWebhookPayload as TestPayload, UpdateWebhookPayload as UpdatePayload, } from "./generated";
|
|
2
2
|
export declare const list: ((input?: {
|
|
3
|
+
readonly page?: string | null | undefined;
|
|
3
4
|
readonly limit?: string | null | undefined;
|
|
4
5
|
readonly search?: string | null | undefined;
|
|
5
|
-
readonly page?: string | null | undefined;
|
|
6
6
|
} | undefined) => import("effect/Effect").Effect<{
|
|
7
7
|
readonly items: readonly {
|
|
8
8
|
readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
9
9
|
readonly name: string;
|
|
10
10
|
readonly url: string;
|
|
11
|
-
readonly eventTypes: readonly ("
|
|
12
|
-
readonly channels: readonly
|
|
13
|
-
readonly status: "
|
|
11
|
+
readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.ended" | "conversation.started" | "conversation.updated" | "domain.updated" | "message.bounced" | "message.complained" | "message.delivered" | "message.failed" | "message.read" | "message.received" | "message.sent" | "template.approved" | "template.created" | "template.deleted" | "template.rejected" | "template.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
|
|
12
|
+
readonly channels: readonly "email"[] | null;
|
|
13
|
+
readonly status: "active" | "disabled";
|
|
14
14
|
readonly hasCustomHeaders: boolean;
|
|
15
15
|
readonly failureStartedAt: string | null;
|
|
16
16
|
readonly lastSucceededAt: string | null;
|
|
@@ -23,19 +23,19 @@ export declare const list: ((input?: {
|
|
|
23
23
|
readonly total: number;
|
|
24
24
|
readonly totalPages: number;
|
|
25
25
|
};
|
|
26
|
-
}, import("
|
|
26
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError, import("./client").Service>) & {
|
|
27
27
|
readonly pages: (input?: {
|
|
28
|
+
readonly page?: string | null | undefined;
|
|
28
29
|
readonly limit?: string | null | undefined;
|
|
29
30
|
readonly search?: string | null | undefined;
|
|
30
|
-
readonly page?: string | null | undefined;
|
|
31
31
|
} | undefined) => import("effect/Stream").Stream<{
|
|
32
32
|
readonly items: readonly {
|
|
33
33
|
readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
34
34
|
readonly name: string;
|
|
35
35
|
readonly url: string;
|
|
36
|
-
readonly eventTypes: readonly ("
|
|
37
|
-
readonly channels: readonly
|
|
38
|
-
readonly status: "
|
|
36
|
+
readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.ended" | "conversation.started" | "conversation.updated" | "domain.updated" | "message.bounced" | "message.complained" | "message.delivered" | "message.failed" | "message.read" | "message.received" | "message.sent" | "template.approved" | "template.created" | "template.deleted" | "template.rejected" | "template.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
|
|
37
|
+
readonly channels: readonly "email"[] | null;
|
|
38
|
+
readonly status: "active" | "disabled";
|
|
39
39
|
readonly hasCustomHeaders: boolean;
|
|
40
40
|
readonly failureStartedAt: string | null;
|
|
41
41
|
readonly lastSucceededAt: string | null;
|
|
@@ -48,42 +48,42 @@ export declare const list: ((input?: {
|
|
|
48
48
|
readonly total: number;
|
|
49
49
|
readonly totalPages: number;
|
|
50
50
|
};
|
|
51
|
-
}, import("
|
|
51
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError, import("./client").Service>;
|
|
52
52
|
readonly items: (input?: {
|
|
53
|
+
readonly page?: string | null | undefined;
|
|
53
54
|
readonly limit?: string | null | undefined;
|
|
54
55
|
readonly search?: string | null | undefined;
|
|
55
|
-
readonly page?: string | null | undefined;
|
|
56
56
|
} | undefined) => import("effect/Stream").Stream<{
|
|
57
57
|
readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
58
58
|
readonly name: string;
|
|
59
59
|
readonly url: string;
|
|
60
|
-
readonly eventTypes: readonly ("
|
|
61
|
-
readonly channels: readonly
|
|
62
|
-
readonly status: "
|
|
60
|
+
readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.ended" | "conversation.started" | "conversation.updated" | "domain.updated" | "message.bounced" | "message.complained" | "message.delivered" | "message.failed" | "message.read" | "message.received" | "message.sent" | "template.approved" | "template.created" | "template.deleted" | "template.rejected" | "template.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
|
|
61
|
+
readonly channels: readonly "email"[] | null;
|
|
62
|
+
readonly status: "active" | "disabled";
|
|
63
63
|
readonly hasCustomHeaders: boolean;
|
|
64
64
|
readonly failureStartedAt: string | null;
|
|
65
65
|
readonly lastSucceededAt: string | null;
|
|
66
66
|
readonly createdAt: string;
|
|
67
67
|
readonly updatedAt: string;
|
|
68
|
-
}, import("
|
|
68
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError, import("./client").Service>;
|
|
69
69
|
};
|
|
70
70
|
export declare const create: (input: {
|
|
71
|
-
readonly url: string;
|
|
72
71
|
readonly name: string;
|
|
72
|
+
readonly url: string;
|
|
73
73
|
readonly eventTypes: readonly string[];
|
|
74
|
+
readonly channels?: readonly string[] | null | undefined;
|
|
74
75
|
readonly headers?: {
|
|
75
76
|
readonly [x: string]: string | undefined;
|
|
76
77
|
} | null | undefined;
|
|
77
|
-
readonly channels?: readonly string[] | null | undefined;
|
|
78
78
|
readonly status?: string | null | undefined;
|
|
79
79
|
}) => import("effect/Effect").Effect<{
|
|
80
80
|
readonly endpoint: {
|
|
81
81
|
readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
82
82
|
readonly name: string;
|
|
83
83
|
readonly url: string;
|
|
84
|
-
readonly eventTypes: readonly ("
|
|
85
|
-
readonly channels: readonly
|
|
86
|
-
readonly status: "
|
|
84
|
+
readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.ended" | "conversation.started" | "conversation.updated" | "domain.updated" | "message.bounced" | "message.complained" | "message.delivered" | "message.failed" | "message.read" | "message.received" | "message.sent" | "template.approved" | "template.created" | "template.deleted" | "template.rejected" | "template.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
|
|
85
|
+
readonly channels: readonly "email"[] | null;
|
|
86
|
+
readonly status: "active" | "disabled";
|
|
87
87
|
readonly hasCustomHeaders: boolean;
|
|
88
88
|
readonly failureStartedAt: string | null;
|
|
89
89
|
readonly lastSucceededAt: string | null;
|
|
@@ -91,84 +91,84 @@ export declare const create: (input: {
|
|
|
91
91
|
readonly updatedAt: string;
|
|
92
92
|
};
|
|
93
93
|
readonly secret: import("effect/Redacted").Redacted<string>;
|
|
94
|
-
}, import("
|
|
94
|
+
}, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").PaymentRequiredError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
|
|
95
95
|
export declare const get: (input: {
|
|
96
96
|
readonly id: string;
|
|
97
97
|
}) => import("effect/Effect").Effect<{
|
|
98
98
|
readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
99
99
|
readonly name: string;
|
|
100
100
|
readonly url: string;
|
|
101
|
-
readonly eventTypes: readonly ("
|
|
102
|
-
readonly channels: readonly
|
|
103
|
-
readonly status: "
|
|
101
|
+
readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.ended" | "conversation.started" | "conversation.updated" | "domain.updated" | "message.bounced" | "message.complained" | "message.delivered" | "message.failed" | "message.read" | "message.received" | "message.sent" | "template.approved" | "template.created" | "template.deleted" | "template.rejected" | "template.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
|
|
102
|
+
readonly channels: readonly "email"[] | null;
|
|
103
|
+
readonly status: "active" | "disabled";
|
|
104
104
|
readonly hasCustomHeaders: boolean;
|
|
105
105
|
readonly failureStartedAt: string | null;
|
|
106
106
|
readonly lastSucceededAt: string | null;
|
|
107
107
|
readonly createdAt: string;
|
|
108
108
|
readonly updatedAt: string;
|
|
109
|
-
}, import("
|
|
109
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError, import("./client").Service>;
|
|
110
110
|
export declare const remove: (input: {
|
|
111
111
|
readonly id: string;
|
|
112
112
|
}) => import("effect/Effect").Effect<{
|
|
113
113
|
readonly success: boolean;
|
|
114
|
-
}, import("
|
|
114
|
+
}, import("./generated").BillingProviderError | import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError, import("./client").Service>;
|
|
115
115
|
export declare const update: (input: {
|
|
116
116
|
readonly id: string;
|
|
117
|
+
readonly name?: string | null | undefined;
|
|
118
|
+
readonly url?: string | null | undefined;
|
|
119
|
+
readonly eventTypes?: readonly string[] | null | undefined;
|
|
120
|
+
readonly channels?: readonly string[] | null | undefined;
|
|
117
121
|
readonly headers?: {
|
|
118
122
|
readonly [x: string]: string | undefined;
|
|
119
123
|
} | null | undefined;
|
|
120
|
-
readonly url?: string | null | undefined;
|
|
121
|
-
readonly name?: string | null | undefined;
|
|
122
|
-
readonly channels?: readonly string[] | null | undefined;
|
|
123
124
|
readonly status?: string | null | undefined;
|
|
124
|
-
readonly eventTypes?: readonly string[] | null | undefined;
|
|
125
125
|
}) => import("effect/Effect").Effect<{
|
|
126
126
|
readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
127
127
|
readonly name: string;
|
|
128
128
|
readonly url: string;
|
|
129
|
-
readonly eventTypes: readonly ("
|
|
130
|
-
readonly channels: readonly
|
|
131
|
-
readonly status: "
|
|
129
|
+
readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.ended" | "conversation.started" | "conversation.updated" | "domain.updated" | "message.bounced" | "message.complained" | "message.delivered" | "message.failed" | "message.read" | "message.received" | "message.sent" | "template.approved" | "template.created" | "template.deleted" | "template.rejected" | "template.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
|
|
130
|
+
readonly channels: readonly "email"[] | null;
|
|
131
|
+
readonly status: "active" | "disabled";
|
|
132
132
|
readonly hasCustomHeaders: boolean;
|
|
133
133
|
readonly failureStartedAt: string | null;
|
|
134
134
|
readonly lastSucceededAt: string | null;
|
|
135
135
|
readonly createdAt: string;
|
|
136
136
|
readonly updatedAt: string;
|
|
137
|
-
}, import("
|
|
137
|
+
}, import("./generated").ConflictError | import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
|
|
138
138
|
export declare const test: (input: {
|
|
139
139
|
readonly id: string;
|
|
140
140
|
readonly data?: {
|
|
141
141
|
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | /*elided*/ any | {
|
|
142
142
|
readonly [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null | undefined;
|
|
143
143
|
} | null)[] | {
|
|
144
|
-
readonly [x: string]: string | number | boolean |
|
|
144
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
145
145
|
} | null)[] | {
|
|
146
|
-
readonly [x: string]: string | number | boolean |
|
|
146
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
147
147
|
} | null)[] | {
|
|
148
|
-
readonly [x: string]: string | number | boolean |
|
|
148
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
149
149
|
} | null)[] | {
|
|
150
|
-
readonly [x: string]: string | number | boolean |
|
|
150
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
151
151
|
} | null)[] | {
|
|
152
|
-
readonly [x: string]: string | number | boolean |
|
|
152
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
153
153
|
} | null)[] | {
|
|
154
|
-
readonly [x: string]: string | number | boolean |
|
|
154
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
155
155
|
} | null)[] | {
|
|
156
|
-
readonly [x: string]: string | number | boolean |
|
|
156
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
157
157
|
} | null)[] | {
|
|
158
|
-
readonly [x: string]: string | number | boolean |
|
|
158
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
159
159
|
} | null)[] | {
|
|
160
|
-
readonly [x: string]: string | number | boolean |
|
|
160
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
161
161
|
} | null)[] | {
|
|
162
|
-
readonly [x: string]: string | number | boolean |
|
|
162
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
163
163
|
} | null)[] | {
|
|
164
|
-
readonly [x: string]: string | number | boolean |
|
|
164
|
+
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
165
165
|
} | null | undefined;
|
|
166
166
|
} | null | undefined;
|
|
167
167
|
}) => import("effect/Effect").Effect<{
|
|
168
168
|
readonly accepted: true;
|
|
169
169
|
readonly eventId: string & import("effect/Brand").Brand<"WebhookEventId">;
|
|
170
170
|
readonly deliveryId: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
|
|
171
|
-
}, import("
|
|
171
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError, import("./client").Service>;
|
|
172
172
|
export declare const getLogs: (input: {
|
|
173
173
|
readonly webhookId: string;
|
|
174
174
|
readonly limit?: string | null | undefined;
|
|
@@ -177,7 +177,7 @@ export declare const getLogs: (input: {
|
|
|
177
177
|
readonly id: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
|
|
178
178
|
readonly eventId: string & import("effect/Brand").Brand<"WebhookEventId">;
|
|
179
179
|
readonly endpointId: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
180
|
-
readonly status: "
|
|
180
|
+
readonly status: "cancelled" | "delivered" | "exhausted" | "pending";
|
|
181
181
|
readonly automaticAttempts: number;
|
|
182
182
|
readonly nextAttemptAt: string | null;
|
|
183
183
|
readonly completedAt: string | null;
|
|
@@ -186,15 +186,14 @@ export declare const getLogs: (input: {
|
|
|
186
186
|
readonly attempts: readonly {
|
|
187
187
|
readonly id: string & import("effect/Brand").Brand<"WebhookAttemptId">;
|
|
188
188
|
readonly deliveryId: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
|
|
189
|
-
readonly kind: "
|
|
189
|
+
readonly kind: "automatic" | "manual";
|
|
190
190
|
readonly attemptNumber: number;
|
|
191
|
-
readonly classification: "cancelled" | "
|
|
191
|
+
readonly classification: "cancelled" | "http-error" | "network-error" | "success" | "timeout";
|
|
192
192
|
readonly attemptedAt: string;
|
|
193
193
|
readonly responseStatus: number | null;
|
|
194
194
|
readonly responseHeaders: {
|
|
195
195
|
readonly [x: string]: string;
|
|
196
196
|
} | null;
|
|
197
|
-
readonly responseBody: string | null;
|
|
198
197
|
readonly durationMs: number | null;
|
|
199
198
|
readonly errorCode: string | null;
|
|
200
199
|
readonly errorMessage: string | null;
|
|
@@ -202,7 +201,7 @@ export declare const getLogs: (input: {
|
|
|
202
201
|
}[];
|
|
203
202
|
}[];
|
|
204
203
|
readonly hasMore: boolean;
|
|
205
|
-
}, import("
|
|
204
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError, import("./client").Service>;
|
|
206
205
|
export declare const getStats: (input: {
|
|
207
206
|
readonly webhookId: string;
|
|
208
207
|
}) => import("effect/Effect").Effect<{
|
|
@@ -211,7 +210,7 @@ export declare const getStats: (input: {
|
|
|
211
210
|
readonly delivered: number;
|
|
212
211
|
readonly exhausted: number;
|
|
213
212
|
readonly cancelled: number;
|
|
214
|
-
}, import("
|
|
213
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError, import("./client").Service>;
|
|
215
214
|
export declare const retryDelivery: (input: {
|
|
216
215
|
readonly webhookId: string;
|
|
217
216
|
readonly deliveryId: string;
|
|
@@ -220,9 +219,9 @@ export declare const retryDelivery: (input: {
|
|
|
220
219
|
readonly deliveryId: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
|
|
221
220
|
readonly attemptId: string & import("effect/Brand").Brand<"WebhookAttemptId">;
|
|
222
221
|
readonly outcome: "failed" | "succeeded";
|
|
223
|
-
}, import("
|
|
222
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
|
|
224
223
|
export declare const regenerateSecret: (input: {
|
|
225
224
|
readonly webhookId: string;
|
|
226
225
|
}) => import("effect/Effect").Effect<{
|
|
227
226
|
readonly secret: import("effect/Redacted").Redacted<string>;
|
|
228
|
-
}, import("
|
|
227
|
+
}, import("./generated").ForbiddenError | import("effect/unstable/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
|
package/dist/effect/webhooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { n as make } from "../operation-
|
|
3
|
-
import { S as UpdateWebhookPayload, c as CreateWebhookPayload, v as TestWebhookPayload } from "../client-
|
|
2
|
+
import { n as make } from "../operation-B1knNlxk.js";
|
|
3
|
+
import { S as UpdateWebhookPayload, c as CreateWebhookPayload, v as TestWebhookPayload } from "../client-BmZK_uCt.js";
|
|
4
4
|
//#region src/effect/webhooks.ts
|
|
5
5
|
var webhooks_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
CreatePayload: () => CreateWebhookPayload,
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as fromApiError, a as ExternalServiceError, c as InternalError, d as ResourceNotFoundError, f as SamvaApiError, g as WebhookEnqueueError, h as ValidationError, i as EmailChannelError, l as PaymentRequiredError, m as UnauthorizedError, n as BillingProviderError, o as FlagDisabledError, p as SamvaTransportError, r as ConflictError, s as ForbiddenError, t as createClient, u as RateLimitedError } from "./promises-
|
|
1
|
+
import { _ as fromApiError, a as ExternalServiceError, c as InternalError, d as ResourceNotFoundError, f as SamvaApiError, g as WebhookEnqueueError, h as ValidationError, i as EmailChannelError, l as PaymentRequiredError, m as UnauthorizedError, n as BillingProviderError, o as FlagDisabledError, p as SamvaTransportError, r as ConflictError, s as ForbiddenError, t as createClient, u as RateLimitedError } from "./promises-n1opem5V.js";
|
|
2
2
|
export { BillingProviderError, ConflictError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, InternalError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, UnauthorizedError, ValidationError, WebhookEnqueueError, createClient, fromApiError };
|
|
@@ -3,12 +3,8 @@ function toRecipientArray(recipient) {
|
|
|
3
3
|
return Array.isArray(recipient) ? recipient : [recipient];
|
|
4
4
|
}
|
|
5
5
|
function normalizeMessageRecipient(recipient, channel) {
|
|
6
|
-
if (typeof recipient === "string")
|
|
7
|
-
|
|
8
|
-
case "sms": return { phone: recipient };
|
|
9
|
-
case "whatsapp": return { whatsapp: recipient };
|
|
10
|
-
}
|
|
11
|
-
if ("contactId" in recipient || "email" in recipient || "phone" in recipient || "whatsapp" in recipient) return recipient;
|
|
6
|
+
if (typeof recipient === "string") return { email: recipient };
|
|
7
|
+
if ("contactId" in recipient || "email" in recipient || "phone" in recipient) return recipient;
|
|
12
8
|
return { contactId: recipient.id };
|
|
13
9
|
}
|
|
14
10
|
function normalizeRecipients(recipient, channel) {
|
|
@@ -17,8 +13,7 @@ function normalizeRecipients(recipient, channel) {
|
|
|
17
13
|
/**
|
|
18
14
|
* cc / bcc payload fragment. `undefined` → omitted (JSON drops it anyway),
|
|
19
15
|
* `null` → passed through (explicit "no recipients"), otherwise normalized.
|
|
20
|
-
* This is the single canonical rule
|
|
21
|
-
* null/undefined cases differently.
|
|
16
|
+
* This is the single canonical rule for both clients.
|
|
22
17
|
*/
|
|
23
18
|
function ccBccPayload(key, value, channel) {
|
|
24
19
|
if (value === void 0) return {};
|
|
@@ -64,19 +59,15 @@ function buildEmailSendPayload(input) {
|
|
|
64
59
|
};
|
|
65
60
|
}
|
|
66
61
|
function buildMessagesSendPayload(input) {
|
|
67
|
-
|
|
62
|
+
return {
|
|
68
63
|
...input,
|
|
69
|
-
to: normalizeRecipients(input.to, input.channel)
|
|
70
|
-
};
|
|
71
|
-
if (input.channel === "email") return {
|
|
72
|
-
...base,
|
|
64
|
+
to: normalizeRecipients(input.to, input.channel),
|
|
73
65
|
...ccBccPayload("cc", input.cc, "email"),
|
|
74
66
|
...ccBccPayload("bcc", input.bcc, "email"),
|
|
75
67
|
email: normalizeEmailContent(input.email ?? {})
|
|
76
68
|
};
|
|
77
|
-
return base;
|
|
78
69
|
}
|
|
79
70
|
//#endregion
|
|
80
71
|
export { buildMessagesSendPayload as n, replyToEmailsPayload as r, buildEmailSendPayload as t };
|
|
81
72
|
|
|
82
|
-
//# sourceMappingURL=normalize-
|
|
73
|
+
//# sourceMappingURL=normalize-BiIJnycv.js.map
|
package/dist/normalize.d.ts
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* to its own generated body type at the call site — the same cast both clients
|
|
14
14
|
* already performed inline.
|
|
15
15
|
*/
|
|
16
|
-
type SendChannel = "email" | "sms" | "whatsapp";
|
|
17
16
|
/** A recipient the caller may pass in ergonomic form. */
|
|
18
17
|
type ErgonomicRecipient<Recipient> = Recipient | {
|
|
19
18
|
readonly id: string;
|
|
@@ -42,41 +41,12 @@ export interface EmailSendFields<Recipient> {
|
|
|
42
41
|
readonly [key: string]: unknown;
|
|
43
42
|
}
|
|
44
43
|
export declare function buildEmailSendPayload<Recipient extends object>(input: EmailSendFields<Recipient>): Record<string, unknown>;
|
|
45
|
-
/** @public — staged SMS/WhatsApp channel surface; ships with the channel launch */
|
|
46
|
-
export interface SmsSendFields<Recipient> {
|
|
47
|
-
readonly to: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>>;
|
|
48
|
-
readonly conversationId?: string | null | undefined;
|
|
49
|
-
readonly metadata?: Metadata;
|
|
50
|
-
readonly text?: string | null | undefined;
|
|
51
|
-
readonly message?: string | undefined;
|
|
52
|
-
readonly templateId?: string | null | undefined;
|
|
53
|
-
readonly templateSlug?: string | null | undefined;
|
|
54
|
-
readonly templateData?: Record<string, unknown> | null | undefined;
|
|
55
|
-
}
|
|
56
|
-
/** @public — staged SMS/WhatsApp channel surface; ships with the channel launch */
|
|
57
|
-
export declare function buildSmsSendPayload<Recipient extends object>(input: SmsSendFields<Recipient>): Record<string, unknown>;
|
|
58
|
-
/** @public — staged SMS/WhatsApp channel surface; ships with the channel launch */
|
|
59
|
-
export interface WhatsAppSendFields<Recipient> {
|
|
60
|
-
readonly to: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>>;
|
|
61
|
-
readonly conversationId?: string | null | undefined;
|
|
62
|
-
readonly metadata?: Metadata;
|
|
63
|
-
readonly text?: string | null | undefined;
|
|
64
|
-
readonly mediaUrl?: string | null | undefined;
|
|
65
|
-
readonly mediaType?: "image" | "video" | "audio" | "document" | null | undefined;
|
|
66
|
-
readonly templateId?: string | null | undefined;
|
|
67
|
-
readonly templateSlug?: string | null | undefined;
|
|
68
|
-
readonly templateCategory?: "marketing" | "utility" | "authentication" | null | undefined;
|
|
69
|
-
readonly templateData?: Record<string, unknown> | null | undefined;
|
|
70
|
-
}
|
|
71
|
-
/** @public — staged SMS/WhatsApp channel surface; ships with the channel launch */
|
|
72
|
-
export declare function buildWhatsAppSendPayload<Recipient extends object>(input: WhatsAppSendFields<Recipient>): Record<string, unknown>;
|
|
73
44
|
/**
|
|
74
|
-
* Unified `messages.send` payload: the caller
|
|
75
|
-
*
|
|
76
|
-
* email — cc/bcc/email-content are normalized; everything else passes through.
|
|
45
|
+
* Unified `messages.send` payload: the caller provides the email-shaped body,
|
|
46
|
+
* so only recipients and email content are normalized.
|
|
77
47
|
*/
|
|
78
48
|
export interface MessagesSendFields<Recipient> {
|
|
79
|
-
readonly channel:
|
|
49
|
+
readonly channel: "email";
|
|
80
50
|
readonly to: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>>;
|
|
81
51
|
readonly cc?: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>> | null | undefined;
|
|
82
52
|
readonly bcc?: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>> | null | undefined;
|