@naturalcycles/abba 2.3.3 → 2.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/dist/abba.d.ts +1 -1
- package/dist/abba.js +6 -2
- package/dist/dao/bucket.dao.d.ts +1 -1
- package/dist/dao/bucket.dao.js +1 -1
- package/dist/dao/experiment.dao.d.ts +1 -1
- package/dist/dao/experiment.dao.js +2 -2
- package/dist/dao/userAssignment.dao.d.ts +1 -1
- package/dist/dao/userAssignment.dao.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/util.js +1 -1
- package/package.json +1 -1
- package/src/abba.ts +7 -3
- package/src/dao/bucket.dao.ts +1 -1
- package/src/dao/experiment.dao.ts +3 -3
- package/src/dao/userAssignment.dao.ts +1 -1
- package/src/types.ts +1 -1
- package/src/util.ts +2 -2
package/dist/abba.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Unsaved } from '@naturalcycles/js-lib';
|
|
1
|
+
import type { Unsaved } from '@naturalcycles/js-lib/types';
|
|
2
2
|
import { type GetAllExperimentsOpts } from './dao/experiment.dao.js';
|
|
3
3
|
import type { AbbaConfig, Bucket, DecoratedUserAssignment, Experiment, ExperimentAssignmentStatistics, ExperimentWithBuckets, SegmentationData, UserExperiment } from './types.js';
|
|
4
4
|
export declare class Abba {
|
package/dist/abba.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { _shuffle } from '@naturalcycles/js-lib';
|
|
3
|
+
import { localTime } from '@naturalcycles/js-lib/datetime';
|
|
4
|
+
import { _Memo } from '@naturalcycles/js-lib/decorators';
|
|
5
|
+
import { _assert } from '@naturalcycles/js-lib/error';
|
|
6
|
+
import { pMap } from '@naturalcycles/js-lib/promise';
|
|
7
|
+
import { LRUMemoCache } from '@naturalcycles/nodejs-lib/lruMemoCache';
|
|
4
8
|
import { bucketDao } from './dao/bucket.dao.js';
|
|
5
9
|
import { experimentDao } from './dao/experiment.dao.js';
|
|
6
10
|
import { userAssignmentDao } from './dao/userAssignment.dao.js';
|
package/dist/dao/bucket.dao.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonDB } from '@naturalcycles/db-lib';
|
|
2
|
-
import { CommonDao } from '@naturalcycles/db-lib';
|
|
2
|
+
import { CommonDao } from '@naturalcycles/db-lib/dao';
|
|
3
3
|
import type { BaseBucket, Bucket } from '../types.js';
|
|
4
4
|
type BucketDBM = BaseBucket & {
|
|
5
5
|
data: string | null;
|
package/dist/dao/bucket.dao.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonDao } from '@naturalcycles/db-lib';
|
|
1
|
+
import { CommonDao } from '@naturalcycles/db-lib/dao';
|
|
2
2
|
export class BucketDao extends CommonDao {
|
|
3
3
|
async getByExperimentId(experimentId) {
|
|
4
4
|
return await this.query().filterEq('experimentId', experimentId).runQuery();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonDB } from '@naturalcycles/db-lib';
|
|
2
|
-
import { CommonDao } from '@naturalcycles/db-lib';
|
|
2
|
+
import { CommonDao } from '@naturalcycles/db-lib/dao';
|
|
3
3
|
import type { BaseExperiment, Experiment } from '../types.js';
|
|
4
4
|
export declare class ExperimentDao extends CommonDao<Experiment, ExperimentDBM> {
|
|
5
5
|
getAllExperiments(opt?: GetAllExperimentsOpts): Promise<Experiment[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonDao } from '@naturalcycles/db-lib';
|
|
2
|
-
import { localDate } from '@naturalcycles/js-lib';
|
|
1
|
+
import { CommonDao } from '@naturalcycles/db-lib/dao';
|
|
2
|
+
import { localDate } from '@naturalcycles/js-lib/datetime';
|
|
3
3
|
export class ExperimentDao extends CommonDao {
|
|
4
4
|
async getAllExperiments(opt) {
|
|
5
5
|
if (!opt?.includeDeleted) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonDB } from '@naturalcycles/db-lib';
|
|
2
|
-
import { CommonDao } from '@naturalcycles/db-lib';
|
|
2
|
+
import { CommonDao } from '@naturalcycles/db-lib/dao';
|
|
3
3
|
import type { UserAssignment } from '../types.js';
|
|
4
4
|
export declare class UserAssignmentDao extends CommonDao<UserAssignment> {
|
|
5
5
|
getUserAssignmentByExperimentId(userId: string, experimentId: string): Promise<UserAssignment | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonDao } from '@naturalcycles/db-lib';
|
|
1
|
+
import { CommonDao } from '@naturalcycles/db-lib/dao';
|
|
2
2
|
export class UserAssignmentDao extends CommonDao {
|
|
3
3
|
async getUserAssignmentByExperimentId(userId, experimentId) {
|
|
4
4
|
const query = this.query().filterEq('userId', userId).filterEq('experimentId', experimentId);
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonDB } from '@naturalcycles/db-lib';
|
|
2
|
-
import type { AnyObject, BaseDBEntity, IsoDate } from '@naturalcycles/js-lib';
|
|
2
|
+
import type { AnyObject, BaseDBEntity, IsoDate } from '@naturalcycles/js-lib/types';
|
|
3
3
|
export interface AbbaConfig {
|
|
4
4
|
db: CommonDB;
|
|
5
5
|
}
|
package/dist/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Unsaved } from '@naturalcycles/js-lib';
|
|
1
|
+
import type { Unsaved } from '@naturalcycles/js-lib/types';
|
|
2
2
|
import type { Bucket, ExclusionSet, Experiment, ExperimentWithBuckets, SegmentationData, SegmentationRule, SegmentationRuleFn, UserAssignment, UserExperiment } from './types.js';
|
|
3
3
|
import { SegmentationRuleOperator } from './types.js';
|
|
4
4
|
/**
|
package/dist/util.js
CHANGED
package/package.json
CHANGED
package/src/abba.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { _shuffle } from '@naturalcycles/js-lib'
|
|
2
|
+
import { localTime } from '@naturalcycles/js-lib/datetime'
|
|
3
|
+
import { _Memo } from '@naturalcycles/js-lib/decorators'
|
|
4
|
+
import { _assert } from '@naturalcycles/js-lib/error'
|
|
5
|
+
import { pMap } from '@naturalcycles/js-lib/promise'
|
|
6
|
+
import type { Unsaved } from '@naturalcycles/js-lib/types'
|
|
7
|
+
import { LRUMemoCache } from '@naturalcycles/nodejs-lib/lruMemoCache'
|
|
4
8
|
import { bucketDao } from './dao/bucket.dao.js'
|
|
5
9
|
import { experimentDao, type GetAllExperimentsOpts } from './dao/experiment.dao.js'
|
|
6
10
|
import { userAssignmentDao } from './dao/userAssignment.dao.js'
|
package/src/dao/bucket.dao.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommonDB } from '@naturalcycles/db-lib'
|
|
2
|
-
import { CommonDao } from '@naturalcycles/db-lib'
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { CommonDao } from '@naturalcycles/db-lib/dao'
|
|
3
|
+
import { localDate } from '@naturalcycles/js-lib/datetime'
|
|
4
|
+
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> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonDB } from '@naturalcycles/db-lib'
|
|
2
|
-
import { CommonDao } from '@naturalcycles/db-lib'
|
|
2
|
+
import { CommonDao } from '@naturalcycles/db-lib/dao'
|
|
3
3
|
import type { UserAssignment } from '../types.js'
|
|
4
4
|
|
|
5
5
|
export class UserAssignmentDao extends CommonDao<UserAssignment> {
|
package/src/types.ts
CHANGED
package/src/util.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { localDate } from '@naturalcycles/js-lib/datetime'
|
|
2
|
+
import type { Unsaved } from '@naturalcycles/js-lib/types'
|
|
3
3
|
import { satisfies } from 'semver'
|
|
4
4
|
import type {
|
|
5
5
|
Bucket,
|