@epilot/metering-client 0.2.1 → 0.2.3

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 i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(279));t.default=n.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/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/submission":{"post":{"operationId":"createMeterReadingFromSubmission","summary":"createMeterReadingFromSubmission","description":"This operation lets to create reading from a journey submission.","tags":["Epilot_360"],"security":[{"EpilotAuth":[]}],"requestBody":{"description":"Meter reading payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionMeterReading"}}}},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}}}}},"/v1/metering/reading/with-meter":{"post":{"operationId":"createReadingWithMeter","summary":"createReadingWithMeter","description":"This operation lets to create reading along with a meter.","tags":["Epilot_360"],"security":[{"EpilotAuth":[]}],"requestBody":{"description":"Meter reading payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingWithMeter"}}}},"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 10 years 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},"firstRecordCreatedAt":{"type":"string","example":"2022-10-01T20:00:00.000Z"}}}}}}}},"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 10 years 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"]},"TariffType":{"type":"string","enum":["ht","nt"]},"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":{"$ref":"#/components/schemas/Source"}}},"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":{"$ref":"#/components/schemas/Unit"},"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},"tariff_type":{"$ref":"#/components/schemas/TariffType"}}}]},"SubmissionMeterReading":{"type":"object","properties":{},"additionalProperties":true},"Unit":{"type":"string","enum":["w","wh","kw","kWh","kvarh","mw","mWh","unit","cubic-meter","hour","day","month","year","percentage"]},"Source":{"type":"string","enum":["ECP","ERP","360","journey-submission"]},"ReadingWithMeter":{"type":"object","properties":{"ma_lo_id":{"type":"string","example":"A09-123"},"meter_id":{"$ref":"#/components/schemas/Id"},"obis_number":{"type":"string","example":"A-34"},"unit":{"$ref":"#/components/schemas/Unit"},"direction":{"$ref":"#/components/schemas/Direction"},"tariff_type":{"$ref":"#/components/schemas/TariffType"},"value":{"type":"number","example":240},"read_by":{"type":"string","example":"John Doe"},"reason":{"type":"string","example":"Storing the feed-in record"},"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-10T10:10:00.000Z"},"source":{"$ref":"#/components/schemas/Source"}}}}}}')}},t={};return function r(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.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 i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(279));t.default=n.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":[]},{"PortalAuth":[]}],"paths":{"/v1/metering/meter":{"get":{"operationId":"getCustomerMeters","summary":"getCustomerMeters","description":"Get All meters related to a customer","tags":["ECP"],"security":[{"EpilotAuth":[]},{"PortalAuth":[]}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Meter"}}}}}}}}}},"/v1/metering/meter/{id}":{"patch":{"operationId":"updateMeter","summary":"updateMeter","description":"Update the Meter details","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/EntityId"},"required":true,"description":"The Id of meter"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entity"}}}},"responses":{"200":{"description":"The returned meter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityItem"}}}}}}},"/v1/metering/counter":{"get":{"operationId":"getMeterCounters","summary":"getMeterCounters","description":"Get all counters for a given meter","tags":["ECP"],"security":[{"EpilotAuth":[]},{"PortalAuth":[]}],"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":[]},{"PortalAuth":[]}],"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":[]},{"PortalAuth":[]}],"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":[]},{"PortalAuth":[]}],"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/submission":{"post":{"operationId":"createMeterReadingFromSubmission","summary":"createMeterReadingFromSubmission","description":"This operation lets to create reading from a journey submission.","tags":["Epilot_360"],"security":[{"EpilotAuth":[]}],"requestBody":{"description":"Meter reading payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionMeterReading"}}}},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}}}}},"/v1/metering/reading/with-meter":{"post":{"operationId":"createReadingWithMeter","summary":"createReadingWithMeter","description":"This operation lets to create reading along with a meter.","tags":["Epilot_360"],"security":[{"EpilotAuth":[]}],"requestBody":{"description":"Meter reading payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingWithMeter"}}}},"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":[]},{"PortalAuth":[]}],"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 10 years 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},"firstRecordCreatedAt":{"type":"string","example":"2022-10-01T20:00:00.000Z"}}}}}}}},"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":[]},{"PortalAuth":[]}],"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 10 years 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"},"PortalAuth":{"type":"http","scheme":"bearer","description":"Authorization header with customer pilot OAuth2 bearer token","bearerFormat":"JWT"}},"schemas":{"EntityId":{"type":"string"},"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"},"_updated_at":{"type":"string"}},"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"}},"Entity":{"type":"object","properties":{},"additionalProperties":true},"EntityItem":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"$ref":"#/components/schemas/Entity"}]},"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"]},"TariffType":{"type":"string","enum":["ht","nt"]},"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":{"$ref":"#/components/schemas/Source"}}},"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":{"$ref":"#/components/schemas/Unit"},"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},"tariff_type":{"$ref":"#/components/schemas/TariffType"}}}]},"SubmissionMeterReading":{"type":"object","properties":{},"additionalProperties":true},"Unit":{"type":"string","enum":["w","wh","kw","kWh","kvarh","mw","mWh","unit","cubic-meter","hour","day","month","year","percentage"]},"Source":{"type":"string","enum":["ECP","ERP","360","journey-submission"]},"ReadingWithMeter":{"type":"object","properties":{"ma_lo_id":{"type":"string","example":"A09-123"},"meter_id":{"$ref":"#/components/schemas/Id"},"obis_number":{"type":"string","example":"A-34"},"unit":{"$ref":"#/components/schemas/Unit"},"direction":{"$ref":"#/components/schemas/Direction"},"tariff_type":{"$ref":"#/components/schemas/TariffType"},"value":{"type":"number","example":240},"read_by":{"type":"string","example":"John Doe"},"reason":{"type":"string","example":"Storing the feed-in record"},"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-10T10:10:00.000Z"},"source":{"$ref":"#/components/schemas/Source"}}}}}}')}},t={};return function r(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.exports}(914)})());
package/dist/openapi.d.ts CHANGED
@@ -24,7 +24,7 @@ declare namespace Components {
24
24
  * }
