@naturalcycles/abba 1.23.1 → 1.24.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.
@@ -4,6 +4,7 @@ import { BaseExperiment, Experiment } from '../types';
4
4
  type ExperimentDBM = Saved<BaseExperiment> & {
5
5
  rules: string | null;
6
6
  exclusions: string | null;
7
+ data: string | null;
7
8
  };
8
9
  export declare class ExperimentDao extends CommonDao<Experiment, ExperimentDBM> {
9
10
  }
@@ -18,6 +18,7 @@ const experimentDao = (db) => new ExperimentDao({
18
18
  exclusions: bm.exclusions.length
19
19
  ? JSON.stringify(bm.exclusions.map(exclusion => exclusion.toString()))
20
20
  : null,
21
+ data: bm.data ? JSON.stringify(bm.data) : null,
21
22
  }),
22
23
  beforeDBMToBM: dbm => ({
23
24
  ...dbm,
@@ -29,6 +30,7 @@ const experimentDao = (db) => new ExperimentDao({
29
30
  exclusions: (dbm.exclusions &&
30
31
  JSON.parse(dbm.exclusions).map((exclusion) => exclusion.toString())) ||
31
32
  [],
33
+ data: dbm.data ? JSON.parse(dbm.data) : null,
32
34
  }),
33
35
  },
34
36
  });
@@ -24,6 +24,7 @@ CREATE TABLE IF NOT EXISTS `Experiment` (
24
24
  `updated` INT NOT NULL,
25
25
  `rules` JSON NULL,
26
26
  `exclusions` JSON NULL,
27
+ `data` JSON NULL,
27
28
 
28
29
  PRIMARY KEY (`id`),
29
30
  UNIQUE INDEX `key_unique` (`key`)
package/dist/types.d.ts CHANGED
@@ -33,6 +33,7 @@ export type BaseExperiment = BaseDBEntity & {
33
33
  export type Experiment = BaseExperiment & {
34
34
  rules: SegmentationRule[];
35
35
  exclusions: string[];
36
+ data: AnyObject | null;
36
37
  };
37
38
  export type ExperimentWithBuckets = Saved<Experiment> & {
38
39
  buckets: Saved<Bucket>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/abba",
3
- "version": "1.23.1",
3
+ "version": "1.24.0",
4
4
  "scripts": {
5
5
  "prepare": "husky"
6
6
  },
@@ -5,6 +5,7 @@ import { BaseExperiment, Experiment } from '../types'
5
5
  type ExperimentDBM = Saved<BaseExperiment> & {
6
6
  rules: string | null
7
7
  exclusions: string | null
8
+ data: string | null
8
9
  }
9
10
 
10
11
  export class ExperimentDao extends CommonDao<Experiment, ExperimentDBM> {}
@@ -22,6 +23,7 @@ export const experimentDao = (db: CommonDB): ExperimentDao =>
22
23
  exclusions: bm.exclusions.length
23
24
  ? JSON.stringify(bm.exclusions.map(exclusion => exclusion.toString()))
24
25
  : null,
26
+ data: bm.data ? JSON.stringify(bm.data) : null,
25
27
  }),
26
28
  beforeDBMToBM: dbm => ({
27
29
  ...dbm,
@@ -34,6 +36,7 @@ export const experimentDao = (db: CommonDB): ExperimentDao =>
34
36
  (dbm.exclusions &&
35
37
  JSON.parse(dbm.exclusions).map((exclusion: string | number) => exclusion.toString())) ||
36
38
  [],
39
+ data: dbm.data ? JSON.parse(dbm.data) : null,
37
40
  }),
38
41
  },
39
42
  })
@@ -24,6 +24,7 @@ CREATE TABLE IF NOT EXISTS `Experiment` (
24
24
  `updated` INT NOT NULL,
25
25
  `rules` JSON NULL,
26
26
  `exclusions` JSON NULL,
27
+ `data` JSON NULL,
27
28
 
28
29
  PRIMARY KEY (`id`),
29
30
  UNIQUE INDEX `key_unique` (`key`)
package/src/types.ts CHANGED
@@ -36,6 +36,7 @@ export type BaseExperiment = BaseDBEntity & {
36
36
  export type Experiment = BaseExperiment & {
37
37
  rules: SegmentationRule[]
38
38
  exclusions: string[]
39
+ data: AnyObject | null
39
40
  }
40
41
 
41
42
  export type ExperimentWithBuckets = Saved<Experiment> & {