@fnndsc/cumin 3.27.6 → 3.27.7
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/connect/chrisConnection.d.ts +2 -0
- package/dist/connect/chrisConnection.js +30 -11
- package/dist/connect/chrisConnection.js.map +1 -1
- package/dist/connect/loginFailure.d.ts +50 -0
- package/dist/connect/loginFailure.js +222 -0
- package/dist/connect/loginFailure.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
|
@@ -67,6 +67,8 @@ export declare class ChRISConnection {
|
|
|
67
67
|
* @param config - The connection configuration object.
|
|
68
68
|
* @param storageProvider - The storage provider for persistence.
|
|
69
69
|
*/
|
|
70
|
+
/** How a failed login asks the network what happened; a test stands one in. */
|
|
71
|
+
loginProbe: (url: string) => Promise<string | null>;
|
|
70
72
|
init(config: ConnectionConfig, storageProvider: IStorageProvider): void;
|
|
71
73
|
/**
|
|
72
74
|
* Establishes a connection to the ChRIS CUBE and authenticates the user.
|
|
@@ -19,6 +19,7 @@ const folderMemo_1 = require("../filebrowser/folderMemo");
|
|
|
19
19
|
const requestLedger_1 = require("../net/requestLedger");
|
|
20
20
|
const adapter_js_1 = require("../chrisapi/adapter.js");
|
|
21
21
|
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return adapter_js_1.Client; } });
|
|
22
|
+
const loginFailure_js_1 = require("./loginFailure.js");
|
|
22
23
|
const config_js_1 = require("../config/config.js");
|
|
23
24
|
const chrisContext_js_1 = require("../context/chrisContext.js");
|
|
24
25
|
const chrisIO_js_1 = require("../io/chrisIO.js");
|
|
@@ -54,6 +55,13 @@ class ChRISConnection {
|
|
|
54
55
|
this.chrisURL = null;
|
|
55
56
|
this.client = null;
|
|
56
57
|
this.elevatedClientContext = new node_async_hooks_1.AsyncLocalStorage();
|
|
58
|
+
/**
|
|
59
|
+
* Initializes the connection with configuration and storage provider.
|
|
60
|
+
* @param config - The connection configuration object.
|
|
61
|
+
* @param storageProvider - The storage provider for persistence.
|
|
62
|
+
*/
|
|
63
|
+
/** How a failed login asks the network what happened; a test stands one in. */
|
|
64
|
+
this.loginProbe = loginFailure_js_1.urlProbe;
|
|
57
65
|
// Every request the session makes is counted from the moment there is
|
|
58
66
|
// a session to make them (netstat reads the ledger).
|
|
59
67
|
(0, requestLedger_1.requestLedger_start)();
|
|
@@ -71,11 +79,6 @@ class ChRISConnection {
|
|
|
71
79
|
get config() {
|
|
72
80
|
return this._config;
|
|
73
81
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Initializes the connection with configuration and storage provider.
|
|
76
|
-
* @param config - The connection configuration object.
|
|
77
|
-
* @param storageProvider - The storage provider for persistence.
|
|
78
|
-
*/
|
|
79
82
|
init(config, storageProvider) {
|
|
80
83
|
this._config = config;
|
|
81
84
|
this.storageProvider = storageProvider;
|
|
@@ -114,11 +117,12 @@ class ChRISConnection {
|
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
119
|
catch (error) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
console.error(
|
|
121
|
-
|
|
120
|
+
// The real cause, said as what it is: only CUBE's refusal blames the
|
|
121
|
+
// credentials; an untrusted certificate or an unreachable host says so (#965).
|
|
122
|
+
const failure = await (0, loginFailure_js_1.loginFailure_diagnose)(error, authUrl, this.loginProbe);
|
|
123
|
+
console.error('');
|
|
124
|
+
for (const line of (0, loginFailure_js_1.loginFailure_lines)(failure, url))
|
|
125
|
+
console.error(line);
|
|
122
126
|
console.error("\nExiting to system with code 1...");
|
|
123
127
|
if (debug) {
|
|
124
128
|
throw error;
|
|
@@ -152,6 +156,10 @@ class ChRISConnection {
|
|
|
152
156
|
await client.getUser();
|
|
153
157
|
}
|
|
154
158
|
catch (error) {
|
|
159
|
+
const failure = await (0, loginFailure_js_1.loginFailure_diagnose)(error, url, this.loginProbe);
|
|
160
|
+
if (failure.kind === 'tls' || failure.kind === 'network') {
|
|
161
|
+
return { connected: false, reason: (0, loginFailure_js_1.loginFailure_lines)(failure, url).join(' ') };
|
|
162
|
+
}
|
|
155
163
|
const reason = error instanceof Error ? error.message : String(error);
|
|
156
164
|
return { connected: false, reason: `${url} refused the token for ${user}: ${reason}` };
|
|
157
165
|
}
|
|
@@ -304,7 +312,18 @@ class ChRISConnection {
|
|
|
304
312
|
const url = await this.chrisURL_get();
|
|
305
313
|
if (!url)
|
|
306
314
|
throw new Error('Not connected to ChRIS. Run connect first.');
|
|
307
|
-
|
|
315
|
+
let token;
|
|
316
|
+
try {
|
|
317
|
+
token = await (0, adapter_js_1.authToken_get)(`${url}auth-token/`, credentials.username, credentials.password);
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
// A refusal is the credentials' to answer for; a certificate or a
|
|
321
|
+
// network failure says what it is instead (#965).
|
|
322
|
+
const failure = await (0, loginFailure_js_1.loginFailure_diagnose)(error, `${url}auth-token/`, this.loginProbe);
|
|
323
|
+
if (failure.kind === 'tls' || failure.kind === 'network')
|
|
324
|
+
throw new Error((0, loginFailure_js_1.loginFailure_lines)(failure, url).join(' '));
|
|
325
|
+
throw error;
|
|
326
|
+
}
|
|
308
327
|
const elevatedClient = (0, adapter_js_1.client_create)(url, token);
|
|
309
328
|
return await this.elevatedClientContext.run(elevatedClient, operation);
|
|
310
329
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrisConnection.js","sourceRoot":"","sources":["../../src/connect/chrisConnection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;
|
|
1
|
+
{"version":3,"file":"chrisConnection.js","sourceRoot":"","sources":["../../src/connect/chrisConnection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;AAqcH,oDAKC;AAxcD,0DAAiE;AACjE,wDAA2D;AAC3D,uDAAsG;AAkB7F,uFAlBA,mBAAM,OAkBA;AAjBf,uDAA2G;AAC3G,mDAAsF;AACtF,gEAKoC;AAE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AAC,CAAC,wCAAwC;IAC5E,uBAAe,CAAC,IAAI,CAAC,4BAAgB,EAAE,eAAe,CAAC,CAAC;IACxD,oBAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC7C,OAAO,uBAAe,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** What kind of failure a login met. */
|
|
2
|
+
export type LoginFailureKind = 'credentials' | 'tls' | 'network' | 'other';
|
|
3
|
+
/** A login failure, classified. */
|
|
4
|
+
export interface LoginFailure {
|
|
5
|
+
kind: LoginFailureKind;
|
|
6
|
+
/** The network's or TLS's error code, when one was found. */
|
|
7
|
+
code?: string;
|
|
8
|
+
/** CUBE's HTTP status, when it answered. */
|
|
9
|
+
status?: number;
|
|
10
|
+
/** The most telling message found on the error. */
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Classifies a login error from what it carries: CUBE's status (400 or 401
|
|
15
|
+
* on `auth-token/`, 401 or 403 on a token), or a TLS or network code found
|
|
16
|
+
* anywhere down its `cause` chain. Nothing found is `other`.
|
|
17
|
+
*
|
|
18
|
+
* @param error - What the login threw.
|
|
19
|
+
* @returns The failure.
|
|
20
|
+
*/
|
|
21
|
+
export declare function loginFailure_classify(error: unknown): LoginFailure;
|
|
22
|
+
/**
|
|
23
|
+
* Asks the network about a URL once: the error code a plain GET meets, or
|
|
24
|
+
* null when anything answered (the host is there and its certificate holds).
|
|
25
|
+
*
|
|
26
|
+
* @param url - The URL.
|
|
27
|
+
* @param timeoutMs - How long to wait.
|
|
28
|
+
* @returns The code, or null.
|
|
29
|
+
*/
|
|
30
|
+
export declare function urlProbe(url: string, timeoutMs?: number): Promise<string | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Classifies a login error, asking the network once when the error itself
|
|
33
|
+
* carries neither CUBE's answer nor a code (chrisapi's "No server response!").
|
|
34
|
+
*
|
|
35
|
+
* @param error - What the login threw.
|
|
36
|
+
* @param url - The URL the login went to.
|
|
37
|
+
* @param probe - How the network is asked; {@link urlProbe} by default.
|
|
38
|
+
* @returns The failure.
|
|
39
|
+
*/
|
|
40
|
+
export declare function loginFailure_diagnose(error: unknown, url: string, probe?: (url: string) => Promise<string | null>): Promise<LoginFailure>;
|
|
41
|
+
/**
|
|
42
|
+
* What the operator reads about a login failure: the real cause, and what
|
|
43
|
+
* to do. Only CUBE's own refusal blames the credentials; an untrusted
|
|
44
|
+
* certificate names the CA setting (never a switch that turns checking off).
|
|
45
|
+
*
|
|
46
|
+
* @param failure - The failure.
|
|
47
|
+
* @param url - The CUBE the login went to.
|
|
48
|
+
* @returns The lines.
|
|
49
|
+
*/
|
|
50
|
+
export declare function loginFailure_lines(failure: LoginFailure, url: string): string[];
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.loginFailure_classify = loginFailure_classify;
|
|
37
|
+
exports.urlProbe = urlProbe;
|
|
38
|
+
exports.loginFailure_diagnose = loginFailure_diagnose;
|
|
39
|
+
exports.loginFailure_lines = loginFailure_lines;
|
|
40
|
+
/**
|
|
41
|
+
* @file Why a login failed, said as what it is (#965).
|
|
42
|
+
*
|
|
43
|
+
* Every login failure used to print one text that blamed the credentials:
|
|
44
|
+
* an untrusted TLS certificate, a host that does not resolve, a refused
|
|
45
|
+
* connection and a real "wrong password" all read "check your login
|
|
46
|
+
* credentials carefully", and an operator with the right password went
|
|
47
|
+
* looking for the wrong problem. A failure is classified first, and only
|
|
48
|
+
* CUBE's own refusal blames the credentials.
|
|
49
|
+
*
|
|
50
|
+
* chrisapi turns every failure without a response into "No server
|
|
51
|
+
* response!" and keeps none of the network's error code, so when nothing
|
|
52
|
+
* on the error says what happened, one plain request to the same URL asks
|
|
53
|
+
* the network again — on the failure path only, never on a login that works.
|
|
54
|
+
* Asked upstream to keep the cause (FNNDSC/fnndsc#108); once a release
|
|
55
|
+
* does, the probe has nothing left to find and can go.
|
|
56
|
+
*
|
|
57
|
+
* Dependency-free (Node's own http/https), so the door can use it too
|
|
58
|
+
* (`@fnndsc/cumin/login-failure`).
|
|
59
|
+
*
|
|
60
|
+
* @module
|
|
61
|
+
*/
|
|
62
|
+
const http = __importStar(require("node:http"));
|
|
63
|
+
const https = __importStar(require("node:https"));
|
|
64
|
+
/** Node's and OpenSSL's words for a certificate the client does not trust. */
|
|
65
|
+
const TLS_CODES = new Set([
|
|
66
|
+
'SELF_SIGNED_CERT_IN_CHAIN',
|
|
67
|
+
'DEPTH_ZERO_SELF_SIGNED_CERT',
|
|
68
|
+
'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
|
|
69
|
+
'UNABLE_TO_GET_ISSUER_CERT',
|
|
70
|
+
'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
|
|
71
|
+
'CERT_HAS_EXPIRED',
|
|
72
|
+
'CERT_NOT_YET_VALID',
|
|
73
|
+
'CERT_UNTRUSTED',
|
|
74
|
+
'CERT_REVOKED',
|
|
75
|
+
'CERT_SIGNATURE_FAILURE',
|
|
76
|
+
'ERR_TLS_CERT_ALTNAME_INVALID',
|
|
77
|
+
]);
|
|
78
|
+
/** The network's words for a CUBE that cannot be reached. */
|
|
79
|
+
const NETWORK_CODES = new Set([
|
|
80
|
+
'ENOTFOUND',
|
|
81
|
+
'EAI_AGAIN',
|
|
82
|
+
'ECONNREFUSED',
|
|
83
|
+
'ECONNRESET',
|
|
84
|
+
'ETIMEDOUT',
|
|
85
|
+
'EHOSTUNREACH',
|
|
86
|
+
'ENETUNREACH',
|
|
87
|
+
'UND_ERR_CONNECT_TIMEOUT',
|
|
88
|
+
'UND_ERR_SOCKET',
|
|
89
|
+
]);
|
|
90
|
+
/** Messages that say nothing about why (chrisapi's, fetch's). */
|
|
91
|
+
const GENERIC_MESSAGES = new Set(['No server response!', 'fetch failed', 'Bad server response!']);
|
|
92
|
+
/** The kind a code alone decides, or null. */
|
|
93
|
+
function kind_ofCode(code) {
|
|
94
|
+
if (TLS_CODES.has(code))
|
|
95
|
+
return 'tls';
|
|
96
|
+
if (NETWORK_CODES.has(code))
|
|
97
|
+
return 'network';
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Classifies a login error from what it carries: CUBE's status (400 or 401
|
|
102
|
+
* on `auth-token/`, 401 or 403 on a token), or a TLS or network code found
|
|
103
|
+
* anywhere down its `cause` chain. Nothing found is `other`.
|
|
104
|
+
*
|
|
105
|
+
* @param error - What the login threw.
|
|
106
|
+
* @returns The failure.
|
|
107
|
+
*/
|
|
108
|
+
function loginFailure_classify(error) {
|
|
109
|
+
let status;
|
|
110
|
+
let code;
|
|
111
|
+
let message;
|
|
112
|
+
let at = error;
|
|
113
|
+
for (let depth = 0; depth < 6 && at !== null && at !== undefined; depth++) {
|
|
114
|
+
if (typeof at === 'object') {
|
|
115
|
+
const node = at;
|
|
116
|
+
const found = node.response?.status ?? node.status;
|
|
117
|
+
if (status === undefined && typeof found === 'number')
|
|
118
|
+
status = found;
|
|
119
|
+
if (code === undefined && typeof node.code === 'string' && kind_ofCode(node.code) !== null)
|
|
120
|
+
code = node.code;
|
|
121
|
+
if (message === undefined && typeof node.message === 'string' && !GENERIC_MESSAGES.has(node.message))
|
|
122
|
+
message = node.message;
|
|
123
|
+
at = node.cause;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
if (message === undefined && typeof at === 'string')
|
|
127
|
+
message = at;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const said = message ?? (error instanceof Error ? error.message : String(error));
|
|
132
|
+
if (status !== undefined && [400, 401, 403].includes(status))
|
|
133
|
+
return { kind: 'credentials', status, message: said };
|
|
134
|
+
if (code !== undefined)
|
|
135
|
+
return { kind: kind_ofCode(code) ?? 'other', code, message: said };
|
|
136
|
+
return { kind: 'other', ...(status !== undefined ? { status } : {}), message: said };
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Asks the network about a URL once: the error code a plain GET meets, or
|
|
140
|
+
* null when anything answered (the host is there and its certificate holds).
|
|
141
|
+
*
|
|
142
|
+
* @param url - The URL.
|
|
143
|
+
* @param timeoutMs - How long to wait.
|
|
144
|
+
* @returns The code, or null.
|
|
145
|
+
*/
|
|
146
|
+
function urlProbe(url, timeoutMs = 8000) {
|
|
147
|
+
return new Promise((resolve) => {
|
|
148
|
+
let settled = false;
|
|
149
|
+
const settle = (code) => { if (!settled) {
|
|
150
|
+
settled = true;
|
|
151
|
+
resolve(code);
|
|
152
|
+
} };
|
|
153
|
+
try {
|
|
154
|
+
const client = url.startsWith('https:') ? https : http;
|
|
155
|
+
// A fresh connection, never a kept-alive one: the question is what a new connection meets.
|
|
156
|
+
const request = client.get(url, { agent: false }, (response) => { response.resume(); settle(null); });
|
|
157
|
+
request.setTimeout(timeoutMs, () => { request.destroy(); settle('ETIMEDOUT'); });
|
|
158
|
+
request.on('error', (error) => settle(typeof error.code === 'string' ? error.code : null));
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
settle(null);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Classifies a login error, asking the network once when the error itself
|
|
167
|
+
* carries neither CUBE's answer nor a code (chrisapi's "No server response!").
|
|
168
|
+
*
|
|
169
|
+
* @param error - What the login threw.
|
|
170
|
+
* @param url - The URL the login went to.
|
|
171
|
+
* @param probe - How the network is asked; {@link urlProbe} by default.
|
|
172
|
+
* @returns The failure.
|
|
173
|
+
*/
|
|
174
|
+
async function loginFailure_diagnose(error, url, probe = urlProbe) {
|
|
175
|
+
const failure = loginFailure_classify(error);
|
|
176
|
+
if (failure.kind !== 'other' || failure.status !== undefined)
|
|
177
|
+
return failure;
|
|
178
|
+
const code = await probe(url);
|
|
179
|
+
const kind = code === null ? null : kind_ofCode(code);
|
|
180
|
+
return kind === null ? failure : { kind, code: code, message: failure.message };
|
|
181
|
+
}
|
|
182
|
+
/** The host of a URL, or the URL when it does not parse. */
|
|
183
|
+
function host_of(url) {
|
|
184
|
+
try {
|
|
185
|
+
return new URL(url).host;
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
return url;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* What the operator reads about a login failure: the real cause, and what
|
|
193
|
+
* to do. Only CUBE's own refusal blames the credentials; an untrusted
|
|
194
|
+
* certificate names the CA setting (never a switch that turns checking off).
|
|
195
|
+
*
|
|
196
|
+
* @param failure - The failure.
|
|
197
|
+
* @param url - The CUBE the login went to.
|
|
198
|
+
* @returns The lines.
|
|
199
|
+
*/
|
|
200
|
+
function loginFailure_lines(failure, url) {
|
|
201
|
+
switch (failure.kind) {
|
|
202
|
+
case 'tls':
|
|
203
|
+
return [
|
|
204
|
+
`Could not log in to ${url}: the TLS certificate of ${host_of(url)} is not trusted (${failure.code}).`,
|
|
205
|
+
'If this CUBE uses a private CA, give Node that CA and try again:',
|
|
206
|
+
' NODE_EXTRA_CA_CERTS=/path/to/ca.pem',
|
|
207
|
+
];
|
|
208
|
+
case 'network':
|
|
209
|
+
return [
|
|
210
|
+
`Could not reach ${url} (${failure.code}).`,
|
|
211
|
+
'Check the URL, and that CUBE is up and reachable from this machine.',
|
|
212
|
+
];
|
|
213
|
+
case 'credentials':
|
|
214
|
+
return [
|
|
215
|
+
`${url} refused the login (HTTP ${failure.status}): the username or password is not right.`,
|
|
216
|
+
'If your password has special characters, check that your shell passes it as typed.',
|
|
217
|
+
];
|
|
218
|
+
case 'other':
|
|
219
|
+
return [`Could not log in to ${url}: ${failure.message}`];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=loginFailure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loginFailure.js","sourceRoot":"","sources":["../../src/connect/loginFailure.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,sDAsBC;AAUD,4BAcC;AAWD,sDAMC;AAoBD,gDAqBC;AA7LD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,gDAAkC;AAClC,kDAAoC;AAgBpC,8EAA8E;AAC9E,MAAM,SAAS,GAAwB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,OAAO,CAAC,MAAM,2CAA2C;gBAC3F,oFAAoF;aACrF,CAAC;QACJ,KAAK,OAAO;YACV,OAAO,CAAC,uBAAuB,GAAG,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./feeds/chrisFeed";
|
|
|
15
15
|
export * from "./feeds/chrisTags";
|
|
16
16
|
export * from "./feeds/chrisAccess";
|
|
17
17
|
export * from "./connect/chrisConnection";
|
|
18
|
+
export * from "./connect/loginFailure";
|
|
18
19
|
export * from "./context/chrisContext";
|
|
19
20
|
export * from "./plugins/chrisPlugins";
|
|
20
21
|
export * from "./plugins/chrisPluginMetaPlugins";
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __exportStar(require("./feeds/chrisFeed"), exports);
|
|
|
33
33
|
__exportStar(require("./feeds/chrisTags"), exports);
|
|
34
34
|
__exportStar(require("./feeds/chrisAccess"), exports);
|
|
35
35
|
__exportStar(require("./connect/chrisConnection"), exports);
|
|
36
|
+
__exportStar(require("./connect/loginFailure"), exports);
|
|
36
37
|
__exportStar(require("./context/chrisContext"), exports);
|
|
37
38
|
__exportStar(require("./plugins/chrisPlugins"), exports);
|
|
38
39
|
__exportStar(require("./plugins/chrisPluginMetaPlugins"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;AA6HH,4CAKC;AAhID,qCAAmB;AACnB,qDAAmC;AACnC,kDAAgC;AAChC,oDAAkC;AAClC,oDAAkC;AAClC,sDAAoC;AACpC,4DAA0C;AAC1C,yDAA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,gBAAgB,CAAC,GAAW;IAChD,MAAM,OAAO,GAAW,OAAO,CAAC;IAChC,wCAAwC;IACxC,6CAA6C;IAC7C,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAC5B,CAAC;AAED,gEAAgE;AAChE,qCAAqC;AACrC,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fnndsc/cumin",
|
|
3
|
-
"version": "3.27.
|
|
3
|
+
"version": "3.27.7",
|
|
4
4
|
"description": "Utility library for ChILI and other ChRIS-related JavaScript applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,7 +38,12 @@
|
|
|
38
38
|
"types": "./dist/output/runtimeOutput.d.ts",
|
|
39
39
|
"require": "./dist/output/runtimeOutput.js"
|
|
40
40
|
},
|
|
41
|
-
"./package.json": "./package.json"
|
|
41
|
+
"./package.json": "./package.json",
|
|
42
|
+
"./login-failure": {
|
|
43
|
+
"import": "./dist/connect/loginFailure.js",
|
|
44
|
+
"types": "./dist/connect/loginFailure.d.ts",
|
|
45
|
+
"require": "./dist/connect/loginFailure.js"
|
|
46
|
+
}
|
|
42
47
|
},
|
|
43
48
|
"scripts": {
|
|
44
49
|
"build": "rm -fr dist types && tsc && chmod +x ./dist/cli.js",
|