@mxpicture/gcp-functions-generator 0.2.70 → 0.2.71
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/4testing/templates/template.example.d.ts +3 -35
- package/dist/4testing/templates/template.example.d.ts.map +1 -1
- package/dist/4testing/templates/template.example.js +103 -181
- package/dist/4testing/templates/template.example.js.map +1 -1
- package/dist/4testing/templates/template.medication.d.ts +1 -27
- package/dist/4testing/templates/template.medication.d.ts.map +1 -1
- package/dist/4testing/templates/template.medication.js +76 -141
- package/dist/4testing/templates/template.medication.js.map +1 -1
- package/dist/4testing/templates/template.settings.d.ts +1 -23
- package/dist/4testing/templates/template.settings.d.ts.map +1 -1
- package/dist/4testing/templates/template.settings.js +38 -73
- package/dist/4testing/templates/template.settings.js.map +1 -1
- package/dist/common/Barrel.d.ts +4 -4
- package/dist/common/Barrel.d.ts.map +1 -1
- package/dist/common/Collector.d.ts +5 -6
- package/dist/common/Collector.d.ts.map +1 -1
- package/dist/common/Collector.js +2 -2
- package/dist/common/Collector.js.map +1 -1
- package/dist/common/Directories.d.ts +12 -12
- package/dist/common/Directories.d.ts.map +1 -1
- package/dist/common/Directories.js +4 -4
- package/dist/common/Directories.js.map +1 -1
- package/dist/common/Extractor.d.ts +4 -28
- package/dist/common/Extractor.d.ts.map +1 -1
- package/dist/common/Extractor.js +11 -185
- package/dist/common/Extractor.js.map +1 -1
- package/dist/common/file.common.d.ts +5 -5
- package/dist/common/file.common.d.ts.map +1 -1
- package/dist/common/file.common.js +6 -6
- package/dist/common/file.common.js.map +1 -1
- package/dist/common/generator.common.d.ts +3 -3
- package/dist/common/generator.common.d.ts.map +1 -1
- package/dist/common/generator.common.js +2 -2
- package/dist/common/generator.common.js.map +1 -1
- package/dist/common/index.d.ts +0 -1
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +0 -1
- package/dist/common/index.js.map +1 -1
- package/dist/common/types.common.d.ts +4 -4
- package/dist/common/types.common.d.ts.map +1 -1
- package/dist/{meta/meta.imports.d.ts → decorator/deco.imports.d.ts} +3 -3
- package/dist/decorator/deco.imports.d.ts.map +1 -0
- package/dist/{meta/meta.imports.js → decorator/deco.imports.js} +1 -1
- package/dist/decorator/deco.imports.js.map +1 -0
- package/dist/decorator/deco.names.d.ts +13 -0
- package/dist/decorator/deco.names.d.ts.map +1 -0
- package/dist/decorator/deco.names.js +93 -0
- package/dist/decorator/deco.names.js.map +1 -0
- package/dist/decorator/index.d.ts +3 -0
- package/dist/decorator/index.d.ts.map +1 -0
- package/dist/decorator/index.js +4 -0
- package/dist/decorator/index.js.map +1 -0
- package/dist/generator/Generator.d.ts +26 -21
- package/dist/generator/Generator.d.ts.map +1 -1
- package/dist/generator/Generator.js +24 -23
- package/dist/generator/Generator.js.map +1 -1
- package/dist/generator/GeneratorAnnotations.d.ts +2 -4
- package/dist/generator/GeneratorAnnotations.d.ts.map +1 -1
- package/dist/generator/GeneratorAnnotations.js +24 -23
- package/dist/generator/GeneratorAnnotations.js.map +1 -1
- package/dist/generator/GeneratorBackend.d.ts +8 -8
- package/dist/generator/GeneratorBackend.d.ts.map +1 -1
- package/dist/generator/GeneratorBackend.js +21 -18
- package/dist/generator/GeneratorBackend.js.map +1 -1
- package/dist/generator/GeneratorDoc.d.ts +2 -4
- package/dist/generator/GeneratorDoc.d.ts.map +1 -1
- package/dist/generator/GeneratorDoc.js +24 -8
- package/dist/generator/GeneratorDoc.js.map +1 -1
- package/dist/generator/GeneratorFrontend.d.ts +7 -7
- package/dist/generator/GeneratorFrontend.d.ts.map +1 -1
- package/dist/generator/GeneratorFrontend.js +19 -16
- package/dist/generator/GeneratorFrontend.js.map +1 -1
- package/dist/generator/GeneratorRoutes.d.ts +5 -6
- package/dist/generator/GeneratorRoutes.d.ts.map +1 -1
- package/dist/generator/GeneratorRoutes.js +15 -9
- package/dist/generator/GeneratorRoutes.js.map +1 -1
- package/dist/generator/GeneratorZod.d.ts +19 -19
- package/dist/generator/GeneratorZod.d.ts.map +1 -1
- package/dist/generator/GeneratorZod.js +19 -17
- package/dist/generator/GeneratorZod.js.map +1 -1
- package/package.json +10 -7
- package/dist/common/Evaluate.d.ts +0 -13
- package/dist/common/Evaluate.d.ts.map +0 -1
- package/dist/common/Evaluate.js +0 -121
- package/dist/common/Evaluate.js.map +0 -1
- package/dist/meta/index.d.ts +0 -4
- package/dist/meta/index.d.ts.map +0 -1
- package/dist/meta/index.js +0 -5
- package/dist/meta/index.js.map +0 -1
- package/dist/meta/meta.decorators.d.ts +0 -19
- package/dist/meta/meta.decorators.d.ts.map +0 -1
- package/dist/meta/meta.decorators.js +0 -23
- package/dist/meta/meta.decorators.js.map +0 -1
- package/dist/meta/meta.imports.d.ts.map +0 -1
- package/dist/meta/meta.imports.js.map +0 -1
- package/dist/meta/meta.names.d.ts +0 -14
- package/dist/meta/meta.names.d.ts.map +0 -1
- package/dist/meta/meta.names.js +0 -98
- package/dist/meta/meta.names.js.map +0 -1
|
@@ -1,36 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Since TypeScript interfaces are compile-time only and don't exist at runtime,
|
|
5
|
-
* we demonstrate the decorator system using classes that can serve as both
|
|
6
|
-
* type definitions and runtime metadata carriers.
|
|
7
|
-
*
|
|
8
|
-
* test
|
|
9
|
-
* This example shows how to:
|
|
10
|
-
* 1. Use decorators to annotate class properties
|
|
11
|
-
* 2. Generate Zod schemas from the decorator metadata
|
|
12
|
-
* 3. Use the generated schemas for validation
|
|
13
|
-
*/
|
|
14
|
-
import type { DocumentAdmin, DocumentKey } from "@mxpicture/gcp-functions-common/types";
|
|
15
|
-
export declare class ExamplePlanTimesTemplate {
|
|
16
|
-
morning: number;
|
|
17
|
-
noon: number;
|
|
18
|
-
evening: number;
|
|
19
|
-
night: number;
|
|
20
|
-
}
|
|
21
|
-
export declare class ExamplePlanTemplate {
|
|
22
|
-
lastPickDate?: Date;
|
|
23
|
-
times: ExamplePlanTimesTemplate;
|
|
24
|
-
}
|
|
25
|
-
export declare class ExampleTemplate implements DocumentKey, DocumentAdmin {
|
|
26
|
-
id: string;
|
|
27
|
-
createTime?: Date;
|
|
28
|
-
updateTime?: Date;
|
|
29
|
-
name: string;
|
|
30
|
-
dosageMg: number;
|
|
31
|
-
size?: number;
|
|
32
|
-
stock: number;
|
|
33
|
-
orderMail?: string;
|
|
34
|
-
plan?: ExamplePlanTemplate;
|
|
35
|
-
}
|
|
1
|
+
export declare const examplePlanTimes: import("@mxpicture/gcp-functions-common/decorator").Decorator;
|
|
2
|
+
export declare const examplePlan: import("@mxpicture/gcp-functions-common/decorator").Decorator;
|
|
3
|
+
export declare const example: import("@mxpicture/gcp-functions-common/decorator").Decorator;
|
|
36
4
|
//# sourceMappingURL=template.example.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.example.d.ts","sourceRoot":"","sources":["../../../src/4testing/templates/template.example.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"template.example.d.ts","sourceRoot":"","sources":["../../../src/4testing/templates/template.example.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,gBAAgB,+DA6BzB,CAAC;AAEL,eAAO,MAAM,WAAW,+DASpB,CAAC;AAEL,eAAO,MAAM,OAAO,+DA6DhB,CAAC"}
|
|
@@ -1,182 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
plan
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
], ExampleTemplate.prototype, "id", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
MetaCreateTime({ optional: true, hidden: { lineItem: true } }),
|
|
107
|
-
__metadata("design:type", Date)
|
|
108
|
-
], ExampleTemplate.prototype, "createTime", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
MetaUpdateTime({ optional: true, hidden: { lineItem: true } }),
|
|
111
|
-
__metadata("design:type", Date)
|
|
112
|
-
], ExampleTemplate.prototype, "updateTime", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
MetaString({
|
|
115
|
-
title: "Name",
|
|
116
|
-
editable: true,
|
|
117
|
-
sortable: true,
|
|
118
|
-
filterable: true,
|
|
119
|
-
default: "",
|
|
120
|
-
minLength: 3,
|
|
121
|
-
}),
|
|
122
|
-
__metadata("design:type", String)
|
|
123
|
-
], ExampleTemplate.prototype, "name", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
MetaNumber({ title: "Dosage mg", min: 0, editable: true, default: 0 }),
|
|
126
|
-
__metadata("design:type", Number)
|
|
127
|
-
], ExampleTemplate.prototype, "dosageMg", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
MetaNumber({
|
|
130
|
-
title: "Size",
|
|
131
|
-
min: 1,
|
|
132
|
-
optional: true,
|
|
133
|
-
editable: true,
|
|
134
|
-
sortable: true,
|
|
135
|
-
filterable: true,
|
|
136
|
-
default: 0,
|
|
137
|
-
}),
|
|
138
|
-
__metadata("design:type", Number)
|
|
139
|
-
], ExampleTemplate.prototype, "size", void 0);
|
|
140
|
-
__decorate([
|
|
141
|
-
MetaNumber({
|
|
142
|
-
title: "Stock",
|
|
143
|
-
min: 0,
|
|
144
|
-
editable: true,
|
|
145
|
-
sortable: true,
|
|
146
|
-
filterable: true,
|
|
147
|
-
default: 0,
|
|
148
|
-
}),
|
|
149
|
-
__metadata("design:type", Number)
|
|
150
|
-
], ExampleTemplate.prototype, "stock", void 0);
|
|
151
|
-
__decorate([
|
|
152
|
-
MetaString({
|
|
153
|
-
title: "Order Mail",
|
|
154
|
-
optional: true,
|
|
155
|
-
editable: true,
|
|
156
|
-
default: "",
|
|
157
|
-
}),
|
|
158
|
-
__metadata("design:type", String)
|
|
159
|
-
], ExampleTemplate.prototype, "orderMail", void 0);
|
|
160
|
-
__decorate([
|
|
161
|
-
MetaObject({ title: "Plan", optional: true, editable: true }),
|
|
162
|
-
__metadata("design:type", ExamplePlanTemplate)
|
|
163
|
-
], ExampleTemplate.prototype, "plan", void 0);
|
|
164
|
-
ExampleTemplate = __decorate([
|
|
165
|
-
MetaHeadInterface({
|
|
166
|
-
title: "Example",
|
|
167
|
-
namespace: "ex",
|
|
168
|
-
routes: {
|
|
169
|
-
crud: true,
|
|
170
|
-
testRoute: { requestType: "DocumentKey", responseType: "{test:boolean}" },
|
|
171
|
-
},
|
|
172
|
-
additionalImports: [
|
|
173
|
-
{
|
|
174
|
-
path: "@mxpicture/gcp-functions-common/types",
|
|
175
|
-
props: ["DocumentKey"],
|
|
176
|
-
isType: true,
|
|
177
|
-
},
|
|
178
|
-
],
|
|
179
|
-
})
|
|
180
|
-
], ExampleTemplate);
|
|
181
|
-
export { ExampleTemplate };
|
|
1
|
+
import { createDecorator, decoDate, decoNumber, decoObject, decoString, } from "@mxpicture/gcp-functions-common/decorator";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
const decorator = createDecorator(fileURLToPath(import.meta.url));
|
|
4
|
+
export const examplePlanTimes = decorator("ExamplePlanTimes")
|
|
5
|
+
.title("Example Plan Times")
|
|
6
|
+
.properties({
|
|
7
|
+
morning: decoNumber()
|
|
8
|
+
.title("Morning")
|
|
9
|
+
.min(0)
|
|
10
|
+
.default(0)
|
|
11
|
+
.editable()
|
|
12
|
+
.optional(),
|
|
13
|
+
noon: decoNumber()
|
|
14
|
+
.title("Noon")
|
|
15
|
+
.min(0)
|
|
16
|
+
.default(0)
|
|
17
|
+
.editable()
|
|
18
|
+
.optional(),
|
|
19
|
+
evening: decoNumber()
|
|
20
|
+
.title("Evening")
|
|
21
|
+
.min(0)
|
|
22
|
+
.default(0)
|
|
23
|
+
.editable()
|
|
24
|
+
.optional(),
|
|
25
|
+
night: decoNumber()
|
|
26
|
+
.title("Night")
|
|
27
|
+
.min(0)
|
|
28
|
+
.default(0)
|
|
29
|
+
.editable()
|
|
30
|
+
.optional(),
|
|
31
|
+
});
|
|
32
|
+
export const examplePlan = decorator("ExamplePlan")
|
|
33
|
+
.title("Example Plan")
|
|
34
|
+
.properties({
|
|
35
|
+
lastPickDate: decoDate()
|
|
36
|
+
.title("Last Pick Date")
|
|
37
|
+
.optional(),
|
|
38
|
+
times: decoObject(examplePlanTimes)
|
|
39
|
+
.title("Times")
|
|
40
|
+
.optional(),
|
|
41
|
+
});
|
|
42
|
+
export const example = decorator("Example")
|
|
43
|
+
.title("Example")
|
|
44
|
+
.namespace("ex")
|
|
45
|
+
.lead()
|
|
46
|
+
.routesCrud()
|
|
47
|
+
.routes({
|
|
48
|
+
testRoute: {
|
|
49
|
+
requestType: "DocumentKey",
|
|
50
|
+
responseType: "{test:boolean}",
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
.properties({
|
|
54
|
+
id: decoString()
|
|
55
|
+
.key()
|
|
56
|
+
.title("Example ID")
|
|
57
|
+
.hidden({ item: true }),
|
|
58
|
+
createDate: decoDate()
|
|
59
|
+
.optional()
|
|
60
|
+
.title("Created at")
|
|
61
|
+
.hidden({ item: true }),
|
|
62
|
+
updateTime: decoDate()
|
|
63
|
+
.optional()
|
|
64
|
+
.title("Update at")
|
|
65
|
+
.hidden({ item: true }),
|
|
66
|
+
name: decoString()
|
|
67
|
+
.optional()
|
|
68
|
+
.title("Name")
|
|
69
|
+
.editable()
|
|
70
|
+
.sortable()
|
|
71
|
+
.filterable()
|
|
72
|
+
.default("")
|
|
73
|
+
.minLength(3),
|
|
74
|
+
dosageMg: decoNumber()
|
|
75
|
+
.title("Dosage mg")
|
|
76
|
+
.min(0)
|
|
77
|
+
.editable()
|
|
78
|
+
.default(0),
|
|
79
|
+
size: decoNumber()
|
|
80
|
+
.title("Size")
|
|
81
|
+
.optional()
|
|
82
|
+
.min(1)
|
|
83
|
+
.editable()
|
|
84
|
+
.sortable()
|
|
85
|
+
.filterable()
|
|
86
|
+
.default(0),
|
|
87
|
+
stock: decoNumber()
|
|
88
|
+
.title("Stock")
|
|
89
|
+
.min(0)
|
|
90
|
+
.editable()
|
|
91
|
+
.sortable()
|
|
92
|
+
.filterable()
|
|
93
|
+
.default(0),
|
|
94
|
+
orderMail: decoString()
|
|
95
|
+
.title("Order Mail")
|
|
96
|
+
.optional()
|
|
97
|
+
.editable()
|
|
98
|
+
.default(""),
|
|
99
|
+
plan: decoObject(examplePlan)
|
|
100
|
+
.title("Plan")
|
|
101
|
+
.optional()
|
|
102
|
+
.editable(),
|
|
103
|
+
});
|
|
182
104
|
//# sourceMappingURL=template.example.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.example.js","sourceRoot":"","sources":["../../../src/4testing/templates/template.example.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"template.example.js","sourceRoot":"","sources":["../../../src/4testing/templates/template.example.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,eAAe,CAC/B,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CACvC,kBAAkB,CACnB;KACE,KAAK,CAAC,oBAAoB,CAAC;KAC3B,UAAU,CAAC;IACV,OAAO,EAAE,UAAU,EAAE;SAClB,KAAK,CAAC,SAAS,CAAC;SAChB,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,EAAE;SACV,QAAQ,EAAE;IACb,IAAI,EAAE,UAAU,EAAE;SACf,KAAK,CAAC,MAAM,CAAC;SACb,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,EAAE;SACV,QAAQ,EAAE;IACb,OAAO,EAAE,UAAU,EAAE;SAClB,KAAK,CAAC,SAAS,CAAC;SAChB,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,EAAE;SACV,QAAQ,EAAE;IACb,KAAK,EAAE,UAAU,EAAE;SAChB,KAAK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,OAAO,CAAC,EAAE,CAAC;SACX,SAAS,CAAC,CAAC,CAAC;IACf,QAAQ,EAAE,UAAU,EAAE;SACnB,KAAK,CAAC,WAAW,CAAC;SAClB,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,OAAO,CAAC,CAAC,CAAC;IACb,IAAI,EAAE,UAAU,EAAE;SACf,KAAK,CAAC,MAAM,CAAC;SACb,QAAQ,EAAE;SACV,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,UAAU,EAAE;SACZ,OAAO,CAAC,CAAC,CAAC;IACb,KAAK,EAAE,UAAU,EAAE;SAChB,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,UAAU,EAAE;SACZ,OAAO,CAAC,CAAC,CAAC;IACb,SAAS,EAAE,UAAU,EAAE;SACpB,KAAK,CAAC,YAAY,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,OAAO,CAAC,EAAE,CAAC;IACd,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC;SAC1B,KAAK,CAAC,MAAM,CAAC;SACb,QAAQ,EAAE;SACV,QAAQ,EAAE;CACd,CAAC,CAAC"}
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Example: Decorator-based Zod schema generation
|
|
3
|
-
*
|
|
4
|
-
* Since TypeScript interfaces are compile-time only and don't exist at runtime,
|
|
5
|
-
* we demonstrate the decorator system using classes that can serve as both
|
|
6
|
-
* type definitions and runtime metadata carriers.
|
|
7
|
-
*
|
|
8
|
-
* test
|
|
9
|
-
* This example shows how to:
|
|
10
|
-
* 1. Use decorators to annotate class properties
|
|
11
|
-
* 2. Generate Zod schemas from the decorator metadata
|
|
12
|
-
* 3. Use the generated schemas for validation
|
|
13
|
-
*/
|
|
14
|
-
import type { DocumentAdmin, DocumentKey } from "@mxpicture/gcp-functions-common/types";
|
|
15
|
-
export declare class MedicationTemplate implements DocumentKey, DocumentAdmin {
|
|
16
|
-
id: string;
|
|
17
|
-
createTime?: Date;
|
|
18
|
-
updateTime?: Date;
|
|
19
|
-
name: string;
|
|
20
|
-
dosageMg: number;
|
|
21
|
-
size?: number;
|
|
22
|
-
stock: number;
|
|
23
|
-
orderMail?: string;
|
|
24
|
-
planLastPickDate?: Date;
|
|
25
|
-
planTime?: Date;
|
|
26
|
-
planQuantity: number;
|
|
27
|
-
}
|
|
1
|
+
export declare const medication: import("@mxpicture/gcp-functions-common/decorator").Decorator;
|
|
28
2
|
//# sourceMappingURL=template.medication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.medication.d.ts","sourceRoot":"","sources":["../../../src/4testing/templates/template.medication.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"template.medication.d.ts","sourceRoot":"","sources":["../../../src/4testing/templates/template.medication.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,UAAU,+DAwEnB,CAAC"}
|
|
@@ -1,142 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
], MedicationTemplate.prototype, "size", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
MetaNumber({
|
|
80
|
-
title: "Stock",
|
|
81
|
-
min: 0,
|
|
82
|
-
minInclusive: true,
|
|
83
|
-
editable: true,
|
|
84
|
-
sortable: true,
|
|
85
|
-
filterable: true,
|
|
86
|
-
default: 0,
|
|
87
|
-
}),
|
|
88
|
-
__metadata("design:type", Number)
|
|
89
|
-
], MedicationTemplate.prototype, "stock", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
MetaString({
|
|
92
|
-
title: "Order Mail",
|
|
93
|
-
optional: true,
|
|
94
|
-
editable: true,
|
|
95
|
-
default: "",
|
|
96
|
-
}),
|
|
97
|
-
__metadata("design:type", String)
|
|
98
|
-
], MedicationTemplate.prototype, "orderMail", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
MetaDate({ title: "Plan Last Pick", optional: true }),
|
|
101
|
-
__metadata("design:type", Date)
|
|
102
|
-
], MedicationTemplate.prototype, "planLastPickDate", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
MetaDate({
|
|
105
|
-
title: "Plan Time",
|
|
106
|
-
optional: true,
|
|
107
|
-
editable: true,
|
|
108
|
-
dateFormat: MetaDateFormat.date,
|
|
109
|
-
}),
|
|
110
|
-
__metadata("design:type", Date)
|
|
111
|
-
], MedicationTemplate.prototype, "planTime", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
MetaNumber({
|
|
114
|
-
title: "Plan Quantity",
|
|
115
|
-
min: 0,
|
|
116
|
-
minInclusive: true,
|
|
117
|
-
default: 0,
|
|
118
|
-
optional: true,
|
|
119
|
-
editable: true,
|
|
120
|
-
fractionDigits: 1,
|
|
121
|
-
}),
|
|
122
|
-
__metadata("design:type", Number)
|
|
123
|
-
], MedicationTemplate.prototype, "planQuantity", void 0);
|
|
124
|
-
MedicationTemplate = __decorate([
|
|
125
|
-
MetaHeadInterface({
|
|
126
|
-
title: "Medication",
|
|
127
|
-
namespace: "picpad",
|
|
128
|
-
routes: {
|
|
129
|
-
crud: true,
|
|
130
|
-
testRoute: { requestType: "DocumentKey", responseType: "{test:boolean}" },
|
|
131
|
-
},
|
|
132
|
-
additionalImports: [
|
|
133
|
-
{
|
|
134
|
-
path: "@mxpicture/gcp-functions-common/types",
|
|
135
|
-
props: ["DocumentKey"],
|
|
136
|
-
isType: true,
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
})
|
|
140
|
-
], MedicationTemplate);
|
|
141
|
-
export { MedicationTemplate };
|
|
1
|
+
import { createDecorator, decoDate, DecoDateFormat, decoNumber, decoString, } from "@mxpicture/gcp-functions-common/decorator";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
const decorator = createDecorator(fileURLToPath(import.meta.url));
|
|
4
|
+
export const medication = decorator("Medication")
|
|
5
|
+
.title("Medication")
|
|
6
|
+
.namespace("picpad")
|
|
7
|
+
.lead()
|
|
8
|
+
.routesCrud()
|
|
9
|
+
.routes({
|
|
10
|
+
testRoute: {
|
|
11
|
+
requestType: "DocumentKey",
|
|
12
|
+
responseType: "{test:boolean}",
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
.properties({
|
|
16
|
+
id: decoString()
|
|
17
|
+
.key()
|
|
18
|
+
.title("Example ID")
|
|
19
|
+
.hidden({ item: true }),
|
|
20
|
+
createDate: decoDate()
|
|
21
|
+
.optional()
|
|
22
|
+
.title("Created at")
|
|
23
|
+
.hidden({ item: true }),
|
|
24
|
+
updateTime: decoDate()
|
|
25
|
+
.optional()
|
|
26
|
+
.title("Update at")
|
|
27
|
+
.hidden({ item: true }),
|
|
28
|
+
name: decoString()
|
|
29
|
+
.optional()
|
|
30
|
+
.title("Name")
|
|
31
|
+
.editable()
|
|
32
|
+
.sortable()
|
|
33
|
+
.filterable()
|
|
34
|
+
.default("")
|
|
35
|
+
.minLength(3),
|
|
36
|
+
dosageMg: decoNumber()
|
|
37
|
+
.title("Dosage mg")
|
|
38
|
+
.min(0)
|
|
39
|
+
.editable()
|
|
40
|
+
.default(0),
|
|
41
|
+
size: decoNumber()
|
|
42
|
+
.title("Size")
|
|
43
|
+
.optional()
|
|
44
|
+
.min(1)
|
|
45
|
+
.editable()
|
|
46
|
+
.sortable()
|
|
47
|
+
.filterable()
|
|
48
|
+
.default(0),
|
|
49
|
+
stock: decoNumber()
|
|
50
|
+
.title("Stock")
|
|
51
|
+
.min(0)
|
|
52
|
+
.editable()
|
|
53
|
+
.sortable()
|
|
54
|
+
.filterable()
|
|
55
|
+
.default(0),
|
|
56
|
+
orderMail: decoString()
|
|
57
|
+
.title("Order Mail")
|
|
58
|
+
.optional()
|
|
59
|
+
.editable()
|
|
60
|
+
.default(""),
|
|
61
|
+
planLastPickDate: decoDate()
|
|
62
|
+
.title("Plan Last Pick")
|
|
63
|
+
.optional(),
|
|
64
|
+
planTime: decoDate()
|
|
65
|
+
.title("Plan Time")
|
|
66
|
+
.optional()
|
|
67
|
+
.editable()
|
|
68
|
+
.format(DecoDateFormat.date),
|
|
69
|
+
planQuantity: decoNumber()
|
|
70
|
+
.title("Plan Quantity")
|
|
71
|
+
.min(0)
|
|
72
|
+
.default(0)
|
|
73
|
+
.optional()
|
|
74
|
+
.editable()
|
|
75
|
+
.fraction(1),
|
|
76
|
+
});
|
|
142
77
|
//# sourceMappingURL=template.medication.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.medication.js","sourceRoot":"","sources":["../../../src/4testing/templates/template.medication.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"template.medication.js","sourceRoot":"","sources":["../../../src/4testing/templates/template.medication.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,QAAQ,EACR,cAAc,EACd,UAAU,EACV,UAAU,GACX,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,eAAe,CAC/B,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC,YAAY,CAAC;KAC9C,KAAK,CAAC,YAAY,CAAC;KACnB,SAAS,CAAC,QAAQ,CAAC;KACnB,IAAI,EAAE;KACN,UAAU,EAAE;KACZ,MAAM,CAAC;IACN,SAAS,EAAE;QACT,WAAW,EAAE,aAAa;QAC1B,YAAY,EAAE,gBAAgB;KAC/B;CACF,CAAC;KACD,UAAU,CAAC;IACV,EAAE,EAAE,UAAU,EAAE;SACb,GAAG,EAAE;SACL,KAAK,CAAC,YAAY,CAAC;SACnB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzB,UAAU,EAAE,QAAQ,EAAE;SACnB,QAAQ,EAAE;SACV,KAAK,CAAC,YAAY,CAAC;SACnB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzB,UAAU,EAAE,QAAQ,EAAE;SACnB,QAAQ,EAAE;SACV,KAAK,CAAC,WAAW,CAAC;SAClB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzB,IAAI,EAAE,UAAU,EAAE;SACf,QAAQ,EAAE;SACV,KAAK,CAAC,MAAM,CAAC;SACb,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,UAAU,EAAE;SACZ,OAAO,CAAC,EA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