@ldo/solid-type-index 0.0.1-alpha.32 → 1.0.0-alpha.11

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.
Files changed (144) hide show
  1. package/dist/{.ldo → cjs/.ldo}/profile.context.js +5 -0
  2. package/dist/cjs/.ldo/profile.context.js.map +1 -0
  3. package/dist/{.ldo → cjs/.ldo}/profile.schema.js +5 -0
  4. package/dist/cjs/.ldo/profile.schema.js.map +1 -0
  5. package/dist/cjs/.ldo/profile.shapeTypes.js +19 -0
  6. package/dist/cjs/.ldo/profile.shapeTypes.js.map +1 -0
  7. package/dist/cjs/.ldo/profile.typings.js.map +1 -0
  8. package/dist/{.ldo → cjs/.ldo}/typeIndex.context.js +20 -1
  9. package/dist/cjs/.ldo/typeIndex.context.js.map +1 -0
  10. package/dist/{.ldo → cjs/.ldo}/typeIndex.schema.js +5 -0
  11. package/dist/cjs/.ldo/typeIndex.schema.js.map +1 -0
  12. package/dist/cjs/.ldo/typeIndex.shapeTypes.js +27 -0
  13. package/dist/cjs/.ldo/typeIndex.shapeTypes.js.map +1 -0
  14. package/dist/cjs/.ldo/typeIndex.typings.js.map +1 -0
  15. package/dist/cjs/constants.js.map +1 -0
  16. package/dist/{getTypeIndex.js → cjs/getTypeIndex.js} +21 -16
  17. package/dist/cjs/getTypeIndex.js.map +1 -0
  18. package/dist/{index.js → cjs/index.js} +4 -4
  19. package/dist/cjs/index.js.map +1 -0
  20. package/dist/cjs/react/useInstanceUris.js +33 -0
  21. package/dist/cjs/react/useInstanceUris.js.map +1 -0
  22. package/dist/{react → cjs/react}/useTypeIndexProfile.js +3 -4
  23. package/dist/cjs/react/useTypeIndexProfile.js.map +1 -0
  24. package/dist/{react → cjs/react}/util/useSubscribeToUris.js +4 -2
  25. package/dist/cjs/react/util/useSubscribeToUris.js.map +1 -0
  26. package/dist/cjs/setTypeIndex.js +163 -0
  27. package/dist/cjs/setTypeIndex.js.map +1 -0
  28. package/dist/cjs/util/Options.js +12 -0
  29. package/dist/cjs/util/Options.js.map +1 -0
  30. package/dist/esm/.ldo/profile.context.js +18 -0
  31. package/dist/esm/.ldo/profile.context.js.map +1 -0
  32. package/dist/esm/.ldo/profile.schema.js +61 -0
  33. package/dist/esm/.ldo/profile.schema.js.map +1 -0
  34. package/dist/esm/.ldo/profile.shapeTypes.js +16 -0
  35. package/dist/esm/.ldo/profile.shapeTypes.js.map +1 -0
  36. package/dist/esm/.ldo/profile.typings.js +2 -0
  37. package/dist/esm/.ldo/profile.typings.js.map +1 -0
  38. package/dist/esm/.ldo/typeIndex.context.js +63 -0
  39. package/dist/esm/.ldo/typeIndex.context.js.map +1 -0
  40. package/dist/esm/.ldo/typeIndex.schema.js +143 -0
  41. package/dist/esm/.ldo/typeIndex.schema.js.map +1 -0
  42. package/dist/esm/.ldo/typeIndex.shapeTypes.js +24 -0
  43. package/dist/esm/.ldo/typeIndex.shapeTypes.js.map +1 -0
  44. package/dist/esm/.ldo/typeIndex.typings.js +2 -0
  45. package/dist/esm/.ldo/typeIndex.typings.js.map +1 -0
  46. package/dist/esm/constants.js +6 -0
  47. package/dist/esm/constants.js.map +1 -0
  48. package/dist/esm/getTypeIndex.js +61 -0
  49. package/dist/esm/getTypeIndex.js.map +1 -0
  50. package/dist/esm/index.js +5 -0
  51. package/dist/esm/index.js.map +1 -0
  52. package/dist/esm/react/useInstanceUris.js +30 -0
  53. package/dist/esm/react/useInstanceUris.js.map +1 -0
  54. package/dist/esm/react/useTypeIndexProfile.js +9 -0
  55. package/dist/esm/react/useTypeIndexProfile.js.map +1 -0
  56. package/dist/esm/react/util/useSubscribeToUris.js +30 -0
  57. package/dist/esm/react/util/useSubscribeToUris.js.map +1 -0
  58. package/dist/esm/setTypeIndex.js +156 -0
  59. package/dist/esm/setTypeIndex.js.map +1 -0
  60. package/dist/esm/util/Options.js +9 -0
  61. package/dist/esm/util/Options.js.map +1 -0
  62. package/dist/types/.ldo/profile.context.d.ts +8 -0
  63. package/dist/types/.ldo/profile.context.d.ts.map +1 -0
  64. package/dist/types/.ldo/profile.schema.d.ts +8 -0
  65. package/dist/types/.ldo/profile.schema.d.ts.map +1 -0
  66. package/dist/types/.ldo/profile.shapeTypes.d.ts +12 -0
  67. package/dist/types/.ldo/profile.shapeTypes.d.ts.map +1 -0
  68. package/dist/types/.ldo/profile.typings.d.ts +26 -0
  69. package/dist/types/.ldo/profile.typings.d.ts.map +1 -0
  70. package/dist/types/.ldo/typeIndex.context.d.ts +8 -0
  71. package/dist/types/.ldo/typeIndex.context.d.ts.map +1 -0
  72. package/dist/types/.ldo/typeIndex.schema.d.ts +8 -0
  73. package/dist/types/.ldo/typeIndex.schema.d.ts.map +1 -0
  74. package/dist/types/.ldo/typeIndex.shapeTypes.d.ts +16 -0
  75. package/dist/types/.ldo/typeIndex.shapeTypes.d.ts.map +1 -0
  76. package/dist/types/.ldo/typeIndex.typings.d.ts +53 -0
  77. package/dist/types/.ldo/typeIndex.typings.d.ts.map +1 -0
  78. package/dist/{constants.d.ts → types/constants.d.ts} +1 -0
  79. package/dist/types/constants.d.ts.map +1 -0
  80. package/dist/types/getTypeIndex.d.ts +10 -0
  81. package/dist/types/getTypeIndex.d.ts.map +1 -0
  82. package/dist/types/index.d.ts +5 -0
  83. package/dist/types/index.d.ts.map +1 -0
  84. package/dist/types/react/useInstanceUris.d.ts +9 -0
  85. package/dist/types/react/useInstanceUris.d.ts.map +1 -0
  86. package/dist/types/react/useTypeIndexProfile.d.ts +3 -0
  87. package/dist/types/react/useTypeIndexProfile.d.ts.map +1 -0
  88. package/dist/{react → types/react}/util/useSubscribeToUris.d.ts +1 -0
  89. package/dist/types/react/util/useSubscribeToUris.d.ts.map +1 -0
  90. package/dist/types/setTypeIndex.d.ts +53 -0
  91. package/dist/types/setTypeIndex.d.ts.map +1 -0
  92. package/dist/types/util/Options.d.ts +11 -0
  93. package/dist/types/util/Options.d.ts.map +1 -0
  94. package/package.json +28 -21
  95. package/src/.ldo/profile.context.ts +1 -1
  96. package/src/.ldo/profile.shapeTypes.ts +3 -3
  97. package/src/.ldo/profile.typings.ts +6 -6
  98. package/src/.ldo/typeIndex.context.ts +16 -2
  99. package/src/.ldo/typeIndex.shapeTypes.ts +3 -3
  100. package/src/.ldo/typeIndex.typings.ts +9 -9
  101. package/src/getTypeIndex.ts +19 -18
  102. package/src/index.ts +4 -4
  103. package/src/react/useInstanceUris.ts +11 -9
  104. package/src/react/useTypeIndexProfile.ts +2 -2
  105. package/src/setTypeIndex.ts +60 -38
  106. package/src/util/Options.ts +8 -5
  107. package/dist/.ldo/profile.context.d.ts +0 -2
  108. package/dist/.ldo/profile.context.js.map +0 -1
  109. package/dist/.ldo/profile.schema.d.ts +0 -2
  110. package/dist/.ldo/profile.schema.js.map +0 -1
  111. package/dist/.ldo/profile.shapeTypes.d.ts +0 -3
  112. package/dist/.ldo/profile.shapeTypes.js +0 -11
  113. package/dist/.ldo/profile.shapeTypes.js.map +0 -1
  114. package/dist/.ldo/profile.typings.d.ts +0 -11
  115. package/dist/.ldo/profile.typings.js.map +0 -1
  116. package/dist/.ldo/typeIndex.context.d.ts +0 -2
  117. package/dist/.ldo/typeIndex.context.js.map +0 -1
  118. package/dist/.ldo/typeIndex.schema.d.ts +0 -2
  119. package/dist/.ldo/typeIndex.schema.js.map +0 -1
  120. package/dist/.ldo/typeIndex.shapeTypes.d.ts +0 -4
  121. package/dist/.ldo/typeIndex.shapeTypes.js +0 -16
  122. package/dist/.ldo/typeIndex.shapeTypes.js.map +0 -1
  123. package/dist/.ldo/typeIndex.typings.d.ts +0 -26
  124. package/dist/.ldo/typeIndex.typings.js.map +0 -1
  125. package/dist/constants.js.map +0 -1
  126. package/dist/getTypeIndex.d.ts +0 -8
  127. package/dist/getTypeIndex.js.map +0 -1
  128. package/dist/index.d.ts +0 -4
  129. package/dist/index.js.map +0 -1
  130. package/dist/react/useInstanceUris.d.ts +0 -2
  131. package/dist/react/useInstanceUris.js +0 -26
  132. package/dist/react/useInstanceUris.js.map +0 -1
  133. package/dist/react/useTypeIndexProfile.d.ts +0 -2
  134. package/dist/react/useTypeIndexProfile.js.map +0 -1
  135. package/dist/react/util/useSubscribeToUris.js.map +0 -1
  136. package/dist/setTypeIndex.d.ts +0 -14
  137. package/dist/setTypeIndex.js +0 -123
  138. package/dist/setTypeIndex.js.map +0 -1
  139. package/dist/util/Options.d.ts +0 -9
  140. package/dist/util/Options.js +0 -12
  141. package/dist/util/Options.js.map +0 -1
  142. /package/dist/{.ldo → cjs/.ldo}/profile.typings.js +0 -0
  143. /package/dist/{.ldo → cjs/.ldo}/typeIndex.typings.js +0 -0
  144. /package/dist/{constants.js → cjs/constants.js} +0 -0
