twilio 6.0.0 → 6.0.2
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/lib/rest/ConversationsBase.d.ts +3 -0
- package/lib/rest/ConversationsBase.js +5 -0
- package/lib/rest/InsightsBase.d.ts +3 -0
- package/lib/rest/InsightsBase.js +5 -0
- package/lib/rest/IntelligenceBase.d.ts +3 -0
- package/lib/rest/IntelligenceBase.js +5 -0
- package/lib/rest/KnowledgeBase.d.ts +3 -0
- package/lib/rest/KnowledgeBase.js +5 -0
- package/lib/rest/Memory.d.ts +4 -0
- package/lib/rest/Memory.js +8 -0
- package/lib/rest/MemoryBase.d.ts +13 -0
- package/lib/rest/MemoryBase.js +31 -0
- package/lib/rest/Twilio.d.ts +5 -0
- package/lib/rest/Twilio.js +5 -0
- package/lib/rest/VoiceBase.d.ts +3 -0
- package/lib/rest/VoiceBase.js +5 -0
- package/lib/rest/api/v2010/account/call/recording.d.ts +2 -0
- package/lib/rest/api/v2010/account/call/recording.js +4 -0
- package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
- package/lib/rest/api/v2010/account/call/transcription.js +6 -4
- package/lib/rest/api/v2010/account/call.d.ts +2 -0
- package/lib/rest/api/v2010/account/call.js +4 -0
- package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -0
- package/lib/rest/api/v2010/account/conference/participant.js +4 -0
- package/lib/rest/conversations/V2.d.ts +38 -0
- package/lib/rest/conversations/V2.js +72 -0
- package/lib/rest/conversations/v2/action.d.ts +241 -0
- package/lib/rest/conversations/v2/action.js +246 -0
- package/lib/rest/conversations/v2/communication.d.ts +479 -0
- package/lib/rest/conversations/v2/communication.js +436 -0
- package/lib/rest/conversations/v2/configuration.d.ts +906 -0
- package/lib/rest/conversations/v2/configuration.js +619 -0
- package/lib/rest/conversations/v2/conversation.d.ts +936 -0
- package/lib/rest/conversations/v2/conversation.js +664 -0
- package/lib/rest/conversations/v2/operation.d.ts +167 -0
- package/lib/rest/conversations/v2/operation.js +170 -0
- package/lib/rest/conversations/v2/participant.d.ts +469 -0
- package/lib/rest/conversations/v2/participant.js +442 -0
- package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
- package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
- package/lib/rest/insights/V3.d.ts +20 -0
- package/lib/rest/insights/V3.js +42 -0
- package/lib/rest/insights/v1/call/callSummary.d.ts +10 -10
- package/lib/rest/insights/v1/call/event.d.ts +4 -4
- package/lib/rest/insights/v1/callSummaries.d.ts +12 -9
- package/lib/rest/insights/v3/metadata.d.ts +115 -0
- package/lib/rest/insights/v3/metadata.js +118 -0
- package/lib/rest/insights/v3/query.d.ts +180 -0
- package/lib/rest/insights/v3/query.js +214 -0
- package/lib/rest/intelligence/V3.d.ts +35 -0
- package/lib/rest/intelligence/V3.js +65 -0
- package/lib/rest/intelligence/v3/configuration.d.ts +693 -0
- package/lib/rest/intelligence/v3/configuration.js +528 -0
- package/lib/rest/intelligence/v3/conversation.d.ts +478 -0
- package/lib/rest/intelligence/v3/conversation.js +342 -0
- package/lib/rest/intelligence/v3/operator.d.ts +619 -0
- package/lib/rest/intelligence/v3/operator.js +493 -0
- package/lib/rest/intelligence/v3/operatorResult.d.ts +543 -0
- package/lib/rest/intelligence/v3/operatorResult.js +478 -0
- package/lib/rest/intelligence/v3/version.d.ts +469 -0
- package/lib/rest/intelligence/v3/version.js +341 -0
- package/lib/rest/knowledge/V2.d.ts +31 -0
- package/lib/rest/knowledge/V2.js +62 -0
- package/lib/rest/knowledge/v2/chunk.d.ts +209 -0
- package/lib/rest/knowledge/v2/chunk.js +178 -0
- package/lib/rest/knowledge/v2/knowledge.d.ts +507 -0
- package/lib/rest/knowledge/v2/knowledge.js +466 -0
- package/lib/rest/knowledge/v2/knowledgeBasis.d.ts +484 -0
- package/lib/rest/knowledge/v2/knowledgeBasis.js +441 -0
- package/lib/rest/knowledge/v2/operation.d.ts +162 -0
- package/lib/rest/knowledge/v2/operation.js +175 -0
- package/lib/rest/knowledge/v2/search.d.ts +180 -0
- package/lib/rest/knowledge/v2/search.js +174 -0
- package/lib/rest/memory/V1.d.ts +76 -0
- package/lib/rest/memory/V1.js +140 -0
- package/lib/rest/memory/v1/bulk.d.ts +129 -0
- package/lib/rest/memory/v1/bulk.js +158 -0
- package/lib/rest/memory/v1/conversationSummary.d.ts +531 -0
- package/lib/rest/memory/v1/conversationSummary.js +473 -0
- package/lib/rest/memory/v1/dataMapping.d.ts +630 -0
- package/lib/rest/memory/v1/dataMapping.js +512 -0
- package/lib/rest/memory/v1/event.d.ts +153 -0
- package/lib/rest/memory/v1/event.js +159 -0
- package/lib/rest/memory/v1/identifier.d.ts +362 -0
- package/lib/rest/memory/v1/identifier.js +369 -0
- package/lib/rest/memory/v1/identityResolutionSetting.d.ts +247 -0
- package/lib/rest/memory/v1/identityResolutionSetting.js +229 -0
- package/lib/rest/memory/v1/import.d.ts +292 -0
- package/lib/rest/memory/v1/import.js +280 -0
- package/lib/rest/memory/v1/lookup.d.ts +82 -0
- package/lib/rest/memory/v1/lookup.js +118 -0
- package/lib/rest/memory/v1/observation.d.ts +521 -0
- package/lib/rest/memory/v1/observation.js +477 -0
- package/lib/rest/memory/v1/operation.d.ts +162 -0
- package/lib/rest/memory/v1/operation.js +175 -0
- package/lib/rest/memory/v1/profile.d.ts +548 -0
- package/lib/rest/memory/v1/profile.js +531 -0
- package/lib/rest/memory/v1/recall.d.ts +306 -0
- package/lib/rest/memory/v1/recall.js +234 -0
- package/lib/rest/memory/v1/revision.d.ts +246 -0
- package/lib/rest/memory/v1/revision.js +195 -0
- package/lib/rest/memory/v1/store.d.ts +544 -0
- package/lib/rest/memory/v1/store.js +534 -0
- package/lib/rest/memory/v1/trait.d.ts +233 -0
- package/lib/rest/memory/v1/trait.js +190 -0
- package/lib/rest/memory/v1/traitGroup.d.ts +758 -0
- package/lib/rest/memory/v1/traitGroup.js +555 -0
- package/lib/rest/messaging/v2/channelsSender.d.ts +8 -0
- package/lib/rest/messaging/v2/channelsSender.js +2 -0
- package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +32 -0
- package/lib/rest/previewIam/versionless/organization/roleAssignment.js +14 -0
- package/lib/rest/studio/v2/flow.d.ts +4 -0
- package/lib/rest/studio/v2/flow.js +8 -0
- package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
- package/lib/rest/verify/v2/service/webhook.js +8 -8
- package/lib/rest/voice/V3.d.ts +15 -0
- package/lib/rest/voice/V3.js +37 -0
- package/lib/rest/voice/v3/transcription.d.ts +378 -0
- package/lib/rest/voice/v3/transcription.js +264 -0
- package/lib/twiml/VoiceResponse.d.ts +8 -0
- package/package.json +1 -1
|
@@ -437,27 +437,27 @@ export declare class CallSummariesInstance {
|
|
|
437
437
|
*/
|
|
438
438
|
connectDuration: number;
|
|
439
439
|
/**
|
|
440
|
-
* The calling party.
|
|
440
|
+
* `object` The calling party. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#tofrom-object) for the object properties.
|
|
441
441
|
*/
|
|
442
442
|
from: any;
|
|
443
443
|
/**
|
|
444
|
-
* The called party.
|
|
444
|
+
* `object` The called party. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#tofrom-object) for the object properties.
|
|
445
445
|
*/
|
|
446
446
|
to: any;
|
|
447
447
|
/**
|
|
448
|
-
* Contains metrics and properties for the Twilio media gateway of a PSTN call.
|
|
448
|
+
* `object` Contains metrics and properties for the Twilio media gateway of a PSTN call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
449
449
|
*/
|
|
450
450
|
carrierEdge: any;
|
|
451
451
|
/**
|
|
452
|
-
* Contains metrics and properties for the Twilio media gateway of a Client call.
|
|
452
|
+
* `object` Contains metrics and properties for the Twilio media gateway of a Client call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
453
453
|
*/
|
|
454
454
|
clientEdge: any;
|
|
455
455
|
/**
|
|
456
|
-
* Contains metrics and properties for the SDK sensor library for Client calls.
|
|
456
|
+
* `object` Contains metrics and properties for the SDK sensor library for Client calls. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
457
457
|
*/
|
|
458
458
|
sdkEdge: any;
|
|
459
459
|
/**
|
|
460
|
-
* Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call.
|
|
460
|
+
* `object` Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties.
|
|
461
461
|
*/
|
|
462
462
|
sipEdge: any;
|
|
463
463
|
/**
|
|
@@ -469,17 +469,20 @@ export declare class CallSummariesInstance {
|
|
|
469
469
|
*/
|
|
470
470
|
url: string;
|
|
471
471
|
/**
|
|
472
|
-
* Attributes capturing call-flow-specific details.
|
|
472
|
+
* `object` Attributes capturing call-flow-specific details. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#attributes-object) for the object properties.
|
|
473
473
|
*/
|
|
474
474
|
attributes: any;
|
|
475
475
|
/**
|
|
476
|
-
* Contains edge-agnostic call-level details.
|
|
476
|
+
* `object` Contains edge-agnostic call-level details. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#properties-object) for the object properties.
|
|
477
477
|
*/
|
|
478
478
|
properties: any;
|
|
479
479
|
/**
|
|
480
|
-
* Contains trusted communications details including Branded Call and verified caller ID.
|
|
480
|
+
* `object` Contains trusted communications details including Branded Call and verified caller ID. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#trust-object) for the object properties.
|
|
481
481
|
*/
|
|
482
482
|
trust: any;
|
|
483
|
+
/**
|
|
484
|
+
* `object` Programmatically labeled annotations for the Call. Developers can update the Call Summary records with Annotation during or after a Call. Annotations can be updated as long as the Call Summary record is addressable via the API. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#annotation-object) for the object properties.
|
|
485
|
+
*/
|
|
483
486
|
annotation: any;
|
|
484
487
|
/**
|
|
485
488
|
* Provide a user-friendly representation
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { inspect, InspectOptions } from "util";
|
|
2
|
+
import V3 from "../V3";
|
|
3
|
+
import { ApiResponse } from "../../../base/ApiResponse";
|
|
4
|
+
export declare class InsightsMetadataResponseCubes {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the cube, used as a reference in queries
|
|
7
|
+
*/
|
|
8
|
+
"name": string;
|
|
9
|
+
/**
|
|
10
|
+
* Human-readable description of what the cube represents
|
|
11
|
+
*/
|
|
12
|
+
"description"?: string;
|
|
13
|
+
/**
|
|
14
|
+
* List of measures available in the cube, representing quantitative values that can be aggregated
|
|
15
|
+
*/
|
|
16
|
+
"measures": Array<InsightsMetadataResponseCubesMeasures>;
|
|
17
|
+
/**
|
|
18
|
+
* List of dimensions available in the cube, representing categorical attributes for grouping data
|
|
19
|
+
*/
|
|
20
|
+
"dimensions": Array<InsightsMetadataResponseCubesDimensions>;
|
|
21
|
+
constructor(payload: any);
|
|
22
|
+
}
|
|
23
|
+
export declare class InsightsMetadataResponseCubesDimensions {
|
|
24
|
+
/**
|
|
25
|
+
* Identifier used to reference this dimension in queries
|
|
26
|
+
*/
|
|
27
|
+
"name": string;
|
|
28
|
+
/**
|
|
29
|
+
* Detailed explanation of what this dimension represents
|
|
30
|
+
*/
|
|
31
|
+
"description"?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Data type of the dimension (e.g., string, number, boolean, date)
|
|
34
|
+
*/
|
|
35
|
+
"type": string;
|
|
36
|
+
constructor(payload: any);
|
|
37
|
+
}
|
|
38
|
+
export declare class InsightsMetadataResponseCubesMeasures {
|
|
39
|
+
/**
|
|
40
|
+
* Identifier used to reference this measure in queries
|
|
41
|
+
*/
|
|
42
|
+
"name": string;
|
|
43
|
+
/**
|
|
44
|
+
* Detailed explanation of what this measure represents
|
|
45
|
+
*/
|
|
46
|
+
"description"?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Type of the measure
|
|
49
|
+
*/
|
|
50
|
+
"type": string;
|
|
51
|
+
/**
|
|
52
|
+
* Aggregation type for the measure (e.g., sum, count, average)
|
|
53
|
+
*/
|
|
54
|
+
"aggregation"?: string;
|
|
55
|
+
constructor(payload: any);
|
|
56
|
+
}
|
|
57
|
+
export interface MetadataSolution {
|
|
58
|
+
}
|
|
59
|
+
export interface MetadataListInstance {
|
|
60
|
+
_version: V3;
|
|
61
|
+
_solution: MetadataSolution;
|
|
62
|
+
_uri: string;
|
|
63
|
+
/**
|
|
64
|
+
* Fetch a MetadataInstance
|
|
65
|
+
*
|
|
66
|
+
* @param callback - Callback to handle processed record
|
|
67
|
+
*
|
|
68
|
+
* @returns Resolves to processed MetadataInstance
|
|
69
|
+
*/
|
|
70
|
+
fetch(callback?: (error: Error | null, item?: MetadataInstance) => any): Promise<MetadataInstance>;
|
|
71
|
+
/**
|
|
72
|
+
* Fetch a MetadataInstance and return HTTP info
|
|
73
|
+
*
|
|
74
|
+
* @param callback - Callback to handle processed record
|
|
75
|
+
*
|
|
76
|
+
* @returns Resolves to processed MetadataInstance with HTTP metadata
|
|
77
|
+
*/
|
|
78
|
+
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<MetadataInstance>) => any): Promise<ApiResponse<MetadataInstance>>;
|
|
79
|
+
/**
|
|
80
|
+
* Provide a user-friendly representation
|
|
81
|
+
*/
|
|
82
|
+
toJSON(): any;
|
|
83
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
84
|
+
}
|
|
85
|
+
export declare function MetadataListInstance(version: V3): MetadataListInstance;
|
|
86
|
+
interface MetadataResource {
|
|
87
|
+
domain: string;
|
|
88
|
+
cubes: Array<InsightsMetadataResponseCubes>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Response containing metadata about available cubes, measures, and dimensions for a domain
|
|
92
|
+
*/
|
|
93
|
+
export declare class MetadataInstance {
|
|
94
|
+
protected _version: V3;
|
|
95
|
+
constructor(_version: V3, _payload: MetadataResource);
|
|
96
|
+
/**
|
|
97
|
+
* The business domain name for which metadata is being provided
|
|
98
|
+
*/
|
|
99
|
+
domain: string;
|
|
100
|
+
/**
|
|
101
|
+
* List of data cubes available in the domain, each containing measures and dimensions
|
|
102
|
+
*/
|
|
103
|
+
cubes: Array<InsightsMetadataResponseCubes>;
|
|
104
|
+
/**
|
|
105
|
+
* Provide a user-friendly representation
|
|
106
|
+
*
|
|
107
|
+
* @returns Object
|
|
108
|
+
*/
|
|
109
|
+
toJSON(): {
|
|
110
|
+
domain: string;
|
|
111
|
+
cubes: InsightsMetadataResponseCubes[];
|
|
112
|
+
};
|
|
113
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
114
|
+
}
|
|
115
|
+
export {};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Insights
|
|
9
|
+
* Insights Domain V3 API.
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.MetadataInstance = exports.InsightsMetadataResponseCubesMeasures = exports.InsightsMetadataResponseCubesDimensions = exports.InsightsMetadataResponseCubes = void 0;
|
|
17
|
+
exports.MetadataListInstance = MetadataListInstance;
|
|
18
|
+
const util_1 = require("util");
|
|
19
|
+
const deserialize = require("../../../base/deserialize");
|
|
20
|
+
const serialize = require("../../../base/serialize");
|
|
21
|
+
class InsightsMetadataResponseCubes {
|
|
22
|
+
constructor(payload) {
|
|
23
|
+
this.name = payload["name"];
|
|
24
|
+
this.description = payload["description"];
|
|
25
|
+
this.measures = payload["measures"];
|
|
26
|
+
this.dimensions = payload["dimensions"];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.InsightsMetadataResponseCubes = InsightsMetadataResponseCubes;
|
|
30
|
+
class InsightsMetadataResponseCubesDimensions {
|
|
31
|
+
constructor(payload) {
|
|
32
|
+
this.name = payload["name"];
|
|
33
|
+
this.description = payload["description"];
|
|
34
|
+
this.type = payload["type"];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.InsightsMetadataResponseCubesDimensions = InsightsMetadataResponseCubesDimensions;
|
|
38
|
+
class InsightsMetadataResponseCubesMeasures {
|
|
39
|
+
constructor(payload) {
|
|
40
|
+
this.name = payload["name"];
|
|
41
|
+
this.description = payload["description"];
|
|
42
|
+
this.type = payload["type"];
|
|
43
|
+
this.aggregation = payload["aggregation"];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.InsightsMetadataResponseCubesMeasures = InsightsMetadataResponseCubesMeasures;
|
|
47
|
+
function MetadataListInstance(version) {
|
|
48
|
+
const instance = {};
|
|
49
|
+
instance._version = version;
|
|
50
|
+
instance._solution = {};
|
|
51
|
+
instance._uri = `/InsightsDomains/Conversations/Metadata`;
|
|
52
|
+
instance.fetch = function fetch(callback) {
|
|
53
|
+
const headers = {};
|
|
54
|
+
headers["Accept"] = "application/json";
|
|
55
|
+
let operationVersion = version, operationPromise = operationVersion.fetch({
|
|
56
|
+
uri: instance._uri,
|
|
57
|
+
method: "get",
|
|
58
|
+
headers,
|
|
59
|
+
});
|
|
60
|
+
operationPromise = operationPromise.then((payload) => new MetadataInstance(operationVersion, payload));
|
|
61
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
62
|
+
return operationPromise;
|
|
63
|
+
};
|
|
64
|
+
instance.fetchWithHttpInfo = function fetchWithHttpInfo(callback) {
|
|
65
|
+
const headers = {};
|
|
66
|
+
headers["Accept"] = "application/json";
|
|
67
|
+
let operationVersion = version;
|
|
68
|
+
// CREATE, FETCH, UPDATE operations
|
|
69
|
+
let operationPromise = operationVersion
|
|
70
|
+
.fetchWithResponseInfo({
|
|
71
|
+
uri: instance._uri,
|
|
72
|
+
method: "get",
|
|
73
|
+
headers,
|
|
74
|
+
})
|
|
75
|
+
.then((response) => ({
|
|
76
|
+
...response,
|
|
77
|
+
body: new MetadataInstance(operationVersion, response.body),
|
|
78
|
+
}));
|
|
79
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
80
|
+
return operationPromise;
|
|
81
|
+
};
|
|
82
|
+
instance.toJSON = function toJSON() {
|
|
83
|
+
return instance._solution;
|
|
84
|
+
};
|
|
85
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
86
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
87
|
+
};
|
|
88
|
+
return instance;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Response containing metadata about available cubes, measures, and dimensions for a domain
|
|
92
|
+
*/
|
|
93
|
+
class MetadataInstance {
|
|
94
|
+
constructor(_version, _payload) {
|
|
95
|
+
this._version = _version;
|
|
96
|
+
const payload = _payload;
|
|
97
|
+
this.domain = payload.domain;
|
|
98
|
+
this.cubes =
|
|
99
|
+
payload.cubes !== null && payload.cubes !== undefined
|
|
100
|
+
? payload.cubes.map((payload) => new InsightsMetadataResponseCubes(payload))
|
|
101
|
+
: null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Provide a user-friendly representation
|
|
105
|
+
*
|
|
106
|
+
* @returns Object
|
|
107
|
+
*/
|
|
108
|
+
toJSON() {
|
|
109
|
+
return {
|
|
110
|
+
domain: this.domain,
|
|
111
|
+
cubes: this.cubes,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
[util_1.inspect.custom](_depth, options) {
|
|
115
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.MetadataInstance = MetadataInstance;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { inspect, InspectOptions } from "util";
|
|
2
|
+
import V3 from "../V3";
|
|
3
|
+
import { ApiResponse } from "../../../base/ApiResponse";
|
|
4
|
+
export declare class InsightsQueryRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The business domain to execute the query against
|
|
7
|
+
*/
|
|
8
|
+
"domain"?: string;
|
|
9
|
+
"query": QueryDefinition;
|
|
10
|
+
constructor(payload: any);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Pagination metadata containing navigation tokens and result information, this schema should according to convention be added to the response payload\'s \'meta\' attribute
|
|
14
|
+
*/
|
|
15
|
+
export declare class PaginationMeta {
|
|
16
|
+
/**
|
|
17
|
+
* The key of the list property contains the actual data items. This enables programmatic iteration over paginated results.
|
|
18
|
+
*/
|
|
19
|
+
"key": string;
|
|
20
|
+
/**
|
|
21
|
+
* The actual number of items returned in this response. May be less than the requested pageSize for the last page.
|
|
22
|
+
*/
|
|
23
|
+
"pageSize": number;
|
|
24
|
+
/**
|
|
25
|
+
* Token to fetch the previous page of results. Only included if there is a previous page, otherwise omitted.
|
|
26
|
+
*/
|
|
27
|
+
"previousToken"?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Token to fetch the next page of results. Only included if there is a next page, otherwise omitted.
|
|
30
|
+
*/
|
|
31
|
+
"nextToken"?: string | null;
|
|
32
|
+
constructor(payload: any);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Structured query definition that specifies what data to retrieve and how to filter, group, and order it
|
|
36
|
+
*/
|
|
37
|
+
export declare class QueryDefinition {
|
|
38
|
+
/**
|
|
39
|
+
* Array of measures to retrieve, representing quantitative values or metrics to be calculated
|
|
40
|
+
*/
|
|
41
|
+
"measures"?: Array<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Array of dimensions to retrieve, representing categorical attributes for grouping and organizing data
|
|
44
|
+
*/
|
|
45
|
+
"dimensions"?: Array<string>;
|
|
46
|
+
/**
|
|
47
|
+
* Nested filter conditions. Always use `op` and `expressions`.
|
|
48
|
+
*/
|
|
49
|
+
"filters"?: Array<QueryDefinitionFilters>;
|
|
50
|
+
/**
|
|
51
|
+
* Specifications for sorting the query results by specific fields in ascending or descending order
|
|
52
|
+
*/
|
|
53
|
+
"orderBy"?: Array<QueryDefinitionOrderBy>;
|
|
54
|
+
constructor(payload: any);
|
|
55
|
+
}
|
|
56
|
+
export declare class QueryDefinitionFilters {
|
|
57
|
+
"op"?: string;
|
|
58
|
+
"expressions": Array<QueryDefinitionFiltersExpressions>;
|
|
59
|
+
constructor(payload: any);
|
|
60
|
+
}
|
|
61
|
+
export declare class QueryDefinitionFiltersExpressions {
|
|
62
|
+
"op": string;
|
|
63
|
+
"field": string;
|
|
64
|
+
"values"?: Array<string>;
|
|
65
|
+
constructor(payload: any);
|
|
66
|
+
}
|
|
67
|
+
export declare class QueryDefinitionOrderBy {
|
|
68
|
+
/**
|
|
69
|
+
* Dimension or measure to order by
|
|
70
|
+
*/
|
|
71
|
+
"field"?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Sort order direction, ascending or descending
|
|
74
|
+
*/
|
|
75
|
+
"direction"?: string;
|
|
76
|
+
constructor(payload: any);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Options to pass to create a QueryInstance
|
|
80
|
+
*/
|
|
81
|
+
export interface QueryListInstanceCreateOptions {
|
|
82
|
+
/** */
|
|
83
|
+
insightsQueryRequest: InsightsQueryRequest;
|
|
84
|
+
/** Number of items per page */
|
|
85
|
+
pageSize?: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Options to pass to fetch a QueryInstance
|
|
89
|
+
*/
|
|
90
|
+
export interface QueryListInstanceFetchOptions {
|
|
91
|
+
/** Pagination token */
|
|
92
|
+
pageToken: string;
|
|
93
|
+
}
|
|
94
|
+
export interface QuerySolution {
|
|
95
|
+
}
|
|
96
|
+
export interface QueryListInstance {
|
|
97
|
+
_version: V3;
|
|
98
|
+
_solution: QuerySolution;
|
|
99
|
+
_uri: string;
|
|
100
|
+
/**
|
|
101
|
+
* Create a QueryInstance
|
|
102
|
+
*
|
|
103
|
+
* @param params - Body for request
|
|
104
|
+
* @param headers - header params for request
|
|
105
|
+
* @param callback - Callback to handle processed record
|
|
106
|
+
*
|
|
107
|
+
* @returns Resolves to processed QueryInstance
|
|
108
|
+
*/
|
|
109
|
+
create(params: InsightsQueryRequest, headers?: any, callback?: (error: Error | null, item?: QueryInstance) => any): Promise<QueryInstance>;
|
|
110
|
+
/**
|
|
111
|
+
* Create a QueryInstance and return HTTP info
|
|
112
|
+
*
|
|
113
|
+
* @param params - Body for request
|
|
114
|
+
* @param headers - header params for request
|
|
115
|
+
* @param callback - Callback to handle processed record
|
|
116
|
+
*
|
|
117
|
+
* @returns Resolves to processed QueryInstance with HTTP metadata
|
|
118
|
+
*/
|
|
119
|
+
createWithHttpInfo(params: InsightsQueryRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<QueryInstance>) => any): Promise<ApiResponse<QueryInstance>>;
|
|
120
|
+
/**
|
|
121
|
+
* Fetch a QueryInstance
|
|
122
|
+
*
|
|
123
|
+
* @param params - Parameter for request
|
|
124
|
+
* @param callback - Callback to handle processed record
|
|
125
|
+
*
|
|
126
|
+
* @returns Resolves to processed QueryInstance
|
|
127
|
+
*/
|
|
128
|
+
fetch(params: QueryListInstanceFetchOptions, callback?: (error: Error | null, item?: QueryInstance) => any): Promise<QueryInstance>;
|
|
129
|
+
/**
|
|
130
|
+
* Fetch a QueryInstance and return HTTP info
|
|
131
|
+
*
|
|
132
|
+
* @param params - Parameter for request
|
|
133
|
+
* @param callback - Callback to handle processed record
|
|
134
|
+
*
|
|
135
|
+
* @returns Resolves to processed QueryInstance with HTTP metadata
|
|
136
|
+
*/
|
|
137
|
+
fetchWithHttpInfo(params: QueryListInstanceFetchOptions, callback?: (error: Error | null, item?: ApiResponse<QueryInstance>) => any): Promise<ApiResponse<QueryInstance>>;
|
|
138
|
+
/**
|
|
139
|
+
* Provide a user-friendly representation
|
|
140
|
+
*/
|
|
141
|
+
toJSON(): any;
|
|
142
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
143
|
+
}
|
|
144
|
+
export declare function QueryListInstance(version: V3): QueryListInstance;
|
|
145
|
+
interface QueryResource {
|
|
146
|
+
domain: string;
|
|
147
|
+
items: Array<{
|
|
148
|
+
[key: string]: any;
|
|
149
|
+
}>;
|
|
150
|
+
meta: PaginationMeta;
|
|
151
|
+
}
|
|
152
|
+
export declare class QueryInstance {
|
|
153
|
+
protected _version: V3;
|
|
154
|
+
constructor(_version: V3, _payload: QueryResource);
|
|
155
|
+
/**
|
|
156
|
+
* Indicates the business domain the query was executed against
|
|
157
|
+
*/
|
|
158
|
+
domain: string;
|
|
159
|
+
/**
|
|
160
|
+
* Array of result objects containing the query results. Each object contains properties matching the requested measures and dimensions.
|
|
161
|
+
*/
|
|
162
|
+
items: Array<{
|
|
163
|
+
[key: string]: any;
|
|
164
|
+
}>;
|
|
165
|
+
meta: PaginationMeta;
|
|
166
|
+
/**
|
|
167
|
+
* Provide a user-friendly representation
|
|
168
|
+
*
|
|
169
|
+
* @returns Object
|
|
170
|
+
*/
|
|
171
|
+
toJSON(): {
|
|
172
|
+
domain: string;
|
|
173
|
+
items: {
|
|
174
|
+
[key: string]: any;
|
|
175
|
+
}[];
|
|
176
|
+
meta: PaginationMeta;
|
|
177
|
+
};
|
|
178
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
179
|
+
}
|
|
180
|
+
export {};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Insights
|
|
9
|
+
* Insights Domain V3 API.
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.QueryInstance = exports.QueryDefinitionOrderBy = exports.QueryDefinitionFiltersExpressions = exports.QueryDefinitionFilters = exports.QueryDefinition = exports.PaginationMeta = exports.InsightsQueryRequest = void 0;
|
|
17
|
+
exports.QueryListInstance = QueryListInstance;
|
|
18
|
+
const util_1 = require("util");
|
|
19
|
+
const deserialize = require("../../../base/deserialize");
|
|
20
|
+
const serialize = require("../../../base/serialize");
|
|
21
|
+
class InsightsQueryRequest {
|
|
22
|
+
constructor(payload) {
|
|
23
|
+
this.domain = payload["domain"];
|
|
24
|
+
this.query = payload["query"];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.InsightsQueryRequest = InsightsQueryRequest;
|
|
28
|
+
/**
|
|
29
|
+
* Pagination metadata containing navigation tokens and result information, this schema should according to convention be added to the response payload\'s \'meta\' attribute
|
|
30
|
+
*/
|
|
31
|
+
class PaginationMeta {
|
|
32
|
+
constructor(payload) {
|
|
33
|
+
this.key = payload["key"];
|
|
34
|
+
this.pageSize = payload["pageSize"];
|
|
35
|
+
this.previousToken = payload["previousToken"];
|
|
36
|
+
this.nextToken = payload["nextToken"];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.PaginationMeta = PaginationMeta;
|
|
40
|
+
/**
|
|
41
|
+
* Structured query definition that specifies what data to retrieve and how to filter, group, and order it
|
|
42
|
+
*/
|
|
43
|
+
class QueryDefinition {
|
|
44
|
+
constructor(payload) {
|
|
45
|
+
this.measures = payload["measures"];
|
|
46
|
+
this.dimensions = payload["dimensions"];
|
|
47
|
+
this.filters = payload["filters"];
|
|
48
|
+
this.orderBy = payload["orderBy"];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.QueryDefinition = QueryDefinition;
|
|
52
|
+
class QueryDefinitionFilters {
|
|
53
|
+
constructor(payload) {
|
|
54
|
+
this.op = payload["op"];
|
|
55
|
+
this.expressions = payload["expressions"];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.QueryDefinitionFilters = QueryDefinitionFilters;
|
|
59
|
+
class QueryDefinitionFiltersExpressions {
|
|
60
|
+
constructor(payload) {
|
|
61
|
+
this.op = payload["op"];
|
|
62
|
+
this.field = payload["field"];
|
|
63
|
+
this.values = payload["values"];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.QueryDefinitionFiltersExpressions = QueryDefinitionFiltersExpressions;
|
|
67
|
+
class QueryDefinitionOrderBy {
|
|
68
|
+
constructor(payload) {
|
|
69
|
+
this.field = payload["field"];
|
|
70
|
+
this.direction = payload["direction"];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.QueryDefinitionOrderBy = QueryDefinitionOrderBy;
|
|
74
|
+
function QueryListInstance(version) {
|
|
75
|
+
const instance = {};
|
|
76
|
+
instance._version = version;
|
|
77
|
+
instance._solution = {};
|
|
78
|
+
instance._uri = `/InsightsDomains/Conversations/Query`;
|
|
79
|
+
instance.create = function create(params, headers, callback) {
|
|
80
|
+
if (params === null || params === undefined) {
|
|
81
|
+
throw new Error('Required parameter "params" missing.');
|
|
82
|
+
}
|
|
83
|
+
let data = {};
|
|
84
|
+
if (params["pageSize"] !== undefined)
|
|
85
|
+
data["pageSize"] = params["pageSize"];
|
|
86
|
+
data = params;
|
|
87
|
+
if (headers === null || headers === undefined) {
|
|
88
|
+
headers = {};
|
|
89
|
+
}
|
|
90
|
+
headers["Content-Type"] = "application/json";
|
|
91
|
+
headers["Accept"] = "application/json";
|
|
92
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
93
|
+
uri: instance._uri,
|
|
94
|
+
method: "post",
|
|
95
|
+
data,
|
|
96
|
+
headers,
|
|
97
|
+
});
|
|
98
|
+
operationPromise = operationPromise.then((payload) => new QueryInstance(operationVersion, payload));
|
|
99
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
100
|
+
return operationPromise;
|
|
101
|
+
};
|
|
102
|
+
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
|
103
|
+
if (params === null || params === undefined) {
|
|
104
|
+
throw new Error('Required parameter "params" missing.');
|
|
105
|
+
}
|
|
106
|
+
let data = {};
|
|
107
|
+
if (params["pageSize"] !== undefined)
|
|
108
|
+
data["pageSize"] = params["pageSize"];
|
|
109
|
+
data = params;
|
|
110
|
+
if (headers === null || headers === undefined) {
|
|
111
|
+
headers = {};
|
|
112
|
+
}
|
|
113
|
+
headers["Content-Type"] = "application/json";
|
|
114
|
+
headers["Accept"] = "application/json";
|
|
115
|
+
let operationVersion = version;
|
|
116
|
+
// CREATE, FETCH, UPDATE operations
|
|
117
|
+
let operationPromise = operationVersion
|
|
118
|
+
.createWithResponseInfo({
|
|
119
|
+
uri: instance._uri,
|
|
120
|
+
method: "post",
|
|
121
|
+
data,
|
|
122
|
+
headers,
|
|
123
|
+
})
|
|
124
|
+
.then((response) => ({
|
|
125
|
+
...response,
|
|
126
|
+
body: new QueryInstance(operationVersion, response.body),
|
|
127
|
+
}));
|
|
128
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
129
|
+
return operationPromise;
|
|
130
|
+
};
|
|
131
|
+
instance.fetch = function fetch(params, callback) {
|
|
132
|
+
if (params === null || params === undefined) {
|
|
133
|
+
throw new Error('Required parameter "params" missing.');
|
|
134
|
+
}
|
|
135
|
+
if (params["pageToken"] === null || params["pageToken"] === undefined) {
|
|
136
|
+
throw new Error("Required parameter \"params['pageToken']\" missing.");
|
|
137
|
+
}
|
|
138
|
+
let data = {};
|
|
139
|
+
data["pageToken"] = params["pageToken"];
|
|
140
|
+
const headers = {};
|
|
141
|
+
headers["Accept"] = "application/json";
|
|
142
|
+
let operationVersion = version, operationPromise = operationVersion.fetch({
|
|
143
|
+
uri: instance._uri,
|
|
144
|
+
method: "get",
|
|
145
|
+
params: data,
|
|
146
|
+
headers,
|
|
147
|
+
});
|
|
148
|
+
operationPromise = operationPromise.then((payload) => new QueryInstance(operationVersion, payload));
|
|
149
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
150
|
+
return operationPromise;
|
|
151
|
+
};
|
|
152
|
+
instance.fetchWithHttpInfo = function fetchWithHttpInfo(params, callback) {
|
|
153
|
+
if (params === null || params === undefined) {
|
|
154
|
+
throw new Error('Required parameter "params" missing.');
|
|
155
|
+
}
|
|
156
|
+
if (params["pageToken"] === null || params["pageToken"] === undefined) {
|
|
157
|
+
throw new Error("Required parameter \"params['pageToken']\" missing.");
|
|
158
|
+
}
|
|
159
|
+
let data = {};
|
|
160
|
+
data["pageToken"] = params["pageToken"];
|
|
161
|
+
const headers = {};
|
|
162
|
+
headers["Accept"] = "application/json";
|
|
163
|
+
let operationVersion = version;
|
|
164
|
+
// CREATE, FETCH, UPDATE operations
|
|
165
|
+
let operationPromise = operationVersion
|
|
166
|
+
.fetchWithResponseInfo({
|
|
167
|
+
uri: instance._uri,
|
|
168
|
+
method: "get",
|
|
169
|
+
params: data,
|
|
170
|
+
headers,
|
|
171
|
+
})
|
|
172
|
+
.then((response) => ({
|
|
173
|
+
...response,
|
|
174
|
+
body: new QueryInstance(operationVersion, response.body),
|
|
175
|
+
}));
|
|
176
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
177
|
+
return operationPromise;
|
|
178
|
+
};
|
|
179
|
+
instance.toJSON = function toJSON() {
|
|
180
|
+
return instance._solution;
|
|
181
|
+
};
|
|
182
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
183
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
184
|
+
};
|
|
185
|
+
return instance;
|
|
186
|
+
}
|
|
187
|
+
class QueryInstance {
|
|
188
|
+
constructor(_version, _payload) {
|
|
189
|
+
this._version = _version;
|
|
190
|
+
const payload = _payload;
|
|
191
|
+
this.domain = payload.domain;
|
|
192
|
+
this.items = payload.items;
|
|
193
|
+
this.meta =
|
|
194
|
+
payload.meta !== null && payload.meta !== undefined
|
|
195
|
+
? new PaginationMeta(payload.meta)
|
|
196
|
+
: null;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Provide a user-friendly representation
|
|
200
|
+
*
|
|
201
|
+
* @returns Object
|
|
202
|
+
*/
|
|
203
|
+
toJSON() {
|
|
204
|
+
return {
|
|
205
|
+
domain: this.domain,
|
|
206
|
+
items: this.items,
|
|
207
|
+
meta: this.meta,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
[util_1.inspect.custom](_depth, options) {
|
|
211
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
exports.QueryInstance = QueryInstance;
|