25
25
  */
26
26
  export interface BaseEntity {
27
- _id: EntityId /* uuid */;
27
+ _id: EntityId;
28
28
  /**
29
29
  * Title of entity
30
30
  */
@@ -40,11 +40,49 @@ declare namespace Components {
40
40
  */
41
41
  EntitySlug;
42
42
  _tags?: string[];
43
- _created_at: string; // date-time
44
- _updated_at: string; // date-time
43
+ _created_at: string;
44
+ _updated_at: string;
45
45
  }
46
46
  export type Direction = "feed-in" | "feed-out";
47
- export type EntityId = string; // uuid
47
+ export interface Entity {
48
+ [name: string]: any;
49
+ }
50
+ export type EntityId = string;
51
+ /**
52
+ * example:
53
+ * {
54
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
55
+ * "_org": "123",
56
+ * "_schema": "contact",
57
+ * "_tags": [
58
+ * "example",
59
+ * "mock"
60
+ * ],
61
+ * "_created_at": {},
62
+ * "_updated_at": {}
63
+ * }
64
+ */
65
+ export interface EntityItem {
66
+ [name: string]: any;
67
+ _id: EntityId;
68
+ /**
69
+ * Title of entity
70
+ */
71
+ _title: string;
72
+ /**
73
+ * Organization Id the entity belongs to
74
+ */
75
+ _org: string;
76
+ _schema: /**
77
+ * URL-friendly identifier for the entity schema
78
+ * example:
79
+ * contact
80
+ */
81
+ EntitySlug;
82
+ _tags?: string[];
83
+ _created_at: string;
84
+ _updated_at: string;
85
+ }
48
86
  export interface EntityRelation {
49
87
  /**
50
88
  * example:
@@ -75,7 +113,7 @@ declare namespace Components {
75
113
  * }
76
114
  */
77
115
  export interface Meter {
78
- _id: EntityId /* uuid */;
116
+ _id: EntityId;
79
117
  /**
80
118
  * Title of entity
81
119
  */
@@ -91,8 +129,8 @@ declare namespace Components {
91
129
  */
92
130
  EntitySlug;
93
131
  _tags?: string[];
94
- _created_at: string; // date-time
95
- _updated_at: string; // date-time
132
+ _created_at: string;
133
+ _updated_at: string;
96
134
  /**
97
135
  * example:
98
136
  * A09-123
@@ -167,7 +205,7 @@ declare namespace Components {
167
205
  * }
168
206
  */
169
207
  export interface MeterCounter {
170
- _id: EntityId /* uuid */;
208
+ _id: EntityId;
171
209
  /**
172
210
  * Title of entity
173
211
  */
@@ -183,8 +221,8 @@ declare namespace Components {
183
221
  */
184
222
  EntitySlug;
185
223
  _tags?: string[];
186
- _created_at: string; // date-time
187
- _updated_at: string; // date-time
224
+ _created_at: string;
225
+ _updated_at: string;
188
226
  /**
189
227
  * example:
190
228
  * A-34
@@ -570,6 +608,32 @@ declare namespace Paths {
570
608
  }
571
609
  }
572
610
  }
611
+ namespace UpdateMeter {
612
+ namespace Parameters {
613
+ export type Id = Components.Schemas.EntityId;
614
+ }
615
+ export interface PathParameters {
616
+ id: Parameters.Id;
617
+ }
618
+ export type RequestBody = Components.Schemas.Entity;
619
+ namespace Responses {
620
+ export type $200 = /**
621
+ * example:
622
+ * {
623
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
624
+ * "_org": "123",
625
+ * "_schema": "contact",
626
+ * "_tags": [
627
+ * "example",
628
+ * "mock"
629
+ * ],
630
+ * "_created_at": {},
631
+ * "_updated_at": {}
632
+ * }
633
+ */
634
+ Components.Schemas.EntityItem;
635
+ }
636
+ }
573
637
  namespace UpdateMeterReading {
574
638
  namespace Parameters {
575
639
  export type CounterId = Components.Schemas.Id;
@@ -611,6 +675,16 @@ export interface OperationMethods {
611
675
  data?: any,
612
676
  config?: AxiosRequestConfig
613
677
  ): OperationResponse<Paths.GetCustomerMeters.Responses.$200>
678
+ /**
679
+ * updateMeter - updateMeter
680
+ *
681
+ * Update the Meter details
682
+ */
683
+ 'updateMeter'(
684
+ parameters?: Parameters<Paths.UpdateMeter.PathParameters> | null,
685
+ data?: Paths.UpdateMeter.RequestBody,
686
+ config?: AxiosRequestConfig
687
+ ): OperationResponse<Paths.UpdateMeter.Responses.$200>
614
688
  /**
615
689
  * getMeterCounters - getMeterCounters
616
690
  *
@@ -732,6 +806,18 @@ export interface PathsDictionary {
732
806
  config?: AxiosRequestConfig
733
807
  ): OperationResponse<Paths.GetCustomerMeters.Responses.$200>
734
808
  }
809
+ ['/v1/metering/meter/{id}']: {
810
+ /**
811
+ * updateMeter - updateMeter
812
+ *
813
+ * Update the Meter details
814
+ */
815
+ 'patch'(
816
+ parameters?: Parameters<Paths.UpdateMeter.PathParameters> | null,
817
+ data?: Paths.UpdateMeter.RequestBody,
818
+ config?: AxiosRequestConfig
819
+ ): OperationResponse<Paths.UpdateMeter.Responses.$200>
820
+ }
735
821
  ['/v1/metering/counter']: {
736
822
  /**
737
823
  * getMeterCounters - getMeterCounters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/metering-client",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "API Client for epilot Metering API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,945 @@
1
+ /* eslint-disable */
2
+ import type {
3
+ OpenAPIClient,
4
+ Parameters,
5
+ UnknownParamsObject,
6
+ OperationResponse,
7
+ AxiosRequestConfig,
8
+ } from 'openapi-client-axios';
9
+
10
+ declare namespace Components {
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;
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;
44
+ _updated_at: string;
45
+ }
46
+ export type Direction = "feed-in" | "feed-out";
47
+ export interface Entity {
48
+ [name: string]: any;
49
+ }
50
+ export type EntityId = string;
51
+ /**
52
+ * example:
53
+ * {
54
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
55
+ * "_org": "123",
56
+ * "_schema": "contact",
57
+ * "_tags": [
58
+ * "example",
59
+ * "mock"
60
+ * ],
61
+ * "_created_at": {},
62
+ * "_updated_at": {}
63
+ * }
64
+ */
65
+ export interface EntityItem {
66
+ [name: string]: any;
67
+ _id: EntityId;
68
+ /**
69
+ * Title of entity
70
+ */
71
+ _title: string;
72
+ /**
73
+ * Organization Id the entity belongs to
74
+ */
75
+ _org: string;
76
+ _schema: /**
77
+ * URL-friendly identifier for the entity schema
78
+ * example:
79
+ * contact
80
+ */
81
+ EntitySlug;
82
+ _tags?: string[];
83
+ _created_at: string;
84
+ _updated_at: string;
85
+ }
86
+ export interface EntityRelation {
87
+ /**
88
+ * example:
89
+ * 9a2081a2-1615-44b8-b988-d757983290dd
90
+ */
91
+ entity_id?: string;
92
+ _slug?: "contact" | "contract";
93
+ }
94
+ /**
95
+ * URL-friendly identifier for the entity schema
96
+ * example:
97
+ * contact
98
+ */
99
+ export type EntitySlug = string;
100
+ export type Id = string;
101
+ /**
102
+ * example:
103
+ * {
104
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
105
+ * "_org": "123",
106
+ * "_schema": "contact",
107
+ * "_tags": [
108
+ * "example",
109
+ * "mock"
110
+ * ],
111
+ * "_created_at": {},
112
+ * "_updated_at": {}
113
+ * }
114
+ */
115
+ export interface Meter {
116
+ _id: EntityId;
117
+ /**
118
+ * Title of entity
119
+ */
120
+ _title: string;
121
+ /**
122
+ * Organization Id the entity belongs to
123
+ */
124
+ _org: string;
125
+ _schema: /**
126
+ * URL-friendly identifier for the entity schema
127
+ * example:
128
+ * contact
129
+ */
130
+ EntitySlug;
131
+ _tags?: string[];
132
+ _created_at: string;
133
+ _updated_at: string;
134
+ /**
135
+ * example:
136
+ * A09-123
137
+ */
138
+ ma_lo_id?: string;
139
+ 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";
140
+ /**
141
+ * example:
142
+ * Peak load tariff
143
+ */
144
+ tariff_type?: string;
145
+ /**
146
+ * example:
147
+ * J-1093-1AK
148
+ */
149
+ meter_number?: string;
150
+ sector?: "power" | "water" | "gas";
151
+ /**
152
+ * example:
153
+ * [
154
+ * {
155
+ * "country": "Germany",
156
+ * "city": "Koln",
157
+ * "postal_code": 81475,
158
+ * "street": "Melatengürtel",
159
+ * "street_number": 71,
160
+ * "additional_info": "5. Etage",
161
+ * "_tags": [
162
+ * "billing",
163
+ * "delivery"
164
+ * ]
165
+ * }
166
+ * ]
167
+ */
168
+ location?: {
169
+ [key: string]: any;
170
+ };
171
+ /**
172
+ * example:
173
+ * Domestic Usage
174
+ */
175
+ used_for?: string;
176
+ /**
177
+ * example:
178
+ * Energy One
179
+ */
180
+ manufacturer?: string;
181
+ /**
182
+ * example:
183
+ * {}
184
+ */
185
+ calibration_date?: string;
186
+ contract?: {
187
+ $relation?: EntityRelation[];
188
+ };
189
+ customer?: {
190
+ $relation?: EntityRelation[];
191
+ };
192
+ }
193
+ /**
194
+ * example:
195
+ * {
196
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
197
+ * "_org": "123",
198
+ * "_schema": "contact",
199
+ * "_tags": [
200
+ * "example",
201
+ * "mock"
202
+ * ],
203
+ * "_created_at": {},
204
+ * "_updated_at": {}
205
+ * }
206
+ */
207
+ export interface MeterCounter {
208
+ _id: EntityId;
209
+ /**
210
+ * Title of entity
211
+ */
212
+ _title: string;
213
+ /**
214
+ * Organization Id the entity belongs to
215
+ */
216
+ _org: string;
217
+ _schema: /**
218
+ * URL-friendly identifier for the entity schema
219
+ * example:
220
+ * contact
221
+ */
222
+ EntitySlug;
223
+ _tags?: string[];
224
+ _created_at: string;
225
+ _updated_at: string;
226
+ /**
227
+ * example:
228
+ * A-34
229
+ */
230
+ obis_number?: string;
231
+ direction?: Direction;
232
+ /**
233
+ * example:
234
+ * 70
235
+ */
236
+ transformer_ratio?: number;
237
+ unit?: Unit;
238
+ /**
239
+ * example:
240
+ * 270
241
+ */
242
+ forecast_reading_value?: string;
243
+ /**
244
+ * example:
245
+ * {}
246
+ */
247
+ forecast_as_of?: string;
248
+ /**
249
+ * example:
250
+ * 240
251
+ */
252
+ current_consumption?: number;
253
+ /**
254
+ * example:
255
+ * {}
256
+ */
257
+ last_reading?: string;
258
+ /**
259
+ * example:
260
+ * 3
261
+ */
262
+ conversion_factor?: number;
263
+ tariff_type?: TariffType;
264
+ }
265
+ export interface MeterReading {
266
+ /**
267
+ * example:
268
+ * 240
269
+ */
270
+ value?: number;
271
+ /**
272
+ * example:
273
+ * John Doe
274
+ */
275
+ read_by?: string;
276
+ /**
277
+ * example:
278
+ * Storing the feed-in record
279
+ */
280
+ reason?: string;
281
+ /**
282
+ * example:
283
+ * 1446829f-4b6f-474e-b978-3997d89a7928
284
+ */
285
+ meter_id?: string;
286
+ /**
287
+ * example:
288
+ * 991a1821-43bc-46b8-967d-64a3d87c31f8
289
+ */
290
+ counter_id?: string;
291
+ direction?: Direction;
292
+ /**
293
+ * If the value is not provided, the system will be set with the time the request is processed.
294
+ * example:
295
+ * "2022-10-10T00:00:00.000Z"
296
+ */
297
+ timestamp?: string;
298
+ source?: Source;
299
+ }
300
+ export interface ReadingWithMeter {
301
+ /**
302
+ * example:
303
+ * A09-123
304
+ */
305
+ ma_lo_id?: string;
306
+ meter_id?: Id;
307
+ /**
308
+ * example:
309
+ * A-34
310
+ */
311
+ obis_number?: string;
312
+ unit?: Unit;
313
+ direction?: Direction;
314
+ tariff_type?: TariffType;
315
+ /**
316
+ * example:
317
+ * 240
318
+ */
319
+ value?: number;
320
+ /**
321
+ * example:
322
+ * John Doe
323
+ */
324
+ read_by?: string;
325
+ /**
326
+ * example:
327
+ * Storing the feed-in record
328
+ */
329
+ reason?: string;
330
+ /**
331
+ * If the value is not provided, the system will be set with the time the request is processed.
332
+ * example:
333
+ * "2022-10-10T10:10:00.000Z"
334
+ */
335
+ timestamp?: string;
336
+ source?: Source;
337
+ }
338
+ export type Source = "ECP" | "ERP" | "360" | "journey-submission";
339
+ export interface SubmissionMeterReading {
340
+ [name: string]: any;
341
+ }
342
+ export type TariffType = "ht" | "nt";
343
+ export type Unit = "w" | "wh" | "kw" | "kWh" | "kvarh" | "mw" | "mWh" | "unit" | "cubic-meter" | "hour" | "day" | "month" | "year" | "percentage";
344
+ }
345
+ }
346
+ declare namespace Paths {
347
+ namespace CreateMeterReading {
348
+ export type RequestBody = Components.Schemas.MeterReading;
349
+ namespace Responses {
350
+ export interface $200 {
351
+ data?: Components.Schemas.MeterReading;
352
+ }
353
+ }
354
+ }
355
+ namespace CreateMeterReadingFromSubmission {
356
+ export type RequestBody = Components.Schemas.SubmissionMeterReading;
357
+ namespace Responses {
358
+ export interface $200 {
359
+ data?: Components.Schemas.MeterReading;
360
+ }
361
+ }
362
+ }
363
+ namespace CreateMeterReadings {
364
+ export interface RequestBody {
365
+ readings?: Components.Schemas.MeterReading[];
366
+ }
367
+ namespace Responses {
368
+ export interface $200 {
369
+ data?: Components.Schemas.MeterReading[];
370
+ }
371
+ }
372
+ }
373
+ namespace CreateReadingWithMeter {
374
+ export type RequestBody = Components.Schemas.ReadingWithMeter;
375
+ namespace Responses {
376
+ export interface $200 {
377
+ data?: Components.Schemas.MeterReading;
378
+ }
379
+ }
380
+ }
381
+ namespace DeleteMeterReading {
382
+ namespace Parameters {
383
+ export type CounterId = Components.Schemas.Id;
384
+ export type MeterId = Components.Schemas.Id;
385
+ /**
386
+ * example:
387
+ * "2022-10-01T20:00:00.000Z"
388
+ */
389
+ export type Timestamp = string;
390
+ }
391
+ export interface PathParameters {
392
+ meter_id: Parameters.MeterId;
393
+ counter_id: Parameters.CounterId;
394
+ }
395
+ export interface QueryParameters {
396
+ timestamp: /**
397
+ * example:
398
+ * "2022-10-01T20:00:00.000Z"
399
+ */
400
+ Parameters.Timestamp;
401
+ }
402
+ namespace Responses {
403
+ export interface $200 {
404
+ data?: {
405
+ meterId?: Components.Schemas.Id;
406
+ counterId?: Components.Schemas.Id;
407
+ /**
408
+ * example:
409
+ * "2022-10-01T20:00:00.000Z"
410
+ */
411
+ timestamp?: string;
412
+ };
413
+ }
414
+ }
415
+ }
416
+ namespace GetCounterDetails {
417
+ namespace Parameters {
418
+ export type CounterId = Components.Schemas.Id;
419
+ }
420
+ export interface PathParameters {
421
+ counter_id: Parameters.CounterId;
422
+ }
423
+ namespace Responses {
424
+ export interface $200 {
425
+ data?: /**
426
+ * example:
427
+ * {
428
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
429
+ * "_org": "123",
430
+ * "_schema": "contact",
431
+ * "_tags": [
432
+ * "example",
433
+ * "mock"
434
+ * ],
435
+ * "_created_at": {},
436
+ * "_updated_at": {}
437
+ * }
438
+ */
439
+ Components.Schemas.MeterCounter;
440
+ }
441
+ }
442
+ }
443
+ namespace GetCustomerMeters {
444
+ namespace Responses {
445
+ export interface $200 {
446
+ data?: /**
447
+ * example:
448
+ * {
449
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
450
+ * "_org": "123",
451
+ * "_schema": "contact",
452
+ * "_tags": [
453
+ * "example",
454
+ * "mock"
455
+ * ],
456
+ * "_created_at": {},
457
+ * "_updated_at": {}
458
+ * }
459
+ */
460
+ Components.Schemas.Meter[];
461
+ }
462
+ }
463
+ }
464
+ namespace GetDownSampleReadingsByInterval {
465
+ namespace Parameters {
466
+ export type CounterId = Components.Schemas.Id;
467
+ export type Direction = Components.Schemas.Direction;
468
+ /**
469
+ * example:
470
+ * "2022-10-10T00:00:00.000Z"
471
+ */
472
+ export type EndDate = string;
473
+ export type GroupBy = "day" | "week" | "month" | "year";
474
+ export type MeterId = Components.Schemas.Id;
475
+ /**
476
+ * example:
477
+ * "2022-10-01T00:00:00.000Z"
478
+ */
479
+ export type StartDate = string;
480
+ }
481
+ export interface PathParameters {
482
+ meter_id: Parameters.MeterId;
483
+ counter_id: Parameters.CounterId;
484
+ }
485
+ export interface QueryParameters {
486
+ start_date?: /**
487
+ * example:
488
+ * "2022-10-01T00:00:00.000Z"
489
+ */
490
+ Parameters.StartDate;
491
+ end_date?: /**
492
+ * example:
493
+ * "2022-10-10T00:00:00.000Z"
494
+ */
495
+ Parameters.EndDate;
496
+ group_by?: Parameters.GroupBy;
497
+ direction?: Parameters.Direction;
498
+ }
499
+ namespace Responses {
500
+ export interface $200 {
501
+ data?: Components.Schemas.MeterReading[];
502
+ }
503
+ }
504
+ }
505
+ namespace GetMeterCounters {
506
+ namespace Parameters {
507
+ /**
508
+ * example:
509
+ * 1446829f-4b6f-474e-b978-3997d89a7928
510
+ */
511
+ export type MeterId = string;
512
+ }
513
+ export interface QueryParameters {
514
+ meter_id: /**
515
+ * example:
516
+ * 1446829f-4b6f-474e-b978-3997d89a7928
517
+ */
518
+ Parameters.MeterId;
519
+ }
520
+ namespace Responses {
521
+ export interface $200 {
522
+ data?: /**
523
+ * example:
524
+ * {
525
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
526
+ * "_org": "123",
527
+ * "_schema": "contact",
528
+ * "_tags": [
529
+ * "example",
530
+ * "mock"
531
+ * ],
532
+ * "_created_at": {},
533
+ * "_updated_at": {}
534
+ * }
535
+ */
536
+ Components.Schemas.MeterCounter[];
537
+ }
538
+ }
539
+ }
540
+ namespace GetReadingsByInterval {
541
+ namespace Parameters {
542
+ export type CounterId = Components.Schemas.Id;
543
+ export type Direction = Components.Schemas.Direction;
544
+ /**
545
+ * example:
546
+ * "2022-10-10T00:00:00.000Z"
547
+ */
548
+ export type EndDate = string;
549
+ /**
550
+ * example:
551
+ * 0
552
+ */
553
+ export type From = number;
554
+ export type MeterId = Components.Schemas.Id;
555
+ /**
556
+ * example:
557
+ * 20
558
+ */
559
+ export type Size = number;
560
+ /**
561
+ * example:
562
+ * "2022-10-01T00:00:00.000Z"
563
+ */
564
+ export type StartDate = string;
565
+ export type Type = "cumulative" | "relative";
566
+ }
567
+ export interface PathParameters {
568
+ meter_id: Parameters.MeterId;
569
+ counter_id: Parameters.CounterId;
570
+ }
571
+ export interface QueryParameters {
572
+ start_date?: /**
573
+ * example:
574
+ * "2022-10-01T00:00:00.000Z"
575
+ */
576
+ Parameters.StartDate;
577
+ end_date?: /**
578
+ * example:
579
+ * "2022-10-10T00:00:00.000Z"
580
+ */
581
+ Parameters.EndDate;
582
+ direction?: Parameters.Direction;
583
+ size?: /**
584
+ * example:
585
+ * 20
586
+ */
587
+ Parameters.Size;
588
+ from?: /**
589
+ * example:
590
+ * 0
591
+ */
592
+ Parameters.From;
593
+ type: Parameters.Type;
594
+ }
595
+ namespace Responses {
596
+ export interface $200 {
597
+ results?: Components.Schemas.MeterReading[];
598
+ /**
599
+ * example:
600
+ * 120
601
+ */
602
+ hits?: number;
603
+ /**
604
+ * example:
605
+ * "2022-10-01T20:00:00.000Z"
606
+ */
607
+ firstRecordCreatedAt?: string;
608
+ }
609
+ }
610
+ }
611
+ namespace UpdateMeter {
612
+ namespace Parameters {
613
+ export type Id = Components.Schemas.EntityId;
614
+ }
615
+ export interface PathParameters {
616
+ id: Parameters.Id;
617
+ }
618
+ export type RequestBody = Components.Schemas.Entity;
619
+ namespace Responses {
620
+ export type $200 = /**
621
+ * example:
622
+ * {
623
+ * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
624
+ * "_org": "123",
625
+ * "_schema": "contact",
626
+ * "_tags": [
627
+ * "example",
628
+ * "mock"
629
+ * ],
630
+ * "_created_at": {},
631
+ * "_updated_at": {}
632
+ * }
633
+ */
634
+ Components.Schemas.EntityItem;
635
+ }
636
+ }
637
+ namespace UpdateMeterReading {
638
+ namespace Parameters {
639
+ export type CounterId = Components.Schemas.Id;
640
+ export type MeterId = Components.Schemas.Id;
641
+ /**
642
+ * example:
643
+ * "2022-10-01T20:00:00.000Z"
644
+ */
645
+ export type Timestamp = string;
646
+ }
647
+ export interface PathParameters {
648
+ meter_id: Parameters.MeterId;
649
+ counter_id: Parameters.CounterId;
650
+ }
651
+ export interface QueryParameters {
652
+ timestamp: /**
653
+ * example:
654
+ * "2022-10-01T20:00:00.000Z"
655
+ */
656
+ Parameters.Timestamp;
657
+ }
658
+ export type RequestBody = Components.Schemas.MeterReading;
659
+ namespace Responses {
660
+ export interface $200 {
661
+ data?: Components.Schemas.MeterReading;
662
+ }
663
+ }
664
+ }
665
+ }
666
+
667
+ export interface OperationMethods {
668
+ /**
669
+ * getCustomerMeters - getCustomerMeters
670
+ *
671
+ * Get All meters related to a customer
672
+ */
673
+ 'getCustomerMeters'(
674
+ parameters?: Parameters<UnknownParamsObject> | null,
675
+ data?: any,
676
+ config?: AxiosRequestConfig
677
+ ): OperationResponse<Paths.GetCustomerMeters.Responses.$200>
678
+ /**
679
+ * updateMeter - updateMeter
680
+ *
681
+ * Update the Meter details
682
+ */
683
+ 'updateMeter'(
684
+ parameters?: Parameters<Paths.UpdateMeter.PathParameters> | null,
685
+ data?: Paths.UpdateMeter.RequestBody,
686
+ config?: AxiosRequestConfig
687
+ ): OperationResponse<Paths.UpdateMeter.Responses.$200>
688
+ /**
689
+ * getMeterCounters - getMeterCounters
690
+ *
691
+ * Get all counters for a given meter
692
+ */
693
+ 'getMeterCounters'(
694
+ parameters?: Parameters<Paths.GetMeterCounters.QueryParameters> | null,
695
+ data?: any,
696
+ config?: AxiosRequestConfig
697
+ ): OperationResponse<Paths.GetMeterCounters.Responses.$200>
698
+ /**
699
+ * getCounterDetails - getCounterDetails
700
+ *
701
+ * Get details for a meter counter
702
+ */
703
+ 'getCounterDetails'(
704
+ parameters?: Parameters<Paths.GetCounterDetails.PathParameters> | null,
705
+ data?: any,
706
+ config?: AxiosRequestConfig
707
+ ): OperationResponse<Paths.GetCounterDetails.Responses.$200>
708
+ /**
709
+ * createMeterReading - createMeterReading
710
+ *
711
+ * This operation inserts a new meter reading
712
+ */
713
+ 'createMeterReading'(
714
+ parameters?: Parameters<UnknownParamsObject> | null,
715
+ data?: Paths.CreateMeterReading.RequestBody,
716
+ config?: AxiosRequestConfig
717
+ ): OperationResponse<Paths.CreateMeterReading.Responses.$200>
718
+ /**
719
+ * createMeterReadings - createMeterReadings
720
+ *
721
+ * This operation inserts a multiple meter readings at once, e.g; to submit bi-directional data (feed-in & feed-out) in a journey
722
+ */
723
+ 'createMeterReadings'(
724
+ parameters?: Parameters<UnknownParamsObject> | null,
725
+ data?: Paths.CreateMeterReadings.RequestBody,
726
+ config?: AxiosRequestConfig
727
+ ): OperationResponse<Paths.CreateMeterReadings.Responses.$200>
728
+ /**
729
+ * createMeterReadingFromSubmission - createMeterReadingFromSubmission
730
+ *
731
+ * This operation lets to create reading from a journey submission.
732
+ */
733
+ 'createMeterReadingFromSubmission'(
734
+ parameters?: Parameters<UnknownParamsObject> | null,
735
+ data?: Paths.CreateMeterReadingFromSubmission.RequestBody,
736
+ config?: AxiosRequestConfig
737
+ ): OperationResponse<Paths.CreateMeterReadingFromSubmission.Responses.$200>
738
+ /**
739
+ * createReadingWithMeter - createReadingWithMeter
740
+ *
741
+ * This operation lets to create reading along with a meter.
742
+ */
743
+ 'createReadingWithMeter'(
744
+ parameters?: Parameters<UnknownParamsObject> | null,
745
+ data?: Paths.CreateReadingWithMeter.RequestBody,
746
+ config?: AxiosRequestConfig
747
+ ): OperationResponse<Paths.CreateReadingWithMeter.Responses.$200>
748
+ /**
749
+ * getReadingsByInterval - getReadingsByInterval
750
+ *
751
+ * - Get all readings specified in an interval
752
+ * - If the start_date & end_date are equal, then returns the readings of the specified date
753
+ * - start_date should <= end_date
754
+ *
755
+ */
756
+ 'getReadingsByInterval'(
757
+ parameters?: Parameters<Paths.GetReadingsByInterval.PathParameters & Paths.GetReadingsByInterval.QueryParameters> | null,
758
+ data?: any,
759
+ config?: AxiosRequestConfig
760
+ ): OperationResponse<Paths.GetReadingsByInterval.Responses.$200>
761
+ /**
762
+ * updateMeterReading - updateMeterReading
763
+ *
764
+ * This operation updates a meter reading
765
+ */
766
+ 'updateMeterReading'(
767
+ parameters?: Parameters<Paths.UpdateMeterReading.PathParameters & Paths.UpdateMeterReading.QueryParameters> | null,
768
+ data?: Paths.UpdateMeterReading.RequestBody,
769
+ config?: AxiosRequestConfig
770
+ ): OperationResponse<Paths.UpdateMeterReading.Responses.$200>
771
+ /**
772
+ * deleteMeterReading - deleteMeterReading
773
+ *
774
+ * This operation deletes a meter reading
775
+ */
776
+ 'deleteMeterReading'(
777
+ parameters?: Parameters<Paths.DeleteMeterReading.PathParameters & Paths.DeleteMeterReading.QueryParameters> | null,
778
+ data?: any,
779
+ config?: AxiosRequestConfig
780
+ ): OperationResponse<Paths.DeleteMeterReading.Responses.$200>
781
+ /**
782
+ * getDownSampleReadingsByInterval - getDownSampleReadingsByInterval
783
+ *
784
+ * - Get the down sampled data of the entire readings specified in an interval
785
+ * - If the start_date & end_date are equal, then returns the readings of the specified date
786
+ * - start_date should <= end_date
787
+ *
788
+ */
789
+ 'getDownSampleReadingsByInterval'(
790
+ parameters?: Parameters<Paths.GetDownSampleReadingsByInterval.PathParameters & Paths.GetDownSampleReadingsByInterval.QueryParameters> | null,
791
+ data?: any,
792
+ config?: AxiosRequestConfig
793
+ ): OperationResponse<Paths.GetDownSampleReadingsByInterval.Responses.$200>
794
+ }
795
+
796
+ export interface PathsDictionary {
797
+ ['/v1/metering/meter']: {
798
+ /**
799
+ * getCustomerMeters - getCustomerMeters
800
+ *
801
+ * Get All meters related to a customer
802
+ */
803
+ 'get'(
804
+ parameters?: Parameters<UnknownParamsObject> | null,
805
+ data?: any,
806
+ config?: AxiosRequestConfig
807
+ ): OperationResponse<Paths.GetCustomerMeters.Responses.$200>
808
+ }
809
+ ['/v1/metering/meter/{id}']: {
810
+ /**
811
+ * updateMeter - updateMeter
812
+ *
813
+ * Update the Meter details
814
+ */
815
+ 'patch'(
816
+ parameters?: Parameters<Paths.UpdateMeter.PathParameters> | null,
817
+ data?: Paths.UpdateMeter.RequestBody,
818
+ config?: AxiosRequestConfig
819
+ ): OperationResponse<Paths.UpdateMeter.Responses.$200>
820
+ }
821
+ ['/v1/metering/counter']: {
822
+ /**
823
+ * getMeterCounters - getMeterCounters
824
+ *
825
+ * Get all counters for a given meter
826
+ */
827
+ 'get'(
828
+ parameters?: Parameters<Paths.GetMeterCounters.QueryParameters> | null,
829
+ data?: any,
830
+ config?: AxiosRequestConfig
831
+ ): OperationResponse<Paths.GetMeterCounters.Responses.$200>
832
+ }
833
+ ['/v1/metering/counter/{counter_id}']: {
834
+ /**
835
+ * getCounterDetails - getCounterDetails
836
+ *
837
+ * Get details for a meter counter
838
+ */
839
+ 'get'(
840
+ parameters?: Parameters<Paths.GetCounterDetails.PathParameters> | null,
841
+ data?: any,
842
+ config?: AxiosRequestConfig
843
+ ): OperationResponse<Paths.GetCounterDetails.Responses.$200>
844
+ }
845
+ ['/v1/metering/reading']: {
846
+ /**
847
+ * createMeterReading - createMeterReading
848
+ *
849
+ * This operation inserts a new meter reading
850
+ */
851
+ 'post'(
852
+ parameters?: Parameters<UnknownParamsObject> | null,
853
+ data?: Paths.CreateMeterReading.RequestBody,
854
+ config?: AxiosRequestConfig
855
+ ): OperationResponse<Paths.CreateMeterReading.Responses.$200>
856
+ }
857
+ ['/v1/metering/readings']: {
858
+ /**
859
+ * createMeterReadings - createMeterReadings
860
+ *
861
+ * This operation inserts a multiple meter readings at once, e.g; to submit bi-directional data (feed-in & feed-out) in a journey
862
+ */
863
+ 'post'(
864
+ parameters?: Parameters<UnknownParamsObject> | null,
865
+ data?: Paths.CreateMeterReadings.RequestBody,
866
+ config?: AxiosRequestConfig
867
+ ): OperationResponse<Paths.CreateMeterReadings.Responses.$200>
868
+ }
869
+ ['/v1/metering/reading/submission']: {
870
+ /**
871
+ * createMeterReadingFromSubmission - createMeterReadingFromSubmission
872
+ *
873
+ * This operation lets to create reading from a journey submission.
874
+ */
875
+ 'post'(
876
+ parameters?: Parameters<UnknownParamsObject> | null,
877
+ data?: Paths.CreateMeterReadingFromSubmission.RequestBody,
878
+ config?: AxiosRequestConfig
879
+ ): OperationResponse<Paths.CreateMeterReadingFromSubmission.Responses.$200>
880
+ }
881
+ ['/v1/metering/reading/with-meter']: {
882
+ /**
883
+ * createReadingWithMeter - createReadingWithMeter
884
+ *
885
+ * This operation lets to create reading along with a meter.
886
+ */
887
+ 'post'(
888
+ parameters?: Parameters<UnknownParamsObject> | null,
889
+ data?: Paths.CreateReadingWithMeter.RequestBody,
890
+ config?: AxiosRequestConfig
891
+ ): OperationResponse<Paths.CreateReadingWithMeter.Responses.$200>
892
+ }
893
+ ['/v1/metering/reading/{meter_id}/{counter_id}']: {
894
+ /**
895
+ * getReadingsByInterval - getReadingsByInterval
896
+ *
897
+ * - Get all readings specified in an interval
898
+ * - If the start_date & end_date are equal, then returns the readings of the specified date
899
+ * - start_date should <= end_date
900
+ *
901
+ */
902
+ 'get'(
903
+ parameters?: Parameters<Paths.GetReadingsByInterval.PathParameters & Paths.GetReadingsByInterval.QueryParameters> | null,
904
+ data?: any,
905
+ config?: AxiosRequestConfig
906
+ ): OperationResponse<Paths.GetReadingsByInterval.Responses.$200>
907
+ /**
908
+ * updateMeterReading - updateMeterReading
909
+ *
910
+ * This operation updates a meter reading
911
+ */
912
+ 'put'(
913
+ parameters?: Parameters<Paths.UpdateMeterReading.PathParameters & Paths.UpdateMeterReading.QueryParameters> | null,
914
+ data?: Paths.UpdateMeterReading.RequestBody,
915
+ config?: AxiosRequestConfig
916
+ ): OperationResponse<Paths.UpdateMeterReading.Responses.$200>
917
+ /**
918
+ * deleteMeterReading - deleteMeterReading
919
+ *
920
+ * This operation deletes a meter reading
921
+ */
922
+ 'delete'(
923
+ parameters?: Parameters<Paths.DeleteMeterReading.PathParameters & Paths.DeleteMeterReading.QueryParameters> | null,
924
+ data?: any,
925
+ config?: AxiosRequestConfig
926
+ ): OperationResponse<Paths.DeleteMeterReading.Responses.$200>
927
+ }
928
+ ['/v1/metering/down-sample/readings/{meter_id}/{counter_id}']: {
929
+ /**
930
+ * getDownSampleReadingsByInterval - getDownSampleReadingsByInterval
931
+ *
932
+ * - Get the down sampled data of the entire readings specified in an interval
933
+ * - If the start_date & end_date are equal, then returns the readings of the specified date
934
+ * - start_date should <= end_date
935
+ *
936
+ */
937
+ 'get'(
938
+ parameters?: Parameters<Paths.GetDownSampleReadingsByInterval.PathParameters & Paths.GetDownSampleReadingsByInterval.QueryParameters> | null,
939
+ data?: any,
940
+ config?: AxiosRequestConfig
941
+ ): OperationResponse<Paths.GetDownSampleReadingsByInterval.Responses.$200>
942
+ }
943
+ }
944
+
945
+ export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
package/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ### [0.1.1](https://github.com/epilot-dev/sdk-js/compare/v1.0.0...v0.1.1) (2022-03-09)