@ldo/solid-type-index 1.0.0-alpha.50 → 1.0.0-alpha.53
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/README.md +2 -2
- package/dist/_ldo/{profile.context.mjs → profile.context.js} +1 -1
- package/dist/_ldo/profile.context.js.map +1 -0
- package/dist/_ldo/{profile.schema.mjs → profile.schema.js} +1 -1
- package/dist/_ldo/profile.schema.js.map +1 -0
- package/dist/_ldo/{profile.shapeTypes.mjs → profile.shapeTypes.js} +3 -3
- package/dist/_ldo/profile.shapeTypes.js.map +1 -0
- package/dist/_ldo/{profile.typings.d.cts → profile.typings.d.ts} +1 -1
- package/dist/_ldo/profile.typings.d.ts.map +1 -0
- package/dist/_ldo/{typeIndex.context.mjs → typeIndex.context.js} +1 -1
- package/dist/_ldo/typeIndex.context.js.map +1 -0
- package/dist/_ldo/{typeIndex.schema.mjs → typeIndex.schema.js} +1 -1
- package/dist/_ldo/typeIndex.schema.js.map +1 -0
- package/dist/_ldo/{typeIndex.shapeTypes.mjs → typeIndex.shapeTypes.js} +3 -3
- package/dist/_ldo/typeIndex.shapeTypes.js.map +1 -0
- package/dist/_ldo/{typeIndex.typings.d.cts → typeIndex.typings.d.ts} +1 -1
- package/dist/_ldo/typeIndex.typings.d.ts.map +1 -0
- package/dist/{constants.mjs → constants.js} +1 -1
- package/dist/constants.js.map +1 -0
- package/dist/{getTypeIndex.d.cts → getTypeIndex.d.ts} +5 -5
- package/dist/getTypeIndex.d.ts.map +1 -0
- package/dist/{getTypeIndex.mjs → getTypeIndex.js} +5 -5
- package/dist/getTypeIndex.js.map +1 -0
- package/dist/{index.d.cts → index.d.ts} +4 -4
- package/dist/{index.mjs → index.js} +4 -4
- package/dist/react/{useInstanceUris.d.mts → useInstanceUris.d.ts} +1 -1
- package/dist/react/useInstanceUris.d.ts.map +1 -0
- package/dist/react/{useInstanceUris.mjs → useInstanceUris.js} +6 -6
- package/dist/react/useInstanceUris.js.map +1 -0
- package/dist/react/{useTypeIndexProfile.d.cts → useTypeIndexProfile.d.ts} +2 -2
- package/dist/react/useTypeIndexProfile.d.ts.map +1 -0
- package/dist/react/{useTypeIndexProfile.mjs → useTypeIndexProfile.js} +2 -2
- package/dist/react/useTypeIndexProfile.js.map +1 -0
- package/dist/react/util/{useSubscribeToUris.mjs → useSubscribeToUris.js} +1 -1
- package/dist/react/util/useSubscribeToUris.js.map +1 -0
- package/dist/{setTypeIndex.d.mts → setTypeIndex.d.ts} +3 -3
- package/dist/setTypeIndex.d.ts.map +1 -0
- package/dist/{setTypeIndex.mjs → setTypeIndex.js} +6 -6
- package/dist/setTypeIndex.js.map +1 -0
- package/dist/util/{Options.d.mts → Options.d.ts} +1 -1
- package/dist/util/Options.d.ts.map +1 -0
- package/dist/util/{Options.mjs → Options.js} +1 -1
- package/dist/util/Options.js.map +1 -0
- package/package.json +15 -19
- package/dist/_ldo/profile.context.cjs +0 -20
- package/dist/_ldo/profile.context.mjs.map +0 -1
- package/dist/_ldo/profile.schema.cjs +0 -50
- package/dist/_ldo/profile.schema.mjs.map +0 -1
- package/dist/_ldo/profile.shapeTypes.cjs +0 -18
- package/dist/_ldo/profile.shapeTypes.mjs.map +0 -1
- package/dist/_ldo/profile.typings.d.cts.map +0 -1
- package/dist/_ldo/profile.typings.d.mts +0 -30
- package/dist/_ldo/profile.typings.d.mts.map +0 -1
- package/dist/_ldo/typeIndex.context.cjs +0 -53
- package/dist/_ldo/typeIndex.context.mjs.map +0 -1
- package/dist/_ldo/typeIndex.schema.cjs +0 -115
- package/dist/_ldo/typeIndex.schema.mjs.map +0 -1
- package/dist/_ldo/typeIndex.shapeTypes.cjs +0 -27
- package/dist/_ldo/typeIndex.shapeTypes.mjs.map +0 -1
- package/dist/_ldo/typeIndex.typings.d.cts.map +0 -1
- package/dist/_ldo/typeIndex.typings.d.mts +0 -37
- package/dist/_ldo/typeIndex.typings.d.mts.map +0 -1
- package/dist/constants.cjs +0 -8
- package/dist/constants.mjs.map +0 -1
- package/dist/getTypeIndex.cjs +0 -52
- package/dist/getTypeIndex.d.cts.map +0 -1
- package/dist/getTypeIndex.d.mts +0 -14
- package/dist/getTypeIndex.d.mts.map +0 -1
- package/dist/getTypeIndex.mjs.map +0 -1
- package/dist/index.cjs +0 -16
- package/dist/index.d.mts +0 -5
- package/dist/react/useInstanceUris.cjs +0 -27
- package/dist/react/useInstanceUris.d.cts +0 -13
- package/dist/react/useInstanceUris.d.cts.map +0 -1
- package/dist/react/useInstanceUris.d.mts.map +0 -1
- package/dist/react/useInstanceUris.mjs.map +0 -1
- package/dist/react/useTypeIndexProfile.cjs +0 -10
- package/dist/react/useTypeIndexProfile.d.cts.map +0 -1
- package/dist/react/useTypeIndexProfile.d.mts +0 -7
- package/dist/react/useTypeIndexProfile.d.mts.map +0 -1
- package/dist/react/useTypeIndexProfile.mjs.map +0 -1
- package/dist/react/util/useSubscribeToUris.cjs +0 -24
- package/dist/react/util/useSubscribeToUris.mjs.map +0 -1
- package/dist/setTypeIndex.cjs +0 -125
- package/dist/setTypeIndex.d.cts +0 -56
- package/dist/setTypeIndex.d.cts.map +0 -1
- package/dist/setTypeIndex.d.mts.map +0 -1
- package/dist/setTypeIndex.mjs.map +0 -1
- package/dist/util/Options.cjs +0 -13
- package/dist/util/Options.d.cts +0 -11
- package/dist/util/Options.d.cts.map +0 -1
- package/dist/util/Options.d.mts.map +0 -1
- package/dist/util/Options.mjs.map +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { LdSet, LdoJsonldContext } from "@ldo/ldo";
|
|
2
|
-
|
|
3
|
-
//#region src/_ldo/profile.typings.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* =============================================================================
|
|
6
|
-
* Typescript Typings for profile
|
|
7
|
-
* =============================================================================
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* TypeIndexProfile Type
|
|
11
|
-
*/
|
|
12
|
-
interface TypeIndexProfile {
|
|
13
|
-
"@id"?: string;
|
|
14
|
-
"@context"?: LdoJsonldContext;
|
|
15
|
-
/**
|
|
16
|
-
* A registry of all types used on the user's Pod (for private access only)
|
|
17
|
-
*/
|
|
18
|
-
privateTypeIndex?: LdSet<{
|
|
19
|
-
"@id": string;
|
|
20
|
-
}>;
|
|
21
|
-
/**
|
|
22
|
-
* A registry of all types used on the user's Pod (for public access)
|
|
23
|
-
*/
|
|
24
|
-
publicTypeIndex?: LdSet<{
|
|
25
|
-
"@id": string;
|
|
26
|
-
}>;
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { TypeIndexProfile };
|
|
30
|
-
//# sourceMappingURL=profile.typings.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.typings.d.mts","names":[],"sources":["../../src/_ldo/profile.typings.ts"],"mappings":";;;;;AAWA;;;;;;UAAiB,gBAAA;EACf,KAAA;EACA,UAAA,GAAa,gBAAA;EAAb;;;EAIA,gBAAA,GAAmB,KAAA;IACjB,KAAA;EAAA;EAKgB;;;EAAlB,eAAA,GAAkB,KAAA;IAChB,KAAA;EAAA;AAAA"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//#region src/_ldo/typeIndex.context.ts
|
|
2
|
-
/**
|
|
3
|
-
* =============================================================================
|
|
4
|
-
* typeIndexContext: JSONLD Context for typeIndex
|
|
5
|
-
* =============================================================================
|
|
6
|
-
*/
|
|
7
|
-
const typeIndexContext = {
|
|
8
|
-
type: { "@id": "@type" },
|
|
9
|
-
TypeIndex: {
|
|
10
|
-
"@id": "http://www.w3.org/ns/solid/terms#TypeIndex",
|
|
11
|
-
"@context": { type: { "@id": "@type" } }
|
|
12
|
-
},
|
|
13
|
-
ListedDocument: {
|
|
14
|
-
"@id": "http://www.w3.org/ns/solid/terms#ListedDocument",
|
|
15
|
-
"@context": { type: { "@id": "@type" } }
|
|
16
|
-
},
|
|
17
|
-
TypeRegistration: {
|
|
18
|
-
"@id": "http://www.w3.org/ns/solid/terms#TypeRegistration",
|
|
19
|
-
"@context": {
|
|
20
|
-
type: { "@id": "@type" },
|
|
21
|
-
forClass: {
|
|
22
|
-
"@id": "http://www.w3.org/ns/solid/terms#forClass",
|
|
23
|
-
"@type": "@id"
|
|
24
|
-
},
|
|
25
|
-
instance: {
|
|
26
|
-
"@id": "http://www.w3.org/ns/solid/terms#instance",
|
|
27
|
-
"@type": "@id",
|
|
28
|
-
"@isCollection": true
|
|
29
|
-
},
|
|
30
|
-
instanceContainer: {
|
|
31
|
-
"@id": "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
32
|
-
"@type": "@id",
|
|
33
|
-
"@isCollection": true
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
forClass: {
|
|
38
|
-
"@id": "http://www.w3.org/ns/solid/terms#forClass",
|
|
39
|
-
"@type": "@id"
|
|
40
|
-
},
|
|
41
|
-
instance: {
|
|
42
|
-
"@id": "http://www.w3.org/ns/solid/terms#instance",
|
|
43
|
-
"@type": "@id",
|
|
44
|
-
"@isCollection": true
|
|
45
|
-
},
|
|
46
|
-
instanceContainer: {
|
|
47
|
-
"@id": "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
48
|
-
"@type": "@id",
|
|
49
|
-
"@isCollection": true
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
//#endregion
|
|
53
|
-
exports.typeIndexContext = typeIndexContext;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.context.mjs","names":[],"sources":["../../src/_ldo/typeIndex.context.ts"],"sourcesContent":["import type { LdoJsonldContext } from \"@ldo/ldo\";\n\n/**\n * =============================================================================\n * typeIndexContext: JSONLD Context for typeIndex\n * =============================================================================\n */\nexport const typeIndexContext: LdoJsonldContext = {\n type: {\n \"@id\": \"@type\",\n },\n TypeIndex: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#TypeIndex\",\n \"@context\": {\n type: {\n \"@id\": \"@type\",\n },\n },\n },\n ListedDocument: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#ListedDocument\",\n \"@context\": {\n type: {\n \"@id\": \"@type\",\n },\n },\n },\n TypeRegistration: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#TypeRegistration\",\n \"@context\": {\n type: {\n \"@id\": \"@type\",\n },\n forClass: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#forClass\",\n \"@type\": \"@id\",\n },\n instance: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#instance\",\n \"@type\": \"@id\",\n \"@isCollection\": true,\n },\n instanceContainer: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#instanceContainer\",\n \"@type\": \"@id\",\n \"@isCollection\": true,\n },\n },\n },\n forClass: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#forClass\",\n \"@type\": \"@id\",\n },\n instance: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#instance\",\n \"@type\": \"@id\",\n \"@isCollection\": true,\n },\n instanceContainer: {\n \"@id\": \"http://www.w3.org/ns/solid/terms#instanceContainer\",\n \"@type\": \"@id\",\n \"@isCollection\": true,\n },\n};\n"],"mappings":";;;;;;AAOA,MAAa,mBAAqC;CAChD,MAAM,EACJ,OAAO,SACR;CACD,WAAW;EACT,OAAO;EACP,YAAY,EACV,MAAM,EACJ,OAAO,SACR,EACF;EACF;CACD,gBAAgB;EACd,OAAO;EACP,YAAY,EACV,MAAM,EACJ,OAAO,SACR,EACF;EACF;CACD,kBAAkB;EAChB,OAAO;EACP,YAAY;GACV,MAAM,EACJ,OAAO,SACR;GACD,UAAU;IACR,OAAO;IACP,SAAS;IACV;GACD,UAAU;IACR,OAAO;IACP,SAAS;IACT,iBAAiB;IAClB;GACD,mBAAmB;IACjB,OAAO;IACP,SAAS;IACT,iBAAiB;IAClB;GACF;EACF;CACD,UAAU;EACR,OAAO;EACP,SAAS;EACV;CACD,UAAU;EACR,OAAO;EACP,SAAS;EACT,iBAAiB;EAClB;CACD,mBAAmB;EACjB,OAAO;EACP,SAAS;EACT,iBAAiB;EAClB;CACF"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
//#region src/_ldo/typeIndex.schema.ts
|
|
2
|
-
/**
|
|
3
|
-
* =============================================================================
|
|
4
|
-
* typeIndexSchema: ShexJ Schema for typeIndex
|
|
5
|
-
* =============================================================================
|
|
6
|
-
*/
|
|
7
|
-
const typeIndexSchema = {
|
|
8
|
-
type: "Schema",
|
|
9
|
-
shapes: [{
|
|
10
|
-
id: "https://shaperepo.com/schemas/solidProfile#TypeIndexDocument",
|
|
11
|
-
type: "ShapeDecl",
|
|
12
|
-
shapeExpr: {
|
|
13
|
-
type: "Shape",
|
|
14
|
-
expression: {
|
|
15
|
-
type: "EachOf",
|
|
16
|
-
expressions: [{
|
|
17
|
-
type: "TripleConstraint",
|
|
18
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
19
|
-
valueExpr: {
|
|
20
|
-
type: "NodeConstraint",
|
|
21
|
-
values: ["http://www.w3.org/ns/solid/terms#TypeIndex"]
|
|
22
|
-
},
|
|
23
|
-
annotations: [{
|
|
24
|
-
type: "Annotation",
|
|
25
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
26
|
-
object: { value: "Defines the node as a TypeIndex" }
|
|
27
|
-
}]
|
|
28
|
-
}, {
|
|
29
|
-
type: "TripleConstraint",
|
|
30
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
31
|
-
valueExpr: {
|
|
32
|
-
type: "NodeConstraint",
|
|
33
|
-
values: ["http://www.w3.org/ns/solid/terms#ListedDocument"]
|
|
34
|
-
},
|
|
35
|
-
annotations: [{
|
|
36
|
-
type: "Annotation",
|
|
37
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
38
|
-
object: { value: "Defines the node as a Listed Document" }
|
|
39
|
-
}]
|
|
40
|
-
}]
|
|
41
|
-
},
|
|
42
|
-
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]
|
|
43
|
-
}
|
|
44
|
-
}, {
|
|
45
|
-
id: "https://shaperepo.com/schemas/solidProfile#TypeRegistration",
|
|
46
|
-
type: "ShapeDecl",
|
|
47
|
-
shapeExpr: {
|
|
48
|
-
type: "Shape",
|
|
49
|
-
expression: {
|
|
50
|
-
type: "EachOf",
|
|
51
|
-
expressions: [
|
|
52
|
-
{
|
|
53
|
-
type: "TripleConstraint",
|
|
54
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
55
|
-
valueExpr: {
|
|
56
|
-
type: "NodeConstraint",
|
|
57
|
-
values: ["http://www.w3.org/ns/solid/terms#TypeRegistration"]
|
|
58
|
-
},
|
|
59
|
-
annotations: [{
|
|
60
|
-
type: "Annotation",
|
|
61
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
62
|
-
object: { value: "Defines this node as a Type Registration" }
|
|
63
|
-
}]
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: "TripleConstraint",
|
|
67
|
-
predicate: "http://www.w3.org/ns/solid/terms#forClass",
|
|
68
|
-
valueExpr: {
|
|
69
|
-
type: "NodeConstraint",
|
|
70
|
-
nodeKind: "iri"
|
|
71
|
-
},
|
|
72
|
-
annotations: [{
|
|
73
|
-
type: "Annotation",
|
|
74
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
75
|
-
object: { value: "The class of object at this type." }
|
|
76
|
-
}]
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
type: "TripleConstraint",
|
|
80
|
-
predicate: "http://www.w3.org/ns/solid/terms#instance",
|
|
81
|
-
valueExpr: {
|
|
82
|
-
type: "NodeConstraint",
|
|
83
|
-
nodeKind: "iri"
|
|
84
|
-
},
|
|
85
|
-
min: 0,
|
|
86
|
-
max: -1,
|
|
87
|
-
annotations: [{
|
|
88
|
-
type: "Annotation",
|
|
89
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
90
|
-
object: { value: "A specific resource that contains the class." }
|
|
91
|
-
}]
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
type: "TripleConstraint",
|
|
95
|
-
predicate: "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
96
|
-
valueExpr: {
|
|
97
|
-
type: "NodeConstraint",
|
|
98
|
-
nodeKind: "iri"
|
|
99
|
-
},
|
|
100
|
-
min: 0,
|
|
101
|
-
max: -1,
|
|
102
|
-
annotations: [{
|
|
103
|
-
type: "Annotation",
|
|
104
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
105
|
-
object: { value: "Containers that contain resources with the class." }
|
|
106
|
-
}]
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]
|
|
111
|
-
}
|
|
112
|
-
}]
|
|
113
|
-
};
|
|
114
|
-
//#endregion
|
|
115
|
-
exports.typeIndexSchema = typeIndexSchema;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.schema.mjs","names":[],"sources":["../../src/_ldo/typeIndex.schema.ts"],"sourcesContent":["import type { Schema } from \"shexj\";\n\n/**\n * =============================================================================\n * typeIndexSchema: ShexJ Schema for typeIndex\n * =============================================================================\n */\nexport const typeIndexSchema: Schema = {\n type: \"Schema\",\n shapes: [\n {\n id: \"https://shaperepo.com/schemas/solidProfile#TypeIndexDocument\",\n type: \"ShapeDecl\",\n shapeExpr: {\n type: \"Shape\",\n expression: {\n type: \"EachOf\",\n expressions: [\n {\n type: \"TripleConstraint\",\n predicate: \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\",\n valueExpr: {\n type: \"NodeConstraint\",\n values: [\"http://www.w3.org/ns/solid/terms#TypeIndex\"],\n },\n annotations: [\n {\n type: \"Annotation\",\n predicate: \"http://www.w3.org/2000/01/rdf-schema#comment\",\n object: {\n value: \"Defines the node as a TypeIndex\",\n },\n },\n ],\n },\n {\n type: \"TripleConstraint\",\n predicate: \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\",\n valueExpr: {\n type: \"NodeConstraint\",\n values: [\"http://www.w3.org/ns/solid/terms#ListedDocument\"],\n },\n annotations: [\n {\n type: \"Annotation\",\n predicate: \"http://www.w3.org/2000/01/rdf-schema#comment\",\n object: {\n value: \"Defines the node as a Listed Document\",\n },\n },\n ],\n },\n ],\n },\n extra: [\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\"],\n },\n },\n {\n id: \"https://shaperepo.com/schemas/solidProfile#TypeRegistration\",\n type: \"ShapeDecl\",\n shapeExpr: {\n type: \"Shape\",\n expression: {\n type: \"EachOf\",\n expressions: [\n {\n type: \"TripleConstraint\",\n predicate: \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\",\n valueExpr: {\n type: \"NodeConstraint\",\n values: [\"http://www.w3.org/ns/solid/terms#TypeRegistration\"],\n },\n annotations: [\n {\n type: \"Annotation\",\n predicate: \"http://www.w3.org/2000/01/rdf-schema#comment\",\n object: {\n value: \"Defines this node as a Type Registration\",\n },\n },\n ],\n },\n {\n type: \"TripleConstraint\",\n predicate: \"http://www.w3.org/ns/solid/terms#forClass\",\n valueExpr: {\n type: \"NodeConstraint\",\n nodeKind: \"iri\",\n },\n annotations: [\n {\n type: \"Annotation\",\n predicate: \"http://www.w3.org/2000/01/rdf-schema#comment\",\n object: {\n value: \"The class of object at this type.\",\n },\n },\n ],\n },\n {\n type: \"TripleConstraint\",\n predicate: \"http://www.w3.org/ns/solid/terms#instance\",\n valueExpr: {\n type: \"NodeConstraint\",\n nodeKind: \"iri\",\n },\n min: 0,\n max: -1,\n annotations: [\n {\n type: \"Annotation\",\n predicate: \"http://www.w3.org/2000/01/rdf-schema#comment\",\n object: {\n value: \"A specific resource that contains the class.\",\n },\n },\n ],\n },\n {\n type: \"TripleConstraint\",\n predicate: \"http://www.w3.org/ns/solid/terms#instanceContainer\",\n valueExpr: {\n type: \"NodeConstraint\",\n nodeKind: \"iri\",\n },\n min: 0,\n max: -1,\n annotations: [\n {\n type: \"Annotation\",\n predicate: \"http://www.w3.org/2000/01/rdf-schema#comment\",\n object: {\n value: \"Containers that contain resources with the class.\",\n },\n },\n ],\n },\n ],\n },\n extra: [\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\"],\n },\n },\n ],\n};\n"],"mappings":";;;;;;AAOA,MAAa,kBAA0B;CACrC,MAAM;CACN,QAAQ,CACN;EACE,IAAI;EACJ,MAAM;EACN,WAAW;GACT,MAAM;GACN,YAAY;IACV,MAAM;IACN,aAAa,CACX;KACE,MAAM;KACN,WAAW;KACX,WAAW;MACT,MAAM;MACN,QAAQ,CAAC,6CAA6C;MACvD;KACD,aAAa,CACX;MACE,MAAM;MACN,WAAW;MACX,QAAQ,EACN,OAAO,mCACR;MACF,CACF;KACF,EACD;KACE,MAAM;KACN,WAAW;KACX,WAAW;MACT,MAAM;MACN,QAAQ,CAAC,kDAAkD;MAC5D;KACD,aAAa,CACX;MACE,MAAM;MACN,WAAW;MACX,QAAQ,EACN,OAAO,yCACR;MACF,CACF;KACF,CACF;IACF;GACD,OAAO,CAAC,kDAAkD;GAC3D;EACF,EACD;EACE,IAAI;EACJ,MAAM;EACN,WAAW;GACT,MAAM;GACN,YAAY;IACV,MAAM;IACN,aAAa;KACX;MACE,MAAM;MACN,WAAW;MACX,WAAW;OACT,MAAM;OACN,QAAQ,CAAC,oDAAoD;OAC9D;MACD,aAAa,CACX;OACE,MAAM;OACN,WAAW;OACX,QAAQ,EACN,OAAO,4CACR;OACF,CACF;MACF;KACD;MACE,MAAM;MACN,WAAW;MACX,WAAW;OACT,MAAM;OACN,UAAU;OACX;MACD,aAAa,CACX;OACE,MAAM;OACN,WAAW;OACX,QAAQ,EACN,OAAO,qCACR;OACF,CACF;MACF;KACD;MACE,MAAM;MACN,WAAW;MACX,WAAW;OACT,MAAM;OACN,UAAU;OACX;MACD,KAAK;MACL,KAAK;MACL,aAAa,CACX;OACE,MAAM;OACN,WAAW;OACX,QAAQ,EACN,OAAO,gDACR;OACF,CACF;MACF;KACD;MACE,MAAM;MACN,WAAW;MACX,WAAW;OACT,MAAM;OACN,UAAU;OACX;MACD,KAAK;MACL,KAAK;MACL,aAAa,CACX;OACE,MAAM;OACN,WAAW;OACX,QAAQ,EACN,OAAO,qDACR;OACF,CACF;MACF;KACF;IACF;GACD,OAAO,CAAC,kDAAkD;GAC3D;EACF,CACF;CACF"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const require_typeIndex_schema = require("./typeIndex.schema.cjs");
|
|
2
|
-
const require_typeIndex_context = require("./typeIndex.context.cjs");
|
|
3
|
-
//#region src/_ldo/typeIndex.shapeTypes.ts
|
|
4
|
-
/**
|
|
5
|
-
* =============================================================================
|
|
6
|
-
* LDO ShapeTypes typeIndex
|
|
7
|
-
* =============================================================================
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* TypeIndexDocument ShapeType
|
|
11
|
-
*/
|
|
12
|
-
const TypeIndexDocumentShapeType = {
|
|
13
|
-
schema: require_typeIndex_schema.typeIndexSchema,
|
|
14
|
-
shape: "https://shaperepo.com/schemas/solidProfile#TypeIndexDocument",
|
|
15
|
-
context: require_typeIndex_context.typeIndexContext
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* TypeRegistration ShapeType
|
|
19
|
-
*/
|
|
20
|
-
const TypeRegistrationShapeType = {
|
|
21
|
-
schema: require_typeIndex_schema.typeIndexSchema,
|
|
22
|
-
shape: "https://shaperepo.com/schemas/solidProfile#TypeRegistration",
|
|
23
|
-
context: require_typeIndex_context.typeIndexContext
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
26
|
-
exports.TypeIndexDocumentShapeType = TypeIndexDocumentShapeType;
|
|
27
|
-
exports.TypeRegistrationShapeType = TypeRegistrationShapeType;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.shapeTypes.mjs","names":[],"sources":["../../src/_ldo/typeIndex.shapeTypes.ts"],"sourcesContent":["import type { ShapeType } from \"@ldo/ldo\";\nimport { typeIndexSchema } from \"./typeIndex.schema\";\nimport { typeIndexContext } from \"./typeIndex.context\";\nimport type { TypeIndexDocument, TypeRegistration } from \"./typeIndex.typings\";\n\n/**\n * =============================================================================\n * LDO ShapeTypes typeIndex\n * =============================================================================\n */\n\n/**\n * TypeIndexDocument ShapeType\n */\nexport const TypeIndexDocumentShapeType: ShapeType<TypeIndexDocument> = {\n schema: typeIndexSchema,\n shape: \"https://shaperepo.com/schemas/solidProfile#TypeIndexDocument\",\n context: typeIndexContext,\n};\n\n/**\n * TypeRegistration ShapeType\n */\nexport const TypeRegistrationShapeType: ShapeType<TypeRegistration> = {\n schema: typeIndexSchema,\n shape: \"https://shaperepo.com/schemas/solidProfile#TypeRegistration\",\n context: typeIndexContext,\n};\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,6BAA2D;CACtE,QAAQ;CACR,OAAO;CACP,SAAS;CACV;;;;AAKD,MAAa,4BAAyD;CACpE,QAAQ;CACR,OAAO;CACP,SAAS;CACV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.typings.d.cts","names":[],"sources":["../../src/_ldo/typeIndex.typings.ts"],"mappings":";;;;;;UA8BiB,gBAAA;EACf,KAAA;EACA,UAAA,GAAa,gBAAA;;;;EAIb,IAAA;IACE,KAAA;EAAA;;;;EAKF,QAAA;IACE,KAAA;EAAA;;;;EAKF,QAAA,GAAW,KAAA;IACT,KAAA;EAAA;;;;EAKF,iBAAA,GAAoB,KAAA;IAClB,KAAA;EAAA;AAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { LdSet, LdoJsonldContext } from "@ldo/ldo";
|
|
2
|
-
|
|
3
|
-
//#region src/_ldo/typeIndex.typings.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* TypeRegistration Type
|
|
6
|
-
*/
|
|
7
|
-
interface TypeRegistration {
|
|
8
|
-
"@id"?: string;
|
|
9
|
-
"@context"?: LdoJsonldContext;
|
|
10
|
-
/**
|
|
11
|
-
* Defines this node as a Type Registration
|
|
12
|
-
*/
|
|
13
|
-
type: {
|
|
14
|
-
"@id": "TypeRegistration";
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* The class of object at this type.
|
|
18
|
-
*/
|
|
19
|
-
forClass: {
|
|
20
|
-
"@id": string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* A specific resource that contains the class.
|
|
24
|
-
*/
|
|
25
|
-
instance?: LdSet<{
|
|
26
|
-
"@id": string;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Containers that contain resources with the class.
|
|
30
|
-
*/
|
|
31
|
-
instanceContainer?: LdSet<{
|
|
32
|
-
"@id": string;
|
|
33
|
-
}>;
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { TypeRegistration };
|
|
37
|
-
//# sourceMappingURL=typeIndex.typings.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.typings.d.mts","names":[],"sources":["../../src/_ldo/typeIndex.typings.ts"],"mappings":";;;;;;UA8BiB,gBAAA;EACf,KAAA;EACA,UAAA,GAAa,gBAAA;;;;EAIb,IAAA;IACE,KAAA;EAAA;;;;EAKF,QAAA;IACE,KAAA;EAAA;;;;EAKF,QAAA,GAAW,KAAA;IACT,KAAA;EAAA;;;;EAKF,iBAAA,GAAoB,KAAA;IAClB,KAAA;EAAA;AAAA"}
|
package/dist/constants.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region src/constants.ts
|
|
2
|
-
const RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
|
|
3
|
-
const TYPE_REGISTRATION = "http://www.w3.org/ns/solid/terms#TypeRegistration";
|
|
4
|
-
const FOR_CLASS = "http://www.w3.org/ns/solid/terms#forClass";
|
|
5
|
-
//#endregion
|
|
6
|
-
exports.FOR_CLASS = FOR_CLASS;
|
|
7
|
-
exports.RDF_TYPE = RDF_TYPE;
|
|
8
|
-
exports.TYPE_REGISTRATION = TYPE_REGISTRATION;
|
package/dist/constants.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const RDF_TYPE = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\";\nexport const TYPE_REGISTRATION =\n \"http://www.w3.org/ns/solid/terms#TypeRegistration\";\nexport const FOR_CLASS = \"http://www.w3.org/ns/solid/terms#forClass\";\nexport const INSTANCE = \"http://www.w3.org/ns/solid/terms#instance\";\nexport const INSTANCE_CONTAINER =\n \"http://www.w3.org/ns/solid/terms#instanceContainer\";\n"],"mappings":";AAAA,MAAa,WAAW;AACxB,MAAa,oBACX;AACF,MAAa,YAAY"}
|
package/dist/getTypeIndex.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const require_profile_shapeTypes = require("./_ldo/profile.shapeTypes.cjs");
|
|
2
|
-
const require_typeIndex_shapeTypes = require("./_ldo/typeIndex.shapeTypes.cjs");
|
|
3
|
-
const require_constants = require("./constants.cjs");
|
|
4
|
-
const require_Options = require("./util/Options.cjs");
|
|
5
|
-
//#region src/getTypeIndex.ts
|
|
6
|
-
async function getTypeRegistrations(webId, options) {
|
|
7
|
-
const { dataset } = require_Options.guaranteeOptions(options);
|
|
8
|
-
const typeIndexUris = getTypeIndexesUrisFromProfile(await getProfile(webId, options));
|
|
9
|
-
await Promise.all(typeIndexUris.map(async (typeIndexUri) => {
|
|
10
|
-
const readResult = await dataset.getResource(typeIndexUri).readIfUnfetched();
|
|
11
|
-
if (readResult.isError) throw readResult;
|
|
12
|
-
}));
|
|
13
|
-
return dataset.usingType(require_typeIndex_shapeTypes.TypeRegistrationShapeType).matchSubject(require_constants.RDF_TYPE, require_constants.TYPE_REGISTRATION);
|
|
14
|
-
}
|
|
15
|
-
async function getProfile(webId, options) {
|
|
16
|
-
const { dataset } = require_Options.guaranteeOptions(options);
|
|
17
|
-
const readResult = await dataset.getResource(webId).readIfUnfetched();
|
|
18
|
-
if (readResult.isError) throw readResult;
|
|
19
|
-
return dataset.usingType(require_profile_shapeTypes.TypeIndexProfileShapeType).fromSubject(webId);
|
|
20
|
-
}
|
|
21
|
-
function getTypeIndexesUrisFromProfile(profile) {
|
|
22
|
-
const uris = [];
|
|
23
|
-
profile.privateTypeIndex?.forEach((indexNode) => {
|
|
24
|
-
uris.push(indexNode["@id"]);
|
|
25
|
-
});
|
|
26
|
-
profile.publicTypeIndex?.forEach((indexNode) => {
|
|
27
|
-
uris.push(indexNode["@id"]);
|
|
28
|
-
});
|
|
29
|
-
return uris;
|
|
30
|
-
}
|
|
31
|
-
async function getInstanceUris(classUri, typeRegistrations, options) {
|
|
32
|
-
const { dataset } = require_Options.guaranteeOptions(options);
|
|
33
|
-
const leafUris = /* @__PURE__ */ new Set();
|
|
34
|
-
await Promise.all(typeRegistrations.map(async (registration) => {
|
|
35
|
-
if (registration.forClass["@id"] === classUri) {
|
|
36
|
-
registration.instance?.forEach((instance) => leafUris.add(instance["@id"]));
|
|
37
|
-
await Promise.all(registration.instanceContainer?.map(async (instanceContainer) => {
|
|
38
|
-
const containerResource = dataset.getResource(instanceContainer["@id"]);
|
|
39
|
-
await containerResource.readIfUnfetched();
|
|
40
|
-
containerResource.children().forEach((child) => {
|
|
41
|
-
if (child.type === "SolidLeaf") leafUris.add(child.uri);
|
|
42
|
-
});
|
|
43
|
-
}) ?? []);
|
|
44
|
-
}
|
|
45
|
-
}));
|
|
46
|
-
return Array.from(leafUris);
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
exports.getInstanceUris = getInstanceUris;
|
|
50
|
-
exports.getProfile = getProfile;
|
|
51
|
-
exports.getTypeIndexesUrisFromProfile = getTypeIndexesUrisFromProfile;
|
|
52
|
-
exports.getTypeRegistrations = getTypeRegistrations;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTypeIndex.d.cts","names":[],"sources":["../src/getTypeIndex.ts"],"mappings":";;;;;;;iBAUsB,oBAAA,CACpB,KAAA,UACA,OAAA,GAAU,OAAA,GACT,OAAA,CAAQ,KAAA,CAAM,gBAAA;AAAA,iBAwBK,UAAA,CACpB,KAAA,UACA,OAAA,GAAU,OAAA,GACT,OAAA,CAAQ,gBAAA;AAAA,iBAQK,6BAAA,CACd,OAAA,EAAS,gBAAA,GACR,YAAA;AAAA,iBAWmB,eAAA,CACpB,QAAA,UACA,iBAAA,EAAmB,gBAAA,IACnB,OAAA,GAAU,OAAA,GACT,OAAA,CAAQ,YAAA"}
|
package/dist/getTypeIndex.d.mts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TypeRegistration } from "./_ldo/typeIndex.typings.mjs";
|
|
2
|
-
import { TypeIndexProfile } from "./_ldo/profile.typings.mjs";
|
|
3
|
-
import { Options } from "./util/Options.mjs";
|
|
4
|
-
import { SolidLeafUri } from "@ldo/connected-solid";
|
|
5
|
-
import { LdSet } from "@ldo/ldo";
|
|
6
|
-
|
|
7
|
-
//#region src/getTypeIndex.d.ts
|
|
8
|
-
declare function getTypeRegistrations(webId: string, options?: Options): Promise<LdSet<TypeRegistration>>;
|
|
9
|
-
declare function getProfile(webId: string, options?: Options): Promise<TypeIndexProfile>;
|
|
10
|
-
declare function getTypeIndexesUrisFromProfile(profile: TypeIndexProfile): SolidLeafUri[];
|
|
11
|
-
declare function getInstanceUris(classUri: string, typeRegistrations: TypeRegistration[], options?: Options): Promise<SolidLeafUri[]>;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { getInstanceUris, getProfile, getTypeIndexesUrisFromProfile, getTypeRegistrations };
|
|
14
|
-
//# sourceMappingURL=getTypeIndex.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTypeIndex.d.mts","names":[],"sources":["../src/getTypeIndex.ts"],"mappings":";;;;;;;iBAUsB,oBAAA,CACpB,KAAA,UACA,OAAA,GAAU,OAAA,GACT,OAAA,CAAQ,KAAA,CAAM,gBAAA;AAAA,iBAwBK,UAAA,CACpB,KAAA,UACA,OAAA,GAAU,OAAA,GACT,OAAA,CAAQ,gBAAA;AAAA,iBAQK,6BAAA,CACd,OAAA,EAAS,gBAAA,GACR,YAAA;AAAA,iBAWmB,eAAA,CACpB,QAAA,UACA,iBAAA,EAAmB,gBAAA,IACnB,OAAA,GAAU,OAAA,GACT,OAAA,CAAQ,YAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTypeIndex.mjs","names":[],"sources":["../src/getTypeIndex.ts"],"sourcesContent":["import type { TypeRegistration } from \"./_ldo/typeIndex.typings\";\nimport type { TypeIndexProfile } from \"./_ldo/profile.typings\";\nimport { TypeIndexProfileShapeType } from \"./_ldo/profile.shapeTypes\";\nimport { TypeRegistrationShapeType } from \"./_ldo/typeIndex.shapeTypes\";\nimport { RDF_TYPE, TYPE_REGISTRATION } from \"./constants\";\nimport type { Options } from \"./util/Options\";\nimport { guaranteeOptions } from \"./util/Options\";\nimport type { LdSet } from \"@ldo/ldo\";\nimport type { SolidContainerUri, SolidLeafUri } from \"@ldo/connected-solid\";\n\nexport async function getTypeRegistrations(\n webId: string,\n options?: Options,\n): Promise<LdSet<TypeRegistration>> {\n const { dataset } = guaranteeOptions(options);\n\n // Get Profile\n const profile = await getProfile(webId, options);\n\n // Get Type Indexes\n const typeIndexUris = getTypeIndexesUrisFromProfile(profile);\n\n // Fetch the type Indexes\n await Promise.all(\n typeIndexUris.map(async (typeIndexUri) => {\n const typeIndexResource = dataset.getResource(typeIndexUri);\n const readResult = await typeIndexResource.readIfUnfetched();\n if (readResult.isError) throw readResult;\n }),\n );\n\n // Get Type Registrations\n return dataset\n .usingType(TypeRegistrationShapeType)\n .matchSubject(RDF_TYPE, TYPE_REGISTRATION);\n}\n\nexport async function getProfile(\n webId: string,\n options?: Options,\n): Promise<TypeIndexProfile> {\n const { dataset } = guaranteeOptions(options);\n const profileResource = dataset.getResource(webId);\n const readResult = await profileResource.readIfUnfetched();\n if (readResult.isError) throw readResult;\n return dataset.usingType(TypeIndexProfileShapeType).fromSubject(webId);\n}\n\nexport function getTypeIndexesUrisFromProfile(\n profile: TypeIndexProfile,\n): SolidLeafUri[] {\n const uris: SolidLeafUri[] = [];\n profile.privateTypeIndex?.forEach((indexNode) => {\n uris.push(indexNode[\"@id\"] as SolidLeafUri);\n });\n profile.publicTypeIndex?.forEach((indexNode) => {\n uris.push(indexNode[\"@id\"] as SolidLeafUri);\n });\n return uris;\n}\n\nexport async function getInstanceUris(\n classUri: string,\n typeRegistrations: TypeRegistration[],\n options?: Options,\n): Promise<SolidLeafUri[]> {\n const { dataset } = guaranteeOptions(options);\n\n const leafUris = new Set<SolidLeafUri>();\n await Promise.all(\n typeRegistrations.map(async (registration) => {\n if (registration.forClass[\"@id\"] === classUri) {\n // Individual registrations\n registration.instance?.forEach((instance) =>\n leafUris.add(instance[\"@id\"] as SolidLeafUri),\n );\n // Container registrations\n await Promise.all(\n registration.instanceContainer?.map(async (instanceContainer) => {\n const containerResource = dataset.getResource(\n instanceContainer[\"@id\"] as SolidContainerUri,\n );\n await containerResource.readIfUnfetched();\n containerResource.children().forEach((child) => {\n if (child.type === \"SolidLeaf\") leafUris.add(child.uri);\n });\n }) ?? [],\n );\n }\n }),\n );\n return Array.from(leafUris);\n}\n"],"mappings":";;;;;AAUA,eAAsB,qBACpB,OACA,SACkC;CAClC,MAAM,EAAE,YAAY,iBAAiB,QAAQ;CAM7C,MAAM,gBAAgB,8BAA8B,MAH9B,WAAW,OAAO,QAAQ,CAGY;AAG5D,OAAM,QAAQ,IACZ,cAAc,IAAI,OAAO,iBAAiB;EAExC,MAAM,aAAa,MADO,QAAQ,YAAY,aACJ,CAAC,iBAAiB;AAC5D,MAAI,WAAW,QAAS,OAAM;GAC9B,CACH;AAGD,QAAO,QACJ,UAAU,0BAA0B,CACpC,aAAa,UAAU,kBAAkB;;AAG9C,eAAsB,WACpB,OACA,SAC2B;CAC3B,MAAM,EAAE,YAAY,iBAAiB,QAAQ;CAE7C,MAAM,aAAa,MADK,QAAQ,YAAY,MACJ,CAAC,iBAAiB;AAC1D,KAAI,WAAW,QAAS,OAAM;AAC9B,QAAO,QAAQ,UAAU,0BAA0B,CAAC,YAAY,MAAM;;AAGxE,SAAgB,8BACd,SACgB;CAChB,MAAM,OAAuB,EAAE;AAC/B,SAAQ,kBAAkB,SAAS,cAAc;AAC/C,OAAK,KAAK,UAAU,OAAuB;GAC3C;AACF,SAAQ,iBAAiB,SAAS,cAAc;AAC9C,OAAK,KAAK,UAAU,OAAuB;GAC3C;AACF,QAAO;;AAGT,eAAsB,gBACpB,UACA,mBACA,SACyB;CACzB,MAAM,EAAE,YAAY,iBAAiB,QAAQ;CAE7C,MAAM,2BAAW,IAAI,KAAmB;AACxC,OAAM,QAAQ,IACZ,kBAAkB,IAAI,OAAO,iBAAiB;AAC5C,MAAI,aAAa,SAAS,WAAW,UAAU;AAE7C,gBAAa,UAAU,SAAS,aAC9B,SAAS,IAAI,SAAS,OAAuB,CAC9C;AAED,SAAM,QAAQ,IACZ,aAAa,mBAAmB,IAAI,OAAO,sBAAsB;IAC/D,MAAM,oBAAoB,QAAQ,YAChC,kBAAkB,OACnB;AACD,UAAM,kBAAkB,iBAAiB;AACzC,sBAAkB,UAAU,CAAC,SAAS,UAAU;AAC9C,SAAI,MAAM,SAAS,YAAa,UAAS,IAAI,MAAM,IAAI;MACvD;KACF,IAAI,EAAE,CACT;;GAEH,CACH;AACD,QAAO,MAAM,KAAK,SAAS"}
|
package/dist/index.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_getTypeIndex = require("./getTypeIndex.cjs");
|
|
3
|
-
const require_setTypeIndex = require("./setTypeIndex.cjs");
|
|
4
|
-
const require_useTypeIndexProfile = require("./react/useTypeIndexProfile.cjs");
|
|
5
|
-
const require_useInstanceUris = require("./react/useInstanceUris.cjs");
|
|
6
|
-
exports.addRegistration = require_setTypeIndex.addRegistration;
|
|
7
|
-
exports.createIndex = require_setTypeIndex.createIndex;
|
|
8
|
-
exports.findAppropriateTypeRegistration = require_setTypeIndex.findAppropriateTypeRegistration;
|
|
9
|
-
exports.getInstanceUris = require_getTypeIndex.getInstanceUris;
|
|
10
|
-
exports.getProfile = require_getTypeIndex.getProfile;
|
|
11
|
-
exports.getTypeIndexesUrisFromProfile = require_getTypeIndex.getTypeIndexesUrisFromProfile;
|
|
12
|
-
exports.getTypeRegistrations = require_getTypeIndex.getTypeRegistrations;
|
|
13
|
-
exports.initTypeIndex = require_setTypeIndex.initTypeIndex;
|
|
14
|
-
exports.removeRegistration = require_setTypeIndex.removeRegistration;
|
|
15
|
-
exports.useInstanceUris = require_useInstanceUris.useInstanceUris;
|
|
16
|
-
exports.useTypeIndexProfile = require_useTypeIndexProfile.useTypeIndexProfile;
|
package/dist/index.d.mts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { getInstanceUris, getProfile, getTypeIndexesUrisFromProfile, getTypeRegistrations } from "./getTypeIndex.mjs";
|
|
2
|
-
import { addRegistration, createIndex, findAppropriateTypeRegistration, initTypeIndex, removeRegistration } from "./setTypeIndex.mjs";
|
|
3
|
-
import { useInstanceUris } from "./react/useInstanceUris.mjs";
|
|
4
|
-
import { useTypeIndexProfile } from "./react/useTypeIndexProfile.mjs";
|
|
5
|
-
export { addRegistration, createIndex, findAppropriateTypeRegistration, getInstanceUris, getProfile, getTypeIndexesUrisFromProfile, getTypeRegistrations, initTypeIndex, removeRegistration, useInstanceUris, useTypeIndexProfile };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const require_typeIndex_shapeTypes = require("../_ldo/typeIndex.shapeTypes.cjs");
|
|
2
|
-
const require_constants = require("../constants.cjs");
|
|
3
|
-
const require_getTypeIndex = require("../getTypeIndex.cjs");
|
|
4
|
-
const require_useTypeIndexProfile = require("./useTypeIndexProfile.cjs");
|
|
5
|
-
const require_useSubscribeToUris = require("./util/useSubscribeToUris.cjs");
|
|
6
|
-
let _ldo_solid_react = require("@ldo/solid-react");
|
|
7
|
-
let react = require("react");
|
|
8
|
-
//#region src/react/useInstanceUris.ts
|
|
9
|
-
/**
|
|
10
|
-
* Provides the LeafUris of everything in a type node for a specific class uri
|
|
11
|
-
*
|
|
12
|
-
* @param classUri - the class uri
|
|
13
|
-
* @returns - URIs of all resources registered with this node
|
|
14
|
-
*/
|
|
15
|
-
function useInstanceUris(classUri) {
|
|
16
|
-
const { dataset } = (0, _ldo_solid_react.useLdo)();
|
|
17
|
-
const profile = require_useTypeIndexProfile.useTypeIndexProfile();
|
|
18
|
-
require_useSubscribeToUris.useSubscribeToUris((0, react.useMemo)(() => profile ? require_getTypeIndex.getTypeIndexesUrisFromProfile(profile) : [], [profile]));
|
|
19
|
-
const [leafUris, setLeafUris] = (0, react.useState)([]);
|
|
20
|
-
const typeRegistrations = (0, _ldo_solid_react.useMatchSubject)(require_typeIndex_shapeTypes.TypeRegistrationShapeType, require_constants.RDF_TYPE, require_constants.TYPE_REGISTRATION);
|
|
21
|
-
(0, react.useEffect)(() => {
|
|
22
|
-
require_getTypeIndex.getInstanceUris(classUri, typeRegistrations.toArray(), { solidLdoDataset: dataset }).then(setLeafUris);
|
|
23
|
-
}, [typeRegistrations]);
|
|
24
|
-
return leafUris;
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
exports.useInstanceUris = useInstanceUris;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SolidLeafUri } from "@ldo/connected-solid";
|
|
2
|
-
|
|
3
|
-
//#region src/react/useInstanceUris.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Provides the LeafUris of everything in a type node for a specific class uri
|
|
6
|
-
*
|
|
7
|
-
* @param classUri - the class uri
|
|
8
|
-
* @returns - URIs of all resources registered with this node
|
|
9
|
-
*/
|
|
10
|
-
declare function useInstanceUris(classUri: string): SolidLeafUri[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { useInstanceUris };
|
|
13
|
-
//# sourceMappingURL=useInstanceUris.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInstanceUris.d.cts","names":[],"sources":["../../src/react/useInstanceUris.ts"],"mappings":";;;;;AAkBA;;;;iBAAgB,eAAA,CAAgB,QAAA,WAAmB,YAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInstanceUris.d.mts","names":[],"sources":["../../src/react/useInstanceUris.ts"],"mappings":";;;;;AAkBA;;;;iBAAgB,eAAA,CAAgB,QAAA,WAAmB,YAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInstanceUris.mjs","names":[],"sources":["../../src/react/useInstanceUris.ts"],"sourcesContent":["import { useTypeIndexProfile } from \"./useTypeIndexProfile\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { useSubscribeToUris } from \"./util/useSubscribeToUris\";\nimport { useLdo, useMatchSubject } from \"@ldo/solid-react\";\nimport { TypeRegistrationShapeType } from \"../_ldo/typeIndex.shapeTypes\";\nimport { RDF_TYPE, TYPE_REGISTRATION } from \"../constants\";\nimport {\n getInstanceUris,\n getTypeIndexesUrisFromProfile,\n} from \"../getTypeIndex\";\nimport type { SolidLeafUri } from \"@ldo/connected-solid\";\n\n/**\n * Provides the LeafUris of everything in a type node for a specific class uri\n *\n * @param classUri - the class uri\n * @returns - URIs of all resources registered with this node\n */\nexport function useInstanceUris(classUri: string): SolidLeafUri[] {\n const { dataset } = useLdo();\n const profile = useTypeIndexProfile();\n\n const typeIndexUris: string[] = useMemo(\n () => (profile ? getTypeIndexesUrisFromProfile(profile) : []),\n [profile],\n );\n\n useSubscribeToUris(typeIndexUris);\n\n const [leafUris, setLeafUris] = useState<SolidLeafUri[]>([]);\n\n const typeRegistrations = useMatchSubject(\n TypeRegistrationShapeType,\n RDF_TYPE,\n TYPE_REGISTRATION,\n );\n\n useEffect(() => {\n getInstanceUris(classUri, typeRegistrations.toArray(), {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore TODO: come back and see if we can fix this\n solidLdoDataset: dataset,\n }).then(setLeafUris);\n }, [typeRegistrations]);\n\n return leafUris;\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgB,gBAAgB,UAAkC;CAChE,MAAM,EAAE,YAAY,QAAQ;CAC5B,MAAM,UAAU,qBAAqB;AAOrC,oBALgC,cACvB,UAAU,8BAA8B,QAAQ,GAAG,EAAE,EAC5D,CAAC,QAAQ,CAGqB,CAAC;CAEjC,MAAM,CAAC,UAAU,eAAe,SAAyB,EAAE,CAAC;CAE5D,MAAM,oBAAoB,gBACxB,2BACA,UACA,kBACD;AAED,iBAAgB;AACd,kBAAgB,UAAU,kBAAkB,SAAS,EAAE,EAGrD,iBAAiB,SAClB,CAAC,CAAC,KAAK,YAAY;IACnB,CAAC,kBAAkB,CAAC;AAEvB,QAAO"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const require_profile_shapeTypes = require("../_ldo/profile.shapeTypes.cjs");
|
|
2
|
-
let _ldo_solid_react = require("@ldo/solid-react");
|
|
3
|
-
//#region src/react/useTypeIndexProfile.ts
|
|
4
|
-
function useTypeIndexProfile() {
|
|
5
|
-
const { session } = (0, _ldo_solid_react.useSolidAuth)();
|
|
6
|
-
(0, _ldo_solid_react.useResource)(session.webId, { subscribe: true });
|
|
7
|
-
return (0, _ldo_solid_react.useSubject)(require_profile_shapeTypes.TypeIndexProfileShapeType, session.webId);
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
exports.useTypeIndexProfile = useTypeIndexProfile;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTypeIndexProfile.d.cts","names":[],"sources":["../../src/react/useTypeIndexProfile.ts"],"mappings":";;;iBAIgB,mBAAA,CAAA,GAAuB,gBAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TypeIndexProfile } from "../_ldo/profile.typings.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/react/useTypeIndexProfile.d.ts
|
|
4
|
-
declare function useTypeIndexProfile(): TypeIndexProfile | undefined;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { useTypeIndexProfile };
|
|
7
|
-
//# sourceMappingURL=useTypeIndexProfile.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTypeIndexProfile.d.mts","names":[],"sources":["../../src/react/useTypeIndexProfile.ts"],"mappings":";;;iBAIgB,mBAAA,CAAA,GAAuB,gBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTypeIndexProfile.mjs","names":[],"sources":["../../src/react/useTypeIndexProfile.ts"],"sourcesContent":["import { useResource, useSolidAuth, useSubject } from \"@ldo/solid-react\";\nimport type { TypeIndexProfile } from \"../_ldo/profile.typings\";\nimport { TypeIndexProfileShapeType } from \"../_ldo/profile.shapeTypes\";\n\nexport function useTypeIndexProfile(): TypeIndexProfile | undefined {\n const { session } = useSolidAuth();\n useResource(session.webId, { subscribe: true });\n const profile = useSubject(TypeIndexProfileShapeType, session.webId);\n return profile;\n}\n"],"mappings":";;;AAIA,SAAgB,sBAAoD;CAClE,MAAM,EAAE,YAAY,cAAc;AAClC,aAAY,QAAQ,OAAO,EAAE,WAAW,MAAM,CAAC;AAE/C,QADgB,WAAW,2BAA2B,QAAQ,MAChD"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
let _ldo_solid_react = require("@ldo/solid-react");
|
|
2
|
-
let react = require("react");
|
|
3
|
-
//#region src/react/util/useSubscribeToUris.ts
|
|
4
|
-
function useSubscribeToUris(uris) {
|
|
5
|
-
const { dataset } = (0, _ldo_solid_react.useLdo)();
|
|
6
|
-
const currentlySubscribed = (0, react.useRef)({});
|
|
7
|
-
(0, react.useEffect)(() => {
|
|
8
|
-
const resources = uris.map((uri) => dataset.getResource(uri));
|
|
9
|
-
const previousSubscriptions = { ...currentlySubscribed.current };
|
|
10
|
-
Promise.all(resources.map(async (resource) => {
|
|
11
|
-
if (!previousSubscriptions[resource.uri]) {
|
|
12
|
-
await resource.readIfUnfetched();
|
|
13
|
-
currentlySubscribed.current[resource.uri] = await resource.subscribeToNotifications();
|
|
14
|
-
} else delete previousSubscriptions[resource.uri];
|
|
15
|
-
})).then(async () => {
|
|
16
|
-
await Promise.all(Object.entries(previousSubscriptions).map(async ([resourceUri, subscriptionId]) => {
|
|
17
|
-
delete currentlySubscribed.current[resourceUri];
|
|
18
|
-
await dataset.getResource(resourceUri).unsubscribeFromNotifications(subscriptionId);
|
|
19
|
-
}));
|
|
20
|
-
});
|
|
21
|
-
}, [uris]);
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
exports.useSubscribeToUris = useSubscribeToUris;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSubscribeToUris.mjs","names":[],"sources":["../../../src/react/util/useSubscribeToUris.ts"],"sourcesContent":["import { useLdo } from \"@ldo/solid-react\";\nimport { useEffect, useRef } from \"react\";\n\nexport function useSubscribeToUris(uris: string[]) {\n const { dataset } = useLdo();\n const currentlySubscribed = useRef<Record<string, string>>({});\n useEffect(() => {\n const resources = uris.map((uri) => dataset.getResource(uri));\n const previousSubscriptions = { ...currentlySubscribed.current };\n Promise.all<void>(\n resources.map(async (resource) => {\n if (!previousSubscriptions[resource.uri]) {\n // Read and subscribe\n await resource.readIfUnfetched();\n currentlySubscribed.current[resource.uri] =\n await resource.subscribeToNotifications();\n } else {\n delete previousSubscriptions[resource.uri];\n }\n }),\n ).then(async () => {\n // Unsubscribe from all remaining previous subscriptions\n await Promise.all(\n Object.entries(previousSubscriptions).map(\n async ([resourceUri, subscriptionId]) => {\n // Unsubscribe\n delete currentlySubscribed.current[resourceUri];\n const resource = dataset.getResource(resourceUri);\n await resource.unsubscribeFromNotifications(subscriptionId);\n },\n ),\n );\n });\n }, [uris]);\n}\n"],"mappings":";;;AAGA,SAAgB,mBAAmB,MAAgB;CACjD,MAAM,EAAE,YAAY,QAAQ;CAC5B,MAAM,sBAAsB,OAA+B,EAAE,CAAC;AAC9D,iBAAgB;EACd,MAAM,YAAY,KAAK,KAAK,QAAQ,QAAQ,YAAY,IAAI,CAAC;EAC7D,MAAM,wBAAwB,EAAE,GAAG,oBAAoB,SAAS;AAChE,UAAQ,IACN,UAAU,IAAI,OAAO,aAAa;AAChC,OAAI,CAAC,sBAAsB,SAAS,MAAM;AAExC,UAAM,SAAS,iBAAiB;AAChC,wBAAoB,QAAQ,SAAS,OACnC,MAAM,SAAS,0BAA0B;SAE3C,QAAO,sBAAsB,SAAS;IAExC,CACH,CAAC,KAAK,YAAY;AAEjB,SAAM,QAAQ,IACZ,OAAO,QAAQ,sBAAsB,CAAC,IACpC,OAAO,CAAC,aAAa,oBAAoB;AAEvC,WAAO,oBAAoB,QAAQ;AAEnC,UADiB,QAAQ,YAAY,YACvB,CAAC,6BAA6B,eAAe;KAE9D,CACF;IACD;IACD,CAAC,KAAK,CAAC"}
|