@fnndsc/cumin 3.25.0 → 3.27.0
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/cache/listCache.d.ts +35 -0
- package/dist/cache/listCache.js +62 -0
- package/dist/cache/listCache.js.map +1 -1
- package/dist/chrisapi/adapter.d.ts +1 -1
- package/dist/chrisapi/adapter.js.map +1 -1
- package/dist/chrisapi/contract.js +9 -1
- package/dist/chrisapi/contract.js.map +1 -1
- package/dist/connect/chrisConnection.js +7 -1
- package/dist/connect/chrisConnection.js.map +1 -1
- package/dist/feeds/chrisAccess.d.ts +44 -0
- package/dist/feeds/chrisAccess.js +156 -0
- package/dist/feeds/chrisAccess.js.map +1 -0
- package/dist/feeds/chrisTags.d.ts +94 -0
- package/dist/feeds/chrisTags.js +336 -0
- package/dist/feeds/chrisTags.js.map +1 -0
- package/dist/filebrowser/folderMemo.d.ts +20 -0
- package/dist/filebrowser/folderMemo.js +32 -0
- package/dist/filebrowser/folderMemo.js.map +1 -0
- package/dist/groups/chrisGroups.js +51 -4
- package/dist/groups/chrisGroups.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/net/requestLedger.d.ts +78 -0
- package/dist/net/requestLedger.js +158 -0
- package/dist/net/requestLedger.js.map +1 -0
- package/dist/pipelines/chrisPipeline.d.ts +5 -0
- package/dist/pipelines/chrisPipeline.js +107 -40
- package/dist/pipelines/chrisPipeline.js.map +1 -1
- package/dist/pipelines/pipelineMemo.d.ts +63 -0
- package/dist/pipelines/pipelineMemo.js +94 -0
- package/dist/pipelines/pipelineMemo.js.map +1 -0
- package/package.json +7 -2
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pipelineRecord_recall = pipelineRecord_recall;
|
|
4
|
+
exports.pipelineRecord_keep = pipelineRecord_keep;
|
|
5
|
+
exports.pipelineResource_recall = pipelineResource_recall;
|
|
6
|
+
exports.pipelineResource_keep = pipelineResource_keep;
|
|
7
|
+
exports.pipeline_forget = pipeline_forget;
|
|
8
|
+
exports.pipelineMemo_count = pipelineMemo_count;
|
|
9
|
+
/** Memos by client: a new connection starts empty. */
|
|
10
|
+
const memos = new WeakMap();
|
|
11
|
+
/**
|
|
12
|
+
* The memo of one client, made on first use.
|
|
13
|
+
*
|
|
14
|
+
* @param client - The connection's chrisapi client.
|
|
15
|
+
* @returns That client's memo.
|
|
16
|
+
*/
|
|
17
|
+
function memo_for(client) {
|
|
18
|
+
const kept = memos.get(client);
|
|
19
|
+
if (kept !== undefined)
|
|
20
|
+
return kept;
|
|
21
|
+
const made = { records: new Map(), resources: new Map() };
|
|
22
|
+
memos.set(client, made);
|
|
23
|
+
return made;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Recalls a resolution.
|
|
27
|
+
*
|
|
28
|
+
* @param client - The connection's chrisapi client.
|
|
29
|
+
* @param specifier - The name or id string that was asked.
|
|
30
|
+
* @returns The record, or null when this session never resolved it.
|
|
31
|
+
*/
|
|
32
|
+
function pipelineRecord_recall(client, specifier) {
|
|
33
|
+
return memo_for(client).records.get(specifier) ?? null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Keeps a resolution under the specifier asked and under the record's own
|
|
37
|
+
* name and id, so any of the three answers next time.
|
|
38
|
+
*
|
|
39
|
+
* @param client - The connection's chrisapi client.
|
|
40
|
+
* @param specifier - The name or id string that was asked.
|
|
41
|
+
* @param record - The record it resolved to.
|
|
42
|
+
*/
|
|
43
|
+
function pipelineRecord_keep(client, specifier, record) {
|
|
44
|
+
const memo = memo_for(client);
|
|
45
|
+
memo.records.set(specifier, record);
|
|
46
|
+
memo.records.set(record.name, record);
|
|
47
|
+
memo.records.set(String(record.id), record);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Recalls the chrisapi item of a pipeline.
|
|
51
|
+
*
|
|
52
|
+
* @param client - The connection's chrisapi client.
|
|
53
|
+
* @param pipelineID - The pipeline's id.
|
|
54
|
+
* @returns The item, or null when none was served this session.
|
|
55
|
+
*/
|
|
56
|
+
function pipelineResource_recall(client, pipelineID) {
|
|
57
|
+
return memo_for(client).resources.get(pipelineID) ?? null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Keeps the chrisapi item a search or a get served.
|
|
61
|
+
*
|
|
62
|
+
* @param client - The connection's chrisapi client.
|
|
63
|
+
* @param pipelineID - The pipeline's id.
|
|
64
|
+
* @param resource - The chrisapi pipeline item.
|
|
65
|
+
*/
|
|
66
|
+
function pipelineResource_keep(client, pipelineID, resource) {
|
|
67
|
+
memo_for(client).resources.set(pipelineID, resource);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Forgets one pipeline: its item and every specifier that resolved to it.
|
|
71
|
+
* Called when an item kept turns out not to answer (the pipeline was
|
|
72
|
+
* removed under the session), so the next ask resolves afresh.
|
|
73
|
+
*
|
|
74
|
+
* @param client - The connection's chrisapi client.
|
|
75
|
+
* @param pipelineID - The pipeline's id.
|
|
76
|
+
*/
|
|
77
|
+
function pipeline_forget(client, pipelineID) {
|
|
78
|
+
const memo = memo_for(client);
|
|
79
|
+
memo.resources.delete(pipelineID);
|
|
80
|
+
for (const [specifier, record] of memo.records) {
|
|
81
|
+
if (record.id === pipelineID)
|
|
82
|
+
memo.records.delete(specifier);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* How many resolutions a client's memo holds (for tests and readouts).
|
|
87
|
+
*
|
|
88
|
+
* @param client - The connection's chrisapi client.
|
|
89
|
+
* @returns The count of specifiers kept.
|
|
90
|
+
*/
|
|
91
|
+
function pipelineMemo_count(client) {
|
|
92
|
+
return memos.get(client)?.records.size ?? 0;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=pipelineMemo.js.map
|
|
@@ -0,0 +1 @@
|
|
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AAc,EAAE,UAAkB;IACxE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC;AAC5D,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,MAAc,EAAE,UAAkB,EAAE,QAAgB;IACxF,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,MAAc,EAAE,UAAkB;IAChE,MAAM,IAAI,GAAiB,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClC,KAAK,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAC/C,IAAI,MAAM,CAAC,EAAE,KAAK,UAAU;YAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,MAAc;IAC/C,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;AAC9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fnndsc/cumin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.0",
|
|
4
4
|
"description": "Utility library for ChILI and other ChRIS-related JavaScript applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"require": "./dist/index.js"
|
|
25
25
|
},
|
|
26
|
+
"./request-ledger": {
|
|
27
|
+
"import": "./dist/net/requestLedger.js",
|
|
28
|
+
"types": "./dist/net/requestLedger.d.ts",
|
|
29
|
+
"require": "./dist/net/requestLedger.js"
|
|
30
|
+
},
|
|
26
31
|
"./dicom-payload": {
|
|
27
32
|
"import": "./dist/pacs/dicomPayload.js",
|
|
28
33
|
"types": "./dist/pacs/dicomPayload.d.ts",
|
|
@@ -63,6 +68,6 @@
|
|
|
63
68
|
"@fnndsc/chrisapi": "^1.25.0",
|
|
64
69
|
"chalk": "^4.1.2",
|
|
65
70
|
"figlet": "^1.7.0",
|
|
66
|
-
"@fnndsc/menu": "^0.
|
|
71
|
+
"@fnndsc/menu": "^0.15.0"
|
|
67
72
|
}
|
|
68
73
|
}
|