@zuplo/cli 7.14.2 → 7.14.5
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/README.md +1 -0
- package/dist/cmds/variable/delete.d.ts +9 -0
- package/dist/cmds/variable/delete.d.ts.map +1 -0
- package/dist/cmds/variable/delete.js +72 -0
- package/dist/cmds/variable/delete.js.map +1 -0
- package/dist/cmds/variable/index.d.ts.map +1 -1
- package/dist/cmds/variable/index.js +2 -1
- package/dist/cmds/variable/index.js.map +1 -1
- package/dist/common/middleware/get-environment-param.d.ts.map +1 -1
- package/dist/common/middleware/get-environment-param.js +10 -12
- package/dist/common/middleware/get-environment-param.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/variable/delete/handler.d.ts +9 -0
- package/dist/variable/delete/handler.d.ts.map +1 -0
- package/dist/variable/delete/handler.js +13 -0
- package/dist/variable/delete/handler.js.map +1 -0
- package/node_modules/@posthog/core/dist/error-tracking/parsers/node.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/error-tracking/parsers/node.js +1 -1
- package/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs +1 -1
- package/node_modules/@posthog/core/dist/index.d.ts +1 -1
- package/node_modules/@posthog/core/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/logs/logs-utils.js +5 -5
- package/node_modules/@posthog/core/dist/logs/logs-utils.mjs +5 -5
- package/node_modules/@posthog/core/dist/metrics/index.d.ts +15 -2
- package/node_modules/@posthog/core/dist/metrics/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/metrics/index.js +88 -35
- package/node_modules/@posthog/core/dist/metrics/index.mjs +88 -35
- package/node_modules/@posthog/core/dist/metrics/types.d.ts +1 -1
- package/node_modules/@posthog/core/dist/metrics/types.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/privacy.js +3 -3
- package/node_modules/@posthog/core/dist/privacy.mjs +3 -3
- package/node_modules/@posthog/core/dist/utils/user-agent-utils.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/user-agent-utils.js +36 -36
- package/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs +36 -36
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/error-tracking/parsers/node.spec.ts +15 -0
- package/node_modules/@posthog/core/src/error-tracking/parsers/node.ts +2 -1
- package/node_modules/@posthog/core/src/index.ts +1 -0
- package/node_modules/@posthog/core/src/logs/logs-utils.ts +3 -3
- package/node_modules/@posthog/core/src/metrics/index.spec.ts +278 -0
- package/node_modules/@posthog/core/src/metrics/index.ts +160 -44
- package/node_modules/@posthog/core/src/metrics/types.ts +1 -0
- package/node_modules/@posthog/core/src/privacy.ts +3 -3
- package/node_modules/@posthog/core/src/utils/user-agent-utils.ts +39 -36
- package/node_modules/@posthog/types/dist/capture-metric.d.ts +24 -2
- package/node_modules/@posthog/types/dist/capture-metric.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/index.d.ts +1 -1
- package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts +18 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/capture-metric.ts +25 -2
- package/node_modules/@posthog/types/src/index.ts +1 -0
- package/node_modules/@posthog/types/src/posthog-config.ts +18 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-MUDGPSWL.js → chunk-UGZSO3CK.js} +94 -94
- package/node_modules/@zuplo/runtime/out/esm/chunk-UGZSO3CK.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +12 -12
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/graphql/error/GraphQLError.d.ts +5 -1
- package/node_modules/graphql/error/GraphQLError.js +12 -7
- package/node_modules/graphql/error/GraphQLError.mjs +13 -6
- package/node_modules/graphql/error/locatedError.d.ts +6 -4
- package/node_modules/graphql/error/locatedError.js +6 -4
- package/node_modules/graphql/error/locatedError.mjs +6 -4
- package/node_modules/graphql/execution/collectFields.d.ts +1 -0
- package/node_modules/graphql/execution/collectFields.js +9 -0
- package/node_modules/graphql/execution/collectFields.mjs +9 -0
- package/node_modules/graphql/execution/execute.d.ts +9 -10
- package/node_modules/graphql/execution/execute.js +44 -29
- package/node_modules/graphql/execution/execute.mjs +44 -29
- package/node_modules/graphql/execution/mapAsyncIterator.js +12 -11
- package/node_modules/graphql/execution/mapAsyncIterator.mjs +12 -11
- package/node_modules/graphql/execution/subscribe.d.ts +5 -2
- package/node_modules/graphql/execution/subscribe.js +5 -2
- package/node_modules/graphql/execution/subscribe.mjs +5 -2
- package/node_modules/graphql/execution/values.d.ts +43 -21
- package/node_modules/graphql/execution/values.js +52 -24
- package/node_modules/graphql/execution/values.mjs +51 -23
- package/node_modules/graphql/graphql.d.ts +8 -14
- package/node_modules/graphql/graphql.js +16 -15
- package/node_modules/graphql/graphql.mjs +11 -15
- package/node_modules/graphql/jsutils/SetMap.d.ts +14 -0
- package/node_modules/graphql/jsutils/SetMap.js +48 -0
- package/node_modules/graphql/jsutils/SetMap.mjs +39 -0
- package/node_modules/graphql/jsutils/isIterableObject.d.ts +2 -0
- package/node_modules/graphql/jsutils/isIterableObject.js +2 -0
- package/node_modules/graphql/jsutils/isIterableObject.mjs +2 -0
- package/node_modules/graphql/jsutils/keyMap.d.ts +2 -0
- package/node_modules/graphql/jsutils/keyMap.js +2 -0
- package/node_modules/graphql/jsutils/keyMap.mjs +2 -0
- package/node_modules/graphql/jsutils/keyValMap.d.ts +3 -3
- package/node_modules/graphql/jsutils/keyValMap.js +3 -3
- package/node_modules/graphql/jsutils/keyValMap.mjs +3 -3
- package/node_modules/graphql/language/ast.d.ts +2 -6
- package/node_modules/graphql/language/ast.js +2 -6
- package/node_modules/graphql/language/ast.mjs +2 -6
- package/node_modules/graphql/language/lexer.d.ts +6 -0
- package/node_modules/graphql/language/lexer.js +22 -0
- package/node_modules/graphql/language/lexer.mjs +22 -0
- package/node_modules/graphql/language/location.d.ts +8 -3
- package/node_modules/graphql/language/location.js +57 -17
- package/node_modules/graphql/language/location.mjs +56 -16
- package/node_modules/graphql/language/parser.d.ts +27 -13
- package/node_modules/graphql/language/parser.js +31 -9
- package/node_modules/graphql/language/parser.mjs +31 -9
- package/node_modules/graphql/language/predicates.d.ts +10 -3
- package/node_modules/graphql/language/predicates.js +10 -3
- package/node_modules/graphql/language/predicates.mjs +10 -3
- package/node_modules/graphql/language/printLocation.d.ts +2 -6
- package/node_modules/graphql/language/printLocation.js +2 -6
- package/node_modules/graphql/language/printLocation.mjs +2 -6
- package/node_modules/graphql/language/printer.d.ts +22 -3
- package/node_modules/graphql/language/printer.js +394 -308
- package/node_modules/graphql/language/printer.mjs +394 -308
- package/node_modules/graphql/language/reducer.d.ts +32 -0
- package/node_modules/graphql/language/reducer.js +95 -0
- package/node_modules/graphql/language/reducer.mjs +86 -0
- package/node_modules/graphql/language/source.d.ts +4 -5
- package/node_modules/graphql/language/source.js +4 -5
- package/node_modules/graphql/language/source.mjs +4 -5
- package/node_modules/graphql/language/visitor.d.ts +16 -10
- package/node_modules/graphql/language/visitor.js +15 -7
- package/node_modules/graphql/language/visitor.mjs +15 -7
- package/node_modules/graphql/package.json +1 -4
- package/node_modules/graphql/type/definition.d.ts +170 -102
- package/node_modules/graphql/type/definition.js +169 -96
- package/node_modules/graphql/type/definition.mjs +168 -95
- package/node_modules/graphql/type/directives.d.ts +12 -6
- package/node_modules/graphql/type/directives.js +12 -6
- package/node_modules/graphql/type/directives.mjs +12 -6
- package/node_modules/graphql/type/scalars.js +8 -11
- package/node_modules/graphql/type/scalars.mjs +1 -1
- package/node_modules/graphql/type/schema.d.ts +36 -11
- package/node_modules/graphql/type/schema.js +35 -10
- package/node_modules/graphql/type/schema.mjs +35 -10
- package/node_modules/graphql/type/validate.d.ts +1 -3
- package/node_modules/graphql/type/validate.js +1 -3
- package/node_modules/graphql/type/validate.mjs +1 -3
- package/node_modules/graphql/utilities/TypeInfo.d.ts +15 -11
- package/node_modules/graphql/utilities/TypeInfo.js +15 -11
- package/node_modules/graphql/utilities/TypeInfo.mjs +15 -11
- package/node_modules/graphql/utilities/assertValidName.d.ts +1 -1
- package/node_modules/graphql/utilities/assertValidName.js +1 -1
- package/node_modules/graphql/utilities/assertValidName.mjs +1 -1
- package/node_modules/graphql/utilities/astFromValue.d.ts +3 -1
- package/node_modules/graphql/utilities/astFromValue.js +3 -1
- package/node_modules/graphql/utilities/astFromValue.mjs +3 -1
- package/node_modules/graphql/utilities/buildASTSchema.d.ts +8 -8
- package/node_modules/graphql/utilities/buildASTSchema.js +9 -20
- package/node_modules/graphql/utilities/buildASTSchema.mjs +9 -20
- package/node_modules/graphql/utilities/buildClientSchema.d.ts +6 -2
- package/node_modules/graphql/utilities/buildClientSchema.js +6 -2
- package/node_modules/graphql/utilities/buildClientSchema.mjs +6 -2
- package/node_modules/graphql/utilities/coerceInputValue.d.ts +9 -3
- package/node_modules/graphql/utilities/coerceInputValue.js +60 -13
- package/node_modules/graphql/utilities/coerceInputValue.mjs +58 -13
- package/node_modules/graphql/utilities/concatAST.d.ts +4 -1
- package/node_modules/graphql/utilities/concatAST.js +4 -1
- package/node_modules/graphql/utilities/concatAST.mjs +4 -1
- package/node_modules/graphql/utilities/extendSchema.d.ts +7 -4
- package/node_modules/graphql/utilities/extendSchema.js +7 -4
- package/node_modules/graphql/utilities/extendSchema.mjs +7 -4
- package/node_modules/graphql/utilities/findBreakingChanges.d.ts +2 -2
- package/node_modules/graphql/utilities/findBreakingChanges.js +2 -2
- package/node_modules/graphql/utilities/findBreakingChanges.mjs +2 -2
- package/node_modules/graphql/utilities/getIntrospectionQuery.d.ts +9 -9
- package/node_modules/graphql/utilities/getIntrospectionQuery.js +8 -8
- package/node_modules/graphql/utilities/getIntrospectionQuery.mjs +8 -8
- package/node_modules/graphql/utilities/getOperationAST.d.ts +2 -2
- package/node_modules/graphql/utilities/getOperationAST.js +2 -2
- package/node_modules/graphql/utilities/getOperationAST.mjs +2 -2
- package/node_modules/graphql/utilities/getOperationRootType.d.ts +3 -1
- package/node_modules/graphql/utilities/getOperationRootType.js +3 -1
- package/node_modules/graphql/utilities/getOperationRootType.mjs +3 -1
- package/node_modules/graphql/utilities/introspectionFromSchema.d.ts +12 -4
- package/node_modules/graphql/utilities/introspectionFromSchema.js +12 -4
- package/node_modules/graphql/utilities/introspectionFromSchema.mjs +12 -4
- package/node_modules/graphql/utilities/lexicographicSortSchema.d.ts +17 -13
- package/node_modules/graphql/utilities/lexicographicSortSchema.js +17 -13
- package/node_modules/graphql/utilities/lexicographicSortSchema.mjs +17 -13
- package/node_modules/graphql/utilities/printSchema.d.ts +7 -4
- package/node_modules/graphql/utilities/printSchema.js +7 -4
- package/node_modules/graphql/utilities/printSchema.mjs +7 -4
- package/node_modules/graphql/utilities/resolveSchemaCoordinate.d.ts +9 -8
- package/node_modules/graphql/utilities/resolveSchemaCoordinate.js +9 -8
- package/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs +9 -8
- package/node_modules/graphql/utilities/separateOperations.d.ts +2 -2
- package/node_modules/graphql/utilities/separateOperations.js +2 -2
- package/node_modules/graphql/utilities/separateOperations.mjs +2 -2
- package/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts +19 -5
- package/node_modules/graphql/utilities/stripIgnoredCharacters.js +19 -5
- package/node_modules/graphql/utilities/stripIgnoredCharacters.mjs +19 -5
- package/node_modules/graphql/utilities/typeComparators.d.ts +1 -5
- package/node_modules/graphql/utilities/typeComparators.js +1 -5
- package/node_modules/graphql/utilities/typeComparators.mjs +1 -5
- package/node_modules/graphql/utilities/valueFromAST.js +4 -4
- package/node_modules/graphql/utilities/valueFromAST.mjs +4 -4
- package/node_modules/graphql/utilities/valueFromASTUntyped.d.ts +1 -3
- package/node_modules/graphql/utilities/valueFromASTUntyped.js +1 -3
- package/node_modules/graphql/utilities/valueFromASTUntyped.mjs +1 -3
- package/node_modules/graphql/validation/ValidationContext.d.ts +22 -3
- package/node_modules/graphql/validation/ValidationContext.js +84 -27
- package/node_modules/graphql/validation/ValidationContext.mjs +82 -27
- package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js +6 -4
- package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js +10 -6
- package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs +12 -6
- package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js +6 -4
- package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js +26 -17
- package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs +21 -11
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts +1 -3
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.js +1 -3
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs +1 -3
- package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts +1 -3
- package/node_modules/graphql/validation/rules/KnownTypeNamesRule.js +7 -7
- package/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs +7 -7
- package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js +6 -4
- package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js +44 -19
- package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs +44 -19
- package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts +1 -3
- package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js +1 -3
- package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs +1 -3
- package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js +4 -4
- package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js +10 -14
- package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs +10 -14
- package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js +4 -4
- package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +8 -6
- package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js +552 -354
- package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +545 -352
- package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js +6 -4
- package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js +6 -4
- package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts +1 -3
- package/node_modules/graphql/validation/rules/ScalarLeafsRule.js +1 -3
- package/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs +1 -3
- package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js +50 -9
- package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs +50 -9
- package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +6 -4
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js +6 -4
- package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js +4 -4
- package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +29 -23
- package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs +24 -14
- package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js +6 -4
- package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts +6 -4
- package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js +6 -4
- package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs +6 -4
- package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts +4 -4
- package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js +4 -4
- package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs +4 -4
- package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +7 -5
- package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +7 -5
- package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +7 -5
- package/node_modules/graphql/validation/validate.d.ts +2 -0
- package/node_modules/graphql/validation/validate.js +14 -2
- package/node_modules/graphql/validation/validate.mjs +13 -2
- package/node_modules/graphql/validation/validationAbortedError.d.ts +3 -0
- package/node_modules/graphql/validation/validationAbortedError.js +14 -0
- package/node_modules/graphql/validation/validationAbortedError.mjs +4 -0
- package/node_modules/graphql/version.js +3 -3
- package/node_modules/graphql/version.mjs +3 -3
- package/package.json +11 -11
- package/node_modules/@zuplo/runtime/out/esm/chunk-MUDGPSWL.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-MUDGPSWL.js.LEGAL.txt → chunk-UGZSO3CK.js.LEGAL.txt} +0 -0
|
@@ -56,6 +56,9 @@ class PostHogMetrics {
|
|
|
56
56
|
this._seriesCapWarned = false;
|
|
57
57
|
this._typeByName = new Map();
|
|
58
58
|
this._typeCollisionWarned = new Set();
|
|
59
|
+
this._boundsByHistogram = new Map();
|
|
60
|
+
this._boundsConflictWarned = new Set();
|
|
61
|
+
this._boundsCapWarned = false;
|
|
59
62
|
this._retryAfter = new retry_after_js_namespaceObject.RetryAfterWindow();
|
|
60
63
|
this._consecutiveFlushFailures = 0;
|
|
61
64
|
this._flushJitter = backoff_js_namespaceObject.NO_JITTER;
|
|
@@ -85,7 +88,8 @@ class PostHogMetrics {
|
|
|
85
88
|
type: 'histogram',
|
|
86
89
|
value,
|
|
87
90
|
unit: options?.unit,
|
|
88
|
-
attributes: options?.attributes
|
|
91
|
+
attributes: options?.attributes,
|
|
92
|
+
bounds: (0, index_js_namespaceObject.isArray)(options?.bounds) ? options.bounds.slice() : options?.bounds
|
|
89
93
|
});
|
|
90
94
|
}
|
|
91
95
|
flush() {
|
|
@@ -103,10 +107,7 @@ class PostHogMetrics {
|
|
|
103
107
|
drainWindow() {
|
|
104
108
|
if (0 === this._series.size) return null;
|
|
105
109
|
const window = this._series;
|
|
106
|
-
this.
|
|
107
|
-
this._seriesCapWarned = false;
|
|
108
|
-
this._typeByName = new Map();
|
|
109
|
-
this._typeCollisionWarned = new Set();
|
|
110
|
+
this._startWindow();
|
|
110
111
|
return this._buildPayload(window);
|
|
111
112
|
}
|
|
112
113
|
reset() {
|
|
@@ -115,11 +116,17 @@ class PostHogMetrics {
|
|
|
115
116
|
this._consecutiveFlushFailures = 0;
|
|
116
117
|
this._flushJitter = backoff_js_namespaceObject.NO_JITTER;
|
|
117
118
|
this._flushTimer.clear();
|
|
118
|
-
this._series = new Map();
|
|
119
119
|
this._flushPromise = null;
|
|
120
|
+
this._startWindow();
|
|
121
|
+
this._boundsByHistogram = new Map();
|
|
122
|
+
this._boundsCapWarned = false;
|
|
123
|
+
}
|
|
124
|
+
_startWindow() {
|
|
125
|
+
this._series = new Map();
|
|
120
126
|
this._seriesCapWarned = false;
|
|
121
127
|
this._typeByName = new Map();
|
|
122
128
|
this._typeCollisionWarned = new Set();
|
|
129
|
+
this._boundsConflictWarned = new Set();
|
|
123
130
|
}
|
|
124
131
|
_capture(sample) {
|
|
125
132
|
if (this._instance.isDisabled || this._instance.optedOut) return;
|
|
@@ -127,6 +134,7 @@ class PostHogMetrics {
|
|
|
127
134
|
if (null === filtered) return;
|
|
128
135
|
if (!filtered.name || 'string' != typeof filtered.name) return void this._logger.warn('Dropping metric with empty name');
|
|
129
136
|
if ('number' != typeof filtered.value || !Number.isFinite(filtered.value)) return void this._logger.warn(`Dropping metric '${filtered.name}': value must be a finite number`);
|
|
137
|
+
if ('count' !== filtered.type && 'gauge' !== filtered.type && 'histogram' !== filtered.type) return void this._logger.warn(`Dropping metric '${filtered.name}': unknown type '${String(filtered.type)}'`);
|
|
130
138
|
if ('count' === filtered.type && filtered.value < 0) return void this._logger.warn(`Dropping count '${filtered.name}': counters are monotonic, value must be >= 0`);
|
|
131
139
|
let attributes;
|
|
132
140
|
let key;
|
|
@@ -140,14 +148,20 @@ class PostHogMetrics {
|
|
|
140
148
|
return;
|
|
141
149
|
}
|
|
142
150
|
let state = this._series.get(key);
|
|
151
|
+
if (!state && !this._admitNewSeries()) return;
|
|
152
|
+
let bounds;
|
|
153
|
+
if ('histogram' === filtered.type) {
|
|
154
|
+
bounds = this._histogramBounds(filtered.name, filtered.unit, filtered.bounds);
|
|
155
|
+
if (!bounds) return;
|
|
156
|
+
}
|
|
143
157
|
if (!state) {
|
|
144
|
-
if (!this._admitNewSeries()) return;
|
|
145
158
|
state = {
|
|
146
159
|
name: filtered.name,
|
|
147
160
|
type: filtered.type,
|
|
148
161
|
unit: filtered.unit,
|
|
149
162
|
attributes,
|
|
150
|
-
windowStartMs: Date.now()
|
|
163
|
+
windowStartMs: Date.now(),
|
|
164
|
+
hist: bounds && emptyHistogram(bounds)
|
|
151
165
|
};
|
|
152
166
|
this._series.set(key, state);
|
|
153
167
|
}
|
|
@@ -183,6 +197,31 @@ class PostHogMetrics {
|
|
|
183
197
|
}
|
|
184
198
|
return false;
|
|
185
199
|
}
|
|
200
|
+
_histogramBounds(name, unit, requested) {
|
|
201
|
+
if (void 0 !== requested && !isValidBounds(requested)) return void this._logger.warn(`Dropping histogram '${name}': bounds must be a non-empty array of finite, strictly increasing numbers`);
|
|
202
|
+
const histogramKey = (0, external_metrics_utils_js_namespaceObject.seriesKey)('histogram', name, unit, void 0);
|
|
203
|
+
const fixed = this._boundsByHistogram.get(histogramKey);
|
|
204
|
+
if (fixed) {
|
|
205
|
+
this._warnOnBoundsConflict(name, histogramKey, fixed, requested);
|
|
206
|
+
return fixed;
|
|
207
|
+
}
|
|
208
|
+
if (this._boundsByHistogram.size >= this._config.maxSeriesPerFlush) {
|
|
209
|
+
if (!this._boundsCapWarned) {
|
|
210
|
+
this._boundsCapWarned = true;
|
|
211
|
+
this._logger.warn(`Histogram bounds limit reached (${this._config.maxSeriesPerFlush} distinct histograms); new histograms that pass custom bounds are dropped. Reduce histogram name cardinality.`);
|
|
212
|
+
}
|
|
213
|
+
if (requested && !sameBounds(requested, external_metrics_utils_js_namespaceObject.DEFAULT_HISTOGRAM_BOUNDS)) return;
|
|
214
|
+
return external_metrics_utils_js_namespaceObject.DEFAULT_HISTOGRAM_BOUNDS;
|
|
215
|
+
}
|
|
216
|
+
const bounds = requested ? requested.slice() : external_metrics_utils_js_namespaceObject.DEFAULT_HISTOGRAM_BOUNDS;
|
|
217
|
+
this._boundsByHistogram.set(histogramKey, bounds);
|
|
218
|
+
return bounds;
|
|
219
|
+
}
|
|
220
|
+
_warnOnBoundsConflict(name, histogramKey, fixed, requested) {
|
|
221
|
+
if (sameBounds(fixed, requested ?? external_metrics_utils_js_namespaceObject.DEFAULT_HISTOGRAM_BOUNDS) || this._boundsConflictWarned.has(histogramKey)) return;
|
|
222
|
+
this._boundsConflictWarned.add(histogramKey);
|
|
223
|
+
this._logger.warn(`Histogram '${name}' already uses the bounds [${fixed.join(', ')}]; samples that pass different bounds are recorded in those buckets.`);
|
|
224
|
+
}
|
|
186
225
|
_fold(state, value) {
|
|
187
226
|
switch(state.type){
|
|
188
227
|
case 'count':
|
|
@@ -193,19 +232,12 @@ class PostHogMetrics {
|
|
|
193
232
|
break;
|
|
194
233
|
case 'histogram':
|
|
195
234
|
{
|
|
196
|
-
if (!state.hist) state.hist = {
|
|
197
|
-
count: 0,
|
|
198
|
-
sum: 0,
|
|
199
|
-
min: value,
|
|
200
|
-
max: value,
|
|
201
|
-
bucketCounts: new Array(external_metrics_utils_js_namespaceObject.DEFAULT_HISTOGRAM_BOUNDS.length + 1).fill(0)
|
|
202
|
-
};
|
|
203
235
|
const hist = state.hist;
|
|
204
236
|
hist.count += 1;
|
|
205
237
|
hist.sum += value;
|
|
206
238
|
hist.min = Math.min(hist.min, value);
|
|
207
239
|
hist.max = Math.max(hist.max, value);
|
|
208
|
-
hist.bucketCounts[(0, external_metrics_utils_js_namespaceObject.bucketIndexFor)(value,
|
|
240
|
+
hist.bucketCounts[(0, external_metrics_utils_js_namespaceObject.bucketIndexFor)(value, hist.bounds)] += 1;
|
|
209
241
|
break;
|
|
210
242
|
}
|
|
211
243
|
}
|
|
@@ -241,10 +273,7 @@ class PostHogMetrics {
|
|
|
241
273
|
this._flushTimer.clear();
|
|
242
274
|
if (0 === this._series.size) return;
|
|
243
275
|
const window = this._series;
|
|
244
|
-
this.
|
|
245
|
-
this._seriesCapWarned = false;
|
|
246
|
-
this._typeByName = new Map();
|
|
247
|
-
this._typeCollisionWarned = new Set();
|
|
276
|
+
this._startWindow();
|
|
248
277
|
const generation = this._generation;
|
|
249
278
|
const outcome = await this._instance._sendMetricsBatch(this._buildPayload(window));
|
|
250
279
|
if (generation !== this._generation) return;
|
|
@@ -322,17 +351,18 @@ class PostHogMetrics {
|
|
|
322
351
|
...exemplars
|
|
323
352
|
};
|
|
324
353
|
metric.gauge.dataPoints.push(dp);
|
|
325
|
-
} else
|
|
354
|
+
} else {
|
|
355
|
+
const hist = state.hist;
|
|
326
356
|
const dp = {
|
|
327
357
|
attributes,
|
|
328
358
|
startTimeUnixNano: startNano,
|
|
329
359
|
timeUnixNano: nowNano,
|
|
330
|
-
count:
|
|
331
|
-
sum:
|
|
332
|
-
min:
|
|
333
|
-
max:
|
|
334
|
-
bucketCounts:
|
|
335
|
-
explicitBounds:
|
|
360
|
+
count: hist.count,
|
|
361
|
+
sum: hist.sum,
|
|
362
|
+
min: hist.min,
|
|
363
|
+
max: hist.max,
|
|
364
|
+
bucketCounts: hist.bucketCounts,
|
|
365
|
+
explicitBounds: hist.bounds,
|
|
336
366
|
...exemplars
|
|
337
367
|
};
|
|
338
368
|
metric.histogram.dataPoints.push(dp);
|
|
@@ -356,18 +386,41 @@ class PostHogMetrics {
|
|
|
356
386
|
case 'gauge':
|
|
357
387
|
break;
|
|
358
388
|
case 'histogram':
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
389
|
+
{
|
|
390
|
+
const hist = current.hist;
|
|
391
|
+
const oldHist = old.hist;
|
|
392
|
+
hist.count += oldHist.count;
|
|
393
|
+
hist.sum += oldHist.sum;
|
|
394
|
+
hist.min = Math.min(hist.min, oldHist.min);
|
|
395
|
+
hist.max = Math.max(hist.max, oldHist.max);
|
|
396
|
+
for(let i = 0; i < hist.bucketCounts.length; i++)hist.bucketCounts[i] += oldHist.bucketCounts[i];
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
367
399
|
}
|
|
368
400
|
}
|
|
369
401
|
}
|
|
370
402
|
}
|
|
403
|
+
function isValidBounds(bounds) {
|
|
404
|
+
if (!(0, index_js_namespaceObject.isArray)(bounds) || 0 === bounds.length) return false;
|
|
405
|
+
for(let i = 0; i < bounds.length; i++)if (!Number.isFinite(bounds[i]) || i > 0 && bounds[i] <= bounds[i - 1]) return false;
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
function sameBounds(a, b) {
|
|
409
|
+
if (a === b) return true;
|
|
410
|
+
if (a.length !== b.length) return false;
|
|
411
|
+
for(let i = 0; i < a.length; i++)if (a[i] !== b[i]) return false;
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
function emptyHistogram(bounds) {
|
|
415
|
+
return {
|
|
416
|
+
bounds,
|
|
417
|
+
count: 0,
|
|
418
|
+
sum: 0,
|
|
419
|
+
min: 1 / 0,
|
|
420
|
+
max: -1 / 0,
|
|
421
|
+
bucketCounts: new Array(bounds.length + 1).fill(0)
|
|
422
|
+
};
|
|
423
|
+
}
|
|
371
424
|
function toOtlpExemplars(exemplar) {
|
|
372
425
|
if (!exemplar) return {};
|
|
373
426
|
return {
|
|
@@ -19,6 +19,9 @@ class PostHogMetrics {
|
|
|
19
19
|
this._seriesCapWarned = false;
|
|
20
20
|
this._typeByName = new Map();
|
|
21
21
|
this._typeCollisionWarned = new Set();
|
|
22
|
+
this._boundsByHistogram = new Map();
|
|
23
|
+
this._boundsConflictWarned = new Set();
|
|
24
|
+
this._boundsCapWarned = false;
|
|
22
25
|
this._retryAfter = new RetryAfterWindow();
|
|
23
26
|
this._consecutiveFlushFailures = 0;
|
|
24
27
|
this._flushJitter = NO_JITTER;
|
|
@@ -48,7 +51,8 @@ class PostHogMetrics {
|
|
|
48
51
|
type: 'histogram',
|
|
49
52
|
value,
|
|
50
53
|
unit: options?.unit,
|
|
51
|
-
attributes: options?.attributes
|
|
54
|
+
attributes: options?.attributes,
|
|
55
|
+
bounds: isArray(options?.bounds) ? options.bounds.slice() : options?.bounds
|
|
52
56
|
});
|
|
53
57
|
}
|
|
54
58
|
flush() {
|
|
@@ -66,10 +70,7 @@ class PostHogMetrics {
|
|
|
66
70
|
drainWindow() {
|
|
67
71
|
if (0 === this._series.size) return null;
|
|
68
72
|
const window = this._series;
|
|
69
|
-
this.
|
|
70
|
-
this._seriesCapWarned = false;
|
|
71
|
-
this._typeByName = new Map();
|
|
72
|
-
this._typeCollisionWarned = new Set();
|
|
73
|
+
this._startWindow();
|
|
73
74
|
return this._buildPayload(window);
|
|
74
75
|
}
|
|
75
76
|
reset() {
|
|
@@ -78,11 +79,17 @@ class PostHogMetrics {
|
|
|
78
79
|
this._consecutiveFlushFailures = 0;
|
|
79
80
|
this._flushJitter = NO_JITTER;
|
|
80
81
|
this._flushTimer.clear();
|
|
81
|
-
this._series = new Map();
|
|
82
82
|
this._flushPromise = null;
|
|
83
|
+
this._startWindow();
|
|
84
|
+
this._boundsByHistogram = new Map();
|
|
85
|
+
this._boundsCapWarned = false;
|
|
86
|
+
}
|
|
87
|
+
_startWindow() {
|
|
88
|
+
this._series = new Map();
|
|
83
89
|
this._seriesCapWarned = false;
|
|
84
90
|
this._typeByName = new Map();
|
|
85
91
|
this._typeCollisionWarned = new Set();
|
|
92
|
+
this._boundsConflictWarned = new Set();
|
|
86
93
|
}
|
|
87
94
|
_capture(sample) {
|
|
88
95
|
if (this._instance.isDisabled || this._instance.optedOut) return;
|
|
@@ -90,6 +97,7 @@ class PostHogMetrics {
|
|
|
90
97
|
if (null === filtered) return;
|
|
91
98
|
if (!filtered.name || 'string' != typeof filtered.name) return void this._logger.warn('Dropping metric with empty name');
|
|
92
99
|
if ('number' != typeof filtered.value || !Number.isFinite(filtered.value)) return void this._logger.warn(`Dropping metric '${filtered.name}': value must be a finite number`);
|
|
100
|
+
if ('count' !== filtered.type && 'gauge' !== filtered.type && 'histogram' !== filtered.type) return void this._logger.warn(`Dropping metric '${filtered.name}': unknown type '${String(filtered.type)}'`);
|
|
93
101
|
if ('count' === filtered.type && filtered.value < 0) return void this._logger.warn(`Dropping count '${filtered.name}': counters are monotonic, value must be >= 0`);
|
|
94
102
|
let attributes;
|
|
95
103
|
let key;
|
|
@@ -103,14 +111,20 @@ class PostHogMetrics {
|
|
|
103
111
|
return;
|
|
104
112
|
}
|
|
105
113
|
let state = this._series.get(key);
|
|
114
|
+
if (!state && !this._admitNewSeries()) return;
|
|
115
|
+
let bounds;
|
|
116
|
+
if ('histogram' === filtered.type) {
|
|
117
|
+
bounds = this._histogramBounds(filtered.name, filtered.unit, filtered.bounds);
|
|
118
|
+
if (!bounds) return;
|
|
119
|
+
}
|
|
106
120
|
if (!state) {
|
|
107
|
-
if (!this._admitNewSeries()) return;
|
|
108
121
|
state = {
|
|
109
122
|
name: filtered.name,
|
|
110
123
|
type: filtered.type,
|
|
111
124
|
unit: filtered.unit,
|
|
112
125
|
attributes,
|
|
113
|
-
windowStartMs: Date.now()
|
|
126
|
+
windowStartMs: Date.now(),
|
|
127
|
+
hist: bounds && emptyHistogram(bounds)
|
|
114
128
|
};
|
|
115
129
|
this._series.set(key, state);
|
|
116
130
|
}
|
|
@@ -146,6 +160,31 @@ class PostHogMetrics {
|
|
|
146
160
|
}
|
|
147
161
|
return false;
|
|
148
162
|
}
|
|
163
|
+
_histogramBounds(name, unit, requested) {
|
|
164
|
+
if (void 0 !== requested && !isValidBounds(requested)) return void this._logger.warn(`Dropping histogram '${name}': bounds must be a non-empty array of finite, strictly increasing numbers`);
|
|
165
|
+
const histogramKey = seriesKey('histogram', name, unit, void 0);
|
|
166
|
+
const fixed = this._boundsByHistogram.get(histogramKey);
|
|
167
|
+
if (fixed) {
|
|
168
|
+
this._warnOnBoundsConflict(name, histogramKey, fixed, requested);
|
|
169
|
+
return fixed;
|
|
170
|
+
}
|
|
171
|
+
if (this._boundsByHistogram.size >= this._config.maxSeriesPerFlush) {
|
|
172
|
+
if (!this._boundsCapWarned) {
|
|
173
|
+
this._boundsCapWarned = true;
|
|
174
|
+
this._logger.warn(`Histogram bounds limit reached (${this._config.maxSeriesPerFlush} distinct histograms); new histograms that pass custom bounds are dropped. Reduce histogram name cardinality.`);
|
|
175
|
+
}
|
|
176
|
+
if (requested && !sameBounds(requested, DEFAULT_HISTOGRAM_BOUNDS)) return;
|
|
177
|
+
return DEFAULT_HISTOGRAM_BOUNDS;
|
|
178
|
+
}
|
|
179
|
+
const bounds = requested ? requested.slice() : DEFAULT_HISTOGRAM_BOUNDS;
|
|
180
|
+
this._boundsByHistogram.set(histogramKey, bounds);
|
|
181
|
+
return bounds;
|
|
182
|
+
}
|
|
183
|
+
_warnOnBoundsConflict(name, histogramKey, fixed, requested) {
|
|
184
|
+
if (sameBounds(fixed, requested ?? DEFAULT_HISTOGRAM_BOUNDS) || this._boundsConflictWarned.has(histogramKey)) return;
|
|
185
|
+
this._boundsConflictWarned.add(histogramKey);
|
|
186
|
+
this._logger.warn(`Histogram '${name}' already uses the bounds [${fixed.join(', ')}]; samples that pass different bounds are recorded in those buckets.`);
|
|
187
|
+
}
|
|
149
188
|
_fold(state, value) {
|
|
150
189
|
switch(state.type){
|
|
151
190
|
case 'count':
|
|
@@ -156,19 +195,12 @@ class PostHogMetrics {
|
|
|
156
195
|
break;
|
|
157
196
|
case 'histogram':
|
|
158
197
|
{
|
|
159
|
-
if (!state.hist) state.hist = {
|
|
160
|
-
count: 0,
|
|
161
|
-
sum: 0,
|
|
162
|
-
min: value,
|
|
163
|
-
max: value,
|
|
164
|
-
bucketCounts: new Array(DEFAULT_HISTOGRAM_BOUNDS.length + 1).fill(0)
|
|
165
|
-
};
|
|
166
198
|
const hist = state.hist;
|
|
167
199
|
hist.count += 1;
|
|
168
200
|
hist.sum += value;
|
|
169
201
|
hist.min = Math.min(hist.min, value);
|
|
170
202
|
hist.max = Math.max(hist.max, value);
|
|
171
|
-
hist.bucketCounts[bucketIndexFor(value,
|
|
203
|
+
hist.bucketCounts[bucketIndexFor(value, hist.bounds)] += 1;
|
|
172
204
|
break;
|
|
173
205
|
}
|
|
174
206
|
}
|
|
@@ -204,10 +236,7 @@ class PostHogMetrics {
|
|
|
204
236
|
this._flushTimer.clear();
|
|
205
237
|
if (0 === this._series.size) return;
|
|
206
238
|
const window = this._series;
|
|
207
|
-
this.
|
|
208
|
-
this._seriesCapWarned = false;
|
|
209
|
-
this._typeByName = new Map();
|
|
210
|
-
this._typeCollisionWarned = new Set();
|
|
239
|
+
this._startWindow();
|
|
211
240
|
const generation = this._generation;
|
|
212
241
|
const outcome = await this._instance._sendMetricsBatch(this._buildPayload(window));
|
|
213
242
|
if (generation !== this._generation) return;
|
|
@@ -285,17 +314,18 @@ class PostHogMetrics {
|
|
|
285
314
|
...exemplars
|
|
286
315
|
};
|
|
287
316
|
metric.gauge.dataPoints.push(dp);
|
|
288
|
-
} else
|
|
317
|
+
} else {
|
|
318
|
+
const hist = state.hist;
|
|
289
319
|
const dp = {
|
|
290
320
|
attributes,
|
|
291
321
|
startTimeUnixNano: startNano,
|
|
292
322
|
timeUnixNano: nowNano,
|
|
293
|
-
count:
|
|
294
|
-
sum:
|
|
295
|
-
min:
|
|
296
|
-
max:
|
|
297
|
-
bucketCounts:
|
|
298
|
-
explicitBounds:
|
|
323
|
+
count: hist.count,
|
|
324
|
+
sum: hist.sum,
|
|
325
|
+
min: hist.min,
|
|
326
|
+
max: hist.max,
|
|
327
|
+
bucketCounts: hist.bucketCounts,
|
|
328
|
+
explicitBounds: hist.bounds,
|
|
299
329
|
...exemplars
|
|
300
330
|
};
|
|
301
331
|
metric.histogram.dataPoints.push(dp);
|
|
@@ -319,18 +349,41 @@ class PostHogMetrics {
|
|
|
319
349
|
case 'gauge':
|
|
320
350
|
break;
|
|
321
351
|
case 'histogram':
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
352
|
+
{
|
|
353
|
+
const hist = current.hist;
|
|
354
|
+
const oldHist = old.hist;
|
|
355
|
+
hist.count += oldHist.count;
|
|
356
|
+
hist.sum += oldHist.sum;
|
|
357
|
+
hist.min = Math.min(hist.min, oldHist.min);
|
|
358
|
+
hist.max = Math.max(hist.max, oldHist.max);
|
|
359
|
+
for(let i = 0; i < hist.bucketCounts.length; i++)hist.bucketCounts[i] += oldHist.bucketCounts[i];
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
330
362
|
}
|
|
331
363
|
}
|
|
332
364
|
}
|
|
333
365
|
}
|
|
366
|
+
function isValidBounds(bounds) {
|
|
367
|
+
if (!isArray(bounds) || 0 === bounds.length) return false;
|
|
368
|
+
for(let i = 0; i < bounds.length; i++)if (!Number.isFinite(bounds[i]) || i > 0 && bounds[i] <= bounds[i - 1]) return false;
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
function sameBounds(a, b) {
|
|
372
|
+
if (a === b) return true;
|
|
373
|
+
if (a.length !== b.length) return false;
|
|
374
|
+
for(let i = 0; i < a.length; i++)if (a[i] !== b[i]) return false;
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
function emptyHistogram(bounds) {
|
|
378
|
+
return {
|
|
379
|
+
bounds,
|
|
380
|
+
count: 0,
|
|
381
|
+
sum: 0,
|
|
382
|
+
min: 1 / 0,
|
|
383
|
+
max: -1 / 0,
|
|
384
|
+
bucketCounts: new Array(bounds.length + 1).fill(0)
|
|
385
|
+
};
|
|
386
|
+
}
|
|
334
387
|
function toOtlpExemplars(exemplar) {
|
|
335
388
|
if (!exemplar) return {};
|
|
336
389
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { MetricAttributeValue, MetricAttributes, MetricType, MetricsConfig, CaptureMetricOptions, MetricSample, BeforeSendMetricFn, Metrics, OtlpNumberDataPoint, OtlpHistogramDataPoint, OtlpMetric, OtlpMetricsPayload, OtlpExemplar, } from '@posthog/types';
|
|
1
|
+
export type { MetricAttributeValue, MetricAttributes, MetricType, MetricsConfig, CaptureMetricOptions, HistogramOptions, MetricSample, BeforeSendMetricFn, Metrics, OtlpNumberDataPoint, OtlpHistogramDataPoint, OtlpMetric, OtlpMetricsPayload, OtlpExemplar, } from '@posthog/types';
|
|
2
2
|
import type { BeforeSendMetricFn, MetricAttributeValue, OtlpMetricsPayload, Span } from '@posthog/types';
|
|
3
3
|
/** Same tagged outcome shape as `SendLogsBatchOutcome` — one policy for both signals. */
|
|
4
4
|
export type SendMetricsBatchOutcome = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/metrics/types.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,YAAY,GACb,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAExG,yFAAyF;AACzF,MAAM,MAAM,uBAAuB,GAC/B;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9D;IACE,IAAI,EAAE,WAAW,CAAA;IACjB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAA;AAErC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;IAChF,YAAY,IAAI,MAAM,CAAA;IACtB,iBAAiB,IAAI,MAAM,CAAA;IAC3B;;;OAGG;IACH,aAAa,CAAC,IAAI,IAAI,GAAG,IAAI,CAAA;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IAEzD;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAA;CACvD;AAID,MAAM,WAAW,4BAA6B,SAAQ,oBAAoB;IACxE,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;CAC1B"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/metrics/types.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,YAAY,GACb,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAExG,yFAAyF;AACzF,MAAM,MAAM,uBAAuB,GAC/B;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9D;IACE,IAAI,EAAE,WAAW,CAAA;IACjB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAA;AAErC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;IAChF,YAAY,IAAI,MAAM,CAAA;IACtB,iBAAiB,IAAI,MAAM,CAAA;IAC3B;;;OAGG;IACH,aAAa,CAAC,IAAI,IAAI,GAAG,IAAI,CAAA;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IAEzD;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAA;CACvD;AAID,MAAM,WAAW,4BAA6B,SAAQ,oBAAoB;IACxE,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;CAC1B"}
|
|
@@ -39,10 +39,10 @@ const POSTHOG_TOKEN_PATTERN = /\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g;
|
|
|
39
39
|
const SENSITIVE_KEY_PATTERN = /^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i;
|
|
40
40
|
const URL_PATTERN = /[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi;
|
|
41
41
|
const URL_END_PATTERN = /[\s<>"]/;
|
|
42
|
-
const URL_PATTERN_ONCE = new RegExp(URL_PATTERN.source, 'i');
|
|
42
|
+
const URL_PATTERN_ONCE = /* @__PURE__ */ (()=>new RegExp(URL_PATTERN.source, 'i'))();
|
|
43
43
|
const URL_AUTHORITY_SEARCH = /[a-z][a-z0-9+.-]{0,63}:\/\//i;
|
|
44
|
-
const URL_AUTHORITY_PATTERN = new RegExp(`^${URL_AUTHORITY_SEARCH.source}`, 'i');
|
|
45
|
-
const URL_AUTHORITY_SEARCH_ALL = new RegExp(URL_AUTHORITY_SEARCH.source, 'gi');
|
|
44
|
+
const URL_AUTHORITY_PATTERN = /* @__PURE__ */ (()=>new RegExp(`^${URL_AUTHORITY_SEARCH.source}`, 'i'))();
|
|
45
|
+
const URL_AUTHORITY_SEARCH_ALL = /* @__PURE__ */ (()=>new RegExp(URL_AUTHORITY_SEARCH.source, 'gi'))();
|
|
46
46
|
const URL_FIELD_CHARACTERS = '=&';
|
|
47
47
|
const LEGACY_FIELD_SEPARATOR = ';';
|
|
48
48
|
const URL_TRAILING_PUNCTUATION = ".,;:!?)]}'";
|
|
@@ -10,10 +10,10 @@ const POSTHOG_TOKEN_PATTERN = /\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g;
|
|
|
10
10
|
const SENSITIVE_KEY_PATTERN = /^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i;
|
|
11
11
|
const URL_PATTERN = /[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi;
|
|
12
12
|
const URL_END_PATTERN = /[\s<>"]/;
|
|
13
|
-
const URL_PATTERN_ONCE = new RegExp(URL_PATTERN.source, 'i');
|
|
13
|
+
const URL_PATTERN_ONCE = /* @__PURE__ */ (()=>new RegExp(URL_PATTERN.source, 'i'))();
|
|
14
14
|
const URL_AUTHORITY_SEARCH = /[a-z][a-z0-9+.-]{0,63}:\/\//i;
|
|
15
|
-
const URL_AUTHORITY_PATTERN = new RegExp(`^${URL_AUTHORITY_SEARCH.source}`, 'i');
|
|
16
|
-
const URL_AUTHORITY_SEARCH_ALL = new RegExp(URL_AUTHORITY_SEARCH.source, 'gi');
|
|
15
|
+
const URL_AUTHORITY_PATTERN = /* @__PURE__ */ (()=>new RegExp(`^${URL_AUTHORITY_SEARCH.source}`, 'i'))();
|
|
16
|
+
const URL_AUTHORITY_SEARCH_ALL = /* @__PURE__ */ (()=>new RegExp(URL_AUTHORITY_SEARCH.source, 'gi'))();
|
|
17
17
|
const URL_FIELD_CHARACTERS = '=&';
|
|
18
18
|
const LEGACY_FIELD_SEPARATOR = ';';
|
|
19
19
|
const URL_TRAILING_PUNCTUATION = ".,;:!?)]}'";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-agent-utils.d.ts","sourceRoot":"","sources":["../../src/utils/user-agent-utils.ts"],"names":[],"mappings":"AAsEA;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAGpC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AASD;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IAGtC,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAgCD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,eACZ,MAAM,UACV,MAAM,GAAG,SAAS,UAClB,qBAAqB,YACnB,uBAAuB,KAChC,MAkGF,CAAA;
|
|
1
|
+
{"version":3,"file":"user-agent-utils.d.ts","sourceRoot":"","sources":["../../src/utils/user-agent-utils.ts"],"names":[],"mappings":"AAsEA;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAGpC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AASD;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IAGtC,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAgCD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,eACZ,MAAM,UACV,MAAM,GAAG,SAAS,UAClB,qBAAqB,YACnB,uBAAuB,KAChC,MAkGF,CAAA;AAyCD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,UACT,MAAM,GAAG,SAAS,UAClB,qBAAqB,YACnB,uBAAuB,KAChC,MAAM,GAAG,IAmBX,CAAA;AA0FD,eAAO,MAAM,QAAQ,eAAyB,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAUrE,CAAA;AAED,eAAO,MAAM,YAAY,eAAyB,MAAM,KAAG,MAuD1D,CAAA;AAED,eAAO,MAAM,gBAAgB,eACf,MAAM,YACR;IACR,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,KACA,MA4BF,CAAA"}
|