@grafana/faro-core 1.8.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/bundle/faro-core.iife.js +1 -1
  2. package/dist/bundle/types/api/events/types.d.ts +1 -0
  3. package/dist/bundle/types/api/exceptions/types.d.ts +1 -0
  4. package/dist/bundle/types/api/logs/types.d.ts +1 -0
  5. package/dist/bundle/types/api/measurements/types.d.ts +1 -0
  6. package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
  7. package/dist/bundle/types/utils/date.d.ts +2 -0
  8. package/dist/bundle/types/utils/index.d.ts +1 -1
  9. package/dist/bundle/types/version.d.ts +1 -1
  10. package/dist/cjs/api/events/initialize.js +3 -2
  11. package/dist/cjs/api/events/initialize.js.map +1 -1
  12. package/dist/cjs/api/events/types.js.map +1 -1
  13. package/dist/cjs/api/exceptions/initialize.js +3 -2
  14. package/dist/cjs/api/exceptions/initialize.js.map +1 -1
  15. package/dist/cjs/api/exceptions/types.js.map +1 -1
  16. package/dist/cjs/api/logs/initialize.js +3 -2
  17. package/dist/cjs/api/logs/initialize.js.map +1 -1
  18. package/dist/cjs/api/logs/types.js.map +1 -1
  19. package/dist/cjs/api/measurements/initialize.js +3 -3
  20. package/dist/cjs/api/measurements/initialize.js.map +1 -1
  21. package/dist/cjs/api/measurements/types.js.map +1 -1
  22. package/dist/cjs/utils/date.js +9 -1
  23. package/dist/cjs/utils/date.js.map +1 -1
  24. package/dist/cjs/utils/index.js +4 -4
  25. package/dist/cjs/utils/index.js.map +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/cjs/version.js.map +1 -1
  28. package/dist/esm/api/events/initialize.js +3 -2
  29. package/dist/esm/api/events/initialize.js.map +1 -1
  30. package/dist/esm/api/events/types.js.map +1 -1
  31. package/dist/esm/api/exceptions/initialize.js +3 -2
  32. package/dist/esm/api/exceptions/initialize.js.map +1 -1
  33. package/dist/esm/api/exceptions/types.js.map +1 -1
  34. package/dist/esm/api/logs/initialize.js +3 -2
  35. package/dist/esm/api/logs/initialize.js.map +1 -1
  36. package/dist/esm/api/logs/types.js.map +1 -1
  37. package/dist/esm/api/measurements/initialize.js +3 -3
  38. package/dist/esm/api/measurements/initialize.js.map +1 -1
  39. package/dist/esm/api/measurements/types.js.map +1 -1
  40. package/dist/esm/utils/date.js +6 -0
  41. package/dist/esm/utils/date.js.map +1 -1
  42. package/dist/esm/utils/index.js +1 -1
  43. package/dist/esm/utils/index.js.map +1 -1
  44. package/dist/esm/version.js +1 -1
  45. package/dist/esm/version.js.map +1 -1
  46. package/dist/spec/core/src/api/events/initialize.js +3 -2
  47. package/dist/spec/core/src/api/events/initialize.js.map +1 -1
  48. package/dist/spec/core/src/api/events/initialize.test.js +6 -0
  49. package/dist/spec/core/src/api/events/initialize.test.js.map +1 -1
  50. package/dist/spec/core/src/api/events/types.js.map +1 -1
  51. package/dist/spec/core/src/api/exceptions/initialize.js +3 -2
  52. package/dist/spec/core/src/api/exceptions/initialize.js.map +1 -1
  53. package/dist/spec/core/src/api/exceptions/initialize.test.js +6 -0
  54. package/dist/spec/core/src/api/exceptions/initialize.test.js.map +1 -1
  55. package/dist/spec/core/src/api/exceptions/types.js.map +1 -1
  56. package/dist/spec/core/src/api/logs/initialize.js +3 -2
  57. package/dist/spec/core/src/api/logs/initialize.js.map +1 -1
  58. package/dist/spec/core/src/api/logs/initialize.test.js +6 -0
  59. package/dist/spec/core/src/api/logs/initialize.test.js.map +1 -1
  60. package/dist/spec/core/src/api/logs/types.js.map +1 -1
  61. package/dist/spec/core/src/api/measurements/initialize.js +3 -3
  62. package/dist/spec/core/src/api/measurements/initialize.js.map +1 -1
  63. package/dist/spec/core/src/api/measurements/initialize.test.js +6 -0
  64. package/dist/spec/core/src/api/measurements/initialize.test.js.map +1 -1
  65. package/dist/spec/core/src/api/measurements/types.js.map +1 -1
  66. package/dist/spec/core/src/utils/date.js +9 -1
  67. package/dist/spec/core/src/utils/date.js.map +1 -1
  68. package/dist/spec/core/src/utils/index.js +4 -4
  69. package/dist/spec/core/src/utils/index.js.map +1 -1
  70. package/dist/spec/core/src/version.js +1 -1
  71. package/dist/spec/core/src/version.js.map +1 -1
  72. package/dist/types/api/events/types.d.ts +1 -0
  73. package/dist/types/api/exceptions/types.d.ts +1 -0
  74. package/dist/types/api/logs/types.d.ts +1 -0
  75. package/dist/types/api/measurements/types.d.ts +1 -0
  76. package/dist/types/core/src/api/events/types.d.ts +1 -0
  77. package/dist/types/core/src/api/exceptions/types.d.ts +1 -0
  78. package/dist/types/core/src/api/logs/types.d.ts +1 -0
  79. package/dist/types/core/src/api/measurements/types.d.ts +1 -0
  80. package/dist/types/core/src/testUtils/mockTransport.d.ts +1 -1
  81. package/dist/types/core/src/utils/date.d.ts +2 -0
  82. package/dist/types/core/src/utils/index.d.ts +1 -1
  83. package/dist/types/core/src/version.d.ts +1 -1
  84. package/dist/types/testUtils/mockTransport.d.ts +1 -1
  85. package/dist/types/utils/date.d.ts +2 -0
  86. package/dist/types/utils/index.d.ts +1 -1
  87. package/dist/types/version.d.ts +1 -1
  88. package/package.json +2 -2
  89. package/dist/bundle/types/utils/getCurrentTimestamp.d.ts +0 -1
  90. package/dist/cjs/utils/getCurrentTimestamp.js +0 -8
  91. package/dist/cjs/utils/getCurrentTimestamp.js.map +0 -1
  92. package/dist/esm/utils/getCurrentTimestamp.js +0 -4
  93. package/dist/esm/utils/getCurrentTimestamp.js.map +0 -1
  94. package/dist/spec/core/src/utils/getCurrentTimestamp.js +0 -8
  95. package/dist/spec/core/src/utils/getCurrentTimestamp.js.map +0 -1
  96. package/dist/types/core/src/utils/getCurrentTimestamp.d.ts +0 -1
  97. package/dist/types/utils/getCurrentTimestamp.d.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../../../src/api/measurements/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,+CAAoE;AAGpE,qCAA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cAAc,CAAC;YAE7B,cAAc,CAAC,KAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;YAEpD,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC1B;QAAC,OAAO,GAAG,EAAE;YACZ,cAAc,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;SAC1D;IACH,CAAC,CAAC;IAEF,OAAO;QACL,eAAe,iBAAA;KAChB,CAAC;AACJ,CAAC;AAvDD,8DAuDC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType } from '../../transports';\nimport type { Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { deepEqual, getCurrentTimestamp, isNull } from '../../utils';\nimport type { TracesAPI } from '../traces';\n\nimport type { MeasurementEvent, MeasurementsAPI } from './types';\n\nexport function initializeMeasurementsAPI(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\n tracesApi: TracesAPI\n): MeasurementsAPI {\n internalLogger.debug('Initializing measurements API');\n\n let lastPayload: Pick<MeasurementEvent, 'type' | 'values' | 'context'> | null = null;\n\n const pushMeasurement: MeasurementsAPI['pushMeasurement'] = (payload, { skipDedupe, context, spanContext } = {}) => {\n try {\n const item: TransportItem<MeasurementEvent> = {\n type: TransportItemType.MEASUREMENT,\n payload: {\n ...payload,\n trace: spanContext\n ? {\n trace_id: spanContext.traceId,\n span_id: spanContext.spanId,\n }\n : tracesApi.getTraceContext(),\n timestamp: payload.timestamp ?? getCurrentTimestamp(),\n context: context ?? {},\n },\n meta: metas.value,\n };\n\n const testingPayload = {\n type: item.payload.type,\n values: item.payload.values,\n context: item.payload.context,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping measurement push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing measurement\\n', item);\n\n transports.execute(item);\n } catch (err) {\n internalLogger.error('Error pushing measurement\\n', err);\n }\n };\n\n return {\n pushMeasurement,\n };\n}\n"]}
1
+ {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../../../src/api/measurements/initialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,+CAAoE;AAGpE,qCAAqE;AACrE,yCAAwD;AAKxD,SAAgB,yBAAyB,CACvC,iBAAmC,EACnC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB,EACtB,SAAoB;IAEpB,cAAc,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAEtD,IAAI,WAAW,GAAiE,IAAI,CAAC;IAErF,IAAM,eAAe,GAAuC,UAC1D,OAAO,EACP,EAA+D;YAA/D,qBAA6D,EAAE,KAAA,EAA7D,UAAU,gBAAA,EAAE,OAAO,aAAA,EAAE,WAAW,iBAAA,EAAE,oBAAoB,0BAAA;QAExD,IAAI;YACF,IAAM,IAAI,GAAoC;gBAC5C,IAAI,EAAE,8BAAiB,CAAC,WAAW;gBACnC,OAAO,wBACF,OAAO,KACV,KAAK,EAAE,WAAW;wBAChB,CAAC,CAAC;4BACE,QAAQ,EAAE,WAAW,CAAC,OAAO;4BAC7B,OAAO,EAAE,WAAW,CAAC,MAAM;yBAC5B;wBACH,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE,EAC/B,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,IAAA,2BAAoB,EAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAA,2BAAmB,GAAE,EACpG,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,GACvB;gBACD,IAAI,EAAE,KAAK,CAAC,KAAK;aAClB,CAAC;YAEF,IAAM,cAAc,GAAG;gBACrB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;gBACvB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;gBAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;aAC9B,CAAC;YAEF,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,IAAA,cAAM,EAAC,WAAW,CAAC,IAAI,IAAA,iBAAS,EAAC,cAAc,EAAE,WAAW,CAAC,EAAE;gBAClG,cAAc,CAAC,KAAK,CAAC,oEAAoE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEzG,OAAO;aACR;YAED,WAAW,GAAG,cAAc,CAAC;YAE7B,cAAc,CAAC,KAAK,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;YAEpD,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC1B;QAAC,OAAO,GAAG,EAAE;YACZ,cAAc,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;SAC1D;IACH,CAAC,CAAC;IAEF,OAAO;QACL,eAAe,iBAAA;KAChB,CAAC;AACJ,CAAC;AA1DD,8DA0DC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType } from '../../transports';\nimport type { Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { deepEqual, getCurrentTimestamp, isNull } from '../../utils';\nimport { timestampToIsoString } from '../../utils/date';\nimport type { TracesAPI } from '../traces';\n\nimport type { MeasurementEvent, MeasurementsAPI } from './types';\n\nexport function initializeMeasurementsAPI(\n _unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports,\n tracesApi: TracesAPI\n): MeasurementsAPI {\n internalLogger.debug('Initializing measurements API');\n\n let lastPayload: Pick<MeasurementEvent, 'type' | 'values' | 'context'> | null = null;\n\n const pushMeasurement: MeasurementsAPI['pushMeasurement'] = (\n payload,\n { skipDedupe, context, spanContext, timestampOverwriteMs } = {}\n ) => {\n try {\n const item: TransportItem<MeasurementEvent> = {\n type: TransportItemType.MEASUREMENT,\n payload: {\n ...payload,\n trace: spanContext\n ? {\n trace_id: spanContext.traceId,\n span_id: spanContext.spanId,\n }\n : tracesApi.getTraceContext(),\n timestamp: timestampOverwriteMs ? timestampToIsoString(timestampOverwriteMs) : getCurrentTimestamp(),\n context: context ?? {},\n },\n meta: metas.value,\n };\n\n const testingPayload = {\n type: item.payload.type,\n values: item.payload.values,\n context: item.payload.context,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping measurement push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing measurement\\n', item);\n\n transports.execute(item);\n } catch (err) {\n internalLogger.error('Error pushing measurement\\n', err);\n }\n };\n\n return {\n pushMeasurement,\n };\n}\n"]}
@@ -156,6 +156,12 @@ describe('api.measurements', function () {
156
156
  });
157
157
  });
158
158
  });
159
+ it('Sets the timestamp to the provided custom timestamp', function () {
160
+ var _a;
161
+ api.pushEvent('test', undefined, undefined, { timestampOverwriteMs: 123 });
162
+ expect(transport.items).toHaveLength(1);
163
+ expect(((_a = transport.items[0]) === null || _a === void 0 ? void 0 : _a.payload).timestamp).toBe('1970-01-01T00:00:00.123Z');
164
+ });
159
165
  });
160
166
  });
161
167
  //# sourceMappingURL=initialize.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.test.js","sourceRoot":"","sources":["../../../../../../src/api/measurements/initialize.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,+CAAkD;AAClD,6CAA4D;AAG5D,QAAQ,CAAC,kBAAkB,EAAE;IAC3B,SAAS,SAAS,CAAC,EAAkD;YAAlD,qBAAkC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAA,EAAhD,MAAM,YAAA;QACzB,IAAM,SAAS,GAAG,IAAI,yBAAa,EAAE,CAA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E,EAAE,WAAW,aAAA,EAAE,CAAC,CAAC;gBAClD,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBAExC,MAAM,CAAC,CAAC,MAAA,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,0CAAE,OAA4B,CAAA,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC;oBAC5E,QAAQ,EAAE,aAAa;oBACvB,OAAO,EAAE,YAAY;iBACtB,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import type { MeasurementEvent, PushMeasurementOptions } from '../..';\nimport { initializeFaro } from '../../initialize';\nimport { mockConfig, MockTransport } from '../../testUtils';\nimport type { API } from '../types';\n\ndescribe('api.measurements', () => {\n function createAPI({ dedupe }: { dedupe: boolean } = { dedupe: true }): [API, MockTransport] {\n const transport = new MockTransport();\n const config = mockConfig({\n dedupe,\n transports: [transport],\n });\n\n const { api } = initializeFaro(config);\n\n return [api, transport];\n }\n\n describe('pushMeasurement', () => {\n let api: API;\n let transport: MockTransport;\n\n beforeEach(() => {\n [api, transport] = createAPI();\n });\n\n describe('Filtering', () => {\n it('filters the same measurement', () => {\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(1);\n });\n\n it('filters the same measurement with the same context', () => {\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n const context = { foo: 'bar' };\n\n api.pushMeasurement(measurement, { context });\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement, { context });\n expect(transport.items).toHaveLength(1);\n });\n\n it(\"doesn't filter events with different context\", () => {\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement, { context: { foo: 'bar' } });\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement, { context: { bar: 'baz' } });\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"doesn't filter measurements with same type and partially same values\", () => {\n const measurement1 = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n const measurement2 = {\n ...measurement1,\n values: {\n ...measurement1.values,\n b: 2,\n },\n };\n\n api.pushMeasurement(measurement1);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement2);\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"doesn't filter measurements with different type and same values\", () => {\n const measurement1 = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n const measurement2 = {\n ...measurement1,\n type: 'web-vitals',\n };\n\n api.pushMeasurement(measurement1);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement2);\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"filters a measurement and doesn't filter the next different one\", () => {\n const measurement1 = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n const measurement2 = {\n ...measurement1,\n type: 'web-vitals',\n };\n\n api.pushMeasurement(measurement1);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement1);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement2);\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"doesn't filter when dedupe is false\", () => {\n [api, transport] = createAPI({ dedupe: false });\n\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"doesn't filter when skipDedupe is true\", () => {\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement, { skipDedupe: true });\n expect(transport.items).toHaveLength(2);\n });\n\n it('uses traceId and spanId from custom context', () => {\n const spanContext: PushMeasurementOptions['spanContext'] = {\n traceId: 'my-trace-id',\n spanId: 'my-span-id',\n };\n\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement, { spanContext });\n expect(transport.items).toHaveLength(1);\n\n expect((transport.items[0]?.payload as MeasurementEvent).trace).toStrictEqual({\n trace_id: 'my-trace-id',\n span_id: 'my-span-id',\n });\n });\n });\n });\n});\n"]}
1
+ {"version":3,"file":"initialize.test.js","sourceRoot":"","sources":["../../../../../../src/api/measurements/initialize.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,+CAAkD;AAClD,6CAA4D;AAG5D,QAAQ,CAAC,kBAAkB,EAAE;IAC3B,SAAS,SAAS,CAAC,EAAkD;YAAlD,qBAAkC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAA,EAAhD,MAAM,YAAA;QACzB,IAAM,SAAS,GAAG,IAAI,yBAAa,EAAE,CAAC;QACtC,IAAM,MAAM,GAAG,IAAA,sBAAU,EAAC;YACxB,MAAM,QAAA;YACN,UAAU,EAAE,CAAC,SAAS,CAAC;SACxB,CAAC,CAAC;QAEK,IAAA,GAAG,GAAK,IAAA,2BAAc,EAAC,MAAM,CAAC,IAA3B,CAA4B;QAEvC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC1B,CAAC;IAED,QAAQ,CAAC,iBAAiB,EAAE;QAC1B,IAAI,GAAQ,CAAC;QACb,IAAI,SAAwB,CAAC;QAE7B,UAAU,CAAC;;YACT,KAAmB,SAAS,EAAE,EAA7B,GAAG,QAAA,EAAE,SAAS,QAAA,CAAgB;QACjC,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,WAAW,EAAE;YACpB,EAAE,CAAC,8BAA8B,EAAE;gBACjC,IAAM,WAAW,GAAG;oBAClB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACN,CAAC,EAAE,CAAC;qBACL;iBACF,CAAC;gBAEF,GAAG,CAAC,eAAe,CAAC,WAAW,CAAC,CAA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A,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACvG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import type { MeasurementEvent, PushMeasurementOptions } from '../..';\nimport { initializeFaro } from '../../initialize';\nimport { mockConfig, MockTransport } from '../../testUtils';\nimport type { API } from '../types';\n\ndescribe('api.measurements', () => {\n function createAPI({ dedupe }: { dedupe: boolean } = { dedupe: true }): [API, MockTransport] {\n const transport = new MockTransport();\n const config = mockConfig({\n dedupe,\n transports: [transport],\n });\n\n const { api } = initializeFaro(config);\n\n return [api, transport];\n }\n\n describe('pushMeasurement', () => {\n let api: API;\n let transport: MockTransport;\n\n beforeEach(() => {\n [api, transport] = createAPI();\n });\n\n describe('Filtering', () => {\n it('filters the same measurement', () => {\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(1);\n });\n\n it('filters the same measurement with the same context', () => {\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n const context = { foo: 'bar' };\n\n api.pushMeasurement(measurement, { context });\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement, { context });\n expect(transport.items).toHaveLength(1);\n });\n\n it(\"doesn't filter events with different context\", () => {\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement, { context: { foo: 'bar' } });\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement, { context: { bar: 'baz' } });\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"doesn't filter measurements with same type and partially same values\", () => {\n const measurement1 = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n const measurement2 = {\n ...measurement1,\n values: {\n ...measurement1.values,\n b: 2,\n },\n };\n\n api.pushMeasurement(measurement1);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement2);\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"doesn't filter measurements with different type and same values\", () => {\n const measurement1 = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n const measurement2 = {\n ...measurement1,\n type: 'web-vitals',\n };\n\n api.pushMeasurement(measurement1);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement2);\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"filters a measurement and doesn't filter the next different one\", () => {\n const measurement1 = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n const measurement2 = {\n ...measurement1,\n type: 'web-vitals',\n };\n\n api.pushMeasurement(measurement1);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement1);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement2);\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"doesn't filter when dedupe is false\", () => {\n [api, transport] = createAPI({ dedupe: false });\n\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(2);\n });\n\n it(\"doesn't filter when skipDedupe is true\", () => {\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement);\n expect(transport.items).toHaveLength(1);\n\n api.pushMeasurement(measurement, { skipDedupe: true });\n expect(transport.items).toHaveLength(2);\n });\n\n it('uses traceId and spanId from custom context', () => {\n const spanContext: PushMeasurementOptions['spanContext'] = {\n traceId: 'my-trace-id',\n spanId: 'my-span-id',\n };\n\n const measurement = {\n type: 'custom',\n values: {\n a: 1,\n },\n };\n\n api.pushMeasurement(measurement, { spanContext });\n expect(transport.items).toHaveLength(1);\n\n expect((transport.items[0]?.payload as MeasurementEvent).trace).toStrictEqual({\n trace_id: 'my-trace-id',\n span_id: 'my-span-id',\n });\n });\n });\n\n it('Sets the timestamp to the provided custom timestamp', () => {\n api.pushEvent('test', undefined, undefined, { timestampOverwriteMs: 123 });\n expect(transport.items).toHaveLength(1);\n expect((transport.items[0]?.payload as MeasurementEvent).timestamp).toBe('1970-01-01T00:00:00.123Z');\n });\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/api/measurements/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type MeasurementContext = Record<string, string>;\n\nexport interface MeasurementEvent<V extends { [label: string]: number } = { [label: string]: number }> {\n type: string;\n values: V;\n\n timestamp: string;\n trace?: TraceContext;\n context?: MeasurementContext;\n}\n\nexport interface PushMeasurementOptions {\n skipDedupe?: boolean;\n context?: MeasurementContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n}\n\nexport interface MeasurementsAPI {\n pushMeasurement: (\n payload: Omit<MeasurementEvent, 'timestamp'> & Partial<Pick<MeasurementEvent, 'timestamp'>>,\n options?: PushMeasurementOptions\n ) => void;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/api/measurements/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type MeasurementContext = Record<string, string>;\n\nexport interface MeasurementEvent<V extends { [label: string]: number } = { [label: string]: number }> {\n type: string;\n values: V;\n\n timestamp: string;\n trace?: TraceContext;\n context?: MeasurementContext;\n}\n\nexport interface PushMeasurementOptions {\n skipDedupe?: boolean;\n context?: MeasurementContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n timestampOverwriteMs?: number;\n}\n\nexport interface MeasurementsAPI {\n pushMeasurement: (\n payload: Omit<MeasurementEvent, 'timestamp'> & Partial<Pick<MeasurementEvent, 'timestamp'>>,\n options?: PushMeasurementOptions\n ) => void;\n}\n"]}
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateNow = void 0;
3
+ exports.timestampToIsoString = exports.getCurrentTimestamp = exports.dateNow = void 0;
4
4
  function dateNow() {
5
5
  return Date.now();
6
6
  }
7
7
  exports.dateNow = dateNow;
8
+ function getCurrentTimestamp() {
9
+ return new Date().toISOString();
10
+ }
11
+ exports.getCurrentTimestamp = getCurrentTimestamp;
12
+ function timestampToIsoString(value) {
13
+ return new Date(value).toISOString();
14
+ }
15
+ exports.timestampToIsoString = timestampToIsoString;
8
16
  //# sourceMappingURL=date.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../../src/utils/date.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO;IACrB,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACpB,CAAC;AAFD,0BAEC","sourcesContent":["export function dateNow(): number {\n return Date.now();\n}\n"]}
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../../src/utils/date.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO;IACrB,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACpB,CAAC;AAFD,0BAEC;AAED,SAAgB,mBAAmB;IACjC,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAFD,kDAEC;AAED,SAAgB,oBAAoB,CAAC,KAAa;IAChD,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AACvC,CAAC;AAFD,oDAEC","sourcesContent":["export function dateNow(): number {\n return Date.now();\n}\n\nexport function getCurrentTimestamp(): string {\n return new Date().toISOString();\n}\n\nexport function timestampToIsoString(value: number): string {\n return new Date(value).toISOString();\n}\n"]}
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dateNow = exports.getBundleId = exports.genShortID = exports.createPromiseBuffer = exports.noop = exports.LogLevel = exports.defaultLogLevel = exports.allLogLevels = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.getCurrentTimestamp = exports.deepEqual = void 0;
4
4
  var deepEqual_1 = require("./deepEqual");
5
5
  Object.defineProperty(exports, "deepEqual", { enumerable: true, get: function () { return deepEqual_1.deepEqual; } });
6
- var getCurrentTimestamp_1 = require("./getCurrentTimestamp");
7
- Object.defineProperty(exports, "getCurrentTimestamp", { enumerable: true, get: function () { return getCurrentTimestamp_1.getCurrentTimestamp; } });
6
+ var date_1 = require("./date");
7
+ Object.defineProperty(exports, "getCurrentTimestamp", { enumerable: true, get: function () { return date_1.getCurrentTimestamp; } });
8
8
  var is_1 = require("./is");
9
9
  Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return is_1.isArray; } });
