@mxpicture/teslamate-extended-cli 2.1.61 → 3.1.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.
@@ -1,56 +1,38 @@
1
1
  import { Option } from "@commander-js/extra-typings";
2
- import { type FetchOptions, type FetchScope } from "@mxpicture/teslamate-extended-api/api";
3
2
  import { type IStore } from "@mxpicture/teslamate-extended-api/store";
4
3
  /** Reads the CLI package version from its package.json. */
5
4
  export declare const readVersion: () => string;
6
- /** One day in milliseconds — the schedule interval. */
5
+ /** One day in milliseconds — the schedule interval and the cadence clock unit. */
7
6
  export declare const DAY_MS: number;
8
7
  /**
9
- * Match radius (km) for `--charged`: a TeslaMate charge location counts as a
10
- * given Supercharger when it sits within this distance of it. ~300 m comfortably
11
- * covers the gap between where the car parks and the site's listed point while
12
- * staying well under the spacing between distinct sites.
8
+ * Match radius (km) for the outdated-price determination: a TeslaMate charge
9
+ * location maps to a given Supercharger when it sits within this distance of it.
10
+ * ~300 m comfortably covers the gap between where the car parks and the site's
11
+ * listed point while staying well under the spacing between distinct sites.
13
12
  */
14
13
  export declare const CHARGED_MATCH_KM = 0.3;
15
- /** Parses a non-negative float (e.g. --delay). */
14
+ /** Parses a non-negative float (e.g. --delay, --radius). */
16
15
  export declare const parseFloatArg: (v: string) => number;
17
16
  /** Parses a non-negative integer (e.g. --limit). */
18
17
  export declare const parseIntArg: (v: string) => number;
18
+ /** Parses a positive integer number of days (e.g. --*-every, --outdated-age). */
19
+ export declare const parseDaysArg: (v: string) => number;
19
20
  /** Validates an HH:MM (24h) time string (e.g. --at). */
20
21
  export declare const parseTime: (v: string) => string;
21
- /** Parses a "lat,lon" coordinate pair (e.g. --near). */
22
- export declare const parseNear: (v: string) => {
23
- lat: number;
24
- lon: number;
25
- };
26
- /** One schedule tier: fetch within `radiusKm` of home every `everyDays` days. */
27
- export interface Tier {
28
- radiusKm: number;
29
- everyDays: number;
30
- }
31
- /** Collects a repeatable --tier "radiusKm:everyDays" value onto the previous list. */
32
- export declare const parseTier: (v: string, prev: Tier[]) => Tier[];
22
+ /** Commander option: radius (km) around the TeslaMate "Home" geofence. */
23
+ export declare const radiusOption: Option<"-r, --radius <km>", undefined, undefined, number, false, undefined>;
24
+ /** Commander option: cadence (days) for the radius determination. */
25
+ export declare const radiusEveryOption: Option<"--radius-every <days>", undefined, 7, number, false, undefined>;
33
26
  /** Commander option: restrict to a single country. */
34
27
  export declare const countryOption: Option<"-c, --country <name>", undefined, undefined, undefined, false, undefined>;
35
- /** Commander option: restrict to a single region. */
36
- export declare const regionOption: Option<"-R, --region <name>", undefined, undefined, undefined, false, undefined>;
37
- /** Commander option: all Superchargers worldwide. */
38
- export declare const allOption: Option<"-a, --all", undefined, undefined, undefined, false, undefined>;
39
- /** Commander option: center coordinate "lat,lon" for a radius scope. */
40
- export declare const nearOption: Option<"--near <lat,lon>", undefined, undefined, {
41
- lat: number;
42
- lon: number;
43
- }, false, undefined>;
44
- /** Commander option: radius in km around --near. */
45
- export declare const radiusOption: Option<"--radius <km>", undefined, undefined, number, false, undefined>;
46
- /** Commander option (schedule): repeatable tier "radiusKm:everyDays". */
47
- export declare const tierOption: Option<"--tier <km:everyDays>", undefined, Tier[], Tier[], false, undefined>;
48
- /** Commander option: scope = the Superchargers you've charged at (TeslaMate DB). */
49
- export declare const chargedOption: Option<"--charged", undefined, undefined, undefined, false, undefined>;
50
- /** Commander option: center the radius scope on the TeslaMate "Home" geofence. */
51
- export declare const homeFromTeslamateOption: Option<"--home-from-teslamate", undefined, undefined, undefined, false, undefined>;
52
- /** Commander option: also upsert each fetched Supercharger as a TeslaMate geofence. */
53
- export declare const geofencesOption: Option<"--teslamate-geofences", undefined, undefined, undefined, false, undefined>;
28
+ /** Commander option: cadence (days) for the country determination. */
29
+ export declare const countryEveryOption: Option<"--country-every <days>", undefined, 30, number, false, undefined>;
30
+ /** Commander option: enable the missing/outdated-price determination. */
31
+ export declare const outdatedOption: Option<"--outdated", undefined, undefined, undefined, false, undefined>;
32
+ /** Commander option: cadence (days) for the outdated determination. */
33
+ export declare const outdatedEveryOption: Option<"--outdated-every <days>", undefined, 1, number, false, undefined>;
34
+ /** Commander option: age (days) past which a managed geofence's price is "outdated". */
35
+ export declare const outdatedAgeOption: Option<"--outdated-age <days>", undefined, 30, number, false, undefined>;
54
36
  /** Commander option: pricing locale. */
55
37
  export declare const localeOption: Option<"-l, --locale <locale>", undefined, "en-US", undefined, false, undefined>;
56
38
  /** Commander option: politeness delay between requests (seconds). */
@@ -69,27 +51,29 @@ export declare const httpUrlOption: Option<"--http-url <url>", undefined, undefi
69
51
  export declare const httpUserOption: Option<"--http-user <user>", undefined, undefined, undefined, false, undefined>;
70
52
  /** Commander option: Basic-auth password for --http-url. */
71
53
  export declare const httpPasswordOption: Option<"--http-password <password>", undefined, undefined, undefined, false, undefined>;
