ai-project-manage-cli 1.0.29 → 2.0.1
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/dist/api/cli.d.ts +30 -0
- package/dist/api/cli.d.ts.map +1 -0
- package/dist/api/cli.js +3 -0
- package/dist/api/cli.js.map +1 -0
- package/dist/api/client.d.ts +10 -4
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +7 -4
- package/dist/api/client.js.map +1 -1
- package/dist/api/index.d.ts +3 -3
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -4
- package/dist/api/index.js.map +1 -1
- package/dist/api/request-config.d.ts +6 -15
- package/dist/api/request-config.d.ts.map +1 -1
- package/dist/api/request-config.js +8 -41
- package/dist/api/request-config.js.map +1 -1
- package/dist/api/requirement.d.ts +0 -133
- package/dist/api/requirement.d.ts.map +1 -1
- package/dist/api/requirement.js +0 -4
- package/dist/api/requirement.js.map +1 -1
- package/dist/cli/commands/auth.d.ts.map +1 -1
- package/dist/cli/commands/auth.js +32 -51
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +12 -48
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/publish.d.ts.map +1 -1
- package/dist/cli/commands/publish.js +3 -16
- package/dist/cli/commands/publish.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +2 -2
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/ws.d.ts.map +1 -1
- package/dist/cli/commands/ws.js +4 -73
- package/dist/cli/commands/ws.js.map +1 -1
- package/dist/cli/exit-api-error.d.ts.map +1 -1
- package/dist/cli/exit-api-error.js +6 -0
- package/dist/cli/exit-api-error.js.map +1 -1
- package/dist/cli.js +6 -38
- package/dist/cli.js.map +1 -1
- package/dist/core/apm-config.d.ts +27 -0
- package/dist/core/apm-config.d.ts.map +1 -0
- package/dist/core/apm-config.js +71 -0
- package/dist/core/apm-config.js.map +1 -0
- package/dist/core/constants.d.ts +4 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +7 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/cursor-cmd.d.ts +23 -0
- package/dist/core/cursor-cmd.d.ts.map +1 -0
- package/dist/core/cursor-cmd.js +137 -0
- package/dist/core/cursor-cmd.js.map +1 -0
- package/dist/core/std-event-handler.d.ts +25 -0
- package/dist/core/std-event-handler.d.ts.map +1 -0
- package/dist/core/std-event-handler.js +90 -0
- package/dist/core/std-event-handler.js.map +1 -0
- package/dist/core/utils.d.ts +18 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +61 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/core/ws-client.d.ts +24 -0
- package/dist/core/ws-client.d.ts.map +1 -0
- package/dist/core/ws-client.js +79 -0
- package/dist/core/ws-client.js.map +1 -0
- package/package.json +3 -3
- package/templates/skills/apm-auto-dev/SKILL.md +73 -16
- package/templates/skills/requirement-review/SKILL.md +12 -21
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** 对应 lpm-server `POST /cli/variables/get` */
|
|
2
|
+
export type ReqCliVariablesGet = void;
|
|
3
|
+
export type ResCliVariables = {
|
|
4
|
+
deploy: {
|
|
5
|
+
endpoint: string;
|
|
6
|
+
port: number;
|
|
7
|
+
useSsl: boolean;
|
|
8
|
+
bucket: string;
|
|
9
|
+
accessKey: string;
|
|
10
|
+
secretKey: string;
|
|
11
|
+
};
|
|
12
|
+
server: {
|
|
13
|
+
url: string;
|
|
14
|
+
wsPort: number;
|
|
15
|
+
};
|
|
16
|
+
auth: {
|
|
17
|
+
id: number;
|
|
18
|
+
token: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/** 对应 lpm-server `POST /cli/employee/auth`;`username` 为员工 id */
|
|
22
|
+
export type ReqCliLoginByEmployee = {
|
|
23
|
+
username: number;
|
|
24
|
+
password: string;
|
|
25
|
+
};
|
|
26
|
+
export type ResCliLoginByEmployee = {
|
|
27
|
+
token: string;
|
|
28
|
+
id: number;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/api/cli.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEtC,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
|
package/dist/api/cli.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/api/cli.ts"],"names":[],"mappings":""}
|
package/dist/api/client.d.ts
CHANGED
|
@@ -3,12 +3,18 @@ import { requestConfig } from "./request-config";
|
|
|
3
3
|
export type CreateApmClientOptions = {
|
|
4
4
|
/** 服务根地址,不含尾斜杠 */
|
|
5
5
|
baseUrl: string;
|
|
6
|
-
/** 员工 CLI token(与库表 `Employee.
|
|
6
|
+
/** 员工 CLI token(与库表 `Employee.token` 一致);登录前可传空串 */
|
|
7
7
|
token: string;
|
|
8
|
-
/** 与 Bearer 一并发送;服务端要求与 token 对应行的 `Employee.id` 一致 */
|
|
9
|
-
employeeId?: number;
|
|
10
|
-
defaultTimeoutMs?: number;
|
|
11
8
|
};
|
|
12
9
|
export type ApmClient = ApiClient<typeof requestConfig>;
|
|
13
10
|
export declare function createApmClient(options: CreateApmClientOptions): ApmClient;
|
|
11
|
+
declare const api: ApiClient<{
|
|
12
|
+
readonly cli: {
|
|
13
|
+
readonly variablesGet: import("listpage-http").EndpointConfig<void, import("./cli").ResCliVariables>;
|
|
14
|
+
};
|
|
15
|
+
readonly employee: {
|
|
16
|
+
readonly auth: import("listpage-http").EndpointConfig<import("./cli").ReqCliLoginByEmployee, import("./cli").ResCliLoginByEmployee>;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
export default api;
|
|
14
20
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,MAAM,MAAM,sBAAsB,GAAG;IACnC,kBAAkB;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAMF,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,aAAa,CAAC,CAAC;AAExD,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAkB1E;AAID,QAAA,MAAM,GAAG;;;;;;;EAGP,CAAC;AAEH,eAAe,GAAG,CAAC"}
|
package/dist/api/client.js
CHANGED
|
@@ -3,15 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createApmClient = createApmClient;
|
|
4
4
|
const listpage_http_1 = require("listpage-http");
|
|
5
5
|
const request_config_1 = require("./request-config");
|
|
6
|
+
const apm_config_1 = require("../core/apm-config");
|
|
6
7
|
function normalizeBaseUrl(url) {
|
|
7
8
|
return url.trim().replace(/\/+$/, "");
|
|
8
9
|
}
|
|
9
10
|
function createApmClient(options) {
|
|
10
11
|
const baseURL = `${normalizeBaseUrl(options.baseUrl)}/api/v1`;
|
|
11
12
|
const defaultHeaders = {};
|
|
12
|
-
if (options.employeeId != null && Number.isFinite(options.employeeId)) {
|
|
13
|
-
defaultHeaders["X-Apm-Employee-Id"] = String(options.employeeId);
|
|
14
|
-
}
|
|
15
13
|
return (0, listpage_http_1.createApiClient)(request_config_1.requestConfig, {
|
|
16
14
|
baseURL,
|
|
17
15
|
getToken: () => {
|
|
@@ -19,7 +17,6 @@ function createApmClient(options) {
|
|
|
19
17
|
return t.length > 0 ? t : undefined;
|
|
20
18
|
},
|
|
21
19
|
defaultHeaders,
|
|
22
|
-
defaultTimeout: options.defaultTimeoutMs ?? 30_000,
|
|
23
20
|
successCodes: [20000, 200, 201],
|
|
24
21
|
unauthorizedCodes: [],
|
|
25
22
|
onError(code, message, opts) {
|
|
@@ -29,4 +26,10 @@ function createApmClient(options) {
|
|
|
29
26
|
},
|
|
30
27
|
});
|
|
31
28
|
}
|
|
29
|
+
const config = (0, apm_config_1.loadApmConfig)();
|
|
30
|
+
const api = createApmClient({
|
|
31
|
+
baseUrl: config.server.url,
|
|
32
|
+
token: config.auth.token,
|
|
33
|
+
});
|
|
34
|
+
exports.default = api;
|
|
32
35
|
//# sourceMappingURL=client.js.map
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":";;AAiBA,0CAkBC;AAnCD,iDAAgE;AAChE,qDAAiD;AACjD,mDAAmD;AASnD,SAAS,gBAAgB,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAID,SAAgB,eAAe,CAAC,OAA+B;IAC7D,MAAM,OAAO,GAAG,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAC9D,MAAM,cAAc,GAA2B,EAAE,CAAC;IAElD,OAAO,IAAA,+BAAe,EAAC,8BAAa,EAAE;QACpC,OAAO;QACP,QAAQ,EAAE,GAAG,EAAE;YACb,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC/B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACtC,CAAC;QACD,cAAc;QACd,YAAY,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC;QAC/B,iBAAiB,EAAE,EAAE;QACrB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,IAA0B;YAC/C,IAAI,IAAI,EAAE,KAAK;gBAAE,OAAO;YACxB,OAAO,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,IAAI,CAAC,KAAK,OAAO,IAAI,MAAM,EAAE,CAAC,CAAC;QACnE,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,MAAM,GAAG,IAAA,0BAAa,GAAE,CAAC;AAE/B,MAAM,GAAG,GAAG,eAAe,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK;CACzB,CAAC,CAAC;AAEH,kBAAe,GAAG,CAAC"}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { ApiClient } from "listpage-http";
|
|
2
2
|
export { ApiError, ERROR_CODE_NETWORK, RequestTimeoutException, defineEndpoint, } from "listpage-http";
|
|
3
|
-
export { createApmClient, type ApmClient, type CreateApmClientOptions, } from "./client
|
|
4
|
-
export { requestConfig, type RequestConfig } from "./request-config
|
|
5
|
-
export type {
|
|
3
|
+
export { createApmClient, type ApmClient, type CreateApmClientOptions, } from "./client";
|
|
4
|
+
export { requestConfig, type RequestConfig } from "./request-config";
|
|
5
|
+
export type { ReqCliLoginByEmployee, ReqCliVariablesGet, ResCliLoginByEmployee, ResCliVariables, } from "./cli";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,KAAK,SAAS,EACd,KAAK,sBAAsB,GAC5B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,KAAK,SAAS,EACd,KAAK,sBAAsB,GAC5B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACrE,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,GAChB,MAAM,OAAO,CAAC"}
|
package/dist/api/index.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "ApiError", { enumerable: true, get: function ()
|
|
|
6
6
|
Object.defineProperty(exports, "ERROR_CODE_NETWORK", { enumerable: true, get: function () { return listpage_http_1.ERROR_CODE_NETWORK; } });
|
|
7
7
|
Object.defineProperty(exports, "RequestTimeoutException", { enumerable: true, get: function () { return listpage_http_1.RequestTimeoutException; } });
|
|
8
8
|
Object.defineProperty(exports, "defineEndpoint", { enumerable: true, get: function () { return listpage_http_1.defineEndpoint; } });
|
|
9
|
-
var
|
|
10
|
-
Object.defineProperty(exports, "createApmClient", { enumerable: true, get: function () { return
|
|
11
|
-
var
|
|
12
|
-
Object.defineProperty(exports, "requestConfig", { enumerable: true, get: function () { return
|
|
9
|
+
var client_1 = require("./client");
|
|
10
|
+
Object.defineProperty(exports, "createApmClient", { enumerable: true, get: function () { return client_1.createApmClient; } });
|
|
11
|
+
var request_config_1 = require("./request-config");
|
|
12
|
+
Object.defineProperty(exports, "requestConfig", { enumerable: true, get: function () { return request_config_1.requestConfig; } });
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;AACA,+CAKuB;AAJrB,yGAAA,QAAQ,OAAA;AACR,mHAAA,kBAAkB,OAAA;AAClB,wHAAA,uBAAuB,OAAA;AACvB,+GAAA,cAAc,OAAA;AAEhB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;AACA,+CAKuB;AAJrB,yGAAA,QAAQ,OAAA;AACR,mHAAA,kBAAkB,OAAA;AAClB,wHAAA,uBAAuB,OAAA;AACvB,+GAAA,cAAc,OAAA;AAEhB,mCAIkB;AAHhB,yGAAA,eAAe,OAAA;AAIjB,mDAAqE;AAA5D,+GAAA,aAAa,OAAA"}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReqCliLoginByEmployee, ResCliLoginByEmployee, ResCliVariables } from "./cli";
|
|
2
2
|
export declare const requestConfig: {
|
|
3
|
-
readonly
|
|
4
|
-
readonly
|
|
3
|
+
readonly cli: {
|
|
4
|
+
readonly variablesGet: import("listpage-http").EndpointConfig<void, ResCliVariables>;
|
|
5
5
|
};
|
|
6
|
-
readonly
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
readonly testCasesCreateBatch: import("listpage-http").EndpointConfig<ReqTestCaseCreate[], RequirementTestCaseRow[]>;
|
|
10
|
-
readonly branchesList: import("listpage-http").EndpointConfig<ReqBranchList, RequirementBranchRow[]>;
|
|
11
|
-
readonly branchesUpdate: import("listpage-http").EndpointConfig<ReqBranchUpdate, RequirementBranchRow>;
|
|
12
|
-
readonly defectsUpdate: import("listpage-http").EndpointConfig<ReqDefectUpdate, RequirementDefectRow>;
|
|
13
|
-
readonly versionsList: import("listpage-http").EndpointConfig<ReqVersionList, RequirementVersionRow[]>;
|
|
14
|
-
};
|
|
15
|
-
readonly instructionLog: {
|
|
16
|
-
readonly create: import("listpage-http").EndpointConfig<ReqInstructionLogCreate, ResInstructionLogCreate>;
|
|
17
|
-
readonly update: import("listpage-http").EndpointConfig<ReqInstructionLogUpdate, ResInstructionLogUpdate>;
|
|
6
|
+
readonly employee: {
|
|
7
|
+
/** 登录等鉴权(路径落在 `/cli/employee/auth`,便于与业务接口区分) */
|
|
8
|
+
readonly auth: import("listpage-http").EndpointConfig<ReqCliLoginByEmployee, ResCliLoginByEmployee>;
|
|
18
9
|
};
|
|
19
10
|
};
|
|
20
11
|
export type RequestConfig = typeof requestConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-config.d.ts","sourceRoot":"","sources":["../../src/api/request-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request-config.d.ts","sourceRoot":"","sources":["../../src/api/request-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qBAAqB,EAErB,qBAAqB,EACrB,eAAe,EAChB,MAAM,OAAO,CAAC;AAEf,eAAO,MAAM,aAAa;;;;;QAQtB,iDAAiD;;;CAO3C,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC"}
|
|
@@ -3,51 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.requestConfig = void 0;
|
|
4
4
|
const listpage_http_1 = require("listpage-http");
|
|
5
5
|
exports.requestConfig = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
cli: {
|
|
7
|
+
variablesGet: (0, listpage_http_1.defineEndpoint)({
|
|
8
8
|
method: "POST",
|
|
9
|
-
path: "/
|
|
10
|
-
authRequired: false,
|
|
9
|
+
path: "/cli/variables/get",
|
|
11
10
|
}),
|
|
12
11
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
path: "/requirements/comments/submit-pending",
|
|
17
|
-
}),
|
|
18
|
-
commentsProcessPendingAndVersion: (0, listpage_http_1.defineEndpoint)({
|
|
19
|
-
method: "POST",
|
|
20
|
-
path: "/requirements/comments/process-pending-and-version",
|
|
21
|
-
}),
|
|
22
|
-
testCasesCreateBatch: (0, listpage_http_1.defineEndpoint)({
|
|
12
|
+
employee: {
|
|
13
|
+
/** 登录等鉴权(路径落在 `/cli/employee/auth`,便于与业务接口区分) */
|
|
14
|
+
auth: (0, listpage_http_1.defineEndpoint)({
|
|
23
15
|
method: "POST",
|
|
24
|
-
path: "/
|
|
25
|
-
|
|
26
|
-
branchesList: (0, listpage_http_1.defineEndpoint)({
|
|
27
|
-
method: "POST",
|
|
28
|
-
path: "/requirements/branches/list",
|
|
29
|
-
}),
|
|
30
|
-
branchesUpdate: (0, listpage_http_1.defineEndpoint)({
|
|
31
|
-
method: "POST",
|
|
32
|
-
path: "/requirements/branches/update",
|
|
33
|
-
}),
|
|
34
|
-
defectsUpdate: (0, listpage_http_1.defineEndpoint)({
|
|
35
|
-
method: "POST",
|
|
36
|
-
path: "/requirements/defects/update",
|
|
37
|
-
}),
|
|
38
|
-
versionsList: (0, listpage_http_1.defineEndpoint)({
|
|
39
|
-
method: "POST",
|
|
40
|
-
path: "/requirements/versions/list",
|
|
41
|
-
}),
|
|
42
|
-
},
|
|
43
|
-
instructionLog: {
|
|
44
|
-
create: (0, listpage_http_1.defineEndpoint)({
|
|
45
|
-
method: "POST",
|
|
46
|
-
path: "/instruction-logs/create",
|
|
47
|
-
}),
|
|
48
|
-
update: (0, listpage_http_1.defineEndpoint)({
|
|
49
|
-
method: "POST",
|
|
50
|
-
path: "/instruction-logs/update",
|
|
16
|
+
path: "/cli/employee/auth",
|
|
17
|
+
authRequired: false,
|
|
51
18
|
}),
|
|
52
19
|
},
|
|
53
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-config.js","sourceRoot":"","sources":["../../src/api/request-config.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;
|
|
1
|
+
{"version":3,"file":"request-config.js","sourceRoot":"","sources":["../../src/api/request-config.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AASlC,QAAA,aAAa,GAAG;IAC3B,GAAG,EAAE;QACH,YAAY,EAAE,IAAA,8BAAc,EAAsC;YAChE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,oBAAoB;SAC3B,CAAC;KACH;IACD,QAAQ,EAAE;QACR,iDAAiD;QACjD,IAAI,EAAE,IAAA,8BAAc,EAA+C;YACjE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,oBAAoB;YAC1B,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;CACO,CAAC"}
|
|
@@ -1,134 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 与 apps/fe/src/api/requirement.ts 对齐的请求/响应类型(本包仅含 SDK 已用子集)。
|
|
3
|
-
*/
|
|
4
|
-
export type RequirementCommentStatus = "CREATED" | "RESOLVED" | "PENDING" | "IN_PROGRESS" | "IGNORED";
|
|
5
|
-
export type EmployeeSummary = {
|
|
6
|
-
id: number;
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
export type RequirementCommentRow = {
|
|
10
|
-
id: number;
|
|
11
|
-
content: string;
|
|
12
|
-
status: RequirementCommentStatus;
|
|
13
|
-
reply: string | null;
|
|
14
|
-
employee: EmployeeSummary;
|
|
15
|
-
workDirPath: string;
|
|
16
|
-
createdAt: string;
|
|
17
|
-
updatedAt: string;
|
|
18
|
-
};
|
|
19
|
-
export type RequirementVersionRow = {
|
|
20
|
-
id: number;
|
|
21
|
-
versionSeq: number;
|
|
22
|
-
content: string;
|
|
23
|
-
createdAt: string;
|
|
24
|
-
comments: RequirementCommentRow[];
|
|
25
|
-
};
|
|
26
|
-
/** 仅 CREATED → 写正文并置 PENDING */
|
|
27
|
-
export type ReqCommentSubmitPending = {
|
|
28
|
-
id: number;
|
|
29
|
-
content: string;
|
|
30
|
-
};
|
|
31
|
-
/** 批量 PENDING→RESOLVED 并创建新版本(仅员工 CLI;versionSeq 为需求内 v1、v2 序号) */
|
|
32
|
-
export type ReqCommentProcessPendingAndVersion = {
|
|
33
|
-
requirementId: number;
|
|
34
|
-
versionSeq: number;
|
|
35
|
-
content: string;
|
|
36
|
-
};
|
|
37
|
-
export type ResCommentProcessPendingAndVersion = {
|
|
38
|
-
resolvedCommentCount: number;
|
|
39
|
-
newVersion: RequirementVersionRow;
|
|
40
|
-
};
|
|
41
|
-
export type RequirementDefectStatus = "CREATED" | "PENDING" | "IN_PROGRESS" | "RESOLVED" | "CLOSED";
|
|
42
|
-
export type DefectAssigneePair = {
|
|
43
|
-
employeeId: number;
|
|
44
|
-
workDirPath: string;
|
|
45
|
-
};
|
|
46
|
-
export type RequirementDefectRow = {
|
|
47
|
-
id: number;
|
|
48
|
-
title: string;
|
|
49
|
-
description: string | null;
|
|
50
|
-
status: RequirementDefectStatus;
|
|
51
|
-
assignees: (EmployeeSummary & {
|
|
52
|
-
workDirPath: string;
|
|
53
|
-
})[];
|
|
54
|
-
createdAt: string;
|
|
55
|
-
updatedAt: string;
|
|
56
|
-
};
|
|
57
|
-
export type ReqDefectUpdate = {
|
|
58
|
-
id: number;
|
|
59
|
-
title?: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
assignees?: DefectAssigneePair[];
|
|
62
|
-
status?: RequirementDefectStatus;
|
|
63
|
-
};
|
|
64
|
-
export type RequirementBranchStatus = "CREATED" | "IN_DEVELOPMENT" | "PENDING_TEST" | "MERGED";
|
|
65
|
-
export type RequirementBranchRow = {
|
|
66
|
-
id: number;
|
|
67
|
-
repository: {
|
|
68
|
-
id: number;
|
|
69
|
-
name: string;
|
|
70
|
-
baseBranch: string;
|
|
71
|
-
};
|
|
72
|
-
branchName: string;
|
|
73
|
-
employee: EmployeeSummary;
|
|
74
|
-
workDirPath: string;
|
|
75
|
-
status: RequirementBranchStatus;
|
|
76
|
-
createdAt: string;
|
|
77
|
-
updatedAt: string;
|
|
78
|
-
};
|
|
79
|
-
export type ReqBranchList = {
|
|
80
|
-
requirementId: number;
|
|
81
|
-
};
|
|
82
|
-
export type ReqBranchUpdate = {
|
|
83
|
-
id: number;
|
|
84
|
-
repositoryId?: number;
|
|
85
|
-
employeeId?: number;
|
|
86
|
-
workDirPath?: string;
|
|
87
|
-
status?: RequirementBranchStatus;
|
|
88
|
-
};
|
|
89
|
-
export type RequirementTestCaseStatus = "DRAFT" | "READY" | "PASSED" | "FAILED" | "BLOCKED";
|
|
90
|
-
export type RequirementTestCaseRow = {
|
|
91
|
-
id: number;
|
|
92
|
-
title: string;
|
|
93
|
-
steps: string;
|
|
94
|
-
expectedResult: string | null;
|
|
95
|
-
status: RequirementTestCaseStatus;
|
|
96
|
-
createdAt: string;
|
|
97
|
-
updatedAt: string;
|
|
98
|
-
};
|
|
99
|
-
export type ReqTestCaseCreate = {
|
|
100
|
-
requirementId: number;
|
|
101
|
-
title: string;
|
|
102
|
-
steps: string;
|
|
103
|
-
expectedResult?: string;
|
|
104
|
-
status?: RequirementTestCaseStatus;
|
|
105
|
-
};
|
|
106
|
-
/** 列出某需求下全部内容版本(与 apps/fe ReqVersionList 对齐) */
|
|
107
|
-
export type ReqVersionList = {
|
|
108
|
-
requirementId: number;
|
|
109
|
-
};
|
|
110
|
-
export type ReqLoginByEmployee = {
|
|
111
|
-
employeeId: number;
|
|
112
|
-
password: string;
|
|
113
|
-
};
|
|
114
|
-
export type ResLoginByEmployee = {
|
|
115
|
-
token: string;
|
|
116
|
-
};
|
|
117
|
-
export type ReqInstructionLogCreate = {
|
|
118
|
-
requirementId: number;
|
|
119
|
-
sessionId: string;
|
|
120
|
-
logType: "INFO" | "WARN" | "ERROR" | "DEBUG";
|
|
121
|
-
instructionName: string;
|
|
122
|
-
payload: unknown;
|
|
123
|
-
};
|
|
124
|
-
export type ReqInstructionLogUpdate = {
|
|
125
|
-
id: number;
|
|
126
|
-
payload: unknown;
|
|
127
|
-
};
|
|
128
|
-
export type ResInstructionLogCreate = {
|
|
129
|
-
id: number;
|
|
130
|
-
};
|
|
131
|
-
export type ResInstructionLogUpdate = {
|
|
132
|
-
id: number;
|
|
133
|
-
};
|
|
134
1
|
//# sourceMappingURL=requirement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirement.d.ts","sourceRoot":"","sources":["../../src/api/requirement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requirement.d.ts","sourceRoot":"","sources":["../../src/api/requirement.ts"],"names":[],"mappings":""}
|
package/dist/api/requirement.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirement.js","sourceRoot":"","sources":["../../src/api/requirement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requirement.js","sourceRoot":"","sources":["../../src/api/requirement.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4B3D"}
|
|
@@ -1,72 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.registerAuthCommands = registerAuthCommands;
|
|
4
7
|
const node_process_1 = require("node:process");
|
|
5
8
|
const promises_1 = require("node:readline/promises");
|
|
6
|
-
const client_1 = require("../../api/client");
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
+
const client_1 = __importDefault(require("../../api/client"));
|
|
10
|
+
const apm_config_1 = require("../../core/apm-config");
|
|
11
|
+
async function getUserInput() {
|
|
12
|
+
const rl = (0, promises_1.createInterface)({ input: node_process_1.stdin, output: node_process_1.stdout });
|
|
13
|
+
let password = "";
|
|
14
|
+
try {
|
|
15
|
+
password = await rl.question("请输入密码: ");
|
|
16
|
+
password = password.trim();
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
await rl.close();
|
|
20
|
+
}
|
|
21
|
+
if (!password) {
|
|
22
|
+
console.error("密码不能为空");
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
return password;
|
|
26
|
+
}
|
|
9
27
|
function registerAuthCommands(program) {
|
|
10
28
|
program
|
|
11
29
|
.command("login")
|
|
12
30
|
.description("员工 CLI 登录(写入配置文件 baseUrl、token 与 employeeId;可用 --url 指定或覆盖服务地址)")
|
|
13
|
-
.
|
|
14
|
-
.option("--
|
|
15
|
-
.option("--password <text>", "口令(不推荐在 shell 历史中留明文)")
|
|
31
|
+
.option("-u, --username <text>", "员工 ID", (v) => Number.parseInt(v, 10))
|
|
32
|
+
.option("-p, --password <text>", "口令(不推荐在 shell 历史中留明文)")
|
|
16
33
|
.action(async (opts) => {
|
|
17
|
-
const cfg = await (0, config_store_1.readApmConfig)();
|
|
18
|
-
const fromArg = opts.url?.trim() || "";
|
|
19
|
-
const baseUrl = (0, config_store_1.normalizeBaseUrl)(fromArg || cfg.baseUrl?.trim() || "");
|
|
20
|
-
if (!baseUrl) {
|
|
21
|
-
console.error("缺少服务根地址:请传入 --url <url>,或先执行 apm config set base-url <url>");
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
34
|
let password = opts.password?.trim();
|
|
25
35
|
if (!password) {
|
|
26
|
-
|
|
27
|
-
try {
|
|
28
|
-
password = (await rl.question("口令: ")).trim();
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
await rl.close();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (!password) {
|
|
35
|
-
console.error("口令不能为空");
|
|
36
|
-
process.exit(1);
|
|
36
|
+
password = await getUserInput();
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const res = await client_1.default.employee.auth({
|
|
39
|
+
username: opts.username,
|
|
40
|
+
password,
|
|
41
41
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
employeeId: opts.employeeId,
|
|
45
|
-
password,
|
|
46
|
-
});
|
|
47
|
-
const next = {
|
|
48
|
-
...cfg,
|
|
49
|
-
baseUrl,
|
|
50
|
-
token: res.token,
|
|
51
|
-
employeeId: opts.employeeId,
|
|
52
|
-
};
|
|
53
|
-
await (0, config_store_1.writeApmConfig)(next);
|
|
54
|
-
console.log(JSON.stringify({ ok: true, baseUrl, employeeId: opts.employeeId }, null, 2));
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
(0, exit_api_error_1.exitApiError)(e);
|
|
58
|
-
}
|
|
42
|
+
(0, apm_config_1.saveApmToken)(res.token);
|
|
43
|
+
console.log("登录成功");
|
|
59
44
|
});
|
|
60
45
|
program
|
|
61
46
|
.command("logout")
|
|
62
|
-
.description("清除配置文件中的
|
|
47
|
+
.description("清除配置文件中的 Token,下次登录需要重新输入用户名和密码")
|
|
63
48
|
.action(async () => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
baseUrl: cfg.baseUrl,
|
|
67
|
-
...(cfg.wsPort != null ? { wsPort: cfg.wsPort } : {}),
|
|
68
|
-
});
|
|
69
|
-
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
49
|
+
(0, apm_config_1.saveApmToken)("");
|
|
50
|
+
console.log("退出登录成功");
|
|
70
51
|
});
|
|
71
52
|
}
|
|
72
53
|
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":";;;;;AAsBA,oDA4BC;AAlDD,+CAAgE;AAChE,qDAAyD;AAEzD,8DAAmC;AACnC,sDAAqD;AAErD,KAAK,UAAU,YAAY;IACzB,MAAM,EAAE,GAAG,IAAA,0BAAe,EAAC,EAAE,KAAK,EAAL,oBAAK,EAAE,MAAM,EAAN,qBAAM,EAAE,CAAC,CAAC;IAC9C,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACxC,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CACV,iEAAiE,CAClE;SACA,MAAM,CAAC,uBAAuB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;SACvE,MAAM,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;SACxD,MAAM,CAAC,KAAK,EAAE,IAA6C,EAAE,EAAE;QAC9D,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;QAClC,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,gBAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;YAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ;SACT,CAAC,CAAC;QACH,IAAA,yBAAY,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IAEL,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAA,yBAAY,EAAC,EAAE,CAAC,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiB7D"}
|
|
@@ -1,59 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerConfigCommands = registerConfigCommands;
|
|
4
|
-
const
|
|
4
|
+
const apm_config_1 = require("../../core/apm-config");
|
|
5
5
|
function registerConfigCommands(program) {
|
|
6
|
-
const configCmd = program
|
|
7
|
-
.command("config")
|
|
8
|
-
.description("读写本机配置(npm config 风格)");
|
|
6
|
+
const configCmd = program.command("config").description("apm配置管理");
|
|
9
7
|
configCmd
|
|
10
|
-
.command("
|
|
11
|
-
.
|
|
12
|
-
.argument("
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
console.error("base-url 不能为空");
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
else if (key === "ws-port") {
|
|
23
|
-
const n = Number.parseInt(value.trim(), 10);
|
|
24
|
-
if (!Number.isFinite(n) || n < 1 || n > 65535) {
|
|
25
|
-
console.error("ws-port 须为 1–65535 的整数");
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
cfg.wsPort = n;
|
|
8
|
+
.command("init")
|
|
9
|
+
.description("初始化apm配置,如果不存在则创建,如果存在则更新")
|
|
10
|
+
.argument("<id>", "员工ID")
|
|
11
|
+
.option("--url <url>", "服务根地址")
|
|
12
|
+
.action(async (id, opts) => {
|
|
13
|
+
if ((0, apm_config_1.isApmConfigExists)()) {
|
|
14
|
+
await (0, apm_config_1.syncApmConfig)();
|
|
15
|
+
console.log("APM 配置已存在,已为您更新");
|
|
29
16
|
}
|
|
30
17
|
else {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
await (0, config_store_1.writeApmConfig)(cfg);
|
|
35
|
-
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
36
|
-
});
|
|
37
|
-
configCmd
|
|
38
|
-
.command("get")
|
|
39
|
-
.argument("key", "base-url | ws-port")
|
|
40
|
-
.action(async (key) => {
|
|
41
|
-
const cfg = await (0, config_store_1.readApmConfig)();
|
|
42
|
-
if (key === "base-url") {
|
|
43
|
-
const u = cfg.baseUrl?.trim();
|
|
44
|
-
if (!u) {
|
|
45
|
-
console.error("未配置 base-url");
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
console.log((0, config_store_1.normalizeBaseUrl)(u));
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (key === "ws-port") {
|
|
52
|
-
console.log(String((0, config_store_1.resolveEmployeeWsPortFromConfig)()));
|
|
53
|
-
return;
|
|
18
|
+
await (0, apm_config_1.createApmConfig)({ id: Number(id), url: opts.url });
|
|
19
|
+
console.log("已为您创建 APM 配置");
|
|
54
20
|
}
|
|
55
|
-
console.error("当前仅支持键 base-url、ws-port");
|
|
56
|
-
process.exit(1);
|
|
57
21
|
});
|
|
58
22
|
}
|
|
59
23
|
//# sourceMappingURL=config.js.map
|