@ms-cloudpack/external-telemetry 0.5.93 → 0.5.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/getAppName.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getAppName(appPath: string): Promise<string>;
|
|
1
|
+
export declare function getAppName(appPath: string): Promise<string | undefined>;
|
|
2
2
|
//# sourceMappingURL=getAppName.d.ts.map
|
package/lib/getAppName.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAppName.d.ts","sourceRoot":"","sources":["../src/getAppName.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getAppName.d.ts","sourceRoot":"","sources":["../src/getAppName.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAQ7E"}
|
package/lib/getAppName.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAppName.js","sourceRoot":"","sources":["../src/getAppName.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAe;IAC9C,MAAM,UAAU,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAgB,CAAC;IAElF,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yCAAyC,OAAO,IAAI,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC;AACzB,CAAC","sourcesContent":["import type { PackageJson } from '@ms-cloudpack/common-types';\nimport { readJson } from '@ms-cloudpack/json-utilities';\nimport { join } from 'path';\n\nexport async function getAppName(appPath: string) {\n const definition = (await readJson(join(appPath, 'package.json'))) as PackageJson;\n\n if (!definition) {\n throw new Error(`There was no package.json located at \"${appPath}\".`);\n }\n\n return definition.name;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getAppName.js","sourceRoot":"","sources":["../src/getAppName.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAe;IAC9C,MAAM,UAAU,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAgB,CAAC;IAElF,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yCAAyC,OAAO,IAAI,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC;AACzB,CAAC","sourcesContent":["import type { PackageJson } from '@ms-cloudpack/common-types';\nimport { readJson } from '@ms-cloudpack/json-utilities';\nimport { join } from 'path';\n\nexport async function getAppName(appPath: string): Promise<string | undefined> {\n const definition = (await readJson(join(appPath, 'package.json'))) as PackageJson;\n\n if (!definition) {\n throw new Error(`There was no package.json located at \"${appPath}\".`);\n }\n\n return definition.name;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reportExternalTelemetryEvent.d.ts","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAIhF;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"reportExternalTelemetryEvent.d.ts","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[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AU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,WAAW;SAC/E;KACF,CAAC,CAAC;IAEH,qBAAqB,CAAC,QAAQ,CAAC,GAAG,QAAQ,IAAI,OAAO,CAAC,SAAS,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvF,qBAAqB,CAAC,GAAG,EAAE,CAAC;IAE5B,MAAM,eAAe,CAAC,QAAQ,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import { readConfig } from '@ms-cloudpack/config';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport { createTelemetryClient } from '@ms-cloudpack/telemetry';\nimport { getVersion } from '@ms-cloudpack/package-utilities';\nimport { getAppName } from './getAppName.js';\nimport type { ReportTelemetryOptions } from './types/ReportTelemetryOptions.js';\n\nconst external = 'EXTERNAL';\n\n/**\n * Report an external telemetry event to the CloudPack telemetry service.\n * @param options - The options for reporting the event.\n */\nexport async function reportExternalTelemetryEvent(options: ReportTelemetryOptions) {\n const { telemetry } = await readConfig(options.appPath);\n const connectionString = telemetry?.connectionString || environmentInfo.cloudpack.telemetryConnectionString;\n\n const telemetryClient = await createTelemetryClient({\n productVersion: getVersion(import.meta.url),\n serviceName: 'external-telemetry',\n serviceNamespace: 'cloudpack',\n connectionString: connectionString,\n logLevel: options.logLevel,\n });\n\n const externalTelemetrySpan = telemetryClient.tracer.startSpan(external, {\n attributes: {\n appName: options.appName || (await getAppName(options.appPath)) || '<unknown>',\n },\n });\n\n externalTelemetrySpan.addEvent(`${external}-${options.eventName}`, options.attributes);\n\n externalTelemetrySpan.end();\n\n await telemetryClient.shutdown();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reportExternalTelemetryEvent.js","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAA+B;IAChF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,SAAS,EAAE,gBAAgB,IAAI,eAAe,CAAC,SAAS,CAAC,yBAAyB,CAAC;IAE5G,MAAM,eAAe,GAAG,MAAM,qBAAqB,CAAC;QAClD,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,WAAW,EAAE,oBAAoB;QACjC,gBAAgB,EAAE,WAAW;QAC7B,gBAAgB,EAAE,gBAAgB;QAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;IAEH,MAAM,qBAAqB,GAAG,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE;QACvE,UAAU,EAAE;YACV,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,WAAW;SAC/E;KACF,CAAC,CAAC;IAEH,qBAAqB,CAAC,QAAQ,CAAC,GAAG,QAAQ,IAAI,OAAO,CAAC,SAAS,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvF,qBAAqB,CAAC,GAAG,EAAE,CAAC;IAE5B,MAAM,eAAe,CAAC,QAAQ,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import { readConfig } from '@ms-cloudpack/config';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport { createTelemetryClient } from '@ms-cloudpack/telemetry';\nimport { getVersion } from '@ms-cloudpack/package-utilities';\nimport { getAppName } from './getAppName.js';\nimport type { ReportTelemetryOptions } from './types/ReportTelemetryOptions.js';\n\nconst external = 'EXTERNAL';\n\n/**\n * Report an external telemetry event to the CloudPack telemetry service.\n * @param options - The options for reporting the event.\n */\nexport async function reportExternalTelemetryEvent(options: ReportTelemetryOptions): Promise<void> {\n const { telemetry } = await readConfig(options.appPath);\n const connectionString = telemetry?.connectionString || environmentInfo.cloudpack.telemetryConnectionString;\n\n const telemetryClient = await createTelemetryClient({\n productVersion: getVersion(import.meta.url),\n serviceName: 'external-telemetry',\n serviceNamespace: 'cloudpack',\n connectionString: connectionString,\n logLevel: options.logLevel,\n });\n\n const externalTelemetrySpan = telemetryClient.tracer.startSpan(external, {\n attributes: {\n appName: options.appName || (await getAppName(options.appPath)) || '<unknown>',\n },\n });\n\n externalTelemetrySpan.addEvent(`${external}-${options.eventName}`, options.attributes);\n\n externalTelemetrySpan.end();\n\n await telemetryClient.shutdown();\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/external-telemetry",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.94",
|
|
4
4
|
"description": "Reporting external telemetry which is not about of cloudpack internals.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@ms-cloudpack/common-types": "^0.23.7",
|
|
18
|
-
"@ms-cloudpack/config": "^0.33.
|
|
18
|
+
"@ms-cloudpack/config": "^0.33.5",
|
|
19
19
|
"@ms-cloudpack/environment": "^0.1.1",
|
|
20
20
|
"@ms-cloudpack/json-utilities": "^0.1.9",
|
|
21
|
-
"@ms-cloudpack/package-utilities": "^11.0.
|
|
22
|
-
"@ms-cloudpack/telemetry": "^0.10.
|
|
21
|
+
"@ms-cloudpack/package-utilities": "^11.0.1",
|
|
22
|
+
"@ms-cloudpack/telemetry": "^0.10.4"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
|