@critical-path/client 0.12.0 → 0.13.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 +14 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +284 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/cli.test.d.ts +2 -0
- package/dist/cli.test.d.ts.map +1 -0
- package/dist/cli.test.js +126 -0
- package/dist/cli.test.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +29 -0
- package/dist/index.test.js.map +1 -1
- package/package.json +5 -2
- package/src/bin/cli.ts +323 -0
- package/src/cli.test.ts +150 -0
- package/src/index.test.ts +34 -0
- package/src/index.ts +31 -0
- package/tsconfig.tsbuildinfo +1 -1
package/src/index.ts
CHANGED
|
@@ -73,6 +73,19 @@ export type {
|
|
|
73
73
|
WorkloadMetric
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
export interface UpdateStatusOptions {
|
|
77
|
+
taskId?: string;
|
|
78
|
+
projectId?: string;
|
|
79
|
+
details?: string;
|
|
80
|
+
isEngaged?: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface UpdateStatusResult {
|
|
84
|
+
success: boolean;
|
|
85
|
+
status: string;
|
|
86
|
+
timestamp: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
76
89
|
export interface ClientOptions {
|
|
77
90
|
baseUrl: string; // e.g. "http://localhost:3000/api/critical-path"
|
|
78
91
|
headers?: Record<string, string>;
|
|
@@ -553,6 +566,24 @@ export class CriticalPathClient {
|
|
|
553
566
|
});
|
|
554
567
|
return res.timeEntry;
|
|
555
568
|
}
|
|
569
|
+
|
|
570
|
+
// Agent Status / Telemetry
|
|
571
|
+
async updateStatus(
|
|
572
|
+
status: string,
|
|
573
|
+
options?: UpdateStatusOptions
|
|
574
|
+
): Promise<UpdateStatusResult> {
|
|
575
|
+
const res = await this.request<UpdateStatusResult>('/status', {
|
|
576
|
+
method: 'POST',
|
|
577
|
+
body: JSON.stringify({
|
|
578
|
+
status,
|
|
579
|
+
taskId: options?.taskId,
|
|
580
|
+
projectId: options?.projectId,
|
|
581
|
+
details: options?.details,
|
|
582
|
+
isEngaged: options?.isEngaged ?? true
|
|
583
|
+
})
|
|
584
|
+
});
|
|
585
|
+
return res;
|
|
586
|
+
}
|
|
556
587
|
}
|
|
557
588
|
|
|
558
589
|
export type { CommentReaction };
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/index.test.ts","./src/index.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["./src/cli.test.ts","./src/index.test.ts","./src/index.ts","./src/bin/cli.ts"],"version":"5.9.3"}
|