@mxpicture/tesla-superchargers-api 0.1.51 → 0.1.53

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.
@@ -0,0 +1,19 @@
1
+ import { type ClusterAssignSummary } from "@mxpicture/tesla-superchargers-mate/store";
2
+ import { IApi } from "./IApi.js";
3
+ /**
4
+ * Address clustering — `pic_cluster` / `pic_cluster_member`, the grouping that
5
+ * lets a Supercharger site logged under half a dozen slightly different
6
+ * Nominatim addresses read as one place in the clustered cost views.
7
+ *
8
+ * TeslaMate creates an address whenever it geocodes a new place, so the
9
+ * assignment has to be kept up: this is the scheduled caller that replaced the
10
+ * AFTER INSERT trigger the clustering used to install on `addresses`. A full
11
+ * re-clustering (`pic_rebuild()`) is deliberately not exposed here — it
12
+ * discards every cluster, which is a manual act, not a scheduled one.
13
+ */
14
+ export declare class ClustersApi extends IApi {
15
+ /** Cluster the addresses that have no cluster yet. Idempotent. */
16
+ assign(diameterM?: number): Promise<ClusterAssignSummary>;
17
+ }
18
+ export declare const clustersApi: () => ClustersApi;
19
+ //# sourceMappingURL=ClustersApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClustersApi.d.ts","sourceRoot":"","sources":["../../src/api/ClustersApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;GAUG;AACH,qBAAa,WAAY,SAAQ,IAAI;IACnC,kEAAkE;IACrD,MAAM,CACjB,SAAS,GAAE,MAA2B,GACrC,OAAO,CAAC,oBAAoB,CAAC;CAGjC;AAGD,eAAO,MAAM,WAAW,mBAAqC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { assignClusters, CLUSTER_DIAMETER_M, } from "@mxpicture/tesla-superchargers-mate/store";
2
+ import { IApi } from "./IApi.js";
3
+ /**
4
+ * Address clustering — `pic_cluster` / `pic_cluster_member`, the grouping that
5
+ * lets a Supercharger site logged under half a dozen slightly different
6
+ * Nominatim addresses read as one place in the clustered cost views.
7
+ *
8
+ * TeslaMate creates an address whenever it geocodes a new place, so the
9
+ * assignment has to be kept up: this is the scheduled caller that replaced the
10
+ * AFTER INSERT trigger the clustering used to install on `addresses`. A full
11
+ * re-clustering (`pic_rebuild()`) is deliberately not exposed here — it
12
+ * discards every cluster, which is a manual act, not a scheduled one.
13
+ */
14
+ export class ClustersApi extends IApi {
15
+ /** Cluster the addresses that have no cluster yet. Idempotent. */
16
+ async assign(diameterM = CLUSTER_DIAMETER_M) {
17
+ return await assignClusters(diameterM);
18
+ }
19
+ }
20
+ let _api = null;
21
+ export const clustersApi = () => (_api ??= new ClustersApi());
22
+ //# sourceMappingURL=ClustersApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClustersApi.js","sourceRoot":"","sources":["../../src/api/ClustersApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,GAEnB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,WAAY,SAAQ,IAAI;IACnC,kEAAkE;IAC3D,KAAK,CAAC,MAAM,CACjB,YAAoB,kBAAkB;QAEtC,OAAO,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAED,IAAI,IAAI,GAAuB,IAAI,CAAC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,WAAW,EAAE,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { type RefsBuildSummary } from "@mxpicture/tesla-superchargers-mate/store";
2
+ import { IApi } from "./IApi.js";
3
+ /**
4
+ * `pic_refs` — one row per drive, parked interval and charge, each carrying the
5
+ * euros it consumed, which the Grafana drive/idle cost views read through
6
+ * `pic_base_drive_cost_v` / `pic_base_idle_cost_v`.
7
+ *
8
+ * The table is a projection of what TeslaMate has logged, so it only ever holds
9
+ * what the last build saw: it needs rebuilding after TeslaMate logs new drives
10
+ * or charges, after the pricing pass back-fills a charge's
11
+ * cost (the invoice the replay prices a charge from), and after a
12
+ * deploy — the schema migration drops and recreates the table, so `setup`
13
+ * leaves it empty.
14
+ */
15
+ export declare class RefsApi extends IApi {
16
+ /** Reconcile and reprice every car's refs. Idempotent; see `buildRefs`. */
17
+ build(): Promise<RefsBuildSummary>;
18
+ }
19
+ export declare const refsApi: () => RefsApi;
20
+ //# sourceMappingURL=RefsApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefsApi.d.ts","sourceRoot":"","sources":["../../src/api/RefsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;GAWG;AACH,qBAAa,OAAQ,SAAQ,IAAI;IAC/B,2EAA2E;IAC9D,KAAK,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAGhD;AAGD,eAAO,MAAM,OAAO,eAAiC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { buildRefs, } from "@mxpicture/tesla-superchargers-mate/store";
2
+ import { IApi } from "./IApi.js";
3
+ /**
4
+ * `pic_refs` — one row per drive, parked interval and charge, each carrying the
5
+ * euros it consumed, which the Grafana drive/idle cost views read through
6
+ * `pic_base_drive_cost_v` / `pic_base_idle_cost_v`.
7
+ *
8
+ * The table is a projection of what TeslaMate has logged, so it only ever holds
9
+ * what the last build saw: it needs rebuilding after TeslaMate logs new drives
10
+ * or charges, after the pricing pass back-fills a charge's
11
+ * cost (the invoice the replay prices a charge from), and after a
12
+ * deploy — the schema migration drops and recreates the table, so `setup`
13
+ * leaves it empty.
14
+ */
15
+ export class RefsApi extends IApi {
16
+ /** Reconcile and reprice every car's refs. Idempotent; see `buildRefs`. */
17
+ async build() {
18
+ return await buildRefs();
19
+ }
20
+ }
21
+ let _api = null;
22
+ export const refsApi = () => (_api ??= new RefsApi());
23
+ //# sourceMappingURL=RefsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefsApi.js","sourceRoot":"","sources":["../../src/api/RefsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,GAEV,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,OAAQ,SAAQ,IAAI;IAC/B,2EAA2E;IACpE,KAAK,CAAC,KAAK;QAChB,OAAO,MAAM,SAAS,EAAE,CAAC;IAC3B,CAAC;CACF;AAED,IAAI,IAAI,GAAmB,IAAI,CAAC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC,CAAC"}
@@ -1,8 +1,10 @@
1
1
  export * from "./ChargersApi.js";
