@oursprivacy/platform-sdk 1.29.0 → 1.30.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.
@@ -659,9 +659,10 @@ export interface ExperimentVariantCreateParams {
659
659
  name: string;
660
660
 
661
661
  /**
662
- * Traffic weight to assign to this variant. Weights are relative shares; the
663
- * runtime normalizes by their sum. Must be a positive integer in the range
664
- * 1..1_000_000.
662
+ * Traffic weight for this variant as a percentage (0–100). Treatment weights are
663
+ * percentages of the split and must total 99% or less to leave room for the
664
+ * control; the control variant is the remainder (100 − Σ treatment weights, always
665
+ * ≥ 1%) and is maintained automatically.
665
666
  */
666
667
  weight: number;
667
668
 
@@ -673,11 +674,11 @@ export interface ExperimentVariantCreateParams {
673
674
 
674
675
  /**
675
676
  * Mark this variant as the experiment control. Defaults to `false`. The API
676
- * rejects the request with 409 if the experiment already has a control variant —
677
- * to swap controls, first PATCH the existing control to clear `isControl`, then
678
- * create or PATCH the new one with `isControl: true`. The auto-generated control
679
- * variant created with each new experiment can be replaced this way. DELETE on the
680
- * control returns 409.
677
+ * rejects the request with 409 if the experiment already has a control variant.
678
+ * Every experiment keeps exactly one control whose weight is the auto-derived
679
+ * remainder of the split, so the control cannot be cleared while it would leave
680
+ * the treatments at 100% (no room for a control). DELETE on the control
681
+ * returns 409.
681
682
  */
682
683
  isControl?: boolean | null;
683
684
 
@@ -776,8 +777,9 @@ export interface ExperimentVariantUpdateParams {
776
777
 
777
778
  /**
778
779
  * Promote or demote this variant as the control. Promoting a second variant while
779
- * another already has `isControl: true` is rejected with 409 — clear the existing
780
- * control first.
780
+ * another already has `isControl: true` is rejected with 409. Demoting the control
781
+ * (`isControl: false`) is rejected when it would leave the treatments at 100% —
782
+ * there must always be room for a control.
781
783
  */
782
784
  isControl?: boolean | null;
783
785
 
@@ -802,8 +804,9 @@ export interface ExperimentVariantUpdateParams {
802
804
  variantType?: 'dom_modifications' | 'redirect' | null;
803
805
 
804
806
  /**
805
- * Updated traffic weight relative to other variants. Must be a positive integer in
806
- * the range 1..1_000_000.
807
+ * Updated traffic weight as a percentage (0–100). The control variant weight is
808
+ * derived from the treatments (it is the remainder of the split) and cannot be set
809
+ * directly.
807
810
  */
808
811
  weight?: number | null;
809
812
  }
@@ -2186,6 +2186,15 @@ export interface ExperimentCreateParams {
2186
2186
  */
2187
2187
  name: string;
2188
2188
 
2189
+ /**
2190
+ * Weight of the auto-created control variant, as a percentage (1–100). Defaults to
2191
+ * 100 (a new experiment is all control until treatments are added). The control
2192
+ * must keep at least 1% — a 0% control leaves visitors with no bucket to assign at
2193
+ * runtime. As treatments are added the control is reconciled to the remainder (100
2194
+ * − Σ treatment weights), so it normally does not need to be set explicitly.
2195
+ */
2196
+ controlWeight?: number | null;
2197
+
2189
2198
  /**
2190
2199
  * Optional hypothesis or operator note.
2191
2200
  */
@@ -82,6 +82,7 @@ export interface SourceListResponse {
82
82
  type:
83
83
  | 'AlchemerWebhook'
84
84
  | 'AndroidNativeApi'
85
+ | 'Branch'
85
86
  | 'CSharpApi'
86
87
  | 'CalComWebhooks'
87
88
  | 'CalendlyWebhook'
@@ -171,6 +172,7 @@ export interface SourceCreateResponse {
171
172
  type:
172
173
  | 'AlchemerWebhook'
173
174
  | 'AndroidNativeApi'
175
+ | 'Branch'
174
176
  | 'CSharpApi'
175
177
  | 'CalComWebhooks'
176
178
  | 'CalendlyWebhook'
@@ -260,6 +262,7 @@ export interface SourceRetrieveResponse {
260
262
  type:
261
263
  | 'AlchemerWebhook'
262
264
  | 'AndroidNativeApi'
265
+ | 'Branch'
263
266
  | 'CSharpApi'
264
267
  | 'CalComWebhooks'
265
268
  | 'CalendlyWebhook'
@@ -349,6 +352,7 @@ export interface SourceUpdateResponse {
349
352
  type:
350
353
  | 'AlchemerWebhook'
351
354
  | 'AndroidNativeApi'
355
+ | 'Branch'
352
356
  | 'CSharpApi'
353
357
  | 'CalComWebhooks'
354
358
  | 'CalendlyWebhook'
@@ -517,6 +521,7 @@ export interface SourceListParams extends CursorParams {
517
521
  type?:
518
522
  | 'AlchemerWebhook'
519
523
  | 'AndroidNativeApi'
524
+ | 'Branch'
520
525
  | 'CSharpApi'
521
526
  | 'CalComWebhooks'
522
527
  | 'CalendlyWebhook'
@@ -552,6 +557,7 @@ export interface SourceCreateParams {
552
557
  type:
553
558
  | 'AlchemerWebhook'
554
559
  | 'AndroidNativeApi'
560
+ | 'Branch'
555
561
  | 'CSharpApi'
556
562
  | 'CalComWebhooks'
557
563
  | 'CalendlyWebhook'
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.29.0'; // x-release-please-version
1
+ export const VERSION = '1.30.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.29.0";
1
+ export declare const VERSION = "1.30.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.29.0";
1
+ export declare const VERSION = "1.30.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.29.0'; // x-release-please-version
4
+ exports.VERSION = '1.30.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.29.0'; // x-release-please-version
1
+ export const VERSION = '1.30.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map