@epilot/metering-client 0.1.18 → 0.1.20

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 a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=a(r(279));t.default=i.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"},{"name":"Proxy","description":"Authorize with help of x-api-key"}],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"paths":{"/v1/metering/meter":{"get":{"operationId":"getCustomerMeters","summary":"getCustomerMeters","description":"Get All meters related to a customer","tags":["ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Meter"}}}}}}}}}},"/v1/metering/counter":{"get":{"operationId":"getMeterCounters","summary":"getMeterCounters","description":"Get all counters for a given meter","tags":["ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"query","name":"meter_id","required":true,"schema":{"type":"string","example":"1446829f-4b6f-474e-b978-3997d89a7928"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterCounter"}}}}}}}}}},"/v1/metering/counter/{counter_id}":{"get":{"operationId":"getCounterDetails","summary":"getCounterDetails","description":"Get details for a meter counter","tags":["ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of a Counter"}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterCounter"}}}}}}}}},"/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/{id}":{"put":{"operationId":"updateMeterReading","summary":"updateMeterReading","description":"This operation updates a meter reading","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of meter reading"}],"requestBody":{"description":"Update 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"}}}}}}}},"delete":{"operationId":"deleteMeterReading","summary":"deleteMeterReading","description":"This operation deletes a meter reading","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of meter reading"}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"}}}}}}}}}}},"/v1/metering/readings":{"post":{"operationId":"createMeterReadings","summary":"createMeterReadings","description":"This operation inserts a multiple meter readings at once, e.g; to submit bi-directional data (feed-in & feed-out) in a journey","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"requestBody":{"description":"Meter readings payload","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"readings":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}}}}},"/v1/metering/reading/proxy":{"post":{"operationId":"createMeterReadingAsProxy","summary":"createMeterReadingAsProxy","description":"This operation lets to create reading with the help of valid x-api-key.","tags":["Proxy"],"security":[],"requestBody":{"description":"Meter reading payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProxyMeterReading"}}}},"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":false,"description":"If the value is not provided, the system will default to the date one year ago","schema":{"type":"string","example":"2022-10-01T00:00:00.000Z"}},{"in":"query","name":"end_date","required":false,"description":"If the value is not provided, the system will default to today","schema":{"type":"string","example":"2022-10-10T00:00:00.000Z"}},{"in":"query","name":"direction","required":false,"schema":{"$ref":"#/components/schemas/Direction"}},{"in":"query","name":"size","description":"- Returns the first n results after the specified offset(from).\\n- If this value is provided with -1, then returns all results at once.\\n","required":false,"schema":{"type":"number","example":20,"default":20}},{"in":"query","name":"from","required":false,"schema":{"type":"number","example":0,"default":0}},{"in":"query","name":"type","required":true,"description":"- Since meter readings are cumulative, Users may need to request actual consumptions which are the difference between consecutive measurements.\\n- If this value is provided with \\"cumulative\\", then actual readings will be return.\\n- If this value is provided with \\"relative\\", then actual consumption will be return.\\n","schema":{"type":"string","default":"cumulative","enum":["cumulative","relative"]}}],"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":false,"description":"If the value is not provided, the system will default to the date one year ago","schema":{"type":"string","example":"2022-10-01T00:00:00.000Z"}},{"in":"query","name":"end_date","required":false,"description":"If the value is not provided, the system will default to today","schema":{"type":"string","example":"2022-10-10T00:00:00.000Z"}},{"in":"query","name":"group_by","schema":{"type":"string","default":"day","enum":["day","week","month","year"]}},{"in":"query","name":"direction","required":false,"schema":{"$ref":"#/components/schemas/Direction"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"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"},"EntityRelation":{"type":"object","properties":{"entity_id":{"type":"string","example":"9a2081a2-1615-44b8-b988-d757983290dd"},"_slug":{"type":"string","enum":["contact","contract"]}}},"Meter":{"type":"object","properties":{"_id":{"type":"string","example":"991a1821-43bc-46b8-967d-64a3d87c31f8"},"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":"object","example":[{"country":"Germany","city":"Koln","postal_code":81475,"street":"Melatengürtel","street_number":71,"additional_info":"5. Etage","_tags":["billing","delivery"]}]},"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":{"type":"object","properties":{"$relation":{"type":"array","items":{"$ref":"#/components/schemas/EntityRelation"}}}},"customer":{"type":"object","properties":{"$relation":{"type":"array","items":{"$ref":"#/components/schemas/EntityRelation"}}}}}},"Direction":{"type":"string","enum":["feed-in","feed-out"]},"MeterReading":{"type":"object","properties":{"value":{"type":"number","example":240},"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":"991a1821-43bc-46b8-967d-64a3d87c31f8"},"direction":{"$ref":"#/components/schemas/Direction"},"timestamp":{"type":"string","description":"If the value is not provided, the system will be set with the time the request is processed.","example":"2022-10-10T00:00:00.000Z"},"source":{"type":"string","enum":["ECP","ERP","360","journey-submission"]}}},"MeterCounter":{"type":"object","properties":{"_id":{"type":"string","example":"991a1821-43bc-46b8-967d-64a3d87c31f8"},"obis_number":{"type":"string","example":"A-34"},"direction":{"$ref":"#/components/schemas/Direction"},"transformer_ratio":{"type":"number","example":70},"unit":{"type":"string","enum":["w","wh","kw","kwh","kvarh","mw","mwh","unit","cubic-meter","hour","day","month","year","percentage"]},"forecast_reading_value":{"type":"string","example":270},"forecast_as_of":{"type":"string","example":"2022-12-10T00:00:00.000Z"},"current_consumption":{"type":"number","example":240},"last_reading":{"type":"string","example":"2022-10-10T00:00:00.000Z"},"conversion_factor":{"type":"number","example":3}}},"ProxyMeterReading":{"allOf":[{"$ref":"#/components/schemas/MeterReading"},{"type":"object","properties":{"_org":{"type":"string","example":123}}}]}}}}')}},t={};return function r(a){if(t[a])return t[a].exports;var i=t[a]={exports:{}};return e[a].call(i.exports,i,i.exports,r),i.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 a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=a(r(279));t.default=i.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"},{"name":"Proxy","description":"Authorize with help of x-api-key"}],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"paths":{"/v1/metering/meter":{"get":{"operationId":"getCustomerMeters","summary":"getCustomerMeters","description":"Get All meters related to a customer","tags":["ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Meter"}}}}}}}}}},"/v1/metering/counter":{"get":{"operationId":"getMeterCounters","summary":"getMeterCounters","description":"Get all counters for a given meter","tags":["ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"query","name":"meter_id","required":true,"schema":{"type":"string","example":"1446829f-4b6f-474e-b978-3997d89a7928"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterCounter"}}}}}}}}}},"/v1/metering/counter/{counter_id}":{"get":{"operationId":"getCounterDetails","summary":"getCounterDetails","description":"Get details for a meter counter","tags":["ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"parameters":[{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of a Counter"}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterCounter"}}}}}}}}},"/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/readings":{"post":{"operationId":"createMeterReadings","summary":"createMeterReadings","description":"This operation inserts a multiple meter readings at once, e.g; to submit bi-directional data (feed-in & feed-out) in a journey","tags":["Epilot_360","ECP"],"security":[{"EpilotAuth":[]},{"CustomerPortalAuth":[]}],"requestBody":{"description":"Meter readings payload","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"readings":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}}}}},"/v1/metering/reading/proxy":{"post":{"operationId":"createMeterReadingAsProxy","summary":"createMeterReadingAsProxy","description":"This operation lets to create reading with the help of valid x-api-key.","tags":["Proxy"],"security":[],"requestBody":{"description":"Meter reading payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProxyMeterReading"}}}},"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":false,"description":"If the value is not provided, the system will default to the date one year ago","schema":{"type":"string","example":"2022-10-01T00:00:00.000Z"}},{"in":"query","name":"end_date","required":false,"description":"If the value is not provided, the system will default to today","schema":{"type":"string","example":"2022-10-10T00:00:00.000Z"}},{"in":"query","name":"direction","required":false,"schema":{"$ref":"#/components/schemas/Direction"}},{"in":"query","name":"size","description":"- Returns the first n results after the specified offset(from).\\n- If this value is provided with -1, then returns all results at once.\\n","required":false,"schema":{"type":"number","example":20,"default":20}},{"in":"query","name":"from","required":false,"schema":{"type":"number","example":0,"default":0}},{"in":"query","name":"type","required":true,"description":"- Since meter readings are cumulative, Users may need to request actual consumptions which are the difference between consecutive measurements.\\n- If this value is provided with \\"cumulative\\", then actual readings will be return.\\n- If this value is provided with \\"relative\\", then actual consumption will be return.\\n","schema":{"type":"string","default":"cumulative","enum":["cumulative","relative"]}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}},"hits":{"type":"number","example":120}}}}}}}},"put":{"operationId":"updateMeterReading","summary":"updateMeterReading","description":"This operation updates a meter reading","tags":["Epilot_360"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of meter entity"},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of counter entity"},{"in":"query","name":"timestamp","required":true,"description":"Timestamp when the reading was created at","schema":{"type":"string","example":"2022-10-01T20:00:00.000Z"}}],"requestBody":{"description":"Update 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"}}}}}}}},"delete":{"operationId":"deleteMeterReading","summary":"deleteMeterReading","description":"This operation deletes a meter reading","tags":["Epilot_360"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of meter entity"},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The Id of counter entity"},{"in":"query","name":"timestamp","required":true,"description":"Timestamp when the reading was created at","schema":{"type":"string","example":"2022-10-01T20:00:00.000Z"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"meterId":{"$ref":"#/components/schemas/Id"},"counterId":{"$ref":"#/components/schemas/Id"},"timestamp":{"type":"string","example":"2022-10-01T20:00:00.000Z"}}}}}}}}}}},"/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":false,"description":"If the value is not provided, the system will default to the date one year ago","schema":{"type":"string","example":"2022-10-01T00:00:00.000Z"}},{"in":"query","name":"end_date","required":false,"description":"If the value is not provided, the system will default to today","schema":{"type":"string","example":"2022-10-10T00:00:00.000Z"}},{"in":"query","name":"group_by","schema":{"type":"string","default":"day","enum":["day","week","month","year"]}},{"in":"query","name":"direction","required":false,"schema":{"$ref":"#/components/schemas/Direction"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"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":{"EntityId":{"type":"string","format":"uuid"},"EntitySlug":{"description":"URL-friendly identifier for the entity schema","type":"string","example":"contact"},"BaseEntity":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/EntityId"},"_title":{"type":"string","description":"Title of entity"},"_org":{"type":"string","description":"Organization Id the entity belongs to"},"_schema":{"$ref":"#/components/schemas/EntitySlug"},"_tags":{"type":"array","items":{"type":"string"}},"_created_at":{"type":"string","format":"date-time"},"_updated_at":{"type":"string","format":"date-time"}},"required":["_id","_title","_org","_schema","_created_at","_updated_at"],"example":{"_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","_org":"123","_schema":"contact","_tags":["example","mock"],"_created_at":"2021-02-09T12:41:43.662Z","_updated_at":"2021-02-09T12:41:43.662Z"}},"Id":{"type":"string"},"EntityRelation":{"type":"object","properties":{"entity_id":{"type":"string","example":"9a2081a2-1615-44b8-b988-d757983290dd"},"_slug":{"type":"string","enum":["contact","contract"]}}},"Meter":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"type":"object","properties":{"_id":{"type":"string","example":"991a1821-43bc-46b8-967d-64a3d87c31f8"},"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":"object","example":[{"country":"Germany","city":"Koln","postal_code":81475,"street":"Melatengürtel","street_number":71,"additional_info":"5. Etage","_tags":["billing","delivery"]}]},"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":{"type":"object","properties":{"$relation":{"type":"array","items":{"$ref":"#/components/schemas/EntityRelation"}}}},"customer":{"type":"object","properties":{"$relation":{"type":"array","items":{"$ref":"#/components/schemas/EntityRelation"}}}}}}]},"Direction":{"type":"string","enum":["feed-in","feed-out"]},"MeterReading":{"type":"object","properties":{"value":{"type":"number","example":240},"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":"991a1821-43bc-46b8-967d-64a3d87c31f8"},"direction":{"$ref":"#/components/schemas/Direction"},"timestamp":{"type":"string","description":"If the value is not provided, the system will be set with the time the request is processed.","example":"2022-10-10T00:00:00.000Z"},"source":{"type":"string","enum":["ECP","ERP","360","journey-submission"]}}},"MeterCounter":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"type":"object","properties":{"_id":{"type":"string","example":"991a1821-43bc-46b8-967d-64a3d87c31f8"},"obis_number":{"type":"string","example":"A-34"},"direction":{"$ref":"#/components/schemas/Direction"},"transformer_ratio":{"type":"number","example":70},"unit":{"type":"string","enum":["w","wh","kw","kwh","kvarh","mw","mwh","unit","cubic-meter","hour","day","month","year","percentage"]},"forecast_reading_value":{"type":"string","example":270},"forecast_as_of":{"type":"string","example":"2022-12-10T00:00:00.000Z"},"current_consumption":{"type":"number","example":240},"last_reading":{"type":"string","example":"2022-10-10T00:00:00.000Z"},"conversion_factor":{"type":"number","example":3}}}]},"ProxyMeterReading":{"allOf":[{"$ref":"#/components/schemas/MeterReading"},{"type":"object","properties":{"_org":{"type":"string","example":123}}}]}}}}')}},t={};return function r(a){if(t[a])return t[a].exports;var i=t[a]={exports:{}};return e[a].call(i.exports,i,i.exports,r),i.exports}(914)})());
package/dist/openapi.d.ts CHANGED
@@ -9,7 +9,42 @@ import type {
9
9
 
10
10
  declare namespace Components {
11
11
  namespace Schemas {
12
+ /**
13
+ * example:
14
+ * {
15
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
16
+ * "_org": "123",
17
+ * "_schema": "contact",
18
+ * "_tags": [
19
+ * "example",
20
+ * "mock"
21
+ * ],
22
+ * "_created_at": "2021-02-09T12:41:43.662Z",
23
+ * "_updated_at": "2021-02-09T12:41:43.662Z"
24
+ * }
25
+ */
26
+ export interface BaseEntity {
27
+ _id: EntityId /* uuid */;
28
+ /**
29
+ * Title of entity
30
+ */
31
+ _title: string;
32
+ /**
33
+ * Organization Id the entity belongs to
34
+ */
35
+ _org: string;
36
+ _schema: /**
37
+ * URL-friendly identifier for the entity schema
38
+ * example:
39
+ * contact
40
+ */
41
+ EntitySlug;
42
+ _tags?: string[];
43
+ _created_at: string; // date-time
44
+ _updated_at: string; // date-time
45
+ }
12
46
  export type Direction = "feed-in" | "feed-out";
47
+ export type EntityId = string; // uuid
13
48
  export interface EntityRelation {
14
49
  /**
15
50
  * example:
@@ -18,13 +53,46 @@ declare namespace Components {
18
53
  entity_id?: string;
19
54
  _slug?: "contact" | "contract";
20
55
  }
56
+ /**
57
+ * URL-friendly identifier for the entity schema
58
+ * example:
59
+ * contact
60
+ */
61
+ export type EntitySlug = string;
21
62
  export type Id = string;
63
+ /**
64
+ * example:
65
+ * {
66
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
67
+ * "_org": "123",
68
+ * "_schema": "contact",
69
+ * "_tags": [
70
+ * "example",
71
+ * "mock"
72
+ * ],
73
+ * "_created_at": {},
74
+ * "_updated_at": {}
75
+ * }
76
+ */
22
77
  export interface Meter {
78
+ _id: EntityId /* uuid */;
79
+ /**
80
+ * Title of entity
81
+ */
82
+ _title: string;
23
83
  /**
84
+ * Organization Id the entity belongs to
85
+ */
86
+ _org: string;
87
+ _schema: /**
88
+ * URL-friendly identifier for the entity schema
24
89
  * example:
25
- * 991a1821-43bc-46b8-967d-64a3d87c31f8
90
+ * contact
26
91
  */
27
- _id?: string;
92
+ EntitySlug;
93
+ _tags?: string[];
94
+ _created_at: string; // date-time
95
+ _updated_at: string; // date-time
28
96
  /**
29
97
  * example:
30
98
  * A09-123
@@ -74,7 +142,7 @@ declare namespace Components {
74
142
  manufacturer?: string;
75
143
  /**
76
144
  * example:
77
- * "2022-10-10T00:00:00.000Z"
145
+ * {}
78
146
  */
79
147
  calibration_date?: string;
80
148
  contract?: {
@@ -84,12 +152,39 @@ declare namespace Components {
84
152
  $relation?: EntityRelation[];
85
153
  };
86
154
  }
155
+ /**
156
+ * example:
157
+ * {
158
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
159
+ * "_org": "123",
160
+ * "_schema": "contact",
161
+ * "_tags": [
162
+ * "example",
163
+ * "mock"
164
+ * ],
165
+ * "_created_at": {},
166
+ * "_updated_at": {}
167
+ * }
168
+ */
87
169
  export interface MeterCounter {
170
+ _id: EntityId /* uuid */;
88
171
  /**
172
+ * Title of entity
173
+ */
174
+ _title: string;
175
+ /**
176
+ * Organization Id the entity belongs to
177
+ */
178
+ _org: string;
179
+ _schema: /**
180
+ * URL-friendly identifier for the entity schema
89
181
  * example:
90
- * 991a1821-43bc-46b8-967d-64a3d87c31f8
182
+ * contact
91
183
  */
92
- _id?: string;
184
+ EntitySlug;
185
+ _tags?: string[];
186
+ _created_at: string; // date-time
187
+ _updated_at: string; // date-time
93
188
  /**
94
189
  * example:
95
190
  * A-34
@@ -109,7 +204,7 @@ declare namespace Components {
109
204
  forecast_reading_value?: string;
110
205
  /**
111
206
  * example:
112
- * "2022-12-10T00:00:00.000Z"
207
+ * {}
113
208
  */
114
209
  forecast_as_of?: string;
115
210
  /**
@@ -119,7 +214,7 @@ declare namespace Components {
119
214
  current_consumption?: number;
120
215
  /**
121
216
  * example:
122
- * "2022-10-10T00:00:00.000Z"
217
+ * {}
123
218
  */
124
219
  last_reading?: string;
125
220
  /**
@@ -234,15 +329,35 @@ declare namespace Paths {
234
329
  }
235
330
  namespace DeleteMeterReading {
236
331
  namespace Parameters {
237
- export type Id = Components.Schemas.Id;
332
+ export type CounterId = Components.Schemas.Id;
333
+ export type MeterId = Components.Schemas.Id;
334
+ /**
335
+ * example:
336
+ * "2022-10-01T20:00:00.000Z"
337
+ */
338
+ export type Timestamp = string;
238
339
  }
239
340
  export interface PathParameters {
240
- id: Parameters.Id;
341
+ meter_id: Parameters.MeterId;
342
+ counter_id: Parameters.CounterId;
343
+ }
344
+ export interface QueryParameters {
345
+ timestamp: /**
346
+ * example:
347
+ * "2022-10-01T20:00:00.000Z"
348
+ */
349
+ Parameters.Timestamp;
241
350
  }
242
351
  namespace Responses {
243
352
  export interface $200 {
244
353
  data?: {
245
- id?: Components.Schemas.Id;
354
+ meterId?: Components.Schemas.Id;
355
+ counterId?: Components.Schemas.Id;
356
+ /**
357
+ * example:
358
+ * "2022-10-01T20:00:00.000Z"
359
+ */
360
+ timestamp?: string;
246
361
  };
247
362
  }
248
363
  }
@@ -256,14 +371,42 @@ declare namespace Paths {
256
371
  }
257
372
  namespace Responses {
258
373
  export interface $200 {
259
- data?: Components.Schemas.MeterCounter;
374
+ data?: /**
375
+ * example:
376
+ * {
377
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
378
+ * "_org": "123",
379
+ * "_schema": "contact",
380
+ * "_tags": [
381
+ * "example",
382
+ * "mock"
383
+ * ],
384
+ * "_created_at": {},
385
+ * "_updated_at": {}
386
+ * }
387
+ */
388
+ Components.Schemas.MeterCounter;
260
389
  }
261
390
  }
262
391
  }
263
392
  namespace GetCustomerMeters {
264
393
  namespace Responses {
265
394
  export interface $200 {
266
- data?: Components.Schemas.Meter[];
395
+ data?: /**
396
+ * example:
397
+ * {
398
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
399
+ * "_org": "123",
400
+ * "_schema": "contact",
401
+ * "_tags": [
402
+ * "example",
403
+ * "mock"
404
+ * ],
405
+ * "_created_at": {},
406
+ * "_updated_at": {}
407
+ * }
408
+ */
409
+ Components.Schemas.Meter[];
267
410
  }
268
411
  }
269
412
  }
@@ -325,7 +468,21 @@ declare namespace Paths {
325
468
  }
326
469
  namespace Responses {
327
470
  export interface $200 {
328
- data?: Components.Schemas.MeterCounter[];
471
+ data?: /**
472
+ * example:
473
+ * {
474
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
475
+ * "_org": "123",
476
+ * "_schema": "contact",
477
+ * "_tags": [
478
+ * "example",
479
+ * "mock"
480
+ * ],
481
+ * "_created_at": {},
482
+ * "_updated_at": {}
483
+ * }
484
+ */
485
+ Components.Schemas.MeterCounter[];
329
486
  }
330
487
  }
331
488
  }
@@ -397,10 +554,24 @@ declare namespace Paths {
397
554
  }
398
555
  namespace UpdateMeterReading {
399
556
  namespace Parameters {
400
- export type Id = Components.Schemas.Id;
557
+ export type CounterId = Components.Schemas.Id;
558
+ export type MeterId = Components.Schemas.Id;
559
+ /**
560
+ * example:
561
+ * "2022-10-01T20:00:00.000Z"
562
+ */
563
+ export type Timestamp = string;
401
564
  }
402
565
  export interface PathParameters {
403
- id: Parameters.Id;
566
+ meter_id: Parameters.MeterId;
567
+ counter_id: Parameters.CounterId;
568
+ }
569
+ export interface QueryParameters {
570
+ timestamp: /**
571
+ * example:
572
+ * "2022-10-01T20:00:00.000Z"
573
+ */
574
+ Parameters.Timestamp;
404
575
  }
405
576
  export type RequestBody = Components.Schemas.MeterReading;
406
577
  namespace Responses {
@@ -452,26 +623,6 @@ export interface OperationMethods {
452
623
  data?: Paths.CreateMeterReading.RequestBody,
453
624
  config?: AxiosRequestConfig
454
625
  ): OperationResponse<Paths.CreateMeterReading.Responses.$200>
455
- /**
456
- * updateMeterReading - updateMeterReading
457
- *
458
- * This operation updates a meter reading
459
- */
460
- 'updateMeterReading'(
461
- parameters?: Parameters<Paths.UpdateMeterReading.PathParameters> | null,
462
- data?: Paths.UpdateMeterReading.RequestBody,
463
- config?: AxiosRequestConfig
464
- ): OperationResponse<Paths.UpdateMeterReading.Responses.$200>
465
- /**
466
- * deleteMeterReading - deleteMeterReading
467
- *
468
- * This operation deletes a meter reading
469
- */
470
- 'deleteMeterReading'(
471
- parameters?: Parameters<Paths.DeleteMeterReading.PathParameters> | null,
472
- data?: any,
473
- config?: AxiosRequestConfig
474
- ): OperationResponse<Paths.DeleteMeterReading.Responses.$200>
475
626
  /**
476
627
  * createMeterReadings - createMeterReadings
477
628
  *
@@ -505,6 +656,26 @@ export interface OperationMethods {
505
656
  data?: any,
506
657
  config?: AxiosRequestConfig
507
658
  ): OperationResponse<Paths.GetReadingsByInterval.Responses.$200>
659
+ /**
660
+ * updateMeterReading - updateMeterReading
661
+ *
662
+ * This operation updates a meter reading
663
+ */
664
+ 'updateMeterReading'(
665
+ parameters?: Parameters<Paths.UpdateMeterReading.PathParameters & Paths.UpdateMeterReading.QueryParameters> | null,
666
+ data?: Paths.UpdateMeterReading.RequestBody,
667
+ config?: AxiosRequestConfig
668
+ ): OperationResponse<Paths.UpdateMeterReading.Responses.$200>
669
+ /**
670
+ * deleteMeterReading - deleteMeterReading
671
+ *
672
+ * This operation deletes a meter reading
673
+ */
674
+ 'deleteMeterReading'(
675
+ parameters?: Parameters<Paths.DeleteMeterReading.PathParameters & Paths.DeleteMeterReading.QueryParameters> | null,
676
+ data?: any,
677
+ config?: AxiosRequestConfig
678
+ ): OperationResponse<Paths.DeleteMeterReading.Responses.$200>
508
679
  /**
509
680
  * getDownSampleReadingsByInterval - getDownSampleReadingsByInterval
510
681
  *
@@ -569,28 +740,6 @@ export interface PathsDictionary {
569
740
  config?: AxiosRequestConfig
570
741
  ): OperationResponse<Paths.CreateMeterReading.Responses.$200>
571
742
  }
572
- ['/v1/metering/reading/{id}']: {
573
- /**
574
- * updateMeterReading - updateMeterReading
575
- *
576
- * This operation updates a meter reading
577
- */
578
- 'put'(
579
- parameters?: Parameters<Paths.UpdateMeterReading.PathParameters> | null,
580
- data?: Paths.UpdateMeterReading.RequestBody,
581
- config?: AxiosRequestConfig
582
- ): OperationResponse<Paths.UpdateMeterReading.Responses.$200>
583
- /**
584
- * deleteMeterReading - deleteMeterReading
585
- *
586
- * This operation deletes a meter reading
587
- */
588
- 'delete'(
589
- parameters?: Parameters<Paths.DeleteMeterReading.PathParameters> | null,
590
- data?: any,
591
- config?: AxiosRequestConfig
592
- ): OperationResponse<Paths.DeleteMeterReading.Responses.$200>
593
- }
594
743
  ['/v1/metering/readings']: {
595
744
  /**
596
745
  * createMeterReadings - createMeterReadings
@@ -629,6 +778,26 @@ export interface PathsDictionary {
629
778
  data?: any,
630
779
  config?: AxiosRequestConfig
631
780
  ): OperationResponse<Paths.GetReadingsByInterval.Responses.$200>
781
+ /**
782
+ * updateMeterReading - updateMeterReading
783
+ *
784
+ * This operation updates a meter reading
785
+ */
786
+ 'put'(
787
+ parameters?: Parameters<Paths.UpdateMeterReading.PathParameters & Paths.UpdateMeterReading.QueryParameters> | null,
788
+ data?: Paths.UpdateMeterReading.RequestBody,
789
+ config?: AxiosRequestConfig
790
+ ): OperationResponse<Paths.UpdateMeterReading.Responses.$200>
791
+ /**
792
+ * deleteMeterReading - deleteMeterReading
793
+ *
794
+ * This operation deletes a meter reading
795
+ */
796
+ 'delete'(
797
+ parameters?: Parameters<Paths.DeleteMeterReading.PathParameters & Paths.DeleteMeterReading.QueryParameters> | null,
798
+ data?: any,
799
+ config?: AxiosRequestConfig
800
+ ): OperationResponse<Paths.DeleteMeterReading.Responses.$200>
632
801
  }
633
802
  ['/v1/metering/down-sample/readings/{meter_id}/{counter_id}']: {
634
803
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/metering-client",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "description": "API Client for epilot Metering API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",