@3sixty/telemetry-models 0.20.0-next.0 → 0.20.0-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.
Files changed (36) hide show
  1. package/dist/es/connectors/multiTelemetryConnector.js.map +1 -1
  2. package/dist/es/connectors/silentTelemetryConnector.js +2 -0
  3. package/dist/es/connectors/silentTelemetryConnector.js.map +1 -1
  4. package/dist/es/factories/metricsProducerFactory.js.map +1 -1
  5. package/dist/es/factories/telemetryConnectorFactory.js.map +1 -1
  6. package/dist/es/helpers/metricHelper.js.map +1 -1
  7. package/dist/es/index.js.map +1 -1
  8. package/dist/es/models/IMetricsCollectorComponent.js.map +1 -1
  9. package/dist/es/models/IMetricsProducer.js.map +1 -1
  10. package/dist/es/models/IMultiTelemetryConnectorConstructorOptions.js.map +1 -1
  11. package/dist/es/models/ITelemetryComponent.js.map +1 -1
  12. package/dist/es/models/ITelemetryConnector.js.map +1 -1
  13. package/dist/es/models/ITelemetryMetric.js.map +1 -1
  14. package/dist/es/models/ITelemetryMetricValue.js.map +1 -1
  15. package/dist/es/models/ITelemetryMetricValueEntry.js.map +1 -1
  16. package/dist/es/models/api/ITelemetryAddMetricValueRequest.js.map +1 -1
  17. package/dist/es/models/api/ITelemetryCreateMetricRequest.js.map +1 -1
  18. package/dist/es/models/api/ITelemetryGetMetricRequest.js.map +1 -1
  19. package/dist/es/models/api/ITelemetryGetMetricResponse.js.map +1 -1
  20. package/dist/es/models/api/ITelemetryGetMetricValueRequest.js.map +1 -1
  21. package/dist/es/models/api/ITelemetryGetMetricValueResponse.js.map +1 -1
  22. package/dist/es/models/api/ITelemetryListRequest.js.map +1 -1
  23. package/dist/es/models/api/ITelemetryListResponse.js.map +1 -1
  24. package/dist/es/models/api/ITelemetryRemoveMetricRequest.js.map +1 -1
  25. package/dist/es/models/api/ITelemetryUpdateMetricRequest.js.map +1 -1
  26. package/dist/es/models/api/ITelemetryValuesListRequest.js.map +1 -1
  27. package/dist/es/models/api/ITelemetryValuesListResponse.js.map +1 -1
  28. package/dist/es/models/metricCounterOperation.js.map +1 -1
  29. package/dist/es/models/metricType.js.map +1 -1
  30. package/docs/changelog.md +16 -0
  31. package/docs/reference/classes/MetricHelper.md +6 -0
  32. package/docs/reference/classes/MultiTelemetryConnector.md +2 -0
  33. package/docs/reference/classes/SilentTelemetryConnector.md +2 -0
  34. package/docs/reference/interfaces/ITelemetryComponent.md +2 -0
  35. package/docs/reference/interfaces/ITelemetryConnector.md +2 -0
  36. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"multiTelemetryConnector.js","sourceRoot":"","sources":["../../../src/connectors/multiTelemetryConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAOtF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,uBAAuB;IACnC;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,OAAO,CAAC;IAEnD;;OAEG;IACI,MAAM,CAAU,UAAU,6BAA6C;IAE9E;;;OAGG;IACc,oBAAoB,CAAwB;IAE7D;;;OAGG;IACH,YAAY,OAAmD;QAC9D,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,UAAU,aAAmB,OAAO,CAAC,CAAC;QAC5E,MAAM,CAAC,UAAU,CAChB,uBAAuB,CAAC,UAAU,qCAElC,OAAO,CAAC,uBAAuB,CAC/B,CAAC;QACF,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACnE,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC,CAChC,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,u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AAM,IAAI,mBAAmB,CAAC,uBAAuB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAClF,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Guards, Is, NotImplementedError, NotSupportedError } from \"@3sixty/core\";\nimport { nameof } from \"@3sixty/nameof\";\nimport { TelemetryConnectorFactory } from \"../factories/telemetryConnectorFactory.js\";\nimport type { IMultiTelemetryConnectorConstructorOptions } from \"../models/IMultiTelemetryConnectorConstructorOptions.js\";\nimport type { ITelemetryConnector } from \"../models/ITelemetryConnector.js\";\nimport type { ITelemetryMetric } from \"../models/ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"../models/ITelemetryMetricValue.js\";\nimport type { ITelemetryMetricValueEntry } from \"../models/ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"../models/metricCounterOperation.js\";\nimport { MetricType } from \"../models/metricType.js\";\n\n/**\n * Class for performing telemetry operations on multiple connectors.\n */\nexport class MultiTelemetryConnector implements ITelemetryConnector {\n\t/**\n\t * The namespace for the class.\n\t */\n\tpublic static readonly NAMESPACE: string = \"multi\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<MultiTelemetryConnector>();\n\n\t/**\n\t * The connectors to send the telemetry entries to.\n\t * @internal\n\t */\n\tprivate readonly _telemetryConnectors: ITelemetryConnector[];\n\n\t/**\n\t * Create a new instance of MultiTelemetryConnector.\n\t * @param options The options for the connector.\n\t */\n\tconstructor(options: IMultiTelemetryConnectorConstructorOptions) {\n\t\tGuards.object(MultiTelemetryConnector.CLASS_NAME, nameof(options), options);\n\t\tGuards.arrayValue(\n\t\t\tMultiTelemetryConnector.CLASS_NAME,\n\t\t\tnameof(options.telemetryConnectorTypes),\n\t\t\toptions.telemetryConnectorTypes\n\t\t);\n\t\tthis._telemetryConnectors = options.telemetryConnectorTypes.map(t =>\n\t\t\tTelemetryConnectorFactory.get(t)\n\t\t);\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn MultiTelemetryConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create one or more metrics.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created on all connectors.\n\t */\n\tpublic async createMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void> {\n\t\tconst metrics = Is.array<ITelemetryMetric>(metric) ? metric : [metric];\n\n\t\tfor (const entry of metrics) {\n\t\t\tGuards.object<ITelemetryMetric>(MultiTelemetryConnector.CLASS_NAME, nameof(entry), entry);\n\t\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(entry.id), entry.id);\n\t\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(entry.label), entry.label);\n\t\t\tGuards.arrayOneOf(\n\t\t\t\tMultiTelemetryConnector.CLASS_NAME,\n\t\t\t\tnameof(entry.type),\n\t\t\t\tentry.type,\n\t\t\t\tObject.values(MetricType)\n\t\t\t);\n\t\t}\n\n\t\tawait Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector =>\n\t\t\t\ttelemetryConnector.createMetric(metric)\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tpublic async getMetric(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}> {\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(id), id);\n\n\t\tfor (const telemetryConnector of this._telemetryConnectors) {\n\t\t\tconst getMetricResult = telemetryConnector.getMetric?.(id);\n\t\t\tif (!Is.empty(getMetricResult)) {\n\t\t\t\treturn getMetricResult;\n\t\t\t}\n\t\t}\n\t\tthrow new NotSupportedError(MultiTelemetryConnector.CLASS_NAME, \"notSupported\", {\n\t\t\tmethodName: \"getMetric\"\n\t\t});\n\t}\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tpublic async getMetricValue(id: string, valueId: string): Promise<ITelemetryMetricValue> {\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(valueId), valueId);\n\n\t\tfor (const telemetryConnector of this._telemetryConnectors) {\n\t\t\tconst getMetricValueResult = telemetryConnector.getMetricValue?.(id, valueId);\n\t\t\tif (!Is.empty(getMetricValueResult)) {\n\t\t\t\treturn getMetricValueResult;\n\t\t\t}\n\t\t}\n\t\tthrow new NotSupportedError(MultiTelemetryConnector.CLASS_NAME, \"notSupported\", {\n\t\t\tmethodName: \"getMetricValue\"\n\t\t});\n\t}\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated on all connectors.\n\t */\n\tpublic async updateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void> {\n\t\tGuards.object<ITelemetryMetric>(MultiTelemetryConnector.CLASS_NAME, nameof(metric), metric);\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(metric.id), metric.id);\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(metric.label), metric.label);\n\n\t\tawait Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector =>\n\t\t\t\ttelemetryConnector.updateMetric(metric)\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Add a metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the add operation.\n\t * @param customData The custom data for the add operation.\n\t * @returns The created metric value id.\n\t */\n\tpublic async addMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string> {\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(id), id);\n\n\t\tconst results = await Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector =>\n\t\t\t\ttelemetryConnector.addMetricValue(id, value, customData)\n\t\t\t)\n\t\t);\n\n\t\tif (results[0].status === \"fulfilled\") {\n\t\t\treturn results[0].value;\n\t\t}\n\t\tthrow new NotSupportedError(MultiTelemetryConnector.CLASS_NAME, \"notSupported\", {\n\t\t\tmethodName: \"addMetricValue\"\n\t\t});\n\t}\n\n\t/**\n\t * Add multiple metric values.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\tpublic async addMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]> {\n\t\tGuards.array<ITelemetryMetricValueEntry>(\n\t\t\tMultiTelemetryConnector.CLASS_NAME,\n\t\t\tnameof(values),\n\t\t\tvalues\n\t\t);\n\n\t\tconst results = await Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector =>\n\t\t\t\ttelemetryConnector.addMetricValues(values)\n\t\t\t)\n\t\t);\n\n\t\tif (results[0]?.status === \"fulfilled\") {\n\t\t\treturn results[0].value;\n\t\t}\n\t\tthrow new NotSupportedError(MultiTelemetryConnector.CLASS_NAME, \"notSupported\", {\n\t\t\tmethodName: \"addMetricValues\"\n\t\t});\n\t}\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric has been removed from all connectors.\n\t */\n\tpublic async removeMetric(id: string): Promise<void> {\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, nameof(id), id);\n\n\t\tawait Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector => telemetryConnector.removeMetric(id))\n\t\t);\n\t}\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tpublic async query(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\t// See if we can find a connector that supports querying.\n\t\tfor (const telemetryConnector of this._telemetryConnectors) {\n\t\t\tconst queryBound = telemetryConnector.query?.bind(telemetryConnector);\n\t\t\tif (Is.function(queryBound)) {\n\t\t\t\treturn queryBound(type, cursor, limit);\n\t\t\t}\n\t\t}\n\n\t\tthrow new NotImplementedError(MultiTelemetryConnector.CLASS_NAME, \"query\");\n\t}\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tpublic async queryValues(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\t// See if we can find a connector that supports querying.\n\t\t// If it throws anything other than not implemented, we should throw it.\n\t\tfor (const telemetryConnector of this._telemetryConnectors) {\n\t\t\tconst queryValuesBound = telemetryConnector.queryValues?.bind(telemetryConnector);\n\t\t\tif (Is.function(queryValuesBound)) {\n\t\t\t\treturn queryValuesBound(id, timeStart, timeEnd, cursor, limit);\n\t\t\t}\n\t\t}\n\n\t\tthrow new NotImplementedError(MultiTelemetryConnector.CLASS_NAME, \"queryValues\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"multiTelemetryConnector.js","sources":["../../../src/connectors/multiTelemetryConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAOtF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,uBAAuB;IACnC;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,OAAO,CAAC;IAEnD;;OAEG;IACI,MAAM,CAAU,UAAU,GAAW,yBAAyB,CAAC;IAEtE;;;OAGG;IACc,oBAAoB,CAAwB;IAE7D;;;OAGG;IACH,YAAY,OAAmD;QAC9D,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACtE,MAAM,CAAC,UAAU,CAChB,uBAAuB,CAAC,UAAU,EAClC,iCAAiC,EACjC,OAAO,CAAC,uBAAuB,CAC/B,CAAC;QACF,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACnE,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC,CAChC,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,uBAAuB,CAAC,UAAU,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,MAA6C;QACtE,MAAM,OAAO,GAAG,EAAE,CAAC,KAAK,CAAmB,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAA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EAAE,aAAa,CAAC,CAAC;IAClF,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Guards, Is, NotImplementedError, NotSupportedError } from \"@3sixty/core\";\n\nimport { TelemetryConnectorFactory } from \"../factories/telemetryConnectorFactory.js\";\nimport type { IMultiTelemetryConnectorConstructorOptions } from \"../models/IMultiTelemetryConnectorConstructorOptions.js\";\nimport type { ITelemetryConnector } from \"../models/ITelemetryConnector.js\";\nimport type { ITelemetryMetric } from \"../models/ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"../models/ITelemetryMetricValue.js\";\nimport type { ITelemetryMetricValueEntry } from \"../models/ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"../models/metricCounterOperation.js\";\nimport { MetricType } from \"../models/metricType.js\";\n\n/**\n * Class for performing telemetry operations on multiple connectors.\n */\nexport class MultiTelemetryConnector implements ITelemetryConnector {\n\t/**\n\t * The namespace for the class.\n\t */\n\tpublic static readonly NAMESPACE: string = \"multi\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"MultiTelemetryConnector\";\n\n\t/**\n\t * The connectors to send the telemetry entries to.\n\t * @internal\n\t */\n\tprivate readonly _telemetryConnectors: ITelemetryConnector[];\n\n\t/**\n\t * Create a new instance of MultiTelemetryConnector.\n\t * @param options The options for the connector.\n\t */\n\tconstructor(options: IMultiTelemetryConnectorConstructorOptions) {\n\t\tGuards.object(MultiTelemetryConnector.CLASS_NAME, \"options\", options);\n\t\tGuards.arrayValue(\n\t\t\tMultiTelemetryConnector.CLASS_NAME,\n\t\t\t\"options.telemetryConnectorTypes\",\n\t\t\toptions.telemetryConnectorTypes\n\t\t);\n\t\tthis._telemetryConnectors = options.telemetryConnectorTypes.map(t =>\n\t\t\tTelemetryConnectorFactory.get(t)\n\t\t);\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn MultiTelemetryConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create one or more metrics.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created on all connectors.\n\t */\n\tpublic async createMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void> {\n\t\tconst metrics = Is.array<ITelemetryMetric>(metric) ? metric : [metric];\n\n\t\tfor (const entry of metrics) {\n\t\t\tGuards.object<ITelemetryMetric>(MultiTelemetryConnector.CLASS_NAME, \"entry\", entry);\n\t\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"entry.id\", entry.id);\n\t\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"entry.label\", entry.label);\n\t\t\tGuards.arrayOneOf(\n\t\t\t\tMultiTelemetryConnector.CLASS_NAME,\n\t\t\t\t\"entry.type\",\n\t\t\t\tentry.type,\n\t\t\t\tObject.values(MetricType)\n\t\t\t);\n\t\t}\n\n\t\tawait Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector =>\n\t\t\t\ttelemetryConnector.createMetric(metric)\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tpublic async getMetric(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}> {\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"id\", id);\n\n\t\tfor (const telemetryConnector of this._telemetryConnectors) {\n\t\t\tconst getMetricResult = telemetryConnector.getMetric?.(id);\n\t\t\tif (!Is.empty(getMetricResult)) {\n\t\t\t\treturn getMetricResult;\n\t\t\t}\n\t\t}\n\t\tthrow new NotSupportedError(MultiTelemetryConnector.CLASS_NAME, \"notSupported\", {\n\t\t\tmethodName: \"getMetric\"\n\t\t});\n\t}\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tpublic async getMetricValue(id: string, valueId: string): Promise<ITelemetryMetricValue> {\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"id\", id);\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"valueId\", valueId);\n\n\t\tfor (const telemetryConnector of this._telemetryConnectors) {\n\t\t\tconst getMetricValueResult = telemetryConnector.getMetricValue?.(id, valueId);\n\t\t\tif (!Is.empty(getMetricValueResult)) {\n\t\t\t\treturn getMetricValueResult;\n\t\t\t}\n\t\t}\n\t\tthrow new NotSupportedError(MultiTelemetryConnector.CLASS_NAME, \"notSupported\", {\n\t\t\tmethodName: \"getMetricValue\"\n\t\t});\n\t}\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated on all connectors.\n\t */\n\tpublic async updateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void> {\n\t\tGuards.object<ITelemetryMetric>(MultiTelemetryConnector.CLASS_NAME, \"metric\", metric);\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"metric.id\", metric.id);\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"metric.label\", metric.label);\n\n\t\tawait Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector =>\n\t\t\t\ttelemetryConnector.updateMetric(metric)\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Add a metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the add operation.\n\t * @param customData The custom data for the add operation.\n\t * @returns The created metric value id.\n\t */\n\tpublic async addMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string> {\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"id\", id);\n\n\t\tconst results = await Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector =>\n\t\t\t\ttelemetryConnector.addMetricValue(id, value, customData)\n\t\t\t)\n\t\t);\n\n\t\tif (results[0].status === \"fulfilled\") {\n\t\t\treturn results[0].value;\n\t\t}\n\t\tthrow new NotSupportedError(MultiTelemetryConnector.CLASS_NAME, \"notSupported\", {\n\t\t\tmethodName: \"addMetricValue\"\n\t\t});\n\t}\n\n\t/**\n\t * Add multiple metric values.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\tpublic async addMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]> {\n\t\tGuards.array<ITelemetryMetricValueEntry>(\n\t\t\tMultiTelemetryConnector.CLASS_NAME,\n\t\t\t\"values\",\n\t\t\tvalues\n\t\t);\n\n\t\tconst results = await Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector =>\n\t\t\t\ttelemetryConnector.addMetricValues(values)\n\t\t\t)\n\t\t);\n\n\t\tif (results[0]?.status === \"fulfilled\") {\n\t\t\treturn results[0].value;\n\t\t}\n\t\tthrow new NotSupportedError(MultiTelemetryConnector.CLASS_NAME, \"notSupported\", {\n\t\t\tmethodName: \"addMetricValues\"\n\t\t});\n\t}\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric has been removed from all connectors.\n\t */\n\tpublic async removeMetric(id: string): Promise<void> {\n\t\tGuards.stringValue(MultiTelemetryConnector.CLASS_NAME, \"id\", id);\n\n\t\tawait Promise.allSettled(\n\t\t\tthis._telemetryConnectors.map(async telemetryConnector => telemetryConnector.removeMetric(id))\n\t\t);\n\t}\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tpublic async query(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\t// See if we can find a connector that supports querying.\n\t\tfor (const telemetryConnector of this._telemetryConnectors) {\n\t\t\tconst queryBound = telemetryConnector.query?.bind(telemetryConnector);\n\t\t\tif (Is.function(queryBound)) {\n\t\t\t\treturn queryBound(type, cursor, limit);\n\t\t\t}\n\t\t}\n\n\t\tthrow new NotImplementedError(MultiTelemetryConnector.CLASS_NAME, \"query\");\n\t}\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tpublic async queryValues(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\t// See if we can find a connector that supports querying.\n\t\t// If it throws anything other than not implemented, we should throw it.\n\t\tfor (const telemetryConnector of this._telemetryConnectors) {\n\t\t\tconst queryValuesBound = telemetryConnector.queryValues?.bind(telemetryConnector);\n\t\t\tif (Is.function(queryValuesBound)) {\n\t\t\t\treturn queryValuesBound(id, timeStart, timeEnd, cursor, limit);\n\t\t\t}\n\t\t}\n\n\t\tthrow new NotImplementedError(MultiTelemetryConnector.CLASS_NAME, \"queryValues\");\n\t}\n}\n"]}
