@linqapp/sdk 0.1.0 → 0.1.3
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/LICENSE +198 -4
- package/README.md +52 -52
- package/client.d.mts +34 -22
- package/client.d.mts.map +1 -1
- package/client.d.ts +34 -22
- package/client.d.ts.map +1 -1
- package/client.js +50 -41
- package/client.js.map +1 -1
- package/client.mjs +49 -40
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +2 -2
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +2 -2
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +2 -2
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +2 -2
- package/core/error.d.ts.map +1 -1
- package/core/error.js +4 -4
- package/core/error.js.map +1 -1
- package/core/error.mjs +2 -2
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts +3 -3
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +3 -3
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts +3 -3
- package/index.d.mts.map +1 -1
- package/index.d.ts +3 -3
- package/index.d.ts.map +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/index.mjs +3 -3
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts +2 -2
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +2 -2
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/shims.js +1 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/uploads.d.mts +4 -4
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +4 -4
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.js +2 -2
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +3 -3
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts +3 -3
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +3 -3
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.js +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +2 -2
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +6 -6
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +4 -4
- package/resources/attachments.d.mts +28 -3
- package/resources/attachments.d.mts.map +1 -1
- package/resources/attachments.d.ts +28 -3
- package/resources/attachments.d.ts.map +1 -1
- package/resources/capability.d.mts +74 -0
- package/resources/capability.d.mts.map +1 -0
- package/resources/capability.d.ts +74 -0
- package/resources/capability.d.ts.map +1 -0
- package/resources/capability.js +36 -0
- package/resources/capability.js.map +1 -0
- package/resources/capability.mjs +32 -0
- package/resources/capability.mjs.map +1 -0
- package/resources/chats/chats.d.mts +133 -663
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +133 -663
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +2 -2
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +2 -2
- 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 +55 -716
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +55 -716
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/index.d.mts +8 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -2
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +129 -553
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +129 -553
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +1 -50
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +1 -50
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +0 -8
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +0 -8
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/phonenumbers.d.mts +58 -0
- package/resources/phonenumbers.d.mts.map +1 -0
- package/resources/phonenumbers.d.ts +58 -0
- package/resources/phonenumbers.d.ts.map +1 -0
- package/resources/phonenumbers.js +17 -0
- package/resources/phonenumbers.js.map +1 -0
- package/resources/phonenumbers.mjs +13 -0
- package/resources/phonenumbers.mjs.map +1 -0
- package/resources/webhook-events.d.mts +29 -0
- package/resources/webhook-events.d.mts.map +1 -0
- package/resources/webhook-events.d.ts +29 -0
- package/resources/webhook-events.d.ts.map +1 -0
- package/resources/{webhooks/events.js → webhook-events.js} +5 -10
- package/resources/webhook-events.js.map +1 -0
- package/resources/{webhooks/events.mjs → webhook-events.mjs} +3 -8
- package/resources/webhook-events.mjs.map +1 -0
- package/resources/webhook-subscriptions.d.mts +184 -0
- package/resources/webhook-subscriptions.d.mts.map +1 -0
- package/resources/webhook-subscriptions.d.ts +184 -0
- package/resources/webhook-subscriptions.d.ts.map +1 -0
- package/resources/{webhooks/subscriptions.js → webhook-subscriptions.js} +16 -16
- package/resources/webhook-subscriptions.js.map +1 -0
- package/resources/{webhooks/subscriptions.mjs → webhook-subscriptions.mjs} +14 -14
- package/resources/webhook-subscriptions.mjs.map +1 -0
- package/src/client.ts +97 -41
- package/src/core/api-promise.ts +4 -4
- package/src/core/error.ts +2 -2
- package/src/core/resource.ts +3 -3
- package/src/index.ts +3 -3
- package/src/internal/parse.ts +2 -2
- package/src/internal/shims.ts +1 -1
- package/src/internal/uploads.ts +5 -5
- package/src/internal/utils/base64.ts +3 -3
- package/src/internal/utils/log.ts +3 -3
- package/src/internal/utils/path.ts +2 -2
- package/src/internal/utils/values.ts +6 -6
- package/src/resources/attachments.ts +81 -106
- package/src/resources/capability.ts +98 -0
- package/src/resources/chats/chats.ts +135 -770
- package/src/resources/chats/index.ts +4 -2
- package/src/resources/chats/messages.ts +60 -839
- package/src/resources/index.ts +29 -9
- package/src/resources/messages.ts +153 -659
- package/src/resources/phone-numbers.ts +1 -65
- package/src/resources/phonenumbers.ts +72 -0
- package/src/resources/webhook-events.ts +57 -0
- package/src/resources/webhook-subscriptions.ts +238 -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
- package/resources/webhooks/events.d.mts +0 -30
- package/resources/webhooks/events.d.mts.map +0 -1
- package/resources/webhooks/events.d.ts +0 -30
- package/resources/webhooks/events.d.ts.map +0 -1
- package/resources/webhooks/events.js.map +0 -1
- package/resources/webhooks/events.mjs.map +0 -1
- package/resources/webhooks/index.d.mts +0 -4
- package/resources/webhooks/index.d.mts.map +0 -1
- package/resources/webhooks/index.d.ts +0 -4
- package/resources/webhooks/index.d.ts.map +0 -1
- package/resources/webhooks/index.js +0 -11
- package/resources/webhooks/index.js.map +0 -1
- package/resources/webhooks/index.mjs +0 -5
- package/resources/webhooks/index.mjs.map +0 -1
- package/resources/webhooks/subscriptions.d.mts +0 -237
- package/resources/webhooks/subscriptions.d.mts.map +0 -1
- package/resources/webhooks/subscriptions.d.ts +0 -237
- package/resources/webhooks/subscriptions.d.ts.map +0 -1
- package/resources/webhooks/subscriptions.js.map +0 -1
- package/resources/webhooks/subscriptions.mjs.map +0 -1
- package/resources/webhooks/webhooks.d.mts +0 -14
- package/resources/webhooks/webhooks.d.mts.map +0 -1
- package/resources/webhooks/webhooks.d.ts +0 -14
- package/resources/webhooks/webhooks.d.ts.map +0 -1
- package/resources/webhooks/webhooks.js +0 -21
- package/resources/webhooks/webhooks.js.map +0 -1
- package/resources/webhooks/webhooks.mjs +0 -16
- package/resources/webhooks/webhooks.mjs.map +0 -1
- package/resources/webhooks.d.mts +0 -2
- package/resources/webhooks.d.mts.map +0 -1
- package/resources/webhooks.d.ts +0 -2
- package/resources/webhooks.d.ts.map +0 -1
- package/resources/webhooks.js +0 -6
- package/resources/webhooks.js.map +0 -1
- package/resources/webhooks.mjs +0 -3
- package/resources/webhooks.mjs.map +0 -1
- package/src/resources/webhooks/events.ts +0 -55
- package/src/resources/webhooks/index.ts +0 -13
- package/src/resources/webhooks/subscriptions.ts +0 -409
- package/src/resources/webhooks/webhooks.ts +0 -37
- package/src/resources/webhooks.ts +0 -3
|
@@ -13,15 +13,6 @@ export class PhoneNumbers extends APIResource {
|
|
|
13
13
|
list(options?: RequestOptions): APIPromise<PhoneNumberListResponse> {
|
|
14
14
|
return this._client.get('/v3/phone_numbers', options);
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* **Deprecated.** Use `GET /v3/phone_numbers` instead.
|
|
19
|
-
*
|
|
20
|
-
* @deprecated Use `list` instead, which calls `GET /v3/phone_numbers`.
|
|
21
|
-
*/
|
|
22
|
-
listDeprecated(options?: RequestOptions): APIPromise<PhoneNumberListDeprecatedResponse> {
|
|
23
|
-
return this._client.get('/v3/phonenumbers', options);
|
|
24
|
-
}
|
|
25
16
|
}
|
|
26
17
|
|
|
27
18
|
export interface PhoneNumberListResponse {
|
|
@@ -45,61 +36,6 @@ export namespace PhoneNumberListResponse {
|
|
|
45
36
|
}
|
|
46
37
|
}
|
|
47
38
|
|
|
48
|
-
export interface PhoneNumberListDeprecatedResponse {
|
|
49
|
-
/**
|
|
50
|
-
* List of phone numbers assigned to the partner
|
|
51
|
-
*/
|
|
52
|
-
phone_numbers: Array<PhoneNumberListDeprecatedResponse.PhoneNumber>;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export namespace PhoneNumberListDeprecatedResponse {
|
|
56
|
-
export interface PhoneNumber {
|
|
57
|
-
/**
|
|
58
|
-
* Unique identifier for the phone number
|
|
59
|
-
*/
|
|
60
|
-
id: string;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Phone number in E.164 format
|
|
64
|
-
*/
|
|
65
|
-
phone_number: string;
|
|
66
|
-
|
|
67
|
-
capabilities?: PhoneNumber.Capabilities;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Deprecated. Always null.
|
|
71
|
-
*/
|
|
72
|
-
country_code?: string;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Deprecated. Always null.
|
|
76
|
-
*/
|
|
77
|
-
type?: 'TWILIO' | 'APPLE_ID';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export namespace PhoneNumber {
|
|
81
|
-
export interface Capabilities {
|
|
82
|
-
/**
|
|
83
|
-
* Whether MMS messaging is supported
|
|
84
|
-
*/
|
|
85
|
-
mms: boolean;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Whether SMS messaging is supported
|
|
89
|
-
*/
|
|
90
|
-
sms: boolean;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Whether voice calls are supported
|
|
94
|
-
*/
|
|
95
|
-
voice: boolean;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
39
|
export declare namespace PhoneNumbers {
|
|
101
|
-
export {
|
|
102
|
-
type PhoneNumberListResponse as PhoneNumberListResponse,
|
|
103
|
-
type PhoneNumberListDeprecatedResponse as PhoneNumberListDeprecatedResponse,
|
|
104
|
-
};
|
|
40
|
+
export { type PhoneNumberListResponse as PhoneNumberListResponse };
|
|
105
41
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Phonenumbers extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* **Deprecated.** Use `GET /v3/phone_numbers` instead.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/
|
|
13
|
+
list(options?: RequestOptions): APIPromise<PhonenumberListResponse> {
|
|
14
|
+
return this._client.get('/v3/phonenumbers', options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface PhonenumberListResponse {
|
|
19
|
+
/**
|
|
20
|
+
* List of phone numbers assigned to the partner
|
|
21
|
+
*/
|
|
22
|
+
phone_numbers: Array<PhonenumberListResponse.PhoneNumber>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export namespace PhonenumberListResponse {
|
|
26
|
+
export interface PhoneNumber {
|
|
27
|
+
/**
|
|
28
|
+
* Unique identifier for the phone number
|
|
29
|
+
*/
|
|
30
|
+
id: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Phone number in E.164 format
|
|
34
|
+
*/
|
|
35
|
+
phone_number: string;
|
|
36
|
+
|
|
37
|
+
capabilities?: PhoneNumber.Capabilities;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Deprecated. Always null.
|
|
41
|
+
*/
|
|
42
|
+
country_code?: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Deprecated. Always null.
|
|
46
|
+
*/
|
|
47
|
+
type?: 'TWILIO' | 'APPLE_ID';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export namespace PhoneNumber {
|
|
51
|
+
export interface Capabilities {
|
|
52
|
+
/**
|
|
53
|
+
* Whether MMS messaging is supported
|
|
54
|
+
*/
|
|
55
|
+
mms: boolean;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Whether SMS messaging is supported
|
|
59
|
+
*/
|
|
60
|
+
sms: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Whether voice calls are supported
|
|
64
|
+
*/
|
|
65
|
+
voice: boolean;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export declare namespace Phonenumbers {
|
|
71
|
+
export { type PhonenumberListResponse as PhonenumberListResponse };
|
|
72
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class WebhookEvents extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns all available webhook event types that can be subscribed to. Use this
|
|
10
|
+
* endpoint to discover valid values for the `subscribed_events` field when
|
|
11
|
+
* creating or updating webhook subscriptions.
|
|
12
|
+
*/
|
|
13
|
+
list(options?: RequestOptions): APIPromise<WebhookEventListResponse> {
|
|
14
|
+
return this._client.get('/v3/webhook-events', options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Valid webhook event types that can be subscribed to
|
|
20
|
+
*/
|
|
21
|
+
export type WebhookEventType =
|
|
22
|
+
| 'message.sent'
|
|
23
|
+
| 'message.received'
|
|
24
|
+
| 'message.read'
|
|
25
|
+
| 'message.delivered'
|
|
26
|
+
| 'message.failed'
|
|
27
|
+
| 'reaction.added'
|
|
28
|
+
| 'reaction.removed'
|
|
29
|
+
| 'participant.added'
|
|
30
|
+
| 'participant.removed'
|
|
31
|
+
| 'chat.created'
|
|
32
|
+
| 'chat.group_name_updated'
|
|
33
|
+
| 'chat.group_icon_updated'
|
|
34
|
+
| 'chat.group_name_update_failed'
|
|
35
|
+
| 'chat.group_icon_update_failed'
|
|
36
|
+
| 'chat.typing_indicator.started'
|
|
37
|
+
| 'chat.typing_indicator.stopped'
|
|
38
|
+
| 'phone_number.status_updated';
|
|
39
|
+
|
|
40
|
+
export interface WebhookEventListResponse {
|
|
41
|
+
/**
|
|
42
|
+
* URL to the webhook events documentation
|
|
43
|
+
*/
|
|
44
|
+
doc_url: 'https://apidocs.linqapp.com/documentation/webhook-events';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* List of all available webhook event types
|
|
48
|
+
*/
|
|
49
|
+
events: Array<WebhookEventType>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export declare namespace WebhookEvents {
|
|
53
|
+
export {
|
|
54
|
+
type WebhookEventType as WebhookEventType,
|
|
55
|
+
type WebhookEventListResponse as WebhookEventListResponse,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as WebhookEventsAPI from './webhook-events';
|
|
5
|
+
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { buildHeaders } from '../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class WebhookSubscriptions extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Create a new webhook subscription to receive events at a target URL. Upon
|
|
13
|
+
* creation, a signing secret is generated for verifying webhook authenticity.
|
|
14
|
+
* **Store this secret securely — it cannot be retrieved later.**
|
|
15
|
+
*
|
|
16
|
+
* **Webhook Delivery:**
|
|
17
|
+
*
|
|
18
|
+
* - Events are sent via HTTP POST to the target URL
|
|
19
|
+
* - Each request includes `X-Webhook-Signature` and `X-Webhook-Timestamp` headers
|
|
20
|
+
* - Signature is HMAC-SHA256 over `{timestamp}.{payload}` — see
|
|
21
|
+
* [Webhook Events](/docs/webhook-events) for verification details
|
|
22
|
+
* - Failed deliveries (5xx, 429, network errors) are retried up to 10 times over
|
|
23
|
+
* ~2 hours with exponential backoff
|
|
24
|
+
* - Client errors (4xx except 429) are not retried
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const webhookSubscription =
|
|
29
|
+
* await client.webhookSubscriptions.create({
|
|
30
|
+
* subscribed_events: [
|
|
31
|
+
* 'message.sent',
|
|
32
|
+
* 'message.delivered',
|
|
33
|
+
* 'message.read',
|
|
34
|
+
* ],
|
|
35
|
+
* target_url: 'https://webhooks.example.com/linq/events',
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
create(
|
|
40
|
+
body: WebhookSubscriptionCreateParams,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<WebhookSubscriptionCreateResponse> {
|
|
43
|
+
return this._client.post('/v3/webhook-subscriptions', { body, ...options });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve details for a specific webhook subscription including its target URL,
|
|
48
|
+
* subscribed events, and current status.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const webhookSubscription =
|
|
53
|
+
* await client.webhookSubscriptions.retrieve(
|
|
54
|
+
* 'b2c3d4e5-f6a7-8901-bcde-f23456789012',
|
|
55
|
+
* );
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
retrieve(subscriptionID: string, options?: RequestOptions): APIPromise<WebhookSubscription> {
|
|
59
|
+
return this._client.get(path`/v3/webhook-subscriptions/${subscriptionID}`, options);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Update an existing webhook subscription. You can modify the target URL,
|
|
64
|
+
* subscribed events, or activate/deactivate the subscription.
|
|
65
|
+
*
|
|
66
|
+
* **Note:** The signing secret cannot be changed via this endpoint.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const webhookSubscription =
|
|
71
|
+
* await client.webhookSubscriptions.update(
|
|
72
|
+
* 'b2c3d4e5-f6a7-8901-bcde-f23456789012',
|
|
73
|
+
* {
|
|
74
|
+
* target_url:
|
|
75
|
+
* 'https://webhooks.example.com/linq/events',
|
|
76
|
+
* },
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
update(
|
|
81
|
+
subscriptionID: string,
|
|
82
|
+
body: WebhookSubscriptionUpdateParams,
|
|
83
|
+
options?: RequestOptions,
|
|
84
|
+
): APIPromise<WebhookSubscription> {
|
|
85
|
+
return this._client.put(path`/v3/webhook-subscriptions/${subscriptionID}`, { body, ...options });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve all webhook subscriptions for the authenticated partner. Returns a list
|
|
90
|
+
* of active and inactive subscriptions with their configuration and status.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const webhookSubscriptions =
|
|
95
|
+
* await client.webhookSubscriptions.list();
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
list(options?: RequestOptions): APIPromise<WebhookSubscriptionListResponse> {
|
|
99
|
+
return this._client.get('/v3/webhook-subscriptions', options);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Delete a webhook subscription.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* await client.webhookSubscriptions.delete(
|
|
108
|
+
* 'b2c3d4e5-f6a7-8901-bcde-f23456789012',
|
|
109
|
+
* );
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
delete(subscriptionID: string, options?: RequestOptions): APIPromise<void> {
|
|
113
|
+
return this._client.delete(path`/v3/webhook-subscriptions/${subscriptionID}`, {
|
|
114
|
+
...options,
|
|
115
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface WebhookSubscription {
|
|
121
|
+
/**
|
|
122
|
+
* Unique identifier for the webhook subscription
|
|
123
|
+
*/
|
|
124
|
+
id: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* When the subscription was created
|
|
128
|
+
*/
|
|
129
|
+
created_at: string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Whether this subscription is currently active
|
|
133
|
+
*/
|
|
134
|
+
is_active: boolean;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* List of event types this subscription receives
|
|
138
|
+
*/
|
|
139
|
+
subscribed_events: Array<WebhookEventsAPI.WebhookEventType>;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* URL where webhook events will be sent
|
|
143
|
+
*/
|
|
144
|
+
target_url: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* When the subscription was last updated
|
|
148
|
+
*/
|
|
149
|
+
updated_at: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Response returned when creating a webhook subscription. Includes the signing
|
|
154
|
+
* secret which is only shown once.
|
|
155
|
+
*/
|
|
156
|
+
export interface WebhookSubscriptionCreateResponse {
|
|
157
|
+
/**
|
|
158
|
+
* Unique identifier for the webhook subscription
|
|
159
|
+
*/
|
|
160
|
+
id: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* When the subscription was created
|
|
164
|
+
*/
|
|
165
|
+
created_at: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Whether this subscription is currently active
|
|
169
|
+
*/
|
|
170
|
+
is_active: boolean;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Secret for verifying webhook signatures. Store this securely - it cannot be
|
|
174
|
+
* retrieved again.
|
|
175
|
+
*/
|
|
176
|
+
signing_secret: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* List of event types this subscription receives
|
|
180
|
+
*/
|
|
181
|
+
subscribed_events: Array<WebhookEventsAPI.WebhookEventType>;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* URL where webhook events will be sent
|
|
185
|
+
*/
|
|
186
|
+
target_url: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* When the subscription was last updated
|
|
190
|
+
*/
|
|
191
|
+
updated_at: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface WebhookSubscriptionListResponse {
|
|
195
|
+
/**
|
|
196
|
+
* List of webhook subscriptions
|
|
197
|
+
*/
|
|
198
|
+
subscriptions: Array<WebhookSubscription>;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface WebhookSubscriptionCreateParams {
|
|
202
|
+
/**
|
|
203
|
+
* List of event types to subscribe to
|
|
204
|
+
*/
|
|
205
|
+
subscribed_events: Array<WebhookEventsAPI.WebhookEventType>;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* URL where webhook events will be sent. Must be HTTPS.
|
|
209
|
+
*/
|
|
210
|
+
target_url: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface WebhookSubscriptionUpdateParams {
|
|
214
|
+
/**
|
|
215
|
+
* Activate or deactivate the subscription
|
|
216
|
+
*/
|
|
217
|
+
is_active?: boolean;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Updated list of event types to subscribe to
|
|
221
|
+
*/
|
|
222
|
+
subscribed_events?: Array<WebhookEventsAPI.WebhookEventType>;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* New target URL for webhook events
|
|
226
|
+
*/
|
|
227
|
+
target_url?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export declare namespace WebhookSubscriptions {
|
|
231
|
+
export {
|
|
232
|
+
type WebhookSubscription as WebhookSubscription,
|
|
233
|
+
type WebhookSubscriptionCreateResponse as WebhookSubscriptionCreateResponse,
|
|
234
|
+
type WebhookSubscriptionListResponse as WebhookSubscriptionListResponse,
|
|
235
|
+
type WebhookSubscriptionCreateParams as WebhookSubscriptionCreateParams,
|
|
236
|
+
type WebhookSubscriptionUpdateParams as WebhookSubscriptionUpdateParams,
|
|
237
|
+
};
|
|
238
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.3'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.3";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.3";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.3'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
-
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
-
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
-
export declare class Events extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Returns all available webhook event types that can be subscribed to. Use this
|
|
7
|
-
* endpoint to discover valid values for the `subscribed_events` field when
|
|
8
|
-
* creating or updating webhook subscriptions.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const events = await client.webhooks.events.list();
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
list(options?: RequestOptions): APIPromise<EventListResponse>;
|
|
16
|
-
}
|
|
17
|
-
export interface EventListResponse {
|
|
18
|
-
/**
|
|
19
|
-
* URL to the webhook events documentation
|
|
20
|
-
*/
|
|
21
|
-
doc_url: 'https://apidocs.linqapp.com/documentation/webhook-events';
|
|
22
|
-
/**
|
|
23
|
-
* List of all available webhook event types
|
|
24
|
-
*/
|
|
25
|
-
events: Array<'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'>;
|
|
26
|
-
}
|
|
27
|
-
export declare namespace Events {
|
|
28
|
-
export { type EventListResponse as EventListResponse };
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=events.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.mts","sourceRoot":"","sources":["../../src/resources/webhooks/events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAG9D;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CACT,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,CAChC,CAAC;CACH;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACxD"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../core/resource.js";
|
|
2
|
-
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
-
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
-
export declare class Events extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Returns all available webhook event types that can be subscribed to. Use this
|
|
7
|
-
* endpoint to discover valid values for the `subscribed_events` field when
|
|
8
|
-
* creating or updating webhook subscriptions.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const events = await client.webhooks.events.list();
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
list(options?: RequestOptions): APIPromise<EventListResponse>;
|
|
16
|
-
}
|
|
17
|
-
export interface EventListResponse {
|
|
18
|
-
/**
|
|
19
|
-
* URL to the webhook events documentation
|
|
20
|
-
*/
|
|
21
|
-
doc_url: 'https://apidocs.linqapp.com/documentation/webhook-events';
|
|
22
|
-
/**
|
|
23
|
-
* List of all available webhook event types
|
|
24
|
-
*/
|
|
25
|
-
events: Array<'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'>;
|
|
26
|
-
}
|
|
27
|
-
export declare namespace Events {
|
|
28
|
-
export { type EventListResponse as EventListResponse };
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/resources/webhooks/events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAG9D;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CACT,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,CAChC,CAAC;CACH;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/resources/webhooks/events.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AAdD,wBAcC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.mjs","sourceRoot":"","sources":["../../src/resources/webhooks/events.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { Events, type EventListResponse } from "./events.mjs";
|
|
2
|
-
export { Subscriptions, type SubscriptionCreateResponse, type SubscriptionRetrieveResponse, type SubscriptionUpdateResponse, type SubscriptionListResponse, type SubscriptionCreateParams, type SubscriptionUpdateParams, } from "./subscriptions.mjs";
|
|
3
|
-
export { Webhooks } from "./webhooks.mjs";
|
|
4
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/webhooks/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE,KAAK,iBAAiB,EAAE;OAClC,EACL,aAAa,EACb,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B;OACM,EAAE,QAAQ,EAAE"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { Events, type EventListResponse } from "./events.js";
|
|
2
|
-
export { Subscriptions, type SubscriptionCreateResponse, type SubscriptionRetrieveResponse, type SubscriptionUpdateResponse, type SubscriptionListResponse, type SubscriptionCreateParams, type SubscriptionUpdateParams, } from "./subscriptions.js";
|
|
3
|
-
export { Webhooks } from "./webhooks.js";
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/webhooks/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE,KAAK,iBAAiB,EAAE;OAClC,EACL,aAAa,EACb,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B;OACM,EAAE,QAAQ,EAAE"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Webhooks = exports.Subscriptions = exports.Events = void 0;
|
|
5
|
-
var events_1 = require("./events.js");
|
|
6
|
-
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return events_1.Events; } });
|
|
7
|
-
var subscriptions_1 = require("./subscriptions.js");
|
|
8
|
-
Object.defineProperty(exports, "Subscriptions", { enumerable: true, get: function () { return subscriptions_1.Subscriptions; } });
|
|
9
|
-
var webhooks_1 = require("./webhooks.js");
|
|
10
|
-
Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return webhooks_1.Webhooks; } });
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/webhooks/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAA0D;AAAjD,gGAAA,MAAM,OAAA;AACf,oDAQyB;AAPvB,8GAAA,aAAa,OAAA;AAQf,0CAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/webhooks/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,EAA0B;OAClC,EACL,aAAa,GAOd;OACM,EAAE,QAAQ,EAAE"}
|