@ezpaarse-project/ezreeport-sdk-js 1.0.0-beta.1 → 1.0.0-beta.10
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 +19 -752
- package/dist/browser/ezreeport-sdk-js.mjs +1054 -891
- package/dist/browser/ezreeport-sdk-js.mjs.map +1 -1
- package/dist/browser/ezreeport-sdk-js.umd.js +5 -3
- package/dist/browser/ezreeport-sdk-js.umd.js.map +1 -1
- package/dist/dist/browser/ezreeport-sdk-js.mjs +2426 -0
- package/dist/dist/browser/ezreeport-sdk-js.mjs.map +1 -0
- package/dist/dist/browser/ezreeport-sdk-js.umd.js +6 -0
- package/dist/dist/browser/ezreeport-sdk-js.umd.js.map +1 -0
- package/dist/dist/dist/browser/ezreeport-sdk-js.mjs +2426 -0
- package/dist/dist/dist/browser/ezreeport-sdk-js.mjs.map +1 -0
- package/dist/dist/dist/browser/ezreeport-sdk-js.umd.js +6 -0
- package/dist/dist/dist/browser/ezreeport-sdk-js.umd.js.map +1 -0
- package/dist/dist/dist/node/package.json +58 -0
- package/dist/dist/dist/node/src/index.js +43 -0
- package/dist/dist/dist/node/src/index.js.map +1 -0
- package/dist/dist/dist/node/src/lib/axios.js +95 -0
- package/dist/dist/dist/node/src/lib/axios.js.map +1 -0
- package/dist/dist/dist/node/src/lib/promises.js +41 -0
- package/dist/dist/dist/node/src/lib/promises.js.map +1 -0
- package/dist/dist/dist/node/src/lib/utils.js +24 -0
- package/dist/dist/dist/node/src/lib/utils.js.map +1 -0
- package/dist/dist/dist/node/src/modules/auth.js +111 -0
- package/dist/dist/dist/node/src/modules/auth.js.map +1 -0
- package/dist/dist/dist/node/src/modules/auth.public.js +11 -0
- package/dist/dist/dist/node/src/modules/auth.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/crons.js +128 -0
- package/dist/dist/dist/node/src/modules/crons.js.map +1 -0
- package/dist/dist/dist/node/src/modules/crons.public.js +11 -0
- package/dist/dist/dist/node/src/modules/crons.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/elastic.js +31 -0
- package/dist/dist/dist/node/src/modules/elastic.js.map +1 -0
- package/dist/dist/dist/node/src/modules/elastic.public.js +7 -0
- package/dist/dist/dist/node/src/modules/elastic.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/health.js +60 -0
- package/dist/dist/dist/node/src/modules/health.js.map +1 -0
- package/dist/dist/dist/node/src/modules/health.public.js +9 -0
- package/dist/dist/dist/node/src/modules/health.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/history.js +62 -0
- package/dist/dist/dist/node/src/modules/history.js.map +1 -0
- package/dist/dist/dist/node/src/modules/history.public.js +6 -0
- package/dist/dist/dist/node/src/modules/history.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/namespaces.js +15 -0
- package/dist/dist/dist/node/src/modules/namespaces.js.map +1 -0
- package/dist/dist/dist/node/src/modules/namespaces.public.js +3 -0
- package/dist/dist/dist/node/src/modules/namespaces.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/queues.js +179 -0
- package/dist/dist/dist/node/src/modules/queues.js.map +1 -0
- package/dist/dist/dist/node/src/modules/queues.public.js +13 -0
- package/dist/dist/dist/node/src/modules/queues.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/reports.js +267 -0
- package/dist/dist/dist/node/src/modules/reports.js.map +1 -0
- package/dist/dist/dist/node/src/modules/reports.public.js +13 -0
- package/dist/dist/dist/node/src/modules/reports.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/setup.js +35 -0
- package/dist/dist/dist/node/src/modules/setup.js.map +1 -0
- package/dist/dist/dist/node/src/modules/setup.public.js +12 -0
- package/dist/dist/dist/node/src/modules/setup.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/tasks.base.js +51 -0
- package/dist/dist/dist/node/src/modules/tasks.base.js.map +1 -0
- package/dist/dist/dist/node/src/modules/tasks.js +281 -0
- package/dist/dist/dist/node/src/modules/tasks.js.map +1 -0
- package/dist/dist/dist/node/src/modules/tasks.public.js +21 -0
- package/dist/dist/dist/node/src/modules/tasks.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/tasksActivity.js +62 -0
- package/dist/dist/dist/node/src/modules/tasksActivity.js.map +1 -0
- package/dist/dist/dist/node/src/modules/tasksActivity.public.js +6 -0
- package/dist/dist/dist/node/src/modules/tasksActivity.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/tasksPresets.js +102 -0
- package/dist/dist/dist/node/src/modules/tasksPresets.js.map +1 -0
- package/dist/dist/dist/node/src/modules/tasksPresets.public.js +10 -0
- package/dist/dist/dist/node/src/modules/tasksPresets.public.js.map +1 -0
- package/dist/dist/dist/node/src/modules/templates.js +136 -0
- package/dist/dist/dist/node/src/modules/templates.js.map +1 -0
- package/dist/dist/dist/node/src/modules/templates.public.js +11 -0
- package/dist/dist/dist/node/src/modules/templates.public.js.map +1 -0
- package/dist/dist/dist/test +0 -0
- package/dist/{types → dist/dist/types/src}/index.d.ts +10 -2
- package/dist/{types → dist/dist/types/src}/lib/axios.d.ts +3 -3
- package/dist/dist/dist/types/src/lib/promises.d.ts +21 -0
- package/dist/{types → dist/dist/types/src}/lib/utils.d.ts +5 -0
- package/dist/{types → dist/dist/types/src}/modules/auth.d.ts +4 -4
- package/dist/{types → dist/dist/types/src}/modules/crons.d.ts +32 -8
- package/dist/dist/dist/types/src/modules/crons.public.d.ts +1 -0
- package/dist/dist/dist/types/src/modules/elastic.d.ts +22 -0
- package/dist/dist/dist/types/src/modules/elastic.public.d.ts +1 -0
- package/dist/{types → dist/dist/types/src}/modules/namespaces.d.ts +10 -0
- package/dist/dist/dist/types/src/modules/queues.d.ts +120 -0
- package/dist/dist/dist/types/src/modules/queues.public.d.ts +1 -0
- package/dist/{types → dist/dist/types/src}/modules/reports.d.ts +27 -17
- package/dist/dist/dist/types/src/modules/tasks.d.ts +243 -0
- package/dist/dist/dist/types/src/modules/tasks.public.d.ts +2 -0
- package/dist/dist/dist/types/src/modules/tasksActivity.d.ts +36 -0
- package/dist/dist/dist/types/src/modules/tasksActivity.public.d.ts +5 -0
- package/dist/dist/dist/types/src/modules/tasksPresets.d.ts +83 -0
- package/dist/dist/dist/types/src/modules/tasksPresets.public.d.ts +1 -0
- package/dist/dist/dist/types/src/modules/templates.d.ts +153 -0
- package/dist/dist/node/package.json +58 -0
- package/dist/dist/node/src/index.js +43 -0
- package/dist/dist/node/src/index.js.map +1 -0
- package/dist/dist/node/src/lib/axios.js +95 -0
- package/dist/dist/node/src/lib/axios.js.map +1 -0
- package/dist/dist/node/src/lib/promises.js +41 -0
- package/dist/dist/node/src/lib/promises.js.map +1 -0
- package/dist/dist/node/src/lib/utils.js +24 -0
- package/dist/dist/node/src/lib/utils.js.map +1 -0
- package/dist/dist/node/src/modules/auth.js +111 -0
- package/dist/dist/node/src/modules/auth.js.map +1 -0
- package/dist/dist/node/src/modules/auth.public.js +11 -0
- package/dist/dist/node/src/modules/auth.public.js.map +1 -0
- package/dist/dist/node/src/modules/crons.js +128 -0
- package/dist/dist/node/src/modules/crons.js.map +1 -0
- package/dist/dist/node/src/modules/crons.public.js +11 -0
- package/dist/dist/node/src/modules/crons.public.js.map +1 -0
- package/dist/dist/node/src/modules/elastic.js +31 -0
- package/dist/dist/node/src/modules/elastic.js.map +1 -0
- package/dist/dist/node/src/modules/elastic.public.js +7 -0
- package/dist/dist/node/src/modules/elastic.public.js.map +1 -0
- package/dist/dist/node/src/modules/health.js +60 -0
- package/dist/dist/node/src/modules/health.js.map +1 -0
- package/dist/dist/node/src/modules/health.public.js +9 -0
- package/dist/dist/node/src/modules/health.public.js.map +1 -0
- package/dist/dist/node/src/modules/history.js +62 -0
- package/dist/dist/node/src/modules/history.js.map +1 -0
- package/dist/dist/node/src/modules/history.public.js +6 -0
- package/dist/dist/node/src/modules/history.public.js.map +1 -0
- package/dist/dist/node/src/modules/namespaces.js +15 -0
- package/dist/dist/node/src/modules/namespaces.js.map +1 -0
- package/dist/dist/node/src/modules/namespaces.public.js +3 -0
- package/dist/dist/node/src/modules/namespaces.public.js.map +1 -0
- package/dist/dist/node/src/modules/queues.js +179 -0
- package/dist/dist/node/src/modules/queues.js.map +1 -0
- package/dist/dist/node/src/modules/queues.public.js +13 -0
- package/dist/dist/node/src/modules/queues.public.js.map +1 -0
- package/dist/dist/node/src/modules/reports.js +267 -0
- package/dist/dist/node/src/modules/reports.js.map +1 -0
- package/dist/dist/node/src/modules/reports.public.js +13 -0
- package/dist/dist/node/src/modules/reports.public.js.map +1 -0
- package/dist/dist/node/src/modules/setup.js +35 -0
- package/dist/dist/node/src/modules/setup.js.map +1 -0
- package/dist/dist/node/src/modules/setup.public.js +12 -0
- package/dist/dist/node/src/modules/setup.public.js.map +1 -0
- package/dist/dist/node/src/modules/tasks.base.js +51 -0
- package/dist/dist/node/src/modules/tasks.base.js.map +1 -0
- package/dist/dist/node/src/modules/tasks.js +281 -0
- package/dist/dist/node/src/modules/tasks.js.map +1 -0
- package/dist/dist/node/src/modules/tasks.public.js +21 -0
- package/dist/dist/node/src/modules/tasks.public.js.map +1 -0
- package/dist/dist/node/src/modules/tasksActivity.js +62 -0
- package/dist/dist/node/src/modules/tasksActivity.js.map +1 -0
- package/dist/dist/node/src/modules/tasksActivity.public.js +6 -0
- package/dist/dist/node/src/modules/tasksActivity.public.js.map +1 -0
- package/dist/dist/node/src/modules/tasksPresets.js +102 -0
- package/dist/dist/node/src/modules/tasksPresets.js.map +1 -0
- package/dist/dist/node/src/modules/tasksPresets.public.js +10 -0
- package/dist/dist/node/src/modules/tasksPresets.public.js.map +1 -0
- package/dist/dist/node/src/modules/templates.js +136 -0
- package/dist/dist/node/src/modules/templates.js.map +1 -0
- package/dist/dist/node/src/modules/templates.public.js +11 -0
- package/dist/dist/node/src/modules/templates.public.js.map +1 -0
- package/dist/dist/test +0 -0
- package/dist/dist/types/src/index.d.ts +32 -0
- package/dist/dist/types/src/lib/axios.d.ts +51 -0
- package/dist/dist/types/src/lib/promises.d.ts +21 -0
- package/dist/dist/types/src/lib/utils.d.ts +27 -0
- package/dist/dist/types/src/modules/auth.d.ts +90 -0
- package/dist/dist/types/src/modules/auth.public.d.ts +1 -0
- package/dist/dist/types/src/modules/crons.d.ts +102 -0
- package/dist/dist/types/src/modules/crons.public.d.ts +1 -0
- package/dist/dist/types/src/modules/elastic.d.ts +22 -0
- package/dist/dist/types/src/modules/elastic.public.d.ts +1 -0
- package/dist/dist/types/src/modules/health.d.ts +53 -0
- package/dist/dist/types/src/modules/health.public.d.ts +1 -0
- package/dist/dist/types/src/modules/history.d.ts +38 -0
- package/dist/dist/types/src/modules/history.public.d.ts +1 -0
- package/dist/dist/types/src/modules/namespaces.d.ts +29 -0
- package/dist/dist/types/src/modules/namespaces.public.d.ts +1 -0
- package/dist/dist/types/src/modules/queues.d.ts +120 -0
- package/dist/dist/types/src/modules/queues.public.d.ts +1 -0
- package/dist/dist/types/src/modules/reports.d.ts +204 -0
- package/dist/dist/types/src/modules/reports.public.d.ts +1 -0
- package/dist/dist/types/src/modules/setup.d.ts +17 -0
- package/dist/dist/types/src/modules/setup.public.d.ts +2 -0
- package/dist/dist/types/src/modules/tasks.base.d.ts +48 -0
- package/dist/dist/types/src/modules/tasks.d.ts +243 -0
- package/dist/dist/types/src/modules/tasks.public.d.ts +2 -0
- package/dist/dist/types/src/modules/tasksActivity.d.ts +36 -0
- package/dist/dist/types/src/modules/tasksActivity.public.d.ts +5 -0
- package/dist/dist/types/src/modules/tasksPresets.d.ts +83 -0
- package/dist/dist/types/src/modules/tasksPresets.public.d.ts +1 -0
- package/dist/dist/types/src/modules/templates.d.ts +153 -0
- package/dist/dist/types/src/modules/templates.public.d.ts +1 -0
- package/dist/node/package.json +15 -13
- package/dist/node/src/index.js +43 -0
- package/dist/node/src/index.js.map +1 -0
- package/dist/node/src/lib/axios.js +95 -0
- package/dist/node/src/lib/axios.js.map +1 -0
- package/dist/node/src/lib/promises.js +41 -0
- package/dist/node/src/lib/promises.js.map +1 -0
- package/dist/node/src/lib/utils.js +24 -0
- package/dist/node/src/lib/utils.js.map +1 -0
- package/dist/node/src/modules/auth.js +111 -0
- package/dist/node/src/modules/auth.js.map +1 -0
- package/dist/node/src/modules/auth.public.js +11 -0
- package/dist/node/src/modules/auth.public.js.map +1 -0
- package/dist/node/src/modules/crons.js +128 -0
- package/dist/node/src/modules/crons.js.map +1 -0
- package/dist/node/src/modules/crons.public.js +11 -0
- package/dist/node/src/modules/crons.public.js.map +1 -0
- package/dist/node/src/modules/elastic.js +31 -0
- package/dist/node/src/modules/elastic.js.map +1 -0
- package/dist/node/src/modules/elastic.public.js +7 -0
- package/dist/node/src/modules/elastic.public.js.map +1 -0
- package/dist/node/src/modules/health.js +60 -0
- package/dist/node/src/modules/health.js.map +1 -0
- package/dist/node/src/modules/health.public.js +9 -0
- package/dist/node/src/modules/health.public.js.map +1 -0
- package/dist/node/src/modules/history.js +62 -0
- package/dist/node/src/modules/history.js.map +1 -0
- package/dist/node/src/modules/history.public.js +6 -0
- package/dist/node/src/modules/history.public.js.map +1 -0
- package/dist/node/src/modules/namespaces.js +15 -0
- package/dist/node/src/modules/namespaces.js.map +1 -0
- package/dist/node/src/modules/namespaces.public.js +3 -0
- package/dist/node/src/modules/namespaces.public.js.map +1 -0
- package/dist/node/src/modules/queues.js +179 -0
- package/dist/node/src/modules/queues.js.map +1 -0
- package/dist/node/src/modules/queues.public.js +13 -0
- package/dist/node/src/modules/queues.public.js.map +1 -0
- package/dist/node/src/modules/reports.js +267 -0
- package/dist/node/src/modules/reports.js.map +1 -0
- package/dist/node/src/modules/reports.public.js +13 -0
- package/dist/node/src/modules/reports.public.js.map +1 -0
- package/dist/node/src/modules/setup.js +35 -0
- package/dist/node/src/modules/setup.js.map +1 -0
- package/dist/node/src/modules/setup.public.js +12 -0
- package/dist/node/src/modules/setup.public.js.map +1 -0
- package/dist/node/src/modules/tasks.base.js +51 -0
- package/dist/node/src/modules/tasks.base.js.map +1 -0
- package/dist/node/src/modules/tasks.js +281 -0
- package/dist/node/src/modules/tasks.js.map +1 -0
- package/dist/node/src/modules/tasks.public.js +21 -0
- package/dist/node/src/modules/tasks.public.js.map +1 -0
- package/dist/node/src/modules/tasksActivity.js +62 -0
- package/dist/node/src/modules/tasksActivity.js.map +1 -0
- package/dist/node/src/modules/tasksActivity.public.js +6 -0
- package/dist/node/src/modules/tasksActivity.public.js.map +1 -0
- package/dist/node/src/modules/tasksPresets.js +102 -0
- package/dist/node/src/modules/tasksPresets.js.map +1 -0
- package/dist/node/src/modules/tasksPresets.public.js +10 -0
- package/dist/node/src/modules/tasksPresets.public.js.map +1 -0
- package/dist/node/src/modules/templates.js +136 -0
- package/dist/node/src/modules/templates.js.map +1 -0
- package/dist/node/src/modules/templates.public.js +11 -0
- package/dist/node/src/modules/templates.public.js.map +1 -0
- package/dist/types/src/index.d.ts +32 -0
- package/dist/types/src/lib/axios.d.ts +51 -0
- package/dist/types/src/lib/promises.d.ts +21 -0
- package/dist/types/src/lib/utils.d.ts +27 -0
- package/dist/types/src/modules/auth.d.ts +90 -0
- package/dist/types/src/modules/auth.public.d.ts +1 -0
- package/dist/types/src/modules/crons.d.ts +102 -0
- package/dist/types/src/modules/crons.public.d.ts +1 -0
- package/dist/types/src/modules/elastic.d.ts +22 -0
- package/dist/types/src/modules/elastic.public.d.ts +1 -0
- package/dist/types/src/modules/health.d.ts +53 -0
- package/dist/types/src/modules/health.public.d.ts +1 -0
- package/dist/types/src/modules/history.d.ts +38 -0
- package/dist/types/src/modules/history.public.d.ts +1 -0
- package/dist/types/src/modules/namespaces.d.ts +29 -0
- package/dist/types/src/modules/namespaces.public.d.ts +1 -0
- package/dist/types/src/modules/queues.d.ts +120 -0
- package/dist/types/src/modules/queues.public.d.ts +1 -0
- package/dist/types/src/modules/reports.d.ts +204 -0
- package/dist/types/src/modules/reports.public.d.ts +1 -0
- package/dist/types/src/modules/setup.d.ts +17 -0
- package/dist/types/src/modules/setup.public.d.ts +2 -0
- package/dist/types/src/modules/tasks.base.d.ts +48 -0
- package/dist/types/src/modules/tasks.d.ts +243 -0
- package/dist/types/src/modules/tasks.public.d.ts +2 -0
- package/dist/types/src/modules/tasksActivity.d.ts +36 -0
- package/dist/types/src/modules/tasksActivity.public.d.ts +5 -0
- package/dist/types/src/modules/tasksPresets.d.ts +83 -0
- package/dist/types/src/modules/tasksPresets.public.d.ts +1 -0
- package/dist/types/src/modules/templates.d.ts +153 -0
- package/dist/types/src/modules/templates.public.d.ts +1 -0
- package/package.json +14 -12
- package/CHANGELOG.md +0 -42
- package/dist/types/lib/promises.d.ts +0 -18
- package/dist/types/modules/crons.public.d.ts +0 -1
- package/dist/types/modules/institutions.d.ts +0 -56
- package/dist/types/modules/queues.d.ts +0 -93
- package/dist/types/modules/queues.public.d.ts +0 -1
- package/dist/types/modules/tasks.d.ts +0 -124
- package/dist/types/modules/tasks.public.d.ts +0 -2
- package/dist/types/modules/templates.d.ts +0 -120
- /package/dist/{types → dist/dist/types/src}/modules/auth.public.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/health.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/health.public.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/history.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/history.public.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/namespaces.public.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/reports.public.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/setup.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/setup.public.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/tasks.base.d.ts +0 -0
- /package/dist/{types → dist/dist/types/src}/modules/templates.public.d.ts +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
1
3
|
import { Stream } from 'stream';
|
|
2
4
|
import { type Period, type RawPeriod } from '../lib/utils';
|
|
3
|
-
import {
|
|
5
|
+
import { type FullJob, type Job, type Queue } from './queues';
|
|
4
6
|
import type { RawFullTask } from './tasks';
|
|
5
7
|
interface RawReportResultDetail {
|
|
6
8
|
createdAt: string;
|
|
@@ -19,6 +21,11 @@ interface RawReportResultDetail {
|
|
|
19
21
|
error?: {
|
|
20
22
|
message: string;
|
|
21
23
|
stack: string[];
|
|
24
|
+
cause?: {
|
|
25
|
+
type: string;
|
|
26
|
+
layout: number;
|
|
27
|
+
figure?: number;
|
|
28
|
+
};
|
|
22
29
|
};
|
|
23
30
|
meta?: unknown;
|
|
24
31
|
}
|
|
@@ -46,15 +53,15 @@ type FullReportJob = FullJob<RawReportData, RawReportResult>;
|
|
|
46
53
|
/**
|
|
47
54
|
* Start generation of a report
|
|
48
55
|
*
|
|
49
|
-
* Needs `namespaces[namespaceId].tasks-post-task-
|
|
56
|
+
* Needs `namespaces[namespaceId].tasks-post-task-_run` permission
|
|
50
57
|
*
|
|
51
|
-
* @param
|
|
58
|
+
* @param taskOrId Task or id of the task
|
|
52
59
|
* @param params Other params for overriding default
|
|
53
60
|
* @param namespaces
|
|
54
61
|
*
|
|
55
62
|
* @returns Job info to track progress
|
|
56
63
|
*/
|
|
57
|
-
export declare const startGeneration: (
|
|
64
|
+
export declare const startGeneration: (taskOrId: RawFullTask | RawFullTask['id'], params?: {
|
|
58
65
|
/**
|
|
59
66
|
* Override targets of task. Also enable first level of debugging
|
|
60
67
|
* (disable generation history)
|
|
@@ -73,13 +80,17 @@ export type GenerationProgressEvent = {
|
|
|
73
80
|
progress: number;
|
|
74
81
|
status: FullReportJob['status'];
|
|
75
82
|
};
|
|
83
|
+
type GenerationEvents = {
|
|
84
|
+
'started': [GenerationStartedEvent];
|
|
85
|
+
'progress': [GenerationProgressEvent];
|
|
86
|
+
};
|
|
76
87
|
/**
|
|
77
88
|
* Start generation of a report and track progress
|
|
78
89
|
*
|
|
79
90
|
* Needs `namespaces[namespaceId].tasks-post-task-run`
|
|
80
91
|
* & `namespaces[namespaceId].queues-get-queue-jobs-jobId` permissions
|
|
81
92
|
*
|
|
82
|
-
* @param
|
|
93
|
+
* @param taskOrId Task or id of the task
|
|
83
94
|
* @param params Other params for overriding default
|
|
84
95
|
* @param namespaces
|
|
85
96
|
*
|
|
@@ -91,7 +102,7 @@ export type GenerationProgressEvent = {
|
|
|
91
102
|
*
|
|
92
103
|
* @returns When generation ends, with detail
|
|
93
104
|
*/
|
|
94
|
-
export declare const startAndListenGeneration: (
|
|
105
|
+
export declare const startAndListenGeneration: (taskOrId: string | RawFullTask, params?: {
|
|
95
106
|
/**
|
|
96
107
|
* Override targets of task. Also enable first level of debugging
|
|
97
108
|
* (disable generation history)
|
|
@@ -101,7 +112,7 @@ export declare const startAndListenGeneration: (taskId: string, params?: {
|
|
|
101
112
|
* Override period, must match task's recurrence
|
|
102
113
|
*/
|
|
103
114
|
period?: Period | undefined;
|
|
104
|
-
} | undefined, namespaces?: string[] | undefined) => import("../lib/promises").EventfulPromise<ReportResult>;
|
|
115
|
+
} | undefined, namespaces?: string[] | undefined) => import("../lib/promises").EventfulPromise<ReportResult, GenerationEvents>;
|
|
105
116
|
interface ResponseTypeMap {
|
|
106
117
|
arraybuffer: ArrayBuffer;
|
|
107
118
|
blob: Blob;
|
|
@@ -109,7 +120,6 @@ interface ResponseTypeMap {
|
|
|
109
120
|
text: string;
|
|
110
121
|
stream: Stream;
|
|
111
122
|
}
|
|
112
|
-
type GetJobParams = Parameters<typeof getJob>;
|
|
113
123
|
/**
|
|
114
124
|
* Get report main file (the result) by giving the report's name
|
|
115
125
|
*
|
|
@@ -129,14 +139,14 @@ export declare const getReportFileByName: <Result extends keyof ResponseTypeMap
|
|
|
129
139
|
* Needs `namespaces[namespaceId].reports-get-year-yearMonth-filename`
|
|
130
140
|
* & `namespaces[namespaceId].queues-get-queue-jobs-jobId ` permission
|
|
131
141
|
*
|
|
132
|
-
* @param
|
|
133
|
-
* @param
|
|
142
|
+
* @param queueOrName Queue or queue's name where job is
|
|
143
|
+
* @param jobOrId Job or job's id in queue
|
|
134
144
|
* @param namespaces
|
|
135
145
|
* @param responseType Wanted response type
|
|
136
146
|
*
|
|
137
147
|
* @returns The report's content
|
|
138
148
|
*/
|
|
139
|
-
export declare const getReportFileByJob: <Result extends keyof ResponseTypeMap = "text">(queueName:
|
|
149
|
+
export declare const getReportFileByJob: <Result extends keyof ResponseTypeMap = "text">(queueName: Queue | Queue['name'], jobId: Job<RawReportData> | Job<RawReportData>['id'], namespaces?: string[], responseType?: Result | undefined) => Promise<ResponseTypeMap[Result]>;
|
|
140
150
|
/**
|
|
141
151
|
* Get report detail by giving the report's name
|
|
142
152
|
*
|
|
@@ -156,15 +166,15 @@ export declare const getReportDetailByName: (name: string, namespaces?: string[]
|
|
|
156
166
|
* Needs `namespaces[namespaceId].reports-get-year-yearMonth-filename`
|
|
157
167
|
* & `namespaces[namespaceId].queues-get-queue-jobs-jobId` permission
|
|
158
168
|
*
|
|
159
|
-
* @param
|
|
160
|
-
* @param
|
|
169
|
+
* @param queueOrName Queue or queue's name where job is
|
|
170
|
+
* @param jobOrId Job or job's id in queue
|
|
161
171
|
* @param namespaces
|
|
162
172
|
* @param responseType Wanted response type. **If provided with anything but `json` you will have to
|
|
163
173
|
* cast in your type to avoid auto-completion issues.**
|
|
164
174
|
*
|
|
165
175
|
* @returns The detail's content
|
|
166
176
|
*/
|
|
167
|
-
export declare const getReportDetailByJob: (queueName:
|
|
177
|
+
export declare const getReportDetailByJob: (queueName: Queue | Queue['name'], jobId: Job<RawReportData> | Job<RawReportData>['id'], namespaces?: string[], responseType?: keyof ResponseTypeMap) => Promise<ReportResult>;
|
|
168
178
|
/**
|
|
169
179
|
* Get report debug file by giving the report's name
|
|
170
180
|
*
|
|
@@ -183,12 +193,12 @@ export declare const getReportDebugByName: <Result extends keyof ResponseTypeMap
|
|
|
183
193
|
* Needs `namespaces[namespaceId].reports-get-year-yearMonth-filename`
|
|
184
194
|
* & `namespaces[namespaceId].queues-get-queue-jobs-jobId ` permission
|
|
185
195
|
*
|
|
186
|
-
* @param
|
|
187
|
-
* @param
|
|
196
|
+
* @param queueOrName Queue or queue's name where job is
|
|
197
|
+
* @param jobOrId Job or job's id in queue
|
|
188
198
|
* @param namespaces
|
|
189
199
|
* @param responseType Wanted response type
|
|
190
200
|
*
|
|
191
201
|
* @returns The debug's content
|
|
192
202
|
*/
|
|
193
|
-
export declare const getReportDebugByJob: <Result extends keyof ResponseTypeMap = "json">(queueName:
|
|
203
|
+
export declare const getReportDebugByJob: <Result extends keyof ResponseTypeMap = "json">(queueName: Queue | Queue['name'], jobId: Job<RawReportData> | Job<RawReportData>['id'], namespaces?: string[], responseType?: Result | undefined) => Promise<ResponseTypeMap[Result]>;
|
|
194
204
|
export {};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { type ApiResponse, type PaginatedApiResponse } from '../lib/axios';
|
|
2
|
+
import type { PaginationOpts } from '../lib/utils';
|
|
3
|
+
import { type Activity, type RawActivity } from './tasksActivity';
|
|
4
|
+
import type { Namespace } from './namespaces';
|
|
5
|
+
import { type Layout, type RawTemplate, type Template } from './templates';
|
|
6
|
+
import { type Task, type RawTaskWithNamespace, type TaskWithNamespace } from './tasks.base';
|
|
7
|
+
interface AdditionalRawTaskData {
|
|
8
|
+
template: {
|
|
9
|
+
fetchOptions?: {
|
|
10
|
+
filters?: Record<string, any>;
|
|
11
|
+
dateField?: string;
|
|
12
|
+
index: string;
|
|
13
|
+
};
|
|
14
|
+
inserts?: (Layout & {
|
|
15
|
+
at: number;
|
|
16
|
+
})[];
|
|
17
|
+
};
|
|
18
|
+
extends: RawTemplate;
|
|
19
|
+
lastExtended?: {
|
|
20
|
+
id: string;
|
|
21
|
+
tags: RawTemplate['tags'];
|
|
22
|
+
};
|
|
23
|
+
targets: string[];
|
|
24
|
+
activity: RawActivity[];
|
|
25
|
+
}
|
|
26
|
+
interface AdditionalTaskData extends Omit<AdditionalRawTaskData, 'activity' | 'extends' | 'lastExtended'> {
|
|
27
|
+
activity: Activity[];
|
|
28
|
+
extends: Template;
|
|
29
|
+
lastExtended?: {
|
|
30
|
+
id: Template['id'];
|
|
31
|
+
name: Template['name'];
|
|
32
|
+
tags: Template['tags'];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface RawFullTask extends RawTaskWithNamespace, AdditionalRawTaskData {
|
|
36
|
+
}
|
|
37
|
+
export interface FullTask extends TaskWithNamespace, AdditionalTaskData {
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Input data for creating a new task
|
|
41
|
+
*/
|
|
42
|
+
export interface InputTask extends Pick<FullTask, 'name' | 'template' | 'targets' | 'recurrence'> {
|
|
43
|
+
namespace?: Task['namespaceId'];
|
|
44
|
+
nextRun?: FullTask['nextRun'];
|
|
45
|
+
enabled?: FullTask['enabled'];
|
|
46
|
+
extends: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Partial input data for creating a new task with a preset
|
|
50
|
+
*/
|
|
51
|
+
export interface PartialInputTask extends Pick<InputTask, 'targets' | 'name' | 'namespace'>, Partial<Omit<InputTask, 'targets' | 'name' | 'namespace' | 'template'>> {
|
|
52
|
+
template: Pick<InputTask['template'], 'fetchOptions'>;
|
|
53
|
+
}
|
|
54
|
+
export type TaskList = (Task & {
|
|
55
|
+
tags: Template['tags'];
|
|
56
|
+
_count: {
|
|
57
|
+
targets: number;
|
|
58
|
+
};
|
|
59
|
+
})[];
|
|
60
|
+
/**
|
|
61
|
+
* Get all available tasks
|
|
62
|
+
*
|
|
63
|
+
* Needs `namespaces[namespaceId].tasks-get` permission
|
|
64
|
+
*
|
|
65
|
+
* @param paginationOpts Options for pagination
|
|
66
|
+
* @param namespaces
|
|
67
|
+
*
|
|
68
|
+
* @returns All tasks' info
|
|
69
|
+
*/
|
|
70
|
+
export declare const getAllTasks: (paginationOpts?: PaginationOpts, namespaces?: Namespace['id'][]) => Promise<PaginatedApiResponse<TaskList[number], 'id'>>;
|
|
71
|
+
/**
|
|
72
|
+
* Get targets of available tasks
|
|
73
|
+
*
|
|
74
|
+
* Needs `namespaces[namespaceId].tasks-get-_targets` permission
|
|
75
|
+
*
|
|
76
|
+
* @param namespaces
|
|
77
|
+
*
|
|
78
|
+
* @returns Targets' email
|
|
79
|
+
*/
|
|
80
|
+
export declare const getAllTargets: (namespaces?: Namespace['id'][]) => Promise<ApiResponse<string[]>>;
|
|
81
|
+
/**
|
|
82
|
+
* Get available tasks of specific target
|
|
83
|
+
*
|
|
84
|
+
* Needs `namespaces[namespaceId].tasks-get-_targets-email-tasks` permission
|
|
85
|
+
*
|
|
86
|
+
* @param email The email of the target
|
|
87
|
+
* @param namespaces
|
|
88
|
+
*
|
|
89
|
+
* @returns Tasks where given email is a target
|
|
90
|
+
*/
|
|
91
|
+
export declare const getTasksOfTarget: (email: string, namespaces?: Namespace['id'][]) => Promise<{
|
|
92
|
+
content: {
|
|
93
|
+
nextRun: Date;
|
|
94
|
+
lastRun?: Date | undefined;
|
|
95
|
+
createdAt: Date;
|
|
96
|
+
updatedAt?: Date | undefined;
|
|
97
|
+
name: string;
|
|
98
|
+
id: string;
|
|
99
|
+
namespaceId: string;
|
|
100
|
+
recurrence: import("./tasks.base").Recurrence;
|
|
101
|
+
enabled: boolean;
|
|
102
|
+
tags: {
|
|
103
|
+
name: string;
|
|
104
|
+
color?: string | undefined;
|
|
105
|
+
}[];
|
|
106
|
+
}[];
|
|
107
|
+
status: {
|
|
108
|
+
code: number;
|
|
109
|
+
message: string;
|
|
110
|
+
};
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Unsubscribe a target from a task
|
|
114
|
+
*
|
|
115
|
+
* Needs `namespaces[namespaceId].tasks-get-_targets-email-tasks` permission
|
|
116
|
+
*
|
|
117
|
+
* @param email The email of the target
|
|
118
|
+
* @param taskOrId Task or Task's id
|
|
119
|
+
* @param namespaces
|
|
120
|
+
*/
|
|
121
|
+
export declare const unsubTargetOfTask: (email: string, taskOrId: Task | Task['id'], namespaces?: Namespace['id'][]) => Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Create a new task
|
|
124
|
+
*
|
|
125
|
+
* Needs `namespaces[namespaceId].tasks-post` permission
|
|
126
|
+
*
|
|
127
|
+
* @param task Task's data
|
|
128
|
+
* @param namespaces
|
|
129
|
+
*
|
|
130
|
+
* @returns Created task's info
|
|
131
|
+
*/
|
|
132
|
+
export declare const createTask: (task: InputTask, namespaces?: Namespace['id'][]) => Promise<ApiResponse<FullTask>>;
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new task from a preset
|
|
135
|
+
*
|
|
136
|
+
* Needs `namespaces[namespaceId].tasks-post-_from-preset-presetId` permission
|
|
137
|
+
*
|
|
138
|
+
* @param presetId The ID of the preset.
|
|
139
|
+
* @param partialTask The partial input task.
|
|
140
|
+
* @param namespaces
|
|
141
|
+
*
|
|
142
|
+
* @returns Created task's info
|
|
143
|
+
*/
|
|
144
|
+
export declare const createTaskFromPreset: (presetId: string, partialTask: PartialInputTask, namespaces?: Namespace['id'][]) => Promise<ApiResponse<FullTask>>;
|
|
145
|
+
/**
|
|
146
|
+
* Get task info
|
|
147
|
+
*
|
|
148
|
+
* Needs `namespaces[namespaceId].tasks-get-task` permission
|
|
149
|
+
*
|
|
150
|
+
* @param taskOrId Task or Task's id
|
|
151
|
+
* @param namespaces
|
|
152
|
+
*
|
|
153
|
+
* @returns Task's info
|
|
154
|
+
*/
|
|
155
|
+
export declare const getTask: (taskOrId: Task | Task['id'], namespaces?: Namespace['id'][]) => Promise<ApiResponse<FullTask>>;
|
|
156
|
+
/**
|
|
157
|
+
* Update or create a task
|
|
158
|
+
*
|
|
159
|
+
* Needs `namespaces[namespaceId].tasks-put-task` permission
|
|
160
|
+
*
|
|
161
|
+
* @param task Task's data **with id**
|
|
162
|
+
* @param namespaces
|
|
163
|
+
*
|
|
164
|
+
* @returns Updated/Created Task's info
|
|
165
|
+
*/
|
|
166
|
+
export declare const upsertTask: (task: InputTask & {
|
|
167
|
+
id: Task['id'];
|
|
168
|
+
}, namespaces?: Namespace['id'][]) => Promise<ApiResponse<FullTask>>;
|
|
169
|
+
/**
|
|
170
|
+
* Update a task
|
|
171
|
+
*
|
|
172
|
+
* Needs `namespaces[namespaceId].tasks-put-task` permission
|
|
173
|
+
*
|
|
174
|
+
* @param task Task's data **with id**
|
|
175
|
+
* @param namespaces
|
|
176
|
+
*
|
|
177
|
+
* @deprecated Use `upsertTask` instead
|
|
178
|
+
*
|
|
179
|
+
* @returns Updated Task's info
|
|
180
|
+
*/
|
|
181
|
+
export declare const updateTask: (task: InputTask & {
|
|
182
|
+
id: Task['id'];
|
|
183
|
+
}, namespaces?: Namespace['id'][]) => Promise<ApiResponse<FullTask>>;
|
|
184
|
+
/**
|
|
185
|
+
* Delete a task
|
|
186
|
+
*
|
|
187
|
+
* Needs `namespaces[namespaceId].tasks-delete-task` permission
|
|
188
|
+
*
|
|
189
|
+
* @param taskOrId Task or Task's id
|
|
190
|
+
* @param namespaces
|
|
191
|
+
*/
|
|
192
|
+
export declare const deleteTask: (taskOrId: Task | Task['id'], namespaces?: Namespace['id'][]) => Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Shorthand to enable task
|
|
195
|
+
*
|
|
196
|
+
* Needs `namespaces[namespaceId].tasks-put-_task-enable` permission
|
|
197
|
+
*
|
|
198
|
+
* @param taskOrId Task or Task's id
|
|
199
|
+
* @param namespaces
|
|
200
|
+
*
|
|
201
|
+
* @returns Updated task's info
|
|
202
|
+
*/
|
|
203
|
+
export declare const enableTask: (taskOrId: Task | Task['id'], namespaces?: Namespace['id'][]) => Promise<ApiResponse<FullTask>>;
|
|
204
|
+
/**
|
|
205
|
+
* Shorthand to disable task
|
|
206
|
+
*
|
|
207
|
+
* Needs `namespaces[namespaceId].tasks-put-_task-disable` permission
|
|
208
|
+
*
|
|
209
|
+
* @param taskOrId Task or Task's id
|
|
210
|
+
* @param namespaces
|
|
211
|
+
*
|
|
212
|
+
* @returns Updated task's info
|
|
213
|
+
*/
|
|
214
|
+
export declare const disableTask: (taskOrId: Task | Task['id'], namespaces?: Namespace['id'][]) => Promise<ApiResponse<FullTask>>;
|
|
215
|
+
/**
|
|
216
|
+
* Link a task to a template
|
|
217
|
+
*
|
|
218
|
+
* Needs `namespaces[namespaceId].tasks-put-task-_link-template` permission
|
|
219
|
+
*
|
|
220
|
+
* @param taskOrId Task or Task's id
|
|
221
|
+
* @param templateOrId Template or Template's id
|
|
222
|
+
* @param namespaces
|
|
223
|
+
*
|
|
224
|
+
* @returns Updated task's info
|
|
225
|
+
*/
|
|
226
|
+
export declare const linkTaskToTemplate: (taskOrId: Task | Task['id'], templateOrId: Template | Template['id'], namespaces?: Namespace['id'][]) => Promise<{
|
|
227
|
+
content: FullTask;
|
|
228
|
+
status: {
|
|
229
|
+
code: number;
|
|
230
|
+
message: string;
|
|
231
|
+
};
|
|
232
|
+
}>;
|
|
233
|
+
/**
|
|
234
|
+
* Unlink a task to a template
|
|
235
|
+
*
|
|
236
|
+
* Needs `namespaces[namespaceId].tasks-delete-task-_link-template` permission
|
|
237
|
+
*
|
|
238
|
+
* @param taskOrId Task or Task's id
|
|
239
|
+
* @param templateOrId Template or Template's id
|
|
240
|
+
* @param namespaces
|
|
241
|
+
*/
|
|
242
|
+
export declare const unlinkTaskToTemplate: (taskOrId: Task | Task['id'], templateOrId: Template | Template['id'], namespaces?: Namespace['id'][]) => Promise<void>;
|
|
243
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { type FullTask, type InputTask, type PartialInputTask, type TaskList, getAllTasks, getAllTargets, getTasksOfTarget, unsubTargetOfTask, getTask, createTask, createTaskFromPreset, updateTask, upsertTask, deleteTask, enableTask, disableTask, linkTaskToTemplate, unlinkTaskToTemplate, } from './tasks';
|
|
2
|
+
export { Recurrence, type Task, type TaskWithNamespace, } from './tasks.base';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type PaginatedApiResponse } from '../lib/axios';
|
|
2
|
+
import type { PaginationOpts } from '../lib/utils';
|
|
3
|
+
import { type TaskWithNamespace } from './tasks.base';
|
|
4
|
+
export interface RawActivity {
|
|
5
|
+
id: string;
|
|
6
|
+
taskId: string;
|
|
7
|
+
type: string;
|
|
8
|
+
message: string;
|
|
9
|
+
data?: object;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Activity extends Omit<RawActivity, 'createdAt'> {
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
}
|
|
15
|
+
export interface ActivityWithTask extends Omit<Activity, 'taskId'> {
|
|
16
|
+
task: TaskWithNamespace;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Transform raw data from JSON, to JS usable data
|
|
20
|
+
*
|
|
21
|
+
* @param entry Raw history entry
|
|
22
|
+
*
|
|
23
|
+
* @returns Parsed history entry
|
|
24
|
+
*/
|
|
25
|
+
export declare const parseActivity: (entry: RawActivity) => Activity;
|
|
26
|
+
/**
|
|
27
|
+
* Get all available history entries
|
|
28
|
+
*
|
|
29
|
+
* Needs `namespaces[namespaceId].history-get` permission
|
|
30
|
+
*
|
|
31
|
+
* @param paginationOpts Options for pagination
|
|
32
|
+
* @param namespaces
|
|
33
|
+
*
|
|
34
|
+
* @returns All history entries' info
|
|
35
|
+
*/
|
|
36
|
+
export declare const getAllEntries: (paginationOpts?: PaginationOpts, namespaces?: string[]) => Promise<PaginatedApiResponse<ActivityWithTask, 'id'>>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Recurrence } from './tasks.base';
|
|
2
|
+
import type { FullTemplate } from './templates';
|
|
3
|
+
import { type ApiResponse } from '../lib/axios';
|
|
4
|
+
interface RawTasksPreset {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
recurrence: Recurrence;
|
|
8
|
+
tags: {
|
|
9
|
+
name: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
}[];
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TasksPreset extends Omit<RawTasksPreset, 'createdAt' | 'updatedAt'> {
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt?: Date;
|
|
18
|
+
}
|
|
19
|
+
export interface RawFullTasksPreset extends Omit<RawTasksPreset, 'tags'> {
|
|
20
|
+
fetchOptions?: {
|
|
21
|
+
dateField?: string;
|
|
22
|
+
};
|
|
23
|
+
template: Pick<FullTemplate, 'id' | 'name' | 'tags' | 'createdAt' | 'updatedAt'>;
|
|
24
|
+
}
|
|
25
|
+
export interface FullTasksPreset extends Omit<RawFullTasksPreset, 'createdAt' | 'updatedAt'> {
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt?: Date;
|
|
28
|
+
}
|
|
29
|
+
export interface InputTasksPreset extends Pick<FullTasksPreset, 'name' | 'fetchOptions' | 'recurrence'> {
|
|
30
|
+
template: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get all available tasks presets
|
|
34
|
+
*
|
|
35
|
+
* Needs `general.tasks-presets-get` permission
|
|
36
|
+
*
|
|
37
|
+
* @returns All presets' info
|
|
38
|
+
*/
|
|
39
|
+
export declare const getAllTasksPresets: () => Promise<ApiResponse<TasksPreset[]>>;
|
|
40
|
+
/**
|
|
41
|
+
* Get tasks preset info
|
|
42
|
+
*
|
|
43
|
+
* Needs `general.tasks-presets-get-preset` permission
|
|
44
|
+
*
|
|
45
|
+
* @param presetOrId Preset or Preset's id
|
|
46
|
+
*
|
|
47
|
+
* @returns Preset info
|
|
48
|
+
*/
|
|
49
|
+
export declare const getTasksPreset: (presetOrId: TasksPreset | TasksPreset['id']) => Promise<ApiResponse<FullTasksPreset>>;
|
|
50
|
+
/**
|
|
51
|
+
* Create a new tasks preset
|
|
52
|
+
*
|
|
53
|
+
* Needs `general.tasks-presets-post` permission
|
|
54
|
+
*
|
|
55
|
+
* @param preset Preset's data
|
|
56
|
+
* @param namespaces
|
|
57
|
+
*
|
|
58
|
+
* @returns Created preset's info
|
|
59
|
+
*/
|
|
60
|
+
export declare const createTasksPreset: (preset: InputTasksPreset) => Promise<ApiResponse<FullTasksPreset>>;
|
|
61
|
+
/**
|
|
62
|
+
* Update or create a tasks preset
|
|
63
|
+
*
|
|
64
|
+
* Needs `general.tasks-presets-put-preset` permission
|
|
65
|
+
*
|
|
66
|
+
* @param preset Preset's data **with id**
|
|
67
|
+
* @param namespaces
|
|
68
|
+
*
|
|
69
|
+
* @returns Updated/Created Preset's info
|
|
70
|
+
*/
|
|
71
|
+
export declare const upsertTasksPreset: (preset: InputTasksPreset & {
|
|
72
|
+
id: TasksPreset['id'];
|
|
73
|
+
}) => Promise<ApiResponse<FullTasksPreset>>;
|
|
74
|
+
/**
|
|
75
|
+
* Delete a tasks preset
|
|
76
|
+
*
|
|
77
|
+
* Needs `general.tasks-presets-delete-preset` permission
|
|
78
|
+
*
|
|
79
|
+
* @param presetOrId Preset or Preset's id
|
|
80
|
+
* @param namespaces
|
|
81
|
+
*/
|
|
82
|
+
export declare const deleteTasksPreset: (presetOrId: TasksPreset | TasksPreset['id']) => Promise<void>;
|
|
83
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type TasksPreset, type FullTasksPreset, type InputTasksPreset, getAllTasksPresets, getTasksPreset, createTasksPreset, upsertTasksPreset, deleteTasksPreset, } from './tasksPresets';
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { type ApiResponse } from '../lib/axios';
|
|
2
|
+
import { type RawTask, type Task } from './tasks.base';
|
|
3
|
+
interface FigureFetchOptions {
|
|
4
|
+
fetchCount?: string;
|
|
5
|
+
filters?: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
interface FigureFetchOptionsAggs extends FigureFetchOptions {
|
|
8
|
+
aggs?: Record<string, any>[];
|
|
9
|
+
}
|
|
10
|
+
interface FigureFetchOptionsBuckets extends FigureFetchOptions {
|
|
11
|
+
buckets?: Record<string, any>[];
|
|
12
|
+
metric?: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export interface Figure {
|
|
15
|
+
type: string;
|
|
16
|
+
data?: string | unknown[];
|
|
17
|
+
params: Record<string, any>;
|
|
18
|
+
fetchOptions?: FigureFetchOptionsAggs | FigureFetchOptionsBuckets;
|
|
19
|
+
slots?: number[];
|
|
20
|
+
}
|
|
21
|
+
export interface Layout {
|
|
22
|
+
data?: unknown;
|
|
23
|
+
fetcher?: string;
|
|
24
|
+
fetchOptions?: {
|
|
25
|
+
fetchCount?: string;
|
|
26
|
+
filters?: Record<string, any>;
|
|
27
|
+
};
|
|
28
|
+
figures: Figure[];
|
|
29
|
+
}
|
|
30
|
+
export interface RawTemplate {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
pageCount: number;
|
|
34
|
+
tags: {
|
|
35
|
+
name: string;
|
|
36
|
+
color?: string;
|
|
37
|
+
}[];
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface Template extends Omit<RawTemplate, 'createdAt' | 'updatedAt'> {
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt?: Date;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Transform raw data from JSON, to JS usable data
|
|
47
|
+
*
|
|
48
|
+
* @param template Raw template
|
|
49
|
+
*
|
|
50
|
+
* @returns Parsed template
|
|
51
|
+
*/
|
|
52
|
+
export declare const parseTemplate: (template: RawTemplate) => Template;
|
|
53
|
+
export interface RawFullTemplate extends RawTemplate {
|
|
54
|
+
body: {
|
|
55
|
+
renderer?: string;
|
|
56
|
+
renderOptions?: {
|
|
57
|
+
grid?: {
|
|
58
|
+
cols: number;
|
|
59
|
+
rows: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
fetchOptions?: {
|
|
63
|
+
filters?: Record<string, any>;
|
|
64
|
+
index?: string;
|
|
65
|
+
dateField: string;
|
|
66
|
+
};
|
|
67
|
+
layouts: Layout[];
|
|
68
|
+
};
|
|
69
|
+
tasks: RawTask[];
|
|
70
|
+
}
|
|
71
|
+
export interface FullTemplate extends Omit<RawFullTemplate, 'tasks' | 'createdAt' | 'updatedAt'> {
|
|
72
|
+
createdAt: Date;
|
|
73
|
+
updatedAt?: Date;
|
|
74
|
+
tasks: Task[];
|
|
75
|
+
}
|
|
76
|
+
export interface InputTemplate {
|
|
77
|
+
name: FullTemplate['name'];
|
|
78
|
+
body: FullTemplate['body'];
|
|
79
|
+
tags: FullTemplate['tags'];
|
|
80
|
+
}
|
|
81
|
+
type TemplateListResponse = ApiResponse<Template[]> & {
|
|
82
|
+
meta: {
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Get all available templates
|
|
88
|
+
*
|
|
89
|
+
* Needs `general.templates-get` permission
|
|
90
|
+
*
|
|
91
|
+
* @returns All templates' info
|
|
92
|
+
*/
|
|
93
|
+
export declare const getAllTemplates: () => Promise<TemplateListResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* Get template info
|
|
96
|
+
*
|
|
97
|
+
* Needs `general.templates-get-template` permission
|
|
98
|
+
*
|
|
99
|
+
* @param templateOrId Template or Template's id
|
|
100
|
+
*
|
|
101
|
+
* @returns Template info
|
|
102
|
+
*/
|
|
103
|
+
export declare const getTemplate: (templateOrId: Template | Template['id']) => Promise<ApiResponse<FullTemplate>>;
|
|
104
|
+
/**
|
|
105
|
+
* Create a new template
|
|
106
|
+
*
|
|
107
|
+
* Needs `general.templates-post` permission
|
|
108
|
+
*
|
|
109
|
+
* @param template Template's data
|
|
110
|
+
* @param namespaces
|
|
111
|
+
*
|
|
112
|
+
* @returns Created template's info
|
|
113
|
+
*/
|
|
114
|
+
export declare const createTemplate: (template: InputTemplate) => Promise<ApiResponse<FullTemplate>>;
|
|
115
|
+
/**
|
|
116
|
+
* Update or create a template
|
|
117
|
+
*
|
|
118
|
+
* Needs `general.templates-put-template` permission
|
|
119
|
+
*
|
|
120
|
+
* @param template Template's data **with id**
|
|
121
|
+
* @param namespaces
|
|
122
|
+
*
|
|
123
|
+
* @returns Updated/Created Template's info
|
|
124
|
+
*/
|
|
125
|
+
export declare const upsertTemplate: (template: InputTemplate & {
|
|
126
|
+
id: Template['id'];
|
|
127
|
+
}) => Promise<ApiResponse<FullTemplate>>;
|
|
128
|
+
/**
|
|
129
|
+
* Update a template
|
|
130
|
+
*
|
|
131
|
+
* Needs `general.templates-put-template` permission
|
|
132
|
+
*
|
|
133
|
+
* @param id Template's id
|
|
134
|
+
* @param template New Template's data
|
|
135
|
+
* @param namespaces
|
|
136
|
+
*
|
|
137
|
+
* @deprecated use `upsertTemplate` instead
|
|
138
|
+
*
|
|
139
|
+
* @returns Updated Template's info
|
|
140
|
+
*/
|
|
141
|
+
export declare const updateTemplate: (template: InputTemplate & {
|
|
142
|
+
id: Template['id'];
|
|
143
|
+
}) => Promise<ApiResponse<FullTemplate>>;
|
|
144
|
+
/**
|
|
145
|
+
* Delete a template
|
|
146
|
+
*
|
|
147
|
+
* Needs `general.templates-delete-template` permission
|
|
148
|
+
*
|
|
149
|
+
* @param templateOrId Template or Template's id
|
|
150
|
+
* @param namespaces
|
|
151
|
+
*/
|
|
152
|
+
export declare const deleteTemplate: (templateOrId: Template | Template['id']) => Promise<void>;
|
|
153
|
+
export {};
|