@@ -0,0 +1,156 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { v4 } from "uuid";
3
+ import { FOR_CLASS, RDF_TYPE, TYPE_REGISTRATION } from "./constants.js";
4
+ import { guaranteeOptions } from "./util/Options.js";
5
+ import { namedNode, quad } from "@rdfjs/data-model";
6
+ import { getProfile } from "./getTypeIndex.js";
7
+ import { TypeIndexProfileShapeType } from "./.ldo/profile.shapeTypes.js";
8
+ import { set } from "@ldo/ldo";
9
+ import { TypeIndexDocumentShapeType, TypeRegistrationShapeType, } from "./.ldo/typeIndex.shapeTypes.js";
10
+ /**
11
+ * =============================================================================
12
+ * INITIALIZERS
13
+ * =============================================================================
14
+ */
15
+ export async function initTypeIndex(webId, options) {
16
+ const { dataset } = guaranteeOptions(options);
17
+ const profile = await getProfile(webId, options);
18
+ if (!profile.privateTypeIndex?.size || !profile.publicTypeIndex?.size) {
19
+ const profileFolder = await dataset
20
+ .getResource(webId)
21
+ .getParentContainer();
22
+ if (profileFolder?.isError)
23
+ throw profileFolder;
24
+ if (!profileFolder)
25
+ throw new Error("No folder to save the type indexes to.");
26
+ if (!profile.privateTypeIndex?.size) {
27
+ await createIndex(webId, profileFolder, dataset, true);
28
+ }
29
+ if (!profile.publicTypeIndex?.size) {
30
+ await createIndex(webId, profileFolder, dataset, false);
31
+ }
32
+ }
33
+ }
34
+ /**
35
+ * @internal
36
+ * @param webId
37
+ * @param profileFolder
38
+ * @param dataset
39
+ */
40
+ export async function createIndex(webId, profileFolder, dataset, isPrivate) {
41
+ // Create a private type index
42
+ const createResult = await profileFolder.createChildAndOverwrite(`${isPrivate ? "private" : "public"}_index_${v4()}`);
43
+ if (createResult.isError)
44
+ throw createResult;
45
+ const indexResource = createResult.resource;
46
+ const wacResult = await indexResource.setWac({
47
+ agent: {
48
+ [webId]: { read: true, write: true, append: true, control: true },
49
+ },
50
+ public: {
51
+ read: isPrivate ? false : true,
52
+ write: true,
53
+ append: true,
54
+ control: true,
55
+ },
56
+ authenticated: {
57
+ read: isPrivate ? false : true,
58
+ write: true,
59
+ append: true,
60
+ control: true,
61
+ },
62
+ });
63
+ if (wacResult.isError)
64
+ throw wacResult;
65
+ const transaction = dataset.startTransaction();
66
+ const cProfile = transaction
67
+ .usingType(TypeIndexProfileShapeType)
68
+ .write(dataset.getResource(webId).uri)
69
+ .fromSubject(webId);
70
+ if (isPrivate) {
71
+ cProfile.privateTypeIndex?.add({ "@id": indexResource.uri });
72
+ }
73
+ else {
74
+ cProfile.publicTypeIndex?.add({ "@id": indexResource.uri });
75
+ }
76
+ const cTypeIndex = transaction
77
+ .usingType(TypeIndexDocumentShapeType)
78
+ .write(indexResource.uri)
79
+ .fromSubject(indexResource.uri);
80
+ cTypeIndex.type = set({ "@id": "ListedDocument" }, { "@id": "TypeIndex" });
81
+ const commitResult = await transaction.commitToRemote();
82
+ if (commitResult.isError)
83
+ throw commitResult;
84
+ }
85
+ /**
86
+ * Adds an instance to a TypeRegistration
87
+ * @param indexUri The URI of the TypeIndex
88
+ * @param classUri The URI for the class the instance should be added to
89
+ * @param instances Objects representing the instances to add
90
+ * @param options Options
91
+ */
92
+ export function addRegistration(indexUri, classUri, instances, options) {
93
+ // Check to see if its already in the index
94
+ const typeRegistration = findAppropriateTypeRegistration(indexUri, classUri, options);
95
+ // Add instances to type registration
96
+ instances.instance?.forEach((instance) => {
97
+ typeRegistration.instance?.add({ "@id": instance });
98
+ });
99
+ instances.instanceContainer?.forEach((instanceContainer) => {
100
+ typeRegistration.instanceContainer?.add({ "@id": instanceContainer });
101
+ });
102
+ }
103
+ /**
104
+ * Removes instances from a TypeRegistration
105
+ * @param indexUri The URI of the TypeIndex
106
+ * @param classUri The URI for the class the instance should be removed from
107
+ * @param instances Objects representing the instances to remove
108
+ * @param options Options
109
+ */
110
+ export async function removeRegistration(indexUri, classUri, instances, options) {
111
+ // Check to see if its already in the index
112
+ const typeRegistration = findAppropriateTypeRegistration(indexUri, classUri, options);
113
+ // Add instances to type registration
114
+ instances.instance?.forEach((instanceUri) => {
115
+ typeRegistration.instance?.delete({ "@id": instanceUri });
116
+ });
117
+ instances.instanceContainer?.forEach((instanceContainerUri) => {
118
+ typeRegistration.instanceContainer?.delete({ "@id": instanceContainerUri });
119
+ });
120
+ }
121
+ /**
122
+ * Finds a TypeRegistration inside of a type index. If it doesn't exist, it
123
+ * creates one.
124
+ * @param indexUri The URI of the typeIndex
125
+ * @param classUri The URI of the class in question for the TypeRegistration
126
+ * @param options
127
+ * @returns The Type Index
128
+ */
129
+ export function findAppropriateTypeRegistration(indexUri, classUri, options) {
130
+ const { dataset } = guaranteeOptions(options);
131
+ // Check to see if its already in the index
132
+ const existingRegistrationsUris = dataset
133
+ .match(null, namedNode(RDF_TYPE), namedNode(TYPE_REGISTRATION), namedNode(indexUri))
134
+ .toArray()
135
+ .map((quad) => quad.subject);
136
+ const existingRegistrationForClassUri = existingRegistrationsUris.find((registrationUri) => {
137
+ return dataset.has(quad(registrationUri, namedNode(FOR_CLASS), namedNode(classUri), namedNode(indexUri)));
138
+ })?.value;
139
+ let typeRegistration;
140
+ if (existingRegistrationForClassUri) {
141
+ typeRegistration = dataset
142
+ .usingType(TypeRegistrationShapeType)
143
+ .write(indexUri)
144
+ .fromSubject(existingRegistrationForClassUri);
145
+ }
146
+ else {
147
+ typeRegistration = dataset
148
+ .usingType(TypeRegistrationShapeType)
149
+ .write(indexUri)
150
+ .fromSubject(`${indexUri}#${v4()}`);
151
+ typeRegistration.type = { "@id": "TypeRegistration" };
152
+ typeRegistration.forClass = { "@id": classUri };
153
+ }
154
+ return typeRegistration;
155
+ }
156
+ //# sourceMappingURL=setTypeIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setTypeIndex.js","sourceRoot":"","sources":["../../src/setTypeIndex.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAQ/B,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAa,EACb,OAAiB;IAEjB,MAAM,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC;QACtE,MAAM,aAAa,GAAG,MAAM,OAAO;aAChC,WAAW,CAAC,KAAyC,CAAC;aACtD,kBAAkB,EAAE,CAAC;QACxB,IAAI,aAAa,EAAE,OAAO;YAAE,M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D,KAAK,CACJ,IAAI,EACJ,SAAS,CAAC,QAAQ,CAAC,EACnB,SAAS,CAAC,iBAAiB,CAAC,EAC5B,SAAS,CAAC,QAAQ,CAAC,CACpB;SACA,OAAO,EAAE;SACT,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAgB,CAAC;IAE9C,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,IAAI,CACpE,CAAC,eAAe,EAAE,EAAE;QAClB,OAAO,OAAO,CAAC,GAAG,CAChB,IAAI,CACF,eAAe,EACf,SAAS,CAAC,SAAS,CAAC,EACpB,SAAS,CAAC,QAAQ,CAAC,EACnB,SAAS,CAAC,QAAQ,CAAC,CACpB,CACF,CAAC;IACJ,CAAC,CACF,EAAE,KAAK,CAAC;IAET,IAAI,gBAAkC,CAAC;IACvC,IAAI,+BAA+B,EAAE,CAAC;QACpC,gBAAgB,GAAG,OAAO;aACvB,SAAS,CAAC,yBAAyB,CAAC;aACpC,KAAK,CAAC,QAAQ,CAAC;aACf,WAAW,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,gBAAgB,GAAG,OAAO;aACvB,SAAS,CAAC,yBAAyB,CAAC;aACpC,KAAK,CAAC,QAAQ,CAAC;aACf,WAAW,CAAC,GAAG,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACtC,gBAAgB,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;QACtD,gBAAgB,CAAC,QAAQ,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { createSolidLdoDataset, guaranteeFetch } from "@ldo/connected-solid";
2
+ export function guaranteeOptions(options) {
3
+ const fetch = guaranteeFetch(options?.fetch);
4
+ const dataset = (options?.solidLdoDataset ??
5
+ createSolidLdoDataset());
6
+ dataset.setContext("solid", { fetch });
7
+ return { fetch, dataset };
8
+ }
9
+ //# sourceMappingURL=Options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Options.js","sourceRoot":"","sources":["../../../src/util/Options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAO7E,MAAM,UAAU,gBAAgB,CAAC,OAAiB;IAChD,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,eAAe;QACvC,qBAAqB,EAAE,CAAgD,CAAC;IAC1E,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACvC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC"}
@@ -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,5 @@
1
+ export * from "./getTypeIndex.js";
2
+ export * from "./setTypeIndex.js";
3
+ export * from "./react/useInstanceUris.js";
4
+ export * from "./react/useTypeIndexProfile.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -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,3 @@
1
+ import type { TypeIndexProfile } from "../.ldo/profile.typings.js";
2
+ export declare function useTypeIndexProfile(): TypeIndexProfile | undefined;
3
+ //# sourceMappingURL=useTypeIndexProfile.d.ts.map
@@ -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"}
@@ -1 +1,2 @@
1
1
  export declare function useSubscribeToUris(uris: string[]): void;
