twilio 6.0.0 → 6.0.1

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.
Files changed (119) hide show
  1. package/lib/rest/ConversationsBase.d.ts +3 -0
  2. package/lib/rest/ConversationsBase.js +5 -0
  3. package/lib/rest/InsightsBase.d.ts +3 -0
  4. package/lib/rest/InsightsBase.js +5 -0
  5. package/lib/rest/IntelligenceBase.d.ts +3 -0
  6. package/lib/rest/IntelligenceBase.js +5 -0
  7. package/lib/rest/KnowledgeBase.d.ts +3 -0
  8. package/lib/rest/KnowledgeBase.js +5 -0
  9. package/lib/rest/Memory.d.ts +4 -0
  10. package/lib/rest/Memory.js +8 -0
  11. package/lib/rest/MemoryBase.d.ts +13 -0
  12. package/lib/rest/MemoryBase.js +31 -0
  13. package/lib/rest/Twilio.d.ts +5 -0
  14. package/lib/rest/Twilio.js +5 -0
  15. package/lib/rest/VoiceBase.d.ts +3 -0
  16. package/lib/rest/VoiceBase.js +5 -0
  17. package/lib/rest/api/v2010/account/call/recording.d.ts +2 -0
  18. package/lib/rest/api/v2010/account/call/recording.js +4 -0
  19. package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
  20. package/lib/rest/api/v2010/account/call/transcription.js +6 -4
  21. package/lib/rest/api/v2010/account/call.d.ts +2 -0
  22. package/lib/rest/api/v2010/account/call.js +4 -0
  23. package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -0
  24. package/lib/rest/api/v2010/account/conference/participant.js +4 -0
  25. package/lib/rest/conversations/V2.d.ts +35 -0
  26. package/lib/rest/conversations/V2.js +67 -0
  27. package/lib/rest/conversations/v2/communication.d.ts +479 -0
  28. package/lib/rest/conversations/v2/communication.js +436 -0
  29. package/lib/rest/conversations/v2/configuration.d.ts +906 -0
  30. package/lib/rest/conversations/v2/configuration.js +619 -0
  31. package/lib/rest/conversations/v2/conversation.d.ts +936 -0
  32. package/lib/rest/conversations/v2/conversation.js +664 -0
  33. package/lib/rest/conversations/v2/operation.d.ts +167 -0
  34. package/lib/rest/conversations/v2/operation.js +170 -0
  35. package/lib/rest/conversations/v2/participant.d.ts +469 -0
  36. package/lib/rest/conversations/v2/participant.js +442 -0
  37. package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
  38. package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
  39. package/lib/rest/insights/V3.d.ts +20 -0
  40. package/lib/rest/insights/V3.js +42 -0
  41. package/lib/rest/insights/v1/call/callSummary.d.ts +10 -10
  42. package/lib/rest/insights/v1/call/event.d.ts +4 -4
  43. package/lib/rest/insights/v1/callSummaries.d.ts +12 -9
  44. package/lib/rest/insights/v3/metadata.d.ts +115 -0
  45. package/lib/rest/insights/v3/metadata.js +118 -0
  46. package/lib/rest/insights/v3/query.d.ts +180 -0
  47. package/lib/rest/insights/v3/query.js +214 -0
  48. package/lib/rest/intelligence/V3.d.ts +35 -0
  49. package/lib/rest/intelligence/V3.js +65 -0
  50. package/lib/rest/intelligence/v3/configuration.d.ts +693 -0
  51. package/lib/rest/intelligence/v3/configuration.js +528 -0
  52. package/lib/rest/intelligence/v3/conversation.d.ts +478 -0
  53. package/lib/rest/intelligence/v3/conversation.js +342 -0
  54. package/lib/rest/intelligence/v3/operator.d.ts +619 -0
  55. package/lib/rest/intelligence/v3/operator.js +493 -0
  56. package/lib/rest/intelligence/v3/operatorResult.d.ts +543 -0
  57. package/lib/rest/intelligence/v3/operatorResult.js +478 -0
  58. package/lib/rest/intelligence/v3/version.d.ts +469 -0
  59. package/lib/rest/intelligence/v3/version.js +341 -0
  60. package/lib/rest/knowledge/V2.d.ts +31 -0
  61. package/lib/rest/knowledge/V2.js +62 -0
  62. package/lib/rest/knowledge/v2/chunk.d.ts +209 -0
  63. package/lib/rest/knowledge/v2/chunk.js +178 -0
  64. package/lib/rest/knowledge/v2/knowledge.d.ts +507 -0
  65. package/lib/rest/knowledge/v2/knowledge.js +466 -0
  66. package/lib/rest/knowledge/v2/knowledgeBasis.d.ts +484 -0
  67. package/lib/rest/knowledge/v2/knowledgeBasis.js +441 -0
  68. package/lib/rest/knowledge/v2/operation.d.ts +162 -0
  69. package/lib/rest/knowledge/v2/operation.js +175 -0
  70. package/lib/rest/knowledge/v2/search.d.ts +180 -0
  71. package/lib/rest/knowledge/v2/search.js +174 -0
  72. package/lib/rest/memory/V1.d.ts +76 -0
  73. package/lib/rest/memory/V1.js +140 -0
  74. package/lib/rest/memory/v1/bulk.d.ts +129 -0
  75. package/lib/rest/memory/v1/bulk.js +158 -0
  76. package/lib/rest/memory/v1/conversationSummary.d.ts +531 -0
  77. package/lib/rest/memory/v1/conversationSummary.js +473 -0
  78. package/lib/rest/memory/v1/dataMapping.d.ts +630 -0
  79. package/lib/rest/memory/v1/dataMapping.js +512 -0
  80. package/lib/rest/memory/v1/event.d.ts +153 -0
  81. package/lib/rest/memory/v1/event.js +159 -0
  82. package/lib/rest/memory/v1/identifier.d.ts +362 -0
  83. package/lib/rest/memory/v1/identifier.js +369 -0
  84. package/lib/rest/memory/v1/identityResolutionSetting.d.ts +247 -0
  85. package/lib/rest/memory/v1/identityResolutionSetting.js +229 -0
  86. package/lib/rest/memory/v1/import.d.ts +292 -0
  87. package/lib/rest/memory/v1/import.js +280 -0
  88. package/lib/rest/memory/v1/lookup.d.ts +82 -0
  89. package/lib/rest/memory/v1/lookup.js +118 -0
  90. package/lib/rest/memory/v1/observation.d.ts +521 -0
  91. package/lib/rest/memory/v1/observation.js +477 -0
  92. package/lib/rest/memory/v1/operation.d.ts +162 -0
  93. package/lib/rest/memory/v1/operation.js +175 -0
  94. package/lib/rest/memory/v1/profile.d.ts +441 -0
  95. package/lib/rest/memory/v1/profile.js +467 -0
  96. package/lib/rest/memory/v1/recall.d.ts +306 -0
  97. package/lib/rest/memory/v1/recall.js +234 -0
  98. package/lib/rest/memory/v1/revision.d.ts +246 -0
  99. package/lib/rest/memory/v1/revision.js +195 -0
  100. package/lib/rest/memory/v1/store.d.ts +503 -0
  101. package/lib/rest/memory/v1/store.js +482 -0
  102. package/lib/rest/memory/v1/trait.d.ts +233 -0
  103. package/lib/rest/memory/v1/trait.js +190 -0
  104. package/lib/rest/memory/v1/traitGroup.d.ts +758 -0
  105. package/lib/rest/memory/v1/traitGroup.js +555 -0
  106. package/lib/rest/messaging/v2/channelsSender.d.ts +8 -0
  107. package/lib/rest/messaging/v2/channelsSender.js +2 -0
  108. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +32 -0
  109. package/lib/rest/previewIam/versionless/organization/roleAssignment.js +14 -0
  110. package/lib/rest/studio/v2/flow.d.ts +4 -0
  111. package/lib/rest/studio/v2/flow.js +8 -0
  112. package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
  113. package/lib/rest/verify/v2/service/webhook.js +8 -8
  114. package/lib/rest/voice/V3.d.ts +15 -0
  115. package/lib/rest/voice/V3.js +37 -0
  116. package/lib/rest/voice/v3/transcription.d.ts +378 -0
  117. package/lib/rest/voice/v3/transcription.js +264 -0
  118. package/lib/twiml/VoiceResponse.d.ts +8 -0
  119. package/package.json +1 -1
