@surgeapi/node 0.34.0 → 0.36.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 +48 -0
- package/README.md +31 -0
- package/client.d.mts +18 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +18 -8
- package/client.d.ts.map +1 -1
- package/client.js +21 -2
- package/client.js.map +1 -1
- package/client.mjs +24 -5
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +60 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +60 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +115 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +109 -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/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- 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/blasts.d.mts +4 -4
- package/resources/blasts.d.mts.map +1 -1
- package/resources/blasts.d.ts +4 -4
- package/resources/blasts.d.ts.map +1 -1
- package/resources/campaigns.d.mts +15 -0
- package/resources/campaigns.d.mts.map +1 -1
- package/resources/campaigns.d.ts +15 -0
- package/resources/campaigns.d.ts.map +1 -1
- package/resources/campaigns.js +13 -0
- package/resources/campaigns.js.map +1 -1
- package/resources/campaigns.mjs +13 -0
- package/resources/campaigns.mjs.map +1 -1
- package/resources/contacts.d.mts +19 -1
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +19 -1
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +20 -0
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +20 -0
- package/resources/contacts.mjs.map +1 -1
- package/resources/index.d.mts +5 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -4
- 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 +4 -3
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +21 -3
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +21 -3
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +20 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +20 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +19 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +19 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +20 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +20 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/recordings.d.mts +31 -0
- package/resources/recordings.d.mts.map +1 -0
- package/resources/recordings.d.ts +31 -0
- package/resources/recordings.d.ts.map +1 -0
- package/resources/recordings.js +24 -0
- package/resources/recordings.js.map +1 -0
- package/resources/recordings.mjs +20 -0
- package/resources/recordings.mjs.map +1 -0
- package/resources/webhooks.d.mts +138 -6
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +138 -6
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +80 -6
- package/src/core/pagination.ts +176 -0
- package/src/index.ts +1 -0
- package/src/internal/parse.ts +6 -0
- package/src/pagination.ts +2 -0
- package/src/resources/blasts.ts +4 -4
- package/src/resources/campaigns.ts +19 -0
- package/src/resources/contacts.ts +31 -0
- package/src/resources/index.ts +25 -3
- package/src/resources/messages.ts +37 -3
- package/src/resources/phone-numbers.ts +35 -1
- package/src/resources/recordings.ts +38 -0
- package/src/resources/webhooks.ts +184 -5
- 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/messages.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
2
|
import * as ContactsAPI from "./contacts.mjs";
|
|
3
3
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
+
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
|
|
4
5
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
6
|
export declare class Messages extends APIResource {
|
|
6
7
|
/**
|
|
@@ -54,7 +55,22 @@ export declare class Messages extends APIResource {
|
|
|
54
55
|
* ```
|
|
55
56
|
*/
|
|
56
57
|
retrieve(id: string, options?: RequestOptions): APIPromise<Message>;
|
|
58
|
+
/**
|
|
59
|
+
* List all messages for an account with cursor-based pagination.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* // Automatically fetches more pages as needed.
|
|
64
|
+
* for await (const message of client.messages.list(
|
|
65
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
66
|
+
* )) {
|
|
67
|
+
* // ...
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
list(accountID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesCursor, Message>;
|
|
57
72
|
}
|
|
73
|
+
export type MessagesCursor = Cursor<Message>;
|
|
58
74
|
/**
|
|
59
75
|
* A Message is a communication sent to a Contact.
|
|
60
76
|
*/
|
|
@@ -68,11 +84,11 @@ export interface Message {
|
|
|
68
84
|
* The ID of the blast this message belongs to, if any. This can be used to
|
|
69
85
|
* attribute messages back to a specific blast.
|
|
70
86
|
*/
|
|
71
|
-
blast_id?: string;
|
|
87
|
+
blast_id?: string | null;
|
|
72
88
|
/**
|
|
73
89
|
* The message body.
|
|
74
90
|
*/
|
|
75
|
-
body?: string;
|
|
91
|
+
body?: string | null;
|
|
76
92
|
/**
|
|
77
93
|
* A conversation with a Contact
|
|
78
94
|
*/
|
|
@@ -259,7 +275,9 @@ export declare namespace MessageCreateParams {
|
|
|
259
275
|
}
|
|
260
276
|
}
|
|
261
277
|
}
|
|
278
|
+
export interface MessageListParams extends CursorParams {
|
|
279
|
+
}
|
|
262
280
|
export declare namespace Messages {
|
|
263
|
-
export { type Message as Message, type MessageCreateParams as MessageCreateParams };
|
|
281
|
+
export { type Message as Message, type MessagesCursor as MessagesCursor, type MessageCreateParams as MessageCreateParams, type MessageListParams as MessageListParams, };
|
|
264
282
|
}
|
|
265
283
|
//# sourceMappingURL=messages.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInG;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,E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ource.js";
|
|
2
2
|
import * as ContactsAPI from "./contacts.js";
|
|
3
3
|
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
+
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.js";
|
|
4
5
|
import { RequestOptions } from "../internal/request-options.js";
|
|
5
6
|
export declare class Messages extends APIResource {
|
|
6
7
|
/**
|
|
@@ -54,7 +55,22 @@ export declare class Messages extends APIResource {
|
|
|
54
55
|
* ```
|
|
55
56
|
*/
|
|
56
57
|
retrieve(id: string, options?: RequestOptions): APIPromise<Message>;
|
|
58
|
+
/**
|
|
59
|
+
* List all messages for an account with cursor-based pagination.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* // Automatically fetches more pages as needed.
|
|
64
|
+
* for await (const message of client.messages.list(
|
|
65
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
66
|
+
* )) {
|
|
67
|
+
* // ...
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
list(accountID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesCursor, Message>;
|
|
57
72
|
}
|
|
73
|
+
export type MessagesCursor = Cursor<Message>;
|
|
58
74
|
/**
|
|
59
75
|
* A Message is a communication sent to a Contact.
|
|
60
76
|
*/
|
|
@@ -68,11 +84,11 @@ export interface Message {
|
|
|
68
84
|
* The ID of the blast this message belongs to, if any. This can be used to
|
|
69
85
|
* attribute messages back to a specific blast.
|
|
70
86
|
*/
|
|
71
|
-
blast_id?: string;
|
|
87
|
+
blast_id?: string | null;
|
|
72
88
|
/**
|
|
73
89
|
* The message body.
|
|
74
90
|
*/
|
|
75
|
-
body?: string;
|
|
91
|
+
body?: string | null;
|
|
76
92
|
/**
|
|
77
93
|
* A conversation with a Contact
|
|
78
94
|
*/
|
|
@@ -259,7 +275,9 @@ export declare namespace MessageCreateParams {
|
|
|
259
275
|
}
|
|
260
276
|
}
|
|
261
277
|
}
|
|
278
|
+
export interface MessageListParams extends CursorParams {
|
|
279
|
+
}
|
|
262
280
|
export declare namespace Messages {
|
|
263
|
-
export { type Message as Message, type MessageCreateParams as MessageCreateParams };
|
|
281
|
+
export { type Message as Message, type MessagesCursor as MessagesCursor, type MessageCreateParams as MessageCreateParams, type MessageListParams as MessageListParams, };
|
|
264
282
|
}
|
|
265
283
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInG;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInG;;;;;;;;;OASG;IAC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AEG;QACH,UAAiB,UAAU;YACzB;;eAEG;YACH,GAAG,EAAE,MAAM,CAAC;SACb;KACF;IAED,UAAiB,mBAAmB;QAClC;;;WAGG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX,WAAW,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAEpD;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;;WAGG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QAErC;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,UAAiB,mBAAmB,CAAC;QACnC;;WAEG;QACH,UAAiB,UAAU;YACzB;;eAEG;YACH,GAAG,EAAE,MAAM,CAAC;SACb;KACF;CACF;AAED,MAAM,WAAW,iBAAkB,SAAQ,YAAY;CAAG;AAE1D,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/messages.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Messages = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
6
7
|
const path_1 = require("../internal/utils/path.js");
|
|
7
8
|
class Messages extends resource_1.APIResource {
|
|
8
9
|
/**
|
|
@@ -60,6 +61,25 @@ class Messages extends resource_1.APIResource {
|
|
|
60
61
|
retrieve(id, options) {
|
|
61
62
|
return this._client.get((0, path_1.path) `/messages/${id}`, options);
|
|
62
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* List all messages for an account with cursor-based pagination.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* // Automatically fetches more pages as needed.
|
|
70
|
+
* for await (const message of client.messages.list(
|
|
71
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
72
|
+
* )) {
|
|
73
|
+
* // ...
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
list(accountID, query = {}, options) {
|
|
78
|
+
return this._client.getAPIList((0, path_1.path) `/accounts/${accountID}/messages`, (pagination_1.Cursor), {
|
|
79
|
+
query,
|
|
80
|
+
...options,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
63
83
|
}
|
|
64
84
|
exports.Messages = Messages;
|
|
65
85
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAA4E;AAE5E,oDAA8C;AAE9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,WAAW,EAAE,CAAA,mBAAe,CAAA,EAAE;YACrF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAjFD,4BAiFC"}
|
package/resources/messages.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { Cursor } from "../core/pagination.mjs";
|
|
3
4
|
import { path } from "../internal/utils/path.mjs";
|
|
4
5
|
export class Messages extends APIResource {
|
|
5
6
|
/**
|
|
@@ -57,5 +58,24 @@ export class Messages extends APIResource {
|
|
|
57
58
|
retrieve(id, options) {
|
|
58
59
|
return this._client.get(path `/messages/${id}`, options);
|
|
59
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* List all messages for an account with cursor-based pagination.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* // Automatically fetches more pages as needed.
|
|
67
|
+
* for await (const message of client.messages.list(
|
|
68
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
69
|
+
* )) {
|
|
70
|
+
* // ...
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
list(accountID, query = {}, options) {
|
|
75
|
+
return this._client.getAPIList(path `/accounts/${accountID}/messages`, (Cursor), {
|
|
76
|
+
query,
|
|
77
|
+
...options,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
60
80
|
}
|
|
61
81
|
//# sourceMappingURL=messages.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,MAAM,EAAkC;OAE1C,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,aAAa,SAAS,WAAW,EAAE,CAAA,MAAe,CAAA,EAAE;YACrF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
|
|
3
4
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
5
|
export declare class PhoneNumbers extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* List all phone numbers for an account with cursor-based pagination.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Automatically fetches more pages as needed.
|
|
12
|
+
* for await (const phoneNumber of client.phoneNumbers.list(
|
|
13
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
14
|
+
* )) {
|
|
15
|
+
* // ...
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
list(accountID: string, query?: PhoneNumberListParams | null | undefined, options?: RequestOptions): PagePromise<PhoneNumbersCursor, PhoneNumber>;
|
|
5
20
|
/**
|
|
6
21
|
* Purchase a new phone number for the account. You can specify search criteria or
|
|
7
22
|
* let the system select a random number.
|
|
@@ -15,6 +30,7 @@ export declare class PhoneNumbers extends APIResource {
|
|
|
15
30
|
*/
|
|
16
31
|
purchase(accountID: string, body: PhoneNumberPurchaseParams, options?: RequestOptions): APIPromise<PhoneNumber>;
|
|
17
32
|
}
|
|
33
|
+
export type PhoneNumbersCursor = Cursor<PhoneNumber>;
|
|
18
34
|
/**
|
|
19
35
|
* A phone number that can be used to send and receive messages and calls
|
|
20
36
|
*/
|
|
@@ -32,6 +48,8 @@ export interface PhoneNumber {
|
|
|
32
48
|
*/
|
|
33
49
|
type: 'local' | 'short_code' | 'toll_free';
|
|
34
50
|
}
|
|
51
|
+
export interface PhoneNumberListParams extends CursorParams {
|
|
52
|
+
}
|
|
35
53
|
export interface PhoneNumberPurchaseParams {
|
|
36
54
|
/**
|
|
37
55
|
* The desired area code for this phone number. If provided without type, the type
|
|
@@ -55,6 +73,6 @@ export interface PhoneNumberPurchaseParams {
|
|
|
55
73
|
type?: 'local' | 'toll_free';
|
|
56
74
|
}
|
|
57
75
|
export declare namespace PhoneNumbers {
|
|
58
|
-
export { type PhoneNumber as PhoneNumber, type PhoneNumberPurchaseParams as PhoneNumberPurchaseParams };
|
|
76
|
+
export { type PhoneNumber as PhoneNumber, type PhoneNumbersCursor as PhoneNumbersCursor, type PhoneNumberListParams as PhoneNumberListParams, type PhoneNumberPurchaseParams as PhoneNumberPurchaseParams, };
|
|
59
77
|
}
|
|
60
78
|
//# sourceMappingURL=phone-numbers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.d.mts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC;CAG3B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,WAAW,CAAC;CAC5C;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"phone-numbers.d.mts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kBAAkB,EAAE,WAAW,CAAC;IAO/C;;;;;;;;;;OAUG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC;CAG3B;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,WAAW,CAAC;CAC5C;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;CAAG;AAE9D,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.js";
|
|
3
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
5
|
export declare class PhoneNumbers extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* List all phone numbers for an account with cursor-based pagination.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Automatically fetches more pages as needed.
|
|
12
|
+
* for await (const phoneNumber of client.phoneNumbers.list(
|
|
13
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
14
|
+
* )) {
|
|
15
|
+
* // ...
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
list(accountID: string, query?: PhoneNumberListParams | null | undefined, options?: RequestOptions): PagePromise<PhoneNumbersCursor, PhoneNumber>;
|
|
5
20
|
/**
|
|
6
21
|
* Purchase a new phone number for the account. You can specify search criteria or
|
|
7
22
|
* let the system select a random number.
|
|
@@ -15,6 +30,7 @@ export declare class PhoneNumbers extends APIResource {
|
|
|
15
30
|
*/
|
|
16
31
|
purchase(accountID: string, body: PhoneNumberPurchaseParams, options?: RequestOptions): APIPromise<PhoneNumber>;
|
|
17
32
|
}
|
|
33
|
+
export type PhoneNumbersCursor = Cursor<PhoneNumber>;
|
|
18
34
|
/**
|
|
19
35
|
* A phone number that can be used to send and receive messages and calls
|
|
20
36
|
*/
|
|
@@ -32,6 +48,8 @@ export interface PhoneNumber {
|
|
|
32
48
|
*/
|
|
33
49
|
type: 'local' | 'short_code' | 'toll_free';
|
|
34
50
|
}
|
|
51
|
+
export interface PhoneNumberListParams extends CursorParams {
|
|
52
|
+
}
|
|
35
53
|
export interface PhoneNumberPurchaseParams {
|
|
36
54
|
/**
|
|
37
55
|
* The desired area code for this phone number. If provided without type, the type
|
|
@@ -55,6 +73,6 @@ export interface PhoneNumberPurchaseParams {
|
|
|
55
73
|
type?: 'local' | 'toll_free';
|
|
56
74
|
}
|
|
57
75
|
export declare namespace PhoneNumbers {
|
|
58
|
-
export { type PhoneNumber as PhoneNumber, type PhoneNumberPurchaseParams as PhoneNumberPurchaseParams };
|
|
76
|
+
export { type PhoneNumber as PhoneNumber, type PhoneNumbersCursor as PhoneNumbersCursor, type PhoneNumberListParams as PhoneNumberListParams, type PhoneNumberPurchaseParams as PhoneNumberPurchaseParams, };
|
|
59
77
|
}
|
|
60
78
|
//# sourceMappingURL=phone-numbers.d.ts.map
|
|
@@ -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;AAGzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC;CAG3B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,WAAW,CAAC;CAC5C;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,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,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.PhoneNumbers = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
6
7
|
const path_1 = require("../internal/utils/path.js");
|
|
7
8
|
class PhoneNumbers extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List all phone numbers for an account with cursor-based pagination.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Automatically fetches more pages as needed.
|
|
15
|
+
* for await (const phoneNumber of client.phoneNumbers.list(
|
|
16
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
17
|
+
* )) {
|
|
18
|
+
* // ...
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
list(accountID, query = {}, options) {
|
|
23
|
+
return this._client.getAPIList((0, path_1.path) `/accounts/${accountID}/phone_numbers`, (pagination_1.Cursor), {
|
|
24
|
+
query,
|
|
25
|
+
...options,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
8
28
|
/**
|
|
9
29
|
* Purchase a new phone number for the account. You can specify search criteria or
|
|
10
30
|
* let the system select a random number.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAE5E,oDAA8C;AAE9C,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,gBAAgB,EAAE,CAAA,mBAAmB,CAAA,EAAE;YAC9F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CACN,SAAiB,EACjB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF;AA3CD,oCA2CC"}
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { Cursor } from "../core/pagination.mjs";
|
|
3
4
|
import { path } from "../internal/utils/path.mjs";
|
|
4
5
|
export class PhoneNumbers extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* List all phone numbers for an account with cursor-based pagination.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Automatically fetches more pages as needed.
|
|
12
|
+
* for await (const phoneNumber of client.phoneNumbers.list(
|
|
13
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
14
|
+
* )) {
|
|
15
|
+
* // ...
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
list(accountID, query = {}, options) {
|
|
20
|
+
return this._client.getAPIList(path `/accounts/${accountID}/phone_numbers`, (Cursor), {
|
|
21
|
+
query,
|
|
22
|
+
...options,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
5
25
|
/**
|
|
6
26
|
* Purchase a new phone number for the account. You can specify search criteria or
|
|
7
27
|
* let the system select a random number.
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAE1C,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,aAAa,SAAS,gBAAgB,EAAE,CAAA,MAAmB,CAAA,EAAE;YAC9F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CACN,SAAiB,EACjB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as Shared from "./shared.mjs";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
export declare class Recordings extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Redirects to a signed URL where the recording audio file can be downloaded. URL
|
|
8
|
+
* is short-lived, so redirect should be followed immediately.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const response = await client.recordings.getFile(
|
|
13
|
+
* 'rec_01kfyc9dgdec1avkgs7tng8htg',
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
getFile(recordingID: string, options?: RequestOptions): APIPromise<RecordingGetFileResponse>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An error response
|
|
21
|
+
*/
|
|
22
|
+
export interface RecordingGetFileResponse {
|
|
23
|
+
/**
|
|
24
|
+
* An error response
|
|
25
|
+
*/
|
|
26
|
+
error: Shared.Error;
|
|
27
|
+
}
|
|
28
|
+
export declare namespace Recordings {
|
|
29
|
+
export { type RecordingGetFileResponse as RecordingGetFileResponse };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=recordings.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordings.d.mts","sourceRoot":"","sources":["../src/resources/recordings.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAG7F;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EAAE,KAAK,wBAAwB,IAAI,wBAAwB,EAAE,CAAC;CACtE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import * as Shared from "./shared.js";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
export declare class Recordings extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Redirects to a signed URL where the recording audio file can be downloaded. URL
|
|
8
|
+
* is short-lived, so redirect should be followed immediately.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const response = await client.recordings.getFile(
|
|
13
|
+
* 'rec_01kfyc9dgdec1avkgs7tng8htg',
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
getFile(recordingID: string, options?: RequestOptions): APIPromise<RecordingGetFileResponse>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An error response
|
|
21
|
+
*/
|
|
22
|
+
export interface RecordingGetFileResponse {
|
|
23
|
+
/**
|
|
24
|
+
* An error response
|
|
25
|
+
*/
|
|
26
|
+
error: Shared.Error;
|
|
27
|
+
}
|
|
28
|
+
export declare namespace Recordings {
|
|
29
|
+
export { type RecordingGetFileResponse as RecordingGetFileResponse };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=recordings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordings.d.ts","sourceRoot":"","sources":["../src/resources/recordings.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAG7F;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EAAE,KAAK,wBAAwB,IAAI,wBAAwB,EAAE,CAAC;CACtE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.Recordings = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const path_1 = require("../internal/utils/path.js");
|
|
7
|
+
class Recordings extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Redirects to a signed URL where the recording audio file can be downloaded. URL
|
|
10
|
+
* is short-lived, so redirect should be followed immediately.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response = await client.recordings.getFile(
|
|
15
|
+
* 'rec_01kfyc9dgdec1avkgs7tng8htg',
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
getFile(recordingID, options) {
|
|
20
|
+
return this._client.get((0, path_1.path) `/recordings/${recordingID}/file`, options);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Recordings = Recordings;
|
|
24
|
+
//# sourceMappingURL=recordings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordings.js","sourceRoot":"","sources":["../src/resources/recordings.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAA8C;AAE9C,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAmB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,WAAW,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;CACF;AAfD,gCAeC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { path } from "../internal/utils/path.mjs";
|
|
4
|
+
export class Recordings extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Redirects to a signed URL where the recording audio file can be downloaded. URL
|
|
7
|
+
* is short-lived, so redirect should be followed immediately.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const response = await client.recordings.getFile(
|
|
12
|
+
* 'rec_01kfyc9dgdec1avkgs7tng8htg',
|
|
13
|
+
* );
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
getFile(recordingID, options) {
|
|
17
|
+
return this._client.get(path `/recordings/${recordingID}/file`, options);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=recordings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordings.mjs","sourceRoot":"","sources":["../src/resources/recordings.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAmB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,WAAW,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;CACF"}
|