@ldo/subscribable-dataset 1.0.0-alpha.32 → 1.0.0-alpha.34
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/SubscribableDataset.cjs +373 -0
- package/dist/SubscribableDataset.d.cts +172 -0
- package/dist/SubscribableDataset.d.cts.map +1 -0
- package/dist/SubscribableDataset.d.ts +172 -0
- package/dist/SubscribableDataset.d.ts.map +1 -0
- package/dist/SubscribableDataset.js +373 -0
- package/dist/SubscribableDataset.js.map +1 -0
- package/dist/SubscribableDatasetFactory.cjs +20 -0
- package/dist/SubscribableDatasetFactory.d.cts +20 -0
- package/dist/SubscribableDatasetFactory.d.cts.map +1 -0
- package/dist/SubscribableDatasetFactory.d.ts +20 -0
- package/dist/SubscribableDatasetFactory.d.ts.map +1 -0
- package/dist/SubscribableDatasetFactory.js +21 -0
- package/dist/SubscribableDatasetFactory.js.map +1 -0
- package/dist/TransactionDataset.cjs +211 -0
- package/dist/TransactionDataset.d.cts +133 -0
- package/dist/TransactionDataset.d.cts.map +1 -0
- package/dist/TransactionDataset.d.ts +133 -0
- package/dist/TransactionDataset.d.ts.map +1 -0
- package/dist/TransactionDataset.js +212 -0
- package/dist/TransactionDataset.js.map +1 -0
- package/dist/TransactionDatasetFactory.cjs +17 -0
- package/dist/TransactionDatasetFactory.d.cts +16 -0
- package/dist/TransactionDatasetFactory.d.cts.map +1 -0
- package/dist/TransactionDatasetFactory.d.ts +16 -0
- package/dist/TransactionDatasetFactory.d.ts.map +1 -0
- package/dist/TransactionDatasetFactory.js +18 -0
- package/dist/TransactionDatasetFactory.js.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/createSubscribableDataset.cjs +37 -0
- package/dist/createSubscribableDataset.d.cts +26 -0
- package/dist/createSubscribableDataset.d.cts.map +1 -0
- package/dist/createSubscribableDataset.d.ts +26 -0
- package/dist/createSubscribableDataset.d.ts.map +1 -0
- package/dist/createSubscribableDataset.js +35 -0
- package/dist/createSubscribableDataset.js.map +1 -0
- package/dist/createSubscribableDatasetFromSerializedInput.cjs +23 -0
- package/dist/createSubscribableDatasetFromSerializedInput.d.cts +22 -0
- package/dist/createSubscribableDatasetFromSerializedInput.d.cts.map +1 -0
- package/dist/createSubscribableDatasetFromSerializedInput.d.ts +22 -0
- package/dist/createSubscribableDatasetFromSerializedInput.d.ts.map +1 -0
- package/dist/createSubscribableDatasetFromSerializedInput.js +23 -0
- package/dist/createSubscribableDatasetFromSerializedInput.js.map +1 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/mergeDatasetChanges.cjs +26 -0
- package/dist/mergeDatasetChanges.d.cts +16 -0
- package/dist/mergeDatasetChanges.d.cts.map +1 -0
- package/dist/mergeDatasetChanges.d.ts +16 -0
- package/dist/mergeDatasetChanges.d.ts.map +1 -0
- package/dist/mergeDatasetChanges.js +26 -0
- package/dist/mergeDatasetChanges.js.map +1 -0
- package/dist/types.d.cts +125 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.ts +125 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/util.cjs +19 -0
- package/dist/util.d.cts +16 -0
- package/dist/util.d.cts.map +1 -0
- package/dist/util.d.ts +16 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +19 -0
- package/dist/util.js.map +1 -0
- package/package.json +19 -16
- package/src/SubscribableDataset.ts +1 -1
- package/src/SubscribableDatasetFactory.ts +2 -2
- package/src/TransactionDataset.ts +4 -7
- package/src/TransactionDatasetFactory.ts +2 -2
- package/src/createSubscribableDataset.ts +3 -3
- package/src/createSubscribableDatasetFromSerializedInput.ts +2 -2
- package/src/index.ts +9 -9
- package/src/util.ts +1 -1
- package/dist/cjs/SubscribableDataset.cjs +0 -313
- package/dist/cjs/SubscribableDataset.js.map +0 -1
- package/dist/cjs/SubscribableDatasetFactory.cjs +0 -18
- package/dist/cjs/SubscribableDatasetFactory.js.map +0 -1
- package/dist/cjs/TransactionDataset.cjs +0 -219
- package/dist/cjs/TransactionDataset.js.map +0 -1
- package/dist/cjs/TransactionDatasetFactory.cjs +0 -15
- package/dist/cjs/TransactionDatasetFactory.js.map +0 -1
- package/dist/cjs/createSubscribableDataset.cjs +0 -37
- package/dist/cjs/createSubscribableDataset.js.map +0 -1
- package/dist/cjs/createSubscribableDatasetFromSerializedInput.cjs +0 -21
- package/dist/cjs/createSubscribableDatasetFromSerializedInput.js.map +0 -1
- package/dist/cjs/index.cjs +0 -28
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/mergeDatasetChanges.cjs +0 -48
- package/dist/cjs/mergeDatasetChanges.js.map +0 -1
- package/dist/cjs/types.cjs +0 -3
- package/dist/cjs/types.js.map +0 -1
- package/dist/cjs/util.cjs +0 -25
- package/dist/cjs/util.js.map +0 -1
- package/dist/esm/SubscribableDataset.js +0 -309
- package/dist/esm/SubscribableDataset.js.map +0 -1
- package/dist/esm/SubscribableDatasetFactory.js +0 -14
- package/dist/esm/SubscribableDatasetFactory.js.map +0 -1
- package/dist/esm/TransactionDataset.js +0 -215
- package/dist/esm/TransactionDataset.js.map +0 -1
- package/dist/esm/TransactionDatasetFactory.js +0 -11
- package/dist/esm/TransactionDatasetFactory.js.map +0 -1
- package/dist/esm/createSubscribableDataset.js +0 -32
- package/dist/esm/createSubscribableDataset.js.map +0 -1
- package/dist/esm/createSubscribableDatasetFromSerializedInput.js +0 -18
- package/dist/esm/createSubscribableDatasetFromSerializedInput.js.map +0 -1
- package/dist/esm/index.js +0 -10
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/mergeDatasetChanges.js +0 -45
- package/dist/esm/mergeDatasetChanges.js.map +0 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/util.js +0 -22
- package/dist/esm/util.js.map +0 -1
- package/dist/types/SubscribableDataset.d.ts +0 -166
- package/dist/types/SubscribableDataset.d.ts.map +0 -1
- package/dist/types/SubscribableDatasetFactory.d.ts +0 -13
- package/dist/types/SubscribableDatasetFactory.d.ts.map +0 -1
- package/dist/types/TransactionDataset.d.ts +0 -127
- package/dist/types/TransactionDataset.d.ts.map +0 -1
- package/dist/types/TransactionDatasetFactory.d.ts +0 -10
- package/dist/types/TransactionDatasetFactory.d.ts.map +0 -1
- package/dist/types/createSubscribableDataset.d.ts +0 -19
- package/dist/types/createSubscribableDataset.d.ts.map +0 -1
- package/dist/types/createSubscribableDatasetFromSerializedInput.d.ts +0 -16
- package/dist/types/createSubscribableDatasetFromSerializedInput.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/mergeDatasetChanges.d.ts +0 -9
- package/dist/types/mergeDatasetChanges.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -119
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/util.d.ts +0 -9
- package/dist/types/util.d.ts.map +0 -1
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IBulkEditableDataset, ISubscribableDataset, ISubscribableDatasetFactory, ITransactionDataset, ITransactionDatasetFactory, nodeEventListener } from "./types.cjs";
|
|
2
|
+
import { createSubscribableDataset, createSubscribableDatasetFactory, createTransactionDatasetFactory } from "./createSubscribableDataset.cjs";
|
|
3
|
+
import { createWrapperSubscribableDatasetFromSerializedInput } from "./createSubscribableDatasetFromSerializedInput.cjs";
|
|
4
|
+
import { SubscribableDataset } from "./SubscribableDataset.cjs";
|
|
5
|
+
import { TransactionDataset } from "./TransactionDataset.cjs";
|
|
6
|
+
import { TransactionDatasetFactory } from "./TransactionDatasetFactory.cjs";
|
|
7
|
+
import { SubscribableDatasetFactory } from "./SubscribableDatasetFactory.cjs";
|
|
8
|
+
import { mergeDatasetChanges } from "./mergeDatasetChanges.cjs";
|
|
9
|
+
import { updateDatasetInBulk } from "./util.cjs";
|
|
10
|
+
export { IBulkEditableDataset, ISubscribableDataset, ISubscribableDatasetFactory, ITransactionDataset, ITransactionDatasetFactory, SubscribableDataset, SubscribableDatasetFactory, TransactionDataset, TransactionDatasetFactory, createSubscribableDataset, createSubscribableDatasetFactory, createTransactionDatasetFactory, mergeDatasetChanges, nodeEventListener, createWrapperSubscribableDatasetFromSerializedInput as serializedToSubscribableDataset, updateDatasetInBulk };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IBulkEditableDataset, ISubscribableDataset, ISubscribableDatasetFactory, ITransactionDataset, ITransactionDatasetFactory, nodeEventListener } from "./types.js";
|
|
2
|
+
import { createSubscribableDataset$1 as createSubscribableDataset, createSubscribableDatasetFactory$1 as createSubscribableDatasetFactory, createTransactionDatasetFactory$1 as createTransactionDatasetFactory } from "./createSubscribableDataset.js";
|
|
3
|
+
import { createWrapperSubscribableDatasetFromSerializedInput$1 as createWrapperSubscribableDatasetFromSerializedInput } from "./createSubscribableDatasetFromSerializedInput.js";
|
|
4
|
+
import { SubscribableDataset$1 as SubscribableDataset } from "./SubscribableDataset.js";
|
|
5
|
+
import { TransactionDataset$1 as TransactionDataset } from "./TransactionDataset.js";
|
|
6
|
+
import { TransactionDatasetFactory$1 as TransactionDatasetFactory } from "./TransactionDatasetFactory.js";
|
|
7
|
+
import { SubscribableDatasetFactory$1 as SubscribableDatasetFactory } from "./SubscribableDatasetFactory.js";
|
|
8
|
+
import { mergeDatasetChanges$1 as mergeDatasetChanges } from "./mergeDatasetChanges.js";
|
|
9
|
+
import { updateDatasetInBulk$1 as updateDatasetInBulk } from "./util.js";
|
|
10
|
+
export { IBulkEditableDataset, ISubscribableDataset, ISubscribableDatasetFactory, ITransactionDataset, ITransactionDatasetFactory, SubscribableDataset, SubscribableDatasetFactory, TransactionDataset, TransactionDatasetFactory, createSubscribableDataset, createSubscribableDatasetFactory, createTransactionDatasetFactory, mergeDatasetChanges, nodeEventListener, createWrapperSubscribableDatasetFromSerializedInput as serializedToSubscribableDataset, updateDatasetInBulk };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SubscribableDataset } from "./SubscribableDataset.js";
|
|
2
|
+
import { SubscribableDatasetFactory } from "./SubscribableDatasetFactory.js";
|
|
3
|
+
import { mergeDatasetChanges } from "./mergeDatasetChanges.js";
|
|
4
|
+
import { updateDatasetInBulk } from "./util.js";
|
|
5
|
+
import { TransactionDataset } from "./TransactionDataset.js";
|
|
6
|
+
import { TransactionDatasetFactory } from "./TransactionDatasetFactory.js";
|
|
7
|
+
import { createSubscribableDataset, createSubscribableDatasetFactory, createTransactionDatasetFactory } from "./createSubscribableDataset.js";
|
|
8
|
+
import { createWrapperSubscribableDatasetFromSerializedInput } from "./createSubscribableDatasetFromSerializedInput.js";
|
|
9
|
+
|
|
10
|
+
export { SubscribableDataset, SubscribableDatasetFactory, TransactionDataset, TransactionDatasetFactory, createSubscribableDataset, createSubscribableDatasetFactory, createTransactionDatasetFactory, mergeDatasetChanges, createWrapperSubscribableDatasetFromSerializedInput as serializedToSubscribableDataset, updateDatasetInBulk };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/mergeDatasetChanges.ts
|
|
3
|
+
/**
|
|
4
|
+
* Merges a new change into an original change
|
|
5
|
+
* @param originalChange
|
|
6
|
+
* @param newChange
|
|
7
|
+
*/
|
|
8
|
+
function mergeDatasetChanges(originalChange, newChange) {
|
|
9
|
+
if (newChange.added) {
|
|
10
|
+
if (originalChange.added) originalChange.added.addAll(newChange.added);
|
|
11
|
+
else originalChange.added = newChange.added;
|
|
12
|
+
const changesIntersection = originalChange.removed?.intersection(newChange.added);
|
|
13
|
+
if (changesIntersection && changesIntersection.size > 0) originalChange.removed = originalChange.removed?.difference(changesIntersection);
|
|
14
|
+
}
|
|
15
|
+
if (newChange.removed) {
|
|
16
|
+
if (originalChange.removed) originalChange.removed.addAll(newChange.removed);
|
|
17
|
+
else originalChange.removed = newChange.removed;
|
|
18
|
+
const changesIntersection = originalChange.added?.intersection(newChange.removed);
|
|
19
|
+
if (changesIntersection && changesIntersection.size > 0) originalChange.added = originalChange.added?.difference(changesIntersection);
|
|
20
|
+
}
|
|
21
|
+
if (originalChange.added && originalChange.added.size === 0) originalChange.added = void 0;
|
|
22
|
+
if (originalChange.removed && originalChange.removed.size === 0) originalChange.removed = void 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.mergeDatasetChanges = mergeDatasetChanges;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseQuad } from "@rdfjs/types";
|
|
2
|
+
import { DatasetChanges } from "@ldo/rdf-utils";
|
|
3
|
+
|
|
4
|
+
//#region src/mergeDatasetChanges.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Merges a new change into an original change
|
|
8
|
+
* @param originalChange
|
|
9
|
+
* @param newChange
|
|
10
|
+
*/
|
|
11
|
+
declare function mergeDatasetChanges<InAndOutQuad extends BaseQuad>(originalChange: DatasetChanges<InAndOutQuad>, newChange: DatasetChanges<InAndOutQuad>): void;
|
|
12
|
+
//# sourceMappingURL=mergeDatasetChanges.d.ts.map
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { mergeDatasetChanges };
|
|
16
|
+
//# sourceMappingURL=mergeDatasetChanges.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeDatasetChanges.d.cts","names":[],"sources":["../../src/mergeDatasetChanges.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;;;AACiC,iBADjB,mBACiB,CAAA,qBADwB,QACxB,CAAA,CAAA,cAAA,EAAf,cAAe,CAAA,YAAA,CAAA,EAAA,SAAA,EACpB,cADoB,CACL,YADK,CAAA,CAAA,EAAA,IAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DatasetChanges } from "@ldo/rdf-utils";
|
|
2
|
+
import { BaseQuad } from "@rdfjs/types";
|
|
3
|
+
|
|
4
|
+
//#region src/mergeDatasetChanges.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Merges a new change into an original change
|
|
8
|
+
* @param originalChange
|
|
9
|
+
* @param newChange
|
|
10
|
+
*/
|
|
11
|
+
declare function mergeDatasetChanges<InAndOutQuad extends BaseQuad>(originalChange: DatasetChanges<InAndOutQuad>, newChange: DatasetChanges<InAndOutQuad>): void;
|
|
12
|
+
//# sourceMappingURL=mergeDatasetChanges.d.ts.map
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { mergeDatasetChanges as mergeDatasetChanges$1 };
|
|
16
|
+
//# sourceMappingURL=mergeDatasetChanges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeDatasetChanges.d.ts","names":[],"sources":["../../src/mergeDatasetChanges.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;;;AACiC,iBADjB,mBACiB,CAAA,qBADwB,QACxB,CAAA,CAAA,cAAA,EAAf,cAAe,CAAA,YAAA,CAAA,EAAA,SAAA,EACpB,cADoB,CACL,YADK,CAAA,CAAA,EAAA,IAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/mergeDatasetChanges.ts
|
|
2
|
+
/**
|
|
3
|
+
* Merges a new change into an original change
|
|
4
|
+
* @param originalChange
|
|
5
|
+
* @param newChange
|
|
6
|
+
*/
|
|
7
|
+
function mergeDatasetChanges(originalChange, newChange) {
|
|
8
|
+
if (newChange.added) {
|
|
9
|
+
if (originalChange.added) originalChange.added.addAll(newChange.added);
|
|
10
|
+
else originalChange.added = newChange.added;
|
|
11
|
+
const changesIntersection = originalChange.removed?.intersection(newChange.added);
|
|
12
|
+
if (changesIntersection && changesIntersection.size > 0) originalChange.removed = originalChange.removed?.difference(changesIntersection);
|
|
13
|
+
}
|
|
14
|
+
if (newChange.removed) {
|
|
15
|
+
if (originalChange.removed) originalChange.removed.addAll(newChange.removed);
|
|
16
|
+
else originalChange.removed = newChange.removed;
|
|
17
|
+
const changesIntersection = originalChange.added?.intersection(newChange.removed);
|
|
18
|
+
if (changesIntersection && changesIntersection.size > 0) originalChange.added = originalChange.added?.difference(changesIntersection);
|
|
19
|
+
}
|
|
20
|
+
if (originalChange.added && originalChange.added.size === 0) originalChange.added = void 0;
|
|
21
|
+
if (originalChange.removed && originalChange.removed.size === 0) originalChange.removed = void 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { mergeDatasetChanges };
|
|
26
|
+
//# sourceMappingURL=mergeDatasetChanges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeDatasetChanges.js","names":["originalChange: DatasetChanges<InAndOutQuad>","newChange: DatasetChanges<InAndOutQuad>"],"sources":["../src/mergeDatasetChanges.ts"],"sourcesContent":["import type { DatasetChanges } from \"@ldo/rdf-utils\";\nimport type { BaseQuad } from \"@rdfjs/types\";\n\n/**\n * Merges a new change into an original change\n * @param originalChange\n * @param newChange\n */\nexport function mergeDatasetChanges<InAndOutQuad extends BaseQuad>(\n originalChange: DatasetChanges<InAndOutQuad>,\n newChange: DatasetChanges<InAndOutQuad>,\n): void {\n // Add added\n if (newChange.added) {\n if (originalChange.added) {\n originalChange.added.addAll(newChange.added);\n } else {\n originalChange.added = newChange.added;\n }\n // Delete from removed if present\n const changesIntersection = originalChange.removed?.intersection(\n newChange.added,\n );\n if (changesIntersection && changesIntersection.size > 0) {\n originalChange.removed =\n originalChange.removed?.difference(changesIntersection);\n }\n }\n // Add removed\n if (newChange.removed) {\n if (originalChange.removed) {\n originalChange.removed.addAll(newChange.removed);\n } else {\n originalChange.removed = newChange.removed;\n }\n // Delete from added if present\n const changesIntersection = originalChange.added?.intersection(\n newChange.removed,\n );\n if (changesIntersection && changesIntersection.size > 0) {\n originalChange.added =\n originalChange.added?.difference(changesIntersection);\n }\n }\n\n // Make undefined if size is zero\n if (originalChange.added && originalChange.added.size === 0) {\n originalChange.added = undefined;\n }\n if (originalChange.removed && originalChange.removed.size === 0) {\n originalChange.removed = undefined;\n }\n}\n"],"mappings":";;;;;;AAQA,SAAgB,oBACdA,gBACAC,WACM;AAEN,KAAI,UAAU,OAAO;AACnB,MAAI,eAAe,MACjB,gBAAe,MAAM,OAAO,UAAU,MAAM;MAE5C,gBAAe,QAAQ,UAAU;EAGnC,MAAM,sBAAsB,eAAe,SAAS,aAClD,UAAU,MACX;AACD,MAAI,uBAAuB,oBAAoB,OAAO,EACpD,gBAAe,UACb,eAAe,SAAS,WAAW,oBAAoB;CAE5D;AAED,KAAI,UAAU,SAAS;AACrB,MAAI,eAAe,QACjB,gBAAe,QAAQ,OAAO,UAAU,QAAQ;MAEhD,gBAAe,UAAU,UAAU;EAGrC,MAAM,sBAAsB,eAAe,OAAO,aAChD,UAAU,QACX;AACD,MAAI,uBAAuB,oBAAoB,OAAO,EACpD,gBAAe,QACb,eAAe,OAAO,WAAW,oBAAoB;CAE1D;AAGD,KAAI,eAAe,SAAS,eAAe,MAAM,SAAS,EACxD,gBAAe;AAEjB,KAAI,eAAe,WAAW,eAAe,QAAQ,SAAS,EAC5D,gBAAe;AAElB"}
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { BaseQuad, Dataset, DatasetFactory } from "@rdfjs/types";
|
|
2
|
+
import { DatasetChanges, QuadMatch } from "@ldo/rdf-utils";
|
|
3
|
+
|
|
4
|
+
//#region src/types.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An event listeners for nodes
|
|
8
|
+
*/
|
|
9
|
+
type nodeEventListener<InAndOutQuad extends BaseQuad = BaseQuad> = (changes: DatasetChanges<InAndOutQuad>, transactionId: string, triggeringQuadMatch: QuadMatch) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Adds the bulk method for add and remove
|
|
12
|
+
*/
|
|
13
|
+
interface IBulkEditableDataset<InAndOutQuad extends BaseQuad = BaseQuad> extends Dataset<InAndOutQuad, InAndOutQuad> {
|
|
14
|
+
bulk(changes: DatasetChanges<InAndOutQuad>): this;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Factory for creating SubscribableDatasets
|
|
18
|
+
*/
|
|
19
|
+
type ISubscribableDatasetFactory<InAndOutQuad extends BaseQuad = BaseQuad> = DatasetFactory<InAndOutQuad, InAndOutQuad, ISubscribableDataset<InAndOutQuad>>;
|
|
20
|
+
/**
|
|
21
|
+
* Dataset that allows developers to subscribe to a sepecific term and be alerted
|
|
22
|
+
* if a quad is added or removed containing that term. It's methods follow the
|
|
23
|
+
* EventEmitter interface except take in namedNodes as keys.
|
|
24
|
+
*/
|
|
25
|
+
interface ISubscribableDataset<InAndOutQuad extends BaseQuad = BaseQuad> extends IBulkEditableDataset<InAndOutQuad> {
|
|
26
|
+
/**
|
|
27
|
+
* Alias for emitter.on(eventName, listener).
|
|
28
|
+
* @param eventName
|
|
29
|
+
* @param listener
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
addListener(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
33
|
+
/**
|
|
34
|
+
* Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.
|
|
35
|
+
* @param eventName
|
|
36
|
+
* @param changes
|
|
37
|
+
* @returns true if the event had listeners, false otherwise.
|
|
38
|
+
*/
|
|
39
|
+
emit(eventName: QuadMatch, changes: DatasetChanges<InAndOutQuad>): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.
|
|
42
|
+
*/
|
|
43
|
+
eventNames(): QuadMatch[];
|
|
44
|
+
/**
|
|
45
|
+
* Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to events.defaultMaxListeners.
|
|
46
|
+
*/
|
|
47
|
+
getMaxListeners(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the number of listeners listening to the event named eventName.
|
|
50
|
+
*/
|
|
51
|
+
listenerCount(eventName: QuadMatch): number;
|
|
52
|
+
/**
|
|
53
|
+
* Returns a copy of the array of listeners for the event named eventName.
|
|
54
|
+
*/
|
|
55
|
+
listeners(eventName: QuadMatch): nodeEventListener<InAndOutQuad>[];
|
|
56
|
+
/**
|
|
57
|
+
* Alias for emitter.removeListener()
|
|
58
|
+
*/
|
|
59
|
+
off(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
|
|
62
|
+
*/
|
|
63
|
+
on(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
64
|
+
/**
|
|
65
|
+
* Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.
|
|
66
|
+
*/
|
|
67
|
+
once(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
68
|
+
/**
|
|
69
|
+
* Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
|
|
70
|
+
*/
|
|
71
|
+
prependListener(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
72
|
+
/**
|
|
73
|
+
* Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.
|
|
74
|
+
*/
|
|
75
|
+
prependOnceListener(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
76
|
+
/**
|
|
77
|
+
* Removes all listeners, or those of the specified eventName.
|
|
78
|
+
*/
|
|
79
|
+
removeAllListeners(eventName: QuadMatch): this;
|
|
80
|
+
/**
|
|
81
|
+
* Removes the specified listener from the listener array for the event named eventName.
|
|
82
|
+
*/
|
|
83
|
+
removeListener(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
84
|
+
/**
|
|
85
|
+
* Removes the specified listener from all events
|
|
86
|
+
*/
|
|
87
|
+
removeListenerFromAllEvents(listener: nodeEventListener<InAndOutQuad>): this;
|
|
88
|
+
/**
|
|
89
|
+
* By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.
|
|
90
|
+
*/
|
|
91
|
+
setMaxListeners(n: number): this;
|
|
92
|
+
/**
|
|
93
|
+
* Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).
|
|
94
|
+
*/
|
|
95
|
+
rawListeners(eventName: QuadMatch): nodeEventListener<InAndOutQuad>[];
|
|
96
|
+
/**
|
|
97
|
+
* ==================================================================
|
|
98
|
+
* TRANSACTION METHODS
|
|
99
|
+
* ==================================================================
|
|
100
|
+
*/
|
|
101
|
+
/**
|
|
102
|
+
* Returns a transactional dataset that will update this dataset when its transaction is committed.
|
|
103
|
+
*/
|
|
104
|
+
startTransaction(): ITransactionDataset<InAndOutQuad>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Creates a TransactionDataset
|
|
108
|
+
*/
|
|
109
|
+
interface ITransactionDatasetFactory<InAndOutQuad extends BaseQuad = BaseQuad> {
|
|
110
|
+
transactionDataset(parent: Dataset<InAndOutQuad, InAndOutQuad>): ITransactionDataset<InAndOutQuad>;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A dataset that allows you to modify the dataset and
|
|
114
|
+
*/
|
|
115
|
+
interface ITransactionDataset<InAndOutQuad extends BaseQuad = BaseQuad> extends ISubscribableDataset<InAndOutQuad> {
|
|
116
|
+
readonly parentDataset: Dataset<InAndOutQuad, InAndOutQuad>;
|
|
117
|
+
rollback(): void;
|
|
118
|
+
commit(): void;
|
|
119
|
+
getChanges(): DatasetChanges<InAndOutQuad>;
|
|
120
|
+
hasChanges(): boolean;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=types.d.ts.map
|
|
123
|
+
//#endregion
|
|
124
|
+
export { IBulkEditableDataset, ISubscribableDataset, ISubscribableDatasetFactory, ITransactionDataset, ITransactionDatasetFactory, nodeEventListener };
|
|
125
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAMA;AAA6B,KAAjB,iBAAiB,CAAA,qBAAsB,QAAtB,GAAiC,QAAjC,CAAA,GAAA,CAAA,OAAA,EAClB,cADkB,CACH,YADG,CAAA,EAAA,aAAA,EAAA,MAAA,EAAA,mBAAA,EAGN,SAHM,EAAA,GAAA,IAAA;;;;AAClB,UAQM,oBARN,CAAA,qBAQgD,QARhD,GAQ2D,QAR3D,CAAA,SASD,OATC,CASO,YATP,EASqB,YATrB,CAAA,CAAA;EAAc,IAEF,CAAA,OAAA,EAQP,cARO,CAQQ,YARR,CAAA,CAAA,EAAA,IAAA;AAAS;AAMhC;;;AAAsE,KAQ1D,2BAR0D,CAAA,qBAS/C,QAT+C,GASpC,QAToC,CAAA,GAUlE,cAVkE,CAWpE,YAXoE,EAYpE,YAZoE,EAapE,oBAboE,CAa/C,YAb+C,CAAA,CAAA;;;;;;AACrD,UAoBA,oBApBA,CAAA,qBAoB0C,QApB1C,GAoBqD,QApBrD,CAAA,SAqBP,oBArBO,CAqBc,YArBd,CAAA,CAAA;EAOL;;;;;;EAIE,WACS,CAAA,SAAA,EAiBR,SAjBQ,EAAA,QAAA,EAkBT,iBAlBS,CAkBS,YAlBT,CAAA,CAAA,EAAA,IAAA;EAAY;;AAHjB;AAWlB;;;EAAmE,IAAG,CAAA,SAAA,EAmBpD,SAnBoD,EAAA,OAAA,EAmBhC,cAnBgC,CAmBjB,YAnBiB,CAAA,CAAA,EAAA,OAAA;EAAQ;;;EAUlC,UAA9B,EAAA,EAcE,SAdF,EAAA;EAAiB;;;EASqB,eAKpC,EAAA,EAAA,MAAA;EAAS;;;EAewC,aAA9B,CAAA,SAAA,EALR,SAKQ,CAAA,EAAA,MAAA;EAAiB;;;EAKG,SAKvC,CAAA,SAAA,EAVO,SAUP,CAAA,EAVmB,iBAUnB,CAVqC,YAUrC,CAAA,EAAA;EAAS;;;EAKE,GAA8B,CAAA,SAAA,EAVxC,SAUwC,EAAA,QAAA,EAVnB,iBAUmB,CAVD,YAUC,CAAA,CAAA,EAAA,IAAA;EAAY;;;EAOzB,EAAA,CAA9B,SAAA,EAZE,SAYF,EAAA,QAAA,EAZuB,iBAYvB,CAZyC,YAYzC,CAAA,CAAA,EAAA,IAAA;EAAiB;;;EAQA,IAMC,CAAA,SAAA,EArBd,SAqBc,EAAA,QAAA,EArBO,iBAqBP,CArByB,YAqBzB,CAAA,CAAA,EAAA,IAAA;EAAS;;;EAOV,eAM2B,CAAA,SAAA,EA5B3C,SA4B2C,EAAA,QAAA,EA3B5C,iBA2B4C,CA3B1B,YA2B0B,CAAA,CAAA,EAAA,IAAA;EAAY;;;EAUF,mBAA9B,CAAA,SAAA,EA9BvB,SA8BuB,EAAA,QAAA,EA7BxB,iBA6BwB,CA7BN,YA6BM,CAAA,CAAA,EAAA,IAAA;EAAiB;;;EAjGzB,kBAAA,CAAA,SAAA,EA0EE,SA1EF,CAAA,EAAA,IAAA;EAkHb;;;EACc,cAAG,CAAA,SAAA,EAnCnB,SAmCmB,EAAA,QAAA,EAlCpB,iBAkCoB,CAlCF,YAkCE,CAAA,CAAA,EAAA,IAAA;EAAQ;;;EAGvB,2BACM,CAAA,QAAA,EAhCe,iBAgCf,CAhCiC,YAgCjC,CAAA,CAAA,EAAA,IAAA;EAAY;AAAb;AAMxB;EAAoC,eAAA,CAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;EAAA;;;EACO,YACT,CAAA,SAAA,EA9BR,SA8BQ,CAAA,EA9BI,iBA8BJ,CA9BsB,YA8BtB,CAAA,EAAA;EAAY;;;;;EADhB;;;sBAlBR,oBAAoB;;;;;UAMzB,gDACM,WAAW;6BAGtB,QAAQ,cAAc,gBAC7B,oBAAoB;;;;;UAMR,yCAAyC,WAAW,kBAC3D,qBAAqB;0BACL,QAAQ,cAAc;;;gBAGhC,eAAe"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { DatasetChanges, QuadMatch } from "@ldo/rdf-utils";
|
|
2
|
+
import { BaseQuad, Dataset, DatasetFactory } from "@rdfjs/types";
|
|
3
|
+
|
|
4
|
+
//#region src/types.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An event listeners for nodes
|
|
8
|
+
*/
|
|
9
|
+
type nodeEventListener<InAndOutQuad extends BaseQuad = BaseQuad> = (changes: DatasetChanges<InAndOutQuad>, transactionId: string, triggeringQuadMatch: QuadMatch) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Adds the bulk method for add and remove
|
|
12
|
+
*/
|
|
13
|
+
interface IBulkEditableDataset<InAndOutQuad extends BaseQuad = BaseQuad> extends Dataset<InAndOutQuad, InAndOutQuad> {
|
|
14
|
+
bulk(changes: DatasetChanges<InAndOutQuad>): this;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Factory for creating SubscribableDatasets
|
|
18
|
+
*/
|
|
19
|
+
type ISubscribableDatasetFactory<InAndOutQuad extends BaseQuad = BaseQuad> = DatasetFactory<InAndOutQuad, InAndOutQuad, ISubscribableDataset<InAndOutQuad>>;
|
|
20
|
+
/**
|
|
21
|
+
* Dataset that allows developers to subscribe to a sepecific term and be alerted
|
|
22
|
+
* if a quad is added or removed containing that term. It's methods follow the
|
|
23
|
+
* EventEmitter interface except take in namedNodes as keys.
|
|
24
|
+
*/
|
|
25
|
+
interface ISubscribableDataset<InAndOutQuad extends BaseQuad = BaseQuad> extends IBulkEditableDataset<InAndOutQuad> {
|
|
26
|
+
/**
|
|
27
|
+
* Alias for emitter.on(eventName, listener).
|
|
28
|
+
* @param eventName
|
|
29
|
+
* @param listener
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
addListener(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
33
|
+
/**
|
|
34
|
+
* Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.
|
|
35
|
+
* @param eventName
|
|
36
|
+
* @param changes
|
|
37
|
+
* @returns true if the event had listeners, false otherwise.
|
|
38
|
+
*/
|
|
39
|
+
emit(eventName: QuadMatch, changes: DatasetChanges<InAndOutQuad>): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.
|
|
42
|
+
*/
|
|
43
|
+
eventNames(): QuadMatch[];
|
|
44
|
+
/**
|
|
45
|
+
* Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to events.defaultMaxListeners.
|
|
46
|
+
*/
|
|
47
|
+
getMaxListeners(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the number of listeners listening to the event named eventName.
|
|
50
|
+
*/
|
|
51
|
+
listenerCount(eventName: QuadMatch): number;
|
|
52
|
+
/**
|
|
53
|
+
* Returns a copy of the array of listeners for the event named eventName.
|
|
54
|
+
*/
|
|
55
|
+
listeners(eventName: QuadMatch): nodeEventListener<InAndOutQuad>[];
|
|
56
|
+
/**
|
|
57
|
+
* Alias for emitter.removeListener()
|
|
58
|
+
*/
|
|
59
|
+
off(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
|
|
62
|
+
*/
|
|
63
|
+
on(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
64
|
+
/**
|
|
65
|
+
* Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.
|
|
66
|
+
*/
|
|
67
|
+
once(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
68
|
+
/**
|
|
69
|
+
* Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
|
|
70
|
+
*/
|
|
71
|
+
prependListener(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
72
|
+
/**
|
|
73
|
+
* Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.
|
|
74
|
+
*/
|
|
75
|
+
prependOnceListener(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
76
|
+
/**
|
|
77
|
+
* Removes all listeners, or those of the specified eventName.
|
|
78
|
+
*/
|
|
79
|
+
removeAllListeners(eventName: QuadMatch): this;
|
|
80
|
+
/**
|
|
81
|
+
* Removes the specified listener from the listener array for the event named eventName.
|
|
82
|
+
*/
|
|
83
|
+
removeListener(eventName: QuadMatch, listener: nodeEventListener<InAndOutQuad>): this;
|
|
84
|
+
/**
|
|
85
|
+
* Removes the specified listener from all events
|
|
86
|
+
*/
|
|
87
|
+
removeListenerFromAllEvents(listener: nodeEventListener<InAndOutQuad>): this;
|
|
88
|
+
/**
|
|
89
|
+
* By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.
|
|
90
|
+
*/
|
|
91
|
+
setMaxListeners(n: number): this;
|
|
92
|
+
/**
|
|
93
|
+
* Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).
|
|
94
|
+
*/
|
|
95
|
+
rawListeners(eventName: QuadMatch): nodeEventListener<InAndOutQuad>[];
|
|
96
|
+
/**
|
|
97
|
+
* ==================================================================
|
|
98
|
+
* TRANSACTION METHODS
|
|
99
|
+
* ==================================================================
|
|
100
|
+
*/
|
|
101
|
+
/**
|
|
102
|
+
* Returns a transactional dataset that will update this dataset when its transaction is committed.
|
|
103
|
+
*/
|
|
104
|
+
startTransaction(): ITransactionDataset<InAndOutQuad>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Creates a TransactionDataset
|
|
108
|
+
*/
|
|
109
|
+
interface ITransactionDatasetFactory<InAndOutQuad extends BaseQuad = BaseQuad> {
|
|
110
|
+
transactionDataset(parent: Dataset<InAndOutQuad, InAndOutQuad>): ITransactionDataset<InAndOutQuad>;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A dataset that allows you to modify the dataset and
|
|
114
|
+
*/
|
|
115
|
+
interface ITransactionDataset<InAndOutQuad extends BaseQuad = BaseQuad> extends ISubscribableDataset<InAndOutQuad> {
|
|
116
|
+
readonly parentDataset: Dataset<InAndOutQuad, InAndOutQuad>;
|
|
117
|
+
rollback(): void;
|
|
118
|
+
commit(): void;
|
|
119
|
+
getChanges(): DatasetChanges<InAndOutQuad>;
|
|
120
|
+
hasChanges(): boolean;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=types.d.ts.map
|
|
123
|
+
//#endregion
|
|
124
|
+
export { IBulkEditableDataset, ISubscribableDataset, ISubscribableDatasetFactory, ITransactionDataset, ITransactionDatasetFactory, nodeEventListener };
|
|
125
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAMA;AAA6B,KAAjB,iBAAiB,CAAA,qBAAsB,QAAtB,GAAiC,QAAjC,CAAA,GAAA,CAAA,OAAA,EAClB,cADkB,CACH,YADG,CAAA,EAAA,aAAA,EAAA,MAAA,EAAA,mBAAA,EAGN,SAHM,EAAA,GAAA,IAAA;;;;AAClB,UAQM,oBARN,CAAA,qBAQgD,QARhD,GAQ2D,QAR3D,CAAA,SASD,OATC,CASO,YATP,EASqB,YATrB,CAAA,CAAA;EAAc,IAEF,CAAA,OAAA,EAQP,cARO,CAQQ,YARR,CAAA,CAAA,EAAA,IAAA;AAAS;AAMhC;;;AAAsE,KAQ1D,2BAR0D,CAAA,qBAS/C,QAT+C,GASpC,QAToC,CAAA,GAUlE,cAVkE,CAWpE,YAXoE,EAYpE,YAZoE,EAapE,oBAboE,CAa/C,YAb+C,CAAA,CAAA;;;;;;AACrD,UAoBA,oBApBA,CAAA,qBAoB0C,QApB1C,GAoBqD,QApBrD,CAAA,SAqBP,oBArBO,CAqBc,YArBd,CAAA,CAAA;EAOL;;;;;;EAIE,WACS,CAAA,SAAA,EAiBR,SAjBQ,EAAA,QAAA,EAkBT,iBAlBS,CAkBS,YAlBT,CAAA,CAAA,EAAA,IAAA;EAAY;;AAHjB;AAWlB;;;EAAmE,IAAG,CAAA,SAAA,EAmBpD,SAnBoD,EAAA,OAAA,EAmBhC,cAnBgC,CAmBjB,YAnBiB,CAAA,CAAA,EAAA,OAAA;EAAQ;;;EAUlC,UAA9B,EAAA,EAcE,SAdF,EAAA;EAAiB;;;EASqB,eAKpC,EAAA,EAAA,MAAA;EAAS;;;EAewC,aAA9B,CAAA,SAAA,EALR,SAKQ,CAAA,EAAA,MAAA;EAAiB;;;EAKG,SAKvC,CAAA,SAAA,EAVO,SAUP,CAAA,EAVmB,iBAUnB,CAVqC,YAUrC,CAAA,EAAA;EAAS;;;EAKE,GAA8B,CAAA,SAAA,EAVxC,SAUwC,EAAA,QAAA,EAVnB,iBAUmB,CAVD,YAUC,CAAA,CAAA,EAAA,IAAA;EAAY;;;EAOzB,EAAA,CAA9B,SAAA,EAZE,SAYF,EAAA,QAAA,EAZuB,iBAYvB,CAZyC,YAYzC,CAAA,CAAA,EAAA,IAAA;EAAiB;;;EAQA,IAMC,CAAA,SAAA,EArBd,SAqBc,EAAA,QAAA,EArBO,iBAqBP,CArByB,YAqBzB,CAAA,CAAA,EAAA,IAAA;EAAS;;;EAOV,eAM2B,CAAA,SAAA,EA5B3C,SA4B2C,EAAA,QAAA,EA3B5C,iBA2B4C,CA3B1B,YA2B0B,CAAA,CAAA,EAAA,IAAA;EAAY;;;EAUF,mBAA9B,CAAA,SAAA,EA9BvB,SA8BuB,EAAA,QAAA,EA7BxB,iBA6BwB,CA7BN,YA6BM,CAAA,CAAA,EAAA,IAAA;EAAiB;;;EAjGzB,kBAAA,CAAA,SAAA,EA0EE,SA1EF,CAAA,EAAA,IAAA;EAkHb;;;EACc,cAAG,CAAA,SAAA,EAnCnB,SAmCmB,EAAA,QAAA,EAlCpB,iBAkCoB,CAlCF,YAkCE,CAAA,CAAA,EAAA,IAAA;EAAQ;;;EAGvB,2BACM,CAAA,QAAA,EAhCe,iBAgCf,CAhCiC,YAgCjC,CAAA,CAAA,EAAA,IAAA;EAAY;AAAb;AAMxB;EAAoC,eAAA,CAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;EAAA;;;EACO,YACT,CAAA,SAAA,EA9BR,SA8BQ,CAAA,EA9BI,iBA8BJ,CA9BsB,YA8BtB,CAAA,EAAA;EAAY;;;;;EADhB;;;sBAlBR,oBAAoB;;;;;UAMzB,gDACM,WAAW;6BAGtB,QAAQ,cAAc,gBAC7B,oBAAoB;;;;;UAMR,yCAAyC,WAAW,kBAC3D,qBAAqB;0BACL,QAAQ,cAAc;;;gBAGhC,eAAe"}
|
package/dist/util.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/util.ts
|
|
3
|
+
/**
|
|
4
|
+
* Performs a bulk update for a dataset even if it doesn't have a bulk method.
|
|
5
|
+
* @param dataset - the input dataset
|
|
6
|
+
* @param datasetChanges - changes to be applied
|
|
7
|
+
*/
|
|
8
|
+
function updateDatasetInBulk(dataset, datasetChanges) {
|
|
9
|
+
if (dataset.bulk) dataset.bulk(datasetChanges);
|
|
10
|
+
else {
|
|
11
|
+
if (datasetChanges.added) dataset.addAll(datasetChanges.added);
|
|
12
|
+
if (datasetChanges.removed) datasetChanges.removed.forEach((curQuad) => {
|
|
13
|
+
dataset.delete(curQuad);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.updateDatasetInBulk = updateDatasetInBulk;
|
package/dist/util.d.cts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseQuad, Dataset } from "@rdfjs/types";
|
|
2
|
+
import { DatasetChanges } from "@ldo/rdf-utils";
|
|
3
|
+
|
|
4
|
+
//#region src/util.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Performs a bulk update for a dataset even if it doesn't have a bulk method.
|
|
8
|
+
* @param dataset - the input dataset
|
|
9
|
+
* @param datasetChanges - changes to be applied
|
|
10
|
+
*/
|
|
11
|
+
declare function updateDatasetInBulk<InAndOutQuad extends BaseQuad = BaseQuad>(dataset: Dataset<InAndOutQuad>, datasetChanges: DatasetChanges<InAndOutQuad>): void;
|
|
12
|
+
//# sourceMappingURL=util.d.ts.map
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { updateDatasetInBulk };
|
|
16
|
+
//# sourceMappingURL=util.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.cts","names":[],"sources":["../../src/util.ts"],"sourcesContent":[],"mappings":";;;;;;;AASA;;;AAAoE,iBAApD,mBAAoD,CAAA,qBAAX,QAAW,GAAA,QAAA,CAAA,CAAA,OAAA,EACzD,OADyD,CACjD,YADiD,CAAA,EAAA,cAAA,EAElD,cAFkD,CAEnC,YAFmC,CAAA,CAAA,EAAA,IAAA"}
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DatasetChanges } from "@ldo/rdf-utils";
|
|
2
|
+
import { BaseQuad, Dataset } from "@rdfjs/types";
|
|
3
|
+
|
|
4
|
+
//#region src/util.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Performs a bulk update for a dataset even if it doesn't have a bulk method.
|
|
8
|
+
* @param dataset - the input dataset
|
|
9
|
+
* @param datasetChanges - changes to be applied
|
|
10
|
+
*/
|
|
11
|
+
declare function updateDatasetInBulk<InAndOutQuad extends BaseQuad = BaseQuad>(dataset: Dataset<InAndOutQuad>, datasetChanges: DatasetChanges<InAndOutQuad>): void;
|
|
12
|
+
//# sourceMappingURL=util.d.ts.map
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { updateDatasetInBulk as updateDatasetInBulk$1 };
|
|
16
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","names":[],"sources":["../../src/util.ts"],"sourcesContent":[],"mappings":";;;;;;;AASA;;;AAAoE,iBAApD,mBAAoD,CAAA,qBAAX,QAAW,GAAA,QAAA,CAAA,CAAA,OAAA,EACzD,OADyD,CACjD,YADiD,CAAA,EAAA,cAAA,EAElD,cAFkD,CAEnC,YAFmC,CAAA,CAAA,EAAA,IAAA"}
|
package/dist/util.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/util.ts
|
|
2
|
+
/**
|
|
3
|
+
* Performs a bulk update for a dataset even if it doesn't have a bulk method.
|
|
4
|
+
* @param dataset - the input dataset
|
|
5
|
+
* @param datasetChanges - changes to be applied
|
|
6
|
+
*/
|
|
7
|
+
function updateDatasetInBulk(dataset, datasetChanges) {
|
|
8
|
+
if (dataset.bulk) dataset.bulk(datasetChanges);
|
|
9
|
+
else {
|
|
10
|
+
if (datasetChanges.added) dataset.addAll(datasetChanges.added);
|
|
11
|
+
if (datasetChanges.removed) datasetChanges.removed.forEach((curQuad) => {
|
|
12
|
+
dataset.delete(curQuad);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { updateDatasetInBulk };
|
|
19
|
+
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","names":["dataset: Dataset<InAndOutQuad>","datasetChanges: DatasetChanges<InAndOutQuad>"],"sources":["../src/util.ts"],"sourcesContent":["import type { DatasetChanges } from \"@ldo/rdf-utils\";\nimport type { BaseQuad, Dataset } from \"@rdfjs/types\";\nimport type { IBulkEditableDataset } from \"./types\";\n\n/**\n * Performs a bulk update for a dataset even if it doesn't have a bulk method.\n * @param dataset - the input dataset\n * @param datasetChanges - changes to be applied\n */\nexport function updateDatasetInBulk<InAndOutQuad extends BaseQuad = BaseQuad>(\n dataset: Dataset<InAndOutQuad>,\n datasetChanges: DatasetChanges<InAndOutQuad>,\n) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((dataset as any).bulk) {\n (dataset as IBulkEditableDataset<InAndOutQuad>).bulk(datasetChanges);\n } else {\n if (datasetChanges.added) {\n dataset.addAll(datasetChanges.added);\n }\n if (datasetChanges.removed) {\n datasetChanges.removed.forEach((curQuad) => {\n dataset.delete(curQuad);\n });\n }\n }\n}\n"],"mappings":";;;;;;AASA,SAAgB,oBACdA,SACAC,gBACA;AAEA,KAAK,QAAgB,KACnB,CAAC,QAA+C,KAAK,eAAe;MAC/D;AACL,MAAI,eAAe,MACjB,SAAQ,OAAO,eAAe,MAAM;AAEtC,MAAI,eAAe,QACjB,gBAAe,QAAQ,QAAQ,CAAC,YAAY;AAC1C,WAAQ,OAAO,QAAQ;EACxB,EAAC;CAEL;AACF"}
|
package/package.json
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldo/subscribable-dataset",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.34",
|
|
4
4
|
"description": "An RDFJS dataset implementation that can be subscribed to for updates",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/
|
|
7
|
-
"module": "./dist/
|
|
8
|
-
"types": "./dist/
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
14
19
|
},
|
|
15
20
|
"./package.json": "./package.json"
|
|
16
21
|
},
|
|
17
22
|
"scripts": {
|
|
18
|
-
"build": "rimraf dist &&
|
|
19
|
-
"
|
|
20
|
-
"build:esm": "tsc --project tsconfig.esm.json",
|
|
21
|
-
"test": "jest --coverage",
|
|
23
|
+
"build": "rimraf dist && NODE_OPTIONS=--max-old-space-size=8192 tsdown",
|
|
24
|
+
"test": "vitest run --coverage",
|
|
22
25
|
"example:subscribableDataset": "ts-node ./example/subscribableDatasetExample.ts",
|
|
23
|
-
"prepublishOnly": "
|
|
26
|
+
"prepublishOnly": "npm run build",
|
|
24
27
|
"lint": "eslint src/** --fix --no-error-on-unmatched-pattern",
|
|
25
28
|
"remove-dist": "rimraf dist/"
|
|
26
29
|
},
|
|
@@ -36,15 +39,15 @@
|
|
|
36
39
|
"homepage": "https://github.com/o-development/ldo/tree/main/packages/subscribable-dataset#readme",
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"@rdfjs/dataset": "^1.1.0",
|
|
39
|
-
"@rdfjs/types": "^1.0.1",
|
|
40
42
|
"@types/jsonld": "^1.5.6",
|
|
41
43
|
"@types/rdfjs__dataset": "^1.0.4",
|
|
42
44
|
"@types/uuid": "^10.0.0",
|
|
43
45
|
"ts-node": "^9.1.1"
|
|
44
46
|
},
|
|
45
47
|
"dependencies": {
|
|
46
|
-
"@ldo/dataset": "^1.0.0-alpha.
|
|
47
|
-
"@ldo/rdf-utils": "^1.0.0-alpha.
|
|
48
|
+
"@ldo/dataset": "^1.0.0-alpha.34",
|
|
49
|
+
"@ldo/rdf-utils": "^1.0.0-alpha.34",
|
|
50
|
+
"@rdfjs/types": "^1.0.1",
|
|
48
51
|
"uuid": "^11.1.0"
|
|
49
52
|
},
|
|
50
53
|
"files": [
|
|
@@ -54,5 +57,5 @@
|
|
|
54
57
|
"publishConfig": {
|
|
55
58
|
"access": "public"
|
|
56
59
|
},
|
|
57
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "ac9581d27e78e3e813620d0651390ad01d5a387a"
|
|
58
61
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DatasetFactory, BaseQuad, Dataset } from "@rdfjs/types";
|
|
2
|
-
import type { ITransactionDatasetFactory } from "./types
|
|
3
|
-
import { SubscribableDataset } from "./SubscribableDataset
|
|
2
|
+
import type { ITransactionDatasetFactory } from "./types";
|
|
3
|
+
import { SubscribableDataset } from "./SubscribableDataset";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A DatasetFactory that returns a SubscribableDataset given a generic DatasetFactory.
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { Dataset, BaseQuad, Term, DatasetFactory } from "@rdfjs/types";
|
|
2
2
|
import type { DatasetChanges } from "@ldo/rdf-utils";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "./
|
|
7
|
-
import { mergeDatasetChanges } from "./mergeDatasetChanges.js";
|
|
8
|
-
import { SubscribableDataset } from "./SubscribableDataset.js";
|
|
9
|
-
import { updateDatasetInBulk } from "./util.js";
|
|
3
|
+
import type { ITransactionDataset, ITransactionDatasetFactory } from "./types";
|
|
4
|
+
import { mergeDatasetChanges } from "./mergeDatasetChanges";
|
|
5
|
+
import { SubscribableDataset } from "./SubscribableDataset";
|
|
6
|
+
import { updateDatasetInBulk } from "./util";
|
|
10
7
|
|
|
11
8
|
/**
|
|
12
9
|
* Proxy Transactional Dataset is a transactional dataset that does not duplicate
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseQuad, DatasetFactory } from "@rdfjs/types";
|
|
2
|
-
import type { ISubscribableDataset, ITransactionDatasetFactory } from "./types
|
|
3
|
-
import { TransactionDataset } from "./TransactionDataset
|
|
2
|
+
import type { ISubscribableDataset, ITransactionDatasetFactory } from "./types";
|
|
3
|
+
import { TransactionDataset } from "./TransactionDataset";
|
|
4
4
|
|
|
5
5
|
export class TransactionDatasetFactory<InAndOutQuad extends BaseQuad>
|
|
6
6
|
implements ITransactionDatasetFactory<InAndOutQuad>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Dataset, DatasetFactory, Quad } from "@rdfjs/types";
|
|
2
2
|
import { createDataset } from "@ldo/dataset";
|
|
3
|
-
import { SubscribableDatasetFactory } from "./SubscribableDatasetFactory
|
|
3
|
+
import { SubscribableDatasetFactory } from "./SubscribableDatasetFactory";
|
|
4
4
|
import type {
|
|
5
5
|
ISubscribableDataset,
|
|
6
6
|
ISubscribableDatasetFactory,
|
|
7
7
|
ITransactionDatasetFactory,
|
|
8
|
-
} from "./types
|
|
9
|
-
import { TransactionDatasetFactory } from "./TransactionDatasetFactory
|
|
8
|
+
} from "./types";
|
|
9
|
+
import { TransactionDatasetFactory } from "./TransactionDatasetFactory";
|
|
10
10
|
|
|
11
11
|
const datasetFactory: DatasetFactory<Quad> = {
|
|
12
12
|
dataset: (quads?: Dataset<Quad> | Quad[]): Dataset<Quad> => {
|