2
2
  export * from "./ChargingProcessesApi.js";
3
+ export * from "./ClustersApi.js";
3
4
  export * from "./FailuresApi.js";
4
5
  export * from "./IApi.js";
5
6
  export * from "./InvoicesApi.js";
7
+ export * from "./RefsApi.js";
6
8
  export * from "./SlugsApi.js";
7
9
  export * from "./ZipCodesApi.js";
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
package/dist/api/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  // This file is auto-generated by build-cli. Do not edit manually.
2
2
  export * from "./ChargersApi.js";
3
3
  export * from "./ChargingProcessesApi.js";
4
+ export * from "./ClustersApi.js";
4
5
  export * from "./FailuresApi.js";
5
6
  export * from "./IApi.js";
6
7
  export * from "./InvoicesApi.js";
8
+ export * from "./RefsApi.js";
7
9
  export * from "./SlugsApi.js";
8
10
  export * from "./ZipCodesApi.js";
9
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxpicture/tesla-superchargers-api",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "Fetch + store Tesla Supercharger locations and pricing",
5
5
  "type": "module",
6
6
  "author": "MXPicture",
@@ -44,9 +44,9 @@
44
44
  "access": "public"
45
45
  },
46
46
  "dependencies": {
47
- "@mxpicture/tesla-superchargers-cloud-store": "^0.1.51",
48
- "@mxpicture/tesla-superchargers-generated": "^0.1.51",
49
- "@mxpicture/tesla-superchargers-mate": "^0.1.51",
47
+ "@mxpicture/tesla-superchargers-cloud-store": "^0.1.53",
48
+ "@mxpicture/tesla-superchargers-generated": "^0.1.53",
49
+ "@mxpicture/tesla-superchargers-mate": "^0.1.53",
50
50
  "csv-parse": "^7.0.1",
51
51
  "fflate": "^0.8.3",
52
52
  "json5": "^2.2.3",