@productcraft/flags 0.4.0 → 0.5.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.
- package/README.md +35 -0
- package/api.md +5 -16
- package/dist/{chunk-7237IZU3.js → browser/chunk-OOX7EUCT.js} +8 -19
- package/dist/browser/chunk-OOX7EUCT.js.map +1 -0
- package/dist/browser/{chunk-72WU42RU.js → chunk-WUZAG2E3.js} +11 -4
- package/dist/browser/chunk-WUZAG2E3.js.map +1 -0
- package/dist/browser/{chunk-CXYODDHM.cjs → chunk-XZK57G7L.cjs} +8 -19
- package/dist/browser/chunk-XZK57G7L.cjs.map +1 -0
- package/dist/browser/{chunk-4XCQBTYE.cjs → chunk-YM5K4NHA.cjs} +11 -4
- package/dist/browser/chunk-YM5K4NHA.cjs.map +1 -0
- package/dist/browser/index.cjs +8 -8
- package/dist/browser/index.js +2 -2
- package/dist/browser/management.cjs +2 -2
- package/dist/browser/management.js +1 -1
- package/dist/browser/testing.cjs +3 -3
- package/dist/browser/testing.cjs.map +1 -1
- package/dist/browser/testing.js +1 -1
- package/dist/browser/testing.js.map +1 -1
- package/dist/{chunk-NB7OGN6R.js → chunk-CGVDMKEE.js} +12 -5
- package/dist/chunk-CGVDMKEE.js.map +1 -0
- package/dist/{chunk-Q3P66XRI.cjs → chunk-L3AOANTB.cjs} +12 -5
- package/dist/chunk-L3AOANTB.cjs.map +1 -0
- package/dist/{chunk-NSAKFGTJ.cjs → chunk-RJIVAOBG.cjs} +8 -19
- package/dist/{browser/chunk-CXYODDHM.cjs.map → chunk-RJIVAOBG.cjs.map} +1 -1
- package/dist/{browser/chunk-TCVKCN3S.js → chunk-XNJ5OX4X.js} +8 -19
- package/dist/{browser/chunk-TCVKCN3S.js.map → chunk-XNJ5OX4X.js.map} +1 -1
- package/dist/{client-K2zALPGD.d.cts → client-BBiIKiGW.d.cts} +18 -14
- package/dist/{client-K2zALPGD.d.ts → client-BBiIKiGW.d.ts} +18 -14
- package/dist/{client-BwoMpm8_.d.cts → client-BWi7PASW.d.cts} +94 -33
- package/dist/{client-BwoMpm8_.d.ts → client-BWi7PASW.d.ts} +94 -33
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/management.cjs +2 -2
- package/dist/management.d.cts +1 -1
- package/dist/management.d.ts +1 -1
- package/dist/management.js +1 -1
- package/dist/testing.cjs +3 -3
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -2
- package/dist/browser/chunk-4XCQBTYE.cjs.map +0 -1
- package/dist/browser/chunk-72WU42RU.js.map +0 -1
- package/dist/chunk-7237IZU3.js.map +0 -1
- package/dist/chunk-NB7OGN6R.js.map +0 -1
- package/dist/chunk-NSAKFGTJ.cjs.map +0 -1
- package/dist/chunk-Q3P66XRI.cjs.map +0 -1
|
@@ -570,7 +570,7 @@ type paths = {
|
|
|
570
570
|
head?: never;
|
|
571
571
|
/**
|
|
572
572
|
* Update a segment
|
|
573
|
-
* @description Key, name, description or conditions; only the fields you send change. Edit a confidential list with `list_id` plus `values_add` / `values_remove`. A segment used in a protected environment also needs `flags.protected.update` there.
|
|
573
|
+
* @description Key, name, description or conditions; only the fields you send change. To add or remove values in one list condition without re-sending the others, send `condition_edits` (with the `version` you read). Edit a confidential list with `list_id` plus `values_add` / `values_remove`, or with `condition_edits`. A segment used in a protected environment also needs `flags.protected.update` there.
|
|
574
574
|
*/
|
|
575
575
|
patch: operations["SegmentsController_update"];
|
|
576
576
|
trace?: never;
|
|
@@ -646,7 +646,7 @@ type paths = {
|
|
|
646
646
|
head?: never;
|
|
647
647
|
/**
|
|
648
648
|
* Update a value
|
|
649
|
-
* @description The quick edits: `value` (the toggle), `percentage_attribute`, and `clear_rules: true` to drop every rule and split so `value` is served to everyone (the kill switch). Send the `version` you read.
|
|
649
|
+
* @description The quick edits: `value` (the toggle), `percentage_attribute`, `rule_edits` to add or remove values in a list condition of an existing rule (a tester, a QA account) without re-sending the other rules, and `clear_rules: true` to drop every rule and split so `value` is served to everyone (the kill switch). Send the `version` you read. A protected environment needs `flags.protected.update`; one change and one revision per request, none when nothing changed.
|
|
650
650
|
*/
|
|
651
651
|
patch: operations["SettingsController_patchValue"];
|
|
652
652
|
trace?: never;
|
|
@@ -1110,6 +1110,27 @@ type components = {
|
|
|
1110
1110
|
/** @description Its value in each requested environment, in the order of `environment_ids`. */
|
|
1111
1111
|
values: components["schemas"]["SettingValueResponseDto"][];
|
|
1112
1112
|
};
|
|
1113
|
+
ConditionListEditDto: {
|
|
1114
|
+
/**
|
|
1115
|
+
* @description The condition to edit (0-based, in the order the conditions are listed).
|
|
1116
|
+
* @example 0
|
|
1117
|
+
*/
|
|
1118
|
+
condition_index: number;
|
|
1119
|
+
/**
|
|
1120
|
+
* @description Values to add. A value already in the list is ignored (no change, no new version).
|
|
1121
|
+
* @example [
|
|
1122
|
+
* "qa-bot@example.com"
|
|
1123
|
+
* ]
|
|
1124
|
+
*/
|
|
1125
|
+
values_add?: string[];
|
|
1126
|
+
/**
|
|
1127
|
+
* @description Values to remove, applied before `values_add`. A value not in the list is ignored. The list cannot become empty (remove the condition with a full PUT).
|
|
1128
|
+
* @example [
|
|
1129
|
+
* "old-bot@example.com"
|
|
1130
|
+
* ]
|
|
1131
|
+
*/
|
|
1132
|
+
values_remove?: string[];
|
|
1133
|
+
};
|
|
1113
1134
|
ConfidentialListDto: {
|
|
1114
1135
|
/**
|
|
1115
1136
|
* @description The user attribute the condition compares.
|
|
@@ -2325,6 +2346,19 @@ type components = {
|
|
|
2325
2346
|
note?: string;
|
|
2326
2347
|
/** @description The attribute splits hash; null for `identifier`. */
|
|
2327
2348
|
percentage_attribute?: string | null;
|
|
2349
|
+
/**
|
|
2350
|
+
* @description Add or remove values in list conditions of the existing rules without re-sending the targeting: each edit names a rule and a condition by index (as `GET` returns them, so send the `version` you read) and changes only that condition's values, with set semantics. A 422 `INVALID_TARGETING` names an index with no rule or condition, or a condition that is not a list. Re-adding a present value or removing an absent one is not a change: the current value comes back with the same `version` and no history entry. Cannot be combined with `clear_rules`.
|
|
2351
|
+
* @example [
|
|
2352
|
+
* {
|
|
2353
|
+
* "condition_index": 0,
|
|
2354
|
+
* "rule_index": 0,
|
|
2355
|
+
* "values_add": [
|
|
2356
|
+
* "qa-bot@example.com"
|
|
2357
|
+
* ]
|
|
2358
|
+
* }
|
|
2359
|
+
* ]
|
|
2360
|
+
*/
|
|
2361
|
+
rule_edits?: components["schemas"]["RuleListEditDto"][];
|
|
2328
2362
|
/**
|
|
2329
2363
|
* @description The new plain value (the on/off toggle for a flag). Must match the setting type: `boolean` true/false; `string` a string; `integer` a safe integer; `number` a finite number; `json` a string holding JSON text (for example `"{\"limit\":5}"`). At most 100 KB. Strings are stored and returned byte for byte.
|
|
2330
2364
|
* @example true
|
|
@@ -2542,6 +2576,32 @@ type components = {
|
|
|
2542
2576
|
*/
|
|
2543
2577
|
grace_hours?: number;
|
|
2544
2578
|
};
|
|
2579
|
+
RuleListEditDto: {
|
|
2580
|
+
/**
|
|
2581
|
+
* @description The condition to edit (0-based, in the order the conditions are listed).
|
|
2582
|
+
* @example 0
|
|
2583
|
+
*/
|
|
2584
|
+
condition_index: number;
|
|
2585
|
+
/**
|
|
2586
|
+
* @description The rule the condition is in (0-based, in evaluation order).
|
|
2587
|
+
* @example 0
|
|
2588
|
+
*/
|
|
2589
|
+
rule_index: number;
|
|
2590
|
+
/**
|
|
2591
|
+
* @description Values to add. A value already in the list is ignored (no change, no new version).
|
|
2592
|
+
* @example [
|
|
2593
|
+
* "qa-bot@example.com"
|
|
2594
|
+
* ]
|
|
2595
|
+
*/
|
|
2596
|
+
values_add?: string[];
|
|
2597
|
+
/**
|
|
2598
|
+
* @description Values to remove, applied before `values_add`. A value not in the list is ignored. The list cannot become empty (remove the condition with a full PUT).
|
|
2599
|
+
* @example [
|
|
2600
|
+
* "old-bot@example.com"
|
|
2601
|
+
* ]
|
|
2602
|
+
*/
|
|
2603
|
+
values_remove?: string[];
|
|
2604
|
+
};
|
|
2545
2605
|
SdkKeyListResponseDto: {
|
|
2546
2606
|
/** @description The primary key, then the secondary key while a grace period runs. */
|
|
2547
2607
|
data: components["schemas"]["SdkKeyResponseDto"][];
|
|
@@ -3226,6 +3286,18 @@ type components = {
|
|
|
3226
3286
|
ordinal?: number;
|
|
3227
3287
|
};
|
|
3228
3288
|
UpdateSegmentDto: {
|
|
3289
|
+
/**
|
|
3290
|
+
* @description Instead of `conditions`: add or remove values in list conditions without re-sending the others. Each edit names a condition by index and changes only its values, with set semantics (`values_remove` first). A 422 `INVALID_TARGETING` names an index with no condition, or a condition that is not a list. Re-adding a present value or removing an absent one is not a change (same `version`, no history entry). Send `version` so an edit against a stale read is refused.
|
|
3291
|
+
* @example [
|
|
3292
|
+
* {
|
|
3293
|
+
* "condition_index": 0,
|
|
3294
|
+
* "values_add": [
|
|
3295
|
+
* "qa-bot@example.com"
|
|
3296
|
+
* ]
|
|
3297
|
+
* }
|
|
3298
|
+
* ]
|
|
3299
|
+
*/
|
|
3300
|
+
condition_edits?: components["schemas"]["ConditionListEditDto"][];
|
|
3229
3301
|
/**
|
|
3230
3302
|
* @description Replaces the conditions. 1-20 conditions, ANDed in order; each is `{user: {attribute, comparator, values}}` (segments hold user conditions only). Confidential comparators take cleartext `values` (stored hashed with the segment's seed and the project salt, and encrypted at rest), `values_hashed`, or `list_id` with `values_add` / `values_remove` to edit a stored list. To keep a confidential list, send its `list_id` (or echo the `{hashed: true, list_id, …}` object as `values`).
|
|
3231
3303
|
* @example [
|
|
@@ -3966,7 +4038,7 @@ interface operations {
|
|
|
3966
4038
|
parameters: {
|
|
3967
4039
|
query?: never;
|
|
3968
4040
|
header?: {
|
|
3969
|
-
/** @description Idempotency key (1-256 characters, `[A-Za-z0-
|
|
4041
|
+
/** @description Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h. */
|
|
3970
4042
|
"Idempotency-Key"?: string;
|
|
3971
4043
|
};
|
|
3972
4044
|
path: {
|
|
@@ -4459,7 +4531,7 @@ interface operations {
|
|
|
4459
4531
|
parameters: {
|
|
4460
4532
|
query?: never;
|
|
4461
4533
|
header?: {
|
|
4462
|
-
/** @description Idempotency key (1-256 characters, `[A-Za-z0-
|
|
4534
|
+
/** @description Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h. */
|
|
4463
4535
|
"Idempotency-Key"?: string;
|
|
4464
4536
|
};
|
|
4465
4537
|
path: {
|
|
@@ -5072,7 +5144,7 @@ interface operations {
|
|
|
5072
5144
|
parameters: {
|
|
5073
5145
|
query?: never;
|
|
5074
5146
|
header?: {
|
|
5075
|
-
/** @description Idempotency key (1-256 characters, `[A-Za-z0-
|
|
5147
|
+
/** @description Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h. */
|
|
5076
5148
|
"Idempotency-Key"?: string;
|
|
5077
5149
|
};
|
|
5078
5150
|
path: {
|
|
@@ -5510,7 +5582,7 @@ interface operations {
|
|
|
5510
5582
|
parameters: {
|
|
5511
5583
|
query?: never;
|
|
5512
5584
|
header?: {
|
|
5513
|
-
/** @description Idempotency key (1-256 characters, `[A-Za-z0-
|
|
5585
|
+
/** @description Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h. */
|
|
5514
5586
|
"Idempotency-Key"?: string;
|
|
5515
5587
|
};
|
|
5516
5588
|
path: {
|
|
@@ -5913,7 +5985,7 @@ interface operations {
|
|
|
5913
5985
|
parameters: {
|
|
5914
5986
|
query?: never;
|
|
5915
5987
|
header?: {
|
|
5916
|
-
/** @description Idempotency key (1-256 characters, `[A-Za-z0-
|
|
5988
|
+
/** @description Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h. */
|
|
5917
5989
|
"Idempotency-Key"?: string;
|
|
5918
5990
|
};
|
|
5919
5991
|
path: {
|
|
@@ -6663,7 +6735,7 @@ interface operations {
|
|
|
6663
6735
|
parameters: {
|
|
6664
6736
|
query?: never;
|
|
6665
6737
|
header?: {
|
|
6666
|
-
/** @description Idempotency key (1-256 characters, `[A-Za-z0-
|
|
6738
|
+
/** @description Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h. */
|
|
6667
6739
|
"Idempotency-Key"?: string;
|
|
6668
6740
|
};
|
|
6669
6741
|
path: {
|
|
@@ -6862,7 +6934,7 @@ interface operations {
|
|
|
6862
6934
|
parameters: {
|
|
6863
6935
|
query?: never;
|
|
6864
6936
|
header?: {
|
|
6865
|
-
/** @description Idempotency key (1-256 characters, `[A-Za-z0-
|
|
6937
|
+
/** @description Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h. */
|
|
6866
6938
|
"Idempotency-Key"?: string;
|
|
6867
6939
|
};
|
|
6868
6940
|
path: {
|
|
@@ -7365,7 +7437,7 @@ interface operations {
|
|
|
7365
7437
|
parameters: {
|
|
7366
7438
|
query?: never;
|
|
7367
7439
|
header?: {
|
|
7368
|
-
/** @description Idempotency key (1-256 characters, `[A-Za-z0-
|
|
7440
|
+
/** @description Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h. */
|
|
7369
7441
|
"Idempotency-Key"?: string;
|
|
7370
7442
|
};
|
|
7371
7443
|
path: {
|
|
@@ -7694,7 +7766,7 @@ interface operations {
|
|
|
7694
7766
|
"application/json": components["schemas"]["SegmentDetailResponseDto"];
|
|
7695
7767
|
};
|
|
7696
7768
|
};
|
|
7697
|
-
/** @description `VALIDATION_ERROR`: a field is invalid. */
|
|
7769
|
+
/** @description `VALIDATION_ERROR`: a field is invalid, an edit has no values, or both `conditions` and `condition_edits` were sent. */
|
|
7698
7770
|
400: {
|
|
7699
7771
|
headers: {
|
|
7700
7772
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -8391,7 +8463,7 @@ interface operations {
|
|
|
8391
8463
|
"application/json": components["schemas"]["SettingValueResponseDto"];
|
|
8392
8464
|
};
|
|
8393
8465
|
};
|
|
8394
|
-
/** @description `VALIDATION_ERROR`: nothing to change,
|
|
8466
|
+
/** @description `VALIDATION_ERROR`: nothing to change, `version` is missing, an edit has no values, or `rule_edits` sent with `clear_rules`. */
|
|
8395
8467
|
400: {
|
|
8396
8468
|
headers: {
|
|
8397
8469
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -8705,7 +8777,7 @@ interface operations {
|
|
|
8705
8777
|
parameters: {
|
|
8706
8778
|
query?: never;
|
|
8707
8779
|
header?: {
|
|
8708
|
-
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-
|
|
8780
|
+
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9._:-]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
|
|
8709
8781
|
"Idempotency-Key"?: string;
|
|
8710
8782
|
};
|
|
8711
8783
|
path: {
|
|
@@ -8985,7 +9057,7 @@ interface operations {
|
|
|
8985
9057
|
parameters: {
|
|
8986
9058
|
query?: never;
|
|
8987
9059
|
header?: {
|
|
8988
|
-
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-
|
|
9060
|
+
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9._:-]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
|
|
8989
9061
|
"Idempotency-Key"?: string;
|
|
8990
9062
|
};
|
|
8991
9063
|
path: {
|
|
@@ -9101,7 +9173,7 @@ interface operations {
|
|
|
9101
9173
|
parameters: {
|
|
9102
9174
|
query?: never;
|
|
9103
9175
|
header?: {
|
|
9104
|
-
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-
|
|
9176
|
+
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9._:-]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
|
|
9105
9177
|
"Idempotency-Key"?: string;
|
|
9106
9178
|
};
|
|
9107
9179
|
path: {
|
|
@@ -9209,7 +9281,7 @@ interface operations {
|
|
|
9209
9281
|
parameters: {
|
|
9210
9282
|
query?: never;
|
|
9211
9283
|
header?: {
|
|
9212
|
-
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-
|
|
9284
|
+
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9._:-]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
|
|
9213
9285
|
"Idempotency-Key"?: string;
|
|
9214
9286
|
};
|
|
9215
9287
|
path: {
|
|
@@ -9607,7 +9679,7 @@ interface operations {
|
|
|
9607
9679
|
endpoint_id?: string;
|
|
9608
9680
|
};
|
|
9609
9681
|
header?: {
|
|
9610
|
-
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-
|
|
9682
|
+
/** @description Opaque client-generated string (1-256 chars, `[A-Za-z0-9._:-]`) that makes a retry of this request safe for 24 hours. The same key with a different body returns 409 `IDEMPOTENCY_KEY_REUSE`. */
|
|
9611
9683
|
"Idempotency-Key"?: string;
|
|
9612
9684
|
};
|
|
9613
9685
|
path: {
|
|
@@ -11055,12 +11127,12 @@ declare class SegmentsResource extends APIResource {
|
|
|
11055
11127
|
/**
|
|
11056
11128
|
* Update a segment
|
|
11057
11129
|
*
|
|
11058
|
-
* Key, name, description or conditions; only the fields you send change. Edit a confidential list with `list_id` plus `values_add` / `values_remove`. A segment used in a protected environment also needs `flags.protected.update` there.
|
|
11130
|
+
* Key, name, description or conditions; only the fields you send change. To add or remove values in one list condition without re-sending the others, send `condition_edits` (with the `version` you read). Edit a confidential list with `list_id` plus `values_add` / `values_remove`, or with `condition_edits`. A segment used in a protected environment also needs `flags.protected.update` there.
|
|
11059
11131
|
*
|
|
11060
11132
|
* @param segmentId - Id of the segment.
|
|
11061
11133
|
* @param params - `Flags.SegmentUpdateParams`.
|
|
11062
11134
|
* @param options - Per-request options.
|
|
11063
|
-
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
|
|
11135
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid, an edit has no values, or both `conditions` and `condition_edits` were sent.
|
|
11064
11136
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
11065
11137
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`). A segment used in a protected environment also needs `flags.protected.update` on it.
|
|
11066
11138
|
* @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: `SEGMENT_NOT_FOUND`: no such segment in this workspace.
|
|
@@ -11072,18 +11144,7 @@ declare class SegmentsResource extends APIResource {
|
|
|
11072
11144
|
* @see https://productcraft.co/docs/flags/api-reference#patch-v1-workspaces-workspace-id-segments-segment-id
|
|
11073
11145
|
* @example
|
|
11074
11146
|
* ```ts
|
|
11075
|
-
* const segmentDetail = await flags.segments.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {
|
|
11076
|
-
* conditions: [
|
|
11077
|
-
* {
|
|
11078
|
-
* user: {
|
|
11079
|
-
* attribute: "email",
|
|
11080
|
-
* comparator: "ends_with_any_hashed",
|
|
11081
|
-
* list_id: "3f0c6a3e-0f5e-4b8e-9d1a-2c7b9f1e8a10",
|
|
11082
|
-
* values_add: ["@beta.test"],
|
|
11083
|
-
* },
|
|
11084
|
-
* },
|
|
11085
|
-
* ],
|
|
11086
|
-
* });
|
|
11147
|
+
* const segmentDetail = await flags.segments.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { condition_edits: [{ condition_index: 0, values_add: ["qa-bot@example.com"] }] });
|
|
11087
11148
|
* ```
|
|
11088
11149
|
*/
|
|
11089
11150
|
update(segmentId: string, params?: SegmentUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<SegmentDetail>>;
|
|
@@ -11161,13 +11222,13 @@ declare class SettingsValuesResource extends APIResource {
|
|
|
11161
11222
|
/**
|
|
11162
11223
|
* Update a value
|
|
11163
11224
|
*
|
|
11164
|
-
* The quick edits: `value` (the toggle), `percentage_attribute`, and `clear_rules: true` to drop every rule and split so `value` is served to everyone (the kill switch). Send the `version` you read.
|
|
11225
|
+
* The quick edits: `value` (the toggle), `percentage_attribute`, `rule_edits` to add or remove values in a list condition of an existing rule (a tester, a QA account) without re-sending the other rules, and `clear_rules: true` to drop every rule and split so `value` is served to everyone (the kill switch). Send the `version` you read. A protected environment needs `flags.protected.update`; one change and one revision per request, none when nothing changed.
|
|
11165
11226
|
*
|
|
11166
11227
|
* @param settingId - Id of the setting.
|
|
11167
11228
|
* @param environmentId - Id of an environment of the same project.
|
|
11168
11229
|
* @param params - `Flags.SettingsValueUpdateParams`.
|
|
11169
11230
|
* @param options - Per-request options.
|
|
11170
|
-
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: nothing to change,
|
|
11231
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: nothing to change, `version` is missing, an edit has no values, or `rule_edits` sent with `clear_rules`.
|
|
11171
11232
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
11172
11233
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`). Value writes need `flags.value.update` on the environment and the setting, plus `flags.protected.update` in a protected environment.
|
|
11173
11234
|
* @throws {NotFoundError} 404 NOT_FOUND, SETTING_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `SETTING_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`.
|
package/dist/index.cjs
CHANGED
|
@@ -2,35 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkL3AOANTB_cjs = require('./chunk-L3AOANTB.cjs');
|
|
6
|
+
var chunkRJIVAOBG_cjs = require('./chunk-RJIVAOBG.cjs');
|
|
7
7
|
var core = require('@productcraft/core');
|
|
8
8
|
|
|
9
9
|
var FlagsErrorCode = { values: ["BAD_REQUEST", "VALIDATION_ERROR", "UNAUTHORIZED", "PAYMENT_REQUIRED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "GONE", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "UNPROCESSABLE_ENTITY", "PRECONDITION_REQUIRED", "RATE_LIMITED", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "BAD_GATEWAY", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT", "SERVICE_NOT_ENABLED", "INVALID_CREDENTIALS", "SESSION_REVOKED", "MCP_NOT_PERMITTED", "MCP_WORKSPACE_MISMATCH", "PAK_NOT_PERMITTED", "ACTIONS_NOT_GRANTABLE", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_KEY_REQUIRED", "IDEMPOTENCY_IN_PROGRESS", "WEBHOOK_ENDPOINT_LIMIT", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED", "WEBHOOK_EVENT_NOT_FOUND", "WEBHOOK_EVENT_TYPE_UNKNOWN", "PROJECT_NOT_FOUND", "ENVIRONMENT_NOT_FOUND", "CONFIG_NOT_FOUND", "SETTING_NOT_FOUND", "SEGMENT_NOT_FOUND", "CHANGE_NOT_FOUND", "REVISION_NOT_FOUND", "SDK_KEY_NOT_FOUND", "KEY_ALREADY_EXISTS", "LAST_ENVIRONMENT", "VERSION_CONFLICT", "SETTING_IN_USE", "SEGMENT_IN_USE", "CIRCULAR_PREREQUISITE", "PREREQUISITE_NOT_FOUND", "PREREQUISITE_TYPE_MISMATCH", "INVALID_VALUE", "INVALID_TARGETING", "PERCENTAGES_MUST_SUM_TO_100", "CONFIG_TOO_LARGE", "LIMIT_EXCEEDED", "CONFIRMATION_REQUIRED", "NOTE_REQUIRED", "CONFIDENTIAL_LIST_NOT_EDITABLE", "REVERT_NOT_SUPPORTED", "NOTHING_TO_RESTORE", "EVALUATION_BUDGET_EXCEEDED", "MANAGEMENT_UNAVAILABLE", "IMPORT_CREDENTIALS_INVALID", "IMPORT_SOURCE_UNAVAILABLE", "IMPORT_SOURCE_NOT_FOUND", "IMPORT_UNSUPPORTED", "IMPORT_EXCEEDS_LIMITS", "OWNER_NOT_A_MEMBER", "SETTING_TYPE_IMMUTABLE"] };
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "FlagsClient", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkL3AOANTB_cjs.FlagsClient; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FlagsClientError", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkL3AOANTB_cjs.FlagsClientError; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FlagsSnapshot", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkL3AOANTB_cjs.FlagsSnapshot; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "MAX_CONFIG_BYTES", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkL3AOANTB_cjs.MAX_CONFIG_BYTES; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "Flags", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkRJIVAOBG_cjs.Flags; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "default", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkRJIVAOBG_cjs.Flags; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "APIConnectionError", {
|
|
36
36
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { F as Flags, a as FlagsErrorCode, c as components, F as default, p as paths } from './client-
|
|
1
|
+
export { F as Flags, a as FlagsErrorCode, c as components, F as default, p as paths } from './client-BWi7PASW.cjs';
|
|
2
2
|
export { APIConnectionError, APIError, APIPromise, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ClientOptions, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, LastResponse, NotFoundError, Page, PagePromise, PaymentRequiredError, PermissionDeniedError, PollOptions, ProductCraftError, RateLimitError, RateLimitInfo, RequestOptions, UnprocessableEntityError, WebhookVerificationError, WithResponse } from '@productcraft/core';
|
|
3
|
-
export { A as AutoPolling, C as ClientState, a as ConfigChangedEvent, b as ConfigSource, F as FlagValue, c as FlagsCache, d as FlagsClient, e as FlagsClientError, f as FlagsClientErrorCode, g as FlagsClientEvents, h as FlagsClientOptions, i as FlagsOverrides, j as FlagsSnapshot, L as LazyPolling, M as MAX_CONFIG_BYTES, k as ManualPolling, O as OverrideBehaviour, l as OverrideValue, P as PollingOptions } from './client-
|
|
4
|
-
export { ErrorCode, EvaluationDetails, Reason, SettingType, SettingValue, User, UserAttributeValue, Warning, WarningCode } from '@productcraft/flags-engine';
|
|
3
|
+
export { A as AutoPolling, C as ClientState, a as ConfigChangedEvent, b as ConfigSource, F as FlagValue, c as FlagsCache, d as FlagsClient, e as FlagsClientError, f as FlagsClientErrorCode, g as FlagsClientEvents, h as FlagsClientOptions, i as FlagsOverrides, j as FlagsSnapshot, L as LazyPolling, M as MAX_CONFIG_BYTES, k as ManualPolling, O as OverrideBehaviour, l as OverrideValue, P as PollingOptions } from './client-BBiIKiGW.cjs';
|
|
4
|
+
export { ErrorCode, EvaluationDetails, Reason, SettingType, SettingValue, User, UserAttributeValue, UserAttributes, UserInput, Warning, WarningCode } from '@productcraft/flags-engine';
|
|
5
5
|
import 'openapi-fetch';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { F as Flags, a as FlagsErrorCode, c as components, F as default, p as paths } from './client-
|
|
1
|
+
export { F as Flags, a as FlagsErrorCode, c as components, F as default, p as paths } from './client-BWi7PASW.js';
|
|
2
2
|
export { APIConnectionError, APIError, APIPromise, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ClientOptions, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, LastResponse, NotFoundError, Page, PagePromise, PaymentRequiredError, PermissionDeniedError, PollOptions, ProductCraftError, RateLimitError, RateLimitInfo, RequestOptions, UnprocessableEntityError, WebhookVerificationError, WithResponse } from '@productcraft/core';
|
|
3
|
-
export { A as AutoPolling, C as ClientState, a as ConfigChangedEvent, b as ConfigSource, F as FlagValue, c as FlagsCache, d as FlagsClient, e as FlagsClientError, f as FlagsClientErrorCode, g as FlagsClientEvents, h as FlagsClientOptions, i as FlagsOverrides, j as FlagsSnapshot, L as LazyPolling, M as MAX_CONFIG_BYTES, k as ManualPolling, O as OverrideBehaviour, l as OverrideValue, P as PollingOptions } from './client-
|
|
4
|
-
export { ErrorCode, EvaluationDetails, Reason, SettingType, SettingValue, User, UserAttributeValue, Warning, WarningCode } from '@productcraft/flags-engine';
|
|
3
|
+
export { A as AutoPolling, C as ClientState, a as ConfigChangedEvent, b as ConfigSource, F as FlagValue, c as FlagsCache, d as FlagsClient, e as FlagsClientError, f as FlagsClientErrorCode, g as FlagsClientEvents, h as FlagsClientOptions, i as FlagsOverrides, j as FlagsSnapshot, L as LazyPolling, M as MAX_CONFIG_BYTES, k as ManualPolling, O as OverrideBehaviour, l as OverrideValue, P as PollingOptions } from './client-BBiIKiGW.js';
|
|
4
|
+
export { ErrorCode, EvaluationDetails, Reason, SettingType, SettingValue, User, UserAttributeValue, UserAttributes, UserInput, Warning, WarningCode } from '@productcraft/flags-engine';
|
|
5
5
|
import 'openapi-fetch';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { FlagsClient, FlagsClientError, FlagsSnapshot, MAX_CONFIG_BYTES } from './chunk-
|
|
2
|
-
export { Flags, Flags as default } from './chunk-
|
|
1
|
+
export { FlagsClient, FlagsClientError, FlagsSnapshot, MAX_CONFIG_BYTES } from './chunk-CGVDMKEE.js';
|
|
2
|
+
export { Flags, Flags as default } from './chunk-XNJ5OX4X.js';
|
|
3
3
|
export { APIConnectionError, APIError, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, NotFoundError, PaymentRequiredError, PermissionDeniedError, ProductCraftError, RateLimitError, UnprocessableEntityError, WebhookVerificationError } from '@productcraft/core';
|
|
4
4
|
|
|
5
5
|
var FlagsErrorCode = { values: ["BAD_REQUEST", "VALIDATION_ERROR", "UNAUTHORIZED", "PAYMENT_REQUIRED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "GONE", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "UNPROCESSABLE_ENTITY", "PRECONDITION_REQUIRED", "RATE_LIMITED", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "BAD_GATEWAY", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT", "SERVICE_NOT_ENABLED", "INVALID_CREDENTIALS", "SESSION_REVOKED", "MCP_NOT_PERMITTED", "MCP_WORKSPACE_MISMATCH", "PAK_NOT_PERMITTED", "ACTIONS_NOT_GRANTABLE", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_KEY_REQUIRED", "IDEMPOTENCY_IN_PROGRESS", "WEBHOOK_ENDPOINT_LIMIT", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED", "WEBHOOK_EVENT_NOT_FOUND", "WEBHOOK_EVENT_TYPE_UNKNOWN", "PROJECT_NOT_FOUND", "ENVIRONMENT_NOT_FOUND", "CONFIG_NOT_FOUND", "SETTING_NOT_FOUND", "SEGMENT_NOT_FOUND", "CHANGE_NOT_FOUND", "REVISION_NOT_FOUND", "SDK_KEY_NOT_FOUND", "KEY_ALREADY_EXISTS", "LAST_ENVIRONMENT", "VERSION_CONFLICT", "SETTING_IN_USE", "SEGMENT_IN_USE", "CIRCULAR_PREREQUISITE", "PREREQUISITE_NOT_FOUND", "PREREQUISITE_TYPE_MISMATCH", "INVALID_VALUE", "INVALID_TARGETING", "PERCENTAGES_MUST_SUM_TO_100", "CONFIG_TOO_LARGE", "LIMIT_EXCEEDED", "CONFIRMATION_REQUIRED", "NOTE_REQUIRED", "CONFIDENTIAL_LIST_NOT_EDITABLE", "REVERT_NOT_SUPPORTED", "NOTHING_TO_RESTORE", "EVALUATION_BUDGET_EXCEEDED", "MANAGEMENT_UNAVAILABLE", "IMPORT_CREDENTIALS_INVALID", "IMPORT_SOURCE_UNAVAILABLE", "IMPORT_SOURCE_NOT_FOUND", "IMPORT_UNSUPPORTED", "IMPORT_EXCEEDS_LIMITS", "OWNER_NOT_A_MEMBER", "SETTING_TYPE_IMMUTABLE"] };
|
package/dist/management.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRJIVAOBG_cjs = require('./chunk-RJIVAOBG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Flags", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkRJIVAOBG_cjs.Flags; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=management.cjs.map
|
|
12
12
|
//# sourceMappingURL=management.cjs.map
|
package/dist/management.d.cts
CHANGED
package/dist/management.d.ts
CHANGED
package/dist/management.js
CHANGED
package/dist/testing.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkL3AOANTB_cjs = require('./chunk-L3AOANTB.cjs');
|
|
4
4
|
var core = require('@productcraft/core');
|
|
5
5
|
|
|
6
6
|
var ROUTES = [
|
|
@@ -1289,10 +1289,10 @@ function createMockFetch(overrides = {}) {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
|
|
1291
1291
|
// src/client/testing.ts
|
|
1292
|
-
var TestFlagsClient = class extends
|
|
1292
|
+
var TestFlagsClient = class extends chunkL3AOANTB_cjs.FlagsClient {
|
|
1293
1293
|
/** Changes one value; emits `configChanged`. */
|
|
1294
1294
|
set(key, value) {
|
|
1295
|
-
|
|
1295
|
+
chunkL3AOANTB_cjs.setOverride(this, key, value);
|
|
1296
1296
|
}
|
|
1297
1297
|
};
|
|
1298
1298
|
function createTestClient(options = {}) {
|