dd-trace 6.20.1 → 6.22.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 (225) hide show
  1. package/ci/diagnose.js +9 -14
  2. package/ci/init.js +1 -2
  3. package/ci/test-optimization-validation/ci-discovery.js +9 -4
  4. package/ci/test-optimization-validation/executable.js +1 -5
  5. package/ci/test-optimization-validation/framework-adapters/cypress.js +1 -4
  6. package/ci/test-optimization-validation/framework-adapters/vitest.js +1 -1
  7. package/ci/test-optimization-validation/generated-files.js +6 -4
  8. package/ci/test-optimization-validation/generated-test-contract.js +7 -3
  9. package/ci/test-optimization-validation/manifest-scaffold.js +7 -2
  10. package/ci/test-optimization-validation/manifest-schema.js +6 -7
  11. package/ci/test-optimization-validation/report-writer.js +6 -2
  12. package/ci/test-optimization-validation/runner-command.js +2 -4
  13. package/ci/test-optimization-validation/runner-contract.js +1 -2
  14. package/ci/test-optimization-validation/scenarios/auto-test-retries.js +1 -15
  15. package/ci/vitest-no-worker-init-setup.mjs +10 -7
  16. package/index.d.ts +116 -17
  17. package/initialize.mjs +1 -3
  18. package/openfeature/rules-based.d.ts +11 -0
  19. package/openfeature/rules-based.js +7 -0
  20. package/package.json +13 -11
  21. package/packages/datadog-core/src/storage.js +16 -0
  22. package/packages/datadog-esbuild/index.js +18 -12
  23. package/packages/datadog-instrumentations/src/aerospike.js +3 -3
  24. package/packages/datadog-instrumentations/src/ai.js +3 -3
  25. package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -6
  26. package/packages/datadog-instrumentations/src/aws-sdk.js +21 -13
  27. package/packages/datadog-instrumentations/src/cassandra-driver.js +25 -20
  28. package/packages/datadog-instrumentations/src/claude-agent-sdk.js +9 -23
  29. package/packages/datadog-instrumentations/src/cucumber.js +48 -33
  30. package/packages/datadog-instrumentations/src/elasticsearch.js +1 -5
  31. package/packages/datadog-instrumentations/src/electron.js +6 -6
  32. package/packages/datadog-instrumentations/src/fastify.js +13 -4
  33. package/packages/datadog-instrumentations/src/fs.js +2 -2
  34. package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +9 -5
  35. package/packages/datadog-instrumentations/src/grpc/client.js +2 -0
  36. package/packages/datadog-instrumentations/src/helpers/bundler-register.js +2 -2
  37. package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +1 -2
  38. package/packages/datadog-instrumentations/src/helpers/instrument.js +1 -1
  39. package/packages/datadog-instrumentations/src/helpers/register.js +36 -1
  40. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +2 -0
  41. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +87 -6
  42. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql-jit.js +5 -6
  43. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +48 -31
  44. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +64 -11
  45. package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +1 -0
  46. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +42 -4
  47. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +7 -10
  48. package/packages/datadog-instrumentations/src/ioredis.js +7 -5
  49. package/packages/datadog-instrumentations/src/iovalkey.js +7 -5
  50. package/packages/datadog-instrumentations/src/jest.js +122 -11
  51. package/packages/datadog-instrumentations/src/knex.js +9 -5
  52. package/packages/datadog-instrumentations/src/mariadb-bundle.js +3 -3
  53. package/packages/datadog-instrumentations/src/mocha/common.js +20 -8
  54. package/packages/datadog-instrumentations/src/mocha/main.js +140 -43
  55. package/packages/datadog-instrumentations/src/mocha/utils.js +127 -38
  56. package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +61 -34
  57. package/packages/datadog-instrumentations/src/mocha/worker.js +7 -5
  58. package/packages/datadog-instrumentations/src/mongodb-core.js +3 -3
  59. package/packages/datadog-instrumentations/src/mongoose.js +3 -3
  60. package/packages/datadog-instrumentations/src/nova-sonic/audio.js +173 -0
  61. package/packages/datadog-instrumentations/src/nova-sonic/index.js +209 -0
  62. package/packages/datadog-instrumentations/src/nova-sonic/session.js +483 -0
  63. package/packages/datadog-instrumentations/src/openai-realtime/index.js +18 -6
  64. package/packages/datadog-instrumentations/src/openai-realtime/session.js +1 -1
  65. package/packages/datadog-instrumentations/src/openai.js +7 -0
  66. package/packages/datadog-instrumentations/src/pino.js +5 -6
  67. package/packages/datadog-instrumentations/src/playwright.js +3 -0
  68. package/packages/datadog-instrumentations/src/redis.js +27 -13
  69. package/packages/datadog-instrumentations/src/router.js +30 -0
  70. package/packages/datadog-instrumentations/src/rum-browser-scripts.js +2 -6
  71. package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +7 -5
  72. package/packages/datadog-instrumentations/src/vitest-main.js +9 -17
  73. package/packages/datadog-instrumentations/src/vitest-util.js +2 -2
  74. package/packages/datadog-instrumentations/src/vitest-worker.js +1 -2
  75. package/packages/datadog-instrumentations/src/vitest.js +2 -2
  76. package/packages/datadog-instrumentations/src/webdriverio.js +118 -21
  77. package/packages/datadog-instrumentations/src/ws.js +1 -4
  78. package/packages/datadog-plugin-amqplib/src/client.js +1 -2
  79. package/packages/datadog-plugin-avsc/src/schema_iterator.js +1 -5
  80. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/handler.js +1 -2
  81. package/packages/datadog-plugin-aws-sdk/src/base.js +5 -8
  82. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/index.js +18 -0
  83. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/sonic.js +45 -0
  84. package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +9 -3
  85. package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +2 -5
  86. package/packages/datadog-plugin-azure-durable-functions/src/index.js +5 -4
  87. package/packages/datadog-plugin-azure-functions/src/index.js +5 -3
  88. package/packages/datadog-plugin-claude-agent-sdk/src/index.js +0 -2
  89. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +18 -5
  90. package/packages/datadog-plugin-cypress/src/index.js +6 -6
  91. package/packages/datadog-plugin-cypress/src/source-map-utils.js +1 -2
  92. package/packages/datadog-plugin-cypress/src/support.js +1 -4
  93. package/packages/datadog-plugin-express/src/code_origin.js +1 -2
  94. package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +2 -2
  95. package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +1 -2
  96. package/packages/datadog-plugin-graphql/src/execute.js +5 -5
  97. package/packages/datadog-plugin-grpc/src/util.js +1 -2
  98. package/packages/datadog-plugin-kafkajs/src/producer.js +1 -2
  99. package/packages/datadog-plugin-mocha/src/index.js +223 -39
  100. package/packages/datadog-plugin-mocha/src/webdriverio-video.js +453 -0
  101. package/packages/datadog-plugin-mongodb-core/src/query.js +8 -5
  102. package/packages/datadog-plugin-next/src/index.js +1 -2
  103. package/packages/datadog-plugin-openai/src/tracing.js +5 -2
  104. package/packages/datadog-plugin-openai-agents/src/integration.js +6 -2
  105. package/packages/datadog-plugin-openai-agents/src/processor.js +2 -4
  106. package/packages/datadog-plugin-postgres/src/index.js +24 -0
  107. package/packages/datadog-plugin-protobufjs/src/schema_iterator.js +1 -5
  108. package/packages/datadog-plugin-rhea/src/consumer.js +1 -4
  109. package/packages/datadog-plugin-vitest/src/index.js +5 -2
  110. package/packages/datadog-shimmer/src/shimmer.js +5 -4
  111. package/packages/datadog-webpack/index.js +55 -43
  112. package/packages/datadog-webpack/src/loader.js +56 -8
  113. package/packages/dd-trace/src/aiguard/integrations/vercel-ai.js +2 -4
  114. package/packages/dd-trace/src/aiguard/messages/utils.js +1 -2
  115. package/packages/dd-trace/src/aiguard/redaction.js +8 -2
  116. package/packages/dd-trace/src/appsec/api_security/normalized-route.js +3 -2
  117. package/packages/dd-trace/src/appsec/api_security/sampler.js +2 -6
  118. package/packages/dd-trace/src/appsec/downstream_requests.js +1 -9
  119. package/packages/dd-trace/src/appsec/handlers/http-request.js +3 -9
  120. package/packages/dd-trace/src/appsec/handlers/http-response.js +7 -2
  121. package/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js +4 -3
  122. package/packages/dd-trace/src/appsec/iast/analyzers/set-cookies-header-interceptor.js +1 -4
  123. package/packages/dd-trace/src/appsec/iast/taint-tracking/operations-taint-object.js +7 -1
  124. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -3
  125. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-esm.mjs +1 -3
  126. package/packages/dd-trace/src/appsec/iast/telemetry/iast-metric.js +1 -6
  127. package/packages/dd-trace/src/appsec/lambda.js +1 -3
  128. package/packages/dd-trace/src/appsec/rasp/fs-plugin.js +37 -27
  129. package/packages/dd-trace/src/appsec/rasp/lfi.js +9 -5
  130. package/packages/dd-trace/src/appsec/reporter.js +21 -1
  131. package/packages/dd-trace/src/appsec/stack_trace.js +1 -2
  132. package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +3 -6
  133. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +1 -1
  134. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +13 -7
  135. package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +1 -2
  136. package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +2 -8
  137. package/packages/dd-trace/src/ci-visibility/resolve-runfile-path.js +54 -0
  138. package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache-schema.js +5 -8
  139. package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache.js +2 -53
  140. package/packages/dd-trace/src/config/config-types.d.ts +2 -2
  141. package/packages/dd-trace/src/config/defaults.js +5 -5
  142. package/packages/dd-trace/src/config/generated-config-types.d.ts +8 -0
  143. package/packages/dd-trace/src/config/helper.js +34 -3
  144. package/packages/dd-trace/src/config/index.js +10 -9
  145. package/packages/dd-trace/src/config/normalize-service.js +1 -1
  146. package/packages/dd-trace/src/config/parsers.js +2 -2
  147. package/packages/dd-trace/src/config/supported-configurations.json +35 -0
  148. package/packages/dd-trace/src/datastreams/processor.js +3 -2
  149. package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +1 -4
  150. package/packages/dd-trace/src/debugger/constants.js +1 -0
  151. package/packages/dd-trace/src/debugger/devtools_client/index.js +5 -3
  152. package/packages/dd-trace/src/debugger/devtools_client/remote_config.js +17 -12
  153. package/packages/dd-trace/src/debugger/devtools_client/send.js +7 -2
  154. package/packages/dd-trace/src/debugger/devtools_client/status.js +1 -0
  155. package/packages/dd-trace/src/debugger/devtools_client/worker-error.js +21 -0
  156. package/packages/dd-trace/src/debugger/guardrail-metrics.js +2 -2
  157. package/packages/dd-trace/src/debugger/index.js +24 -2
  158. package/packages/dd-trace/src/debugger/probe_sampler.js +108 -11
  159. package/packages/dd-trace/src/dogstatsd.js +1 -1
  160. package/packages/dd-trace/src/encode/tags-processors.js +2 -2
  161. package/packages/dd-trace/src/exporters/common/request.js +2 -5
  162. package/packages/dd-trace/src/exporters/common/url.js +1 -1
  163. package/packages/dd-trace/src/id.js +15 -5
  164. package/packages/dd-trace/src/lambda/handler.js +179 -19
  165. package/packages/dd-trace/src/lambda/index.js +15 -1
  166. package/packages/dd-trace/src/lambda/runtime/patch.js +34 -7
  167. package/packages/dd-trace/src/llmobs/agent-manifest.js +296 -0
  168. package/packages/dd-trace/src/llmobs/audio-utils.js +3 -2
  169. package/packages/dd-trace/src/llmobs/constants/tags.js +13 -0
  170. package/packages/dd-trace/src/llmobs/experiments/experiment.js +1 -1
  171. package/packages/dd-trace/src/llmobs/plugins/anthropic/index.js +15 -0
  172. package/packages/dd-trace/src/llmobs/plugins/genai/util.js +1 -2
  173. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +1 -3
  174. package/packages/dd-trace/src/llmobs/plugins/langgraph/index.js +1 -1
  175. package/packages/dd-trace/src/llmobs/plugins/nova-sonic.js +92 -0
  176. package/packages/dd-trace/src/llmobs/plugins/openai/index.js +56 -2
  177. package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +38 -0
  178. package/packages/dd-trace/src/llmobs/prompts/manager.js +5 -7
  179. package/packages/dd-trace/src/llmobs/prompts/prompt.js +1 -1
  180. package/packages/dd-trace/src/llmobs/sdk.js +23 -6
  181. package/packages/dd-trace/src/llmobs/span_processor.js +18 -8
  182. package/packages/dd-trace/src/llmobs/tagger.js +56 -3
  183. package/packages/dd-trace/src/llmobs/util.js +1 -2
  184. package/packages/dd-trace/src/llmobs/writers/base.js +7 -6
  185. package/packages/dd-trace/src/llmobs/writers/util.js +3 -1
  186. package/packages/dd-trace/src/log/log.js +1 -5
  187. package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +30 -1
  188. package/packages/dd-trace/src/openfeature/configuration_source.js +17 -2
  189. package/packages/dd-trace/src/openfeature/debug-logging-hook.js +25 -0
  190. package/packages/dd-trace/src/openfeature/evaluation-telemetry-opt-out-hook.js +51 -0
  191. package/packages/dd-trace/src/openfeature/flagging_provider.js +59 -3
  192. package/packages/dd-trace/src/openfeature/remote_config.js +9 -0
  193. package/packages/dd-trace/src/openfeature/writers/util.js +43 -4
  194. package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +1 -1
  195. package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +1 -1
  196. package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -2
  197. package/packages/dd-trace/src/opentelemetry/otlp/common.proto +1 -1
  198. package/packages/dd-trace/src/opentelemetry/resource-attributes.js +1 -1
  199. package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +6 -23
  200. package/packages/dd-trace/src/opentracing/propagation/text_map.js +53 -13
  201. package/packages/dd-trace/src/otel-sampling.js +4 -5
  202. package/packages/dd-trace/src/otel-thread-ctx.js +81 -15
  203. package/packages/dd-trace/src/plugins/database.js +7 -16
  204. package/packages/dd-trace/src/plugins/util/git.js +9 -25
  205. package/packages/dd-trace/src/plugins/util/inferred_proxy.js +1 -5
  206. package/packages/dd-trace/src/plugins/util/test.js +48 -4
  207. package/packages/dd-trace/src/priority_sampler.js +1 -2
  208. package/packages/dd-trace/src/profiling/profiler.js +4 -6
  209. package/packages/dd-trace/src/profiling/profilers/wall.js +4 -10
  210. package/packages/dd-trace/src/proxy.js +3 -2
  211. package/packages/dd-trace/src/ritm.js +4 -2
  212. package/packages/dd-trace/src/serverless.js +10 -0
  213. package/packages/dd-trace/src/span_processor.js +13 -17
  214. package/packages/dd-trace/src/storage-channels.js +112 -46
  215. package/packages/dd-trace/src/telemetry/endpoints.js +1 -3
  216. package/packages/dd-trace/src/util.js +29 -0
  217. package/packages/dd-trace/src/web-tags-cache.js +6 -2
  218. package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
  219. package/vendor/dist/@datadog/openfeature-node-server/rules-based/LICENSE +201 -0
  220. package/vendor/dist/@datadog/openfeature-node-server/rules-based/index.d.ts +925 -0
  221. package/vendor/dist/@datadog/openfeature-node-server/rules-based/index.js +1 -0
  222. package/vendor/dist/@datadog/sketches-js/index.js +1 -1
  223. package/vendor/dist/protobufjs/index.js +1 -1
  224. package/vendor/dist/protobufjs/minimal/index.js +1 -1
  225. package/vendor/dist/shell-quote/index.js +1 -1
