diff --git a/.gitignore b/.gitignore index b963875..f6c2ad6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ yarn-debug.log* yarn-error.log* coverage/ + +docs/ diff --git a/package-lock.json b/package-lock.json index 0e10ef5..a73a107 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31209,9 +31209,9 @@ } }, "node_modules/typedoc": { - "version": "0.25.3", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.3.tgz", - "integrity": "sha512-Ow8Bo7uY1Lwy7GTmphRIMEo6IOZ+yYUyrc8n5KXIZg1svpqhZSWgni2ZrDhe+wLosFS8yswowUzljTAV/3jmWw==", + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz", + "integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==", "dev": true, "dependencies": { "lunr": "^2.3.9", @@ -31226,13 +31226,13 @@ "node": ">= 16" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x" + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x" } }, "node_modules/typedoc-plugin-markdown": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.0.tgz", - "integrity": "sha512-+uh5fHNfNSGdUxae0FWOuJ8Xu9Sl08jkdshOg6dilAqN/ZXmYsUFFDKw70fYfiGxdCLvpUuyr9FYO+WAa2lHeA==", + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz", + "integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==", "dev": true, "dependencies": { "handlebars": "^4.7.7" @@ -33492,9 +33492,7 @@ "cross-fetch": "^3.1.5", "jest": "^27.4.5", "ts-jest": "^27.1.2", - "ts-node": "^10.4.0", - "typedoc": "^0.25.3", - "typedoc-plugin-markdown": "^3.17.0" + "ts-node": "^10.4.0" } }, "packages/ldo/node_modules/ts-jest": { @@ -34815,7 +34813,9 @@ "jest-rdf": "^1.8.0", "ts-jest": "^29.0.2", "ts-node": "^10.9.1", - "typed-emitter": "^2.1.0" + "typed-emitter": "^2.1.0", + "typedoc": "^0.25.4", + "typedoc-plugin-markdown": "^3.17.1" } }, "packages/solid-react": { @@ -43913,9 +43913,7 @@ "jest": "^27.4.5", "readable-stream": "^4.3.0", "ts-jest": "^27.1.2", - "ts-node": "^10.4.0", - "typedoc": "*", - "typedoc-plugin-markdown": "*" + "ts-node": "^10.4.0" }, "dependencies": { "ts-jest": { @@ -44812,7 +44810,9 @@ "ts-jest": "^29.0.2", "ts-mixer": "^6.0.3", "ts-node": "^10.9.1", - "typed-emitter": "^2.1.0" + "typed-emitter": "^2.1.0", + "typedoc": "^0.25.4", + "typedoc-plugin-markdown": "^3.17.1" }, "dependencies": { "@jest/console": { @@ -62571,9 +62571,9 @@ } }, "typedoc": { - "version": "0.25.3", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.3.tgz", - "integrity": "sha512-Ow8Bo7uY1Lwy7GTmphRIMEo6IOZ+yYUyrc8n5KXIZg1svpqhZSWgni2ZrDhe+wLosFS8yswowUzljTAV/3jmWw==", + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz", + "integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==", "dev": true, "requires": { "lunr": "^2.3.9", @@ -62603,9 +62603,9 @@ } }, "typedoc-plugin-markdown": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.0.tgz", - "integrity": "sha512-+uh5fHNfNSGdUxae0FWOuJ8Xu9Sl08jkdshOg6dilAqN/ZXmYsUFFDKw70fYfiGxdCLvpUuyr9FYO+WAa2lHeA==", + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz", + "integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==", "dev": true, "requires": { "handlebars": "^4.7.7" diff --git a/packages/ldo/example/example.ts b/packages/ldo/example/example.ts deleted file mode 100644 index ecae41a..0000000 --- a/packages/ldo/example/example.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { parseRdf, startTransaction, toSparqlUpdate, toTurtle } from "../src"; -import { FoafProfileShapeType } from "./ldo/foafProfile.shapeTypes"; - -async function run() { - const rawTurtle = ` - <#me> a ; - "Jane Doe". - `; - - /** - * Step 1: Convert Raw RDF into a Linked Data Object - */ - const ldoDataset = await parseRdf(rawTurtle, { - baseIRI: "https://solidweb.me/jane_doe/profile/card", - }); - // Create a linked data object by telling the dataset the type and subject of - // the object - const janeProfile = ldoDataset - // Tells the LDO dataset that we're looking for a FoafProfile - .usingType(FoafProfileShapeType) - // Says the subject of the FoafProfile - .fromSubject("https://solidweb.me/jane_doe/profile/card#me"); - - /** - * Step 2: Manipulate the Linked Data Object - */ - // Logs "Jane Doe" - console.log(janeProfile.name); - // Logs "Person" - console.log(janeProfile.type); - // Logs 0 - console.log(janeProfile.knows?.length); - - // Begins a transaction that tracks your changes - startTransaction(janeProfile); - janeProfile.name = "Jane Smith"; - janeProfile.knows?.push({ - "@id": "https://solidweb.me/john_smith/profile/card#me", - type: { - "@id": "Person", - }, - name: "John Smith", - knows: [janeProfile], - }); - - // Logs "Jane Smith" - console.log(janeProfile.name); - // Logs "John Smith" - console.log(janeProfile.knows?.[0].name); - // Logs "Jane Smith" - console.log(janeProfile.knows?.[0].knows?.[0].name); - - /** - * Step 3: Convert it back to RDF - */ - // Logs: - // a ; - // "Jane Smith"; - // . - // a ; - // "John Smith"; - // . - console.log(await toTurtle(janeProfile)); - // Logs: - // DELETE DATA { - // "Jane Doe" . - // }; - // INSERT DATA { - // "Jane Smith" . - // . - // "John Smith" . - // . - // . - // } - console.log(await toSparqlUpdate(janeProfile)); -} -run(); diff --git a/packages/ldo/example/ldo/foafProfile.context.ts b/packages/ldo/example/ldo/foafProfile.context.ts deleted file mode 100644 index ebad8e7..0000000 --- a/packages/ldo/example/ldo/foafProfile.context.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { ContextDefinition } from "jsonld"; - -/** - * ============================================================================= - * foafProfileContext: JSONLD Context for foafProfile - * ============================================================================= - */ -export const foafProfileContext: ContextDefinition = { - type: { - "@id": "@type", - }, - Person: "http://xmlns.com/foaf/0.1/Person", - name: { - "@id": "http://xmlns.com/foaf/0.1/name", - "@type": "http://www.w3.org/2001/XMLSchema#string", - }, - img: { - "@id": "http://xmlns.com/foaf/0.1/img", - "@type": "http://www.w3.org/2001/XMLSchema#string", - }, - knows: { - "@id": "http://xmlns.com/foaf/0.1/knows", - "@type": "@id", - "@container": "@set", - }, -}; diff --git a/packages/ldo/example/ldo/foafProfile.schema.ts b/packages/ldo/example/ldo/foafProfile.schema.ts deleted file mode 100644 index de2909b..0000000 --- a/packages/ldo/example/ldo/foafProfile.schema.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { Schema } from "shexj"; - -/** - * ============================================================================= - * foafProfileSchema: ShexJ Schema for foafProfile - * ============================================================================= - */ -export const foafProfileSchema: Schema = { - type: "Schema", - shapes: [ - { - id: "https://example.com/FoafProfile", - type: "Shape", - expression: { - type: "EachOf", - expressions: [ - { - type: "TripleConstraint", - predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", - valueExpr: { - type: "NodeConstraint", - values: ["http://xmlns.com/foaf/0.1/Person"], - }, - annotations: [ - { - type: "Annotation", - predicate: "http://www.w3.org/2000/01/rdf-schema#comment", - object: { - value: "Defines the node as a Person (from foaf)", - }, - }, - ], - }, - { - type: "TripleConstraint", - predicate: "http://xmlns.com/foaf/0.1/name", - valueExpr: { - type: "NodeConstraint", - datatype: "http://www.w3.org/2001/XMLSchema#string", - }, - min: 0, - max: 1, - annotations: [ - { - type: "Annotation", - predicate: "http://www.w3.org/2000/01/rdf-schema#comment", - object: { - value: "Define a person's name.", - }, - }, - ], - }, - { - type: "TripleConstraint", - predicate: "http://xmlns.com/foaf/0.1/img", - valueExpr: { - type: "NodeConstraint", - datatype: "http://www.w3.org/2001/XMLSchema#string", - }, - min: 0, - max: 1, - annotations: [ - { - type: "Annotation", - predicate: "http://www.w3.org/2000/01/rdf-schema#comment", - object: { - value: "Photo link but in string form", - }, - }, - ], - }, - { - type: "TripleConstraint", - predicate: "http://xmlns.com/foaf/0.1/knows", - valueExpr: "https://example.com/FoafProfile", - min: 0, - max: -1, - annotations: [ - { - type: "Annotation", - predicate: "http://www.w3.org/2000/01/rdf-schema#comment", - object: { - value: "A list of WebIds for all the people this user knows.", - }, - }, - ], - }, - ], - }, - extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"], - }, - ], -}; diff --git a/packages/ldo/example/ldo/foafProfile.shapeTypes.ts b/packages/ldo/example/ldo/foafProfile.shapeTypes.ts deleted file mode 100644 index 6595247..0000000 --- a/packages/ldo/example/ldo/foafProfile.shapeTypes.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ShapeType } from "../../lib"; -import { foafProfileSchema } from "./foafProfile.schema"; -import { foafProfileContext } from "./foafProfile.context"; -import { FoafProfile } from "./foafProfile.typings"; - -/** - * ============================================================================= - * LDO ShapeTypes foafProfile - * ============================================================================= - */ - -/** - * FoafProfile ShapeType - */ -export const FoafProfileShapeType: ShapeType = { - schema: foafProfileSchema, - shape: "https://example.com/FoafProfile", - context: foafProfileContext, -}; diff --git a/packages/ldo/example/ldo/foafProfile.typings.ts b/packages/ldo/example/ldo/foafProfile.typings.ts deleted file mode 100644 index 8ea8877..0000000 --- a/packages/ldo/example/ldo/foafProfile.typings.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { ContextDefinition } from "jsonld"; - -/** - * ============================================================================= - * Typescript Typings for foafProfile - * ============================================================================= - */ - -/** - * FoafProfile Type - */ -export interface FoafProfile { - "@id"?: string; - "@context"?: ContextDefinition; - /** - * Defines the node as a Person (from foaf) - */ - type: { - "@id": "Person"; - }; - /** - * Define a person's name. - */ - name?: string; - /** - * Photo link but in string form - */ - img?: string; - /** - * A list of WebIds for all the people this user knows. - */ - knows?: FoafProfile[]; -} diff --git a/packages/ldo/example/shapes/foafProfile.shex b/packages/ldo/example/shapes/foafProfile.shex deleted file mode 100644 index 464fc24..0000000 --- a/packages/ldo/example/shapes/foafProfile.shex +++ /dev/null @@ -1,15 +0,0 @@ -PREFIX ex: -PREFIX foaf: -PREFIX rdfs: -PREFIX xsd: - -ex:FoafProfile EXTRA a { - a [ foaf:Person ] - // rdfs:comment "Defines the node as a Person (from foaf)" ; - foaf:name xsd:string ? - // rdfs:comment "Define a person's name." ; - foaf:img xsd:string ? - // rdfs:comment "Photo link but in string form" ; - foaf:knows @ex:FoafProfile * - // rdfs:comment "A list of WebIds for all the people this user knows." ; -} diff --git a/packages/ldo/src/createLdoDataset.ts b/packages/ldo/src/createLdoDataset.ts index 5417019..dbef1a0 100644 --- a/packages/ldo/src/createLdoDataset.ts +++ b/packages/ldo/src/createLdoDataset.ts @@ -1,6 +1,7 @@ import type { Dataset, DatasetFactory, Quad } from "@rdfjs/types"; import { createDataset } from "@ldo/dataset"; import { LdoDatasetFactory } from "./LdoDatasetFactory"; +import type { LdoDataset } from "./LdoDataset"; /** * Creates an LDO Dataset Factory @@ -18,11 +19,11 @@ export function createLdoDatasetFactory() { /** * Create an LDO Dataset * @param initialDataset - * @returns An LDO Dataset Factory + * @returns An LDO Dataset */ export function createLdoDataset( initialDataset?: Dataset | Quad[], -) { +): LdoDataset { const ldoDatasetFactory = createLdoDatasetFactory(); return ldoDatasetFactory.dataset(initialDataset); } diff --git a/packages/solid/README.md b/packages/solid/README.md index f9102cf..1670088 100644 --- a/packages/solid/README.md +++ b/packages/solid/README.md @@ -1,13 +1,6 @@ # @ldo/solid -Alpha -## Notes: - - Any quads in the default graph will not be synced to Solid Pods, but will be added to the dataset without any syncing - -## TODO: - - Add Documentation - - Access rule stuff just doesn't work. I might need to program a custom implementation for that ## Sponsorship This project was made possible by a grant from NGI Zero Entrust via nlnet. Learn more on the [NLnet project page](https://nlnet.nl/project/SolidUsableApps/). diff --git a/packages/solid/example/example-methodBrainstorm.ts b/packages/solid/example/example-methodBrainstorm.ts deleted file mode 100644 index 60aa3ec..0000000 --- a/packages/solid/example/example-methodBrainstorm.ts +++ /dev/null @@ -1,195 +0,0 @@ -const resourceMethods: Record = { - RootContainerResource: [ - "uri", - "isLoading", - "didInitialFetch", - "ldoDataset", - "getIsRootContainer", - "createContainerIn", - "createDataResourceIn", - "uploadBinaryIn", - "createOrOverwrite", - "read", - "reload", - "load", - "clear", - "clearIfPresent", - ], - ContainerResource: [ - "uri", - "isLoading", - "didInitialFetch", - "parentContainer", - "getIsRootContainer", - "getParentContainer", - "childResources", - "getRootContainer", - "createContainerIn", - "createDataResourceIn", - "uploadBinaryIn", - "ldoDataset", - "createOrOverwrite", - "read", - "reload", - "load", - "delete", - "deleteIfPresent", - "clear", - "clearIfPresent", - ], - ChildDataResource: [ - "uri", - "isLoading", - "didInitialFetch", - "parentContainer", - "getParentContainer", - "hasData", - "ldoDataset", - "getRootContainer", - "createOrOverwrite", - "read", - "reload", - "load", - "delete", - "deleteIfPresent", - ], - BinaryResource: [ - "uri", - "isLoading", - "didInitialFetch", - "mimeType", - "fileExtension", - "getRootContainer", - "getParentContainer", - "uploadOrOverwrite", - "read", - "reload", - "load", - "delete", - "deleteIfPresent", - ], - AbsentContainerResource: [ - "uri", - "isLoading", - "didInitialFetch", - "parentContainer", - "getIsRootContainer", - "getParentContainer", - "getRootContainer", - "createContainerIn", - "createDataResourceIn", - "uploadBinaryIn", - "createOrOverwrite", - "create", - "createIfAbsent", - "read", - "reload", - "load", - "deleteIfPresent", - "clearIfPresent", - ], - AbsentChildDataResource: [ - "uri", - "isLoading", - "didInitialFetch", - "parentContainer", - "getParentContainer", - "getRootContainer", - "createOrOverwrite", - "create", - "createIfAbsent", - "read", - "reload", - "load", - "deleteIfPresent", - ], - AbsentBinaryResource: [ - "uri", - "isLoading", - "didInitialFetch", - "parentContainer", - "getParentContainer", - "getRootContainer", - "uploadOrOverwrite", - "upload", - "uploadIfAbsent", - "read", - "reload", - "load", - "deleteIfPresent", - ], - UnfetchedContainerResource: [ - "uri", - "isLoading", - "didInitialFetch", - "getIsRootContainer", - "getParentContainer", - "getRootContainer", - "createContainerIn", - "createDataResourceIn", - "uploadBinaryIn", - "createOrOverwrite", - "createIfAbsent", - "read", - "reload", - "load", - "clearIfPresent", - ], - UnfetchedChildDataResource: [ - "parentContainer", - "getParentContainer", - "uri", - "isLoading", - "didInitialFetch", - "getRootContainer", - "createOrOverwrite", - "createIfAbsent", - "read", - "reload", - "load", - "deleteIfPresent", - ], - UnfetchedBinaryResource: [ - "uri", - "isLoading", - "didInitialFetch", - "parentContainer", - "getParentContainer", - "getRootContainer", - "uploadOrOverwrite", - "createOrOverwrite", - "uploadIfAbsent", - "read", - "reload", - "load", - "deleteIfPresent", - ], -}; - -function processTypes() { - const usedKeys = new Set(); - const interfaces = Object.keys(resourceMethods); - const groupMap: Record = {}; - - interfaces.forEach((interfaceName) => { - resourceMethods[interfaceName].forEach((methodKey) => { - if (!usedKeys.has(methodKey)) { - usedKeys.add(methodKey); - - let groupName = ""; - interfaces.forEach((interfaceName) => { - if (resourceMethods[interfaceName].includes(methodKey)) { - groupName += `${interfaceName}|`; - } - }); - if (!groupMap[groupName]) { - groupMap[groupName] = []; - } - groupMap[groupName].push(methodKey); - } - }); - }); - - console.log(groupMap); -} -processTypes(); diff --git a/packages/solid/example/example.ts b/packages/solid/example/example.ts deleted file mode 100644 index 9eaae91..0000000 --- a/packages/solid/example/example.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Mixin } from "ts-mixer"; - -class Foo { - protected makeFoo() { - return "foo"; - } -} - -class Bar { - protected makeFoo() { - return "bar"; - } -} - -class FooBar extends Mixin(Foo, Bar) { - public makeFooBar() { - return this.makeFoo() + this.makeFoo(); - } -} - -const fooBar = new FooBar(); -console.log(fooBar.makeFooBar()); diff --git a/packages/solid/package.json b/packages/solid/package.json index ee95a32..b3e450c 100644 --- a/packages/solid/package.json +++ b/packages/solid/package.json @@ -11,7 +11,8 @@ "test:watch": "jest --watch", "prepublishOnly": "npm run test && npm run build", "build:ldo": "ldo build --input src/.shapes --output src/.ldo", - "lint": "eslint src/** --fix --no-error-on-unmatched-pattern" + "lint": "eslint src/** --fix --no-error-on-unmatched-pattern", + "docs": "typedoc --plugin typedoc-plugin-markdown" }, "repository": { "type": "git", @@ -34,7 +35,9 @@ "jest-rdf": "^1.8.0", "ts-jest": "^29.0.2", "ts-node": "^10.9.1", - "typed-emitter": "^2.1.0" + "typed-emitter": "^2.1.0", + "typedoc": "^0.25.4", + "typedoc-plugin-markdown": "^3.17.1" }, "dependencies": { "@inrupt/solid-client": "^1.30.0", diff --git a/packages/solid/src/index.ts b/packages/solid/src/index.ts index 544a8b0..22b3108 100644 --- a/packages/solid/src/index.ts +++ b/packages/solid/src/index.ts @@ -9,3 +9,13 @@ export * from "./resource/Leaf"; export * from "./util/uriTypes"; export * from "./methods"; + +export * from "./requester/requests/checkRootContainer"; +export * from "./requester/requests/createDataResource"; +export * from "./requester/requests/deleteResource"; +export * from "./requester/requests/getAccessRules"; +export * from "./requester/requests/readResource"; +export * from "./requester/requests/requestOptions"; +export * from "./requester/requests/setAccessRules"; +export * from "./requester/requests/updateDataResource"; +export * from "./requester/requests/uploadResource"; diff --git a/packages/solid/src/util/uriTypes.ts b/packages/solid/src/util/uriTypes.ts index a5a3d6c..77e1e81 100644 --- a/packages/solid/src/util/uriTypes.ts +++ b/packages/solid/src/util/uriTypes.ts @@ -1,6 +1,6 @@ -export type ContainerUri = `${string}/${NonPathnameEnding}`; +export type ContainerUri = `${string}/${NonPathnameEnding}` & {}; export type LeafUri = - `${string}${EveryLegalPathnameCharacterOtherThanSlash}${NonPathnameEnding}`; + `${string}${EveryLegalPathnameCharacterOtherThanSlash}${NonPathnameEnding}` & {}; export function isContainerUri(uri: string): uri is ContainerUri { const url = new URL(uri); diff --git a/packages/solid/typedoc.json b/packages/solid/typedoc.json new file mode 100644 index 0000000..77072ae --- /dev/null +++ b/packages/solid/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": ["src/index.ts"], + "out": "docs", + "allReflectionsHaveOwnDocument": true +} \ No newline at end of file diff --git a/packages/subscribable-dataset/src/ProxyTransactionalDataset.ts b/packages/subscribable-dataset/src/ProxyTransactionalDataset.ts index f01eceb..da18828 100644 --- a/packages/subscribable-dataset/src/ProxyTransactionalDataset.ts +++ b/packages/subscribable-dataset/src/ProxyTransactionalDataset.ts @@ -9,9 +9,7 @@ import { mergeDatasetChanges } from "./mergeDatasetChanges"; * the parent dataset, it will dynamically determine the correct return value for * methods in real time when the method is called. */ -export default class ProxyTransactionalDataset< - InAndOutQuad extends BaseQuad = BaseQuad, - > +export class ProxyTransactionalDataset extends ExtendedDataset implements BulkEditableDataset, diff --git a/packages/subscribable-dataset/src/WrapperSubscribableDataset.ts b/packages/subscribable-dataset/src/WrapperSubscribableDataset.ts index 41db03c..a2d0ee5 100644 --- a/packages/subscribable-dataset/src/WrapperSubscribableDataset.ts +++ b/packages/subscribable-dataset/src/WrapperSubscribableDataset.ts @@ -20,13 +20,13 @@ import type { SubscribableDataset, TransactionalDataset, } from "./types"; -import ProxyTransactionalDataset from "./ProxyTransactionalDataset"; +import { ProxyTransactionalDataset } from "./ProxyTransactionalDataset"; /** * A wrapper for a dataset that allows subscriptions to be made on nodes to * be triggered whenever a quad containing that added or removed. */ -export default class WrapperSubscribableDataset< +export class WrapperSubscribableDataset< InAndOutQuad extends BaseQuad = BaseQuad, > implements SubscribableDataset { diff --git a/packages/subscribable-dataset/src/WrapperSubscribableDatasetFactory.ts b/packages/subscribable-dataset/src/WrapperSubscribableDatasetFactory.ts index 785ee73..b3d1757 100644 --- a/packages/subscribable-dataset/src/WrapperSubscribableDatasetFactory.ts +++ b/packages/subscribable-dataset/src/WrapperSubscribableDatasetFactory.ts @@ -1,10 +1,10 @@ import type { DatasetFactory, BaseQuad, Dataset } from "@rdfjs/types"; -import WrapperSubscribableDataset from "./WrapperSubscribableDataset"; +import { WrapperSubscribableDataset } from "./WrapperSubscribableDataset"; /** * A DatasetFactory that returns a WrapperSubscribableDataset given a generic DatasetFactory. */ -export default class WrapperSubscribableDatasetFactory< +export class WrapperSubscribableDatasetFactory< InAndOutQuad extends BaseQuad = BaseQuad, > implements DatasetFactory { diff --git a/packages/subscribable-dataset/src/createWrapperSubscribableDataset.ts b/packages/subscribable-dataset/src/createWrapperSubscribableDataset.ts index 68833de..df7af0d 100644 --- a/packages/subscribable-dataset/src/createWrapperSubscribableDataset.ts +++ b/packages/subscribable-dataset/src/createWrapperSubscribableDataset.ts @@ -1,7 +1,7 @@ import type { Dataset, DatasetFactory, Quad } from "@rdfjs/types"; -import type { WrapperSubscribableDataset } from "."; +import type { WrapperSubscribableDataset } from "./WrapperSubscribableDataset"; import { createDataset } from "@ldo/dataset"; -import WrapperSubscribableDatasetFactory from "./WrapperSubscribableDatasetFactory"; +import { WrapperSubscribableDatasetFactory } from "./WrapperSubscribableDatasetFactory"; /** * Creates a dataset factory that generates a SubscribableDataset @@ -21,7 +21,7 @@ export function createWrapperSubscribableDatasetFactory(): WrapperSubscribableDa * @param quads: A dataset or array of Quads to initialize the dataset. * @returns Dataset */ -export default function createWrapperSubscribableDataset( +export function createWrapperSubscribableDataset( quads?: Dataset | Quad[], ): WrapperSubscribableDataset { const wrapperSubscribableDatasetFactory = diff --git a/packages/subscribable-dataset/src/createWrapperSubscribableDatasetFromSerializedInput.ts b/packages/subscribable-dataset/src/createWrapperSubscribableDatasetFromSerializedInput.ts index cf18abb..dd3c511 100644 --- a/packages/subscribable-dataset/src/createWrapperSubscribableDatasetFromSerializedInput.ts +++ b/packages/subscribable-dataset/src/createWrapperSubscribableDatasetFromSerializedInput.ts @@ -2,7 +2,7 @@ import type { Quad } from "@rdfjs/types"; import type { ParserOptions } from "@ldo/rdf-utils"; import { createDatasetFromSerializedInput } from "@ldo/dataset"; import { createWrapperSubscribableDatasetFactory } from "./createWrapperSubscribableDataset"; -import type WrapperSubscribableDataset from "./WrapperSubscribableDataset"; +import type { WrapperSubscribableDataset } from "./WrapperSubscribableDataset"; /** * Creates a SubscribableDataset with a string input that could be JSON-LD, Turtle, N-Triples, TriG, RDF*, or N3. @@ -15,7 +15,7 @@ import type WrapperSubscribableDataset from "./WrapperSubscribableDataset"; * } * @returns A dataset */ -export default async function createWrapperSubscribableDatasetDataserFromSerializedInput( +export async function createWrapperSubscribableDatasetFromSerializedInput( data: string, options?: ParserOptions, ): Promise> { diff --git a/packages/subscribable-dataset/src/index.ts b/packages/subscribable-dataset/src/index.ts index b718c4c..d4ecf2f 100644 --- a/packages/subscribable-dataset/src/index.ts +++ b/packages/subscribable-dataset/src/index.ts @@ -1,10 +1,10 @@ export { - default as createSubscribableDataset, + createWrapperSubscribableDataset as createSubscribableDataset, createWrapperSubscribableDatasetFactory as createSubscribableDatasetFactory, } from "./createWrapperSubscribableDataset"; -export { default as serializedToSubscribableDataset } from "./createWrapperSubscribableDatasetFromSerializedInput"; -export { default as ProxyTransactionalDataset } from "./ProxyTransactionalDataset"; -export { default as WrapperSubscribableDataset } from "./WrapperSubscribableDataset"; -export { default as WrapperSubscribableDatasetFactory } from "./WrapperSubscribableDatasetFactory"; +export { createWrapperSubscribableDatasetFromSerializedInput as serializedToSubscribableDataset } from "./createWrapperSubscribableDatasetFromSerializedInput"; +export * from "./ProxyTransactionalDataset"; +export * from "./WrapperSubscribableDataset"; +export * from "./WrapperSubscribableDatasetFactory"; export * from "./types"; export * from "./mergeDatasetChanges";