@nebula-ai/sdk 1.4.0 → 1.6.0-rc.0
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 +29 -13
- package/dist/index.cjs +75 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -353
- package/dist/index.d.ts +112 -353
- package/dist/index.js +75 -198
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -293,14 +293,14 @@ var ClientResource = class {
|
|
|
293
293
|
* @endpoint GET /v1/health
|
|
294
294
|
*/
|
|
295
295
|
async health(options) {
|
|
296
|
-
return this.core.request({
|
|
296
|
+
return (await this.core.request({
|
|
297
297
|
method: "GET",
|
|
298
298
|
path: "/v1/health",
|
|
299
299
|
pathParams: {},
|
|
300
300
|
query: void 0,
|
|
301
301
|
idempotent: true,
|
|
302
302
|
signal: options?.signal
|
|
303
|
-
});
|
|
303
|
+
})).results;
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
306
|
//#endregion
|
|
@@ -323,16 +323,16 @@ var CollectionsResource = class {
|
|
|
323
323
|
* @operationId collections.create
|
|
324
324
|
* @endpoint POST /v1/collections
|
|
325
325
|
*/
|
|
326
|
-
async create(
|
|
327
|
-
return this.core.request({
|
|
326
|
+
async create(body, options) {
|
|
327
|
+
return (await this.core.request({
|
|
328
328
|
method: "POST",
|
|
329
329
|
path: "/v1/collections",
|
|
330
330
|
pathParams: {},
|
|
331
331
|
query: void 0,
|
|
332
|
-
body
|
|
332
|
+
body,
|
|
333
333
|
idempotent: false,
|
|
334
334
|
signal: options?.signal
|
|
335
|
-
});
|
|
335
|
+
})).results;
|
|
336
336
|
}
|
|
337
337
|
/**
|
|
338
338
|
*
|
|
@@ -348,14 +348,14 @@ var CollectionsResource = class {
|
|
|
348
348
|
* @endpoint DELETE /v1/collections/{id}
|
|
349
349
|
*/
|
|
350
350
|
async delete(id, options) {
|
|
351
|
-
return this.core.request({
|
|
351
|
+
return (await this.core.request({
|
|
352
352
|
method: "DELETE",
|
|
353
353
|
path: "/v1/collections/{id}",
|
|
354
354
|
pathParams: { id },
|
|
355
355
|
query: void 0,
|
|
356
356
|
idempotent: true,
|
|
357
357
|
signal: options?.signal
|
|
358
|
-
});
|
|
358
|
+
})).results;
|
|
359
359
|
}
|
|
360
360
|
/**
|
|
361
361
|
*
|
|
@@ -403,14 +403,14 @@ var CollectionsResource = class {
|
|
|
403
403
|
* @endpoint GET /v1/collections/{id}
|
|
404
404
|
*/
|
|
405
405
|
async retrieve(id, options) {
|
|
406
|
-
return this.core.request({
|
|
406
|
+
return (await this.core.request({
|
|
407
407
|
method: "GET",
|
|
408
408
|
path: "/v1/collections/{id}",
|
|
409
409
|
pathParams: { id },
|
|
410
410
|
query: void 0,
|
|
411
411
|
idempotent: true,
|
|
412
412
|
signal: options?.signal
|
|
413
|
-
});
|
|
413
|
+
})).results;
|
|
414
414
|
}
|
|
415
415
|
/**
|
|
416
416
|
*
|
|
@@ -424,14 +424,14 @@ var CollectionsResource = class {
|
|
|
424
424
|
* @endpoint GET /v1/collections/name/{collection_name}
|
|
425
425
|
*/
|
|
426
426
|
async retrieveByName(params, options) {
|
|
427
|
-
return this.core.request({
|
|
427
|
+
return (await this.core.request({
|
|
428
428
|
method: "GET",
|
|
429
429
|
path: "/v1/collections/name/{collection_name}",
|
|
430
430
|
pathParams: { collection_name: params.collectionName },
|
|
431
431
|
query: { owner_id: params.ownerId },
|
|
432
432
|
idempotent: true,
|
|
433
433
|
signal: options?.signal
|
|
434
|
-
});
|
|
434
|
+
})).results;
|
|
435
435
|
}
|
|
436
436
|
/**
|
|
437
437
|
*
|
|
@@ -446,7 +446,7 @@ var CollectionsResource = class {
|
|
|
446
446
|
* @endpoint POST /v1/collections/{id}
|
|
447
447
|
*/
|
|
448
448
|
async update(params, options) {
|
|
449
|
-
return this.core.request({
|
|
449
|
+
return (await this.core.request({
|
|
450
450
|
method: "POST",
|
|
451
451
|
path: "/v1/collections/{id}",
|
|
452
452
|
pathParams: { id: params.id },
|
|
@@ -454,7 +454,7 @@ var CollectionsResource = class {
|
|
|
454
454
|
body: params.body,
|
|
455
455
|
idempotent: false,
|
|
456
456
|
signal: options?.signal
|
|
457
|
-
});
|
|
457
|
+
})).results;
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
460
|
//#endregion
|
|
@@ -473,7 +473,7 @@ var ConnectorsResource = class {
|
|
|
473
473
|
* @endpoint POST /v1/connectors/{provider}/connect
|
|
474
474
|
*/
|
|
475
475
|
async connect(params, options) {
|
|
476
|
-
return this.core.request({
|
|
476
|
+
return (await this.core.request({
|
|
477
477
|
method: "POST",
|
|
478
478
|
path: "/v1/connectors/{provider}/connect",
|
|
479
479
|
pathParams: { provider: params.provider },
|
|
@@ -481,7 +481,7 @@ var ConnectorsResource = class {
|
|
|
481
481
|
body: params.body,
|
|
482
482
|
idempotent: false,
|
|
483
483
|
signal: options?.signal
|
|
484
|
-
});
|
|
484
|
+
})).results;
|
|
485
485
|
}
|
|
486
486
|
/**
|
|
487
487
|
*
|
|
@@ -492,14 +492,14 @@ var ConnectorsResource = class {
|
|
|
492
492
|
* @endpoint DELETE /v1/connectors/{connection_id}
|
|
493
493
|
*/
|
|
494
494
|
async disconnect(params, options) {
|
|
495
|
-
return this.core.request({
|
|
495
|
+
return (await this.core.request({
|
|
496
496
|
method: "DELETE",
|
|
497
497
|
path: "/v1/connectors/{connection_id}",
|
|
498
498
|
pathParams: { connection_id: params.connectionId },
|
|
499
499
|
query: { delete_memories: params.deleteMemories },
|
|
500
500
|
idempotent: true,
|
|
501
501
|
signal: options?.signal
|
|
502
|
-
});
|
|
502
|
+
})).results;
|
|
503
503
|
}
|
|
504
504
|
/**
|
|
505
505
|
*
|
|
@@ -510,14 +510,14 @@ var ConnectorsResource = class {
|
|
|
510
510
|
* @endpoint GET /v1/connectors
|
|
511
511
|
*/
|
|
512
512
|
async list(params, options) {
|
|
513
|
-
return this.core.request({
|
|
513
|
+
return (await this.core.request({
|
|
514
514
|
method: "GET",
|
|
515
515
|
path: "/v1/connectors",
|
|
516
516
|
pathParams: {},
|
|
517
517
|
query: { collection_id: params.collectionId },
|
|
518
518
|
idempotent: true,
|
|
519
519
|
signal: options?.signal
|
|
520
|
-
});
|
|
520
|
+
})).results;
|
|
521
521
|
}
|
|
522
522
|
/**
|
|
523
523
|
*
|
|
@@ -528,14 +528,14 @@ var ConnectorsResource = class {
|
|
|
528
528
|
* @endpoint GET /v1/connectors/providers
|
|
529
529
|
*/
|
|
530
530
|
async listProviders(options) {
|
|
531
|
-
return this.core.request({
|
|
531
|
+
return (await this.core.request({
|
|
532
532
|
method: "GET",
|
|
533
533
|
path: "/v1/connectors/providers",
|
|
534
534
|
pathParams: {},
|
|
535
535
|
query: void 0,
|
|
536
536
|
idempotent: true,
|
|
537
537
|
signal: options?.signal
|
|
538
|
-
});
|
|
538
|
+
})).results;
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
541
541
|
*
|
|
@@ -546,14 +546,14 @@ var ConnectorsResource = class {
|
|
|
546
546
|
* @endpoint GET /v1/connectors/{connection_id}
|
|
547
547
|
*/
|
|
548
548
|
async retrieve(connectionId, options) {
|
|
549
|
-
return this.core.request({
|
|
549
|
+
return (await this.core.request({
|
|
550
550
|
method: "GET",
|
|
551
551
|
path: "/v1/connectors/{connection_id}",
|
|
552
552
|
pathParams: { connection_id: connectionId },
|
|
553
553
|
query: void 0,
|
|
554
554
|
idempotent: true,
|
|
555
555
|
signal: options?.signal
|
|
556
|
-
});
|
|
556
|
+
})).results;
|
|
557
557
|
}
|
|
558
558
|
/**
|
|
559
559
|
*
|
|
@@ -564,14 +564,14 @@ var ConnectorsResource = class {
|
|
|
564
564
|
* @endpoint POST /v1/connectors/{connection_id}/sync
|
|
565
565
|
*/
|
|
566
566
|
async sync(connectionId, options) {
|
|
567
|
-
return this.core.request({
|
|
567
|
+
return (await this.core.request({
|
|
568
568
|
method: "POST",
|
|
569
569
|
path: "/v1/connectors/{connection_id}/sync",
|
|
570
570
|
pathParams: { connection_id: connectionId },
|
|
571
571
|
query: void 0,
|
|
572
572
|
idempotent: true,
|
|
573
573
|
signal: options?.signal
|
|
574
|
-
});
|
|
574
|
+
})).results;
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
577
|
//#endregion
|
|
@@ -598,7 +598,7 @@ var MemoriesResource = class {
|
|
|
598
598
|
* @endpoint POST /v1/memories/{id}/append
|
|
599
599
|
*/
|
|
600
600
|
async append(params, options) {
|
|
601
|
-
return this.core.request({
|
|
601
|
+
return (await this.core.request({
|
|
602
602
|
method: "POST",
|
|
603
603
|
path: "/v1/memories/{id}/append",
|
|
604
604
|
pathParams: { id: params.id },
|
|
@@ -606,7 +606,7 @@ var MemoriesResource = class {
|
|
|
606
606
|
body: params.body,
|
|
607
607
|
idempotent: false,
|
|
608
608
|
signal: options?.signal
|
|
609
|
-
});
|
|
609
|
+
})).results;
|
|
610
610
|
}
|
|
611
611
|
/**
|
|
612
612
|
*
|
|
@@ -624,16 +624,16 @@ var MemoriesResource = class {
|
|
|
624
624
|
* @operationId memories.create
|
|
625
625
|
* @endpoint POST /v1/memories
|
|
626
626
|
*/
|
|
627
|
-
async create(
|
|
628
|
-
return this.core.request({
|
|
627
|
+
async create(body, options) {
|
|
628
|
+
return (await this.core.request({
|
|
629
629
|
method: "POST",
|
|
630
630
|
path: "/v1/memories",
|
|
631
631
|
pathParams: {},
|
|
632
632
|
query: void 0,
|
|
633
|
-
body
|
|
633
|
+
body,
|
|
634
634
|
idempotent: false,
|
|
635
635
|
signal: options?.signal
|
|
636
|
-
});
|
|
636
|
+
})).results;
|
|
637
637
|
}
|
|
638
638
|
/**
|
|
639
639
|
*
|
|
@@ -661,7 +661,7 @@ var MemoriesResource = class {
|
|
|
661
661
|
* @endpoint POST /v1/memories/upload
|
|
662
662
|
*/
|
|
663
663
|
async createUpload(params, options) {
|
|
664
|
-
return this.core.request({
|
|
664
|
+
return (await this.core.request({
|
|
665
665
|
method: "POST",
|
|
666
666
|
path: "/v1/memories/upload",
|
|
667
667
|
pathParams: {},
|
|
@@ -672,7 +672,7 @@ var MemoriesResource = class {
|
|
|
672
672
|
},
|
|
673
673
|
idempotent: false,
|
|
674
674
|
signal: options?.signal
|
|
675
|
-
});
|
|
675
|
+
})).results;
|
|
676
676
|
}
|
|
677
677
|
/**
|
|
678
678
|
*
|
|
@@ -688,14 +688,14 @@ var MemoriesResource = class {
|
|
|
688
688
|
* @endpoint DELETE /v1/memories/{id}
|
|
689
689
|
*/
|
|
690
690
|
async delete(id, options) {
|
|
691
|
-
return this.core.request({
|
|
691
|
+
return (await this.core.request({
|
|
692
692
|
method: "DELETE",
|
|
693
693
|
path: "/v1/memories/{id}",
|
|
694
694
|
pathParams: { id },
|
|
695
695
|
query: void 0,
|
|
696
696
|
idempotent: false,
|
|
697
697
|
signal: options?.signal
|
|
698
|
-
});
|
|
698
|
+
})).results;
|
|
699
699
|
}
|
|
700
700
|
/**
|
|
701
701
|
*
|
|
@@ -715,13 +715,13 @@ var MemoriesResource = class {
|
|
|
715
715
|
* @operationId memories.deleteMany
|
|
716
716
|
* @endpoint POST /v1/memories/delete
|
|
717
717
|
*/
|
|
718
|
-
async deleteMany(
|
|
718
|
+
async deleteMany(body, options) {
|
|
719
719
|
return this.core.request({
|
|
720
720
|
method: "POST",
|
|
721
721
|
path: "/v1/memories/delete",
|
|
722
722
|
pathParams: {},
|
|
723
723
|
query: void 0,
|
|
724
|
-
body
|
|
724
|
+
body,
|
|
725
725
|
idempotent: false,
|
|
726
726
|
signal: options?.signal
|
|
727
727
|
});
|
|
@@ -736,14 +736,14 @@ var MemoriesResource = class {
|
|
|
736
736
|
* @endpoint DELETE /v1/memories/upload
|
|
737
737
|
*/
|
|
738
738
|
async deleteUpload(params, options) {
|
|
739
|
-
return this.core.request({
|
|
739
|
+
return (await this.core.request({
|
|
740
740
|
method: "DELETE",
|
|
741
741
|
path: "/v1/memories/upload",
|
|
742
742
|
pathParams: {},
|
|
743
743
|
query: { s3_key: params.s3Key },
|
|
744
744
|
idempotent: true,
|
|
745
745
|
signal: options?.signal
|
|
746
|
-
});
|
|
746
|
+
})).results;
|
|
747
747
|
}
|
|
748
748
|
/**
|
|
749
749
|
*
|
|
@@ -797,16 +797,16 @@ var MemoriesResource = class {
|
|
|
797
797
|
* @operationId memories.recallWorkflow
|
|
798
798
|
* @endpoint POST /v1/memories/workflow/recall
|
|
799
799
|
*/
|
|
800
|
-
async recallWorkflow(
|
|
801
|
-
return this.core.request({
|
|
800
|
+
async recallWorkflow(body, options) {
|
|
801
|
+
return (await this.core.request({
|
|
802
802
|
method: "POST",
|
|
803
803
|
path: "/v1/memories/workflow/recall",
|
|
804
804
|
pathParams: {},
|
|
805
805
|
query: void 0,
|
|
806
|
-
body
|
|
806
|
+
body,
|
|
807
807
|
idempotent: false,
|
|
808
808
|
signal: options?.signal
|
|
809
|
-
});
|
|
809
|
+
})).results;
|
|
810
810
|
}
|
|
811
811
|
/**
|
|
812
812
|
*
|
|
@@ -824,14 +824,14 @@ var MemoriesResource = class {
|
|
|
824
824
|
* @endpoint GET /v1/memories/{id}
|
|
825
825
|
*/
|
|
826
826
|
async retrieve(id, options) {
|
|
827
|
-
return this.core.request({
|
|
827
|
+
return (await this.core.request({
|
|
828
828
|
method: "GET",
|
|
829
829
|
path: "/v1/memories/{id}",
|
|
830
830
|
pathParams: { id },
|
|
831
831
|
query: void 0,
|
|
832
832
|
idempotent: true,
|
|
833
833
|
signal: options?.signal
|
|
834
|
-
});
|
|
834
|
+
})).results;
|
|
835
835
|
}
|
|
836
836
|
/**
|
|
837
837
|
*
|
|
@@ -847,16 +847,16 @@ var MemoriesResource = class {
|
|
|
847
847
|
* @operationId memories.search
|
|
848
848
|
* @endpoint POST /v1/memories/search
|
|
849
849
|
*/
|
|
850
|
-
async search(
|
|
851
|
-
return this.core.request({
|
|
850
|
+
async search(body, options) {
|
|
851
|
+
return (await this.core.request({
|
|
852
852
|
method: "POST",
|
|
853
853
|
path: "/v1/memories/search",
|
|
854
854
|
pathParams: {},
|
|
855
855
|
query: void 0,
|
|
856
|
-
body
|
|
856
|
+
body,
|
|
857
857
|
idempotent: false,
|
|
858
858
|
signal: options?.signal
|
|
859
|
-
});
|
|
859
|
+
})).results;
|
|
860
860
|
}
|
|
861
861
|
/**
|
|
862
862
|
*
|
|
@@ -879,7 +879,7 @@ var MemoriesResource = class {
|
|
|
879
879
|
* @endpoint PATCH /v1/memories/{id}
|
|
880
880
|
*/
|
|
881
881
|
async update(params, options) {
|
|
882
|
-
return this.core.request({
|
|
882
|
+
return (await this.core.request({
|
|
883
883
|
method: "PATCH",
|
|
884
884
|
path: "/v1/memories/{id}",
|
|
885
885
|
pathParams: { id: params.id },
|
|
@@ -887,7 +887,7 @@ var MemoriesResource = class {
|
|
|
887
887
|
body: params.body,
|
|
888
888
|
idempotent: false,
|
|
889
889
|
signal: options?.signal
|
|
890
|
-
});
|
|
890
|
+
})).results;
|
|
891
891
|
}
|
|
892
892
|
};
|
|
893
893
|
//#endregion
|
|
@@ -906,16 +906,16 @@ var SnapshotsResource = class {
|
|
|
906
906
|
* @operationId snapshots.export
|
|
907
907
|
* @endpoint POST /v1/device-memory/snapshot/export
|
|
908
908
|
*/
|
|
909
|
-
async export(
|
|
910
|
-
return this.core.request({
|
|
909
|
+
async export(body, options) {
|
|
910
|
+
return (await this.core.request({
|
|
911
911
|
method: "POST",
|
|
912
912
|
path: "/v1/device-memory/snapshot/export",
|
|
913
913
|
pathParams: {},
|
|
914
914
|
query: void 0,
|
|
915
|
-
body
|
|
915
|
+
body,
|
|
916
916
|
idempotent: true,
|
|
917
917
|
signal: options?.signal
|
|
918
|
-
});
|
|
918
|
+
})).results;
|
|
919
919
|
}
|
|
920
920
|
/**
|
|
921
921
|
*
|
|
@@ -926,16 +926,16 @@ var SnapshotsResource = class {
|
|
|
926
926
|
* @operationId snapshots.import
|
|
927
927
|
* @endpoint POST /v1/device-memory/snapshot/import
|
|
928
928
|
*/
|
|
929
|
-
async import(
|
|
930
|
-
return this.core.request({
|
|
929
|
+
async import(body, options) {
|
|
930
|
+
return (await this.core.request({
|
|
931
931
|
method: "POST",
|
|
932
932
|
path: "/v1/device-memory/snapshot/import",
|
|
933
933
|
pathParams: {},
|
|
934
934
|
query: void 0,
|
|
935
|
-
body
|
|
935
|
+
body,
|
|
936
936
|
idempotent: false,
|
|
937
937
|
signal: options?.signal
|
|
938
|
-
});
|
|
938
|
+
})).results;
|
|
939
939
|
}
|
|
940
940
|
};
|
|
941
941
|
//#endregion
|
|
@@ -957,80 +957,8 @@ var NebulaClient = class {
|
|
|
957
957
|
}
|
|
958
958
|
};
|
|
959
959
|
//#endregion
|
|
960
|
-
//#region src/lib/_dx_generated.ts
|
|
961
|
-
/** Strip a `results` envelope at runtime; matches `Unwrapped<>`. */
|
|
962
|
-
function unwrap$1(p) {
|
|
963
|
-
return p.then((r) => {
|
|
964
|
-
if (r !== null && typeof r === "object" && "results" in r) return r.results;
|
|
965
|
-
return r;
|
|
966
|
-
});
|
|
967
|
-
}
|
|
968
|
-
/**
|
|
969
|
-
* Generated DX layer: simple unwrap/passthrough convenience methods.
|
|
970
|
-
* Signatures are derived from the underlying resource methods so
|
|
971
|
-
* callers see the same arg names + types in IDE hover.
|
|
972
|
-
*/
|
|
973
|
-
var NebulaDX = class extends NebulaClient {
|
|
974
|
-
/** Retrieve a single memory by id and return just the data. (generated from dx-extensions.yaml). */
|
|
975
|
-
async getMemory(...args) {
|
|
976
|
-
return unwrap$1(this.memories.retrieve(...args));
|
|
977
|
-
}
|
|
978
|
-
/** Update a memory by id; returns the updated record. (generated from dx-extensions.yaml). */
|
|
979
|
-
async updateMemory(...args) {
|
|
980
|
-
return unwrap$1(this.memories.update(...args));
|
|
981
|
-
}
|
|
982
|
-
/** Liveness probe with the wire envelope unwrapped. (generated from dx-extensions.yaml). */
|
|
983
|
-
async healthCheck(...args) {
|
|
984
|
-
return unwrap$1(this.client.health(...args));
|
|
985
|
-
}
|
|
986
|
-
/** unwrap → collections.create (generated from dx-extensions.yaml). */
|
|
987
|
-
async createCollection(...args) {
|
|
988
|
-
return unwrap$1(this.collections.create(...args));
|
|
989
|
-
}
|
|
990
|
-
/** unwrap → collections.retrieve (generated from dx-extensions.yaml). */
|
|
991
|
-
async getCollection(...args) {
|
|
992
|
-
return unwrap$1(this.collections.retrieve(...args));
|
|
993
|
-
}
|
|
994
|
-
/** unwrap → collections.retrieveByName (generated from dx-extensions.yaml). */
|
|
995
|
-
async getCollectionByName(...args) {
|
|
996
|
-
return unwrap$1(this.collections.retrieveByName(...args));
|
|
997
|
-
}
|
|
998
|
-
/** unwrap → collections.list (generated from dx-extensions.yaml). */
|
|
999
|
-
async listCollections(...args) {
|
|
1000
|
-
return unwrap$1(this.collections.list(...args));
|
|
1001
|
-
}
|
|
1002
|
-
/** unwrap → collections.update (generated from dx-extensions.yaml). */
|
|
1003
|
-
async updateCollection(...args) {
|
|
1004
|
-
return unwrap$1(this.collections.update(...args));
|
|
1005
|
-
}
|
|
1006
|
-
/** unwrap → connectors.listProviders (generated from dx-extensions.yaml). */
|
|
1007
|
-
async listProviders(...args) {
|
|
1008
|
-
return unwrap$1(this.connectors.listProviders(...args));
|
|
1009
|
-
}
|
|
1010
|
-
/** unwrap → connectors.retrieve (generated from dx-extensions.yaml). */
|
|
1011
|
-
async getConnection(...args) {
|
|
1012
|
-
return unwrap$1(this.connectors.retrieve(...args));
|
|
1013
|
-
}
|
|
1014
|
-
/** unwrap → connectors.sync (generated from dx-extensions.yaml). */
|
|
1015
|
-
async triggerSync(...args) {
|
|
1016
|
-
return unwrap$1(this.connectors.sync(...args));
|
|
1017
|
-
}
|
|
1018
|
-
/** unwrap → memories.createUpload (generated from dx-extensions.yaml). */
|
|
1019
|
-
async getUploadUrl(...args) {
|
|
1020
|
-
return unwrap$1(this.memories.createUpload(...args));
|
|
1021
|
-
}
|
|
1022
|
-
/** unwrap → snapshots.export (generated from dx-extensions.yaml). */
|
|
1023
|
-
async exportSnapshot(...args) {
|
|
1024
|
-
return unwrap$1(this.snapshots.export(...args));
|
|
1025
|
-
}
|
|
1026
|
-
/** unwrap → snapshots.import (generated from dx-extensions.yaml). */
|
|
1027
|
-
async importSnapshot(...args) {
|
|
1028
|
-
return unwrap$1(this.snapshots.import(...args));
|
|
1029
|
-
}
|
|
1030
|
-
};
|
|
1031
|
-
//#endregion
|
|
1032
960
|
//#region src/lib/dx.ts
|
|
1033
|
-
var Nebula = class extends
|
|
961
|
+
var Nebula = class extends NebulaClient {
|
|
1034
962
|
constructor(options = {}) {
|
|
1035
963
|
super(normalizeAuthOptions(normalizeClientOptions(options)));
|
|
1036
964
|
}
|
|
@@ -1048,7 +976,7 @@ var Nebula = class extends NebulaDX {
|
|
|
1048
976
|
}, options);
|
|
1049
977
|
return memoryID;
|
|
1050
978
|
}
|
|
1051
|
-
const result =
|
|
979
|
+
const result = await this.memories.create(toMemoryCreateParams(memory), options);
|
|
1052
980
|
if (isSnapshotResult(result)) return result.snapshot ?? result;
|
|
1053
981
|
return extractID(result);
|
|
1054
982
|
}
|
|
@@ -1081,30 +1009,9 @@ var Nebula = class extends NebulaDX {
|
|
|
1081
1009
|
*/
|
|
1082
1010
|
async listMemories(query, options) {
|
|
1083
1011
|
const normalized = typeof query === "string" || Array.isArray(query) ? { collectionIds: arrayify(query) } : query;
|
|
1084
|
-
return
|
|
1012
|
+
return this.memories.list(normalized, options);
|
|
1085
1013
|
}
|
|
1086
1014
|
/**
|
|
1087
|
-
* Memory search shortcut: unwraps `results`. (Affinity-header injection
|
|
1088
|
-
* is a planned enhancement; currently delegates straight to the resource.)
|
|
1089
|
-
*/
|
|
1090
|
-
async search(body, options) {
|
|
1091
|
-
return unwrap(this.memories.search({ body }, options));
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* deleteCollection coerces the wire {success: bool} envelope into a Python-
|
|
1095
|
-
* style boolean return.
|
|
1096
|
-
*/
|
|
1097
|
-
async deleteCollection(id, options) {
|
|
1098
|
-
const result = unwrapResults(await this.collections.delete(id, options));
|
|
1099
|
-
return Boolean(result.success);
|
|
1100
|
-
}
|
|
1101
|
-
createCluster = this.createCollection;
|
|
1102
|
-
getCluster = this.getCollection;
|
|
1103
|
-
getClusterByName = this.getCollectionByName;
|
|
1104
|
-
listClusters = this.listCollections;
|
|
1105
|
-
updateCluster = this.updateCollection;
|
|
1106
|
-
deleteCluster = this.deleteCollection;
|
|
1107
|
-
/**
|
|
1108
1015
|
* Positional `connectProvider(provider, collectionID, config?)` — wraps the
|
|
1109
1016
|
* generated `connectors.connect({provider, body})` to build the body shape.
|
|
1110
1017
|
*/
|
|
@@ -1113,48 +1020,28 @@ var Nebula = class extends NebulaDX {
|
|
|
1113
1020
|
collection_id: collectionID,
|
|
1114
1021
|
...config !== void 0 ? { config } : {}
|
|
1115
1022
|
};
|
|
1116
|
-
return
|
|
1023
|
+
return this.connectors.connect({
|
|
1117
1024
|
provider,
|
|
1118
1025
|
body
|
|
1119
|
-
}, options)
|
|
1026
|
+
}, options);
|
|
1120
1027
|
}
|
|
1121
1028
|
/** Positional listConnections(collectionID) — wraps the query wrapper. */
|
|
1122
1029
|
async listConnections(collectionID, options) {
|
|
1123
|
-
return
|
|
1030
|
+
return this.connectors.list({ collectionId: collectionID }, options);
|
|
1124
1031
|
}
|
|
1125
1032
|
/** Positional disconnect(connectionID, deleteMemories?). */
|
|
1126
1033
|
async disconnectConnection(connectionID, deleteMemories = false, options) {
|
|
1127
|
-
return
|
|
1034
|
+
return this.connectors.disconnect({
|
|
1128
1035
|
connectionId: connectionID,
|
|
1129
1036
|
deleteMemories
|
|
1130
|
-
}, options)
|
|
1037
|
+
}, options);
|
|
1131
1038
|
}
|
|
1132
1039
|
/** Alias for disconnectConnection (same arg shape). */
|
|
1133
1040
|
async disconnect(connectionID, deleteMemories = false, options) {
|
|
1134
|
-
return
|
|
1041
|
+
return this.connectors.disconnect({
|
|
1135
1042
|
connectionId: connectionID,
|
|
1136
1043
|
deleteMemories
|
|
1137
|
-
}, options)
|
|
1138
|
-
}
|
|
1139
|
-
/** Single-id delete; coerces 204 to boolean true. */
|
|
1140
|
-
async deleteMemory(memoryID, options) {
|
|
1141
|
-
await this.memories.delete(memoryID, options);
|
|
1142
|
-
return true;
|
|
1143
|
-
}
|
|
1144
|
-
/** Bulk delete by ids. */
|
|
1145
|
-
async deleteMemories(memoryIDs, options) {
|
|
1146
|
-
return this.memories.deleteMany({ body: memoryIDs }, options);
|
|
1147
|
-
}
|
|
1148
|
-
/**
|
|
1149
|
-
* Polymorphic delete: dispatches based on argument type.
|
|
1150
|
-
* - `delete("/some/path")` -> raw HTTP DELETE (escape hatch; not implemented)
|
|
1151
|
-
* - `delete("memory-id")` -> deleteMemory
|
|
1152
|
-
* - `delete(["id1", "id2"])` -> deleteMemories (bulk)
|
|
1153
|
-
*/
|
|
1154
|
-
async delete(pathOrMemoryIDs, options) {
|
|
1155
|
-
if (Array.isArray(pathOrMemoryIDs)) return this.deleteMemories(pathOrMemoryIDs, options);
|
|
1156
|
-
if (isRequestPath(pathOrMemoryIDs)) throw new Error(`delete("${pathOrMemoryIDs}") raw-path escape hatch is not implemented in this SDK yet`);
|
|
1157
|
-
return this.deleteMemory(pathOrMemoryIDs, options);
|
|
1044
|
+
}, options);
|
|
1158
1045
|
}
|
|
1159
1046
|
};
|
|
1160
1047
|
function normalizeAuthOptions(options) {
|
|
@@ -1166,13 +1053,13 @@ function normalizeAuthOptions(options) {
|
|
|
1166
1053
|
return options;
|
|
1167
1054
|
}
|
|
1168
1055
|
function normalizeClientOptions(options) {
|
|
1169
|
-
const {
|
|
1056
|
+
const { apiKey, baseUrl: baseUrlAlias, baseURL: baseURLCapAlias, timeout: timeoutAlias, bearerToken, ...rest } = options;
|
|
1170
1057
|
const restClientOptions = rest;
|
|
1171
1058
|
return {
|
|
1172
1059
|
...restClientOptions,
|
|
1173
|
-
apiKey:
|
|
1174
|
-
bearerToken:
|
|
1175
|
-
baseUrl: firstDefined(restClientOptions.baseUrl, baseUrlAlias, baseURLCapAlias
|
|
1060
|
+
apiKey: apiKey ?? void 0,
|
|
1061
|
+
bearerToken: bearerToken ?? void 0,
|
|
1062
|
+
baseUrl: firstDefined(restClientOptions.baseUrl, baseUrlAlias, baseURLCapAlias) ?? void 0,
|
|
1176
1063
|
timeoutMs: firstDefined(restClientOptions.timeoutMs, timeoutAlias) ?? void 0
|
|
1177
1064
|
};
|
|
1178
1065
|
}
|
|
@@ -1192,7 +1079,7 @@ function toMemoryCreateParams(memory) {
|
|
|
1192
1079
|
if (collectionID !== void 0) params.collection_id = collectionID;
|
|
1193
1080
|
if (content != null) if (typeof content === "string") params.raw_text = content;
|
|
1194
1081
|
else params.content_parts = content;
|
|
1195
|
-
if (params.messages != null && !params.
|
|
1082
|
+
if (params.messages != null && !params.kind) params.kind = "conversation";
|
|
1196
1083
|
return params;
|
|
1197
1084
|
}
|
|
1198
1085
|
function toMemoryAppendParams(memory) {
|
|
@@ -1218,13 +1105,6 @@ function toMemoryAppendParams(memory) {
|
|
|
1218
1105
|
}
|
|
1219
1106
|
return params;
|
|
1220
1107
|
}
|
|
1221
|
-
function unwrap(promise) {
|
|
1222
|
-
return Promise.resolve(promise).then((response) => unwrapResults(response));
|
|
1223
|
-
}
|
|
1224
|
-
function unwrapResults(response) {
|
|
1225
|
-
if (response !== null && typeof response === "object" && "results" in response) return response.results;
|
|
1226
|
-
return response;
|
|
1227
|
-
}
|
|
1228
1108
|
function extractID(value) {
|
|
1229
1109
|
if (typeof value === "object" && value !== null) {
|
|
1230
1110
|
const record = value;
|
|
@@ -1239,9 +1119,6 @@ function isSnapshotResult(value) {
|
|
|
1239
1119
|
function arrayify(value) {
|
|
1240
1120
|
return Array.isArray(value) ? value : [value];
|
|
1241
1121
|
}
|
|
1242
|
-
function isRequestPath(value) {
|
|
1243
|
-
return value.startsWith("/") || /^https?:\/\//i.test(value);
|
|
1244
|
-
}
|
|
1245
1122
|
//#endregion
|
|
1246
1123
|
exports.DEFAULT_RETRY = DEFAULT_RETRY;
|
|
1247
1124
|
exports.Nebula = Nebula;
|