@naturalcycles/abba 1.15.5 → 1.15.7

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.js CHANGED
@@ -4,11 +4,11 @@ exports.Abba = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const js_lib_1 = require("@naturalcycles/js-lib");
6
6
  const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
7
- const types_1 = require("./types");
8
- const util_1 = require("./util");
7
+ const bucket_dao_1 = require("./dao/bucket.dao");
9
8
  const experiment_dao_1 = require("./dao/experiment.dao");
10
9
  const userAssignment_dao_1 = require("./dao/userAssignment.dao");
11
- const bucket_dao_1 = require("./dao/bucket.dao");
10
+ const types_1 = require("./types");
11
+ const util_1 = require("./util");
12
12
  /**
13
13
  * 10 minutes
14
14
  */
@@ -208,7 +208,7 @@ class Abba {
208
208
  return statistics;
209
209
  }
210
210
  }
211
+ exports.Abba = Abba;
211
212
  tslib_1.__decorate([
212
213
  (0, js_lib_1._AsyncMemo)({ cacheFactory: () => new nodejs_lib_1.LRUMemoCache({ ttl: CACHE_TTL, max: 1 }) })
213
214
  ], Abba.prototype, "getAllExperiments", null);
214
- exports.Abba = Abba;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from './types';
2
- export { Abba } from './abba';
2
+ export * from './abba';
package/dist/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Abba = void 0;
4
3
  const tslib_1 = require("tslib");
5
4
  tslib_1.__exportStar(require("./types"), exports);
6
- var abba_1 = require("./abba");
7
- Object.defineProperty(exports, "Abba", { enumerable: true, get: function () { return abba_1.Abba; } });
5
+ tslib_1.__exportStar(require("./abba"), exports);
package/dist/types.js CHANGED
@@ -15,7 +15,7 @@ var AssignmentStatus;
15
15
  * Will not return any assignments
16
16
  */
17
17
  AssignmentStatus[AssignmentStatus["Inactive"] = 3] = "Inactive";
18
- })(AssignmentStatus = exports.AssignmentStatus || (exports.AssignmentStatus = {}));
18
+ })(AssignmentStatus || (exports.AssignmentStatus = AssignmentStatus = {}));
19
19
  var SegmentationRuleOperator;
20
20
  (function (SegmentationRuleOperator) {
21
21
  SegmentationRuleOperator["IsSet"] = "isSet";
@@ -34,4 +34,4 @@ var SegmentationRuleOperator;
34
34
  * @deprecated
35
35
  */
36
36
  SegmentationRuleOperator["NotEquals"] = "!=";
37
- })(SegmentationRuleOperator = exports.SegmentationRuleOperator || (exports.SegmentationRuleOperator = {}));
37
+ })(SegmentationRuleOperator || (exports.SegmentationRuleOperator = SegmentationRuleOperator = {}));
package/dist/util.js CHANGED
@@ -127,7 +127,7 @@ exports.segmentationRuleMap = {
127
127
  const canGenerateNewAssignments = (experiment, exclusionSet) => {
128
128
  return (!exclusionSet.has(experiment.id) &&
129
129
  experiment.status === types_1.AssignmentStatus.Active &&
130
- (0, js_lib_1.localDate)().isBetween(experiment.startDateIncl, experiment.endDateExcl, '[)'));
130
+ (0, js_lib_1.localDateToday)().isBetween(experiment.startDateIncl, experiment.endDateExcl, '[)'));
131
131
  };
132
132
  exports.canGenerateNewAssignments = canGenerateNewAssignments;
133
133
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/abba",
3
- "version": "1.15.5",
3
+ "version": "1.15.7",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "build": "build",
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "@naturalcycles/db-lib": "^8.40.1",
11
11
  "@naturalcycles/js-lib": "^14.98.2",
12
- "@naturalcycles/nodejs-lib": "^12.70.1",
12
+ "@naturalcycles/nodejs-lib": "^13.1.2",
13
13
  "semver": "^7.3.5"
14
14
  },
15
15
  "devDependencies": {
package/src/abba.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { _assert, _AsyncMemo, _shuffle, pMap, Saved } from '@naturalcycles/js-lib'
2
2
  import { LRUMemoCache } from '@naturalcycles/nodejs-lib'
3
+ import { bucketDao } from './dao/bucket.dao'
4
+ import { experimentDao } from './dao/experiment.dao'
5
+ import { userAssignmentDao } from './dao/userAssignment.dao'
3
6
  import {
4
7
  AbbaConfig,
5
8
  AssignmentStatus,
@@ -16,9 +19,6 @@ import {
16
19
  getUserExclusionSet,
17
20
  validateTotalBucketRatio,
18
21
  } from './util'
19
- import { experimentDao } from './dao/experiment.dao'
20
- import { userAssignmentDao } from './dao/userAssignment.dao'
21
- import { bucketDao } from './dao/bucket.dao'
22
22
  import { SegmentationData, AssignmentStatistics } from '.'
23
23
 
24
24
  /**
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from './types'
2
- export { Abba } from './abba'
2
+ export * from './abba'
package/src/util.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { localDate, Saved } from '@naturalcycles/js-lib'
1
+ import { localDateToday, Saved } from '@naturalcycles/js-lib'
2
2
  import { satisfies } from 'semver'
3
3
  import {
4
4
  AssignmentStatus,
@@ -150,7 +150,7 @@ export const canGenerateNewAssignments = (
150
150
  return (
151
151
  !exclusionSet.has(experiment.id) &&
152
152
  experiment.status === AssignmentStatus.Active &&
153
- localDate().isBetween(experiment.startDateIncl, experiment.endDateExcl, '[)')
153
+ localDateToday().isBetween(experiment.startDateIncl, experiment.endDateExcl, '[)')
154
154
  )
155
155
  }
156
156