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
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio Knowledge API
|
|
9
|
+
* APIs for managing knowledge bases and knowledge content for AI-powered applications.
|
|
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.OperationInstance = exports.OperationContextImpl = exports.OperationStatusError = exports.OperationResultResourceId = void 0;
|
|
17
|
+
exports.OperationListInstance = OperationListInstance;
|
|
18
|
+
const util_1 = require("util");
|
|
19
|
+
const deserialize = require("../../../base/deserialize");
|
|
20
|
+
const serialize = require("../../../base/serialize");
|
|
21
|
+
const utility_1 = require("../../../base/utility");
|
|
22
|
+
class OperationResultResourceId {
|
|
23
|
+
constructor(payload) {
|
|
24
|
+
this.type = payload["type"];
|
|
25
|
+
this.id = payload["id"];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.OperationResultResourceId = OperationResultResourceId;
|
|
29
|
+
class OperationStatusError {
|
|
30
|
+
constructor(payload) {
|
|
31
|
+
this.type = payload["type"];
|
|
32
|
+
this.title = payload["title"];
|
|
33
|
+
this.code = payload["code"];
|
|
34
|
+
this.detail = payload["detail"];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.OperationStatusError = OperationStatusError;
|
|
38
|
+
class OperationContextImpl {
|
|
39
|
+
constructor(_version, operationId) {
|
|
40
|
+
this._version = _version;
|
|
41
|
+
if (!(0, utility_1.isValidPathParam)(operationId)) {
|
|
42
|
+
throw new Error("Parameter 'operationId' is not valid.");
|
|
43
|
+
}
|
|
44
|
+
this._solution = { operationId };
|
|
45
|
+
this._uri = `/ControlPlane/Operations/${operationId}`;
|
|
46
|
+
}
|
|
47
|
+
fetch(callback) {
|
|
48
|
+
const headers = {};
|
|
49
|
+
headers["Accept"] = "application/json";
|
|
50
|
+
const instance = this;
|
|
51
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
52
|
+
uri: instance._uri,
|
|
53
|
+
method: "get",
|
|
54
|
+
headers,
|
|
55
|
+
});
|
|
56
|
+
operationPromise = operationPromise.then((payload) => new OperationInstance(operationVersion, payload, instance._solution.operationId));
|
|
57
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
58
|
+
return operationPromise;
|
|
59
|
+
}
|
|
60
|
+
fetchWithHttpInfo(callback) {
|
|
61
|
+
const headers = {};
|
|
62
|
+
headers["Accept"] = "application/json";
|
|
63
|
+
const instance = this;
|
|
64
|
+
let operationVersion = instance._version;
|
|
65
|
+
// CREATE, FETCH, UPDATE operations
|
|
66
|
+
let operationPromise = operationVersion
|
|
67
|
+
.fetchWithResponseInfo({
|
|
68
|
+
uri: instance._uri,
|
|
69
|
+
method: "get",
|
|
70
|
+
headers,
|
|
71
|
+
})
|
|
72
|
+
.then((response) => ({
|
|
73
|
+
...response,
|
|
74
|
+
body: new OperationInstance(operationVersion, response.body, instance._solution.operationId),
|
|
75
|
+
}));
|
|
76
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
77
|
+
return operationPromise;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Provide a user-friendly representation
|
|
81
|
+
*
|
|
82
|
+
* @returns Object
|
|
83
|
+
*/
|
|
84
|
+
toJSON() {
|
|
85
|
+
return this._solution;
|
|
86
|
+
}
|
|
87
|
+
[util_1.inspect.custom](_depth, options) {
|
|
88
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.OperationContextImpl = OperationContextImpl;
|
|
92
|
+
class OperationInstance {
|
|
93
|
+
constructor(_version, _payload, operationId) {
|
|
94
|
+
this._version = _version;
|
|
95
|
+
const payload = _payload;
|
|
96
|
+
this.operationId = payload.operationId;
|
|
97
|
+
this.status = payload.status;
|
|
98
|
+
this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
|
|
99
|
+
this.statusUrl = payload.statusUrl;
|
|
100
|
+
this.completedAt = deserialize.iso8601DateTime(payload.completedAt);
|
|
101
|
+
this.result =
|
|
102
|
+
payload.result !== null && payload.result !== undefined
|
|
103
|
+
? new OperationResultResourceId(payload.result)
|
|
104
|
+
: null;
|
|
105
|
+
this.error =
|
|
106
|
+
payload.error !== null && payload.error !== undefined
|
|
107
|
+
? new OperationStatusError(payload.error)
|
|
108
|
+
: null;
|
|
109
|
+
this.resultUrl = payload.resultUrl;
|
|
110
|
+
this._solution = { operationId: operationId };
|
|
111
|
+
}
|
|
112
|
+
get _proxy() {
|
|
113
|
+
this._context =
|
|
114
|
+
this._context ||
|
|
115
|
+
new OperationContextImpl(this._version, this._solution.operationId);
|
|
116
|
+
return this._context;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Fetch a OperationInstance
|
|
120
|
+
*
|
|
121
|
+
* @param callback - Callback to handle processed record
|
|
122
|
+
*
|
|
123
|
+
* @returns Resolves to processed OperationInstance
|
|
124
|
+
*/
|
|
125
|
+
fetch(callback) {
|
|
126
|
+
return this._proxy.fetch(callback);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Fetch a OperationInstance and return HTTP info
|
|
130
|
+
*
|
|
131
|
+
* @param callback - Callback to handle processed record
|
|
132
|
+
*
|
|
133
|
+
* @returns Resolves to processed OperationInstance with HTTP metadata
|
|
134
|
+
*/
|
|
135
|
+
fetchWithHttpInfo(callback) {
|
|
136
|
+
return this._proxy.fetchWithHttpInfo(callback);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Provide a user-friendly representation
|
|
140
|
+
*
|
|
141
|
+
* @returns Object
|
|
142
|
+
*/
|
|
143
|
+
toJSON() {
|
|
144
|
+
return {
|
|
145
|
+
operationId: this.operationId,
|
|
146
|
+
status: this.status,
|
|
147
|
+
createdAt: this.createdAt,
|
|
148
|
+
statusUrl: this.statusUrl,
|
|
149
|
+
completedAt: this.completedAt,
|
|
150
|
+
result: this.result,
|
|
151
|
+
error: this.error,
|
|
152
|
+
resultUrl: this.resultUrl,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
[util_1.inspect.custom](_depth, options) {
|
|
156
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.OperationInstance = OperationInstance;
|
|
160
|
+
function OperationListInstance(version) {
|
|
161
|
+
const instance = ((operationId) => instance.get(operationId));
|
|
162
|
+
instance.get = function get(operationId) {
|
|
163
|
+
return new OperationContextImpl(version, operationId);
|
|
164
|
+
};
|
|
165
|
+
instance._version = version;
|
|
166
|
+
instance._solution = {};
|
|
167
|
+
instance._uri = ``;
|
|
168
|
+
instance.toJSON = function toJSON() {
|
|
169
|
+
return instance._solution;
|
|
170
|
+
};
|
|
171
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
172
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
173
|
+
};
|
|
174
|
+
return instance;
|
|
175
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { inspect, InspectOptions } from "util";
|
|
2
|
+
import V2 from "../V2";
|
|
3
|
+
import { ApiResponse } from "../../../base/ApiResponse";
|
|
4
|
+
export declare class KnowledgeChunkResult {
|
|
5
|
+
/**
|
|
6
|
+
* The chunk content.
|
|
7
|
+
*/
|
|
8
|
+
"content"?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
11
|
+
*/
|
|
12
|
+
"createdAt"?: Date;
|
|
13
|
+
/**
|
|
14
|
+
* The score associated with the chunk.
|
|
15
|
+
*/
|
|
16
|
+
"score"?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The unique identifier of knowledge source.
|
|
19
|
+
*/
|
|
20
|
+
"knowledgeId"?: string;
|
|
21
|
+
constructor(payload: any);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Request payload for performing semantic search across knowledge sources within the knowledge base.. Allows querying with natural language text and filtering by specific knowledge sources to find the most relevant content chunks.
|
|
25
|
+
*/
|
|
26
|
+
export declare class KnowledgeSearch {
|
|
27
|
+
/**
|
|
28
|
+
* The query to search the knowledge source.
|
|
29
|
+
*/
|
|
30
|
+
"query": string;
|
|
31
|
+
/**
|
|
32
|
+
* The top K results to return.
|
|
33
|
+
*/
|
|
34
|
+
"top": number;
|
|
35
|
+
/**
|
|
36
|
+
* The list of knowledge IDs to search.
|
|
37
|
+
*/
|
|
38
|
+
"knowledgeIds"?: Array<string>;
|
|
39
|
+
constructor(payload: any);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Options to pass to create a SearchInstance
|
|
43
|
+
*/
|
|
44
|
+
export interface SearchContextCreateOptions {
|
|
45
|
+
/** */
|
|
46
|
+
knowledgeSearch?: KnowledgeSearch;
|
|
47
|
+
}
|
|
48
|
+
export interface SearchContext {
|
|
49
|
+
/**
|
|
50
|
+
* Create a SearchInstance
|
|
51
|
+
*
|
|
52
|
+
* @param callback - Callback to handle processed record
|
|
53
|
+
*
|
|
54
|
+
* @returns Resolves to processed SearchInstance
|
|
55
|
+
*/
|
|
56
|
+
create(callback?: (error: Error | null, item?: SearchInstance) => any): Promise<SearchInstance>;
|
|
57
|
+
/**
|
|
58
|
+
* Create a SearchInstance
|
|
59
|
+
*
|
|
60
|
+
* @param params - Body for request
|
|
61
|
+
* @param headers - header params for request
|
|
62
|
+
* @param callback - Callback to handle processed record
|
|
63
|
+
*
|
|
64
|
+
* @returns Resolves to processed SearchInstance
|
|
65
|
+
*/
|
|
66
|
+
create(params: KnowledgeSearch, headers?: any, callback?: (error: Error | null, item?: SearchInstance) => any): Promise<SearchInstance>;
|
|
67
|
+
/**
|
|
68
|
+
* Create a SearchInstance and return HTTP info
|
|
69
|
+
*
|
|
70
|
+
* @param callback - Callback to handle processed record
|
|
71
|
+
*
|
|
72
|
+
* @returns Resolves to processed SearchInstance with HTTP metadata
|
|
73
|
+
*/
|
|
74
|
+
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SearchInstance>) => any): Promise<ApiResponse<SearchInstance>>;
|
|
75
|
+
/**
|
|
76
|
+
* Create a SearchInstance and return HTTP info
|
|
77
|
+
*
|
|
78
|
+
* @param params - Body for request
|
|
79
|
+
* @param headers - header params for request
|
|
80
|
+
* @param callback - Callback to handle processed record
|
|
81
|
+
*
|
|
82
|
+
* @returns Resolves to processed SearchInstance with HTTP metadata
|
|
83
|
+
*/
|
|
84
|
+
createWithHttpInfo(params: KnowledgeSearch, headers?: any, callback?: (error: Error | null, item?: ApiResponse<SearchInstance>) => any): Promise<ApiResponse<SearchInstance>>;
|
|
85
|
+
/**
|
|
86
|
+
* Provide a user-friendly representation
|
|
87
|
+
*/
|
|
88
|
+
toJSON(): any;
|
|
89
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
90
|
+
}
|
|
91
|
+
export interface SearchContextSolution {
|
|
92
|
+
kbId: string;
|
|
93
|
+
}
|
|
94
|
+
export declare class SearchContextImpl implements SearchContext {
|
|
95
|
+
protected _version: V2;
|
|
96
|
+
protected _solution: SearchContextSolution;
|
|
97
|
+
protected _uri: string;
|
|
98
|
+
constructor(_version: V2, kbId: string);
|
|
99
|
+
create(params?: KnowledgeSearch | ((error: Error | null, item?: SearchInstance) => any), headers?: any, callback?: (error: Error | null, item?: SearchInstance) => any): Promise<SearchInstance>;
|
|
100
|
+
createWithHttpInfo(params?: KnowledgeSearch | ((error: Error | null, item?: ApiResponse<SearchInstance>) => any), headers?: any, callback?: (error: Error | null, item?: ApiResponse<SearchInstance>) => any): Promise<ApiResponse<SearchInstance>>;
|
|
101
|
+
/**
|
|
102
|
+
* Provide a user-friendly representation
|
|
103
|
+
*
|
|
104
|
+
* @returns Object
|
|
105
|
+
*/
|
|
106
|
+
toJSON(): SearchContextSolution;
|
|
107
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
108
|
+
}
|
|
109
|
+
interface SearchResource {
|
|
110
|
+
chunks: Array<KnowledgeChunkResult>;
|
|
111
|
+
}
|
|
112
|
+
export declare class SearchInstance {
|
|
113
|
+
protected _version: V2;
|
|
114
|
+
protected _solution: SearchContextSolution;
|
|
115
|
+
protected _context?: SearchContext;
|
|
116
|
+
constructor(_version: V2, _payload: SearchResource, kbId?: string);
|
|
117
|
+
chunks: Array<KnowledgeChunkResult>;
|
|
118
|
+
private get _proxy();
|
|
119
|
+
/**
|
|
120
|
+
* Create a SearchInstance
|
|
121
|
+
*
|
|
122
|
+
* @param callback - Callback to handle processed record
|
|
123
|
+
*
|
|
124
|
+
* @returns Resolves to processed SearchInstance
|
|
125
|
+
*/
|
|
126
|
+
create(callback?: (error: Error | null, item?: SearchInstance) => any): Promise<SearchInstance>;
|
|
127
|
+
/**
|
|
128
|
+
* Create a SearchInstance
|
|
129
|
+
*
|
|
130
|
+
* @param params - Body for request
|
|
131
|
+
* @param headers - header params for request
|
|
132
|
+
* @param callback - Callback to handle processed record
|
|
133
|
+
*
|
|
134
|
+
* @returns Resolves to processed SearchInstance
|
|
135
|
+
*/
|
|
136
|
+
create(params: KnowledgeSearch, headers?: any, callback?: (error: Error | null, item?: SearchInstance) => any): Promise<SearchInstance>;
|
|
137
|
+
/**
|
|
138
|
+
* Create a SearchInstance and return HTTP info
|
|
139
|
+
*
|
|
140
|
+
* @param callback - Callback to handle processed record
|
|
141
|
+
*
|
|
142
|
+
* @returns Resolves to processed SearchInstance with HTTP metadata
|
|
143
|
+
*/
|
|
144
|
+
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SearchInstance>) => any): Promise<ApiResponse<SearchInstance>>;
|
|
145
|
+
/**
|
|
146
|
+
* Create a SearchInstance and return HTTP info
|
|
147
|
+
*
|
|
148
|
+
* @param params - Body for request
|
|
149
|
+
* @param headers - header params for request
|
|
150
|
+
* @param callback - Callback to handle processed record
|
|
151
|
+
*
|
|
152
|
+
* @returns Resolves to processed SearchInstance with HTTP metadata
|
|
153
|
+
*/
|
|
154
|
+
createWithHttpInfo(params: KnowledgeSearch, headers?: any, callback?: (error: Error | null, item?: ApiResponse<SearchInstance>) => any): Promise<ApiResponse<SearchInstance>>;
|
|
155
|
+
/**
|
|
156
|
+
* Provide a user-friendly representation
|
|
157
|
+
*
|
|
158
|
+
* @returns Object
|
|
159
|
+
*/
|
|
160
|
+
toJSON(): {
|
|
161
|
+
chunks: KnowledgeChunkResult[];
|
|
162
|
+
};
|
|
163
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
164
|
+
}
|
|
165
|
+
export interface SearchSolution {
|
|
166
|
+
}
|
|
167
|
+
export interface SearchListInstance {
|
|
168
|
+
_version: V2;
|
|
169
|
+
_solution: SearchSolution;
|
|
170
|
+
_uri: string;
|
|
171
|
+
(kbId: string): SearchContext;
|
|
172
|
+
get(kbId: string): SearchContext;
|
|
173
|
+
/**
|
|
174
|
+
* Provide a user-friendly representation
|
|
175
|
+
*/
|
|
176
|
+
toJSON(): any;
|
|
177
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
178
|
+
}
|
|
179
|
+
export declare function SearchListInstance(version: V2): SearchListInstance;
|
|
180
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio Knowledge API
|
|
9
|
+
* APIs for managing knowledge bases and knowledge content for AI-powered applications.
|
|
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.SearchInstance = exports.SearchContextImpl = exports.KnowledgeSearch = exports.KnowledgeChunkResult = void 0;
|
|
17
|
+
exports.SearchListInstance = SearchListInstance;
|
|
18
|
+
const util_1 = require("util");
|
|
19
|
+
const deserialize = require("../../../base/deserialize");
|
|
20
|
+
const serialize = require("../../../base/serialize");
|
|
21
|
+
const utility_1 = require("../../../base/utility");
|
|
22
|
+
class KnowledgeChunkResult {
|
|
23
|
+
constructor(payload) {
|
|
24
|
+
this.content = payload["content"];
|
|
25
|
+
this.createdAt = payload["createdAt"];
|
|
26
|
+
this.score = payload["score"];
|
|
27
|
+
this.knowledgeId = payload["knowledgeId"];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.KnowledgeChunkResult = KnowledgeChunkResult;
|
|
31
|
+
/**
|
|
32
|
+
* Request payload for performing semantic search across knowledge sources within the knowledge base.. Allows querying with natural language text and filtering by specific knowledge sources to find the most relevant content chunks.
|
|
33
|
+
*/
|
|
34
|
+
class KnowledgeSearch {
|
|
35
|
+
constructor(payload) {
|
|
36
|
+
this.query = payload["query"];
|
|
37
|
+
this.top = payload["top"];
|
|
38
|
+
this.knowledgeIds = payload["knowledgeIds"];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.KnowledgeSearch = KnowledgeSearch;
|
|
42
|
+
class SearchContextImpl {
|
|
43
|
+
constructor(_version, kbId) {
|
|
44
|
+
this._version = _version;
|
|
45
|
+
if (!(0, utility_1.isValidPathParam)(kbId)) {
|
|
46
|
+
throw new Error("Parameter 'kbId' is not valid.");
|
|
47
|
+
}
|
|
48
|
+
this._solution = { kbId };
|
|
49
|
+
this._uri = `/KnowledgeBases/${kbId}/Search`;
|
|
50
|
+
}
|
|
51
|
+
create(params, headers, callback) {
|
|
52
|
+
if (params instanceof Function) {
|
|
53
|
+
callback = params;
|
|
54
|
+
params = {};
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
params = params || {};
|
|
58
|
+
}
|
|
59
|
+
let data = {};
|
|
60
|
+
data = params;
|
|
61
|
+
if (headers === null || headers === undefined) {
|
|
62
|
+
headers = {};
|
|
63
|
+
}
|
|
64
|
+
headers["Content-Type"] = "application/json";
|
|
65
|
+
headers["Accept"] = "application/json";
|
|
66
|
+
const instance = this;
|
|
67
|
+
let operationVersion = instance._version, operationPromise = operationVersion.create({
|
|
68
|
+
uri: instance._uri,
|
|
69
|
+
method: "post",
|
|
70
|
+
data,
|
|
71
|
+
headers,
|
|
72
|
+
});
|
|
73
|
+
operationPromise = operationPromise.then((payload) => new SearchInstance(operationVersion, payload, instance._solution.kbId));
|
|
74
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
75
|
+
return operationPromise;
|
|
76
|
+
}
|
|
77
|
+
createWithHttpInfo(params, headers, callback) {
|
|
78
|
+
if (params instanceof Function) {
|
|
79
|
+
callback = params;
|
|
80
|
+
params = {};
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
params = params || {};
|
|
84
|
+
}
|
|
85
|
+
let data = {};
|
|
86
|
+
data = params;
|
|
87
|
+
if (headers === null || headers === undefined) {
|
|
88
|
+
headers = {};
|
|
89
|
+
}
|
|
90
|
+
headers["Content-Type"] = "application/json";
|
|
91
|
+
headers["Accept"] = "application/json";
|
|
92
|
+
const instance = this;
|
|
93
|
+
let operationVersion = instance._version;
|
|
94
|
+
// CREATE, FETCH, UPDATE operations
|
|
95
|
+
let operationPromise = operationVersion
|
|
96
|
+
.createWithResponseInfo({
|
|
97
|
+
uri: instance._uri,
|
|
98
|
+
method: "post",
|
|
99
|
+
data,
|
|
100
|
+
headers,
|
|
101
|
+
})
|
|
102
|
+
.then((response) => ({
|
|
103
|
+
...response,
|
|
104
|
+
body: new SearchInstance(operationVersion, response.body, instance._solution.kbId),
|
|
105
|
+
}));
|
|
106
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
107
|
+
return operationPromise;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Provide a user-friendly representation
|
|
111
|
+
*
|
|
112
|
+
* @returns Object
|
|
113
|
+
*/
|
|
114
|
+
toJSON() {
|
|
115
|
+
return this._solution;
|
|
116
|
+
}
|
|
117
|
+
[util_1.inspect.custom](_depth, options) {
|
|
118
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.SearchContextImpl = SearchContextImpl;
|
|
122
|
+
class SearchInstance {
|
|
123
|
+
constructor(_version, _payload, kbId) {
|
|
124
|
+
this._version = _version;
|
|
125
|
+
const payload = _payload;
|
|
126
|
+
this.chunks =
|
|
127
|
+
payload.chunks !== null && payload.chunks !== undefined
|
|
128
|
+
? payload.chunks.map((payload) => new KnowledgeChunkResult(payload))
|
|
129
|
+
: null;
|
|
130
|
+
this._solution = { kbId: kbId };
|
|
131
|
+
}
|
|
132
|
+
get _proxy() {
|
|
133
|
+
this._context =
|
|
134
|
+
this._context ||
|
|
135
|
+
new SearchContextImpl(this._version, this._solution.kbId);
|
|
136
|
+
return this._context;
|
|
137
|
+
}
|
|
138
|
+
create(params, callback) {
|
|
139
|
+
return this._proxy.create(params, callback);
|
|
140
|
+
}
|
|
141
|
+
createWithHttpInfo(params, callback) {
|
|
142
|
+
return this._proxy.createWithHttpInfo(params, callback);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Provide a user-friendly representation
|
|
146
|
+
*
|
|
147
|
+
* @returns Object
|
|
148
|
+
*/
|
|
149
|
+
toJSON() {
|
|
150
|
+
return {
|
|
151
|
+
chunks: this.chunks,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
[util_1.inspect.custom](_depth, options) {
|
|
155
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.SearchInstance = SearchInstance;
|
|
159
|
+
function SearchListInstance(version) {
|
|
160
|
+
const instance = ((kbId) => instance.get(kbId));
|
|
161
|
+
instance.get = function get(kbId) {
|
|
162
|
+
return new SearchContextImpl(version, kbId);
|
|
163
|
+
};
|
|
164
|
+
instance._version = version;
|
|
165
|
+
instance._solution = {};
|
|
166
|
+
instance._uri = ``;
|
|
167
|
+
instance.toJSON = function toJSON() {
|
|
168
|
+
return instance._solution;
|
|
169
|
+
};
|
|
170
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
171
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
172
|
+
};
|
|
173
|
+
return instance;
|
|
174
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import MemoryBase from "../MemoryBase";
|
|
2
|
+
import Version from "../../base/Version";
|
|
3
|
+
import { BulkContext } from "./v1/bulk";
|
|
4
|
+
import { ConversationSummaryListInstance, ConversationSummaryContext } from "./v1/conversationSummary";
|
|
5
|
+
import { DataMappingListInstance, DataMappingContext } from "./v1/dataMapping";
|
|
6
|
+
import { EventListInstance } from "./v1/event";
|
|
7
|
+
import { IdentifierListInstance, IdentifierContext } from "./v1/identifier";
|
|
8
|
+
import { IdentityResolutionSettingContext } from "./v1/identityResolutionSetting";
|
|
9
|
+
import { ImportListInstance, ImportContext } from "./v1/import";
|
|
10
|
+
import { LookupListInstance } from "./v1/lookup";
|
|
11
|
+
import { ObservationListInstance, ObservationContext } from "./v1/observation";
|
|
12
|
+
import { OperationListInstance } from "./v1/operation";
|
|
13
|
+
import { ProfileListInstance, ProfileContext } from "./v1/profile";
|
|
14
|
+
import { RecallListInstance } from "./v1/recall";
|
|
15
|
+
import { RevisionListInstance } from "./v1/revision";
|
|
16
|
+
import { StoreListInstance } from "./v1/store";
|
|
17
|
+
import { TraitListInstance } from "./v1/trait";
|
|
18
|
+
import { TraitGroupListInstance, TraitGroupContext } from "./v1/traitGroup";
|
|
19
|
+
export default class V1 extends Version {
|
|
20
|
+
/**
|
|
21
|
+
* Initialize the V1 version of Memory
|
|
22
|
+
*
|
|
23
|
+
* @param domain - The Twilio (Twilio.Memory) domain
|
|
24
|
+
*/
|
|
25
|
+
constructor(domain: MemoryBase);
|
|
26
|
+
/** operations - { Twilio.Memory.V1.OperationListInstance } resource */
|
|
27
|
+
protected _operations?: OperationListInstance;
|
|
28
|
+
/** stores - { Twilio.Memory.V1.StoreListInstance } resource */
|
|
29
|
+
protected _stores?: StoreListInstance;
|
|
30
|
+
/** Accessor for bulk resource */
|
|
31
|
+
bulk(storeId: string): BulkContext;
|
|
32
|
+
/** Accessor for conversationSummaries resource - list operations */
|
|
33
|
+
conversationSummaries(storeId: string, profileId: string): ConversationSummaryListInstance;
|
|
34
|
+
/** Accessor for conversationSummaries resource - instance operations */
|
|
35
|
+
conversationSummaries(storeId: string, profileId: string, summaryId: string): ConversationSummaryContext;
|
|
36
|
+
/** Accessor for dataMappings resource - list operations */
|
|
37
|
+
dataMappings(storeId: string): DataMappingListInstance;
|
|
38
|
+
/** Accessor for dataMappings resource - instance operations */
|
|
39
|
+
dataMappings(storeId: string, dataMappingId: string): DataMappingContext;
|
|
40
|
+
/** Accessor for events resource */
|
|
41
|
+
events(storeId: string, profileId: string): EventListInstance;
|
|
42
|
+
/** Accessor for identifiers resource - list operations */
|
|
43
|
+
identifiers(storeId: string, profileId: string): IdentifierListInstance;
|
|
44
|
+
/** Accessor for identifiers resource - instance operations */
|
|
45
|
+
identifiers(storeId: string, profileId: string, idType: string): IdentifierContext;
|
|
46
|
+
/** Accessor for identityResolutionSettings resource */
|
|
47
|
+
identityResolutionSettings(storeId: string): IdentityResolutionSettingContext;
|
|
48
|
+
/** Accessor for imports resource - list operations */
|
|
49
|
+
imports(storeId: string): ImportListInstance;
|
|
50
|
+
/** Accessor for imports resource - instance operations */
|
|
51
|
+
imports(storeId: string, importId: string): ImportContext;
|
|
52
|
+
/** Accessor for lookup resource */
|
|
53
|
+
lookup(storeId: string): LookupListInstance;
|
|
54
|
+
/** Accessor for observations resource - list operations */
|
|
55
|
+
observations(storeId: string, profileId: string): ObservationListInstance;
|
|
56
|
+
/** Accessor for observations resource - instance operations */
|
|
57
|
+
observations(storeId: string, profileId: string, observationId: string): ObservationContext;
|
|
58
|
+
/** Getter for operations resource */
|
|
59
|
+
get operations(): OperationListInstance;
|
|
60
|
+
/** Accessor for profiles resource - list operations */
|
|
61
|
+
profiles(storeId: string): ProfileListInstance;
|
|
62
|
+
/** Accessor for profiles resource - instance operations */
|
|
63
|
+
profiles(storeId: string, profileId: string): ProfileContext;
|
|
64
|
+
/** Accessor for recall resource */
|
|
65
|
+
recall(storeId: string, profileId: string): RecallListInstance;
|
|
66
|
+
/** Accessor for revisions resource */
|
|
67
|
+
revisions(storeId: string, profileId: string, observationId: string): RevisionListInstance;
|
|
68
|
+
/** Getter for stores resource */
|
|
69
|
+
get stores(): StoreListInstance;
|
|
70
|
+
/** Accessor for traits resource */
|
|
71
|
+
traits(storeId: string, profileId: string): TraitListInstance;
|
|
72
|
+
/** Accessor for traitGroups resource - list operations */
|
|
73
|
+
traitGroups(storeId: string): TraitGroupListInstance;
|
|
74
|
+
/** Accessor for traitGroups resource - instance operations */
|
|
75
|
+
traitGroups(storeId: string, traitGroupName: string): TraitGroupContext;
|
|
76
|
+
}
|