samva 0.43.3 → 0.45.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 +3 -0
- package/README.md +4 -0
- package/dist/client/sdk.gen.d.ts +308 -2
- package/dist/client/sdk.gen.js +937 -2
- package/dist/client/types.gen.d.ts +2294 -54
- package/dist/effect/agents.d.ts +86 -86
- package/dist/effect/agents.js +2 -2
- package/dist/effect/api-keys.d.ts +36 -36
- package/dist/effect/api-keys.js +2 -2
- package/dist/effect/attachments.d.ts +3 -3
- package/dist/effect/attachments.js +1 -1
- package/dist/effect/campaigns.d.ts +250 -250
- package/dist/effect/campaigns.js +3 -3
- package/dist/effect/categories.d.ts +23 -5
- package/dist/effect/categories.js +11 -20
- package/dist/effect/contact-groups.d.ts +44 -44
- package/dist/effect/contact-groups.js +3 -3
- package/dist/effect/contacts.d.ts +3 -3
- package/dist/effect/contacts.js +1 -1
- package/dist/effect/conversations.d.ts +53 -53
- package/dist/effect/conversations.js +1 -1
- package/dist/effect/email.d.ts +99 -97
- package/dist/effect/email.js +21 -21
- package/dist/effect/errors.d.ts +1 -1
- package/dist/effect/errors.js +2 -2
- package/dist/effect/extension-installations.d.ts +6 -6
- package/dist/effect/extension-installations.js +1 -1
- package/dist/effect/generated/campaigns.js +2 -2
- package/dist/effect/generated/email.d.ts +7 -0
- package/dist/effect/generated/email.js +8 -9
- package/dist/effect/generated/index.d.ts +9 -1
- package/dist/effect/generated/journeys.d.ts +1 -3
- package/dist/effect/generated/journeys.js +2 -6
- package/dist/effect/generated/mailboxes.d.ts +14 -14
- package/dist/effect/generated/mailboxes.js +2 -0
- package/dist/effect/generated/messages.d.ts +1 -5
- package/dist/effect/generated/messages.js +2 -10
- package/dist/effect/generated/newsletter-issues.js +29 -29
- package/dist/effect/generated/organizations.js +2 -2
- package/dist/effect/generated/scheduled-messages.js +3 -3
- package/dist/effect/generated/shared.d.ts +112 -2
- package/dist/effect/generated/shared.js +66 -25
- package/dist/effect/generated/subscriptions.js +4 -4
- package/dist/effect/generated/template-registrations.d.ts +651 -0
- package/dist/effect/generated/template-registrations.js +138 -0
- package/dist/effect/generated/templates.d.ts +789 -6
- package/dist/effect/generated/templates.js +156 -54
- package/dist/effect/generated/whats-app-flows.d.ts +1838 -0
- package/dist/effect/generated/whats-app-flows.js +338 -0
- package/dist/effect/generated/whats-app-setup-links.d.ts +705 -0
- package/dist/effect/generated/whats-app-setup-links.js +150 -0
- package/dist/effect/generated/whats-app.d.ts +2089 -0
- package/dist/effect/generated/whats-app.js +633 -0
- package/dist/effect/generated-metadata.d.ts +257 -0
- package/dist/effect/generated-metadata.js +223 -48
- package/dist/effect/index.d.ts +4 -0
- package/dist/effect/index.js +6 -2
- package/dist/effect/mailboxes.d.ts +301 -301
- package/dist/effect/mailboxes.js +3 -3
- package/dist/effect/media.d.ts +4 -4
- package/dist/effect/media.js +2 -2
- package/dist/effect/messages.d.ts +17 -17
- package/dist/effect/messages.js +4 -4
- package/dist/effect/namespaces.d.ts +5 -5
- package/dist/effect/namespaces.js +1 -1
- package/dist/effect/newsletter-issues.d.ts +8 -8
- package/dist/effect/newsletter-issues.js +2 -2
- package/dist/effect/newsletters.d.ts +3 -3
- package/dist/effect/newsletters.js +1 -1
- package/dist/effect/organizations.d.ts +10 -10
- package/dist/effect/organizations.js +1 -1
- package/dist/effect/runtime.d.ts +2 -0
- package/dist/effect/runtime.js +2 -1
- package/dist/effect/scheduled-messages.d.ts +839 -839
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/template-registrations.d.ts +12 -0
- package/dist/effect/template-registrations.js +16 -0
- package/dist/effect/templates.d.ts +66 -56
- package/dist/effect/templates.js +16 -12
- package/dist/effect/topic-forms.d.ts +4 -4
- package/dist/effect/topic-forms.js +1 -1
- package/dist/effect/topics.d.ts +11 -11
- package/dist/effect/topics.js +2 -2
- package/dist/effect/webhooks.d.ts +18 -18
- package/dist/effect/webhooks.js +3 -3
- package/dist/effect/whatsapp-flows.d.ts +34 -0
- package/dist/effect/whatsapp-flows.js +30 -0
- package/dist/effect/whatsapp-setup-links.d.ts +66 -0
- package/dist/effect/whatsapp-setup-links.js +18 -0
- package/dist/effect/whatsapp.d.ts +51 -0
- package/dist/effect/whatsapp.js +34 -0
- package/dist/index.js +2 -2
- package/dist/mailbox/types.d.ts +2 -1
- package/dist/package.js +1 -1
- package/dist/promises/client.d.ts +9 -1
- package/dist/promises/client.js +11 -3
- package/dist/promises/errors.gen.d.ts +38 -2
- package/dist/promises/errors.gen.js +160 -3
- package/dist/promises/index.js +2 -2
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/service-map.d.ts +923 -734
- package/dist/service-map.js +288 -233
- package/package.json +27 -11
package/dist/client/sdk.gen.js
CHANGED
|
@@ -2044,7 +2044,7 @@ var Email = class {
|
|
|
2044
2044
|
/**
|
|
2045
2045
|
* Set the default sender
|
|
2046
2046
|
*
|
|
2047
|
-
* Sets a
|
|
2047
|
+
* Sets a sendable sender (see `sendable` on the sender) as the default for the caller's namespace, the explicit namespaceId, or the sender's own scope. A namespace can select its own sender or a sender on a shared organization domain. This changes only the namespace's default; it does not change a shared sender. Omitted-`from` sends use this default when neither the request nor the template names a `from`.
|
|
2048
2048
|
*/
|
|
2049
2049
|
static setDefaultSender(parameters, options) {
|
|
2050
2050
|
const params = buildClientParams([parameters], [{ args: [{
|
|
@@ -7892,6 +7892,84 @@ var Templates = class {
|
|
|
7892
7892
|
}));
|
|
7893
7893
|
}
|
|
7894
7894
|
/**
|
|
7895
|
+
* Suggest designs for a brief
|
|
7896
|
+
*
|
|
7897
|
+
* Ranks Samva's gallery designs for a brief and returns the three to start a new email from, best first, each with the `galleryTemplateId` that creates a template from it. When the brief names a company's email, `recreation` says whether the gallery recreates that kind of email from it, recreates another kind (start from it for the look), or has none. The ranking is deterministic: the same brief returns the same designs.
|
|
7898
|
+
*/
|
|
7899
|
+
static suggestStarters(parameters, options) {
|
|
7900
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
7901
|
+
in: "body",
|
|
7902
|
+
key: "brief"
|
|
7903
|
+
}] }]);
|
|
7904
|
+
return requestWithPolicy(options?.client ?? client, "templatesSuggestStarters", options, (headers) => (options?.client ?? client).post({
|
|
7905
|
+
security: [{
|
|
7906
|
+
name: "x-api-key",
|
|
7907
|
+
type: "apiKey"
|
|
7908
|
+
}],
|
|
7909
|
+
url: "/v1/templates/suggestions",
|
|
7910
|
+
...options,
|
|
7911
|
+
...params,
|
|
7912
|
+
body: params.body ?? {},
|
|
7913
|
+
headers: {
|
|
7914
|
+
"Content-Type": "application/json",
|
|
7915
|
+
...options?.headers,
|
|
7916
|
+
...params.headers
|
|
7917
|
+
},
|
|
7918
|
+
headers: {
|
|
7919
|
+
"Content-Type": "application/json",
|
|
7920
|
+
...headers
|
|
7921
|
+
}
|
|
7922
|
+
}));
|
|
7923
|
+
}
|
|
7924
|
+
/**
|
|
7925
|
+
* Create a template from a brief
|
|
7926
|
+
*
|
|
7927
|
+
* Creates an email template project from the gallery design that best fits a brief (the first of `POST /v1/templates/suggestions`, or the `galleryTemplateId` you name) and returns it with status 201, the design it started from, the other suggestions, any company email the brief named, and the request that makes the template assistant adapt the design. The assistant runs when that request is sent in the editor; an agent of your own adapts the design through the workspace endpoints instead.
|
|
7928
|
+
*/
|
|
7929
|
+
static createFromBrief(parameters, options) {
|
|
7930
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
7931
|
+
{
|
|
7932
|
+
in: "body",
|
|
7933
|
+
key: "brief"
|
|
7934
|
+
},
|
|
7935
|
+
{
|
|
7936
|
+
in: "body",
|
|
7937
|
+
key: "name"
|
|
7938
|
+
},
|
|
7939
|
+
{
|
|
7940
|
+
in: "body",
|
|
7941
|
+
key: "galleryTemplateId"
|
|
7942
|
+
},
|
|
7943
|
+
{
|
|
7944
|
+
in: "body",
|
|
7945
|
+
key: "useBrand"
|
|
7946
|
+
},
|
|
7947
|
+
{
|
|
7948
|
+
in: "body",
|
|
7949
|
+
key: "namespaceId"
|
|
7950
|
+
}
|
|
7951
|
+
] }]);
|
|
7952
|
+
return requestWithPolicy(options?.client ?? client, "templatesCreateFromBrief", options, (headers) => (options?.client ?? client).post({
|
|
7953
|
+
security: [{
|
|
7954
|
+
name: "x-api-key",
|
|
7955
|
+
type: "apiKey"
|
|
7956
|
+
}],
|
|
7957
|
+
url: "/v1/templates/from-brief",
|
|
7958
|
+
...options,
|
|
7959
|
+
...params,
|
|
7960
|
+
body: params.body ?? {},
|
|
7961
|
+
headers: {
|
|
7962
|
+
"Content-Type": "application/json",
|
|
7963
|
+
...options?.headers,
|
|
7964
|
+
...params.headers
|
|
7965
|
+
},
|
|
7966
|
+
headers: {
|
|
7967
|
+
"Content-Type": "application/json",
|
|
7968
|
+
...headers
|
|
7969
|
+
}
|
|
7970
|
+
}));
|
|
7971
|
+
}
|
|
7972
|
+
/**
|
|
7895
7973
|
* Create a template from a website
|
|
7896
7974
|
*
|
|
7897
7975
|
* Checks that the website is a public page Samva can read, creates an email template project from Samva's canonical TSX starter, and returns the template with status 201 and the request that makes the template assistant match the site. The assistant runs when the request is sent in the editor; it rebuilds the project's theme and blocks from the site and proposes a brand that applies only after the customer approves it. A 422 names why the site cannot be matched: not a web address, not public, no answer, a missing page, refused automated visits, or not a web page.
|
|
@@ -12812,6 +12890,832 @@ var ExtensionInstallations = class {
|
|
|
12812
12890
|
}));
|
|
12813
12891
|
}
|
|
12814
12892
|
};
|
|
12893
|
+
var Whatsapp = class {
|
|
12894
|
+
/**
|
|
12895
|
+
* Get WhatsApp messaging stats
|
|
12896
|
+
*
|
|
12897
|
+
* Returns aggregate WhatsApp delivery, read, and failure statistics for the organization.
|
|
12898
|
+
*/
|
|
12899
|
+
static getStats(parameters, options) {
|
|
12900
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
12901
|
+
in: "query",
|
|
12902
|
+
key: "startDate"
|
|
12903
|
+
}, {
|
|
12904
|
+
in: "query",
|
|
12905
|
+
key: "endDate"
|
|
12906
|
+
}] }]);
|
|
12907
|
+
return requestWithPolicy(options?.client ?? client, "whatsappGetStats", options, (headers) => (options?.client ?? client).get({
|
|
12908
|
+
security: [{
|
|
12909
|
+
name: "x-api-key",
|
|
12910
|
+
type: "apiKey"
|
|
12911
|
+
}],
|
|
12912
|
+
url: "/v1/whatsapp/stats",
|
|
12913
|
+
...options,
|
|
12914
|
+
...params,
|
|
12915
|
+
headers
|
|
12916
|
+
}));
|
|
12917
|
+
}
|
|
12918
|
+
/**
|
|
12919
|
+
* Get WhatsApp template stats
|
|
12920
|
+
*
|
|
12921
|
+
* Returns sent, delivered, read, and failed counts and Meta's estimated cost for each WhatsApp template, split by what sent it: a campaign, a journey step, or a direct send. Filter by template, campaign, journey, or the time the message was created.
|
|
12922
|
+
*/
|
|
12923
|
+
static getTemplateStats(parameters, options) {
|
|
12924
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
12925
|
+
{
|
|
12926
|
+
in: "query",
|
|
12927
|
+
key: "startDate"
|
|
12928
|
+
},
|
|
12929
|
+
{
|
|
12930
|
+
in: "query",
|
|
12931
|
+
key: "endDate"
|
|
12932
|
+
},
|
|
12933
|
+
{
|
|
12934
|
+
in: "query",
|
|
12935
|
+
key: "templateId"
|
|
12936
|
+
},
|
|
12937
|
+
{
|
|
12938
|
+
in: "query",
|
|
12939
|
+
key: "campaignId"
|
|
12940
|
+
},
|
|
12941
|
+
{
|
|
12942
|
+
in: "query",
|
|
12943
|
+
key: "journeyId"
|
|
12944
|
+
}
|
|
12945
|
+
] }]);
|
|
12946
|
+
return requestWithPolicy(options?.client ?? client, "whatsappGetTemplateStats", options, (headers) => (options?.client ?? client).get({
|
|
12947
|
+
security: [{
|
|
12948
|
+
name: "x-api-key",
|
|
12949
|
+
type: "apiKey"
|
|
12950
|
+
}],
|
|
12951
|
+
url: "/v1/whatsapp/templates/stats",
|
|
12952
|
+
...options,
|
|
12953
|
+
...params,
|
|
12954
|
+
headers
|
|
12955
|
+
}));
|
|
12956
|
+
}
|
|
12957
|
+
/**
|
|
12958
|
+
* Get WhatsApp service window status
|
|
12959
|
+
*
|
|
12960
|
+
* Returns whether the service window and free entry point are active for a customer and business phone pair.
|
|
12961
|
+
*/
|
|
12962
|
+
static getServiceWindowStatus(parameters, options) {
|
|
12963
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
12964
|
+
in: "query",
|
|
12965
|
+
key: "customerPhone"
|
|
12966
|
+
}, {
|
|
12967
|
+
in: "query",
|
|
12968
|
+
key: "businessPhone"
|
|
12969
|
+
}] }]);
|
|
12970
|
+
return requestWithPolicy(options?.client ?? client, "whatsappGetServiceWindowStatus", options, (headers) => (options?.client ?? client).get({
|
|
12971
|
+
security: [{
|
|
12972
|
+
name: "x-api-key",
|
|
12973
|
+
type: "apiKey"
|
|
12974
|
+
}],
|
|
12975
|
+
url: "/v1/whatsapp/service-window/status",
|
|
12976
|
+
...options,
|
|
12977
|
+
...params,
|
|
12978
|
+
headers
|
|
12979
|
+
}));
|
|
12980
|
+
}
|
|
12981
|
+
/**
|
|
12982
|
+
* Get WhatsApp service window billing
|
|
12983
|
+
*
|
|
12984
|
+
* Returns message counts and the estimated Meta cost for a WhatsApp service window.
|
|
12985
|
+
*/
|
|
12986
|
+
static getServiceWindowBilling(parameters, options) {
|
|
12987
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
12988
|
+
in: "query",
|
|
12989
|
+
key: "serviceWindowId"
|
|
12990
|
+
}] }]);
|
|
12991
|
+
return requestWithPolicy(options?.client ?? client, "whatsappGetServiceWindowBilling", options, (headers) => (options?.client ?? client).get({
|
|
12992
|
+
security: [{
|
|
12993
|
+
name: "x-api-key",
|
|
12994
|
+
type: "apiKey"
|
|
12995
|
+
}],
|
|
12996
|
+
url: "/v1/whatsapp/service-window/billing",
|
|
12997
|
+
...options,
|
|
12998
|
+
...params,
|
|
12999
|
+
headers
|
|
13000
|
+
}));
|
|
13001
|
+
}
|
|
13002
|
+
/**
|
|
13003
|
+
* Get a WhatsApp media download URL
|
|
13004
|
+
*
|
|
13005
|
+
* Returns a short-lived URL for the media an inbound WhatsApp delivery carried, when Samva stored it.
|
|
13006
|
+
*/
|
|
13007
|
+
static getMediaDownloadUrl(parameters, options) {
|
|
13008
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13009
|
+
in: "path",
|
|
13010
|
+
key: "deliveryId"
|
|
13011
|
+
}] }]);
|
|
13012
|
+
return requestWithPolicy(options?.client ?? client, "whatsappGetMediaDownloadUrl", options, (headers) => (options?.client ?? client).get({
|
|
13013
|
+
security: [{
|
|
13014
|
+
name: "x-api-key",
|
|
13015
|
+
type: "apiKey"
|
|
13016
|
+
}],
|
|
13017
|
+
url: "/v1/whatsapp/media/{deliveryId}/download-url",
|
|
13018
|
+
...options,
|
|
13019
|
+
...params,
|
|
13020
|
+
headers
|
|
13021
|
+
}));
|
|
13022
|
+
}
|
|
13023
|
+
/**
|
|
13024
|
+
* List WhatsApp business accounts
|
|
13025
|
+
*
|
|
13026
|
+
* Returns a paginated list of the organization's connected WhatsApp business accounts.
|
|
13027
|
+
*/
|
|
13028
|
+
static listBusinessAccounts(parameters, options) {
|
|
13029
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
13030
|
+
{
|
|
13031
|
+
in: "query",
|
|
13032
|
+
key: "page"
|
|
13033
|
+
},
|
|
13034
|
+
{
|
|
13035
|
+
in: "query",
|
|
13036
|
+
key: "limit"
|
|
13037
|
+
},
|
|
13038
|
+
{
|
|
13039
|
+
in: "query",
|
|
13040
|
+
key: "isActive"
|
|
13041
|
+
},
|
|
13042
|
+
{
|
|
13043
|
+
in: "query",
|
|
13044
|
+
key: "verificationStatus"
|
|
13045
|
+
},
|
|
13046
|
+
{
|
|
13047
|
+
in: "query",
|
|
13048
|
+
key: "namespaceId"
|
|
13049
|
+
}
|
|
13050
|
+
] }]);
|
|
13051
|
+
return requestWithPolicy(options?.client ?? client, "whatsappListBusinessAccounts", options, (headers) => (options?.client ?? client).get({
|
|
13052
|
+
security: [{
|
|
13053
|
+
name: "x-api-key",
|
|
13054
|
+
type: "apiKey"
|
|
13055
|
+
}],
|
|
13056
|
+
url: "/v1/whatsapp/business-accounts",
|
|
13057
|
+
...options,
|
|
13058
|
+
...params,
|
|
13059
|
+
headers
|
|
13060
|
+
}));
|
|
13061
|
+
}
|
|
13062
|
+
/**
|
|
13063
|
+
* Connect a WhatsApp business account
|
|
13064
|
+
*
|
|
13065
|
+
* Completes embedded signup: exchanges its code for the business's Meta token, checks the token grants Samva both WhatsApp permissions over the WABA, subscribes Samva to the WABA's webhooks, and registers the phone number with the Cloud API. A number that stays on the WhatsApp Business app (coexistence) is already registered, so it skips registration and Samva asks Meta to sync its contacts and chat history. A number Meta has not verified yet connects as pending; sync it once verification finishes.
|
|
13066
|
+
*/
|
|
13067
|
+
static connectBusinessAccount(parameters, options) {
|
|
13068
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
13069
|
+
{
|
|
13070
|
+
in: "body",
|
|
13071
|
+
key: "code"
|
|
13072
|
+
},
|
|
13073
|
+
{
|
|
13074
|
+
in: "body",
|
|
13075
|
+
key: "wabaId"
|
|
13076
|
+
},
|
|
13077
|
+
{
|
|
13078
|
+
in: "body",
|
|
13079
|
+
key: "phoneNumberId"
|
|
13080
|
+
},
|
|
13081
|
+
{
|
|
13082
|
+
in: "body",
|
|
13083
|
+
key: "namespaceId"
|
|
13084
|
+
}
|
|
13085
|
+
] }]);
|
|
13086
|
+
return requestWithPolicy(options?.client ?? client, "whatsappConnectBusinessAccount", options, (headers) => (options?.client ?? client).post({
|
|
13087
|
+
security: [{
|
|
13088
|
+
name: "x-api-key",
|
|
13089
|
+
type: "apiKey"
|
|
13090
|
+
}],
|
|
13091
|
+
url: "/v1/whatsapp/business-accounts",
|
|
13092
|
+
...options,
|
|
13093
|
+
...params,
|
|
13094
|
+
body: params.body ?? {},
|
|
13095
|
+
headers: {
|
|
13096
|
+
"Content-Type": "application/json",
|
|
13097
|
+
...options?.headers,
|
|
13098
|
+
...params.headers
|
|
13099
|
+
},
|
|
13100
|
+
headers: {
|
|
13101
|
+
"Content-Type": "application/json",
|
|
13102
|
+
...headers
|
|
13103
|
+
}
|
|
13104
|
+
}));
|
|
13105
|
+
}
|
|
13106
|
+
/**
|
|
13107
|
+
* Disconnect a WhatsApp business account
|
|
13108
|
+
*
|
|
13109
|
+
* Disconnects a WhatsApp business account from the organization.
|
|
13110
|
+
*/
|
|
13111
|
+
static disconnectBusinessAccount(parameters, options) {
|
|
13112
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13113
|
+
in: "path",
|
|
13114
|
+
key: "accountId"
|
|
13115
|
+
}] }]);
|
|
13116
|
+
return requestWithPolicy(options?.client ?? client, "whatsappDisconnectBusinessAccount", options, (headers) => (options?.client ?? client).delete({
|
|
13117
|
+
security: [{
|
|
13118
|
+
name: "x-api-key",
|
|
13119
|
+
type: "apiKey"
|
|
13120
|
+
}],
|
|
13121
|
+
url: "/v1/whatsapp/business-accounts/{accountId}",
|
|
13122
|
+
...options,
|
|
13123
|
+
...params,
|
|
13124
|
+
headers
|
|
13125
|
+
}));
|
|
13126
|
+
}
|
|
13127
|
+
/**
|
|
13128
|
+
* Get a WhatsApp business account
|
|
13129
|
+
*
|
|
13130
|
+
* Returns a single connected WhatsApp business account by its identifier.
|
|
13131
|
+
*/
|
|
13132
|
+
static getBusinessAccount(parameters, options) {
|
|
13133
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13134
|
+
in: "path",
|
|
13135
|
+
key: "accountId"
|
|
13136
|
+
}] }]);
|
|
13137
|
+
return requestWithPolicy(options?.client ?? client, "whatsappGetBusinessAccount", options, (headers) => (options?.client ?? client).get({
|
|
13138
|
+
security: [{
|
|
13139
|
+
name: "x-api-key",
|
|
13140
|
+
type: "apiKey"
|
|
13141
|
+
}],
|
|
13142
|
+
url: "/v1/whatsapp/business-accounts/{accountId}",
|
|
13143
|
+
...options,
|
|
13144
|
+
...params,
|
|
13145
|
+
headers
|
|
13146
|
+
}));
|
|
13147
|
+
}
|
|
13148
|
+
/**
|
|
13149
|
+
* Update a WhatsApp business account
|
|
13150
|
+
*
|
|
13151
|
+
* Updates the display name or webhook settings of a connected WhatsApp business account.
|
|
13152
|
+
*/
|
|
13153
|
+
static updateBusinessAccount(parameters, options) {
|
|
13154
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
13155
|
+
{
|
|
13156
|
+
in: "path",
|
|
13157
|
+
key: "accountId"
|
|
13158
|
+
},
|
|
13159
|
+
{
|
|
13160
|
+
in: "body",
|
|
13161
|
+
key: "displayName"
|
|
13162
|
+
},
|
|
13163
|
+
{
|
|
13164
|
+
in: "body",
|
|
13165
|
+
key: "webhookUrl"
|
|
13166
|
+
}
|
|
13167
|
+
] }]);
|
|
13168
|
+
return requestWithPolicy(options?.client ?? client, "whatsappUpdateBusinessAccount", options, (headers) => (options?.client ?? client).patch({
|
|
13169
|
+
security: [{
|
|
13170
|
+
name: "x-api-key",
|
|
13171
|
+
type: "apiKey"
|
|
13172
|
+
}],
|
|
13173
|
+
url: "/v1/whatsapp/business-accounts/{accountId}",
|
|
13174
|
+
...options,
|
|
13175
|
+
...params,
|
|
13176
|
+
body: params.body ?? {},
|
|
13177
|
+
headers: {
|
|
13178
|
+
"Content-Type": "application/json",
|
|
13179
|
+
...options?.headers,
|
|
13180
|
+
...params.headers
|
|
13181
|
+
},
|
|
13182
|
+
headers: {
|
|
13183
|
+
"Content-Type": "application/json",
|
|
13184
|
+
...headers
|
|
13185
|
+
}
|
|
13186
|
+
}));
|
|
13187
|
+
}
|
|
13188
|
+
/**
|
|
13189
|
+
* Set the default WhatsApp business account
|
|
13190
|
+
*
|
|
13191
|
+
* Marks a connected WhatsApp business account as the organization's default and returns it.
|
|
13192
|
+
*/
|
|
13193
|
+
static setDefaultBusinessAccount(parameters, options) {
|
|
13194
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13195
|
+
in: "path",
|
|
13196
|
+
key: "accountId"
|
|
13197
|
+
}] }]);
|
|
13198
|
+
return requestWithPolicy(options?.client ?? client, "whatsappSetDefaultBusinessAccount", options, (headers) => (options?.client ?? client).post({
|
|
13199
|
+
security: [{
|
|
13200
|
+
name: "x-api-key",
|
|
13201
|
+
type: "apiKey"
|
|
13202
|
+
}],
|
|
13203
|
+
url: "/v1/whatsapp/business-accounts/{accountId}/set-default",
|
|
13204
|
+
...options,
|
|
13205
|
+
...params,
|
|
13206
|
+
headers
|
|
13207
|
+
}));
|
|
13208
|
+
}
|
|
13209
|
+
/**
|
|
13210
|
+
* Sync a WhatsApp business account status
|
|
13211
|
+
*
|
|
13212
|
+
* Reads the number's quality rating, messaging limit, and registration from Meta, and registers the number with the Cloud API if it is verified but not yet registered.
|
|
13213
|
+
*/
|
|
13214
|
+
static syncAccountStatus(parameters, options) {
|
|
13215
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13216
|
+
in: "path",
|
|
13217
|
+
key: "accountId"
|
|
13218
|
+
}] }]);
|
|
13219
|
+
return requestWithPolicy(options?.client ?? client, "whatsappSyncAccountStatus", options, (headers) => (options?.client ?? client).post({
|
|
13220
|
+
security: [{
|
|
13221
|
+
name: "x-api-key",
|
|
13222
|
+
type: "apiKey"
|
|
13223
|
+
}],
|
|
13224
|
+
url: "/v1/whatsapp/business-accounts/{accountId}/sync",
|
|
13225
|
+
...options,
|
|
13226
|
+
...params,
|
|
13227
|
+
headers
|
|
13228
|
+
}));
|
|
13229
|
+
}
|
|
13230
|
+
};
|
|
13231
|
+
var WhatsappFlows = class {
|
|
13232
|
+
/**
|
|
13233
|
+
* List flows
|
|
13234
|
+
*
|
|
13235
|
+
* Returns the organization's flows, newest first, each with its current version.
|
|
13236
|
+
*/
|
|
13237
|
+
static list(options) {
|
|
13238
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsList", options, (headers) => (options?.client ?? client).get({
|
|
13239
|
+
security: [{
|
|
13240
|
+
name: "x-api-key",
|
|
13241
|
+
type: "apiKey"
|
|
13242
|
+
}],
|
|
13243
|
+
url: "/v1/whatsapp/flows",
|
|
13244
|
+
...options,
|
|
13245
|
+
headers
|
|
13246
|
+
}));
|
|
13247
|
+
}
|
|
13248
|
+
/**
|
|
13249
|
+
* Create a flow
|
|
13250
|
+
*
|
|
13251
|
+
* Creates a WhatsApp flow whose versions read `flows/<handle>.json` in the template project. The handle is unique in the organization; the categories are Meta's and go with every version to Meta.
|
|
13252
|
+
*/
|
|
13253
|
+
static create(parameters, options) {
|
|
13254
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
13255
|
+
{
|
|
13256
|
+
in: "body",
|
|
13257
|
+
key: "projectId"
|
|
13258
|
+
},
|
|
13259
|
+
{
|
|
13260
|
+
in: "body",
|
|
13261
|
+
key: "handle"
|
|
13262
|
+
},
|
|
13263
|
+
{
|
|
13264
|
+
in: "body",
|
|
13265
|
+
key: "categories"
|
|
13266
|
+
}
|
|
13267
|
+
] }]);
|
|
13268
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsCreate", options, (headers) => (options?.client ?? client).post({
|
|
13269
|
+
security: [{
|
|
13270
|
+
name: "x-api-key",
|
|
13271
|
+
type: "apiKey"
|
|
13272
|
+
}],
|
|
13273
|
+
url: "/v1/whatsapp/flows",
|
|
13274
|
+
...options,
|
|
13275
|
+
...params,
|
|
13276
|
+
body: params.body ?? {},
|
|
13277
|
+
headers: {
|
|
13278
|
+
"Content-Type": "application/json",
|
|
13279
|
+
...options?.headers,
|
|
13280
|
+
...params.headers
|
|
13281
|
+
},
|
|
13282
|
+
headers: {
|
|
13283
|
+
"Content-Type": "application/json",
|
|
13284
|
+
...headers
|
|
13285
|
+
}
|
|
13286
|
+
}));
|
|
13287
|
+
}
|
|
13288
|
+
/**
|
|
13289
|
+
* Get a flow
|
|
13290
|
+
*
|
|
13291
|
+
* Returns one flow by its ID.
|
|
13292
|
+
*/
|
|
13293
|
+
static get(parameters, options) {
|
|
13294
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13295
|
+
in: "path",
|
|
13296
|
+
key: "id"
|
|
13297
|
+
}] }]);
|
|
13298
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsGet", options, (headers) => (options?.client ?? client).get({
|
|
13299
|
+
security: [{
|
|
13300
|
+
name: "x-api-key",
|
|
13301
|
+
type: "apiKey"
|
|
13302
|
+
}],
|
|
13303
|
+
url: "/v1/whatsapp/flows/{id}",
|
|
13304
|
+
...options,
|
|
13305
|
+
...params,
|
|
13306
|
+
headers
|
|
13307
|
+
}));
|
|
13308
|
+
}
|
|
13309
|
+
/**
|
|
13310
|
+
* List a flow's versions
|
|
13311
|
+
*
|
|
13312
|
+
* Newest first.
|
|
13313
|
+
*/
|
|
13314
|
+
static listVersions(parameters, options) {
|
|
13315
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13316
|
+
in: "path",
|
|
13317
|
+
key: "id"
|
|
13318
|
+
}] }]);
|
|
13319
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsListVersions", options, (headers) => (options?.client ?? client).get({
|
|
13320
|
+
security: [{
|
|
13321
|
+
name: "x-api-key",
|
|
13322
|
+
type: "apiKey"
|
|
13323
|
+
}],
|
|
13324
|
+
url: "/v1/whatsapp/flows/{id}/versions",
|
|
13325
|
+
...options,
|
|
13326
|
+
...params,
|
|
13327
|
+
headers
|
|
13328
|
+
}));
|
|
13329
|
+
}
|
|
13330
|
+
/**
|
|
13331
|
+
* Record a flow version
|
|
13332
|
+
*
|
|
13333
|
+
* Reads the flow's file at a commit on the project's default branch, checks it is Flow JSON Samva sends, and records it as the flow's current version. The same content returns the version that already recorded it.
|
|
13334
|
+
*/
|
|
13335
|
+
static recordVersion(parameters, options) {
|
|
13336
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
13337
|
+
{
|
|
13338
|
+
in: "path",
|
|
13339
|
+
key: "id"
|
|
13340
|
+
},
|
|
13341
|
+
{
|
|
13342
|
+
in: "body",
|
|
13343
|
+
key: "commitSha"
|
|
13344
|
+
},
|
|
13345
|
+
{
|
|
13346
|
+
in: "body",
|
|
13347
|
+
key: "expectedWorkspaceRevision"
|
|
13348
|
+
}
|
|
13349
|
+
] }]);
|
|
13350
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsRecordVersion", options, (headers) => (options?.client ?? client).post({
|
|
13351
|
+
security: [{
|
|
13352
|
+
name: "x-api-key",
|
|
13353
|
+
type: "apiKey"
|
|
13354
|
+
}],
|
|
13355
|
+
url: "/v1/whatsapp/flows/{id}/versions",
|
|
13356
|
+
...options,
|
|
13357
|
+
...params,
|
|
13358
|
+
body: params.body ?? {},
|
|
13359
|
+
headers: {
|
|
13360
|
+
"Content-Type": "application/json",
|
|
13361
|
+
...options?.headers,
|
|
13362
|
+
...params.headers
|
|
13363
|
+
},
|
|
13364
|
+
headers: {
|
|
13365
|
+
"Content-Type": "application/json",
|
|
13366
|
+
...headers
|
|
13367
|
+
}
|
|
13368
|
+
}));
|
|
13369
|
+
}
|
|
13370
|
+
/**
|
|
13371
|
+
* List a flow's registrations
|
|
13372
|
+
*
|
|
13373
|
+
* Returns every Meta flow the flow's versions registered as, newest version first, with its status on its business account.
|
|
13374
|
+
*/
|
|
13375
|
+
static listRegistrations(parameters, options) {
|
|
13376
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13377
|
+
in: "path",
|
|
13378
|
+
key: "id"
|
|
13379
|
+
}] }]);
|
|
13380
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsListRegistrations", options, (headers) => (options?.client ?? client).get({
|
|
13381
|
+
security: [{
|
|
13382
|
+
name: "x-api-key",
|
|
13383
|
+
type: "apiKey"
|
|
13384
|
+
}],
|
|
13385
|
+
url: "/v1/whatsapp/flows/{id}/registrations",
|
|
13386
|
+
...options,
|
|
13387
|
+
...params,
|
|
13388
|
+
headers
|
|
13389
|
+
}));
|
|
13390
|
+
}
|
|
13391
|
+
/**
|
|
13392
|
+
* Register and publish a flow
|
|
13393
|
+
*
|
|
13394
|
+
* Creates the flow's current version as a Meta flow on the business account of the named number, or of the default number, and publishes it. A version already published there returns its registration. Meta's validator findings answer a validation error and stay on the draft registration.
|
|
13395
|
+
*/
|
|
13396
|
+
static register(parameters, options) {
|
|
13397
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13398
|
+
in: "path",
|
|
13399
|
+
key: "id"
|
|
13400
|
+
}, {
|
|
13401
|
+
in: "body",
|
|
13402
|
+
key: "businessAccountId"
|
|
13403
|
+
}] }]);
|
|
13404
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsRegister", options, (headers) => (options?.client ?? client).post({
|
|
13405
|
+
security: [{
|
|
13406
|
+
name: "x-api-key",
|
|
13407
|
+
type: "apiKey"
|
|
13408
|
+
}],
|
|
13409
|
+
url: "/v1/whatsapp/flows/{id}/registrations",
|
|
13410
|
+
...options,
|
|
13411
|
+
...params,
|
|
13412
|
+
body: params.body ?? {},
|
|
13413
|
+
headers: {
|
|
13414
|
+
"Content-Type": "application/json",
|
|
13415
|
+
...options?.headers,
|
|
13416
|
+
...params.headers
|
|
13417
|
+
},
|
|
13418
|
+
headers: {
|
|
13419
|
+
"Content-Type": "application/json",
|
|
13420
|
+
...headers
|
|
13421
|
+
}
|
|
13422
|
+
}));
|
|
13423
|
+
}
|
|
13424
|
+
/**
|
|
13425
|
+
* Rotate a business account's flow encryption key
|
|
13426
|
+
*
|
|
13427
|
+
* Replaces the key WhatsApp encrypts data-exchange requests with on the business account of the named number, or of the default number, and uploads it to each of the account's numbers. The replaced key keeps decrypting for a day while clients fetch the new one.
|
|
13428
|
+
*/
|
|
13429
|
+
static rotateEncryptionKey(parameters, options) {
|
|
13430
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13431
|
+
in: "body",
|
|
13432
|
+
key: "businessAccountId"
|
|
13433
|
+
}] }]);
|
|
13434
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsRotateEncryptionKey", options, (headers) => (options?.client ?? client).post({
|
|
13435
|
+
security: [{
|
|
13436
|
+
name: "x-api-key",
|
|
13437
|
+
type: "apiKey"
|
|
13438
|
+
}],
|
|
13439
|
+
url: "/v1/whatsapp/flows/encryption-key/rotate",
|
|
13440
|
+
...options,
|
|
13441
|
+
...params,
|
|
13442
|
+
body: params.body ?? {},
|
|
13443
|
+
headers: {
|
|
13444
|
+
"Content-Type": "application/json",
|
|
13445
|
+
...options?.headers,
|
|
13446
|
+
...params.headers
|
|
13447
|
+
},
|
|
13448
|
+
headers: {
|
|
13449
|
+
"Content-Type": "application/json",
|
|
13450
|
+
...headers
|
|
13451
|
+
}
|
|
13452
|
+
}));
|
|
13453
|
+
}
|
|
13454
|
+
/**
|
|
13455
|
+
* Set a flow's endpoint
|
|
13456
|
+
*
|
|
13457
|
+
* Sets the HTTPS endpoint Samva forwards the flow's data-exchange requests to, signed like a webhook delivery. The flow's first endpoint is issued a signing secret, returned once; changing the URL keeps the secret.
|
|
13458
|
+
*/
|
|
13459
|
+
static setEndpoint(parameters, options) {
|
|
13460
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13461
|
+
in: "path",
|
|
13462
|
+
key: "id"
|
|
13463
|
+
}, {
|
|
13464
|
+
in: "body",
|
|
13465
|
+
key: "url"
|
|
13466
|
+
}] }]);
|
|
13467
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsSetEndpoint", options, (headers) => (options?.client ?? client).put({
|
|
13468
|
+
security: [{
|
|
13469
|
+
name: "x-api-key",
|
|
13470
|
+
type: "apiKey"
|
|
13471
|
+
}],
|
|
13472
|
+
url: "/v1/whatsapp/flows/{id}/endpoint",
|
|
13473
|
+
...options,
|
|
13474
|
+
...params,
|
|
13475
|
+
body: params.body ?? {},
|
|
13476
|
+
headers: {
|
|
13477
|
+
"Content-Type": "application/json",
|
|
13478
|
+
...options?.headers,
|
|
13479
|
+
...params.headers
|
|
13480
|
+
},
|
|
13481
|
+
headers: {
|
|
13482
|
+
"Content-Type": "application/json",
|
|
13483
|
+
...headers
|
|
13484
|
+
}
|
|
13485
|
+
}));
|
|
13486
|
+
}
|
|
13487
|
+
/**
|
|
13488
|
+
* Rotate a flow endpoint's signing secret
|
|
13489
|
+
*
|
|
13490
|
+
* Issues and returns a new signing secret. Requests carry a signature from the previous secret too for 24 hours.
|
|
13491
|
+
*/
|
|
13492
|
+
static rotateEndpointSecret(parameters, options) {
|
|
13493
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13494
|
+
in: "path",
|
|
13495
|
+
key: "id"
|
|
13496
|
+
}] }]);
|
|
13497
|
+
return requestWithPolicy(options?.client ?? client, "whatsappFlowsRotateEndpointSecret", options, (headers) => (options?.client ?? client).post({
|
|
13498
|
+
security: [{
|
|
13499
|
+
name: "x-api-key",
|
|
13500
|
+
type: "apiKey"
|
|
13501
|
+
}],
|
|
13502
|
+
url: "/v1/whatsapp/flows/{id}/endpoint/rotate-secret",
|
|
13503
|
+
...options,
|
|
13504
|
+
...params,
|
|
13505
|
+
headers
|
|
13506
|
+
}));
|
|
13507
|
+
}
|
|
13508
|
+
};
|
|
13509
|
+
var WhatsappSetupLinks = class {
|
|
13510
|
+
/**
|
|
13511
|
+
* List WhatsApp setup links
|
|
13512
|
+
*
|
|
13513
|
+
* Returns setup links newest first, by namespace and status when named.
|
|
13514
|
+
*/
|
|
13515
|
+
static list(parameters, options) {
|
|
13516
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
13517
|
+
{
|
|
13518
|
+
in: "query",
|
|
13519
|
+
key: "limit"
|
|
13520
|
+
},
|
|
13521
|
+
{
|
|
13522
|
+
in: "query",
|
|
13523
|
+
key: "cursor"
|
|
13524
|
+
},
|
|
13525
|
+
{
|
|
13526
|
+
in: "query",
|
|
13527
|
+
key: "namespaceId"
|
|
13528
|
+
},
|
|
13529
|
+
{
|
|
13530
|
+
in: "query",
|
|
13531
|
+
key: "status"
|
|
13532
|
+
}
|
|
13533
|
+
] }]);
|
|
13534
|
+
return requestWithPolicy(options?.client ?? client, "whatsappSetupLinksList", options, (headers) => (options?.client ?? client).get({
|
|
13535
|
+
security: [{
|
|
13536
|
+
name: "x-api-key",
|
|
13537
|
+
type: "apiKey"
|
|
13538
|
+
}],
|
|
13539
|
+
url: "/v1/whatsapp/setup-links",
|
|
13540
|
+
...options,
|
|
13541
|
+
...params,
|
|
13542
|
+
headers
|
|
13543
|
+
}));
|
|
13544
|
+
}
|
|
13545
|
+
/**
|
|
13546
|
+
* Create a WhatsApp setup link
|
|
13547
|
+
*
|
|
13548
|
+
* Creates a single-use link your customer opens to connect their WhatsApp number into the namespace, without a Samva account. The response carries the link's URL once; Samva keeps only a digest of its token. The link expires at `expiresAt`, at most 30 days ahead and 7 days when omitted.
|
|
13549
|
+
*/
|
|
13550
|
+
static create(parameters, options) {
|
|
13551
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
13552
|
+
{
|
|
13553
|
+
in: "body",
|
|
13554
|
+
key: "namespaceId"
|
|
13555
|
+
},
|
|
13556
|
+
{
|
|
13557
|
+
in: "body",
|
|
13558
|
+
key: "redirectUrl"
|
|
13559
|
+
},
|
|
13560
|
+
{
|
|
13561
|
+
in: "body",
|
|
13562
|
+
key: "metadata"
|
|
13563
|
+
},
|
|
13564
|
+
{
|
|
13565
|
+
in: "body",
|
|
13566
|
+
key: "expiresAt"
|
|
13567
|
+
}
|
|
13568
|
+
] }]);
|
|
13569
|
+
return requestWithPolicy(options?.client ?? client, "whatsappSetupLinksCreate", options, (headers) => (options?.client ?? client).post({
|
|
13570
|
+
security: [{
|
|
13571
|
+
name: "x-api-key",
|
|
13572
|
+
type: "apiKey"
|
|
13573
|
+
}],
|
|
13574
|
+
url: "/v1/whatsapp/setup-links",
|
|
13575
|
+
...options,
|
|
13576
|
+
...params,
|
|
13577
|
+
body: params.body ?? {},
|
|
13578
|
+
headers: {
|
|
13579
|
+
"Content-Type": "application/json",
|
|
13580
|
+
...options?.headers,
|
|
13581
|
+
...params.headers
|
|
13582
|
+
},
|
|
13583
|
+
headers: {
|
|
13584
|
+
"Content-Type": "application/json",
|
|
13585
|
+
...headers
|
|
13586
|
+
}
|
|
13587
|
+
}));
|
|
13588
|
+
}
|
|
13589
|
+
/**
|
|
13590
|
+
* Get a WhatsApp setup link
|
|
13591
|
+
*
|
|
13592
|
+
* Returns a setup link’s status and connection details.
|
|
13593
|
+
*/
|
|
13594
|
+
static get(parameters, options) {
|
|
13595
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13596
|
+
in: "path",
|
|
13597
|
+
key: "linkId"
|
|
13598
|
+
}] }]);
|
|
13599
|
+
return requestWithPolicy(options?.client ?? client, "whatsappSetupLinksGet", options, (headers) => (options?.client ?? client).get({
|
|
13600
|
+
security: [{
|
|
13601
|
+
name: "x-api-key",
|
|
13602
|
+
type: "apiKey"
|
|
13603
|
+
}],
|
|
13604
|
+
url: "/v1/whatsapp/setup-links/{linkId}",
|
|
13605
|
+
...options,
|
|
13606
|
+
...params,
|
|
13607
|
+
headers
|
|
13608
|
+
}));
|
|
13609
|
+
}
|
|
13610
|
+
/**
|
|
13611
|
+
* Revoke a WhatsApp setup link
|
|
13612
|
+
*
|
|
13613
|
+
* Stops a pending link from connecting a number. A link that already connected one, was revoked, or expired answers 410.
|
|
13614
|
+
*/
|
|
13615
|
+
static revoke(parameters, options) {
|
|
13616
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13617
|
+
in: "path",
|
|
13618
|
+
key: "linkId"
|
|
13619
|
+
}] }]);
|
|
13620
|
+
return requestWithPolicy(options?.client ?? client, "whatsappSetupLinksRevoke", options, (headers) => (options?.client ?? client).post({
|
|
13621
|
+
security: [{
|
|
13622
|
+
name: "x-api-key",
|
|
13623
|
+
type: "apiKey"
|
|
13624
|
+
}],
|
|
13625
|
+
url: "/v1/whatsapp/setup-links/{linkId}/revoke",
|
|
13626
|
+
...options,
|
|
13627
|
+
...params,
|
|
13628
|
+
headers
|
|
13629
|
+
}));
|
|
13630
|
+
}
|
|
13631
|
+
};
|
|
13632
|
+
var TemplateRegistrations = class {
|
|
13633
|
+
/**
|
|
13634
|
+
* List a template's registrations
|
|
13635
|
+
*
|
|
13636
|
+
* Returns every provider registration of the template, newest first, with its review status and the publication it last submitted.
|
|
13637
|
+
*/
|
|
13638
|
+
static list(parameters, options) {
|
|
13639
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13640
|
+
in: "path",
|
|
13641
|
+
key: "id"
|
|
13642
|
+
}] }]);
|
|
13643
|
+
return requestWithPolicy(options?.client ?? client, "templateRegistrationsList", options, (headers) => (options?.client ?? client).get({
|
|
13644
|
+
security: [{
|
|
13645
|
+
name: "x-api-key",
|
|
13646
|
+
type: "apiKey"
|
|
13647
|
+
}],
|
|
13648
|
+
url: "/v1/templates/{id}/registrations",
|
|
13649
|
+
...options,
|
|
13650
|
+
...params,
|
|
13651
|
+
headers
|
|
13652
|
+
}));
|
|
13653
|
+
}
|
|
13654
|
+
/**
|
|
13655
|
+
* Submit a template registration
|
|
13656
|
+
*
|
|
13657
|
+
* Submits the template's current publication for the provider's review: for WhatsApp, as a message template on the business account of the named number, or of the default number. A first submission creates the provider template; a later one resubmits the newer publication's content to the same template.
|
|
13658
|
+
*/
|
|
13659
|
+
static submit(parameters, options) {
|
|
13660
|
+
const params = buildClientParams([parameters], [{ args: [
|
|
13661
|
+
{
|
|
13662
|
+
in: "path",
|
|
13663
|
+
key: "id"
|
|
13664
|
+
},
|
|
13665
|
+
{
|
|
13666
|
+
in: "body",
|
|
13667
|
+
key: "provider"
|
|
13668
|
+
},
|
|
13669
|
+
{
|
|
13670
|
+
in: "body",
|
|
13671
|
+
key: "businessAccountId"
|
|
13672
|
+
}
|
|
13673
|
+
] }]);
|
|
13674
|
+
return requestWithPolicy(options?.client ?? client, "templateRegistrationsSubmit", options, (headers) => (options?.client ?? client).post({
|
|
13675
|
+
security: [{
|
|
13676
|
+
name: "x-api-key",
|
|
13677
|
+
type: "apiKey"
|
|
13678
|
+
}],
|
|
13679
|
+
url: "/v1/templates/{id}/registrations",
|
|
13680
|
+
...options,
|
|
13681
|
+
...params,
|
|
13682
|
+
body: params.body ?? {},
|
|
13683
|
+
headers: {
|
|
13684
|
+
"Content-Type": "application/json",
|
|
13685
|
+
...options?.headers,
|
|
13686
|
+
...params.headers
|
|
13687
|
+
},
|
|
13688
|
+
headers: {
|
|
13689
|
+
"Content-Type": "application/json",
|
|
13690
|
+
...headers
|
|
13691
|
+
}
|
|
13692
|
+
}));
|
|
13693
|
+
}
|
|
13694
|
+
/**
|
|
13695
|
+
* Get a template registration
|
|
13696
|
+
*
|
|
13697
|
+
* Returns one registration: its status, the category the provider assigned, and why the provider rejected, paused, or disabled it.
|
|
13698
|
+
*/
|
|
13699
|
+
static get(parameters, options) {
|
|
13700
|
+
const params = buildClientParams([parameters], [{ args: [{
|
|
13701
|
+
in: "path",
|
|
13702
|
+
key: "id"
|
|
13703
|
+
}, {
|
|
13704
|
+
in: "path",
|
|
13705
|
+
key: "registrationId"
|
|
13706
|
+
}] }]);
|
|
13707
|
+
return requestWithPolicy(options?.client ?? client, "templateRegistrationsGet", options, (headers) => (options?.client ?? client).get({
|
|
13708
|
+
security: [{
|
|
13709
|
+
name: "x-api-key",
|
|
13710
|
+
type: "apiKey"
|
|
13711
|
+
}],
|
|
13712
|
+
url: "/v1/templates/{id}/registrations/{registrationId}",
|
|
13713
|
+
...options,
|
|
13714
|
+
...params,
|
|
13715
|
+
headers
|
|
13716
|
+
}));
|
|
13717
|
+
}
|
|
13718
|
+
};
|
|
12815
13719
|
Object.assign(Messages.list, { operation: "messagesList" });
|
|
12816
13720
|
Object.assign(Messages.send, { operation: "messagesSend" });
|
|
12817
13721
|
Object.assign(Messages.remove, { operation: "messagesRemove" });
|
|
@@ -13048,6 +13952,8 @@ Object.assign(Templates.attachFamilyMember, { operation: "templatesAttachFamilyM
|
|
|
13048
13952
|
Object.assign(Templates.delete, { operation: "templatesDelete" });
|
|
13049
13953
|
Object.assign(Templates.getById, { operation: "templatesGetById" });
|
|
13050
13954
|
Object.assign(Templates.update, { operation: "templatesUpdate" });
|
|
13955
|
+
Object.assign(Templates.suggestStarters, { operation: "templatesSuggestStarters" });
|
|
13956
|
+
Object.assign(Templates.createFromBrief, { operation: "templatesCreateFromBrief" });
|
|
13051
13957
|
Object.assign(Templates.createFromWebsite, { operation: "templatesCreateFromWebsite" });
|
|
13052
13958
|
Object.assign(Templates.addEntry, { operation: "templatesAddEntry" });
|
|
13053
13959
|
Object.assign(Templates.deleteProject, { operation: "templatesDeleteProject" });
|
|
@@ -13195,6 +14101,35 @@ Object.assign(ExtensionInstallations.disable, { operation: "extensionInstallatio
|
|
|
13195
14101
|
Object.assign(ExtensionInstallations.enable, { operation: "extensionInstallationsEnable" });
|
|
13196
14102
|
Object.assign(ExtensionInstallations.listRuns, { operation: "extensionInstallationsListRuns" });
|
|
13197
14103
|
Object.assign(ExtensionInstallations.getRun, { operation: "extensionInstallationsGetRun" });
|
|
13198
|
-
|
|
14104
|
+
Object.assign(Whatsapp.getStats, { operation: "whatsappGetStats" });
|
|
14105
|
+
Object.assign(Whatsapp.getTemplateStats, { operation: "whatsappGetTemplateStats" });
|
|
14106
|
+
Object.assign(Whatsapp.getServiceWindowStatus, { operation: "whatsappGetServiceWindowStatus" });
|
|
14107
|
+
Object.assign(Whatsapp.getServiceWindowBilling, { operation: "whatsappGetServiceWindowBilling" });
|
|
14108
|
+
Object.assign(Whatsapp.getMediaDownloadUrl, { operation: "whatsappGetMediaDownloadUrl" });
|
|
14109
|
+
Object.assign(Whatsapp.listBusinessAccounts, { operation: "whatsappListBusinessAccounts" });
|
|
14110
|
+
Object.assign(Whatsapp.connectBusinessAccount, { operation: "whatsappConnectBusinessAccount" });
|
|
14111
|
+
Object.assign(Whatsapp.disconnectBusinessAccount, { operation: "whatsappDisconnectBusinessAccount" });
|
|
14112
|
+
Object.assign(Whatsapp.getBusinessAccount, { operation: "whatsappGetBusinessAccount" });
|
|
14113
|
+
Object.assign(Whatsapp.updateBusinessAccount, { operation: "whatsappUpdateBusinessAccount" });
|
|
14114
|
+
Object.assign(Whatsapp.setDefaultBusinessAccount, { operation: "whatsappSetDefaultBusinessAccount" });
|
|
14115
|
+
Object.assign(Whatsapp.syncAccountStatus, { operation: "whatsappSyncAccountStatus" });
|
|
14116
|
+
Object.assign(WhatsappFlows.list, { operation: "whatsappFlowsList" });
|
|
14117
|
+
Object.assign(WhatsappFlows.create, { operation: "whatsappFlowsCreate" });
|
|
14118
|
+
Object.assign(WhatsappFlows.get, { operation: "whatsappFlowsGet" });
|
|
14119
|
+
Object.assign(WhatsappFlows.listVersions, { operation: "whatsappFlowsListVersions" });
|
|
14120
|
+
Object.assign(WhatsappFlows.recordVersion, { operation: "whatsappFlowsRecordVersion" });
|
|
14121
|
+
Object.assign(WhatsappFlows.listRegistrations, { operation: "whatsappFlowsListRegistrations" });
|
|
14122
|
+
Object.assign(WhatsappFlows.register, { operation: "whatsappFlowsRegister" });
|
|
14123
|
+
Object.assign(WhatsappFlows.rotateEncryptionKey, { operation: "whatsappFlowsRotateEncryptionKey" });
|
|
14124
|
+
Object.assign(WhatsappFlows.setEndpoint, { operation: "whatsappFlowsSetEndpoint" });
|
|
14125
|
+
Object.assign(WhatsappFlows.rotateEndpointSecret, { operation: "whatsappFlowsRotateEndpointSecret" });
|
|
14126
|
+
Object.assign(WhatsappSetupLinks.list, { operation: "whatsappSetupLinksList" });
|
|
14127
|
+
Object.assign(WhatsappSetupLinks.create, { operation: "whatsappSetupLinksCreate" });
|
|
14128
|
+
Object.assign(WhatsappSetupLinks.get, { operation: "whatsappSetupLinksGet" });
|
|
14129
|
+
Object.assign(WhatsappSetupLinks.revoke, { operation: "whatsappSetupLinksRevoke" });
|
|
14130
|
+
Object.assign(TemplateRegistrations.list, { operation: "templateRegistrationsList" });
|
|
14131
|
+
Object.assign(TemplateRegistrations.submit, { operation: "templateRegistrationsSubmit" });
|
|
14132
|
+
Object.assign(TemplateRegistrations.get, { operation: "templateRegistrationsGet" });
|
|
14133
|
+
export { Agents, Analytics, ApiKeys, Attachments, Brands, Campaigns, ContactEvents, ContactGroups, Contacts, Conversations, CustomFields, Domains, Email, Events, ExtensionInstallations, Extensions, Feedback, Issues, Journeys, Mailboxes, Media, Messages, Namespaces, Newsletters, Operations, Organizations, Policies, ScheduledMessages, Subscriptions, TemplateRegistrations, Templates, TopicForms, Topics, Webhooks, Whatsapp, WhatsappFlows, WhatsappSetupLinks, Whoami };
|
|
13199
14134
|
|
|
13200
14135
|
//# sourceMappingURL=sdk.gen.js.map
|