@twin.org/telemetry-service 0.0.3-next.1 → 0.0.3-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/telemetryRoutes.js +1 -1
- package/dist/es/telemetryRoutes.js.map +1 -1
- package/docs/changelog.md +14 -0
- package/docs/open-api/spec.json +434 -41
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetryRoutes.js","sourceRoot":"","sources":["../../src/telemetryRoutes.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EACN,UAAU,EAYV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE5D;;GAEG;AACH,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAW;IACpC;QACC,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,8DAA8D;KAC3E;CACD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAC1C,aAAqB,EACrB,aAAqB;IAErB,MAAM,iBAAiB,GAAgE;QACtF,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,2BAA2B;QACpC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1B,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,GAAG,aAAa,SAAS;QAC/B,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,EAAE,CAC9C,qBAAqB,CAAC,kBAAkB,EAAE,aAAa,EAAE,OAAO,CAAC;QAClE,WAAW,EAAE;YACZ,IAAI,iCAAyC;YAC7C,QAAQ,EAAE;gBACT;oBACC,EAAE,EAAE,qCAAqC;oBACzC,OAAO,EAAE;wBACR,IAAI,EAAE;4BACL,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C;IACpF,MAAM,CAAC,MAAM,CACZ,aAAa,mBAEb,OAAO,CAAC,KAAK,CACb,CAAC;IACF,MAAM,CAAC,WAAW,CAAC,aAAa,2BAAiC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAExF,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAsB,aAAa,CAAC,CAAC;IAE3E,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC,WAAW,CACjD,OAAO,EAAE,UAAU,CAAC,EAAE,EACtB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,EACxC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,EACtC,OAAO,EAAE,KAAK,EAAE,MAAM,EACtB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CACpC,CAAC;IAEF,OAAO;QACN,IAAI,EAAE,cAAc;KACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tICreatedResponse,\n\tIHttpRequestContext,\n\tINoContentResponse,\n\tIRestRoute,\n\tITag\n} from \"@twin.org/api-models\";\nimport { Coerce, ComponentFactory, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tMetricType,\n\ttype ITelemetryAddMetricValueRequest,\n\ttype ITelemetryComponent,\n\ttype ITelemetryCreateMetricRequest,\n\ttype ITelemetryGetMetricRequest,\n\ttype ITelemetryGetMetricResponse,\n\ttype ITelemetryListRequest,\n\ttype ITelemetryListResponse,\n\ttype ITelemetryRemoveMetricRequest,\n\ttype ITelemetryUpdateMetricRequest,\n\ttype ITelemetryValuesListRequest,\n\ttype ITelemetryValuesListResponse\n} from \"@twin.org/telemetry-models\";\nimport { HeaderTypes, HttpStatusCode } from \"@twin.org/web\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"telemetryRoutes\";\n\n/**\n * The tag to associate with the routes.\n */\nexport const tagsTelemetry: ITag[] = [\n\t{\n\t\tname: \"Telemetry\",\n\t\tdescription: \"Endpoints which are modelled to access a telemetry contract.\"\n\t}\n];\n\n/**\n * The REST routes for telemetry.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateRestRoutesTelemetry(\n\tbaseRouteName: string,\n\tcomponentName: string\n): IRestRoute[] {\n\tconst createMetricRoute: IRestRoute<ITelemetryCreateMetricRequest, ICreatedResponse> = {\n\t\toperationId: \"telemetryCreateMetric\",\n\t\tsummary: \"Create a telemetry metric\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/metric`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryCreateMetric(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryCreateMetricRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryCreateMetricRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tid: \"my-counter\",\n\t\t\t\t\t\t\tlabel: \"My Counter\",\n\t\t\t\t\t\t\tdescription: \"This is my counter\",\n\t\t\t\t\t\t\ttype: MetricType.Counter,\n\t\t\t\t\t\t\tunit: \"KG\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ICreatedResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryCreateMetricResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: HttpStatusCode.created,\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.Location]: \"my-counter\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst getMetricRoute: IRestRoute<ITelemetryGetMetricRequest, ITelemetryGetMetricResponse> = {\n\t\toperationId: \"telemetryGetMetric\",\n\t\tsummary: \"Get a telemetry metric and it's most recent value\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/metric/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryGetMetric(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryGetMetricRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryGetMetricRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ITelemetryGetMetricResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryGetMetricResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\tmetric: {\n\t\t\t\t\t\t\t\t\tid: \"my-counter\",\n\t\t\t\t\t\t\t\t\tlabel: \"My Counter\",\n\t\t\t\t\t\t\t\t\tdescription: \"This is my counter\",\n\t\t\t\t\t\t\t\t\ttype: MetricType.Counter,\n\t\t\t\t\t\t\t\t\tunit: \"KG\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t\t\tid: \"aabbccdd11223445566\",\n\t\t\t\t\t\t\t\t\tts: 1715252922273,\n\t\t\t\t\t\t\t\t\tvalue: 10\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst updateMetricRoute: IRestRoute<ITelemetryUpdateMetricRequest, INoContentResponse> = {\n\t\toperationId: \"telemetryUpdateMetric\",\n\t\tsummary: \"Update a telemetry metric\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"PUT\",\n\t\tpath: `${baseRouteName}/metric/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryUpdateMetric(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryUpdateMetricRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryUpdateMetricRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tlabel: \"My New Label\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<INoContentResponse>()\n\t\t\t}\n\t\t]\n\t};\n\n\tconst addMetricValueRoute: IRestRoute<ITelemetryAddMetricValueRequest, ICreatedResponse> = {\n\t\toperationId: \"telemetryAddMetricValue\",\n\t\tsummary: \"Add a telemetry metric value\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/metric/:id/value`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryAddMetricValue(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryAddMetricValueRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryAddMetricValueRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tvalue: 10\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryAddMetricValueIncRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tvalue: \"inc\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ICreatedResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryAddMetricValueResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: HttpStatusCode.created,\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.Location]: \"aabbccdd11223445566\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst removeMetricRoute: IRestRoute<ITelemetryRemoveMetricRequest, INoContentResponse> = {\n\t\toperationId: \"telemetryRemoveMetric\",\n\t\tsummary: \"Remove a telemetry metric and it's values.\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"DELETE\",\n\t\tpath: `${baseRouteName}/metric/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryRemoveMetric(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryRemoveMetricRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryRemoveMetricRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<INoContentResponse>()\n\t\t\t}\n\t\t]\n\t};\n\n\tconst listMetricsRoute: IRestRoute<ITelemetryListRequest, ITelemetryListResponse> = {\n\t\toperationId: \"telemetryListEntries\",\n\t\tsummary: \"Get a list of the telemetry metrics\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/metric`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryMetricList(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryListRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryListRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\ttype: MetricType.Counter\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ITelemetryListResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryListResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\tentities: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: \"my-counter\",\n\t\t\t\t\t\t\t\t\t\tlabel: \"My Counter\",\n\t\t\t\t\t\t\t\t\t\ttype: MetricType.Counter,\n\t\t\t\t\t\t\t\t\t\tunit: \"KG\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: \"my-counter-2\",\n\t\t\t\t\t\t\t\t\t\tlabel: \"My Counter 2\",\n\t\t\t\t\t\t\t\t\t\ttype: MetricType.IncDecCounter,\n\t\t\t\t\t\t\t\t\t\tunit: \"M\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tcursor: \"1\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst listMetricsValuesRoute: IRestRoute<\n\t\tITelemetryValuesListRequest,\n\t\tITelemetryValuesListResponse\n\t> = {\n\t\toperationId: \"telemetryValuesListEntries\",\n\t\tsummary: \"Get a list of the values for a telemetry metric\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/metric/:id/value`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryMetricValueList(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryValuesListRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryValuesListRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ITelemetryValuesListResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryValuesListResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\tmetric: {\n\t\t\t\t\t\t\t\t\tid: \"my-counter\",\n\t\t\t\t\t\t\t\t\tlabel: \"My Counter\",\n\t\t\t\t\t\t\t\t\ttype: MetricType.Counter,\n\t\t\t\t\t\t\t\t\tunit: \"KG\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tentities: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: \"aabbccdd11223445566\",\n\t\t\t\t\t\t\t\t\t\tts: 1715252922273,\n\t\t\t\t\t\t\t\t\t\tvalue: 10\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: \"aabbccdd11223445566\",\n\t\t\t\t\t\t\t\t\t\tts: 1715252922274,\n\t\t\t\t\t\t\t\t\t\tvalue: 11\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tcursor: \"1\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\treturn [\n\t\tcreateMetricRoute,\n\t\tgetMetricRoute,\n\t\tupdateMetricRoute,\n\t\taddMetricValueRoute,\n\t\tremoveMetricRoute,\n\t\tlistMetricsRoute,\n\t\tlistMetricsValuesRoute\n\t];\n}\n\n/**\n * Create a new telemetry metric.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryCreateMetric(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryCreateMetricRequest\n): Promise<ICreatedResponse> {\n\tGuards.object<ITelemetryCreateMetricRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryCreateMetricRequest[\"body\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.body),\n\t\trequest.body\n\t);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tawait component.createMetric({\n\t\tid: request.body.id,\n\t\tlabel: request.body.label,\n\t\tdescription: request.body.description,\n\t\ttype: request.body.type,\n\t\tunit: request.body.unit\n\t});\n\treturn {\n\t\tstatusCode: HttpStatusCode.created,\n\t\theaders: {\n\t\t\t[HeaderTypes.Location]: request.body.id\n\t\t}\n\t};\n}\n\n/**\n * Gets a telemetry metric.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryGetMetric(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryGetMetricRequest\n): Promise<ITelemetryGetMetricResponse> {\n\tGuards.object<ITelemetryGetMetricRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryGetMetricRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tconst result = await component.getMetric(request.pathParams.id);\n\treturn { body: result };\n}\n\n/**\n * Updates a telemetry metric.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryUpdateMetric(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryUpdateMetricRequest\n): Promise<INoContentResponse> {\n\tGuards.object<ITelemetryUpdateMetricRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryUpdateMetricRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\tGuards.object<ITelemetryUpdateMetricRequest[\"body\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.body),\n\t\trequest.body\n\t);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tawait component.updateMetric({\n\t\tid: request.pathParams.id,\n\t\tlabel: request.body.label,\n\t\tdescription: request.body.description,\n\t\tunit: request.body.unit\n\t});\n\n\treturn { statusCode: HttpStatusCode.noContent };\n}\n\n/**\n * Add a telemetry metric value.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryAddMetricValue(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryAddMetricValueRequest\n): Promise<ICreatedResponse> {\n\tGuards.object<ITelemetryAddMetricValueRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryAddMetricValueRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\tGuards.object<ITelemetryAddMetricValueRequest[\"body\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.body),\n\t\trequest.body\n\t);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tconst id = await component.addMetricValue(\n\t\trequest.pathParams.id,\n\t\trequest.body.value,\n\t\trequest.body.customData\n\t);\n\n\treturn { statusCode: HttpStatusCode.created, headers: { [HeaderTypes.Location]: id } };\n}\n\n/**\n * Removes a telemetry metric.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryRemoveMetric(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryRemoveMetricRequest\n): Promise<INoContentResponse> {\n\tGuards.object<ITelemetryRemoveMetricRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryRemoveMetricRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tawait component.removeMetric(request.pathParams.id);\n\treturn {\n\t\tstatusCode: HttpStatusCode.noContent\n\t};\n}\n\n/**\n * Get a list of the telemetry metrics.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryMetricList(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryListRequest\n): Promise<ITelemetryListResponse> {\n\tGuards.object<ITelemetryListRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryListRequest[\"query\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.query),\n\t\trequest.query\n\t);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\n\tconst itemsAndCursor = await component.query(\n\t\tCoerce.number(request?.query?.type) as MetricType,\n\t\trequest?.query?.cursor,\n\t\tCoerce.number(request?.query?.limit)\n\t);\n\n\treturn {\n\t\tbody: itemsAndCursor\n\t};\n}\n\n/**\n * Get a list of the telemetry metric values.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryMetricValueList(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryValuesListRequest\n): Promise<ITelemetryValuesListResponse> {\n\tGuards.object<ITelemetryValuesListRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryValuesListRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.query),\n\t\trequest.query\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\n\tconst itemsAndCursor = await component.queryValues(\n\t\trequest?.pathParams.id,\n\t\tCoerce.number(request?.query?.timeStart),\n\t\tCoerce.number(request?.query?.timeEnd),\n\t\trequest?.query?.cursor,\n\t\tCoerce.number(request?.query?.limit)\n\t);\n\n\treturn {\n\t\tbody: itemsAndCursor\n\t};\n}\n"]}
|
|
1
|
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,MAAM,SAAS,CAAC,WAAW,CACjD,OAAO,EAAE,UAAU,CAAC,EAAE,EACtB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,EACxC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,EACtC,OAAO,EAAE,KAAK,EAAE,MAAM,EACtB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CACpC,CAAC;IAEF,OAAO;QACN,IAAI,EAAE,cAAc;KACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tICreatedResponse,\n\tIHttpRequestContext,\n\tINoContentResponse,\n\tIRestRoute,\n\tITag\n} from \"@twin.org/api-models\";\nimport { Coerce, ComponentFactory, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tMetricType,\n\ttype ITelemetryAddMetricValueRequest,\n\ttype ITelemetryComponent,\n\ttype ITelemetryCreateMetricRequest,\n\ttype ITelemetryGetMetricRequest,\n\ttype ITelemetryGetMetricResponse,\n\ttype ITelemetryListRequest,\n\ttype ITelemetryListResponse,\n\ttype ITelemetryRemoveMetricRequest,\n\ttype ITelemetryUpdateMetricRequest,\n\ttype ITelemetryValuesListRequest,\n\ttype ITelemetryValuesListResponse\n} from \"@twin.org/telemetry-models\";\nimport { HeaderTypes, HttpStatusCode } from \"@twin.org/web\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"telemetryRoutes\";\n\n/**\n * The tag to associate with the routes.\n */\nexport const tagsTelemetry: ITag[] = [\n\t{\n\t\tname: \"Telemetry\",\n\t\tdescription: \"Endpoints which are modelled to access a telemetry contract.\"\n\t}\n];\n\n/**\n * The REST routes for telemetry.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateRestRoutesTelemetry(\n\tbaseRouteName: string,\n\tcomponentName: string\n): IRestRoute[] {\n\tconst createMetricRoute: IRestRoute<ITelemetryCreateMetricRequest, ICreatedResponse> = {\n\t\toperationId: \"telemetryCreateMetric\",\n\t\tsummary: \"Create a telemetry metric\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/metric`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryCreateMetric(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryCreateMetricRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryCreateMetricRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tid: \"my-counter\",\n\t\t\t\t\t\t\tlabel: \"My Counter\",\n\t\t\t\t\t\t\tdescription: \"This is my counter\",\n\t\t\t\t\t\t\ttype: MetricType.Counter,\n\t\t\t\t\t\t\tunit: \"KG\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ICreatedResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryCreateMetricResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: HttpStatusCode.created,\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.Location]: \"my-counter\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst getMetricRoute: IRestRoute<ITelemetryGetMetricRequest, ITelemetryGetMetricResponse> = {\n\t\toperationId: \"telemetryGetMetric\",\n\t\tsummary: \"Get a telemetry metric and it's most recent value\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/metric/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryGetMetric(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryGetMetricRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryGetMetricRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ITelemetryGetMetricResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryGetMetricResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\tmetric: {\n\t\t\t\t\t\t\t\t\tid: \"my-counter\",\n\t\t\t\t\t\t\t\t\tlabel: \"My Counter\",\n\t\t\t\t\t\t\t\t\tdescription: \"This is my counter\",\n\t\t\t\t\t\t\t\t\ttype: MetricType.Counter,\n\t\t\t\t\t\t\t\t\tunit: \"KG\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t\t\tid: \"aabbccdd11223445566\",\n\t\t\t\t\t\t\t\t\tts: 1715252922273,\n\t\t\t\t\t\t\t\t\tvalue: 10\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst updateMetricRoute: IRestRoute<ITelemetryUpdateMetricRequest, INoContentResponse> = {\n\t\toperationId: \"telemetryUpdateMetric\",\n\t\tsummary: \"Update a telemetry metric\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"PUT\",\n\t\tpath: `${baseRouteName}/metric/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryUpdateMetric(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryUpdateMetricRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryUpdateMetricRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tlabel: \"My New Label\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<INoContentResponse>()\n\t\t\t}\n\t\t]\n\t};\n\n\tconst addMetricValueRoute: IRestRoute<ITelemetryAddMetricValueRequest, ICreatedResponse> = {\n\t\toperationId: \"telemetryAddMetricValue\",\n\t\tsummary: \"Add a telemetry metric value\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/metric/:id/value`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryAddMetricValue(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryAddMetricValueRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryAddMetricValueRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tvalue: 10\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryAddMetricValueIncRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tvalue: \"inc\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ICreatedResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryAddMetricValueResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tstatusCode: HttpStatusCode.created,\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t[HeaderTypes.Location]: \"aabbccdd11223445566\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst removeMetricRoute: IRestRoute<ITelemetryRemoveMetricRequest, INoContentResponse> = {\n\t\toperationId: \"telemetryRemoveMetric\",\n\t\tsummary: \"Remove a telemetry metric and it's values.\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"DELETE\",\n\t\tpath: `${baseRouteName}/metric/:id`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryRemoveMetric(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryRemoveMetricRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryRemoveMetricRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<INoContentResponse>()\n\t\t\t}\n\t\t]\n\t};\n\n\tconst listMetricsRoute: IRestRoute<ITelemetryListRequest, ITelemetryListResponse> = {\n\t\toperationId: \"telemetryListEntries\",\n\t\tsummary: \"Get a list of the telemetry metrics\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/metric`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryMetricList(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryListRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryListRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\ttype: MetricType.Counter.toString()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ITelemetryListResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryListResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\tentities: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: \"my-counter\",\n\t\t\t\t\t\t\t\t\t\tlabel: \"My Counter\",\n\t\t\t\t\t\t\t\t\t\ttype: MetricType.Counter,\n\t\t\t\t\t\t\t\t\t\tunit: \"KG\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: \"my-counter-2\",\n\t\t\t\t\t\t\t\t\t\tlabel: \"My Counter 2\",\n\t\t\t\t\t\t\t\t\t\ttype: MetricType.IncDecCounter,\n\t\t\t\t\t\t\t\t\t\tunit: \"M\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tcursor: \"1\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst listMetricsValuesRoute: IRestRoute<\n\t\tITelemetryValuesListRequest,\n\t\tITelemetryValuesListResponse\n\t> = {\n\t\toperationId: \"telemetryValuesListEntries\",\n\t\tsummary: \"Get a list of the values for a telemetry metric\",\n\t\ttag: tagsTelemetry[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/metric/:id/value`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\ttelemetryMetricValueList(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ITelemetryValuesListRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"telemetryValuesListRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tid: \"my-counter\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ITelemetryValuesListResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"telemetryValuesListResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\tmetric: {\n\t\t\t\t\t\t\t\t\tid: \"my-counter\",\n\t\t\t\t\t\t\t\t\tlabel: \"My Counter\",\n\t\t\t\t\t\t\t\t\ttype: MetricType.Counter,\n\t\t\t\t\t\t\t\t\tunit: \"KG\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tentities: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: \"aabbccdd11223445566\",\n\t\t\t\t\t\t\t\t\t\tts: 1715252922273,\n\t\t\t\t\t\t\t\t\t\tvalue: 10\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tid: \"aabbccdd11223445566\",\n\t\t\t\t\t\t\t\t\t\tts: 1715252922274,\n\t\t\t\t\t\t\t\t\t\tvalue: 11\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tcursor: \"1\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\treturn [\n\t\tcreateMetricRoute,\n\t\tgetMetricRoute,\n\t\tupdateMetricRoute,\n\t\taddMetricValueRoute,\n\t\tremoveMetricRoute,\n\t\tlistMetricsRoute,\n\t\tlistMetricsValuesRoute\n\t];\n}\n\n/**\n * Create a new telemetry metric.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryCreateMetric(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryCreateMetricRequest\n): Promise<ICreatedResponse> {\n\tGuards.object<ITelemetryCreateMetricRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryCreateMetricRequest[\"body\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.body),\n\t\trequest.body\n\t);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tawait component.createMetric({\n\t\tid: request.body.id,\n\t\tlabel: request.body.label,\n\t\tdescription: request.body.description,\n\t\ttype: request.body.type,\n\t\tunit: request.body.unit\n\t});\n\treturn {\n\t\tstatusCode: HttpStatusCode.created,\n\t\theaders: {\n\t\t\t[HeaderTypes.Location]: request.body.id\n\t\t}\n\t};\n}\n\n/**\n * Gets a telemetry metric.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryGetMetric(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryGetMetricRequest\n): Promise<ITelemetryGetMetricResponse> {\n\tGuards.object<ITelemetryGetMetricRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryGetMetricRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tconst result = await component.getMetric(request.pathParams.id);\n\treturn { body: result };\n}\n\n/**\n * Updates a telemetry metric.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryUpdateMetric(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryUpdateMetricRequest\n): Promise<INoContentResponse> {\n\tGuards.object<ITelemetryUpdateMetricRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryUpdateMetricRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\tGuards.object<ITelemetryUpdateMetricRequest[\"body\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.body),\n\t\trequest.body\n\t);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tawait component.updateMetric({\n\t\tid: request.pathParams.id,\n\t\tlabel: request.body.label,\n\t\tdescription: request.body.description,\n\t\tunit: request.body.unit\n\t});\n\n\treturn { statusCode: HttpStatusCode.noContent };\n}\n\n/**\n * Add a telemetry metric value.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryAddMetricValue(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryAddMetricValueRequest\n): Promise<ICreatedResponse> {\n\tGuards.object<ITelemetryAddMetricValueRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryAddMetricValueRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\tGuards.object<ITelemetryAddMetricValueRequest[\"body\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.body),\n\t\trequest.body\n\t);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tconst id = await component.addMetricValue(\n\t\trequest.pathParams.id,\n\t\trequest.body.value,\n\t\trequest.body.customData\n\t);\n\n\treturn { statusCode: HttpStatusCode.created, headers: { [HeaderTypes.Location]: id } };\n}\n\n/**\n * Removes a telemetry metric.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryRemoveMetric(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryRemoveMetricRequest\n): Promise<INoContentResponse> {\n\tGuards.object<ITelemetryRemoveMetricRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryRemoveMetricRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams),\n\t\trequest.pathParams\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\tawait component.removeMetric(request.pathParams.id);\n\treturn {\n\t\tstatusCode: HttpStatusCode.noContent\n\t};\n}\n\n/**\n * Get a list of the telemetry metrics.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryMetricList(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryListRequest\n): Promise<ITelemetryListResponse> {\n\tGuards.object<ITelemetryListRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryListRequest[\"query\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.query),\n\t\trequest.query\n\t);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\n\tconst itemsAndCursor = await component.query(\n\t\tCoerce.number(request?.query?.type) as MetricType,\n\t\trequest?.query?.cursor,\n\t\tCoerce.number(request?.query?.limit)\n\t);\n\n\treturn {\n\t\tbody: itemsAndCursor\n\t};\n}\n\n/**\n * Get a list of the telemetry metric values.\n * @param httpRequestContext The request context for the API.\n * @param componentName The name of the component to use in the routes.\n * @param request The request.\n * @returns The response object with additional http response properties.\n */\nexport async function telemetryMetricValueList(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ITelemetryValuesListRequest\n): Promise<ITelemetryValuesListResponse> {\n\tGuards.object<ITelemetryValuesListRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object<ITelemetryValuesListRequest[\"pathParams\"]>(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.query),\n\t\trequest.query\n\t);\n\tGuards.stringValue(ROUTES_SOURCE, nameof(request.pathParams.id), request.pathParams.id);\n\n\tconst component = ComponentFactory.get<ITelemetryComponent>(componentName);\n\n\tconst itemsAndCursor = await component.queryValues(\n\t\trequest?.pathParams.id,\n\t\tCoerce.number(request?.query?.timeStart),\n\t\tCoerce.number(request?.query?.timeEnd),\n\t\trequest?.query?.cursor,\n\t\tCoerce.number(request?.query?.limit)\n\t);\n\n\treturn {\n\t\tbody: itemsAndCursor\n\t};\n}\n"]}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/telemetry-service - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.2](https://github.com/twinfoundation/telemetry/compare/telemetry-service-v0.0.3-next.1...telemetry-service-v0.0.3-next.2) (2026-03-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* api data types ([2edc5ac](https://github.com/twinfoundation/telemetry/commit/2edc5ac665b996a1b29173cac3b389fa3ceafa34))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/telemetry-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.1](https://github.com/twinfoundation/telemetry/compare/telemetry-service-v0.0.3-next.0...telemetry-service-v0.0.3-next.1) (2025-11-11)
|
|
4
18
|
|
|
5
19
|
|
package/docs/open-api/spec.json
CHANGED
|
@@ -56,15 +56,8 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"responses": {
|
|
59
|
-
"
|
|
59
|
+
"201": {
|
|
60
60
|
"description": "The rest request ended in created response.",
|
|
61
|
-
"content": {
|
|
62
|
-
"text/plain": {
|
|
63
|
-
"schema": {
|
|
64
|
-
"$ref": "#/components/schemas/CreatedResponse"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
61
|
"headers": {
|
|
69
62
|
"location": {
|
|
70
63
|
"schema": {
|
|
@@ -73,6 +66,63 @@
|
|
|
73
66
|
"description": "e.g. my-counter"
|
|
74
67
|
}
|
|
75
68
|
}
|
|
69
|
+
},
|
|
70
|
+
"400": {
|
|
71
|
+
"description": "The server cannot process the request, see the content for more details.",
|
|
72
|
+
"content": {
|
|
73
|
+
"application/json": {
|
|
74
|
+
"schema": {
|
|
75
|
+
"$ref": "#/components/schemas/Error"
|
|
76
|
+
},
|
|
77
|
+
"examples": {
|
|
78
|
+
"exampleResponse": {
|
|
79
|
+
"value": {
|
|
80
|
+
"name": "GeneralError",
|
|
81
|
+
"message": "errorMessage",
|
|
82
|
+
"properties": {
|
|
83
|
+
"foo": "bar"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"401": {
|
|
92
|
+
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
|
|
93
|
+
"content": {
|
|
94
|
+
"application/json": {
|
|
95
|
+
"schema": {
|
|
96
|
+
"$ref": "#/components/schemas/Error"
|
|
97
|
+
},
|
|
98
|
+
"examples": {
|
|
99
|
+
"exampleResponse": {
|
|
100
|
+
"value": {
|
|
101
|
+
"name": "UnauthorizedError",
|
|
102
|
+
"message": "errorMessage"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"500": {
|
|
110
|
+
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
|
|
111
|
+
"content": {
|
|
112
|
+
"application/json": {
|
|
113
|
+
"schema": {
|
|
114
|
+
"$ref": "#/components/schemas/Error"
|
|
115
|
+
},
|
|
116
|
+
"examples": {
|
|
117
|
+
"exampleResponse": {
|
|
118
|
+
"value": {
|
|
119
|
+
"name": "InternalServerError",
|
|
120
|
+
"message": "errorMessage"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
76
126
|
}
|
|
77
127
|
}
|
|
78
128
|
},
|
|
@@ -89,8 +139,9 @@
|
|
|
89
139
|
"in": "query",
|
|
90
140
|
"required": false,
|
|
91
141
|
"schema": {
|
|
92
|
-
"
|
|
93
|
-
}
|
|
142
|
+
"type": "string"
|
|
143
|
+
},
|
|
144
|
+
"example": "0"
|
|
94
145
|
},
|
|
95
146
|
{
|
|
96
147
|
"name": "cursor",
|
|
@@ -147,6 +198,63 @@
|
|
|
147
198
|
}
|
|
148
199
|
}
|
|
149
200
|
}
|
|
201
|
+
},
|
|
202
|
+
"400": {
|
|
203
|
+
"description": "The server cannot process the request, see the content for more details.",
|
|
204
|
+
"content": {
|
|
205
|
+
"application/json": {
|
|
206
|
+
"schema": {
|
|
207
|
+
"$ref": "#/components/schemas/Error"
|
|
208
|
+
},
|
|
209
|
+
"examples": {
|
|
210
|
+
"exampleResponse": {
|
|
211
|
+
"value": {
|
|
212
|
+
"name": "GeneralError",
|
|
213
|
+
"message": "errorMessage",
|
|
214
|
+
"properties": {
|
|
215
|
+
"foo": "bar"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"401": {
|
|
224
|
+
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
|
|
225
|
+
"content": {
|
|
226
|
+
"application/json": {
|
|
227
|
+
"schema": {
|
|
228
|
+
"$ref": "#/components/schemas/Error"
|
|
229
|
+
},
|
|
230
|
+
"examples": {
|
|
231
|
+
"exampleResponse": {
|
|
232
|
+
"value": {
|
|
233
|
+
"name": "UnauthorizedError",
|
|
234
|
+
"message": "errorMessage"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"500": {
|
|
242
|
+
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
|
|
243
|
+
"content": {
|
|
244
|
+
"application/json": {
|
|
245
|
+
"schema": {
|
|
246
|
+
"$ref": "#/components/schemas/Error"
|
|
247
|
+
},
|
|
248
|
+
"examples": {
|
|
249
|
+
"exampleResponse": {
|
|
250
|
+
"value": {
|
|
251
|
+
"name": "InternalServerError",
|
|
252
|
+
"message": "errorMessage"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
150
258
|
}
|
|
151
259
|
}
|
|
152
260
|
}
|
|
@@ -204,6 +312,63 @@
|
|
|
204
312
|
}
|
|
205
313
|
}
|
|
206
314
|
}
|
|
315
|
+
},
|
|
316
|
+
"400": {
|
|
317
|
+
"description": "The server cannot process the request, see the content for more details.",
|
|
318
|
+
"content": {
|
|
319
|
+
"application/json": {
|
|
320
|
+
"schema": {
|
|
321
|
+
"$ref": "#/components/schemas/Error"
|
|
322
|
+
},
|
|
323
|
+
"examples": {
|
|
324
|
+
"exampleResponse": {
|
|
325
|
+
"value": {
|
|
326
|
+
"name": "GeneralError",
|
|
327
|
+
"message": "errorMessage",
|
|
328
|
+
"properties": {
|
|
329
|
+
"foo": "bar"
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"401": {
|
|
338
|
+
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
|
|
339
|
+
"content": {
|
|
340
|
+
"application/json": {
|
|
341
|
+
"schema": {
|
|
342
|
+
"$ref": "#/components/schemas/Error"
|
|
343
|
+
},
|
|
344
|
+
"examples": {
|
|
345
|
+
"exampleResponse": {
|
|
346
|
+
"value": {
|
|
347
|
+
"name": "UnauthorizedError",
|
|
348
|
+
"message": "errorMessage"
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"500": {
|
|
356
|
+
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
|
|
357
|
+
"content": {
|
|
358
|
+
"application/json": {
|
|
359
|
+
"schema": {
|
|
360
|
+
"$ref": "#/components/schemas/Error"
|
|
361
|
+
},
|
|
362
|
+
"examples": {
|
|
363
|
+
"exampleResponse": {
|
|
364
|
+
"value": {
|
|
365
|
+
"name": "InternalServerError",
|
|
366
|
+
"message": "errorMessage"
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
207
372
|
}
|
|
208
373
|
}
|
|
209
374
|
},
|
|
@@ -250,12 +415,62 @@
|
|
|
250
415
|
}
|
|
251
416
|
},
|
|
252
417
|
"responses": {
|
|
253
|
-
"
|
|
254
|
-
"description": "The rest request ended in success with no data."
|
|
418
|
+
"204": {
|
|
419
|
+
"description": "The rest request ended in success with no data."
|
|
420
|
+
},
|
|
421
|
+
"400": {
|
|
422
|
+
"description": "The server cannot process the request, see the content for more details.",
|
|
423
|
+
"content": {
|
|
424
|
+
"application/json": {
|
|
425
|
+
"schema": {
|
|
426
|
+
"$ref": "#/components/schemas/Error"
|
|
427
|
+
},
|
|
428
|
+
"examples": {
|
|
429
|
+
"exampleResponse": {
|
|
430
|
+
"value": {
|
|
431
|
+
"name": "GeneralError",
|
|
432
|
+
"message": "errorMessage",
|
|
433
|
+
"properties": {
|
|
434
|
+
"foo": "bar"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
"401": {
|
|
443
|
+
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
|
|
444
|
+
"content": {
|
|
445
|
+
"application/json": {
|
|
446
|
+
"schema": {
|
|
447
|
+
"$ref": "#/components/schemas/Error"
|
|
448
|
+
},
|
|
449
|
+
"examples": {
|
|
450
|
+
"exampleResponse": {
|
|
451
|
+
"value": {
|
|
452
|
+
"name": "UnauthorizedError",
|
|
453
|
+
"message": "errorMessage"
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
"500": {
|
|
461
|
+
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
|
|
255
462
|
"content": {
|
|
256
|
-
"
|
|
463
|
+
"application/json": {
|
|
257
464
|
"schema": {
|
|
258
|
-
"$ref": "#/components/schemas/
|
|
465
|
+
"$ref": "#/components/schemas/Error"
|
|
466
|
+
},
|
|
467
|
+
"examples": {
|
|
468
|
+
"exampleResponse": {
|
|
469
|
+
"value": {
|
|
470
|
+
"name": "InternalServerError",
|
|
471
|
+
"message": "errorMessage"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
259
474
|
}
|
|
260
475
|
}
|
|
261
476
|
}
|
|
@@ -287,12 +502,62 @@
|
|
|
287
502
|
}
|
|
288
503
|
],
|
|
289
504
|
"responses": {
|
|
290
|
-
"
|
|
291
|
-
"description": "The rest request ended in success with no data."
|
|
505
|
+
"204": {
|
|
506
|
+
"description": "The rest request ended in success with no data."
|
|
507
|
+
},
|
|
508
|
+
"400": {
|
|
509
|
+
"description": "The server cannot process the request, see the content for more details.",
|
|
510
|
+
"content": {
|
|
511
|
+
"application/json": {
|
|
512
|
+
"schema": {
|
|
513
|
+
"$ref": "#/components/schemas/Error"
|
|
514
|
+
},
|
|
515
|
+
"examples": {
|
|
516
|
+
"exampleResponse": {
|
|
517
|
+
"value": {
|
|
518
|
+
"name": "GeneralError",
|
|
519
|
+
"message": "errorMessage",
|
|
520
|
+
"properties": {
|
|
521
|
+
"foo": "bar"
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
"401": {
|
|
530
|
+
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
|
|
531
|
+
"content": {
|
|
532
|
+
"application/json": {
|
|
533
|
+
"schema": {
|
|
534
|
+
"$ref": "#/components/schemas/Error"
|
|
535
|
+
},
|
|
536
|
+
"examples": {
|
|
537
|
+
"exampleResponse": {
|
|
538
|
+
"value": {
|
|
539
|
+
"name": "UnauthorizedError",
|
|
540
|
+
"message": "errorMessage"
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
"500": {
|
|
548
|
+
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
|
|
292
549
|
"content": {
|
|
293
|
-
"
|
|
550
|
+
"application/json": {
|
|
294
551
|
"schema": {
|
|
295
|
-
"$ref": "#/components/schemas/
|
|
552
|
+
"$ref": "#/components/schemas/Error"
|
|
553
|
+
},
|
|
554
|
+
"examples": {
|
|
555
|
+
"exampleResponse": {
|
|
556
|
+
"value": {
|
|
557
|
+
"name": "InternalServerError",
|
|
558
|
+
"message": "errorMessage"
|
|
559
|
+
}
|
|
560
|
+
}
|
|
296
561
|
}
|
|
297
562
|
}
|
|
298
563
|
}
|
|
@@ -349,15 +614,8 @@
|
|
|
349
614
|
}
|
|
350
615
|
},
|
|
351
616
|
"responses": {
|
|
352
|
-
"
|
|
617
|
+
"201": {
|
|
353
618
|
"description": "The rest request ended in created response.",
|
|
354
|
-
"content": {
|
|
355
|
-
"text/plain": {
|
|
356
|
-
"schema": {
|
|
357
|
-
"$ref": "#/components/schemas/CreatedResponse"
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
619
|
"headers": {
|
|
362
620
|
"location": {
|
|
363
621
|
"schema": {
|
|
@@ -366,6 +624,63 @@
|
|
|
366
624
|
"description": "e.g. aabbccdd11223445566"
|
|
367
625
|
}
|
|
368
626
|
}
|
|
627
|
+
},
|
|
628
|
+
"400": {
|
|
629
|
+
"description": "The server cannot process the request, see the content for more details.",
|
|
630
|
+
"content": {
|
|
631
|
+
"application/json": {
|
|
632
|
+
"schema": {
|
|
633
|
+
"$ref": "#/components/schemas/Error"
|
|
634
|
+
},
|
|
635
|
+
"examples": {
|
|
636
|
+
"exampleResponse": {
|
|
637
|
+
"value": {
|
|
638
|
+
"name": "GeneralError",
|
|
639
|
+
"message": "errorMessage",
|
|
640
|
+
"properties": {
|
|
641
|
+
"foo": "bar"
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
"401": {
|
|
650
|
+
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
|
|
651
|
+
"content": {
|
|
652
|
+
"application/json": {
|
|
653
|
+
"schema": {
|
|
654
|
+
"$ref": "#/components/schemas/Error"
|
|
655
|
+
},
|
|
656
|
+
"examples": {
|
|
657
|
+
"exampleResponse": {
|
|
658
|
+
"value": {
|
|
659
|
+
"name": "UnauthorizedError",
|
|
660
|
+
"message": "errorMessage"
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
"500": {
|
|
668
|
+
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
|
|
669
|
+
"content": {
|
|
670
|
+
"application/json": {
|
|
671
|
+
"schema": {
|
|
672
|
+
"$ref": "#/components/schemas/Error"
|
|
673
|
+
},
|
|
674
|
+
"examples": {
|
|
675
|
+
"exampleResponse": {
|
|
676
|
+
"value": {
|
|
677
|
+
"name": "InternalServerError",
|
|
678
|
+
"message": "errorMessage"
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
369
684
|
}
|
|
370
685
|
}
|
|
371
686
|
},
|
|
@@ -393,10 +708,7 @@
|
|
|
393
708
|
"in": "query",
|
|
394
709
|
"required": false,
|
|
395
710
|
"schema": {
|
|
396
|
-
"type":
|
|
397
|
-
"number",
|
|
398
|
-
"string"
|
|
399
|
-
]
|
|
711
|
+
"type": "string"
|
|
400
712
|
}
|
|
401
713
|
},
|
|
402
714
|
{
|
|
@@ -405,10 +717,7 @@
|
|
|
405
717
|
"in": "query",
|
|
406
718
|
"required": false,
|
|
407
719
|
"schema": {
|
|
408
|
-
"type":
|
|
409
|
-
"number",
|
|
410
|
-
"string"
|
|
411
|
-
]
|
|
720
|
+
"type": "string"
|
|
412
721
|
}
|
|
413
722
|
},
|
|
414
723
|
{
|
|
@@ -470,6 +779,63 @@
|
|
|
470
779
|
}
|
|
471
780
|
}
|
|
472
781
|
}
|
|
782
|
+
},
|
|
783
|
+
"400": {
|
|
784
|
+
"description": "The server cannot process the request, see the content for more details.",
|
|
785
|
+
"content": {
|
|
786
|
+
"application/json": {
|
|
787
|
+
"schema": {
|
|
788
|
+
"$ref": "#/components/schemas/Error"
|
|
789
|
+
},
|
|
790
|
+
"examples": {
|
|
791
|
+
"exampleResponse": {
|
|
792
|
+
"value": {
|
|
793
|
+
"name": "GeneralError",
|
|
794
|
+
"message": "errorMessage",
|
|
795
|
+
"properties": {
|
|
796
|
+
"foo": "bar"
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
"401": {
|
|
805
|
+
"description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
|
|
806
|
+
"content": {
|
|
807
|
+
"application/json": {
|
|
808
|
+
"schema": {
|
|
809
|
+
"$ref": "#/components/schemas/Error"
|
|
810
|
+
},
|
|
811
|
+
"examples": {
|
|
812
|
+
"exampleResponse": {
|
|
813
|
+
"value": {
|
|
814
|
+
"name": "UnauthorizedError",
|
|
815
|
+
"message": "errorMessage"
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
"500": {
|
|
823
|
+
"description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
|
|
824
|
+
"content": {
|
|
825
|
+
"application/json": {
|
|
826
|
+
"schema": {
|
|
827
|
+
"$ref": "#/components/schemas/Error"
|
|
828
|
+
},
|
|
829
|
+
"examples": {
|
|
830
|
+
"exampleResponse": {
|
|
831
|
+
"value": {
|
|
832
|
+
"name": "InternalServerError",
|
|
833
|
+
"message": "errorMessage"
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
473
839
|
}
|
|
474
840
|
}
|
|
475
841
|
}
|
|
@@ -477,6 +843,40 @@
|
|
|
477
843
|
},
|
|
478
844
|
"components": {
|
|
479
845
|
"schemas": {
|
|
846
|
+
"Error": {
|
|
847
|
+
"type": "object",
|
|
848
|
+
"properties": {
|
|
849
|
+
"name": {
|
|
850
|
+
"type": "string",
|
|
851
|
+
"description": "The name for the error."
|
|
852
|
+
},
|
|
853
|
+
"message": {
|
|
854
|
+
"type": "string",
|
|
855
|
+
"description": "The message for the error."
|
|
856
|
+
},
|
|
857
|
+
"source": {
|
|
858
|
+
"type": "string",
|
|
859
|
+
"description": "The source of the error."
|
|
860
|
+
},
|
|
861
|
+
"properties": {
|
|
862
|
+
"type": "object",
|
|
863
|
+
"additionalProperties": {},
|
|
864
|
+
"description": "Any additional information for the error."
|
|
865
|
+
},
|
|
866
|
+
"stack": {
|
|
867
|
+
"type": "string",
|
|
868
|
+
"description": "The stack trace for the error."
|
|
869
|
+
},
|
|
870
|
+
"cause": {
|
|
871
|
+
"$ref": "#/components/schemas/Error"
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
"required": [
|
|
875
|
+
"name",
|
|
876
|
+
"message"
|
|
877
|
+
],
|
|
878
|
+
"description": "Model to describe serialized error."
|
|
879
|
+
},
|
|
480
880
|
"MetricType": {
|
|
481
881
|
"anyOf": [
|
|
482
882
|
{
|
|
@@ -525,7 +925,6 @@
|
|
|
525
925
|
"required": [
|
|
526
926
|
"value"
|
|
527
927
|
],
|
|
528
|
-
"additionalProperties": false,
|
|
529
928
|
"description": "The data to be used in the update."
|
|
530
929
|
},
|
|
531
930
|
"TelemetryGetMetricResponse": {
|
|
@@ -542,7 +941,6 @@
|
|
|
542
941
|
"metric",
|
|
543
942
|
"value"
|
|
544
943
|
],
|
|
545
|
-
"additionalProperties": false,
|
|
546
944
|
"description": "The body parameters."
|
|
547
945
|
},
|
|
548
946
|
"TelemetryListResponse": {
|
|
@@ -563,7 +961,6 @@
|
|
|
563
961
|
"required": [
|
|
564
962
|
"entities"
|
|
565
963
|
],
|
|
566
|
-
"additionalProperties": false,
|
|
567
964
|
"description": "The response payload."
|
|
568
965
|
},
|
|
569
966
|
"TelemetryMetric": {
|
|
@@ -594,7 +991,6 @@
|
|
|
594
991
|
"label",
|
|
595
992
|
"type"
|
|
596
993
|
],
|
|
597
|
-
"additionalProperties": false,
|
|
598
994
|
"description": "Interface describing a telemetry metric."
|
|
599
995
|
},
|
|
600
996
|
"TelemetryMetricValue": {
|
|
@@ -623,7 +1019,6 @@
|
|
|
623
1019
|
"ts",
|
|
624
1020
|
"value"
|
|
625
1021
|
],
|
|
626
|
-
"additionalProperties": false,
|
|
627
1022
|
"description": "Interface describing a telemetry metric value."
|
|
628
1023
|
},
|
|
629
1024
|
"TelemetryUpdateMetricRequest": {
|
|
@@ -645,7 +1040,6 @@
|
|
|
645
1040
|
"required": [
|
|
646
1041
|
"label"
|
|
647
1042
|
],
|
|
648
|
-
"additionalProperties": false,
|
|
649
1043
|
"description": "The data to be used in the update."
|
|
650
1044
|
},
|
|
651
1045
|
"TelemetryValuesListResponse": {
|
|
@@ -670,7 +1064,6 @@
|
|
|
670
1064
|
"metric",
|
|
671
1065
|
"entities"
|
|
672
1066
|
],
|
|
673
|
-
"additionalProperties": false,
|
|
674
1067
|
"description": "The response payload."
|
|
675
1068
|
}
|
|
676
1069
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/telemetry-service",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.2",
|
|
4
4
|
"description": "Telemetry contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@twin.org/core": "next",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
|
-
"@twin.org/telemetry-models": "0.0.3-next.
|
|
21
|
+
"@twin.org/telemetry-models": "0.0.3-next.2",
|
|
22
22
|
"@twin.org/web": "next"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/es/index.js",
|