@bluestep-systems/b6p-core 0.9.0 → 1.1.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 +274 -24
- package/dist/B6PCore.d.ts +13 -0
- package/dist/B6PCore.js +61 -1
- package/dist/B6PCore.js.map +1 -1
- package/dist/B6PUri.d.ts +6 -8
- package/dist/B6PUri.js +6 -8
- package/dist/B6PUri.js.map +1 -1
- package/dist/Err.d.ts +434 -0
- package/dist/Err.js +582 -0
- package/dist/Err.js.map +1 -1
- package/dist/auth/BearerAuthProvider.d.ts +32 -0
- package/dist/auth/BearerAuthProvider.js +49 -0
- package/dist/auth/BearerAuthProvider.js.map +1 -1
- package/dist/cache/OrgCache.js.map +1 -1
- package/dist/cache/ScriptMetaDataStore.js.map +1 -1
- package/dist/constants/ApiEndpoints.d.ts +1 -0
- package/dist/constants/ApiEndpoints.js +1 -0
- package/dist/constants/ApiEndpoints.js.map +1 -1
- package/dist/constants/AuthTypes.js.map +1 -1
- package/dist/constants/BlueHQ.js.map +1 -1
- package/dist/constants/CryptoAlgorithms.js.map +1 -1
- package/dist/constants/ExtensionConfig.js.map +1 -1
- package/dist/constants/FileExtensions.js.map +1 -1
- package/dist/constants/FolderNames.js.map +1 -1
- package/dist/constants/Gateway.d.ts +71 -0
- package/dist/constants/Gateway.js +79 -0
- package/dist/constants/Gateway.js.map +1 -0
- package/dist/constants/GitHubUrls.js.map +1 -1
- package/dist/constants/Http.js.map +1 -1
- package/dist/constants/MimeTypes.js.map +1 -1
- package/dist/constants/Numerical.js.map +1 -1
- package/dist/constants/OutputChannels.js.map +1 -1
- package/dist/constants/SettingsKeys.d.ts +5 -0
- package/dist/constants/SettingsKeys.js +5 -0
- package/dist/constants/SettingsKeys.js.map +1 -1
- package/dist/constants/SpecialFiles.js.map +1 -1
- package/dist/constants/WebDAVElements.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +3 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/data/DownstairsPathParser.js.map +1 -1
- package/dist/data/GlobMatcher.js.map +1 -1
- package/dist/data/IdUtility.js.map +1 -1
- package/dist/data/OrgWorker.js.map +1 -1
- package/dist/data/ScriptKey.js.map +1 -1
- package/dist/data/ScriptUrlParser.js.map +1 -1
- package/dist/data/ServerVersion.d.ts +76 -0
- package/dist/data/ServerVersion.js +111 -0
- package/dist/data/ServerVersion.js.map +1 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.js +7 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gateway/GatewayClient.d.ts +147 -0
- package/dist/gateway/GatewayClient.js +395 -0
- package/dist/gateway/GatewayClient.js.map +1 -0
- package/dist/gateway/GatewayContext.d.ts +43 -0
- package/dist/gateway/GatewayContext.js +3 -0
- package/dist/gateway/GatewayContext.js.map +1 -0
- package/dist/gateway/GatewayGit.d.ts +291 -0
- package/dist/gateway/GatewayGit.js +731 -0
- package/dist/gateway/GatewayGit.js.map +1 -0
- package/dist/gateway/GatewayKb.d.ts +173 -0
- package/dist/gateway/GatewayKb.js +354 -0
- package/dist/gateway/GatewayKb.js.map +1 -0
- package/dist/gateway/GatewayMarketplace.d.ts +116 -0
- package/dist/gateway/GatewayMarketplace.js +278 -0
- package/dist/gateway/GatewayMarketplace.js.map +1 -0
- package/dist/gateway/GatewayService.d.ts +47 -0
- package/dist/gateway/GatewayService.js +54 -0
- package/dist/gateway/GatewayService.js.map +1 -0
- package/dist/gateway/GatewayToken.d.ts +18 -0
- package/dist/gateway/GatewayToken.js +43 -0
- package/dist/gateway/GatewayToken.js.map +1 -0
- package/dist/gateway/GatewayTokenService.d.ts +101 -0
- package/dist/gateway/GatewayTokenService.js +465 -0
- package/dist/gateway/GatewayTokenService.js.map +1 -0
- package/dist/index.d.ts +27 -9
- package/dist/index.js +36 -7
- package/dist/index.js.map +1 -1
- package/dist/network/HttpClient.js.map +1 -1
- package/dist/network/HttpClientProvider.js.map +1 -1
- package/dist/network/StatusCodes.js.map +1 -1
- package/dist/persistence/PersistablePseudoMap.js.map +1 -1
- package/dist/persistence/PersistenceKeys.js.map +1 -1
- package/dist/persistence/PrivatePersistanceMap.js.map +1 -1
- package/dist/persistence/PseudoMap.js.map +1 -1
- package/dist/persistence/PublicPersistanceMap.js.map +1 -1
- package/dist/persistence/Serializable.js.map +1 -1
- package/dist/persistence/SharedFilePersistence.d.ts +22 -0
- package/dist/persistence/SharedFilePersistence.js +65 -14
- package/dist/persistence/SharedFilePersistence.js.map +1 -1
- package/dist/persistence/TypedMap.js.map +1 -1
- package/dist/persistence/TypedPersistable.js.map +1 -1
- package/dist/persistence/TypedPrivatePersistable.js.map +1 -1
- package/dist/persistence/dirLockdown.js.map +1 -1
- package/dist/providers.d.ts +36 -19
- package/dist/schema/SchemaContext.d.ts +10 -0
- package/dist/schema/SchemaContext.js +3 -0
- package/dist/schema/SchemaContext.js.map +1 -0
- package/dist/schema/SchemaService.d.ts +99 -0
- package/dist/schema/SchemaService.js +225 -0
- package/dist/schema/SchemaService.js.map +1 -0
- package/dist/script/GitIdentity.js.map +1 -1
- package/dist/script/GitSync.d.ts +78 -11
- package/dist/script/GitSync.js +84 -17
- package/dist/script/GitSync.js.map +1 -1
- package/dist/script/ScriptContext.d.ts +1 -8
- package/dist/script/ScriptFactory.d.ts +1 -2
- package/dist/script/ScriptFactory.js +1 -2
- package/dist/script/ScriptFactory.js.map +1 -1
- package/dist/script/ScriptFile.js.map +1 -1
- package/dist/script/ScriptFolder.js.map +1 -1
- package/dist/script/ScriptNode.js.map +1 -1
- package/dist/script/ScriptRoot.d.ts +0 -63
- package/dist/script/ScriptRoot.js +0 -178
- package/dist/script/ScriptRoot.js.map +1 -1
- package/dist/script/ScriptService.d.ts +45 -11
- package/dist/script/ScriptService.js +44 -6
- package/dist/script/ScriptService.js.map +1 -1
- package/dist/script/ServerCompile.d.ts +35 -0
- package/dist/script/ServerCompile.js +40 -0
- package/dist/script/ServerCompile.js.map +1 -0
- package/dist/script/TsConfig.d.ts +2 -2
- package/dist/script/TsConfig.js +3 -3
- package/dist/script/TsConfig.js.map +1 -1
- package/dist/script/push.d.ts +117 -77
- package/dist/script/push.js +151 -170
- package/dist/script/push.js.map +1 -1
- package/dist/session/SessionManager.js.map +1 -1
- package/dist/testing/FakeGateway.d.ts +280 -0
- package/dist/testing/FakeGateway.js +627 -0
- package/dist/testing/FakeGateway.js.map +1 -0
- package/dist/testing/MockFileSystem.js.map +1 -1
- package/dist/types.d.ts +534 -0
- package/dist/update/UpdateService.js.map +1 -1
- package/package.json +8 -7
- package/dist/script/ScriptTranspiler.d.ts +0 -183
- package/dist/script/ScriptTranspiler.js +0 -425
- package/dist/script/ScriptTranspiler.js.map +0 -1
- package/dist/script/TsLibResolver.d.ts +0 -60
- package/dist/script/TsLibResolver.js +0 -134
- package/dist/script/TsLibResolver.js.map +0 -1
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves the directory that holds TypeScript's default library declaration
|
|
3
|
-
* files (`lib.d.ts`, `lib.es2022.d.ts`, `lib.dom.d.ts`, ...).
|
|
4
|
-
*
|
|
5
|
-
* WHY THIS EXISTS: b6p-core is bundled by its consumers (the b6p CLI's single
|
|
6
|
-
* `dist/cli.js` and its SEA binary). TypeScript's default `CompilerHost` locates
|
|
7
|
-
* the standard library via:
|
|
8
|
-
*
|
|
9
|
-
* getDefaultLibLocation() = getDirectoryPath(sys.getExecutingFilePath())
|
|
10
|
-
* getExecutingFilePath() = __filename
|
|
11
|
-
*
|
|
12
|
-
* Once bundled, `__filename` is the bundle path (or the standalone exe), so TS
|
|
13
|
-
* looks for `lib.*.d.ts` next to the bundle — where they never exist. The result
|
|
14
|
-
* is "File 'lib.esnext.d.ts' not found" cascading into "Cannot find global type
|
|
15
|
-
* 'Array'", "Cannot find name 'console'", etc., for every project.
|
|
16
|
-
*
|
|
17
|
-
* This resolver finds the lib directory WITHOUT relying on `__filename`, so the
|
|
18
|
-
* caller can override the host's lib resolution and compile correctly whether it
|
|
19
|
-
* runs from an npm install, a bundled CLI, or a SEA binary.
|
|
20
|
-
* @lastreviewed null
|
|
21
|
-
*/
|
|
22
|
-
export declare class TsLibResolver {
|
|
23
|
-
/**
|
|
24
|
-
* A file present in every TypeScript lib directory; used as the existence probe.
|
|
25
|
-
* @lastreviewed null
|
|
26
|
-
*/
|
|
27
|
-
private static readonly SENTINEL;
|
|
28
|
-
/**
|
|
29
|
-
* Return the first directory that actually contains TypeScript's default
|
|
30
|
-
* library files, or `undefined` if none is found (in which case the caller
|
|
31
|
-
* should leave the default host behavior untouched).
|
|
32
|
-
*
|
|
33
|
-
* Resolution order:
|
|
34
|
-
* 1. `explicitDirs` — supplied by the consumer (the CLI). Covers both the
|
|
35
|
-
* npm fallback (a `lib/` shipped next to the bundle) and the SEA binary
|
|
36
|
-
* (a temp dir the binary extracts its embedded libs into). Neither
|
|
37
|
-
* depends on `__filename`, so both stay correct under bundling.
|
|
38
|
-
* 2. `node_modules/typescript/lib`, walking up from each project dir — the
|
|
39
|
-
* typescript install of the workspace being pushed.
|
|
40
|
-
*
|
|
41
|
-
* Existence is probed with `ts.sys`, which reads the real filesystem — the
|
|
42
|
-
* same source the `CompilerHost` reads libs from — so a hit here guarantees
|
|
43
|
-
* the host can actually read the files.
|
|
44
|
-
* @lastreviewed null
|
|
45
|
-
*/
|
|
46
|
-
static resolveLibDir(opts: {
|
|
47
|
-
explicitDirs?: readonly string[];
|
|
48
|
-
projectDirs?: readonly string[];
|
|
49
|
-
}): string | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* True if `dir` contains TypeScript's default library files.
|
|
52
|
-
* @lastreviewed null
|
|
53
|
-
*/
|
|
54
|
-
private static hasLibFiles;
|
|
55
|
-
/**
|
|
56
|
-
* Walk up from `startDir` looking for `node_modules/typescript/lib`.
|
|
57
|
-
* @lastreviewed null
|
|
58
|
-
*/
|
|
59
|
-
private static findInNodeModules;
|
|
60
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.TsLibResolver = void 0;
|
|
40
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
41
|
-
const path = __importStar(require("path"));
|
|
42
|
-
/**
|
|
43
|
-
* Resolves the directory that holds TypeScript's default library declaration
|
|
44
|
-
* files (`lib.d.ts`, `lib.es2022.d.ts`, `lib.dom.d.ts`, ...).
|
|
45
|
-
*
|
|
46
|
-
* WHY THIS EXISTS: b6p-core is bundled by its consumers (the b6p CLI's single
|
|
47
|
-
* `dist/cli.js` and its SEA binary). TypeScript's default `CompilerHost` locates
|
|
48
|
-
* the standard library via:
|
|
49
|
-
*
|
|
50
|
-
* getDefaultLibLocation() = getDirectoryPath(sys.getExecutingFilePath())
|
|
51
|
-
* getExecutingFilePath() = __filename
|
|
52
|
-
*
|
|
53
|
-
* Once bundled, `__filename` is the bundle path (or the standalone exe), so TS
|
|
54
|
-
* looks for `lib.*.d.ts` next to the bundle — where they never exist. The result
|
|
55
|
-
* is "File 'lib.esnext.d.ts' not found" cascading into "Cannot find global type
|
|
56
|
-
* 'Array'", "Cannot find name 'console'", etc., for every project.
|
|
57
|
-
*
|
|
58
|
-
* This resolver finds the lib directory WITHOUT relying on `__filename`, so the
|
|
59
|
-
* caller can override the host's lib resolution and compile correctly whether it
|
|
60
|
-
* runs from an npm install, a bundled CLI, or a SEA binary.
|
|
61
|
-
* @lastreviewed null
|
|
62
|
-
*/
|
|
63
|
-
class TsLibResolver {
|
|
64
|
-
/**
|
|
65
|
-
* A file present in every TypeScript lib directory; used as the existence probe.
|
|
66
|
-
* @lastreviewed null
|
|
67
|
-
*/
|
|
68
|
-
static SENTINEL = "lib.d.ts";
|
|
69
|
-
/**
|
|
70
|
-
* Return the first directory that actually contains TypeScript's default
|
|
71
|
-
* library files, or `undefined` if none is found (in which case the caller
|
|
72
|
-
* should leave the default host behavior untouched).
|
|
73
|
-
*
|
|
74
|
-
* Resolution order:
|
|
75
|
-
* 1. `explicitDirs` — supplied by the consumer (the CLI). Covers both the
|
|
76
|
-
* npm fallback (a `lib/` shipped next to the bundle) and the SEA binary
|
|
77
|
-
* (a temp dir the binary extracts its embedded libs into). Neither
|
|
78
|
-
* depends on `__filename`, so both stay correct under bundling.
|
|
79
|
-
* 2. `node_modules/typescript/lib`, walking up from each project dir — the
|
|
80
|
-
* typescript install of the workspace being pushed.
|
|
81
|
-
*
|
|
82
|
-
* Existence is probed with `ts.sys`, which reads the real filesystem — the
|
|
83
|
-
* same source the `CompilerHost` reads libs from — so a hit here guarantees
|
|
84
|
-
* the host can actually read the files.
|
|
85
|
-
* @lastreviewed null
|
|
86
|
-
*/
|
|
87
|
-
static resolveLibDir(opts) {
|
|
88
|
-
const { explicitDirs = [], projectDirs = [] } = opts;
|
|
89
|
-
for (const dir of explicitDirs) {
|
|
90
|
-
if (dir && this.hasLibFiles(dir)) {
|
|
91
|
-
return dir;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
for (const projectDir of projectDirs) {
|
|
95
|
-
if (!projectDir) {
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
const found = this.findInNodeModules(projectDir);
|
|
99
|
-
if (found) {
|
|
100
|
-
return found;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return undefined;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* True if `dir` contains TypeScript's default library files.
|
|
107
|
-
* @lastreviewed null
|
|
108
|
-
*/
|
|
109
|
-
static hasLibFiles(dir) {
|
|
110
|
-
// ts.sys is always defined under Node; guard anyway so a non-Node host that
|
|
111
|
-
// lacks it degrades to "not found" rather than throwing.
|
|
112
|
-
return !!typescript_1.default.sys?.fileExists(path.join(dir, this.SENTINEL));
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Walk up from `startDir` looking for `node_modules/typescript/lib`.
|
|
116
|
-
* @lastreviewed null
|
|
117
|
-
*/
|
|
118
|
-
static findInNodeModules(startDir) {
|
|
119
|
-
let current = path.resolve(startDir);
|
|
120
|
-
let prev = "";
|
|
121
|
-
// Loop terminates when `path.dirname` stops changing (filesystem root).
|
|
122
|
-
while (current !== prev) {
|
|
123
|
-
const candidate = path.join(current, "node_modules", "typescript", "lib");
|
|
124
|
-
if (this.hasLibFiles(candidate)) {
|
|
125
|
-
return candidate;
|
|
126
|
-
}
|
|
127
|
-
prev = current;
|
|
128
|
-
current = path.dirname(current);
|
|
129
|
-
}
|
|
130
|
-
return undefined;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
exports.TsLibResolver = TsLibResolver;
|
|
134
|
-
//# sourceMappingURL=TsLibResolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TsLibResolver.js","sourceRoot":"","sources":["../../src/script/TsLibResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA4B;AAC5B,2CAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,aAAa;IACxB;;;OAGG;IACK,MAAM,CAAU,QAAQ,GAAG,UAAU,CAAC;IAE9C;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,aAAa,CAAC,IAGpB;QACC,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;QAErD,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;YAC/B,IAAI,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;gBACjC,OAAO,GAAG,CAAC;YACb,CAAC;QACH,CAAC;QAED,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,SAAS;YACX,CAAC;YACD,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;YACjD,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,WAAW,CAAC,GAAW;QACpC,4EAA4E;QAC5E,yDAAyD;QACzD,OAAO,CAAC,CAAC,oBAAE,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,iBAAiB,CAAC,QAAgB;QAC/C,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,wEAAwE;QACxE,OAAO,OAAO,KAAK,IAAI,EAAE,CAAC;YACxB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;YAC1E,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;gBAChC,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,IAAI,GAAG,OAAO,CAAC;YACf,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;;AA7EH,sCA8EC"}
|