72
- /** Commander option: daily run time for `schedule` (24h, local). */
73
- export declare const atOption: Option<"-t, --at <HH:MM>", undefined, "03:30", string, false, undefined>;
54
+ /** Commander option: also upsert each fetched Supercharger as a TeslaMate geofence. */
55
+ export declare const geofencesOption: Option<"--teslamate-geofences", undefined, undefined, undefined, false, undefined>;
56
+ /** Commander option: backfill TeslaMate charge costs from the managed geofence prices. */
57
+ export declare const chargesOption: Option<"--teslamate-charges", undefined, undefined, undefined, false, undefined>;
74
58
  /**
75
59
  * Commander option: route tesla.com requests through a proxy. Sets
76
60
  * HTTPS_PROXY/ALL_PROXY for the curl subprocess (which already honors them when
77
61
  * set in the environment). Use this to escape datacenter IPs Akamai 403s.
78
62
  */
79
63
  export declare const proxyOption: Option<"--proxy <url>", undefined, undefined, undefined, false, undefined>;
64
+ /** Commander option: daily run time for `schedule` (24h, local). */
65
+ export declare const atOption: Option<"-t, --at <HH:MM>", undefined, "03:30", string, false, undefined>;
80
66
  /** Options common to `fetch` and `schedule`. */
