@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
package/README.md
CHANGED
|
@@ -9,6 +9,10 @@ This package contains the headless orchestration logic shared by the
|
|
|
9
9
|
anywhere Node does. You supply the platform adapters (file system, prompts, logging, progress,
|
|
10
10
|
persistence) through provider interfaces.
|
|
11
11
|
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
Node.js **24 or newer** (`engines.node` is `>=24`).
|
|
15
|
+
|
|
12
16
|
## Packages
|
|
13
17
|
|
|
14
18
|
This repo holds two npm packages: `@bluestep-systems/b6p-core` (this one, Node) and
|
|
@@ -30,11 +34,11 @@ the platform through its subsystem services:
|
|
|
30
34
|
import { B6PCore, type B6PProviders } from "@bluestep-systems/b6p-core";
|
|
31
35
|
|
|
32
36
|
const providers: B6PProviders = {
|
|
33
|
-
fs,
|
|
37
|
+
fs, // FileSystem — read/write/list files
|
|
34
38
|
persistence, // Persistence — durable key/value (settings, sessions)
|
|
35
|
-
prompt,
|
|
36
|
-
logger,
|
|
37
|
-
progress,
|
|
39
|
+
prompt, // Prompt — ask the user for input/credentials
|
|
40
|
+
logger, // Logger — diagnostic logging
|
|
41
|
+
progress, // Progress — long-running task reporting
|
|
38
42
|
};
|
|
39
43
|
|
|
40
44
|
const core = new B6PCore(providers);
|
|
@@ -64,15 +68,31 @@ between the local filesystem and the platform (the draft over git, `declarations
|
|
|
64
68
|
| `deriveWorkspacePath` | Recover the workspace folder from a path inside a script root |
|
|
65
69
|
| `getFactory` | The `ScriptFactory` for entering the script tree from a bare path |
|
|
66
70
|
|
|
67
|
-
`core`
|
|
71
|
+
`core.schema` ([`SchemaService`](src/schema/SchemaService.ts)) — declarative schema apply against one org
|
|
72
|
+
(super users only; every method takes any URL on the org):
|
|
68
73
|
|
|
69
74
|
| Method | Purpose |
|
|
70
75
|
| --- | --- |
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
+
| `generate` | The manifest (YAML) describing the named objects as they stand, optionally `closure` / `portable` |
|
|
77
|
+
| `recipe` | Run a recipe (`LINK_VIEW_GRANTS`): its manifest plus the findings it met |
|
|
78
|
+
| `test` | Dry-run a manifest as the caller: the plan, any refusals, and a one-use key when it passes (`verbose` adds same-name warnings) |
|
|
79
|
+
| `apply` | Apply the plan a `test` approved: the same manifest string and its key; never retried |
|
|
80
|
+
| `testThenApply` | `test`, ask `confirm` with the result, then `apply` with the same manifest and key |
|
|
81
|
+
|
|
82
|
+
`core.gateway` ([`GatewayService`](src/gateway/GatewayService.ts)) — web-global's gateway
|
|
83
|
+
(`https://gateway.bluestep.net`), the origin for knowledge bases and marketplace repos. It
|
|
84
|
+
holds the HTTP client, the git layer, `core.gateway.kb` (knowledge bases), `core.gateway.marketplace`
|
|
85
|
+
and `core.gateway.tokens` for managing the caller's own access tokens; see [Gateway](#gateway) below.
|
|
86
|
+
|
|
87
|
+
`core` itself — cross-cutting state that is not specific to any one subsystem:
|
|
88
|
+
|
|
89
|
+
| Method | Purpose |
|
|
90
|
+
| -------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
91
|
+
| `report` | Report cached metadata / org-cache state |
|
|
92
|
+
| `updateCredentials` / `clearSessions` / `clearSettings` / `clearAll` | Auth & state management |
|
|
93
|
+
| `getConfig` / `setConfig` | Configuration helpers |
|
|
94
|
+
| `checkForUpdates` | GitHub-releases-based update check |
|
|
95
|
+
| `dispose` | Release the session cleanup timer and org-cache resources |
|
|
76
96
|
|
|
77
97
|
See [`src/index.ts`](src/index.ts) for the full set of exported classes, provider interfaces, data
|
|
78
98
|
utilities, constants, and types.
|
|
@@ -88,20 +108,20 @@ written over WebDAV any more (only `declarations/` and the root `.gitignore` sti
|
|
|
88
108
|
also changed is kept and reported (`keptLocalPaths`); files missing locally come back. A folder pulled before git (files,
|
|
89
109
|
no repository) is bound to the repo as it stands: its files that its last sync record shows unedited take the platform
|
|
90
110
|
copy, edited ones are kept.
|
|
91
|
-
- **push** commits the working tree as the author and pushes the draft branch
|
|
92
|
-
also publishes (`publishedSha`) and reads back that the platform's `master` is at that
|
|
111
|
+
- **push** commits the working tree as the author and pushes the draft branch; the platform then builds it (see below).
|
|
112
|
+
A **snapshot** push also publishes the build (`publishedSha`) and reads back that the platform's `master` is at that
|
|
113
|
+
commit.
|
|
93
114
|
- **audit** compares the working tree with the platform's draft (a folder that is not a git working copy yet is reported
|
|
94
115
|
as not pulled).
|
|
95
|
-
- **deploy** pushes the source draft's files to each target script through a scratch clone, and
|
|
96
|
-
folder to a target.
|
|
116
|
+
- **deploy** pushes the source draft's files to each target script through a scratch clone, and the target's platform
|
|
117
|
+
builds them; the source folder is never bound to a target.
|
|
97
118
|
- **A script that still publishes over WebDAV is switched to git, one way.** A push does it on its first write (and
|
|
98
119
|
`PushResult.switchedToGit` and a warning say so); a pull asks first (`Prompt.confirm`, safe answer first, so
|
|
99
120
|
auto-confirm declines and the pull returns `null`) unless `enableGit: true` is passed. After the switch the script's
|
|
100
121
|
draft and snapshot refuse WebDAV writes.
|
|
101
122
|
- **The commit author is never invented.** It is the `author` option of `push`/`pushCurrent`/`deploy`, else `git config
|
|
102
123
|
user.name`/`user.email` for the draft folder (global config included), else `GIT_AUTHOR_NAME`/`GIT_AUTHOR_EMAIL`
|
|
103
|
-
(then `GIT_COMMITTER_*`) from the environment, else a `GitIdentityError` before the
|
|
104
|
-
touched.
|
|
124
|
+
(then `GIT_COMMITTER_*`) from the environment, else a `GitIdentityError` before the platform is touched.
|
|
105
125
|
- `B6PProviders.gitFs` (default `node:fs`) is the Node-style file system git works on; it must read and write the same
|
|
106
126
|
disk as the `fs` provider.
|
|
107
127
|
|
|
@@ -112,17 +132,51 @@ given). Read `pushed` first: `false` means nothing was pushed.
|
|
|
112
132
|
|
|
113
133
|
| Field | Meaning |
|
|
114
134
|
| --- | --- |
|
|
115
|
-
| `pushed` | The draft is on the platform. `false` when the draft folder is missing or empty
|
|
116
|
-
| `commitSha` | The draft
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
135
|
+
| `pushed` | The draft is on the platform. `false` when the draft folder is missing or empty |
|
|
136
|
+
| `commitSha` | The draft commit this push made, or the one already there; `null` when `pushed` is `false` |
|
|
137
|
+
| `route` | Which route ran: `{ mode: "server-build" \| "push-only", reason, serverVersion, required }`, `reason` one of `dev`, `at-or-above-floor`, `below-floor`, `unknown`, `floor-unset`. `null` when the push stopped before asking |
|
|
138
|
+
| `snapshotRefused` | Set when a snapshot was asked for on a server that does not build git drafts: `{ reason: "too-old" \| "unknown" \| "floor-unset", serverVersion, required }`. The draft was pushed; nothing was built or published |
|
|
139
|
+
| `build` | The platform's compile of the pushed draft (`compileDraft`): `status` (`COMPILED`, `GATE_TRIPPED`, `EMIT_WITHHELD`, `NOTHING_TO_COMPILE`, `SKIPPED_EXTERNALLY_BUILT`, …, or `UNKNOWN` with `rawStatus`), `errors` / `warnings`, `diagnostics` (+ `diagnosticsOmitted`), `gate`. `null` when no build ran or the request failed |
|
|
140
|
+
| `buildCommitSha` | The platform's build commit (output, and the manifest when it vouched); the folder was moved to it unless `buildFastForward` says otherwise. `null` when it made none (already built, nothing to build) |
|
|
141
|
+
| `buildFastForward` | How the folder was moved to the build: `{ state, blockedPaths, error }`, `state` `fast-forwarded`, `unchanged`, `blocked` (local files the build changes match neither side, listed; nothing was changed, nothing published) or `failed`. `null` when no build answer came |
|
|
142
|
+
| `buildIncomplete` | The build ended in a status after which the draft does not publish (`BUSY` / `INPUT_INCOMPLETE` once retries ran out, `COMPILER_UNAVAILABLE`, `NOT_PERMITTED`, `WRITE_FAILED`, `OUTPUT_UPLOAD`, `SKIPPED_GIT_MANAGED`, `GATE_TRIPPED`, `EMIT_WITHHELD`, `UNKNOWN`): `{ status, rawStatus, description }`. `null` otherwise |
|
|
143
|
+
| `buildVouched` | `true`: the build is clean and its manifest committed, or the draft needs none (externally built, nothing to build). `false`: unclean, output committed without a manifest, so a publish is refused until it builds cleanly. `null`: no build ran |
|
|
144
|
+
| `buildError` / `buildErrorKind` | Why no build answer came after a successful push, and whether a build was `not-requested` (the platform's draft was no longer the pushed commit) or the `request-failed` (it may have run); otherwise `null` |
|
|
145
|
+
| `publishedSha` | The commit the platform published on a snapshot push (the build commit); `null` on a plain push, when nothing was published, or on a failed publish. A caller that asked for a snapshot treats `null` as a failure |
|
|
146
|
+
| `publishError` / `publishRefusal` | Why the platform refused or failed the publish (the draft stays pushed), and the structured `{ reason, withheld }` (`BUILD_STALE`, `BUILD_MANIFEST_MISSING`, `DRAFT_MOVED`, `ENTRYPOINT_MISSING`, …) |
|
|
119
147
|
| `switchedToGit` | This push switched a WebDAV script to git, which cannot be undone |
|
|
120
|
-
| `typeCheckDiagnostics` |
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
148
|
+
| `typeCheckDiagnostics` | The platform build's whole count of `ERROR` and `WARNING` diagnostics; `null` when no build ran |
|
|
149
|
+
| `typeCheckErrors` | Those in the script's own sources (never a `.d.ts`), as listed by the platform, which lists at most 20: `{ file, line, column, code, message, severity }`, a type-checker finding being a `WARNING`. Empty when none or no build ran |
|
|
150
|
+
| `liveVerified` | `true`: the platform's `master` is at `publishedSha`. `false`: it is at another commit. `null`: not proven either way |
|
|
151
|
+
| `liveMismatches` | Draft-relative paths that differ between `publishedSha` and `master` when `liveVerified` is `false` |
|
|
123
152
|
| `keptPlatformOnly` | Platform-only files kept because deleting them was not confirmed (they are part of the pushed commit) |
|
|
124
153
|
|
|
125
|
-
|
|
154
|
+
### How a push builds (since 1.0.0)
|
|
155
|
+
|
|
156
|
+
Nothing compiles in core or in `bsjsGit`; neither package has a runtime `typescript` dependency. The platform builds:
|
|
157
|
+
|
|
158
|
+
1. The draft is committed and pushed over git (the confirmations above).
|
|
159
|
+
2. `compileDraft` (GraphQL, `bsjsGit.ScriptRepo.compileDraft`) asks the platform to build the draft branch at the pushed
|
|
160
|
+
commit (`expectedDraftSha`; a draft that moved meanwhile is refused, `DraftBuildMovedError`). It commits the output,
|
|
161
|
+
plus the build manifest when the build is clean, as one build commit authored by the pushing user, and the folder is
|
|
162
|
+
fast-forwarded to it: the working tree and index first, for exactly the paths the build changed, then the branch. A
|
|
163
|
+
local file in the way (an edit, or an untracked or ignored copy matching neither side) leaves the folder as it was
|
|
164
|
+
and is reported (`buildFastForward`); a later push stops on it (`GitBuildFastForwardBlockedError`, with the paths)
|
|
165
|
+
until it is out of the way. A build whose answer was lost is taken in by the next push, not asked about: only a commit with the platform's
|
|
166
|
+
`Bluestep-Build-Of: <pushed sha>` trailer, one parent and an output-only diff (or a chain of such rebuilds) counts. `BUSY` is retried 3 times 5 s apart, `INPUT_INCOMPLETE` 3 times 2 s apart,
|
|
167
|
+
`COMPILER_UNAVAILABLE` and a failed request once. Every push builds, plain ones too.
|
|
168
|
+
3. A snapshot push whose build status publishes (`COMPILED`, `NOTHING_TO_COMPILE`, `SKIPPED_EXTERNALLY_BUILT`) then
|
|
169
|
+
publishes the build commit and reads `master` back. An unclean build is refused by the platform's manifest check
|
|
170
|
+
(`publishRefusal.reason` `BUILD_MANIFEST_MISSING` or `BUILD_STALE`); a tripped gate or withheld emit publishes
|
|
171
|
+
nothing. Once the push succeeded, nothing throws: a failed build is `buildError`, a status that does not publish
|
|
172
|
+
`buildIncomplete`, a failed publish `publishError`, and none of them is reported complete. A deploy counts a
|
|
173
|
+
snapshot target that published nothing as failed.
|
|
174
|
+
|
|
175
|
+
Before pushing, a push asks the org's server for its version (`/appinfo/version`) and picks the route; it never refuses
|
|
176
|
+
a push for the version. A `dev` or `latest` server, or one at or above `MIN_SERVER_VERSION`, builds as above. Any other
|
|
177
|
+
(below the floor, an unreadable version, the floor unset) gets the git push alone: no build, and a snapshot push takes
|
|
178
|
+
no snapshot (`snapshotRefused`). `MIN_SERVER_VERSION` is `26.11.16.00`, the day the git build
|
|
179
|
+
(web#2022) was readied; every web release from that day on has it.
|
|
126
180
|
|
|
127
181
|
### Overwrites and destructive prompts
|
|
128
182
|
|
|
@@ -153,6 +207,202 @@ So a `Prompt` that answers `options[0]` without asking (an empty answer, an auto
|
|
|
153
207
|
declines. Core's messages say what was kept and why. How to confirm (a flag, a button, piped
|
|
154
208
|
input) is the consumer's to explain.
|
|
155
209
|
|
|
210
|
+
### Gateway
|
|
211
|
+
|
|
212
|
+
`core.gateway.client` ([`GatewayClient`](src/gateway/GatewayClient.ts)) talks to web-global's gateway
|
|
213
|
+
with the same `b6pt_` access token `BearerAuthProvider` already stores: it reads the stored token on
|
|
214
|
+
every request (never prompting) and sends it as `Authorization: Bearer <token>`. There is no session
|
|
215
|
+
or login on this origin. REST requests through the client run one at a time; redirects are never
|
|
216
|
+
followed, and a request path that resolves off the gateway's origin is refused before sending.
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
await core.setConfig("gatewayUrl", "https://gateway.bluestep.net"); // the default; https only, except loopback
|
|
220
|
+
const list = await core.gateway.client.getJson("/api/v1/knowledge-bases", { scope: "global" });
|
|
221
|
+
const headers = await core.gateway.client.authHeadersFor(gitUrl); // for a git client; gateway origin only
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Failures are typed, all extending `Err.GatewayError` (`status`, `code`):
|
|
225
|
+
|
|
226
|
+
| Error | When |
|
|
227
|
+
| --- | --- |
|
|
228
|
+
| `GatewayAuthError` (`reason`) | `token-missing` (none stored; thrown before sending), `token-invalid` (401), `token-malformed` (not a `b6pt_` token; nothing sent) |
|
|
229
|
+
| `GatewayScopeError` (`scope`) | `403 scope-missing` |
|
|
230
|
+
| `GatewayNotPermittedError` | `403 not-permitted` |
|
|
231
|
+
| `GatewayNotFoundError` | `404` (also for something that exists but is not visible) |
|
|
232
|
+
| `GatewayScopeEscalationError` | `403 scope-escalation` (a new token asked for a scope the presenting one lacks) |
|
|
233
|
+
| `GatewayConflictError` | `409 non-fast-forward` |
|
|
234
|
+
| `GatewayAliasTakenError` | `409 alias-taken` |
|
|
235
|
+
| `GatewayTooLargeError` | `413 too-large` |
|
|
236
|
+
| `GatewayUnavailableError` | `502`/`503`/`504`, a network failure or a timeout |
|
|
237
|
+
| `GatewayUnexpectedResponseError` | any other status, a redirect (`code: "redirect-refused"`, not followed), or a 2xx body that is not JSON |
|
|
238
|
+
| `GatewayConfigError` | an unusable `gatewayUrl`, or a URL or request path that resolves off the gateway's origin |
|
|
239
|
+
| `GatewayDirtyWorkingTreeError` (`paths`) | a pull would overwrite local changes (git layer) |
|
|
240
|
+
| `GatewayCloneMismatchError` (`reason`, `dir`, `repo`) | a marketplace pull found a clone it must not update: `different-repo`, `different-ref`, `tag-moved` (the tag now names another commit) or `tag-gone` (the gateway no longer has it) |
|
|
241
|
+
| `GatewayKnowledgeBaseError` (`reason`, `ref`, `candidates`) | a knowledge base address is `bad-ref`, `not-found`, `ambiguous`, `unsafe-name`, `wrong-branch` (a pull or push from a clone that is detached, off the live branch, or not tracking it; fields `branch`, `liveBranch`, `upstream`), or a clone is `not-a-kb` |
|
|
242
|
+
| `GatewayKnowledgeBasePushNotPermittedError` (`ref`) | a push to a KB whose listing says `canPush: false` (a `GatewayNotPermittedError`) |
|
|
243
|
+
| `GatewayInvalidArgumentError` | refused before sending: an empty alias or scope list, an expiry that is not a date, a pasted `b6pt_` secret where an id or alias belongs (token operations), or a relative path with no absolute `cwd` to resolve it against (core never reads `process.cwd()`) |
|
|
244
|
+
| `GatewayWorkingCopyError` (`reason`) | the local folder cannot be used: `not-empty`, `not-a-clone`, `detached`, `no-upstream`, `diverged`, `ref-not-found`, `unsafe-target` (git layer), `wrong-repository` (knowledge-base pull) |
|
|
245
|
+
|
|
246
|
+
`core.gateway.client.sequence((seq) => …)` runs a unit as one queue entry: nothing else on the
|
|
247
|
+
client runs until it settles. `seq.token()` reads the token once, and `seq.request` presents that
|
|
248
|
+
read. The git layer holds the queue for a whole operation with it, and token rotation uses it so
|
|
249
|
+
nothing runs between the revoke and the store.
|
|
250
|
+
|
|
251
|
+
`gatewayErrorFor(status, body, what)` applies the same mapping to a status seen elsewhere (the git
|
|
252
|
+
layer). The token never appears in a message or a log line, including when the server echoes it.
|
|
253
|
+
|
|
254
|
+
#### Git
|
|
255
|
+
|
|
256
|
+
`core.gateway.git` ([`GatewayGit`](src/gateway/GatewayGit.ts)) clones and updates the repositories behind
|
|
257
|
+
a knowledge base or marketplace listing, in pure JS ([isomorphic-git](https://isomorphic-git.org), MIT;
|
|
258
|
+
no git install needed) over the gateway's smart HTTP endpoints. It takes the `gitUrl` from a listing
|
|
259
|
+
and never builds one; a URL off the gateway's origin is refused before any request, and a redirect is
|
|
260
|
+
not followed (`redirect-refused`). The folders are real local paths, read and written through Node's `fs`, and file
|
|
261
|
+
contents are never rewritten (no autocrlf).
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
await core.gateway.git.clone(kb.gitUrl, dir, { ref: "master" }); // dir missing or empty
|
|
265
|
+
const status = await core.gateway.git.status(dir, { fetch: true }); // branch, dirty, ahead, behind
|
|
266
|
+
await core.gateway.git.pull(dir); // fetch + fast-forward only
|
|
267
|
+
await core.gateway.git.push(dir); // current branch to its upstream, fast-forward only
|
|
268
|
+
await core.gateway.git.inspect(dir, "v1"); // origin url, branch, head, upstream, local tag commit (typed `not-a-clone` if damaged)
|
|
269
|
+
await core.gateway.git.remoteTagCommit(kb.gitUrl, "v1"); // the commit a tag names on the gateway now, or null
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
- `pull` never merges or rebases. A clean tree just proceeds, and unstaged edits and untracked files
|
|
273
|
+
on paths the incoming commits do not touch are kept. Anything staged refuses the pull (the checkout
|
|
274
|
+
would drop it), naming the paths. A pull interrupted after its checkout is finished on the next call. If they do touch them, it throws `GatewayDirtyWorkingTreeError` with the
|
|
275
|
+
`paths` and changes nothing. If both sides have moved on it throws `GatewayWorkingCopyError`
|
|
276
|
+
(`diverged`).
|
|
277
|
+
- `push` is never forced, never deletes a ref and never sends tags. An upstream that has moved on
|
|
278
|
+
(found locally, or reported by the gateway as `409`) is `GatewayConflictError`; a token without
|
|
279
|
+
`kb:push` is `GatewayScopeError`.
|
|
280
|
+
- Gateway failures map through `gatewayErrorFor`, as for REST. Operations share the client's
|
|
281
|
+
one-at-a-time queue.
|
|
282
|
+
|
|
283
|
+
#### Access tokens
|
|
284
|
+
|
|
285
|
+
`core.gateway.tokens` ([`GatewayTokenService`](src/gateway/GatewayTokenService.ts)) manages the
|
|
286
|
+
caller's **own** tokens. Every call needs the `tokens:self` scope on the stored token
|
|
287
|
+
(`GatewayScopeError` with `scope: "tokens:self"` otherwise); nothing addresses another user.
|
|
288
|
+
|
|
289
|
+
```typescript
|
|
290
|
+
const tokens = await core.gateway.tokens.list(); // [{ id, alias, scopes, createdAt (null for old tokens), expiresAt, lastUsedAt (approximate), current, neverExpires, expired }] - expired tokens are listed too
|
|
291
|
+
const minted = await core.gateway.tokens.create({ alias: "ci", scopes: ["kb:read"] }); // 90 days by default
|
|
292
|
+
minted.expiryCapped; // null, or { cappedTo, requested: "90d" } when the 90-day default was cut to the stored token's own expiry
|
|
293
|
+
minted.token; // the b6pt_ secret, shown this once; expiresAt: null mints one that never expires (neverExpires: true)
|
|
294
|
+
await core.gateway.tokens.revoke("ci"); // id or alias → { id, alias, revokedCurrent }
|
|
295
|
+
await core.gateway.tokens.rotate("laptop"); // → { replaced, token, rotatedCurrent }
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
- An id or alias is trimmed and resolved through `list()` first: no match is `GatewayNotFoundError`,
|
|
299
|
+
a value that is one token's id and another's alias is `GatewayTokenAmbiguousError`, and a value
|
|
300
|
+
containing `b6pt_` anywhere (a pasted secret) is refused (`GatewayInvalidArgumentError`) without
|
|
301
|
+
being sent. Nothing is revoked or rotated in any of these cases, and no message quotes the value.
|
|
302
|
+
- `create` refuses an empty or whitespace alias, an empty scope list or an expiry that is not a
|
|
303
|
+
strict ISO 8601 date-time with a time zone (`2027-02-01T00:00:00Z`, `…+05:30`; a plain date,
|
|
304
|
+
`March 7` or `1` is refused) before sending (`GatewayInvalidArgumentError`). A new token's scopes must be a subset of the
|
|
305
|
+
stored token's.
|
|
306
|
+
- **Expiry.** The gateway caps a new token's expiry at the presenting token's. With no `expiresAt`,
|
|
307
|
+
`create` sends none and the gateway mints for the sooner of 90 days and the stored token's expiry;
|
|
308
|
+
`expiryCapped` (`{ cappedTo, requested: "90d" }`, `cappedTo` = the returned `expiresAt`) is set only
|
|
309
|
+
when that cut more than 24 hours off the 90 days. An explicit expiry, or `null`, is sent as given. A
|
|
310
|
+
`403 not-permitted` on a mint or rotate is typed by the body's `reason`:
|
|
311
|
+
`expiry-exceeds-presenting` (with `presentingExpiresAt`) is `GatewayTokenExpiryRefusedError`,
|
|
312
|
+
`restricted-mints-disabled` is `GatewayRestrictedMintsDisabledError`, `rewrite-not-permitted` (with
|
|
313
|
+
`scope: "kb:rewrite"`) is `GatewayRewriteNotPermittedError`, and any other or missing
|
|
314
|
+
reason stays `GatewayNotPermittedError` (`reason` says what arrived). Other mint failures:
|
|
315
|
+
`GatewayTokenLimitError` (`409 token-limit`, `limit`), `GatewayInvalidRequestError` (`400`). Scopes
|
|
316
|
+
(including `kb:rewrite`) are not checked client-side.
|
|
317
|
+
- **Rotating the stored token** (`current`) stores the replacement in its place: there is still one
|
|
318
|
+
stored token. If storing fails after the gateway has rotated (so the old token is already
|
|
319
|
+
revoked), `rotate` throws `GatewayTokenStoreError`, whose non-enumerable `replacement` property
|
|
320
|
+
carries the new token, secret included, so it can be shown and the user is not locked out. The
|
|
321
|
+
store also refuses, the same way, when the stored token is no longer the one that was rotated
|
|
322
|
+
(an in-process compare-then-write, not atomic across processes). The list, the rotate and the
|
|
323
|
+
store run as one entry in the client's queue with one read of the stored token, so a request
|
|
324
|
+
queued behind a rotation presents the replacement, never the revoked token.
|
|
325
|
+
- **A minted secret that reaches core is never dropped.** When a create or rotate answer carries
|
|
326
|
+
the secret but is otherwise off-contract, the call throws `GatewayOffContractTokenError`, whose
|
|
327
|
+
non-enumerable `secret` holds it; for a rotation of the stored token it is still offered to the
|
|
328
|
+
store, and `stored` says whether that worked. The store reads the token back after writing, so
|
|
329
|
+
another writer's overwrite (for example a second b6p process) is `GatewayTokenStoreError`, not
|
|
330
|
+
success.
|
|
331
|
+
- **An answer that never arrives** (a dropped connection, a timeout, or `502`/`503`/`504` on the
|
|
332
|
+
create or rotate request) is `GatewayOutcomeUnknownError` (a `GatewayUnavailableError`,
|
|
333
|
+
`operation` `create` or `rotate`): the token may have been minted or rotated, and for a rotation
|
|
334
|
+
the old one may already be revoked. Any new secret is lost; the error says the outcome is unknown.
|
|
335
|
+
- **Rotation is retried once.** `rotate` sends an `Idempotency-Key` (a fresh UUID per call). When the
|
|
336
|
+
rotate request goes unanswered, it is retried once with the same key and presenting token, and the
|
|
337
|
+
gateway answers the retry with the first attempt's result without rotating again; a successful
|
|
338
|
+
retry is the normal path. `GatewayOutcomeUnknownError` (`retried: true`) follows only when the
|
|
339
|
+
retry is unanswered too, or is refused `401`/`404` while rotating the stored token (the first
|
|
340
|
+
attempt most likely rotated and so revoked it); the store is then left untouched. A create is
|
|
341
|
+
never retried. A rotated token keeps its absolute end date; an expired one cannot be rotated
|
|
342
|
+
(`GatewayInvalidRequestError`).
|
|
343
|
+
- **Revoking the stored token** is allowed. The result says `revokedCurrent: true` and the stored
|
|
344
|
+
(now dead) token is left in place; what to do next is the consumer's call.
|
|
345
|
+
- Core never logs a secret or puts one in an error message. Warning about a token that never
|
|
346
|
+
expires is the consumer's job; results carry `neverExpires`.
|
|
347
|
+
|
|
348
|
+
#### Marketplace
|
|
349
|
+
|
|
350
|
+
`core.gateway.marketplace` ([`GatewayMarketplace`](src/gateway/GatewayMarketplace.ts)) lists the
|
|
351
|
+
marketplace repos (name, description, default branch, tags, `gitUrl`; the body is validated) and
|
|
352
|
+
pulls a plain working clone of one. It is unrelated to any script's sources or pins, and there is
|
|
353
|
+
no push (the gateway refuses it for the marketplace).
|
|
354
|
+
|
|
355
|
+
```typescript
|
|
356
|
+
const repos = await core.gateway.marketplace.list();
|
|
357
|
+
const repo = await core.gateway.marketplace.get("core"); // GatewayNotFoundError if absent
|
|
358
|
+
await core.gateway.marketplace.pull("core", { cwd }); // <cwd>/core at the default branch
|
|
359
|
+
await core.gateway.marketplace.pull("core", { cwd, dir, ref: "v1.1.0" }); // a tag (detached head) or branch
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
`cwd` is the consumer's own working directory (core never reads `process.cwd()`); `dir` is relative to it.
|
|
363
|
+
`list` leaves out a malformed entry rather than failing for every repo (`get` of that name is
|
|
364
|
+
`GatewayUnexpectedResponseError`), and a name is checked as a folder name only when `dir` is omitted.
|
|
365
|
+
`ref` may be a short name or `refs/heads/x` / `refs/tags/x` (normalised to `x`). A folder name from the listing must be a plain segment: no leading dot (so never `.git`), `git~N`, control or reserved characters, or Windows device names (`CON`, `CONIN$`, `COM0`..., also `CON .txt`), and no Unicode control, format or invisible characters (those make the whole listing entry malformed, in any text field). `cwd` must be absolute and is required unless `dir` is absolute: a relative folder without it is `GatewayConfigError`.
|
|
366
|
+
`pull` clones into a missing or empty folder. A folder that already holds a clone of the same
|
|
367
|
+
`gitUrl` on a branch is fast-forwarded (`action`: `fast-forwarded`, `up-to-date` or `ahead`); a tag
|
|
368
|
+
checkout is `up-to-date` when the gateway's tag still points at the checked-out commit, else
|
|
369
|
+
`GatewayCloneMismatchError` (`tag-moved`, or `tag-gone` when the gateway no longer has the tag). A clone of another repo, or on another ref than asked for, is
|
|
370
|
+
`GatewayCloneMismatchError` (`reason`: `different-repo` / `different-ref` / `tag-moved` / `tag-gone`, plus `dir` and `repo`) and is
|
|
371
|
+
left untouched; local changes the incoming commits would overwrite are `GatewayDirtyWorkingTreeError`;
|
|
372
|
+
a folder with files but no clone is `GatewayWorkingCopyError` (`not-empty`).
|
|
373
|
+
|
|
374
|
+
#### Knowledge bases
|
|
375
|
+
|
|
376
|
+
`core.gateway.kb` ([`GatewayKb`](src/gateway/GatewayKb.ts)) lists the knowledge bases the token's user
|
|
377
|
+
may read, global and tenant, and pulls and pushes them over `core.gateway.git`. A KB is addressed as
|
|
378
|
+
`<name>` (global) or `<U…>/<name>` (tenant); the listing's own `global/<name>` and
|
|
379
|
+
`tenant/<U…>/<name>` forms work too.
|
|
380
|
+
|
|
381
|
+
```typescript
|
|
382
|
+
const kbs = await core.gateway.kb.list({ scope: "tenant", tenant: "U142133" }); // ref, scope, tenant, name, title, liveBranch, canPush, gitUrl
|
|
383
|
+
const kb = await core.gateway.kb.resolve("onboarding");
|
|
384
|
+
const pulled = await core.gateway.kb.pull("U142133/handbook", { cwd: process.cwd() }); // clones into <cwd>/U142133-handbook
|
|
385
|
+
const pushed = await core.gateway.kb.push(pulled.dir); // { pushed, commit, ref }; a relative dir needs { cwd }
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
- `list` checks the body's shape and throws `GatewayUnexpectedResponseError` for a bad one.
|
|
389
|
+
- `resolve` throws `GatewayKnowledgeBaseError` (`reason`: `bad-ref`, `not-found`, `ambiguous` with
|
|
390
|
+
`candidates`).
|
|
391
|
+
- `pull` clones the live branch into a missing or empty folder (`dir`, relative to the `cwd` you pass;
|
|
392
|
+
default `<name>`, or `<tenant>-<name>`), and fast-forwards an existing clone of the same repository.
|
|
393
|
+
An existing clone that is not on the KB's live branch, does not track it, or is detached is refused before any fetch with `GatewayKnowledgeBaseError` (`wrong-branch`, `branch`, `liveBranch`). A clone of a different repository is `GatewayWorkingCopyError` (`wrong-repository`); incoming commits
|
|
394
|
+
that touch locally changed files are `GatewayDirtyWorkingTreeError` (`paths`). It never prompts and
|
|
395
|
+
has no way to discard local changes.
|
|
396
|
+
- `push` finds the KB from the clone's remote in a fresh listing and refuses a KB with
|
|
397
|
+
`canPush: false` before sending anything, with `GatewayKnowledgeBasePushNotPermittedError` (`ref`).
|
|
398
|
+
A clone not on the KB's live branch, not tracking it, or detached is refused the same way with `GatewayKnowledgeBaseError` (`wrong-branch`, `branch`, `liveBranch`). A gateway branch that moved on is `GatewayConflictError`.
|
|
399
|
+
|
|
400
|
+
For specs, [`FakeGateway`](src/testing/FakeGateway.ts) is an in-process gateway on `127.0.0.1` that
|
|
401
|
+
answers the contract's REST routes (the token routes included) and error codes, with `grantToken`
|
|
402
|
+
(scopes, plus optional id, alias, owner and expiry; an expired token is `401 token-invalid`),
|
|
403
|
+
`issuedTokens`, `issuedSecrets` (every secret ever accepted, revoked ones included, for leak
|
|
404
|
+
checks), `failNext` and `route` (for mounting git smart-HTTP handlers).
|
|
405
|
+
|
|
156
406
|
## Development
|
|
157
407
|
|
|
158
408
|
```bash
|
package/dist/B6PCore.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { ScriptMetaDataStore } from "./cache/ScriptMetaDataStore";
|
|
|
5
5
|
import { OrgCache } from "./cache/OrgCache";
|
|
6
6
|
import { ScriptService } from "./script/ScriptService";
|
|
7
7
|
import { UpdateService } from "./update/UpdateService";
|
|
8
|
+
import { GatewayService } from "./gateway/GatewayService";
|
|
9
|
+
import { SchemaService } from "./schema/SchemaService";
|
|
8
10
|
/**
|
|
9
11
|
* Result returned by the report command.
|
|
10
12
|
*/
|
|
@@ -59,6 +61,17 @@ export declare class B6PCore {
|
|
|
59
61
|
* @lastreviewed null
|
|
60
62
|
*/
|
|
61
63
|
readonly script: ScriptService;
|
|
64
|
+
/**
|
|
65
|
+
* Web-global's gateway: knowledge bases, marketplace repos and the caller's own tokens, over the
|
|
66
|
+
* `b6pt_` token.
|
|
67
|
+
* @lastreviewed null
|
|
68
|
+
*/
|
|
69
|
+
readonly gateway: GatewayService;
|
|
70
|
+
/**
|
|
71
|
+
* Schema apply: generate, test and apply declarative manifests against one org (super users only).
|
|
72
|
+
* @lastreviewed null
|
|
73
|
+
*/
|
|
74
|
+
readonly schema: SchemaService;
|
|
62
75
|
private readonly _isDebugMode;
|
|
63
76
|
constructor(providers: B6PProviders);
|
|
64
77
|
isDebugMode(): boolean;
|
package/dist/B6PCore.js
CHANGED
|
@@ -42,9 +42,41 @@ const ScriptMetaDataStore_1 = require("./cache/ScriptMetaDataStore");
|
|
|
42
42
|
const OrgCache_1 = require("./cache/OrgCache");
|
|
43
43
|
const ScriptService_1 = require("./script/ScriptService");
|
|
44
44
|
const UpdateService_1 = require("./update/UpdateService");
|
|
45
|
+
const GatewayService_1 = require("./gateway/GatewayService");
|
|
46
|
+
const SchemaService_1 = require("./schema/SchemaService");
|
|
47
|
+
const Gateway_1 = require("./constants/Gateway");
|
|
48
|
+
const SettingsKeys_1 = require("./constants/SettingsKeys");
|
|
45
49
|
const NOOP_ORG_CACHE_SETTINGS = {
|
|
46
50
|
getParsedAnyDomainOverrideUrl: () => null,
|
|
47
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* The gateway's token source: the `b6pt_` token the bearer provider already stores (ruling 22),
|
|
54
|
+
* read without prompting. A consumer-supplied {@link AuthProvider} of some other scheme holds no
|
|
55
|
+
* such token, so the gateway then has none and every request fails `token-missing` before sending.
|
|
56
|
+
* @lastreviewed null
|
|
57
|
+
*/
|
|
58
|
+
function gatewayTokenFrom(auth) {
|
|
59
|
+
if (auth instanceof BearerAuthProvider_1.BearerAuthProvider) {
|
|
60
|
+
return { token: () => auth.storedToken() };
|
|
61
|
+
}
|
|
62
|
+
return { token: async () => undefined };
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Where a rotated replacement of the stored token is written: {@link BearerAuthProvider.replaceStoredToken}.
|
|
66
|
+
* Any other {@link AuthProvider} stores no `b6pt_` token, so the gateway never presented one and
|
|
67
|
+
* there is nothing to replace; the write is refused.
|
|
68
|
+
* @lastreviewed null
|
|
69
|
+
*/
|
|
70
|
+
function gatewayTokenStoreFrom(auth) {
|
|
71
|
+
if (auth instanceof BearerAuthProvider_1.BearerAuthProvider) {
|
|
72
|
+
return { replace: (expected, next) => auth.replaceStoredToken(expected, next) };
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
replace: async () => {
|
|
76
|
+
throw new Error("The configured auth provider stores no gateway token to replace.");
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
48
80
|
/**
|
|
49
81
|
* Headless SDK entry point for the BlueStep platform.
|
|
50
82
|
*
|
|
@@ -91,6 +123,17 @@ class B6PCore {
|
|
|
91
123
|
* @lastreviewed null
|
|
92
124
|
*/
|
|
93
125
|
script;
|
|
126
|
+
/**
|
|
127
|
+
* Web-global's gateway: knowledge bases, marketplace repos and the caller's own tokens, over the
|
|
128
|
+
* `b6pt_` token.
|
|
129
|
+
* @lastreviewed null
|
|
130
|
+
*/
|
|
131
|
+
gateway;
|
|
132
|
+
/**
|
|
133
|
+
* Schema apply: generate, test and apply declarative manifests against one org (super users only).
|
|
134
|
+
* @lastreviewed null
|
|
135
|
+
*/
|
|
136
|
+
schema;
|
|
94
137
|
_isDebugMode;
|
|
95
138
|
constructor(providers) {
|
|
96
139
|
this.fs = providers.fs;
|
|
@@ -121,7 +164,6 @@ class B6PCore {
|
|
|
121
164
|
...platform,
|
|
122
165
|
scriptMetadataStore: this.scriptMetadataStore,
|
|
123
166
|
orgCache: this.orgCache,
|
|
124
|
-
typescriptLibDirs: providers.typescriptLibDirs,
|
|
125
167
|
gitFs: providers.gitFs ?? nodeFs,
|
|
126
168
|
gitToken: async () => {
|
|
127
169
|
const header = await this.auth.authHeaderValue();
|
|
@@ -130,6 +172,24 @@ class B6PCore {
|
|
|
130
172
|
gitFetch: providers.fetchFn,
|
|
131
173
|
gitEnv: providers.gitEnv,
|
|
132
174
|
});
|
|
175
|
+
this.schema = new SchemaService_1.SchemaService(platform);
|
|
176
|
+
// The gateway is a second origin that takes the same stored `b6pt_` token, but per request: it
|
|
177
|
+
// reads it through a non-prompting accessor and never goes through `SessionManager`'s cookie
|
|
178
|
+
// bootstrap or `auth.authHeaderValue()`. Its URL is read from core config on every
|
|
179
|
+
// request (default gateway.bluestep.net) and validated by the client.
|
|
180
|
+
const persistence = this.persistence;
|
|
181
|
+
this.gateway = new GatewayService_1.GatewayService({
|
|
182
|
+
...platform,
|
|
183
|
+
gatewayToken: gatewayTokenFrom(this.auth),
|
|
184
|
+
gatewayTokenStore: gatewayTokenStoreFrom(this.auth),
|
|
185
|
+
gatewayUrl: async () => {
|
|
186
|
+
const configured = await persistence.get(`settings.${SettingsKeys_1.SettingsKeys.GATEWAY_URL}`);
|
|
187
|
+
return configured === undefined || configured === null || configured === ""
|
|
188
|
+
? Gateway_1.Gateway.DEFAULT_URL
|
|
189
|
+
: String(configured);
|
|
190
|
+
},
|
|
191
|
+
fetchFn: providers.fetchFn ?? globalThis.fetch.bind(globalThis),
|
|
192
|
+
});
|
|
133
193
|
// Initialize update service if configuration is provided
|
|
134
194
|
if (providers.updateServiceConfig) {
|
|
135
195
|
this.updateService = new UpdateService_1.UpdateService(this.persistence, this.logger, providers.updateServiceConfig, providers.fetchFn);
|
package/dist/B6PCore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"B6PCore.js","sourceRoot":"","sources":["../src/B6PCore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"B6PCore.js","sourceRoot":"","sources":["../src/B6PCore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QACrG,CAAC;IACH,CAAC;IAED,qEAAqE;IAErE,KAAK,CAAC,SAAS,CAAC,GAAW,EAAE,KAAc;QACzC,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,SAAS,CAAI,GAAW;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAI,YAAY,GAAG,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;CACF"}
|
package/dist/B6PUri.d.ts
CHANGED
|
@@ -124,11 +124,11 @@ export declare class B6PUri {
|
|
|
124
124
|
* of one directory compare equal.
|
|
125
125
|
*
|
|
126
126
|
* The single definition behind every marker-insensitive comparison in the codebase:
|
|
127
|
-
* `ScriptFolder.contains`/`equals`,
|
|
128
|
-
*
|
|
127
|
+
* `ScriptFolder.contains`/`equals`, path-containment checks in the push, and
|
|
128
|
+
* `MockFileSystem`'s entry keys. It lives here, beside
|
|
129
129
|
* {@link B6PUri.isDirectoryMarked} and {@link B6PUri.asDirectory}, because a
|
|
130
|
-
* comparison rule that disagrees with the API producing the marker
|
|
131
|
-
*
|
|
130
|
+
* comparison rule that disagrees with the API producing the marker once silently
|
|
131
|
+
* broke a containment check.
|
|
132
132
|
*
|
|
133
133
|
* Accepts either a filesystem path or a URL string, and handles each on its own
|
|
134
134
|
* terms:
|
|
@@ -154,10 +154,8 @@ export declare class B6PUri {
|
|
|
154
154
|
* The result is a directory in every case by construction, so marking it looks
|
|
155
155
|
* right — and an earlier revision did exactly that, via {@link B6PUri.asDirectory}.
|
|
156
156
|
* It caused a real regression: `TsConfig.folder()` is built from `rawUri.dirname`,
|
|
157
|
-
* so
|
|
158
|
-
*
|
|
159
|
-
* `"…/static" + sep + sep`. Nothing ever matched, and `b6p push` silently stopped
|
|
160
|
-
* warning about stale compiled client bundles.
|
|
157
|
+
* so a containment test began comparing against `"…/static" + sep + sep`.
|
|
158
|
+
* Nothing ever matched, and a check that depended on it silently stopped working.
|
|
161
159
|
*
|
|
162
160
|
* The misclassification the marker was meant to prevent — `ScriptFactory.createNode`
|
|
163
161
|
* treating a parent directory as a `ScriptFile` — is not reachable from any call
|
package/dist/B6PUri.js
CHANGED
|
@@ -212,11 +212,11 @@ class B6PUri {
|
|
|
212
212
|
* of one directory compare equal.
|
|
213
213
|
*
|
|
214
214
|
* The single definition behind every marker-insensitive comparison in the codebase:
|
|
215
|
-
* `ScriptFolder.contains`/`equals`,
|
|
216
|
-
*
|
|
215
|
+
* `ScriptFolder.contains`/`equals`, path-containment checks in the push, and
|
|
216
|
+
* `MockFileSystem`'s entry keys. It lives here, beside
|
|
217
217
|
* {@link B6PUri.isDirectoryMarked} and {@link B6PUri.asDirectory}, because a
|
|
218
|
-
* comparison rule that disagrees with the API producing the marker
|
|
219
|
-
*
|
|
218
|
+
* comparison rule that disagrees with the API producing the marker once silently
|
|
219
|
+
* broke a containment check.
|
|
220
220
|
*
|
|
221
221
|
* Accepts either a filesystem path or a URL string, and handles each on its own
|
|
222
222
|
* terms:
|
|
@@ -259,10 +259,8 @@ class B6PUri {
|
|
|
259
259
|
* The result is a directory in every case by construction, so marking it looks
|
|
260
260
|
* right — and an earlier revision did exactly that, via {@link B6PUri.asDirectory}.
|
|
261
261
|
* It caused a real regression: `TsConfig.folder()` is built from `rawUri.dirname`,
|
|
262
|
-
* so
|
|
263
|
-
*
|
|
264
|
-
* `"…/static" + sep + sep`. Nothing ever matched, and `b6p push` silently stopped
|
|
265
|
-
* warning about stale compiled client bundles.
|
|
262
|
+
* so a containment test began comparing against `"…/static" + sep + sep`.
|
|
263
|
+
* Nothing ever matched, and a check that depended on it silently stopped working.
|
|
266
264
|
*
|
|
267
265
|
* The misclassification the marker was meant to prevent — `ScriptFactory.createNode`
|
|
268
266
|
* treating a parent directory as a `ScriptFile` — is not reachable from any call
|
package/dist/B6PUri.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"B6PUri.js","sourceRoot":"","sources":["../src/B6PUri.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"B6PUri.js","sourceRoot":"","sources":["../src/B6PUri.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,IAAI,iCAAa;AAC7B,6BAAmD;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IACuC,KAAK;IAA1C,YAAqC,KAAa;qBAAb,KAAK;IAAW,CAAC;IAEtD,qEAAqE;IAErE,0FAA0F;IAC1F,MAAM,CAAC,UAAU,CAAC,MAAc;QAC9B,OAAO,IAAI,MAAM,CAAC,IAAA,mBAAa,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,OAAO,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,qEAAqE;IAErE;;;;;;;;;;;;;OAaG;IACK,KAAK;QACX,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B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