edmaxlabs-core 1.4.8 → 2.4.9
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.cjs +17 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +17 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -242,7 +242,7 @@ var _Authentication = class _Authentication {
|
|
|
242
242
|
this.client = EdmaxLabs.instance;
|
|
243
243
|
this.app = new EdmaxLabs({
|
|
244
244
|
token: "auth",
|
|
245
|
-
project:
|
|
245
|
+
project: "6922d5982b23ae6a12e51d85"
|
|
246
246
|
});
|
|
247
247
|
_Authentication.instance = this;
|
|
248
248
|
this.restoreSession();
|
|
@@ -571,7 +571,7 @@ var Array2 = class {
|
|
|
571
571
|
const res = await new HttpsRequest({
|
|
572
572
|
method: "POST" /* POST */,
|
|
573
573
|
endpoint: `${this.app.getBaseUrl()}/db/array/show`,
|
|
574
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
574
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
575
575
|
body: {
|
|
576
576
|
collection: this.collection,
|
|
577
577
|
document: this.docID,
|
|
@@ -631,7 +631,7 @@ var Array2 = class {
|
|
|
631
631
|
const res = await new HttpsRequest({
|
|
632
632
|
method: "POST" /* POST */,
|
|
633
633
|
endpoint: `${this.app.getBaseUrl()}/db/array/push`,
|
|
634
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
634
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
635
635
|
body: {
|
|
636
636
|
collection: this.collection,
|
|
637
637
|
document: this.docID,
|
|
@@ -658,7 +658,7 @@ var Array2 = class {
|
|
|
658
658
|
const res = await new HttpsRequest({
|
|
659
659
|
method: "POST" /* POST */,
|
|
660
660
|
endpoint: `${this.app.getBaseUrl()}/db/array/update`,
|
|
661
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
661
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
662
662
|
body: {
|
|
663
663
|
collection: this.collection,
|
|
664
664
|
document: this.docID,
|
|
@@ -751,7 +751,7 @@ var DocumentRef = class {
|
|
|
751
751
|
const res = await new HttpsRequest({
|
|
752
752
|
method: "POST" /* POST */,
|
|
753
753
|
endpoint: `${this.app.getBaseUrl()}/db/create`,
|
|
754
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
754
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
755
755
|
body: { collection: this.collection, data: { ...data, id: this.id } }
|
|
756
756
|
}).sendRequest();
|
|
757
757
|
return res?.success ? DocumentSnapshot.fromMap(data) : null;
|
|
@@ -972,7 +972,7 @@ var Query = class {
|
|
|
972
972
|
const res = await new HttpsRequest({
|
|
973
973
|
method: "POST" /* POST */,
|
|
974
974
|
endpoint: `${this.app.getBaseUrl()}/db/read`,
|
|
975
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
975
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
976
976
|
body: {
|
|
977
977
|
collection: this.collection,
|
|
978
978
|
filter: genfilter
|
|
@@ -997,7 +997,7 @@ var Query = class {
|
|
|
997
997
|
const res = await new HttpsRequest({
|
|
998
998
|
method: "POST" /* POST */,
|
|
999
999
|
endpoint: `${this.app.getBaseUrl()}/db/update`,
|
|
1000
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
1000
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
1001
1001
|
body: {
|
|
1002
1002
|
collection: this.collection,
|
|
1003
1003
|
filter: genfilter,
|
|
@@ -1079,7 +1079,7 @@ var CollectionRef = class {
|
|
|
1079
1079
|
const res = await new HttpsRequest({
|
|
1080
1080
|
method: "POST" /* POST */,
|
|
1081
1081
|
endpoint: `${this.app.getBaseUrl()}/db/read`,
|
|
1082
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
1082
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
1083
1083
|
body: {
|
|
1084
1084
|
collection: this.collection,
|
|
1085
1085
|
filter: {}
|
|
@@ -1241,7 +1241,7 @@ var Batch = class {
|
|
|
1241
1241
|
const res = await new HttpsRequest({
|
|
1242
1242
|
method: "POST" /* POST */,
|
|
1243
1243
|
endpoint: `${this.app.getBaseUrl()}/db/batch`,
|
|
1244
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
1244
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
1245
1245
|
body: { ops: this.ops }
|
|
1246
1246
|
}).sendRequest();
|
|
1247
1247
|
if (res?.error) {
|
|
@@ -1293,7 +1293,7 @@ var Database = class {
|
|
|
1293
1293
|
const res = await new HttpsRequest({
|
|
1294
1294
|
method: "POST" /* POST */,
|
|
1295
1295
|
endpoint: `${this.app.getBaseUrl()}/db/transaction`,
|
|
1296
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
1296
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
1297
1297
|
body: { ops: tx.ops }
|
|
1298
1298
|
}).sendRequest();
|
|
1299
1299
|
if (res?.error) {
|
|
@@ -1353,7 +1353,7 @@ var Realtime = class {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
this.socket = (0, import_socket.io)(this.app.getSocketUrl(), {
|
|
1355
1355
|
transports: ["websocket"],
|
|
1356
|
-
auth: { token: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
1356
|
+
auth: { token: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
1357
1357
|
autoConnect: true,
|
|
1358
1358
|
reconnection: true,
|
|
1359
1359
|
reconnectionAttempts: Infinity,
|
|
@@ -1486,7 +1486,7 @@ var Functions = class {
|
|
|
1486
1486
|
const res = await new HttpsRequest({
|
|
1487
1487
|
method: "POST" /* POST */,
|
|
1488
1488
|
endpoint: this.app.getBaseUrl() + "/functions/call/" + functionName,
|
|
1489
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
1489
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
1490
1490
|
body: data
|
|
1491
1491
|
}).sendRequest();
|
|
1492
1492
|
return res;
|
|
@@ -1509,7 +1509,7 @@ var Hosting = class {
|
|
|
1509
1509
|
const res = await new HttpsRequest({
|
|
1510
1510
|
method: "POST" /* POST */,
|
|
1511
1511
|
endpoint: this.app.getBaseUrl() + "/hosting/register",
|
|
1512
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
1512
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
1513
1513
|
body: {
|
|
1514
1514
|
hostname: name,
|
|
1515
1515
|
project: this.app.getConfig().project
|
|
@@ -2344,7 +2344,7 @@ var SyncEngine = class {
|
|
|
2344
2344
|
const res = await new HttpsRequest({
|
|
2345
2345
|
method: "POST" /* POST */,
|
|
2346
2346
|
endpoint: `${this.app.getBaseUrl()}/db/create`,
|
|
2347
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
2347
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
2348
2348
|
body: {
|
|
2349
2349
|
collection: mutation.collection,
|
|
2350
2350
|
data: mutation.payload
|
|
@@ -2371,7 +2371,7 @@ var SyncEngine = class {
|
|
|
2371
2371
|
const res = await new HttpsRequest({
|
|
2372
2372
|
method: "POST" /* POST */,
|
|
2373
2373
|
endpoint: `${this.app.getBaseUrl()}/db/update`,
|
|
2374
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
2374
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
2375
2375
|
body: {
|
|
2376
2376
|
collection: mutation.collection,
|
|
2377
2377
|
document: mutation.documentId,
|
|
@@ -2403,7 +2403,7 @@ var SyncEngine = class {
|
|
|
2403
2403
|
const res = await new HttpsRequest({
|
|
2404
2404
|
method: "POST" /* POST */,
|
|
2405
2405
|
endpoint: `${this.app.getBaseUrl()}/db/delete`,
|
|
2406
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
2406
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
2407
2407
|
body: {
|
|
2408
2408
|
collection: mutation.collection,
|
|
2409
2409
|
document: mutation.documentId
|
|
@@ -2562,7 +2562,7 @@ var StorageRef = class {
|
|
|
2562
2562
|
const res = await new HttpsRequest({
|
|
2563
2563
|
method: "POST" /* POST */,
|
|
2564
2564
|
endpoint: this.app.getBaseUrl() + "/storage/file/delete",
|
|
2565
|
-
headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
|
|
2565
|
+
headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
|
|
2566
2566
|
body: {
|
|
2567
2567
|
file_id: id
|
|
2568
2568
|
}
|