@datadog/flagging-core 0.1.0-alpha.8 → 0.1.0-alpha.9
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/cjs/configuration/configuration.d.ts +2 -2
- package/cjs/configuration/configuration.d.ts.map +1 -1
- package/cjs/configuration/wire.d.ts +3 -3
- package/cjs/configuration/wire.d.ts.map +1 -1
- package/cjs/configuration/wire.js.map +1 -1
- package/package.json +5 -7
- package/src/configuration/configuration.ts +3 -8
- package/src/configuration/wire.ts +4 -4
- package/webpack.config.js +0 -10
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { EvaluationContext, FlagValueType, JsonValue, ResolutionReason } from '@openfeature/web-sdk';
|
|
2
2
|
/**
|
|
3
|
-
* Internal configuration for DatadogProvider.
|
|
3
|
+
* Internal flags configuration for DatadogProvider.
|
|
4
4
|
*/
|
|
5
|
-
export type
|
|
5
|
+
export type FlagsConfiguration = {
|
|
6
6
|
/** @internal */
|
|
7
7
|
precomputed?: PrecomputedConfiguration;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEzG;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB;IAChB,WAAW,CAAC,EAAE,wBAAwB,CAAA;CACvC,CAAA;AAED,gBAAgB;AAChB,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,gCAAgC,CAAA;IAC1C,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,SAAS,CAAC,EAAE,aAAa,CAAA;CAC1B,CAAA;AAGD,gBAAgB;AAChB,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,aAAa,IAAI;IACrD,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IACpB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAClB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAClB,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACtB,CAAC,CAAC,CAAC,CAAA;AAEJ;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAA;AAElC,gBAAgB;AAChB,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE;QACJ,UAAU,EAAE;YACV,wCAAwC;YACxC,SAAS,EAAE,MAAM,CAAA;YACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;SACvC,CAAA;KACF,CAAA;CACF,CAAA;AAED,gBAAgB;AAChB,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI;IACrE,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,CAAC,CAAA;IAChB,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;IAClC,MAAM,EAAE,gBAAgB,CAAA;IACxB,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACtC,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FlagsConfiguration } from './configuration';
|
|
2
2
|
/**
|
|
3
3
|
* Create configuration from a string created with `configurationToString`.
|
|
4
4
|
*/
|
|
5
|
-
export declare function configurationFromString(s: string):
|
|
5
|
+
export declare function configurationFromString(s: string): FlagsConfiguration;
|
|
6
6
|
/**
|
|
7
7
|
* Serialize configuration to string that can be deserialized with
|
|
8
8
|
* `configurationFromString`. The serialized string format is
|
|
9
9
|
* unspecified.
|
|
10
10
|
*/
|
|
11
|
-
export declare function configurationToString(configuration:
|
|
11
|
+
export declare function configurationToString(configuration: FlagsConfiguration): string;
|
|
12
12
|
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/configuration/wire.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/configuration/wire.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAiB,MAAM,iBAAiB,CAAA;AAWxE;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAqBrE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,kBAAkB,GAAG,MAAM,CAa/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/configuration/wire.ts"],"names":[],"mappings":";;AAgBA,0DAqBC;AAOD,sDAaC;AA5CD;;GAEG;AACH,SAAgB,uBAAuB,CAAC,CAAS;IAC/C,IAAI,CAAC;QACH,MAAM,IAAI,GAAsB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAE7C,IAAI,IAAI,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;YACvB,kBAAkB;YAClB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/configuration/wire.ts"],"names":[],"mappings":";;AAgBA,0DAqBC;AAOD,sDAaC;AA5CD;;GAEG;AACH,SAAgB,uBAAuB,CAAC,CAAS;IAC/C,IAAI,CAAC;QACH,MAAM,IAAI,GAAsB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAE7C,IAAI,IAAI,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;YACvB,kBAAkB;YAClB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,MAAM,aAAa,GAAuB,EAAE,CAAA;QAC5C,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,aAAa,CAAC,WAAW,GAAG;gBAC1B,GAAG,IAAI,CAAC,WAAW;gBACnB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;aAChD,CAAA;QACH,CAAC;QAED,OAAO,aAAa,CAAA;IACtB,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,aAAiC;IACrE,MAAM,IAAI,GAAsB;QAC9B,OAAO,EAAE,CAAC;KACX,CAAA;IAED,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG;YACjB,GAAG,aAAa,CAAC,WAAW;YAC5B,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC;SACpD,CAAA;IACH,CAAC;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/flagging-core",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"description": "Runtime-agnostic flag-evaluation logic for Datadog Flagging",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"prepack": "yarn build",
|
|
20
20
|
"pack": "yarn pack",
|
|
21
|
-
"build": "run-p build:cjs build:esm
|
|
22
|
-
"build:bundle": "rm -rf bundle && SDK_SETUP=cdn node ../../scripts/webpack-runner.js webpack.config.js --mode=production",
|
|
21
|
+
"build": "run-p build:cjs build:esm",
|
|
23
22
|
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json && yarn replace-build-env cjs",
|
|
24
23
|
"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json && yarn replace-build-env esm",
|
|
25
24
|
"replace-build-env": "node ../../scripts/build/replace-build-env.js",
|
|
@@ -28,6 +27,8 @@
|
|
|
28
27
|
"typecheck": "tsc --noEmit"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
30
|
+
"@openfeature/core": "^1.8.1",
|
|
31
|
+
"@openfeature/web-sdk": "^1.5.0",
|
|
31
32
|
"@types/jest": "^29.4.0",
|
|
32
33
|
"@types/node": "^20.0.0",
|
|
33
34
|
"jest": "^30.0.4",
|
|
@@ -36,11 +37,8 @@
|
|
|
36
37
|
"ts-loader": "^9.5.2",
|
|
37
38
|
"typescript": "^5.5.0"
|
|
38
39
|
},
|
|
39
|
-
"
|
|
40
|
+
"peerDependencies": {
|
|
40
41
|
"@openfeature/core": "^1.8.1",
|
|
41
42
|
"@openfeature/web-sdk": "^1.5.0"
|
|
42
|
-
},
|
|
43
|
-
"peerDependencies": {
|
|
44
|
-
"webpack": "^5.0.0"
|
|
45
43
|
}
|
|
46
44
|
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
EvaluationContext,
|
|
3
|
-
FlagValueType,
|
|
4
|
-
JsonValue,
|
|
5
|
-
ResolutionReason,
|
|
6
|
-
} from '@openfeature/web-sdk'
|
|
1
|
+
import type { EvaluationContext, FlagValueType, JsonValue, ResolutionReason } from '@openfeature/web-sdk'
|
|
7
2
|
|
|
8
3
|
/**
|
|
9
|
-
* Internal configuration for DatadogProvider.
|
|
4
|
+
* Internal flags configuration for DatadogProvider.
|
|
10
5
|
*/
|
|
11
|
-
export type
|
|
6
|
+
export type FlagsConfiguration = {
|
|
12
7
|
/** @internal */
|
|
13
8
|
precomputed?: PrecomputedConfiguration
|
|
14
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EvaluationContext } from '@openfeature/web-sdk'
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { FlagsConfiguration, UnixTimestamp } from './configuration'
|
|
4
4
|
|
|
5
5
|
type ConfigurationWire = {
|
|
6
6
|
version: 1
|
|
@@ -14,7 +14,7 @@ type ConfigurationWire = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Create configuration from a string created with `configurationToString`.
|
|
16
16
|
*/
|
|
17
|
-
export function configurationFromString(s: string):
|
|
17
|
+
export function configurationFromString(s: string): FlagsConfiguration {
|
|
18
18
|
try {
|
|
19
19
|
const wire: ConfigurationWire = JSON.parse(s)
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ export function configurationFromString(s: string): Configuration {
|
|
|
23
23
|
return {}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const configuration:
|
|
26
|
+
const configuration: FlagsConfiguration = {}
|
|
27
27
|
if (wire.precomputed) {
|
|
28
28
|
configuration.precomputed = {
|
|
29
29
|
...wire.precomputed,
|
|
@@ -42,7 +42,7 @@ export function configurationFromString(s: string): Configuration {
|
|
|
42
42
|
* `configurationFromString`. The serialized string format is
|
|
43
43
|
* unspecified.
|
|
44
44
|
*/
|
|
45
|
-
export function configurationToString(configuration:
|
|
45
|
+
export function configurationToString(configuration: FlagsConfiguration): string {
|
|
46
46
|
const wire: ConfigurationWire = {
|
|
47
47
|
version: 1,
|
|
48
48
|
}
|
package/webpack.config.js
DELETED