@sasjs/api 0.19.0 → 0.20.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/build/browser.js +113 -19
- package/build/cjs/corpus/home.js +51 -0
- package/build/cjs/corpus/runner.js +3 -0
- package/build/cjs/home/service.js +103 -0
- package/build/cjs/host/dispatch.js +28 -8
- package/build/cjs/index.js +19 -12
- package/build/cjs/routes/overlay.js +11 -3
- package/build/esm/corpus/home.d.ts +27 -0
- package/build/esm/corpus/home.d.ts.map +1 -0
- package/build/esm/corpus/home.js +48 -0
- package/build/esm/corpus/runner.d.ts.map +1 -1
- package/build/esm/corpus/runner.js +3 -0
- package/build/esm/home/service.d.ts +69 -0
- package/build/esm/home/service.d.ts.map +1 -0
- package/build/esm/home/service.js +98 -0
- package/build/esm/host/dispatch.d.ts +19 -0
- package/build/esm/host/dispatch.d.ts.map +1 -1
- package/build/esm/host/dispatch.js +26 -7
- package/build/esm/index.d.ts +3 -0
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js +2 -0
- package/build/esm/routes/overlay.d.ts.map +1 -1
- package/build/esm/routes/overlay.js +11 -3
- package/package.json +1 -1
package/build/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @sasjs/api 0.
|
|
1
|
+
/* @sasjs/api 0.20.0 - the SASjs Server API, for a service worker. https://github.com/sasjs/api */
|
|
2
2
|
"use strict";
|
|
3
3
|
var SASjsApi = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -28,6 +28,7 @@ var SASjsApi = (() => {
|
|
|
28
28
|
AUTH_CONFIG_CORPUS: () => AUTH_CONFIG_CORPUS,
|
|
29
29
|
ApiError: () => ApiError,
|
|
30
30
|
BROWSER_INFO: () => BROWSER_INFO,
|
|
31
|
+
BUNDLE_NAME: () => BUNDLE_NAME,
|
|
31
32
|
CODE_CORPUS: () => CODE_CORPUS,
|
|
32
33
|
CODE_DEBUG: () => CODE_DEBUG,
|
|
33
34
|
DEFAULT_GRANTABLE_ROUTES: () => DEFAULT_GRANTABLE_ROUTES,
|
|
@@ -41,6 +42,7 @@ var SASjsApi = (() => {
|
|
|
41
42
|
DOCUMENTED_RUN_TIMES: () => DOCUMENTED_RUN_TIMES,
|
|
42
43
|
DRIVE_CORPUS: () => DRIVE_CORPUS,
|
|
43
44
|
HANDLED_ROUTES: () => HANDLED_ROUTES,
|
|
45
|
+
HOME_CORPUS: () => HOME_CORPUS,
|
|
44
46
|
IDENTITY_CORPUS: () => IDENTITY_CORPUS,
|
|
45
47
|
IDENTITY_FORMAT: () => IDENTITY_FORMAT,
|
|
46
48
|
INFO_CORPUS: () => INFO_CORPUS,
|
|
@@ -49,6 +51,7 @@ var SASjsApi = (() => {
|
|
|
49
51
|
MemoryIdentityStore: () => MemoryIdentityStore,
|
|
50
52
|
MemorySessionHost: () => MemorySessionHost,
|
|
51
53
|
MemorySessionRunner: () => MemorySessionRunner,
|
|
54
|
+
NO_WEB_BUILD: () => NO_WEB_BUILD,
|
|
52
55
|
OVERLAY: () => OVERLAY,
|
|
53
56
|
PROVIDER_MANAGED: () => PROVIDER_MANAGED,
|
|
54
57
|
RECORD_CORPUS: () => RECORD_CORPUS,
|
|
@@ -61,6 +64,7 @@ var SASjsApi = (() => {
|
|
|
61
64
|
basename: () => basename,
|
|
62
65
|
checkDeployTree: () => checkDeployTree,
|
|
63
66
|
createDriveService: () => createDriveService,
|
|
67
|
+
createHomeService: () => createHomeService,
|
|
64
68
|
createIdentityService: () => createIdentityService,
|
|
65
69
|
createInfoService: () => createInfoService,
|
|
66
70
|
createRecordService: () => createRecordService,
|
|
@@ -85,7 +89,8 @@ var SASjsApi = (() => {
|
|
|
85
89
|
sanitiseDisplayName: () => sanitiseDisplayName,
|
|
86
90
|
servicesFor: () => servicesFor,
|
|
87
91
|
topLevelRouteFor: () => topLevelRouteFor,
|
|
88
|
-
unpublishAppStream: () => unpublishAppStream
|
|
92
|
+
unpublishAppStream: () => unpublishAppStream,
|
|
93
|
+
withBundleVersion: () => withBundleVersion
|
|
89
94
|
});
|
|
90
95
|
|
|
91
96
|
// src/types.ts
|
|
@@ -2626,7 +2631,6 @@ var SASjsApi = (() => {
|
|
|
2626
2631
|
Client: ["identity"],
|
|
2627
2632
|
Web: ["identity"]
|
|
2628
2633
|
};
|
|
2629
|
-
var WEB_BUNDLE = "The host serves its own web bundle; there is no API decision here for this package to answer.";
|
|
2630
2634
|
var success = { status: "success" };
|
|
2631
2635
|
var user = {
|
|
2632
2636
|
uid: "",
|
|
@@ -2636,8 +2640,17 @@ var SASjsApi = (() => {
|
|
|
2636
2640
|
needsToUpdatePassword: false
|
|
2637
2641
|
};
|
|
2638
2642
|
var OVERLAY = {
|
|
2639
|
-
// Web - the sign-in pages the identity service answers, and the
|
|
2640
|
-
|
|
2643
|
+
// Web - the sign-in pages the identity service answers, and the shell itself.
|
|
2644
|
+
// The page is the host's file; the stamping rule that keeps a cached shell
|
|
2645
|
+
// from pinning an old bundle is the package's.
|
|
2646
|
+
"GET /": {
|
|
2647
|
+
implemented: true,
|
|
2648
|
+
// public: the shell is what an unauthenticated browser asks for first
|
|
2649
|
+
capabilities: [],
|
|
2650
|
+
responses: {
|
|
2651
|
+
200: "<html><head></head><body>Web Build is not present</body></html>"
|
|
2652
|
+
}
|
|
2653
|
+
},
|
|
2641
2654
|
"POST /SASLogon/login": {
|
|
2642
2655
|
implemented: true,
|
|
2643
2656
|
// The lockout and the provider failure are answered before the package is
|
|
@@ -3175,6 +3188,17 @@ var SASjsApi = (() => {
|
|
|
3175
3188
|
}
|
|
3176
3189
|
}
|
|
3177
3190
|
switch (routeId) {
|
|
3191
|
+
// The shell is a body, not JSON: an HTML page served with the content type
|
|
3192
|
+
// the document states, as it came from the host (stamped, if it references
|
|
3193
|
+
// a bundle).
|
|
3194
|
+
case "GET /": {
|
|
3195
|
+
if (!services.home)
|
|
3196
|
+
throw new ApiError(
|
|
3197
|
+
501,
|
|
3198
|
+
`This host has no home service, so it cannot answer ${routeId}.`
|
|
3199
|
+
);
|
|
3200
|
+
return { status: 200, contents: await services.home.home() };
|
|
3201
|
+
}
|
|
3178
3202
|
// The one answer a host states rather than derives: public, pre-auth, and
|
|
3179
3203
|
// read by the login screen before anything else.
|
|
3180
3204
|
case "GET /SASjsApi/info": {
|
|
@@ -3588,16 +3612,19 @@ var SASjsApi = (() => {
|
|
|
3588
3612
|
newPassword: String(body.newPassword ?? "")
|
|
3589
3613
|
});
|
|
3590
3614
|
return { status: 204 };
|
|
3591
|
-
default:
|
|
3592
|
-
|
|
3593
|
-
throw new ApiError(
|
|
3594
|
-
501,
|
|
3595
|
-
`This package has no handler for ${routeId}.${reason ? ` ${reason}` : ""}`
|
|
3596
|
-
);
|
|
3597
|
-
}
|
|
3615
|
+
default:
|
|
3616
|
+
throw noHandler(routeId);
|
|
3598
3617
|
}
|
|
3599
3618
|
};
|
|
3619
|
+
var noHandler = (routeId) => {
|
|
3620
|
+
const reason = routeById(routeId)?.reason;
|
|
3621
|
+
return new ApiError(
|
|
3622
|
+
501,
|
|
3623
|
+
`This package has no handler for ${routeId}.${reason ? ` ${reason}` : ""}`
|
|
3624
|
+
);
|
|
3625
|
+
};
|
|
3600
3626
|
var HANDLED_ROUTES = [
|
|
3627
|
+
"GET /",
|
|
3601
3628
|
"GET /SASjsApi/info",
|
|
3602
3629
|
"GET /SASjsApi/admin/diagnostics",
|
|
3603
3630
|
"GET /SASjsApi/admin/logs",
|
|
@@ -4369,6 +4396,72 @@ var SASjsApi = (() => {
|
|
|
4369
4396
|
}
|
|
4370
4397
|
];
|
|
4371
4398
|
|
|
4399
|
+
// src/corpus/home.ts
|
|
4400
|
+
var CORPUS_WEB_PAGE = {
|
|
4401
|
+
version: "4a26a3d1b2c3",
|
|
4402
|
+
html: [
|
|
4403
|
+
"<!doctype html>",
|
|
4404
|
+
"<html>",
|
|
4405
|
+
"<head>",
|
|
4406
|
+
' <script src="./index.bundle.js"></script>',
|
|
4407
|
+
' <script src="./vendor.js?v=keepme"></script>',
|
|
4408
|
+
' <link rel="stylesheet" href="./index.bundle.css" />',
|
|
4409
|
+
"</head>",
|
|
4410
|
+
"<body>",
|
|
4411
|
+
" <p>The page loads index.bundle.js from the folder beside it.</p>",
|
|
4412
|
+
' <div id="root"></div>',
|
|
4413
|
+
"</body>",
|
|
4414
|
+
"</html>"
|
|
4415
|
+
].join("\n")
|
|
4416
|
+
};
|
|
4417
|
+
var CORPUS_WEB_BODY = CORPUS_WEB_PAGE.html.replace(
|
|
4418
|
+
'./index.bundle.js"',
|
|
4419
|
+
`./index.bundle.js?v=${CORPUS_WEB_PAGE.version}"`
|
|
4420
|
+
);
|
|
4421
|
+
var HOME_CORPUS = [
|
|
4422
|
+
{
|
|
4423
|
+
id: "home-answers-the-stamped-shell",
|
|
4424
|
+
route: "GET /",
|
|
4425
|
+
description: "answers the shell with its bundle reference stamped, leaving prose and an already-versioned reference alone",
|
|
4426
|
+
request: {},
|
|
4427
|
+
expect: { status: 200, contents: CORPUS_WEB_BODY }
|
|
4428
|
+
}
|
|
4429
|
+
];
|
|
4430
|
+
|
|
4431
|
+
// src/home/service.ts
|
|
4432
|
+
var BUNDLE_NAME = "index.bundle.js";
|
|
4433
|
+
var NO_WEB_BUILD = "<html><head></head><body>Web Build is not present</body></html>";
|
|
4434
|
+
var FILE_ATTRIBUTE = /(\s(?:src|href)=)("[^"]*"|'[^']*'|[^\s>]+)/g;
|
|
4435
|
+
var BUNDLE_REFERENCE = new RegExp(
|
|
4436
|
+
`(^|/)${BUNDLE_NAME.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`
|
|
4437
|
+
);
|
|
4438
|
+
var withBundleVersion = (html, version) => html.replace(FILE_ATTRIBUTE, (match, attribute, value) => {
|
|
4439
|
+
const quote = value[0] === '"' || value[0] === "'" ? value[0] : "";
|
|
4440
|
+
const target = quote ? value.slice(1, -1) : value;
|
|
4441
|
+
if (!BUNDLE_REFERENCE.test(target) || target.includes("?")) return match;
|
|
4442
|
+
return `${attribute}${quote}${target}?v=${version}${quote}`;
|
|
4443
|
+
});
|
|
4444
|
+
var isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
4445
|
+
var pageOf = (page) => {
|
|
4446
|
+
if (!page || typeof page !== "object")
|
|
4447
|
+
throw new Error("The web page is not an object.");
|
|
4448
|
+
if (!isNonEmptyString(page.html))
|
|
4449
|
+
throw new Error(
|
|
4450
|
+
"The web page states no html, so there is nothing to serve. Answer `undefined` from the port when the host has no build."
|
|
4451
|
+
);
|
|
4452
|
+
if (!isNonEmptyString(page.version) || !/^[A-Za-z0-9._-]+$/.test(page.version))
|
|
4453
|
+
throw new Error(
|
|
4454
|
+
`The web page states version as ${JSON.stringify(page.version)}; it is the bundle's cache token, so it may contain only letters, digits, ".", "_" and "-" - anything else, a quote above all, would end the attribute it is written into.`
|
|
4455
|
+
);
|
|
4456
|
+
return withBundleVersion(page.html, page.version);
|
|
4457
|
+
};
|
|
4458
|
+
var createHomeService = (page) => ({
|
|
4459
|
+
async home() {
|
|
4460
|
+
const found = await page();
|
|
4461
|
+
return found === void 0 ? NO_WEB_BUILD : pageOf(found);
|
|
4462
|
+
}
|
|
4463
|
+
});
|
|
4464
|
+
|
|
4372
4465
|
// src/info/service.ts
|
|
4373
4466
|
var BROWSER_INFO = {
|
|
4374
4467
|
mode: "desktop",
|
|
@@ -4394,7 +4487,7 @@ var SASjsApi = (() => {
|
|
|
4394
4487
|
var REQUIRED_FIELDS = FIELDS.filter((field) => field !== "oidcProviderName");
|
|
4395
4488
|
var MODES = ["server", "desktop"];
|
|
4396
4489
|
var CORS_VALUES = ["enable", "disable"];
|
|
4397
|
-
var
|
|
4490
|
+
var isNonEmptyString2 = (value) => typeof value === "string" && value.length > 0;
|
|
4398
4491
|
var portOf = (value, name) => {
|
|
4399
4492
|
if (value === null || value === void 0) return null;
|
|
4400
4493
|
if (typeof value !== "number" || !Number.isInteger(value))
|
|
@@ -4413,7 +4506,7 @@ var SASjsApi = (() => {
|
|
|
4413
4506
|
`The info configuration states ${name} as ${JSON.stringify(value)}; the document states an array of strings.`
|
|
4414
4507
|
);
|
|
4415
4508
|
for (const entry of value)
|
|
4416
|
-
if (!
|
|
4509
|
+
if (!isNonEmptyString2(entry))
|
|
4417
4510
|
throw new Error(
|
|
4418
4511
|
`The info configuration states ${name} with an entry that is not a name: ${JSON.stringify(entry)}.`
|
|
4419
4512
|
);
|
|
@@ -4443,14 +4536,14 @@ var SASjsApi = (() => {
|
|
|
4443
4536
|
`The info configuration states cors as ${JSON.stringify(cors)}; the document states the CorsType enum - ${CORS_VALUES.map((value) => `\`${value}\``).join(" or ")}.`
|
|
4444
4537
|
);
|
|
4445
4538
|
const version = config.version;
|
|
4446
|
-
if (!
|
|
4539
|
+
if (!isNonEmptyString2(version) || version.trim() === "")
|
|
4447
4540
|
throw new Error(
|
|
4448
4541
|
`The info configuration states version as ${JSON.stringify(version)}; the document states the release that produced the build, such as \`v3.2.2 (4a26a3d)\`.`
|
|
4449
4542
|
);
|
|
4450
4543
|
const authProviders = namesOf(config.authProviders, "authProviders");
|
|
4451
4544
|
const runTimes = namesOf(config.runTimes, "runTimes");
|
|
4452
4545
|
const rawName = config.oidcProviderName;
|
|
4453
|
-
if (rawName !== void 0 && !
|
|
4546
|
+
if (rawName !== void 0 && !isNonEmptyString2(rawName))
|
|
4454
4547
|
throw new Error(
|
|
4455
4548
|
`The info configuration states oidcProviderName as ${JSON.stringify(rawName)}; the document states the sign-on button's label, or omits it.`
|
|
4456
4549
|
);
|
|
@@ -7926,13 +8019,13 @@ var SASjsApi = (() => {
|
|
|
7926
8019
|
});
|
|
7927
8020
|
|
|
7928
8021
|
// src/directory/service.ts
|
|
7929
|
-
var
|
|
8022
|
+
var isNonEmptyString3 = (value) => typeof value === "string" && value.length > 0;
|
|
7930
8023
|
var usersOf = (users) => {
|
|
7931
8024
|
if (!Array.isArray(users))
|
|
7932
8025
|
throw new Error("The directory answer has no users array.");
|
|
7933
8026
|
const seen = /* @__PURE__ */ new Set();
|
|
7934
8027
|
for (const user3 of users) {
|
|
7935
|
-
if (!
|
|
8028
|
+
if (!isNonEmptyString3(user3?.username) || !isNonEmptyString3(user3?.displayName))
|
|
7936
8029
|
throw new Error(
|
|
7937
8030
|
`The directory answer carries a user without a username or displayName: ${JSON.stringify(user3)}. Both are what the API keys an account on, so the import cannot guess them.`
|
|
7938
8031
|
);
|
|
@@ -7949,7 +8042,7 @@ var SASjsApi = (() => {
|
|
|
7949
8042
|
throw new Error("The directory answer has no groups array.");
|
|
7950
8043
|
const seen = /* @__PURE__ */ new Set();
|
|
7951
8044
|
for (const group of groups) {
|
|
7952
|
-
if (!
|
|
8045
|
+
if (!isNonEmptyString3(group?.name))
|
|
7953
8046
|
throw new Error(
|
|
7954
8047
|
`The directory answer carries a group without a name: ${JSON.stringify(group)}.`
|
|
7955
8048
|
);
|
|
@@ -8035,6 +8128,7 @@ var SASjsApi = (() => {
|
|
|
8035
8128
|
testCase.unwritable ? new RefusingDriveStore(testCase.seed || {}) : new MemoryDriveStore(testCase.seed || {})
|
|
8036
8129
|
),
|
|
8037
8130
|
info: createInfoService(BROWSER_INFO),
|
|
8131
|
+
home: createHomeService(async () => CORPUS_WEB_PAGE),
|
|
8038
8132
|
authConfig: createAuthConfigService(CORPUS_AUTH_CONFIG),
|
|
8039
8133
|
admin: createAdminService({
|
|
8040
8134
|
diagnostics: async () => CORPUS_DIAGNOSTICS,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOME_CORPUS = exports.CORPUS_WEB_BODY = exports.CORPUS_WEB_PAGE = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The shell the corpus host serves.
|
|
6
|
+
*
|
|
7
|
+
* A bundle reference the stamping rule must rewrite, a second reference that
|
|
8
|
+
* already carries a query string (left alone, which is what makes the transform
|
|
9
|
+
* idempotent), and the bundle's name in prose (left as prose). The page a real
|
|
10
|
+
* host reads looks like this; the values are a fixture so a case can pin the
|
|
11
|
+
* exact bytes.
|
|
12
|
+
*/
|
|
13
|
+
exports.CORPUS_WEB_PAGE = {
|
|
14
|
+
version: '4a26a3d1b2c3',
|
|
15
|
+
html: [
|
|
16
|
+
'<!doctype html>',
|
|
17
|
+
'<html>',
|
|
18
|
+
'<head>',
|
|
19
|
+
' <script src="./index.bundle.js"></script>',
|
|
20
|
+
' <script src="./vendor.js?v=keepme"></script>',
|
|
21
|
+
' <link rel="stylesheet" href="./index.bundle.css" />',
|
|
22
|
+
'</head>',
|
|
23
|
+
'<body>',
|
|
24
|
+
' <p>The page loads index.bundle.js from the folder beside it.</p>',
|
|
25
|
+
' <div id="root"></div>',
|
|
26
|
+
'</body>',
|
|
27
|
+
'</html>'
|
|
28
|
+
].join('\n')
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The body that page must answer with: the bundle reference stamped, the
|
|
32
|
+
* already-versioned one and the prose untouched.
|
|
33
|
+
*/
|
|
34
|
+
exports.CORPUS_WEB_BODY = exports.CORPUS_WEB_PAGE.html.replace('./index.bundle.js"', `./index.bundle.js?v=${exports.CORPUS_WEB_PAGE.version}"`);
|
|
35
|
+
/**
|
|
36
|
+
* The home corpus.
|
|
37
|
+
*
|
|
38
|
+
* The document states one status, `200` as `text/html`; what a client cannot see
|
|
39
|
+
* is that the page's bundle reference carries the build's token. That is what the
|
|
40
|
+
* case pins, because a browser holding the previous build is the failure this
|
|
41
|
+
* route exists to prevent.
|
|
42
|
+
*/
|
|
43
|
+
exports.HOME_CORPUS = [
|
|
44
|
+
{
|
|
45
|
+
id: 'home-answers-the-stamped-shell',
|
|
46
|
+
route: 'GET /',
|
|
47
|
+
description: 'answers the shell with its bundle reference stamped, leaving prose and an already-versioned reference alone',
|
|
48
|
+
request: {},
|
|
49
|
+
expect: { status: 200, contents: exports.CORPUS_WEB_BODY }
|
|
50
|
+
}
|
|
51
|
+
];
|
|
@@ -17,6 +17,8 @@ const service_js_8 = require("../directory/service.js");
|
|
|
17
17
|
const authconfig_js_1 = require("./authconfig.js");
|
|
18
18
|
const admin_js_1 = require("./admin.js");
|
|
19
19
|
const directory_js_1 = require("./directory.js");
|
|
20
|
+
const service_js_9 = require("../home/service.js");
|
|
21
|
+
const home_js_1 = require("./home.js");
|
|
20
22
|
const memory_store_js_2 = require("../identity/memory-store.js");
|
|
21
23
|
const fixture_js_1 = require("../identity/fixture.js");
|
|
22
24
|
const types_js_1 = require("../types.js");
|
|
@@ -45,6 +47,7 @@ const servicesFor = (testCase) => {
|
|
|
45
47
|
? new RefusingDriveStore(testCase.seed || {})
|
|
46
48
|
: new memory_store_js_1.MemoryDriveStore(testCase.seed || {})),
|
|
47
49
|
info: (0, service_js_5.createInfoService)(service_js_5.BROWSER_INFO),
|
|
50
|
+
home: (0, service_js_9.createHomeService)(async () => home_js_1.CORPUS_WEB_PAGE),
|
|
48
51
|
authConfig: (0, service_js_6.createAuthConfigService)(authconfig_js_1.CORPUS_AUTH_CONFIG),
|
|
49
52
|
admin: (0, service_js_7.createAdminService)({
|
|
50
53
|
diagnostics: async () => admin_js_1.CORPUS_DIAGNOSTICS,
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The web interface's shell - the one page every host serves at `/`.
|
|
4
|
+
*
|
|
5
|
+
* The document states what the route is for: "Serves the web interface's
|
|
6
|
+
* `index.html`, with the current bundle version appended so a returning browser
|
|
7
|
+
* loads the updated bundle." That is the whole decision, and it is the same one
|
|
8
|
+
* on every host:
|
|
9
|
+
*
|
|
10
|
+
* - the SPA bundle has a fixed name (`index.bundle.js`), so a browser that
|
|
11
|
+
* keeps the previous build cached goes on rendering the previous interface
|
|
12
|
+
* after an update. A login screen once kept offering a password form the new
|
|
13
|
+
* server refused, and only a cache-disabled reload showed the new screen. The
|
|
14
|
+
* token is derived from the bundle's contents, so it changes with every build
|
|
15
|
+
* and is stable within one;
|
|
16
|
+
* - only an attribute naming the bundle is rewritten, so the same words in
|
|
17
|
+
* prose are left as prose;
|
|
18
|
+
* - a reference that already carries a query string is left alone, so applying
|
|
19
|
+
* this twice cannot produce a second `?v=`;
|
|
20
|
+
* - a host with no build answers a page saying so, rather than an error: a
|
|
21
|
+
* missing bundle costs a stale page at worst, and must never be the reason a
|
|
22
|
+
* deployment cannot render its own app.
|
|
23
|
+
*
|
|
24
|
+
* The host still reads the file and computes the digest - a hash of a megabyte
|
|
25
|
+
* bundle is the host's to make, and the package compiles with no node built-ins
|
|
26
|
+
* and no DOM `crypto`. What it cannot be left to each host is the rule that
|
|
27
|
+
* turns the two into the page, which is why it lives here.
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.createHomeService = exports.withBundleVersion = exports.NO_WEB_BUILD = exports.BUNDLE_NAME = void 0;
|
|
31
|
+
/** The entry bundle the served page references. */
|
|
32
|
+
exports.BUNDLE_NAME = 'index.bundle.js';
|
|
33
|
+
/**
|
|
34
|
+
* What a host with no web build answers.
|
|
35
|
+
*
|
|
36
|
+
* A page rather than a `404`: the route is the interface, and an operator whose
|
|
37
|
+
* build did not land needs to see that from the browser rather than from a JSON
|
|
38
|
+
* error. The wording is sasjs/server's, so an adopting host changes nothing a
|
|
39
|
+
* user or a smoke test already reads.
|
|
40
|
+
*/
|
|
41
|
+
exports.NO_WEB_BUILD = '<html><head></head><body>Web Build is not present</body></html>';
|
|
42
|
+
/** An attribute whose value names a file; quoted or not, both are valid. */
|
|
43
|
+
const FILE_ATTRIBUTE = /(\s(?:src|href)=)("[^"]*"|'[^']*'|[^\s>]+)/g;
|
|
44
|
+
/**
|
|
45
|
+
* A reference that names the bundle file itself.
|
|
46
|
+
*
|
|
47
|
+
* Anchored at the end (and at a path boundary) rather than `includes`, so an
|
|
48
|
+
* asset whose name merely begins with the bundle's - `index.bundle.js.css` - is
|
|
49
|
+
* left alone: it is a different file, and stamping it would suggest the token
|
|
50
|
+
* described something it did not.
|
|
51
|
+
*/
|
|
52
|
+
const BUNDLE_REFERENCE = new RegExp(`(^|/)${exports.BUNDLE_NAME.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}$`);
|
|
53
|
+
/**
|
|
54
|
+
* The page with its bundle reference carrying that token.
|
|
55
|
+
*
|
|
56
|
+
* Only an attribute naming the bundle is rewritten. A reference that already
|
|
57
|
+
* carries a query string is left alone, so applying this twice is the same as
|
|
58
|
+
* applying it once.
|
|
59
|
+
*/
|
|
60
|
+
const withBundleVersion = (html, version) => html.replace(FILE_ATTRIBUTE, (match, attribute, value) => {
|
|
61
|
+
const quote = value[0] === '"' || value[0] === "'" ? value[0] : '';
|
|
62
|
+
const target = quote ? value.slice(1, -1) : value;
|
|
63
|
+
if (!BUNDLE_REFERENCE.test(target) || target.includes('?'))
|
|
64
|
+
return match;
|
|
65
|
+
return `${attribute}${quote}${target}?v=${version}${quote}`;
|
|
66
|
+
});
|
|
67
|
+
exports.withBundleVersion = withBundleVersion;
|
|
68
|
+
const isNonEmptyString = (value) => typeof value === 'string' && value.length > 0;
|
|
69
|
+
/**
|
|
70
|
+
* The page, checked and stamped.
|
|
71
|
+
*
|
|
72
|
+
* A version is a query-string token: whitespace or a `?`/`#` would produce a URL
|
|
73
|
+
* that does not resolve, and a host that computed one from the wrong input would
|
|
74
|
+
* otherwise serve a broken reference rather than noticing.
|
|
75
|
+
*/
|
|
76
|
+
const pageOf = (page) => {
|
|
77
|
+
if (!page || typeof page !== 'object')
|
|
78
|
+
throw new Error('The web page is not an object.');
|
|
79
|
+
if (!isNonEmptyString(page.html))
|
|
80
|
+
throw new Error('The web page states no html, so there is nothing to serve. Answer `undefined` from the port when the host has no build.');
|
|
81
|
+
// a token, not text: the value is written into a quoted attribute, so a
|
|
82
|
+
// quote closes it early and serves a broken reference - the failure this
|
|
83
|
+
// check exists to stop. A digest is `[0-9a-f]`, so the set below is strict
|
|
84
|
+
// enough to be safe and wide enough for any host's chosen encoding
|
|
85
|
+
if (!isNonEmptyString(page.version) ||
|
|
86
|
+
!/^[A-Za-z0-9._-]+$/.test(page.version))
|
|
87
|
+
throw new Error(`The web page states version as ${JSON.stringify(page.version)}; it is the bundle's cache token, so it may contain only letters, digits, ".", "_" and "-" - anything else, a quote above all, would end the attribute it is written into.`);
|
|
88
|
+
return (0, exports.withBundleVersion)(page.html, page.version);
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The home service, over the host's own page.
|
|
92
|
+
*
|
|
93
|
+
* The port answers `undefined` when this host has no web build - a packaged
|
|
94
|
+
* server whose build folder is absent, a host that only answers the API - and
|
|
95
|
+
* the service answers the documented page rather than an error.
|
|
96
|
+
*/
|
|
97
|
+
const createHomeService = (page) => ({
|
|
98
|
+
async home() {
|
|
99
|
+
const found = await page();
|
|
100
|
+
return found === undefined ? exports.NO_WEB_BUILD : pageOf(found);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
exports.createHomeService = createHomeService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HANDLED_ROUTES = exports.dispatch = void 0;
|
|
3
|
+
exports.HANDLED_ROUTES = exports.noHandler = exports.dispatch = void 0;
|
|
4
4
|
const index_js_1 = require("../routes/index.js");
|
|
5
5
|
const registry_js_1 = require("../drive/registry.js");
|
|
6
6
|
const types_js_1 = require("../types.js");
|
|
@@ -187,6 +187,14 @@ const dispatch = async (services, routeId, request = {}) => {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
switch (routeId) {
|
|
190
|
+
// The shell is a body, not JSON: an HTML page served with the content type
|
|
191
|
+
// the document states, as it came from the host (stamped, if it references
|
|
192
|
+
// a bundle).
|
|
193
|
+
case 'GET /': {
|
|
194
|
+
if (!services.home)
|
|
195
|
+
throw new types_js_1.ApiError(501, `This host has no home service, so it cannot answer ${routeId}.`);
|
|
196
|
+
return { status: 200, contents: await services.home.home() };
|
|
197
|
+
}
|
|
190
198
|
// The one answer a host states rather than derives: public, pre-auth, and
|
|
191
199
|
// read by the login screen before anything else.
|
|
192
200
|
case 'GET /SASjsApi/info': {
|
|
@@ -539,18 +547,30 @@ const dispatch = async (services, routeId, request = {}) => {
|
|
|
539
547
|
newPassword: String(body.newPassword ?? '')
|
|
540
548
|
});
|
|
541
549
|
return { status: 204 };
|
|
542
|
-
default:
|
|
543
|
-
|
|
544
|
-
// reading a 501 wants to know what the operation waits on, not only that
|
|
545
|
-
// it is missing.
|
|
546
|
-
const reason = (0, index_js_1.routeById)(routeId)?.reason;
|
|
547
|
-
throw new types_js_1.ApiError(501, `This package has no handler for ${routeId}.${reason ? ` ${reason}` : ''}`);
|
|
548
|
-
}
|
|
550
|
+
default:
|
|
551
|
+
throw (0, exports.noHandler)(routeId);
|
|
549
552
|
}
|
|
550
553
|
};
|
|
551
554
|
exports.dispatch = dispatch;
|
|
555
|
+
/**
|
|
556
|
+
* The refusal for an operation the table states and this file does not answer.
|
|
557
|
+
*
|
|
558
|
+
* Unreachable while every operation has a handler - `spec/routes.spec` asserts
|
|
559
|
+
* that the table's `implemented` set and `HANDLED_ROUTES` are the same list - but
|
|
560
|
+
* it is kept as the answer a future operation gets if it reaches the document
|
|
561
|
+
* before it reaches the dispatcher, rather than a promise that resolves
|
|
562
|
+
* `undefined`. The reason the table carries travels with it: a host developer
|
|
563
|
+
* reading a 501 wants to know what the operation waits on, not only that it is
|
|
564
|
+
* missing.
|
|
565
|
+
*/
|
|
566
|
+
const noHandler = (routeId) => {
|
|
567
|
+
const reason = (0, index_js_1.routeById)(routeId)?.reason;
|
|
568
|
+
return new types_js_1.ApiError(501, `This package has no handler for ${routeId}.${reason ? ` ${reason}` : ''}`);
|
|
569
|
+
};
|
|
570
|
+
exports.noHandler = noHandler;
|
|
552
571
|
/** Whether a route is one `dispatch` can answer today. */
|
|
553
572
|
exports.HANDLED_ROUTES = [
|
|
573
|
+
'GET /',
|
|
554
574
|
'GET /SASjsApi/info',
|
|
555
575
|
'GET /SASjsApi/admin/diagnostics',
|
|
556
576
|
'GET /SASjsApi/admin/logs',
|
package/build/cjs/index.js
CHANGED
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.servicesFor = exports.runCase = exports.PROVIDER_MANAGED = exports.ADMIN_SIGNED_IN = exports.RECORD_CORPUS = exports.unpublishAppStream = void 0;
|
|
17
|
+
exports.CODE_DEBUG = exports.MemorySessionHost = exports.DEFAULT_SESSIONS = exports.createSessionService = exports.SESSION_CORPUS = exports.DEPLOY_CORPUS = exports.IDENTITY_CORPUS = exports.DRIVE_CORPUS = exports.parseIdentity = exports.IDENTITY_FORMAT = exports.DEFAULT_IDENTITY = exports.MemoryIdentityStore = exports.normaliseInfo = exports.createInfoService = exports.BROWSER_INFO = exports.withBundleVersion = exports.createHomeService = exports.NO_WEB_BUILD = exports.BUNDLE_NAME = exports.HOME_CORPUS = exports.DIRECTORY_CORPUS = exports.AUTH_CONFIG_CORPUS = exports.ADMIN_CORPUS = exports.INFO_CORPUS = exports.CODE_CORPUS = exports.sanitiseDisplayName = exports.createRecordService = exports.createIdentityService = exports.HANDLED_ROUTES = exports.dispatch = exports.TAG_CAPABILITIES = exports.OVERLAY = exports.findRoute = exports.routeById = exports.ROUTES = exports.MemoryDriveStore = exports.measureDeployTree = exports.isDeployTree = exports.deployTree = exports.decodeBase64 = exports.checkDeployTree = exports.DEPLOY_SUCCESS = exports.DEPLOY_PAYLOAD_BYTES = exports.DEPLOY_LIMITS = exports.createDriveService = exports.isRoot = exports.basename = exports.dirname = exports.hasBlockedExtension = exports.normaliseDrivePath = void 0;
|
|
18
|
+
exports.servicesFor = exports.runCase = exports.PROVIDER_MANAGED = exports.ADMIN_SIGNED_IN = exports.RECORD_CORPUS = exports.unpublishAppStream = exports.MemoryAppStreamRegistry = exports.RUNTIME_CORPUS = exports.MemorySessionRunner = exports.createRuntimeService = exports.DOCUMENTED_RUN_TIMES = void 0;
|
|
19
19
|
/**
|
|
20
20
|
* `@sasjs/api` - the SASjs Server API described once.
|
|
21
21
|
*
|
|
@@ -78,10 +78,17 @@ var authconfig_js_1 = require("./corpus/authconfig.js");
|
|
|
78
78
|
Object.defineProperty(exports, "AUTH_CONFIG_CORPUS", { enumerable: true, get: function () { return authconfig_js_1.AUTH_CONFIG_CORPUS; } });
|
|
79
79
|
var directory_js_1 = require("./corpus/directory.js");
|
|
80
80
|
Object.defineProperty(exports, "DIRECTORY_CORPUS", { enumerable: true, get: function () { return directory_js_1.DIRECTORY_CORPUS; } });
|
|
81
|
-
var
|
|
82
|
-
Object.defineProperty(exports, "
|
|
83
|
-
|
|
84
|
-
Object.defineProperty(exports, "
|
|
81
|
+
var home_js_1 = require("./corpus/home.js");
|
|
82
|
+
Object.defineProperty(exports, "HOME_CORPUS", { enumerable: true, get: function () { return home_js_1.HOME_CORPUS; } });
|
|
83
|
+
var service_js_3 = require("./home/service.js");
|
|
84
|
+
Object.defineProperty(exports, "BUNDLE_NAME", { enumerable: true, get: function () { return service_js_3.BUNDLE_NAME; } });
|
|
85
|
+
Object.defineProperty(exports, "NO_WEB_BUILD", { enumerable: true, get: function () { return service_js_3.NO_WEB_BUILD; } });
|
|
86
|
+
Object.defineProperty(exports, "createHomeService", { enumerable: true, get: function () { return service_js_3.createHomeService; } });
|
|
87
|
+
Object.defineProperty(exports, "withBundleVersion", { enumerable: true, get: function () { return service_js_3.withBundleVersion; } });
|
|
88
|
+
var service_js_4 = require("./info/service.js");
|
|
89
|
+
Object.defineProperty(exports, "BROWSER_INFO", { enumerable: true, get: function () { return service_js_4.BROWSER_INFO; } });
|
|
90
|
+
Object.defineProperty(exports, "createInfoService", { enumerable: true, get: function () { return service_js_4.createInfoService; } });
|
|
91
|
+
Object.defineProperty(exports, "normaliseInfo", { enumerable: true, get: function () { return service_js_4.normaliseInfo; } });
|
|
85
92
|
var memory_store_js_2 = require("./identity/memory-store.js");
|
|
86
93
|
Object.defineProperty(exports, "MemoryIdentityStore", { enumerable: true, get: function () { return memory_store_js_2.MemoryIdentityStore; } });
|
|
87
94
|
var fixture_js_1 = require("./identity/fixture.js");
|
|
@@ -96,15 +103,15 @@ var deploy_js_2 = require("./corpus/deploy.js");
|
|
|
96
103
|
Object.defineProperty(exports, "DEPLOY_CORPUS", { enumerable: true, get: function () { return deploy_js_2.DEPLOY_CORPUS; } });
|
|
97
104
|
var session_js_1 = require("./corpus/session.js");
|
|
98
105
|
Object.defineProperty(exports, "SESSION_CORPUS", { enumerable: true, get: function () { return session_js_1.SESSION_CORPUS; } });
|
|
99
|
-
var
|
|
100
|
-
Object.defineProperty(exports, "createSessionService", { enumerable: true, get: function () { return
|
|
106
|
+
var service_js_5 = require("./session/service.js");
|
|
107
|
+
Object.defineProperty(exports, "createSessionService", { enumerable: true, get: function () { return service_js_5.createSessionService; } });
|
|
101
108
|
var memory_host_js_1 = require("./session/memory-host.js");
|
|
102
109
|
Object.defineProperty(exports, "DEFAULT_SESSIONS", { enumerable: true, get: function () { return memory_host_js_1.DEFAULT_SESSIONS; } });
|
|
103
110
|
Object.defineProperty(exports, "MemorySessionHost", { enumerable: true, get: function () { return memory_host_js_1.MemorySessionHost; } });
|
|
104
|
-
var
|
|
105
|
-
Object.defineProperty(exports, "CODE_DEBUG", { enumerable: true, get: function () { return
|
|
106
|
-
Object.defineProperty(exports, "DOCUMENTED_RUN_TIMES", { enumerable: true, get: function () { return
|
|
107
|
-
Object.defineProperty(exports, "createRuntimeService", { enumerable: true, get: function () { return
|
|
111
|
+
var service_js_6 = require("./runtime/service.js");
|
|
112
|
+
Object.defineProperty(exports, "CODE_DEBUG", { enumerable: true, get: function () { return service_js_6.CODE_DEBUG; } });
|
|
113
|
+
Object.defineProperty(exports, "DOCUMENTED_RUN_TIMES", { enumerable: true, get: function () { return service_js_6.DOCUMENTED_RUN_TIMES; } });
|
|
114
|
+
Object.defineProperty(exports, "createRuntimeService", { enumerable: true, get: function () { return service_js_6.createRuntimeService; } });
|
|
108
115
|
var memory_runner_js_1 = require("./runtime/memory-runner.js");
|
|
109
116
|
Object.defineProperty(exports, "MemorySessionRunner", { enumerable: true, get: function () { return memory_runner_js_1.MemorySessionRunner; } });
|
|
110
117
|
var runtime_js_1 = require("./corpus/runtime.js");
|
|
@@ -25,7 +25,6 @@ exports.TAG_CAPABILITIES = {
|
|
|
25
25
|
* operation waits on, and thirty copies of the same sentence would say the same
|
|
26
26
|
* thing thirty times.
|
|
27
27
|
*/
|
|
28
|
-
const WEB_BUNDLE = 'The host serves its own web bundle; there is no API decision here for this package to answer.';
|
|
29
28
|
const success = { status: 'success' };
|
|
30
29
|
const user = {
|
|
31
30
|
uid: '',
|
|
@@ -35,8 +34,17 @@ const user = {
|
|
|
35
34
|
needsToUpdatePassword: false
|
|
36
35
|
};
|
|
37
36
|
exports.OVERLAY = {
|
|
38
|
-
// Web - the sign-in pages the identity service answers, and the
|
|
39
|
-
|
|
37
|
+
// Web - the sign-in pages the identity service answers, and the shell itself.
|
|
38
|
+
// The page is the host's file; the stamping rule that keeps a cached shell
|
|
39
|
+
// from pinning an old bundle is the package's.
|
|
40
|
+
'GET /': {
|
|
41
|
+
implemented: true,
|
|
42
|
+
// public: the shell is what an unauthenticated browser asks for first
|
|
43
|
+
capabilities: [],
|
|
44
|
+
responses: {
|
|
45
|
+
200: '<html><head></head><body>Web Build is not present</body></html>'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
40
48
|
'POST /SASLogon/login': {
|
|
41
49
|
implemented: true,
|
|
42
50
|
// The lockout and the provider failure are answered before the package is
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CorpusCase } from './drive.js';
|
|
2
|
+
import type { WebPage } from '../home/service.js';
|
|
3
|
+
/**
|
|
4
|
+
* The shell the corpus host serves.
|
|
5
|
+
*
|
|
6
|
+
* A bundle reference the stamping rule must rewrite, a second reference that
|
|
7
|
+
* already carries a query string (left alone, which is what makes the transform
|
|
8
|
+
* idempotent), and the bundle's name in prose (left as prose). The page a real
|
|
9
|
+
* host reads looks like this; the values are a fixture so a case can pin the
|
|
10
|
+
* exact bytes.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CORPUS_WEB_PAGE: WebPage;
|
|
13
|
+
/**
|
|
14
|
+
* The body that page must answer with: the bundle reference stamped, the
|
|
15
|
+
* already-versioned one and the prose untouched.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CORPUS_WEB_BODY: string;
|
|
18
|
+
/**
|
|
19
|
+
* The home corpus.
|
|
20
|
+
*
|
|
21
|
+
* The document states one status, `200` as `text/html`; what a client cannot see
|
|
22
|
+
* is that the page's bundle reference carries the build's token. That is what the
|
|
23
|
+
* case pins, because a browser holding the previous build is the failure this
|
|
24
|
+
* route exists to prevent.
|
|
25
|
+
*/
|
|
26
|
+
export declare const HOME_CORPUS: CorpusCase[];
|
|
27
|
+
//# sourceMappingURL=home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../../src/corpus/home.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,OAgB7B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAG3B,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,UAAU,EASnC,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell the corpus host serves.
|
|
3
|
+
*
|
|
4
|
+
* A bundle reference the stamping rule must rewrite, a second reference that
|
|
5
|
+
* already carries a query string (left alone, which is what makes the transform
|
|
6
|
+
* idempotent), and the bundle's name in prose (left as prose). The page a real
|
|
7
|
+
* host reads looks like this; the values are a fixture so a case can pin the
|
|
8
|
+
* exact bytes.
|
|
9
|
+
*/
|
|
10
|
+
export const CORPUS_WEB_PAGE = {
|
|
11
|
+
version: '4a26a3d1b2c3',
|
|
12
|
+
html: [
|
|
13
|
+
'<!doctype html>',
|
|
14
|
+
'<html>',
|
|
15
|
+
'<head>',
|
|
16
|
+
' <script src="./index.bundle.js"></script>',
|
|
17
|
+
' <script src="./vendor.js?v=keepme"></script>',
|
|
18
|
+
' <link rel="stylesheet" href="./index.bundle.css" />',
|
|
19
|
+
'</head>',
|
|
20
|
+
'<body>',
|
|
21
|
+
' <p>The page loads index.bundle.js from the folder beside it.</p>',
|
|
22
|
+
' <div id="root"></div>',
|
|
23
|
+
'</body>',
|
|
24
|
+
'</html>'
|
|
25
|
+
].join('\n')
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The body that page must answer with: the bundle reference stamped, the
|
|
29
|
+
* already-versioned one and the prose untouched.
|
|
30
|
+
*/
|
|
31
|
+
export const CORPUS_WEB_BODY = CORPUS_WEB_PAGE.html.replace('./index.bundle.js"', `./index.bundle.js?v=${CORPUS_WEB_PAGE.version}"`);
|
|
32
|
+
/**
|
|
33
|
+
* The home corpus.
|
|
34
|
+
*
|
|
35
|
+
* The document states one status, `200` as `text/html`; what a client cannot see
|
|
36
|
+
* is that the page's bundle reference carries the build's token. That is what the
|
|
37
|
+
* case pins, because a browser holding the previous build is the failure this
|
|
38
|
+
* route exists to prevent.
|
|
39
|
+
*/
|
|
40
|
+
export const HOME_CORPUS = [
|
|
41
|
+
{
|
|
42
|
+
id: 'home-answers-the-stamped-shell',
|
|
43
|
+
route: 'GET /',
|
|
44
|
+
description: 'answers the shell with its bundle reference stamped, leaving prose and an already-versioned reference alone',
|
|
45
|
+
request: {},
|
|
46
|
+
expect: { status: 200, contents: CORPUS_WEB_BODY }
|
|
47
|
+
}
|
|
48
|
+
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/corpus/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/corpus/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAsBnD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAC9B,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,UAAU,KAAG,QA0ClD,CAAA;AA2BD;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAClB,UAAU,UAAU,EACpB,WAAU,QAAgC,KACzC,OAAO,CAAC,UAAU,CAepB,CAAA"}
|
|
@@ -14,6 +14,8 @@ import { createDirectoryService } from '../directory/service.js';
|
|
|
14
14
|
import { CORPUS_AUTH_CONFIG } from './authconfig.js';
|
|
15
15
|
import { CORPUS_DIAGNOSTICS, CORPUS_LOG, CORPUS_LOG_TAIL } from './admin.js';
|
|
16
16
|
import { CORPUS_DIRECTORY } from './directory.js';
|
|
17
|
+
import { createHomeService } from '../home/service.js';
|
|
18
|
+
import { CORPUS_WEB_PAGE } from './home.js';
|
|
17
19
|
import { MemoryIdentityStore } from '../identity/memory-store.js';
|
|
18
20
|
import { DEFAULT_IDENTITY } from '../identity/fixture.js';
|
|
19
21
|
import { isApiError } from '../types.js';
|
|
@@ -42,6 +44,7 @@ export const servicesFor = (testCase) => {
|
|
|
42
44
|
? new RefusingDriveStore(testCase.seed || {})
|
|
43
45
|
: new MemoryDriveStore(testCase.seed || {})),
|
|
44
46
|
info: createInfoService(BROWSER_INFO),
|
|
47
|
+
home: createHomeService(async () => CORPUS_WEB_PAGE),
|
|
45
48
|
authConfig: createAuthConfigService(CORPUS_AUTH_CONFIG),
|
|
46
49
|
admin: createAdminService({
|
|
47
50
|
diagnostics: async () => CORPUS_DIAGNOSTICS,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The web interface's shell - the one page every host serves at `/`.
|
|
3
|
+
*
|
|
4
|
+
* The document states what the route is for: "Serves the web interface's
|
|
5
|
+
* `index.html`, with the current bundle version appended so a returning browser
|
|
6
|
+
* loads the updated bundle." That is the whole decision, and it is the same one
|
|
7
|
+
* on every host:
|
|
8
|
+
*
|
|
9
|
+
* - the SPA bundle has a fixed name (`index.bundle.js`), so a browser that
|
|
10
|
+
* keeps the previous build cached goes on rendering the previous interface
|
|
11
|
+
* after an update. A login screen once kept offering a password form the new
|
|
12
|
+
* server refused, and only a cache-disabled reload showed the new screen. The
|
|
13
|
+
* token is derived from the bundle's contents, so it changes with every build
|
|
14
|
+
* and is stable within one;
|
|
15
|
+
* - only an attribute naming the bundle is rewritten, so the same words in
|
|
16
|
+
* prose are left as prose;
|
|
17
|
+
* - a reference that already carries a query string is left alone, so applying
|
|
18
|
+
* this twice cannot produce a second `?v=`;
|
|
19
|
+
* - a host with no build answers a page saying so, rather than an error: a
|
|
20
|
+
* missing bundle costs a stale page at worst, and must never be the reason a
|
|
21
|
+
* deployment cannot render its own app.
|
|
22
|
+
*
|
|
23
|
+
* The host still reads the file and computes the digest - a hash of a megabyte
|
|
24
|
+
* bundle is the host's to make, and the package compiles with no node built-ins
|
|
25
|
+
* and no DOM `crypto`. What it cannot be left to each host is the rule that
|
|
26
|
+
* turns the two into the page, which is why it lives here.
|
|
27
|
+
*/
|
|
28
|
+
/** The entry bundle the served page references. */
|
|
29
|
+
export declare const BUNDLE_NAME = "index.bundle.js";
|
|
30
|
+
/**
|
|
31
|
+
* What a host with no web build answers.
|
|
32
|
+
*
|
|
33
|
+
* A page rather than a `404`: the route is the interface, and an operator whose
|
|
34
|
+
* build did not land needs to see that from the browser rather than from a JSON
|
|
35
|
+
* error. The wording is sasjs/server's, so an adopting host changes nothing a
|
|
36
|
+
* user or a smoke test already reads.
|
|
37
|
+
*/
|
|
38
|
+
export declare const NO_WEB_BUILD = "<html><head></head><body>Web Build is not present</body></html>";
|
|
39
|
+
/** What the host hands over: the page it read, and the token it computed. */
|
|
40
|
+
export interface WebPage {
|
|
41
|
+
/** The shell document, as it was read. */
|
|
42
|
+
html: string;
|
|
43
|
+
/**
|
|
44
|
+
* The cache-busting token for the bundle the page references - a digest of the
|
|
45
|
+
* bundle's contents, twelve characters in sasjs/server's implementation.
|
|
46
|
+
*/
|
|
47
|
+
version: string;
|
|
48
|
+
}
|
|
49
|
+
export interface HomeService {
|
|
50
|
+
/** The page to send with a `200`, as `text/html`. */
|
|
51
|
+
home(): Promise<string>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The page with its bundle reference carrying that token.
|
|
55
|
+
*
|
|
56
|
+
* Only an attribute naming the bundle is rewritten. A reference that already
|
|
57
|
+
* carries a query string is left alone, so applying this twice is the same as
|
|
58
|
+
* applying it once.
|
|
59
|
+
*/
|
|
60
|
+
export declare const withBundleVersion: (html: string, version: string) => string;
|
|
61
|
+
/**
|
|
62
|
+
* The home service, over the host's own page.
|
|
63
|
+
*
|
|
64
|
+
* The port answers `undefined` when this host has no web build - a packaged
|
|
65
|
+
* server whose build folder is absent, a host that only answers the API - and
|
|
66
|
+
* the service answers the documented page rather than an error.
|
|
67
|
+
*/
|
|
68
|
+
export declare const createHomeService: (page: () => Promise<WebPage | undefined>) => HomeService;
|
|
69
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/home/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,mDAAmD;AACnD,eAAO,MAAM,WAAW,oBAAoB,CAAA;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,oEAC0C,CAAA;AAEnE,6EAA6E;AAC7E,MAAM,WAAW,OAAO;IACtB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;CACxB;AAiBD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,SAAS,MAAM,KAAG,MAQ9D,CAAA;AAoCJ;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,MAAM,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,KACvC,WAKD,CAAA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The web interface's shell - the one page every host serves at `/`.
|
|
3
|
+
*
|
|
4
|
+
* The document states what the route is for: "Serves the web interface's
|
|
5
|
+
* `index.html`, with the current bundle version appended so a returning browser
|
|
6
|
+
* loads the updated bundle." That is the whole decision, and it is the same one
|
|
7
|
+
* on every host:
|
|
8
|
+
*
|
|
9
|
+
* - the SPA bundle has a fixed name (`index.bundle.js`), so a browser that
|
|
10
|
+
* keeps the previous build cached goes on rendering the previous interface
|
|
11
|
+
* after an update. A login screen once kept offering a password form the new
|
|
12
|
+
* server refused, and only a cache-disabled reload showed the new screen. The
|
|
13
|
+
* token is derived from the bundle's contents, so it changes with every build
|
|
14
|
+
* and is stable within one;
|
|
15
|
+
* - only an attribute naming the bundle is rewritten, so the same words in
|
|
16
|
+
* prose are left as prose;
|
|
17
|
+
* - a reference that already carries a query string is left alone, so applying
|
|
18
|
+
* this twice cannot produce a second `?v=`;
|
|
19
|
+
* - a host with no build answers a page saying so, rather than an error: a
|
|
20
|
+
* missing bundle costs a stale page at worst, and must never be the reason a
|
|
21
|
+
* deployment cannot render its own app.
|
|
22
|
+
*
|
|
23
|
+
* The host still reads the file and computes the digest - a hash of a megabyte
|
|
24
|
+
* bundle is the host's to make, and the package compiles with no node built-ins
|
|
25
|
+
* and no DOM `crypto`. What it cannot be left to each host is the rule that
|
|
26
|
+
* turns the two into the page, which is why it lives here.
|
|
27
|
+
*/
|
|
28
|
+
/** The entry bundle the served page references. */
|
|
29
|
+
export const BUNDLE_NAME = 'index.bundle.js';
|
|
30
|
+
/**
|
|
31
|
+
* What a host with no web build answers.
|
|
32
|
+
*
|
|
33
|
+
* A page rather than a `404`: the route is the interface, and an operator whose
|
|
34
|
+
* build did not land needs to see that from the browser rather than from a JSON
|
|
35
|
+
* error. The wording is sasjs/server's, so an adopting host changes nothing a
|
|
36
|
+
* user or a smoke test already reads.
|
|
37
|
+
*/
|
|
38
|
+
export const NO_WEB_BUILD = '<html><head></head><body>Web Build is not present</body></html>';
|
|
39
|
+
/** An attribute whose value names a file; quoted or not, both are valid. */
|
|
40
|
+
const FILE_ATTRIBUTE = /(\s(?:src|href)=)("[^"]*"|'[^']*'|[^\s>]+)/g;
|
|
41
|
+
/**
|
|
42
|
+
* A reference that names the bundle file itself.
|
|
43
|
+
*
|
|
44
|
+
* Anchored at the end (and at a path boundary) rather than `includes`, so an
|
|
45
|
+
* asset whose name merely begins with the bundle's - `index.bundle.js.css` - is
|
|
46
|
+
* left alone: it is a different file, and stamping it would suggest the token
|
|
47
|
+
* described something it did not.
|
|
48
|
+
*/
|
|
49
|
+
const BUNDLE_REFERENCE = new RegExp(`(^|/)${BUNDLE_NAME.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}$`);
|
|
50
|
+
/**
|
|
51
|
+
* The page with its bundle reference carrying that token.
|
|
52
|
+
*
|
|
53
|
+
* Only an attribute naming the bundle is rewritten. A reference that already
|
|
54
|
+
* carries a query string is left alone, so applying this twice is the same as
|
|
55
|
+
* applying it once.
|
|
56
|
+
*/
|
|
57
|
+
export const withBundleVersion = (html, version) => html.replace(FILE_ATTRIBUTE, (match, attribute, value) => {
|
|
58
|
+
const quote = value[0] === '"' || value[0] === "'" ? value[0] : '';
|
|
59
|
+
const target = quote ? value.slice(1, -1) : value;
|
|
60
|
+
if (!BUNDLE_REFERENCE.test(target) || target.includes('?'))
|
|
61
|
+
return match;
|
|
62
|
+
return `${attribute}${quote}${target}?v=${version}${quote}`;
|
|
63
|
+
});
|
|
64
|
+
const isNonEmptyString = (value) => typeof value === 'string' && value.length > 0;
|
|
65
|
+
/**
|
|
66
|
+
* The page, checked and stamped.
|
|
67
|
+
*
|
|
68
|
+
* A version is a query-string token: whitespace or a `?`/`#` would produce a URL
|
|
69
|
+
* that does not resolve, and a host that computed one from the wrong input would
|
|
70
|
+
* otherwise serve a broken reference rather than noticing.
|
|
71
|
+
*/
|
|
72
|
+
const pageOf = (page) => {
|
|
73
|
+
if (!page || typeof page !== 'object')
|
|
74
|
+
throw new Error('The web page is not an object.');
|
|
75
|
+
if (!isNonEmptyString(page.html))
|
|
76
|
+
throw new Error('The web page states no html, so there is nothing to serve. Answer `undefined` from the port when the host has no build.');
|
|
77
|
+
// a token, not text: the value is written into a quoted attribute, so a
|
|
78
|
+
// quote closes it early and serves a broken reference - the failure this
|
|
79
|
+
// check exists to stop. A digest is `[0-9a-f]`, so the set below is strict
|
|
80
|
+
// enough to be safe and wide enough for any host's chosen encoding
|
|
81
|
+
if (!isNonEmptyString(page.version) ||
|
|
82
|
+
!/^[A-Za-z0-9._-]+$/.test(page.version))
|
|
83
|
+
throw new Error(`The web page states version as ${JSON.stringify(page.version)}; it is the bundle's cache token, so it may contain only letters, digits, ".", "_" and "-" - anything else, a quote above all, would end the attribute it is written into.`);
|
|
84
|
+
return withBundleVersion(page.html, page.version);
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* The home service, over the host's own page.
|
|
88
|
+
*
|
|
89
|
+
* The port answers `undefined` when this host has no web build - a packaged
|
|
90
|
+
* server whose build folder is absent, a host that only answers the API - and
|
|
91
|
+
* the service answers the documented page rather than an error.
|
|
92
|
+
*/
|
|
93
|
+
export const createHomeService = (page) => ({
|
|
94
|
+
async home() {
|
|
95
|
+
const found = await page();
|
|
96
|
+
return found === undefined ? NO_WEB_BUILD : pageOf(found);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
@@ -9,7 +9,9 @@ import type { InfoService } from '../info/service.js';
|
|
|
9
9
|
import type { AuthConfigService } from '../authconfig/service.js';
|
|
10
10
|
import type { AdminService } from '../admin/service.js';
|
|
11
11
|
import type { DirectoryService } from '../directory/service.js';
|
|
12
|
+
import type { HomeService } from '../home/service.js';
|
|
12
13
|
import type { Subject } from '../identity/types.js';
|
|
14
|
+
import { ApiError } from '../types.js';
|
|
13
15
|
export interface ApiRequest {
|
|
14
16
|
query?: Record<string, string | undefined>;
|
|
15
17
|
body?: Record<string, unknown>;
|
|
@@ -73,6 +75,11 @@ export interface Services {
|
|
|
73
75
|
* the connection is the host's.
|
|
74
76
|
*/
|
|
75
77
|
directory?: DirectoryService;
|
|
78
|
+
/**
|
|
79
|
+
* The web interface's shell. Absent, `GET /` answers 501: the page is a file
|
|
80
|
+
* only the host holds.
|
|
81
|
+
*/
|
|
82
|
+
home?: HomeService;
|
|
76
83
|
drive: DriveService;
|
|
77
84
|
/**
|
|
78
85
|
* Users, clients and tokens. A host without one answers 501 for the identity
|
|
@@ -99,6 +106,18 @@ export interface Services {
|
|
|
99
106
|
registry?: AppStreamRegistry;
|
|
100
107
|
}
|
|
101
108
|
export declare const dispatch: (services: Services, routeId: string, request?: ApiRequest) => Promise<ApiResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* The refusal for an operation the table states and this file does not answer.
|
|
111
|
+
*
|
|
112
|
+
* Unreachable while every operation has a handler - `spec/routes.spec` asserts
|
|
113
|
+
* that the table's `implemented` set and `HANDLED_ROUTES` are the same list - but
|
|
114
|
+
* it is kept as the answer a future operation gets if it reaches the document
|
|
115
|
+
* before it reaches the dispatcher, rather than a promise that resolves
|
|
116
|
+
* `undefined`. The reason the table carries travels with it: a host developer
|
|
117
|
+
* reading a 501 wants to know what the operation waits on, not only that it is
|
|
118
|
+
* missing.
|
|
119
|
+
*/
|
|
120
|
+
export declare const noHandler: (routeId: string) => ApiError;
|
|
102
121
|
/** Whether a route is one `dispatch` can answer today. */
|
|
103
122
|
export declare const HANDLED_ROUTES: string[];
|
|
104
123
|
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/host/dispatch.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CA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AAC,WAAW,CA4oBrB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,KAAG,QAO3C,CAAA;AAED,0DAA0D;AAC1D,eAAO,MAAM,cAAc,EAAE,MAAM,EA8DlC,CAAA"}
|
|
@@ -184,6 +184,14 @@ export const dispatch = async (services, routeId, request = {}) => {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
switch (routeId) {
|
|
187
|
+
// The shell is a body, not JSON: an HTML page served with the content type
|
|
188
|
+
// the document states, as it came from the host (stamped, if it references
|
|
189
|
+
// a bundle).
|
|
190
|
+
case 'GET /': {
|
|
191
|
+
if (!services.home)
|
|
192
|
+
throw new ApiError(501, `This host has no home service, so it cannot answer ${routeId}.`);
|
|
193
|
+
return { status: 200, contents: await services.home.home() };
|
|
194
|
+
}
|
|
187
195
|
// The one answer a host states rather than derives: public, pre-auth, and
|
|
188
196
|
// read by the login screen before anything else.
|
|
189
197
|
case 'GET /SASjsApi/info': {
|
|
@@ -536,17 +544,28 @@ export const dispatch = async (services, routeId, request = {}) => {
|
|
|
536
544
|
newPassword: String(body.newPassword ?? '')
|
|
537
545
|
});
|
|
538
546
|
return { status: 204 };
|
|
539
|
-
default:
|
|
540
|
-
|
|
541
|
-
// reading a 501 wants to know what the operation waits on, not only that
|
|
542
|
-
// it is missing.
|
|
543
|
-
const reason = routeById(routeId)?.reason;
|
|
544
|
-
throw new ApiError(501, `This package has no handler for ${routeId}.${reason ? ` ${reason}` : ''}`);
|
|
545
|
-
}
|
|
547
|
+
default:
|
|
548
|
+
throw noHandler(routeId);
|
|
546
549
|
}
|
|
547
550
|
};
|
|
551
|
+
/**
|
|
552
|
+
* The refusal for an operation the table states and this file does not answer.
|
|
553
|
+
*
|
|
554
|
+
* Unreachable while every operation has a handler - `spec/routes.spec` asserts
|
|
555
|
+
* that the table's `implemented` set and `HANDLED_ROUTES` are the same list - but
|
|
556
|
+
* it is kept as the answer a future operation gets if it reaches the document
|
|
557
|
+
* before it reaches the dispatcher, rather than a promise that resolves
|
|
558
|
+
* `undefined`. The reason the table carries travels with it: a host developer
|
|
559
|
+
* reading a 501 wants to know what the operation waits on, not only that it is
|
|
560
|
+
* missing.
|
|
561
|
+
*/
|
|
562
|
+
export const noHandler = (routeId) => {
|
|
563
|
+
const reason = routeById(routeId)?.reason;
|
|
564
|
+
return new ApiError(501, `This package has no handler for ${routeId}.${reason ? ` ${reason}` : ''}`);
|
|
565
|
+
};
|
|
548
566
|
/** Whether a route is one `dispatch` can answer today. */
|
|
549
567
|
export const HANDLED_ROUTES = [
|
|
568
|
+
'GET /',
|
|
550
569
|
'GET /SASjsApi/info',
|
|
551
570
|
'GET /SASjsApi/admin/diagnostics',
|
|
552
571
|
'GET /SASjsApi/admin/logs',
|
package/build/esm/index.d.ts
CHANGED
|
@@ -34,6 +34,9 @@ export { INFO_CORPUS } from './corpus/info.js';
|
|
|
34
34
|
export { ADMIN_CORPUS } from './corpus/admin.js';
|
|
35
35
|
export { AUTH_CONFIG_CORPUS } from './corpus/authconfig.js';
|
|
36
36
|
export { DIRECTORY_CORPUS } from './corpus/directory.js';
|
|
37
|
+
export { HOME_CORPUS } from './corpus/home.js';
|
|
38
|
+
export { BUNDLE_NAME, NO_WEB_BUILD, createHomeService, withBundleVersion } from './home/service.js';
|
|
39
|
+
export type { HomeService, WebPage } from './home/service.js';
|
|
37
40
|
export { BROWSER_INFO, createInfoService, normaliseInfo } from './info/service.js';
|
|
38
41
|
export type { InfoResponse, InfoService } from './info/service.js';
|
|
39
42
|
export type { AuthorizedRoutesResponse, GroupDetailsResponse, GroupResponse, PermissionResponse, RecordServiceOptions, RecordService, UserDetailsResponse, UserResponse } from './identity/records.js';
|
package/build/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,YAAY,C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EACpB,iBAAiB,EACjB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC9E,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EACL,aAAa,EACb,eAAe,EACf,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACzD,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA"}
|
package/build/esm/index.js
CHANGED
|
@@ -30,6 +30,8 @@ export { INFO_CORPUS } from './corpus/info.js';
|
|
|
30
30
|
export { ADMIN_CORPUS } from './corpus/admin.js';
|
|
31
31
|
export { AUTH_CONFIG_CORPUS } from './corpus/authconfig.js';
|
|
32
32
|
export { DIRECTORY_CORPUS } from './corpus/directory.js';
|
|
33
|
+
export { HOME_CORPUS } from './corpus/home.js';
|
|
34
|
+
export { BUNDLE_NAME, NO_WEB_BUILD, createHomeService, withBundleVersion } from './home/service.js';
|
|
33
35
|
export { BROWSER_INFO, createInfoService, normaliseInfo } from './info/service.js';
|
|
34
36
|
export { MemoryIdentityStore } from './identity/memory-store.js';
|
|
35
37
|
export { DEFAULT_IDENTITY, IDENTITY_FORMAT, parseIdentity } from './identity/fixture.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../src/routes/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGzD,yDAAyD;AACzD,UAAU,aAAa;IACrB,YAAY,CAAC,EAAE,UAAU,EAAE,CAAA;IAC3B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,CAAC;IAAE,WAAW,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAElE,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAczD,CAAA;
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../src/routes/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGzD,yDAAyD;AACzD,UAAU,aAAa;IACrB,YAAY,CAAC,EAAE,UAAU,EAAE,CAAA;IAC3B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,CAAC;IAAE,WAAW,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAElE,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAczD,CAAA;AAmBD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA+ThD,CAAA;AAED,wEAAwE;AACxE,eAAO,MAAM,OAAO,EAAE,UAAU,EAA8C,CAAA"}
|
|
@@ -22,7 +22,6 @@ export const TAG_CAPABILITIES = {
|
|
|
22
22
|
* operation waits on, and thirty copies of the same sentence would say the same
|
|
23
23
|
* thing thirty times.
|
|
24
24
|
*/
|
|
25
|
-
const WEB_BUNDLE = 'The host serves its own web bundle; there is no API decision here for this package to answer.';
|
|
26
25
|
const success = { status: 'success' };
|
|
27
26
|
const user = {
|
|
28
27
|
uid: '',
|
|
@@ -32,8 +31,17 @@ const user = {
|
|
|
32
31
|
needsToUpdatePassword: false
|
|
33
32
|
};
|
|
34
33
|
export const OVERLAY = {
|
|
35
|
-
// Web - the sign-in pages the identity service answers, and the
|
|
36
|
-
|
|
34
|
+
// Web - the sign-in pages the identity service answers, and the shell itself.
|
|
35
|
+
// The page is the host's file; the stamping rule that keeps a cached shell
|
|
36
|
+
// from pinning an old bundle is the package's.
|
|
37
|
+
'GET /': {
|
|
38
|
+
implemented: true,
|
|
39
|
+
// public: the shell is what an unauthenticated browser asks for first
|
|
40
|
+
capabilities: [],
|
|
41
|
+
responses: {
|
|
42
|
+
200: '<html><head></head><body>Web Build is not present</body></html>'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
37
45
|
'POST /SASLogon/login': {
|
|
38
46
|
implemented: true,
|
|
39
47
|
// The lockout and the provider failure are answered before the package is
|
package/package.json
CHANGED