@ezpaarse-project/ezreeport-sdk-js 2.0.0 → 2.1.0-beta.2
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/{body-BqAn9vHJ.d.ts → body-ADynkNh0.d.ts} +4 -2
- package/dist/helpers/jobs.d.ts +2 -2
- package/dist/helpers/jobs.js +1 -1
- package/dist/helpers/jobs.mjs +2 -2
- package/dist/helpers/layouts.d.ts +9 -4
- package/dist/helpers/task-presets.d.ts +2 -2
- package/dist/helpers/task-presets.js +1 -1
- package/dist/helpers/task-presets.mjs +1 -1
- package/dist/helpers/tasks.d.ts +19 -7
- package/dist/helpers/tasks.js +1 -1
- package/dist/helpers/tasks.js.map +1 -1
- package/dist/helpers/tasks.mjs +91 -64
- package/dist/helpers/tasks.mjs.map +1 -1
- package/dist/helpers/templates.d.ts +2 -2
- package/dist/helpers/templates.js +1 -1
- package/dist/helpers/templates.js.map +1 -1
- package/dist/helpers/templates.mjs +3 -1
- package/dist/helpers/templates.mjs.map +1 -1
- package/dist/{index-6ma-WCUD.d.ts → index-DfRKlMeG.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/methods-8bLJk-Sx.mjs +161 -0
- package/dist/{methods-DUqC5qzU.mjs.map → methods-8bLJk-Sx.mjs.map} +1 -1
- package/dist/methods-BOf9WLn2.js +2 -0
- package/dist/methods-BOf9WLn2.js.map +1 -0
- package/dist/methods-C3rgYZb1.mjs +122 -0
- package/dist/methods-C3rgYZb1.mjs.map +1 -0
- package/dist/methods-CMrpqFJZ.js +2 -0
- package/dist/{methods-CGdoP4Hi.js.map → methods-CMrpqFJZ.js.map} +1 -1
- package/dist/methods-ChKQbOFl.js +2 -0
- package/dist/methods-ChKQbOFl.js.map +1 -0
- package/dist/methods-DC2Gjy1i.js +2 -0
- package/dist/{methods-cUjyNkoK.js.map → methods-DC2Gjy1i.js.map} +1 -1
- package/dist/methods-jKz01wri.mjs +151 -0
- package/dist/methods-jKz01wri.mjs.map +1 -0
- package/dist/methods-sTFYWEAr.mjs +156 -0
- package/dist/methods-sTFYWEAr.mjs.map +1 -0
- package/dist/queues.d.ts +2 -2
- package/dist/reports.d.ts +1 -1
- package/dist/reports.js +1 -1
- package/dist/reports.mjs +1 -1
- package/dist/task-activity.d.ts +1 -1
- package/dist/task-activity.js +1 -1
- package/dist/task-activity.mjs +1 -1
- package/dist/task-presets.d.ts +2 -2
- package/dist/task-presets.js +1 -1
- package/dist/task-presets.mjs +1 -1
- package/dist/tasks.d.ts +2 -2
- package/dist/tasks.js +1 -1
- package/dist/tasks.mjs +1 -1
- package/dist/templates.js +1 -1
- package/dist/templates.mjs +1 -1
- package/dist/{types-C4AhJDkW.d.ts → types-DP1QhOKe.d.ts} +1 -1
- package/dist/{types-BGlpjxH9.d.ts → types-DtBHOMlQ.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/methods-BBsb3M5p.mjs +0 -142
- package/dist/methods-BBsb3M5p.mjs.map +0 -1
- package/dist/methods-CGdoP4Hi.js +0 -2
- package/dist/methods-CO0p8irP.js +0 -2
- package/dist/methods-CO0p8irP.js.map +0 -1
- package/dist/methods-DOB4Ry8E.mjs +0 -147
- package/dist/methods-DOB4Ry8E.mjs.map +0 -1
- package/dist/methods-DUqC5qzU.mjs +0 -146
- package/dist/methods-DY2VLwGd.mjs +0 -116
- package/dist/methods-DY2VLwGd.mjs.map +0 -1
- package/dist/methods-cUjyNkoK.js +0 -2
- package/dist/methods-uWDk6_pk.js +0 -2
- package/dist/methods-uWDk6_pk.js.map +0 -1
- package/dist/tasks-BDFAJ6Oi.d.ts +0 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as TemplateTag, T as Template, I as InputTemplate } from '../types-DcoMmjs3.js';
|
|
2
|
-
import { T as TemplateBodyHelper } from '../body-
|
|
3
|
-
export {
|
|
2
|
+
import { T as TemplateBodyHelper } from '../body-ADynkNh0.js';
|
|
3
|
+
export { b as addLayoutOfHelper, c as createTemplateBodyHelper, a as createTemplateBodyHelperFrom, r as removeLayoutOfHelper, u as updateLayoutOfHelper } from '../body-ADynkNh0.js';
|
|
4
4
|
import '../templates-BgRTZc5c.js';
|
|
5
5
|
import './figures.js';
|
|
6
6
|
import './aggregations.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var m=(e,t,a)=>new Promise((r,n)=>{var o=l=>{try{u(a.next(l))}catch(p){n(p)}},i=l=>{try{u(a.throw(l))}catch(p){n(p)}},u=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,i);u((a=a.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../methods-BOf9WLn2.js"),h=require("../decorator-C2gcn2rK.js"),y=require("object-hash"),d=require("../templates-yZjsVuN9.js");function c(e,t="",a=[],r=[],n){var o;return{version:2,dateField:t,layouts:a,filters:new Map((o=r==null?void 0:r.map(i=>[i.name,i]))!=null?o:[]),grid:n,index:e}}function f(e){return c(e.index,e.dateField,e.layouts.map(t=>d.createLayoutHelperFrom(t)),e.filters,e.grid)}function O(e){return{version:e.version,dateField:e.dateField,layouts:e.layouts.map(t=>d.layoutHelperToJSON(t)),filters:Array.from(e.filters.values()),grid:e.grid,index:e.index}}function w(e,t,a){if(e.layouts.some(r=>r.id===t.id))throw new Error(`Layout "${t.id}" already exists`);return e.layouts.splice(a!=null?a:e.layouts.length,0,t),e}function v(e,t){const a=e;return a.layouts=e.layouts.filter(r=>r.id!==t.id),e}function F(e,t,a){const r=e.layouts.findIndex(o=>o.id===t.id);if(r<0)throw new Error(`Layout "${t.id}" not found`);const n=e;return n.layouts[r]=a,e}function T(e){return y({name:e.name,body:e.body,tags:e.tags})}function g(e="",t,a=new Map,r="",n=new Date,o){const i={id:r,name:e,body:t!=null?t:c(),tags:a,createdAt:n,updatedAt:o,hash:""};return i.hash=T(i),i}function L(e){var t,a;return g(e.name,f(e.body),new Map((a=(t=e.tags)==null?void 0:t.map(r=>[r.name,r]))!=null?a:[]),e.id,e.createdAt,e.updatedAt)}function S(e){return{name:e.name,body:O(e.body),tags:Array.from(e.tags.values())}}function B(e){return e.hash!==T(e)}function H(e,t){return m(this,null,function*(){const a=yield s.getTemplate(e);return yield s.upsertTemplate({id:a.id,name:a.name,tags:a.tags,body:a.body,hidden:t})})}h.assignDependencies(H,[s.getTemplate,s.upsertTemplate]);exports.addLayoutOfHelper=w;exports.changeTemplateVisibility=H;exports.createTemplateBodyHelper=c;exports.createTemplateBodyHelperFrom=f;exports.createTemplateHelper=g;exports.createTemplateHelperFrom=L;exports.hasTemplateChanged=B;exports.removeLayoutOfHelper=v;exports.templateHelperToJSON=S;exports.updateLayoutOfHelper=F;
|
|
2
2
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sources":["../../src/helpers/templates/editor/body.ts","../../src/helpers/templates/editor/index.ts","../../src/helpers/templates/index.ts"],"sourcesContent":["import type { TemplateBody, TemplateFilter, TemplateBodyGrid } from '~/modules/templates';\nimport { createLayoutHelperFrom, layoutHelperToJSON, type LayoutHelper } from './layouts';\n\nexport interface TemplateBodyHelper {\n readonly version: number;\n filters: Map<string, TemplateFilter>;\n index?: string;\n dateField: string;\n layouts: LayoutHelper[];\n grid?: TemplateBodyGrid;\n}\n\nexport function createTemplateBodyHelper(\n index?: string,\n dateField: string = '',\n layouts: LayoutHelper[] = [],\n filters: TemplateFilter[] = [],\n grid?: TemplateBodyGrid,\n): TemplateBodyHelper {\n return {\n version: 2,\n dateField,\n layouts,\n filters: new Map(filters?.map((filter) => [filter.name, filter]) ?? []),\n grid,\n index,\n };\n}\n\nexport function createTemplateBodyHelperFrom(body: TemplateBody): TemplateBodyHelper {\n return createTemplateBodyHelper(\n body.index,\n body.dateField,\n body.layouts.map((l) => createLayoutHelperFrom(l)),\n body.filters,\n body.grid,\n );\n}\n\nexport function templateHelperBodyToJSON(body: TemplateBodyHelper): TemplateBody {\n return {\n version: body.version,\n dateField: body.dateField,\n layouts: body.layouts.map((l) => layoutHelperToJSON(l)),\n filters: Array.from(body.filters.values()),\n grid: body.grid,\n index: body.index,\n };\n}\n\nexport function addLayoutOfHelper(\n body: TemplateBodyHelper,\n layout: LayoutHelper,\n index?: number,\n): TemplateBodyHelper {\n if (body.layouts.some((l) => l.id === layout.id)) {\n throw new Error(`Layout \"${layout.id}\" already exists`);\n }\n body.layouts.splice(index ?? body.layouts.length, 0, layout);\n return body;\n}\n\nexport function removeLayoutOfHelper(\n body: TemplateBodyHelper,\n layout: LayoutHelper,\n): TemplateBodyHelper {\n const template = body;\n template.layouts = body.layouts.filter((l) => l.id !== layout.id);\n return body;\n}\n\nexport function updateLayoutOfHelper(\n body: TemplateBodyHelper,\n oldLayout: LayoutHelper,\n newLayout: LayoutHelper,\n): TemplateBodyHelper {\n const index = body.layouts.findIndex((l) => l.id === oldLayout.id);\n if (index < 0) {\n throw new Error(`Layout \"${oldLayout.id}\" not found`);\n }\n const template = body;\n template.layouts[index] = newLayout;\n return body;\n}\n","import objectHash from 'object-hash';\nimport type { InputTemplate, Template } from '~/modules/templates';\n\nimport type { TemplateTagMap } from './tags';\nimport {\n createTemplateBodyHelper,\n createTemplateBodyHelperFrom,\n templateHelperBodyToJSON,\n type TemplateBodyHelper,\n} from './body';\n\nexport interface TemplateHelper {\n readonly id: string;\n name: string;\n body: TemplateBodyHelper;\n tags: TemplateTagMap;\n readonly createdAt: Date;\n readonly updatedAt?: Date;\n readonly hash: string;\n}\n\nfunction hashTemplate(template: Template | TemplateHelper): string {\n return objectHash({\n name: template.name,\n body: template.body,\n tags: template.tags,\n });\n}\n\nexport function createTemplateHelper(\n name: string = '',\n body?: TemplateBodyHelper,\n tags: TemplateTagMap = new Map(),\n id: string = '',\n createdAt: Date = new Date(),\n updatedAt?: Date,\n): TemplateHelper {\n const template = {\n id,\n name,\n body: body ?? createTemplateBodyHelper(),\n tags,\n createdAt,\n updatedAt,\n hash: '',\n };\n\n template.hash = hashTemplate(template);\n\n return template;\n}\n\nexport function createTemplateHelperFrom(template: Template): TemplateHelper {\n return createTemplateHelper(\n template.name,\n createTemplateBodyHelperFrom(template.body),\n new Map(template.tags?.map((t) => [t.name, t]) ?? []),\n template.id,\n template.createdAt,\n template.updatedAt,\n );\n}\n\nexport function templateHelperToJSON(template: TemplateHelper): InputTemplate {\n return {\n name: template.name,\n body: templateHelperBodyToJSON(template.body),\n tags: Array.from(template.tags.values()),\n };\n}\n\nexport function hasTemplateChanged(template: TemplateHelper): boolean {\n return template.hash !== hashTemplate(template);\n}\n\nexport {\n type TemplateBodyHelper,\n addLayoutOfHelper,\n removeLayoutOfHelper,\n updateLayoutOfHelper,\n} from './body';\nexport * from './tags';\n","import { type Template, getTemplate, upsertTemplate } from '~/modules/templates';\n\nimport { assignDependencies } from '~/helpers/permissions/decorator';\n\nexport * from './editor';\n\n/**\n * Change visibility of a template\n *\n * @param templateOrId Template or Template's id\n * @param hidden New state\n *\n * @returns Updated template\n */\nexport async function changeTemplateVisibility(\n templateOrId: Omit<Template, 'body'> | string,\n hidden: boolean,\n): Promise<Template> {\n const base = await getTemplate(templateOrId);\n\n const template = await upsertTemplate({\n id: base.id,\n name: base.name,\n tags: base.tags,\n body: base.body,\n hidden,\n });\n\n return template;\n}\nassignDependencies(changeTemplateVisibility, [getTemplate, upsertTemplate]);\n"],"names":["createTemplateBodyHelper","index","dateField","layouts","filters","grid","_a","filter","createTemplateBodyHelperFrom","body","l","createLayoutHelperFrom","templateHelperBodyToJSON","layoutHelperToJSON","addLayoutOfHelper","layout","removeLayoutOfHelper","template","updateLayoutOfHelper","oldLayout","newLayout","hashTemplate","objectHash","createTemplateHelper","name","tags","id","createdAt","updatedAt","createTemplateHelperFrom","_b","t","templateHelperToJSON","hasTemplateChanged","changeTemplateVisibility","templateOrId","hidden","__async","base","getTemplate","upsertTemplate","assignDependencies"],"mappings":"4aAYgB,SAAAA,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AAA,mBAAmBP,EAA0B,CAACK,cAAaC,EAAAA,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"templates.js","sources":["../../src/helpers/templates/editor/body.ts","../../src/helpers/templates/editor/index.ts","../../src/helpers/templates/index.ts"],"sourcesContent":["import type { TemplateBody, TemplateFilter, TemplateBodyGrid } from '~/modules/templates';\nimport { createLayoutHelperFrom, layoutHelperToJSON, type LayoutHelper } from './layouts';\n\nexport interface TemplateBodyHelper {\n readonly version: number;\n filters: Map<string, TemplateFilter>;\n index?: string;\n dateField: string;\n layouts: LayoutHelper[];\n grid?: TemplateBodyGrid;\n}\n\nexport function createTemplateBodyHelper(\n index?: string,\n dateField: string = '',\n layouts: LayoutHelper[] = [],\n filters: TemplateFilter[] = [],\n grid?: TemplateBodyGrid,\n): TemplateBodyHelper {\n return {\n version: 2,\n dateField,\n layouts,\n filters: new Map(filters?.map((filter) => [filter.name, filter]) ?? []),\n grid,\n index,\n };\n}\n\nexport function createTemplateBodyHelperFrom(body: TemplateBody): TemplateBodyHelper {\n return createTemplateBodyHelper(\n body.index,\n body.dateField,\n body.layouts.map((l) => createLayoutHelperFrom(l)),\n body.filters,\n body.grid,\n );\n}\n\nexport function templateHelperBodyToJSON(body: TemplateBodyHelper): TemplateBody {\n return {\n version: body.version,\n dateField: body.dateField,\n layouts: body.layouts.map((l) => layoutHelperToJSON(l)),\n filters: Array.from(body.filters.values()),\n grid: body.grid,\n index: body.index,\n };\n}\n\nexport function addLayoutOfHelper(\n body: TemplateBodyHelper,\n layout: LayoutHelper,\n index?: number,\n): TemplateBodyHelper {\n if (body.layouts.some((l) => l.id === layout.id)) {\n throw new Error(`Layout \"${layout.id}\" already exists`);\n }\n body.layouts.splice(index ?? body.layouts.length, 0, layout);\n return body;\n}\n\nexport function removeLayoutOfHelper(\n body: TemplateBodyHelper,\n layout: LayoutHelper,\n): TemplateBodyHelper {\n const template = body;\n template.layouts = body.layouts.filter((l) => l.id !== layout.id);\n return body;\n}\n\nexport function updateLayoutOfHelper(\n body: TemplateBodyHelper,\n oldLayout: LayoutHelper,\n newLayout: LayoutHelper,\n): TemplateBodyHelper {\n const index = body.layouts.findIndex((l) => l.id === oldLayout.id);\n if (index < 0) {\n throw new Error(`Layout \"${oldLayout.id}\" not found`);\n }\n const template = body;\n template.layouts[index] = newLayout;\n return body;\n}\n","import objectHash from 'object-hash';\nimport type { InputTemplate, Template } from '~/modules/templates';\n\nimport type { TemplateTagMap } from './tags';\nimport {\n createTemplateBodyHelper,\n createTemplateBodyHelperFrom,\n templateHelperBodyToJSON,\n type TemplateBodyHelper,\n} from './body';\n\nexport interface TemplateHelper {\n readonly id: string;\n name: string;\n body: TemplateBodyHelper;\n tags: TemplateTagMap;\n readonly createdAt: Date;\n readonly updatedAt?: Date;\n readonly hash: string;\n}\n\nfunction hashTemplate(template: Template | TemplateHelper): string {\n return objectHash({\n name: template.name,\n body: template.body,\n tags: template.tags,\n });\n}\n\nexport function createTemplateHelper(\n name: string = '',\n body?: TemplateBodyHelper,\n tags: TemplateTagMap = new Map(),\n id: string = '',\n createdAt: Date = new Date(),\n updatedAt?: Date,\n): TemplateHelper {\n const template = {\n id,\n name,\n body: body ?? createTemplateBodyHelper(),\n tags,\n createdAt,\n updatedAt,\n hash: '',\n };\n\n template.hash = hashTemplate(template);\n\n return template;\n}\n\nexport function createTemplateHelperFrom(template: Template): TemplateHelper {\n return createTemplateHelper(\n template.name,\n createTemplateBodyHelperFrom(template.body),\n new Map(template.tags?.map((t) => [t.name, t]) ?? []),\n template.id,\n template.createdAt,\n template.updatedAt,\n );\n}\n\nexport function templateHelperToJSON(template: TemplateHelper): InputTemplate {\n return {\n name: template.name,\n body: templateHelperBodyToJSON(template.body),\n tags: Array.from(template.tags.values()),\n };\n}\n\nexport function hasTemplateChanged(template: TemplateHelper): boolean {\n return template.hash !== hashTemplate(template);\n}\n\nexport {\n type TemplateBodyHelper,\n createTemplateBodyHelper,\n createTemplateBodyHelperFrom,\n addLayoutOfHelper,\n removeLayoutOfHelper,\n updateLayoutOfHelper,\n} from './body';\nexport * from './tags';\n","import { type Template, getTemplate, upsertTemplate } from '~/modules/templates';\n\nimport { assignDependencies } from '~/helpers/permissions/decorator';\n\nexport * from './editor';\n\n/**\n * Change visibility of a template\n *\n * @param templateOrId Template or Template's id\n * @param hidden New state\n *\n * @returns Updated template\n */\nexport async function changeTemplateVisibility(\n templateOrId: Omit<Template, 'body'> | string,\n hidden: boolean,\n): Promise<Template> {\n const base = await getTemplate(templateOrId);\n\n const template = await upsertTemplate({\n id: base.id,\n name: base.name,\n tags: base.tags,\n body: base.body,\n hidden,\n });\n\n return template;\n}\nassignDependencies(changeTemplateVisibility, [getTemplate, upsertTemplate]);\n"],"names":["createTemplateBodyHelper","index","dateField","layouts","filters","grid","_a","filter","createTemplateBodyHelperFrom","body","l","createLayoutHelperFrom","templateHelperBodyToJSON","layoutHelperToJSON","addLayoutOfHelper","layout","removeLayoutOfHelper","template","updateLayoutOfHelper","oldLayout","newLayout","hashTemplate","objectHash","createTemplateHelper","name","tags","id","createdAt","updatedAt","createTemplateHelperFrom","_b","t","templateHelperToJSON","hasTemplateChanged","changeTemplateVisibility","templateOrId","hidden","__async","base","getTemplate","upsertTemplate","assignDependencies"],"mappings":"4aAYgB,SAAAA,EACdC,EACAC,EAAoB,GACpBC,EAA0B,GAC1BC,EAA4B,CAAC,EAC7BC,EACoB,OACb,MAAA,CACL,QAAS,EACT,UAAAH,EACA,QAAAC,EACA,QAAS,IAAI,KAAIG,EAAAF,GAAA,YAAAA,EAAS,IAAKG,GAAW,CAACA,EAAO,KAAMA,CAAM,KAA7C,KAAAD,EAAmD,CAAA,CAAE,EACtE,KAAAD,EACA,MAAAJ,CACF,CACF,CAEO,SAASO,EAA6BC,EAAwC,CAC5E,OAAAT,EACLS,EAAK,MACLA,EAAK,UACLA,EAAK,QAAQ,IAAKC,GAAMC,EAAAA,uBAAuBD,CAAC,CAAC,EACjDD,EAAK,QACLA,EAAK,IACP,CACF,CAEO,SAAS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M,EACR,EAES,OAAAX,EAAA,KAAOI,EAAaJ,CAAQ,EAE9BA,CACT,CAEO,SAASY,EAAyBZ,EAAoC,SACpE,OAAAM,EACLN,EAAS,KACTT,EAA6BS,EAAS,IAAI,EAC1C,IAAI,KAAIa,GAAAxB,EAAAW,EAAS,OAAT,YAAAX,EAAe,IAAKyB,GAAM,CAACA,EAAE,KAAMA,CAAC,KAApC,KAAAD,EAA0C,CAAA,CAAE,EACpDb,EAAS,GACTA,EAAS,UACTA,EAAS,SACX,CACF,CAEO,SAASe,EAAqBf,EAAyC,CACrE,MAAA,CACL,KAAMA,EAAS,KACf,KAAML,EAAyBK,EAAS,IAAI,EAC5C,KAAM,MAAM,KAAKA,EAAS,KAAK,OAAQ,CAAA,CACzC,CACF,CAEO,SAASgB,EAAmBhB,EAAmC,CAC7D,OAAAA,EAAS,OAASI,EAAaJ,CAAQ,CAChD,CC3DsB,SAAAiB,EACpBC,EACAC,EACmB,QAAAC,EAAA,sBACb,MAAAC,EAAO,MAAMC,EAAA,YAAYJ,CAAY,EAUpC,OARU,MAAMK,iBAAe,CACpC,GAAIF,EAAK,GACT,KAAMA,EAAK,KACX,KAAMA,EAAK,KACX,KAAMA,EAAK,KACX,OAAAF,CAAA,CACD,CAGH,GACAK,EAAA,mBAAmBP,EAA0B,CAACK,cAAaC,EAAAA,cAAc,CAAC"}
|
|
@@ -14,7 +14,7 @@ var m = (e, a, t) => new Promise((r, n) => {
|
|
|
14
14
|
}, u = (i) => i.done ? r(i.value) : Promise.resolve(i.value).then(o, s);
|
|
15
15
|
u((t = t.apply(e, a)).next());
|
|
16
16
|
});
|
|
17
|
-
import { a as p, u as c } from "../methods-
|
|
17
|
+
import { a as p, u as c } from "../methods-C3rgYZb1.mjs";
|
|
18
18
|
import { b as g } from "../decorator-DBkj--6g.mjs";
|
|
19
19
|
import h from "object-hash";
|
|
20
20
|
import { a as H, l as T } from "../templates-zMmVXt6k.mjs";
|
|
@@ -120,6 +120,8 @@ g(F, [p, c]);
|
|
|
120
120
|
export {
|
|
121
121
|
J as addLayoutOfHelper,
|
|
122
122
|
F as changeTemplateVisibility,
|
|
123
|
+
f as createTemplateBodyHelper,
|
|
124
|
+
w as createTemplateBodyHelperFrom,
|
|
123
125
|
v as createTemplateHelper,
|
|
124
126
|
S as createTemplateHelperFrom,
|
|
125
127
|
E as hasTemplateChanged,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.mjs","sources":["../../src/helpers/templates/editor/body.ts","../../src/helpers/templates/editor/index.ts","../../src/helpers/templates/index.ts"],"sourcesContent":["import type { TemplateBody, TemplateFilter, TemplateBodyGrid } from '~/modules/templates';\nimport { createLayoutHelperFrom, layoutHelperToJSON, type LayoutHelper } from './layouts';\n\nexport interface TemplateBodyHelper {\n readonly version: number;\n filters: Map<string, TemplateFilter>;\n index?: string;\n dateField: string;\n layouts: LayoutHelper[];\n grid?: TemplateBodyGrid;\n}\n\nexport function createTemplateBodyHelper(\n index?: string,\n dateField: string = '',\n layouts: LayoutHelper[] = [],\n filters: TemplateFilter[] = [],\n grid?: TemplateBodyGrid,\n): TemplateBodyHelper {\n return {\n version: 2,\n dateField,\n layouts,\n filters: new Map(filters?.map((filter) => [filter.name, filter]) ?? []),\n grid,\n index,\n };\n}\n\nexport function createTemplateBodyHelperFrom(body: TemplateBody): TemplateBodyHelper {\n return createTemplateBodyHelper(\n body.index,\n body.dateField,\n body.layouts.map((l) => createLayoutHelperFrom(l)),\n body.filters,\n body.grid,\n );\n}\n\nexport function templateHelperBodyToJSON(body: TemplateBodyHelper): TemplateBody {\n return {\n version: body.version,\n dateField: body.dateField,\n layouts: body.layouts.map((l) => layoutHelperToJSON(l)),\n filters: Array.from(body.filters.values()),\n grid: body.grid,\n index: body.index,\n };\n}\n\nexport function addLayoutOfHelper(\n body: TemplateBodyHelper,\n layout: LayoutHelper,\n index?: number,\n): TemplateBodyHelper {\n if (body.layouts.some((l) => l.id === layout.id)) {\n throw new Error(`Layout \"${layout.id}\" already exists`);\n }\n body.layouts.splice(index ?? body.layouts.length, 0, layout);\n return body;\n}\n\nexport function removeLayoutOfHelper(\n body: TemplateBodyHelper,\n layout: LayoutHelper,\n): TemplateBodyHelper {\n const template = body;\n template.layouts = body.layouts.filter((l) => l.id !== layout.id);\n return body;\n}\n\nexport function updateLayoutOfHelper(\n body: TemplateBodyHelper,\n oldLayout: LayoutHelper,\n newLayout: LayoutHelper,\n): TemplateBodyHelper {\n const index = body.layouts.findIndex((l) => l.id === oldLayout.id);\n if (index < 0) {\n throw new Error(`Layout \"${oldLayout.id}\" not found`);\n }\n const template = body;\n template.layouts[index] = newLayout;\n return body;\n}\n","import objectHash from 'object-hash';\nimport type { InputTemplate, Template } from '~/modules/templates';\n\nimport type { TemplateTagMap } from './tags';\nimport {\n createTemplateBodyHelper,\n createTemplateBodyHelperFrom,\n templateHelperBodyToJSON,\n type TemplateBodyHelper,\n} from './body';\n\nexport interface TemplateHelper {\n readonly id: string;\n name: string;\n body: TemplateBodyHelper;\n tags: TemplateTagMap;\n readonly createdAt: Date;\n readonly updatedAt?: Date;\n readonly hash: string;\n}\n\nfunction hashTemplate(template: Template | TemplateHelper): string {\n return objectHash({\n name: template.name,\n body: template.body,\n tags: template.tags,\n });\n}\n\nexport function createTemplateHelper(\n name: string = '',\n body?: TemplateBodyHelper,\n tags: TemplateTagMap = new Map(),\n id: string = '',\n createdAt: Date = new Date(),\n updatedAt?: Date,\n): TemplateHelper {\n const template = {\n id,\n name,\n body: body ?? createTemplateBodyHelper(),\n tags,\n createdAt,\n updatedAt,\n hash: '',\n };\n\n template.hash = hashTemplate(template);\n\n return template;\n}\n\nexport function createTemplateHelperFrom(template: Template): TemplateHelper {\n return createTemplateHelper(\n template.name,\n createTemplateBodyHelperFrom(template.body),\n new Map(template.tags?.map((t) => [t.name, t]) ?? []),\n template.id,\n template.createdAt,\n template.updatedAt,\n );\n}\n\nexport function templateHelperToJSON(template: TemplateHelper): InputTemplate {\n return {\n name: template.name,\n body: templateHelperBodyToJSON(template.body),\n tags: Array.from(template.tags.values()),\n };\n}\n\nexport function hasTemplateChanged(template: TemplateHelper): boolean {\n return template.hash !== hashTemplate(template);\n}\n\nexport {\n type TemplateBodyHelper,\n addLayoutOfHelper,\n removeLayoutOfHelper,\n updateLayoutOfHelper,\n} from './body';\nexport * from './tags';\n","import { type Template, getTemplate, upsertTemplate } from '~/modules/templates';\n\nimport { assignDependencies } from '~/helpers/permissions/decorator';\n\nexport * from './editor';\n\n/**\n * Change visibility of a template\n *\n * @param templateOrId Template or Template's id\n * @param hidden New state\n *\n * @returns Updated template\n */\nexport async function changeTemplateVisibility(\n templateOrId: Omit<Template, 'body'> | string,\n hidden: boolean,\n): Promise<Template> {\n const base = await getTemplate(templateOrId);\n\n const template = await upsertTemplate({\n id: base.id,\n name: base.name,\n tags: base.tags,\n body: base.body,\n hidden,\n });\n\n return template;\n}\nassignDependencies(changeTemplateVisibility, [getTemplate, upsertTemplate]);\n"],"names":["createTemplateBodyHelper","index","dateField","layouts","filters","grid","_a","filter","createTemplateBodyHelperFrom","body","l","createLayoutHelperFrom","templateHelperBodyToJSON","layoutHelperToJSON","addLayoutOfHelper","layout","removeLayoutOfHelper","template","updateLayoutOfHelper","oldLayout","newLayout","hashTemplate","objectHash","createTemplateHelper","name","tags","id","createdAt","updatedAt","createTemplateHelperFrom","_b","t","templateHelperToJSON","hasTemplateChanged","changeTemplateVisibility","templateOrId","hidden","__async","base","getTemplate","upsertTemplate","assignDependencies"],"mappings":";;;;;;;;;;;;;;;;;;;;AAYgB,SAAAA,EACdC,GACAC,IAAoB,IACpBC,IAA0B,IAC1BC,IAA4B,CAAC,GAC7BC,GACoB;;AACb,SAAA;AAAA,IACL,SAAS;AAAA,IACT,WAAAH;AAAA,IACA,SAAAC;AAAA,IACA,SAAS,IAAI,KAAIG,IAAAF,KAAA,gBAAAA,EAAS,IAAI,CAACG,MAAW,CAACA,EAAO,MAAMA,CAAM,OAA7C,OAAAD,IAAmD,CAAA,CAAE;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AAK;AAAA,MACX,QAAAF;AAAA,IAAA,CACD;AAAA,EAGH;AAAA;AACAK,EAAmBP,GAA0B,CAACK,GAAaC,CAAc,CAAC;"}
|
|
1
|
+
{"version":3,"file":"templates.mjs","sources":["../../src/helpers/templates/editor/body.ts","../../src/helpers/templates/editor/index.ts","../../src/helpers/templates/index.ts"],"sourcesContent":["import type { TemplateBody, TemplateFilter, TemplateBodyGrid } from '~/modules/templates';\nimport { createLayoutHelperFrom, layoutHelperToJSON, type LayoutHelper } from './layouts';\n\nexport interface TemplateBodyHelper {\n readonly version: number;\n filters: Map<string, TemplateFilter>;\n index?: string;\n dateField: string;\n layouts: LayoutHelper[];\n grid?: TemplateBodyGrid;\n}\n\nexport function createTemplateBodyHelper(\n index?: string,\n dateField: string = '',\n layouts: LayoutHelper[] = [],\n filters: TemplateFilter[] = [],\n grid?: TemplateBodyGrid,\n): TemplateBodyHelper {\n return {\n version: 2,\n dateField,\n layouts,\n filters: new Map(filters?.map((filter) => [filter.name, filter]) ?? []),\n grid,\n index,\n };\n}\n\nexport function createTemplateBodyHelperFrom(body: TemplateBody): TemplateBodyHelper {\n return createTemplateBodyHelper(\n body.index,\n body.dateField,\n body.layouts.map((l) => createLayoutHelperFrom(l)),\n body.filters,\n body.grid,\n );\n}\n\nexport function templateHelperBodyToJSON(body: TemplateBodyHelper): TemplateBody {\n return {\n version: body.version,\n dateField: body.dateField,\n layouts: body.layouts.map((l) => layoutHelperToJSON(l)),\n filters: Array.from(body.filters.values()),\n grid: body.grid,\n index: body.index,\n };\n}\n\nexport function addLayoutOfHelper(\n body: TemplateBodyHelper,\n layout: LayoutHelper,\n index?: number,\n): TemplateBodyHelper {\n if (body.layouts.some((l) => l.id === layout.id)) {\n throw new Error(`Layout \"${layout.id}\" already exists`);\n }\n body.layouts.splice(index ?? body.layouts.length, 0, layout);\n return body;\n}\n\nexport function removeLayoutOfHelper(\n body: TemplateBodyHelper,\n layout: LayoutHelper,\n): TemplateBodyHelper {\n const template = body;\n template.layouts = body.layouts.filter((l) => l.id !== layout.id);\n return body;\n}\n\nexport function updateLayoutOfHelper(\n body: TemplateBodyHelper,\n oldLayout: LayoutHelper,\n newLayout: LayoutHelper,\n): TemplateBodyHelper {\n const index = body.layouts.findIndex((l) => l.id === oldLayout.id);\n if (index < 0) {\n throw new Error(`Layout \"${oldLayout.id}\" not found`);\n }\n const template = body;\n template.layouts[index] = newLayout;\n return body;\n}\n","import objectHash from 'object-hash';\nimport type { InputTemplate, Template } from '~/modules/templates';\n\nimport type { TemplateTagMap } from './tags';\nimport {\n createTemplateBodyHelper,\n createTemplateBodyHelperFrom,\n templateHelperBodyToJSON,\n type TemplateBodyHelper,\n} from './body';\n\nexport interface TemplateHelper {\n readonly id: string;\n name: string;\n body: TemplateBodyHelper;\n tags: TemplateTagMap;\n readonly createdAt: Date;\n readonly updatedAt?: Date;\n readonly hash: string;\n}\n\nfunction hashTemplate(template: Template | TemplateHelper): string {\n return objectHash({\n name: template.name,\n body: template.body,\n tags: template.tags,\n });\n}\n\nexport function createTemplateHelper(\n name: string = '',\n body?: TemplateBodyHelper,\n tags: TemplateTagMap = new Map(),\n id: string = '',\n createdAt: Date = new Date(),\n updatedAt?: Date,\n): TemplateHelper {\n const template = {\n id,\n name,\n body: body ?? createTemplateBodyHelper(),\n tags,\n createdAt,\n updatedAt,\n hash: '',\n };\n\n template.hash = hashTemplate(template);\n\n return template;\n}\n\nexport function createTemplateHelperFrom(template: Template): TemplateHelper {\n return createTemplateHelper(\n template.name,\n createTemplateBodyHelperFrom(template.body),\n new Map(template.tags?.map((t) => [t.name, t]) ?? []),\n template.id,\n template.createdAt,\n template.updatedAt,\n );\n}\n\nexport function templateHelperToJSON(template: TemplateHelper): InputTemplate {\n return {\n name: template.name,\n body: templateHelperBodyToJSON(template.body),\n tags: Array.from(template.tags.values()),\n };\n}\n\nexport function hasTemplateChanged(template: TemplateHelper): boolean {\n return template.hash !== hashTemplate(template);\n}\n\nexport {\n type TemplateBodyHelper,\n createTemplateBodyHelper,\n createTemplateBodyHelperFrom,\n addLayoutOfHelper,\n removeLayoutOfHelper,\n updateLayoutOfHelper,\n} from './body';\nexport * from './tags';\n","import { type Template, getTemplate, upsertTemplate } from '~/modules/templates';\n\nimport { assignDependencies } from '~/helpers/permissions/decorator';\n\nexport * from './editor';\n\n/**\n * Change visibility of a template\n *\n * @param templateOrId Template or Template's id\n * @param hidden New state\n *\n * @returns Updated template\n */\nexport async function changeTemplateVisibility(\n templateOrId: Omit<Template, 'body'> | string,\n hidden: boolean,\n): Promise<Template> {\n const base = await getTemplate(templateOrId);\n\n const template = await upsertTemplate({\n id: base.id,\n name: base.name,\n tags: base.tags,\n body: base.body,\n hidden,\n });\n\n return template;\n}\nassignDependencies(changeTemplateVisibility, [getTemplate, upsertTemplate]);\n"],"names":["createTemplateBodyHelper","index","dateField","layouts","filters","grid","_a","filter","createTemplateBodyHelperFrom","body","l","createLayoutHelperFrom","templateHelperBodyToJSON","layoutHelperToJSON","addLayoutOfHelper","layout","removeLayoutOfHelper","template","updateLayoutOfHelper","oldLayout","newLayout","hashTemplate","objectHash","createTemplateHelper","name","tags","id","createdAt","updatedAt","createTemplateHelperFrom","_b","t","templateHelperToJSON","hasTemplateChanged","changeTemplateVisibility","templateOrId","hidden","__async","base","getTemplate","upsertTemplate","assignDependencies"],"mappings":";;;;;;;;;;;;;;;;;;;;AAYgB,SAAAA,EACdC,GACAC,IAAoB,IACpBC,IAA0B,IAC1BC,IAA4B,CAAC,GAC7BC,GACoB;;AACb,SAAA;AAAA,IACL,SAAS;AAAA,IACT,WAAAH;AAAA,IACA,SAAAC;AAAA,IACA,SAAS,IAAI,KAAIG,IAAAF,KAAA,gBAAAA,EAAS,IAAI,CAACG,MAAW,CAACA,EAAO,MAAMA,CAAM,OAA7C,OAAAD,IAAmD,CAAA,CAAE;AAAA,IACtE,MAAAD;AAAA,IACA,OAAAJ;AAAA,EACF;AACF;AAEO,SAASO,EAA6BC,GAAwC;AAC5E,SAAAT;AAAA,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C;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as ApiRequestOptions, S as SdkPaginated } from './api-C_g0ldUn.js';
|
|
2
2
|
import { c as ReportPeriod } from './types-jXqGnCKQ.js';
|
|
3
|
-
import { T as Task } from './types-
|
|
3
|
+
import { T as Task } from './types-DP1QhOKe.js';
|
|
4
4
|
|
|
5
5
|
interface GenerationData {
|
|
6
6
|
task: Omit<Task, 'namespace' | 'extends'>;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./fetch-Hd-ajPIl.js"),r="2.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./fetch-Hd-ajPIl.js"),r="2.1.0-beta.2";exports.prepareClient=e.prepareClient;exports.version=r;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
var E = Object.defineProperty, l = Object.defineProperties;
|
|
2
|
+
var $ = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var h = Object.getOwnPropertySymbols;
|
|
4
|
+
var q = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var g = (e, t, r) => t in e ? E(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, y = (e, t) => {
|
|
6
|
+
for (var r in t || (t = {}))
|
|
7
|
+
q.call(t, r) && g(e, r, t[r]);
|
|
8
|
+
if (h)
|
|
9
|
+
for (var r of h(t))
|
|
10
|
+
A.call(t, r) && g(e, r, t[r]);
|
|
11
|
+
return e;
|
|
12
|
+
}, u = (e, t) => l(e, $(t));
|
|
13
|
+
var o = (e, t, r) => new Promise((p, a) => {
|
|
14
|
+
var f = (i) => {
|
|
15
|
+
try {
|
|
16
|
+
c(r.next(i));
|
|
17
|
+
} catch (d) {
|
|
18
|
+
a(d);
|
|
19
|
+
}
|
|
20
|
+
}, w = (i) => {
|
|
21
|
+
try {
|
|
22
|
+
c(r.throw(i));
|
|
23
|
+
} catch (d) {
|
|
24
|
+
a(d);
|
|
25
|
+
}
|
|
26
|
+
}, c = (i) => i.done ? p(i.value) : Promise.resolve(i.value).then(f, w);
|
|
27
|
+
c((r = r.apply(e, t)).next());
|
|
28
|
+
});
|
|
29
|
+
import { formatISO as m, parseISO as T } from "date-fns";
|
|
30
|
+
import { c as s } from "./fetch-xZFTa3q1.mjs";
|
|
31
|
+
import { t as x } from "./transform-EpMTJExd.mjs";
|
|
32
|
+
import { a as n } from "./decorator-DBkj--6g.mjs";
|
|
33
|
+
const G = (e) => ({
|
|
34
|
+
start: T(e.start),
|
|
35
|
+
end: T(e.end)
|
|
36
|
+
}), b = (e) => u(y({}, x(e)), {
|
|
37
|
+
destroyAt: T(e.destroyAt),
|
|
38
|
+
period: e.period ? G(e.period) : void 0
|
|
39
|
+
}), z = (e) => u(y({}, e), {
|
|
40
|
+
detail: b(e.detail)
|
|
41
|
+
});
|
|
42
|
+
function R() {
|
|
43
|
+
return o(this, null, function* () {
|
|
44
|
+
const {
|
|
45
|
+
content: e
|
|
46
|
+
} = yield s.fetch(
|
|
47
|
+
"/reports"
|
|
48
|
+
);
|
|
49
|
+
return e;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
n(R, "GET /reports");
|
|
53
|
+
function F(e) {
|
|
54
|
+
return o(this, null, function* () {
|
|
55
|
+
const t = typeof e == "string" ? e : e.id;
|
|
56
|
+
if (!t)
|
|
57
|
+
throw new Error("Task id is required");
|
|
58
|
+
const {
|
|
59
|
+
content: r
|
|
60
|
+
} = yield s.fetch(
|
|
61
|
+
`/reports/${t}`
|
|
62
|
+
);
|
|
63
|
+
return r;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
n(F, "GET /reports/:taskId", !0);
|
|
67
|
+
function M(e, t) {
|
|
68
|
+
return o(this, null, function* () {
|
|
69
|
+
const r = typeof e == "string" ? e : e.id;
|
|
70
|
+
if (!r)
|
|
71
|
+
throw new Error("Task id is required");
|
|
72
|
+
return s.fetch(`/reports/${r}/${t}`, {
|
|
73
|
+
responseType: "blob"
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
n(M, "GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext", !0);
|
|
78
|
+
function S(e, t) {
|
|
79
|
+
return o(this, null, function* () {
|
|
80
|
+
const r = typeof e == "string" ? e : e.id;
|
|
81
|
+
if (!r)
|
|
82
|
+
throw new Error("Task id is required");
|
|
83
|
+
return s.fetch(`/reports/${r}/${t}`, {
|
|
84
|
+
responseType: "arrayBuffer"
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
n(S, "GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext", !0);
|
|
89
|
+
function P(e, t) {
|
|
90
|
+
return o(this, null, function* () {
|
|
91
|
+
const r = typeof e == "string" ? e : e.id;
|
|
92
|
+
if (!r)
|
|
93
|
+
throw new Error("Task id is required");
|
|
94
|
+
return s.fetch(`/reports/${r}/${t}`, {
|
|
95
|
+
responseType: "stream"
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
n(P, "GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext", !0);
|
|
100
|
+
function B(e, t) {
|
|
101
|
+
return o(this, null, function* () {
|
|
102
|
+
const r = typeof e == "string" ? e : e.id;
|
|
103
|
+
if (!r)
|
|
104
|
+
throw new Error("Task id is required");
|
|
105
|
+
return s.fetch(`/reports/${r}/${t}`, {
|
|
106
|
+
responseType: "text"
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
n(B, "GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext", !0);
|
|
111
|
+
function k(e, t) {
|
|
112
|
+
return o(this, null, function* () {
|
|
113
|
+
const r = typeof e == "string" ? e : e.id;
|
|
114
|
+
if (!r)
|
|
115
|
+
throw new Error("Task id is required");
|
|
116
|
+
return s.fetch(`/reports/${r}/${t}`);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
n(k, "GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext", !0);
|
|
120
|
+
function D(e, t, r) {
|
|
121
|
+
return o(this, null, function* () {
|
|
122
|
+
const p = typeof e == "string" ? e : e.id;
|
|
123
|
+
if (!p)
|
|
124
|
+
throw new Error("Task id is required");
|
|
125
|
+
let a;
|
|
126
|
+
t && (a = {
|
|
127
|
+
start: m(t.start, { representation: "date" }),
|
|
128
|
+
end: m(t.end, { representation: "date" })
|
|
129
|
+
});
|
|
130
|
+
const {
|
|
131
|
+
content: f
|
|
132
|
+
} = yield s.fetch(
|
|
133
|
+
`/reports/${p}`,
|
|
134
|
+
{
|
|
135
|
+
method: "POST",
|
|
136
|
+
body: {
|
|
137
|
+
period: a,
|
|
138
|
+
targets: r
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
return {
|
|
143
|
+
queue: f.queue,
|
|
144
|
+
jobId: f.id
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
n(D, "POST /reports/:taskId", !0);
|
|
149
|
+
export {
|
|
150
|
+
F as a,
|
|
151
|
+
D as b,
|
|
152
|
+
k as c,
|
|
153
|
+
P as d,
|
|
154
|
+
S as e,
|
|
155
|
+
M as f,
|
|
156
|
+
R as g,
|
|
157
|
+
B as h,
|
|
158
|
+
G as i,
|
|
159
|
+
z as t
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=methods-8bLJk-Sx.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods-
|
|
1
|
+
{"version":3,"file":"methods-8bLJk-Sx.mjs","sources":["../src/modules/reports/methods.ts"],"sourcesContent":["import { formatISO, parseISO } from 'date-fns';\n\nimport { client } from '~/lib/fetch';\nimport { transformCreated } from '~/lib/transform';\nimport type { ApiResponse } from '~/lib/api';\n\nimport { assignPermission } from '~/helpers/permissions/decorator';\n\nimport type { Task } from '~/modules/tasks/types';\n\nimport type {\n ReportFiles,\n RawReportPeriod,\n ReportPeriod,\n ReportDetails,\n RawReportDetails,\n ReportResult,\n RawReportResult,\n} from './types';\n\ntype ReportMap = Record<string, ReportFiles>;\n\nexport const transformPeriod = (period: RawReportPeriod): ReportPeriod => ({\n start: parseISO(period.start),\n end: parseISO(period.end),\n});\n\nexport const transformReportDetails = (detail: RawReportDetails): ReportDetails => ({\n ...transformCreated(detail),\n destroyAt: parseISO(detail.destroyAt),\n period: detail.period ? transformPeriod(detail.period) : undefined,\n});\n\nexport const transformReportResult = (report: RawReportResult): ReportResult => ({\n ...report,\n detail: transformReportDetails(report.detail),\n});\n\n/**\n * Get all available reports\n *\n * @returns Object with keys being task IDs, values being report IDs\n */\nexport async function getAllReports(): Promise<Record<string, ReportMap>> {\n const {\n content,\n } = await client.fetch<ApiResponse<Record<string, ReportMap>>>(\n '/reports',\n );\n\n return content;\n}\nassignPermission(getAllReports, 'GET /reports');\n\n/**\n * Get all available reports of a task\n *\n * @param taskOrId Task or Task's id\n *\n * @returns Object with keys being report IDs, values being files\n */\nexport async function getReportsOfTask(taskOrId: Omit<Task, 'template'> | string): Promise<ReportMap> {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n const {\n content,\n } = await client.fetch<ApiResponse<ReportMap>>(\n `/reports/${id}`,\n );\n\n return content;\n}\nassignPermission(getReportsOfTask, 'GET /reports/:taskId', true);\n\n/**\n * Get a report file as a blob\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The blob\n */\nexport async function getFileAsBlob(taskOrId: Omit<Task, 'template'> | string, path: string) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch(`/reports/${id}/${path}`, {\n responseType: 'blob',\n });\n}\nassignPermission(getFileAsBlob, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Get a report file as an array buffer\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The array buffer\n */\nexport async function getFileAsArrayBuffer(taskOrId: Omit<Task, 'template'> | string, path: string) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch(`/reports/${id}/${path}`, {\n responseType: 'arrayBuffer',\n });\n}\nassignPermission(getFileAsArrayBuffer, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Get a report file as a stream\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The stream\n */\nexport async function getFileAsStream(taskOrId: Omit<Task, 'template'> | string, path: string) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch(`/reports/${id}/${path}`, {\n responseType: 'stream',\n });\n}\nassignPermission(getFileAsStream, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Get a report file as a text\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The text\n */\nexport async function getFileAsText(taskOrId: Omit<Task, 'template'> | string, path: string) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch(`/reports/${id}/${path}`, {\n responseType: 'text',\n });\n}\nassignPermission(getFileAsText, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Get a report file as a JSON object\n * The file should end with `.det.json`\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The JSON object\n */\nexport async function getFileAsJson(taskOrId: Omit<Task, 'template'> | string, path: `${string}.det.json`) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch<ReportResult>(`/reports/${id}/${path}`);\n}\nassignPermission(getFileAsJson, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Start a report generation\n *\n * @param taskOrId Task or Task's id\n * @param targets Override targets, also enable first level of debugging\n * @param period Override period, must match task's recurrence\n *\n * @returns Data to get job, and so the progress of the generation\n */\nexport async function generateReportOfTask(\n taskOrId: Omit<Task, 'template'> | string,\n period?: { start: Date, end: Date },\n targets?: string[],\n) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n let periodDate;\n if (period) {\n periodDate = {\n start: formatISO(period.start, { representation: 'date' }),\n end: formatISO(period.end, { representation: 'date' }),\n };\n }\n\n const {\n content,\n } = await client.fetch<ApiResponse<{ queue: string, id: string }>>(\n `/reports/${id}`,\n {\n method: 'POST',\n body: {\n period: periodDate,\n targets,\n },\n },\n );\n\n return {\n queue: content.queue,\n jobId: content.id,\n };\n}\nassignPermission(generateReportOfTask, 'POST /reports/:taskId', true);\n"],"names":["transformPeriod","period","parseISO","transformReportDetails","detail","__spreadProps","__spreadValues","transformCreated","transformReportResult","report","getAllReports","__async","content","client","assignPermission","getReportsOfTask","taskOrId","id","getFileAsBlob","path","getFileAsArrayBuffer","getFileAsStream","getFileAsText","getFileAsJson","generateReportOfTask","targets","periodDate","formatISO"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBa,MAAAA,IAAkB,CAACC,OAA2C;AAAA,EACzE,OAAOC,EAASD,EAAO,KAAK;AAAA,EAC5B,KAAKC,EAASD,EAAO,GAAG;AAC1B,IAEaE,IAAyB,CAACC,MAA6CC,EAAAC,EAAA,IAC/EC,EAAiBH,CAAM,IADwD;AAAA,EAElF,WAAWF,EAASE,EAAO,SAAS;AAAA,EACpC,QAAQA,EAAO,SAASJ,EAAgBI,E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OAAQ,CAAA;AAAA,IACvD;AAGI,UAAA;AAAA,MACJ,SAAAW;AAAA,IAAA,IACE,MAAMC,EAAO;AAAA,MACf,YAAYI,CAAE;AAAA,MACd;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,UACJ,QAAQS;AAAA,UACR,SAAAD;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ;AAEO,WAAA;AAAA,MACL,OAAOb,EAAQ;AAAA,MACf,OAAOA,EAAQ;AAAA,IACjB;AAAA,EACF;AAAA;AACAE,EAAiBU,GAAsB,yBAAyB,EAAI;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var T=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var f=(e,t)=>{var s={};for(var n in e)q.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&T)for(var n of T(e))t.indexOf(n)<0&&w.call(e,n)&&(s[n]=e[n]);return s};var o=(e,t,s)=>new Promise((n,r)=>{var p=a=>{try{i(s.next(a))}catch(u){r(u)}},d=a=>{try{i(s.throw(a))}catch(u){r(u)}},i=a=>a.done?n(a.value):Promise.resolve(a.value).then(p,d);i((s=s.apply(e,t)).next())});const c=require("./fetch-Hd-ajPIl.js"),l=require("./transform-DzLAfSJo.js"),U=require("./api-DVzOqMA2.js"),m=require("./decorator-C2gcn2rK.js");function g(e){return o(this,null,function*(){const{content:t,meta:d}=yield c.client.fetch("/templates",{query:U.apiRequestOptionsToQuery(e)}),i=d,{total:s,count:n,page:r}=i,p=f(i,["total","count","page"]);return{items:t.map(l.transformCreatedUpdated),total:s,count:n,page:r,meta:p}})}m.assignPermission(g,"GET /templates",!0);function y(e){return o(this,null,function*(){const t=typeof e=="string"?e:e.id;if(!t)throw new Error("Template id is required");const{content:s}=yield c.client.fetch(`/templates/${t}`);return l.transformCreatedUpdated(s)})}m.assignPermission(y,"GET /templates/:id",!0);function h(e){return o(this,null,function*(){const{content:t}=yield c.client.fetch("/templates",{method:"POST",body:e});return l.transformCreatedUpdated(t)})}m.assignPermission(h,"POST /templates");function E(s){return o(this,null,function*(){var n=s,{id:e}=n,t=f(n,["id"]);const{content:r}=yield c.client.fetch(`/templates/${e}`,{method:"PUT",body:t});return l.transformCreatedUpdated(r)})}m.assignPermission(E,"PUT /templates/:id");function P(e){return o(this,null,function*(){const t=typeof e=="string"?e:e.id;if(!t)return!1;const{content:s}=yield c.client.fetch(`/templates/${t}`,{method:"DELETE"});return s.deleted})}m.assignPermission(P,"DELETE /templates/:id");exports.createTemplate=h;exports.deleteTemplate=P;exports.getAllTemplates=g;exports.getTemplate=y;exports.upsertTemplate=E;
|
|
2
|
+
//# sourceMappingURL=methods-BOf9WLn2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods-BOf9WLn2.js","sources":["../src/modules/templates/methods.ts"],"sourcesContent":["import { client } from '~/lib/fetch';\nimport { transformCreatedUpdated } from '~/lib/transform';\nimport {\n apiRequestOptionsToQuery,\n type ApiResponse,\n type ApiResponsePaginated,\n type ApiRequestOptions,\n type ApiDeletedResponse,\n type SdkPaginated,\n} from '~/lib/api';\n\nimport { assignPermission } from '~/helpers/permissions/decorator';\n\nimport type { InputTemplate, RawTemplate, Template } from './types';\n\ntype PaginatedTemplates = SdkPaginated<Omit<Template, 'body'>> & { meta: { default: string } };\n\n/**\n * Get all available templates\n *\n * @returns All templates' info\n */\nexport async function getAllTemplates(\n opts?: ApiRequestOptions,\n): Promise<PaginatedTemplates> {\n const {\n content,\n meta: {\n total, count, page, ...meta\n },\n } = await client.fetch<ApiResponsePaginated<Omit<RawTemplate, 'body'>, { default: string }>>(\n '/templates',\n { query: apiRequestOptionsToQuery(opts) },\n );\n\n return {\n items: content.map(transformCreatedUpdated),\n total,\n count,\n page,\n meta,\n };\n}\nassignPermission(getAllTemplates, 'GET /templates', true);\n\n/**\n * Get template info\n *\n * @param templateOrId Template or Template's id\n *\n * @returns Template info\n */\nexport async function getTemplate(\n templateOrId: Omit<Template, 'body'> | string,\n): Promise<Template> {\n const id = typeof templateOrId === 'string' ? templateOrId : templateOrId.id;\n if (!id) {\n throw new Error('Template id is required');\n }\n\n const {\n content,\n } = await client.fetch<ApiResponse<RawTemplate>>(`/templates/${id}`);\n\n return transformCreatedUpdated(content);\n}\nassignPermission(getTemplate, 'GET /templates/:id', true);\n\n/**\n * Create a new template\n *\n * @param template Template's data\n *\n * @returns Created template's info\n */\nexport async function createTemplate(\n template: InputTemplate,\n): Promise<Template> {\n const { content } = await client.fetch<ApiResponse<RawTemplate>>(\n '/templates',\n {\n method: 'POST',\n body: template,\n },\n );\n\n return transformCreatedUpdated(content);\n}\nassignPermission(createTemplate, 'POST /templates');\n\n/**\n * Update or create a template\n *\n * @param template Template's data **with id**\n *\n * @returns Updated/Created Template's info\n */\nexport async function upsertTemplate(\n { id, ...template }: InputTemplate & { id: string },\n): Promise<Template> {\n const {\n content,\n } = await client.fetch<ApiResponse<RawTemplate>>(\n `/templates/${id}`,\n {\n method: 'PUT',\n body: template,\n },\n );\n\n return transformCreatedUpdated(content);\n}\nassignPermission(upsertTemplate, 'PUT /templates/:id');\n\n/**\n * Delete a template\n *\n * @param templateOrId Template or Template's id\n *\n * @returns Whether the template was deleted\n */\nexport async function deleteTemplate(\n templateOrId: Omit<Template, 'body'> | string,\n): Promise<boolean> {\n const id = typeof templateOrId === 'string' ? templateOrId : templateOrId.id;\n if (!id) {\n return false;\n }\n\n const {\n content,\n } = await client.fetch<ApiDeletedResponse>(\n `/templates/${id}`,\n { method: 'DELETE' },\n );\n\n return content.deleted;\n}\nassignPermission(deleteTemplate, 'DELETE /templates/:id');\n"],"names":["getAllTemplates","opts","__async","content","_a","client","apiRequestOptionsToQuery","_b","total","count","page","meta","__objRest","transformCreatedUpdated","assignPermission","getTemplate","templateOrId","id","createTemplate","template","upsertTemplate","deleteTemplate"],"mappings":"6nBAsBA,SAAsBA,EACpBC,EAC6B,QAAAC,EAAA,sBACvB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,SAAsBC,EACpBL,EACkB,QAAAd,EAAA,sBAClB,MAAMe,EAAK,OAAOD,GAAiB,SAAWA,EAAeA,EAAa,GAC1E,GAAI,CAACC,EACI,MAAA,GAGH,KAAA,CACJ,QAAAd,CAAA,EACE,MAAME,EAAO,OAAA,MACf,cAAcY,CAAE,GAChB,CAAE,OAAQ,QAAS,CACrB,EAEA,OAAOd,EAAQ,OACjB,GACAW,EAAAA,iBAAiBO,EAAgB,uBAAuB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var T = Object.getOwnPropertySymbols;
|
|
2
|
+
var y = Object.prototype.hasOwnProperty, h = Object.prototype.propertyIsEnumerable;
|
|
3
|
+
var d = (t, e) => {
|
|
4
|
+
var n = {};
|
|
5
|
+
for (var a in t)
|
|
6
|
+
y.call(t, a) && e.indexOf(a) < 0 && (n[a] = t[a]);
|
|
7
|
+
if (t != null && T)
|
|
8
|
+
for (var a of T(t))
|
|
9
|
+
e.indexOf(a) < 0 && h.call(t, a) && (n[a] = t[a]);
|
|
10
|
+
return n;
|
|
11
|
+
};
|
|
12
|
+
var r = (t, e, n) => new Promise((a, o) => {
|
|
13
|
+
var f = (s) => {
|
|
14
|
+
try {
|
|
15
|
+
i(n.next(s));
|
|
16
|
+
} catch (l) {
|
|
17
|
+
o(l);
|
|
18
|
+
}
|
|
19
|
+
}, u = (s) => {
|
|
20
|
+
try {
|
|
21
|
+
i(n.throw(s));
|
|
22
|
+
} catch (l) {
|
|
23
|
+
o(l);
|
|
24
|
+
}
|
|
25
|
+
}, i = (s) => s.done ? a(s.value) : Promise.resolve(s.value).then(f, u);
|
|
26
|
+
i((n = n.apply(t, e)).next());
|
|
27
|
+
});
|
|
28
|
+
import { c } from "./fetch-xZFTa3q1.mjs";
|
|
29
|
+
import { a as p } from "./transform-EpMTJExd.mjs";
|
|
30
|
+
import { a as E } from "./api-D8l8Ds3U.mjs";
|
|
31
|
+
import { a as m } from "./decorator-DBkj--6g.mjs";
|
|
32
|
+
function g(t) {
|
|
33
|
+
return r(this, null, function* () {
|
|
34
|
+
const {
|
|
35
|
+
content: e,
|
|
36
|
+
meta: u
|
|
37
|
+
} = yield c.fetch(
|
|
38
|
+
"/templates",
|
|
39
|
+
{ query: E(t) }
|
|
40
|
+
), i = u, {
|
|
41
|
+
total: n,
|
|
42
|
+
count: a,
|
|
43
|
+
page: o
|
|
44
|
+
} = i, f = d(i, [
|
|
45
|
+
"total",
|
|
46
|
+
"count",
|
|
47
|
+
"page"
|
|
48
|
+
]);
|
|
49
|
+
return {
|
|
50
|
+
items: e.map(p),
|
|
51
|
+
total: n,
|
|
52
|
+
count: a,
|
|
53
|
+
page: o,
|
|
54
|
+
meta: f
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
m(g, "GET /templates", !0);
|
|
59
|
+
function w(t) {
|
|
60
|
+
return r(this, null, function* () {
|
|
61
|
+
const e = typeof t == "string" ? t : t.id;
|
|
62
|
+
if (!e)
|
|
63
|
+
throw new Error("Template id is required");
|
|
64
|
+
const {
|
|
65
|
+
content: n
|
|
66
|
+
} = yield c.fetch(`/templates/${e}`);
|
|
67
|
+
return p(n);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
m(w, "GET /templates/:id", !0);
|
|
71
|
+
function P(t) {
|
|
72
|
+
return r(this, null, function* () {
|
|
73
|
+
const { content: e } = yield c.fetch(
|
|
74
|
+
"/templates",
|
|
75
|
+
{
|
|
76
|
+
method: "POST",
|
|
77
|
+
body: t
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
return p(e);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
m(P, "POST /templates");
|
|
84
|
+
function q(n) {
|
|
85
|
+
return r(this, null, function* () {
|
|
86
|
+
var a = n, { id: t } = a, e = d(a, ["id"]);
|
|
87
|
+
const {
|
|
88
|
+
content: o
|
|
89
|
+
} = yield c.fetch(
|
|
90
|
+
`/templates/${t}`,
|
|
91
|
+
{
|
|
92
|
+
method: "PUT",
|
|
93
|
+
body: e
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
return p(o);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
m(q, "PUT /templates/:id");
|
|
100
|
+
function U(t) {
|
|
101
|
+
return r(this, null, function* () {
|
|
102
|
+
const e = typeof t == "string" ? t : t.id;
|
|
103
|
+
if (!e)
|
|
104
|
+
return !1;
|
|
105
|
+
const {
|
|
106
|
+
content: n
|
|
107
|
+
} = yield c.fetch(
|
|
108
|
+
`/templates/${e}`,
|
|
109
|
+
{ method: "DELETE" }
|
|
110
|
+
);
|
|
111
|
+
return n.deleted;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
m(U, "DELETE /templates/:id");
|
|
115
|
+
export {
|
|
116
|
+
w as a,
|
|
117
|
+
P as c,
|
|
118
|
+
U as d,
|
|
119
|
+
g,
|
|
120
|
+
q as u
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=methods-C3rgYZb1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods-C3rgYZb1.mjs","sources":["../src/modules/templates/methods.ts"],"sourcesContent":["import { client } from '~/lib/fetch';\nimport { transformCreatedUpdated } from '~/lib/transform';\nimport {\n apiRequestOptionsToQuery,\n type ApiResponse,\n type ApiResponsePaginated,\n type ApiRequestOptions,\n type ApiDeletedResponse,\n type SdkPaginated,\n} from '~/lib/api';\n\nimport { assignPermission } from '~/helpers/permissions/decorator';\n\nimport type { InputTemplate, RawTemplate, Template } from './types';\n\ntype PaginatedTemplates = SdkPaginated<Omit<Template, 'body'>> & { meta: { default: string } };\n\n/**\n * Get all available templates\n *\n * @returns All templates' info\n */\nexport async function getAllTemplates(\n opts?: ApiRequestOptions,\n): Promise<PaginatedTemplates> {\n const {\n content,\n meta: {\n total, count, page, ...meta\n },\n } = await client.fetch<ApiResponsePaginated<Omit<RawTemplate, 'body'>, { default: string }>>(\n '/templates',\n { query: apiRequestOptionsToQuery(opts) },\n );\n\n return {\n items: content.map(transformCreatedUpdated),\n total,\n count,\n page,\n meta,\n };\n}\nassignPermission(getAllTemplates, 'GET /templates', true);\n\n/**\n * Get template info\n *\n * @param templateOrId Template or Template's id\n *\n * @returns Template info\n */\nexport async function getTemplate(\n templateOrId: Omit<Template, 'body'> | string,\n): Promise<Template> {\n const id = typeof templateOrId === 'string' ? templateOrId : templateOrId.id;\n if (!id) {\n throw new Error('Template id is required');\n }\n\n const {\n content,\n } = await client.fetch<ApiResponse<RawTemplate>>(`/templates/${id}`);\n\n return transformCreatedUpdated(content);\n}\nassignPermission(getTemplate, 'GET /templates/:id', true);\n\n/**\n * Create a new template\n *\n * @param template Template's data\n *\n * @returns Created template's info\n */\nexport async function createTemplate(\n template: InputTemplate,\n): Promise<Template> {\n const { content } = await client.fetch<ApiResponse<RawTemplate>>(\n '/templates',\n {\n method: 'POST',\n body: template,\n },\n );\n\n return transformCreatedUpdated(content);\n}\nassignPermission(createTemplate, 'POST /templates');\n\n/**\n * Update or create a template\n *\n * @param template Template's data **with id**\n *\n * @returns Updated/Created Template's info\n */\nexport async function upsertTemplate(\n { id, ...template }: InputTemplate & { id: string },\n): Promise<Template> {\n const {\n content,\n } = await client.fetch<ApiResponse<RawTemplate>>(\n `/templates/${id}`,\n {\n method: 'PUT',\n body: template,\n },\n );\n\n return transformCreatedUpdated(content);\n}\nassignPermission(upsertTemplate, 'PUT /templates/:id');\n\n/**\n * Delete a template\n *\n * @param templateOrId Template or Template's id\n *\n * @returns Whether the template was deleted\n */\nexport async function deleteTemplate(\n templateOrId: Omit<Template, 'body'> | string,\n): Promise<boolean> {\n const id = typeof templateOrId === 'string' ? templateOrId : templateOrId.id;\n if (!id) {\n return false;\n }\n\n const {\n content,\n } = await client.fetch<ApiDeletedResponse>(\n `/templates/${id}`,\n { method: 'DELETE' },\n );\n\n return content.deleted;\n}\nassignPermission(deleteTemplate, 'DELETE /templates/:id');\n"],"names":["getAllTemplates","opts","__async","content","_a","client","apiRequestOptionsToQuery","_b","total","count","page","meta","__objRest","transformCreatedUpdated","assignPermission","getTemplate","templateOrId","id","createTemplate","template","upsertTemplate","deleteTemplate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAsBA,EACpBC,GAC6B;AAAA,SAAAC,EAAA;AACvB,UAEE;AAAA,MADN,SAAAC;AAAA,MACA,MAAMC;AAAA,QAGJ,MAAMC,EAAO;AAAA,MACf;AAAA,MACA,EAAE,OAAOC,EAAyBL,CAAI,EAAE;AAAA,IAC1C,GANQM,IAAAH,GACJ;AAAA,aAAAI;AAAA,MAAO,OAAAC;AAAA,MAAO,MAAAC;AAAA,QADVH,GACmBI,IAAAC,EADnBL,GACmB;AAAA,MAAvB;AAAA,MAAO;AAAA,MAAO;AAAA;AAOX,WAAA;AAAA,MACL,OAAOJ,EAAQ,IAAIU,CAAuB;AAAA,MAC1C,OAAAL;AAAA,MACA,OAAAC;AAAA,MACA,MAAAC;AAAA,MACA,MAAAC;AAAA,IACF;AAAA,EACF;AAAA;AACAG,EAAiBd,GAAiB,kBAAkB,EAAI;AASxD,SAAsBe,EACpBC,GACmB;AAAA,SAAAd,EAAA;AACnB,UAAMe,IAAK,OAAOD,KAAiB,WAAWA,IAAeA,EAAa;AAC1E,QAAI,CAACC;AACG,YAAA,IAAI,MAAM,yBAAyB;AAGrC,UAAA;AAAA,MACJ,SAAAd;AAAA,IAAA,IACE,MAAME,EAAO,MAAgC,cAAcY,CAAE,EAAE;AAEnE,WAAOJ,EAAwBV,CAAO;AAAA,EACxC;AAAA;AACAW,EAAiBC,GAAa,sBAAsB,EAAI;AASxD,SAAsBG,EACpBC,GACmB;AAAA,SAAAjB,EAAA;AACnB,UAAM,EAAE,SAAAC,EAAA,IAAY,MAAME,EAAO;AAAA,MAC/B;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,MAAMc;AAAA,MAAA;AAAA,IAEV;AAEA,WAAON,EAAwBV,CAAO;AAAA,EACxC;AAAA;AACAW,EAAiBI,GAAgB,iBAAiB;AASlD,SAAsBE,EACpBhB,GACmB;AAAA,SAAAF,EAAA;AADnB,QAAAK,IAAAH,GAAE,MAAAa,MAAFV,GAASY,IAAAP,EAATL,GAAS,CAAP;AAEI,UAAA;AAAA,MACJ,SAAAJ;AAAA,IAAA,IACE,MAAME,EAAO;AAAA,MACf,cAAcY,CAAE;AAAA,MAChB;AAAA,QACE,QAAQ;AAAA,QACR,MAAME;AAAA,MAAA;AAAA,IAEV;AAEA,WAAON,EAAwBV,CAAO;AAAA,EACxC;AAAA;AACAW,EAAiBM,GAAgB,oBAAoB;AASrD,SAAsBC,EACpBL,GACkB;AAAA,SAAAd,EAAA;AAClB,UAAMe,IAAK,OAAOD,KAAiB,WAAWA,IAAeA,EAAa;AAC1E,QAAI,CAACC;AACI,aAAA;AAGH,UAAA;AAAA,MACJ,SAAAd;AAAA,IAAA,IACE,MAAME,EAAO;AAAA,MACf,cAAcY,CAAE;AAAA,MAChB,EAAE,QAAQ,SAAS;AAAA,IACrB;AAEA,WAAOd,EAAQ;AAAA,EACjB;AAAA;AACAW,EAAiBO,GAAgB,uBAAuB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var S=Object.defineProperty,x=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var T=(e,t,r)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t)=>{for(var r in t||(t={}))b.call(t,r)&&T(e,r,t[r]);if(l)for(var r of l(t))B.call(t,r)&&T(e,r,t[r]);return e},g=(e,t)=>x(e,G(t));var s=(e,t,r)=>new Promise((c,a)=>{var f=i=>{try{d(r.next(i))}catch(u){a(u)}},R=i=>{try{d(r.throw(i))}catch(u){a(u)}},d=i=>i.done?c(i.value):Promise.resolve(i.value).then(f,R);d((r=r.apply(e,t)).next())});const p=require("date-fns"),o=require("./fetch-Hd-ajPIl.js"),M=require("./transform-DzLAfSJo.js"),n=require("./decorator-C2gcn2rK.js"),h=e=>({start:p.parseISO(e.start),end:p.parseISO(e.end)}),k=e=>g(y({},M.transformCreated(e)),{destroyAt:p.parseISO(e.destroyAt),period:e.period?h(e.period):void 0}),I=e=>g(y({},e),{detail:k(e.detail)});function m(){return s(this,null,function*(){const{content:e}=yield o.client.fetch("/reports");return e})}n.assignPermission(m,"GET /reports");function w(e){return s(this,null,function*(){const t=typeof e=="string"?e:e.id;if(!t)throw new Error("Task id is required");const{content:r}=yield o.client.fetch(`/reports/${t}`);return r})}n.assignPermission(w,"GET /reports/:taskId",!0);function A(e,t){return s(this,null,function*(){const r=typeof e=="string"?e:e.id;if(!r)throw new Error("Task id is required");return o.client.fetch(`/reports/${r}/${t}`,{responseType:"blob"})})}n.assignPermission(A,"GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext",!0);function E(e,t){return s(this,null,function*(){const r=typeof e=="string"?e:e.id;if(!r)throw new Error("Task id is required");return o.client.fetch(`/reports/${r}/${t}`,{responseType:"arrayBuffer"})})}n.assignPermission(E,"GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext",!0);function q(e,t){return s(this,null,function*(){const r=typeof e=="string"?e:e.id;if(!r)throw new Error("Task id is required");return o.client.fetch(`/reports/${r}/${t}`,{responseType:"stream"})})}n.assignPermission(q,"GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext",!0);function P(e,t){return s(this,null,function*(){const r=typeof e=="string"?e:e.id;if(!r)throw new Error("Task id is required");return o.client.fetch(`/reports/${r}/${t}`,{responseType:"text"})})}n.assignPermission(P,"GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext",!0);function $(e,t){return s(this,null,function*(){const r=typeof e=="string"?e:e.id;if(!r)throw new Error("Task id is required");return o.client.fetch(`/reports/${r}/${t}`)})}n.assignPermission($,"GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext",!0);function F(e,t,r){return s(this,null,function*(){const c=typeof e=="string"?e:e.id;if(!c)throw new Error("Task id is required");let a;t&&(a={start:p.formatISO(t.start,{representation:"date"}),end:p.formatISO(t.end,{representation:"date"})});const{content:f}=yield o.client.fetch(`/reports/${c}`,{method:"POST",body:{period:a,targets:r}});return{queue:f.queue,jobId:f.id}})}n.assignPermission(F,"POST /reports/:taskId",!0);exports.generateReportOfTask=F;exports.getAllReports=m;exports.getFileAsArrayBuffer=E;exports.getFileAsBlob=A;exports.getFileAsJson=$;exports.getFileAsStream=q;exports.getFileAsText=P;exports.getReportsOfTask=w;exports.transformPeriod=h;exports.transformReportResult=I;
|
|
2
|
+
//# sourceMappingURL=methods-CMrpqFJZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods-
|
|
1
|
+
{"version":3,"file":"methods-CMrpqFJZ.js","sources":["../src/modules/reports/methods.ts"],"sourcesContent":["import { formatISO, parseISO } from 'date-fns';\n\nimport { client } from '~/lib/fetch';\nimport { transformCreated } from '~/lib/transform';\nimport type { ApiResponse } from '~/lib/api';\n\nimport { assignPermission } from '~/helpers/permissions/decorator';\n\nimport type { Task } from '~/modules/tasks/types';\n\nimport type {\n ReportFiles,\n RawReportPeriod,\n ReportPeriod,\n ReportDetails,\n RawReportDetails,\n ReportResult,\n RawReportResult,\n} from './types';\n\ntype ReportMap = Record<string, ReportFiles>;\n\nexport const transformPeriod = (period: RawReportPeriod): ReportPeriod => ({\n start: parseISO(period.start),\n end: parseISO(period.end),\n});\n\nexport const transformReportDetails = (detail: RawReportDetails): ReportDetails => ({\n ...transformCreated(detail),\n destroyAt: parseISO(detail.destroyAt),\n period: detail.period ? transformPeriod(detail.period) : undefined,\n});\n\nexport const transformReportResult = (report: RawReportResult): ReportResult => ({\n ...report,\n detail: transformReportDetails(report.detail),\n});\n\n/**\n * Get all available reports\n *\n * @returns Object with keys being task IDs, values being report IDs\n */\nexport async function getAllReports(): Promise<Record<string, ReportMap>> {\n const {\n content,\n } = await client.fetch<ApiResponse<Record<string, ReportMap>>>(\n '/reports',\n );\n\n return content;\n}\nassignPermission(getAllReports, 'GET /reports');\n\n/**\n * Get all available reports of a task\n *\n * @param taskOrId Task or Task's id\n *\n * @returns Object with keys being report IDs, values being files\n */\nexport async function getReportsOfTask(taskOrId: Omit<Task, 'template'> | string): Promise<ReportMap> {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n const {\n content,\n } = await client.fetch<ApiResponse<ReportMap>>(\n `/reports/${id}`,\n );\n\n return content;\n}\nassignPermission(getReportsOfTask, 'GET /reports/:taskId', true);\n\n/**\n * Get a report file as a blob\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The blob\n */\nexport async function getFileAsBlob(taskOrId: Omit<Task, 'template'> | string, path: string) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch(`/reports/${id}/${path}`, {\n responseType: 'blob',\n });\n}\nassignPermission(getFileAsBlob, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Get a report file as an array buffer\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The array buffer\n */\nexport async function getFileAsArrayBuffer(taskOrId: Omit<Task, 'template'> | string, path: string) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch(`/reports/${id}/${path}`, {\n responseType: 'arrayBuffer',\n });\n}\nassignPermission(getFileAsArrayBuffer, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Get a report file as a stream\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The stream\n */\nexport async function getFileAsStream(taskOrId: Omit<Task, 'template'> | string, path: string) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch(`/reports/${id}/${path}`, {\n responseType: 'stream',\n });\n}\nassignPermission(getFileAsStream, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Get a report file as a text\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The text\n */\nexport async function getFileAsText(taskOrId: Omit<Task, 'template'> | string, path: string) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch(`/reports/${id}/${path}`, {\n responseType: 'text',\n });\n}\nassignPermission(getFileAsText, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Get a report file as a JSON object\n * The file should end with `.det.json`\n *\n * @param taskOrId Task or Task's id\n * @param path Path to the file\n *\n * @returns The JSON object\n */\nexport async function getFileAsJson(taskOrId: Omit<Task, 'template'> | string, path: `${string}.det.json`) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n return client.fetch<ReportResult>(`/reports/${id}/${path}`);\n}\nassignPermission(getFileAsJson, 'GET /reports/:taskId/:year/:yearMonth/:reportId.:type.:ext', true);\n\n/**\n * Start a report generation\n *\n * @param taskOrId Task or Task's id\n * @param targets Override targets, also enable first level of debugging\n * @param period Override period, must match task's recurrence\n *\n * @returns Data to get job, and so the progress of the generation\n */\nexport async function generateReportOfTask(\n taskOrId: Omit<Task, 'template'> | string,\n period?: { start: Date, end: Date },\n targets?: string[],\n) {\n const id = typeof taskOrId === 'string' ? taskOrId : taskOrId.id;\n if (!id) {\n throw new Error('Task id is required');\n }\n\n let periodDate;\n if (period) {\n periodDate = {\n start: formatISO(period.start, { representation: 'date' }),\n end: formatISO(period.end, { representation: 'date' }),\n };\n }\n\n const {\n content,\n } = await client.fetch<ApiResponse<{ queue: string, id: string }>>(\n `/reports/${id}`,\n {\n method: 'POST',\n body: {\n period: periodDate,\n targets,\n },\n },\n );\n\n return {\n queue: content.queue,\n jobId: content.id,\n };\n}\nassignPermission(generateReportOfTask, 'POST /reports/:taskId', true);\n"],"names":["transformPeriod","period","parseISO","transformReportDetails","detail","__spreadProps","__spreadValues","transformCreated","transformReportResult","report","getAllReports","__async","content","client","assignPermission","getReportsOfTask","taskOrId","id","getFileAsBlob","path","getFileAsArrayBuffer","getFileAsStream","getFileAsText","getFileAsJson","generateReportOfTask","targets","periodDate","formatISO"],"mappings":"8wBAsBaA,EAAmBC,IAA2C,CACzE,MAAOC,EAAAA,SAASD,EAAO,KAAK,EAC5B,IAAKC,EAAAA,SAASD,EAAO,GAAG,CAC1B,GAEaE,EAA0BC,GAA6CC,EAAAC,EAAA,GAC/EC,EAAAA,iBAAiBH,CAAM,GADwD,CAElF,UAAWF,EAAAA,SAASE,EAAO,SAAS,EACpC,OAAQA,EAAO,OAASJ,EAAgBI,EAAO,MAAM,EAAI,MAC3D,GAEaI,EAAyBC,GAA2CJ,EAAAC,EAAA,GAC5EG,GAD4E,CAE/E,OAAQN,EAAuBM,EAAO,MAAM,CAC9C,GAOA,SAAsBC,GAAoD,QAAAC,EAAA,sBAClE,KAAA,CACJ,QAAAC,CAAA,EACE,MAAMC,EAAO,OAAA,MACf,UACF,EAEO,OAAAD,CACT,GACAE,EAAAA,iBAAiBJ,EAAe,cAAc,EAS9C,SAAsBK,EAAiBC,EAA+D,QAAAL,EAAA,sBACpG,MAAMM,EAAK,OAAOD,GAAa,SAAWA,EAAWA,EAAS,GAC9D,GAAI,CAACC,EACG,MAAA,IAAI,MAAM,qBAAqB,EAGjC,KAAA,CACJ,QAAAL,CAAA,EACE,MAAMC,EAAO,OAAA,MACf,YAAYI,CAAE,EAChB,EAEO,OAAAL,CACT,GACAE,EAAAA,iBAAiBC,EAAkB,uBAAwB,EAAI,EAUzC,SAAAG,EAAcF,EAA2CG,EAAc,QAAAR,EAAA,sBAC3F,MAAMM,EAAK,OAAOD,GAAa,SAAWA,EAAWA,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,qBAAqB,EAGvC,OAAOJ,EAAAA,OAAO,MAAoB,YAAYI,CAAE,IAAIE,CAAI,EAAE,CAC5D,GACAL,EAAAA,iBAAiBS,EAAe,6DAA8D,EAAI,EAW5E,SAAAC,EACpBR,EACAf,EACAwB,EACA,QAAAd,EAAA,sBACA,MAAMM,EAAK,OAAOD,GAAa,SAAWA,EAAWA,EAAS,GAC9D,GAAI,CAACC,EACG,MAAA,IAAI,MAAM,qBAAqB,EAGnC,IAAAS,EACAzB,IACWyB,EAAA,CACX,MAAOC,EAAU,UAAA1B,EAAO,MAAO,CAAE,eAAgB,OAAQ,EACzD,IAAK0B,EAAU,UAAA1B,EAAO,IAAK,CAAE,eAAgB,MAAQ,CAAA,CACvD,GAGI,KAAA,CACJ,QAAAW,CAAA,EACE,MAAMC,EAAO,OAAA,MACf,YAAYI,CAAE,GACd,CACE,OAAQ,OACR,KAAM,CACJ,OAAQS,EACR,QAAAD,CAAA,CACF,CAEJ,EAEO,MAAA,CACL,MAAOb,EAAQ,MACf,MAAOA,EAAQ,EACjB,CACF,GACAE,EAAAA,iBAAiBU,EAAsB,wBAAyB,EAAI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var $=Object.defineProperty,b=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var T=(e,t,s)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,l=(e,t)=>{for(var s in t||(t={}))P.call(t,s)&&T(e,s,t[s]);if(d)for(var s of d(t))m.call(t,s)&&T(e,s,t[s]);return e},p=(e,t)=>b(e,A(t));var g=(e,t)=>{var s={};for(var r in e)P.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&d)for(var r of d(e))t.indexOf(r)<0&&m.call(e,r)&&(s[r]=e[r]);return s};var a=(e,t,s)=>new Promise((r,i)=>{var C=n=>{try{k(s.next(n))}catch(f){i(f)}},S=n=>{try{k(s.throw(n))}catch(f){i(f)}},k=n=>n.done?r(n.value):Promise.resolve(n.value).then(C,S);k((s=s.apply(e,t)).next())});const o=require("./fetch-Hd-ajPIl.js"),u=require("./transform-DzLAfSJo.js"),D=require("./api-DVzOqMA2.js"),c=require("./decorator-C2gcn2rK.js"),F=require("./methods-DC2Gjy1i.js");function h(e){return a(this,null,function*(){const{content:t,meta:{total:s,count:r,page:i}}=yield o.client.fetch("/task-presets",{query:p(l({},D.apiRequestOptionsToQuery(e)),{include:e==null?void 0:e.include})});return{items:t.map(u.transformCreatedUpdated),total:s,count:r,page:i}})}c.assignPermission(h,"GET /task-presets",!0);function y(e){return a(this,null,function*(){const t=typeof e=="string"?e:e.id;if(!t)throw new Error("Task preset id is required");const{content:s}=yield o.client.fetch(`/task-presets/${t}`);return u.transformCreatedUpdated(s)})}c.assignPermission(y,"GET /task-presets/:id",!0);function w(e){return a(this,null,function*(){const{content:t}=yield o.client.fetch("/task-presets/",{method:"POST",body:e});return u.transformCreatedUpdated(t)})}c.assignPermission(w,"POST /task-presets");function E(s){return a(this,null,function*(){var r=s,{id:e}=r,t=g(r,["id"]);const{content:i}=yield o.client.fetch(`/task-presets/${e}`,{method:"PUT",body:t});return u.transformCreatedUpdated(i)})}c.assignPermission(E,"PUT /task-presets/:id");function q(e){return a(this,null,function*(){const t=typeof e=="string"?e:e.id;if(!t)return!1;const{content:s}=yield o.client.fetch(`/task-presets/${t}`,{method:"DELETE"});return s.deleted})}c.assignPermission(q,"DELETE /task-presets/:id");function U(e,t){return a(this,null,function*(){const s=typeof e=="string"?e:e.id;if(!s)throw new Error("Task preset id is required");const{content:r}=yield o.client.fetch(`/task-presets/${s}/tasks`,{method:"POST",body:t});return F.transformTask(r)})}c.assignPermission(U,"POST /task-presets/:id/tasks");exports.createTaskFromPreset=U;exports.createTaskPreset=w;exports.deleteTaskPreset=q;exports.getAllTaskPresets=h;exports.getTaskPreset=y;exports.upsertTaskPreset=E;
|
|
2
|
+
//# sourceMappingURL=methods-ChKQbOFl.js.map
|