@twin.org/data-json-ld 0.0.1-next.27 → 0.0.1-next.28
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/cjs/index.cjs
CHANGED
|
@@ -1749,6 +1749,23 @@ class JsonLdProcessor {
|
|
|
1749
1749
|
? finalContext[0]
|
|
1750
1750
|
: finalContext;
|
|
1751
1751
|
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Add a context directly to the document loader cache.
|
|
1754
|
+
* @param url The url the ld context is for.
|
|
1755
|
+
* @param ldContext The context to add.
|
|
1756
|
+
* @returns Nothing.
|
|
1757
|
+
*/
|
|
1758
|
+
static async documentCacheAdd(url, ldContext) {
|
|
1759
|
+
await web.FetchHelper.setCacheEntry(url, ldContext);
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Remove a context from the document loader cache.
|
|
1763
|
+
* @param url The url the ld context is for.
|
|
1764
|
+
* @returns Nothing.
|
|
1765
|
+
*/
|
|
1766
|
+
static async documentCacheRemove(url) {
|
|
1767
|
+
await web.FetchHelper.removeCacheEntry(url);
|
|
1768
|
+
}
|
|
1752
1769
|
/**
|
|
1753
1770
|
* Document loader which uses a caching mechanism.
|
|
1754
1771
|
* @param url The document url to load.
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1747,6 +1747,23 @@ class JsonLdProcessor {
|
|
|
1747
1747
|
? finalContext[0]
|
|
1748
1748
|
: finalContext;
|
|
1749
1749
|
}
|
|
1750
|
+
/**
|
|
1751
|
+
* Add a context directly to the document loader cache.
|
|
1752
|
+
* @param url The url the ld context is for.
|
|
1753
|
+
* @param ldContext The context to add.
|
|
1754
|
+
* @returns Nothing.
|
|
1755
|
+
*/
|
|
1756
|
+
static async documentCacheAdd(url, ldContext) {
|
|
1757
|
+
await FetchHelper.setCacheEntry(url, ldContext);
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Remove a context from the document loader cache.
|
|
1761
|
+
* @param url The url the ld context is for.
|
|
1762
|
+
* @returns Nothing.
|
|
1763
|
+
*/
|
|
1764
|
+
static async documentCacheRemove(url) {
|
|
1765
|
+
await FetchHelper.removeCacheEntry(url);
|
|
1766
|
+
}
|
|
1750
1767
|
/**
|
|
1751
1768
|
* Document loader which uses a caching mechanism.
|
|
1752
1769
|
* @param url The document url to load.
|
|
@@ -64,4 +64,17 @@ export declare class JsonLdProcessor {
|
|
|
64
64
|
* @returns The updated contexts.
|
|
65
65
|
*/
|
|
66
66
|
static removeContexts(context: IJsonLdContextDefinitionRoot | undefined, match?: IJsonLdContextDefinitionElement[]): IJsonLdContextDefinitionRoot | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Add a context directly to the document loader cache.
|
|
69
|
+
* @param url The url the ld context is for.
|
|
70
|
+
* @param ldContext The context to add.
|
|
71
|
+
* @returns Nothing.
|
|
72
|
+
*/
|
|
73
|
+
static documentCacheAdd(url: string, ldContext: unknown): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Remove a context from the document loader cache.
|
|
76
|
+
* @param url The url the ld context is for.
|
|
77
|
+
* @returns Nothing.
|
|
78
|
+
*/
|
|
79
|
+
static documentCacheRemove(url: string): Promise<void>;
|
|
67
80
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -237,3 +237,53 @@ The element to try and match.
|
|
|
237
237
|
`undefined` \| [`IJsonLdContextDefinitionRoot`](../type-aliases/IJsonLdContextDefinitionRoot.md)
|
|
238
238
|
|
|
239
239
|
The updated contexts.
|
|
240
|
+
|
|
241
|
+
***
|
|
242
|
+
|
|
243
|
+
### documentCacheAdd()
|
|
244
|
+
|
|
245
|
+
> `static` **documentCacheAdd**(`url`, `ldContext`): `Promise`\<`void`\>
|
|
246
|
+
|
|
247
|
+
Add a context directly to the document loader cache.
|
|
248
|
+
|
|
249
|
+
#### Parameters
|
|
250
|
+
|
|
251
|
+
##### url
|
|
252
|
+
|
|
253
|
+
`string`
|
|
254
|
+
|
|
255
|
+
The url the ld context is for.
|
|
256
|
+
|
|
257
|
+
##### ldContext
|
|
258
|
+
|
|
259
|
+
`unknown`
|
|
260
|
+
|
|
261
|
+
The context to add.
|
|
262
|
+
|
|
263
|
+
#### Returns
|
|
264
|
+
|
|
265
|
+
`Promise`\<`void`\>
|
|
266
|
+
|
|
267
|
+
Nothing.
|
|
268
|
+
|
|
269
|
+
***
|
|
270
|
+
|
|
271
|
+
### documentCacheRemove()
|
|
272
|
+
|
|
273
|
+
> `static` **documentCacheRemove**(`url`): `Promise`\<`void`\>
|
|
274
|
+
|
|
275
|
+
Remove a context from the document loader cache.
|
|
276
|
+
|
|
277
|
+
#### Parameters
|
|
278
|
+
|
|
279
|
+
##### url
|
|
280
|
+
|
|
281
|
+
`string`
|
|
282
|
+
|
|
283
|
+
The url the ld context is for.
|
|
284
|
+
|
|
285
|
+
#### Returns
|
|
286
|
+
|
|
287
|
+
`Promise`\<`void`\>
|
|
288
|
+
|
|
289
|
+
Nothing.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/data-json-ld",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.28",
|
|
4
4
|
"description": "Models which define the structure of JSON LD",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
|
-
"@twin.org/data-core": "0.0.1-next.
|
|
18
|
+
"@twin.org/data-core": "0.0.1-next.28",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
21
|
"@twin.org/web": "next",
|