@@ -1,3 +1,5 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
1
3
  /**
2
4
  * Class for performing telemetry operations to nowhere.
3
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"silentTelemetryConnector.js","sourceRoot":"","sources":["../../../src/connectors/silentTelemetryConnector.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,OAAO,wBAAwB;IACpC;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,QAAQ,CAAC;IAEpD;;OAEG;IACI,MAAM,CAAU,UAAU,8BAA8C;IAE/E;;;OAGG;IACI,SAAS;QACf,OAAO,wBAAwB,CAAC,UAAU,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,MAA6C,IAAkB,CAAC;IAE1F;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,MAAsC,IAAkB,CAAC;IAEnF;;;;;;OAMG;IACI,KAAK,CAAC,cAAc,CAC1B,EAAU,EACV,KAAsC,EACtC,UAAuC;QAEvC,OAAO,EAAE,CAAC;IACX,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,MAAoC;QAChE,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,EAAU,IAAkB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { nameof } from \"@3sixty/nameof\";\nimport type { ITelemetryConnector } from \"../models/ITelemetryConnector.js\";\nimport type { ITelemetryMetric } from \"../models/ITelemetryMetric.js\";\nimport type { ITelemetryMetricValueEntry } from \"../models/ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"../models/metricCounterOperation.js\";\n\n/**\n * Class for performing telemetry operations to nowhere.\n */\nexport class SilentTelemetryConnector implements ITelemetryConnector {\n\t/**\n\t * The namespace for the class.\n\t */\n\tpublic static readonly NAMESPACE: string = \"silent\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<SilentTelemetryConnector>();\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn SilentTelemetryConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create one or more metrics.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metric has been created.\n\t */\n\tpublic async createMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void> {}\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tpublic async updateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void> {}\n\n\t/**\n\t * Update metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the update operation.\n\t * @param customData The custom data for the update operation.\n\t * @returns The created metric value id.\n\t */\n\tpublic async addMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string> {\n\t\treturn \"\";\n\t}\n\n\t/**\n\t * Add multiple metric values.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids.\n\t */\n\tpublic async addMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]> {\n\t\treturn values.map(() => \"\");\n\t}\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tpublic async removeMetric(id: string): Promise<void> {}\n}\n"]}
1
+ {"version":3,"file":"silentTelemetryConnector.js","sources":["../../../src/connectors/silentTelemetryConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAOvC;;GAEG;AACH,MAAM,OAAO,wBAAwB;IACpC;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,QAAQ,CAAC;IAEpD;;OAEG;IACI,MAAM,CAAU,UAAU,GAAW,0BAA0B,CAAC;IAEvE;;;OAGG;IACI,SAAS;QACf,OAAO,wBAAwB,CAAC,UAAU,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,MAA6C,IAAkB,CAAC;IAE1F;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,MAAsC,IAAkB,CAAC;IAEnF;;;;;;OAMG;IACI,KAAK,CAAC,cAAc,CAC1B,EAAU,EACV,KAAsC,EACtC,UAAuC;QAEvC,OAAO,EAAE,CAAC;IACX,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,MAAoC;QAChE,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,EAAU,IAAkB,CAAC;CACvD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\nimport type { ITelemetryConnector } from \"../models/ITelemetryConnector.js\";\nimport type { ITelemetryMetric } from \"../models/ITelemetryMetric.js\";\nimport type { ITelemetryMetricValueEntry } from \"../models/ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"../models/metricCounterOperation.js\";\n\n/**\n * Class for performing telemetry operations to nowhere.\n */\nexport class SilentTelemetryConnector implements ITelemetryConnector {\n\t/**\n\t * The namespace for the class.\n\t */\n\tpublic static readonly NAMESPACE: string = \"silent\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"SilentTelemetryConnector\";\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn SilentTelemetryConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create one or more metrics.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metric has been created.\n\t */\n\tpublic async createMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void> {}\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tpublic async updateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void> {}\n\n\t/**\n\t * Update metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the update operation.\n\t * @param customData The custom data for the update operation.\n\t * @returns The created metric value id.\n\t */\n\tpublic async addMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string> {\n\t\treturn \"\";\n\t}\n\n\t/**\n\t * Add multiple metric values.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids.\n\t */\n\tpublic async addMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]> {\n\t\treturn values.map(() => \"\");\n\t}\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tpublic async removeMetric(id: string): Promise<void> {}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"metricsProducerFactory.js","sourceRoot":"","sources":["../../../src/factories/metricsProducerFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;;;;;GAMG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC,aAAa,CAAmB,kBAAkB,CAAC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IMetricsProducer } from \"../models/IMetricsProducer.js\";\n\n/**\n * Factory for `IMetricsProducer` implementations.\n *\n * The engine registers producers with `MetricsProducerFactory` during\n * initialisation. Third-party apps can also register their own producers\n * before `engine.start()` is called.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MetricsProducerFactory = Factory.createFactory<IMetricsProducer>(\"metrics-producer\");\n"]}
1
+ {"version":3,"file":"metricsProducerFactory.js","sources":["../../../src/factories/metricsProducerFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;;;;;GAMG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC,aAAa,CAAmB,kBAAkB,CAAC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IMetricsProducer } from \"../models/IMetricsProducer.js\";\n\n/**\n * Factory for `IMetricsProducer` implementations.\n *\n * The engine registers producers with `MetricsProducerFactory` during\n * initialisation. Third-party apps can also register their own producers\n * before `engine.start()` is called.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MetricsProducerFactory = Factory.createFactory<IMetricsProducer>(\"metrics-producer\");\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryConnectorFactory.js","sourceRoot":"","sources":["../../../src/factories/telemetryConnectorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAsB,WAAW,CAAC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { ITelemetryConnector } from \"../models/ITelemetryConnector.js\";\n\n/**\n * Factory for creating telemetry connectors.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const TelemetryConnectorFactory = Factory.createFactory<ITelemetryConnector>(\"telemetry\");\n"]}
1
+ {"version":3,"file":"telemetryConnectorFactory.js","sources":["../../../src/factories/telemetryConnectorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAsB,WAAW,CAAC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { ITelemetryConnector } from \"../models/ITelemetryConnector.js\";\n\n/**\n * Factory for creating telemetry connectors.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const TelemetryConnectorFactory = Factory.createFactory<ITelemetryConnector>(\"telemetry\");\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"metricHelper.js","sourceRoot":"","sources":["../../../src/helpers/metricHelper.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAIjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,YAAY;IACxB;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa,CAChC,kBAAmD,EACnD,OAA2B;QAE3B,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,MAAM,YAAY,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QAC9D,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,YAAY,CAC/B,kBAAmD,EACnD,MAA6C;QAE7C,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC;gBACJ,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,CAAC,KAAK,CAAC,WAAW,CAC9B,kBAAmD,EACnD,EAAU,EACV,KAAa,EACb,UAAuC,EACvC,OAAgD;QAEhD,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,6EAA6E;gBAC7E,sEAAsE;gBACtE,MAAM,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,YAAY,CAC/B,kBAAmD,EACnD,MAAoC,EACpC,OAAgD;QAEhD,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,6EAA6E;gBAC7E,sEAAsE;gBACtE,MAAM,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACK,MAAM,CAAC,KAAK,CAAC,WAAW,CAC/B,OAA6D,EAC7D,GAAY;QAEZ,IAAI,CAAC;YACJ,MAAM,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACR,+EAA+E;QAChF,CAAC;IACF,CAAC;CACD","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { AlreadyExistsError, BaseError, Is } from \"@3sixty/core\";\nimport type { ITelemetryComponent } from \"../models/ITelemetryComponent.js\";\nimport type { ITelemetryMetric } from \"../models/ITelemetryMetric.js\";\nimport type { ITelemetryMetricValueEntry } from \"../models/ITelemetryMetricValueEntry.js\";\nimport { MetricCounterOperation } from \"../models/metricCounterOperation.js\";\n\n/**\n * Helper class for performing common metric operations, swallowing any errors from the telemetry component.\n */\nexport class MetricHelper {\n\t/**\n\t * Create multiple metrics if they don't already exist, swallowing any already exists errors.\n\t * A convenience wrapper over createMetric for callers that always have a list.\n\t * @param telemetryComponent The telemetry component to use for creating the metrics.\n\t * @param metrics The telemetry metrics to create.\n\t * @returns A promise that resolves when all metrics have been created or confirmed to exist.\n\t */\n\tpublic static async createMetrics(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tmetrics: ITelemetryMetric[]\n\t): Promise<void> {\n\t\tif (Is.arrayValue(metrics)) {\n\t\t\tawait MetricHelper.createMetric(telemetryComponent, metrics);\n\t\t}\n\t}\n\n\t/**\n\t * Create one or more metrics if they don't already exist, swallowing any already exists errors.\n\t * @param telemetryComponent The telemetry component to use for creating the metrics.\n\t * @param metric The telemetry metric to create, or the metrics to create.\n\t * @returns A promise that resolves when the metrics have been created or confirmed to exist.\n\t */\n\tpublic static async createMetric(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tmetric: ITelemetryMetric | ITelemetryMetric[]\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.createMetric(metric);\n\t\t\t} catch (err) {\n\t\t\t\t// If the metric already exists, we can ignore the error. Otherwise, rethrow it.\n\t\t\t\tif (!BaseError.isErrorName(err, AlreadyExistsError.CLASS_NAME)) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Increment a metric counter, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for incrementing the metric.\n\t * @param id The metric ID.\n\t * @param customData Optional custom data for the increment.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the increment has been recorded or the error swallowed.\n\t */\n\tpublic static async metricIncrement(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, MetricCounterOperation.Increment, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Decrement a metric counter, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for decrementing the metric.\n\t * @param id The metric ID.\n\t * @param customData Optional custom data for the decrement.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the decrement has been recorded or the error swallowed.\n\t */\n\tpublic static async metricDecrement(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, MetricCounterOperation.Decrement, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set a metric value, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for setting the metric value.\n\t * @param id The metric ID.\n\t * @param value The metric value to set.\n\t * @param customData Optional custom data for setting the value.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the value has been recorded or the error swallowed.\n\t */\n\tpublic static async metricValue(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tvalue: number,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, value, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set several metric values at once, swallowing any telemetry errors.\n\t * Components which support it record the whole set in one operation, which for a persisted\n\t * connector is a single write rather than one per value.\n\t * @param telemetryComponent The telemetry component to use for setting the metric values.\n\t * @param values The metric values to set.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the values have been recorded or the error swallowed.\n\t */\n\tpublic static async metricValues(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tvalues: ITelemetryMetricValueEntry[],\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent) && Is.arrayValue(values)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValues(values);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Invoke the caller's error callback, swallowing anything it throws so a broken callback can\n\t * never break the never-interrupt contract of the calling method.\n\t * @param onError The optional callback to invoke.\n\t * @param err The error to pass to the callback.\n\t * @returns A promise that resolves once the callback has run or failed.\n\t * @internal\n\t */\n\tprivate static async notifyError(\n\t\tonError: ((err: unknown) => Promise<void> | void) | undefined,\n\t\terr: unknown\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait onError?.(err);\n\t\t} catch {\n\t\t\t// The onError callback must never be able to break the swallow contract above.\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"metricHelper.js","sources":["../../../src/helpers/metricHelper.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAIjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,YAAY;IACxB;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa,CAChC,kBAAmD,EACnD,OAA2B;QAE3B,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,MAAM,YAAY,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QAC9D,CAAC;IACF,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,YAAY,CAC/B,kBAAmD,EACnD,MAA6C;QAE7C,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAC/C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,gFAAgF;gBAChF,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;oBAChE,MAAM,GAAG,CAAC;gBACX,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,eAAe,CAClC,kBAAmD,EACnD,EAAU,EACV,UAAuC,EACvC,OAAgD;QAEhD,IAAI,CAAC,EAAE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AC9C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,YAAY,CAC/B,kBAAmD,EACnD,MAAoC,EACpC,OAAgD;QAEhD,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC;gBACJ,MAAM,kBAAkB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,6EAA6E;gBAC7E,sEAAsE;gBACtE,MAAM,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACK,MAAM,CAAC,KAAK,CAAC,WAAW,CAC/B,OAA6D,EAC7D,GAAY;QAEZ,IAAI,CAAC;YACJ,MAAM,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACR,+EAA+E;QAChF,CAAC;IACF,CAAC;CACD","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { AlreadyExistsError, BaseError, Is } from \"@3sixty/core\";\nimport type { ITelemetryComponent } from \"../models/ITelemetryComponent.js\";\nimport type { ITelemetryMetric } from \"../models/ITelemetryMetric.js\";\nimport type { ITelemetryMetricValueEntry } from \"../models/ITelemetryMetricValueEntry.js\";\nimport { MetricCounterOperation } from \"../models/metricCounterOperation.js\";\n\n/**\n * Helper class for performing common metric operations, swallowing any errors from the telemetry component.\n */\nexport class MetricHelper {\n\t/**\n\t * Create multiple metrics if they don't already exist, swallowing any already exists errors.\n\t * A convenience wrapper over createMetric for callers that always have a list.\n\t * @param telemetryComponent The telemetry component to use for creating the metrics.\n\t * @param metrics The telemetry metrics to create.\n\t * @returns A promise that resolves when all metrics have been created or confirmed to exist.\n\t */\n\tpublic static async createMetrics(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tmetrics: ITelemetryMetric[]\n\t): Promise<void> {\n\t\tif (Is.arrayValue(metrics)) {\n\t\t\tawait MetricHelper.createMetric(telemetryComponent, metrics);\n\t\t}\n\t}\n\n\t/**\n\t * Create one or more metrics if they don't already exist, swallowing any already exists errors.\n\t * @param telemetryComponent The telemetry component to use for creating the metrics.\n\t * @param metric The telemetry metric to create, or the metrics to create.\n\t * @returns A promise that resolves when the metrics have been created or confirmed to exist.\n\t */\n\tpublic static async createMetric(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tmetric: ITelemetryMetric | ITelemetryMetric[]\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.createMetric(metric);\n\t\t\t} catch (err) {\n\t\t\t\t// If the metric already exists, we can ignore the error. Otherwise, rethrow it.\n\t\t\t\tif (!BaseError.isErrorName(err, AlreadyExistsError.CLASS_NAME)) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Increment a metric counter, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for incrementing the metric.\n\t * @param id The metric ID.\n\t * @param customData Optional custom data for the increment.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the increment has been recorded or the error swallowed.\n\t */\n\tpublic static async metricIncrement(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, MetricCounterOperation.Increment, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Decrement a metric counter, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for decrementing the metric.\n\t * @param id The metric ID.\n\t * @param customData Optional custom data for the decrement.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the decrement has been recorded or the error swallowed.\n\t */\n\tpublic static async metricDecrement(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, MetricCounterOperation.Decrement, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set a metric value, swallowing any telemetry errors.\n\t * @param telemetryComponent The telemetry component to use for setting the metric value.\n\t * @param id The metric ID.\n\t * @param value The metric value to set.\n\t * @param customData Optional custom data for setting the value.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the value has been recorded or the error swallowed.\n\t */\n\tpublic static async metricValue(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tid: string,\n\t\tvalue: number,\n\t\tcustomData?: { [key: string]: unknown },\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValue(id, value, customData);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set several metric values at once, swallowing any telemetry errors.\n\t * Components which support it record the whole set in one operation, which for a persisted\n\t * connector is a single write rather than one per value.\n\t * @param telemetryComponent The telemetry component to use for setting the metric values.\n\t * @param values The metric values to set.\n\t * @param onError Optional callback invoked with the swallowed error, for callers that want visibility.\n\t * @returns A promise that resolves when the values have been recorded or the error swallowed.\n\t */\n\tpublic static async metricValues(\n\t\ttelemetryComponent: ITelemetryComponent | undefined,\n\t\tvalues: ITelemetryMetricValueEntry[],\n\t\tonError?: (err: unknown) => Promise<void> | void\n\t): Promise<void> {\n\t\tif (!Is.undefined(telemetryComponent) && Is.arrayValue(values)) {\n\t\t\ttry {\n\t\t\t\tawait telemetryComponent.addMetricValues(values);\n\t\t\t} catch (err) {\n\t\t\t\t// This method is designed to swallow any errors from the telemetry component\n\t\t\t\t// So it can safely be called without interrupting any external flows.\n\t\t\t\tawait MetricHelper.notifyError(onError, err);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Invoke the caller's error callback, swallowing anything it throws so a broken callback can\n\t * never break the never-interrupt contract of the calling method.\n\t * @param onError The optional callback to invoke.\n\t * @param err The error to pass to the callback.\n\t * @returns A promise that resolves once the callback has run or failed.\n\t * @internal\n\t */\n\tprivate static async notifyError(\n\t\tonError: ((err: unknown) => Promise<void> | void) | undefined,\n\t\terr: unknown\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait onError?.(err);\n\t\t} catch {\n\t\t\t// The onError callback must never be able to break the swallow contract above.\n\t\t}\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wDAAwD,CAAC;AACvE,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./connectors/multiTelemetryConnector.js\";\nexport * from \"./connectors/silentTelemetryConnector.js\";\nexport * from \"./factories/metricsProducerFactory.js\";\nexport * from \"./factories/telemetryConnectorFactory.js\";\nexport * from \"./helpers/metricHelper.js\";\nexport * from \"./models/api/ITelemetryAddMetricValueRequest.js\";\nexport * from \"./models/api/ITelemetryCreateMetricRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricResponse.js\";\nexport * from \"./models/api/ITelemetryGetMetricValueRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricValueResponse.js\";\nexport * from \"./models/api/ITelemetryListRequest.js\";\nexport * from \"./models/api/ITelemetryListResponse.js\";\nexport * from \"./models/api/ITelemetryRemoveMetricRequest.js\";\nexport * from \"./models/api/ITelemetryUpdateMetricRequest.js\";\nexport * from \"./models/api/ITelemetryValuesListRequest.js\";\nexport * from \"./models/api/ITelemetryValuesListResponse.js\";\nexport * from \"./models/IMetricsCollectorComponent.js\";\nexport * from \"./models/IMetricsProducer.js\";\nexport * from \"./models/IMultiTelemetryConnectorConstructorOptions.js\";\nexport * from \"./models/ITelemetryComponent.js\";\nexport * from \"./models/ITelemetryConnector.js\";\nexport * from \"./models/ITelemetryMetric.js\";\nexport * from \"./models/ITelemetryMetricValue.js\";\nexport * from \"./models/ITelemetryMetricValueEntry.js\";\nexport * from \"./models/metricCounterOperation.js\";\nexport * from \"./models/metricType.js\";\n"]}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wDAAwD,CAAC;AACvE,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./connectors/multiTelemetryConnector.js\";\nexport * from \"./connectors/silentTelemetryConnector.js\";\nexport * from \"./factories/metricsProducerFactory.js\";\nexport * from \"./factories/telemetryConnectorFactory.js\";\nexport * from \"./helpers/metricHelper.js\";\nexport * from \"./models/api/ITelemetryAddMetricValueRequest.js\";\nexport * from \"./models/api/ITelemetryCreateMetricRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricResponse.js\";\nexport * from \"./models/api/ITelemetryGetMetricValueRequest.js\";\nexport * from \"./models/api/ITelemetryGetMetricValueResponse.js\";\nexport * from \"./models/api/ITelemetryListRequest.js\";\nexport * from \"./models/api/ITelemetryListResponse.js\";\nexport * from \"./models/api/ITelemetryRemoveMetricRequest.js\";\nexport * from \"./models/api/ITelemetryUpdateMetricRequest.js\";\nexport * from \"./models/api/ITelemetryValuesListRequest.js\";\nexport * from \"./models/api/ITelemetryValuesListResponse.js\";\nexport * from \"./models/IMetricsCollectorComponent.js\";\nexport * from \"./models/IMetricsProducer.js\";\nexport * from \"./models/IMultiTelemetryConnectorConstructorOptions.js\";\nexport * from \"./models/ITelemetryComponent.js\";\nexport * from \"./models/ITelemetryConnector.js\";\nexport * from \"./models/ITelemetryMetric.js\";\nexport * from \"./models/ITelemetryMetricValue.js\";\nexport * from \"./models/ITelemetryMetricValueEntry.js\";\nexport * from \"./models/metricCounterOperation.js\";\nexport * from \"./models/metricType.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IMetricsCollectorComponent.js","sourceRoot":"","sources":["../../../src/models/IMetricsCollectorComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\n\n/**\n * Contract for a metrics collector component.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IMetricsCollectorComponent extends IComponent {}\n"]}
1
+ {"version":3,"file":"IMetricsCollectorComponent.js","sources":["../../../src/models/IMetricsCollectorComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\n\n/**\n * Contract for a metrics collector component.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IMetricsCollectorComponent extends IComponent {}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IMetricsProducer.js","sourceRoot":"","sources":["../../../src/models/IMetricsProducer.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\n\n/**\n * Contract for a metrics producer.\n *\n * A producer declares its metrics with `register()` once and pushes current\n * values with `collect()` on every poll cycle. Producers are discovered via\n * `MetricsProducerFactory` and orchestrated by a `MetricsCollectorService`.\n *\n * Producers are factory-only entries - they are not lifecycle components of\n * the engine. The orchestrating service owns the polling timer.\n */\nexport interface IMetricsProducer extends IComponent {\n\t/**\n\t * Register every metric this producer emits with the telemetry component.\n\t * Called once when the orchestrating service starts.\n\t * @returns A promise that resolves when all metrics have been registered.\n\t */\n\tregister(): Promise<void>;\n\n\t/**\n\t * Read the current values for every metric this producer emits.\n\t * Called on every poll cycle. The values are returned rather than recorded, so the\n\t * orchestrating service can record a whole cycle in one operation.\n\t * @returns The current values for this producer's metrics.\n\t */\n\tcollect(): Promise<ITelemetryMetricValueEntry[]>;\n}\n"]}
1
+ {"version":3,"file":"IMetricsProducer.js","sources":["../../../src/models/IMetricsProducer.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\n\n/**\n * Contract for a metrics producer.\n *\n * A producer declares its metrics with `register()` once and pushes current\n * values with `collect()` on every poll cycle. Producers are discovered via\n * `MetricsProducerFactory` and orchestrated by a `MetricsCollectorService`.\n *\n * Producers are factory-only entries - they are not lifecycle components of\n * the engine. The orchestrating service owns the polling timer.\n */\nexport interface IMetricsProducer extends IComponent {\n\t/**\n\t * Register every metric this producer emits with the telemetry component.\n\t * Called once when the orchestrating service starts.\n\t * @returns A promise that resolves when all metrics have been registered.\n\t */\n\tregister(): Promise<void>;\n\n\t/**\n\t * Read the current values for every metric this producer emits.\n\t * Called on every poll cycle. The values are returned rather than recorded, so the\n\t * orchestrating service can record a whole cycle in one operation.\n\t * @returns The current values for this producer's metrics.\n\t */\n\tcollect(): Promise<ITelemetryMetricValueEntry[]>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IMultiTelemetryConnectorConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IMultiTelemetryConnectorConstructorOptions.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The options for the multi telemetry connector constructor.\n */\nexport interface IMultiTelemetryConnectorConstructorOptions {\n\t/**\n\t * The telemetry connector types to multiplex.\n\t */\n\ttelemetryConnectorTypes: string[];\n}\n"]}
1
+ {"version":3,"file":"IMultiTelemetryConnectorConstructorOptions.js","sources":["../../../src/models/IMultiTelemetryConnectorConstructorOptions.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The options for the multi telemetry connector constructor.\n */\nexport interface IMultiTelemetryConnectorConstructorOptions {\n\t/**\n\t * The telemetry connector types to multiplex.\n\t */\n\ttelemetryConnectorTypes: string[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryComponent.js","sourceRoot":"","sources":["../../../src/models/ITelemetryComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetric } from \"./ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"./ITelemetryMetricValue.js\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry component contract.\n */\nexport interface ITelemetryComponent extends IComponent {\n\t/**\n\t * Create one or more metrics.\n\t * A single metric fails if it already exists; an array declares the set that should exist,\n\t * creating the ones that are missing and leaving the rest untouched, so implementations\n\t * which persist the definitions can resolve the whole set in one operation.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created.\n\t */\n\tcreateMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void>;\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tgetMetric(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}>;\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tgetMetricValue(id: string, valueId: string): Promise<ITelemetryMetricValue>;\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tupdateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void>;\n\n\t/**\n\t * Add a metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the add operation.\n\t * @param customData The custom data for the add operation.\n\t * @returns The created metric value id.\n\t */\n\taddMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string>;\n\n\t/**\n\t * Add multiple metric values, so implementations which persist them can do so in one\n\t * operation instead of one per value.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\taddMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]>;\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tremoveMetric(id: string): Promise<void>;\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tquery(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tqueryValues(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
1
+ {"version":3,"file":"ITelemetryComponent.js","sources":["../../../src/models/ITelemetryComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetric } from \"./ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"./ITelemetryMetricValue.js\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry component contract.\n */\nexport interface ITelemetryComponent extends IComponent {\n\t/**\n\t * Create one or more metrics.\n\t * A single metric fails if it already exists; an array declares the set that should exist,\n\t * creating the ones that are missing and leaving the rest untouched, so implementations\n\t * which persist the definitions can resolve the whole set in one operation.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created.\n\t */\n\tcreateMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void>;\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tgetMetric(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}>;\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tgetMetricValue(id: string, valueId: string): Promise<ITelemetryMetricValue>;\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tupdateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void>;\n\n\t/**\n\t * Add a metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the add operation.\n\t * @param customData The custom data for the add operation.\n\t * @returns The created metric value id.\n\t */\n\taddMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string>;\n\n\t/**\n\t * Add multiple metric values, so implementations which persist them can do so in one\n\t * operation instead of one per value.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\taddMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]>;\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tremoveMetric(id: string): Promise<void>;\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tquery(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tqueryValues(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryConnector.js","sourceRoot":"","sources":["../../../src/models/ITelemetryConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetric } from \"./ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"./ITelemetryMetricValue.js\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry connector.\n */\nexport interface ITelemetryConnector extends IComponent {\n\t/**\n\t * Create one or more metrics.\n\t * A single metric fails if it already exists; an array declares the set that should exist,\n\t * creating the ones that are missing and leaving the rest untouched, so implementations\n\t * which persist the definitions can resolve the whole set in one operation.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created.\n\t */\n\tcreateMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void>;\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tgetMetric?(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}>;\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tgetMetricValue?(id: string, valueId: string): Promise<ITelemetryMetricValue>;\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tupdateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void>;\n\n\t/**\n\t * Update metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the update operation.\n\t * @param customData The custom data for the update operation.\n\t * @returns The created metric value id.\n\t */\n\taddMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string>;\n\n\t/**\n\t * Add multiple metric values, so implementations which persist them can do so in one\n\t * operation instead of one per value.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\taddMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]>;\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tremoveMetric(id: string): Promise<void>;\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tquery?(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tqueryValues?(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
1
+ {"version":3,"file":"ITelemetryConnector.js","sources":["../../../src/models/ITelemetryConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { ITelemetryMetric } from \"./ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"./ITelemetryMetricValue.js\";\nimport type { ITelemetryMetricValueEntry } from \"./ITelemetryMetricValueEntry.js\";\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry connector.\n */\nexport interface ITelemetryConnector extends IComponent {\n\t/**\n\t * Create one or more metrics.\n\t * A single metric fails if it already exists; an array declares the set that should exist,\n\t * creating the ones that are missing and leaving the rest untouched, so implementations\n\t * which persist the definitions can resolve the whole set in one operation.\n\t * @param metric The metric details, or the details of several metrics.\n\t * @returns A promise that resolves when the metrics have been created.\n\t */\n\tcreateMetric(metric: ITelemetryMetric | ITelemetryMetric[]): Promise<void>;\n\n\t/**\n\t * Get the metric details and it's most recent value.\n\t * @param id The metric id.\n\t * @returns The metric details and it's most recent value.\n\t */\n\tgetMetric?(id: string): Promise<{\n\t\tmetric: ITelemetryMetric;\n\t\tvalue?: ITelemetryMetricValue;\n\t}>;\n\n\t/**\n\t * Get a specific metric value by its id.\n\t * @param id The id of the metric.\n\t * @param valueId The id of the metric value.\n\t * @returns The metric value.\n\t */\n\tgetMetricValue?(id: string, valueId: string): Promise<ITelemetryMetricValue>;\n\n\t/**\n\t * Update metric.\n\t * @param metric The metric details.\n\t * @returns A promise that resolves when the metric has been updated.\n\t */\n\tupdateMetric(metric: Omit<ITelemetryMetric, \"type\">): Promise<void>;\n\n\t/**\n\t * Update metric value.\n\t * @param id The id of the metric.\n\t * @param value The value for the update operation.\n\t * @param customData The custom data for the update operation.\n\t * @returns The created metric value id.\n\t */\n\taddMetricValue(\n\t\tid: string,\n\t\tvalue: MetricCounterOperation | number,\n\t\tcustomData?: { [key: string]: unknown }\n\t): Promise<string>;\n\n\t/**\n\t * Add multiple metric values, so implementations which persist them can do so in one\n\t * operation instead of one per value.\n\t * @param values The metric values to add.\n\t * @returns The created metric value ids, in the order the values were supplied.\n\t */\n\taddMetricValues(values: ITelemetryMetricValueEntry[]): Promise<string[]>;\n\n\t/**\n\t * Remove metric.\n\t * @param id The id of the metric.\n\t * @returns A promise that resolves when the metric and all its values have been removed.\n\t */\n\tremoveMetric(id: string): Promise<void>;\n\n\t/**\n\t * Query the metrics.\n\t * @param type The type of the metric.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tquery?(\n\t\ttype?: MetricType,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Query the metric values.\n\t * @param id The id of the metric.\n\t * @param timeStart The inclusive time as the start of the metric entries.\n\t * @param timeEnd The inclusive time as the end of the metric entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t * @throws NotImplementedError if the implementation does not support retrieval.\n\t */\n\tqueryValues?(\n\t\tid: string,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The values for the metric.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more values.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryMetric.js","sourceRoot":"","sources":["../../../src/models/ITelemetryMetric.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry metric.\n */\nexport interface ITelemetryMetric {\n\t/**\n\t * The id of the metric.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the metric.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The type of the metric.\n\t */\n\ttype: MetricType;\n\n\t/**\n\t * Description.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * The unit the metric describes.\n\t */\n\tunit?: string;\n\n\t/**\n\t * The maximum number of values to retain; oldest are trimmed on each addMetricValue call.\n\t * Unlimited when absent.\n\t */\n\tmaxHistory?: number;\n}\n"]}
1
+ {"version":3,"file":"ITelemetryMetric.js","sources":["../../../src/models/ITelemetryMetric.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricType } from \"./metricType.js\";\n\n/**\n * Interface describing a telemetry metric.\n */\nexport interface ITelemetryMetric {\n\t/**\n\t * The id of the metric.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the metric.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The type of the metric.\n\t */\n\ttype: MetricType;\n\n\t/**\n\t * Description.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * The unit the metric describes.\n\t */\n\tunit?: string;\n\n\t/**\n\t * The maximum number of values to retain; oldest are trimmed on each addMetricValue call.\n\t * Unlimited when absent.\n\t */\n\tmaxHistory?: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryMetricValue.js","sourceRoot":"","sources":["../../../src/models/ITelemetryMetricValue.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Interface describing a telemetry metric value.\n */\nexport interface ITelemetryMetricValue {\n\t/**\n\t * The id of the metric value.\n\t */\n\tid: string;\n\n\t/**\n\t * The timestamp of the metric.\n\t */\n\tts: number;\n\n\t/**\n\t * The value of the metric.\n\t */\n\tvalue: number;\n\n\t/**\n\t * The custom data for the metric value.\n\t */\n\tcustomData?: { [key: string]: unknown };\n}\n"]}
1
+ {"version":3,"file":"ITelemetryMetricValue.js","sources":["../../../src/models/ITelemetryMetricValue.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Interface describing a telemetry metric value.\n */\nexport interface ITelemetryMetricValue {\n\t/**\n\t * The id of the metric value.\n\t */\n\tid: string;\n\n\t/**\n\t * The timestamp of the metric.\n\t */\n\tts: number;\n\n\t/**\n\t * The value of the metric.\n\t */\n\tvalue: number;\n\n\t/**\n\t * The custom data for the metric value.\n\t */\n\tcustomData?: { [key: string]: unknown };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryMetricValueEntry.js","sourceRoot":"","sources":["../../../src/models/ITelemetryMetricValueEntry.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\n\n/**\n * A single metric value in a batch add operation.\n */\nexport interface ITelemetryMetricValueEntry {\n\t/**\n\t * The id of the metric.\n\t */\n\tid: string;\n\n\t/**\n\t * The value for the add operation.\n\t */\n\tvalue: MetricCounterOperation | number;\n\n\t/**\n\t * The custom data for the metric value.\n\t */\n\tcustomData?: { [key: string]: unknown };\n}\n"]}
1
+ {"version":3,"file":"ITelemetryMetricValueEntry.js","sources":["../../../src/models/ITelemetryMetricValueEntry.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricCounterOperation } from \"./metricCounterOperation.js\";\n\n/**\n * A single metric value in a batch add operation.\n */\nexport interface ITelemetryMetricValueEntry {\n\t/**\n\t * The id of the metric.\n\t */\n\tid: string;\n\n\t/**\n\t * The value for the add operation.\n\t */\n\tvalue: MetricCounterOperation | number;\n\n\t/**\n\t * The custom data for the metric value.\n\t */\n\tcustomData?: { [key: string]: unknown };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryAddMetricValueRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryAddMetricValueRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricCounterOperation } from \"../metricCounterOperation.js\";\n\n/**\n * Add a telemetry metric value.\n */\nexport interface ITelemetryAddMetricValueRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The data to be used in the update.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The value for the update operation.\n\t\t */\n\t\tvalue: MetricCounterOperation | number;\n\n\t\t/**\n\t\t * The custom data for the update operation.\n\t\t */\n\t\tcustomData?: { [key: string]: unknown };\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryAddMetricValueRequest.js","sources":["../../../../src/models/api/ITelemetryAddMetricValueRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { MetricCounterOperation } from \"../metricCounterOperation.js\";\n\n/**\n * Add a telemetry metric value.\n */\nexport interface ITelemetryAddMetricValueRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The data to be used in the update.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The value for the update operation.\n\t\t */\n\t\tvalue: MetricCounterOperation | number;\n\n\t\t/**\n\t\t * The custom data for the update operation.\n\t\t */\n\t\tcustomData?: { [key: string]: unknown };\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryCreateMetricRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryCreateMetricRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\n\n/**\n * Create one or more telemetry metrics.\n */\nexport interface ITelemetryCreateMetricRequest {\n\t/**\n\t * The data to be used in the create. A single metric fails if it already exists; an array\n\t * declares the set that should exist, creating the ones that are missing.\n\t */\n\tbody: ITelemetryMetric | ITelemetryMetric[];\n}\n"]}
1
+ {"version":3,"file":"ITelemetryCreateMetricRequest.js","sources":["../../../../src/models/api/ITelemetryCreateMetricRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\n\n/**\n * Create one or more telemetry metrics.\n */\nexport interface ITelemetryCreateMetricRequest {\n\t/**\n\t * The data to be used in the create. A single metric fails if it already exists; an array\n\t * declares the set that should exist, creating the ones that are missing.\n\t */\n\tbody: ITelemetryMetric | ITelemetryMetric[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryGetMetricRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryGetMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a telemetry metric.\n */\nexport interface ITelemetryGetMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryGetMetricRequest.js","sources":["../../../../src/models/api/ITelemetryGetMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a telemetry metric.\n */\nexport interface ITelemetryGetMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryGetMetricResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryGetMetricResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Get a telemetry metric response.\n */\nexport interface ITelemetryGetMetricResponse {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The metric.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The latest metric value.\n\t\t */\n\t\tvalue?: ITelemetryMetricValue;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryGetMetricResponse.js","sources":["../../../../src/models/api/ITelemetryGetMetricResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Get a telemetry metric response.\n */\nexport interface ITelemetryGetMetricResponse {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The metric.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The latest metric value.\n\t\t */\n\t\tvalue?: ITelemetryMetricValue;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryGetMetricValueRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryGetMetricValueRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a telemetry metric value.\n */\nexport interface ITelemetryGetMetricValueRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\n\t\t/**\n\t\t * The id of the metric value.\n\t\t */\n\t\tvalueId: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryGetMetricValueRequest.js","sources":["../../../../src/models/api/ITelemetryGetMetricValueRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a telemetry metric value.\n */\nexport interface ITelemetryGetMetricValueRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\n\t\t/**\n\t\t * The id of the metric value.\n\t\t */\n\t\tvalueId: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryGetMetricValueResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryGetMetricValueResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Get a telemetry metric value response.\n */\nexport interface ITelemetryGetMetricValueResponse {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: ITelemetryMetricValue;\n}\n"]}
1
+ {"version":3,"file":"ITelemetryGetMetricValueResponse.js","sources":["../../../../src/models/api/ITelemetryGetMetricValueResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Get a telemetry metric value response.\n */\nexport interface ITelemetryGetMetricValueResponse {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: ITelemetryMetricValue;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryListRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get the a list of the telemetry metrics.\n */\nexport interface ITelemetryListRequest {\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The type of the metric.\n\t\t */\n\t\ttype?: string;\n\n\t\t/**\n\t\t * The optional cursor to get next chunk.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryListRequest.js","sources":["../../../../src/models/api/ITelemetryListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get the a list of the telemetry metrics.\n */\nexport interface ITelemetryListRequest {\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The type of the metric.\n\t\t */\n\t\ttype?: string;\n\n\t\t/**\n\t\t * The optional cursor to get next chunk.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryListResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\n\n/**\n * Response for telemetry list request.\n */\nexport interface ITelemetryListResponse {\n\t/**\n\t * The response payload.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryListResponse.js","sources":["../../../../src/models/api/ITelemetryListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\n\n/**\n * Response for telemetry list request.\n */\nexport interface ITelemetryListResponse {\n\t/**\n\t * The response payload.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The metrics.\n\t\t */\n\t\tentities: ITelemetryMetric[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryRemoveMetricRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryRemoveMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Remove a telemetry metric and it's values.\n */\nexport interface ITelemetryRemoveMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryRemoveMetricRequest.js","sources":["../../../../src/models/api/ITelemetryRemoveMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Remove a telemetry metric and it's values.\n */\nexport interface ITelemetryRemoveMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryUpdateMetricRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryUpdateMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Update a telemetry metric.\n */\nexport interface ITelemetryUpdateMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The data to be used in the update.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The label of the metric.\n\t\t */\n\t\tlabel: string;\n\n\t\t/**\n\t\t * The description of the metric.\n\t\t */\n\t\tdescription?: string;\n\n\t\t/**\n\t\t * The unit of the metric.\n\t\t */\n\t\tunit?: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryUpdateMetricRequest.js","sources":["../../../../src/models/api/ITelemetryUpdateMetricRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Update a telemetry metric.\n */\nexport interface ITelemetryUpdateMetricRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The data to be used in the update.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The label of the metric.\n\t\t */\n\t\tlabel: string;\n\n\t\t/**\n\t\t * The description of the metric.\n\t\t */\n\t\tdescription?: string;\n\n\t\t/**\n\t\t * The unit of the metric.\n\t\t */\n\t\tunit?: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryValuesListRequest.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryValuesListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get the a list of the telemetry values.\n */\nexport interface ITelemetryValuesListRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The start time of the metrics to retrieve as a timestamp in ms.\n\t\t */\n\t\ttimeStart?: string;\n\n\t\t/**\n\t\t * The end time of the metrics to retrieve as a timestamp in ms.\n\t\t */\n\t\ttimeEnd?: string;\n\n\t\t/**\n\t\t * The optional cursor to get next chunk.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryValuesListRequest.js","sources":["../../../../src/models/api/ITelemetryValuesListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get the a list of the telemetry values.\n */\nexport interface ITelemetryValuesListRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the metric.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The start time of the metrics to retrieve as a timestamp in ms.\n\t\t */\n\t\ttimeStart?: string;\n\n\t\t/**\n\t\t * The end time of the metrics to retrieve as a timestamp in ms.\n\t\t */\n\t\ttimeEnd?: string;\n\n\t\t/**\n\t\t * The optional cursor to get next chunk.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITelemetryValuesListResponse.js","sourceRoot":"","sources":["../../../../src/models/api/ITelemetryValuesListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Response for telemetry list request.\n */\nexport interface ITelemetryValuesListResponse {\n\t/**\n\t * The response payload.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The main metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The metric values.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"ITelemetryValuesListResponse.js","sources":["../../../../src/models/api/ITelemetryValuesListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ITelemetryMetric } from \"../ITelemetryMetric.js\";\nimport type { ITelemetryMetricValue } from \"../ITelemetryMetricValue.js\";\n\n/**\n * Response for telemetry list request.\n */\nexport interface ITelemetryValuesListResponse {\n\t/**\n\t * The response payload.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The main metric details.\n\t\t */\n\t\tmetric: ITelemetryMetric;\n\n\t\t/**\n\t\t * The metric values.\n\t\t */\n\t\tentities: ITelemetryMetricValue[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"metricCounterOperation.js","sourceRoot":"","sources":["../../../src/models/metricCounterOperation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC;;OAEG;IACH,SAAS,EAAE,KAAK;IAEhB;;OAEG;IACH,SAAS,EAAE,KAAK;CACP,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of metric value operations for increment decrement counter metrics.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MetricCounterOperation = {\n\t/**\n\t * Increment Counter.\n\t */\n\tIncrement: \"inc\",\n\n\t/**\n\t * Decrement Counter.\n\t */\n\tDecrement: \"dec\"\n} as const;\n\n/**\n * The types of metric counter operations.\n */\nexport type MetricCounterOperation =\n\t(typeof MetricCounterOperation)[keyof typeof MetricCounterOperation];\n"]}
1
+ {"version":3,"file":"metricCounterOperation.js","sources":["../../../src/models/metricCounterOperation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC;;OAEG;IACH,SAAS,EAAE,KAAK;IAEhB;;OAEG;IACH,SAAS,EAAE,KAAK;CACP,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of metric value operations for increment decrement counter metrics.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MetricCounterOperation = {\n\t/**\n\t * Increment Counter.\n\t */\n\tIncrement: \"inc\",\n\n\t/**\n\t * Decrement Counter.\n\t */\n\tDecrement: \"dec\"\n} as const;\n\n/**\n * The types of metric counter operations.\n */\nexport type MetricCounterOperation =\n\t(typeof MetricCounterOperation)[keyof typeof MetricCounterOperation];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"metricType.js","sourceRoot":"","sources":["../../../src/models/metricType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB;;OAEG;IACH,OAAO,EAAE,CAAC;IAEV;;OAEG;IACH,aAAa,EAAE,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,CAAC;CACC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of metrics.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MetricType = {\n\t/**\n\t * Counter.\n\t */\n\tCounter: 0,\n\n\t/**\n\t * Increment Decrement Counter.\n\t */\n\tIncDecCounter: 1,\n\n\t/**\n\t * Gauge.\n\t */\n\tGauge: 2\n} as const;\n\n/**\n * The types of metrics.\n */\nexport type MetricType = (typeof MetricType)[keyof typeof MetricType];\n"]}
1
+ {"version":3,"file":"metricType.js","sources":["../../../src/models/metricType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB;;OAEG;IACH,OAAO,EAAE,CAAC;IAEV;;OAEG;IACH,aAAa,EAAE,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,CAAC;CACC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of metrics.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MetricType = {\n\t/**\n\t * Counter.\n\t */\n\tCounter: 0,\n\n\t/**\n\t * Increment Decrement Counter.\n\t */\n\tIncDecCounter: 1,\n\n\t/**\n\t * Gauge.\n\t */\n\tGauge: 2\n} as const;\n\n/**\n * The types of metrics.\n */\nexport type MetricType = (typeof MetricType)[keyof typeof MetricType];\n"]}
package/docs/changelog.md CHANGED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## [0.20.0-next.2](https://github.com/3sixtyglobal/telemetry/compare/telemetry-models-v0.20.0-next.1...telemetry-models-v0.20.0-next.2) (2026-10-26)
4
+
5
+
6
+ ### Features
7
+
8
+ * release to next [skip ci] ([#22](https://github.com/3sixtyglobal/telemetry/issues/22)) ([274c07f](https://github.com/3sixtyglobal/telemetry/commit/274c07f0f0f405c55b73703933759223435e1f70))
9
+
10
+ ## [0.20.0-next.1](https://github.com/3sixtyglobal/telemetry/compare/telemetry-models-v0.20.0-next.0...telemetry-models-v0.20.0-next.1) (2026-10-23)
11
+
12
+
13
+ ### Features
14
+
15
+ * publish packages under the [@3sixty](https://github.com/3sixty) namespace ([e488a8c](https://github.com/3sixtyglobal/telemetry/commit/e488a8cbe26251de694077a0164af480cab61c3a))
16
+ * updated ts compile ([4490a7b](https://github.com/3sixtyglobal/telemetry/commit/4490a7b854bdea72a79946d2dbb708a47e81b56f))
@@ -93,6 +93,8 @@ The metric ID.
93
93
 
94
94
  ##### customData?
95
95
 
96
+ \{\[`key`: `string`\]: `unknown`; \}
97
+
96
98
  Optional custom data for the increment.
97
99
 
98
100
  ##### onError?
@@ -131,6 +133,8 @@ The metric ID.
131
133
 
132
134
  ##### customData?
133
135
 
136
+ \{\[`key`: `string`\]: `unknown`; \}
137
+
134
138
  Optional custom data for the decrement.
135
139
 
136
140
  ##### onError?
@@ -175,6 +179,8 @@ The metric value to set.
175
179
 
176
180
  ##### customData?
177
181
 
182
+ \{\[`key`: `string`\]: `unknown`; \}
183
+
178
184
  Optional custom data for setting the value.
179
185
 
180
186
  ##### onError?
@@ -194,6 +194,8 @@ The value for the add operation.
194
194
 
195
195
  ##### customData?
196
196
 
197
+ \{\[`key`: `string`\]: `unknown`; \}
198
+
197
199
  The custom data for the add operation.
198
200
 
199
201
  #### Returns
@@ -126,6 +126,8 @@ The value for the update operation.
126
126
 
127
127
  ##### customData?
128
128
 
129
+ \{\[`key`: `string`\]: `unknown`; \}
130
+
129
131
  The custom data for the update operation.
130
132
 
131
133
  #### Returns
@@ -127,6 +127,8 @@ The value for the add operation.
127
127
 
128
128
  ##### customData?
129
129
 
130
+ \{\[`key`: `string`\]: `unknown`; \}
131
+
130
132
  The custom data for the add operation.
131
133
 
132
134
  #### Returns
@@ -127,6 +127,8 @@ The value for the update operation.
127
127
 
128
128
  ##### customData?
129
129
 
130
+ \{\[`key`: `string`\]: `unknown`; \}
131
+
130
132
  The custom data for the update operation.
131
133
 
132
134
  #### Returns
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3sixty/telemetry-models",
3
- "version": "0.20.0-next.0",
3
+ "version": "0.20.0-next.2",
4
4
  "description": "Shared telemetry models for connectors and services.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,11 +11,11 @@
11
11
  "license": "Apache-2.0",
12
12
  "type": "module",
13
13
  "engines": {
14
- "node": ">=24.0.0"
14
+ "node": ">=24.0.0",
15
+ "bun": ">=1.4.4"
15
16
  },
16
17
  "dependencies": {
17
18
  "@3sixty/core": "next",
18
- "@3sixty/entity": "next",
19
19
  "@3sixty/nameof": "next"
20
20
  },
21
21
  "main": "./dist/es/index.js",