@realtimex/sdk 1.2.2 → 1.2.4
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/dist/index.js +42 -37
- package/dist/index.mjs +42 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -71,16 +71,16 @@ var ApiModule = class {
|
|
|
71
71
|
this.apiKey = apiKey;
|
|
72
72
|
}
|
|
73
73
|
getHeaders() {
|
|
74
|
+
const headers = {
|
|
75
|
+
"Content-Type": "application/json"
|
|
76
|
+
};
|
|
74
77
|
if (this.apiKey) {
|
|
75
|
-
|
|
76
|
-
"Content-Type": "application/json",
|
|
77
|
-
"Authorization": `Bearer ${this.apiKey}`
|
|
78
|
-
};
|
|
78
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
if (this.appId) {
|
|
81
|
+
headers["x-app-id"] = this.appId;
|
|
82
|
+
}
|
|
83
|
+
return headers;
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* Request a single permission from Electron via internal API
|
|
@@ -189,7 +189,8 @@ var ActivitiesModule = class {
|
|
|
189
189
|
};
|
|
190
190
|
if (this.apiKey) {
|
|
191
191
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
192
|
-
}
|
|
192
|
+
}
|
|
193
|
+
if (this.appId) {
|
|
193
194
|
headers["x-app-id"] = this.appId;
|
|
194
195
|
}
|
|
195
196
|
const response = await fetch(url, {
|
|
@@ -312,7 +313,8 @@ var WebhookModule = class {
|
|
|
312
313
|
};
|
|
313
314
|
if (this.apiKey) {
|
|
314
315
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
315
|
-
}
|
|
316
|
+
}
|
|
317
|
+
if (this.appId) {
|
|
316
318
|
headers["x-app-id"] = this.appId;
|
|
317
319
|
}
|
|
318
320
|
const response = await fetch(url, {
|
|
@@ -404,7 +406,8 @@ var TaskModule = class {
|
|
|
404
406
|
const headers = { "Content-Type": "application/json" };
|
|
405
407
|
if (this.apiKey) {
|
|
406
408
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
407
|
-
}
|
|
409
|
+
}
|
|
410
|
+
if (this.appId) {
|
|
408
411
|
headers["x-app-id"] = this.appId;
|
|
409
412
|
}
|
|
410
413
|
const response = await fetch(`${this.realtimexUrl}/webhooks/realtimex`, {
|
|
@@ -525,16 +528,16 @@ var VectorStore = class {
|
|
|
525
528
|
this.apiKey = apiKey;
|
|
526
529
|
}
|
|
527
530
|
get headers() {
|
|
531
|
+
const headers = {
|
|
532
|
+
"Content-Type": "application/json"
|
|
533
|
+
};
|
|
528
534
|
if (this.apiKey) {
|
|
529
|
-
|
|
530
|
-
"Content-Type": "application/json",
|
|
531
|
-
"Authorization": `Bearer ${this.apiKey}`
|
|
532
|
-
};
|
|
535
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
533
536
|
}
|
|
534
|
-
|
|
535
|
-
"
|
|
536
|
-
|
|
537
|
-
|
|
537
|
+
if (this.appId) {
|
|
538
|
+
headers["x-app-id"] = this.appId;
|
|
539
|
+
}
|
|
540
|
+
return headers;
|
|
538
541
|
}
|
|
539
542
|
/**
|
|
540
543
|
* Request a single permission from Electron via internal API
|
|
@@ -686,16 +689,16 @@ var LLMModule = class {
|
|
|
686
689
|
this.vectors = new VectorStore(baseUrl, appId, appName, apiKey);
|
|
687
690
|
}
|
|
688
691
|
get headers() {
|
|
692
|
+
const headers = {
|
|
693
|
+
"Content-Type": "application/json"
|
|
694
|
+
};
|
|
689
695
|
if (this.apiKey) {
|
|
690
|
-
|
|
691
|
-
"Content-Type": "application/json",
|
|
692
|
-
"Authorization": `Bearer ${this.apiKey}`
|
|
693
|
-
};
|
|
696
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
694
697
|
}
|
|
695
|
-
|
|
696
|
-
"
|
|
697
|
-
|
|
698
|
-
|
|
698
|
+
if (this.appId) {
|
|
699
|
+
headers["x-app-id"] = this.appId;
|
|
700
|
+
}
|
|
701
|
+
return headers;
|
|
699
702
|
}
|
|
700
703
|
/**
|
|
701
704
|
* Request a single permission from Electron via internal API
|
|
@@ -990,16 +993,16 @@ var TTSModule = class {
|
|
|
990
993
|
this.apiKey = apiKey;
|
|
991
994
|
}
|
|
992
995
|
get headers() {
|
|
996
|
+
const headers = {
|
|
997
|
+
"Content-Type": "application/json"
|
|
998
|
+
};
|
|
993
999
|
if (this.apiKey) {
|
|
994
|
-
|
|
995
|
-
"Content-Type": "application/json",
|
|
996
|
-
"Authorization": `Bearer ${this.apiKey}`
|
|
997
|
-
};
|
|
1000
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
998
1001
|
}
|
|
999
|
-
|
|
1000
|
-
"
|
|
1001
|
-
|
|
1002
|
-
|
|
1002
|
+
if (this.appId) {
|
|
1003
|
+
headers["x-app-id"] = this.appId;
|
|
1004
|
+
}
|
|
1005
|
+
return headers;
|
|
1003
1006
|
}
|
|
1004
1007
|
/**
|
|
1005
1008
|
* Request a single permission from Electron via internal API
|
|
@@ -1234,7 +1237,8 @@ var _RealtimeXSDK = class _RealtimeXSDK {
|
|
|
1234
1237
|
const headers = { "Content-Type": "application/json" };
|
|
1235
1238
|
if (this.apiKey) {
|
|
1236
1239
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
1237
|
-
}
|
|
1240
|
+
}
|
|
1241
|
+
if (this.appId) {
|
|
1238
1242
|
headers["x-app-id"] = this.appId;
|
|
1239
1243
|
}
|
|
1240
1244
|
const response = await fetch(`${this.realtimexUrl.replace(/\/$/, "")}/sdk/ping`, {
|
|
@@ -1259,7 +1263,8 @@ var _RealtimeXSDK = class _RealtimeXSDK {
|
|
|
1259
1263
|
const headers = { "Content-Type": "application/json" };
|
|
1260
1264
|
if (this.apiKey) {
|
|
1261
1265
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
1262
|
-
}
|
|
1266
|
+
}
|
|
1267
|
+
if (this.appId) {
|
|
1263
1268
|
headers["x-app-id"] = this.appId;
|
|
1264
1269
|
}
|
|
1265
1270
|
const response = await fetch(`${this.realtimexUrl.replace(/\/$/, "")}/sdk/local-apps/data-dir`, {
|
package/dist/index.mjs
CHANGED
|
@@ -23,16 +23,16 @@ var ApiModule = class {
|
|
|
23
23
|
this.apiKey = apiKey;
|
|
24
24
|
}
|
|
25
25
|
getHeaders() {
|
|
26
|
+
const headers = {
|
|
27
|
+
"Content-Type": "application/json"
|
|
28
|
+
};
|
|
26
29
|
if (this.apiKey) {
|
|
27
|
-
|
|
28
|
-
"Content-Type": "application/json",
|
|
29
|
-
"Authorization": `Bearer ${this.apiKey}`
|
|
30
|
-
};
|
|
30
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
if (this.appId) {
|
|
33
|
+
headers["x-app-id"] = this.appId;
|
|
34
|
+
}
|
|
35
|
+
return headers;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Request a single permission from Electron via internal API
|
|
@@ -141,7 +141,8 @@ var ActivitiesModule = class {
|
|
|
141
141
|
};
|
|
142
142
|
if (this.apiKey) {
|
|
143
143
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
144
|
-
}
|
|
144
|
+
}
|
|
145
|
+
if (this.appId) {
|
|
145
146
|
headers["x-app-id"] = this.appId;
|
|
146
147
|
}
|
|
147
148
|
const response = await fetch(url, {
|
|
@@ -264,7 +265,8 @@ var WebhookModule = class {
|
|
|
264
265
|
};
|
|
265
266
|
if (this.apiKey) {
|
|
266
267
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
267
|
-
}
|
|
268
|
+
}
|
|
269
|
+
if (this.appId) {
|
|
268
270
|
headers["x-app-id"] = this.appId;
|
|
269
271
|
}
|
|
270
272
|
const response = await fetch(url, {
|
|
@@ -356,7 +358,8 @@ var TaskModule = class {
|
|
|
356
358
|
const headers = { "Content-Type": "application/json" };
|
|
357
359
|
if (this.apiKey) {
|
|
358
360
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
359
|
-
}
|
|
361
|
+
}
|
|
362
|
+
if (this.appId) {
|
|
360
363
|
headers["x-app-id"] = this.appId;
|
|
361
364
|
}
|
|
362
365
|
const response = await fetch(`${this.realtimexUrl}/webhooks/realtimex`, {
|
|
@@ -477,16 +480,16 @@ var VectorStore = class {
|
|
|
477
480
|
this.apiKey = apiKey;
|
|
478
481
|
}
|
|
479
482
|
get headers() {
|
|
483
|
+
const headers = {
|
|
484
|
+
"Content-Type": "application/json"
|
|
485
|
+
};
|
|
480
486
|
if (this.apiKey) {
|
|
481
|
-
|
|
482
|
-
"Content-Type": "application/json",
|
|
483
|
-
"Authorization": `Bearer ${this.apiKey}`
|
|
484
|
-
};
|
|
487
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
485
488
|
}
|
|
486
|
-
|
|
487
|
-
"
|
|
488
|
-
|
|
489
|
-
|
|
489
|
+
if (this.appId) {
|
|
490
|
+
headers["x-app-id"] = this.appId;
|
|
491
|
+
}
|
|
492
|
+
return headers;
|
|
490
493
|
}
|
|
491
494
|
/**
|
|
492
495
|
* Request a single permission from Electron via internal API
|
|
@@ -638,16 +641,16 @@ var LLMModule = class {
|
|
|
638
641
|
this.vectors = new VectorStore(baseUrl, appId, appName, apiKey);
|
|
639
642
|
}
|
|
640
643
|
get headers() {
|
|
644
|
+
const headers = {
|
|
645
|
+
"Content-Type": "application/json"
|
|
646
|
+
};
|
|
641
647
|
if (this.apiKey) {
|
|
642
|
-
|
|
643
|
-
"Content-Type": "application/json",
|
|
644
|
-
"Authorization": `Bearer ${this.apiKey}`
|
|
645
|
-
};
|
|
648
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
646
649
|
}
|
|
647
|
-
|
|
648
|
-
"
|
|
649
|
-
|
|
650
|
-
|
|
650
|
+
if (this.appId) {
|
|
651
|
+
headers["x-app-id"] = this.appId;
|
|
652
|
+
}
|
|
653
|
+
return headers;
|
|
651
654
|
}
|
|
652
655
|
/**
|
|
653
656
|
* Request a single permission from Electron via internal API
|
|
@@ -942,16 +945,16 @@ var TTSModule = class {
|
|
|
942
945
|
this.apiKey = apiKey;
|
|
943
946
|
}
|
|
944
947
|
get headers() {
|
|
948
|
+
const headers = {
|
|
949
|
+
"Content-Type": "application/json"
|
|
950
|
+
};
|
|
945
951
|
if (this.apiKey) {
|
|
946
|
-
|
|
947
|
-
"Content-Type": "application/json",
|
|
948
|
-
"Authorization": `Bearer ${this.apiKey}`
|
|
949
|
-
};
|
|
952
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
950
953
|
}
|
|
951
|
-
|
|
952
|
-
"
|
|
953
|
-
|
|
954
|
-
|
|
954
|
+
if (this.appId) {
|
|
955
|
+
headers["x-app-id"] = this.appId;
|
|
956
|
+
}
|
|
957
|
+
return headers;
|
|
955
958
|
}
|
|
956
959
|
/**
|
|
957
960
|
* Request a single permission from Electron via internal API
|
|
@@ -1186,7 +1189,8 @@ var _RealtimeXSDK = class _RealtimeXSDK {
|
|
|
1186
1189
|
const headers = { "Content-Type": "application/json" };
|
|
1187
1190
|
if (this.apiKey) {
|
|
1188
1191
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
1189
|
-
}
|
|
1192
|
+
}
|
|
1193
|
+
if (this.appId) {
|
|
1190
1194
|
headers["x-app-id"] = this.appId;
|
|
1191
1195
|
}
|
|
1192
1196
|
const response = await fetch(`${this.realtimexUrl.replace(/\/$/, "")}/sdk/ping`, {
|
|
@@ -1211,7 +1215,8 @@ var _RealtimeXSDK = class _RealtimeXSDK {
|
|
|
1211
1215
|
const headers = { "Content-Type": "application/json" };
|
|
1212
1216
|
if (this.apiKey) {
|
|
1213
1217
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
1214
|
-
}
|
|
1218
|
+
}
|
|
1219
|
+
if (this.appId) {
|
|
1215
1220
|
headers["x-app-id"] = this.appId;
|
|
1216
1221
|
}
|
|
1217
1222
|
const response = await fetch(`${this.realtimexUrl.replace(/\/$/, "")}/sdk/local-apps/data-dir`, {
|