2
+ //# sourceMappingURL=useSubscribeToUris.d.ts.map
@@ -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": "0.0.1-alpha.32",
3
+ "version": "1.0.0-alpha.11",
4
4
  "description": "Solid Type Index support for LDO",
5
- "main": "dist/index.js",
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": "tsc --project tsconfig.build.json",
8
- "watch": "tsc --watch",
9
- "test": "npm run test:integration",
10
- "test:watch": "jest --watch",
11
- "prepublishOnly": "npm run test && npm run build",
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/ldobjects.git"
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/ldobjects/issues"
33
+ "url": "https://github.com/o-development/ldo/issues"
26
34
  },
27
- "homepage": "https://github.com/o-development/ldobjects/tree/main/packages/solid-react#readme",
35
+ "homepage": "https://github.com/o-development/ldo/tree/main/packages/solid-react#readme",
28
36
  "devDependencies": {
29
- "@ldo/rdf-utils": "^0.0.1-alpha.24",
37
+ "@ldo/rdf-utils": "^1.0.0-alpha.11",
38
+ "@ldo/test-solid-server": "^1.0.0-alpha.11",
30
39
  "@rdfjs/types": "^1.0.1",
31
40
  "@testing-library/react": "^14.1.2",
32
- "@types/jest": "^27.0.3",
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": "^0.0.1-alpha.32",
40
- "@ldo/solid-react": "^0.0.1-alpha.32"
46
+ "@ldo/connected-solid": "^1.0.0-alpha.11",
47
+ "@ldo/solid-react": "^1.0.0-alpha.11"
41
48
  },
