@epilot/metering-client 0.8.2 → 0.9.0

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
- (()=>{"use strict";var e={390: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(871));t.default=s.default},871: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"},{"name":"meter_schema","x-displayName":"Meter","description":"<SchemaDefinition schemaRef=\\"#/components/schemas/Meter\\" />\\n"},{"name":"meter_counter_schema","x-displayName":"Meter Counter","description":"<SchemaDefinition schemaRef=\\"#/components/schemas/MeterCounter\\" />\\n"}],"x-tagGroups":[{"name":"APIs","tags":["ECP","ECP Admin"]},{"name":"Schemas","tags":["meter_schema","meter_counter_schema"]}],"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"}}},{"type":"object","properties":{"last_reading":{"type":"string","example":"2022-10-10T00:00:00.000Z","description":"The timestamp of the last reading"},"current_consumption":{"type":"number","example":100.5,"description":"The current consumption of the 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/InvalidRequestUpdateMeter"},"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/InvalidRequestCreateMeterReading"},"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. Limited to 100 readings per request.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"query","name":"async","description":"Don\'t wait for the reading to become available in GetReadings API. Useful for large migrations","required":false,"schema":{"type":"boolean","default":true}},{"$ref":"#/components/parameters/ActivityIdQueryParam"},{"$ref":"#/components/parameters/SkipValidationQueryParam"}],"requestBody":{"description":"Meter readings payload. Limited to 100 readings per request.","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/InvalidRequestCreateMeterReadings"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v2/metering/readings":{"post":{"operationId":"batchWriteMeterReadings","summary":"Batch Write Readings","description":"Upserts/Deletes multiple meter readings at once. Limited to 100 readings per request.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"query","name":"async","description":"Don\'t wait for the reading to become available in GetReadings API. Useful for large migrations","required":false,"schema":{"type":"boolean","default":true}},{"$ref":"#/components/parameters/SkipValidationQueryParam"},{"$ref":"#/components/parameters/ActivityIdQueryParam"}],"requestBody":{"description":"Meter readings payload. Limited to 100 readings per request.","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"readings":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/MeterReading"},{"properties":{"operation":{"type":"string","enum":["create","update","delete"],"default":"create"}}}]}}}}}}},"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/InvalidRequestCreateMeterReadings"},"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/InvalidRequestCreateMeterReadingFromSubmission"},"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/InvalidRequestCreateReadingWithMeter"},"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/InvalidRequestUpdateMeterReading"},"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"}}}}},"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"}}}},"NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"InvalidRequestUpdateMeter":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["missing_params"]}}}]}}}},"InvalidRequestCreateMeterReading":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["contract_period","no_counter","no_direction","timestamp_future","less_than_previous","greater_than_subsequent","meter_decommissioned"]}}}]}}}},"InvalidRequestCreateMeterReadings":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["too_many_records","timestamp_future","duplicate_reading","less_than_previous"]}}}]}}}},"InvalidRequestCreateMeterReadingFromSubmission":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["timestamp_future","less_than_previous","greater_than_subsequent"]}}}]}}}},"InvalidRequestCreateReadingWithMeter":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["missing_params","timestamp_future","less_than_previous","contract_period","greater_than_subsequent"]}}}]}}}},"InvalidRequestUpdateMeterReading":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["missing_params","timestamp_future","less_than_previous","greater_than_subsequent"]}}}]}}}}},"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"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id as internal user"}},"schemas":{"ErrorResp":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}},"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","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"},"status":{"type":"string","enum":["active","decommissioned"],"description":"The status 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","district_heating","waste_water"],"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"]},"Reason":{"type":"string","nullable":true,"example":"Storing the feed-in record","description":"The reason for recording the reading"},"ReadBy":{"type":"string","nullable":true,"example":"John Doe","description":"The person who recorded the reading"},"ReadingStatus":{"type":"string","nullable":true,"enum":["valid","in-validation","implausible",null,""]},"MeterReading":{"type":"object","required":["value","meter_id","source"],"properties":{"value":{"type":"number","example":240,"description":"The reading value of the meter"},"read_by":{"$ref":"#/components/schemas/ReadBy"},"reason":{"$ref":"#/components/schemas/Reason"},"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"}}},"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"}}},"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":{"$ref":"#/components/schemas/Reason"},"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"]},"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":{"$ref":"#/components/schemas/ReadBy"},"reason":{"$ref":"#/components/schemas/Reason"},"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"}}},"ActivityId":{"type":"string","format":"ulid","description":"See https://github.com/ulid/spec","example":"01F130Q52Q6MWSNS8N2AVXV4JN"}},"parameters":{"ActivityIdQueryParam":{"name":"activity_id","description":"Activity to include in event feed","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ActivityId"}},"SkipValidationQueryParam":{"name":"skip_validation","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"When set to true, all validations will be skipped and the system will allow the reading to be created.\\nIf set to false or not provided, the system performs the following validations:\\n Validation Rules (when not skipped)\\n - Previous Reading Check:\\n The new reading must be greater than the previous reading.\\n Example: If the previous reading is 100 and the new reading is 50, the system will reject it.\\n - Subsequent Reading Check\\n The new reading must be less than the next (subsequent) reading, if one exists.\\n Example: If a future reading for 2022-10-10 is 200, and you try to enter 250 for 2022-10-09, it will be rejected.\\n - Future Timestamp Check\\n The reading timestamp must be less than or equal to the current time.\\n Example: If the current time is 2022-10-10T20:00:00Z, a reading with timestamp 2022-10-11T20:00:00Z will not be accepted.\\n - Duplicate Check\\n A reading is not allowed if there\'s already a record with the same meter_id, counter_id, and timestamp`.\\n - Update Check\\n When updating a reading, the system will look for an existing record with the same meter_id, counter_id, and timestamp.\\n If no such record exists, it won\'t throw an error — the update simply won\'t take effect.\\n"}}},"servers":[{"url":"https://metering.sls.epilot.io"}]}')}},t={},r=function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}(390),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"},{"name":"meter_schema","x-displayName":"Meter","description":"<SchemaDefinition schemaRef=\\"#/components/schemas/Meter\\" />\\n"},{"name":"meter_counter_schema","x-displayName":"Meter Counter","description":"<SchemaDefinition schemaRef=\\"#/components/schemas/MeterCounter\\" />\\n"}],"x-tagGroups":[{"name":"APIs","tags":["ECP","ECP Admin"]},{"name":"Schemas","tags":["meter_schema","meter_counter_schema"]}],"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"}}},{"type":"object","properties":{"last_reading":{"type":"string","example":"2022-10-10T00:00:00.000Z","description":"The timestamp of the last reading"},"current_consumption":{"type":"number","example":100.5,"description":"The current consumption of the 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/InvalidRequestUpdateMeter"},"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/InvalidRequestCreateMeterReading"},"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. Limited to 100 readings per request.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"query","name":"async","description":"Don\'t wait for the reading to become available in GetReadings API. Useful for large migrations","required":false,"schema":{"type":"boolean","default":true}},{"$ref":"#/components/parameters/ActivityIdQueryParam"},{"$ref":"#/components/parameters/SkipValidationQueryParam"}],"requestBody":{"description":"Meter readings payload. Limited to 100 readings per request.","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/InvalidRequestCreateMeterReadings"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v1/metering/readings/{meter_id}":{"post":{"operationId":"createPortalMeterReadings","summary":"createPortalMeterReadings","description":"Inserts multiple meter readings at once for a given meter. Limited to 2 readings per request.","tags":["ECP"],"security":[{"PortalAuth":[]}],"parameters":[{"in":"path","name":"meter_id","schema":{"$ref":"#/components/schemas/Id"},"required":true,"description":"The ID of the meter."}],"requestBody":{"description":"Meter readings payload. Limited to 2 readings per request.","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"readings":{"type":"array","items":{"$ref":"#/components/schemas/PortalMeterReading"}}}}}}},"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/InvalidRequestCreateMeterReadings"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/v2/metering/readings":{"post":{"operationId":"batchWriteMeterReadings","summary":"Batch Write Readings","description":"Upserts/Deletes multiple meter readings at once. Limited to 100 readings per request.","tags":["ECP Admin"],"security":[{"EpilotAuth":[]}],"parameters":[{"in":"query","name":"async","description":"Don\'t wait for the reading to become available in GetReadings API. Useful for large migrations","required":false,"schema":{"type":"boolean","default":true}},{"$ref":"#/components/parameters/SkipValidationQueryParam"},{"$ref":"#/components/parameters/ActivityIdQueryParam"}],"requestBody":{"description":"Meter readings payload. Limited to 100 readings per request.","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"identifiers":{"type":"array","items":{"type":"string","description":"The identifier of the meter reading."},"description":"- By default, the system will use combination of counter_id, meter_id, direction, and timestamp to identify a meter reading.\\n- Additional identifiers can be provided to identify a meter reading uniquely.\\n- Example:\\n - [\\"metadata.registration_id\\", \\"metadata.business_unit\\"]\\n - [\\"metadata.registration_id\\", \\"metadata.business_unit\\", \\"external_id\\"]\\n"},"readings":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/MeterReading"},{"properties":{"operation":{"type":"string","enum":["create","update","delete"],"default":"create"}}}]}}}}}}},"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/InvalidRequestCreateMeterReadings"},"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/InvalidRequestCreateMeterReadingFromSubmission"},"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/InvalidRequestCreateReadingWithMeter"},"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/UpdateMeterReading"}}}},"responses":{"200":{"description":"Meter reading updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeterReading"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequestUpdateMeterReading"},"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"}}}}},"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"}}}},"NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResp"}}}},"InvalidRequestUpdateMeter":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["missing_params"]}}}]}}}},"InvalidRequestCreateMeterReading":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["contract_period","no_counter","no_direction","timestamp_future","less_than_previous","greater_than_subsequent","meter_decommissioned"]}}}]}}}},"InvalidRequestCreateMeterReadings":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["too_many_records","timestamp_future","duplicate_reading","less_than_previous","invalid_identifiers","multiple_readings_found"]}}}]}}}},"InvalidRequestCreateMeterReadingFromSubmission":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["timestamp_future","less_than_previous","greater_than_subsequent"]}}}]}}}},"InvalidRequestCreateReadingWithMeter":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["missing_params","timestamp_future","less_than_previous","contract_period","greater_than_subsequent"]}}}]}}}},"InvalidRequestUpdateMeterReading":{"description":"The request could not be validated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResp"},{"properties":{"reason":{"type":"string","enum":["missing_params","timestamp_future","less_than_previous","greater_than_subsequent"]}}}]}}}}},"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"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id as internal user"}},"schemas":{"ErrorResp":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}},"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","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"},"status":{"type":"string","enum":["active","decommissioned"],"description":"The status 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","district_heating","waste_water"],"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"]},"Reason":{"type":"string","nullable":true,"description":"The reason for recording the reading\\nIf no reason is specified or left empty, the Epilot UI will show \'Regular\' as the default display text\\n","enum":["","regular","irregular","last","first","meter_change","contract_change","meter_adjustment"]},"ReasonString":{"type":"string","nullable":true,"deprecated":true,"description":"This field is deprecated. Please use the Reason enum instead.\\n"},"ReadBy":{"type":"string","nullable":true,"example":"John Doe","description":"The person who recorded the reading"},"ReadingStatus":{"type":"string","nullable":true,"enum":["valid","in-validation","implausible",null,""]},"Reading":{"type":"object","required":["value","source"],"properties":{"value":{"type":"number","example":240,"description":"The reading value of the meter"},"read_by":{"$ref":"#/components/schemas/ReadBy"},"reason":{"$ref":"#/components/schemas/Reason"},"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","format":"date-time"},"source":{"$ref":"#/components/schemas/Source","description":"The source of the reading"},"status":{"$ref":"#/components/schemas/ReadingStatus","description":"The status of the reading"},"external_id":{"type":"string","description":"The external ID of the reading"},"remark":{"type":"string","nullable":true,"description":"A remark or comment for the reading","example":"Customer reported unusual consumption"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Additional metadata for the reading","example":{"registration_id":"1234567890","business_unit":"ABC"}},"note":{"type":"string","description":"Notes to record a meter reading"}}},"MeterReading":{"allOf":[{"$ref":"#/components/schemas/Reading"},{"required":["meter_id"]}]},"PortalMeterReading":{"allOf":[{"$ref":"#/components/schemas/Reading"},{"required":["counter_id"]}]},"UpdateMeterReading":{"type":"object","required":["value","meter_id","source"],"properties":{"value":{"type":"number","example":240,"description":"The reading value of the meter"},"read_by":{"$ref":"#/components/schemas/ReadBy"},"reason":{"$ref":"#/components/schemas/ReasonString"},"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","format":"date-time"},"source":{"$ref":"#/components/schemas/Source","description":"The source of the reading"},"status":{"$ref":"#/components/schemas/ReadingStatus","description":"The status of the reading"},"external_id":{"type":"string","description":"The external ID of the reading"},"remark":{"type":"string","nullable":true,"description":"A remark or comment for the reading","example":"Customer reported unusual consumption"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Additional metadata for the reading","example":{"registration_id":"1234567890","business_unit":"ABC"}}}},"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"}}},"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":{"$ref":"#/components/schemas/Reason"},"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"]},"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":{"$ref":"#/components/schemas/ReadBy"},"reason":{"$ref":"#/components/schemas/Reason"},"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"}}},"ActivityId":{"type":"string","format":"ulid","description":"See https://github.com/ulid/spec","example":"01F130Q52Q6MWSNS8N2AVXV4JN"}},"parameters":{"ActivityIdQueryParam":{"name":"activity_id","description":"Activity to include in event feed","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ActivityId"}},"SkipValidationQueryParam":{"name":"skip_validation","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"When set to true, all validations will be skipped and the system will allow the reading to be created.\\nIf set to false or not provided, the system performs the following validations:\\n Validation Rules (when not skipped)\\n - Previous Reading Check:\\n The new reading must be greater than the previous reading.\\n Example: If the previous reading is 100 and the new reading is 50, the system will reject it.\\n - Subsequent Reading Check\\n The new reading must be less than the next (subsequent) reading, if one exists.\\n Example: If a future reading for 2022-10-10 is 200, and you try to enter 250 for 2022-10-09, it will be rejected.\\n - Future Timestamp Check\\n The reading timestamp must be less than or equal to the current time.\\n Example: If the current time is 2022-10-10T20:00:00Z, a reading with timestamp 2022-10-11T20:00:00Z will not be accepted.\\n - Duplicate Check\\n A reading is not allowed if there\'s already a record with the same meter_id, counter_id, and timestamp`.\\n - Update Check\\n When updating a reading, the system will look for an existing record with the same meter_id, counter_id, and timestamp.\\n If no such record exists, it won\'t throw an error — the update simply won\'t take effect.\\n"}}},"servers":[{"url":"https://metering.sls.epilot.io"}]}')}},t={},r=function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.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
@@ -45,7 +45,7 @@ declare namespace Components {
45
45
  * Error message
46
46
  */
47
47
  message?: string;
48
- reason?: "too_many_records" | "timestamp_future" | "duplicate_reading" | "less_than_previous";
48
+ reason?: "too_many_records" | "timestamp_future" | "duplicate_reading" | "less_than_previous" | "invalid_identifiers" | "multiple_readings_found";
49
49
  }
50
50
  export interface InvalidRequestCreateReadingWithMeter {
51
51
  /**
@@ -426,14 +426,132 @@ declare namespace Components {
426
426
  ReadBy;
427
427
  reason?: /**
428
428
  * The reason for recording the reading
429
+ * If no reason is specified or left empty, the Epilot UI will show 'Regular' as the default display text
430
+ *
431
+ */
432
+ Reason;
433
+ meter_id: EntityId /* uuid */;
434
+ counter_id?: EntityId /* uuid */;
435
+ direction?: Direction;
436
+ /**
437
+ * If the value is not provided, the system will be set with the time the request is processed.
438
+ * example:
439
+ * 2022-10-10T00:00:00.000Z
440
+ */
441
+ timestamp?: string; // date-time
442
+ source: Source;
443
+ status?: ReadingStatus;
444
+ /**
445
+ * The external ID of the reading
446
+ */
447
+ external_id?: string;
448
+ /**
449
+ * A remark or comment for the reading
450
+ * example:
451
+ * Customer reported unusual consumption
452
+ */
453
+ remark?: string | null;
454
+ /**
455
+ * Additional metadata for the reading
456
+ * example:
457
+ * {
458
+ * "registration_id": "1234567890",
459
+ * "business_unit": "ABC"
460
+ * }
461
+ */
462
+ metadata?: {
463
+ [name: string]: string;
464
+ };
465
+ /**
466
+ * Notes to record a meter reading
467
+ */
468
+ note?: string;
469
+ }
470
+ export interface PortalMeterReading {
471
+ /**
472
+ * The reading value of the meter
473
+ * example:
474
+ * 240
475
+ */
476
+ value: number;
477
+ read_by?: /**
478
+ * The person who recorded the reading
479
+ * example:
480
+ * John Doe
481
+ */
482
+ ReadBy;
483
+ reason?: /**
484
+ * The reason for recording the reading
485
+ * If no reason is specified or left empty, the Epilot UI will show 'Regular' as the default display text
486
+ *
487
+ */
488
+ Reason;
489
+ meter_id?: EntityId /* uuid */;
490
+ counter_id: EntityId /* uuid */;
491
+ direction?: Direction;
492
+ /**
493
+ * If the value is not provided, the system will be set with the time the request is processed.
494
+ * example:
495
+ * 2022-10-10T00:00:00.000Z
496
+ */
497
+ timestamp?: string; // date-time
498
+ source: Source;
499
+ status?: ReadingStatus;
500
+ /**
501
+ * The external ID of the reading
502
+ */
503
+ external_id?: string;
504
+ /**
505
+ * A remark or comment for the reading
506
+ * example:
507
+ * Customer reported unusual consumption
508
+ */
509
+ remark?: string | null;
510
+ /**
511
+ * Additional metadata for the reading
512
+ * example:
513
+ * {
514
+ * "registration_id": "1234567890",
515
+ * "business_unit": "ABC"
516
+ * }
517
+ */
518
+ metadata?: {
519
+ [name: string]: string;
520
+ };
521
+ /**
522
+ * Notes to record a meter reading
523
+ */
524
+ note?: string;
525
+ }
526
+ /**
527
+ * The person who recorded the reading
528
+ * example:
529
+ * John Doe
530
+ */
531
+ export type ReadBy = string | null;
532
+ export interface Reading {
533
+ /**
534
+ * The reading value of the meter
429
535
  * example:
430
- * Storing the feed-in record
536
+ * 240
537
+ */
538
+ value: number;
539
+ read_by?: /**
540
+ * The person who recorded the reading
541
+ * example:
542
+ * John Doe
543
+ */
544
+ ReadBy;
545
+ reason?: /**
546
+ * The reason for recording the reading
547
+ * If no reason is specified or left empty, the Epilot UI will show 'Regular' as the default display text
548
+ *
431
549
  */
432
550
  Reason;
433
551
  /**
434
552
  * The ID of the associated meter
435
553
  */
436
- meter_id: EntityId /* uuid */;
554
+ meter_id?: EntityId /* uuid */;
437
555
  /**
438
556
  * The ID of the associated meter counter
439
557
  */
@@ -447,7 +565,7 @@ declare namespace Components {
447
565
  * example:
448
566
  * 2022-10-10T00:00:00.000Z
449
567
  */
450
- timestamp?: string;
568
+ timestamp?: string; // date-time
451
569
  /**
452
570
  * The source of the reading
453
571
  */
@@ -456,13 +574,32 @@ declare namespace Components {
456
574
  * The status of the reading
457
575
  */
458
576
  status?: ReadingStatus;
577
+ /**
578
+ * The external ID of the reading
579
+ */
580
+ external_id?: string;
581
+ /**
582
+ * A remark or comment for the reading
583
+ * example:
584
+ * Customer reported unusual consumption
585
+ */
586
+ remark?: string | null;
587
+ /**
588
+ * Additional metadata for the reading
589
+ * example:
590
+ * {
591
+ * "registration_id": "1234567890",
592
+ * "business_unit": "ABC"
593
+ * }
594
+ */
595
+ metadata?: {
596
+ [name: string]: string;
597
+ };
598
+ /**
599
+ * Notes to record a meter reading
600
+ */
601
+ note?: string;
459
602
  }
460
- /**
461
- * The person who recorded the reading
462
- * example:
463
- * John Doe
464
- */
465
- export type ReadBy = string | null;
466
603
  export type ReadingStatus = "valid" | "in-validation" | "implausible" | null | "";
467
604
  export interface ReadingWithMeter {
468
605
  /**
@@ -507,8 +644,8 @@ declare namespace Components {
507
644
  ReadBy;
508
645
  reason?: /**
509
646
  * The reason for recording the reading
510
- * example:
511
- * Storing the feed-in record
647
+ * If no reason is specified or left empty, the Epilot UI will show 'Regular' as the default display text
648
+ *
512
649
  */
513
650
  Reason;
514
651
  /**
@@ -524,10 +661,15 @@ declare namespace Components {
524
661
  }
525
662
  /**
526
663
  * The reason for recording the reading
527
- * example:
528
- * Storing the feed-in record
664
+ * If no reason is specified or left empty, the Epilot UI will show 'Regular' as the default display text
665
+ *
666
+ */
667
+ export type Reason = "" | "regular" | "irregular" | "last" | "first" | "meter_change" | "contract_change" | "meter_adjustment";
668
+ /**
669
+ * This field is deprecated. Please use the Reason enum instead.
670
+ *
529
671
  */
530
- export type Reason = string | null;
672
+ export type ReasonString = string | null;
531
673
  export interface Rule {
532
674
  entity?: string | null;
533
675
  attribute?: string | null;
@@ -565,8 +707,8 @@ declare namespace Components {
565
707
  readBy?: string;
566
708
  reason?: /**
567
709
  * The reason for recording the reading
568
- * example:
569
- * Storing the feed-in record
710
+ * If no reason is specified or left empty, the Epilot UI will show 'Regular' as the default display text
711
+ *
570
712
  */
571
713
  Reason;
572
714
  /**
@@ -616,6 +758,72 @@ declare namespace Components {
616
758
  } | null;
617
759
  export type TariffType = "ht" | "nt";
618
760
  export type Unit = "w" | "wh" | "kw" | "kWh" | "kvarh" | "mw" | "mWh" | "unit" | "cubic-meter" | "hour" | "day" | "month" | "year" | "percentage";
761
+ export interface UpdateMeterReading {
762
+ /**
763
+ * The reading value of the meter
764
+ * example:
765
+ * 240
766
+ */
767
+ value: number;
768
+ read_by?: /**
769
+ * The person who recorded the reading
770
+ * example:
771
+ * John Doe
772
+ */
773
+ ReadBy;
774
+ reason?: /**
775
+ * This field is deprecated. Please use the Reason enum instead.
776
+ *
777
+ */
778
+ ReasonString;
779
+ /**
780
+ * The ID of the associated meter
781
+ */
782
+ meter_id: EntityId /* uuid */;
783
+ /**
784
+ * The ID of the associated meter counter
785
+ */
786
+ counter_id?: EntityId /* uuid */;
787
+ /**
788
+ * The direction of the reading (feed-in or feed-out)
789
+ */
790
+ direction?: Direction;
791
+ /**
792
+ * If the value is not provided, the system will be set with the time the request is processed.
793
+ * example:
794
+ * 2022-10-10T00:00:00.000Z
795
+ */
796
+ timestamp?: string; // date-time
797
+ /**
798
+ * The source of the reading
799
+ */
800
+ source: Source;
801
+ /**
802
+ * The status of the reading
803
+ */
804
+ status?: ReadingStatus;
805
+ /**
806
+ * The external ID of the reading
807
+ */
808
+ external_id?: string;
809
+ /**
810
+ * A remark or comment for the reading
811
+ * example:
812
+ * Customer reported unusual consumption
813
+ */
814
+ remark?: string | null;
815
+ /**
816
+ * Additional metadata for the reading
817
+ * example:
818
+ * {
819
+ * "registration_id": "1234567890",
820
+ * "business_unit": "ABC"
821
+ * }
822
+ */
823
+ metadata?: {
824
+ [name: string]: string;
825
+ };
826
+ }
619
827
  }
620
828
  }
621
829
  declare namespace Paths {
@@ -636,6 +844,15 @@ declare namespace Paths {
636
844
  activity_id?: Parameters.ActivityId;
637
845
  }
638
846
  export interface RequestBody {
847
+ /**
848
+ * - By default, the system will use combination of counter_id, meter_id, direction, and timestamp to identify a meter reading.
849
+ * - Additional identifiers can be provided to identify a meter reading uniquely.
850
+ * - Example:
851
+ * - ["metadata.registration_id", "metadata.business_unit"]
852
+ * - ["metadata.registration_id", "metadata.business_unit", "external_id"]
853
+ *
854
+ */
855
+ identifiers?: string[];
639
856
  readings?: {
640
857
  /**
641
858
  * The reading value of the meter
@@ -651,8 +868,8 @@ declare namespace Paths {
651
868
  Components.Schemas.ReadBy;
652
869
  reason?: /**
653
870
  * The reason for recording the reading
654
- * example:
655
- * Storing the feed-in record
871
+ * If no reason is specified or left empty, the Epilot UI will show 'Regular' as the default display text
872
+ *
656
873
  */
657
874
  Components.Schemas.Reason;
658
875
  meter_id: Components.Schemas.EntityId /* uuid */;
@@ -663,9 +880,34 @@ declare namespace Paths {
663
880
  * example:
664
881
  * 2022-10-10T00:00:00.000Z
665
882
  */
666
- timestamp?: string;
883
+ timestamp?: string; // date-time
667
884
  source: Components.Schemas.Source;
668
885
  status?: Components.Schemas.ReadingStatus;
886
+ /**
887
+ * The external ID of the reading
888
+ */
889
+ external_id?: string;
890
+ /**
891
+ * A remark or comment for the reading
892
+ * example:
893
+ * Customer reported unusual consumption
894
+ */
895
+ remark?: string | null;
896
+ /**
897
+ * Additional metadata for the reading
898
+ * example:
899
+ * {
900
+ * "registration_id": "1234567890",
901
+ * "business_unit": "ABC"
902
+ * }
903
+ */
904
+ metadata?: {
905
+ [name: string]: string;
906
+ };
907
+ /**
908
+ * Notes to record a meter reading
909
+ */
910
+ note?: string;
669
911
  operation?: "create" | "update" | "delete";
670
912
  }[];
671
913
  }
@@ -750,6 +992,26 @@ declare namespace Paths {
750
992
  export type $500 = Components.Responses.InternalServerError;
751
993
  }
752
994
  }
995
+ namespace CreatePortalMeterReadings {
996
+ namespace Parameters {
997
+ export type MeterId = Components.Schemas.Id;
998
+ }
999
+ export interface PathParameters {
1000
+ meter_id: Parameters.MeterId;
1001
+ }
1002
+ export interface RequestBody {
1003
+ readings?: Components.Schemas.PortalMeterReading[];
1004
+ }
1005
+ namespace Responses {
1006
+ export interface $200 {
1007
+ data?: Components.Schemas.MeterReading[];
1008
+ }
1009
+ export type $400 = Components.Responses.InvalidRequestCreateMeterReadings;
1010
+ export type $401 = Components.Responses.Unauthorized;
1011
+ export type $403 = Components.Responses.Forbidden;
1012
+ export type $500 = Components.Responses.InternalServerError;
1013
+ }
1014
+ }
753
1015
  namespace CreateReadingWithMeter {
754
1016
  export type RequestBody = Components.Schemas.ReadingWithMeter;
755
1017
  namespace Responses {
@@ -1172,7 +1434,7 @@ declare namespace Paths {
1172
1434
  */
1173
1435
  Parameters.Timestamp;
1174
1436
  }
1175
- export type RequestBody = Components.Schemas.MeterReading;
1437
+ export type RequestBody = Components.Schemas.UpdateMeterReading;
1176
1438
  namespace Responses {
1177
1439
  export interface $200 {
1178
1440
  data?: Components.Schemas.MeterReading;
@@ -1185,7 +1447,6 @@ declare namespace Paths {
1185
1447
  }
1186
1448
  }
1187
1449
 
1188
-
1189
1450
  export interface OperationMethods {
1190
1451
  /**
1191
1452
  * getCustomerMeters - Get Customer Meters
@@ -1267,6 +1528,16 @@ export interface OperationMethods {
1267
1528
  data?: Paths.CreateMeterReadings.RequestBody,
1268
1529
  config?: AxiosRequestConfig
1269
1530
  ): OperationResponse<Paths.CreateMeterReadings.Responses.$200>
1531
+ /**
1532
+ * createPortalMeterReadings - createPortalMeterReadings
1533
+ *
1534
+ * Inserts multiple meter readings at once for a given meter. Limited to 2 readings per request.
1535
+ */
1536
+ 'createPortalMeterReadings'(
1537
+ parameters?: Parameters<Paths.CreatePortalMeterReadings.PathParameters> | null,
1538
+ data?: Paths.CreatePortalMeterReadings.RequestBody,
1539
+ config?: AxiosRequestConfig
1540
+ ): OperationResponse<Paths.CreatePortalMeterReadings.Responses.$200>
1270
1541
  /**
1271
1542
  * batchWriteMeterReadings - Batch Write Readings
1272
1543
  *
@@ -1437,6 +1708,18 @@ export interface PathsDictionary {
1437
1708
  config?: AxiosRequestConfig
1438
1709
  ): OperationResponse<Paths.CreateMeterReadings.Responses.$200>
1439
1710
  }
1711
+ ['/v1/metering/readings/{meter_id}']: {
1712
+ /**
1713
+ * createPortalMeterReadings - createPortalMeterReadings
1714
+ *
1715
+ * Inserts multiple meter readings at once for a given meter. Limited to 2 readings per request.
1716
+ */
1717
+ 'post'(
1718
+ parameters?: Parameters<Paths.CreatePortalMeterReadings.PathParameters> | null,
1719
+ data?: Paths.CreatePortalMeterReadings.RequestBody,
1720
+ config?: AxiosRequestConfig
1721
+ ): OperationResponse<Paths.CreatePortalMeterReadings.Responses.$200>
1722
+ }
1440
1723
  ['/v2/metering/readings']: {
1441
1724
  /**
1442
1725
  * batchWriteMeterReadings - Batch Write Readings
@@ -1524,7 +1807,6 @@ export interface PathsDictionary {
1524
1807
 
1525
1808
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
1526
1809
 
1527
-
1528
1810
  export type ActionLabel = Components.Schemas.ActionLabel;
1529
1811
  export type ActivityId = Components.Schemas.ActivityId;
1530
1812
  export type BaseEntity = Components.Schemas.BaseEntity;
@@ -1541,12 +1823,16 @@ export type JourneyActions = Components.Schemas.JourneyActions;
1541
1823
  export type Meter = Components.Schemas.Meter;
1542
1824
  export type MeterCounter = Components.Schemas.MeterCounter;
1543
1825
  export type MeterReading = Components.Schemas.MeterReading;
1826
+ export type PortalMeterReading = Components.Schemas.PortalMeterReading;
1544
1827
  export type ReadBy = Components.Schemas.ReadBy;
1828
+ export type Reading = Components.Schemas.Reading;
1545
1829
  export type ReadingStatus = Components.Schemas.ReadingStatus;
1546
1830
  export type ReadingWithMeter = Components.Schemas.ReadingWithMeter;
1547
1831
  export type Reason = Components.Schemas.Reason;
1832
+ export type ReasonString = Components.Schemas.ReasonString;
1548
1833
  export type Rule = Components.Schemas.Rule;
1549
1834
  export type Source = Components.Schemas.Source;
1550
1835
  export type SubmissionMeterReading = Components.Schemas.SubmissionMeterReading;
1551
1836
  export type TariffType = Components.Schemas.TariffType;
1552
1837
  export type Unit = Components.Schemas.Unit;
1838
+ export type UpdateMeterReading = Components.Schemas.UpdateMeterReading;
package/dist/openapi.json CHANGED
@@ -567,6 +567,83 @@
567
567
  }
568
568
  }
569
569
  },
570
+ "/v1/metering/readings/{meter_id}": {
571
+ "post": {
572
+ "operationId": "createPortalMeterReadings",
573
+ "summary": "createPortalMeterReadings",
574
+ "description": "Inserts multiple meter readings at once for a given meter. Limited to 2 readings per request.",
575
+ "tags": [
576
+ "ECP"
577
+ ],
578
+ "security": [
579
+ {
580
+ "PortalAuth": []
581
+ }
582
+ ],
583
+ "parameters": [
584
+ {
585
+ "in": "path",
586
+ "name": "meter_id",
587
+ "schema": {
588
+ "$ref": "#/components/schemas/Id"
589
+ },
590
+ "required": true,
591
+ "description": "The ID of the meter."
592
+ }
593
+ ],
594
+ "requestBody": {
595
+ "description": "Meter readings payload. Limited to 2 readings per request.",
596
+ "required": true,
597
+ "content": {
598
+ "application/json": {
599
+ "schema": {
600
+ "type": "object",
601
+ "properties": {
602
+ "readings": {
603
+ "type": "array",
604
+ "items": {
605
+ "$ref": "#/components/schemas/PortalMeterReading"
606
+ }
607
+ }
608
+ }
609
+ }
610
+ }
611
+ }
612
+ },
613
+ "responses": {
614
+ "200": {
615
+ "description": "Meter readings created successfully.",
616
+ "content": {
617
+ "application/json": {
618
+ "schema": {
619
+ "type": "object",
620
+ "properties": {
621
+ "data": {
622
+ "type": "array",
623
+ "items": {
624
+ "$ref": "#/components/schemas/MeterReading"
625
+ }
626
+ }
627
+ }
628
+ }
629
+ }
630
+ }
631
+ },
632
+ "400": {
633
+ "$ref": "#/components/responses/InvalidRequestCreateMeterReadings"
634
+ },
635
+ "401": {
636
+ "$ref": "#/components/responses/Unauthorized"
637
+ },
638
+ "403": {
639
+ "$ref": "#/components/responses/Forbidden"
640
+ },
641
+ "500": {
642
+ "$ref": "#/components/responses/InternalServerError"
643
+ }
644
+ }
645
+ }
646
+ },
570
647
  "/v2/metering/readings": {
571
648
  "post": {
572
649
  "operationId": "batchWriteMeterReadings",
@@ -606,6 +683,14 @@
606
683
  "schema": {
607
684
  "type": "object",
608
685
  "properties": {
686
+ "identifiers": {
687
+ "type": "array",
688
+ "items": {
689
+ "type": "string",
690
+ "description": "The identifier of the meter reading."
691
+ },
692
+ "description": "- By default, the system will use combination of counter_id, meter_id, direction, and timestamp to identify a meter reading.\n- Additional identifiers can be provided to identify a meter reading uniquely.\n- Example:\n - [\"metadata.registration_id\", \"metadata.business_unit\"]\n - [\"metadata.registration_id\", \"metadata.business_unit\", \"external_id\"]\n"
693
+ },
609
694
  "readings": {
610
695
  "type": "array",
611
696
  "items": {
@@ -1088,7 +1173,7 @@
1088
1173
  "content": {
1089
1174
  "application/json": {
1090
1175
  "schema": {
1091
- "$ref": "#/components/schemas/MeterReading"
1176
+ "$ref": "#/components/schemas/UpdateMeterReading"
1092
1177
  }
1093
1178
  }
1094
1179
  }
@@ -1332,7 +1417,9 @@
1332
1417
  "too_many_records",
1333
1418
  "timestamp_future",
1334
1419
  "duplicate_reading",
1335
- "less_than_previous"
1420
+ "less_than_previous",
1421
+ "invalid_identifiers",
1422
+ "multiple_readings_found"
1336
1423
  ]
1337
1424
  }
1338
1425
  }
@@ -1699,8 +1786,23 @@
1699
1786
  "Reason": {
1700
1787
  "type": "string",
1701
1788
  "nullable": true,
1702
- "example": "Storing the feed-in record",
1703
- "description": "The reason for recording the reading"
1789
+ "description": "The reason for recording the reading\nIf no reason is specified or left empty, the Epilot UI will show 'Regular' as the default display text\n",
1790
+ "enum": [
1791
+ "",
1792
+ "regular",
1793
+ "irregular",
1794
+ "last",
1795
+ "first",
1796
+ "meter_change",
1797
+ "contract_change",
1798
+ "meter_adjustment"
1799
+ ]
1800
+ },
1801
+ "ReasonString": {
1802
+ "type": "string",
1803
+ "nullable": true,
1804
+ "deprecated": true,
1805
+ "description": "This field is deprecated. Please use the Reason enum instead.\n"
1704
1806
  },
1705
1807
  "ReadBy": {
1706
1808
  "type": "string",
@@ -1719,7 +1821,102 @@
1719
1821
  ""
1720
1822
  ]
1721
1823
  },
1824
+ "Reading": {
1825
+ "type": "object",
1826
+ "required": [
1827
+ "value",
1828
+ "source"
1829
+ ],
1830
+ "properties": {
1831
+ "value": {
1832
+ "type": "number",
1833
+ "example": 240,
1834
+ "description": "The reading value of the meter"
1835
+ },
1836
+ "read_by": {
1837
+ "$ref": "#/components/schemas/ReadBy"
1838
+ },
1839
+ "reason": {
1840
+ "$ref": "#/components/schemas/Reason"
1841
+ },
1842
+ "meter_id": {
1843
+ "$ref": "#/components/schemas/EntityId",
1844
+ "description": "The ID of the associated meter"
1845
+ },
1846
+ "counter_id": {
1847
+ "$ref": "#/components/schemas/EntityId",
1848
+ "description": "The ID of the associated meter counter"
1849
+ },
1850
+ "direction": {
1851
+ "$ref": "#/components/schemas/Direction",
1852
+ "description": "The direction of the reading (feed-in or feed-out)"
1853
+ },
1854
+ "timestamp": {
1855
+ "type": "string",
1856
+ "description": "If the value is not provided, the system will be set with the time the request is processed.",
1857
+ "example": "2022-10-10T00:00:00.000Z",
1858
+ "format": "date-time"
1859
+ },
1860
+ "source": {
1861
+ "$ref": "#/components/schemas/Source",
1862
+ "description": "The source of the reading"
1863
+ },
1864
+ "status": {
1865
+ "$ref": "#/components/schemas/ReadingStatus",
1866
+ "description": "The status of the reading"
1867
+ },
1868
+ "external_id": {
1869
+ "type": "string",
1870
+ "description": "The external ID of the reading"
1871
+ },
1872
+ "remark": {
1873
+ "type": "string",
1874
+ "nullable": true,
1875
+ "description": "A remark or comment for the reading",
1876
+ "example": "Customer reported unusual consumption"
1877
+ },
1878
+ "metadata": {
1879
+ "type": "object",
1880
+ "additionalProperties": {
1881
+ "type": "string"
1882
+ },
1883
+ "description": "Additional metadata for the reading",
1884
+ "example": {
1885
+ "registration_id": "1234567890",
1886
+ "business_unit": "ABC"
1887
+ }
1888
+ },
1889
+ "note": {
1890
+ "type": "string",
1891
+ "description": "Notes to record a meter reading"
1892
+ }
1893
+ }
1894
+ },
1722
1895
  "MeterReading": {
1896
+ "allOf": [
1897
+ {
1898
+ "$ref": "#/components/schemas/Reading"
1899
+ },
1900
+ {
1901
+ "required": [
1902
+ "meter_id"
1903
+ ]
1904
+ }
1905
+ ]
1906
+ },
1907
+ "PortalMeterReading": {
1908
+ "allOf": [
1909
+ {
1910
+ "$ref": "#/components/schemas/Reading"
1911
+ },
1912
+ {
1913
+ "required": [
1914
+ "counter_id"
1915
+ ]
1916
+ }
1917
+ ]
1918
+ },
1919
+ "UpdateMeterReading": {
1723
1920
  "type": "object",
1724
1921
  "required": [
1725
1922
  "value",
@@ -1736,7 +1933,7 @@
1736
1933
  "$ref": "#/components/schemas/ReadBy"
1737
1934
  },
1738
1935
  "reason": {
1739
- "$ref": "#/components/schemas/Reason"
1936
+ "$ref": "#/components/schemas/ReasonString"
1740
1937
  },
1741
1938
  "meter_id": {
1742
1939
  "$ref": "#/components/schemas/EntityId",
@@ -1753,7 +1950,8 @@
1753
1950
  "timestamp": {
1754
1951
  "type": "string",
1755
1952
  "description": "If the value is not provided, the system will be set with the time the request is processed.",
1756
- "example": "2022-10-10T00:00:00.000Z"
1953
+ "example": "2022-10-10T00:00:00.000Z",
1954
+ "format": "date-time"
1757
1955
  },
1758
1956
  "source": {
1759
1957
  "$ref": "#/components/schemas/Source",
@@ -1762,6 +1960,27 @@
1762
1960
  "status": {
1763
1961
  "$ref": "#/components/schemas/ReadingStatus",
1764
1962
  "description": "The status of the reading"
1963
+ },
1964
+ "external_id": {
1965
+ "type": "string",
1966
+ "description": "The external ID of the reading"
1967
+ },
1968
+ "remark": {
1969
+ "type": "string",
1970
+ "nullable": true,
1971
+ "description": "A remark or comment for the reading",
1972
+ "example": "Customer reported unusual consumption"
1973
+ },
1974
+ "metadata": {
1975
+ "type": "object",
1976
+ "additionalProperties": {
1977
+ "type": "string"
1978
+ },
1979
+ "description": "Additional metadata for the reading",
1980
+ "example": {
1981
+ "registration_id": "1234567890",
1982
+ "business_unit": "ABC"
1983
+ }
1765
1984
  }
1766
1985
  }
1767
1986
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/metering-client",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
4
4
  "description": "API Client for epilot Metering API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,6 +18,18 @@
18
18
  "sdk",
19
19
  "metering"
20
20
  ],
21
+ "scripts": {
22
+ "test": "jest",
23
+ "typescript": "tsc",
24
+ "bundle-definition": "webpack",
25
+ "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/metering.yaml",
26
+ "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
27
+ "build": "tsc && npm run build:patch && npm run bundle-definition",
28
+ "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
29
+ "build:watch": "npm run build && tsc -w",
30
+ "prepublishOnly": "npm run typegen && npm run build",
31
+ "lint": "pnpm exec eslint src"
32
+ },
21
33
  "files": [
22
34
  "*.js",
23
35
  "*.d.ts",
@@ -58,16 +70,5 @@
58
70
  "typescript": "^4.1.3",
59
71
  "webpack": "^5.18.0",
60
72
  "webpack-cli": "^4.4.0"
61
- },
62
- "scripts": {
63
- "test": "jest",
64
- "typescript": "tsc",
65
- "bundle-definition": "webpack",
66
- "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/metering.yaml",
67
- "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
68
- "build": "tsc && npm run build:patch && npm run bundle-definition",
69
- "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
70
- "build:watch": "npm run build && tsc -w",
71
- "lint": "pnpm exec eslint src"
72
73
  }
73
- }
74
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2025 epilot GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.