@pd4castr/cli 1.1.0 → 1.2.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 +13 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ var AUTH0_CLIENT_ID = "Q5tQNF57cQlVXnVsqnU0hhgy92rVb03W";
51
51
  var AUTH0_AUDIENCE = "https://api.pd4castr.com.au";
52
52
  var GLOBAL_CONFIG_FILE = ".pd4castr";
53
53
  var PROJECT_CONFIG_FILE = ".pd4castrrc.json";
54
- var DEFAULT_API_URL = "https://pd4castr-api.pipelabs.app";
54
+ var DEFAULT_API_URL = "https://api.v2.pd4castr.com.au";
55
55
  var DEFAULT_INPUT_SOURCE_ID = "0bdfd52b-efaa-455e-9a3b-1a6d2b879b73";
56
56
  var TEST_INPUT_DATA_DIR = "test_input";
57
57
  var TEST_OUTPUT_DATA_DIR = "test_output";
@@ -75,6 +75,14 @@ import { ZodError } from "zod";
75
75
 
76
76
  // src/schemas/project-config-schema.ts
77
77
  import { z } from "zod";
78
+
79
+ // src/utils/is-iana-timezone.ts
80
+ var timezones = /* @__PURE__ */ new Set([...Intl.supportedValuesOf("timeZone"), "UTC"]);
81
+ function isIanaTimeZone(value) {
82
+ return typeof value === "string" && timezones.has(value);
83
+ }
84
+
85
+ // src/schemas/project-config-schema.ts
78
86
  var fileFormatSchema = z.enum(["csv", "json", "parquet"]);
79
87
  var aemoDataFetcherSchema = z.object({
80
88
  type: z.literal("AEMO_MMS"),
@@ -104,6 +112,7 @@ var projectConfigSchema = z.object({
104
112
  name: z.string(),
105
113
  forecastVariable: z.enum(["price"]),
106
114
  timeHorizon: z.enum(["actual", "day_ahead", "week_ahead", "quarterly"]),
115
+ displayTimezone: z.string().refine(isIanaTimeZone, "invalid IANA time zone").optional().default("Australia/Brisbane"),
107
116
  metadata: z.record(z.string(), z.any()).optional(),
108
117
  inputs: z.array(modelInputSchema),
109
118
  outputs: z.array(modelOutputSchema),
@@ -1020,6 +1029,7 @@ async function handleCreateModelFlow(options, app, spinner, ctx, authCtx) {
1020
1029
  config.$$modelGroupID = model.modelGroupId;
1021
1030
  config.$$revision = model.revision;
1022
1031
  config.$$dockerImage = model.dockerImage;
1032
+ config.displayTimezone = model.displayTimezone;
1023
1033
  }, options.config);
1024
1034
  spinner.succeed("Model data published successfully");
1025
1035
  spinner.start(
@@ -1195,6 +1205,7 @@ async function handleModelRevisionUpdateFlow(options, app, spinner, ctx, authCtx
1195
1205
  config.$$modelGroupID = model.modelGroupId;
1196
1206
  config.$$revision = model.revision;
1197
1207
  config.$$dockerImage = model.dockerImage;
1208
+ config.displayTimezone = model.displayTimezone;
1198
1209
  }, options.config);
1199
1210
  spinner.succeed("Model revision data updated successfully");
1200
1211
  spinner.start(
@@ -1404,7 +1415,7 @@ import { Command } from "commander";
1404
1415
  // package.json
1405
1416
  var package_default = {
1406
1417
  name: "@pd4castr/cli",
1407
- version: "1.1.0",
1418
+ version: "1.2.0",
1408
1419
  description: "CLI tool for creating, testing, and publishing pd4castr models",
1409
1420
  main: "dist/index.js",
1410
1421
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pd4castr/cli",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "CLI tool for creating, testing, and publishing pd4castr models",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",