samva 0.16.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.
- package/AGENTS.md +4 -1
- package/README.md +44 -1
- package/dist/analytics-CaqPRsry.js +207 -0
- package/dist/api-keys-Ce1Y4_Ip.js +274 -0
- package/dist/attachments-DYqVIraC.js +140 -0
- package/dist/brands-ZwuOGIWO.js +175 -0
- package/dist/campaigns-DZlz1E9E.js +522 -0
- package/dist/categories-CA4XIQAb.js +1011 -0
- package/dist/client/sdk.gen.d.ts +174 -3
- package/dist/client/types.gen.d.ts +1126 -11
- package/dist/client-DOzUrdTE.js +1115 -0
- package/dist/contact-groups-BLbFXnjq.js +446 -0
- package/dist/contacts-BbsoXXB4.js +787 -0
- package/dist/conversations-_sRHueML.js +494 -0
- package/dist/custom-fields-BHWbwlKn.js +176 -0
- package/dist/effect/analytics.js +2 -21
- package/dist/effect/api-keys.d.ts +1 -1
- package/dist/effect/api-keys.js +2 -28
- package/dist/effect/attachments.js +2 -17
- package/dist/effect/brands.d.ts +1 -1
- package/dist/effect/brands.js +3 -24
- package/dist/effect/campaigns.js +2 -33
- package/dist/effect/categories.js +1 -1
- package/dist/effect/client.d.ts +1 -1
- package/dist/effect/client.js +3 -4
- package/dist/effect/contact-groups.js +2 -29
- package/dist/effect/contacts.d.ts +52 -0
- package/dist/effect/contacts.js +2 -47
- package/dist/effect/conversations.js +2 -35
- package/dist/effect/custom-fields.js +2 -17
- package/dist/effect/email.d.ts +3 -2
- package/dist/effect/email.js +2 -137
- package/dist/effect/events.d.ts +121 -0
- package/dist/effect/events.js +3 -0
- package/dist/effect/extension-installations.js +2 -27
- package/dist/effect/extensions.js +2 -19
- package/dist/effect/feedback.d.ts +1 -1
- package/dist/effect/feedback.js +3 -13
- package/dist/effect/generated/analytics.d.ts +715 -0
- package/dist/effect/generated/api-keys.d.ts +1627 -0
- package/dist/effect/generated/attachments.d.ts +554 -0
- package/dist/effect/generated/brands.d.ts +1118 -0
- package/dist/effect/generated/campaigns.d.ts +3783 -0
- package/dist/effect/generated/contact-events.d.ts +158 -0
- package/dist/effect/generated/contact-groups.d.ts +1445 -0
- package/dist/effect/generated/contacts.d.ts +3789 -0
- package/dist/effect/generated/conversations.d.ts +2870 -0
- package/dist/effect/generated/custom-fields.d.ts +562 -0
- package/dist/effect/generated/email.d.ts +10622 -0
- package/dist/effect/generated/events.d.ts +463 -0
- package/dist/effect/generated/extension-installations.d.ts +1786 -0
- package/dist/effect/generated/extensions.d.ts +927 -0
- package/dist/effect/generated/feedback.d.ts +116 -0
- package/dist/effect/generated/index.d.ts +61 -0
- package/dist/effect/generated/journeys.d.ts +6135 -0
- package/dist/effect/generated/mailboxes.d.ts +13641 -0
- package/dist/effect/generated/media.d.ts +741 -0
- package/dist/effect/generated/messages.d.ts +2355 -0
- package/dist/effect/generated/namespaces.d.ts +654 -0
- package/dist/effect/generated/operations.d.ts +514 -0
- package/dist/effect/generated/organizations.d.ts +1111 -0
- package/dist/effect/generated/scheduled-messages.d.ts +1798 -0
- package/dist/effect/generated/shared.d.ts +3250 -0
- package/dist/effect/generated/subscriptions.d.ts +188 -0
- package/dist/effect/generated/templates.d.ts +8177 -0
- package/dist/effect/generated/unsubscribe-groups.d.ts +1153 -0
- package/dist/effect/generated/webhooks.d.ts +1697 -0
- package/dist/effect/generated/whoami.d.ts +291 -0
- package/dist/effect/generated-metadata.d.ts +1627 -0
- package/dist/effect/index.d.ts +3 -1
- package/dist/effect/index.js +29 -27
- package/dist/effect/internal/client.d.ts +10 -7
- package/dist/effect/internal/email-sender.d.ts +17 -0
- package/dist/effect/internal/operation.d.ts +12 -72
- package/dist/effect/internal/send.d.ts +60 -0
- package/dist/effect/journeys.d.ts +2153 -0
- package/dist/effect/journeys.js +2 -0
- package/dist/effect/mailboxes.d.ts +112 -112
- package/dist/effect/mailboxes.js +1 -1
- package/dist/effect/media.js +3 -1
- package/dist/effect/messages.d.ts +2 -2
- package/dist/effect/messages.js +3 -1
- package/dist/effect/namespaces.js +2 -19
- package/dist/effect/operations.js +2 -15
- package/dist/effect/organizations.js +2 -23
- package/dist/effect/retry.js +1 -1
- package/dist/effect/scheduled-messages.js +2 -19
- package/dist/effect/subscriptions.js +2 -9
- package/dist/effect/templates.d.ts +1 -1
- package/dist/effect/templates.js +3 -78
- package/dist/effect/unsubscribe-groups.js +2 -27
- package/dist/effect/webhooks.d.ts +9 -9
- package/dist/effect/webhooks.js +3 -33
- package/dist/effect/whoami.d.ts +8 -8
- package/dist/effect/whoami.js +2 -9
- package/dist/email-R0NAA9PW.js +2498 -0
- package/dist/events-CxbTUHYT.js +82 -0
- package/dist/extension-installations-CD94LPmk.js +407 -0
- package/dist/extensions-BKyNQLvu.js +220 -0
- package/dist/feedback-Bpa09JOS.js +52 -0
- package/dist/index.js +2 -2
- package/dist/{inline-attachments-Cegg6tTF.js → inline-attachments-Bi1hDltp.js} +2 -2
- package/dist/journeys-CARo_BJT.js +499 -0
- package/dist/mailboxes-BRDn7BIK.js +2470 -0
- package/dist/media-VrrtNnft.js +181 -0
- package/dist/namespaces-CcvEbG-y.js +152 -0
- package/dist/{operation-BTXjPrwf.js → operation-n_IYgNVK.js} +75 -90
- package/dist/operations-CmB3FHwf.js +93 -0
- package/dist/organizations-A-plufWc.js +252 -0
- package/dist/promises/index.d.ts +7 -3
- package/dist/promises/index.js +2 -2
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-KrA2nSLg.js → promises---Kbh-7z.js} +467 -3
- package/dist/runtime-P0l1_2-C.js +25 -0
- package/dist/scheduled-messages-DkKZRRaN.js +207 -0
- package/dist/send-Bxc0XfGE.js +722 -0
- package/dist/service-map.d.ts +85 -0
- package/dist/subscriptions-DEXYtMXg.js +67 -0
- package/dist/templates-DZomxsG7.js +2289 -0
- package/dist/unsubscribe-groups-Iqk4Isf9.js +291 -0
- package/dist/webhooks-CPXuu8Xf.js +530 -0
- package/dist/whoami-Ccz0jwlt.js +59 -0
- package/package.json +13 -3
- package/dist/categories-DV51kr2H.js +0 -187
- package/dist/client-BMUew5Wp.js +0 -13794
- package/dist/effect/generated.d.ts +0 -64004
- package/dist/mailboxes-Thp5z0oX.js +0 -161
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as withUploadedAttachments, n as mediaCreateBody, o as CLIENT_ATTRIBUTION_HEADER, r as planInlineUploads, s as clientAttribution, t as MediaUploadError } from "./inline-attachments-
|
|
1
|
+
import { a as withUploadedAttachments, n as mediaCreateBody, o as CLIENT_ATTRIBUTION_HEADER, r as planInlineUploads, s as clientAttribution, t as MediaUploadError } from "./inline-attachments-Bi1hDltp.js";
|
|
2
2
|
import { t as MailboxEventStream } from "./mailbox-events-VKR4f3qq.js";
|
|
3
3
|
import { n as buildMessagesSendPayload, r as replyToEmailsPayload, t as buildEmailSendPayload } from "./normalize-B79uJIeb.js";
|
|
4
4
|
//#region src/client/core/bodySerializer.gen.ts
|
|
@@ -4723,6 +4723,466 @@ var Contacts = class {
|
|
|
4723
4723
|
});
|
|
4724
4724
|
}
|
|
4725
4725
|
};
|
|
4726
|
+
var Events = class {
|
|
4727
|
+
/**
|
|
4728
|
+
* Record a contact event
|
|
4729
|
+
*
|
|
4730
|
+
* Records a custom contact event. Identify the contact by exactly one ID, external ID, or email. A missing email or external ID creates a contact; an unknown contact ID returns 404. An organization-scoped idempotency key replays the original event. Event names use letters, digits, underscores, hyphens, and dots, up to 255 characters; contact. and samva. prefixes are reserved. Properties allow at most 50 keys and 32 KiB of UTF-8 JSON. Events are retained for 90 days.
|
|
4731
|
+
*/
|
|
4732
|
+
static create(parameters, options) {
|
|
4733
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
4734
|
+
{
|
|
4735
|
+
in: "body",
|
|
4736
|
+
key: "contact"
|
|
4737
|
+
},
|
|
4738
|
+
{
|
|
4739
|
+
in: "body",
|
|
4740
|
+
key: "name"
|
|
4741
|
+
},
|
|
4742
|
+
{
|
|
4743
|
+
in: "body",
|
|
4744
|
+
key: "properties"
|
|
4745
|
+
},
|
|
4746
|
+
{
|
|
4747
|
+
in: "body",
|
|
4748
|
+
key: "occurredAt"
|
|
4749
|
+
},
|
|
4750
|
+
{
|
|
4751
|
+
in: "body",
|
|
4752
|
+
key: "idempotencyKey"
|
|
4753
|
+
}
|
|
4754
|
+
] }]);
|
|
4755
|
+
return (options?.client ?? client).post({
|
|
4756
|
+
security: [{
|
|
4757
|
+
name: "x-api-key",
|
|
4758
|
+
type: "apiKey"
|
|
4759
|
+
}],
|
|
4760
|
+
url: "/v1/events",
|
|
4761
|
+
...options,
|
|
4762
|
+
...params,
|
|
4763
|
+
headers: {
|
|
4764
|
+
"Content-Type": "application/json",
|
|
4765
|
+
...options?.headers,
|
|
4766
|
+
...params.headers
|
|
4767
|
+
}
|
|
4768
|
+
});
|
|
4769
|
+
}
|
|
4770
|
+
/**
|
|
4771
|
+
* Record contact events in a batch
|
|
4772
|
+
*
|
|
4773
|
+
* Validates the full request shape, contact references, and event names before processing. A schema failure rejects the entire batch without writes. Between 1 and 100 valid entries are then processed in input order, with independent indexed results for properties limits, contact resolution, and idempotency.
|
|
4774
|
+
*/
|
|
4775
|
+
static batch(parameters, options) {
|
|
4776
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4777
|
+
in: "body",
|
|
4778
|
+
key: "events"
|
|
4779
|
+
}] }]);
|
|
4780
|
+
return (options?.client ?? client).post({
|
|
4781
|
+
security: [{
|
|
4782
|
+
name: "x-api-key",
|
|
4783
|
+
type: "apiKey"
|
|
4784
|
+
}],
|
|
4785
|
+
url: "/v1/events/batch",
|
|
4786
|
+
...options,
|
|
4787
|
+
...params,
|
|
4788
|
+
headers: {
|
|
4789
|
+
"Content-Type": "application/json",
|
|
4790
|
+
...options?.headers,
|
|
4791
|
+
...params.headers
|
|
4792
|
+
}
|
|
4793
|
+
});
|
|
4794
|
+
}
|
|
4795
|
+
};
|
|
4796
|
+
var ContactEvents = class {
|
|
4797
|
+
/**
|
|
4798
|
+
* List contact events
|
|
4799
|
+
*
|
|
4800
|
+
* Returns custom and Samva lifecycle events, newest occurrence first, within the 90-day retention window. Pass nextCursor back as cursor for the next page.
|
|
4801
|
+
*/
|
|
4802
|
+
static listEvents(parameters, options) {
|
|
4803
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
4804
|
+
{
|
|
4805
|
+
in: "path",
|
|
4806
|
+
key: "id"
|
|
4807
|
+
},
|
|
4808
|
+
{
|
|
4809
|
+
in: "query",
|
|
4810
|
+
key: "limit"
|
|
4811
|
+
},
|
|
4812
|
+
{
|
|
4813
|
+
in: "query",
|
|
4814
|
+
key: "cursor"
|
|
4815
|
+
}
|
|
4816
|
+
] }]);
|
|
4817
|
+
return (options?.client ?? client).get({
|
|
4818
|
+
security: [{
|
|
4819
|
+
name: "x-api-key",
|
|
4820
|
+
type: "apiKey"
|
|
4821
|
+
}],
|
|
4822
|
+
url: "/v1/contacts/{id}/events",
|
|
4823
|
+
...options,
|
|
4824
|
+
...params
|
|
4825
|
+
});
|
|
4826
|
+
}
|
|
4827
|
+
};
|
|
4828
|
+
var Journeys = class {
|
|
4829
|
+
/**
|
|
4830
|
+
* List journeys
|
|
4831
|
+
*
|
|
4832
|
+
* Returns the organization's journeys, newest first, optionally filtered by status. Pass nextCursor back as cursor for the next page.
|
|
4833
|
+
*/
|
|
4834
|
+
static list(parameters, options) {
|
|
4835
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
4836
|
+
{
|
|
4837
|
+
in: "query",
|
|
4838
|
+
key: "status"
|
|
4839
|
+
},
|
|
4840
|
+
{
|
|
4841
|
+
in: "query",
|
|
4842
|
+
key: "limit"
|
|
4843
|
+
},
|
|
4844
|
+
{
|
|
4845
|
+
in: "query",
|
|
4846
|
+
key: "cursor"
|
|
4847
|
+
}
|
|
4848
|
+
] }]);
|
|
4849
|
+
return (options?.client ?? client).get({
|
|
4850
|
+
security: [{
|
|
4851
|
+
name: "x-api-key",
|
|
4852
|
+
type: "apiKey"
|
|
4853
|
+
}],
|
|
4854
|
+
url: "/v1/journeys",
|
|
4855
|
+
...options,
|
|
4856
|
+
...params
|
|
4857
|
+
});
|
|
4858
|
+
}
|
|
4859
|
+
/**
|
|
4860
|
+
* Create a journey
|
|
4861
|
+
*
|
|
4862
|
+
* Creates a draft journey from a definition: a trigger, a root node, and a graph of at most 200 nodes that is acyclic and fully reachable. Templates, senders, and groups the definition names must belong to the organization. Requires a plan that includes journeys.
|
|
4863
|
+
*/
|
|
4864
|
+
static create(parameters, options) {
|
|
4865
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4866
|
+
in: "body",
|
|
4867
|
+
key: "name"
|
|
4868
|
+
}, {
|
|
4869
|
+
in: "body",
|
|
4870
|
+
key: "definition"
|
|
4871
|
+
}] }]);
|
|
4872
|
+
return (options?.client ?? client).post({
|
|
4873
|
+
security: [{
|
|
4874
|
+
name: "x-api-key",
|
|
4875
|
+
type: "apiKey"
|
|
4876
|
+
}],
|
|
4877
|
+
url: "/v1/journeys",
|
|
4878
|
+
...options,
|
|
4879
|
+
...params,
|
|
4880
|
+
headers: {
|
|
4881
|
+
"Content-Type": "application/json",
|
|
4882
|
+
...options?.headers,
|
|
4883
|
+
...params.headers
|
|
4884
|
+
}
|
|
4885
|
+
});
|
|
4886
|
+
}
|
|
4887
|
+
/**
|
|
4888
|
+
* Delete a journey
|
|
4889
|
+
*
|
|
4890
|
+
* Deletes a journey that was never published or is archived, with its versions and runs. An active or paused journey returns 409; archive it first.
|
|
4891
|
+
*/
|
|
4892
|
+
static remove(parameters, options) {
|
|
4893
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4894
|
+
in: "path",
|
|
4895
|
+
key: "id"
|
|
4896
|
+
}] }]);
|
|
4897
|
+
return (options?.client ?? client).delete({
|
|
4898
|
+
security: [{
|
|
4899
|
+
name: "x-api-key",
|
|
4900
|
+
type: "apiKey"
|
|
4901
|
+
}],
|
|
4902
|
+
url: "/v1/journeys/{id}",
|
|
4903
|
+
...options,
|
|
4904
|
+
...params
|
|
4905
|
+
});
|
|
4906
|
+
}
|
|
4907
|
+
/**
|
|
4908
|
+
* Get a journey
|
|
4909
|
+
*
|
|
4910
|
+
* Returns a journey with its draft definition, its current revision, and its newest published version number.
|
|
4911
|
+
*/
|
|
4912
|
+
static get(parameters, options) {
|
|
4913
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4914
|
+
in: "path",
|
|
4915
|
+
key: "id"
|
|
4916
|
+
}] }]);
|
|
4917
|
+
return (options?.client ?? client).get({
|
|
4918
|
+
security: [{
|
|
4919
|
+
name: "x-api-key",
|
|
4920
|
+
type: "apiKey"
|
|
4921
|
+
}],
|
|
4922
|
+
url: "/v1/journeys/{id}",
|
|
4923
|
+
...options,
|
|
4924
|
+
...params
|
|
4925
|
+
});
|
|
4926
|
+
}
|
|
4927
|
+
/**
|
|
4928
|
+
* Rename a journey
|
|
4929
|
+
*
|
|
4930
|
+
* Renames a journey.
|
|
4931
|
+
*/
|
|
4932
|
+
static update(parameters, options) {
|
|
4933
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4934
|
+
in: "path",
|
|
4935
|
+
key: "id"
|
|
4936
|
+
}, {
|
|
4937
|
+
in: "body",
|
|
4938
|
+
key: "name"
|
|
4939
|
+
}] }]);
|
|
4940
|
+
return (options?.client ?? client).patch({
|
|
4941
|
+
security: [{
|
|
4942
|
+
name: "x-api-key",
|
|
4943
|
+
type: "apiKey"
|
|
4944
|
+
}],
|
|
4945
|
+
url: "/v1/journeys/{id}",
|
|
4946
|
+
...options,
|
|
4947
|
+
...params,
|
|
4948
|
+
headers: {
|
|
4949
|
+
"Content-Type": "application/json",
|
|
4950
|
+
...options?.headers,
|
|
4951
|
+
...params.headers
|
|
4952
|
+
}
|
|
4953
|
+
});
|
|
4954
|
+
}
|
|
4955
|
+
/**
|
|
4956
|
+
* Replace a journey draft
|
|
4957
|
+
*
|
|
4958
|
+
* Replaces the draft definition and returns the journey with a new revision. The request names the revision it read; a stale revision returns 409. Published versions and the runs on them do not change.
|
|
4959
|
+
*/
|
|
4960
|
+
static replaceDraft(parameters, options) {
|
|
4961
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
4962
|
+
{
|
|
4963
|
+
in: "path",
|
|
4964
|
+
key: "id"
|
|
4965
|
+
},
|
|
4966
|
+
{
|
|
4967
|
+
in: "body",
|
|
4968
|
+
key: "revision"
|
|
4969
|
+
},
|
|
4970
|
+
{
|
|
4971
|
+
in: "body",
|
|
4972
|
+
key: "definition"
|
|
4973
|
+
}
|
|
4974
|
+
] }]);
|
|
4975
|
+
return (options?.client ?? client).put({
|
|
4976
|
+
security: [{
|
|
4977
|
+
name: "x-api-key",
|
|
4978
|
+
type: "apiKey"
|
|
4979
|
+
}],
|
|
4980
|
+
url: "/v1/journeys/{id}/draft",
|
|
4981
|
+
...options,
|
|
4982
|
+
...params,
|
|
4983
|
+
headers: {
|
|
4984
|
+
"Content-Type": "application/json",
|
|
4985
|
+
...options?.headers,
|
|
4986
|
+
...params.headers
|
|
4987
|
+
}
|
|
4988
|
+
});
|
|
4989
|
+
}
|
|
4990
|
+
/**
|
|
4991
|
+
* Publish a journey
|
|
4992
|
+
*
|
|
4993
|
+
* Publishes the draft as the next immutable version; new runs start on it and existing runs stay on the version they entered. The request names the revision it read; a stale revision returns 409. Publishing a draft identical to the newest version changes nothing. A draft journey becomes active; a paused journey stays paused. A published version sends and updates tags as its publisher, so a draft with a send_email node requires a key that can send email and one with an update_tags node requires contacts:update; without them the request returns 403.
|
|
4994
|
+
*/
|
|
4995
|
+
static publish(parameters, options) {
|
|
4996
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
4997
|
+
in: "path",
|
|
4998
|
+
key: "id"
|
|
4999
|
+
}, {
|
|
5000
|
+
in: "body",
|
|
5001
|
+
key: "revision"
|
|
5002
|
+
}] }]);
|
|
5003
|
+
return (options?.client ?? client).post({
|
|
5004
|
+
security: [{
|
|
5005
|
+
name: "x-api-key",
|
|
5006
|
+
type: "apiKey"
|
|
5007
|
+
}],
|
|
5008
|
+
url: "/v1/journeys/{id}/publish",
|
|
5009
|
+
...options,
|
|
5010
|
+
...params,
|
|
5011
|
+
headers: {
|
|
5012
|
+
"Content-Type": "application/json",
|
|
5013
|
+
...options?.headers,
|
|
5014
|
+
...params.headers
|
|
5015
|
+
}
|
|
5016
|
+
});
|
|
5017
|
+
}
|
|
5018
|
+
/**
|
|
5019
|
+
* Pause a journey
|
|
5020
|
+
*
|
|
5021
|
+
* Stops new enrollment and holds every live run before its next node, including a run whose wait ends while the journey is paused. Held runs report status paused.
|
|
5022
|
+
*/
|
|
5023
|
+
static pause(parameters, options) {
|
|
5024
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
5025
|
+
in: "path",
|
|
5026
|
+
key: "id"
|
|
5027
|
+
}] }]);
|
|
5028
|
+
return (options?.client ?? client).post({
|
|
5029
|
+
security: [{
|
|
5030
|
+
name: "x-api-key",
|
|
5031
|
+
type: "apiKey"
|
|
5032
|
+
}],
|
|
5033
|
+
url: "/v1/journeys/{id}/pause",
|
|
5034
|
+
...options,
|
|
5035
|
+
...params
|
|
5036
|
+
});
|
|
5037
|
+
}
|
|
5038
|
+
/**
|
|
5039
|
+
* Resume a journey
|
|
5040
|
+
*
|
|
5041
|
+
* Resumes enrollment and continues the runs the pause held. Requires a plan that includes journeys.
|
|
5042
|
+
*/
|
|
5043
|
+
static resume(parameters, options) {
|
|
5044
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
5045
|
+
in: "path",
|
|
5046
|
+
key: "id"
|
|
5047
|
+
}] }]);
|
|
5048
|
+
return (options?.client ?? client).post({
|
|
5049
|
+
security: [{
|
|
5050
|
+
name: "x-api-key",
|
|
5051
|
+
type: "apiKey"
|
|
5052
|
+
}],
|
|
5053
|
+
url: "/v1/journeys/{id}/resume",
|
|
5054
|
+
...options,
|
|
5055
|
+
...params
|
|
5056
|
+
});
|
|
5057
|
+
}
|
|
5058
|
+
/**
|
|
5059
|
+
* Archive a journey
|
|
5060
|
+
*
|
|
5061
|
+
* Stops new enrollment for good and exits every live run with exit reason archived. An archived journey cannot be edited, published, or resumed.
|
|
5062
|
+
*/
|
|
5063
|
+
static archive(parameters, options) {
|
|
5064
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
5065
|
+
in: "path",
|
|
5066
|
+
key: "id"
|
|
5067
|
+
}] }]);
|
|
5068
|
+
return (options?.client ?? client).post({
|
|
5069
|
+
security: [{
|
|
5070
|
+
name: "x-api-key",
|
|
5071
|
+
type: "apiKey"
|
|
5072
|
+
}],
|
|
5073
|
+
url: "/v1/journeys/{id}/archive",
|
|
5074
|
+
...options,
|
|
5075
|
+
...params
|
|
5076
|
+
});
|
|
5077
|
+
}
|
|
5078
|
+
/**
|
|
5079
|
+
* Get a published journey version
|
|
5080
|
+
*
|
|
5081
|
+
* Returns the immutable definition of one published version.
|
|
5082
|
+
*/
|
|
5083
|
+
static getVersion(parameters, options) {
|
|
5084
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
5085
|
+
in: "path",
|
|
5086
|
+
key: "id"
|
|
5087
|
+
}, {
|
|
5088
|
+
in: "path",
|
|
5089
|
+
key: "version"
|
|
5090
|
+
}] }]);
|
|
5091
|
+
return (options?.client ?? client).get({
|
|
5092
|
+
security: [{
|
|
5093
|
+
name: "x-api-key",
|
|
5094
|
+
type: "apiKey"
|
|
5095
|
+
}],
|
|
5096
|
+
url: "/v1/journeys/{id}/versions/{version}",
|
|
5097
|
+
...options,
|
|
5098
|
+
...params
|
|
5099
|
+
});
|
|
5100
|
+
}
|
|
5101
|
+
/**
|
|
5102
|
+
* Get journey run counts
|
|
5103
|
+
*
|
|
5104
|
+
* Counts one published version's runs by status, and per node the live runs there now and the runs that have entered it. Defaults to the newest published version.
|
|
5105
|
+
*/
|
|
5106
|
+
static stats(parameters, options) {
|
|
5107
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
5108
|
+
in: "path",
|
|
5109
|
+
key: "id"
|
|
5110
|
+
}, {
|
|
5111
|
+
in: "query",
|
|
5112
|
+
key: "version"
|
|
5113
|
+
}] }]);
|
|
5114
|
+
return (options?.client ?? client).get({
|
|
5115
|
+
security: [{
|
|
5116
|
+
name: "x-api-key",
|
|
5117
|
+
type: "apiKey"
|
|
5118
|
+
}],
|
|
5119
|
+
url: "/v1/journeys/{id}/stats",
|
|
5120
|
+
...options,
|
|
5121
|
+
...params
|
|
5122
|
+
});
|
|
5123
|
+
}
|
|
5124
|
+
/**
|
|
5125
|
+
* List journey runs
|
|
5126
|
+
*
|
|
5127
|
+
* Returns a journey's runs, newest first, optionally filtered by status or contact. Pass nextCursor back as cursor for the next page.
|
|
5128
|
+
*/
|
|
5129
|
+
static listRuns(parameters, options) {
|
|
5130
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
5131
|
+
{
|
|
5132
|
+
in: "path",
|
|
5133
|
+
key: "id"
|
|
5134
|
+
},
|
|
5135
|
+
{
|
|
5136
|
+
in: "query",
|
|
5137
|
+
key: "status"
|
|
5138
|
+
},
|
|
5139
|
+
{
|
|
5140
|
+
in: "query",
|
|
5141
|
+
key: "contactId"
|
|
5142
|
+
},
|
|
5143
|
+
{
|
|
5144
|
+
in: "query",
|
|
5145
|
+
key: "limit"
|
|
5146
|
+
},
|
|
5147
|
+
{
|
|
5148
|
+
in: "query",
|
|
5149
|
+
key: "cursor"
|
|
5150
|
+
}
|
|
5151
|
+
] }]);
|
|
5152
|
+
return (options?.client ?? client).get({
|
|
5153
|
+
security: [{
|
|
5154
|
+
name: "x-api-key",
|
|
5155
|
+
type: "apiKey"
|
|
5156
|
+
}],
|
|
5157
|
+
url: "/v1/journeys/{id}/runs",
|
|
5158
|
+
...options,
|
|
5159
|
+
...params
|
|
5160
|
+
});
|
|
5161
|
+
}
|
|
5162
|
+
/**
|
|
5163
|
+
* Get a journey run
|
|
5164
|
+
*
|
|
5165
|
+
* Returns one run with every node it entered, in order: when it entered and left, how it left, and the message a send node created.
|
|
5166
|
+
*/
|
|
5167
|
+
static getRun(parameters, options) {
|
|
5168
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
5169
|
+
in: "path",
|
|
5170
|
+
key: "id"
|
|
5171
|
+
}, {
|
|
5172
|
+
in: "path",
|
|
5173
|
+
key: "runId"
|
|
5174
|
+
}] }]);
|
|
5175
|
+
return (options?.client ?? client).get({
|
|
5176
|
+
security: [{
|
|
5177
|
+
name: "x-api-key",
|
|
5178
|
+
type: "apiKey"
|
|
5179
|
+
}],
|
|
5180
|
+
url: "/v1/journeys/{id}/runs/{runId}",
|
|
5181
|
+
...options,
|
|
5182
|
+
...params
|
|
5183
|
+
});
|
|
5184
|
+
}
|
|
5185
|
+
};
|
|
4726
5186
|
var Subscriptions = class {
|
|
4727
5187
|
/**
|
|
4728
5188
|
* Request subscription confirmation
|
|
@@ -11818,7 +12278,8 @@ function createClient(config) {
|
|
|
11818
12278
|
email: createBoundService(Email, clientInstance),
|
|
11819
12279
|
media: createBoundService(Media, clientInstance),
|
|
11820
12280
|
templates: createPromiseTemplatesTransport(clientInstance),
|
|
11821
|
-
contacts: createBoundService(Contacts, clientInstance),
|
|
12281
|
+
contacts: Object.assign(createBoundService(Contacts, clientInstance), createBoundService(ContactEvents, clientInstance)),
|
|
12282
|
+
events: createBoundService(Events, clientInstance),
|
|
11822
12283
|
conversations: createBoundService(Conversations, clientInstance),
|
|
11823
12284
|
webhooks: createBoundService(Webhooks, clientInstance),
|
|
11824
12285
|
operations: createBoundService(Operations, clientInstance),
|
|
@@ -11832,6 +12293,7 @@ function createClient(config) {
|
|
|
11832
12293
|
analytics: createBoundService(Analytics, clientInstance),
|
|
11833
12294
|
feedback: createBoundService(Feedback, clientInstance),
|
|
11834
12295
|
whoami: createBoundService(Whoami, clientInstance),
|
|
12296
|
+
journeys: createBoundService(Journeys, clientInstance),
|
|
11835
12297
|
mailboxes: createBoundService(Mailboxes, clientInstance),
|
|
11836
12298
|
namespaces: createBoundService(Namespaces, clientInstance),
|
|
11837
12299
|
extensions: createBoundService(Extensions, clientInstance),
|
|
@@ -11854,6 +12316,7 @@ function createClient(config) {
|
|
|
11854
12316
|
media: createDirectService(raw.media),
|
|
11855
12317
|
templates: createDirectService(raw.templates),
|
|
11856
12318
|
contacts: createDirectService(raw.contacts),
|
|
12319
|
+
events: createDirectService(raw.events),
|
|
11857
12320
|
conversations: createDirectService(raw.conversations),
|
|
11858
12321
|
webhooks: createDirectService(raw.webhooks),
|
|
11859
12322
|
operations: createDirectService(raw.operations),
|
|
@@ -11867,6 +12330,7 @@ function createClient(config) {
|
|
|
11867
12330
|
analytics: createDirectService(raw.analytics),
|
|
11868
12331
|
feedback: createDirectService(raw.feedback),
|
|
11869
12332
|
whoami: createDirectService(raw.whoami),
|
|
12333
|
+
journeys: createDirectService(raw.journeys),
|
|
11870
12334
|
mailboxes: Object.assign(createDirectService(raw.mailboxes), { events: (options) => new MailboxEventStream(streamConnection, options) }),
|
|
11871
12335
|
namespaces: createDirectService(raw.namespaces),
|
|
11872
12336
|
extensions: createDirectService(raw.extensions),
|
|
@@ -11876,4 +12340,4 @@ function createClient(config) {
|
|
|
11876
12340
|
//#endregion
|
|
11877
12341
|
export { SenderNotReadyError as C, fromApiError as E, SamvaTransportError as S, ValidationError as T, OnboardingReviewRequiredError as _, CampaignFooterRequiredError as a, ResourceNotFoundError as b, EmailChannelError as c, ForbiddenError as d, GatewayTimeoutError as f, MailboxSendRefusedError as g, MailboxSendConflictError as h, BrandAddressRequiredError as i, ExternalServiceError as l, MailboxChannelUnsupportedError as m, AnalyticsQueryError as n, ConflictError as o, InternalError as p, BillingProviderError as r, DeliveryUnavailableError as s, createClient as t, FlagDisabledError as u, PaymentRequiredError as v, UnauthorizedError as w, SamvaApiError as x, RateLimitedError as y };
|
|
11878
12342
|
|
|
11879
|
-
//# sourceMappingURL=promises-
|
|
12343
|
+
//# sourceMappingURL=promises---Kbh-7z.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Schema, SchemaTransformation } from "effect";
|
|
2
|
+
//#region src/effect/runtime.ts
|
|
3
|
+
/** Decode wire secrets to redacted values and require redacted values when encoding. */
|
|
4
|
+
const Sensitive = (schema) => Schema.RedactedFromValue(schema);
|
|
5
|
+
const SensitiveString = Sensitive(Schema.String);
|
|
6
|
+
const ABSOLUTE_ISO_INSTANT_PATTERN = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|([+-])(\d{2}):(\d{2}))$/;
|
|
7
|
+
const isValidAbsoluteInstant = (value) => {
|
|
8
|
+
const match = ABSOLUTE_ISO_INSTANT_PATTERN.exec(value);
|
|
9
|
+
if (match === null) return false;
|
|
10
|
+
const [, year, month, day, hour, minute, second = "0", fraction = "", zone, sign, offsetHour, offsetMinute] = match;
|
|
11
|
+
const offsetHours = Number(offsetHour ?? 0);
|
|
12
|
+
const offsetMinutes = Number(offsetMinute ?? 0);
|
|
13
|
+
if (offsetHours > 23 || offsetMinutes > 59) return false;
|
|
14
|
+
const offset = zone === "Z" ? 0 : (sign === "-" ? -1 : 1) * (offsetHours * 60 + offsetMinutes);
|
|
15
|
+
const instant = new Date(value);
|
|
16
|
+
if (!Number.isFinite(instant.getTime())) return false;
|
|
17
|
+
const local = new Date(instant.getTime() + offset * 6e4);
|
|
18
|
+
const millisecond = Number(fraction.padEnd(3, "0").slice(0, 3));
|
|
19
|
+
return local.getUTCFullYear() === Number(year) && local.getUTCMonth() + 1 === Number(month) && local.getUTCDate() === Number(day) && local.getUTCHours() === Number(hour) && local.getUTCMinutes() === Number(minute) && local.getUTCSeconds() === Number(second) && local.getUTCMilliseconds() === millisecond;
|
|
20
|
+
};
|
|
21
|
+
const AbsoluteInstant = Schema.String.check(Schema.isPattern(ABSOLUTE_ISO_INSTANT_PATTERN), Schema.makeFilter(isValidAbsoluteInstant, { message: "Invalid absolute ISO-8601 instant" })).pipe(Schema.decodeTo(Schema.Date, SchemaTransformation.dateFromString));
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SensitiveString as n, AbsoluteInstant as t };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=runtime-P0l1_2-C.js.map
|