@proteinjs/db 1.17.0 → 1.18.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/CHANGELOG.md +11 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +1 -5
- package/dist/generated/index.js.map +1 -1
- package/dist/src/Db.d.ts.map +1 -1
- package/dist/src/Db.js +42 -8
- package/dist/src/Db.js.map +1 -1
- package/dist/src/Table.d.ts +1 -1
- package/dist/src/Table.d.ts.map +1 -1
- package/generated/index.ts +1 -5
- package/package.json +5 -5
- package/src/Db.ts +32 -6
- package/src/Table.ts +1 -1
- package/dist/src/serializers/GraphSerializer.d.ts +0 -13
- package/dist/src/serializers/GraphSerializer.d.ts.map +0 -1
- package/dist/src/serializers/GraphSerializer.js +0 -21
- package/dist/src/serializers/GraphSerializer.js.map +0 -1
- package/dist/src/serializers/QueryBuilderSerializer.d.ts +0 -19
- package/dist/src/serializers/QueryBuilderSerializer.d.ts.map +0 -1
- package/dist/src/serializers/QueryBuilderSerializer.js +0 -32
- package/dist/src/serializers/QueryBuilderSerializer.js.map +0 -1
- package/src/serializers/GraphSerializer.ts +0 -22
- package/src/serializers/QueryBuilderSerializer.ts +0 -39
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CustomSerializer } from '@proteinjs/serializer';
|
|
2
|
-
import { Graph } from '@proteinjs/util';
|
|
3
|
-
import { QueryBuilder } from '@proteinjs/db-query';
|
|
4
|
-
type SerializedQueryBuilder = {
|
|
5
|
-
tableName: string;
|
|
6
|
-
graph: Graph;
|
|
7
|
-
idCounter: number;
|
|
8
|
-
rootId: string;
|
|
9
|
-
currentContextIds: string[];
|
|
10
|
-
paginationNodeId?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const QueryBuilderSerializerId = "@proteinjs/db/QueryBuilderSerializer";
|
|
13
|
-
export declare class QueryBuilderSerializer implements CustomSerializer {
|
|
14
|
-
id: string;
|
|
15
|
-
serialize(qb: QueryBuilder<any>): SerializedQueryBuilder;
|
|
16
|
-
deserialize(serializedQb: SerializedQueryBuilder): QueryBuilder<any>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=QueryBuilderSerializer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBuilderSerializer.d.ts","sourceRoot":"","sources":["../../../src/serializers/QueryBuilderSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,wBAAwB,yCAAyC,CAAC;AAE/E,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,EAAE,SAA4B;IAE9B,SAAS,CAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,GAAG,sBAAsB;IAWxD,WAAW,CAAC,YAAY,EAAE,sBAAsB,GAAG,YAAY,CAAC,GAAG,CAAC;CASrE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QueryBuilderSerializer = exports.QueryBuilderSerializerId = void 0;
|
|
4
|
-
var db_query_1 = require("@proteinjs/db-query");
|
|
5
|
-
exports.QueryBuilderSerializerId = '@proteinjs/db/QueryBuilderSerializer';
|
|
6
|
-
var QueryBuilderSerializer = /** @class */ (function () {
|
|
7
|
-
function QueryBuilderSerializer() {
|
|
8
|
-
this.id = exports.QueryBuilderSerializerId;
|
|
9
|
-
}
|
|
10
|
-
QueryBuilderSerializer.prototype.serialize = function (qb) {
|
|
11
|
-
return {
|
|
12
|
-
tableName: qb.tableName,
|
|
13
|
-
graph: qb.graph,
|
|
14
|
-
idCounter: qb.idCounter,
|
|
15
|
-
rootId: qb.rootId,
|
|
16
|
-
currentContextIds: qb.currentContextIds,
|
|
17
|
-
paginationNodeId: qb.paginationNodeId,
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
QueryBuilderSerializer.prototype.deserialize = function (serializedQb) {
|
|
21
|
-
var qb = new db_query_1.QueryBuilder(serializedQb.tableName);
|
|
22
|
-
qb.graph = serializedQb.graph;
|
|
23
|
-
qb.idCounter = serializedQb.idCounter;
|
|
24
|
-
qb.rootId = serializedQb.rootId;
|
|
25
|
-
qb.currentContextIds = serializedQb.currentContextIds;
|
|
26
|
-
qb.paginationNodeId = serializedQb.paginationNodeId;
|
|
27
|
-
return qb;
|
|
28
|
-
};
|
|
29
|
-
return QueryBuilderSerializer;
|
|
30
|
-
}());
|
|
31
|
-
exports.QueryBuilderSerializer = QueryBuilderSerializer;
|
|
32
|
-
//# sourceMappingURL=QueryBuilderSerializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBuilderSerializer.js","sourceRoot":"","sources":["../../../src/serializers/QueryBuilderSerializer.ts"],"names":[],"mappings":";;;AAEA,gDAAmD;AAWtC,QAAA,wBAAwB,GAAG,sCAAsC,CAAC;AAE/E;IAAA;QACE,OAAE,GAAG,gCAAwB,CAAC;IAsBhC,CAAC;IApBC,0CAAS,GAAT,UAAU,EAAqB;QAC7B,OAAO;YACL,SAAS,EAAE,EAAE,CAAC,SAAS;YACvB,KAAK,EAAE,EAAE,CAAC,KAAK;YACf,SAAS,EAAE,EAAE,CAAC,SAAS;YACvB,MAAM,EAAE,EAAE,CAAC,MAAM;YACjB,iBAAiB,EAAE,EAAE,CAAC,iBAAiB;YACvC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB;SACtC,CAAC;IACJ,CAAC;IAED,4CAAW,GAAX,UAAY,YAAoC;QAC9C,IAAM,EAAE,GAAG,IAAI,uBAAY,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACpD,EAAE,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;QAC9B,EAAE,CAAC,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;QACtC,EAAE,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;QAChC,EAAE,CAAC,iBAAiB,GAAG,YAAY,CAAC,iBAAiB,CAAC;QACtD,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAAC,gBAAgB,CAAC;QACpD,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,6BAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,wDAAsB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ThirdPartyLibCustomSerializer } from '@proteinjs/serializer';
|
|
2
|
-
import { graphSerializer, Graph, isInstanceOf } from '@proteinjs/util';
|
|
3
|
-
|
|
4
|
-
type SerializedGraph = {
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export class GraphSerializer implements ThirdPartyLibCustomSerializer {
|
|
9
|
-
id = '@proteinjs/serializer/GraphSerializer';
|
|
10
|
-
|
|
11
|
-
matches(obj: any) {
|
|
12
|
-
return isInstanceOf(obj, Graph);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
serialize(graph: Graph): SerializedGraph {
|
|
16
|
-
return { value: graphSerializer.serialize(graph) };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
deserialize(serializedGraph: SerializedGraph): Graph {
|
|
20
|
-
return graphSerializer.deserialize(serializedGraph.value);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { CustomSerializer } from '@proteinjs/serializer';
|
|
2
|
-
import { Graph } from '@proteinjs/util';
|
|
3
|
-
import { QueryBuilder } from '@proteinjs/db-query';
|
|
4
|
-
|
|
5
|
-
type SerializedQueryBuilder = {
|
|
6
|
-
tableName: string;
|
|
7
|
-
graph: Graph;
|
|
8
|
-
idCounter: number;
|
|
9
|
-
rootId: string;
|
|
10
|
-
currentContextIds: string[];
|
|
11
|
-
paginationNodeId?: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const QueryBuilderSerializerId = '@proteinjs/db/QueryBuilderSerializer';
|
|
15
|
-
|
|
16
|
-
export class QueryBuilderSerializer implements CustomSerializer {
|
|
17
|
-
id = QueryBuilderSerializerId;
|
|
18
|
-
|
|
19
|
-
serialize(qb: QueryBuilder<any>): SerializedQueryBuilder {
|
|
20
|
-
return {
|
|
21
|
-
tableName: qb.tableName,
|
|
22
|
-
graph: qb.graph,
|
|
23
|
-
idCounter: qb.idCounter,
|
|
24
|
-
rootId: qb.rootId,
|
|
25
|
-
currentContextIds: qb.currentContextIds,
|
|
26
|
-
paginationNodeId: qb.paginationNodeId,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
deserialize(serializedQb: SerializedQueryBuilder): QueryBuilder<any> {
|
|
31
|
-
const qb = new QueryBuilder(serializedQb.tableName);
|
|
32
|
-
qb.graph = serializedQb.graph;
|
|
33
|
-
qb.idCounter = serializedQb.idCounter;
|
|
34
|
-
qb.rootId = serializedQb.rootId;
|
|
35
|
-
qb.currentContextIds = serializedQb.currentContextIds;
|
|
36
|
-
qb.paginationNodeId = serializedQb.paginationNodeId;
|
|
37
|
-
return qb;
|
|
38
|
-
}
|
|
39
|
-
}
|