@utaba/deep-memory-storage-cosmosdb 0.3.0 → 0.4.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/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StorageProvider, GraphTraversalProvider, EnsureSchemaResult, GraphTraversalCapabilities } from '@utaba/deep-memory/providers';
|
|
2
|
-
import { StorageRepositoryConfig, StoredRepository, RepositoryFilter, PaginatedResult, StoredRepositorySummary, RepositoryUpdate, DeleteProgressCallback, RepositoryStats, MemoryVocabulary, PaginationOptions, VocabularyChangeRecord, StoredEntity, StoredEntityUpdate, StorageFindQuery, StoredRelationship, RelationshipQueryOptions, StorageExploreOptions,
|
|
2
|
+
import { StorageRepositoryConfig, StoredRepository, RepositoryFilter, PaginatedResult, StoredRepositorySummary, RepositoryUpdate, DeleteProgressCallback, RepositoryStats, MemoryVocabulary, PaginationOptions, VocabularyChangeRecord, StoredEntity, StoredEntityUpdate, StorageFindQuery, StoredRelationship, RelationshipQueryOptions, StorageExploreOptions, StorageNeighborhood, StoragePathOptions, StoragePathResult, StorageTimelineOptions, StorageTimelineResult, ExportChunk, ImportChunk, BulkImportOptions, BulkImportResult, TraversalSpec, TraversalResult } from '@utaba/deep-memory/types';
|
|
3
3
|
import gremlin from 'gremlin';
|
|
4
4
|
|
|
5
5
|
/** Configuration for CosmosDbProvider. */
|
|
@@ -32,7 +32,7 @@ declare class CosmosDbProvider implements StorageProvider, GraphTraversalProvide
|
|
|
32
32
|
private readonly config;
|
|
33
33
|
private readonly compiler;
|
|
34
34
|
constructor(config: CosmosDbProviderConfig);
|
|
35
|
-
|
|
35
|
+
initialize(): Promise<void>;
|
|
36
36
|
dispose(): Promise<void>;
|
|
37
37
|
ensureSchema(): Promise<EnsureSchemaResult>;
|
|
38
38
|
/** Derive the REST endpoint from config — either explicit or from the Gremlin endpoint host. */
|
|
@@ -68,7 +68,7 @@ declare class CosmosDbProvider implements StorageProvider, GraphTraversalProvide
|
|
|
68
68
|
deleteRelationshipsByType(repositoryId: string, relationshipType: string): Promise<{
|
|
69
69
|
deletedRelationships: number;
|
|
70
70
|
}>;
|
|
71
|
-
|
|
71
|
+
exploreNeighborhood(repositoryId: string, entityId: string, options: StorageExploreOptions): Promise<StorageNeighborhood>;
|
|
72
72
|
findPaths(repositoryId: string, sourceId: string, targetId: string, options: StoragePathOptions): Promise<StoragePathResult>;
|
|
73
73
|
getTimeline(repositoryId: string, entityId: string, options: StorageTimelineOptions): Promise<StorageTimelineResult>;
|
|
74
74
|
exportAll(repositoryId: string): AsyncIterable<ExportChunk>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StorageProvider, GraphTraversalProvider, EnsureSchemaResult, GraphTraversalCapabilities } from '@utaba/deep-memory/providers';
|
|
2
|
-
import { StorageRepositoryConfig, StoredRepository, RepositoryFilter, PaginatedResult, StoredRepositorySummary, RepositoryUpdate, DeleteProgressCallback, RepositoryStats, MemoryVocabulary, PaginationOptions, VocabularyChangeRecord, StoredEntity, StoredEntityUpdate, StorageFindQuery, StoredRelationship, RelationshipQueryOptions, StorageExploreOptions,
|
|
2
|
+
import { StorageRepositoryConfig, StoredRepository, RepositoryFilter, PaginatedResult, StoredRepositorySummary, RepositoryUpdate, DeleteProgressCallback, RepositoryStats, MemoryVocabulary, PaginationOptions, VocabularyChangeRecord, StoredEntity, StoredEntityUpdate, StorageFindQuery, StoredRelationship, RelationshipQueryOptions, StorageExploreOptions, StorageNeighborhood, StoragePathOptions, StoragePathResult, StorageTimelineOptions, StorageTimelineResult, ExportChunk, ImportChunk, BulkImportOptions, BulkImportResult, TraversalSpec, TraversalResult } from '@utaba/deep-memory/types';
|
|
3
3
|
import gremlin from 'gremlin';
|
|
4
4
|
|
|
5
5
|
/** Configuration for CosmosDbProvider. */
|
|
@@ -32,7 +32,7 @@ declare class CosmosDbProvider implements StorageProvider, GraphTraversalProvide
|
|
|
32
32
|
private readonly config;
|
|
33
33
|
private readonly compiler;
|
|
34
34
|
constructor(config: CosmosDbProviderConfig);
|
|
35
|
-
|
|
35
|
+
initialize(): Promise<void>;
|
|
36
36
|
dispose(): Promise<void>;
|
|
37
37
|
ensureSchema(): Promise<EnsureSchemaResult>;
|
|
38
38
|
/** Derive the REST endpoint from config — either explicit or from the Gremlin endpoint host. */
|
|
@@ -68,7 +68,7 @@ declare class CosmosDbProvider implements StorageProvider, GraphTraversalProvide
|
|
|
68
68
|
deleteRelationshipsByType(repositoryId: string, relationshipType: string): Promise<{
|
|
69
69
|
deletedRelationships: number;
|
|
70
70
|
}>;
|
|
71
|
-
|
|
71
|
+
exploreNeighborhood(repositoryId: string, entityId: string, options: StorageExploreOptions): Promise<StorageNeighborhood>;
|
|
72
72
|
findPaths(repositoryId: string, sourceId: string, targetId: string, options: StoragePathOptions): Promise<StoragePathResult>;
|
|
73
73
|
getTimeline(repositoryId: string, entityId: string, options: StorageTimelineOptions): Promise<StorageTimelineResult>;
|
|
74
74
|
exportAll(repositoryId: string): AsyncIterable<ExportChunk>;
|
package/dist/index.js
CHANGED
|
@@ -839,7 +839,7 @@ async function deleteRelationshipsByType(conn, repositoryId, relationshipType) {
|
|
|
839
839
|
|
|
840
840
|
// src/queries/traversal.ts
|
|
841
841
|
import { matchesPropertyFilters as matchesPropertyFilters2 } from "@utaba/deep-memory";
|
|
842
|
-
async function
|
|
842
|
+
async function exploreNeighborhood(conn, repositoryId, entityId, options) {
|
|
843
843
|
const layers = [];
|
|
844
844
|
let frontier = /* @__PURE__ */ new Set([entityId]);
|
|
845
845
|
const visited = /* @__PURE__ */ new Set([entityId]);
|
|
@@ -890,7 +890,7 @@ async function exploreNeighbourhood(conn, repositoryId, entityId, options) {
|
|
|
890
890
|
frontier = nextFrontier;
|
|
891
891
|
if (frontier.size === 0) break;
|
|
892
892
|
}
|
|
893
|
-
return {
|
|
893
|
+
return { centerId: entityId, layers };
|
|
894
894
|
}
|
|
895
895
|
async function getRelationshipsForEntity(conn, repositoryId, entityId, options) {
|
|
896
896
|
const bindings = { rid: repositoryId, eid: entityId };
|
|
@@ -1050,7 +1050,7 @@ function isInTimeRange(timestamp, timeRange) {
|
|
|
1050
1050
|
|
|
1051
1051
|
// src/queries/bulk.ts
|
|
1052
1052
|
var EXPORT_BATCH_SIZE = 100;
|
|
1053
|
-
var IMPORT_CONCURRENCY =
|
|
1053
|
+
var IMPORT_CONCURRENCY = 20;
|
|
1054
1054
|
async function runWithConcurrency(items, concurrency, fn) {
|
|
1055
1055
|
const results = new Array(items.length);
|
|
1056
1056
|
let nextIndex = 0;
|
|
@@ -1283,7 +1283,7 @@ var CosmosDbProvider = class {
|
|
|
1283
1283
|
});
|
|
1284
1284
|
}
|
|
1285
1285
|
// ─── Lifecycle ─────────────────────────────────────────────────────
|
|
1286
|
-
async
|
|
1286
|
+
async initialize() {
|
|
1287
1287
|
await this.conn.connect();
|
|
1288
1288
|
}
|
|
1289
1289
|
async dispose() {
|
|
@@ -1439,8 +1439,8 @@ var CosmosDbProvider = class {
|
|
|
1439
1439
|
return deleteRelationshipsByType(this.conn, repositoryId, relationshipType);
|
|
1440
1440
|
}
|
|
1441
1441
|
// ─── Graph Traversal (StorageProvider) ─────────────────────────────
|
|
1442
|
-
async
|
|
1443
|
-
return
|
|
1442
|
+
async exploreNeighborhood(repositoryId, entityId, options) {
|
|
1443
|
+
return exploreNeighborhood(this.conn, repositoryId, entityId, options);
|
|
1444
1444
|
}
|
|
1445
1445
|
async findPaths(repositoryId, sourceId, targetId, options) {
|
|
1446
1446
|
return findPaths(this.conn, repositoryId, sourceId, targetId, options);
|