@@ -0,0 +1,925 @@
1
+ type PrimitiveValue = null | boolean | string | number;
2
+ type JsonObject = {
3
+ [key: string]: JsonValue;
4
+ };
5
+ type JsonArray = JsonValue[];
6
+ type JsonValue = PrimitiveValue | JsonObject | JsonArray;
7
+ type EvaluationContextValue = PrimitiveValue | Date | {
8
+ [key: string]: EvaluationContextValue;
9
+ } | EvaluationContextValue[];
10
+ type EvaluationContext = {
11
+ /**
12
+ * A string uniquely identifying the subject (end-user, or client service) of a flag evaluation.
13
+ * Providers may require this field for fractional flag evaluation, rules, or overrides targeting specific users.
14
+ * Such providers may behave unpredictably if a targeting key is not specified at flag resolution.
15
+ */
16
+ targetingKey?: string;
17
+ } & Record<string, EvaluationContextValue>;
18
+ type FlagValueType = "boolean" | "string" | "number" | "object";
19
+ type FlagValue = boolean | string | number | JsonValue;
20
+ type ResolutionReason = keyof typeof StandardResolutionReasons | (string & Record<never, never>);
21
+ declare const StandardResolutionReasons: {
22
+ /**
23
+ * The resolved value is static (no dynamic evaluation).
24
+ */
25
+ readonly STATIC: "STATIC";
26
+ /**
27
+ * The resolved value was configured statically, or otherwise fell back to a pre-configured value.
28
+ */
29
+ readonly DEFAULT: "DEFAULT";
30
+ /**
31
+ * The resolved value was the result of a dynamic evaluation, such as a rule or specific user-targeting.
32
+ */
33
+ readonly TARGETING_MATCH: "TARGETING_MATCH";
34
+ /**
35
+ * The resolved value was the result of pseudorandom assignment.
36
+ */
37
+ readonly SPLIT: "SPLIT";
38
+ /**
39
+ * The resolved value was retrieved from cache.
40
+ */
41
+ readonly CACHED: "CACHED";
42
+ /**
43
+ * The resolved value was the result of the flag being disabled in the management system.
44
+ */
45
+ readonly DISABLED: "DISABLED";
46
+ /**
47
+ * The reason for the resolved value could not be determined.
48
+ */
49
+ readonly UNKNOWN: "UNKNOWN";
50
+ /**
51
+ * The resolved value is non-authoritative or possibly out of date.
52
+ */
53
+ readonly STALE: "STALE";
54
+ /**
55
+ * The resolved value was the result of an error.
56
+ *
57
+ * Note: The `errorCode` and `errorMessage` fields may contain additional details of this error.
58
+ */
59
+ readonly ERROR: "ERROR";
60
+ };
61
+ type TimeStamp = number & {
62
+ t: "Epoch time";
63
+ };
64
+ declare const SCHEME = "flag-key-sha256-v1";
65
+ type FlagKeyObfuscation = {
66
+ scheme: typeof SCHEME;
67
+ salt: string;
68
+ };
69
+ declare enum WireType {
70
+ /**
71
+ * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum
72
+ */
73
+ Varint = 0,
74
+ /**
75
+ * Used for fixed64, sfixed64, double.
76
+ * Always 8 bytes with little-endian byte order.
77
+ */
78
+ Bit64 = 1,
79
+ /**
80
+ * Used for string, bytes, embedded messages, packed repeated fields
81
+ *
82
+ * Only repeated numeric types (types which use the varint, 32-bit,
83
+ * or 64-bit wire types) can be packed. In proto3, such fields are
84
+ * packed by default.
85
+ */
86
+ LengthDelimited = 2,
87
+ /**
88
+ * Start of a tag-delimited aggregate, such as a proto2 group, or a message
89
+ * in editions with message_encoding = DELIMITED.
90
+ */
91
+ StartGroup = 3,
92
+ /**
93
+ * End of a tag-delimited aggregate.
94
+ */
95
+ EndGroup = 4,
96
+ /**
97
+ * Used for fixed32, sfixed32, float.
98
+ * Always 4 bytes with little-endian byte order.
99
+ */
100
+ Bit32 = 5
101
+ }
102
+ type Message<TypeName extends string = string> = {
103
+ /**
104
+ * The fully qualified Protobuf type-name of the message.
105
+ */
106
+ readonly $typeName: TypeName;
107
+ /**
108
+ * Unknown fields and extensions stored on the message.
109
+ */
110
+ $unknown?: UnknownField[] | undefined;
111
+ };
112
+ type UnknownField = {
113
+ readonly no: number;
114
+ readonly wireType: WireType;
115
+ readonly data: Uint8Array;
116
+ };
117
+ type Timestamp = Message<"google.protobuf.Timestamp"> & {
118
+ /**
119
+ * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
120
+ * be between -62135596800 and 253402300799 inclusive (which corresponds to
121
+ * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
122
+ *
123
+ * @generated from field: int64 seconds = 1;
124
+ */
125
+ seconds: bigint;
126
+ /**
127
+ * Non-negative fractions of a second at nanosecond resolution. This field is
128
+ * the nanosecond portion of the duration, not an alternative to seconds.
129
+ * Negative second values with fractions must still have non-negative nanos
130
+ * values that count forward in time. Must be between 0 and 999,999,999
131
+ * inclusive.
132
+ *
133
+ * @generated from field: int32 nanos = 2;
134
+ */
135
+ nanos: number;
136
+ };
137
+ type Empty = Message<"google.protobuf.Empty"> & {};
138
+ type FlagsConfiguration = Message<"datadog.ffe.flagging.ufc.v1.FlagsConfiguration"> & {
139
+ /**
140
+ * @generated from field: google.protobuf.Timestamp created_at = 1;
141
+ */
142
+ createdAt?: Timestamp | undefined;
143
+ /**
144
+ * @generated from field: string environment_name = 2;
145
+ */
146
+ environmentName: string;
147
+ /**
148
+ * @generated from field: map<string, datadog.ffe.flagging.ufc.v1.Flag> flags = 3;
149
+ */
150
+ flags: {
151
+ [key: string]: Flag;
152
+ };
153
+ /**
154
+ * Interned data referenced by zero-based indexes in conditions. An index must
155
+ * refer to an element in its corresponding list.
156
+ *
157
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.AttributeReference attributes = 4;
158
+ */
159
+ attributes: AttributeReference[];
160
+ /**
161
+ * @generated from field: repeated string strings = 5;
162
+ */
163
+ strings: string[];
164
+ /**
165
+ * @generated from field: repeated string regexes = 6;
166
+ */
167
+ regexes: string[];
168
+ /**
169
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.Version versions = 7;
170
+ */
171
+ versions: Version[];
172
+ /**
173
+ * Interned JSON variation values, each a serialized JSON document. Indexed
174
+ * by Variation.json_string_index.
175
+ *
176
+ * JSON values are stored as strings because for some SDKs, our
177
+ * users want to override the JSON parser or get the variant as a
178
+ * string they can parse on their own.
179
+ *
180
+ * @generated from field: repeated string json_strings = 8;
181
+ */
182
+ jsonStrings: string[];
183
+ /**
184
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.Condition conditions = 9;
185
+ */
186
+ conditions: Condition[];
187
+ /**
188
+ * Opt-in flag for emitting full flag-evaluation data from SDKs to
189
+ * Datadog. May contain PII; defaults to false for privacy.
190
+ *
191
+ * @generated from field: bool observe_full_evaluation_data = 10;
192
+ */
193
+ observeFullEvaluationData: boolean;
194
+ };
195
+ type Version = Message<"datadog.ffe.flagging.ufc.v1.Version"> & {
196
+ /**
197
+ * Main version components (usually "major.minor.patch" but can have more/less
198
+ * parts). Missing components should be treated as "0" for comparison
199
+ * purposes.
200
+ *
201
+ * @generated from field: repeated string components = 1;
202
+ */
203
+ components: string[];
204
+ /**
205
+ * @generated from field: repeated string prerelease = 2;
206
+ */
207
+ prerelease: string[];
208
+ };
209
+ type Flag = Message<"datadog.ffe.flagging.ufc.v1.Flag"> & {
210
+ /**
211
+ * The minimum feature level an SDK must support to evaluate this flag.
212
+ * SDKs that don't support this level must not evaluate the flag and should
213
+ * report an informative flag-scoped error rather than treat it as absent.
214
+ *
215
+ * @generated from field: uint32 minimum_feature_level = 1;
216
+ */
217
+ minimumFeatureLevel: number;
218
+ /**
219
+ * @generated from field: datadog.ffe.flagging.ufc.v1.VariationType variation_type = 2;
220
+ */
221
+ variationType: VariationType;
222
+ /**
223
+ * Split.variation_index indexes this array.
224
+ *
225
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.Variation variations = 3;
226
+ */
227
+ variations: Variation[];
228
+ /**
229
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.Allocation allocations = 4;
230
+ */
231
+ allocations: Allocation[];
232
+ };
233
+ type Variation = Message<"datadog.ffe.flagging.ufc.v1.Variation"> & {
234
+ /**
235
+ * Variation key. Index into FlagsConfiguration.strings
236
+ *
237
+ * @generated from field: uint32 key_string_index = 1;
238
+ */
239
+ keyStringIndex: number;
240
+ /**
241
+ * The populated field must agree with Flag.variation_type.
242
+ *
243
+ * @generated from oneof datadog.ffe.flagging.ufc.v1.Variation.value
244
+ */
245
+ value: {
246
+ /**
247
+ * Index into FlagsConfiguration.strings
248
+ *
249
+ * @generated from field: uint32 string_value_index = 2;
250
+ */
251
+ value: number;
252
+ case: "stringValueIndex";
253
+ } | {
254
+ /**
255
+ * @generated from field: int64 integer_value = 3;
256
+ */
257
+ value: bigint;
258
+ case: "integerValue";
259
+ } | {
260
+ /**
261
+ * @generated from field: double numeric_value = 4;
262
+ */
263
+ value: number;
264
+ case: "numericValue";
265
+ } | {
266
+ /**
267
+ * @generated from field: bool boolean_value = 5;
268
+ */
269
+ value: boolean;
270
+ case: "booleanValue";
271
+ } | {
272
+ /**
273
+ * JSON variations may be any valid JSON value, including scalar values.
274
+ * Index into FlagsConfiguration.json_strings.
275
+ *
276
+ * @generated from field: uint32 json_string_index = 6;
277
+ */
278
+ value: number;
279
+ case: "jsonStringIndex";
280
+ } | {
281
+ case: undefined;
282
+ value?: undefined;
283
+ };
284
+ };
285
+ type Allocation = Message<"datadog.ffe.flagging.ufc.v1.Allocation"> & {
286
+ /**
287
+ * @generated from field: string key = 1;
288
+ */
289
+ key: string;
290
+ /**
291
+ * Zero-based index into FlagsConfiguration.conditions. Unset means
292
+ * this allocation matches every subject.
293
+ *
294
+ * @generated from field: optional uint32 targeting_condition_index = 2;
295
+ */
296
+ targetingConditionIndex?: number | undefined;
297
+ /**
298
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.PartitionKey partition_key = 3;
299
+ */
300
+ partitionKey: PartitionKey[];
301
+ /**
302
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.Split splits = 4;
303
+ */
304
+ splits: Split[];
305
+ /**
306
+ * Whether an evaluation resolved by this allocation should emit an
307
+ * exposure event (e.g. for experiments).
308
+ *
309
+ * @generated from field: bool log_exposure_event = 5;
310
+ */
311
+ logExposureEvent: boolean;
312
+ };
313
+ type AttributeReference = Message<"datadog.ffe.flagging.ufc.v1.AttributeReference"> & {
314
+ /**
315
+ * @generated from oneof datadog.ffe.flagging.ufc.v1.AttributeReference.kind
316
+ */
317
+ kind: {
318
+ /**
319
+ * @generated from field: google.protobuf.Empty targeting_key = 1;
320
+ */
321
+ value: Empty;
322
+ case: "targetingKey";
323
+ } | {
324
+ /**
325
+ * @generated from field: datadog.ffe.flagging.ufc.v1.AttributePath attribute_path = 2;
326
+ */
327
+ value: AttributePath;
328
+ case: "attributePath";
329
+ } | {
330
+ case: undefined;
331
+ value?: undefined;
332
+ };
333
+ };
334
+ type AttributePath = Message<"datadog.ffe.flagging.ufc.v1.AttributePath"> & {
335
+ /**
336
+ * Contains at least one segment and starts with a string.
337
+ *
338
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.AttributePathSegment segments = 1;
339
+ */
340
+ segments: AttributePathSegment[];
341
+ };
342
+ type AttributePathSegment = Message<"datadog.ffe.flagging.ufc.v1.AttributePathSegment"> & {
343
+ /**
344
+ * @generated from oneof datadog.ffe.flagging.ufc.v1.AttributePathSegment.kind
345
+ */
346
+ kind: {
347
+ /**
348
+ * Index into FlagsConfiguration.strings.
349
+ *
350
+ * @generated from field: uint32 object_key_string_index = 1;
351
+ */
352
+ value: number;
353
+ case: "objectKeyStringIndex";
354
+ } | {
355
+ /**
356
+ * @generated from field: uint32 array_index = 2;
357
+ */
358
+ value: number;
359
+ case: "arrayIndex";
360
+ } | {
361
+ case: undefined;
362
+ value?: undefined;
363
+ };
364
+ };
365
+ type Condition = Message<"datadog.ffe.flagging.ufc.v1.Condition"> & {
366
+ /**
367
+ * @generated from oneof datadog.ffe.flagging.ufc.v1.Condition.kind
368
+ */
369
+ kind: {
370
+ /**
371
+ * Logical AND. True when every referenced condition is
372
+ * true. Empty ALL is true.
373
+ *
374
+ * @generated from field: datadog.ffe.flagging.ufc.v1.ConditionOperands all = 1;
375
+ */
376
+ value: ConditionOperands;
377
+ case: "all";
378
+ } | {
379
+ /**
380
+ * Logical OR. True when any referenced condition is true. Empty
381
+ * ANY is false.
382
+ *
383
+ * @generated from field: datadog.ffe.flagging.ufc.v1.ConditionOperands any = 2;
384
+ */
385
+ value: ConditionOperands;
386
+ case: "any";
387
+ } | {
388
+ /**
389
+ * @generated from field: datadog.ffe.flagging.ufc.v1.NumericCondition numeric = 3;
390
+ */
391
+ value: NumericCondition;
392
+ case: "numeric";
393
+ } | {
394
+ /**
395
+ * @generated from field: datadog.ffe.flagging.ufc.v1.RegexCondition regex = 4;
396
+ */
397
+ value: RegexCondition;
398
+ case: "regex";
399
+ } | {
400
+ /**
401
+ * @generated from field: datadog.ffe.flagging.ufc.v1.StringMembershipCondition string_membership = 5;
402
+ */
403
+ value: StringMembershipCondition;
404
+ case: "stringMembership";
405
+ } | {
406
+ /**
407
+ * @generated from field: datadog.ffe.flagging.ufc.v1.Sha256MembershipCondition sha256_membership = 6;
408
+ */
409
+ value: Sha256MembershipCondition;
410
+ case: "sha256Membership";
411
+ } | {
412
+ /**
413
+ * @generated from field: datadog.ffe.flagging.ufc.v1.AttributePresenceCondition attribute_presence = 7;
414
+ */
415
+ value: AttributePresenceCondition;
416
+ case: "attributePresence";
417
+ } | {
418
+ /**
419
+ * @generated from field: datadog.ffe.flagging.ufc.v1.VersionCondition version = 8;
420
+ */
421
+ value: VersionCondition;
422
+ case: "version";
423
+ } | {
424
+ /**
425
+ * @generated from field: datadog.ffe.flagging.ufc.v1.StringComparisonCondition string_comparison = 9;
426
+ */
427
+ value: StringComparisonCondition;
428
+ case: "stringComparison";
429
+ } | {
430
+ /**
431
+ * @generated from field: datadog.ffe.flagging.ufc.v1.Sha256StringComparisonCondition sha256_string_comparison = 10;
432
+ */
433
+ value: Sha256StringComparisonCondition;
434
+ case: "sha256StringComparison";
435
+ } | {
436
+ case: undefined;
437
+ value?: undefined;
438
+ };
439
+ };
440
+ type ConditionOperands = Message<"datadog.ffe.flagging.ufc.v1.ConditionOperands"> & {
441
+ /**
442
+ * Zero-based indexes into FlagsConfiguration.conditions.
443
+ *
444
+ * @generated from field: repeated uint32 condition_indexes = 1;
445
+ */
446
+ conditionIndexes: number[];
447
+ };
448
+ type NumericCondition = Message<"datadog.ffe.flagging.ufc.v1.NumericCondition"> & {
449
+ /**
450
+ * @generated from field: uint32 attribute_index = 1;
451
+ */
452
+ attributeIndex: number;
453
+ /**
454
+ * @generated from field: datadog.ffe.flagging.ufc.v1.NumericComparator comparator = 2;
455
+ */
456
+ comparator: NumericComparator;
457
+ /**
458
+ * @generated from field: double comparand = 3;
459
+ */
460
+ comparand: number;
461
+ };
462
+ type RegexCondition = Message<"datadog.ffe.flagging.ufc.v1.RegexCondition"> & {
463
+ /**
464
+ * @generated from field: uint32 attribute_index = 1;
465
+ */
466
+ attributeIndex: number;
467
+ /**
468
+ * Index into FlagsConfiguration.regexes.
469
+ *
470
+ * @generated from field: uint32 regex_index = 2;
471
+ */
472
+ regexIndex: number;
473
+ /**
474
+ * True negates the regex match.
475
+ *
476
+ * @generated from field: bool negate = 3;
477
+ */
478
+ negate: boolean;
479
+ };
480
+ type StringMembershipCondition = Message<"datadog.ffe.flagging.ufc.v1.StringMembershipCondition"> & {
481
+ /**
482
+ * @generated from field: uint32 attribute_index = 1;
483
+ */
484
+ attributeIndex: number;
485
+ /**
486
+ * Indices into FlagsConfiguration.strings. Sorted by referenced value.
487
+ *
488
+ * @generated from field: repeated uint32 string_indexes = 2;
489
+ */
490
+ stringIndexes: number[];
491
+ /**
492
+ * True negates membership.
493
+ *
494
+ * @generated from field: bool negate = 3;
495
+ */
496
+ negate: boolean;
497
+ };
498
+ type StringComparisonCondition = Message<"datadog.ffe.flagging.ufc.v1.StringComparisonCondition"> & {
499
+ /**
500
+ * @generated from field: uint32 attribute_index = 1;
501
+ */
502
+ attributeIndex: number;
503
+ /**
504
+ * @generated from field: datadog.ffe.flagging.ufc.v1.StringComparator comparator = 2;
505
+ */
506
+ comparator: StringComparator;
507
+ /**
508
+ * Index into FlagsConfiguration.strings.
509
+ *
510
+ * @generated from field: uint32 string_index = 3;
511
+ */
512
+ stringIndex: number;
513
+ /**
514
+ * True negates the comparator.
515
+ *
516
+ * @generated from field: bool negate = 4;
517
+ */
518
+ negate: boolean;
519
+ };
520
+ type Sha256StringComparisonCondition = Message<"datadog.ffe.flagging.ufc.v1.Sha256StringComparisonCondition"> & {
521
+ /**
522
+ * @generated from field: uint32 attribute_index = 1;
523
+ */
524
+ attributeIndex: number;
525
+ /**
526
+ * @generated from field: bytes salt = 2;
527
+ */
528
+ salt: Uint8Array;
529
+ /**
530
+ * @generated from field: datadog.ffe.flagging.ufc.v1.Sha256StringComparator comparator = 3;
531
+ */
532
+ comparator: Sha256StringComparator;
533
+ /**
534
+ * Number of UTF-8 bytes to extract from the start or end. If the attribute
535
+ * has fewer bytes, or extraction would split a code point, the condition is
536
+ * false.
537
+ *
538
+ * @generated from field: uint32 length = 4;
539
+ */
540
+ length: number;
541
+ /**
542
+ * Expected SHA-256(salt || extracted UTF-8 bytes), as raw digest bytes.
543
+ *
544
+ * @generated from field: bytes sha256 = 5;
545
+ */
546
+ sha256: Uint8Array;
547
+ /**
548
+ * True negates the comparator.
549
+ *
550
+ * @generated from field: bool negate = 6;
551
+ */
552
+ negate: boolean;
553
+ };
554
+ type Sha256MembershipCondition = Message<"datadog.ffe.flagging.ufc.v1.Sha256MembershipCondition"> & {
555
+ /**
556
+ * @generated from field: uint32 attribute_index = 1;
557
+ */
558
+ attributeIndex: number;
559
+ /**
560
+ * @generated from field: bytes salt = 2;
561
+ */
562
+ salt: Uint8Array;
563
+ /**
564
+ * Sorted lexicographically as raw bytes.
565
+ *
566
+ * @generated from field: repeated bytes sha256 = 3;
567
+ */
568
+ sha256: Uint8Array[];
569
+ /**
570
+ * True negates membership.
571
+ *
572
+ * @generated from field: bool negate = 4;
573
+ */
574
+ negate: boolean;
575
+ };
576
+ type AttributePresenceCondition = Message<"datadog.ffe.flagging.ufc.v1.AttributePresenceCondition"> & {
577
+ /**
578
+ * @generated from field: uint32 attribute_index = 1;
579
+ */
580
+ attributeIndex: number;
581
+ /**
582
+ * True checks that the attribute is null/absent (is_null); false checks
583
+ * that it is present/not-null (is_not_null).
584
+ *
585
+ * @generated from field: bool expect_null = 2;
586
+ */
587
+ expectNull: boolean;
588
+ };
589
+ type VersionCondition = Message<"datadog.ffe.flagging.ufc.v1.VersionCondition"> & {
590
+ /**
591
+ * @generated from field: uint32 attribute_index = 1;
592
+ */
593
+ attributeIndex: number;
594
+ /**
595
+ * @generated from field: datadog.ffe.flagging.ufc.v1.VersionComparator comparator = 2;
596
+ */
597
+ comparator: VersionComparator;
598
+ /**
599
+ * Index into FlagsConfiguration.versions.
600
+ *
601
+ * @generated from field: uint32 version_index = 3;
602
+ */
603
+ versionIndex: number;
604
+ };
605
+ type PartitionKey = Message<"datadog.ffe.flagging.ufc.v1.PartitionKey"> & {
606
+ /**
607
+ * @generated from oneof datadog.ffe.flagging.ufc.v1.PartitionKey.kind
608
+ */
609
+ kind: {
610
+ /**
611
+ * @generated from field: datadog.ffe.flagging.ufc.v1.TimePartitionKey time = 1;
612
+ */
613
+ value: TimePartitionKey;
614
+ case: "time";
615
+ } | {
616
+ /**
617
+ * @generated from field: datadog.ffe.flagging.ufc.v1.Md5ShardPartitionKey shard_md5 = 2;
618
+ */
619
+ value: Md5ShardPartitionKey;
620
+ case: "shardMd5";
621
+ } | {
622
+ case: undefined;
623
+ value?: undefined;
624
+ };
625
+ };
626
+ type TimePartitionKey = Message<"datadog.ffe.flagging.ufc.v1.TimePartitionKey"> & {};
627
+ type Md5ShardPartitionKey = Message<"datadog.ffe.flagging.ufc.v1.Md5ShardPartitionKey"> & {
628
+ /**
629
+ * Includes any separator between the salt and the hashed value; callers
630
+ * must concatenate salt and attribute_value directly, with no implicit
631
+ * separator of their own.
632
+ *
633
+ * @generated from field: string salt = 1;
634
+ */
635
+ salt: string;
636
+ /**
637
+ * Index into FlagsConfiguration.attributes.
638
+ *
639
+ * @generated from field: uint32 attribute_index = 2;
640
+ */
641
+ attributeIndex: number;
642
+ /**
643
+ * @generated from field: uint64 total_shards = 3;
644
+ */
645
+ totalShards: bigint;
646
+ };
647
+ type Split = Message<"datadog.ffe.flagging.ufc.v1.Split"> & {
648
+ /**
649
+ * Has the same number of elements as the partition key.
650
+ *
651
+ * @generated from field: repeated datadog.ffe.flagging.ufc.v1.PartitionRange ranges = 1;
652
+ */
653
+ ranges: PartitionRange[];
654
+ /**
655
+ * @generated from field: uint32 variation_index = 2;
656
+ */
657
+ variationIndex: number;
658
+ /**
659
+ * @generated from field: optional int32 serial_id = 3;
660
+ */
661
+ serialId?: number | undefined;
662
+ /**
663
+ * @generated from field: datadog.ffe.flagging.ufc.v1.Reason reason = 4;
664
+ */
665
+ reason: Reason;
666
+ };
667
+ type PartitionRange = Message<"datadog.ffe.flagging.ufc.v1.PartitionRange"> & {
668
+ /**
669
+ * @generated from field: optional uint64 from = 1;
670
+ */
671
+ from?: bigint | undefined;
672
+ /**
673
+ * @generated from field: optional uint64 to = 2;
674
+ */
675
+ to?: bigint | undefined;
676
+ };
677
+ declare enum VariationType {
678
+ /**
679
+ * @generated from enum value: VARIATION_TYPE_UNSPECIFIED = 0;
680
+ */
681
+ UNSPECIFIED = 0,
682
+ /**
683
+ * @generated from enum value: VARIATION_TYPE_STRING = 1;
684
+ */
685
+ STRING = 1,
686
+ /**
687
+ * @generated from enum value: VARIATION_TYPE_INTEGER = 2;
688
+ */
689
+ INTEGER = 2,
690
+ /**
691
+ * @generated from enum value: VARIATION_TYPE_NUMERIC = 3;
692
+ */
693
+ NUMERIC = 3,
694
+ /**
695
+ * @generated from enum value: VARIATION_TYPE_BOOLEAN = 4;
696
+ */
697
+ BOOLEAN = 4,
698
+ /**
699
+ * @generated from enum value: VARIATION_TYPE_JSON = 5;
700
+ */
701
+ JSON = 5
702
+ }
703
+ declare enum NumericComparator {
704
+ /**
705
+ * @generated from enum value: NUMERIC_COMPARATOR_UNSPECIFIED = 0;
706
+ */
707
+ UNSPECIFIED = 0,
708
+ /**
709
+ * @generated from enum value: NUMERIC_COMPARATOR_LESS_THAN = 1;
710
+ */
711
+ LESS_THAN = 1,
712
+ /**
713
+ * @generated from enum value: NUMERIC_COMPARATOR_LESS_THAN_OR_EQUAL = 2;
714
+ */
715
+ LESS_THAN_OR_EQUAL = 2,
716
+ /**
717
+ * @generated from enum value: NUMERIC_COMPARATOR_GREATER_THAN = 3;
718
+ */
719
+ GREATER_THAN = 3,
720
+ /**
721
+ * @generated from enum value: NUMERIC_COMPARATOR_GREATER_THAN_OR_EQUAL = 4;
722
+ */
723
+ GREATER_THAN_OR_EQUAL = 4
724
+ }
725
+ declare enum StringComparator {
726
+ /**
727
+ * @generated from enum value: STRING_COMPARATOR_UNSPECIFIED = 0;
728
+ */
729
+ UNSPECIFIED = 0,
730
+ /**
731
+ * @generated from enum value: STRING_COMPARATOR_STARTS_WITH = 1;
732
+ */
733
+ STARTS_WITH = 1,
734
+ /**
735
+ * @generated from enum value: STRING_COMPARATOR_ENDS_WITH = 2;
736
+ */
737
+ ENDS_WITH = 2,
738
+ /**
739
+ * @generated from enum value: STRING_COMPARATOR_CONTAINS = 3;
740
+ */
741
+ CONTAINS = 3
742
+ }
743
+ declare enum Sha256StringComparator {
744
+ /**
745
+ * @generated from enum value: SHA256_STRING_COMPARATOR_UNSPECIFIED = 0;
746
+ */
747
+ UNSPECIFIED = 0,
748
+ /**
749
+ * @generated from enum value: SHA256_STRING_COMPARATOR_STARTS_WITH = 1;
750
+ */
751
+ STARTS_WITH = 1,
752
+ /**
753
+ * @generated from enum value: SHA256_STRING_COMPARATOR_ENDS_WITH = 2;
754
+ */
755
+ ENDS_WITH = 2
756
+ }
757
+ declare enum VersionComparator {
758
+ /**
759
+ * @generated from enum value: VERSION_COMPARATOR_UNSPECIFIED = 0;
760
+ */
761
+ UNSPECIFIED = 0,
762
+ /**
763
+ * @generated from enum value: VERSION_COMPARATOR_EQUAL = 1;
764
+ */
765
+ EQUAL = 1,
766
+ /**
767
+ * @generated from enum value: VERSION_COMPARATOR_NOT_EQUAL = 2;
768
+ */
769
+ NOT_EQUAL = 2,
770
+ /**
771
+ * @generated from enum value: VERSION_COMPARATOR_LESS_THAN = 3;
772
+ */
773
+ LESS_THAN = 3,
774
+ /**
775
+ * @generated from enum value: VERSION_COMPARATOR_LESS_THAN_OR_EQUAL = 4;
776
+ */
777
+ LESS_THAN_OR_EQUAL = 4,
778
+ /**
779
+ * @generated from enum value: VERSION_COMPARATOR_GREATER_THAN = 5;
780
+ */
781
+ GREATER_THAN = 5,
782
+ /**
783
+ * @generated from enum value: VERSION_COMPARATOR_GREATER_THAN_OR_EQUAL = 6;
784
+ */
785
+ GREATER_THAN_OR_EQUAL = 6
786
+ }
787
+ declare enum Reason {
788
+ /**
789
+ * @generated from enum value: REASON_UNSPECIFIED = 0;
790
+ */
791
+ UNSPECIFIED = 0,
792
+ /**
793
+ * @generated from enum value: REASON_TARGETING_MATCH = 1;
794
+ */
795
+ TARGETING_MATCH = 1,
796
+ /**
797
+ * @generated from enum value: REASON_SPLIT = 2;
798
+ */
799
+ SPLIT = 2,
800
+ /**
801
+ * @generated from enum value: REASON_STATIC = 3;
802
+ */
803
+ STATIC = 3,
804
+ /**
805
+ * @generated from enum value: REASON_DEFAULT = 4;
806
+ */
807
+ DEFAULT = 4
808
+ }
809
+ type CachedJsonValue = {
810
+ valid: true;
811
+ value: FlagValue;
812
+ } | {
813
+ valid: false;
814
+ };
815
+ type PreparedRulesResponse = FlagsConfiguration & {
816
+ evaluationRegexCache: Map<number, RegExp | null>;
817
+ evaluationJsonCache: Map<number, CachedJsonValue>;
818
+ };
819
+ /**
820
+ * Internal flags configuration for DatadogProvider.
821
+ */
822
+ type FlagsConfiguration$1 = {
823
+ /** The configuration wire could not be parsed, so no capability was decoded. @internal */
824
+ configurationError?: string;
825
+ /** @internal */
826
+ precomputed?: PrecomputedConfiguration;
827
+ /** The precomputed capability could not be decoded; a valid rules capability remains usable. @internal */
828
+ precomputedError?: string;
829
+ /** @internal */
830
+ rules?: RulesConfiguration;
831
+ /** The rules capability could not be decoded; a valid precomputed capability remains usable. @internal */
832
+ rulesError?: string;
833
+ };
834
+ type PrecomputedConfiguration = {
835
+ response: PrecomputedConfigurationResponse;
836
+ context?: EvaluationContext;
837
+ fetchedAt?: TimeStamp;
838
+ etag?: string;
839
+ /** Parsing errors for malformed flags, retained by flag key. */
840
+ flagErrors?: Record<string, string>;
841
+ };
842
+ type RulesConfiguration = {
843
+ response: PreparedRulesResponse;
844
+ fetchedAt?: TimeStamp;
845
+ etag?: string;
846
+ };
847
+ type FlagTypeToValue<T extends FlagValueType> = {
848
+ boolean: boolean;
849
+ string: string;
850
+ number: number;
851
+ object: JsonValue;
852
+ }[T];
853
+ type PrecomputedConfigurationResponse = {
854
+ data: {
855
+ attributes: {
856
+ /** When configuration was generated. */
857
+ createdAt: string;
858
+ /** Absent or false for legacy plaintext assignments. */
859
+ obfuscated?: boolean;
860
+ /** Required when obfuscated is true; retained with the map in caches. */
861
+ obfuscation?: FlagKeyObfuscation;
862
+ flags: Record<string, PrecomputedFlag>;
863
+ };
864
+ };
865
+ };
866
+ type PrecomputedFlag<T extends FlagValueType = FlagValueType> = {
867
+ allocationKey: string;
868
+ variationKey: string;
869
+ variationType: T;
870
+ variationValue: FlagTypeToValue<T>;
871
+ reason: ResolutionReason;
872
+ doLog: boolean;
873
+ serialId?: number | null;
874
+ };
875
+ export type FlagsConfigurationWire = string;
876
+ /**
877
+ * Decode a binary flags configuration response.
878
+ */
879
+ export declare function configurationFromRulesBinary(response: Uint8Array): FlagsConfiguration$1;
880
+ /**
881
+ * Parse an opaque flags configuration wire value.
882
+ */
883
+ export declare function configurationFromString(wire: FlagsConfigurationWire): FlagsConfiguration$1;
884
+ /**
885
+ * Serialize a flags configuration to a string that can be deserialized with
886
+ * `configurationFromString`.
887
+ */
888
+ export declare function configurationToString(configuration: FlagsConfiguration$1): FlagsConfigurationWire;
889
+ interface ConfigurationFetchOptions {
890
+ env: string;
891
+ /** Datadog site. Defaults to datadoghq.com. */
892
+ site?: string;
893
+ /** Request and response-body deadline in milliseconds. Defaults to 5000. */
894
+ timeoutMs?: number;
895
+ signal?: AbortSignal;
896
+ /** Fetch-compatible transport. Must honor the supplied signal and redirect policy. */
897
+ fetch?: typeof globalThis.fetch;
898
+ }
899
+ export type RulesConfigurationFetchOptions = ConfigurationFetchOptions & ({
900
+ distributionChannel?: "server";
901
+ apiKey: string;
902
+ clientToken?: never;
903
+ } | {
904
+ distributionChannel: "client";
905
+ clientToken: string;
906
+ apiKey?: never;
907
+ });
908
+ export type ConfigurationFetchErrorCode = "invalid_options" | "http" | "invalid_response" | "decode" | "transport" | "cancelled" | "timeout";
909
+ /** A configuration-loading failure, not an OpenFeature evaluation error. */
910
+ export declare class ConfigurationFetchError extends Error {
911
+ readonly code: ConfigurationFetchErrorCode;
912
+ readonly status?: number | undefined;
913
+ constructor(code: ConfigurationFetchErrorCode, message: string, status?: number | undefined);
914
+ }
915
+ /**
916
+ * Fetch and parse context-independent rules without initializing a provider or tracer.
917
+ * Only client-distributed configurations are suitable for forwarding to a browser.
918
+ */
919
+ export declare function fetchRulesConfiguration(options: RulesConfigurationFetchOptions): Promise<FlagsConfiguration$1>;
920
+
921
+ export {
922
+ FlagsConfiguration$1 as FlagsConfiguration,
923
+ };
924
+
925
+ export {};