@interncom/diplomatic 0.0.58 → 0.0.60
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/entityDB.d.ts +7 -5
- package/dist/index.mjs +9 -2
- package/dist/shared/types.d.ts +2 -1
- package/package.json +1 -1
package/dist/entityDB.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { type DBSchema } from "idb";
|
|
2
2
|
import type { Applier } from "./types";
|
|
3
|
-
import { type GroupID } from "./shared/types";
|
|
3
|
+
import { type EntityID, type GroupID } from "./shared/types";
|
|
4
4
|
import { StateManager } from "./state";
|
|
5
5
|
export declare const entityTableName = "entities";
|
|
6
6
|
export declare const typeIndexName = "entity_type_created_at";
|
|
7
7
|
export declare const typeGroupIndexName = "entity_type_group_id";
|
|
8
|
+
export declare const typeParentIndexName = "entity_type_parent_id";
|
|
8
9
|
export interface IEntity<T> {
|
|
9
|
-
eid:
|
|
10
|
+
eid: EntityID;
|
|
10
11
|
gid?: GroupID;
|
|
11
|
-
pid?:
|
|
12
|
+
pid?: EntityID;
|
|
12
13
|
type: string;
|
|
13
14
|
updatedAt: Date;
|
|
14
15
|
createdAt: Date;
|
|
@@ -19,8 +20,9 @@ interface IEntityDB extends DBSchema {
|
|
|
19
20
|
key: Uint8Array;
|
|
20
21
|
value: IEntity<unknown>;
|
|
21
22
|
indexes: {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
[typeIndexName]: [string, Date];
|
|
24
|
+
[typeGroupIndexName]: [string, GroupID];
|
|
25
|
+
[typeParentIndexName]: [string, EntityID];
|
|
24
26
|
};
|
|
25
27
|
};
|
|
26
28
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -11768,12 +11768,14 @@ __export(entityDB_exports, {
|
|
|
11768
11768
|
entityTableName: () => entityTableName,
|
|
11769
11769
|
stateManager: () => stateManager,
|
|
11770
11770
|
typeGroupIndexName: () => typeGroupIndexName,
|
|
11771
|
-
typeIndexName: () => typeIndexName
|
|
11771
|
+
typeIndexName: () => typeIndexName,
|
|
11772
|
+
typeParentIndexName: () => typeParentIndexName
|
|
11772
11773
|
});
|
|
11773
11774
|
var entityTableName = "entities";
|
|
11774
11775
|
var typeIndexName = "entity_type_created_at";
|
|
11775
11776
|
var typeGroupIndexName = "entity_type_group_id";
|
|
11776
|
-
var
|
|
11777
|
+
var typeParentIndexName = "entity_type_parent_id";
|
|
11778
|
+
var db2 = await openDB("db", 9, {
|
|
11777
11779
|
upgrade(db3, prevVersion, currVersion, tx) {
|
|
11778
11780
|
if (!db3.objectStoreNames.contains(entityTableName)) {
|
|
11779
11781
|
const store2 = db3.createObjectStore(entityTableName, {
|
|
@@ -11792,6 +11794,11 @@ var db2 = await openDB("db", 7, {
|
|
|
11792
11794
|
unique: false
|
|
11793
11795
|
});
|
|
11794
11796
|
}
|
|
11797
|
+
if (!store.indexNames.contains(typeParentIndexName)) {
|
|
11798
|
+
store.createIndex(typeParentIndexName, ["type", "pid"], {
|
|
11799
|
+
unique: false
|
|
11800
|
+
});
|
|
11801
|
+
}
|
|
11795
11802
|
}
|
|
11796
11803
|
});
|
|
11797
11804
|
var applier = async (op) => {
|
package/dist/shared/types.d.ts
CHANGED