@mxpicture/tesla-superchargers-api 0.1.1

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 (77) hide show
  1. package/dist/api/ChargersApi.d.ts +53 -0
  2. package/dist/api/ChargersApi.d.ts.map +1 -0
  3. package/dist/api/ChargersApi.js +173 -0
  4. package/dist/api/ChargersApi.js.map +1 -0
  5. package/dist/api/ChargingProcessesApi.d.ts +11 -0
  6. package/dist/api/ChargingProcessesApi.d.ts.map +1 -0
  7. package/dist/api/ChargingProcessesApi.js +56 -0
  8. package/dist/api/ChargingProcessesApi.js.map +1 -0
  9. package/dist/api/FailuresApi.d.ts +38 -0
  10. package/dist/api/FailuresApi.d.ts.map +1 -0
  11. package/dist/api/FailuresApi.js +88 -0
  12. package/dist/api/FailuresApi.js.map +1 -0
  13. package/dist/api/IApi.d.ts +6 -0
  14. package/dist/api/IApi.d.ts.map +1 -0
  15. package/dist/api/IApi.js +11 -0
  16. package/dist/api/IApi.js.map +1 -0
  17. package/dist/api/SlugsApi.d.ts +15 -0
  18. package/dist/api/SlugsApi.d.ts.map +1 -0
  19. package/dist/api/SlugsApi.js +68 -0
  20. package/dist/api/SlugsApi.js.map +1 -0
  21. package/dist/api/index.d.ts +6 -0
  22. package/dist/api/index.d.ts.map +1 -0
  23. package/dist/api/index.js +7 -0
  24. package/dist/api/index.js.map +1 -0
  25. package/dist/common/chargers.common.d.ts +11 -0
  26. package/dist/common/chargers.common.d.ts.map +1 -0
  27. package/dist/common/chargers.common.js +11 -0
  28. package/dist/common/chargers.common.js.map +1 -0
  29. package/dist/common/failures.common.d.ts +8 -0
  30. package/dist/common/failures.common.d.ts.map +1 -0
  31. package/dist/common/failures.common.js +33 -0
  32. package/dist/common/failures.common.js.map +1 -0
  33. package/dist/common/index.d.ts +6 -0
  34. package/dist/common/index.d.ts.map +1 -0
  35. package/dist/common/index.js +7 -0
  36. package/dist/common/index.js.map +1 -0
  37. package/dist/common/pricebooks.common.d.ts +47 -0
  38. package/dist/common/pricebooks.common.d.ts.map +1 -0
  39. package/dist/common/pricebooks.common.js +95 -0
  40. package/dist/common/pricebooks.common.js.map +1 -0
  41. package/dist/common/pushover.common.d.ts +23 -0
  42. package/dist/common/pushover.common.d.ts.map +1 -0
  43. package/dist/common/pushover.common.js +52 -0
  44. package/dist/common/pushover.common.js.map +1 -0
  45. package/dist/common/sync.common.d.ts +51 -0
  46. package/dist/common/sync.common.d.ts.map +1 -0
  47. package/dist/common/sync.common.js +106 -0
  48. package/dist/common/sync.common.js.map +1 -0
  49. package/dist/types/chargers.types.d.ts +8 -0
  50. package/dist/types/chargers.types.d.ts.map +1 -0
  51. package/dist/types/chargers.types.js +2 -0
  52. package/dist/types/chargers.types.js.map +1 -0
  53. package/dist/types/charging.types.d.ts +15 -0
  54. package/dist/types/charging.types.d.ts.map +1 -0
  55. package/dist/types/charging.types.js +2 -0
  56. package/dist/types/charging.types.js.map +1 -0
  57. package/dist/types/failures.types.d.ts +19 -0
  58. package/dist/types/failures.types.d.ts.map +1 -0
  59. package/dist/types/failures.types.js +2 -0
  60. package/dist/types/failures.types.js.map +1 -0
  61. package/dist/types/index.d.ts +7 -0
  62. package/dist/types/index.d.ts.map +1 -0
  63. package/dist/types/index.js +8 -0
  64. package/dist/types/index.js.map +1 -0
  65. package/dist/types/pricebooks.types.d.ts +28 -0
  66. package/dist/types/pricebooks.types.d.ts.map +1 -0
  67. package/dist/types/pricebooks.types.js +2 -0
  68. package/dist/types/pricebooks.types.js.map +1 -0
  69. package/dist/types/pushover.types.d.ts +12 -0
  70. package/dist/types/pushover.types.d.ts.map +1 -0
  71. package/dist/types/pushover.types.js +2 -0
  72. package/dist/types/pushover.types.js.map +1 -0
  73. package/dist/types/sync.types.d.ts +22 -0
  74. package/dist/types/sync.types.d.ts.map +1 -0
  75. package/dist/types/sync.types.js +2 -0
  76. package/dist/types/sync.types.js.map +1 -0
  77. package/package.json +52 -0
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The content columns of a pricebook row, shared by db rows (`PicPricebooks`)
3
+ * and feed initializers (`PicPricebooksInitializer`). Representations differ
4
+ * per source and must be normalized before comparing:
5
+ * - `start_time`/`end_time`: TIME comes back from postgres as an `HH:MM:SS`
6
+ * string (despite the generated `Date` type); initializers carry a `Date`.
7
+ * - `rate_*`: NUMERIC(5,2) comes back as `"0.50"`; initializers send `"0.5"`.
8
+ * - `days`: feed order is not guaranteed.
9
+ */
10
+ export interface PricebookContent {
11
+ currency_code: string;
12
+ uom: string;
13
+ days: number[];
14
+ start_time: Date | string;
15
+ end_time: Date | string;
16
+ vehicle_make_type: string;
17
+ fee_type: string;
18
+ is_member_pricebook: boolean;
19
+ is_tou: boolean;
20
+ rate_base: string | number;
21
+ rate_tier_1: string | number;
22
+ rate_tier_2: string | number;
23
+ }
24
+ export interface ChargingRate {
25
+ rate: number;
26
+ currencyCode: string;
27
+ }
28
+ //# sourceMappingURL=pricebooks.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricebooks.types.d.ts","sourceRoot":"","sources":["../../src/types/pricebooks.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pricebooks.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricebooks.types.js","sourceRoot":"","sources":["../../src/types/pricebooks.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /** Pushover application credentials. */
2
+ export interface PushoverConfig {
3
+ token: string;
4
+ user: string;
5
+ }
6
+ /** One Pushover message. `priority` follows Pushover's scale (default 0). */
7
+ export interface PushoverMessage {
8
+ title: string;
9
+ message: string;
10
+ priority?: number;
11
+ }
12
+ //# sourceMappingURL=pushover.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pushover.types.d.ts","sourceRoot":"","sources":["../../src/types/pushover.types.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pushover.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pushover.types.js","sourceRoot":"","sources":["../../src/types/pushover.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import type { MateStoreId } from "@mxpicture/tesla-superchargers-mate/store";
2
+ export interface SyncDbRow extends MateStoreId<string> {
3
+ /** absent on hard-delete tables (e.g. slugs) — every row counts as active */
4
+ deleted_at?: Date | null;
5
+ }
6
+ export interface SyncPlan<INITIALZER> {
7
+ /** new + matched docs; the upsert's IS DISTINCT FROM skips unchanged ones */
8
+ upserts: INITIALZER[];
9
+ /** db ids present in the feed; every other row is absent */
10
+ seenIds: string[];
11
+ feedDuplicates: number;
12
+ feedNullKeys: number;
13
+ }
14
+ export interface SyncSummary {
15
+ feedCount: number;
16
+ feedDuplicates: number;
17
+ feedNullKeys: number;
18
+ upserted: number;
19
+ /** rows absent from the feed: soft- or hard-deleted per `deleteAbsent` */
20
+ deleted: number;
21
+ }
22
+ //# sourceMappingURL=sync.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.types.d.ts","sourceRoot":"","sources":["../../src/types/sync.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAE7E,MAAM,WAAW,SAAU,SAAQ,WAAW,CAAC,MAAM,CAAC;IACpD,6EAA6E;IAC7E,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,QAAQ,CAAC,UAAU;IAClC,6EAA6E;IAC7E,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sync.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.types.js","sourceRoot":"","sources":["../../src/types/sync.types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@mxpicture/tesla-superchargers-api",
3
+ "version": "0.1.1",
4
+ "description": "Fetch + store Tesla Supercharger locations and pricing",
5
+ "type": "module",
6
+ "author": "MXPicture",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/MXPicture/npm-tesla-superchargers.git"
11
+ },
12
+ "exports": {
13
+ "./api": {
14
+ "types": "./src/api/index.ts",
15
+ "default": "./dist/api/index.js"
16
+ },
17
+ "./package.json": "./package.json",
18
+ "./common": {
19
+ "types": "./src/common/index.ts",
20
+ "default": "./dist/common/index.js"
21
+ },
22
+ "./types": {
23
+ "types": "./src/types/index.ts",
24
+ "default": "./dist/types/index.js"
25
+ }
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "engines": {
31
+ "node": ">=24"
32
+ },
33
+ "scripts": {
34
+ "lint": "eslint \"src/**/*.ts\" --ext .ts --cache --cache-strategy content",
35
+ "lint:ci": "eslint \"src/**/*.ts\" --ext .ts --max-warnings=0",
36
+ "build": "tsc -b .",
37
+ "test": "tsc -b . && vitest run"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "dependencies": {
43
+ "@mxpicture/tesla-superchargers-generated": "workspace:*",
44
+ "@mxpicture/tesla-superchargers-mate": "workspace:*",
45
+ "json5": "^2.2.3"
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "^25.2.3",
49
+ "typescript": "^5.9.3",
50
+ "vitest": "^4.0.18"
51
+ }
52
+ }