@epilot/metering-client 0.1.1 → 0.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 +1 @@
1
- !function(e,t){for(var r in t)e[r]=t[r];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(r(279));t.default=a.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Metering API","version":"1.0.0"},"tags":[{"name":"Epilot_360","description":"Epilot_360"},{"name":"ECP","description":"End customer portal"}],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"paths":{"/v1/metering/reading":{"post":{"operationId":"saveMeterReading","summary":"saveMeterReading","description":"This operation inserts a new meter reading","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"requestBody":{"description":"Meter reading payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeterReading"}}}},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}}}}},"/v1/metering/reading/{meter_id}/{counter_id}":{"get":{"operationId":"fetchReadingsByInterval","summary":"fetchReadingsByInterval","description":"- Get all readings specified in an interval\\n- If the start_date & end_date are equal, then returns the readings of the specified date\\n- start_date should <= end_date\\n","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of meter"},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of counter"},{"in":"query","name":"start_date","required":true,"schema":{"type":"string","example":"2022-10-01T00:00:00.000Z"}},{"in":"query","name":"end_date","required":true,"schema":{"type":"string","example":"2022-10-10T00:00:00.000Z"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}},"total_count":{"type":"number","example":120}}}}}}}}},"/v1/metering/down-sample/readings/{meter_id}/{counter_id}":{"get":{"operationId":"fetchDownSampleReadingsByInterval","summary":"fetchDownSampleReadingsByInterval","description":"- Get the down sampled data of the entire readings specified in an interval\\n- If the start_date & end_date are equal, then returns the readings of the specified date\\n- start_date should <= end_date\\n","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of meter"},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of counter"},{"in":"query","name":"start_date","required":true,"schema":{"type":"string","example":"2022-10-01T00:00:00.000Z"}},{"in":"query","name":"end_date","required":true,"schema":{"type":"string","example":"2022-10-10T00:00:00.000Z"}},{"in":"query","name":"unit","schema":{"type":"string","default":"day","enum":["day","week","month","year"]}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Authorization header with epilot OAuth2 bearer token","bearerFormat":"JWT"},"CustomerPortalAuth":{"type":"http","scheme":"bearer","description":"Authorization header with customer pilot OAuth2 bearer token","bearerFormat":"JWT"}},"schemas":{"Id":{"type":"string"},"MeterReading":{"type":"object","properties":{"value":{"type":"number","example":240},"unit":{"type":"string","enum":["W","WH","KW","KWH","KVARH","MW","MWH","unit","cubic meter","hour","day","month","year","percentage"]},"read_by":{"type":"string","example":"John Doe"},"reason":{"type":"string","example":"Storing the feed-in record"},"meter_id":{"type":"string","example":"1446829f-4b6f-474e-b978-3997d89a7928"},"counter_id":{"type":"string","example":"2A-3"}}}}}}')}},t={};return function r(n){if(t[n])return t[n].exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(914)})());
1
+ !function(e,t){for(var r in t)e[r]=t[r];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(r(279));t.default=a.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Metering API","version":"1.0.0"},"tags":[{"name":"Epilot_360","description":"Epilot_360"},{"name":"ECP","description":"End customer portal"}],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"paths":{"/v1/metering/bucket":{"post":{"operationId":"createBucket","summary":"createBucket","description":"create a new bucket for an org in InfluxDB","tags":["Epilot_360"],"security":[{"EpilotAuth":[]}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/metering/meter":{"get":{"operationId":"getMeters","summary":"getMeters","description":"Get All meters for an Org","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Meter"}},"hits":{"type":"number","example":20}}}}}}}}},"/v1/metering/reading":{"post":{"operationId":"createMeterReading","summary":"createMeterReading","description":"This operation inserts a new meter reading","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"requestBody":{"description":"Meter reading payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeterReading"}}}},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}}}}},"/v1/metering/reading/{meter_id}/{counter_id}":{"get":{"operationId":"getReadingsByInterval","summary":"getReadingsByInterval","description":"- Get all readings specified in an interval\\n- If the start_date & end_date are equal, then returns the readings of the specified date\\n- start_date should <= end_date\\n","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of meter"},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of counter"},{"in":"query","name":"start_date","required":true,"schema":{"type":"string","example":"2022-10-01T00:00:00.000Z"}},{"in":"query","name":"end_date","required":true,"schema":{"type":"string","example":"2022-10-10T00:00:00.000Z"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}},"hits":{"type":"number","example":120}}}}}}}}},"/v1/metering/down-sample/readings/{meter_id}/{counter_id}":{"get":{"operationId":"getDownSampleReadingsByInterval","summary":"getDownSampleReadingsByInterval","description":"- Get the down sampled data of the entire readings specified in an interval\\n- If the start_date & end_date are equal, then returns the readings of the specified date\\n- start_date should <= end_date\\n","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of meter"},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of counter"},{"in":"query","name":"start_date","required":true,"schema":{"type":"string","example":"2022-10-01T00:00:00.000Z"}},{"in":"query","name":"end_date","required":true,"schema":{"type":"string","example":"2022-10-10T00:00:00.000Z"}},{"in":"query","name":"unit","schema":{"type":"string","default":"day","enum":["day","week","month","year"]}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Authorization header with epilot OAuth2 bearer token","bearerFormat":"JWT"},"CustomerPortalAuth":{"type":"http","scheme":"bearer","description":"Authorization header with customer pilot OAuth2 bearer token","bearerFormat":"JWT"}},"schemas":{"Id":{"type":"string"},"Entity":{"type":"object","properties":{},"additionalProperties":true},"Meter":{"type":"object","properties":{"ma_lo_id":{"type":"string","example":"A09-123"},"meter_type":{"type":"string","enum":["Three-phase meter","Bellow gas meter","Rotary piston meter","Smart meter","Performance meter","Maximum meter","Turbine gas meter","Ultrasonic gas meter","Alternating current meter","Modern metering system","Intelligent measuring system","Electronic meter"]},"tariff_type":{"type":"string","example":"Peak load tariff"},"meter_number":{"type":"string","example":"J-1093-1AK"},"sector":{"type":"string","enum":["Power","Water","Gas"]},"location":{"type":"string","example":"Berlin"},"used_for":{"type":"string","example":"Domestic Usage"},"manufacturer":{"type":"string","example":"Energy One"},"calibration_date":{"type":"string","example":"2022-10-10T00:00:00.000Z"},"contract":{"$ref":"#/components/schemas/Entity"},"billing_contact":{"$ref":"#/components/schemas/Entity"}}},"MeterReading":{"type":"object","properties":{"value":{"type":"number","example":240},"unit":{"type":"string","enum":["W","WH","KW","KWH","KVARH","MW","MWH","unit","cubic meter","hour","day","month","year","percentage"]},"read_by":{"type":"string","example":"John Doe"},"reason":{"type":"string","example":"Storing the feed-in record"},"meter_id":{"type":"string","example":"1446829f-4b6f-474e-b978-3997d89a7928"},"counter_id":{"type":"string","example":"2A-3"}}}}}}')}},t={};return function r(n){if(t[n])return t[n].exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(914)})());
package/dist/openapi.d.ts CHANGED
@@ -9,7 +9,51 @@ import type {
9
9
 
10
10
  declare namespace Components {
11
11
  namespace Schemas {
12
+ export interface Entity {
13
+ [name: string]: any;
14
+ }
12
15
  export type Id = string;
16
+ export interface Meter {
17
+ /**
18
+ * example:
19
+ * A09-123
20
+ */
21
+ ma_lo_id?: string;
22
+ meter_type?: "Three-phase meter" | "Bellow gas meter" | "Rotary piston meter" | "Smart meter" | "Performance meter" | "Maximum meter" | "Turbine gas meter" | "Ultrasonic gas meter" | "Alternating current meter" | "Modern metering system" | "Intelligent measuring system" | "Electronic meter";
23
+ /**
24
+ * example:
25
+ * Peak load tariff
26
+ */
27
+ tariff_type?: string;
28
+ /**
29
+ * example:
30
+ * J-1093-1AK
31
+ */
32
+ meter_number?: string;
33
+ sector?: "Power" | "Water" | "Gas";
34
+ /**
35
+ * example:
36
+ * Berlin
37
+ */
38
+ location?: string;
39
+ /**
40
+ * example:
41
+ * Domestic Usage
42
+ */
43
+ used_for?: string;
44
+ /**
45
+ * example:
46
+ * Energy One
47
+ */
48
+ manufacturer?: string;
49
+ /**
50
+ * example:
51
+ * "2022-10-10T00:00:00.000Z"
52
+ */
53
+ calibration_date?: string;
54
+ contract?: Entity;
55
+ billing_contact?: Entity;
56
+ }
13
57
  export interface MeterReading {
14
58
  /**
15
59
  * example:
@@ -41,7 +85,21 @@ declare namespace Components {
41
85
  }
42
86
  }
43
87
  declare namespace Paths {
44
- namespace FetchDownSampleReadingsByInterval {
88
+ namespace CreateBucket {
89
+ namespace Responses {
90
+ export interface $200 {
91
+ }
92
+ }
93
+ }
94
+ namespace CreateMeterReading {
95
+ export type RequestBody = Components.Schemas.MeterReading;
96
+ namespace Responses {
97
+ export interface $200 {
98
+ data?: Components.Schemas.MeterReading;
99
+ }
100
+ }
101
+ }
102
+ namespace GetDownSampleReadingsByInterval {
45
103
  namespace Parameters {
46
104
  export type CounterId = Components.Schemas.Id;
47
105
  /**
@@ -80,7 +138,19 @@ declare namespace Paths {
80
138
  }
81
139
  }
82
140
  }
83
- namespace FetchReadingsByInterval {
141
+ namespace GetMeters {
142
+ namespace Responses {
143
+ export interface $200 {
144
+ results?: Components.Schemas.Meter[];
145
+ /**
146
+ * example:
147
+ * 20
148
+ */
149
+ hits?: number;
150
+ }
151
+ }
152
+ }
153
+ namespace GetReadingsByInterval {
84
154
  namespace Parameters {
85
155
  export type CounterId = Components.Schemas.Id;
86
156
  /**
@@ -118,15 +188,7 @@ declare namespace Paths {
118
188
  * example:
119
189
  * 120
120
190
  */
121
- total_count?: number;
122
- }
123
- }
124
- }
125
- namespace SaveMeterReading {
126
- export type RequestBody = Components.Schemas.MeterReading;
127
- namespace Responses {
128
- export interface $200 {
129
- data?: Components.Schemas.MeterReading;
191
+ hits?: number;
130
192
  }
131
193
  }
132
194
  }
