@tuturuuu/internal-api 0.31.1 → 0.32.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/dist/task-history.d.ts +24 -0
- package/dist/task-history.d.ts.map +1 -0
- package/dist/task-history.js +21 -0
- package/package.json +10 -5
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Task } from '@tuturuuu/types/primitives/Task';
|
|
2
|
+
import { type InternalApiClientOptions } from './client';
|
|
3
|
+
export type RevertibleTaskHistoryField = 'name' | 'description' | 'priority' | 'start_date' | 'end_date' | 'estimation_points' | 'list_id' | 'completed' | 'assignees' | 'labels' | 'projects';
|
|
4
|
+
export interface RevertWorkspaceTaskHistoryPayload {
|
|
5
|
+
historyId: string;
|
|
6
|
+
fields: RevertibleTaskHistoryField[];
|
|
7
|
+
}
|
|
8
|
+
export interface RevertWorkspaceTaskHistoryResponse {
|
|
9
|
+
success: boolean;
|
|
10
|
+
revertedFields: RevertibleTaskHistoryField[];
|
|
11
|
+
task: Task;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkspaceTaskSnapshotResponse {
|
|
14
|
+
snapshot: Record<string, unknown>;
|
|
15
|
+
historyEntry: {
|
|
16
|
+
id: string;
|
|
17
|
+
changed_at: string;
|
|
18
|
+
change_type: string;
|
|
19
|
+
field_name: string | null;
|
|
20
|
+
} | null;
|
|
21
|
+
}
|
|
22
|
+
export declare function revertWorkspaceTaskHistory(workspaceId: string, taskId: string, payload: RevertWorkspaceTaskHistoryPayload, clientOptions?: InternalApiClientOptions): Promise<RevertWorkspaceTaskHistoryResponse>;
|
|
23
|
+
export declare function getWorkspaceTaskSnapshot(workspaceId: string, taskId: string, historyId: string, clientOptions?: InternalApiClientOptions): Promise<WorkspaceTaskSnapshotResponse>;
|
|
24
|
+
//# sourceMappingURL=task-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-history.d.ts","sourceRoot":"","sources":["../src/task-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,0BAA0B,GAClC,MAAM,GACN,aAAa,GACb,UAAU,GACV,YAAY,GACZ,UAAU,GACV,mBAAmB,GACnB,SAAS,GACT,WAAW,GACX,WAAW,GACX,QAAQ,GACR,UAAU,CAAC;AAEf,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,0BAA0B,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,kCAAkC;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,0BAA0B,EAAE,CAAC;IAC7C,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,GAAG,IAAI,CAAC;CACV;AAMD,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iCAAiC,EAC1C,aAAa,CAAC,EAAE,wBAAwB,+CAYzC;AAED,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE,wBAAwB,0CAOzC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.revertWorkspaceTaskHistory = revertWorkspaceTaskHistory;
|
|
4
|
+
exports.getWorkspaceTaskSnapshot = getWorkspaceTaskSnapshot;
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
function getTaskApiClient(options) {
|
|
7
|
+
return (0, client_1.getInternalApiClient)((0, client_1.withTaskApiBaseUrl)(options));
|
|
8
|
+
}
|
|
9
|
+
async function revertWorkspaceTaskHistory(workspaceId, taskId, payload, clientOptions) {
|
|
10
|
+
const client = getTaskApiClient(clientOptions);
|
|
11
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/revert`, {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
headers: { 'Content-Type': 'application/json' },
|
|
14
|
+
body: JSON.stringify(payload),
|
|
15
|
+
cache: 'no-store',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async function getWorkspaceTaskSnapshot(workspaceId, taskId, historyId, clientOptions) {
|
|
19
|
+
const client = getTaskApiClient(clientOptions);
|
|
20
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/snapshot/${(0, client_1.encodePathSegment)(historyId)}`, { cache: 'no-store' });
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuturuuu/internal-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -215,6 +215,11 @@
|
|
|
215
215
|
"import": "./dist/tasks.js",
|
|
216
216
|
"require": "./dist/tasks.js"
|
|
217
217
|
},
|
|
218
|
+
"./task-history": {
|
|
219
|
+
"types": "./dist/task-history.d.ts",
|
|
220
|
+
"import": "./dist/task-history.js",
|
|
221
|
+
"require": "./dist/task-history.js"
|
|
222
|
+
},
|
|
218
223
|
"./task-templates": {
|
|
219
224
|
"types": "./dist/task-templates.d.ts",
|
|
220
225
|
"import": "./dist/task-templates.js",
|
|
@@ -277,14 +282,14 @@
|
|
|
277
282
|
}
|
|
278
283
|
},
|
|
279
284
|
"devDependencies": {
|
|
280
|
-
"@tuturuuu/typescript-config": "0.1.
|
|
285
|
+
"@tuturuuu/typescript-config": "0.1.2",
|
|
281
286
|
"@types/node": "^26.2.0",
|
|
282
287
|
"typescript": "7.0.2",
|
|
283
|
-
"vitest": "^4.1.
|
|
288
|
+
"vitest": "^4.1.11"
|
|
284
289
|
},
|
|
285
|
-
"packageManager": "bun@1.
|
|
290
|
+
"packageManager": "bun@1.4.0",
|
|
286
291
|
"dependencies": {
|
|
287
|
-
"@tuturuuu/supabase": "0.5.
|
|
292
|
+
"@tuturuuu/supabase": "0.5.1",
|
|
288
293
|
"@tuturuuu/types": "0.27.0"
|
|
289
294
|
}
|
|
290
295
|
}
|