@@ -0,0 +1,482 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio Memory API
9
+ * APIs for managing memory stores, profiles, events, and conversational intelligence capabilities.
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator.
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.StorePage = exports.StoreInstance = exports.StoreContextImpl = exports.ServiceRequest = exports.PatchStoreRequest = exports.Meta = void 0;
20
+ exports.StoreListInstance = StoreListInstance;
21
+ const util_1 = require("util");
22
+ const TokenPage_1 = __importDefault(require("../../../base/TokenPage"));
23
+ const deserialize = require("../../../base/deserialize");
24
+ const serialize = require("../../../base/serialize");
25
+ const utility_1 = require("../../../base/utility");
26
+ class Meta {
27
+ constructor(payload) {
28
+ this.key = payload["key"];
29
+ this.pageSize = payload["pageSize"];
30
+ this.nextToken = payload["nextToken"];
31
+ this.previousToken = payload["previousToken"];
32
+ }
33
+ }
34
+ exports.Meta = Meta;
35
+ class PatchStoreRequest {
36
+ constructor(payload) {
37
+ this.displayName = payload["displayName"];
38
+ this.description = payload["description"];
39
+ }
40
+ }
41
+ exports.PatchStoreRequest = PatchStoreRequest;
42
+ class ServiceRequest {
43
+ constructor(payload) {
44
+ this.displayName = payload["displayName"];
45
+ this.description = payload["description"];
46
+ }
47
+ }
48
+ exports.ServiceRequest = ServiceRequest;
49
+ class StoreContextImpl {
50
+ constructor(_version, storeId) {
51
+ this._version = _version;
52
+ if (!(0, utility_1.isValidPathParam)(storeId)) {
53
+ throw new Error("Parameter 'storeId' is not valid.");
54
+ }
55
+ this._solution = { storeId };
56
+ this._uri = `/ControlPlane/Stores/${storeId}`;
57
+ }
58
+ fetch(callback) {
59
+ const headers = {};
60
+ headers["Accept"] = "application/json";
61
+ const instance = this;
62
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
63
+ uri: instance._uri,
64
+ method: "get",
65
+ headers,
66
+ });
67
+ operationPromise = operationPromise.then((payload) => new StoreInstance(operationVersion, payload, instance._solution.storeId));
68
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
69
+ return operationPromise;
70
+ }
71
+ fetchWithHttpInfo(callback) {
72
+ const headers = {};
73
+ headers["Accept"] = "application/json";
74
+ const instance = this;
75
+ let operationVersion = instance._version;
76
+ // CREATE, FETCH, UPDATE operations
77
+ let operationPromise = operationVersion
78
+ .fetchWithResponseInfo({
79
+ uri: instance._uri,
80
+ method: "get",
81
+ headers,
82
+ })
83
+ .then((response) => ({
84
+ ...response,
85
+ body: new StoreInstance(operationVersion, response.body, instance._solution.storeId),
86
+ }));
87
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
88
+ return operationPromise;
89
+ }
90
+ patch(params, headers, callback) {
91
+ if (params instanceof Function) {
92
+ callback = params;
93
+ params = {};
94
+ }
95
+ else {
96
+ params =
97
+ params || {};
98
+ }
99
+ let data = {};
100
+ data = params;
101
+ if (headers === null || headers === undefined) {
102
+ headers = {};
103
+ }
104
+ headers["Content-Type"] = "application/json";
105
+ headers["Accept"] = "application/json";
106
+ const instance = this;
107
+ let operationVersion = instance._version, operationPromise = operationVersion.patch({
108
+ uri: instance._uri,
109
+ method: "patch",
110
+ data,
111
+ headers,
112
+ });
113
+ operationPromise = operationPromise.then((payload) => new StoreInstance(operationVersion, payload, instance._solution.storeId));
114
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
115
+ return operationPromise;
116
+ }
117
+ patchWithHttpInfo(params, headers, callback) {
118
+ if (params instanceof Function) {
119
+ callback = params;
120
+ params = {};
121
+ }
122
+ else {
123
+ params =
124
+ params || {};
125
+ }
126
+ let data = {};
127
+ data = params;
128
+ if (headers === null || headers === undefined) {
129
+ headers = {};
130
+ }
131
+ headers["Content-Type"] = "application/json";
132
+ headers["Accept"] = "application/json";
133
+ const instance = this;
134
+ let operationVersion = instance._version;
135
+ // CREATE, FETCH, UPDATE operations
136
+ let operationPromise = operationVersion
137
+ .patchWithResponseInfo({
138
+ uri: instance._uri,
139
+ method: "patch",
140
+ data,
141
+ headers,
142
+ })
143
+ .then((response) => ({
144
+ ...response,
145
+ body: new StoreInstance(operationVersion, response.body, instance._solution.storeId),
146
+ }));
147
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
148
+ return operationPromise;
149
+ }
150
+ /**
151
+ * Provide a user-friendly representation
152
+ *
153
+ * @returns Object
154
+ */
155
+ toJSON() {
156
+ return this._solution;
157
+ }
158
+ [util_1.inspect.custom](_depth, options) {
159
+ return (0, util_1.inspect)(this.toJSON(), options);
160
+ }
161
+ }
162
+ exports.StoreContextImpl = StoreContextImpl;
163
+ class StoreInstance {
164
+ constructor(_version, _payload, storeId) {
165
+ this._version = _version;
166
+ const payload = _payload;
167
+ this.message = payload.message;
168
+ this.statusUrl = payload.statusUrl;
169
+ this.stores = payload.stores;
170
+ this.meta =
171
+ payload.meta !== null && payload.meta !== undefined
172
+ ? new Meta(payload.meta)
173
+ : null;
174
+ this.displayName = payload.displayName;
175
+ this.description = payload.description;
176
+ this.id = payload.id;
177
+ this.status = payload.status;
178
+ this.intelligenceServiceId = payload.intelligenceServiceId;
179
+ this.version = deserialize.integer(payload.version);
180
+ this._solution = { storeId: storeId };
181
+ }
182
+ get _proxy() {
183
+ this._context =
184
+ this._context ||
185
+ new StoreContextImpl(this._version, this._solution.storeId);
186
+ return this._context;
187
+ }
188
+ /**
189
+ * Fetch a StoreInstance
190
+ *
191
+ * @param callback - Callback to handle processed record
192
+ *
193
+ * @returns Resolves to processed StoreInstance
194
+ */
195
+ fetch(callback) {
196
+ return this._proxy.fetch(callback);
197
+ }
198
+ /**
199
+ * Fetch a StoreInstance and return HTTP info
200
+ *
201
+ * @param callback - Callback to handle processed record
202
+ *
203
+ * @returns Resolves to processed StoreInstance with HTTP metadata
204
+ */
205
+ fetchWithHttpInfo(callback) {
206
+ return this._proxy.fetchWithHttpInfo(callback);
207
+ }
208
+ patch(params, callback) {
209
+ return this._proxy.patch(params, callback);
210
+ }
211
+ patchWithHttpInfo(params, callback) {
212
+ return this._proxy.patchWithHttpInfo(params, callback);
213
+ }
214
+ /**
215
+ * Provide a user-friendly representation
216
+ *
217
+ * @returns Object
218
+ */
219
+ toJSON() {
220
+ return {
221
+ message: this.message,
222
+ statusUrl: this.statusUrl,
223
+ stores: this.stores,
224
+ meta: this.meta,
225
+ displayName: this.displayName,
226
+ description: this.description,
227
+ id: this.id,
228
+ status: this.status,
229
+ intelligenceServiceId: this.intelligenceServiceId,
230
+ version: this.version,
231
+ };
232
+ }
233
+ [util_1.inspect.custom](_depth, options) {
234
+ return (0, util_1.inspect)(this.toJSON(), options);
235
+ }
236
+ }
237
+ exports.StoreInstance = StoreInstance;
238
+ function StoreListInstance(version) {
239
+ const instance = ((storeId) => instance.get(storeId));
240
+ instance.get = function get(storeId) {
241
+ return new StoreContextImpl(version, storeId);
242
+ };
243
+ instance._version = version;
244
+ instance._solution = {};
245
+ instance._uri = `/ControlPlane/Stores`;
246
+ instance.create = function create(params, headers, callback) {
247
+ if (params === null || params === undefined) {
248
+ throw new Error('Required parameter "params" missing.');
249
+ }
250
+ let data = {};
251
+ data = params;
252
+ if (headers === null || headers === undefined) {
253
+ headers = {};
254
+ }
255
+ headers["Content-Type"] = "application/json";
256
+ headers["Accept"] = "application/json";
257
+ let operationVersion = version, operationPromise = operationVersion.create({
258
+ uri: instance._uri,
259
+ method: "post",
260
+ data,
261
+ headers,
262
+ });
263
+ operationPromise = operationPromise.then((payload) => new StoreInstance(operationVersion, payload));
264
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
265
+ return operationPromise;
266
+ };
267
+ instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
268
+ if (params === null || params === undefined) {
269
+ throw new Error('Required parameter "params" missing.');
270
+ }
271
+ let data = {};
272
+ data = params;
273
+ if (headers === null || headers === undefined) {
274
+ headers = {};
275
+ }
276
+ headers["Content-Type"] = "application/json";
277
+ headers["Accept"] = "application/json";
278
+ let operationVersion = version;
279
+ // CREATE, FETCH, UPDATE operations
280
+ let operationPromise = operationVersion
281
+ .createWithResponseInfo({
282
+ uri: instance._uri,
283
+ method: "post",
284
+ data,
285
+ headers,
286
+ })
287
+ .then((response) => ({
288
+ ...response,
289
+ body: new StoreInstance(operationVersion, response.body),
290
+ }));
291
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
292
+ return operationPromise;
293
+ };
294
+ instance.page = function page(params, callback) {
295
+ if (params instanceof Function) {
296
+ callback = params;
297
+ params = {};
298
+ }
299
+ else {
300
+ params = params || {};
301
+ }
302
+ let data = {};
303
+ if (params["pageSize"] !== undefined)
304
+ data["pageSize"] = params["pageSize"];
305
+ if (params["pageToken"] !== undefined)
306
+ data["pageToken"] = params["pageToken"];
307
+ if (params["orderBy"] !== undefined)
308
+ data["orderBy"] = params["orderBy"];
309
+ const headers = {};
310
+ headers["Accept"] = "application/json";
311
+ let operationVersion = version, operationPromise = operationVersion.page({
312
+ uri: instance._uri,
313
+ method: "get",
314
+ params: data,
315
+ headers,
316
+ });
317
+ operationPromise = operationPromise.then((payload) => new StorePage(operationVersion, payload, instance._uri, data, instance._solution));
318
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
319
+ return operationPromise;
320
+ };
321
+ instance.each = instance._version.each;
322
+ instance.list = function list(params, callback) {
323
+ if (params instanceof Function) {
324
+ callback = params;
325
+ params = {};
326
+ }
327
+ params = params || {};
328
+ let allRecords = [];
329
+ function fetchNextPage(nextPageParams) {
330
+ return instance.page(nextPageParams).then((page) => {
331
+ const payload = page["_payload"];
332
+ const records = payload && payload["stores"] ? payload["stores"] : [];
333
+ allRecords = allRecords.concat(records);
334
+ if (params.limit && allRecords.length >= params.limit) {
335
+ allRecords = allRecords.slice(0, params.limit);
336
+ return allRecords;
337
+ }
338
+ const nextToken = page.nextPageUrl
339
+ ? new URL(page.nextPageUrl).searchParams.get("PageToken")
340
+ : null;
341
+ if (nextToken) {
342
+ return fetchNextPage({ ...nextPageParams, pageToken: nextToken });
343
+ }
344
+ return allRecords;
345
+ });
346
+ }
347
+ const promise = fetchNextPage(params);
348
+ return instance._version.setPromiseCallback(promise, callback);
349
+ };
350
+ instance.getPage = function getPage(targetUrl, callback) {
351
+ const operationPromise = instance._version._domain.twilio.request({
352
+ method: "get",
353
+ uri: targetUrl,
354
+ });
355
+ let pagePromise = operationPromise.then((payload) => new StorePage(instance._version, payload, instance._uri, {}, instance._solution));
356
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
357
+ return pagePromise;
358
+ };
359
+ instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
360
+ if (params instanceof Function) {
361
+ callback = params;
362
+ params = {};
363
+ }
364
+ else {
365
+ params = params || {};
366
+ }
367
+ let data = {};
368
+ if (params["pageSize"] !== undefined)
369
+ data["pageSize"] = params["pageSize"];
370
+ if (params["pageToken"] !== undefined)
371
+ data["pageToken"] = params["pageToken"];
372
+ if (params["orderBy"] !== undefined)
373
+ data["orderBy"] = params["orderBy"];
374
+ const headers = {};
375
+ headers["Accept"] = "application/json";
376
+ let operationVersion = version;
377
+ // For page operations, use page() directly as it already returns { statusCode, body, headers }
378
+ // IMPORTANT: Pass full response to Page constructor, not response.body
379
+ let operationPromise = operationVersion
380
+ .page({ uri: instance._uri, method: "get", params: data, headers })
381
+ .then((response) => ({
382
+ statusCode: response.statusCode,
383
+ headers: response.headers,
384
+ body: new StorePage(operationVersion, response, instance._uri, data, instance._solution),
385
+ }));
386
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
387
+ return operationPromise;
388
+ };
389
+ instance.each = instance._version.each;
390
+ instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
391
+ instance.listWithHttpInfo = function listWithHttpInfo(params, callback) {
392
+ if (params instanceof Function) {
393
+ callback = params;
394
+ params = {};
395
+ }
396
+ params = params || {};
397
+ let allRecords = [];
398
+ let lastResponse;
399
+ function fetchNextPage(nextPageParams) {
400
+ return instance
401
+ .pageWithHttpInfo(nextPageParams)
402
+ .then((response) => {
403
+ lastResponse = response;
404
+ const page = response.body;
405
+ // For primitive arrays, directly access the records array from the payload
406
+ // Access _payload using bracket notation to bypass TypeScript protected access
407
+ const payload = page["_payload"];
408
+ const records = payload && payload["stores"] ? payload["stores"] : [];
409
+ allRecords = allRecords.concat(records);
410
+ if (params.limit && allRecords.length >= params.limit) {
411
+ allRecords = allRecords.slice(0, params.limit);
412
+ return {
413
+ statusCode: lastResponse.statusCode,
414
+ headers: lastResponse.headers,
415
+ body: allRecords,
416
+ };
417
+ }
418
+ const nextToken = page.nextPageUrl
419
+ ? new URL(page.nextPageUrl).searchParams.get("PageToken")
420
+ : null;
421
+ if (nextToken) {
422
+ return fetchNextPage({ ...nextPageParams, pageToken: nextToken });
423
+ }
424
+ return {
425
+ statusCode: lastResponse.statusCode,
426
+ headers: lastResponse.headers,
427
+ body: allRecords,
428
+ };
429
+ });
430
+ }
431
+ const promise = fetchNextPage(params);
432
+ return instance._version.setPromiseCallback(promise, callback);
433
+ };
434
+ instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
435
+ // Use request() directly as it already returns { statusCode, body, headers }
436
+ const operationPromise = instance._version._domain.twilio.request({
437
+ method: "get",
438
+ uri: targetUrl,
439
+ });
440
+ let pagePromise = operationPromise.then((response) => ({
441
+ statusCode: response.statusCode,
442
+ headers: response.headers,
443
+ body: new StorePage(instance._version, response, instance._uri, {}, instance._solution),
444
+ }));
445
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
446
+ return pagePromise;
447
+ };
448
+ instance.toJSON = function toJSON() {
449
+ return instance._solution;
450
+ };
451
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
452
+ return (0, util_1.inspect)(instance.toJSON(), options);
453
+ };
454
+ return instance;
455
+ }
456
+ class StorePage extends TokenPage_1.default {
457
+ /**
458
+ * Initialize the StorePage
459
+ *
460
+ * @param version - Version of the resource
461
+ * @param response - Response from the API
462
+ * @param uri - URI of the resource
463
+ * @param params - Query parameters
464
+ * @param solution - Path solution
465
+ */
466
+ constructor(version, response, uri, params, solution) {
467
+ super(version, response, uri, params, solution);
468
+ }
469
+ /**
470
+ * Build an instance of StoreInstance
471
+ *
472
+ * @param payload - Payload response from the API
473
+ */
474
+ getInstance(payload) {
475
+ // Array items are primitives (strings, numbers), return directly
476
+ return payload;
477
+ }
478
+ [util_1.inspect.custom](depth, options) {
479
+ return (0, util_1.inspect)(this.toJSON(), options);
480
+ }
481
+ }
482
+ exports.StorePage = StorePage;