@@ -134,59 +196,103 @@ declare namespace Paths {
134
196
 
135
197
  export interface OperationMethods {
136
198
  /**
137
- * saveMeterReading - saveMeterReading
199
+ * createBucket - createBucket
200
+ *
201
+ * create a new bucket for an org in InfluxDB
202
+ */
203
+ 'createBucket'(
204
+ parameters?: Parameters<UnknownParamsObject> | null,
205
+ data?: any,
206
+ config?: AxiosRequestConfig
207
+ ): OperationResponse<Paths.CreateBucket.Responses.$200>
208
+ /**
209
+ * getMeters - getMeters
210
+ *
211
+ * Get All meters for an Org
212
+ */
213
+ 'getMeters'(
214
+ parameters?: Parameters<UnknownParamsObject> | null,
215
+ data?: any,
216
+ config?: AxiosRequestConfig
217
+ ): OperationResponse<Paths.GetMeters.Responses.$200>
218
+ /**
219
+ * createMeterReading - createMeterReading
138
220
  *
139
221
  * This operation inserts a new meter reading
140
222
  */
141
- 'saveMeterReading'(
223
+ 'createMeterReading'(
142
224
  parameters?: Parameters<UnknownParamsObject> | null,
143
- data?: Paths.SaveMeterReading.RequestBody,
225
+ data?: Paths.CreateMeterReading.RequestBody,
144
226
  config?: AxiosRequestConfig
145
- ): OperationResponse<Paths.SaveMeterReading.Responses.$200>
227
+ ): OperationResponse<Paths.CreateMeterReading.Responses.$200>
146
228
  /**
147
- * fetchReadingsByInterval - fetchReadingsByInterval
229
+ * getReadingsByInterval - getReadingsByInterval
148
230
  *
149
231
  * - Get all readings specified in an interval
150
232
  * - If the start_date & end_date are equal, then returns the readings of the specified date
151
233
  * - start_date should <= end_date
152
234
  *
153
235
  */
154
- 'fetchReadingsByInterval'(
155
- parameters?: Parameters<Paths.FetchReadingsByInterval.PathParameters & Paths.FetchReadingsByInterval.QueryParameters> | null,
236
+ 'getReadingsByInterval'(
237
+ parameters?: Parameters<Paths.GetReadingsByInterval.PathParameters & Paths.GetReadingsByInterval.QueryParameters> | null,
156
238
  data?: any,
157
239
  config?: AxiosRequestConfig
158
- ): OperationResponse<Paths.FetchReadingsByInterval.Responses.$200>
240
+ ): OperationResponse<Paths.GetReadingsByInterval.Responses.$200>
159
241
  /**
160
- * fetchDownSampleReadingsByInterval - fetchDownSampleReadingsByInterval
242
+ * getDownSampleReadingsByInterval - getDownSampleReadingsByInterval
161
243
  *
162
244
  * - Get the down sampled data of the entire readings specified in an interval
163
245
  * - If the start_date & end_date are equal, then returns the readings of the specified date
164
246
  * - start_date should <= end_date
165
247
  *
166
248
  */
167
- 'fetchDownSampleReadingsByInterval'(
168
- parameters?: Parameters<Paths.FetchDownSampleReadingsByInterval.PathParameters & Paths.FetchDownSampleReadingsByInterval.QueryParameters> | null,
249
+ 'getDownSampleReadingsByInterval'(
250
+ parameters?: Parameters<Paths.GetDownSampleReadingsByInterval.PathParameters & Paths.GetDownSampleReadingsByInterval.QueryParameters> | null,
169
251
  data?: any,
170
252
  config?: AxiosRequestConfig
171
- ): OperationResponse<Paths.FetchDownSampleReadingsByInterval.Responses.$200>
253
+ ): OperationResponse<Paths.GetDownSampleReadingsByInterval.Responses.$200>
172
254
  }
173
255
 
174
256
  export interface PathsDictionary {
257
+ ['/v1/metering/bucket']: {
258
+ /**
259
+ * createBucket - createBucket
260
+ *
261
+ * create a new bucket for an org in InfluxDB
262
+ */
263
+ 'post'(
264
+ parameters?: Parameters<UnknownParamsObject> | null,
265
+ data?: any,
266
+ config?: AxiosRequestConfig
267
+ ): OperationResponse<Paths.CreateBucket.Responses.$200>
268
+ }
269
+ ['/v1/metering/meter']: {
270
+ /**
271
+ * getMeters - getMeters
272
+ *
273
+ * Get All meters for an Org
274
+ */
275
+ 'get'(
276
+ parameters?: Parameters<UnknownParamsObject> | null,
277
+ data?: any,
278
+ config?: AxiosRequestConfig
279
+ ): OperationResponse<Paths.GetMeters.Responses.$200>
280
+ }
175
281
  ['/v1/metering/reading']: {
176
282
  /**
177
- * saveMeterReading - saveMeterReading
283
+ * createMeterReading - createMeterReading
178
284
  *
179
285
  * This operation inserts a new meter reading
180
286
  */
181
287
  'post'(
182
288
  parameters?: Parameters<UnknownParamsObject> | null,
183
- data?: Paths.SaveMeterReading.RequestBody,
289
+ data?: Paths.CreateMeterReading.RequestBody,
184
290
  config?: AxiosRequestConfig
185
- ): OperationResponse<Paths.SaveMeterReading.Responses.$200>
291
+ ): OperationResponse<Paths.CreateMeterReading.Responses.$200>
186
292
  }
187
293
  ['/v1/metering/reading/{meter_id}/{counter_id}']: {
188
294
  /**
189
- * fetchReadingsByInterval - fetchReadingsByInterval
295
+ * getReadingsByInterval - getReadingsByInterval
190
296
  *
191
297
  * - Get all readings specified in an interval
192
298
  * - If the start_date & end_date are equal, then returns the readings of the specified date
@@ -194,14 +300,14 @@ export interface PathsDictionary {
194
300
  *
195
301
  */
196
302
  'get'(
197
- parameters?: Parameters<Paths.FetchReadingsByInterval.PathParameters & Paths.FetchReadingsByInterval.QueryParameters> | null,
303
+ parameters?: Parameters<Paths.GetReadingsByInterval.PathParameters & Paths.GetReadingsByInterval.QueryParameters> | null,
198
304
  data?: any,
199
305
  config?: AxiosRequestConfig
200
- ): OperationResponse<Paths.FetchReadingsByInterval.Responses.$200>
306
+ ): OperationResponse<Paths.GetReadingsByInterval.Responses.$200>
201
307
  }
