@unboundcx/sdk 1.0.2 → 1.0.3
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/README.md +73 -54
- package/base.js +24 -16
- package/index.js +27 -15
- package/package.json +2 -2
- package/services/ai.js +62 -16
- package/services/enroll.js +48 -11
- package/services/externalOAuth.js +11 -3
- package/services/generateId.js +1 -1
- package/services/googleCalendar.js +22 -6
- package/services/layouts.js +12 -8
- package/services/login.js +12 -3
- package/services/lookup.js +1 -1
- package/services/messaging.js +140 -52
- package/services/notes.js +2 -8
- package/services/objects.js +34 -28
- package/services/phoneNumbers.js +85 -53
- package/services/portals.js +19 -4
- package/services/recordTypes.js +14 -3
- package/services/sipEndpoints.js +10 -3
- package/services/storage.js +222 -11
- package/services/subscriptions.js +19 -11
- package/services/verification.js +11 -3
- package/services/video.js +55 -22
- package/services/voice.js +169 -32
- package/services/workflows.js +122 -54
- package/test-backwards-compatibility.js +82 -51
- package/test-complete-coverage.js +113 -73
- package/test-constructor-patterns.js +32 -11
package/services/ai.js
CHANGED
|
@@ -11,7 +11,16 @@ export class GenerativeService {
|
|
|
11
11
|
this.sdk = sdk;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
async chat({
|
|
14
|
+
async chat({
|
|
15
|
+
prompt,
|
|
16
|
+
messages,
|
|
17
|
+
relatedId,
|
|
18
|
+
model,
|
|
19
|
+
temperature,
|
|
20
|
+
subscriptionId,
|
|
21
|
+
stream,
|
|
22
|
+
method,
|
|
23
|
+
}) {
|
|
15
24
|
this.sdk.validateParams(
|
|
16
25
|
{ method },
|
|
17
26
|
{
|
|
@@ -22,7 +31,7 @@ export class GenerativeService {
|
|
|
22
31
|
temperature: { type: 'number', required: false },
|
|
23
32
|
subscriptionId: { type: 'string', required: false },
|
|
24
33
|
stream: { type: 'boolean', required: false },
|
|
25
|
-
method: { type: 'string', required: true }
|
|
34
|
+
method: { type: 'string', required: true },
|
|
26
35
|
},
|
|
27
36
|
);
|
|
28
37
|
|
|
@@ -36,14 +45,24 @@ export class GenerativeService {
|
|
|
36
45
|
subscriptionId,
|
|
37
46
|
stream,
|
|
38
47
|
method,
|
|
39
|
-
}
|
|
40
|
-
}
|
|
48
|
+
},
|
|
49
|
+
};
|
|
41
50
|
|
|
42
51
|
const result = await this.sdk._fetch('/ai/generative/chat', 'POST', params);
|
|
43
52
|
return result;
|
|
44
53
|
}
|
|
45
54
|
|
|
46
|
-
async playbook({
|
|
55
|
+
async playbook({
|
|
56
|
+
prompt,
|
|
57
|
+
messages,
|
|
58
|
+
relatedId,
|
|
59
|
+
model,
|
|
60
|
+
temperature,
|
|
61
|
+
subscriptionId,
|
|
62
|
+
stream,
|
|
63
|
+
playbookId,
|
|
64
|
+
sessionId,
|
|
65
|
+
}) {
|
|
47
66
|
this.sdk.validateParams(
|
|
48
67
|
{ playbookId },
|
|
49
68
|
{
|
|
@@ -55,7 +74,7 @@ export class GenerativeService {
|
|
|
55
74
|
subscriptionId: { type: 'string', required: false },
|
|
56
75
|
stream: { type: 'boolean', required: false },
|
|
57
76
|
playbookId: { type: 'string', required: true },
|
|
58
|
-
sessionId: { type: 'string', required: false }
|
|
77
|
+
sessionId: { type: 'string', required: false },
|
|
59
78
|
},
|
|
60
79
|
);
|
|
61
80
|
|
|
@@ -70,14 +89,27 @@ export class GenerativeService {
|
|
|
70
89
|
stream,
|
|
71
90
|
playbookId,
|
|
72
91
|
sessionId,
|
|
73
|
-
}
|
|
74
|
-
}
|
|
92
|
+
},
|
|
93
|
+
};
|
|
75
94
|
|
|
76
|
-
const result = await this.sdk._fetch(
|
|
95
|
+
const result = await this.sdk._fetch(
|
|
96
|
+
'/ai/generative/playbook',
|
|
97
|
+
'POST',
|
|
98
|
+
params,
|
|
99
|
+
);
|
|
77
100
|
return result;
|
|
78
101
|
}
|
|
79
102
|
|
|
80
|
-
async chatOllama({
|
|
103
|
+
async chatOllama({
|
|
104
|
+
prompt,
|
|
105
|
+
messages,
|
|
106
|
+
relatedId,
|
|
107
|
+
model,
|
|
108
|
+
temperature,
|
|
109
|
+
subscriptionId,
|
|
110
|
+
stream,
|
|
111
|
+
method,
|
|
112
|
+
}) {
|
|
81
113
|
this.sdk.validateParams(
|
|
82
114
|
{ method },
|
|
83
115
|
{
|
|
@@ -88,7 +120,7 @@ export class GenerativeService {
|
|
|
88
120
|
temperature: { type: 'number', required: false },
|
|
89
121
|
subscriptionId: { type: 'string', required: false },
|
|
90
122
|
stream: { type: 'boolean', required: false },
|
|
91
|
-
method: { type: 'string', required: true }
|
|
123
|
+
method: { type: 'string', required: true },
|
|
92
124
|
},
|
|
93
125
|
);
|
|
94
126
|
|
|
@@ -102,10 +134,14 @@ export class GenerativeService {
|
|
|
102
134
|
subscriptionId,
|
|
103
135
|
stream,
|
|
104
136
|
method,
|
|
105
|
-
}
|
|
106
|
-
}
|
|
137
|
+
},
|
|
138
|
+
};
|
|
107
139
|
|
|
108
|
-
const result = await this.sdk._fetch(
|
|
140
|
+
const result = await this.sdk._fetch(
|
|
141
|
+
'/ai/generative/ollama',
|
|
142
|
+
'POST',
|
|
143
|
+
params,
|
|
144
|
+
);
|
|
109
145
|
return result;
|
|
110
146
|
}
|
|
111
147
|
}
|
|
@@ -115,7 +151,17 @@ export class TextToSpeechService {
|
|
|
115
151
|
this.sdk = sdk;
|
|
116
152
|
}
|
|
117
153
|
|
|
118
|
-
async create({
|
|
154
|
+
async create({
|
|
155
|
+
text,
|
|
156
|
+
voice,
|
|
157
|
+
languageCode,
|
|
158
|
+
ssmlGender,
|
|
159
|
+
audioEncoding,
|
|
160
|
+
speakingRate,
|
|
161
|
+
pitch,
|
|
162
|
+
volumeGainDb,
|
|
163
|
+
effectsProfileIds,
|
|
164
|
+
}) {
|
|
119
165
|
this.sdk.validateParams(
|
|
120
166
|
{ text },
|
|
121
167
|
{
|
|
@@ -148,4 +194,4 @@ export class TextToSpeechService {
|
|
|
148
194
|
const result = await this.sdk._fetch('/ai/tts', 'POST', params);
|
|
149
195
|
return result;
|
|
150
196
|
}
|
|
151
|
-
}
|
|
197
|
+
}
|
package/services/enroll.js
CHANGED
|
@@ -15,7 +15,11 @@ export class EnrollService {
|
|
|
15
15
|
query: { namespace },
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const result = await this.sdk._fetch(
|
|
18
|
+
const result = await this.sdk._fetch(
|
|
19
|
+
'/enroll/checkNamespace',
|
|
20
|
+
'GET',
|
|
21
|
+
params,
|
|
22
|
+
);
|
|
19
23
|
return result;
|
|
20
24
|
}
|
|
21
25
|
|
|
@@ -48,7 +52,11 @@ export class EnrollService {
|
|
|
48
52
|
body: updateData,
|
|
49
53
|
};
|
|
50
54
|
|
|
51
|
-
const result = await this.sdk._fetch(
|
|
55
|
+
const result = await this.sdk._fetch(
|
|
56
|
+
`/enroll/enrollment/${enrollmentId}`,
|
|
57
|
+
'PUT',
|
|
58
|
+
params,
|
|
59
|
+
);
|
|
52
60
|
return result;
|
|
53
61
|
}
|
|
54
62
|
|
|
@@ -114,7 +122,11 @@ export class EnrollService {
|
|
|
114
122
|
body: paymentData,
|
|
115
123
|
};
|
|
116
124
|
|
|
117
|
-
const result = await this.sdk._fetch(
|
|
125
|
+
const result = await this.sdk._fetch(
|
|
126
|
+
'/enroll/verifyPayment',
|
|
127
|
+
'POST',
|
|
128
|
+
params,
|
|
129
|
+
);
|
|
118
130
|
return result;
|
|
119
131
|
}
|
|
120
132
|
|
|
@@ -130,7 +142,11 @@ export class EnrollService {
|
|
|
130
142
|
body: sessionData,
|
|
131
143
|
};
|
|
132
144
|
|
|
133
|
-
const result = await this.sdk._fetch(
|
|
145
|
+
const result = await this.sdk._fetch(
|
|
146
|
+
'/enroll/stripeVerification',
|
|
147
|
+
'POST',
|
|
148
|
+
params,
|
|
149
|
+
);
|
|
134
150
|
return result;
|
|
135
151
|
}
|
|
136
152
|
|
|
@@ -146,7 +162,11 @@ export class EnrollService {
|
|
|
146
162
|
query: { sessionId },
|
|
147
163
|
};
|
|
148
164
|
|
|
149
|
-
const result = await this.sdk._fetch(
|
|
165
|
+
const result = await this.sdk._fetch(
|
|
166
|
+
'/enroll/stripeVerification/status',
|
|
167
|
+
'GET',
|
|
168
|
+
params,
|
|
169
|
+
);
|
|
150
170
|
return result;
|
|
151
171
|
}
|
|
152
172
|
|
|
@@ -162,7 +182,11 @@ export class EnrollService {
|
|
|
162
182
|
body: agreementData,
|
|
163
183
|
};
|
|
164
184
|
|
|
165
|
-
const result = await this.sdk._fetch(
|
|
185
|
+
const result = await this.sdk._fetch(
|
|
186
|
+
'/enroll/signAgreement',
|
|
187
|
+
'POST',
|
|
188
|
+
params,
|
|
189
|
+
);
|
|
166
190
|
return result;
|
|
167
191
|
}
|
|
168
192
|
|
|
@@ -191,7 +215,10 @@ export class EnrollService {
|
|
|
191
215
|
},
|
|
192
216
|
);
|
|
193
217
|
|
|
194
|
-
const result = await this.sdk._fetch(
|
|
218
|
+
const result = await this.sdk._fetch(
|
|
219
|
+
`/enroll/brand/${enrollmentId}`,
|
|
220
|
+
'GET',
|
|
221
|
+
);
|
|
195
222
|
return result;
|
|
196
223
|
}
|
|
197
224
|
|
|
@@ -203,7 +230,10 @@ export class EnrollService {
|
|
|
203
230
|
},
|
|
204
231
|
);
|
|
205
232
|
|
|
206
|
-
const result = await this.sdk._fetch(
|
|
233
|
+
const result = await this.sdk._fetch(
|
|
234
|
+
`/enroll/buildStatus/${enrollmentId}`,
|
|
235
|
+
'GET',
|
|
236
|
+
);
|
|
207
237
|
return result;
|
|
208
238
|
}
|
|
209
239
|
|
|
@@ -220,7 +250,11 @@ export class EnrollService {
|
|
|
220
250
|
body: completionData,
|
|
221
251
|
};
|
|
222
252
|
|
|
223
|
-
const result = await this.sdk._fetch(
|
|
253
|
+
const result = await this.sdk._fetch(
|
|
254
|
+
`/enroll/complete/${enrollmentId}`,
|
|
255
|
+
'POST',
|
|
256
|
+
params,
|
|
257
|
+
);
|
|
224
258
|
return result;
|
|
225
259
|
}
|
|
226
260
|
|
|
@@ -232,7 +266,10 @@ export class EnrollService {
|
|
|
232
266
|
},
|
|
233
267
|
);
|
|
234
268
|
|
|
235
|
-
const result = await this.sdk._fetch(
|
|
269
|
+
const result = await this.sdk._fetch(
|
|
270
|
+
`/enroll/createDatabase/${enrollmentId}`,
|
|
271
|
+
'POST',
|
|
272
|
+
);
|
|
236
273
|
return result;
|
|
237
274
|
}
|
|
238
|
-
}
|
|
275
|
+
}
|
|
@@ -89,7 +89,11 @@ export class ExternalOAuthService {
|
|
|
89
89
|
query: { name },
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
const result = await this.sdk._fetch(
|
|
92
|
+
const result = await this.sdk._fetch(
|
|
93
|
+
'/externalOAuth/byName',
|
|
94
|
+
'GET',
|
|
95
|
+
params,
|
|
96
|
+
);
|
|
93
97
|
return result;
|
|
94
98
|
}
|
|
95
99
|
|
|
@@ -106,7 +110,11 @@ export class ExternalOAuthService {
|
|
|
106
110
|
query: { scope, provider },
|
|
107
111
|
};
|
|
108
112
|
|
|
109
|
-
const result = await this.sdk._fetch(
|
|
113
|
+
const result = await this.sdk._fetch(
|
|
114
|
+
'/externalOAuth/byScopeAndProvider',
|
|
115
|
+
'GET',
|
|
116
|
+
params,
|
|
117
|
+
);
|
|
110
118
|
return result;
|
|
111
119
|
}
|
|
112
120
|
|
|
@@ -114,4 +122,4 @@ export class ExternalOAuthService {
|
|
|
114
122
|
const result = await this.sdk._fetch('/externalOAuth', 'GET');
|
|
115
123
|
return result;
|
|
116
124
|
}
|
|
117
|
-
}
|
|
125
|
+
}
|
package/services/generateId.js
CHANGED
|
@@ -21,7 +21,11 @@ export class GoogleCalendarService {
|
|
|
21
21
|
body: webhookData,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const result = await this.sdk._fetch(
|
|
24
|
+
const result = await this.sdk._fetch(
|
|
25
|
+
'/googleCalendar/webhook',
|
|
26
|
+
'POST',
|
|
27
|
+
params,
|
|
28
|
+
);
|
|
25
29
|
return result;
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -33,7 +37,10 @@ export class GoogleCalendarService {
|
|
|
33
37
|
},
|
|
34
38
|
);
|
|
35
39
|
|
|
36
|
-
const result = await this.sdk._fetch(
|
|
40
|
+
const result = await this.sdk._fetch(
|
|
41
|
+
`/googleCalendar/webhook/${webhookId}`,
|
|
42
|
+
'DELETE',
|
|
43
|
+
);
|
|
37
44
|
return result;
|
|
38
45
|
}
|
|
39
46
|
|
|
@@ -59,7 +66,8 @@ export class GoogleCalendarService {
|
|
|
59
66
|
const validationSchema = {};
|
|
60
67
|
if ('timeMin' in options) validationSchema.timeMin = { type: 'string' };
|
|
61
68
|
if ('timeMax' in options) validationSchema.timeMax = { type: 'string' };
|
|
62
|
-
if ('maxResults' in options)
|
|
69
|
+
if ('maxResults' in options)
|
|
70
|
+
validationSchema.maxResults = { type: 'number' };
|
|
63
71
|
if ('orderBy' in options) validationSchema.orderBy = { type: 'string' };
|
|
64
72
|
|
|
65
73
|
if (Object.keys(validationSchema).length > 0) {
|
|
@@ -70,7 +78,11 @@ export class GoogleCalendarService {
|
|
|
70
78
|
query: { calendarId, ...options },
|
|
71
79
|
};
|
|
72
80
|
|
|
73
|
-
const result = await this.sdk._fetch(
|
|
81
|
+
const result = await this.sdk._fetch(
|
|
82
|
+
'/googleCalendar/events',
|
|
83
|
+
'GET',
|
|
84
|
+
params,
|
|
85
|
+
);
|
|
74
86
|
return result;
|
|
75
87
|
}
|
|
76
88
|
|
|
@@ -86,7 +98,11 @@ export class GoogleCalendarService {
|
|
|
86
98
|
body: changeData,
|
|
87
99
|
};
|
|
88
100
|
|
|
89
|
-
const result = await this.sdk._fetch(
|
|
101
|
+
const result = await this.sdk._fetch(
|
|
102
|
+
'/googleCalendar/processChange',
|
|
103
|
+
'POST',
|
|
104
|
+
params,
|
|
105
|
+
);
|
|
90
106
|
return result;
|
|
91
107
|
}
|
|
92
|
-
}
|
|
108
|
+
}
|
package/services/layouts.js
CHANGED
|
@@ -15,11 +15,11 @@ export class LayoutsService {
|
|
|
15
15
|
|
|
16
16
|
const params = {
|
|
17
17
|
query,
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
|
|
20
20
|
let uri = `/layouts/${objectName}`;
|
|
21
21
|
if (id) {
|
|
22
|
-
uri = `${uri}/${id}
|
|
22
|
+
uri = `${uri}/${id}`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const result = await this.sdk._fetch(uri, 'GET', params);
|
|
@@ -36,7 +36,7 @@ export class LayoutsService {
|
|
|
36
36
|
|
|
37
37
|
const params = {
|
|
38
38
|
body: layout,
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
|
|
41
41
|
const result = await this.sdk._fetch('/layouts/', 'POST', params);
|
|
42
42
|
return result;
|
|
@@ -53,7 +53,7 @@ export class LayoutsService {
|
|
|
53
53
|
|
|
54
54
|
const params = {
|
|
55
55
|
body: layout,
|
|
56
|
-
}
|
|
56
|
+
};
|
|
57
57
|
|
|
58
58
|
const result = await this.sdk._fetch(`/layouts/${id}`, 'PUT', params);
|
|
59
59
|
return result;
|
|
@@ -67,7 +67,7 @@ export class LayoutsService {
|
|
|
67
67
|
},
|
|
68
68
|
);
|
|
69
69
|
|
|
70
|
-
const params = {}
|
|
70
|
+
const params = {};
|
|
71
71
|
|
|
72
72
|
const result = await this.sdk._fetch(`/layouts/${id}`, 'DELETE', params);
|
|
73
73
|
return result;
|
|
@@ -83,9 +83,13 @@ export class LayoutsService {
|
|
|
83
83
|
|
|
84
84
|
const params = {
|
|
85
85
|
query,
|
|
86
|
-
}
|
|
86
|
+
};
|
|
87
87
|
|
|
88
|
-
const result = await this.sdk._fetch(
|
|
88
|
+
const result = await this.sdk._fetch(
|
|
89
|
+
'/layouts/dynamic-select-search',
|
|
90
|
+
'GET',
|
|
91
|
+
params,
|
|
92
|
+
);
|
|
89
93
|
return result;
|
|
90
94
|
}
|
|
91
|
-
}
|
|
95
|
+
}
|
package/services/login.js
CHANGED
|
@@ -53,7 +53,12 @@ export class LoginService {
|
|
|
53
53
|
|
|
54
54
|
async validate() {
|
|
55
55
|
const options = {};
|
|
56
|
-
const validation = await this.sdk._fetch(
|
|
56
|
+
const validation = await this.sdk._fetch(
|
|
57
|
+
'/login/validate',
|
|
58
|
+
'POST',
|
|
59
|
+
options,
|
|
60
|
+
true,
|
|
61
|
+
);
|
|
57
62
|
return validation;
|
|
58
63
|
}
|
|
59
64
|
|
|
@@ -70,7 +75,11 @@ export class LoginService {
|
|
|
70
75
|
body: { currentPassword, newPassword },
|
|
71
76
|
};
|
|
72
77
|
|
|
73
|
-
const result = await this.sdk._fetch(
|
|
78
|
+
const result = await this.sdk._fetch(
|
|
79
|
+
'/login/changePassword',
|
|
80
|
+
'POST',
|
|
81
|
+
options,
|
|
82
|
+
);
|
|
74
83
|
return result;
|
|
75
84
|
}
|
|
76
|
-
}
|
|
85
|
+
}
|
package/services/lookup.js
CHANGED