@naturalcycles/abba 2.12.0 → 2.13.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/dist/abba.d.ts CHANGED
@@ -32,6 +32,9 @@ export declare class Abba {
32
32
  * Cold method.
33
33
  */
34
34
  saveExperiment(experiment: Experiment, buckets: (Unsaved<Bucket> | BucketInput)[]): Promise<ExperimentWithBuckets>;
35
+ /**
36
+ * Ensures that mutual exclusions are maintained
37
+ */
35
38
  private updateExclusions;
36
39
  softDeleteExperiment(experimentId: string): Promise<void>;
37
40
  /**
@@ -12,6 +12,9 @@ type ExperimentDBM = BaseExperiment & {
12
12
  data: string | null;
13
13
  };
14
14
  export interface GetAllExperimentsOpts {
15
+ /**
16
+ * Defaults to true.
17
+ */
15
18
  includeDeleted?: boolean;
16
19
  }
17
20
  export {};
@@ -1,8 +1,9 @@
1
1
  import { CommonDao } from '@naturalcycles/db-lib/dao';
2
2
  import { localDate } from '@naturalcycles/js-lib/datetime';
3
3
  export class ExperimentDao extends CommonDao {
4
- async getAllExperiments(opt) {
5
- if (!opt?.includeDeleted) {
4
+ async getAllExperiments(opt = {}) {
5
+ const { includeDeleted = true } = opt;
6
+ if (includeDeleted) {
6
7
  return await this.getAll();
7
8
  }
8
9
  return await this.query().filterEq('deleted', false).runQuery();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/abba",
3
3
  "type": "module",
4
- "version": "2.12.0",
4
+ "version": "2.13.0",
5
5
  "dependencies": {
6
6
  "@naturalcycles/db-lib": "^10",
7
7
  "@naturalcycles/js-lib": "^15",
@@ -10,9 +10,9 @@
10
10
  "tslib": "^2"
11
11
  },
12
12
  "devDependencies": {
13
+ "@naturalcycles/dev-lib": "0.0.0",
13
14
  "@types/semver": "^7",
14
- "@typescript/native-preview": "beta",
15
- "@naturalcycles/dev-lib": "18.4.2"
15
+ "typescript": "^7"
16
16
  },
17
17
  "exports": {
18
18
  ".": "./dist/index.js"
@@ -36,7 +36,7 @@
36
36
  "directory": "packages/abba"
37
37
  },
38
38
  "engines": {
39
- "node": ">=24.10.0"
39
+ "node": ">=26.12.1"
40
40
  },
41
41
  "description": "AB test assignment configuration tool for Node.js",
42
42
  "author": "Natural Cycles Team",
@@ -5,8 +5,9 @@ import type { IsoDate } from '@naturalcycles/js-lib/types'
5
5
  import type { BaseExperiment, Experiment } from '../types.js'
6
6
 
7
7
  export class ExperimentDao extends CommonDao<Experiment, ExperimentDBM> {
8
- async getAllExperiments(opt?: GetAllExperimentsOpts): Promise<Experiment[]> {
9
- if (!opt?.includeDeleted) {
8
+ async getAllExperiments(opt: GetAllExperimentsOpts = {}): Promise<Experiment[]> {
9
+ const { includeDeleted = true } = opt
10
+ if (includeDeleted) {
10
11
  return await this.getAll()
11
12
  }
12
13
 
@@ -59,5 +60,8 @@ type ExperimentDBM = BaseExperiment & {
59
60
  }
60
61
 
61
62
  export interface GetAllExperimentsOpts {
63
+ /**
64
+ * Defaults to true.
65
+ */
62
66
  includeDeleted?: boolean
63
67
  }