@pd4castr/cli 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -77
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -94,62 +94,6 @@ var inputAggregationSchema = z.object({
94
94
  description: z.string().optional().default(""),
95
95
  colours: z.array(z.string()).optional().default([])
96
96
  });
97
- var performanceMetricsOptionValueEntrySchema = z.object({
98
- label: z.string(),
99
- key: z.string()
100
- });
101
- var performanceMetricsSelectOptionSchema = z.object({
102
- label: z.string(),
103
- key: z.string(),
104
- type: z.literal("select"),
105
- values: z.array(performanceMetricsOptionValueEntrySchema).min(1),
106
- defaultValue: z.string().optional()
107
- });
108
- var performanceMetricsNumberOptionSchema = z.object({
109
- label: z.string(),
110
- key: z.string(),
111
- type: z.literal("number"),
112
- defaultValue: z.number().optional()
113
- });
114
- var performanceMetricsDateOptionSchema = z.object({
115
- label: z.string(),
116
- key: z.string(),
117
- type: z.literal("date"),
118
- defaultValue: z.string().optional(),
119
- maxDate: z.string().optional()
120
- });
121
- var performanceMetricsBooleanOptionSchema = z.object({
122
- label: z.string(),
123
- key: z.string(),
124
- type: z.literal("boolean"),
125
- defaultValue: z.boolean().optional()
126
- });
127
- var performanceMetricsRangeInputOptionSchema = z.discriminatedUnion("type", [
128
- performanceMetricsSelectOptionSchema,
129
- performanceMetricsNumberOptionSchema,
130
- performanceMetricsDateOptionSchema
131
- ]);
132
- var performanceMetricsRangeOptionSchema = z.object({
133
- label: z.string(),
134
- key: z.string(),
135
- type: z.literal("range"),
136
- inputs: z.tuple([
137
- performanceMetricsRangeInputOptionSchema,
138
- performanceMetricsRangeInputOptionSchema
139
- ])
140
- });
141
- var performanceMetricsOptionSchema = z.discriminatedUnion("type", [
142
- performanceMetricsSelectOptionSchema,
143
- performanceMetricsNumberOptionSchema,
144
- performanceMetricsDateOptionSchema,
145
- performanceMetricsBooleanOptionSchema,
146
- performanceMetricsRangeOptionSchema
147
- ]);
148
- var performanceMetricsSchema = z.object({
149
- options: z.array(performanceMetricsOptionSchema).optional().default([]),
150
- comparisonModels: z.record(z.string(), z.string()).optional().default({}),
151
- query: z.string().min(1)
152
- });
153
97
  var CONFIG_WARNING_KEY = "// WARNING: DO NOT MODIFY THESE SYSTEM MANAGED VALUES";
154
98
  var projectConfigSchema = z.object({
155
99
  name: z.string(),
@@ -170,7 +114,6 @@ var projectConfigSchema = z.object({
170
114
  inputAggregations: z.array(inputAggregationSchema).optional().default([]),
171
115
  outputs: z.array(modelOutputSchema),
172
116
  sensitivities: z.array(sensitivitySchema).optional().default([]),
173
- performanceMetrics: performanceMetricsSchema.nullable().optional().default(null),
174
117
  [CONFIG_WARNING_KEY]: z.string().optional().default(""),
175
118
  $$id: z.string().nullable().optional().default(null),
176
119
  $$modelGroupID: z.string().nullable().optional().default(null),
@@ -868,7 +811,6 @@ async function getModelConfigFromProjectConfig(ctx) {
868
811
  const sensitivities = await getSensitivitiesWithInlinedSQL(ctx);
869
812
  const inputAggregations = await getInputAggregationsWithInlinedSQL(ctx);
870
813
  const runDatetimeQuery = await getrunDatetimeQuerySQL(ctx);
871
- const performanceMetrics = await getPerformanceMetricsWithInlinedSQL(ctx);
872
814
  const { $$id, $$modelGroupID, $$revision, $$dockerImage, ...config } = ctx.config;
873
815
  return {
874
816
  ...config,
@@ -879,8 +821,7 @@ async function getModelConfigFromProjectConfig(ctx) {
879
821
  inputs,
880
822
  sensitivities,
881
823
  inputAggregations,
882
- runDatetimeQuery,
883
- performanceMetrics
824
+ runDatetimeQuery
884
825
  };
885
826
  }
886
827
  __name(getModelConfigFromProjectConfig, "getModelConfigFromProjectConfig");
@@ -964,22 +905,6 @@ async function getrunDatetimeQuerySQL(ctx) {
964
905
  }
965
906
  }
966
907
  __name(getrunDatetimeQuerySQL, "getrunDatetimeQuerySQL");
967
- async function getPerformanceMetricsWithInlinedSQL(ctx) {
968
- if (ctx.config.performanceMetrics === null) {
969
- return null;
970
- }
971
- try {
972
- const queryPath = path9.resolve(ctx.projectRoot, ctx.config.performanceMetrics.query);
973
- const sql = await fs8.readFile(queryPath, "utf8");
974
- return {
975
- ...ctx.config.performanceMetrics,
976
- query: sql
977
- };
978
- } catch {
979
- throw new Error(`Performance metrics query file not found (${ctx.config.performanceMetrics.query})`);
980
- }
981
- }
982
- __name(getPerformanceMetricsWithInlinedSQL, "getPerformanceMetricsWithInlinedSQL");
983
908
 
984
909
  // src/utils/log-empty-line.ts
985
910
  function logEmptyLine() {
@@ -1767,7 +1692,7 @@ import { Command } from "commander";
1767
1692
  // package.json
1768
1693
  var package_default = {
1769
1694
  name: "@pd4castr/cli",
1770
- version: "1.7.0",
1695
+ version: "1.8.0",
1771
1696
  description: "CLI tool for creating, testing, and publishing pd4castr models",
1772
1697
  license: "UNLICENSED",
1773
1698
  main: "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pd4castr/cli",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "CLI tool for creating, testing, and publishing pd4castr models",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",