42
49
  "files": [
43
50
  "dist",
@@ -46,5 +53,5 @@
46
53
  "publishConfig": {
47
54
  "access": "public"
48
55
  },
49
- "gitHead": "db1622a0660c8a7560726c5f7f9e8ddab6b122c5"
56
+ "gitHead": "84bd3d7cf0a1b28c5e20b019a6451973d69d0198"
50
57
  }
@@ -1,4 +1,4 @@
1
- import { LdoJsonldContext } from "@ldo/jsonld-dataset-proxy";
1
+ import { LdoJsonldContext } from "@ldo/ldo";
2
2
 
3
3
  /**
4
4
  * =============================================================================
@@ -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,4 +1,4 @@
1
- import { ContextDefinition } from "jsonld";
1
+ import { LdoJsonldContext, LdSet } from "@ldo/ldo";
2
2
 
3
3
  /**
4
4
  * =============================================================================
@@ -11,17 +11,17 @@ import { ContextDefinition } from "jsonld";
11
11
  */
12
12
  export interface TypeIndexProfile {
13
13
  "@id"?: string;
14
- "@context"?: ContextDefinition;
14
+ "@context"?: LdoJsonldContext;
15
15
  /**
16
16
  * A registry of all types used on the user's Pod (for private access only)
17
17
  */
18
- privateTypeIndex?: {
18
+ privateTypeIndex?: LdSet<{
19
19
  "@id": string;
20
- }[];
20
+ }>;
21
21
  /**
22
22
  * A registry of all types used on the user's Pod (for public access)
23
23
  */
24
- publicTypeIndex?: {
24
+ publicTypeIndex?: LdSet<{
25
25
  "@id": string;
26
- }[];
26
+ }>;
27
27
  }