@naturalcycles/abba 2.9.0 → 2.10.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
@@ -41,6 +41,7 @@ export declare class Abba {
41
41
  * Cold method.
42
42
  */
43
43
  deleteExperiment(experimentId: string): Promise<void>;
44
+ getExperimentWithBuckets(experimentId: string): Promise<ExperimentWithBuckets | undefined>;
44
45
  /**
45
46
  * Get an assignment for a given user. If existingOnly is false, it will attempt to generate a new assignment
46
47
  * Cold method.
package/dist/abba.js CHANGED
@@ -156,6 +156,16 @@ export class Abba {
156
156
  await this.experimentDao.deleteById(experimentId);
157
157
  await this.updateExclusions(experimentId, []);
158
158
  }
159
+ async getExperimentWithBuckets(experimentId) {
160
+ const experiment = await this.experimentDao.getById(experimentId);
161
+ if (!experiment)
162
+ return;
163
+ const buckets = await this.bucketDao.getByExperimentId(experiment.id);
164
+ return {
165
+ ...experiment,
166
+ buckets,
167
+ };
168
+ }
159
169
  /**
160
170
  * Get an assignment for a given user. If existingOnly is false, it will attempt to generate a new assignment
161
171
  * Cold method.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/abba",
3
3
  "type": "module",
4
- "version": "2.9.0",
4
+ "version": "2.10.0",
5
5
  "dependencies": {
6
6
  "@naturalcycles/db-lib": "^10",
7
7
  "@naturalcycles/js-lib": "^15",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/semver": "^7",
14
- "@typescript/native-preview": "7.0.0-dev.20260401.1",
14
+ "@typescript/native-preview": "7.0.0-dev.20260415.1",
15
15
  "@naturalcycles/dev-lib": "18.4.2"
16
16
  },
17
17
  "exports": {
package/src/abba.ts CHANGED
@@ -242,6 +242,17 @@ export class Abba {
242
242
  await this.updateExclusions(experimentId, [])
243
243
  }
244
244
 
245
+ async getExperimentWithBuckets(experimentId: string): Promise<ExperimentWithBuckets | undefined> {
246
+ const experiment = await this.experimentDao.getById(experimentId)
247
+ if (!experiment) return
248
+
249
+ const buckets = await this.bucketDao.getByExperimentId(experiment.id)
250
+ return {
251
+ ...experiment,
252
+ buckets,
253
+ }
254
+ }
255
+
245
256
  /**
246
257
  * Get an assignment for a given user. If existingOnly is false, it will attempt to generate a new assignment
247
258
  * Cold method.