@linqapp/sdk 0.1.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +31 -0
- package/client.d.mts +299 -7
- package/client.d.mts.map +1 -1
- package/client.d.ts +299 -7
- package/client.d.ts.map +1 -1
- package/client.js +294 -12
- package/client.js.map +1 -1
- package/client.mjs +294 -12
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +69 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +69 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +125 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +118 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/tslib.js +18 -18
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/attachments.d.mts +64 -0
- package/resources/attachments.d.mts.map +1 -1
- package/resources/attachments.d.ts +64 -0
- package/resources/attachments.d.ts.map +1 -1
- package/resources/attachments.js +64 -0
- package/resources/attachments.js.map +1 -1
- package/resources/attachments.mjs +64 -0
- package/resources/attachments.mjs.map +1 -1
- package/resources/capability.d.mts +12 -9
- package/resources/capability.d.mts.map +1 -1
- package/resources/capability.d.ts +12 -9
- package/resources/capability.d.ts.map +1 -1
- package/resources/capability.js +7 -4
- package/resources/capability.js.map +1 -1
- package/resources/capability.mjs +7 -4
- package/resources/capability.mjs.map +1 -1
- package/resources/chats/chats.d.mts +76 -97
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +76 -97
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +8 -4
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +9 -5
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/index.d.mts +2 -2
- package/resources/chats/index.d.mts.map +1 -1
- package/resources/chats/index.d.ts +2 -2
- package/resources/chats/index.d.ts.map +1 -1
- package/resources/chats/index.js.map +1 -1
- package/resources/chats/index.mjs.map +1 -1
- package/resources/chats/messages.d.mts +21 -25
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +21 -25
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +16 -3
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +16 -3
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/chats/participants.d.mts +18 -0
- package/resources/chats/participants.d.mts.map +1 -1
- package/resources/chats/participants.d.ts +18 -0
- package/resources/chats/participants.d.ts.map +1 -1
- package/resources/chats/participants.js +18 -0
- package/resources/chats/participants.js.map +1 -1
- package/resources/chats/participants.mjs +18 -0
- package/resources/chats/participants.mjs.map +1 -1
- package/resources/chats/typing.d.mts +18 -0
- package/resources/chats/typing.d.mts.map +1 -1
- package/resources/chats/typing.d.ts +18 -0
- package/resources/chats/typing.d.ts.map +1 -1
- package/resources/chats/typing.js +18 -0
- package/resources/chats/typing.js.map +1 -1
- package/resources/chats/typing.mjs +18 -0
- package/resources/chats/typing.mjs.map +1 -1
- package/resources/index.d.mts +4 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +37 -72
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +37 -72
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +34 -4
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +34 -4
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +9 -0
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +9 -0
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +9 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +9 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/phonenumbers.d.mts +9 -0
- package/resources/phonenumbers.d.mts.map +1 -1
- package/resources/phonenumbers.d.ts +9 -0
- package/resources/phonenumbers.d.ts.map +1 -1
- package/resources/phonenumbers.js +9 -0
- package/resources/phonenumbers.js.map +1 -1
- package/resources/phonenumbers.mjs +9 -0
- package/resources/phonenumbers.mjs.map +1 -1
- package/resources/shared.d.mts +51 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +51 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/webhook-events.d.mts +90 -1
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +90 -1
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhook-events.js +89 -0
- package/resources/webhook-events.js.map +1 -1
- package/resources/webhook-events.mjs +89 -0
- package/resources/webhook-events.mjs.map +1 -1
- package/resources/webhook-subscriptions.d.mts +89 -0
- package/resources/webhook-subscriptions.d.mts.map +1 -1
- package/resources/webhook-subscriptions.d.ts +89 -0
- package/resources/webhook-subscriptions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.js +89 -0
- package/resources/webhook-subscriptions.js.map +1 -1
- package/resources/webhook-subscriptions.mjs +89 -0
- package/resources/webhook-subscriptions.mjs.map +1 -1
- package/resources/webhooks.d.mts +2506 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +2506 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +12 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +8 -0
- package/resources/webhooks.mjs.map +1 -0
- package/src/client.ts +443 -37
- package/src/core/pagination.ts +212 -0
- package/src/index.ts +1 -0
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/attachments.ts +64 -0
- package/src/resources/capability.ts +17 -14
- package/src/resources/chats/chats.ts +86 -115
- package/src/resources/chats/index.ts +4 -3
- package/src/resources/chats/messages.ts +30 -30
- package/src/resources/chats/participants.ts +18 -0
- package/src/resources/chats/typing.ts +18 -0
- package/src/resources/index.ts +55 -10
- package/src/resources/messages.ts +49 -90
- package/src/resources/phone-numbers.ts +9 -0
- package/src/resources/phonenumbers.ts +9 -0
- package/src/resources/shared.ts +62 -0
- package/src/resources/webhook-events.ts +90 -0
- package/src/resources/webhook-subscriptions.ts +89 -0
- package/src/resources/webhooks.ts +3089 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Phone Numbers represent the phone numbers assigned to your partner account.
|
|
6
|
+
*
|
|
7
|
+
* Use the list phone numbers endpoint to discover which phone numbers are available
|
|
8
|
+
* for sending messages.
|
|
9
|
+
*
|
|
10
|
+
* When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
|
|
11
|
+
* in the `from` field.
|
|
12
|
+
*/
|
|
4
13
|
export declare class PhoneNumbers extends APIResource {
|
|
5
14
|
/**
|
|
6
15
|
* Returns all phone numbers assigned to the authenticated partner. Use this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
|
|
1
|
+
{"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
|
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.PhoneNumbers = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* Phone Numbers represent the phone numbers assigned to your partner account.
|
|
8
|
+
*
|
|
9
|
+
* Use the list phone numbers endpoint to discover which phone numbers are available
|
|
10
|
+
* for sending messages.
|
|
11
|
+
*
|
|
12
|
+
* When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
|
|
13
|
+
* in the `from` field.
|
|
14
|
+
*/
|
|
6
15
|
class PhoneNumbers extends resource_1.APIResource {
|
|
7
16
|
/**
|
|
8
17
|
* Returns all phone numbers assigned to the authenticated partner. Use this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AATD,oCASC"}
|
|
1
|
+
{"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AATD,oCASC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Phone Numbers represent the phone numbers assigned to your partner account.
|
|
5
|
+
*
|
|
6
|
+
* Use the list phone numbers endpoint to discover which phone numbers are available
|
|
7
|
+
* for sending messages.
|
|
8
|
+
*
|
|
9
|
+
* When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
|
|
10
|
+
* in the `from` field.
|
|
11
|
+
*/
|
|
3
12
|
export class PhoneNumbers extends APIResource {
|
|
4
13
|
/**
|
|
5
14
|
* Returns all phone numbers assigned to the authenticated partner. Use this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Phone Numbers represent the phone numbers assigned to your partner account.
|
|
6
|
+
*
|
|
7
|
+
* Use the list phone numbers endpoint to discover which phone numbers are available
|
|
8
|
+
* for sending messages.
|
|
9
|
+
*
|
|
10
|
+
* When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
|
|
11
|
+
* in the `from` field.
|
|
12
|
+
*/
|
|
4
13
|
export declare class Phonenumbers extends APIResource {
|
|
5
14
|
/**
|
|
6
15
|
* **Deprecated.** Use `GET /v3/phone_numbers` instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phonenumbers.d.mts","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;KAC9B;IAED,UAAiB,WAAW,CAAC;QAC3B,UAAiB,YAAY;YAC3B;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,KAAK,EAAE,OAAO,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
|
|
1
|
+
{"version":3,"file":"phonenumbers.d.mts","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;KAC9B;IAED,UAAiB,WAAW,CAAC;QAC3B,UAAiB,YAAY;YAC3B;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,KAAK,EAAE,OAAO,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Phone Numbers represent the phone numbers assigned to your partner account.
|
|
6
|
+
*
|
|
7
|
+
* Use the list phone numbers endpoint to discover which phone numbers are available
|
|
8
|
+
* for sending messages.
|
|
9
|
+
*
|
|
10
|
+
* When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
|
|
11
|
+
* in the `from` field.
|
|
12
|
+
*/
|
|
4
13
|
export declare class Phonenumbers extends APIResource {
|
|
5
14
|
/**
|
|
6
15
|
* **Deprecated.** Use `GET /v3/phone_numbers` instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phonenumbers.d.ts","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;KAC9B;IAED,UAAiB,WAAW,CAAC;QAC3B,UAAiB,YAAY;YAC3B;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,KAAK,EAAE,OAAO,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
|
|
1
|
+
{"version":3,"file":"phonenumbers.d.ts","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;KAC9B;IAED,UAAiB,WAAW,CAAC;QAC3B,UAAiB,YAAY;YAC3B;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,KAAK,EAAE,OAAO,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
|
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Phonenumbers = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* Phone Numbers represent the phone numbers assigned to your partner account.
|
|
8
|
+
*
|
|
9
|
+
* Use the list phone numbers endpoint to discover which phone numbers are available
|
|
10
|
+
* for sending messages.
|
|
11
|
+
*
|
|
12
|
+
* When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
|
|
13
|
+
* in the `from` field.
|
|
14
|
+
*/
|
|
6
15
|
class Phonenumbers extends resource_1.APIResource {
|
|
7
16
|
/**
|
|
8
17
|
* **Deprecated.** Use `GET /v3/phone_numbers` instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phonenumbers.js","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF;AATD,oCASC"}
|
|
1
|
+
{"version":3,"file":"phonenumbers.js","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF;AATD,oCASC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Phone Numbers represent the phone numbers assigned to your partner account.
|
|
5
|
+
*
|
|
6
|
+
* Use the list phone numbers endpoint to discover which phone numbers are available
|
|
7
|
+
* for sending messages.
|
|
8
|
+
*
|
|
9
|
+
* When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
|
|
10
|
+
* in the `from` field.
|
|
11
|
+
*/
|
|
3
12
|
export class Phonenumbers extends APIResource {
|
|
4
13
|
/**
|
|
5
14
|
* **Deprecated.** Use `GET /v3/phone_numbers` instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phonenumbers.mjs","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"phonenumbers.mjs","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF"}
|
package/resources/shared.d.mts
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
|
+
import * as MessagesAPI from "./messages.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* A media attachment part
|
|
4
|
+
*/
|
|
5
|
+
export interface MediaPartResponse {
|
|
6
|
+
/**
|
|
7
|
+
* Unique attachment identifier
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Original filename
|
|
12
|
+
*/
|
|
13
|
+
filename: string;
|
|
14
|
+
/**
|
|
15
|
+
* MIME type of the file
|
|
16
|
+
*/
|
|
17
|
+
mime_type: string;
|
|
18
|
+
/**
|
|
19
|
+
* Reactions on this message part
|
|
20
|
+
*/
|
|
21
|
+
reactions: Array<MessagesAPI.Reaction> | null;
|
|
22
|
+
/**
|
|
23
|
+
* File size in bytes
|
|
24
|
+
*/
|
|
25
|
+
size_bytes: number;
|
|
26
|
+
/**
|
|
27
|
+
* Indicates this is a media attachment part
|
|
28
|
+
*/
|
|
29
|
+
type: 'media';
|
|
30
|
+
/**
|
|
31
|
+
* Presigned URL for downloading the attachment (expires in 1 hour).
|
|
32
|
+
*/
|
|
33
|
+
url: string;
|
|
34
|
+
}
|
|
1
35
|
/**
|
|
2
36
|
* Messaging service type
|
|
3
37
|
*/
|
|
4
38
|
export type ServiceType = 'iMessage' | 'SMS' | 'RCS';
|
|
39
|
+
/**
|
|
40
|
+
* A text message part
|
|
41
|
+
*/
|
|
42
|
+
export interface TextPartResponse {
|
|
43
|
+
/**
|
|
44
|
+
* Reactions on this message part
|
|
45
|
+
*/
|
|
46
|
+
reactions: Array<MessagesAPI.Reaction> | null;
|
|
47
|
+
/**
|
|
48
|
+
* Indicates this is a text message part
|
|
49
|
+
*/
|
|
50
|
+
type: 'text';
|
|
51
|
+
/**
|
|
52
|
+
* The text content
|
|
53
|
+
*/
|
|
54
|
+
value: string;
|
|
55
|
+
}
|
|
5
56
|
//# sourceMappingURL=shared.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"OAEO,KAAK,WAAW;AAEvB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/resources/shared.d.ts
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
|
+
import * as MessagesAPI from "./messages.js";
|
|
2
|
+
/**
|
|
3
|
+
* A media attachment part
|
|
4
|
+
*/
|
|
5
|
+
export interface MediaPartResponse {
|
|
6
|
+
/**
|
|
7
|
+
* Unique attachment identifier
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Original filename
|
|
12
|
+
*/
|
|
13
|
+
filename: string;
|
|
14
|
+
/**
|
|
15
|
+
* MIME type of the file
|
|
16
|
+
*/
|
|
17
|
+
mime_type: string;
|
|
18
|
+
/**
|
|
19
|
+
* Reactions on this message part
|
|
20
|
+
*/
|
|
21
|
+
reactions: Array<MessagesAPI.Reaction> | null;
|
|
22
|
+
/**
|
|
23
|
+
* File size in bytes
|
|
24
|
+
*/
|
|
25
|
+
size_bytes: number;
|
|
26
|
+
/**
|
|
27
|
+
* Indicates this is a media attachment part
|
|
28
|
+
*/
|
|
29
|
+
type: 'media';
|
|
30
|
+
/**
|
|
31
|
+
* Presigned URL for downloading the attachment (expires in 1 hour).
|
|
32
|
+
*/
|
|
33
|
+
url: string;
|
|
34
|
+
}
|
|
1
35
|
/**
|
|
2
36
|
* Messaging service type
|
|
3
37
|
*/
|
|
4
38
|
export type ServiceType = 'iMessage' | 'SMS' | 'RCS';
|
|
39
|
+
/**
|
|
40
|
+
* A text message part
|
|
41
|
+
*/
|
|
42
|
+
export interface TextPartResponse {
|
|
43
|
+
/**
|
|
44
|
+
* Reactions on this message part
|
|
45
|
+
*/
|
|
46
|
+
reactions: Array<MessagesAPI.Reaction> | null;
|
|
47
|
+
/**
|
|
48
|
+
* Indicates this is a text message part
|
|
49
|
+
*/
|
|
50
|
+
type: 'text';
|
|
51
|
+
/**
|
|
52
|
+
* The text content
|
|
53
|
+
*/
|
|
54
|
+
value: string;
|
|
55
|
+
}
|
|
5
56
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"OAEO,KAAK,WAAW;AAEvB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1,6 +1,95 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Webhook Subscriptions allow you to receive real-time notifications when events
|
|
6
|
+
* occur on your account.
|
|
7
|
+
*
|
|
8
|
+
* Configure webhook endpoints to receive events such as messages sent/received,
|
|
9
|
+
* delivery status changes, reactions, typing indicators, and more.
|
|
10
|
+
*
|
|
11
|
+
* Failed deliveries (5xx, 429, network errors) are retried up to 10 times over
|
|
12
|
+
* ~2 hours with exponential backoff. Each event includes a unique ID for
|
|
13
|
+
* deduplication.
|
|
14
|
+
*
|
|
15
|
+
* ## Webhook Headers
|
|
16
|
+
*
|
|
17
|
+
* Each webhook request includes the following headers:
|
|
18
|
+
*
|
|
19
|
+
* | Header | Description |
|
|
20
|
+
* |--------|-------------|
|
|
21
|
+
* | `X-Webhook-Event` | The event type (e.g., `message.sent`, `message.received`) |
|
|
22
|
+
* | `X-Webhook-Subscription-ID` | Your webhook subscription ID |
|
|
23
|
+
* | `X-Webhook-Timestamp` | Unix timestamp (seconds) when the webhook was sent |
|
|
24
|
+
* | `X-Webhook-Signature` | HMAC-SHA256 signature for verification |
|
|
25
|
+
*
|
|
26
|
+
* ## Verifying Webhook Signatures
|
|
27
|
+
*
|
|
28
|
+
* All webhooks are signed using HMAC-SHA256. You should always verify the signature
|
|
29
|
+
* to ensure the webhook originated from Linq and hasn't been tampered with.
|
|
30
|
+
*
|
|
31
|
+
* **Signature Construction:**
|
|
32
|
+
*
|
|
33
|
+
* The signature is computed over a concatenation of the timestamp and payload:
|
|
34
|
+
*
|
|
35
|
+
* ```
|
|
36
|
+
* {timestamp}.{payload}
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* Where:
|
|
40
|
+
* - `timestamp` is the value from the `X-Webhook-Timestamp` header
|
|
41
|
+
* - `payload` is the raw JSON request body (exact bytes, not re-serialized)
|
|
42
|
+
*
|
|
43
|
+
* **Verification Steps:**
|
|
44
|
+
*
|
|
45
|
+
* 1. Extract the `X-Webhook-Timestamp` and `X-Webhook-Signature` headers
|
|
46
|
+
* 2. Get the raw request body bytes (do not parse and re-serialize)
|
|
47
|
+
* 3. Concatenate: `"{timestamp}.{payload}"`
|
|
48
|
+
* 4. Compute HMAC-SHA256 using your signing secret as the key
|
|
49
|
+
* 5. Hex-encode the result and compare with `X-Webhook-Signature`
|
|
50
|
+
* 6. Use constant-time comparison to prevent timing attacks
|
|
51
|
+
*
|
|
52
|
+
* **Example (Python):**
|
|
53
|
+
*
|
|
54
|
+
* ```python
|
|
55
|
+
* import hmac
|
|
56
|
+
* import hashlib
|
|
57
|
+
*
|
|
58
|
+
* def verify_webhook(signing_secret, payload, timestamp, signature):
|
|
59
|
+
* message = f"{timestamp}.{payload.decode('utf-8')}"
|
|
60
|
+
* expected = hmac.new(
|
|
61
|
+
* signing_secret.encode('utf-8'),
|
|
62
|
+
* message.encode('utf-8'),
|
|
63
|
+
* hashlib.sha256
|
|
64
|
+
* ).hexdigest()
|
|
65
|
+
* return hmac.compare_digest(expected, signature)
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* **Example (Node.js):**
|
|
69
|
+
*
|
|
70
|
+
* ```javascript
|
|
71
|
+
* const crypto = require('crypto');
|
|
72
|
+
*
|
|
73
|
+
* function verifyWebhook(signingSecret, payload, timestamp, signature) {
|
|
74
|
+
* const message = `${timestamp}.${payload}`;
|
|
75
|
+
* const expected = crypto
|
|
76
|
+
* .createHmac('sha256', signingSecret)
|
|
77
|
+
* .update(message)
|
|
78
|
+
* .digest('hex');
|
|
79
|
+
* return crypto.timingSafeEqual(
|
|
80
|
+
* Buffer.from(expected),
|
|
81
|
+
* Buffer.from(signature)
|
|
82
|
+
* );
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* **Security Best Practices:**
|
|
87
|
+
*
|
|
88
|
+
* - Reject webhooks with timestamps older than 5 minutes to prevent replay attacks
|
|
89
|
+
* - Always use constant-time comparison for signature verification
|
|
90
|
+
* - Store your signing secret securely (e.g., environment variable, secrets manager)
|
|
91
|
+
* - Return a 2xx status code quickly, then process the webhook asynchronously
|
|
92
|
+
*/
|
|
4
93
|
export declare class WebhookEvents extends APIResource {
|
|
5
94
|
/**
|
|
6
95
|
* Returns all available webhook event types that can be subscribed to. Use this
|
|
@@ -12,7 +101,7 @@ export declare class WebhookEvents extends APIResource {
|
|
|
12
101
|
/**
|
|
13
102
|
* Valid webhook event types that can be subscribed to
|
|
14
103
|
*/
|
|
15
|
-
export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated';
|
|
104
|
+
export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated';
|
|
16
105
|
export interface WebhookEventListResponse {
|
|
17
106
|
/**
|
|
18
107
|
* URL to the webhook events documentation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-events.d.mts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
1
|
+
{"version":3,"file":"webhook-events.d.mts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -1,6 +1,95 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Webhook Subscriptions allow you to receive real-time notifications when events
|
|
6
|
+
* occur on your account.
|
|
7
|
+
*
|
|
8
|
+
* Configure webhook endpoints to receive events such as messages sent/received,
|
|
9
|
+
* delivery status changes, reactions, typing indicators, and more.
|
|
10
|
+
*
|
|
11
|
+
* Failed deliveries (5xx, 429, network errors) are retried up to 10 times over
|
|
12
|
+
* ~2 hours with exponential backoff. Each event includes a unique ID for
|
|
13
|
+
* deduplication.
|
|
14
|
+
*
|
|
15
|
+
* ## Webhook Headers
|
|
16
|
+
*
|
|
17
|
+
* Each webhook request includes the following headers:
|
|
18
|
+
*
|
|
19
|
+
* | Header | Description |
|
|
20
|
+
* |--------|-------------|
|
|
21
|
+
* | `X-Webhook-Event` | The event type (e.g., `message.sent`, `message.received`) |
|
|
22
|
+
* | `X-Webhook-Subscription-ID` | Your webhook subscription ID |
|
|
23
|
+
* | `X-Webhook-Timestamp` | Unix timestamp (seconds) when the webhook was sent |
|
|
24
|
+
* | `X-Webhook-Signature` | HMAC-SHA256 signature for verification |
|
|
25
|
+
*
|
|
26
|
+
* ## Verifying Webhook Signatures
|
|
27
|
+
*
|
|
28
|
+
* All webhooks are signed using HMAC-SHA256. You should always verify the signature
|
|
29
|
+
* to ensure the webhook originated from Linq and hasn't been tampered with.
|
|
30
|
+
*
|
|
31
|
+
* **Signature Construction:**
|
|
32
|
+
*
|
|
33
|
+
* The signature is computed over a concatenation of the timestamp and payload:
|
|
34
|
+
*
|
|
35
|
+
* ```
|
|
36
|
+
* {timestamp}.{payload}
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* Where:
|
|
40
|
+
* - `timestamp` is the value from the `X-Webhook-Timestamp` header
|
|
41
|
+
* - `payload` is the raw JSON request body (exact bytes, not re-serialized)
|
|
42
|
+
*
|
|
43
|
+
* **Verification Steps:**
|
|
44
|
+
*
|
|
45
|
+
* 1. Extract the `X-Webhook-Timestamp` and `X-Webhook-Signature` headers
|
|
46
|
+
* 2. Get the raw request body bytes (do not parse and re-serialize)
|
|
47
|
+
* 3. Concatenate: `"{timestamp}.{payload}"`
|
|
48
|
+
* 4. Compute HMAC-SHA256 using your signing secret as the key
|
|
49
|
+
* 5. Hex-encode the result and compare with `X-Webhook-Signature`
|
|
50
|
+
* 6. Use constant-time comparison to prevent timing attacks
|
|
51
|
+
*
|
|
52
|
+
* **Example (Python):**
|
|
53
|
+
*
|
|
54
|
+
* ```python
|
|
55
|
+
* import hmac
|
|
56
|
+
* import hashlib
|
|
57
|
+
*
|
|
58
|
+
* def verify_webhook(signing_secret, payload, timestamp, signature):
|
|
59
|
+
* message = f"{timestamp}.{payload.decode('utf-8')}"
|
|
60
|
+
* expected = hmac.new(
|
|
61
|
+
* signing_secret.encode('utf-8'),
|
|
62
|
+
* message.encode('utf-8'),
|
|
63
|
+
* hashlib.sha256
|
|
64
|
+
* ).hexdigest()
|
|
65
|
+
* return hmac.compare_digest(expected, signature)
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* **Example (Node.js):**
|
|
69
|
+
*
|
|
70
|
+
* ```javascript
|
|
71
|
+
* const crypto = require('crypto');
|
|
72
|
+
*
|
|
73
|
+
* function verifyWebhook(signingSecret, payload, timestamp, signature) {
|
|
74
|
+
* const message = `${timestamp}.${payload}`;
|
|
75
|
+
* const expected = crypto
|
|
76
|
+
* .createHmac('sha256', signingSecret)
|
|
77
|
+
* .update(message)
|
|
78
|
+
* .digest('hex');
|
|
79
|
+
* return crypto.timingSafeEqual(
|
|
80
|
+
* Buffer.from(expected),
|
|
81
|
+
* Buffer.from(signature)
|
|
82
|
+
* );
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* **Security Best Practices:**
|
|
87
|
+
*
|
|
88
|
+
* - Reject webhooks with timestamps older than 5 minutes to prevent replay attacks
|
|
89
|
+
* - Always use constant-time comparison for signature verification
|
|
90
|
+
* - Store your signing secret securely (e.g., environment variable, secrets manager)
|
|
91
|
+
* - Return a 2xx status code quickly, then process the webhook asynchronously
|
|
92
|
+
*/
|
|
4
93
|
export declare class WebhookEvents extends APIResource {
|
|
5
94
|
/**
|
|
6
95
|
* Returns all available webhook event types that can be subscribed to. Use this
|
|
@@ -12,7 +101,7 @@ export declare class WebhookEvents extends APIResource {
|
|
|
12
101
|
/**
|
|
13
102
|
* Valid webhook event types that can be subscribed to
|
|
14
103
|
*/
|
|
15
|
-
export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated';
|
|
104
|
+
export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated';
|
|
16
105
|
export interface WebhookEventListResponse {
|
|
17
106
|
/**
|
|
18
107
|
* URL to the webhook events documentation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-events.d.ts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
1
|
+
{"version":3,"file":"webhook-events.d.ts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -3,6 +3,95 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.WebhookEvents = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* Webhook Subscriptions allow you to receive real-time notifications when events
|
|
8
|
+
* occur on your account.
|
|
9
|
+
*
|
|
10
|
+
* Configure webhook endpoints to receive events such as messages sent/received,
|
|
11
|
+
* delivery status changes, reactions, typing indicators, and more.
|
|
12
|
+
*
|
|
13
|
+
* Failed deliveries (5xx, 429, network errors) are retried up to 10 times over
|
|
14
|
+
* ~2 hours with exponential backoff. Each event includes a unique ID for
|
|
15
|
+
* deduplication.
|
|
16
|
+
*
|
|
17
|
+
* ## Webhook Headers
|
|
18
|
+
*
|
|
19
|
+
* Each webhook request includes the following headers:
|
|
20
|
+
*
|
|
21
|
+
* | Header | Description |
|
|
22
|
+
* |--------|-------------|
|
|
23
|
+
* | `X-Webhook-Event` | The event type (e.g., `message.sent`, `message.received`) |
|
|
24
|
+
* | `X-Webhook-Subscription-ID` | Your webhook subscription ID |
|
|
25
|
+
* | `X-Webhook-Timestamp` | Unix timestamp (seconds) when the webhook was sent |
|
|
26
|
+
* | `X-Webhook-Signature` | HMAC-SHA256 signature for verification |
|
|
27
|
+
*
|
|
28
|
+
* ## Verifying Webhook Signatures
|
|
29
|
+
*
|
|
30
|
+
* All webhooks are signed using HMAC-SHA256. You should always verify the signature
|
|
31
|
+
* to ensure the webhook originated from Linq and hasn't been tampered with.
|
|
32
|
+
*
|
|
33
|
+
* **Signature Construction:**
|
|
34
|
+
*
|
|
35
|
+
* The signature is computed over a concatenation of the timestamp and payload:
|
|
36
|
+
*
|
|
37
|
+
* ```
|
|
38
|
+
* {timestamp}.{payload}
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* Where:
|
|
42
|
+
* - `timestamp` is the value from the `X-Webhook-Timestamp` header
|
|
43
|
+
* - `payload` is the raw JSON request body (exact bytes, not re-serialized)
|
|
44
|
+
*
|
|
45
|
+
* **Verification Steps:**
|
|
46
|
+
*
|
|
47
|
+
* 1. Extract the `X-Webhook-Timestamp` and `X-Webhook-Signature` headers
|
|
48
|
+
* 2. Get the raw request body bytes (do not parse and re-serialize)
|
|
49
|
+
* 3. Concatenate: `"{timestamp}.{payload}"`
|
|
50
|
+
* 4. Compute HMAC-SHA256 using your signing secret as the key
|
|
51
|
+
* 5. Hex-encode the result and compare with `X-Webhook-Signature`
|
|
52
|
+
* 6. Use constant-time comparison to prevent timing attacks
|
|
53
|
+
*
|
|
54
|
+
* **Example (Python):**
|
|
55
|
+
*
|
|
56
|
+
* ```python
|
|
57
|
+
* import hmac
|
|
58
|
+
* import hashlib
|
|
59
|
+
*
|
|
60
|
+
* def verify_webhook(signing_secret, payload, timestamp, signature):
|
|
61
|
+
* message = f"{timestamp}.{payload.decode('utf-8')}"
|
|
62
|
+
* expected = hmac.new(
|
|
63
|
+
* signing_secret.encode('utf-8'),
|
|
64
|
+
* message.encode('utf-8'),
|
|
65
|
+
* hashlib.sha256
|
|
66
|
+
* ).hexdigest()
|
|
67
|
+
* return hmac.compare_digest(expected, signature)
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* **Example (Node.js):**
|
|
71
|
+
*
|
|
72
|
+
* ```javascript
|
|
73
|
+
* const crypto = require('crypto');
|
|
74
|
+
*
|
|
75
|
+
* function verifyWebhook(signingSecret, payload, timestamp, signature) {
|
|
76
|
+
* const message = `${timestamp}.${payload}`;
|
|
77
|
+
* const expected = crypto
|
|
78
|
+
* .createHmac('sha256', signingSecret)
|
|
79
|
+
* .update(message)
|
|
80
|
+
* .digest('hex');
|
|
81
|
+
* return crypto.timingSafeEqual(
|
|
82
|
+
* Buffer.from(expected),
|
|
83
|
+
* Buffer.from(signature)
|
|
84
|
+
* );
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* **Security Best Practices:**
|
|
89
|
+
*
|
|
90
|
+
* - Reject webhooks with timestamps older than 5 minutes to prevent replay attacks
|
|
91
|
+
* - Always use constant-time comparison for signature verification
|
|
92
|
+
* - Store your signing secret securely (e.g., environment variable, secrets manager)
|
|
93
|
+
* - Return a 2xx status code quickly, then process the webhook asynchronously
|
|
94
|
+
*/
|
|
6
95
|
class WebhookEvents extends resource_1.APIResource {
|
|
7
96
|
/**
|
|
8
97
|
* Returns all available webhook event types that can be subscribed to. Use this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-events.js","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AATD,sCASC"}
|
|
1
|
+
{"version":3,"file":"webhook-events.js","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AATD,sCASC"}
|