@equinor/fusion-framework-module-analytics 3.1.0 → 3.1.1

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 (43) hide show
  1. package/dist/esm/version.js +1 -1
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/dist/types/version.d.ts +1 -1
  4. package/package.json +11 -8
  5. package/CHANGELOG.md +0 -386
  6. package/docs/adapters.md +0 -79
  7. package/docs/collectors.md +0 -91
  8. package/docs/testing.md +0 -87
  9. package/docs/tracking-events.md +0 -16
  10. package/src/AnalyticsConfigurator.interface.ts +0 -77
  11. package/src/AnalyticsConfigurator.ts +0 -128
  12. package/src/AnalyticsProvider.interface.ts +0 -44
  13. package/src/AnalyticsProvider.ts +0 -150
  14. package/src/__tests__/MockAnalyticsAdapter.test.ts +0 -127
  15. package/src/__tests__/mock/analytics-mock-adapter.test.ts +0 -79
  16. package/src/adapters/AnalyticsAdapter.interface.ts +0 -36
  17. package/src/adapters/ConsoleAnalyticsAdapter.ts +0 -37
  18. package/src/adapters/FusionAnalyticsAdapter.ts +0 -95
  19. package/src/adapters/index.ts +0 -11
  20. package/src/collectors/AnalyticsCollector.interface.ts +0 -27
  21. package/src/collectors/AppLoadedCollector.ts +0 -94
  22. package/src/collectors/AppSelectedCollector.ts +0 -70
  23. package/src/collectors/ContextSelectedCollector.ts +0 -83
  24. package/src/collectors/create-schema.ts +0 -123
  25. package/src/collectors/index.ts +0 -12
  26. package/src/collectors/utils/app-key-schema.ts +0 -17
  27. package/src/collectors/utils/app-schema.ts +0 -22
  28. package/src/collectors/utils/context-schema.ts +0 -22
  29. package/src/collectors/utils/extract-app-key-metadata.ts +0 -15
  30. package/src/collectors/utils/extract-app-metadata.ts +0 -20
  31. package/src/collectors/utils/extract-context-metadata.ts +0 -19
  32. package/src/enable-analytics.ts +0 -44
  33. package/src/index.ts +0 -30
  34. package/src/logExporters/fusionOTLPLogExporter/FusionOTLPLogExporter.ts +0 -71
  35. package/src/logExporters/fusionOTLPLogExporter/HttpClientExporterTransport.ts +0 -123
  36. package/src/logExporters/index.ts +0 -10
  37. package/src/mock/MockAnalyticsAdapter.ts +0 -178
  38. package/src/mock/index.ts +0 -29
  39. package/src/module.ts +0 -59
  40. package/src/types.ts +0 -60
  41. package/src/version.ts +0 -2
  42. package/tsconfig.json +0 -29
  43. package/vitest.config.ts +0 -11
package/src/types.ts DELETED
@@ -1,60 +0,0 @@
1
- /**
2
- * Scalar analytics attribute value: a string, number, or boolean.
3
- *
4
- * @remarks
5
- * Mirrors the OpenTelemetry `AnyValue` scalar subset used in log record
6
- * attributes and event bodies.
7
- */
8
- export type AnyValueScalar = string | number | boolean;
9
-
10
- /** Array of {@link AnyValue} entries, allowing nested attribute structures. */
11
- export type AnyValueArray = Array<AnyValue>;
12
-
13
- /**
14
- * A key–value map where each value is an {@link AnyValue}.
15
- *
16
- * Used as the attribute bag on {@link AnalyticsEvent} instances and for
17
- * nested attribute structures.
18
- */
19
- export interface AnyValueMap {
20
- [attributeKey: string]: AnyValue;
21
- }
22
-
23
- /**
24
- * A flexible value type compatible with OpenTelemetry log record bodies and attributes.
25
- *
26
- * Can be one of the following:
27
- * - a scalar value (`string | number | boolean`)
28
- * - a byte array (`Uint8Array`)
29
- * - an array of any value ({@link AnyValueArray})
30
- * - a map from string to any value ({@link AnyValueMap})
31
- * - `null` or `undefined`
32
- */
33
- export type AnyValue = AnyValueScalar | Uint8Array | AnyValueArray | AnyValueMap | null | undefined;
34
-
35
- /**
36
- * Represents a single analytics event emitted by a collector and consumed by adapters.
37
- *
38
- * @template TValue - The event body type, defaults to {@link AnyValue}.
39
- * @template TAttr - The attributes map type, defaults to {@link AnyValueMap}.
40
- *
41
- * @example
42
- * ```ts
43
- * const event: AnalyticsEvent = {
44
- * name: 'button-click',
45
- * value: 'submit',
46
- * attributes: { section: 'header', count: 1 },
47
- * };
48
- * ```
49
- */
50
- export type AnalyticsEvent<
51
- TValue extends AnyValue = AnyValue,
52
- TAttr extends AnyValueMap = AnyValueMap,
53
- > = {
54
- /** Descriptive event name used to categorise the analytic, e.g. `'context-selected'`. */
55
- name: string;
56
- /** The primary payload of the event. */
57
- value: TValue;
58
- /** Optional metadata attached to the event for filtering and grouping. */
59
- attributes?: TAttr;
60
- };
package/src/version.ts DELETED
@@ -1,2 +0,0 @@
1
- // Generated by genversion.
2
- export const version = '3.1.0';
package/tsconfig.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "outDir": "dist/esm",
7
- "rootDir": "src",
8
- "declarationDir": "./dist/types"
9
- },
10
- "references": [
11
- {
12
- "path": "../module"
13
- },
14
- {
15
- "path": "../event"
16
- },
17
- {
18
- "path": "../app"
19
- },
20
- {
21
- "path": "../context"
22
- },
23
- {
24
- "path": "../http"
25
- }
26
- ],
27
- "include": ["src/**/*"],
28
- "exclude": ["node_modules", "lib"]
29
- }
package/vitest.config.ts DELETED
@@ -1,11 +0,0 @@
1
- import { defineProject } from 'vitest/config';
2
-
3
- import { name, version } from './package.json' with { type: 'json' };
4
-
5
- export default defineProject({
6
- test: {
7
- environment: 'node',
8
- include: ['src/__tests__/**/*.test.ts'],
9
- name: `${name}@${version}`,
10
- },
11
- });