@speedkit/cli 4.2.0 → 4.3.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/CHANGELOG.md +15 -0
- package/README.md +3 -3
- package/dist/helpers/html-format-helper.js +1 -2
- package/dist/services/onboarding/browser/extension/extension-downloader.js +2 -2
- package/dist/services/onboarding/browser/extension/extension-validator.js +2 -1
- package/dist/services/onboarding/dashboard/index.d.ts +2 -2
- package/dist/services/onboarding/dashboard/index.js +1 -1
- package/dist/services/onboarding/onboarding-service-factory.d.ts +1 -0
- package/dist/services/onboarding/onboarding-service-factory.js +25 -5
- package/dist/services/query-builder/query-builder-service.d.ts +1 -0
- package/dist/services/query-builder/query-builder-service.js +9 -0
- package/oclif.manifest.json +1 -1
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [4.3.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.2.1...v4.3.0) (2026-05-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **devtools:** do not download devtools if one of the extensions is configured from local ([049cb38](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/049cb38d22756a837759094038c60ae6c22a6bb5))
|
|
7
|
+
* **devtools:** switch to the new devtools project ([b026e2a](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/b026e2a36b6353527204611e7f02463a58968dc7))
|
|
8
|
+
|
|
9
|
+
## [4.2.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.2.0...v4.2.1) (2026-05-12)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* remove memoryLeaking htmlFormatter ([5472bbb](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/5472bbb58bb24064b857fd30156247429998bc47))
|
|
15
|
+
|
|
1
16
|
# [4.2.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.1.0...v4.2.0) (2026-05-08)
|
|
2
17
|
|
|
3
18
|
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ $ npm install -g @speedkit/cli
|
|
|
21
21
|
$ sk COMMAND
|
|
22
22
|
running command...
|
|
23
23
|
$ sk (--version)
|
|
24
|
-
@speedkit/cli/4.
|
|
24
|
+
@speedkit/cli/4.3.0 linux-x64 node-v22.22.2
|
|
25
25
|
$ sk --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ sk COMMAND
|
|
@@ -112,7 +112,7 @@ EXAMPLES
|
|
|
112
112
|
$ sk autocomplete --refresh-cache
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.
|
|
115
|
+
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.49/src/commands/autocomplete/index.ts)_
|
|
116
116
|
|
|
117
117
|
## `sk build-parameter-query CUSTOMERPATH`
|
|
118
118
|
|
|
@@ -355,7 +355,7 @@ DESCRIPTION
|
|
|
355
355
|
Display help for sk.
|
|
356
356
|
```
|
|
357
357
|
|
|
358
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.
|
|
358
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.48/src/commands/help.ts)_
|
|
359
359
|
|
|
360
360
|
## `sk login [APP]`
|
|
361
361
|
|
|
@@ -44,7 +44,7 @@ export class ExtensionDownloader {
|
|
|
44
44
|
}
|
|
45
45
|
async updateLocalDevtools() {
|
|
46
46
|
// downloadExtension
|
|
47
|
-
const extensionResponse = await fetch("https://threepointonefour.app.baqend.com/v1/code/
|
|
47
|
+
const extensionResponse = await fetch("https://threepointonefour.app.baqend.com/v1/code/webhook_devtools_release?download");
|
|
48
48
|
// get fileName from header
|
|
49
49
|
const fileName = extensionResponse.headers.get("filename");
|
|
50
50
|
// resolve path for unpacked extension
|
|
@@ -74,7 +74,7 @@ export class ExtensionDownloader {
|
|
|
74
74
|
return manifestConfig.version;
|
|
75
75
|
}
|
|
76
76
|
async getRemoteVersion() {
|
|
77
|
-
const versionResponse = await fetch("https://threepointonefour.app.baqend.com/v1/code/
|
|
77
|
+
const versionResponse = await fetch("https://threepointonefour.app.baqend.com/v1/code/webhook_devtools_release");
|
|
78
78
|
if (!versionResponse.ok) {
|
|
79
79
|
throw new Error("Could not find version for" + devtools);
|
|
80
80
|
}
|
|
@@ -57,7 +57,8 @@ export class ExtensionValidator {
|
|
|
57
57
|
}
|
|
58
58
|
async handleDevtoolsExtension(validExtensions) {
|
|
59
59
|
// check if devtools extension can be find in current extensionPaths
|
|
60
|
-
if (validExtensions.some((config) => config.name.toLowerCase().includes("devtools
|
|
60
|
+
if (validExtensions.some((config) => config.name.toLowerCase().includes("speed-kit devtools") ||
|
|
61
|
+
config.name.toLowerCase().includes("devtools extension"))) {
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
64
|
// download or update extension
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
2
2
|
import { Protocol } from "devtools-protocol";
|
|
3
|
-
import { ParameterQueryBuilder } from "./parameter-query-builder.js";
|
|
4
3
|
import { CustomerConfig } from "../../integration-api/index.js";
|
|
5
4
|
import { RequestDiffService } from "./request-diff-service.js";
|
|
6
5
|
import { Cache } from "../request-cache/cache.js";
|
|
7
6
|
import { AthenaService } from "../../athena/index.js";
|
|
8
7
|
import { DiffAgainstCurrentPage } from "./diff-against-current-page.js";
|
|
8
|
+
import { QueryBuilderService } from "../../query-builder/query-builder-service.js";
|
|
9
9
|
export declare class Dashboard {
|
|
10
10
|
private customerConfig;
|
|
11
11
|
private parameterQueryBuilder;
|
|
@@ -14,7 +14,7 @@ export declare class Dashboard {
|
|
|
14
14
|
private currentPageDiff;
|
|
15
15
|
private cache;
|
|
16
16
|
private athenaLastResult;
|
|
17
|
-
constructor(customerConfig: CustomerConfig, parameterQueryBuilder:
|
|
17
|
+
constructor(customerConfig: CustomerConfig, parameterQueryBuilder: QueryBuilderService, athenaClient: AthenaService, requestDiffService: RequestDiffService, currentPageDiff: DiffAgainstCurrentPage, cache: Cache);
|
|
18
18
|
getResponse(request: Protocol.Network.Request): Promise<BaqendResponse>;
|
|
19
19
|
private createBaqendResponse;
|
|
20
20
|
}
|
|
@@ -27,7 +27,7 @@ export class Dashboard {
|
|
|
27
27
|
return this.createBaqendResponse(requestOrigin, "unsupported method");
|
|
28
28
|
}
|
|
29
29
|
if (url.pathname.startsWith("/query/create")) {
|
|
30
|
-
return this.createBaqendResponse(requestOrigin, JSON.stringify({ query: this.parameterQueryBuilder.
|
|
30
|
+
return this.createBaqendResponse(requestOrigin, JSON.stringify({ query: this.parameterQueryBuilder.query() }), "application/json; charset=UTF-8");
|
|
31
31
|
}
|
|
32
32
|
if (url.pathname.startsWith("/query/execute")) {
|
|
33
33
|
const postData = request.postData;
|
|
@@ -7,6 +7,7 @@ export declare class OnboardingServiceFactory {
|
|
|
7
7
|
constructor(context: OnboardingContext, cliConfig: UserCliConfig);
|
|
8
8
|
getService(): Promise<OnboardingService>;
|
|
9
9
|
private prepareMessagehandler;
|
|
10
|
+
private getAppToken;
|
|
10
11
|
private buildInstallResource;
|
|
11
12
|
private getAthenaClient;
|
|
12
13
|
private getConfigApi;
|
|
@@ -9,7 +9,6 @@ import { ExternalFileReader, IntegrationApiContext, VirtualFile, ExternalRecipe,
|
|
|
9
9
|
import { InstallFileRecipe } from "./config-renderer/install-file-recipe.js";
|
|
10
10
|
import { SpeedKitInstallContext } from "./config-renderer/speed-kit-install-context.js";
|
|
11
11
|
import { Dashboard } from "./dashboard/index.js";
|
|
12
|
-
import { ParameterQueryBuilder } from "./dashboard/parameter-query-builder.js";
|
|
13
12
|
import { RequestDiffService } from "./dashboard/request-diff-service.js";
|
|
14
13
|
import { FetchEventHandler } from "./fetch-event-handler.js";
|
|
15
14
|
import { CustomerDomainDocumentResponse } from "./fetch-events/customer-domain-document-response.js";
|
|
@@ -26,13 +25,13 @@ import { OnboardingService } from "./onboarding-service.js";
|
|
|
26
25
|
import { Cache } from "./request-cache/cache.js";
|
|
27
26
|
import { InstallSpeedKitHtmlTemplate } from "./templates/install-speed-kit-html-template.js";
|
|
28
27
|
import { InstallSpeedKitJsTemplate } from "./templates/install-speed-kit-js-template.js";
|
|
29
|
-
// import { TodoCollector } from "./todo-collector";
|
|
30
28
|
import { ExtensionValidator } from "./browser/extension/extension-validator.js";
|
|
31
29
|
import { DevtoolsExtensionApi } from "./browser/extension/devtools-extension-api.js";
|
|
32
30
|
import { TodoCollector } from "./todo-collector.js";
|
|
33
31
|
import { Crawler } from "./virtual-orestes-app/crawler.js";
|
|
34
32
|
import { VirtualOrestesApp } from "./virtual-orestes-app/index.js";
|
|
35
33
|
import { ConfigApiContext, ConfigApiServiceFactory, } from "../config-api/index.js";
|
|
34
|
+
import { account } from "baqend/cli";
|
|
36
35
|
import * as fs from "node:fs";
|
|
37
36
|
import * as path from "node:path";
|
|
38
37
|
import { StaticRecipe } from "../integration-api/virtual/static-recipe.js";
|
|
@@ -41,6 +40,8 @@ import { ExtensionDownloader } from "./browser/extension/extension-downloader.js
|
|
|
41
40
|
import { ExecutableValidator } from "./browser/executable/executable-validator.js";
|
|
42
41
|
import { socksDispatcher } from "fetch-socks";
|
|
43
42
|
import crypto from "node:crypto";
|
|
43
|
+
import { QueryBuilderFactory } from "../query-builder/query-builder-factory.js";
|
|
44
|
+
import { QueryTpe } from "../query-builder/query-builder-model.js";
|
|
44
45
|
export class OnboardingServiceFactory {
|
|
45
46
|
context;
|
|
46
47
|
cliConfig;
|
|
@@ -81,10 +82,10 @@ export class OnboardingServiceFactory {
|
|
|
81
82
|
const fileWatcher = new FileWatcher(cli, customerConfig, files, documentHandler, browserContext, cache);
|
|
82
83
|
const athenaClient = (await this.getAthenaClient()) || null;
|
|
83
84
|
const fetchHandler = await this.getFetchEventHandler(files, customerConfig, documentHandler, cache, cli, browserContext, athenaClient);
|
|
84
|
-
const messageHandler = this.prepareMessagehandler(athenaClient, files);
|
|
85
|
+
const messageHandler = await this.prepareMessagehandler(athenaClient, files, customerConfig);
|
|
85
86
|
return new OnboardingService(browserContext, customerConfig, fetchHandler, fileWatcher, cli, messageHandler);
|
|
86
87
|
}
|
|
87
|
-
prepareMessagehandler(athenaClient, files) {
|
|
88
|
+
async prepareMessagehandler(athenaClient, files, customerConfig) {
|
|
88
89
|
const messageHandler = new DevtoolsExtensionApi();
|
|
89
90
|
messageHandler.addMessage({
|
|
90
91
|
id: "athena",
|
|
@@ -95,8 +96,23 @@ export class OnboardingServiceFactory {
|
|
|
95
96
|
id: "todo",
|
|
96
97
|
data: [...fileTodoCollector.getOpenTasks()],
|
|
97
98
|
});
|
|
99
|
+
const appToken = await this.getAppToken(customerConfig.app);
|
|
100
|
+
if (appToken) {
|
|
101
|
+
messageHandler.addMessage({
|
|
102
|
+
id: "appToken",
|
|
103
|
+
data: { app: customerConfig.app, token: appToken },
|
|
104
|
+
});
|
|
105
|
+
}
|
|
98
106
|
return messageHandler;
|
|
99
107
|
}
|
|
108
|
+
async getAppToken(app) {
|
|
109
|
+
// skipInput=true -> fail instead of prompting when no valid login is cached
|
|
110
|
+
const result = await safe(account.login({ app, skipInput: true }));
|
|
111
|
+
if (result.success !== true) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return result.data.token ?? null;
|
|
115
|
+
}
|
|
100
116
|
async buildInstallResource(speedKitInstallContext, files, cli) {
|
|
101
117
|
cli.startAction("ONBOARDING:BUILD:INSTALL_RESOURCE", "build file install_resource");
|
|
102
118
|
const installResourceFile = new VirtualFile(INTEGRATION_FILES.BUILD.INSTALL, new InstallFileRecipe(speedKitInstallContext));
|
|
@@ -124,7 +140,11 @@ export class OnboardingServiceFactory {
|
|
|
124
140
|
const serverConfig = await this.getSpeedKitServerConfig(configApi, cli);
|
|
125
141
|
const agent = this.getCrawlerAgent(customerConfig, cli);
|
|
126
142
|
const crawler = new Crawler(cli, agent, serverConfig);
|
|
127
|
-
const parameterQueryBuilder = new
|
|
143
|
+
const parameterQueryBuilder = await new QueryBuilderFactory({
|
|
144
|
+
configName: this.context.configName,
|
|
145
|
+
customerPath: this.context.customerPath,
|
|
146
|
+
isWindows: this.cliConfig.runtimeConfig.windows,
|
|
147
|
+
}, this.cliConfig).buildService(QueryTpe.parameter);
|
|
128
148
|
const DiffService = new DiffServiceFactory(new DiffContext(this.cliConfig.diffExec, this.cliConfig.diffExecTemplate)).getService();
|
|
129
149
|
const requestDiffService = new RequestDiffService(DiffService, documentHandler);
|
|
130
150
|
const handlers = [
|
|
@@ -43,6 +43,15 @@ export class QueryBuilderService {
|
|
|
43
43
|
this.cli.writeSuccess("Result has been copied to the clipboard 📋");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
query() {
|
|
47
|
+
const parameters = getStrippedParameters(this.speedKitConfig);
|
|
48
|
+
const parameterReplaceFilter = getParameterReplaceFilter(parameters, getSpeedKitConfigVersion(this.speedKitConfig));
|
|
49
|
+
const whitelistedFilter = getWhitelistedFilter(this.speedKitConfig);
|
|
50
|
+
const blacklistedFilter = getBlacklistedFilter(this.speedKitConfig);
|
|
51
|
+
const skConfigVersion = getSpeedKitConfigVersion(this.speedKitConfig);
|
|
52
|
+
const parameterFilter = getParameterFilter(parameters, skConfigVersion);
|
|
53
|
+
return this.buildQuery(this.context.app, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter);
|
|
54
|
+
}
|
|
46
55
|
buildQuery(app, parameterFilter, whitelistedFilter, blacklistedFilter, parameterReplaceFilter) {
|
|
47
56
|
if (this.context.queryType === QueryTpe.prewarm) {
|
|
48
57
|
return new Prewarm(app, whitelistedFilter, blacklistedFilter, parameterReplaceFilter).query;
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speedkit/cli",
|
|
3
3
|
"description": "Speed Kit CLI",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.3.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Baqend.com",
|
|
7
7
|
"email": "info@baqend.com"
|
|
@@ -82,16 +82,16 @@
|
|
|
82
82
|
"types": "dist/index.d.ts",
|
|
83
83
|
"type": "module",
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@aws-sdk/client-athena": "^3.
|
|
85
|
+
"@aws-sdk/client-athena": "^3.1045.0",
|
|
86
86
|
"@eslint/eslintrc": "^3.3.5",
|
|
87
87
|
"@eslint/js": "^10.0.1",
|
|
88
88
|
"@inquirer/prompts": "^8.4.2",
|
|
89
|
-
"@oclif/core": "^4.10.
|
|
89
|
+
"@oclif/core": "^4.10.6",
|
|
90
90
|
"@oclif/errors": "^1.3.6",
|
|
91
|
-
"@oclif/plugin-autocomplete": "^3.2.
|
|
92
|
-
"@oclif/plugin-help": "^6.2.
|
|
93
|
-
"@oclif/plugin-not-found": "^3.2.
|
|
94
|
-
"@oclif/plugin-warn-if-update-available": "^3.1.
|
|
91
|
+
"@oclif/plugin-autocomplete": "^3.2.46",
|
|
92
|
+
"@oclif/plugin-help": "^6.2.45",
|
|
93
|
+
"@oclif/plugin-not-found": "^3.2.81",
|
|
94
|
+
"@oclif/plugin-warn-if-update-available": "^3.1.61",
|
|
95
95
|
"baqend": "^4.2.5",
|
|
96
96
|
"chalk": "^5.6.2",
|
|
97
97
|
"cli-progress": "^3.12.0",
|
|
@@ -106,11 +106,10 @@
|
|
|
106
106
|
"fluent-ffmpeg": "^2.1.3",
|
|
107
107
|
"fs-extra": "^11.3.4",
|
|
108
108
|
"handlebars": "^4.7.9",
|
|
109
|
-
"htmlfy": "^1.0.1",
|
|
110
109
|
"iconv-lite": "^0.7.2",
|
|
111
110
|
"json2csv": "^6.0.0-alpha.2",
|
|
112
111
|
"node-fetch": "^3.3.2",
|
|
113
|
-
"nypm": "^0.6.
|
|
112
|
+
"nypm": "^0.6.6",
|
|
114
113
|
"puppeteer": "^24.41.0",
|
|
115
114
|
"puppeteer-extra": "^3.3.6",
|
|
116
115
|
"semver": "^7.7.4",
|