@bluestep-systems/b6p-core 0.8.1 → 1.0.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.
Files changed (149) hide show
  1. package/README.md +310 -32
  2. package/dist/B6PCore.d.ts +7 -0
  3. package/dist/B6PCore.js +96 -1
  4. package/dist/B6PCore.js.map +1 -1
  5. package/dist/B6PUri.d.ts +6 -8
  6. package/dist/B6PUri.js +6 -8
  7. package/dist/B6PUri.js.map +1 -1
  8. package/dist/Err.d.ts +421 -0
  9. package/dist/Err.js +558 -0
  10. package/dist/Err.js.map +1 -1
  11. package/dist/auth/BearerAuthProvider.d.ts +32 -0
  12. package/dist/auth/BearerAuthProvider.js +49 -0
  13. package/dist/auth/BearerAuthProvider.js.map +1 -1
  14. package/dist/cache/OrgCache.js.map +1 -1
  15. package/dist/cache/ScriptMetaDataStore.js.map +1 -1
  16. package/dist/constants/ApiEndpoints.d.ts +1 -0
  17. package/dist/constants/ApiEndpoints.js +1 -0
  18. package/dist/constants/ApiEndpoints.js.map +1 -1
  19. package/dist/constants/AuthTypes.js.map +1 -1
  20. package/dist/constants/BlueHQ.js.map +1 -1
  21. package/dist/constants/CryptoAlgorithms.js.map +1 -1
  22. package/dist/constants/ExtensionConfig.js.map +1 -1
  23. package/dist/constants/FileExtensions.js.map +1 -1
  24. package/dist/constants/FolderNames.js.map +1 -1
  25. package/dist/constants/Gateway.d.ts +71 -0
  26. package/dist/constants/Gateway.js +79 -0
  27. package/dist/constants/Gateway.js.map +1 -0
  28. package/dist/constants/GitHubUrls.js.map +1 -1
  29. package/dist/constants/Http.js.map +1 -1
  30. package/dist/constants/MimeTypes.js.map +1 -1
  31. package/dist/constants/Numerical.js.map +1 -1
  32. package/dist/constants/OutputChannels.js.map +1 -1
  33. package/dist/constants/SettingsKeys.d.ts +5 -0
  34. package/dist/constants/SettingsKeys.js +5 -0
  35. package/dist/constants/SettingsKeys.js.map +1 -1
  36. package/dist/constants/SpecialFiles.js.map +1 -1
  37. package/dist/constants/WebDAVElements.js.map +1 -1
  38. package/dist/constants/index.d.ts +1 -0
  39. package/dist/constants/index.js +3 -1
  40. package/dist/constants/index.js.map +1 -1
  41. package/dist/data/DownstairsPathParser.js.map +1 -1
  42. package/dist/data/GlobMatcher.js.map +1 -1
  43. package/dist/data/IdUtility.js.map +1 -1
  44. package/dist/data/OrgWorker.js.map +1 -1
  45. package/dist/data/ScriptKey.d.ts +3 -27
  46. package/dist/data/ScriptKey.js +12 -24
  47. package/dist/data/ScriptKey.js.map +1 -1
  48. package/dist/data/ScriptUrlParser.js +3 -1
  49. package/dist/data/ScriptUrlParser.js.map +1 -1
  50. package/dist/data/ServerVersion.d.ts +76 -0
  51. package/dist/data/ServerVersion.js +111 -0
  52. package/dist/data/ServerVersion.js.map +1 -0
  53. package/dist/data/index.d.ts +2 -0
  54. package/dist/data/index.js +7 -1
  55. package/dist/data/index.js.map +1 -1
  56. package/dist/gateway/GatewayClient.d.ts +147 -0
  57. package/dist/gateway/GatewayClient.js +395 -0
  58. package/dist/gateway/GatewayClient.js.map +1 -0
  59. package/dist/gateway/GatewayContext.d.ts +43 -0
  60. package/dist/gateway/GatewayContext.js +3 -0
  61. package/dist/gateway/GatewayContext.js.map +1 -0
  62. package/dist/gateway/GatewayGit.d.ts +291 -0
  63. package/dist/gateway/GatewayGit.js +731 -0
  64. package/dist/gateway/GatewayGit.js.map +1 -0
  65. package/dist/gateway/GatewayKb.d.ts +173 -0
  66. package/dist/gateway/GatewayKb.js +354 -0
  67. package/dist/gateway/GatewayKb.js.map +1 -0
  68. package/dist/gateway/GatewayMarketplace.d.ts +116 -0
  69. package/dist/gateway/GatewayMarketplace.js +278 -0
  70. package/dist/gateway/GatewayMarketplace.js.map +1 -0
  71. package/dist/gateway/GatewayService.d.ts +47 -0
  72. package/dist/gateway/GatewayService.js +54 -0
  73. package/dist/gateway/GatewayService.js.map +1 -0
  74. package/dist/gateway/GatewayToken.d.ts +18 -0
  75. package/dist/gateway/GatewayToken.js +43 -0
  76. package/dist/gateway/GatewayToken.js.map +1 -0
  77. package/dist/gateway/GatewayTokenService.d.ts +101 -0
  78. package/dist/gateway/GatewayTokenService.js +465 -0
  79. package/dist/gateway/GatewayTokenService.js.map +1 -0
  80. package/dist/index.d.ts +29 -8
  81. package/dist/index.js +81 -9
  82. package/dist/index.js.map +1 -1
  83. package/dist/network/HttpClient.js.map +1 -1
  84. package/dist/network/HttpClientProvider.js.map +1 -1
  85. package/dist/network/StatusCodes.js.map +1 -1
  86. package/dist/persistence/PersistablePseudoMap.js.map +1 -1
  87. package/dist/persistence/PersistenceKeys.js.map +1 -1
  88. package/dist/persistence/PrivatePersistanceMap.js.map +1 -1
  89. package/dist/persistence/PseudoMap.js.map +1 -1
  90. package/dist/persistence/PublicPersistanceMap.js.map +1 -1
  91. package/dist/persistence/Serializable.js.map +1 -1
  92. package/dist/persistence/SharedFilePersistence.d.ts +22 -0
  93. package/dist/persistence/SharedFilePersistence.js +65 -14
  94. package/dist/persistence/SharedFilePersistence.js.map +1 -1
  95. package/dist/persistence/TypedMap.js.map +1 -1
  96. package/dist/persistence/TypedPersistable.js.map +1 -1
  97. package/dist/persistence/TypedPrivatePersistable.js.map +1 -1
  98. package/dist/persistence/dirLockdown.js.map +1 -1
  99. package/dist/providers.d.ts +46 -16
  100. package/dist/script/GitIdentity.d.ts +48 -0
  101. package/dist/script/GitIdentity.js +52 -0
  102. package/dist/script/GitIdentity.js.map +1 -0
  103. package/dist/script/GitSync.d.ts +388 -0
  104. package/dist/script/GitSync.js +1068 -0
  105. package/dist/script/GitSync.js.map +1 -0
  106. package/dist/script/ScriptContext.d.ts +20 -5
  107. package/dist/script/ScriptFactory.d.ts +1 -2
  108. package/dist/script/ScriptFactory.js +1 -2
  109. package/dist/script/ScriptFactory.js.map +1 -1
  110. package/dist/script/ScriptFile.d.ts +0 -94
  111. package/dist/script/ScriptFile.js +0 -245
  112. package/dist/script/ScriptFile.js.map +1 -1
  113. package/dist/script/ScriptFolder.d.ts +0 -9
  114. package/dist/script/ScriptFolder.js +4 -7
  115. package/dist/script/ScriptFolder.js.map +1 -1
  116. package/dist/script/ScriptNode.d.ts +0 -9
  117. package/dist/script/ScriptNode.js.map +1 -1
  118. package/dist/script/ScriptRoot.d.ts +0 -65
  119. package/dist/script/ScriptRoot.js +0 -199
  120. package/dist/script/ScriptRoot.js.map +1 -1
  121. package/dist/script/ScriptService.d.ts +113 -9
  122. package/dist/script/ScriptService.js +164 -52
  123. package/dist/script/ScriptService.js.map +1 -1
  124. package/dist/script/ServerCompile.d.ts +35 -0
  125. package/dist/script/ServerCompile.js +40 -0
  126. package/dist/script/ServerCompile.js.map +1 -0
  127. package/dist/script/TsConfig.d.ts +2 -2
  128. package/dist/script/TsConfig.js +3 -3
  129. package/dist/script/TsConfig.js.map +1 -1
  130. package/dist/script/push.d.ts +162 -188
  131. package/dist/script/push.js +216 -474
  132. package/dist/script/push.js.map +1 -1
  133. package/dist/session/SessionManager.js.map +1 -1
  134. package/dist/testing/FakeGateway.d.ts +280 -0
  135. package/dist/testing/FakeGateway.js +627 -0
  136. package/dist/testing/FakeGateway.js.map +1 -0
  137. package/dist/testing/MockFileSystem.js.map +1 -1
  138. package/dist/types.d.ts +332 -0
  139. package/dist/update/UpdateService.js.map +1 -1
  140. package/package.json +17 -12
  141. package/dist/script/ScriptTranspiler.d.ts +0 -121
  142. package/dist/script/ScriptTranspiler.js +0 -333
  143. package/dist/script/ScriptTranspiler.js.map +0 -1
  144. package/dist/script/SnapshotHistoryRecorder.d.ts +0 -47
  145. package/dist/script/SnapshotHistoryRecorder.js +0 -231
  146. package/dist/script/SnapshotHistoryRecorder.js.map +0 -1
  147. package/dist/script/TsLibResolver.d.ts +0 -60
  148. package/dist/script/TsLibResolver.js +0 -134
  149. 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"}