@zernio/node 0.2.171 → 0.2.173
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/dist/index.d.mts +72 -4
- package/dist/index.d.ts +72 -4
- package/dist/index.js +91 -6
- package/dist/index.mjs +91 -6
- package/package.json +1 -1
- package/src/client.ts +9 -6
- package/src/generated/sdk.gen.ts +2 -2
- package/src/generated/types.gen.ts +72 -4
package/dist/index.d.mts
CHANGED
|
@@ -10582,21 +10582,33 @@ type CreateInboxConversationData = {
|
|
|
10582
10582
|
*/
|
|
10583
10583
|
accountId: string;
|
|
10584
10584
|
/**
|
|
10585
|
-
*
|
|
10585
|
+
* Recipient identifier. For X this is the numeric user ID; for WhatsApp, the recipient phone number in international format (digits, country code included). Provide either this or participantUsername.
|
|
10586
10586
|
*/
|
|
10587
10587
|
participantId?: string;
|
|
10588
10588
|
/**
|
|
10589
|
-
*
|
|
10589
|
+
* Recipient handle/username — an X or Bluesky handle (with or without @) or a Reddit username (with or without u/). Resolved via lookup. Provide either this or participantId.
|
|
10590
10590
|
*/
|
|
10591
10591
|
participantUsername?: string;
|
|
10592
10592
|
/**
|
|
10593
|
-
* Text content of the message. At least one of message or
|
|
10593
|
+
* Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required.
|
|
10594
10594
|
*/
|
|
10595
10595
|
message?: string;
|
|
10596
10596
|
/**
|
|
10597
|
-
* Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
|
|
10597
|
+
* X/Twitter only. Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
|
|
10598
10598
|
*/
|
|
10599
10599
|
skipDmCheck?: boolean;
|
|
10600
|
+
/**
|
|
10601
|
+
* WhatsApp only. Name of the approved template to start the conversation with (required for WhatsApp).
|
|
10602
|
+
*/
|
|
10603
|
+
templateName?: string;
|
|
10604
|
+
/**
|
|
10605
|
+
* WhatsApp only. Template language code (e.g. en_US).
|
|
10606
|
+
*/
|
|
10607
|
+
templateLanguage?: string;
|
|
10608
|
+
/**
|
|
10609
|
+
* WhatsApp only. Body variable values, in order, substituted into the template body ({{1}}, {{2}}, ...).
|
|
10610
|
+
*/
|
|
10611
|
+
templateParams?: Array<(string)>;
|
|
10600
10612
|
};
|
|
10601
10613
|
};
|
|
10602
10614
|
type CreateInboxConversationResponse = ({
|
|
@@ -10856,6 +10868,17 @@ type GetInboxConversationMessagesResponse = ({
|
|
|
10856
10868
|
title?: string;
|
|
10857
10869
|
message?: string;
|
|
10858
10870
|
} | null;
|
|
10871
|
+
/**
|
|
10872
|
+
* Emoji reactions on this message (WhatsApp / Telegram). At most one per party in a 1:1 thread.
|
|
10873
|
+
*/
|
|
10874
|
+
reactions?: Array<{
|
|
10875
|
+
emoji?: string;
|
|
10876
|
+
/**
|
|
10877
|
+
* true if the connected account reacted
|
|
10878
|
+
*/
|
|
10879
|
+
fromMe?: boolean;
|
|
10880
|
+
reactedAt?: string;
|
|
10881
|
+
}>;
|
|
10859
10882
|
}>;
|
|
10860
10883
|
lastUpdated?: string;
|
|
10861
10884
|
});
|
|
@@ -11130,6 +11153,51 @@ type SendInboxMessageData = {
|
|
|
11130
11153
|
* Platform message ID to quote-reply to. For WhatsApp, pass the wamid (available in message.platformMessageId from webhooks). For Telegram, pass the Telegram message ID.
|
|
11131
11154
|
*/
|
|
11132
11155
|
replyTo?: string;
|
|
11156
|
+
/**
|
|
11157
|
+
* WhatsApp-only. Send a location pin.
|
|
11158
|
+
*/
|
|
11159
|
+
location?: {
|
|
11160
|
+
/**
|
|
11161
|
+
* Latitude in decimal degrees.
|
|
11162
|
+
*/
|
|
11163
|
+
latitude: number;
|
|
11164
|
+
/**
|
|
11165
|
+
* Longitude in decimal degrees.
|
|
11166
|
+
*/
|
|
11167
|
+
longitude: number;
|
|
11168
|
+
/**
|
|
11169
|
+
* Optional location name.
|
|
11170
|
+
*/
|
|
11171
|
+
name?: string;
|
|
11172
|
+
/**
|
|
11173
|
+
* Optional street address.
|
|
11174
|
+
*/
|
|
11175
|
+
address?: string;
|
|
11176
|
+
};
|
|
11177
|
+
/**
|
|
11178
|
+
* WhatsApp-only. Send one or more contact cards.
|
|
11179
|
+
*/
|
|
11180
|
+
contacts?: Array<{
|
|
11181
|
+
name: {
|
|
11182
|
+
/**
|
|
11183
|
+
* Full display name.
|
|
11184
|
+
*/
|
|
11185
|
+
formatted_name: string;
|
|
11186
|
+
first_name?: string;
|
|
11187
|
+
last_name?: string;
|
|
11188
|
+
};
|
|
11189
|
+
phones?: Array<{
|
|
11190
|
+
phone?: string;
|
|
11191
|
+
/**
|
|
11192
|
+
* e.g. CELL, WORK, HOME.
|
|
11193
|
+
*/
|
|
11194
|
+
type?: string;
|
|
11195
|
+
}>;
|
|
11196
|
+
emails?: Array<{
|
|
11197
|
+
email?: string;
|
|
11198
|
+
type?: string;
|
|
11199
|
+
}>;
|
|
11200
|
+
}>;
|
|
11133
11201
|
};
|
|
11134
11202
|
path: {
|
|
11135
11203
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -10582,21 +10582,33 @@ type CreateInboxConversationData = {
|
|
|
10582
10582
|
*/
|
|
10583
10583
|
accountId: string;
|
|
10584
10584
|
/**
|
|
10585
|
-
*
|
|
10585
|
+
* Recipient identifier. For X this is the numeric user ID; for WhatsApp, the recipient phone number in international format (digits, country code included). Provide either this or participantUsername.
|
|
10586
10586
|
*/
|
|
10587
10587
|
participantId?: string;
|
|
10588
10588
|
/**
|
|
10589
|
-
*
|
|
10589
|
+
* Recipient handle/username — an X or Bluesky handle (with or without @) or a Reddit username (with or without u/). Resolved via lookup. Provide either this or participantId.
|
|
10590
10590
|
*/
|
|
10591
10591
|
participantUsername?: string;
|
|
10592
10592
|
/**
|
|
10593
|
-
* Text content of the message. At least one of message or
|
|
10593
|
+
* Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required.
|
|
10594
10594
|
*/
|
|
10595
10595
|
message?: string;
|
|
10596
10596
|
/**
|
|
10597
|
-
* Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
|
|
10597
|
+
* X/Twitter only. Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
|
|
10598
10598
|
*/
|
|
10599
10599
|
skipDmCheck?: boolean;
|
|
10600
|
+
/**
|
|
10601
|
+
* WhatsApp only. Name of the approved template to start the conversation with (required for WhatsApp).
|
|
10602
|
+
*/
|
|
10603
|
+
templateName?: string;
|
|
10604
|
+
/**
|
|
10605
|
+
* WhatsApp only. Template language code (e.g. en_US).
|
|
10606
|
+
*/
|
|
10607
|
+
templateLanguage?: string;
|
|
10608
|
+
/**
|
|
10609
|
+
* WhatsApp only. Body variable values, in order, substituted into the template body ({{1}}, {{2}}, ...).
|
|
10610
|
+
*/
|
|
10611
|
+
templateParams?: Array<(string)>;
|
|
10600
10612
|
};
|
|
10601
10613
|
};
|
|
10602
10614
|
type CreateInboxConversationResponse = ({
|
|
@@ -10856,6 +10868,17 @@ type GetInboxConversationMessagesResponse = ({
|
|
|
10856
10868
|
title?: string;
|
|
10857
10869
|
message?: string;
|
|
10858
10870
|
} | null;
|
|
10871
|
+
/**
|
|
10872
|
+
* Emoji reactions on this message (WhatsApp / Telegram). At most one per party in a 1:1 thread.
|
|
10873
|
+
*/
|
|
10874
|
+
reactions?: Array<{
|
|
10875
|
+
emoji?: string;
|
|
10876
|
+
/**
|
|
10877
|
+
* true if the connected account reacted
|
|
10878
|
+
*/
|
|
10879
|
+
fromMe?: boolean;
|
|
10880
|
+
reactedAt?: string;
|
|
10881
|
+
}>;
|
|
10859
10882
|
}>;
|
|
10860
10883
|
lastUpdated?: string;
|
|
10861
10884
|
});
|
|
@@ -11130,6 +11153,51 @@ type SendInboxMessageData = {
|
|
|
11130
11153
|
* Platform message ID to quote-reply to. For WhatsApp, pass the wamid (available in message.platformMessageId from webhooks). For Telegram, pass the Telegram message ID.
|
|
11131
11154
|
*/
|
|
11132
11155
|
replyTo?: string;
|
|
11156
|
+
/**
|
|
11157
|
+
* WhatsApp-only. Send a location pin.
|
|
11158
|
+
*/
|
|
11159
|
+
location?: {
|
|
11160
|
+
/**
|
|
11161
|
+
* Latitude in decimal degrees.
|
|
11162
|
+
*/
|
|
11163
|
+
latitude: number;
|
|
11164
|
+
/**
|
|
11165
|
+
* Longitude in decimal degrees.
|
|
11166
|
+
*/
|
|
11167
|
+
longitude: number;
|
|
11168
|
+
/**
|
|
11169
|
+
* Optional location name.
|
|
11170
|
+
*/
|
|
11171
|
+
name?: string;
|
|
11172
|
+
/**
|
|
11173
|
+
* Optional street address.
|
|
11174
|
+
*/
|
|
11175
|
+
address?: string;
|
|
11176
|
+
};
|
|
11177
|
+
/**
|
|
11178
|
+
* WhatsApp-only. Send one or more contact cards.
|
|
11179
|
+
*/
|
|
11180
|
+
contacts?: Array<{
|
|
11181
|
+
name: {
|
|
11182
|
+
/**
|
|
11183
|
+
* Full display name.
|
|
11184
|
+
*/
|
|
11185
|
+
formatted_name: string;
|
|
11186
|
+
first_name?: string;
|
|
11187
|
+
last_name?: string;
|
|
11188
|
+
};
|
|
11189
|
+
phones?: Array<{
|
|
11190
|
+
phone?: string;
|
|
11191
|
+
/**
|
|
11192
|
+
* e.g. CELL, WORK, HOME.
|
|
11193
|
+
*/
|
|
11194
|
+
type?: string;
|
|
11195
|
+
}>;
|
|
11196
|
+
emails?: Array<{
|
|
11197
|
+
email?: string;
|
|
11198
|
+
type?: string;
|
|
11199
|
+
}>;
|
|
11200
|
+
}>;
|
|
11133
11201
|
};
|
|
11134
11202
|
path: {
|
|
11135
11203
|
/**
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,92 @@ __export(index_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(index_exports);
|
|
35
35
|
|
|
36
|
+
// package.json
|
|
37
|
+
var package_default = {
|
|
38
|
+
name: "@zernio/node",
|
|
39
|
+
version: "0.2.173",
|
|
40
|
+
description: "The official Node.js library for the Zernio API",
|
|
41
|
+
main: "dist/index.js",
|
|
42
|
+
module: "dist/index.mjs",
|
|
43
|
+
types: "dist/index.d.ts",
|
|
44
|
+
sideEffects: false,
|
|
45
|
+
exports: {
|
|
46
|
+
".": {
|
|
47
|
+
types: "./dist/index.d.ts",
|
|
48
|
+
import: "./dist/index.mjs",
|
|
49
|
+
require: "./dist/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./_shims/*": {
|
|
52
|
+
types: "./dist/_shims/*.d.ts",
|
|
53
|
+
import: "./dist/_shims/*.mjs",
|
|
54
|
+
require: "./dist/_shims/*.js"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
files: [
|
|
58
|
+
"dist",
|
|
59
|
+
"src",
|
|
60
|
+
"README.md",
|
|
61
|
+
"LICENSE"
|
|
62
|
+
],
|
|
63
|
+
scripts: {
|
|
64
|
+
generate: "openapi-ts -i openapi.yaml -o src/generated -c @hey-api/client-fetch && npm run generate:client",
|
|
65
|
+
"generate:client": "npx tsx scripts/generate-client.ts",
|
|
66
|
+
build: "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
67
|
+
dev: "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
68
|
+
lint: "eslint src",
|
|
69
|
+
typecheck: "tsc --noEmit",
|
|
70
|
+
test: "vitest run",
|
|
71
|
+
"test:watch": "vitest",
|
|
72
|
+
prepublishOnly: "npm run build",
|
|
73
|
+
"fetch-spec": "curl -o openapi.yaml https://zernio.com/openapi.yaml"
|
|
74
|
+
},
|
|
75
|
+
keywords: [
|
|
76
|
+
"zernio",
|
|
77
|
+
"social-media",
|
|
78
|
+
"scheduling",
|
|
79
|
+
"api",
|
|
80
|
+
"sdk",
|
|
81
|
+
"instagram",
|
|
82
|
+
"tiktok",
|
|
83
|
+
"youtube",
|
|
84
|
+
"linkedin",
|
|
85
|
+
"twitter",
|
|
86
|
+
"x",
|
|
87
|
+
"facebook",
|
|
88
|
+
"pinterest",
|
|
89
|
+
"threads",
|
|
90
|
+
"bluesky",
|
|
91
|
+
"snapchat",
|
|
92
|
+
"telegram"
|
|
93
|
+
],
|
|
94
|
+
author: "Zernio <support@zernio.com>",
|
|
95
|
+
license: "Apache-2.0",
|
|
96
|
+
repository: {
|
|
97
|
+
type: "git",
|
|
98
|
+
url: "git+https://github.com/zernio-dev/zernio-node.git"
|
|
99
|
+
},
|
|
100
|
+
homepage: "https://zernio.com/docs/api",
|
|
101
|
+
bugs: {
|
|
102
|
+
url: "https://github.com/zernio-dev/zernio-node/issues"
|
|
103
|
+
},
|
|
104
|
+
engines: {
|
|
105
|
+
node: ">=18"
|
|
106
|
+
},
|
|
107
|
+
devDependencies: {
|
|
108
|
+
"@hey-api/client-fetch": "^0.6.0",
|
|
109
|
+
"@hey-api/openapi-ts": "^0.61.0",
|
|
110
|
+
"@types/node": "^20.11.0",
|
|
111
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
112
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
113
|
+
eslint: "^8.56.0",
|
|
114
|
+
tsup: "^8.0.1",
|
|
115
|
+
tsx: "^4.7.0",
|
|
116
|
+
typescript: "^5.3.3",
|
|
117
|
+
vitest: "^1.2.0",
|
|
118
|
+
yaml: "^2.3.4"
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
36
122
|
// node_modules/@hey-api/client-fetch/dist/index.js
|
|
37
123
|
var U = /\{[^{}]+\}/g;
|
|
38
124
|
var S = ({ allowReserved: t, name: r, value: e }) => {
|
|
@@ -2777,15 +2863,14 @@ var Zernio = class {
|
|
|
2777
2863
|
this.baseURL = options.baseURL ?? "https://zernio.com/api";
|
|
2778
2864
|
this._options = options;
|
|
2779
2865
|
client.setConfig({
|
|
2780
|
-
baseUrl: this.baseURL
|
|
2866
|
+
baseUrl: this.baseURL,
|
|
2867
|
+
headers: {
|
|
2868
|
+
"User-Agent": `zernio-node/${package_default.version}`,
|
|
2869
|
+
...options.defaultHeaders ?? {}
|
|
2870
|
+
}
|
|
2781
2871
|
});
|
|
2782
2872
|
client.interceptors.request.use((request) => {
|
|
2783
2873
|
request.headers.set("Authorization", `Bearer ${this.apiKey}`);
|
|
2784
|
-
if (options.defaultHeaders) {
|
|
2785
|
-
for (const [key, value] of Object.entries(options.defaultHeaders)) {
|
|
2786
|
-
request.headers.set(key, value);
|
|
2787
|
-
}
|
|
2788
|
-
}
|
|
2789
2874
|
return request;
|
|
2790
2875
|
});
|
|
2791
2876
|
client.interceptors.response.use(async (response) => {
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,92 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
|
|
5
|
+
// package.json
|
|
6
|
+
var package_default = {
|
|
7
|
+
name: "@zernio/node",
|
|
8
|
+
version: "0.2.173",
|
|
9
|
+
description: "The official Node.js library for the Zernio API",
|
|
10
|
+
main: "dist/index.js",
|
|
11
|
+
module: "dist/index.mjs",
|
|
12
|
+
types: "dist/index.d.ts",
|
|
13
|
+
sideEffects: false,
|
|
14
|
+
exports: {
|
|
15
|
+
".": {
|
|
16
|
+
types: "./dist/index.d.ts",
|
|
17
|
+
import: "./dist/index.mjs",
|
|
18
|
+
require: "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./_shims/*": {
|
|
21
|
+
types: "./dist/_shims/*.d.ts",
|
|
22
|
+
import: "./dist/_shims/*.mjs",
|
|
23
|
+
require: "./dist/_shims/*.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
files: [
|
|
27
|
+
"dist",
|
|
28
|
+
"src",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
scripts: {
|
|
33
|
+
generate: "openapi-ts -i openapi.yaml -o src/generated -c @hey-api/client-fetch && npm run generate:client",
|
|
34
|
+
"generate:client": "npx tsx scripts/generate-client.ts",
|
|
35
|
+
build: "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
36
|
+
dev: "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
37
|
+
lint: "eslint src",
|
|
38
|
+
typecheck: "tsc --noEmit",
|
|
39
|
+
test: "vitest run",
|
|
40
|
+
"test:watch": "vitest",
|
|
41
|
+
prepublishOnly: "npm run build",
|
|
42
|
+
"fetch-spec": "curl -o openapi.yaml https://zernio.com/openapi.yaml"
|
|
43
|
+
},
|
|
44
|
+
keywords: [
|
|
45
|
+
"zernio",
|
|
46
|
+
"social-media",
|
|
47
|
+
"scheduling",
|
|
48
|
+
"api",
|
|
49
|
+
"sdk",
|
|
50
|
+
"instagram",
|
|
51
|
+
"tiktok",
|
|
52
|
+
"youtube",
|
|
53
|
+
"linkedin",
|
|
54
|
+
"twitter",
|
|
55
|
+
"x",
|
|
56
|
+
"facebook",
|
|
57
|
+
"pinterest",
|
|
58
|
+
"threads",
|
|
59
|
+
"bluesky",
|
|
60
|
+
"snapchat",
|
|
61
|
+
"telegram"
|
|
62
|
+
],
|
|
63
|
+
author: "Zernio <support@zernio.com>",
|
|
64
|
+
license: "Apache-2.0",
|
|
65
|
+
repository: {
|
|
66
|
+
type: "git",
|
|
67
|
+
url: "git+https://github.com/zernio-dev/zernio-node.git"
|
|
68
|
+
},
|
|
69
|
+
homepage: "https://zernio.com/docs/api",
|
|
70
|
+
bugs: {
|
|
71
|
+
url: "https://github.com/zernio-dev/zernio-node/issues"
|
|
72
|
+
},
|
|
73
|
+
engines: {
|
|
74
|
+
node: ">=18"
|
|
75
|
+
},
|
|
76
|
+
devDependencies: {
|
|
77
|
+
"@hey-api/client-fetch": "^0.6.0",
|
|
78
|
+
"@hey-api/openapi-ts": "^0.61.0",
|
|
79
|
+
"@types/node": "^20.11.0",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
81
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
82
|
+
eslint: "^8.56.0",
|
|
83
|
+
tsup: "^8.0.1",
|
|
84
|
+
tsx: "^4.7.0",
|
|
85
|
+
typescript: "^5.3.3",
|
|
86
|
+
vitest: "^1.2.0",
|
|
87
|
+
yaml: "^2.3.4"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
5
91
|
// node_modules/@hey-api/client-fetch/dist/index.js
|
|
6
92
|
var U = /\{[^{}]+\}/g;
|
|
7
93
|
var S = ({ allowReserved: t, name: r, value: e }) => {
|
|
@@ -2746,15 +2832,14 @@ var Zernio = class {
|
|
|
2746
2832
|
this.baseURL = options.baseURL ?? "https://zernio.com/api";
|
|
2747
2833
|
this._options = options;
|
|
2748
2834
|
client.setConfig({
|
|
2749
|
-
baseUrl: this.baseURL
|
|
2835
|
+
baseUrl: this.baseURL,
|
|
2836
|
+
headers: {
|
|
2837
|
+
"User-Agent": `zernio-node/${package_default.version}`,
|
|
2838
|
+
...options.defaultHeaders ?? {}
|
|
2839
|
+
}
|
|
2750
2840
|
});
|
|
2751
2841
|
client.interceptors.request.use((request) => {
|
|
2752
2842
|
request.headers.set("Authorization", `Bearer ${this.apiKey}`);
|
|
2753
|
-
if (options.defaultHeaders) {
|
|
2754
|
-
for (const [key, value] of Object.entries(options.defaultHeaders)) {
|
|
2755
|
-
request.headers.set(key, value);
|
|
2756
|
-
}
|
|
2757
|
-
}
|
|
2758
2843
|
return request;
|
|
2759
2844
|
});
|
|
2760
2845
|
client.interceptors.response.use(async (response) => {
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import packageJson from '../package.json';
|
|
1
2
|
import {
|
|
2
3
|
client,
|
|
3
4
|
activateSequence,
|
|
@@ -965,19 +966,21 @@ export class Zernio {
|
|
|
965
966
|
this.baseURL = options.baseURL ?? 'https://zernio.com/api';
|
|
966
967
|
this._options = options;
|
|
967
968
|
|
|
968
|
-
// Configure the generated client
|
|
969
|
+
// Configure the generated client. User-Agent and defaultHeaders are
|
|
970
|
+
// applied at config time (not via the interceptor) because Node 20's
|
|
971
|
+
// undici treats User-Agent as a forbidden header on already-constructed
|
|
972
|
+
// Request objects, silently dropping `headers.set('User-Agent', …)`.
|
|
969
973
|
client.setConfig({
|
|
970
974
|
baseUrl: this.baseURL,
|
|
975
|
+
headers: {
|
|
976
|
+
'User-Agent': `zernio-node/${packageJson.version}`,
|
|
977
|
+
...(options.defaultHeaders ?? {}),
|
|
978
|
+
},
|
|
971
979
|
});
|
|
972
980
|
|
|
973
981
|
// Add auth interceptor
|
|
974
982
|
client.interceptors.request.use((request) => {
|
|
975
983
|
request.headers.set('Authorization', `Bearer ${this.apiKey}`);
|
|
976
|
-
if (options.defaultHeaders) {
|
|
977
|
-
for (const [key, value] of Object.entries(options.defaultHeaders)) {
|
|
978
|
-
request.headers.set(key, value);
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
984
|
return request;
|
|
982
985
|
});
|
|
983
986
|
|
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -1932,9 +1932,9 @@ export const listInboxConversations = <ThrowOnError extends boolean = false>(opt
|
|
|
1932
1932
|
* Create conversation
|
|
1933
1933
|
* Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread.
|
|
1934
1934
|
*
|
|
1935
|
-
*
|
|
1935
|
+
* Supported platforms: X/Twitter, Bluesky, Reddit, and WhatsApp. Other platforms return PLATFORM_NOT_SUPPORTED. For WhatsApp, a conversation can only be started with an approved template (provide templateName, templateLanguage, and any templateParams) — freeform initial messages are not permitted by WhatsApp; a missing template returns TEMPLATE_REQUIRED.
|
|
1936
1936
|
*
|
|
1937
|
-
* DM eligibility: Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility.
|
|
1937
|
+
* DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility.
|
|
1938
1938
|
*
|
|
1939
1939
|
* X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials.
|
|
1940
1940
|
*
|
|
@@ -10545,21 +10545,33 @@ export type CreateInboxConversationData = {
|
|
|
10545
10545
|
*/
|
|
10546
10546
|
accountId: string;
|
|
10547
10547
|
/**
|
|
10548
|
-
*
|
|
10548
|
+
* Recipient identifier. For X this is the numeric user ID; for WhatsApp, the recipient phone number in international format (digits, country code included). Provide either this or participantUsername.
|
|
10549
10549
|
*/
|
|
10550
10550
|
participantId?: string;
|
|
10551
10551
|
/**
|
|
10552
|
-
*
|
|
10552
|
+
* Recipient handle/username — an X or Bluesky handle (with or without @) or a Reddit username (with or without u/). Resolved via lookup. Provide either this or participantId.
|
|
10553
10553
|
*/
|
|
10554
10554
|
participantUsername?: string;
|
|
10555
10555
|
/**
|
|
10556
|
-
* Text content of the message. At least one of message or
|
|
10556
|
+
* Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required.
|
|
10557
10557
|
*/
|
|
10558
10558
|
message?: string;
|
|
10559
10559
|
/**
|
|
10560
|
-
* Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
|
|
10560
|
+
* X/Twitter only. Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
|
|
10561
10561
|
*/
|
|
10562
10562
|
skipDmCheck?: boolean;
|
|
10563
|
+
/**
|
|
10564
|
+
* WhatsApp only. Name of the approved template to start the conversation with (required for WhatsApp).
|
|
10565
|
+
*/
|
|
10566
|
+
templateName?: string;
|
|
10567
|
+
/**
|
|
10568
|
+
* WhatsApp only. Template language code (e.g. en_US).
|
|
10569
|
+
*/
|
|
10570
|
+
templateLanguage?: string;
|
|
10571
|
+
/**
|
|
10572
|
+
* WhatsApp only. Body variable values, in order, substituted into the template body ({{1}}, {{2}}, ...).
|
|
10573
|
+
*/
|
|
10574
|
+
templateParams?: Array<(string)>;
|
|
10563
10575
|
};
|
|
10564
10576
|
};
|
|
10565
10577
|
|
|
@@ -10829,6 +10841,17 @@ export type GetInboxConversationMessagesResponse = ({
|
|
|
10829
10841
|
title?: string;
|
|
10830
10842
|
message?: string;
|
|
10831
10843
|
} | null;
|
|
10844
|
+
/**
|
|
10845
|
+
* Emoji reactions on this message (WhatsApp / Telegram). At most one per party in a 1:1 thread.
|
|
10846
|
+
*/
|
|
10847
|
+
reactions?: Array<{
|
|
10848
|
+
emoji?: string;
|
|
10849
|
+
/**
|
|
10850
|
+
* true if the connected account reacted
|
|
10851
|
+
*/
|
|
10852
|
+
fromMe?: boolean;
|
|
10853
|
+
reactedAt?: string;
|
|
10854
|
+
}>;
|
|
10832
10855
|
}>;
|
|
10833
10856
|
lastUpdated?: string;
|
|
10834
10857
|
});
|
|
@@ -11105,6 +11128,51 @@ export type SendInboxMessageData = {
|
|
|
11105
11128
|
* Platform message ID to quote-reply to. For WhatsApp, pass the wamid (available in message.platformMessageId from webhooks). For Telegram, pass the Telegram message ID.
|
|
11106
11129
|
*/
|
|
11107
11130
|
replyTo?: string;
|
|
11131
|
+
/**
|
|
11132
|
+
* WhatsApp-only. Send a location pin.
|
|
11133
|
+
*/
|
|
11134
|
+
location?: {
|
|
11135
|
+
/**
|
|
11136
|
+
* Latitude in decimal degrees.
|
|
11137
|
+
*/
|
|
11138
|
+
latitude: number;
|
|
11139
|
+
/**
|
|
11140
|
+
* Longitude in decimal degrees.
|
|
11141
|
+
*/
|
|
11142
|
+
longitude: number;
|
|
11143
|
+
/**
|
|
11144
|
+
* Optional location name.
|
|
11145
|
+
*/
|
|
11146
|
+
name?: string;
|
|
11147
|
+
/**
|
|
11148
|
+
* Optional street address.
|
|
11149
|
+
*/
|
|
11150
|
+
address?: string;
|
|
11151
|
+
};
|
|
11152
|
+
/**
|
|
11153
|
+
* WhatsApp-only. Send one or more contact cards.
|
|
11154
|
+
*/
|
|
11155
|
+
contacts?: Array<{
|
|
11156
|
+
name: {
|
|
11157
|
+
/**
|
|
11158
|
+
* Full display name.
|
|
11159
|
+
*/
|
|
11160
|
+
formatted_name: string;
|
|
11161
|
+
first_name?: string;
|
|
11162
|
+
last_name?: string;
|
|
11163
|
+
};
|
|
11164
|
+
phones?: Array<{
|
|
11165
|
+
phone?: string;
|
|
11166
|
+
/**
|
|
11167
|
+
* e.g. CELL, WORK, HOME.
|
|
11168
|
+
*/
|
|
11169
|
+
type?: string;
|
|
11170
|
+
}>;
|
|
11171
|
+
emails?: Array<{
|
|
11172
|
+
email?: string;
|
|
11173
|
+
type?: string;
|
|
11174
|
+
}>;
|
|
11175
|
+
}>;
|
|
11108
11176
|
};
|
|
11109
11177
|
path: {
|
|
11110
11178
|
/**
|