pico-engine 1.3.0 → 1.5.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/README.md +147 -0
- package/dist/RulesetRegistryLoaderFs.js +4 -7
- package/dist/auth/AuthService.js +537 -0
- package/dist/auth/index.js +8 -0
- package/dist/auth/webauthn.js +97 -0
- package/dist/cli.js +11 -0
- package/dist/index.js +83 -46
- package/dist/logging.js +36 -27
- package/dist/oauth/OAuthService.js +356 -0
- package/dist/oauth/acg.js +495 -0
- package/dist/oauth/channelEligibility.js +26 -0
- package/dist/oauth/errors.js +12 -0
- package/dist/oauth/index.js +21 -0
- package/dist/oauth/krlModule.js +27 -0
- package/dist/oauth/meshOAuth.js +43 -0
- package/dist/provisionRoot.js +80 -0
- package/dist/server.js +565 -17
- package/dist/utils/toFileUrl.js +1 -2
- package/krl/io.picolabs.did-o.krl +25 -5
- package/krl/io.picolabs.oauth.krl +48 -0
- package/krl/io.picolabs.pds.krl +344 -0
- package/krl/io.picolabs.pico-engine-ui.krl +43 -10
- package/krl/io.picolabs.wrangler.krl +21 -20
- package/package.json +29 -29
- package/public/pico-engine-ui.css +4 -4
- package/public/pico-engine-ui.js +50 -16
- package/public/pico-labs-logo.png +0 -0
- package/src/RulesetRegistryLoaderFs.ts +6 -10
- package/src/auth/AuthService.ts +755 -0
- package/src/auth/index.ts +17 -0
- package/src/auth/webauthn.ts +182 -0
- package/src/cli.ts +11 -0
- package/src/index.ts +123 -56
- package/src/logging.ts +36 -47
- package/src/oauth/OAuthService.ts +474 -0
- package/src/oauth/acg.ts +666 -0
- package/src/oauth/channelEligibility.ts +26 -0
- package/src/oauth/errors.ts +10 -0
- package/src/oauth/index.ts +14 -0
- package/src/oauth/krlModule.ts +31 -0
- package/src/oauth/meshOAuth.ts +50 -0
- package/src/provisionRoot.ts +97 -0
- package/src/server.ts +647 -17
|
Binary file
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import fetch from "cross-fetch";
|
|
2
2
|
import * as fs from "fs";
|
|
3
|
-
import
|
|
4
|
-
import { default as level } from "levelup";
|
|
3
|
+
import { ClassicLevel } from "classic-level";
|
|
5
4
|
import * as makeDir from "make-dir";
|
|
6
5
|
import * as path from "path";
|
|
7
6
|
import { RulesetRegistryLoader } from "pico-engine-core";
|
|
8
|
-
import { Ruleset } from "pico-framework";
|
|
7
|
+
import { PicoDbKey, Ruleset } from "pico-framework";
|
|
9
8
|
import * as urlLib from "url";
|
|
10
9
|
const krlCompiler = require("krl-compiler");
|
|
11
10
|
const krlCompilerVersion = require("krl-compiler/package.json").version;
|
|
12
11
|
const charwise = require("charwise");
|
|
13
|
-
const encode = require("encoding-down");
|
|
14
12
|
const safeJsonCodec = require("level-json-coerce-null");
|
|
15
13
|
|
|
16
14
|
function getUrlFilename(url: string): string | null {
|
|
@@ -40,12 +38,10 @@ export function RulesetRegistryLoaderFs(
|
|
|
40
38
|
): RulesetRegistryLoader {
|
|
41
39
|
const rulesetDir = path.resolve(engineHomeDir, "rulesets");
|
|
42
40
|
|
|
43
|
-
const db =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
);
|
|
41
|
+
const db = new ClassicLevel<PicoDbKey, any>(path.resolve(engineHomeDir, "rulesets-db"), {
|
|
42
|
+
keyEncoding: charwise,
|
|
43
|
+
valueEncoding: safeJsonCodec,
|
|
44
|
+
})
|
|
49
45
|
|
|
50
46
|
async function compileAndLoad(
|
|
51
47
|
url: string,
|