@ldo/solid-type-index 1.0.0-alpha.1 → 1.0.0-alpha.12
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 → cjs/.ldo}/profile.context.js +5 -0
- package/dist/cjs/.ldo/profile.context.js.map +1 -0
- package/dist/{.ldo → cjs/.ldo}/profile.schema.js +5 -0
- package/dist/cjs/.ldo/profile.schema.js.map +1 -0
- package/dist/cjs/.ldo/profile.shapeTypes.js +19 -0
- package/dist/cjs/.ldo/profile.shapeTypes.js.map +1 -0
- package/dist/cjs/.ldo/profile.typings.js.map +1 -0
- package/dist/{.ldo → cjs/.ldo}/typeIndex.context.js +5 -0
- package/dist/cjs/.ldo/typeIndex.context.js.map +1 -0
- package/dist/{.ldo → cjs/.ldo}/typeIndex.schema.js +5 -0
- package/dist/cjs/.ldo/typeIndex.schema.js.map +1 -0
- package/dist/cjs/.ldo/typeIndex.shapeTypes.js +27 -0
- package/dist/cjs/.ldo/typeIndex.shapeTypes.js.map +1 -0
- package/dist/cjs/.ldo/typeIndex.typings.js.map +1 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/{getTypeIndex.js → cjs/getTypeIndex.js} +21 -16
- package/dist/cjs/getTypeIndex.js.map +1 -0
- package/dist/{index.js → cjs/index.js} +4 -4
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/react/useInstanceUris.js +33 -0
- package/dist/cjs/react/useInstanceUris.js.map +1 -0
- package/dist/{react → cjs/react}/useTypeIndexProfile.js +3 -4
- package/dist/cjs/react/useTypeIndexProfile.js.map +1 -0
- package/dist/{react → cjs/react}/util/useSubscribeToUris.js +4 -2
- package/dist/cjs/react/util/useSubscribeToUris.js.map +1 -0
- package/dist/{setTypeIndex.js → cjs/setTypeIndex.js} +63 -22
- package/dist/cjs/setTypeIndex.js.map +1 -0
- package/dist/cjs/util/Options.js +12 -0
- package/dist/cjs/util/Options.js.map +1 -0
- package/dist/esm/.ldo/profile.context.js +18 -0
- package/dist/esm/.ldo/profile.context.js.map +1 -0
- package/dist/esm/.ldo/profile.schema.js +61 -0
- package/dist/esm/.ldo/profile.schema.js.map +1 -0
- package/dist/esm/.ldo/profile.shapeTypes.js +16 -0
- package/dist/esm/.ldo/profile.shapeTypes.js.map +1 -0
- package/dist/esm/.ldo/profile.typings.js +2 -0
- package/dist/esm/.ldo/profile.typings.js.map +1 -0
- package/dist/esm/.ldo/typeIndex.context.js +63 -0
- package/dist/esm/.ldo/typeIndex.context.js.map +1 -0
- package/dist/esm/.ldo/typeIndex.schema.js +143 -0
- package/dist/esm/.ldo/typeIndex.schema.js.map +1 -0
- package/dist/esm/.ldo/typeIndex.shapeTypes.js +24 -0
- package/dist/esm/.ldo/typeIndex.shapeTypes.js.map +1 -0
- package/dist/esm/.ldo/typeIndex.typings.js +2 -0
- package/dist/esm/.ldo/typeIndex.typings.js.map +1 -0
- package/dist/esm/constants.js +6 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/getTypeIndex.js +61 -0
- package/dist/esm/getTypeIndex.js.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/react/useInstanceUris.js +30 -0
- package/dist/esm/react/useInstanceUris.js.map +1 -0
- package/dist/esm/react/useTypeIndexProfile.js +9 -0
- package/dist/esm/react/useTypeIndexProfile.js.map +1 -0
- package/dist/esm/react/util/useSubscribeToUris.js +30 -0
- package/dist/esm/react/util/useSubscribeToUris.js.map +1 -0
- package/dist/esm/setTypeIndex.js +156 -0
- package/dist/esm/setTypeIndex.js.map +1 -0
- package/dist/esm/util/Options.js +9 -0
- package/dist/esm/util/Options.js.map +1 -0
- package/dist/types/.ldo/profile.context.d.ts +8 -0
- package/dist/types/.ldo/profile.context.d.ts.map +1 -0
- package/dist/types/.ldo/profile.schema.d.ts +8 -0
- package/dist/types/.ldo/profile.schema.d.ts.map +1 -0
- package/dist/types/.ldo/profile.shapeTypes.d.ts +12 -0
- package/dist/types/.ldo/profile.shapeTypes.d.ts.map +1 -0
- package/dist/types/.ldo/profile.typings.d.ts +26 -0
- package/dist/types/.ldo/profile.typings.d.ts.map +1 -0
- package/dist/types/.ldo/typeIndex.context.d.ts +8 -0
- package/dist/types/.ldo/typeIndex.context.d.ts.map +1 -0
- package/dist/types/.ldo/typeIndex.schema.d.ts +8 -0
- package/dist/types/.ldo/typeIndex.schema.d.ts.map +1 -0
- package/dist/types/.ldo/typeIndex.shapeTypes.d.ts +16 -0
- package/dist/types/.ldo/typeIndex.shapeTypes.d.ts.map +1 -0
- package/dist/types/.ldo/typeIndex.typings.d.ts +53 -0
- package/dist/types/.ldo/typeIndex.typings.d.ts.map +1 -0
- package/dist/{constants.d.ts → types/constants.d.ts} +1 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/getTypeIndex.d.ts +10 -0
- package/dist/types/getTypeIndex.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/react/useInstanceUris.d.ts +9 -0
- package/dist/types/react/useInstanceUris.d.ts.map +1 -0
- package/dist/types/react/useTypeIndexProfile.d.ts +3 -0
- package/dist/types/react/useTypeIndexProfile.d.ts.map +1 -0
- package/dist/{react → types/react}/util/useSubscribeToUris.d.ts +1 -0
- package/dist/types/react/util/useSubscribeToUris.d.ts.map +1 -0
- package/dist/types/setTypeIndex.d.ts +53 -0
- package/dist/types/setTypeIndex.d.ts.map +1 -0
- package/dist/types/util/Options.d.ts +11 -0
- package/dist/types/util/Options.d.ts.map +1 -0
- package/package.json +28 -21
- package/src/.ldo/profile.shapeTypes.ts +3 -3
- package/src/.ldo/typeIndex.shapeTypes.ts +3 -3
- package/src/getTypeIndex.ts +17 -17
- package/src/index.ts +4 -4
- package/src/react/useInstanceUris.ts +10 -8
- package/src/react/useTypeIndexProfile.ts +2 -2
- package/src/setTypeIndex.ts +25 -15
- package/src/util/Options.ts +8 -5
- package/dist/.ldo/profile.context.d.ts +0 -2
- package/dist/.ldo/profile.context.js.map +0 -1
- package/dist/.ldo/profile.schema.d.ts +0 -2
- package/dist/.ldo/profile.schema.js.map +0 -1
- package/dist/.ldo/profile.shapeTypes.d.ts +0 -3
- package/dist/.ldo/profile.shapeTypes.js +0 -11
- package/dist/.ldo/profile.shapeTypes.js.map +0 -1
- package/dist/.ldo/profile.typings.d.ts +0 -11
- package/dist/.ldo/profile.typings.js.map +0 -1
- package/dist/.ldo/typeIndex.context.d.ts +0 -2
- package/dist/.ldo/typeIndex.context.js.map +0 -1
- package/dist/.ldo/typeIndex.schema.d.ts +0 -2
- package/dist/.ldo/typeIndex.schema.js.map +0 -1
- package/dist/.ldo/typeIndex.shapeTypes.d.ts +0 -4
- package/dist/.ldo/typeIndex.shapeTypes.js +0 -16
- package/dist/.ldo/typeIndex.shapeTypes.js.map +0 -1
- package/dist/.ldo/typeIndex.typings.d.ts +0 -26
- package/dist/.ldo/typeIndex.typings.js.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/getTypeIndex.d.ts +0 -9
- package/dist/getTypeIndex.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js.map +0 -1
- package/dist/react/useInstanceUris.d.ts +0 -2
- package/dist/react/useInstanceUris.js +0 -26
- package/dist/react/useInstanceUris.js.map +0 -1
- package/dist/react/useTypeIndexProfile.d.ts +0 -2
- package/dist/react/useTypeIndexProfile.js.map +0 -1
- package/dist/react/util/useSubscribeToUris.js.map +0 -1
- package/dist/setTypeIndex.d.ts +0 -14
- package/dist/setTypeIndex.js.map +0 -1
- package/dist/util/Options.d.ts +0 -9
- package/dist/util/Options.js +0 -12
- package/dist/util/Options.js.map +0 -1
- /package/dist/{.ldo → cjs/.ldo}/profile.typings.js +0 -0
- /package/dist/{.ldo → cjs/.ldo}/typeIndex.typings.js +0 -0
- /package/dist/{constants.js → cjs/constants.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LdoJsonldContext } from "@ldo/ldo";
|
|
2
|
+
/**
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* profileContext: JSONLD Context for profile
|
|
5
|
+
* =============================================================================
|
|
6
|
+
*/
|
|
7
|
+
export declare const profileContext: LdoJsonldContext;
|
|
8
|
+
//# sourceMappingURL=profile.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.context.d.ts","sourceRoot":"","sources":["../../../src/.ldo/profile.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,gBAW5B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "shexj";
|
|
2
|
+
/**
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* profileSchema: ShexJ Schema for profile
|
|
5
|
+
* =============================================================================
|
|
6
|
+
*/
|
|
7
|
+
export declare const profileSchema: Schema;
|
|
8
|
+
//# sourceMappingURL=profile.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.schema.d.ts","sourceRoot":"","sources":["../../../src/.ldo/profile.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAwD3B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ShapeType } from "@ldo/ldo";
|
|
2
|
+
import { TypeIndexProfile } from "./profile.typings.js";
|
|
3
|
+
/**
|
|
4
|
+
* =============================================================================
|
|
5
|
+
* LDO ShapeTypes profile
|
|
6
|
+
* =============================================================================
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* TypeIndexProfile ShapeType
|
|
10
|
+
*/
|
|
11
|
+
export declare const TypeIndexProfileShapeType: ShapeType<TypeIndexProfile>;
|
|
12
|
+
//# sourceMappingURL=profile.shapeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.shapeTypes.d.ts","sourceRoot":"","sources":["../../../src/.ldo/profile.shapeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,CAAC,gBAAgB,CAIjE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LdoJsonldContext, LdSet } from "@ldo/ldo";
|
|
2
|
+
/**
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* Typescript Typings for profile
|
|
5
|
+
* =============================================================================
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* TypeIndexProfile Type
|
|
9
|
+
*/
|
|
10
|
+
export interface TypeIndexProfile {
|
|
11
|
+
"@id"?: string;
|
|
12
|
+
"@context"?: LdoJsonldContext;
|
|
13
|
+
/**
|
|
14
|
+
* A registry of all types used on the user's Pod (for private access only)
|
|
15
|
+
*/
|
|
16
|
+
privateTypeIndex?: LdSet<{
|
|
17
|
+
"@id": string;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* A registry of all types used on the user's Pod (for public access)
|
|
21
|
+
*/
|
|
22
|
+
publicTypeIndex?: LdSet<{
|
|
23
|
+
"@id": string;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=profile.typings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.typings.d.ts","sourceRoot":"","sources":["../../../src/.ldo/profile.typings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;IACH;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC;QACtB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LdoJsonldContext } from "@ldo/ldo";
|
|
2
|
+
/**
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* typeIndexContext: JSONLD Context for typeIndex
|
|
5
|
+
* =============================================================================
|
|
6
|
+
*/
|
|
7
|
+
export declare const typeIndexContext: LdoJsonldContext;
|
|
8
|
+
//# sourceMappingURL=typeIndex.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeIndex.context.d.ts","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAwD9B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "shexj";
|
|
2
|
+
/**
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* typeIndexSchema: ShexJ Schema for typeIndex
|
|
5
|
+
* =============================================================================
|
|
6
|
+
*/
|
|
7
|
+
export declare const typeIndexSchema: Schema;
|
|
8
|
+
//# sourceMappingURL=typeIndex.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeIndex.schema.d.ts","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAwI7B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ShapeType } from "@ldo/ldo";
|
|
2
|
+
import { TypeIndexDocument, TypeRegistration } from "./typeIndex.typings.js";
|
|
3
|
+
/**
|
|
4
|
+
* =============================================================================
|
|
5
|
+
* LDO ShapeTypes typeIndex
|
|
6
|
+
* =============================================================================
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* TypeIndexDocument ShapeType
|
|
10
|
+
*/
|
|
11
|
+
export declare const TypeIndexDocumentShapeType: ShapeType<TypeIndexDocument>;
|
|
12
|
+
/**
|
|
13
|
+
* TypeRegistration ShapeType
|
|
14
|
+
*/
|
|
15
|
+
export declare const TypeRegistrationShapeType: ShapeType<TypeRegistration>;
|
|
16
|
+
//# sourceMappingURL=typeIndex.shapeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeIndex.shapeTypes.d.ts","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.shapeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,CAAC,iBAAiB,CAInE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,CAAC,gBAAgB,CAIjE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { LdoJsonldContext, LdSet } from "@ldo/ldo";
|
|
2
|
+
/**
|
|
3
|
+
* =============================================================================
|
|
4
|
+
* Typescript Typings for typeIndex
|
|
5
|
+
* =============================================================================
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* TypeIndexDocument Type
|
|
9
|
+
*/
|
|
10
|
+
export interface TypeIndexDocument {
|
|
11
|
+
"@id"?: string;
|
|
12
|
+
"@context"?: LdoJsonldContext;
|
|
13
|
+
/**
|
|
14
|
+
* Defines the node as a TypeIndex | Defines the node as a Listed Document
|
|
15
|
+
*/
|
|
16
|
+
type: LdSet<{
|
|
17
|
+
"@id": "TypeIndex";
|
|
18
|
+
} | {
|
|
19
|
+
"@id": "ListedDocument";
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* TypeRegistration Type
|
|
24
|
+
*/
|
|
25
|
+
export interface TypeRegistration {
|
|
26
|
+
"@id"?: string;
|
|
27
|
+
"@context"?: LdoJsonldContext;
|
|
28
|
+
/**
|
|
29
|
+
* Defines this node as a Type Registration
|
|
30
|
+
*/
|
|
31
|
+
type: {
|
|
32
|
+
"@id": "TypeRegistration";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The class of object at this type.
|
|
36
|
+
*/
|
|
37
|
+
forClass: {
|
|
38
|
+
"@id": string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A specific resource that contains the class.
|
|
42
|
+
*/
|
|
43
|
+
instance?: LdSet<{
|
|
44
|
+
"@id": string;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Containers that contain resources with the class.
|
|
48
|
+
*/
|
|
49
|
+
instanceContainer?: LdSet<{
|
|
50
|
+
"@id": string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=typeIndex.typings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeIndex.typings.d.ts","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.typings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;OAEG;IACH,IAAI,EAAE,KAAK,CACP;QACE,KAAK,EAAE,WAAW,CAAC;KACpB,GACD;QACE,KAAK,EAAE,gBAAgB,CAAC;KACzB,CACJ,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;OAEG;IACH,IAAI,EAAE;QACJ,KAAK,EAAE,kBAAkB,CAAC;KAC3B,CAAC;IACF;;OAEG;IACH,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;IACH;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC;QACxB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ"}
|
|
@@ -3,3 +3,4 @@ export declare const TYPE_REGISTRATION = "http://www.w3.org/ns/solid/terms#TypeR
|
|
|
3
3
|
export declare const FOR_CLASS = "http://www.w3.org/ns/solid/terms#forClass";
|
|
4
4
|
export declare const INSTANCE = "http://www.w3.org/ns/solid/terms#instance";
|
|
5
5
|
export declare const INSTANCE_CONTAINER = "http://www.w3.org/ns/solid/terms#instanceContainer";
|
|
6
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,oDAAoD,CAAC;AAC1E,eAAO,MAAM,iBAAiB,sDACuB,CAAC;AACtD,eAAO,MAAM,SAAS,8CAA8C,CAAC;AACrE,eAAO,MAAM,QAAQ,8CAA8C,CAAC;AACpE,eAAO,MAAM,kBAAkB,uDACuB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TypeRegistration } from "./.ldo/typeIndex.typings.js";
|
|
2
|
+
import type { TypeIndexProfile } from "./.ldo/profile.typings.js";
|
|
3
|
+
import type { Options } from "./util/Options.js";
|
|
4
|
+
import type { LdSet } from "@ldo/ldo";
|
|
5
|
+
import type { SolidLeafUri } from "@ldo/connected-solid";
|
|
6
|
+
export declare function getTypeRegistrations(webId: string, options?: Options): Promise<LdSet<TypeRegistration>>;
|
|
7
|
+
export declare function getProfile(webId: string, options?: Options): Promise<TypeIndexProfile>;
|
|
8
|
+
export declare function getTypeIndexesUrisFromProfile(profile: TypeIndexProfile): SolidLeafUri[];
|
|
9
|
+
export declare function getInstanceUris(classUri: string, typeRegistrations: TypeRegistration[], options?: Options): Promise<SolidLeafUri[]>;
|
|
10
|
+
//# sourceMappingURL=getTypeIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTypeIndex.d.ts","sourceRoot":"","sources":["../../src/getTypeIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIlE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAqB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE5E,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAsBlC;AAED,wBAAsB,UAAU,CAC9B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,gBAAgB,GACxB,YAAY,EAAE,CAShB;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,YAAY,EAAE,CAAC,CA2BzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SolidLeafUri } from "@ldo/connected-solid";
|
|
2
|
+
/**
|
|
3
|
+
* Provides the LeafUris of everything in a type node for a specific class uri
|
|
4
|
+
*
|
|
5
|
+
* @param classUri - the class uri
|
|
6
|
+
* @returns - URIs of all resources registered with this node
|
|
7
|
+
*/
|
|
8
|
+
export declare function useInstanceUris(classUri: string): SolidLeafUri[];
|
|
9
|
+
//# sourceMappingURL=useInstanceUris.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInstanceUris.d.ts","sourceRoot":"","sources":["../../../src/react/useInstanceUris.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE,CA4BhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTypeIndexProfile.d.ts","sourceRoot":"","sources":["../../../src/react/useTypeIndexProfile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,SAAS,CAKlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubscribeToUris.d.ts","sourceRoot":"","sources":["../../../../src/react/util/useSubscribeToUris.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QA+BhD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Options } from "./util/Options.js";
|
|
2
|
+
import type { TypeRegistration } from "./.ldo/typeIndex.typings.js";
|
|
3
|
+
import type { SolidConnectedPlugin, SolidContainer } from "@ldo/connected-solid";
|
|
4
|
+
import type { ConnectedLdoDataset, ConnectedPlugin } from "@ldo/connected";
|
|
5
|
+
/**
|
|
6
|
+
* =============================================================================
|
|
7
|
+
* INITIALIZERS
|
|
8
|
+
* =============================================================================
|
|
9
|
+
*/
|
|
10
|
+
export declare function initTypeIndex(webId: string, options?: Options): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
* @param webId
|
|
14
|
+
* @param profileFolder
|
|
15
|
+
* @param dataset
|
|
16
|
+
*/
|
|
17
|
+
export declare function createIndex(webId: any, profileFolder: SolidContainer, dataset: ConnectedLdoDataset<(SolidConnectedPlugin | ConnectedPlugin<any, any, any, any>)[]>, isPrivate: boolean): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* =============================================================================
|
|
20
|
+
* DATASET MODIFIERS
|
|
21
|
+
* =============================================================================
|
|
22
|
+
*/
|
|
23
|
+
interface Instances {
|
|
24
|
+
instance?: string[];
|
|
25
|
+
instanceContainer?: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Adds an instance to a TypeRegistration
|
|
29
|
+
* @param indexUri The URI of the TypeIndex
|
|
30
|
+
* @param classUri The URI for the class the instance should be added to
|
|
31
|
+
* @param instances Objects representing the instances to add
|
|
32
|
+
* @param options Options
|
|
33
|
+
*/
|
|
34
|
+
export declare function addRegistration(indexUri: string, classUri: string, instances: Instances, options?: Options): void;
|
|
35
|
+
/**
|
|
36
|
+
* Removes instances from a TypeRegistration
|
|
37
|
+
* @param indexUri The URI of the TypeIndex
|
|
38
|
+
* @param classUri The URI for the class the instance should be removed from
|
|
39
|
+
* @param instances Objects representing the instances to remove
|
|
40
|
+
* @param options Options
|
|
41
|
+
*/
|
|
42
|
+
export declare function removeRegistration(indexUri: string, classUri: string, instances: Instances, options?: Options): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Finds a TypeRegistration inside of a type index. If it doesn't exist, it
|
|
45
|
+
* creates one.
|
|
46
|
+
* @param indexUri The URI of the typeIndex
|
|
47
|
+
* @param classUri The URI of the class in question for the TypeRegistration
|
|
48
|
+
* @param options
|
|
49
|
+
* @returns The Type Index
|
|
50
|
+
*/
|
|
51
|
+
export declare function findAppropriateTypeRegistration(indexUri: string, classUri: string, options?: Options): TypeRegistration;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=setTypeIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setTypeIndex.d.ts","sourceRoot":"","sources":["../../src/setTypeIndex.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAKpE,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EAGf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAM3E;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,KAAK,KAAA,EACL,aAAa,EAAE,cAAc,EAC7B,OAAO,EAAE,mBAAmB,CAC1B,CAAC,oBAAoB,GAAG,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAC/D,EACD,SAAS,EAAE,OAAO,iBA4CnB;AAED;;;;GAIG;AACH,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,OAAO,GAChB,IAAI,CAeN;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,OAAO,iBAgBlB;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,OAAO,GAChB,gBAAgB,CAyClB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConnectedLdoDataset, IConnectedLdoDataset } from "@ldo/connected";
|
|
2
|
+
import type { SolidConnectedPlugin } from "@ldo/connected-solid";
|
|
3
|
+
export interface Options {
|
|
4
|
+
solidLdoDataset?: IConnectedLdoDataset<SolidConnectedPlugin[]>;
|
|
5
|
+
fetch?: typeof fetch;
|
|
6
|
+
}
|
|
7
|
+
export declare function guaranteeOptions(options?: Options): {
|
|
8
|
+
fetch: typeof globalThis.fetch;
|
|
9
|
+
dataset: ConnectedLdoDataset<SolidConnectedPlugin[]>;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=Options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../../src/util/Options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE,MAAM,WAAW,OAAO;IACtB,eAAe,CAAC,EAAE,oBAAoB,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC/D,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,OAAO;;;EAMjD"}
|
package/package.json
CHANGED
|
@@ -1,43 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldo/solid-type-index",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.12",
|
|
4
4
|
"description": "Solid Type Index support for LDO",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/cjs/index.js",
|
|
7
|
+
"module": "./dist/esm/index.js",
|
|
8
|
+
"types": "./dist/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"import": "./dist/esm/index.js",
|
|
13
|
+
"require": "./dist/cjs/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
6
17
|
"scripts": {
|
|
7
|
-
"build": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"test
|
|
11
|
-
"prepublishOnly": "
|
|
18
|
+
"build": "rimraf dist && npm run build:cjs && npm run build:esm",
|
|
19
|
+
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
20
|
+
"build:esm": "tsc --project tsconfig.esm.json",
|
|
21
|
+
"test": "vitest run --coverage",
|
|
22
|
+
"prepublishOnly": " npm run build",
|
|
12
23
|
"build:ldo": "ldo build --input src/.shapes --output src/.ldo",
|
|
13
|
-
"lint": "eslint src/** --fix --no-error-on-unmatched-pattern"
|
|
14
|
-
"test:integration": "start-server-and-test start-test-server http://localhost:3003 start-integration-test",
|
|
15
|
-
"start-test-server": "ts-node ./test/test-server/runServer.ts",
|
|
16
|
-
"start-integration-test": "jest --coverage"
|
|
24
|
+
"lint": "eslint src/** --fix --no-error-on-unmatched-pattern"
|
|
17
25
|
},
|
|
18
26
|
"repository": {
|
|
19
27
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/o-development/
|
|
28
|
+
"url": "git+https://github.com/o-development/ldo.git"
|
|
21
29
|
},
|
|
22
30
|
"author": "Jackson Morgan",
|
|
23
31
|
"license": "MIT",
|
|
24
32
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/o-development/
|
|
33
|
+
"url": "https://github.com/o-development/ldo/issues"
|
|
26
34
|
},
|
|
27
|
-
"homepage": "https://github.com/o-development/
|
|
35
|
+
"homepage": "https://github.com/o-development/ldo/tree/main/packages/solid-react#readme",
|
|
28
36
|
"devDependencies": {
|
|
29
|
-
"@ldo/rdf-utils": "^1.0.0-alpha.
|
|
37
|
+
"@ldo/rdf-utils": "^1.0.0-alpha.11",
|
|
38
|
+
"@ldo/test-solid-server": "^1.0.0-alpha.12",
|
|
30
39
|
"@rdfjs/types": "^1.0.1",
|
|
31
40
|
"@testing-library/react": "^14.1.2",
|
|
32
|
-
"
|
|
33
|
-
"jest-environment-jsdom": "^27.0.0",
|
|
41
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
34
42
|
"start-server-and-test": "^2.0.3",
|
|
35
|
-
"ts-jest": "^27.1.2",
|
|
36
43
|
"ts-node": "^10.9.2"
|
|
37
44
|
},
|
|
38
45
|
"dependencies": {
|
|
39
|
-
"@ldo/solid": "^1.0.0-alpha.
|
|
40
|
-
"@ldo/solid-react": "^1.0.0-alpha.
|
|
46
|
+
"@ldo/connected-solid": "^1.0.0-alpha.12",
|
|
47
|
+
"@ldo/solid-react": "^1.0.0-alpha.12"
|
|
41
48
|
},
|
|
42
49
|
"files": [
|
|
43
50
|
"dist",
|
|
@@ -46,5 +53,5 @@
|
|
|
46
53
|
"publishConfig": {
|
|
47
54
|
"access": "public"
|
|
48
55
|
},
|
|
49
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "f8ad3ba5f617c781254094923248c386348225b3"
|
|
50
57
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ShapeType } from "@ldo/ldo";
|
|
2
|
-
import { profileSchema } from "./profile.schema";
|
|
3
|
-
import { profileContext } from "./profile.context";
|
|
4
|
-
import { TypeIndexProfile } from "./profile.typings";
|
|
2
|
+
import { profileSchema } from "./profile.schema.js";
|
|
3
|
+
import { profileContext } from "./profile.context.js";
|
|
4
|
+
import { TypeIndexProfile } from "./profile.typings.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* =============================================================================
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ShapeType } from "@ldo/ldo";
|
|
2
|
-
import { typeIndexSchema } from "./typeIndex.schema";
|
|
3
|
-
import { typeIndexContext } from "./typeIndex.context";
|
|
4
|
-
import { TypeIndexDocument, TypeRegistration } from "./typeIndex.typings";
|
|
2
|
+
import { typeIndexSchema } from "./typeIndex.schema.js";
|
|
3
|
+
import { typeIndexContext } from "./typeIndex.context.js";
|
|
4
|
+
import { TypeIndexDocument, TypeRegistration } from "./typeIndex.typings.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* =============================================================================
|
package/src/getTypeIndex.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { guaranteeOptions } from "./util/Options";
|
|
1
|
+
import type { TypeRegistration } from "./.ldo/typeIndex.typings.js";
|
|
2
|
+
import type { TypeIndexProfile } from "./.ldo/profile.typings.js";
|
|
3
|
+
import { TypeIndexProfileShapeType } from "./.ldo/profile.shapeTypes.js";
|
|
4
|
+
import { TypeRegistrationShapeType } from "./.ldo/typeIndex.shapeTypes.js";
|
|
5
|
+
import { RDF_TYPE, TYPE_REGISTRATION } from "./constants.js";
|
|
6
|
+
import type { Options } from "./util/Options.js";
|
|
7
|
+
import { guaranteeOptions } from "./util/Options.js";
|
|
9
8
|
import type { LdSet } from "@ldo/ldo";
|
|
9
|
+
import type { SolidContainerUri, SolidLeafUri } from "@ldo/connected-solid";
|
|
10
10
|
|
|
11
11
|
export async function getTypeRegistrations(
|
|
12
12
|
webId: string,
|
|
@@ -48,13 +48,13 @@ export async function getProfile(
|
|
|
48
48
|
|
|
49
49
|
export function getTypeIndexesUrisFromProfile(
|
|
50
50
|
profile: TypeIndexProfile,
|
|
51
|
-
):
|
|
52
|
-
const uris:
|
|
51
|
+
): SolidLeafUri[] {
|
|
52
|
+
const uris: SolidLeafUri[] = [];
|
|
53
53
|
profile.privateTypeIndex?.forEach((indexNode) => {
|
|
54
|
-
uris.push(indexNode["@id"] as
|
|
54
|
+
uris.push(indexNode["@id"] as SolidLeafUri);
|
|
55
55
|
});
|
|
56
56
|
profile.publicTypeIndex?.forEach((indexNode) => {
|
|
57
|
-
uris.push(indexNode["@id"] as
|
|
57
|
+
uris.push(indexNode["@id"] as SolidLeafUri);
|
|
58
58
|
});
|
|
59
59
|
return uris;
|
|
60
60
|
}
|
|
@@ -63,26 +63,26 @@ export async function getInstanceUris(
|
|
|
63
63
|
classUri: string,
|
|
64
64
|
typeRegistrations: TypeRegistration[],
|
|
65
65
|
options?: Options,
|
|
66
|
-
): Promise<
|
|
66
|
+
): Promise<SolidLeafUri[]> {
|
|
67
67
|
const { dataset } = guaranteeOptions(options);
|
|
68
68
|
|
|
69
|
-
const leafUris = new Set<
|
|
69
|
+
const leafUris = new Set<SolidLeafUri>();
|
|
70
70
|
await Promise.all(
|
|
71
71
|
typeRegistrations.map(async (registration) => {
|
|
72
72
|
if (registration.forClass["@id"] === classUri) {
|
|
73
73
|
// Individual registrations
|
|
74
74
|
registration.instance?.forEach((instance) =>
|
|
75
|
-
leafUris.add(instance["@id"] as
|
|
75
|
+
leafUris.add(instance["@id"] as SolidLeafUri),
|
|
76
76
|
);
|
|
77
77
|
// Container registrations
|
|
78
78
|
await Promise.all(
|
|
79
79
|
registration.instanceContainer?.map(async (instanceContainer) => {
|
|
80
80
|
const containerResource = dataset.getResource(
|
|
81
|
-
instanceContainer["@id"] as
|
|
81
|
+
instanceContainer["@id"] as SolidContainerUri,
|
|
82
82
|
);
|
|
83
83
|
await containerResource.readIfUnfetched();
|
|
84
84
|
containerResource.children().forEach((child) => {
|
|
85
|
-
if (child.type === "
|
|
85
|
+
if (child.type === "SolidLeaf") leafUris.add(child.uri);
|
|
86
86
|
});
|
|
87
87
|
}) ?? [],
|
|
88
88
|
);
|
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.js";
|
|
2
|
+
export * from "./setTypeIndex.js";
|
|
3
|
+
export * from "./react/useInstanceUris.js";
|
|
4
|
+
export * from "./react/useTypeIndexProfile.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useTypeIndexProfile } from "./useTypeIndexProfile";
|
|
1
|
+
import { useTypeIndexProfile } from "./useTypeIndexProfile.js";
|
|
3
2
|
import { useEffect, useMemo, useState } from "react";
|
|
4
|
-
import { useSubscribeToUris } from "./util/useSubscribeToUris";
|
|
3
|
+
import { useSubscribeToUris } from "./util/useSubscribeToUris.js";
|
|
5
4
|
import { useLdo, useMatchSubject } from "@ldo/solid-react";
|
|
6
|
-
import { TypeRegistrationShapeType } from "../.ldo/typeIndex.shapeTypes";
|
|
7
|
-
import { RDF_TYPE, TYPE_REGISTRATION } from "../constants";
|
|
5
|
+
import { TypeRegistrationShapeType } from "../.ldo/typeIndex.shapeTypes.js";
|
|
6
|
+
import { RDF_TYPE, TYPE_REGISTRATION } from "../constants.js";
|
|
8
7
|
import {
|
|
9
8
|
getInstanceUris,
|
|
10
9
|
getTypeIndexesUrisFromProfile,
|
|
11
|
-
} from "../getTypeIndex";
|
|
10
|
+
} from "../getTypeIndex.js";
|
|
11
|
+
import type { SolidLeafUri } from "@ldo/connected-solid";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Provides the LeafUris of everything in a type node for a specific class uri
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
* @param classUri - the class uri
|
|
17
17
|
* @returns - URIs of all resources registered with this node
|
|
18
18
|
*/
|
|
19
|
-
export function useInstanceUris(classUri: string):
|
|
19
|
+
export function useInstanceUris(classUri: string): SolidLeafUri[] {
|
|
20
20
|
const { dataset } = useLdo();
|
|
21
21
|
const profile = useTypeIndexProfile();
|
|
22
22
|
|
|
@@ -27,7 +27,7 @@ export function useInstanceUris(classUri: string): LeafUri[] {
|
|
|
27
27
|
|
|
28
28
|
useSubscribeToUris(typeIndexUris);
|
|
29
29
|
|
|
30
|
-
const [leafUris, setLeafUris] = useState<
|
|
30
|
+
const [leafUris, setLeafUris] = useState<SolidLeafUri[]>([]);
|
|
31
31
|
|
|
32
32
|
const typeRegistrations = useMatchSubject(
|
|
33
33
|
TypeRegistrationShapeType,
|
|
@@ -37,6 +37,8 @@ export function useInstanceUris(classUri: string): LeafUri[] {
|
|
|
37
37
|
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
getInstanceUris(classUri, typeRegistrations.toArray(), {
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
41
|
+
// @ts-ignore TODO: come back and see if we can fix this
|
|
40
42
|
solidLdoDataset: dataset,
|
|
41
43
|
}).then(setLeafUris);
|
|
42
44
|
}, [typeRegistrations]);
|
|
@@ -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.js";
|
|
3
|
+
import { TypeIndexProfileShapeType } from "../.ldo/profile.shapeTypes.js";
|
|
4
4
|
|
|
5
5
|
export function useTypeIndexProfile(): TypeIndexProfile | undefined {
|
|
6
6
|
const { session } = useSolidAuth();
|