202
308
  ['/v1/metering/down-sample/readings/{meter_id}/{counter_id}']: {
203
309
  /**
204
- * fetchDownSampleReadingsByInterval - fetchDownSampleReadingsByInterval
310
+ * getDownSampleReadingsByInterval - getDownSampleReadingsByInterval
205
311
  *
206
312
  * - Get the down sampled data of the entire readings specified in an interval
207
313
  * - If the start_date & end_date are equal, then returns the readings of the specified date
@@ -209,10 +315,10 @@ export interface PathsDictionary {
209
315
  *
210
316
  */
211
317
  'get'(
212
- parameters?: Parameters<Paths.FetchDownSampleReadingsByInterval.PathParameters & Paths.FetchDownSampleReadingsByInterval.QueryParameters> | null,
318
+ parameters?: Parameters<Paths.GetDownSampleReadingsByInterval.PathParameters & Paths.GetDownSampleReadingsByInterval.QueryParameters> | null,
213
319
  data?: any,
214
320
  config?: AxiosRequestConfig
215
- ): OperationResponse<Paths.FetchDownSampleReadingsByInterval.Responses.$200>
321
+ ): OperationResponse<Paths.GetDownSampleReadingsByInterval.Responses.$200>
216
322
  }
217
323
  }
218
324
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/metering-client",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "API Client for epilot Metering API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",