81
67
  export interface CommonOpts {
82
- country?: string;
83
- region?: string;
84
- all?: boolean;
85
- near?: {
86
- lat: number;
87
- lon: number;
88
- };
89
68
  radius?: number;
90
- charged?: boolean;
91
- homeFromTeslamate?: boolean;
69
+ radiusEvery: number;
70
+ country?: string;
71
+ countryEvery: number;
72
+ outdated?: boolean;
73
+ outdatedEvery: number;
74
+ outdatedAge: number;
92
75
  teslamateGeofences?: boolean;
76
+ teslamateCharges?: boolean;
93
77
  locale: string;
94
78
  delay: number;
95
79
  limit: number;
@@ -101,25 +85,10 @@ export interface CommonOpts {
101
85
  httpPassword?: string;
102
86
  proxy?: string;
103
87
  }
104
- /** `schedule` options: the common ones plus the daily run time and tiers. */
88
+ /** `schedule` options: the common ones plus the daily run time. */
105
89
  export type ScheduleOpts = CommonOpts & {
106
90
  at: string;
107
- tier: Tier[];
108
91
  };
109
- /** Resolves the single scope flag (exactly one of country/region/all/near). */
110
- export declare const toScope: (o: CommonOpts) => FetchScope;
111
- /** The radius center: --near, or the TeslaMate "Home" geofence (--home-from-teslamate). */
112
- export declare const resolveCenter: (o: CommonOpts) => Promise<{
113
- lat: number;
114
- lon: number;
115
- }>;
116
- /**
117
- * Resolves the fetch scope, including the TeslaMate-backed ones. Exactly one of
118
- * --country / --region / --all / --near|--home-from-teslamate / --charged.
119
- */
120
- export declare const resolveFetchScope: (o: CommonOpts) => Promise<FetchScope>;
121
- /** Maps CLI options to the api fetch options, optionally with an explicit scope. */
122
- export declare const toFetchOptions: (o: CommonOpts, scope?: FetchScope) => FetchOptions;
123
92
  /** Builds the sinks the user asked for (CLI flag or env). At least one required. */
124
93
  export declare const buildStores: (o: CommonOpts) => IStore[];
125
94
  /**
@@ -128,21 +97,36 @@ export declare const buildStores: (o: CommonOpts) => IStore[];
128
97
  * env the process already has is left untouched.
129
98
  */
130
99
  export declare const applyProxy: (o: CommonOpts) => void;
131
- /** Fetches one snapshot, stores it, and closes the sinks. */
132
- export declare const runOnce: (o: CommonOpts, scope?: FetchScope) => Promise<void>;
133
- /** `fetch` command: resolve the (possibly TeslaMate-backed) scope, then run once. */
100
+ /** A Supercharger-selection method and how often (in days) it runs. */
101
+ export type DeterminationKind = "radius" | "country" | "outdated";
102
+ /** One enabled determination with its day-based cadence. */
103
+ export interface Determination {
104
+ kind: DeterminationKind;
105
+ everyDays: number;
106
+ }
107
+ /** The determinations the user enabled (at least one is required). */
108
+ export declare const buildDeterminations: (o: CommonOpts) => Determination[];
109
+ /**
110
+ * True when a determination with this cadence is due on `date`. Cadence is
111
+ * date-driven — `epochDay % everyDays === 0`, where epochDay is whole days since
112
+ * the Unix epoch (UTC) — so it survives restarts, with `7` landing on a fixed
113
+ * weekday and `30` meaning every 30 days.
114
+ */
115
+ export declare const isDue: (everyDays: number, date: Date) => boolean;
116
+ /** The subset of `dets` whose cadence is due on `date`. */
117
+ export declare const dueDeterminations: (dets: Determination[], date: Date) => Determination[];
118
+ /**
119
+ * Run the given determinations as ONE snapshot: take the union of their target
120
+ * Superchargers (selected from the cached master list), fetch each site's pricing
121
+ * once, then fan the records out to the configured sinks. The union + de-dupe is
122
+ * what keeps requests down — a site several determinations want is fetched once.
123
+ */
124
+ export declare const runDeterminations: (o: CommonOpts, dets: Determination[]) => Promise<void>;
125
+ /** `fetch` command: run every enabled determination once (ignoring cadence), then exit. */
134
126
  export declare const runFetch: (o: CommonOpts) => Promise<void>;
135
127
  /** ms from now until the next HH:MM (local); rolls to tomorrow if already passed. */
136
128
  export declare const msUntil: (at: string) => number;
137
- /**
138
- * The largest tier radius whose cadence is due on `date`, or null if none is.
139
- * A tier is "due" when `epochDay % everyDays === 0` (epochDay = whole days since
140
- * the Unix epoch, UTC) — date-driven so it survives restarts, with `7` landing on
141
- * a fixed weekday and `30` meaning every 30 days. Cumulative: the chosen radius
142
- * already covers every smaller tier, so one fetch at it satisfies all due tiers.
143
- */
144
- export declare const dueRadiusKm: (tiers: Tier[], date: Date) => number | null;
145
- /** Runs once on start, then every day at o.at — keeping the process alive. */
129
+ /** Runs the due determinations on start, then every day at o.at — keeping the process alive. */
146
130
  export declare const scheduleDaily: (o: ScheduleOpts) => Promise<void>;
147
131
  /** Prints the countries and regions that have Superchargers. */
148
132
  export declare const listCountries: () => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"cli.common.d.ts","sourceRoot":"","sources":["../src/cli.common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAK3E,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAML,KAAK,MAAM,EACZ,MAAM,yCAAyC,CAAC;AAIjD,2DAA2D;AAC3D,eAAO,MAAM,WAAW,QAAO,MAET,CAAC;AAEvB,uDAAuD;AACvD,eAAO,MAAM,MAAM,QAAsB,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAIpC,kDAAkD;AAClD,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,KAAG,MAKzC,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,KAAG,MAKvC,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,MAIrC,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAQ/D,CAAC;AAEF,iFAAiF;AACjF,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,sFAAsF;AACtF,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,EAAE,MAAM,IAAI,EAAE,KAAG,IAAI,EASvD,CAAC;AAIF,sDAAsD;AACtD,eAAO,MAAM,aAAa,mFAGzB,CAAC;AACF,qDAAqD;AACrD,eAAO,MAAM,YAAY,kFAGxB,CAAC;AACF,qDAAqD;AACrD,eAAO,MAAM,SAAS,wEAAyD,CAAC;AAChF,wEA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EAAE,KACpB,OAAO,CAAC,IAAI,CA+Cd,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,QAAQ,GAAU,GAAG,UAAU,KAAG,OAAO,CAAC,IAAI,CAE1D,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,KAAG,MAOpC,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,aAAa,GAAU,GAAG,YAAY,KAAG,OAAO,CAAC,IAAI,CA8BjE,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,aAAa,QAAa,OAAO,CAAC,IAAI,CAclD,CAAC"}
@@ -3,23 +3,23 @@ import { readFileSync } from "node:fs";
3
3
  import { dirname, resolve } from "node:path";
4
4
  import { env, exit } from "node:process";
5
5
  import { fileURLToPath } from "node:url";
6
- import { fetchAllLocations, fetchChargeSiteCoords, fetchHomeGeofence, isSupercharger, } from "@mxpicture/teslamate-extended-api/api";
7
- import { HttpStore, ingestSuperchargers, JsonFileStore, PostgresStore, TeslaMateGeofenceStore, } from "@mxpicture/teslamate-extended-api/store";
6
+ import { fetchAllLocations, fetchHomeGeofence, fetchOutdatedChargeSites, fetchRecordsForLocations, inScope, isSupercharger, } from "@mxpicture/teslamate-extended-api/api";
7
+ import { HttpStore, ingestRecords, JsonFileStore, PostgresStore, TeslaMateChargeStore, TeslaMateGeofenceStore, } from "@mxpicture/teslamate-extended-api/store";
8
8
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
9
  /** Reads the CLI package version from its package.json. */
10
10
  export const readVersion = () => JSON.parse(readFileSync(resolve(__dirname, "../package.json"), "utf8"))
11
11
  .version;
12
- /** One day in milliseconds — the schedule interval. */
12
+ /** One day in milliseconds — the schedule interval and the cadence clock unit. */
13
13
  export const DAY_MS = 24 * 60 * 60 * 1000;
14
14
  /**
15
- * Match radius (km) for `--charged`: a TeslaMate charge location counts as a
16
- * given Supercharger when it sits within this distance of it. ~300 m comfortably
17
- * covers the gap between where the car parks and the site's listed point while
18
- * staying well under the spacing between distinct sites.
15
+ * Match radius (km) for the outdated-price determination: a TeslaMate charge
16
+ * location maps to a given Supercharger when it sits within this distance of it.
17
+ * ~300 m comfortably covers the gap between where the car parks and the site's
18
+ * listed point while staying well under the spacing between distinct sites.
19
19
  */
20
20
  export const CHARGED_MATCH_KM = 0.3;
21
21
  // ---------- argument parsers ----------
22
- /** Parses a non-negative float (e.g. --delay). */
22
+ /** Parses a non-negative float (e.g. --delay, --radius). */
23
23
  export const parseFloatArg = (v) => {
24
24
  const n = Number(v);
25
25
  if (!Number.isFinite(n) || n < 0)
@@ -33,54 +33,46 @@ export const parseIntArg = (v) => {
33
33
  throw new InvalidArgumentError("must be a non-negative integer");
34
34
  return n;
35
35
  };
36
+ /** Parses a positive integer number of days (e.g. --*-every, --outdated-age). */
37
+ export const parseDaysArg = (v) => {
38
+ const n = parseInt(v, 10);
39
+ if (!Number.isInteger(n) || n < 1)
40
+ throw new InvalidArgumentError("must be a positive integer (>= 1)");
41
+ return n;
42
+ };
36
43
  /** Validates an HH:MM (24h) time string (e.g. --at). */
37
44
  export const parseTime = (v) => {
38
45
  if (!/^([01]\d|2[0-3]):[0-5]\d$/.test(v))
39
46
  throw new InvalidArgumentError("expected HH:MM (24h)");
40
47
  return v;
41
48
  };
42
- /** Parses a "lat,lon" coordinate pair (e.g. --near). */
43
- export const parseNear = (v) => {
44
- const parts = v.split(",").map((s) => Number(s.trim()));
45
- if (parts.length !== 2 || !parts.every((n) => Number.isFinite(n)))
46
- throw new InvalidArgumentError("expected 'lat,lon' (e.g. 48.137,11.575)");
47
- const [lat, lon] = parts;
48
- if (lat < -90 || lat > 90 || lon < -180 || lon > 180)
49
- throw new InvalidArgumentError("lat must be -90..90 and lon -180..180");
50
- return { lat, lon };
51
- };
52
- /** Collects a repeatable --tier "radiusKm:everyDays" value onto the previous list. */
53
- export const parseTier = (v, prev) => {
54
- const [kmStr, daysStr] = v.split(":");
55
- const radiusKm = Number(kmStr);
56
- const everyDays = parseInt(daysStr ?? "", 10);
57
- if (!Number.isFinite(radiusKm) || radiusKm <= 0)
58
- throw new InvalidArgumentError("radius (km) must be a positive number");
59
- if (!Number.isInteger(everyDays) || everyDays <= 0)
60
- throw new InvalidArgumentError("everyDays must be a positive integer");
61
- return [...prev, { radiusKm, everyDays }];
62
- };
63
49
  // ---------- commander options ----------
50
+ // --- determination: radius from the TeslaMate Home geofence ---
51
+ /** Commander option: radius (km) around the TeslaMate "Home" geofence. */
52
+ export const radiusOption = new Option("-r, --radius <km>", "Determination: fetch Superchargers within this many km of the TeslaMate 'Home' geofence").argParser(parseFloatArg);
53
+ /** Commander option: cadence (days) for the radius determination. */
54
+ export const radiusEveryOption = new Option("--radius-every <days>", "Run the radius determination every N days")
55
+ .default(7)
56
+ .argParser(parseDaysArg);
57
+ // --- determination: by country ---
64
58
  /** Commander option: restrict to a single country. */
65
- export const countryOption = new Option("-c, --country <name>", "Only this country");
66
- /** Commander option: restrict to a single region. */
67
- export const regionOption = new Option("-R, --region <name>", "Only this region");
68
- /** Commander option: all Superchargers worldwide. */
69
- export const allOption = new Option("-a, --all", "All Superchargers worldwide");
70
- /** Commander option: center coordinate "lat,lon" for a radius scope. */
71
- export const nearOption = new Option("--near <lat,lon>", "Center coordinate for a radius scope, e.g. 48.137,11.575").argParser(parseNear);
72
- /** Commander option: radius in km around --near. */
73
- export const radiusOption = new Option("--radius <km>", "Radius in km around --near").argParser(parseFloatArg);
74
- /** Commander option (schedule): repeatable tier "radiusKm:everyDays". */
75
- export const tierOption = new Option("--tier <km:everyDays>", "Schedule tier 'radiusKm:everyDays' (repeatable); fetch within radiusKm every everyDays days")
76
- .default([])
77
- .argParser(parseTier);
78
- /** Commander option: scope = the Superchargers you've charged at (TeslaMate DB). */
79
- export const chargedOption = new Option("--charged", "Only Superchargers you've charged at (read from the TeslaMate DB); needs --postgres-url");
80
- /** Commander option: center the radius scope on the TeslaMate "Home" geofence. */
81
- export const homeFromTeslamateOption = new Option("--home-from-teslamate", "Center --near/--tier on the TeslaMate 'Home' geofence instead of a coordinate; needs --postgres-url");
82
- /** Commander option: also upsert each fetched Supercharger as a TeslaMate geofence. */
83
- export const geofencesOption = new Option("--teslamate-geofences", "Also upsert each fetched Supercharger as a TeslaMate geofence (name + price); needs --postgres-url");
59
+ export const countryOption = new Option("-c, --country <name>", "Determination: fetch Superchargers in this country");
60
+ /** Commander option: cadence (days) for the country determination. */
61
+ export const countryEveryOption = new Option("--country-every <days>", "Run the country determination every N days")
62
+ .default(30)
63
+ .argParser(parseDaysArg);
64
+ // --- determination: missing/outdated price ---
65
+ /** Commander option: enable the missing/outdated-price determination. */
66
+ export const outdatedOption = new Option("--outdated", "Determination: fetch Superchargers whose TeslaMate price is missing or outdated; needs --postgres-url");
67
+ /** Commander option: cadence (days) for the outdated determination. */
68
+ export const outdatedEveryOption = new Option("--outdated-every <days>", "Run the outdated-price determination every N days")
69
+ .default(1)
70
+ .argParser(parseDaysArg);
71
+ /** Commander option: age (days) past which a managed geofence's price is "outdated". */
72
+ export const outdatedAgeOption = new Option("--outdated-age <days>", "A managed geofence's price counts as outdated once older than this many days")
73
+ .default(30)
74
+ .argParser(parseDaysArg);
75
+ // --- pricing / pacing ---
84
76
  /** Commander option: pricing locale. */
85
77
  export const localeOption = new Option("-l, --locale <locale>", "Locale for pricing").default("en-US");
86
78
  /** Commander option: politeness delay between requests (seconds). */
@@ -91,6 +83,7 @@ export const delayOption = new Option("-d, --delay <seconds>", "Delay between re
91
83
  export const limitOption = new Option("-n, --limit <count>", "Cap number of sites")
92
84
  .default(0)
93
85
  .argParser(parseIntArg);
86
+ // --- sinks ---
94
87
  /** Commander option: JSON snapshot output directory. */
95
88
  export const outOption = new Option("-o, --out <dir>", "Write JSON snapshots to this directory (env SUPERCHARGERS_OUT_DIR)");
96
89
  /** Commander option: Postgres connection URL. */
@@ -103,37 +96,21 @@ export const httpUrlOption = new Option("--http-url <url>", "Push snapshots to t
103
96
  export const httpUserOption = new Option("--http-user <user>", "Basic-auth username for --http-url (env SUPERCHARGERS_HTTP_USER)");
104
97
  /** Commander option: Basic-auth password for --http-url. */
105
98
  export const httpPasswordOption = new Option("--http-password <password>", "Basic-auth password for --http-url (env SUPERCHARGERS_HTTP_PASSWORD)");
106
- /** Commander option: daily run time for `schedule` (24h, local). */
107
- export const atOption = new Option("-t, --at <HH:MM>", "Daily run time (24h, local)")
108
- .default("03:30")
109
- .argParser(parseTime);
99
+ /** Commander option: also upsert each fetched Supercharger as a TeslaMate geofence. */
100
+ export const geofencesOption = new Option("--teslamate-geofences", "Upsert each fetched Supercharger as a TeslaMate geofence (name + price); needs --postgres-url");
101
+ /** Commander option: backfill TeslaMate charge costs from the managed geofence prices. */
102
+ export const chargesOption = new Option("--teslamate-charges", "Backfill TeslaMate charge costs from the managed geofence prices (implies --teslamate-geofences); needs --postgres-url");
103
+ // --- transport / scheduling ---
110
104
  /**
111
105
  * Commander option: route tesla.com requests through a proxy. Sets
112
106
  * HTTPS_PROXY/ALL_PROXY for the curl subprocess (which already honors them when
113
107
  * set in the environment). Use this to escape datacenter IPs Akamai 403s.
114
108
  */
115
109
  export const proxyOption = new Option("--proxy <url>", "Route requests through this proxy (env HTTPS_PROXY / ALL_PROXY also honored)");
116
- /** Resolves the single scope flag (exactly one of country/region/all/near). */
117
- export const toScope = (o) => {
118
- const picked = [
119
- o.country,
120
- o.region,
121
- o.all ? "all" : undefined,
122
- o.near ? "near" : undefined,
123
- ].filter(Boolean);
124
- if (picked.length !== 1) {
125
- console.error("Pick exactly one scope: --country | --region | --all | --near.");
126
- exit(1);
127
- }
128
- if (o.near) {
129
- if (o.radius === undefined) {
130
- console.error("--near requires --radius <km>.");
131
- exit(1);
132
- }
133
- return { near: { lat: o.near.lat, lon: o.near.lon, radiusKm: o.radius } };
134
- }
135
- return { country: o.country, region: o.region, all: o.all };
136
- };
110
+ /** Commander option: daily run time for `schedule` (24h, local). */
111
+ export const atOption = new Option("-t, --at <HH:MM>", "Daily run time (24h, local)")
112
+ .default("03:30")
113
+ .argParser(parseTime);
137
114
  /** pgUrl from --postgres-url or env; errors out when a flag needs it and it's absent. */
138
115
  const requirePgUrl = (o, flag) => {
139
116
  const pgUrl = o.postgresUrl ?? env.SUPERCHARGERS_PG_URL;
@@ -143,64 +120,8 @@ const requirePgUrl = (o, flag) => {
143
120
  }
144
121
  return pgUrl;
145
122
  };
146
- /** The radius center: --near, or the TeslaMate "Home" geofence (--home-from-teslamate). */
147
- export const resolveCenter = async (o) => {
148
- if (o.near && o.homeFromTeslamate) {
149
- console.error("Pass either --near or --home-from-teslamate, not both.");
150
- exit(1);
151
- }
152
- if (o.near)
153
- return o.near;
154
- const home = await fetchHomeGeofence(requirePgUrl(o, "--home-from-teslamate"));
155
- if (!home) {
156
- console.error("No TeslaMate 'Home' geofence found (name ILIKE 'home').");
157
- exit(1);
158
- }
159
- console.log(`Home geofence center: ${home.lat},${home.lon}.`);
160
- return home;
161
- };
162
- /**
163
- * Resolves the fetch scope, including the TeslaMate-backed ones. Exactly one of
164
- * --country / --region / --all / --near|--home-from-teslamate / --charged.
165
- */
166
- export const resolveFetchScope = async (o) => {
167
- const nearScope = o.near || o.homeFromTeslamate;
168
- const picked = [
169
- o.country,
170
- o.region,
171
- o.all ? "all" : undefined,
172
- nearScope ? "near" : undefined,
173
- o.charged ? "charged" : undefined,
174
- ].filter(Boolean);
175
- if (picked.length !== 1) {
176
- console.error("Pick exactly one scope: --country | --region | --all | --near | --home-from-teslamate | --charged.");
177
- exit(1);
178
- }
179
- if (o.charged) {
180
- const points = await fetchChargeSiteCoords(requirePgUrl(o, "--charged"));
181
- console.log(`Found ${points.length} charge locations in TeslaMate.`);
182
- return { nearAny: { points, radiusKm: CHARGED_MATCH_KM } };
183
- }
184
- if (nearScope) {
185
- if (o.radius === undefined) {
186
- console.error("--near/--home-from-teslamate requires --radius <km>.");
187
- exit(1);
188
- }
189
- const c = await resolveCenter(o);
190
- return { near: { lat: c.lat, lon: c.lon, radiusKm: o.radius } };
191
- }
192
- return { country: o.country, region: o.region, all: o.all };
193
- };
194
- /** Maps CLI options to the api fetch options, optionally with an explicit scope. */
195
- export const toFetchOptions = (o, scope) => {
196
- return {
197
- scope: scope ?? toScope(o),
198
- locale: o.locale,
199
- delayMs: o.delay * 1000,
200
- limit: o.limit,
201
- logger: (m) => console.log(m),
202
- };
203
- };
123
+ /** Directory the ~30 MB /all-locations download is cached in (so it's read monthly). */
124
+ const cacheDir = (o) => env.SUPERCHARGERS_CACHE_DIR ?? o.out ?? env.SUPERCHARGERS_OUT_DIR;
204
125
  /** Builds the sinks the user asked for (CLI flag or env). At least one required. */
205
126
  export const buildStores = (o) => {
206
127
  const stores = [];
@@ -217,14 +138,20 @@ export const buildStores = (o) => {
217
138
  username: o.httpUser ?? env.SUPERCHARGERS_HTTP_USER,
218
139
  password: o.httpPassword ?? env.SUPERCHARGERS_HTTP_PASSWORD,
219
140
  }));
220
- if (o.teslamateGeofences)
141
+ // --teslamate-charges costs charges from the managed geofence prices, so it
142
+ // implies --teslamate-geofences; the geofence store must also run first.
143
+ if (o.teslamateGeofences || o.teslamateCharges)
221
144
  stores.push(new TeslaMateGeofenceStore({
222
145
  connectionString: requirePgUrl(o, "--teslamate-geofences"),
223
146
  }));
147
+ if (o.teslamateCharges)
148
+ stores.push(new TeslaMateChargeStore({
149
+ connectionString: requirePgUrl(o, "--teslamate-charges"),
150
+ }));
224
151
  if (stores.length === 0) {
225
- console.error("No output configured. Pass --out <dir>, --postgres-url <url>, and/or " +
226
- "--http-url <url> (or set SUPERCHARGERS_OUT_DIR / SUPERCHARGERS_PG_URL " +
227
- "/ SUPERCHARGERS_HTTP_URL).");
152
+ console.error("No output configured. Pass --out <dir>, --postgres-url <url>, " +
153
+ "--http-url <url>, --teslamate-geofences and/or --teslamate-charges " +
154
+ "(or set SUPERCHARGERS_OUT_DIR / SUPERCHARGERS_PG_URL / SUPERCHARGERS_HTTP_URL).");
228
155
  exit(1);
229
156
  }
230
157
  return stores;
@@ -240,13 +167,105 @@ export const applyProxy = (o) => {
240
167
  env.HTTPS_PROXY = o.proxy;
241
168
  env.ALL_PROXY = o.proxy;
242
169
  };
243
- /** Fetches one snapshot, stores it, and closes the sinks. */
244
- export const runOnce = async (o, scope) => {
170
+ /** The determinations the user enabled (at least one is required). */
171
+ export const buildDeterminations = (o) => {
172
+ const dets = [];
173
+ if (o.radius !== undefined)
174
+ dets.push({ kind: "radius", everyDays: o.radiusEvery });
175
+ if (o.country)
176
+ dets.push({ kind: "country", everyDays: o.countryEvery });
177
+ if (o.outdated)
178
+ dets.push({ kind: "outdated", everyDays: o.outdatedEvery });
179
+ if (dets.length === 0) {
180
+ console.error("Enable at least one determination: --radius <km>, --country <name>, and/or --outdated.");
181
+ exit(1);
182
+ }
183
+ return dets;
184
+ };
185
+ /**
186
+ * True when a determination with this cadence is due on `date`. Cadence is
187
+ * date-driven — `epochDay % everyDays === 0`, where epochDay is whole days since
188
+ * the Unix epoch (UTC) — so it survives restarts, with `7` landing on a fixed
189
+ * weekday and `30` meaning every 30 days.
190
+ */
191
+ export const isDue = (everyDays, date) => Math.floor(date.getTime() / DAY_MS) % everyDays === 0;
192
+ /** The subset of `dets` whose cadence is due on `date`. */
193
+ export const dueDeterminations = (dets, date) => dets.filter((d) => isDue(d.everyDays, date));
194
+ /**
195
+ * The fetch scope for one determination, or null to skip it this run:
196
+ * - radius: centered on the TeslaMate "Home" geofence; skipped with a warning
197
+ * when no Home geofence exists (radius-based selection is ignored).
198
+ * - country: a plain country match.
199
+ * - outdated: the charge sites whose managed price is missing/outdated, matched
200
+ * to Superchargers (skipped when there are none).
201
+ */
202
+ const scopeForDetermination = async (det, o) => {
203
+ if (det.kind === "country")
204
+ return { country: o.country };
205
+ if (det.kind === "radius") {
206
+ if (o.radius === undefined)
207
+ return null;
208
+ const home = await fetchHomeGeofence(requirePgUrl(o, "--radius"));
209
+ if (!home) {
210
+ console.warn("No TeslaMate 'Home' geofence found (name ILIKE 'home'); skipping the radius determination.");
211
+ return null;
212
+ }
213
+ console.log(`Home geofence center: ${home.lat},${home.lon}.`);
214
+ return { near: { lat: home.lat, lon: home.lon, radiusKm: o.radius } };
215
+ }
216
+ // outdated
217
+ const sites = await fetchOutdatedChargeSites(requirePgUrl(o, "--outdated"), {
218
+ outdatedAgeDays: o.outdatedAge,
219
+ });
220
+ console.log(`Found ${sites.length} charge sites with missing/outdated pricing.`);
221
+ if (sites.length === 0)
222
+ return null;
223
+ return { nearAny: { points: sites, radiusKm: CHARGED_MATCH_KM } };
224
+ };
225
+ /**
226
+ * Run the given determinations as ONE snapshot: take the union of their target
227
+ * Superchargers (selected from the cached master list), fetch each site's pricing
228
+ * once, then fan the records out to the configured sinks. The union + de-dupe is
229
+ * what keeps requests down — a site several determinations want is fetched once.
230
+ */
231
+ export const runDeterminations = async (o, dets) => {
245
232
  applyProxy(o);
246
- const fetchOpts = toFetchOptions(o, scope);
233
+ // Build (and thereby validate) the sinks up front — before the expensive
234
+ // fetch — so a misconfigured run fails fast instead of after downloading
235
+ // everything; the `finally` always closes them.
247
236
  const stores = buildStores(o);
237
+ const logger = (m) => console.log(m);
248
238
  try {
249
- const res = await ingestSuperchargers(fetchOpts, stores);
239
+ const dir = cacheDir(o);
240
+ const all = (await fetchAllLocations(logger, dir ? { cacheDir: dir } : undefined)).filter(isSupercharger);
241
+ logger(` -> ${all.length} are Superchargers.`);
242
+ const targets = new Map();
243
+ for (const det of dets) {
244
+ const scope = await scopeForDetermination(det, o);
245
+ if (!scope)
246
+ continue;
247
+ let n = 0;
248
+ for (const loc of all) {
249
+ if (!inScope(loc, scope))
250
+ continue;
251
+ targets.set(loc.location_id ?? `${loc.latitude},${loc.longitude}`, loc);
252
+ n++;
253
+ }
254
+ logger(`Determination '${det.kind}': ${n} Superchargers.`);
255
+ }
256
+ let list = [...targets.values()];
257
+ if (o.limit)
258
+ list = list.slice(0, o.limit);
259
+ if (list.length === 0) {
260
+ logger("No Superchargers to fetch; nothing to do.");
261
+ return;
262
+ }
263
+ const records = await fetchRecordsForLocations(list, {
264
+ locale: o.locale,
265
+ delayMs: o.delay * 1000,
266
+ logger,
267
+ });
268
+ const res = await ingestRecords(records, stores);
250
269
  console.log(`Saved ${res.count} Superchargers (run ${res.runId}, ` +
251
270
  `${res.fetchedAt.toISOString()}).`);
252
271
  }
@@ -255,9 +274,9 @@ export const runOnce = async (o, scope) => {
255
274
  await s.close?.();
256
275
  }
257
276
  };
258
- /** `fetch` command: resolve the (possibly TeslaMate-backed) scope, then run once. */
277
+ /** `fetch` command: run every enabled determination once (ignoring cadence), then exit. */
259
278
  export const runFetch = async (o) => {
260
- await runOnce(o, await resolveFetchScope(o));
279
+ await runDeterminations(o, buildDeterminations(o));
261
280
  };
262
281
  /** ms from now until the next HH:MM (local); rolls to tomorrow if already passed. */
263
282
  export const msUntil = (at) => {
@@ -269,47 +288,18 @@ export const msUntil = (at) => {
269
288
  next.setTime(next.getTime() + DAY_MS);
270
289
  return next.getTime() - now.getTime();
271
290
  };
272
- /**
273
- * The largest tier radius whose cadence is due on `date`, or null if none is.
274
- * A tier is "due" when `epochDay % everyDays === 0` (epochDay = whole days since
275
- * the Unix epoch, UTC) — date-driven so it survives restarts, with `7` landing on
276
- * a fixed weekday and `30` meaning every 30 days. Cumulative: the chosen radius
277
- * already covers every smaller tier, so one fetch at it satisfies all due tiers.
278
- */
279
- export const dueRadiusKm = (tiers, date) => {
280
- const epochDay = Math.floor(date.getTime() / DAY_MS);
281
- const due = tiers.filter((t) => epochDay % t.everyDays === 0);
282
- if (due.length === 0)
283
- return null;
284
- return Math.max(...due.map((t) => t.radiusKm));
285
- };
286
- /** Runs once on start, then every day at o.at — keeping the process alive. */
291
+ /** Runs the due determinations on start, then every day at o.at — keeping the process alive. */
287
292
  export const scheduleDaily = async (o) => {
288
- const tiers = o.tier;
289
- if (tiers.length > 0 && !o.near && !o.homeFromTeslamate) {
290
- console.error("--tier requires --near <lat,lon> or --home-from-teslamate.");
291
- exit(1);
292
- }
293
- // Resolve the tier center once (a coordinate, or the TeslaMate "Home" geofence).
294
- const center = tiers.length > 0 ? await resolveCenter(o) : undefined;
293
+ const dets = buildDeterminations(o);
295
294
  const safeRun = async () => {
295
+ const due = dueDeterminations(dets, new Date());
296
+ if (due.length === 0) {
297
+ console.log("No determination due today; skipping run.");
298
+ return;
299
+ }
300
+ console.log(`Determinations due today: ${due.map((d) => d.kind).join(", ")}.`);
296
301
  try {
297
- if (tiers.length > 0 && center) {
298
- const radiusKm = dueRadiusKm(tiers, new Date());
299
- if (radiusKm === null) {
300
- console.log("No tier due today; skipping run.");
301
- return;
302
- }
303
- console.log(`Tier due: fetching within ${radiusKm} km of ${center.lat},${center.lon}.`);
304
- await runOnce(o, {
305
- near: { lat: center.lat, lon: center.lon, radiusKm },
306
- });
307
- }
308
- else {
309
- // No tiers: country/region/all, --near, --home-from-teslamate, or --charged
310
- // (re-resolved each fire so new charge locations are picked up over time).
311
- await runOnce(o, await resolveFetchScope(o));
312
- }
302
+ await runDeterminations(o, due);
313
303
  }
314
304
  catch (e) {
315
305
  console.error("Run failed:", e instanceof Error ? e.message : e);
@@ -328,7 +318,8 @@ export const scheduleDaily = async (o) => {
328
318
  };
329
319
  /** Prints the countries and regions that have Superchargers. */
330
320
  export const listCountries = async () => {
331
- const locations = (await fetchAllLocations()).filter(isSupercharger);
321
+ const dir = env.SUPERCHARGERS_CACHE_DIR ?? env.SUPERCHARGERS_OUT_DIR;
322
+ const locations = (await fetchAllLocations(undefined, dir ? { cacheDir: dir } : undefined)).filter(isSupercharger);
332
323
  const countries = [
333
324
  ...new Set(locations.map((l) => l.country).filter(Boolean)),
334
325
  ].sort();
@@ -1 +1 @@
1
- {"version":3,"file":"cli.common.js","sourceRoot":"","sources":["../src/cli.common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,M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,MAAM,CAAC,OAAO,CAAC,CAAC;KAC5D,CAAC,IAAI,EAAE,CAAC;IACT,MAAM,OAAO,GAAG;QACd,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;KAC3D,CAAC,IAAI,EAAE,CAAC;IACT,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC5B,KAAK,MAAM,CAAC,IAAI,SAAS;QAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -2,17 +2,23 @@
2
2
  /**
3
3
  * teslamate-superchargers
4
4
  * =======================
5
- * Fetch all Tesla Supercharger locations + pricing (via the public tesla.com
5
+ * Fetch Tesla Supercharger locations + pricing (via the public tesla.com
6
6
  * endpoints, see `@mxpicture/teslamate-extended-api`) and persist each run as a
7
- * dated snapshot — to JSON files and/or PostgreSQL. Because every run is stored
8
- * under its own timestamp, repeated runs build a price history.
7
+ * dated snapshot — to JSON files, PostgreSQL and/or TeslaMate. Because every run
8
+ * is stored under its own timestamp, repeated runs build a price history.
9
9
  *
10
- * teslamate-superchargers fetch --all --out ./data --postgres-url "$PG_URL"
11
- * teslamate-superchargers schedule --all --postgres-url "$PG_URL" --at 03:30
10
+ * Which Superchargers to fetch is chosen by one or more "determinations", each
11
+ * with its own day-based cadence:
12
+ * --radius <km> within km of the TeslaMate "Home" geofence (--radius-every)
13
+ * --country <name> every Supercharger in a country (--country-every)
14
+ * --outdated sites whose TeslaMate price is missing/old (--outdated-every)
15
+ *
16
+ * teslamate-superchargers fetch --country Germany --out ./data
17
+ * teslamate-superchargers schedule --radius 100 --outdated --postgres-url "$PG_URL"
12
18
  * teslamate-superchargers list-countries
13
19
  *
14
- * The `schedule` command runs once on start and then daily at --at, keeping the
15
- * process alive — so a single container is enough to refresh the data every day.
20
+ * The `schedule` command runs the due determinations on start and then daily at
21
+ * --at, keeping the process alive — so a single container refreshes the data.
16
22
  */
17
23
  export {};
18
24
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;GAoBG"}
package/dist/cli.js CHANGED
@@ -2,36 +2,43 @@
2
2
  /**
3
3
  * teslamate-superchargers
4
4
  * =======================
5
- * Fetch all Tesla Supercharger locations + pricing (via the public tesla.com
5
+ * Fetch Tesla Supercharger locations + pricing (via the public tesla.com
6
6
  * endpoints, see `@mxpicture/teslamate-extended-api`) and persist each run as a
7
- * dated snapshot — to JSON files and/or PostgreSQL. Because every run is stored
8
- * under its own timestamp, repeated runs build a price history.
7
+ * dated snapshot — to JSON files, PostgreSQL and/or TeslaMate. Because every run
8
+ * is stored under its own timestamp, repeated runs build a price history.
9
9
  *
10
- * teslamate-superchargers fetch --all --out ./data --postgres-url "$PG_URL"
11
- * teslamate-superchargers schedule --all --postgres-url "$PG_URL" --at 03:30
10
+ * Which Superchargers to fetch is chosen by one or more "determinations", each
11
+ * with its own day-based cadence:
12
+ * --radius <km> within km of the TeslaMate "Home" geofence (--radius-every)
13
+ * --country <name> every Supercharger in a country (--country-every)
14
+ * --outdated sites whose TeslaMate price is missing/old (--outdated-every)
15
+ *
16
+ * teslamate-superchargers fetch --country Germany --out ./data
17
+ * teslamate-superchargers schedule --radius 100 --outdated --postgres-url "$PG_URL"
12
18
  * teslamate-superchargers list-countries
13
19
  *
14
- * The `schedule` command runs once on start and then daily at --at, keeping the
15
- * process alive — so a single container is enough to refresh the data every day.
20
+ * The `schedule` command runs the due determinations on start and then daily at
21
+ * --at, keeping the process alive — so a single container refreshes the data.
16
22
  */
17
23
  import { program } from "@commander-js/extra-typings";
18
24
  import { argv, exit } from "node:process";
19
- import { allOption, atOption, chargedOption, countryOption, delayOption, geofencesOption, homeFromTeslamateOption, httpPasswordOption, httpUrlOption, httpUserOption, limitOption, listCountries, localeOption, nearOption, outOption, pgTableOption, postgresUrlOption, proxyOption, radiusOption, readVersion, regionOption, runFetch, scheduleDaily, tierOption, } from "./cli.common.js";
25
+ import { atOption, chargesOption, countryEveryOption, countryOption, delayOption, geofencesOption, httpPasswordOption, httpUrlOption, httpUserOption, limitOption, listCountries, localeOption, outdatedAgeOption, outdatedEveryOption, outdatedOption, outOption, pgTableOption, postgresUrlOption, proxyOption, radiusEveryOption, radiusOption, readVersion, runFetch, scheduleDaily, } from "./cli.common.js";
20
26
  program
21
27
  .name("teslamate-superchargers")
22
28
  .version(readVersion())
23
29
  .description("Fetch + store Tesla Supercharger locations and pricing");
24
30
  program
25
31
  .command("fetch")
26
- .description("Fetch one snapshot and store it, then exit")
27
- .addOption(countryOption)
28
- .addOption(regionOption)
29
- .addOption(allOption)
30
- .addOption(nearOption)
32
+ .description("Run every enabled determination once and store it, then exit")
31
33
  .addOption(radiusOption)
32
- .addOption(chargedOption)
33
- .addOption(homeFromTeslamateOption)
34
+ .addOption(radiusEveryOption)
35
+ .addOption(countryOption)
36
+ .addOption(countryEveryOption)
37
+ .addOption(outdatedOption)
38
+ .addOption(outdatedEveryOption)
39
+ .addOption(outdatedAgeOption)
34
40
  .addOption(geofencesOption)
41
+ .addOption(chargesOption)
35
42
  .addOption(localeOption)
36
43
  .addOption(delayOption)
37
44
  .addOption(limitOption)
@@ -45,16 +52,16 @@ program
45
52
  .action((o) => runFetch(o));
46
53
  program
47
54
  .command("schedule")
48
- .description("Fetch now, then refresh once a day at --at (keeps running)")
49
- .addOption(countryOption)
50
- .addOption(regionOption)
51
- .addOption(allOption)
52
- .addOption(nearOption)
55
+ .description("Run the due determinations now, then daily at --at (keeps running)")
53
56
  .addOption(radiusOption)
54
- .addOption(tierOption)
55
- .addOption(chargedOption)
56
- .addOption(homeFromTeslamateOption)
57
+ .addOption(radiusEveryOption)
58
+ .addOption(countryOption)
59
+ .addOption(countryEveryOption)
60
+ .addOption(outdatedOption)
61
+ .addOption(outdatedEveryOption)
62
+ .addOption(outdatedAgeOption)
57
63
  .addOption(geofencesOption)
64
+ .addOption(chargesOption)
58
65
  .addOption(localeOption)
59
66
  .addOption(delayOption)
60
67
  .addOption(limitOption)
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,aAAa,EACb,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACV,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,UAAU,GACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO;KACJ,IAAI,CAAC,yBAAyB,CAAC;KAC/B,OAAO,CAAC,WAAW,EAAE,CAAC;KACtB,WAAW,CAAC,wDAAwD,CAAC,CAAC;AAEzE,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,4CAA4C,CAAC;KACzD,SAAS,CAAC,aAAa,CAAC;KACxB,SAAS,CAAC,YAAY,CAAC;KACvB,SAAS,CAAC,SAAS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,CAAC;KACnB,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzB,OAAO;KACJ,OAAO,CAAC,gBAAgB,CAAC;KACzB,WAAW,CAAC,wDAAwD,CAAC;KACrE,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACnC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,IAAI,CAAC,CAAC,CAAC,CAAC;AACV,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxpicture/teslamate-extended-cli",
3
- "version": "2.1.61",
3
+ "version": "3.1.2",
4
4
  "description": "CLI to fetch + store Tesla Supercharger locations and pricing",
5
5
  "type": "module",
6
6
  "author": "MXPicture",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@commander-js/extra-typings": "^14.0.0",
39
- "@mxpicture/teslamate-extended-api": "^2.1.61",
39
+ "@mxpicture/teslamate-extended-api": "^3.1.2",
40
40
  "commander": "^14.0.3"
41
41
  },
42
42
  "devDependencies": {