10
10
  Object.defineProperty(exports, "isBoolean", { enumerable: true, get: function () { return is_1.isBoolean; } });
@@ -46,6 +46,6 @@ var shortId_1 = require("./shortId");
46
46
  Object.defineProperty(exports, "genShortID", { enumerable: true, get: function () { return shortId_1.genShortID; } });
47
47
  var sourceMaps_1 = require("./sourceMaps");
48
48
  Object.defineProperty(exports, "getBundleId", { enumerable: true, get: function () { return sourceMaps_1.getBundleId; } });
49
- var date_1 = require("./date");
50
- Object.defineProperty(exports, "dateNow", { enumerable: true, get: function () { return date_1.dateNow; } });
49
+ var date_2 = require("./date");
50
+ Object.defineProperty(exports, "dateNow", { enumerable: true, get: function () { return date_2.dateNow; } });
51
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAE5B,2BA6Bc;AA5BZ,6FAAA,OAAO,OAAA;AACP,+FAAA,SAAS,OAAA;AACT,gGAAA,UAAU,OAAA;AACV,oGAAA,cAAc,OAAA;AACd,+FAAA,SAAS,OAAA;AACT,sGAAA,gBAAgB,OAAA;AAChB,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,kGAAA,YAAY,OAAA;AACZ,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,gGAAA,UAAU,OAAA;AACV,kGAAA,YAAY,OAAA;AACZ,2FAAA,KAAK,OAAA;AACL,2FAAA,KAAK,OAAA;AACL,kGAAA,YAAY,OAAA;AACZ,4FAAA,MAAM,OAAA;AACN,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,sGAAA,gBAAgB,OAAA;AAChB,gGAAA,UAAU,OAAA;AACV,gGAAA,UAAU,OAAA;AACV,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AAIb,yCAAsE;AAA7D,yGAAA,YAAY,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAEhD,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAG5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,2CAA2C;AAAlC,yGAAA,WAAW,OAAA;AAEpB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './getCurrentTimestamp';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,+BAA6C;AAApC,2GAAA,mBAAmB,OAAA;AAE5B,2BA6Bc;AA5BZ,6FAAA,OAAO,OAAA;AACP,+FAAA,SAAS,OAAA;AACT,gGAAA,UAAU,OAAA;AACV,oGAAA,cAAc,OAAA;AACd,+FAAA,SAAS,OAAA;AACT,sGAAA,gBAAgB,OAAA;AAChB,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,kGAAA,YAAY,OAAA;AACZ,6FAAA,OAAO,OAAA;AACP,oGAAA,cAAc,OAAA;AACd,gGAAA,UAAU,OAAA;AACV,kGAAA,YAAY,OAAA;AACZ,2FAAA,KAAK,OAAA;AACL,2FAAA,KAAK,OAAA;AACL,kGAAA,YAAY,OAAA;AACZ,4FAAA,MAAM,OAAA;AACN,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AACX,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,8FAAA,QAAQ,OAAA;AACR,sGAAA,gBAAgB,OAAA;AAChB,gGAAA,UAAU,OAAA;AACV,gGAAA,UAAU,OAAA;AACV,8FAAA,QAAQ,OAAA;AACR,iGAAA,WAAW,OAAA;AAIb,yCAAsE;AAA7D,yGAAA,YAAY,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAEhD,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAG5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,2CAA2C;AAAlC,yGAAA,WAAW,OAAA;AAEpB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './date';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n"]}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // auto-generated by bin/genVersion.ts
5
- exports.VERSION = '1.8.1';
5
+ exports.VERSION = '1.9.0';
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.8.1';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '1.9.0';\n"]}
@@ -11,6 +11,7 @@ export interface EventEvent {
11
11
  export interface PushEventOptions {
12
12
  skipDedupe?: boolean;
13
13
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
14
+ timestampOverwriteMs?: number;
14
15
  }
15
16
  export interface EventsAPI {
16
17
  pushEvent: (name: string, attributes?: EventAttributes, domain?: string, options?: PushEventOptions) => void;
@@ -30,6 +30,7 @@ export interface PushErrorOptions {
30
30
  type?: string;
31
31
  context?: ExceptionContext;
32
32
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
33
+ timestampOverwriteMs?: number;
33
34
  }
34
35
  export interface ExceptionsAPI {
35
36
  changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;
@@ -14,6 +14,7 @@ export interface PushLogOptions {
14
14
  level?: LogLevel;
15
15
  skipDedupe?: boolean;
16
16
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
17
+ timestampOverwriteMs?: number;
17
18
  }
18
19
  export interface LogsAPI {
19
20
  pushLog: (args: unknown[], options?: PushLogOptions) => void;
@@ -16,6 +16,7 @@ export interface PushMeasurementOptions {
16
16
  skipDedupe?: boolean;
17
17
  context?: MeasurementContext;
18
18
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
19
+ timestampOverwriteMs?: number;
19
20
  }
20
21
  export interface MeasurementsAPI {
21
22
  pushMeasurement: (payload: Omit<MeasurementEvent, 'timestamp'> & Partial<Pick<MeasurementEvent, 'timestamp'>>, options?: PushMeasurementOptions) => void;
@@ -11,6 +11,7 @@ export interface EventEvent {
11
11
  export interface PushEventOptions {
12
12
  skipDedupe?: boolean;
13
13
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
14
+ timestampOverwriteMs?: number;
14
15
  }
15
16
  export interface EventsAPI {
16
17
  pushEvent: (name: string, attributes?: EventAttributes, domain?: string, options?: PushEventOptions) => void;
@@ -30,6 +30,7 @@ export interface PushErrorOptions {
30
30
  type?: string;
31
31
  context?: ExceptionContext;
32
32
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
33
+ timestampOverwriteMs?: number;
33
34
  }
34
35
  export interface ExceptionsAPI {
35
36
  changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;
@@ -14,6 +14,7 @@ export interface PushLogOptions {
14
14
  level?: LogLevel;
15
15
  skipDedupe?: boolean;
16
16
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
17
+ timestampOverwriteMs?: number;
17
18
  }
18
19
  export interface LogsAPI {
19
20
  pushLog: (args: unknown[], options?: PushLogOptions) => void;
@@ -16,6 +16,7 @@ export interface PushMeasurementOptions {
16
16
  skipDedupe?: boolean;
17
17
  context?: MeasurementContext;
18
18
  spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;
19
+ timestampOverwriteMs?: number;
19
20
  }
20
21
  export interface MeasurementsAPI {
21
22
  pushMeasurement: (payload: Omit<MeasurementEvent, 'timestamp'> & Partial<Pick<MeasurementEvent, 'timestamp'>>, options?: PushMeasurementOptions) => void;
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.8.1";
7
+ readonly version = "1.9.0";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -1 +1,3 @@
1
1
  export declare function dateNow(): number;
2
+ export declare function getCurrentTimestamp(): string;
3
+ export declare function timestampToIsoString(value: number): string;
@@ -1,6 +1,6 @@
1
1
  export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';
2
2
  export { deepEqual } from './deepEqual';
3
- export { getCurrentTimestamp } from './getCurrentTimestamp';
3
+ export { getCurrentTimestamp } from './date';
4
4
  export { isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, } from './is';
5
5
  export type { IsFnHelper } from './is';
6
6
  export { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';
@@ -1 +1 @@
1
- export declare const VERSION = "1.8.1";
1
+ export declare const VERSION = "1.9.0";
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
4
4
  export declare class MockTransport extends BaseTransport implements Transport {
5
5
  private ignoreURLs;
6
6
  readonly name = "@grafana/transport-mock";
7
- readonly version = "1.8.1";
7
+ readonly version = "1.9.0";
8
8
  items: TransportItem[];
9
9
  constructor(ignoreURLs?: Patterns);
10
10
  send(items: TransportItem[]): void | Promise<void>;
@@ -1 +1,3 @@
1
1
  export declare function dateNow(): number;
2
+ export declare function getCurrentTimestamp(): string;
3
+ export declare function timestampToIsoString(value: number): string;
@@ -1,6 +1,6 @@
1
1
  export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';
2
2
  export { deepEqual } from './deepEqual';
3
- export { getCurrentTimestamp } from './getCurrentTimestamp';
3
+ export { getCurrentTimestamp } from './date';
4
4
  export { isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, } from './is';
5
5
  export type { IsFnHelper } from './is';
6
6
  export { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';
@@ -1 +1 @@
1
- export declare const VERSION = "1.8.1";
1
+ export declare const VERSION = "1.9.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/faro-core",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "description": "Core package of Faro.",
5
5
  "keywords": [
6
6
  "observability",
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "08d0f63dba5ff82c9b29b2f91df9d790514ea8d5"
60
+ "gitHead": "adbb672f86fe8158022cb93a2802edf6219e6655"
61
61
  }
@@ -1 +0,0 @@
1
- export declare function getCurrentTimestamp(): string;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCurrentTimestamp = void 0;
4
- function getCurrentTimestamp() {
5
- return new Date().toISOString();
6
- }
7
- exports.getCurrentTimestamp = getCurrentTimestamp;
8
- //# sourceMappingURL=getCurrentTimestamp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCurrentTimestamp.js","sourceRoot":"","sources":["../../../src/utils/getCurrentTimestamp.ts"],"names":[],"mappings":";;;AAAA,SAAgB,mBAAmB;IACjC,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAFD,kDAEC","sourcesContent":["export function getCurrentTimestamp(): string {\n return new Date().toISOString();\n}\n"]}
@@ -1,4 +0,0 @@
1
- export function getCurrentTimestamp() {
2
- return new Date().toISOString();
3
- }
4
- //# sourceMappingURL=getCurrentTimestamp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCurrentTimestamp.js","sourceRoot":"","sources":["../../../src/utils/getCurrentTimestamp.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC","sourcesContent":["export function getCurrentTimestamp(): string {\n return new Date().toISOString();\n}\n"]}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCurrentTimestamp = void 0;
4
- function getCurrentTimestamp() {
5
- return new Date().toISOString();
6
- }
7
- exports.getCurrentTimestamp = getCurrentTimestamp;
8
- //# sourceMappingURL=getCurrentTimestamp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCurrentTimestamp.js","sourceRoot":"","sources":["../../../../../src/utils/getCurrentTimestamp.ts"],"names":[],"mappings":";;;AAAA,SAAgB,mBAAmB;IACjC,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAFD,kDAEC","sourcesContent":["export function getCurrentTimestamp(): string {\n return new Date().toISOString();\n}\n"]}
@@ -1 +0,0 @@
1
- export declare function getCurrentTimestamp(): string;
@@ -1 +0,0 @@
1
- export declare function getCurrentTimestamp(): string;