@linqapp/sdk 0.24.2 → 0.26.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 +2 -506
- package/client.d.mts +165 -87
- package/client.d.mts.map +1 -1
- package/client.d.ts +165 -87
- package/client.d.ts.map +1 -1
- package/client.js +162 -84
- package/client.js.map +1 -1
- package/client.mjs +162 -84
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/chats/chats.d.mts +67 -63
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +67 -63
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +63 -59
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +63 -59
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/index.d.mts +3 -2
- package/resources/chats/index.d.mts.map +1 -1
- package/resources/chats/index.d.ts +3 -2
- package/resources/chats/index.d.ts.map +1 -1
- package/resources/chats/index.js +3 -1
- package/resources/chats/index.js.map +1 -1
- package/resources/chats/index.mjs +1 -0
- package/resources/chats/index.mjs.map +1 -1
- package/resources/chats/location.d.mts +107 -0
- package/resources/chats/location.d.mts.map +1 -0
- package/resources/chats/location.d.ts +107 -0
- package/resources/chats/location.d.ts.map +1 -0
- package/resources/chats/location.js +68 -0
- package/resources/chats/location.js.map +1 -0
- package/resources/chats/location.mjs +64 -0
- package/resources/chats/location.mjs.map +1 -0
- package/resources/chats/messages.d.mts +17 -17
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +17 -17
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +16 -16
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +16 -16
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/contact-card.d.mts +18 -18
- package/resources/contact-card.d.mts.map +1 -1
- package/resources/contact-card.d.ts +18 -18
- package/resources/contact-card.d.ts.map +1 -1
- package/resources/contact-card.js +12 -12
- package/resources/contact-card.js.map +1 -1
- package/resources/contact-card.mjs +12 -12
- package/resources/contact-card.mjs.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/messages.d.mts +34 -34
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +34 -34
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +29 -29
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +29 -29
- package/resources/messages.mjs.map +1 -1
- package/resources/webhook-events.d.mts +83 -44
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +83 -44
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhook-events.js +81 -42
- package/resources/webhook-events.js.map +1 -1
- package/resources/webhook-events.mjs +81 -42
- package/resources/webhook-events.mjs.map +1 -1
- package/resources/webhook-subscriptions.d.mts +100 -55
- package/resources/webhook-subscriptions.d.mts.map +1 -1
- package/resources/webhook-subscriptions.d.ts +100 -55
- package/resources/webhook-subscriptions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.js +103 -58
- package/resources/webhook-subscriptions.js.map +1 -1
- package/resources/webhook-subscriptions.mjs +103 -58
- package/resources/webhook-subscriptions.mjs.map +1 -1
- package/resources/webhooks.d.mts +4 -4
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +4 -4
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +166 -88
- package/src/resources/chats/chats.ts +88 -78
- package/src/resources/chats/index.ts +3 -2
- package/src/resources/chats/location.ts +138 -0
- package/src/resources/chats/messages.ts +28 -28
- package/src/resources/contact-card.ts +25 -25
- package/src/resources/index.ts +4 -4
- package/src/resources/messages.ts +46 -46
- package/src/resources/webhook-events.ts +85 -44
- package/src/resources/webhook-subscriptions.ts +103 -58
- package/src/resources/webhooks.ts +6 -4
- 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,5 +1,6 @@
|
|
|
1
|
-
export { Chats, type Chat, type LinkPart, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatUpdateResponse, type ChatLeaveChatResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type
|
|
2
|
-
export {
|
|
1
|
+
export { Chats, type Chat, type LinkPart, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatUpdateResponse, type ChatLeaveChatResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type ChatListChatsParams, type ChatUpdateParams, type ChatSendVoicememoParams, type ChatsListChatsPagination, } from "./chats.mjs";
|
|
2
|
+
export { Location, type GetChatLocationResponse, type LocationRequestResponse } from "./location.mjs";
|
|
3
|
+
export { Messages, type SentMessage, type MessageSendResponse, type MessageSendParams, type MessageListParams, } from "./messages.mjs";
|
|
3
4
|
export { Participants, type ParticipantAddResponse, type ParticipantRemoveResponse, type ParticipantAddParams, type ParticipantRemoveParams, } from "./participants.mjs";
|
|
4
5
|
export { Typing } from "./typing.mjs";
|
|
5
6
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,oBAAgB;AACjB,OAAO,EAAE,QAAQ,EAAE,KAAK,uBAAuB,EAAE,KAAK,uBAAuB,EAAE,uBAAmB;AAClG,OAAO,EACL,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,uBAAmB;AACpB,OAAO,EACL,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,2BAAuB;AACxB,OAAO,EAAE,MAAM,EAAE,qBAAiB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { Chats, type Chat, type LinkPart, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatUpdateResponse, type ChatLeaveChatResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type
|
|
2
|
-
export {
|
|
1
|
+
export { Chats, type Chat, type LinkPart, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatUpdateResponse, type ChatLeaveChatResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type ChatListChatsParams, type ChatUpdateParams, type ChatSendVoicememoParams, type ChatsListChatsPagination, } from "./chats.js";
|
|
2
|
+
export { Location, type GetChatLocationResponse, type LocationRequestResponse } from "./location.js";
|
|
3
|
+
export { Messages, type SentMessage, type MessageSendResponse, type MessageSendParams, type MessageListParams, } from "./messages.js";
|
|
3
4
|
export { Participants, type ParticipantAddResponse, type ParticipantRemoveResponse, type ParticipantAddParams, type ParticipantRemoveParams, } from "./participants.js";
|
|
4
5
|
export { Typing } from "./typing.js";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,mBAAgB;AACjB,OAAO,EAAE,QAAQ,EAAE,KAAK,uBAAuB,EAAE,KAAK,uBAAuB,EAAE,sBAAmB;AAClG,OAAO,EACL,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,sBAAmB;AACpB,OAAO,EACL,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,0BAAuB;AACxB,OAAO,EAAE,MAAM,EAAE,oBAAiB"}
|
package/resources/chats/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Typing = exports.Participants = exports.Messages = exports.Chats = void 0;
|
|
4
|
+
exports.Typing = exports.Participants = exports.Messages = exports.Location = exports.Chats = void 0;
|
|
5
5
|
var chats_1 = require("./chats.js");
|
|
6
6
|
Object.defineProperty(exports, "Chats", { enumerable: true, get: function () { return chats_1.Chats; } });
|
|
7
|
+
var location_1 = require("./location.js");
|
|
8
|
+
Object.defineProperty(exports, "Location", { enumerable: true, get: function () { return location_1.Location; } });
|
|
7
9
|
var messages_1 = require("./messages.js");
|
|
8
10
|
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_1.Messages; } });
|
|
9
11
|
var participants_1 = require("./participants.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAgBiB;AAff,8FAAA,KAAK,OAAA;AAgBP,0CAMoB;AALlB,oGAAA,QAAQ,OAAA;AAMV,kDAMwB;AALtB,4GAAA,YAAY,OAAA;AAMd,sCAAkC;AAAzB,gGAAA,MAAM,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAgBiB;AAff,8FAAA,KAAK,OAAA;AAgBP,0CAAkG;AAAzF,oGAAA,QAAQ,OAAA;AACjB,0CAMoB;AALlB,oGAAA,QAAQ,OAAA;AAMV,kDAMwB;AALtB,4GAAA,YAAY,OAAA;AAMd,sCAAkC;AAAzB,gGAAA,MAAM,OAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { Chats, } from "./chats.mjs";
|
|
3
|
+
export { Location } from "./location.mjs";
|
|
3
4
|
export { Messages, } from "./messages.mjs";
|
|
4
5
|
export { Participants, } from "./participants.mjs";
|
|
5
6
|
export { Typing } from "./typing.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,KAAK,GAeN,oBAAgB;AACjB,OAAO,EACL,QAAQ,GAKT,uBAAmB;AACpB,OAAO,EACL,YAAY,GAKb,2BAAuB;AACxB,OAAO,EAAE,MAAM,EAAE,qBAAiB"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,KAAK,GAeN,oBAAgB;AACjB,OAAO,EAAE,QAAQ,EAA8D,uBAAmB;AAClG,OAAO,EACL,QAAQ,GAKT,uBAAmB;AACpB,OAAO,EACL,YAAY,GAKb,2BAAuB;AACxB,OAAO,EAAE,MAAM,EAAE,qBAAiB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Request and retrieve real-time location data via iMessage.
|
|
6
|
+
*
|
|
7
|
+
* Use these endpoints to request a contact's location, retrieve location data
|
|
8
|
+
* for contacts who are sharing with you, and subscribe to webhooks when someone
|
|
9
|
+
* starts or stops sharing their location.
|
|
10
|
+
*
|
|
11
|
+
* **Coordinates** are returned in [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946) format:
|
|
12
|
+
* `[longitude, latitude]` or `[longitude, latitude, altitude]` if altitude is available.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Location extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Send a location sharing request to a contact. They will receive an iMessage
|
|
17
|
+
* prompt asking them to share their location.
|
|
18
|
+
*
|
|
19
|
+
* Location requests only work in **1:1 iMessage chats** (Apple limitation).
|
|
20
|
+
* Attempting to request location in a group chat, or in an SMS or RCS chat,
|
|
21
|
+
* returns `409` (Operation not supported on this chat's service type).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const locationRequestResponse =
|
|
26
|
+
* await client.chats.location.request(
|
|
27
|
+
* '975d0776-bd17-4273-8337-f346b4c661b0',
|
|
28
|
+
* );
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
request(chatID: string, options?: RequestOptions): APIPromise<LocationRequestResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve the current location for contacts sharing with you in a chat.
|
|
34
|
+
*
|
|
35
|
+
* Returns a [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946)
|
|
36
|
+
* `FeatureCollection` with a `Feature` for each participant actively sharing their
|
|
37
|
+
* location.
|
|
38
|
+
*
|
|
39
|
+
* Works for both 1:1 and group chats. In group chats, returns a separate feature
|
|
40
|
+
* for each participant who is sharing. Each feature's `properties.handle`
|
|
41
|
+
* identifies the user.
|
|
42
|
+
*
|
|
43
|
+
* Returns an empty `features` array if no one is sharing or no location data is
|
|
44
|
+
* available yet.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const getChatLocationResponse =
|
|
49
|
+
* await client.chats.location.retrieve(
|
|
50
|
+
* '975d0776-bd17-4273-8337-f346b4c661b0',
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
retrieve(chatID: string, options?: RequestOptions): APIPromise<GetChatLocationResponse>;
|
|
55
|
+
}
|
|
56
|
+
export interface GetChatLocationResponse {
|
|
57
|
+
data: GetChatLocationResponse.Data;
|
|
58
|
+
success: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare namespace GetChatLocationResponse {
|
|
61
|
+
interface Data {
|
|
62
|
+
features: Array<Data.Feature>;
|
|
63
|
+
type: 'FeatureCollection';
|
|
64
|
+
}
|
|
65
|
+
namespace Data {
|
|
66
|
+
interface Feature {
|
|
67
|
+
geometry: Feature.Geometry;
|
|
68
|
+
properties: Feature.Properties;
|
|
69
|
+
type: 'Feature';
|
|
70
|
+
}
|
|
71
|
+
namespace Feature {
|
|
72
|
+
interface Geometry {
|
|
73
|
+
/**
|
|
74
|
+
* [longitude, latitude] or [longitude, latitude, altitude]
|
|
75
|
+
*/
|
|
76
|
+
coordinates: Array<number>;
|
|
77
|
+
type: 'Point';
|
|
78
|
+
}
|
|
79
|
+
interface Properties {
|
|
80
|
+
/**
|
|
81
|
+
* Phone number or email of the person sharing their location
|
|
82
|
+
*/
|
|
83
|
+
handle: string;
|
|
84
|
+
/**
|
|
85
|
+
* Full street address
|
|
86
|
+
*/
|
|
87
|
+
address?: string;
|
|
88
|
+
/**
|
|
89
|
+
* City or locality name
|
|
90
|
+
*/
|
|
91
|
+
locality?: string;
|
|
92
|
+
/**
|
|
93
|
+
* When the location was last updated
|
|
94
|
+
*/
|
|
95
|
+
updated_at?: string;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export interface LocationRequestResponse {
|
|
101
|
+
message: string;
|
|
102
|
+
success: boolean;
|
|
103
|
+
}
|
|
104
|
+
export declare namespace Location {
|
|
105
|
+
export { type GetChatLocationResponse as GetChatLocationResponse, type LocationRequestResponse as LocationRequestResponse, };
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=location.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.d.mts","sourceRoot":"","sources":["../../src/resources/chats/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;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,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Request and retrieve real-time location data via iMessage.
|
|
6
|
+
*
|
|
7
|
+
* Use these endpoints to request a contact's location, retrieve location data
|
|
8
|
+
* for contacts who are sharing with you, and subscribe to webhooks when someone
|
|
9
|
+
* starts or stops sharing their location.
|
|
10
|
+
*
|
|
11
|
+
* **Coordinates** are returned in [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946) format:
|
|
12
|
+
* `[longitude, latitude]` or `[longitude, latitude, altitude]` if altitude is available.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Location extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Send a location sharing request to a contact. They will receive an iMessage
|
|
17
|
+
* prompt asking them to share their location.
|
|
18
|
+
*
|
|
19
|
+
* Location requests only work in **1:1 iMessage chats** (Apple limitation).
|
|
20
|
+
* Attempting to request location in a group chat, or in an SMS or RCS chat,
|
|
21
|
+
* returns `409` (Operation not supported on this chat's service type).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const locationRequestResponse =
|
|
26
|
+
* await client.chats.location.request(
|
|
27
|
+
* '975d0776-bd17-4273-8337-f346b4c661b0',
|
|
28
|
+
* );
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
request(chatID: string, options?: RequestOptions): APIPromise<LocationRequestResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve the current location for contacts sharing with you in a chat.
|
|
34
|
+
*
|
|
35
|
+
* Returns a [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946)
|
|
36
|
+
* `FeatureCollection` with a `Feature` for each participant actively sharing their
|
|
37
|
+
* location.
|
|
38
|
+
*
|
|
39
|
+
* Works for both 1:1 and group chats. In group chats, returns a separate feature
|
|
40
|
+
* for each participant who is sharing. Each feature's `properties.handle`
|
|
41
|
+
* identifies the user.
|
|
42
|
+
*
|
|
43
|
+
* Returns an empty `features` array if no one is sharing or no location data is
|
|
44
|
+
* available yet.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const getChatLocationResponse =
|
|
49
|
+
* await client.chats.location.retrieve(
|
|
50
|
+
* '975d0776-bd17-4273-8337-f346b4c661b0',
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
retrieve(chatID: string, options?: RequestOptions): APIPromise<GetChatLocationResponse>;
|
|
55
|
+
}
|
|
56
|
+
export interface GetChatLocationResponse {
|
|
57
|
+
data: GetChatLocationResponse.Data;
|
|
58
|
+
success: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare namespace GetChatLocationResponse {
|
|
61
|
+
interface Data {
|
|
62
|
+
features: Array<Data.Feature>;
|
|
63
|
+
type: 'FeatureCollection';
|
|
64
|
+
}
|
|
65
|
+
namespace Data {
|
|
66
|
+
interface Feature {
|
|
67
|
+
geometry: Feature.Geometry;
|
|
68
|
+
properties: Feature.Properties;
|
|
69
|
+
type: 'Feature';
|
|
70
|
+
}
|
|
71
|
+
namespace Feature {
|
|
72
|
+
interface Geometry {
|
|
73
|
+
/**
|
|
74
|
+
* [longitude, latitude] or [longitude, latitude, altitude]
|
|
75
|
+
*/
|
|
76
|
+
coordinates: Array<number>;
|
|
77
|
+
type: 'Point';
|
|
78
|
+
}
|
|
79
|
+
interface Properties {
|
|
80
|
+
/**
|
|
81
|
+
* Phone number or email of the person sharing their location
|
|
82
|
+
*/
|
|
83
|
+
handle: string;
|
|
84
|
+
/**
|
|
85
|
+
* Full street address
|
|
86
|
+
*/
|
|
87
|
+
address?: string;
|
|
88
|
+
/**
|
|
89
|
+
* City or locality name
|
|
90
|
+
*/
|
|
91
|
+
locality?: string;
|
|
92
|
+
/**
|
|
93
|
+
* When the location was last updated
|
|
94
|
+
*/
|
|
95
|
+
updated_at?: string;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export interface LocationRequestResponse {
|
|
101
|
+
message: string;
|
|
102
|
+
success: boolean;
|
|
103
|
+
}
|
|
104
|
+
export declare namespace Location {
|
|
105
|
+
export { type GetChatLocationResponse as GetChatLocationResponse, type LocationRequestResponse as LocationRequestResponse, };
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/resources/chats/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAItF;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAMxF;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;IAEnC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,IAAI;QACnB,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE9B,IAAI,EAAE,mBAAmB,CAAC;KAC3B;IAED,UAAiB,IAAI,CAAC;QACpB,UAAiB,OAAO;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;YAE3B,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC;YAE/B,IAAI,EAAE,SAAS,CAAC;SACjB;QAED,UAAiB,OAAO,CAAC;YACvB,UAAiB,QAAQ;gBACvB;;mBAEG;gBACH,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBAE3B,IAAI,EAAE,OAAO,CAAC;aACf;YAED,UAAiB,UAAU;gBACzB;;mBAEG;gBACH,MAAM,EAAE,MAAM,CAAC;gBAEf;;mBAEG;gBACH,OAAO,CAAC,EAAE,MAAM,CAAC;gBAEjB;;mBAEG;gBACH,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAElB;;mBAEG;gBACH,UAAU,CAAC,EAAE,MAAM,CAAC;aACrB;SACF;KACF;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.Location = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../internal/headers.js");
|
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Request and retrieve real-time location data via iMessage.
|
|
10
|
+
*
|
|
11
|
+
* Use these endpoints to request a contact's location, retrieve location data
|
|
12
|
+
* for contacts who are sharing with you, and subscribe to webhooks when someone
|
|
13
|
+
* starts or stops sharing their location.
|
|
14
|
+
*
|
|
15
|
+
* **Coordinates** are returned in [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946) format:
|
|
16
|
+
* `[longitude, latitude]` or `[longitude, latitude, altitude]` if altitude is available.
|
|
17
|
+
*/
|
|
18
|
+
class Location extends resource_1.APIResource {
|
|
19
|
+
/**
|
|
20
|
+
* Send a location sharing request to a contact. They will receive an iMessage
|
|
21
|
+
* prompt asking them to share their location.
|
|
22
|
+
*
|
|
23
|
+
* Location requests only work in **1:1 iMessage chats** (Apple limitation).
|
|
24
|
+
* Attempting to request location in a group chat, or in an SMS or RCS chat,
|
|
25
|
+
* returns `409` (Operation not supported on this chat's service type).
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const locationRequestResponse =
|
|
30
|
+
* await client.chats.location.request(
|
|
31
|
+
* '975d0776-bd17-4273-8337-f346b4c661b0',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
request(chatID, options) {
|
|
36
|
+
return this._client.post((0, path_1.path) `/v3/chats/${chatID}/location/request`, options);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Retrieve the current location for contacts sharing with you in a chat.
|
|
40
|
+
*
|
|
41
|
+
* Returns a [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946)
|
|
42
|
+
* `FeatureCollection` with a `Feature` for each participant actively sharing their
|
|
43
|
+
* location.
|
|
44
|
+
*
|
|
45
|
+
* Works for both 1:1 and group chats. In group chats, returns a separate feature
|
|
46
|
+
* for each participant who is sharing. Each feature's `properties.handle`
|
|
47
|
+
* identifies the user.
|
|
48
|
+
*
|
|
49
|
+
* Returns an empty `features` array if no one is sharing or no location data is
|
|
50
|
+
* available yet.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const getChatLocationResponse =
|
|
55
|
+
* await client.chats.location.retrieve(
|
|
56
|
+
* '975d0776-bd17-4273-8337-f346b4c661b0',
|
|
57
|
+
* );
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
retrieve(chatID, options) {
|
|
61
|
+
return this._client.get((0, path_1.path) `/v3/chats/${chatID}/location`, {
|
|
62
|
+
...options,
|
|
63
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'application/geo+json' }, options?.headers]),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.Location = Location;
|
|
68
|
+
//# sourceMappingURL=location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/resources/chats/location.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAEjD;;;;;;;;;GASG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,WAAW,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,sBAAsB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;CACF;AAjDD,4BAiDC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Request and retrieve real-time location data via iMessage.
|
|
7
|
+
*
|
|
8
|
+
* Use these endpoints to request a contact's location, retrieve location data
|
|
9
|
+
* for contacts who are sharing with you, and subscribe to webhooks when someone
|
|
10
|
+
* starts or stops sharing their location.
|
|
11
|
+
*
|
|
12
|
+
* **Coordinates** are returned in [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946) format:
|
|
13
|
+
* `[longitude, latitude]` or `[longitude, latitude, altitude]` if altitude is available.
|
|
14
|
+
*/
|
|
15
|
+
export class Location extends APIResource {
|
|
16
|
+
/**
|
|
17
|
+
* Send a location sharing request to a contact. They will receive an iMessage
|
|
18
|
+
* prompt asking them to share their location.
|
|
19
|
+
*
|
|
20
|
+
* Location requests only work in **1:1 iMessage chats** (Apple limitation).
|
|
21
|
+
* Attempting to request location in a group chat, or in an SMS or RCS chat,
|
|
22
|
+
* returns `409` (Operation not supported on this chat's service type).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const locationRequestResponse =
|
|
27
|
+
* await client.chats.location.request(
|
|
28
|
+
* '975d0776-bd17-4273-8337-f346b4c661b0',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
request(chatID, options) {
|
|
33
|
+
return this._client.post(path `/v3/chats/${chatID}/location/request`, options);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve the current location for contacts sharing with you in a chat.
|
|
37
|
+
*
|
|
38
|
+
* Returns a [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946)
|
|
39
|
+
* `FeatureCollection` with a `Feature` for each participant actively sharing their
|
|
40
|
+
* location.
|
|
41
|
+
*
|
|
42
|
+
* Works for both 1:1 and group chats. In group chats, returns a separate feature
|
|
43
|
+
* for each participant who is sharing. Each feature's `properties.handle`
|
|
44
|
+
* identifies the user.
|
|
45
|
+
*
|
|
46
|
+
* Returns an empty `features` array if no one is sharing or no location data is
|
|
47
|
+
* available yet.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const getChatLocationResponse =
|
|
52
|
+
* await client.chats.location.retrieve(
|
|
53
|
+
* '975d0776-bd17-4273-8337-f346b4c661b0',
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
retrieve(chatID, options) {
|
|
58
|
+
return this._client.get(path `/v3/chats/${chatID}/location`, {
|
|
59
|
+
...options,
|
|
60
|
+
headers: buildHeaders([{ Accept: 'application/geo+json' }, options?.headers]),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=location.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.mjs","sourceRoot":"","sources":["../../src/resources/chats/location.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;;;;;;GASG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,MAAM,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,WAAW,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,sBAAsB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -27,20 +27,6 @@ import { RequestOptions } from "../../internal/request-options.mjs";
|
|
|
27
27
|
* - Maximum URL length: 2,048 characters.
|
|
28
28
|
*/
|
|
29
29
|
export declare class Messages extends APIResource {
|
|
30
|
-
/**
|
|
31
|
-
* Retrieve messages from a specific chat with pagination support.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* // Automatically fetches more pages as needed.
|
|
36
|
-
* for await (const message of client.chats.messages.list(
|
|
37
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
38
|
-
* )) {
|
|
39
|
-
* // ...
|
|
40
|
-
* }
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, MessagesAPI.Message>;
|
|
44
30
|
/**
|
|
45
31
|
* Send a message to an existing chat. Use this endpoint when you already have a
|
|
46
32
|
* chat ID and want to send additional messages to it.
|
|
@@ -98,6 +84,20 @@ export declare class Messages extends APIResource {
|
|
|
98
84
|
* ```
|
|
99
85
|
*/
|
|
100
86
|
send(chatID: string, body: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Retrieve messages from a specific chat with pagination support.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* // Automatically fetches more pages as needed.
|
|
93
|
+
* for await (const message of client.chats.messages.list(
|
|
94
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
95
|
+
* )) {
|
|
96
|
+
* // ...
|
|
97
|
+
* }
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, MessagesAPI.Message>;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
@@ -165,8 +165,6 @@ export interface MessageSendResponse {
|
|
|
165
165
|
*/
|
|
166
166
|
message: SentMessage;
|
|
167
167
|
}
|
|
168
|
-
export interface MessageListParams extends ListMessagesPaginationParams {
|
|
169
|
-
}
|
|
170
168
|
export interface MessageSendParams {
|
|
171
169
|
/**
|
|
172
170
|
* Message content container. Groups all message-related fields together,
|
|
@@ -175,8 +173,10 @@ export interface MessageSendParams {
|
|
|
175
173
|
*/
|
|
176
174
|
message: ChatsAPI.MessageContent;
|
|
177
175
|
}
|
|
176
|
+
export interface MessageListParams extends ListMessagesPaginationParams {
|
|
177
|
+
}
|
|
178
178
|
export declare namespace Messages {
|
|
179
|
-
export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type
|
|
179
|
+
export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type MessageSendParams as MessageSendParams, type MessageListParams as MessageListParams, };
|
|
180
180
|
}
|
|
181
181
|
export { type MessagesListMessagesPagination };
|
|
182
182
|
//# sourceMappingURL=messages.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,WAAW,wBAAoB;AAC3C,OAAO,EAAE,8BAA8B,EAAE,wBAAoB;AAC7D,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,kCAA8B;AAC/B,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"m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AC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC,aAAa,GAAG,IAAI,CAAC;IAE1C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;IAEvC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC;CAClC;AAED,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;CAAG;AAE1E,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,8BAA8B,EAAE,CAAC"}
|
|
@@ -27,20 +27,6 @@ import { RequestOptions } from "../../internal/request-options.js";
|
|
|
27
27
|
* - Maximum URL length: 2,048 characters.
|
|
28
28
|
*/
|
|
29
29
|
export declare class Messages extends APIResource {
|
|
30
|
-
/**
|
|
31
|
-
* Retrieve messages from a specific chat with pagination support.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* // Automatically fetches more pages as needed.
|
|
36
|
-
* for await (const message of client.chats.messages.list(
|
|
37
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
38
|
-
* )) {
|
|
39
|
-
* // ...
|
|
40
|
-
* }
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, MessagesAPI.Message>;
|
|
44
30
|
/**
|
|
45
31
|
* Send a message to an existing chat. Use this endpoint when you already have a
|
|
46
32
|
* chat ID and want to send additional messages to it.
|
|
@@ -98,6 +84,20 @@ export declare class Messages extends APIResource {
|
|
|
98
84
|
* ```
|
|
99
85
|
*/
|
|
100
86
|
send(chatID: string, body: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Retrieve messages from a specific chat with pagination support.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* // Automatically fetches more pages as needed.
|
|
93
|
+
* for await (const message of client.chats.messages.list(
|
|
94
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
95
|
+
* )) {
|
|
96
|
+
* // ...
|
|
97
|
+
* }
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, MessagesAPI.Message>;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
@@ -165,8 +165,6 @@ export interface MessageSendResponse {
|
|
|
165
165
|
*/
|
|
166
166
|
message: SentMessage;
|
|
167
167
|
}
|
|
168
|
-
export interface MessageListParams extends ListMessagesPaginationParams {
|
|
169
|
-
}
|
|
170
168
|
export interface MessageSendParams {
|
|
171
169
|
/**
|
|
172
170
|
* Message content container. Groups all message-related fields together,
|
|
@@ -175,8 +173,10 @@ export interface MessageSendParams {
|
|
|
175
173
|
*/
|
|
176
174
|
message: ChatsAPI.MessageContent;
|
|
177
175
|
}
|
|
176
|
+
export interface MessageListParams extends ListMessagesPaginationParams {
|
|
177
|
+
}
|
|
178
178
|
export declare namespace Messages {
|
|
179
|
-
export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type
|
|
179
|
+
export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type MessageSendParams as MessageSendParams, type MessageListParams as MessageListParams, };
|
|
180
180
|
}
|
|
181
181
|
export { type MessagesListMessagesPagination };
|
|
182
182
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,WAAW,uBAAoB;AAC3C,OAAO,EAAE,8BAA8B,EAAE,uBAAoB;AAC7D,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,iCAA8B;AAC/B,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,WAAW,uBAAoB;AAC3C,OAAO,EAAE,8BAA8B,EAAE,uBAAoB;AAC7D,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,iCAA8B;AAC/B,OAAO,EAA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G;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC;CAClC;AAED,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;CAAG;AAE1E,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,8BAA8B,EAAE,CAAC"}
|
|
@@ -26,22 +26,6 @@ const path_1 = require("../../internal/utils/path.js");
|
|
|
26
26
|
* - Maximum URL length: 2,048 characters.
|
|
27
27
|
*/
|
|
28
28
|
class Messages extends resource_1.APIResource {
|
|
29
|
-
/**
|
|
30
|
-
* Retrieve messages from a specific chat with pagination support.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* // Automatically fetches more pages as needed.
|
|
35
|
-
* for await (const message of client.chats.messages.list(
|
|
36
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
37
|
-
* )) {
|
|
38
|
-
* // ...
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
list(chatID, query = {}, options) {
|
|
43
|
-
return this._client.getAPIList((0, path_1.path) `/v3/chats/${chatID}/messages`, (pagination_1.ListMessagesPagination), { query, ...options });
|
|
44
|
-
}
|
|
45
29
|
/**
|
|
46
30
|
* Send a message to an existing chat. Use this endpoint when you already have a
|
|
47
31
|
* chat ID and want to send additional messages to it.
|
|
@@ -101,6 +85,22 @@ class Messages extends resource_1.APIResource {
|
|
|
101
85
|
send(chatID, body, options) {
|
|
102
86
|
return this._client.post((0, path_1.path) `/v3/chats/${chatID}/messages`, { body, ...options });
|
|
103
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve messages from a specific chat with pagination support.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* // Automatically fetches more pages as needed.
|
|
94
|
+
* for await (const message of client.chats.messages.list(
|
|
95
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
96
|
+
* )) {
|
|
97
|
+
* // ...
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
list(chatID, query = {}, options) {
|
|
102
|
+
return this._client.getAPIList((0, path_1.path) `/v3/chats/${chatID}/messages`, (pagination_1.ListMessagesPagination), { query, ...options });
|
|
103
|
+
}
|
|
104
104
|
}
|
|
105
105
|
exports.Messages = Messages;
|
|
106
106
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,yDAI+B;AAE/B,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,yDAI+B;AAE/B,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,IAAI,CAAC,MAAc,EAAE,IAAuB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAc,EACd,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,aAAa,MAAM,WAAW,EAClC,CAAA,mCAA2C,CAAA,EAC3C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AArFD,4BAqFC"}
|