@ldo/solid-type-index 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/.ldo/profile.context.cjs +22 -0
- package/dist/.ldo/profile.context.js +22 -0
- package/dist/.ldo/profile.context.js.map +1 -0
- package/dist/.ldo/profile.schema.cjs +52 -0
- package/dist/.ldo/profile.schema.js +52 -0
- package/dist/.ldo/profile.schema.js.map +1 -0
- package/dist/.ldo/profile.shapeTypes.cjs +20 -0
- package/dist/.ldo/profile.shapeTypes.js +21 -0
- package/dist/.ldo/profile.shapeTypes.js.map +1 -0
- package/dist/.ldo/profile.typings.d.cts +32 -0
- package/dist/.ldo/profile.typings.d.cts.map +1 -0
- package/dist/.ldo/profile.typings.d.ts +32 -0
- package/dist/.ldo/profile.typings.d.ts.map +1 -0
- package/dist/.ldo/typeIndex.context.cjs +55 -0
- package/dist/.ldo/typeIndex.context.js +55 -0
- package/dist/.ldo/typeIndex.context.js.map +1 -0
- package/dist/.ldo/typeIndex.schema.cjs +117 -0
- package/dist/.ldo/typeIndex.schema.js +117 -0
- package/dist/.ldo/typeIndex.schema.js.map +1 -0
- package/dist/.ldo/typeIndex.shapeTypes.cjs +29 -0
- package/dist/.ldo/typeIndex.shapeTypes.js +29 -0
- package/dist/.ldo/typeIndex.shapeTypes.js.map +1 -0
- package/dist/.ldo/typeIndex.typings.d.cts +39 -0
- package/dist/.ldo/typeIndex.typings.d.cts.map +1 -0
- package/dist/.ldo/typeIndex.typings.d.ts +39 -0
- package/dist/.ldo/typeIndex.typings.d.ts.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/constants.cjs +10 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/getTypeIndex.cjs +57 -0
- package/dist/getTypeIndex.d.cts +16 -0
- package/dist/getTypeIndex.d.cts.map +1 -0
- package/dist/getTypeIndex.d.ts +16 -0
- package/dist/getTypeIndex.d.ts.map +1 -0
- package/dist/getTypeIndex.js +55 -0
- package/dist/getTypeIndex.js.map +1 -0
- package/dist/index.cjs +16 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/react/useInstanceUris.cjs +31 -0
- package/dist/react/useInstanceUris.d.cts +15 -0
- package/dist/react/useInstanceUris.d.cts.map +1 -0
- package/dist/react/useInstanceUris.d.ts +15 -0
- package/dist/react/useInstanceUris.d.ts.map +1 -0
- package/dist/react/useInstanceUris.js +31 -0
- package/dist/react/useInstanceUris.js.map +1 -0
- package/dist/react/useTypeIndexProfile.cjs +14 -0
- package/dist/react/useTypeIndexProfile.d.cts +9 -0
- package/dist/react/useTypeIndexProfile.d.cts.map +1 -0
- package/dist/react/useTypeIndexProfile.d.ts +9 -0
- package/dist/react/useTypeIndexProfile.d.ts.map +1 -0
- package/dist/react/useTypeIndexProfile.js +14 -0
- package/dist/react/useTypeIndexProfile.js.map +1 -0
- package/dist/react/util/useSubscribeToUris.cjs +28 -0
- package/dist/react/util/useSubscribeToUris.js +28 -0
- package/dist/react/util/useSubscribeToUris.js.map +1 -0
- package/dist/setTypeIndex.cjs +129 -0
- package/dist/{types/setTypeIndex.d.ts → setTypeIndex.d.cts} +17 -13
- package/dist/setTypeIndex.d.cts.map +1 -0
- package/dist/setTypeIndex.d.ts +57 -0
- package/dist/setTypeIndex.d.ts.map +1 -0
- package/dist/setTypeIndex.js +125 -0
- package/dist/setTypeIndex.js.map +1 -0
- package/dist/util/Options.cjs +16 -0
- package/dist/util/Options.d.cts +11 -0
- package/dist/util/Options.d.cts.map +1 -0
- package/dist/util/Options.d.ts +11 -0
- package/dist/util/Options.d.ts.map +1 -0
- package/dist/util/Options.js +16 -0
- package/dist/util/Options.js.map +1 -0
- package/package.json +22 -18
- package/src/.ldo/profile.shapeTypes.ts +3 -3
- package/src/.ldo/typeIndex.shapeTypes.ts +3 -3
- package/src/getTypeIndex.ts +7 -7
- package/src/index.ts +4 -4
- package/src/react/useInstanceUris.ts +5 -5
- package/src/react/useTypeIndexProfile.ts +2 -2
- package/src/setTypeIndex.ts +6 -6
- package/dist/cjs/.ldo/profile.context.cjs +0 -21
- package/dist/cjs/.ldo/profile.context.js.map +0 -1
- package/dist/cjs/.ldo/profile.schema.cjs +0 -64
- package/dist/cjs/.ldo/profile.schema.js.map +0 -1
- package/dist/cjs/.ldo/profile.shapeTypes.cjs +0 -19
- package/dist/cjs/.ldo/profile.shapeTypes.js.map +0 -1
- package/dist/cjs/.ldo/profile.typings.cjs +0 -3
- package/dist/cjs/.ldo/profile.typings.js.map +0 -1
- package/dist/cjs/.ldo/typeIndex.context.cjs +0 -66
- package/dist/cjs/.ldo/typeIndex.context.js.map +0 -1
- package/dist/cjs/.ldo/typeIndex.schema.cjs +0 -146
- package/dist/cjs/.ldo/typeIndex.schema.js.map +0 -1
- package/dist/cjs/.ldo/typeIndex.shapeTypes.cjs +0 -27
- package/dist/cjs/.ldo/typeIndex.shapeTypes.js.map +0 -1
- package/dist/cjs/.ldo/typeIndex.typings.cjs +0 -3
- package/dist/cjs/.ldo/typeIndex.typings.js.map +0 -1
- package/dist/cjs/constants.cjs +0 -9
- package/dist/cjs/constants.js.map +0 -1
- package/dist/cjs/getTypeIndex.cjs +0 -67
- package/dist/cjs/getTypeIndex.js.map +0 -1
- package/dist/cjs/index.cjs +0 -21
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/react/useInstanceUris.cjs +0 -33
- package/dist/cjs/react/useInstanceUris.js.map +0 -1
- package/dist/cjs/react/useTypeIndexProfile.cjs +0 -12
- package/dist/cjs/react/useTypeIndexProfile.js.map +0 -1
- package/dist/cjs/react/util/useSubscribeToUris.cjs +0 -33
- package/dist/cjs/react/util/useSubscribeToUris.js.map +0 -1
- package/dist/cjs/setTypeIndex.cjs +0 -163
- package/dist/cjs/setTypeIndex.js.map +0 -1
- package/dist/cjs/util/Options.cjs +0 -12
- package/dist/cjs/util/Options.js.map +0 -1
- package/dist/esm/.ldo/profile.context.js +0 -18
- package/dist/esm/.ldo/profile.context.js.map +0 -1
- package/dist/esm/.ldo/profile.schema.js +0 -61
- package/dist/esm/.ldo/profile.schema.js.map +0 -1
- package/dist/esm/.ldo/profile.shapeTypes.js +0 -16
- package/dist/esm/.ldo/profile.shapeTypes.js.map +0 -1
- package/dist/esm/.ldo/profile.typings.js +0 -2
- package/dist/esm/.ldo/profile.typings.js.map +0 -1
- package/dist/esm/.ldo/typeIndex.context.js +0 -63
- package/dist/esm/.ldo/typeIndex.context.js.map +0 -1
- package/dist/esm/.ldo/typeIndex.schema.js +0 -143
- package/dist/esm/.ldo/typeIndex.schema.js.map +0 -1
- package/dist/esm/.ldo/typeIndex.shapeTypes.js +0 -24
- package/dist/esm/.ldo/typeIndex.shapeTypes.js.map +0 -1
- package/dist/esm/.ldo/typeIndex.typings.js +0 -2
- package/dist/esm/.ldo/typeIndex.typings.js.map +0 -1
- package/dist/esm/constants.js +0 -6
- package/dist/esm/constants.js.map +0 -1
- package/dist/esm/getTypeIndex.js +0 -61
- package/dist/esm/getTypeIndex.js.map +0 -1
- package/dist/esm/index.js +0 -5
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/react/useInstanceUris.js +0 -30
- package/dist/esm/react/useInstanceUris.js.map +0 -1
- package/dist/esm/react/useTypeIndexProfile.js +0 -9
- package/dist/esm/react/useTypeIndexProfile.js.map +0 -1
- package/dist/esm/react/util/useSubscribeToUris.js +0 -30
- package/dist/esm/react/util/useSubscribeToUris.js.map +0 -1
- package/dist/esm/setTypeIndex.js +0 -156
- package/dist/esm/setTypeIndex.js.map +0 -1
- package/dist/esm/util/Options.js +0 -9
- package/dist/esm/util/Options.js.map +0 -1
- package/dist/types/.ldo/profile.context.d.ts +0 -8
- package/dist/types/.ldo/profile.context.d.ts.map +0 -1
- package/dist/types/.ldo/profile.schema.d.ts +0 -8
- package/dist/types/.ldo/profile.schema.d.ts.map +0 -1
- package/dist/types/.ldo/profile.shapeTypes.d.ts +0 -12
- package/dist/types/.ldo/profile.shapeTypes.d.ts.map +0 -1
- package/dist/types/.ldo/profile.typings.d.ts +0 -26
- package/dist/types/.ldo/profile.typings.d.ts.map +0 -1
- package/dist/types/.ldo/typeIndex.context.d.ts +0 -8
- package/dist/types/.ldo/typeIndex.context.d.ts.map +0 -1
- package/dist/types/.ldo/typeIndex.schema.d.ts +0 -8
- package/dist/types/.ldo/typeIndex.schema.d.ts.map +0 -1
- package/dist/types/.ldo/typeIndex.shapeTypes.d.ts +0 -16
- package/dist/types/.ldo/typeIndex.shapeTypes.d.ts.map +0 -1
- package/dist/types/.ldo/typeIndex.typings.d.ts +0 -53
- package/dist/types/.ldo/typeIndex.typings.d.ts.map +0 -1
- package/dist/types/constants.d.ts +0 -6
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/getTypeIndex.d.ts +0 -10
- package/dist/types/getTypeIndex.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/react/useInstanceUris.d.ts +0 -9
- package/dist/types/react/useInstanceUris.d.ts.map +0 -1
- package/dist/types/react/useTypeIndexProfile.d.ts +0 -3
- package/dist/types/react/useTypeIndexProfile.d.ts.map +0 -1
- package/dist/types/react/util/useSubscribeToUris.d.ts +0 -2
- package/dist/types/react/util/useSubscribeToUris.d.ts.map +0 -1
- package/dist/types/setTypeIndex.d.ts.map +0 -1
- package/dist/types/util/Options.d.ts +0 -11
- package/dist/types/util/Options.d.ts.map +0 -1
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./getTypeIndex
|
|
2
|
-
export * from "./setTypeIndex
|
|
3
|
-
export * from "./react/useInstanceUris
|
|
4
|
-
export * from "./react/useTypeIndexProfile
|
|
1
|
+
export * from "./getTypeIndex";
|
|
2
|
+
export * from "./setTypeIndex";
|
|
3
|
+
export * from "./react/useInstanceUris";
|
|
4
|
+
export * from "./react/useTypeIndexProfile";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useTypeIndexProfile } from "./useTypeIndexProfile
|
|
1
|
+
import { useTypeIndexProfile } from "./useTypeIndexProfile";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
|
-
import { useSubscribeToUris } from "./util/useSubscribeToUris
|
|
3
|
+
import { useSubscribeToUris } from "./util/useSubscribeToUris";
|
|
4
4
|
import { useLdo, useMatchSubject } from "@ldo/solid-react";
|
|
5
|
-
import { TypeRegistrationShapeType } from "../.ldo/typeIndex.shapeTypes
|
|
6
|
-
import { RDF_TYPE, TYPE_REGISTRATION } from "../constants
|
|
5
|
+
import { TypeRegistrationShapeType } from "../.ldo/typeIndex.shapeTypes";
|
|
6
|
+
import { RDF_TYPE, TYPE_REGISTRATION } from "../constants";
|
|
7
7
|
import {
|
|
8
8
|
getInstanceUris,
|
|
9
9
|
getTypeIndexesUrisFromProfile,
|
|
10
|
-
} from "../getTypeIndex
|
|
10
|
+
} from "../getTypeIndex";
|
|
11
11
|
import type { SolidLeafUri } from "@ldo/connected-solid";
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useResource, useSolidAuth, useSubject } from "@ldo/solid-react";
|
|
2
|
-
import type { TypeIndexProfile } from "../.ldo/profile.typings
|
|
3
|
-
import { TypeIndexProfileShapeType } from "../.ldo/profile.shapeTypes
|
|
2
|
+
import type { TypeIndexProfile } from "../.ldo/profile.typings";
|
|
3
|
+
import { TypeIndexProfileShapeType } from "../.ldo/profile.shapeTypes";
|
|
4
4
|
|
|
5
5
|
export function useTypeIndexProfile(): TypeIndexProfile | undefined {
|
|
6
6
|
const { session } = useSolidAuth();
|
package/src/setTypeIndex.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { v4 } from "uuid";
|
|
3
|
-
import { FOR_CLASS, RDF_TYPE, TYPE_REGISTRATION } from "./constants
|
|
4
|
-
import { guaranteeOptions, type Options } from "./util/Options
|
|
3
|
+
import { FOR_CLASS, RDF_TYPE, TYPE_REGISTRATION } from "./constants";
|
|
4
|
+
import { guaranteeOptions, type Options } from "./util/Options";
|
|
5
5
|
import { namedNode, quad } from "@ldo/rdf-utils";
|
|
6
|
-
import type { TypeRegistration } from "./.ldo/typeIndex.typings
|
|
7
|
-
import { getProfile } from "./getTypeIndex
|
|
8
|
-
import { TypeIndexProfileShapeType } from "./.ldo/profile.shapeTypes
|
|
6
|
+
import type { TypeRegistration } from "./.ldo/typeIndex.typings";
|
|
7
|
+
import { getProfile } from "./getTypeIndex";
|
|
8
|
+
import { TypeIndexProfileShapeType } from "./.ldo/profile.shapeTypes";
|
|
9
9
|
import type { NamedNode } from "@rdfjs/types";
|
|
10
10
|
import { set } from "@ldo/ldo";
|
|
11
11
|
import type {
|
|
@@ -18,7 +18,7 @@ import type { ConnectedLdoDataset, ConnectedPlugin } from "@ldo/connected";
|
|
|
18
18
|
import {
|
|
19
19
|
TypeIndexDocumentShapeType,
|
|
20
20
|
TypeRegistrationShapeType,
|
|
21
|
-
} from "./.ldo/typeIndex.shapeTypes
|
|
21
|
+
} from "./.ldo/typeIndex.shapeTypes";
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* =============================================================================
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.profileContext = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* =============================================================================
|
|
6
|
-
* profileContext: JSONLD Context for profile
|
|
7
|
-
* =============================================================================
|
|
8
|
-
*/
|
|
9
|
-
exports.profileContext = {
|
|
10
|
-
privateTypeIndex: {
|
|
11
|
-
"@id": "http://www.w3.org/ns/solid/terms#privateTypeIndex",
|
|
12
|
-
"@type": "@id",
|
|
13
|
-
"@isCollection": true,
|
|
14
|
-
},
|
|
15
|
-
publicTypeIndex: {
|
|
16
|
-
"@id": "http://www.w3.org/ns/solid/terms#publicTypeIndex",
|
|
17
|
-
"@type": "@id",
|
|
18
|
-
"@isCollection": true,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=profile.context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.context.js","sourceRoot":"","sources":["../../../src/.ldo/profile.context.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,cAAc,GAAqB;IAC9C,gBAAgB,EAAE;QAChB,KAAK,EAAE,mDAAmD;QAC1D,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;KACtB;IACD,eAAe,EAAE;QACf,KAAK,EAAE,kDAAkD;QACzD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;KACtB;CACF,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.profileSchema = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* =============================================================================
|
|
6
|
-
* profileSchema: ShexJ Schema for profile
|
|
7
|
-
* =============================================================================
|
|
8
|
-
*/
|
|
9
|
-
exports.profileSchema = {
|
|
10
|
-
type: "Schema",
|
|
11
|
-
shapes: [
|
|
12
|
-
{
|
|
13
|
-
id: "https://shaperepo.com/schemas/solidProfile#TypeIndexProfile",
|
|
14
|
-
type: "ShapeDecl",
|
|
15
|
-
shapeExpr: {
|
|
16
|
-
type: "Shape",
|
|
17
|
-
expression: {
|
|
18
|
-
type: "EachOf",
|
|
19
|
-
expressions: [
|
|
20
|
-
{
|
|
21
|
-
type: "TripleConstraint",
|
|
22
|
-
predicate: "http://www.w3.org/ns/solid/terms#privateTypeIndex",
|
|
23
|
-
valueExpr: {
|
|
24
|
-
type: "NodeConstraint",
|
|
25
|
-
nodeKind: "iri",
|
|
26
|
-
},
|
|
27
|
-
min: 0,
|
|
28
|
-
max: -1,
|
|
29
|
-
annotations: [
|
|
30
|
-
{
|
|
31
|
-
type: "Annotation",
|
|
32
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
33
|
-
object: {
|
|
34
|
-
value: "A registry of all types used on the user's Pod (for private access only)",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
type: "TripleConstraint",
|
|
41
|
-
predicate: "http://www.w3.org/ns/solid/terms#publicTypeIndex",
|
|
42
|
-
valueExpr: {
|
|
43
|
-
type: "NodeConstraint",
|
|
44
|
-
nodeKind: "iri",
|
|
45
|
-
},
|
|
46
|
-
min: 0,
|
|
47
|
-
max: -1,
|
|
48
|
-
annotations: [
|
|
49
|
-
{
|
|
50
|
-
type: "Annotation",
|
|
51
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
52
|
-
object: {
|
|
53
|
-
value: "A registry of all types used on the user's Pod (for public access)",
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=profile.schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.schema.js","sourceRoot":"","sources":["../../../src/.ldo/profile.schema.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,aAAa,GAAW;IACnC,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE;QACN;YACE,EAAE,EAAE,6DAA6D;YACjE,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE;wBACX;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,mDAAmD;4BAC9D,SAAS,EAAE;gCACT,IAAI,EAAE,gBAAgB;gCACtB,QAAQ,EAAE,KAAK;6BAChB;4BACD,GAAG,EAAE,CAAC;4BACN,GAAG,EAAE,CAAC,CAAC;4BACP,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EACH,0EAA0E;qCAC7E;iCACF;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,kDAAkD;4BAC7D,SAAS,EAAE;gCACT,IAAI,EAAE,gBAAgB;gCACtB,QAAQ,EAAE,KAAK;6BAChB;4BACD,GAAG,EAAE,CAAC;4BACN,GAAG,EAAE,CAAC,CAAC;4BACP,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EACH,oEAAoE;qCACvE;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeIndexProfileShapeType = void 0;
|
|
4
|
-
const profile_schema_js_1 = require("./profile.schema.js");
|
|
5
|
-
const profile_context_js_1 = require("./profile.context.js");
|
|
6
|
-
/**
|
|
7
|
-
* =============================================================================
|
|
8
|
-
* LDO ShapeTypes profile
|
|
9
|
-
* =============================================================================
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* TypeIndexProfile ShapeType
|
|
13
|
-
*/
|
|
14
|
-
exports.TypeIndexProfileShapeType = {
|
|
15
|
-
schema: profile_schema_js_1.profileSchema,
|
|
16
|
-
shape: "https://shaperepo.com/schemas/solidProfile#TypeIndexProfile",
|
|
17
|
-
context: profile_context_js_1.profileContext,
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=profile.shapeTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.shapeTypes.js","sourceRoot":"","sources":["../../../src/.ldo/profile.shapeTypes.ts"],"names":[],"mappings":";;;AACA,2DAAoD;AACpD,6DAAsD;AAGtD;;;;GAIG;AAEH;;GAEG;AACU,QAAA,yBAAyB,GAAgC;IACpE,MAAM,EAAE,iCAAa;IACrB,KAAK,EAAE,6DAA6D;IACpE,OAAO,EAAE,mCAAc;CACxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.typings.js","sourceRoot":"","sources":["../../../src/.ldo/profile.typings.ts"],"names":[],"mappings":""}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.typeIndexContext = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* =============================================================================
|
|
6
|
-
* typeIndexContext: JSONLD Context for typeIndex
|
|
7
|
-
* =============================================================================
|
|
8
|
-
*/
|
|
9
|
-
exports.typeIndexContext = {
|
|
10
|
-
type: {
|
|
11
|
-
"@id": "@type",
|
|
12
|
-
},
|
|
13
|
-
TypeIndex: {
|
|
14
|
-
"@id": "http://www.w3.org/ns/solid/terms#TypeIndex",
|
|
15
|
-
"@context": {
|
|
16
|
-
type: {
|
|
17
|
-
"@id": "@type",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
ListedDocument: {
|
|
22
|
-
"@id": "http://www.w3.org/ns/solid/terms#ListedDocument",
|
|
23
|
-
"@context": {
|
|
24
|
-
type: {
|
|
25
|
-
"@id": "@type",
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
TypeRegistration: {
|
|
30
|
-
"@id": "http://www.w3.org/ns/solid/terms#TypeRegistration",
|
|
31
|
-
"@context": {
|
|
32
|
-
type: {
|
|
33
|
-
"@id": "@type",
|
|
34
|
-
},
|
|
35
|
-
forClass: {
|
|
36
|
-
"@id": "http://www.w3.org/ns/solid/terms#forClass",
|
|
37
|
-
"@type": "@id",
|
|
38
|
-
},
|
|
39
|
-
instance: {
|
|
40
|
-
"@id": "http://www.w3.org/ns/solid/terms#instance",
|
|
41
|
-
"@type": "@id",
|
|
42
|
-
"@isCollection": true,
|
|
43
|
-
},
|
|
44
|
-
instanceContainer: {
|
|
45
|
-
"@id": "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
46
|
-
"@type": "@id",
|
|
47
|
-
"@isCollection": true,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
forClass: {
|
|
52
|
-
"@id": "http://www.w3.org/ns/solid/terms#forClass",
|
|
53
|
-
"@type": "@id",
|
|
54
|
-
},
|
|
55
|
-
instance: {
|
|
56
|
-
"@id": "http://www.w3.org/ns/solid/terms#instance",
|
|
57
|
-
"@type": "@id",
|
|
58
|
-
"@isCollection": true,
|
|
59
|
-
},
|
|
60
|
-
instanceContainer: {
|
|
61
|
-
"@id": "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
62
|
-
"@type": "@id",
|
|
63
|
-
"@isCollection": true,
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=typeIndex.context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.context.js","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.context.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,gBAAgB,GAAqB;IAChD,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;KACf;IACD,SAAS,EAAE;QACT,KAAK,EAAE,4CAA4C;QACnD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,KAAK,EAAE,OAAO;aACf;SACF;KACF;IACD,cAAc,EAAE;QACd,KAAK,EAAE,iDAAiD;QACxD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,KAAK,EAAE,OAAO;aACf;SACF;KACF;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,mDAAmD;QAC1D,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,KAAK,EAAE,OAAO;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,2CAA2C;gBAClD,OAAO,EAAE,KAAK;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,2CAA2C;gBAClD,OAAO,EAAE,KAAK;gBACd,eAAe,EAAE,IAAI;aACtB;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,oDAAoD;gBAC3D,OAAO,EAAE,KAAK;gBACd,eAAe,EAAE,IAAI;aACtB;SACF;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,2CAA2C;QAClD,OAAO,EAAE,KAAK;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,2CAA2C;QAClD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;KACtB;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,oDAAoD;QAC3D,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;KACtB;CACF,CAAC"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.typeIndexSchema = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* =============================================================================
|
|
6
|
-
* typeIndexSchema: ShexJ Schema for typeIndex
|
|
7
|
-
* =============================================================================
|
|
8
|
-
*/
|
|
9
|
-
exports.typeIndexSchema = {
|
|
10
|
-
type: "Schema",
|
|
11
|
-
shapes: [
|
|
12
|
-
{
|
|
13
|
-
id: "https://shaperepo.com/schemas/solidProfile#TypeIndexDocument",
|
|
14
|
-
type: "ShapeDecl",
|
|
15
|
-
shapeExpr: {
|
|
16
|
-
type: "Shape",
|
|
17
|
-
expression: {
|
|
18
|
-
type: "EachOf",
|
|
19
|
-
expressions: [
|
|
20
|
-
{
|
|
21
|
-
type: "TripleConstraint",
|
|
22
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
23
|
-
valueExpr: {
|
|
24
|
-
type: "NodeConstraint",
|
|
25
|
-
values: ["http://www.w3.org/ns/solid/terms#TypeIndex"],
|
|
26
|
-
},
|
|
27
|
-
annotations: [
|
|
28
|
-
{
|
|
29
|
-
type: "Annotation",
|
|
30
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
31
|
-
object: {
|
|
32
|
-
value: "Defines the node as a TypeIndex",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
type: "TripleConstraint",
|
|
39
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
40
|
-
valueExpr: {
|
|
41
|
-
type: "NodeConstraint",
|
|
42
|
-
values: ["http://www.w3.org/ns/solid/terms#ListedDocument"],
|
|
43
|
-
},
|
|
44
|
-
annotations: [
|
|
45
|
-
{
|
|
46
|
-
type: "Annotation",
|
|
47
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
48
|
-
object: {
|
|
49
|
-
value: "Defines the node as a Listed Document",
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"],
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "https://shaperepo.com/schemas/solidProfile#TypeRegistration",
|
|
61
|
-
type: "ShapeDecl",
|
|
62
|
-
shapeExpr: {
|
|
63
|
-
type: "Shape",
|
|
64
|
-
expression: {
|
|
65
|
-
type: "EachOf",
|
|
66
|
-
expressions: [
|
|
67
|
-
{
|
|
68
|
-
type: "TripleConstraint",
|
|
69
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
70
|
-
valueExpr: {
|
|
71
|
-
type: "NodeConstraint",
|
|
72
|
-
values: ["http://www.w3.org/ns/solid/terms#TypeRegistration"],
|
|
73
|
-
},
|
|
74
|
-
annotations: [
|
|
75
|
-
{
|
|
76
|
-
type: "Annotation",
|
|
77
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
78
|
-
object: {
|
|
79
|
-
value: "Defines this node as a Type Registration",
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
type: "TripleConstraint",
|
|
86
|
-
predicate: "http://www.w3.org/ns/solid/terms#forClass",
|
|
87
|
-
valueExpr: {
|
|
88
|
-
type: "NodeConstraint",
|
|
89
|
-
nodeKind: "iri",
|
|
90
|
-
},
|
|
91
|
-
annotations: [
|
|
92
|
-
{
|
|
93
|
-
type: "Annotation",
|
|
94
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
95
|
-
object: {
|
|
96
|
-
value: "The class of object at this type.",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
type: "TripleConstraint",
|
|
103
|
-
predicate: "http://www.w3.org/ns/solid/terms#instance",
|
|
104
|
-
valueExpr: {
|
|
105
|
-
type: "NodeConstraint",
|
|
106
|
-
nodeKind: "iri",
|
|
107
|
-
},
|
|
108
|
-
min: 0,
|
|
109
|
-
max: -1,
|
|
110
|
-
annotations: [
|
|
111
|
-
{
|
|
112
|
-
type: "Annotation",
|
|
113
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
114
|
-
object: {
|
|
115
|
-
value: "A specific resource that contains the class.",
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
type: "TripleConstraint",
|
|
122
|
-
predicate: "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
123
|
-
valueExpr: {
|
|
124
|
-
type: "NodeConstraint",
|
|
125
|
-
nodeKind: "iri",
|
|
126
|
-
},
|
|
127
|
-
min: 0,
|
|
128
|
-
max: -1,
|
|
129
|
-
annotations: [
|
|
130
|
-
{
|
|
131
|
-
type: "Annotation",
|
|
132
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
133
|
-
object: {
|
|
134
|
-
value: "Containers that contain resources with the class.",
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"],
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
};
|
|
146
|
-
//# sourceMappingURL=typeIndex.schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.schema.js","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.schema.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeRegistrationShapeType = exports.TypeIndexDocumentShapeType = void 0;
|
|
4
|
-
const typeIndex_schema_js_1 = require("./typeIndex.schema.js");
|
|
5
|
-
const typeIndex_context_js_1 = require("./typeIndex.context.js");
|
|
6
|
-
/**
|
|
7
|
-
* =============================================================================
|
|
8
|
-
* LDO ShapeTypes typeIndex
|
|
9
|
-
* =============================================================================
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* TypeIndexDocument ShapeType
|
|
13
|
-
*/
|
|
14
|
-
exports.TypeIndexDocumentShapeType = {
|
|
15
|
-
schema: typeIndex_schema_js_1.typeIndexSchema,
|
|
16
|
-
shape: "https://shaperepo.com/schemas/solidProfile#TypeIndexDocument",
|
|
17
|
-
context: typeIndex_context_js_1.typeIndexContext,
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* TypeRegistration ShapeType
|
|
21
|
-
*/
|
|
22
|
-
exports.TypeRegistrationShapeType = {
|
|
23
|
-
schema: typeIndex_schema_js_1.typeIndexSchema,
|
|
24
|
-
shape: "https://shaperepo.com/schemas/solidProfile#TypeRegistration",
|
|
25
|
-
context: typeIndex_context_js_1.typeIndexContext,
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=typeIndex.shapeTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.shapeTypes.js","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.shapeTypes.ts"],"names":[],"mappings":";;;AACA,+DAAwD;AACxD,iEAA0D;AAG1D;;;;GAIG;AAEH;;GAEG;AACU,QAAA,0BAA0B,GAAiC;IACtE,MAAM,EAAE,qCAAe;IACvB,KAAK,EAAE,8DAA8D;IACrE,OAAO,EAAE,uCAAgB;CAC1B,CAAC;AAEF;;GAEG;AACU,QAAA,yBAAyB,GAAgC;IACpE,MAAM,EAAE,qCAAe;IACvB,KAAK,EAAE,6DAA6D;IACpE,OAAO,EAAE,uCAAgB;CAC1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.typings.js","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.typings.ts"],"names":[],"mappings":""}
|
package/dist/cjs/constants.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INSTANCE_CONTAINER = exports.INSTANCE = exports.FOR_CLASS = exports.TYPE_REGISTRATION = exports.RDF_TYPE = void 0;
|
|
4
|
-
exports.RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
|
|
5
|
-
exports.TYPE_REGISTRATION = "http://www.w3.org/ns/solid/terms#TypeRegistration";
|
|
6
|
-
exports.FOR_CLASS = "http://www.w3.org/ns/solid/terms#forClass";
|
|
7
|
-
exports.INSTANCE = "http://www.w3.org/ns/solid/terms#instance";
|
|
8
|
-
exports.INSTANCE_CONTAINER = "http://www.w3.org/ns/solid/terms#instanceContainer";
|
|
9
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,iDAAiD,CAAC;AAC7D,QAAA,iBAAiB,GAC5B,mDAAmD,CAAC;AACzC,QAAA,SAAS,GAAG,2CAA2C,CAAC;AACxD,QAAA,QAAQ,GAAG,2CAA2C,CAAC;AACvD,QAAA,kBAAkB,GAC7B,oDAAoD,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTypeRegistrations = getTypeRegistrations;
|
|
4
|
-
exports.getProfile = getProfile;
|
|
5
|
-
exports.getTypeIndexesUrisFromProfile = getTypeIndexesUrisFromProfile;
|
|
6
|
-
exports.getInstanceUris = getInstanceUris;
|
|
7
|
-
const profile_shapeTypes_js_1 = require("./.ldo/profile.shapeTypes.js");
|
|
8
|
-
const typeIndex_shapeTypes_js_1 = require("./.ldo/typeIndex.shapeTypes.js");
|
|
9
|
-
const constants_js_1 = require("./constants.js");
|
|
10
|
-
const Options_js_1 = require("./util/Options.js");
|
|
11
|
-
async function getTypeRegistrations(webId, options) {
|
|
12
|
-
const { dataset } = (0, Options_js_1.guaranteeOptions)(options);
|
|
13
|
-
// Get Profile
|
|
14
|
-
const profile = await getProfile(webId, options);
|
|
15
|
-
// Get Type Indexes
|
|
16
|
-
const typeIndexUris = getTypeIndexesUrisFromProfile(profile);
|
|
17
|
-
// Fetch the type Indexes
|
|
18
|
-
await Promise.all(typeIndexUris.map(async (typeIndexUri) => {
|
|
19
|
-
const typeIndexResource = dataset.getResource(typeIndexUri);
|
|
20
|
-
const readResult = await typeIndexResource.readIfUnfetched();
|
|
21
|
-
if (readResult.isError)
|
|
22
|
-
throw readResult;
|
|
23
|
-
}));
|
|
24
|
-
// Get Type Registrations
|
|
25
|
-
return dataset
|
|
26
|
-
.usingType(typeIndex_shapeTypes_js_1.TypeRegistrationShapeType)
|
|
27
|
-
.matchSubject(constants_js_1.RDF_TYPE, constants_js_1.TYPE_REGISTRATION);
|
|
28
|
-
}
|
|
29
|
-
async function getProfile(webId, options) {
|
|
30
|
-
const { dataset } = (0, Options_js_1.guaranteeOptions)(options);
|
|
31
|
-
const profileResource = dataset.getResource(webId);
|
|
32
|
-
const readResult = await profileResource.readIfUnfetched();
|
|
33
|
-
if (readResult.isError)
|
|
34
|
-
throw readResult;
|
|
35
|
-
return dataset.usingType(profile_shapeTypes_js_1.TypeIndexProfileShapeType).fromSubject(webId);
|
|
36
|
-
}
|
|
37
|
-
function getTypeIndexesUrisFromProfile(profile) {
|
|
38
|
-
const uris = [];
|
|
39
|
-
profile.privateTypeIndex?.forEach((indexNode) => {
|
|
40
|
-
uris.push(indexNode["@id"]);
|
|
41
|
-
});
|
|
42
|
-
profile.publicTypeIndex?.forEach((indexNode) => {
|
|
43
|
-
uris.push(indexNode["@id"]);
|
|
44
|
-
});
|
|
45
|
-
return uris;
|
|
46
|
-
}
|
|
47
|
-
async function getInstanceUris(classUri, typeRegistrations, options) {
|
|
48
|
-
const { dataset } = (0, Options_js_1.guaranteeOptions)(options);
|
|
49
|
-
const leafUris = new Set();
|
|
50
|
-
await Promise.all(typeRegistrations.map(async (registration) => {
|
|
51
|
-
if (registration.forClass["@id"] === classUri) {
|
|
52
|
-
// Individual registrations
|
|
53
|
-
registration.instance?.forEach((instance) => leafUris.add(instance["@id"]));
|
|
54
|
-
// Container registrations
|
|
55
|
-
await Promise.all(registration.instanceContainer?.map(async (instanceContainer) => {
|
|
56
|
-
const containerResource = dataset.getResource(instanceContainer["@id"]);
|
|
57
|
-
await containerResource.readIfUnfetched();
|
|
58
|
-
containerResource.children().forEach((child) => {
|
|
59
|
-
if (child.type === "SolidLeaf")
|
|
60
|
-
leafUris.add(child.uri);
|
|
61
|
-
});
|
|
62
|
-
}) ?? []);
|
|
63
|
-
}
|
|
64
|
-
}));
|
|
65
|
-
return Array.from(leafUris);
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=getTypeIndex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTypeIndex.js","sourceRoot":"","sources":["../../src/getTypeIndex.ts"],"names":[],"mappings":"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"}
|
package/dist/cjs/index.cjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./getTypeIndex.js"), exports);
|
|
18
|
-
__exportStar(require("./setTypeIndex.js"), exports);
|
|
19
|
-
__exportStar(require("./react/useInstanceUris.js"), exports);
|
|
20
|
-
__exportStar(require("./react/useTypeIndexProfile.js"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,6DAA2C;AAC3C,iEAA+C"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useInstanceUris = useInstanceUris;
|
|
4
|
-
const useTypeIndexProfile_js_1 = require("./useTypeIndexProfile.js");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const useSubscribeToUris_js_1 = require("./util/useSubscribeToUris.js");
|
|
7
|
-
const solid_react_1 = require("@ldo/solid-react");
|
|
8
|
-
const typeIndex_shapeTypes_js_1 = require("../.ldo/typeIndex.shapeTypes.js");
|
|
9
|
-
const constants_js_1 = require("../constants.js");
|
|
10
|
-
const getTypeIndex_js_1 = require("../getTypeIndex.js");
|
|
11
|
-
/**
|
|
12
|
-
* Provides the LeafUris of everything in a type node for a specific class uri
|
|
13
|
-
*
|
|
14
|
-
* @param classUri - the class uri
|
|
15
|
-
* @returns - URIs of all resources registered with this node
|
|
16
|
-
*/
|
|
17
|
-
function useInstanceUris(classUri) {
|
|
18
|
-
const { dataset } = (0, solid_react_1.useLdo)();
|
|
19
|
-
const profile = (0, useTypeIndexProfile_js_1.useTypeIndexProfile)();
|
|
20
|
-
const typeIndexUris = (0, react_1.useMemo)(() => (profile ? (0, getTypeIndex_js_1.getTypeIndexesUrisFromProfile)(profile) : []), [profile]);
|
|
21
|
-
(0, useSubscribeToUris_js_1.useSubscribeToUris)(typeIndexUris);
|
|
22
|
-
const [leafUris, setLeafUris] = (0, react_1.useState)([]);
|
|
23
|
-
const typeRegistrations = (0, solid_react_1.useMatchSubject)(typeIndex_shapeTypes_js_1.TypeRegistrationShapeType, constants_js_1.RDF_TYPE, constants_js_1.TYPE_REGISTRATION);
|
|
24
|
-
(0, react_1.useEffect)(() => {
|
|
25
|
-
(0, getTypeIndex_js_1.getInstanceUris)(classUri, typeRegistrations.toArray(), {
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27
|
-
// @ts-ignore TODO: come back and see if we can fix this
|
|
28
|
-
solidLdoDataset: dataset,
|
|
29
|
-
}).then(setLeafUris);
|
|
30
|
-
}, [typeRegistrations]);
|
|
31
|
-
return leafUris;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=useInstanceUris.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInstanceUris.js","sourceRoot":"","sources":["../../../src/react/useInstanceUris.ts"],"names":[],"mappings":";;AAkBA,0CA4BC;AA9CD,qEAA+D;AAC/D,iCAAqD;AACrD,wEAAkE;AAClE,kDAA2D;AAC3D,6EAA4E;AAC5E,kDAA8D;AAC9D,wDAG4B;AAG5B;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,QAAgB;IAC9C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,oBAAM,GAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,IAAA,4CAAmB,GAAE,CAAC;IAEtC,MAAM,aAAa,GAAa,IAAA,eAAO,EACrC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,+CAA6B,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAC7D,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,IAAA,0CAAkB,EAAC,aAAa,CAAC,CAAC;IAElC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAiB,EAAE,CAAC,CAAC;IAE7D,MAAM,iBAAiB,GAAG,IAAA,6BAAe,EACvC,mDAAyB,EACzB,uBAAQ,EACR,gCAAiB,CAClB,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAA,iCAAe,EAAC,QAAQ,EAAE,iBAAiB,CAAC,OAAO,EAAE,EAAE;YACrD,6DAA6D;YAC7D,wDAAwD;YACxD,eAAe,EAAE,OAAO;SACzB,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTypeIndexProfile = useTypeIndexProfile;
|
|
4
|
-
const solid_react_1 = require("@ldo/solid-react");
|
|
5
|
-
const profile_shapeTypes_js_1 = require("../.ldo/profile.shapeTypes.js");
|
|
6
|
-
function useTypeIndexProfile() {
|
|
7
|
-
const { session } = (0, solid_react_1.useSolidAuth)();
|
|
8
|
-
(0, solid_react_1.useResource)(session.webId, { subscribe: true });
|
|
9
|
-
const profile = (0, solid_react_1.useSubject)(profile_shapeTypes_js_1.TypeIndexProfileShapeType, session.webId);
|
|
10
|
-
return profile;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=useTypeIndexProfile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTypeIndexProfile.js","sourceRoot":"","sources":["../../../src/react/useTypeIndexProfile.ts"],"names":[],"mappings":";;AAIA,kDAKC;AATD,kDAAyE;AAEzE,yEAA0E;AAE1E,SAAgB,mBAAmB;IACjC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,0BAAY,GAAE,CAAC;IACnC,IAAA,yBAAW,EAAC,OAAO,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,IAAA,wBAAU,EAAC,iDAAyB,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACrE,OAAO,OAAO,CAAC;AACjB,CAAC"}
|