@epilot/metering-client 0.5.4 → 0.5.6
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.
- package/dist/definition.js +1 -1
- package/dist/openapi.d.ts +187 -45
- package/dist/openapi.json +133 -39
- package/package.json +1 -1
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={914:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(r(534));t.default=s.default},534:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Metering API","version":"1.0.0"},"tags":[{"name":"ECP","description":"APIs defined for a portal user"},{"name":"ECP Admin","description":"APIs defined for a ECP Admin"}],"security":[{"EpilotAuth":[]},{"PortalAuth":[]}],"paths":{"/v1/metering/meter":{"get":{"operationId":"getCustomerMeters","summary":"Get Customer Meters","description":"Retrieves all meters related to a customer.","tags":["ECP"],"security":[{"PortalAuth":[]}],"responses":{"200":{"description":"Customer meters retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Meter"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/contract/meters/{contract_id}":{"get":{"operationId":"getMetersByContractId","summary":"getMetersByContractId","description":"Retrieves all meters related to a contract.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"contract_id","schema":{"$ref":"#/components/schemas/EntityId"},"required":true,"description":"The ID of the Contract."}],"responses":{"200":{"description":"Meters related to the contract retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Meter"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/meter/{id}":{"patch":{"operationId":"updateMeter","summary":"Update Meter","description":"Updates the details of a meter.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/EntityId"},"required":true,"description":"The ID of the meter."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entity"}}}},"responses":{"200":{"description":"Meter updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Meter"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"get":{"operationId":"getMeter","summary":"Get Meter","description":"Retrieves the details of a meter.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/EntityId"},"required":true,"description":"The ID of the meter."}],"responses":{"200":{"description":"Meter retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/Meter"},"relations":{"type":"array","items":{"$ref":"#/components/schemas/EntityItem"}}}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/counter":{"get":{"operationId":"getMeterCounters","summary":"Get Meter Counters","description":"Retrieves all counters for a given meter.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"query","name":"meter_id","required":true,"schema":{"type":"string","example":"1446829f-4b6f-474e-b978-3997d89a7928"}}],"responses":{"200":{"description":"Counters retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterCounter"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/counter/{counter_id}":{"get":{"operationId":"getCounterDetails","summary":"Get Counter Details","description":"Retrieves the details of a meter counter.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter."}],"responses":{"200":{"description":"Counter details retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterCounter"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/reading":{"post":{"operationId":"createMeterReading","summary":"Create Meter Reading","description":"Inserts a new meter reading.","tags":["ECP Admin","ECP"],"security":[{"EpilotAuth":[]},{"PortalAuth":[]}],"requestBody":{"description":"Meter reading payload.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeterReading"}}}},"responses":{"200":{"description":"Meter reading created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/readings":{"post":{"operationId":"createMeterReadings","summary":"Create Meter Readings","description":"Inserts multiple meter readings at once.","tags":["ECP Admin","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":"Meter readings created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/reading/submission":{"post":{"operationId":"createMeterReadingFromSubmission","summary":"Create Meter Reading from Submission","description":"Creates a reading from a journey submission.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"requestBody":{"description":"Meter reading payload.","required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"org_id":{"type":"string","example":"123","description":"ID of the organization"},"entity":{"type":"object","additionalProperties":true,"properties":{"_org":{"type":"string","example":"123","description":"ID of the organization"},"meterReadings":{"type":"array","items":{"$ref":"#/components/schemas/SubmissionMeterReading"}}}}}}}}},"responses":{"200":{"description":"Meter reading created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","enum":["Successfully Processed"]}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/allowed/reading/{meter_id}":{"get":{"operationId":"getAllowedReadingForMeter","summary":"getAllowedReadingForMeter","description":"Get allowed reading for the given meter","tags":["ECP Admin","ECP"],"security":[{"EpilotAuth":[]},{"PortalAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter."},{"in":"query","name":"timestamp","required":false,"description":"If not provided, the system will default to now.","schema":{"type":"string","example":"2022-10-01T10:10:00.000Z"}}],"responses":{"200":{"description":"Recent reading for the meter fetched successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"counter_id":{"$ref":"#/components/schemas/Id"},"min_value":{"type":"number","description":"Minimum allowed reading value for the meter"},"max_value":{"type":"number","description":"Maximum allowed reading value for the meter"}}}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/reading/with-meter":{"post":{"operationId":"createReadingWithMeter","summary":"Create Reading with Meter","description":"Creates a reading along with a meter.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"requestBody":{"description":"Meter reading payload.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingWithMeter"}}}},"responses":{"200":{"description":"Reading with meter created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/reading/{meter_id}/{counter_id}":{"get":{"operationId":"getReadingsByInterval","summary":"Get Readings by Interval","description":"Retrieves all readings specified in an interval.\\nIf the start_date and end_date are equal, then it returns the readings of the specified date.\\nThe start_date should be less than or equal to the end_date.\\n","tags":["ECP Admin","ECP"],"security":[{"EpilotAuth":[]},{"PortalAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter."},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter."},{"in":"query","name":"start_date","required":false,"description":"If not provided, the system will default to 2000-01-01.","schema":{"type":"string","example":"2022-10-01"}},{"in":"query","name":"end_date","required":false,"description":"If not provided, the system will default to today\'s date.","schema":{"type":"string","example":"2022-10-10"}},{"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).\\nIf this value is provided as -1, then it 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.\\nIf this value is provided as \\"cumulative\\", then actual readings will be returned.\\nIf this value is provided as \\"relative\\", then actual consumption will be returned.\\n","schema":{"type":"string","default":"cumulative","enum":["cumulative","relative"]}},{"in":"query","name":"sort","required":false,"schema":{"type":"string","default":"asc","enum":["asc","desc"]},"description":"If this value is provided as \\"asc\\", then the results will be sorted by the timestamp field in ascending order.\\nIf this value is provided as \\"desc\\", then the results will be sorted by the timestamp field in descending order.\\n"}],"responses":{"200":{"description":"Readings retrieved successfully.","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"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"put":{"operationId":"updateMeterReading","summary":"Update Meter Reading","description":"Updates a meter reading.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter entity."},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter entity."},{"in":"query","name":"timestamp","required":true,"description":"The timestamp when the reading was created.","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":"Meter reading updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"delete":{"operationId":"deleteMeterReading","summary":"Delete Meter Reading","description":"Deletes a meter reading.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter entity."},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter entity."},{"in":"query","name":"timestamp","required":true,"description":"The timestamp when the reading was created.","schema":{"type":"string","example":"2022-10-01T20:00:00.000Z"}}],"responses":{"200":{"description":"Meter reading deleted successfully.","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"}}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/down-sample/readings/{meter_id}/{counter_id}":{"get":{"operationId":"getDownSampleReadingsByInterval","summary":"Get Down Sample Readings by Interval","description":"Retrieves the downsampled data of the entire readings specified in an interval.\\nIf the start_date and end_date are equal, then it returns the readings of the specified date.\\nThe start_date should be less than or equal to the end_date.\\n","tags":["ECP Admin","ECP"],"security":[{"EpilotAuth":[]},{"PortalAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter."},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter."},{"in":"query","name":"start_date","required":false,"description":"If not provided, the system will default to 2000-01-01.","schema":{"type":"string","example":"2022-10-01"}},{"in":"query","name":"end_date","required":false,"description":"If not provided, the system will default to today\'s date.","schema":{"type":"string","example":"2022-10-10"}},{"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"}},{"in":"query","name":"sort","required":false,"schema":{"type":"string","default":"asc","enum":["asc","desc"]},"description":"If this value is provided as \\"asc\\", then the results will be sorted by the timestamp field in ascending order.\\nIf this value is provided as \\"desc\\", then the results will be sorted by the timestamp field in descending order.\\n"}],"responses":{"200":{"description":"Downsampled readings retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"responses":{"InvalidRequest":{"description":"The request could not be validated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"Unauthorized":{"description":"Could not authenticate the user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"Forbidden":{"description":"The user is not allowed to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}}},"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 portal OAuth2 bearer token","bearerFormat":"JWT"}},"schemas":{"ErrorResp":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}},"EntityId":{"type":"string"},"BaseEntity":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/EntityId","description":"Entity ID","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"_title":{"type":"string","description":"Title of the entity","example":"Example Entity"},"_org":{"type":"string","description":"Organization ID the entity belongs to","example":"123"},"_tags":{"type":"array","items":{"type":"string"},"description":"Array of entity tags","example":["example","mock"]},"_created_at":{"type":"string","format":"date-time","description":"Creation timestamp of the entity","example":"2021-02-09T12:41:43.662Z"},"_updated_at":{"type":"string","format":"date-time","description":"Last update timestamp of the entity","example":"2021-02-09T12:41:43.662Z"}},"required":["_id","_title","_org","_created_at","_updated_at"]},"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","required":["_schema"],"properties":{"_schema":{"type":"string","enum":["meter"],"description":"The schema type of the meter"},"ma_lo_id":{"type":"string","example":"A09-123","description":"The MA-LO ID of the meter"},"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"],"description":"The type of the meter"},"tariff_type":{"type":"string","example":"Peak load tariff","description":"The tariff type of the meter"},"meter_number":{"type":"string","example":"J-1093-1AK","description":"The number of the meter"},"sector":{"type":"string","enum":["power","water","gas"],"description":"The sector to which the meter belongs"},"location":{"type":"object","example":[{"country":"Germany","city":"Koln","postal_code":81475,"street":"Melatengürtel","street_number":71,"additional_info":"5. Etage","_tags":["billing","delivery"]}],"description":"The location information of the meter"},"used_for":{"type":"string","example":"Domestic Usage","description":"The usage purpose of the meter"},"manufacturer":{"type":"string","example":"Energy One","description":"The manufacturer of the meter"},"calibration_date":{"type":"string","example":"2022-10-10T00:00:00.000Z","description":"The calibration date of the meter"},"contract":{"type":"object","properties":{"$relation":{"type":"array","items":{"$ref":"#/components/schemas/EntityRelation"}}},"description":"The contract associated with the meter"},"customer":{"type":"object","properties":{"$relation":{"type":"array","items":{"$ref":"#/components/schemas/EntityRelation"}}},"description":"The customer associated with the meter"}}}]},"Direction":{"type":"string","enum":["feed-in","feed-out"]},"TariffType":{"type":"string","enum":["ht","nt"]},"ReadingStatus":{"type":"string","enum":["valid","in-validation","implausible"]},"MeterReading":{"type":"object","required":["value","meter_id","source"],"properties":{"value":{"type":"number","example":240,"description":"The reading value of the meter"},"read_by":{"type":"string","example":"John Doe","description":"The person who recorded the reading"},"reason":{"type":"string","example":"Storing the feed-in record","description":"The reason for recording the reading"},"meter_id":{"type":"string","example":"1446829f-4b6f-474e-b978-3997d89a7928","description":"The ID of the associated meter"},"counter_id":{"type":"string","example":"991a1821-43bc-46b8-967d-64a3d87c31f8","description":"The ID of the associated meter counter"},"direction":{"$ref":"#/components/schemas/Direction","description":"The direction of the reading (feed-in or feed-out)"},"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","description":"The source of the reading"},"status":{"$ref":"#/components/schemas/ReadingStatus","description":"The status of the reading"},"minNextReadingValue":{"type":"number","example":250,"description":"The minimum value for the next reading"},"maxNextReadingValue":{"type":"number","example":260,"description":"The maximum value for the next reading"}}},"MeterCounter":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"type":"object","required":["_schema"],"properties":{"_id":{"type":"string","example":"991a1821-43bc-46b8-967d-64a3d87c31f8"},"_schema":{"type":"string","enum":["meter_counter"]},"obis_number":{"type":"string","example":"A-34","description":"The OBIS number of the meter counter"},"direction":{"$ref":"#/components/schemas/Direction","description":"The direction of the meter counter"},"transformer_ratio":{"type":"number","example":70,"description":"The transformer ratio of the meter counter"},"unit":{"$ref":"#/components/schemas/Unit","description":"The unit of measurement for the meter counter"},"forecast_reading_value":{"type":"string","example":270,"description":"The forecast reading value of the meter counter"},"forecast_as_of":{"type":"string","example":"2022-12-10T00:00:00.000Z","description":"The date as of which the forecast reading value is applicable"},"current_consumption":{"type":"number","example":240,"description":"The current consumption value of the meter counter"},"last_reading":{"type":"string","example":"2022-10-10T00:00:00.000Z","description":"The timestamp of the last reading"},"conversion_factor":{"type":"number","example":3,"description":"The conversion factor for the meter counter"},"tariff_type":{"$ref":"#/components/schemas/TariffType","description":"The tariff type of the meter counter"}}}]},"CounterReadingOnSubmission":{"type":"object","required":["counterId","direction","value"],"properties":{"counterId":{"$ref":"#/components/schemas/Id","description":"The ID of the associated meter counter"},"direction":{"$ref":"#/components/schemas/Direction","description":"The direction of the reading (feed-in or feed-out)"},"unit":{"type":"string","enum":["w","wh","kw","kWh","kvarh","mw","mWh","unit","cubic-meter","hour","day","month","year","percentage"],"description":"The unit of measurement for the reading"},"value":{"type":"number","example":240,"description":"The reading value of the meter counter"}}},"SubmissionMeterReading":{"type":"object","required":["meterId"],"nullable":true,"properties":{"meterId":{"$ref":"#/components/schemas/Id","description":"The ID of the associated meter"},"readings":{"type":"array","items":{"$ref":"#/components/schemas/CounterReadingOnSubmission"},"description":"- The counter readings of a meter\\n- This is only sent when the user is authenticated while submitting a journey\\n"},"readingValue":{"type":"number","example":240,"description":"The reading value of the meter when the counterId is passed or when the meterType is one-tariff"},"readingDate":{"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"},"readBy":{"type":"string","example":"John Doe","description":"The person who recorded the reading"},"reason":{"type":"string","example":"Storing the feed-in record","description":"The reason for recording the reading"},"maloId":{"type":"string","example":"A09-123","description":"The MA-LO ID of the meter"},"obisNumber":{"type":"string","example":"A-34","description":"The OBIS number of the meter counter"},"readingUnit":{"$ref":"#/components/schemas/Unit","description":"The unit of measurement for the reading"},"meterType":{"type":"string","enum":["one_tariff","two_tariff","bi_directional"],"description":"The type of the meter"},"feedInValue":{"type":"number","example":240,"description":"The feed-in value of the meter when meterType is one-tariff or bi-directional"},"feedOutValue":{"type":"number","example":240,"description":"The feed-out value of the meter when meterType is bi-directional"},"htValue":{"type":"number","example":240,"description":"The high-peak tariff value of the meter when meterType is two-tariff"},"ntValue":{"type":"number","example":240,"description":"The off-peak tariff value of the meter when meterType is two-tariff"}}},"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","description":"The MA-LO ID of the meter"},"meter_id":{"$ref":"#/components/schemas/Id","description":"The ID of the associated meter"},"obis_number":{"type":"string","example":"A-34","description":"The OBIS number of the meter counter"},"unit":{"$ref":"#/components/schemas/Unit","description":"The unit of measurement for the reading"},"direction":{"$ref":"#/components/schemas/Direction","description":"The direction of the reading"},"tariff_type":{"$ref":"#/components/schemas/TariffType","description":"The tariff type of the reading"},"value":{"type":"number","example":240,"description":"The reading value"},"read_by":{"type":"string","example":"John Doe","description":"The person who recorded the reading"},"reason":{"type":"string","example":"Storing the feed-in record","description":"The reason for recording the reading"},"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","description":"The source of the reading"}}}}},"servers":[{"url":"https://metering.sls.epilot.io"}]}')}},t={},r=function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}(914),n=exports;for(var s in r)n[s]=r[s];r.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
|
|
1
|
+
(()=>{"use strict";var e={914:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(r(534));t.default=s.default},534:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Metering API","version":"1.0.0"},"tags":[{"name":"ECP","description":"APIs defined for a portal user"},{"name":"ECP Admin","description":"APIs defined for a ECP Admin"}],"security":[{"EpilotAuth":[]},{"PortalAuth":[]},{"EitherAuth":[]}],"paths":{"/v1/metering/meter":{"get":{"operationId":"getCustomerMeters","summary":"Get Customer Meters","description":"Retrieves all meters related to a customer.","tags":["ECP"],"security":[{"PortalAuth":[]}],"responses":{"200":{"description":"Customer meters retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Meter"},{"type":"object","properties":{"journey_actions":{"$ref":"#/components/schemas/JourneyActions"}}}]}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/contract/meters/{contract_id}":{"get":{"operationId":"getMetersByContractId","summary":"getMetersByContractId","description":"Retrieves all meters related to a contract.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"contract_id","schema":{"$ref":"#/components/schemas/EntityId"},"required":true,"description":"The ID of the Contract."}],"responses":{"200":{"description":"Meters related to the contract retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Meter"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/meter/{id}":{"patch":{"operationId":"updateMeter","summary":"Update Meter","description":"Updates the details of a meter.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/EntityId"},"required":true,"description":"The ID of the meter."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entity"}}}},"responses":{"200":{"description":"Meter updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Meter"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"get":{"operationId":"getMeter","summary":"Get Meter","description":"Retrieves the details of a meter.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/EntityId"},"required":true,"description":"The ID of the meter."}],"responses":{"200":{"description":"Meter retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/Meter"},"journey_actions":{"$ref":"#/components/schemas/JourneyActions"},"relations":{"type":"array","items":{"$ref":"#/components/schemas/EntityItem"}}}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/counter":{"get":{"operationId":"getMeterCounters","summary":"Get Meter Counters","description":"Retrieves all counters for a given meter.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"query","name":"meter_id","required":true,"schema":{"$ref":"#/components/schemas/EntityId"}}],"responses":{"200":{"description":"Counters retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterCounter"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/counter/{counter_id}":{"get":{"operationId":"getCounterDetails","summary":"Get Counter Details","description":"Retrieves the details of a meter counter.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter."}],"responses":{"200":{"description":"Counter details retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterCounter"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/reading":{"post":{"operationId":"createMeterReading","summary":"Create Meter Reading","description":"Inserts a new meter reading.","tags":["ECP Admin","ECP"],"security":[{"EitherAuth":[]}],"requestBody":{"description":"Meter reading payload.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeterReading"}}}},"responses":{"200":{"description":"Meter reading created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/readings":{"post":{"operationId":"createMeterReadings","summary":"Create Meter Readings","description":"Inserts multiple meter readings at once.","tags":["ECP Admin","ECP"],"security":[{"EitherAuth":[]}],"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":"Meter readings created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/reading/submission":{"post":{"operationId":"createMeterReadingFromSubmission","summary":"Create Meter Reading from Submission","description":"Creates a reading from a journey submission.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"requestBody":{"description":"Meter reading payload.","required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"org_id":{"type":"string","example":"123","description":"ID of the organization"},"entity":{"type":"object","additionalProperties":true,"properties":{"_org":{"type":"string","example":"123","description":"ID of the organization"},"meterReadings":{"type":"array","items":{"$ref":"#/components/schemas/SubmissionMeterReading"}}}}}}}}},"responses":{"200":{"description":"Meter reading created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","enum":["Successfully Processed"]}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/allowed/reading/{meter_id}":{"get":{"operationId":"getAllowedReadingForMeter","summary":"getAllowedReadingForMeter","description":"Get allowed reading for the given meter","tags":["ECP Admin","ECP"],"security":[{"EitherAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter."},{"in":"query","name":"timestamp","required":false,"description":"If not provided, the system will default to now.","schema":{"type":"string","example":"2022-10-01T10:10:00.000Z"}}],"responses":{"200":{"description":"Recent reading for the meter fetched successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"counter_id":{"$ref":"#/components/schemas/Id"},"min_value":{"type":"number","description":"Minimum allowed reading value for the meter"},"max_value":{"type":"number","description":"Maximum allowed reading value for the meter"}}}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/reading/with-meter":{"post":{"operationId":"createReadingWithMeter","summary":"Create Reading with Meter","description":"Creates a reading along with a meter.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"requestBody":{"description":"Meter reading payload.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingWithMeter"}}}},"responses":{"200":{"description":"Reading with meter created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/reading/{meter_id}/{counter_id}":{"get":{"operationId":"getReadingsByInterval","summary":"Get Readings by Interval","description":"Retrieves all readings specified in an interval.\\nIf the start_date and end_date are equal, then it returns the readings of the specified date.\\nThe start_date should be less than or equal to the end_date.\\n","tags":["ECP Admin","ECP"],"security":[{"EitherAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter."},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter."},{"in":"query","name":"start_date","required":false,"description":"If not provided, the system will default to 2000-01-01.","schema":{"type":"string","example":"2022-10-01"}},{"in":"query","name":"end_date","required":false,"description":"If not provided, the system will default to today\'s date.","schema":{"type":"string","example":"2022-10-10"}},{"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).\\nIf this value is provided as -1, then it 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.\\nIf this value is provided as \\"cumulative\\", then actual readings will be returned.\\nIf this value is provided as \\"relative\\", then actual consumption will be returned.\\n","schema":{"type":"string","default":"cumulative","enum":["cumulative","relative"]}},{"in":"query","name":"sort","required":false,"schema":{"type":"string","default":"asc","enum":["asc","desc"]},"description":"If this value is provided as \\"asc\\", then the results will be sorted by the timestamp field in ascending order.\\nIf this value is provided as \\"desc\\", then the results will be sorted by the timestamp field in descending order.\\n"}],"responses":{"200":{"description":"Readings retrieved successfully.","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"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"put":{"operationId":"updateMeterReading","summary":"Update Meter Reading","description":"Updates a meter reading.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter entity."},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter entity."},{"in":"query","name":"timestamp","required":true,"description":"The timestamp when the reading was created.","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":"Meter reading updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"delete":{"operationId":"deleteMeterReading","summary":"Delete Meter Reading","description":"Deletes a meter reading.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter entity."},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter entity."},{"in":"query","name":"timestamp","required":true,"description":"The timestamp when the reading was created.","schema":{"type":"string","example":"2022-10-01T20:00:00.000Z"}}],"responses":{"200":{"description":"Meter reading deleted successfully.","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"}}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/down-sample/readings/{meter_id}/{counter_id}":{"get":{"operationId":"getDownSampleReadingsByInterval","summary":"Get Down Sample Readings by Interval","description":"Retrieves the downsampled data of the entire readings specified in an interval.\\nIf the start_date and end_date are equal, then it returns the readings of the specified date.\\nThe start_date should be less than or equal to the end_date.\\n","tags":["ECP Admin","ECP"],"security":[{"EitherAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter."},{"in":"path","name":"counter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the counter."},{"in":"query","name":"start_date","required":false,"description":"If not provided, the system will default to 2000-01-01.","schema":{"type":"string","example":"2022-10-01"}},{"in":"query","name":"end_date","required":false,"description":"If not provided, the system will default to today\'s date.","schema":{"type":"string","example":"2022-10-10"}},{"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"}},{"in":"query","name":"sort","required":false,"schema":{"type":"string","default":"asc","enum":["asc","desc"]},"description":"If this value is provided as \\"asc\\", then the results will be sorted by the timestamp field in ascending order.\\nIf this value is provided as \\"desc\\", then the results will be sorted by the timestamp field in descending order.\\n"}],"responses":{"200":{"description":"Downsampled readings retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeterReading"}}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"responses":{"InvalidRequest":{"description":"The request could not be validated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"Unauthorized":{"description":"Could not authenticate the user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"Forbidden":{"description":"The user is not allowed to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}}},"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 portal OAuth2 bearer token","bearerFormat":"JWT"},"EitherAuth":{"type":"http","scheme":"bearer","description":"Portal or Epilot Bearer Token"}},"schemas":{"ErrorResp":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}},"EntityId":{"type":"string","format":"uuid"},"BaseEntity":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/EntityId","description":"Entity ID","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"_title":{"type":"string","description":"Title of the entity","example":"Example Entity"},"_org":{"type":"string","description":"Organization ID the entity belongs to","example":"123"},"_tags":{"type":"array","items":{"type":"string"},"description":"Array of entity tags","example":["example","mock"]},"_created_at":{"type":"string","format":"date-time","description":"Creation timestamp of the entity","example":"2021-02-09T12:41:43.662Z"},"_updated_at":{"type":"string","format":"date-time","description":"Last update timestamp of the entity","example":"2021-02-09T12:41:43.662Z"}},"required":["_id","_title","_org","_created_at","_updated_at"]},"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":{"$ref":"#/components/schemas/EntityId"},"_slug":{"type":"string","enum":["contact","contract"]}}},"Meter":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"type":"object","required":["_schema"],"properties":{"_schema":{"type":"string","enum":["meter"],"description":"The schema type of the meter"},"ma_lo_id":{"type":"string","example":"A09-123","description":"The MA-LO ID of the meter"},"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"],"description":"The type of the meter"},"tariff_type":{"type":"string","example":"Peak load tariff","description":"The tariff type of the meter"},"meter_number":{"type":"string","example":"J-1093-1AK","description":"The number of the meter"},"sector":{"type":"string","enum":["power","water","gas"],"description":"The sector to which the meter belongs"},"location":{"type":"object","example":[{"country":"Germany","city":"Koln","postal_code":81475,"street":"Melatengürtel","street_number":71,"additional_info":"5. Etage","_tags":["billing","delivery"]}],"description":"The location information of the meter"},"used_for":{"type":"string","example":"Domestic Usage","description":"The usage purpose of the meter"},"manufacturer":{"type":"string","example":"Energy One","description":"The manufacturer of the meter"},"calibration_date":{"type":"string","example":"2022-10-10T00:00:00.000Z","description":"The calibration date of the meter"},"contract":{"type":"object","properties":{"$relation":{"type":"array","items":{"$ref":"#/components/schemas/EntityRelation"}}},"description":"The contract associated with the meter"},"customer":{"type":"object","properties":{"$relation":{"type":"array","items":{"$ref":"#/components/schemas/EntityRelation"}}},"description":"The customer associated with the meter"}}}]},"Direction":{"type":"string","enum":["feed-in","feed-out"]},"TariffType":{"type":"string","enum":["ht","nt"]},"ReadingStatus":{"type":"string","enum":["valid","in-validation","implausible"]},"MeterReading":{"type":"object","required":["value","meter_id","source"],"properties":{"value":{"type":"number","example":240,"description":"The reading value of the meter"},"read_by":{"type":"string","example":"John Doe","description":"The person who recorded the reading"},"reason":{"type":"string","example":"Storing the feed-in record","description":"The reason for recording the reading"},"meter_id":{"$ref":"#/components/schemas/EntityId","description":"The ID of the associated meter"},"counter_id":{"$ref":"#/components/schemas/EntityId","description":"The ID of the associated meter counter"},"direction":{"$ref":"#/components/schemas/Direction","description":"The direction of the reading (feed-in or feed-out)"},"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","description":"The source of the reading"},"status":{"$ref":"#/components/schemas/ReadingStatus","description":"The status of the reading"},"minNextReadingValue":{"type":"number","example":250,"description":"The minimum value for the next reading"},"maxNextReadingValue":{"type":"number","example":260,"description":"The maximum value for the next reading"}}},"MeterCounter":{"allOf":[{"$ref":"#/components/schemas/BaseEntity"},{"type":"object","required":["_schema"],"properties":{"_id":{"$ref":"#/components/schemas/EntityId"},"_schema":{"type":"string","enum":["meter_counter"]},"obis_number":{"type":"string","example":"A-34","description":"The OBIS number of the meter counter"},"direction":{"$ref":"#/components/schemas/Direction","description":"The direction of the meter counter"},"transformer_ratio":{"type":"number","example":70,"description":"The transformer ratio of the meter counter"},"unit":{"$ref":"#/components/schemas/Unit","description":"The unit of measurement for the meter counter"},"forecast_reading_value":{"type":"string","example":270,"description":"The forecast reading value of the meter counter"},"forecast_as_of":{"type":"string","example":"2022-12-10T00:00:00.000Z","description":"The date as of which the forecast reading value is applicable"},"current_consumption":{"type":"number","example":240,"description":"The current consumption value of the meter counter"},"last_reading":{"type":"string","example":"2022-10-10T00:00:00.000Z","description":"The timestamp of the last reading"},"conversion_factor":{"type":"number","example":3,"description":"The conversion factor for the meter counter"},"tariff_type":{"$ref":"#/components/schemas/TariffType","description":"The tariff type of the meter counter"}}}]},"CounterReadingOnSubmission":{"type":"object","required":["counterId","direction","value"],"properties":{"counterId":{"$ref":"#/components/schemas/Id","description":"The ID of the associated meter counter"},"direction":{"$ref":"#/components/schemas/Direction","description":"The direction of the reading (feed-in or feed-out)"},"unit":{"type":"string","enum":["w","wh","kw","kWh","kvarh","mw","mWh","unit","cubic-meter","hour","day","month","year","percentage"],"description":"The unit of measurement for the reading"},"value":{"type":"number","example":240,"description":"The reading value of the meter counter"}}},"AuthenticatedSubmission":{"type":"object","nullable":true,"required":["meterId"],"properties":{"meterId":{"$ref":"#/components/schemas/Id","description":"The ID of the associated meter"},"readings":{"type":"array","items":{"$ref":"#/components/schemas/CounterReadingOnSubmission"},"description":"- The counter readings of a meter\\n- This is only sent when the user is authenticated while submitting a journey\\n"},"readingDate":{"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"},"readBy":{"type":"string","example":"John Doe","description":"The person who recorded the reading"},"reason":{"type":"string","example":"Storing the feed-in record","description":"The reason for recording the reading"},"maloId":{"type":"string","example":"A09-123","description":"The MA-LO ID of the meter"}}},"UnauthenticatedSubmission":{"type":"object","nullable":true,"properties":{"meterId":{"$ref":"#/components/schemas/Id","description":"The ID of the associated meter"},"readingValue":{"type":"number","example":240,"description":"The reading value of the meter when the counterId is passed or when the meterType is one-tariff"},"readingDate":{"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"},"readBy":{"type":"string","example":"John Doe","description":"The person who recorded the reading"},"reason":{"type":"string","example":"Storing the feed-in record","description":"The reason for recording the reading"},"maloId":{"type":"string","example":"A09-123","description":"The MA-LO ID of the meter"},"readingUnit":{"$ref":"#/components/schemas/Unit","description":"The unit of measurement for the reading"},"meterType":{"type":"string","enum":["one_tariff","two_tariff","bi_directional"],"description":"The type of the meter"},"feedInValue":{"type":"number","example":240,"description":"The feed-in value of the meter when meterType is one-tariff or bi-directional"},"feedOutValue":{"type":"number","example":240,"description":"The feed-out value of the meter when meterType is bi-directional"},"htValue":{"type":"number","example":240,"description":"The high-peak tariff value of the meter when meterType is two-tariff"},"ntValue":{"type":"number","example":240,"description":"The off-peak tariff value of the meter when meterType is two-tariff"}}},"SubmissionMeterReading":{"oneOf":[{"$ref":"#/components/schemas/AuthenticatedSubmission"},{"$ref":"#/components/schemas/UnauthenticatedSubmission"}]},"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"]},"ActionLabel":{"type":"object","properties":{"en":{"type":"string","nullable":true},"de":{"type":"string","nullable":true}}},"Rule":{"type":"object","properties":{"entity":{"type":"string","nullable":true},"attribute":{"type":"string","nullable":true},"attribute_value":{"type":"string","nullable":true}}},"JourneyActions":{"type":"object","properties":{"journey_id":{"type":"string","nullable":true},"action_label":{"type":"object","$ref":"#/components/schemas/ActionLabel","nullable":true},"slug":{"type":"string","nullable":true},"rules":{"type":"array","items":{"$ref":"#/components/schemas/Rule"},"nullable":true}}},"ReadingWithMeter":{"type":"object","properties":{"ma_lo_id":{"type":"string","example":"A09-123","description":"The MA-LO ID of the meter"},"meter_id":{"$ref":"#/components/schemas/Id","description":"The ID of the associated meter"},"obis_number":{"type":"string","example":"A-34","description":"The OBIS number of the meter counter"},"unit":{"$ref":"#/components/schemas/Unit","description":"The unit of measurement for the reading"},"direction":{"$ref":"#/components/schemas/Direction","description":"The direction of the reading"},"tariff_type":{"$ref":"#/components/schemas/TariffType","description":"The tariff type of the reading"},"value":{"type":"number","example":240,"description":"The reading value"},"read_by":{"type":"string","example":"John Doe","description":"The person who recorded the reading"},"reason":{"type":"string","example":"Storing the feed-in record","description":"The reason for recording the reading"},"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","description":"The source of the reading"}}}}},"servers":[{"url":"https://metering.sls.epilot.io"}]}')}},t={},r=function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}(914),n=exports;for(var s in r)n[s]=r[s];r.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
|
package/dist/openapi.d.ts
CHANGED
|
@@ -15,13 +15,53 @@ declare namespace Components {
|
|
|
15
15
|
export type Unauthorized = Schemas.ErrorResp;
|
|
16
16
|
}
|
|
17
17
|
namespace Schemas {
|
|
18
|
+
export interface ActionLabel {
|
|
19
|
+
en?: string | null;
|
|
20
|
+
de?: string | null;
|
|
21
|
+
}
|
|
22
|
+
export type AuthenticatedSubmission = {
|
|
23
|
+
/**
|
|
24
|
+
* The ID of the associated meter
|
|
25
|
+
*/
|
|
26
|
+
meterId: Id;
|
|
27
|
+
/**
|
|
28
|
+
* - The counter readings of a meter
|
|
29
|
+
* - This is only sent when the user is authenticated while submitting a journey
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
readings?: CounterReadingOnSubmission[];
|
|
33
|
+
/**
|
|
34
|
+
* If the value is not provided, the system will be set with the time the request is processed.
|
|
35
|
+
* example:
|
|
36
|
+
* 2022-10-10T10:10:00.000Z
|
|
37
|
+
*/
|
|
38
|
+
readingDate?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The person who recorded the reading
|
|
41
|
+
* example:
|
|
42
|
+
* John Doe
|
|
43
|
+
*/
|
|
44
|
+
readBy?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The reason for recording the reading
|
|
47
|
+
* example:
|
|
48
|
+
* Storing the feed-in record
|
|
49
|
+
*/
|
|
50
|
+
reason?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The MA-LO ID of the meter
|
|
53
|
+
* example:
|
|
54
|
+
* A09-123
|
|
55
|
+
*/
|
|
56
|
+
maloId?: string;
|
|
57
|
+
} | null;
|
|
18
58
|
export interface BaseEntity {
|
|
19
59
|
/**
|
|
20
60
|
* Entity ID
|
|
21
61
|
* example:
|
|
22
62
|
* 3fa85f64-5717-4562-b3fc-2c963f66afa6
|
|
23
63
|
*/
|
|
24
|
-
_id: EntityId
|
|
64
|
+
_id: EntityId /* uuid */;
|
|
25
65
|
/**
|
|
26
66
|
* Title of the entity
|
|
27
67
|
* example:
|
|
@@ -80,10 +120,10 @@ declare namespace Components {
|
|
|
80
120
|
export interface Entity {
|
|
81
121
|
[name: string]: any;
|
|
82
122
|
}
|
|
83
|
-
export type EntityId = string;
|
|
123
|
+
export type EntityId = string; // uuid
|
|
84
124
|
export interface EntityItem {
|
|
85
125
|
[name: string]: any;
|
|
86
|
-
_id: EntityId
|
|
126
|
+
_id: EntityId /* uuid */;
|
|
87
127
|
/**
|
|
88
128
|
* Title of the entity
|
|
89
129
|
* example:
|
|
@@ -119,11 +159,7 @@ declare namespace Components {
|
|
|
119
159
|
_updated_at: string; // date-time
|
|
120
160
|
}
|
|
121
161
|
export interface EntityRelation {
|
|
122
|
-
|
|
123
|
-
* example:
|
|
124
|
-
* 9a2081a2-1615-44b8-b988-d757983290dd
|
|
125
|
-
*/
|
|
126
|
-
entity_id?: string;
|
|
162
|
+
entity_id?: EntityId /* uuid */;
|
|
127
163
|
_slug?: "contact" | "contract";
|
|
128
164
|
}
|
|
129
165
|
export interface ErrorResp {
|
|
@@ -133,8 +169,14 @@ declare namespace Components {
|
|
|
133
169
|
message?: string;
|
|
134
170
|
}
|
|
135
171
|
export type Id = string;
|
|
172
|
+
export interface JourneyActions {
|
|
173
|
+
journey_id?: string | null;
|
|
174
|
+
action_label?: ActionLabel;
|
|
175
|
+
slug?: string | null;
|
|
176
|
+
rules?: Rule[] | null;
|
|
177
|
+
}
|
|
136
178
|
export interface Meter {
|
|
137
|
-
_id: EntityId
|
|
179
|
+
_id: EntityId /* uuid */;
|
|
138
180
|
/**
|
|
139
181
|
* Title of the entity
|
|
140
182
|
* example:
|
|
@@ -251,7 +293,7 @@ declare namespace Components {
|
|
|
251
293
|
};
|
|
252
294
|
}
|
|
253
295
|
export interface MeterCounter {
|
|
254
|
-
_id: EntityId
|
|
296
|
+
_id: EntityId /* uuid */;
|
|
255
297
|
/**
|
|
256
298
|
* Title of the entity
|
|
257
299
|
* example:
|
|
@@ -353,16 +395,12 @@ declare namespace Components {
|
|
|
353
395
|
reason?: string;
|
|
354
396
|
/**
|
|
355
397
|
* The ID of the associated meter
|
|
356
|
-
* example:
|
|
357
|
-
* 1446829f-4b6f-474e-b978-3997d89a7928
|
|
358
398
|
*/
|
|
359
|
-
meter_id:
|
|
399
|
+
meter_id: EntityId /* uuid */;
|
|
360
400
|
/**
|
|
361
401
|
* The ID of the associated meter counter
|
|
362
|
-
* example:
|
|
363
|
-
* 991a1821-43bc-46b8-967d-64a3d87c31f8
|
|
364
402
|
*/
|
|
365
|
-
counter_id?:
|
|
403
|
+
counter_id?: EntityId /* uuid */;
|
|
366
404
|
/**
|
|
367
405
|
* The direction of the reading (feed-in or feed-out)
|
|
368
406
|
*/
|
|
@@ -453,18 +491,19 @@ declare namespace Components {
|
|
|
453
491
|
*/
|
|
454
492
|
source?: Source;
|
|
455
493
|
}
|
|
494
|
+
export interface Rule {
|
|
495
|
+
entity?: string | null;
|
|
496
|
+
attribute?: string | null;
|
|
497
|
+
attribute_value?: string | null;
|
|
498
|
+
}
|
|
456
499
|
export type Source = "ECP" | "ERP" | "360" | "journey-submission";
|
|
457
|
-
export type SubmissionMeterReading =
|
|
500
|
+
export type SubmissionMeterReading = AuthenticatedSubmission | UnauthenticatedSubmission;
|
|
501
|
+
export type TariffType = "ht" | "nt";
|
|
502
|
+
export type UnauthenticatedSubmission = {
|
|
458
503
|
/**
|
|
459
504
|
* The ID of the associated meter
|
|
460
505
|
*/
|
|
461
|
-
meterId
|
|
462
|
-
/**
|
|
463
|
-
* - The counter readings of a meter
|
|
464
|
-
* - This is only sent when the user is authenticated while submitting a journey
|
|
465
|
-
*
|
|
466
|
-
*/
|
|
467
|
-
readings?: CounterReadingOnSubmission[];
|
|
506
|
+
meterId?: Id;
|
|
468
507
|
/**
|
|
469
508
|
* The reading value of the meter when the counterId is passed or when the meterType is one-tariff
|
|
470
509
|
* example:
|
|
@@ -495,12 +534,6 @@ declare namespace Components {
|
|
|
495
534
|
* A09-123
|
|
496
535
|
*/
|
|
497
536
|
maloId?: string;
|
|
498
|
-
/**
|
|
499
|
-
* The OBIS number of the meter counter
|
|
500
|
-
* example:
|
|
501
|
-
* A-34
|
|
502
|
-
*/
|
|
503
|
-
obisNumber?: string;
|
|
504
537
|
/**
|
|
505
538
|
* The unit of measurement for the reading
|
|
506
539
|
*/
|
|
@@ -534,7 +567,6 @@ declare namespace Components {
|
|
|
534
567
|
*/
|
|
535
568
|
ntValue?: number;
|
|
536
569
|
} | null;
|
|
537
|
-
export type TariffType = "ht" | "nt";
|
|
538
570
|
export type Unit = "w" | "wh" | "kw" | "kWh" | "kvarh" | "mw" | "mWh" | "unit" | "cubic-meter" | "hour" | "day" | "month" | "year" | "percentage";
|
|
539
571
|
}
|
|
540
572
|
}
|
|
@@ -705,7 +737,124 @@ declare namespace Paths {
|
|
|
705
737
|
namespace GetCustomerMeters {
|
|
706
738
|
namespace Responses {
|
|
707
739
|
export interface $200 {
|
|
708
|
-
data?:
|
|
740
|
+
data?: {
|
|
741
|
+
_id: Components.Schemas.EntityId /* uuid */;
|
|
742
|
+
/**
|
|
743
|
+
* Title of the entity
|
|
744
|
+
* example:
|
|
745
|
+
* Example Entity
|
|
746
|
+
*/
|
|
747
|
+
_title: string;
|
|
748
|
+
/**
|
|
749
|
+
* Organization ID the entity belongs to
|
|
750
|
+
* example:
|
|
751
|
+
* 123
|
|
752
|
+
*/
|
|
753
|
+
_org: string;
|
|
754
|
+
/**
|
|
755
|
+
* Array of entity tags
|
|
756
|
+
* example:
|
|
757
|
+
* [
|
|
758
|
+
* "example",
|
|
759
|
+
* "mock"
|
|
760
|
+
* ]
|
|
761
|
+
*/
|
|
762
|
+
_tags?: string[];
|
|
763
|
+
/**
|
|
764
|
+
* Creation timestamp of the entity
|
|
765
|
+
* example:
|
|
766
|
+
* 2021-02-09T12:41:43.662Z
|
|
767
|
+
*/
|
|
768
|
+
_created_at: string; // date-time
|
|
769
|
+
/**
|
|
770
|
+
* Last update timestamp of the entity
|
|
771
|
+
* example:
|
|
772
|
+
* 2021-02-09T12:41:43.662Z
|
|
773
|
+
*/
|
|
774
|
+
_updated_at: string; // date-time
|
|
775
|
+
/**
|
|
776
|
+
* The schema type of the meter
|
|
777
|
+
*/
|
|
778
|
+
_schema: "meter";
|
|
779
|
+
/**
|
|
780
|
+
* The MA-LO ID of the meter
|
|
781
|
+
* example:
|
|
782
|
+
* A09-123
|
|
783
|
+
*/
|
|
784
|
+
ma_lo_id?: string;
|
|
785
|
+
/**
|
|
786
|
+
* The type of the meter
|
|
787
|
+
*/
|
|
788
|
+
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";
|
|
789
|
+
/**
|
|
790
|
+
* The tariff type of the meter
|
|
791
|
+
* example:
|
|
792
|
+
* Peak load tariff
|
|
793
|
+
*/
|
|
794
|
+
tariff_type?: string;
|
|
795
|
+
/**
|
|
796
|
+
* The number of the meter
|
|
797
|
+
* example:
|
|
798
|
+
* J-1093-1AK
|
|
799
|
+
*/
|
|
800
|
+
meter_number?: string;
|
|
801
|
+
/**
|
|
802
|
+
* The sector to which the meter belongs
|
|
803
|
+
*/
|
|
804
|
+
sector?: "power" | "water" | "gas";
|
|
805
|
+
/**
|
|
806
|
+
* The location information of the meter
|
|
807
|
+
* example:
|
|
808
|
+
* [
|
|
809
|
+
* {
|
|
810
|
+
* "country": "Germany",
|
|
811
|
+
* "city": "Koln",
|
|
812
|
+
* "postal_code": 81475,
|
|
813
|
+
* "street": "Melatengürtel",
|
|
814
|
+
* "street_number": 71,
|
|
815
|
+
* "additional_info": "5. Etage",
|
|
816
|
+
* "_tags": [
|
|
817
|
+
* "billing",
|
|
818
|
+
* "delivery"
|
|
819
|
+
* ]
|
|
820
|
+
* }
|
|
821
|
+
* ]
|
|
822
|
+
*/
|
|
823
|
+
location?: {
|
|
824
|
+
[key: string]: any;
|
|
825
|
+
};
|
|
826
|
+
/**
|
|
827
|
+
* The usage purpose of the meter
|
|
828
|
+
* example:
|
|
829
|
+
* Domestic Usage
|
|
830
|
+
*/
|
|
831
|
+
used_for?: string;
|
|
832
|
+
/**
|
|
833
|
+
* The manufacturer of the meter
|
|
834
|
+
* example:
|
|
835
|
+
* Energy One
|
|
836
|
+
*/
|
|
837
|
+
manufacturer?: string;
|
|
838
|
+
/**
|
|
839
|
+
* The calibration date of the meter
|
|
840
|
+
* example:
|
|
841
|
+
* 2022-10-10T00:00:00.000Z
|
|
842
|
+
*/
|
|
843
|
+
calibration_date?: string;
|
|
844
|
+
/**
|
|
845
|
+
* The contract associated with the meter
|
|
846
|
+
*/
|
|
847
|
+
contract?: {
|
|
848
|
+
$relation?: Components.Schemas.EntityRelation[];
|
|
849
|
+
};
|
|
850
|
+
/**
|
|
851
|
+
* The customer associated with the meter
|
|
852
|
+
*/
|
|
853
|
+
customer?: {
|
|
854
|
+
$relation?: Components.Schemas.EntityRelation[];
|
|
855
|
+
};
|
|
856
|
+
journey_actions?: Components.Schemas.JourneyActions;
|
|
857
|
+
}[];
|
|
709
858
|
}
|
|
710
859
|
export type $400 = Components.Responses.InvalidRequest;
|
|
711
860
|
export type $401 = Components.Responses.Unauthorized;
|
|
@@ -762,7 +911,7 @@ declare namespace Paths {
|
|
|
762
911
|
}
|
|
763
912
|
namespace GetMeter {
|
|
764
913
|
namespace Parameters {
|
|
765
|
-
export type Id = Components.Schemas.EntityId
|
|
914
|
+
export type Id = Components.Schemas.EntityId /* uuid */;
|
|
766
915
|
}
|
|
767
916
|
export interface PathParameters {
|
|
768
917
|
id: Parameters.Id;
|
|
@@ -771,6 +920,7 @@ declare namespace Paths {
|
|
|
771
920
|
export interface $200 {
|
|
772
921
|
data?: {
|
|
773
922
|
entity?: Components.Schemas.Meter;
|
|
923
|
+
journey_actions?: Components.Schemas.JourneyActions;
|
|
774
924
|
relations?: Components.Schemas.EntityItem[];
|
|
775
925
|
};
|
|
776
926
|
}
|
|
@@ -782,18 +932,10 @@ declare namespace Paths {
|
|
|
782
932
|
}
|
|
783
933
|
namespace GetMeterCounters {
|
|
784
934
|
namespace Parameters {
|
|
785
|
-
|
|
786
|
-
* example:
|
|
787
|
-
* 1446829f-4b6f-474e-b978-3997d89a7928
|
|
788
|
-
*/
|
|
789
|
-
export type MeterId = string;
|
|
935
|
+
export type MeterId = Components.Schemas.EntityId /* uuid */;
|
|
790
936
|
}
|
|
791
937
|
export interface QueryParameters {
|
|
792
|
-
meter_id:
|
|
793
|
-
* example:
|
|
794
|
-
* 1446829f-4b6f-474e-b978-3997d89a7928
|
|
795
|
-
*/
|
|
796
|
-
Parameters.MeterId;
|
|
938
|
+
meter_id: Parameters.MeterId;
|
|
797
939
|
}
|
|
798
940
|
namespace Responses {
|
|
799
941
|
export interface $200 {
|
|
@@ -807,7 +949,7 @@ declare namespace Paths {
|
|
|
807
949
|
}
|
|
808
950
|
namespace GetMetersByContractId {
|
|
809
951
|
namespace Parameters {
|
|
810
|
-
export type ContractId = Components.Schemas.EntityId
|
|
952
|
+
export type ContractId = Components.Schemas.EntityId /* uuid */;
|
|
811
953
|
}
|
|
812
954
|
export interface PathParameters {
|
|
813
955
|
contract_id: Parameters.ContractId;
|
|
@@ -901,7 +1043,7 @@ declare namespace Paths {
|
|
|
901
1043
|
}
|
|
902
1044
|
namespace UpdateMeter {
|
|
903
1045
|
namespace Parameters {
|
|
904
|
-
export type Id = Components.Schemas.EntityId
|
|
1046
|
+
export type Id = Components.Schemas.EntityId /* uuid */;
|
|
905
1047
|
}
|
|
906
1048
|
export interface PathParameters {
|
|
907
1049
|
id: Parameters.Id;
|
package/dist/openapi.json
CHANGED
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"PortalAuth": []
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"EitherAuth": []
|
|
23
26
|
}
|
|
24
27
|
],
|
|
25
28
|
"paths": {
|
|
@@ -47,7 +50,19 @@
|
|
|
47
50
|
"data": {
|
|
48
51
|
"type": "array",
|
|
49
52
|
"items": {
|
|
50
|
-
"
|
|
53
|
+
"allOf": [
|
|
54
|
+
{
|
|
55
|
+
"$ref": "#/components/schemas/Meter"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "object",
|
|
59
|
+
"properties": {
|
|
60
|
+
"journey_actions": {
|
|
61
|
+
"$ref": "#/components/schemas/JourneyActions"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
51
66
|
}
|
|
52
67
|
}
|
|
53
68
|
}
|
|
@@ -228,6 +243,9 @@
|
|
|
228
243
|
"entity": {
|
|
229
244
|
"$ref": "#/components/schemas/Meter"
|
|
230
245
|
},
|
|
246
|
+
"journey_actions": {
|
|
247
|
+
"$ref": "#/components/schemas/JourneyActions"
|
|
248
|
+
},
|
|
231
249
|
"relations": {
|
|
232
250
|
"type": "array",
|
|
233
251
|
"items": {
|
|
@@ -275,8 +293,7 @@
|
|
|
275
293
|
"name": "meter_id",
|
|
276
294
|
"required": true,
|
|
277
295
|
"schema": {
|
|
278
|
-
"
|
|
279
|
-
"example": "1446829f-4b6f-474e-b978-3997d89a7928"
|
|
296
|
+
"$ref": "#/components/schemas/EntityId"
|
|
280
297
|
}
|
|
281
298
|
}
|
|
282
299
|
],
|
|
@@ -380,10 +397,7 @@
|
|
|
380
397
|
],
|
|
381
398
|
"security": [
|
|
382
399
|
{
|
|
383
|
-
"
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
"PortalAuth": []
|
|
400
|
+
"EitherAuth": []
|
|
387
401
|
}
|
|
388
402
|
],
|
|
389
403
|
"requestBody": {
|
|
@@ -439,10 +453,7 @@
|
|
|
439
453
|
],
|
|
440
454
|
"security": [
|
|
441
455
|
{
|
|
442
|
-
"
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"PortalAuth": []
|
|
456
|
+
"EitherAuth": []
|
|
446
457
|
}
|
|
447
458
|
],
|
|
448
459
|
"requestBody": {
|
|
@@ -592,10 +603,7 @@
|
|
|
592
603
|
],
|
|
593
604
|
"security": [
|
|
594
605
|
{
|
|
595
|
-
"
|
|
596
|
-
},
|
|
597
|
-
{
|
|
598
|
-
"PortalAuth": []
|
|
606
|
+
"EitherAuth": []
|
|
599
607
|
}
|
|
600
608
|
],
|
|
601
609
|
"parameters": [
|
|
@@ -732,10 +740,7 @@
|
|
|
732
740
|
],
|
|
733
741
|
"security": [
|
|
734
742
|
{
|
|
735
|
-
"
|
|
736
|
-
},
|
|
737
|
-
{
|
|
738
|
-
"PortalAuth": []
|
|
743
|
+
"EitherAuth": []
|
|
739
744
|
}
|
|
740
745
|
],
|
|
741
746
|
"parameters": [
|
|
@@ -1055,10 +1060,7 @@
|
|
|
1055
1060
|
],
|
|
1056
1061
|
"security": [
|
|
1057
1062
|
{
|
|
1058
|
-
"
|
|
1059
|
-
},
|
|
1060
|
-
{
|
|
1061
|
-
"PortalAuth": []
|
|
1063
|
+
"EitherAuth": []
|
|
1062
1064
|
}
|
|
1063
1065
|
],
|
|
1064
1066
|
"parameters": [
|
|
@@ -1227,6 +1229,11 @@
|
|
|
1227
1229
|
"scheme": "bearer",
|
|
1228
1230
|
"description": "Authorization header with customer portal OAuth2 bearer token",
|
|
1229
1231
|
"bearerFormat": "JWT"
|
|
1232
|
+
},
|
|
1233
|
+
"EitherAuth": {
|
|
1234
|
+
"type": "http",
|
|
1235
|
+
"scheme": "bearer",
|
|
1236
|
+
"description": "Portal or Epilot Bearer Token"
|
|
1230
1237
|
}
|
|
1231
1238
|
},
|
|
1232
1239
|
"schemas": {
|
|
@@ -1240,7 +1247,8 @@
|
|
|
1240
1247
|
}
|
|
1241
1248
|
},
|
|
1242
1249
|
"EntityId": {
|
|
1243
|
-
"type": "string"
|
|
1250
|
+
"type": "string",
|
|
1251
|
+
"format": "uuid"
|
|
1244
1252
|
},
|
|
1245
1253
|
"BaseEntity": {
|
|
1246
1254
|
"type": "object",
|
|
@@ -1314,8 +1322,7 @@
|
|
|
1314
1322
|
"type": "object",
|
|
1315
1323
|
"properties": {
|
|
1316
1324
|
"entity_id": {
|
|
1317
|
-
"
|
|
1318
|
-
"example": "9a2081a2-1615-44b8-b988-d757983290dd"
|
|
1325
|
+
"$ref": "#/components/schemas/EntityId"
|
|
1319
1326
|
},
|
|
1320
1327
|
"_slug": {
|
|
1321
1328
|
"type": "string",
|
|
@@ -1493,13 +1500,11 @@
|
|
|
1493
1500
|
"description": "The reason for recording the reading"
|
|
1494
1501
|
},
|
|
1495
1502
|
"meter_id": {
|
|
1496
|
-
"
|
|
1497
|
-
"example": "1446829f-4b6f-474e-b978-3997d89a7928",
|
|
1503
|
+
"$ref": "#/components/schemas/EntityId",
|
|
1498
1504
|
"description": "The ID of the associated meter"
|
|
1499
1505
|
},
|
|
1500
1506
|
"counter_id": {
|
|
1501
|
-
"
|
|
1502
|
-
"example": "991a1821-43bc-46b8-967d-64a3d87c31f8",
|
|
1507
|
+
"$ref": "#/components/schemas/EntityId",
|
|
1503
1508
|
"description": "The ID of the associated meter counter"
|
|
1504
1509
|
},
|
|
1505
1510
|
"direction": {
|
|
@@ -1543,8 +1548,7 @@
|
|
|
1543
1548
|
],
|
|
1544
1549
|
"properties": {
|
|
1545
1550
|
"_id": {
|
|
1546
|
-
"
|
|
1547
|
-
"example": "991a1821-43bc-46b8-967d-64a3d87c31f8"
|
|
1551
|
+
"$ref": "#/components/schemas/EntityId"
|
|
1548
1552
|
},
|
|
1549
1553
|
"_schema": {
|
|
1550
1554
|
"type": "string",
|
|
@@ -1646,12 +1650,12 @@
|
|
|
1646
1650
|
}
|
|
1647
1651
|
}
|
|
1648
1652
|
},
|
|
1649
|
-
"
|
|
1653
|
+
"AuthenticatedSubmission": {
|
|
1650
1654
|
"type": "object",
|
|
1655
|
+
"nullable": true,
|
|
1651
1656
|
"required": [
|
|
1652
1657
|
"meterId"
|
|
1653
1658
|
],
|
|
1654
|
-
"nullable": true,
|
|
1655
1659
|
"properties": {
|
|
1656
1660
|
"meterId": {
|
|
1657
1661
|
"$ref": "#/components/schemas/Id",
|
|
@@ -1664,6 +1668,36 @@
|
|
|
1664
1668
|
},
|
|
1665
1669
|
"description": "- The counter readings of a meter\n- This is only sent when the user is authenticated while submitting a journey\n"
|
|
1666
1670
|
},
|
|
1671
|
+
"readingDate": {
|
|
1672
|
+
"type": "string",
|
|
1673
|
+
"description": "If the value is not provided, the system will be set with the time the request is processed.",
|
|
1674
|
+
"example": "2022-10-10T10:10:00.000Z"
|
|
1675
|
+
},
|
|
1676
|
+
"readBy": {
|
|
1677
|
+
"type": "string",
|
|
1678
|
+
"example": "John Doe",
|
|
1679
|
+
"description": "The person who recorded the reading"
|
|
1680
|
+
},
|
|
1681
|
+
"reason": {
|
|
1682
|
+
"type": "string",
|
|
1683
|
+
"example": "Storing the feed-in record",
|
|
1684
|
+
"description": "The reason for recording the reading"
|
|
1685
|
+
},
|
|
1686
|
+
"maloId": {
|
|
1687
|
+
"type": "string",
|
|
1688
|
+
"example": "A09-123",
|
|
1689
|
+
"description": "The MA-LO ID of the meter"
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
},
|
|
1693
|
+
"UnauthenticatedSubmission": {
|
|
1694
|
+
"type": "object",
|
|
1695
|
+
"nullable": true,
|
|
1696
|
+
"properties": {
|
|
1697
|
+
"meterId": {
|
|
1698
|
+
"$ref": "#/components/schemas/Id",
|
|
1699
|
+
"description": "The ID of the associated meter"
|
|
1700
|
+
},
|
|
1667
1701
|
"readingValue": {
|
|
1668
1702
|
"type": "number",
|
|
1669
1703
|
"example": 240,
|
|
@@ -1689,11 +1723,6 @@
|
|
|
1689
1723
|
"example": "A09-123",
|
|
1690
1724
|
"description": "The MA-LO ID of the meter"
|
|
1691
1725
|
},
|
|
1692
|
-
"obisNumber": {
|
|
1693
|
-
"type": "string",
|
|
1694
|
-
"example": "A-34",
|
|
1695
|
-
"description": "The OBIS number of the meter counter"
|
|
1696
|
-
},
|
|
1697
1726
|
"readingUnit": {
|
|
1698
1727
|
"$ref": "#/components/schemas/Unit",
|
|
1699
1728
|
"description": "The unit of measurement for the reading"
|
|
@@ -1729,6 +1758,16 @@
|
|
|
1729
1758
|
}
|
|
1730
1759
|
}
|
|
1731
1760
|
},
|
|
1761
|
+
"SubmissionMeterReading": {
|
|
1762
|
+
"oneOf": [
|
|
1763
|
+
{
|
|
1764
|
+
"$ref": "#/components/schemas/AuthenticatedSubmission"
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
"$ref": "#/components/schemas/UnauthenticatedSubmission"
|
|
1768
|
+
}
|
|
1769
|
+
]
|
|
1770
|
+
},
|
|
1732
1771
|
"Unit": {
|
|
1733
1772
|
"type": "string",
|
|
1734
1773
|
"enum": [
|
|
@@ -1757,6 +1796,61 @@
|
|
|
1757
1796
|
"journey-submission"
|
|
1758
1797
|
]
|
|
1759
1798
|
},
|
|
1799
|
+
"ActionLabel": {
|
|
1800
|
+
"type": "object",
|
|
1801
|
+
"properties": {
|
|
1802
|
+
"en": {
|
|
1803
|
+
"type": "string",
|
|
1804
|
+
"nullable": true
|
|
1805
|
+
},
|
|
1806
|
+
"de": {
|
|
1807
|
+
"type": "string",
|
|
1808
|
+
"nullable": true
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
"Rule": {
|
|
1813
|
+
"type": "object",
|
|
1814
|
+
"properties": {
|
|
1815
|
+
"entity": {
|
|
1816
|
+
"type": "string",
|
|
1817
|
+
"nullable": true
|
|
1818
|
+
},
|
|
1819
|
+
"attribute": {
|
|
1820
|
+
"type": "string",
|
|
1821
|
+
"nullable": true
|
|
1822
|
+
},
|
|
1823
|
+
"attribute_value": {
|
|
1824
|
+
"type": "string",
|
|
1825
|
+
"nullable": true
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
},
|
|
1829
|
+
"JourneyActions": {
|
|
1830
|
+
"type": "object",
|
|
1831
|
+
"properties": {
|
|
1832
|
+
"journey_id": {
|
|
1833
|
+
"type": "string",
|
|
1834
|
+
"nullable": true
|
|
1835
|
+
},
|
|
1836
|
+
"action_label": {
|
|
1837
|
+
"type": "object",
|
|
1838
|
+
"$ref": "#/components/schemas/ActionLabel",
|
|
1839
|
+
"nullable": true
|
|
1840
|
+
},
|
|
1841
|
+
"slug": {
|
|
1842
|
+
"type": "string",
|
|
1843
|
+
"nullable": true
|
|
1844
|
+
},
|
|
1845
|
+
"rules": {
|
|
1846
|
+
"type": "array",
|
|
1847
|
+
"items": {
|
|
1848
|
+
"$ref": "#/components/schemas/Rule"
|
|
1849
|
+
},
|
|
1850
|
+
"nullable": true
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
},
|
|
1760
1854
|
"ReadingWithMeter": {
|
|
1761
1855
|
"type": "object",
|
|
1762
1856
|
"properties": {
|