@fabricorg/experiments-api-client 0.1.0 → 0.1.1

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/index.d.cts CHANGED
@@ -158,6 +158,20 @@ declare class ApiClient {
158
158
  sharedJs?: string | undefined;
159
159
  sharedCss?: string | undefined;
160
160
  metadata?: Record<string, unknown> | undefined;
161
+ projectId?: string | undefined;
162
+ propertyId?: string | undefined;
163
+ featureId?: string | undefined;
164
+ environmentIds?: string[] | undefined;
165
+ workload?: {
166
+ kind: "sql" | "notebook" | "job" | "pipeline" | "model" | "feature-serving";
167
+ resourceId: string;
168
+ evaluationMode: "online" | "offline" | "shadow";
169
+ assignmentUnit: "user" | "request" | "job-run" | "table-partition";
170
+ resourceName?: string | undefined;
171
+ catalog?: string | undefined;
172
+ schema?: string | undefined;
173
+ tags?: Record<string, string> | undefined;
174
+ } | undefined;
161
175
  }>;
162
176
  invokeAction: (params: EndpointParams<"experiments.invokeAction">, orgId?: string) => Promise<{
163
177
  success: boolean;
@@ -177,6 +191,580 @@ declare class ApiClient {
177
191
  computedAt: string;
178
192
  }>;
179
193
  };
194
+ projects: {
195
+ list: (orgId?: string) => Promise<{
196
+ projects: {
197
+ name: string;
198
+ key: string;
199
+ kind: "project";
200
+ id: string;
201
+ tenantId: string;
202
+ createdAt: string;
203
+ updatedAt: string;
204
+ description?: string | undefined;
205
+ }[];
206
+ }>;
207
+ create: (params: EndpointParams<"projects.create">, orgId?: string) => Promise<{
208
+ name: string;
209
+ key: string;
210
+ kind: "project";
211
+ id: string;
212
+ tenantId: string;
213
+ createdAt: string;
214
+ updatedAt: string;
215
+ description?: string | undefined;
216
+ }>;
217
+ };
218
+ properties: {
219
+ list: (projectId: string, orgId?: string) => Promise<{
220
+ properties: {
221
+ name: string;
222
+ key: string;
223
+ kind: "property";
224
+ id: string;
225
+ tenantId: string;
226
+ projectId: string;
227
+ createdAt: string;
228
+ updatedAt: string;
229
+ platform: "web" | "server" | "mobile" | "databricks";
230
+ origins: string[];
231
+ description?: string | undefined;
232
+ }[];
233
+ }>;
234
+ create: (projectId: string, params: EndpointParams<"properties.create">, orgId?: string) => Promise<{
235
+ name: string;
236
+ key: string;
237
+ kind: "property";
238
+ id: string;
239
+ tenantId: string;
240
+ projectId: string;
241
+ createdAt: string;
242
+ updatedAt: string;
243
+ platform: "web" | "server" | "mobile" | "databricks";
244
+ origins: string[];
245
+ description?: string | undefined;
246
+ }>;
247
+ };
248
+ environments: {
249
+ list: (projectId: string, orgId?: string) => Promise<{
250
+ environments: {
251
+ name: string;
252
+ key: string;
253
+ kind: "environment";
254
+ id: string;
255
+ tenantId: string;
256
+ projectId: string;
257
+ createdAt: string;
258
+ updatedAt: string;
259
+ tier: "development" | "staging" | "production";
260
+ rank: number;
261
+ requiresApproval: boolean;
262
+ description?: string | undefined;
263
+ }[];
264
+ }>;
265
+ create: (projectId: string, params: EndpointParams<"environments.create">, orgId?: string) => Promise<{
266
+ name: string;
267
+ key: string;
268
+ kind: "environment";
269
+ id: string;
270
+ tenantId: string;
271
+ projectId: string;
272
+ createdAt: string;
273
+ updatedAt: string;
274
+ tier: "development" | "staging" | "production";
275
+ rank: number;
276
+ requiresApproval: boolean;
277
+ description?: string | undefined;
278
+ }>;
279
+ publish: (environmentId: string, orgId?: string) => Promise<{
280
+ status: "published";
281
+ kind: "publication";
282
+ id: string;
283
+ tenantId: string;
284
+ manifestVersion: number;
285
+ environmentId: string;
286
+ version: number;
287
+ resourceHash: string;
288
+ publishedBy: string;
289
+ publishedAt: string;
290
+ snapshot: {
291
+ features: {
292
+ archived: boolean;
293
+ name: string;
294
+ key: string;
295
+ kind: "feature";
296
+ id: string;
297
+ tenantId: string;
298
+ projectId: string;
299
+ createdAt: string;
300
+ updatedAt: string;
301
+ valueType: "string" | "number" | "boolean" | "json";
302
+ defaultValue: string | number | boolean | unknown[] | Record<string, unknown>;
303
+ description?: string | undefined;
304
+ propertyId?: string | undefined;
305
+ }[];
306
+ rules: {
307
+ name: string;
308
+ kind: "rule";
309
+ id: string;
310
+ tenantId: string;
311
+ featureId: string;
312
+ createdAt: string;
313
+ updatedAt: string;
314
+ environmentId: string;
315
+ enabled: boolean;
316
+ priority: number;
317
+ rolloutPercentage: number;
318
+ value?: string | number | boolean | unknown[] | Record<string, unknown> | undefined;
319
+ audience?: unknown;
320
+ variants?: {
321
+ name: string;
322
+ key: string;
323
+ weight?: number | undefined;
324
+ js?: string | undefined;
325
+ css?: string | undefined;
326
+ domOps?: ({
327
+ value: string;
328
+ op: "replaceText";
329
+ selector: string;
330
+ waitForMs?: number | undefined;
331
+ } | {
332
+ value: string;
333
+ op: "replaceHTML";
334
+ selector: string;
335
+ waitForMs?: number | undefined;
336
+ } | {
337
+ value: string;
338
+ op: "setAttr";
339
+ selector: string;
340
+ name: string;
341
+ waitForMs?: number | undefined;
342
+ } | {
343
+ value: string;
344
+ op: "addClass";
345
+ selector: string;
346
+ waitForMs?: number | undefined;
347
+ } | {
348
+ value: string;
349
+ op: "removeClass";
350
+ selector: string;
351
+ waitForMs?: number | undefined;
352
+ } | {
353
+ value: string;
354
+ op: "setStyle";
355
+ selector: string;
356
+ name: string;
357
+ waitForMs?: number | undefined;
358
+ } | {
359
+ op: "remove";
360
+ selector: string;
361
+ waitForMs?: number | undefined;
362
+ } | {
363
+ value: string;
364
+ op: "injectCSS";
365
+ } | {
366
+ value: string;
367
+ op: "injectHTML";
368
+ selector: string;
369
+ position: "beforeend" | "afterbegin" | "beforebegin" | "afterend";
370
+ waitForMs?: number | undefined;
371
+ })[] | undefined;
372
+ recipeSampleRate?: number | undefined;
373
+ payload?: Record<string, unknown> | undefined;
374
+ }[] | undefined;
375
+ experimentId?: string | undefined;
376
+ }[];
377
+ };
378
+ }>;
379
+ publications: (environmentId: string, orgId?: string) => Promise<{
380
+ publications: {
381
+ status: "published";
382
+ kind: "publication";
383
+ id: string;
384
+ tenantId: string;
385
+ manifestVersion: number;
386
+ environmentId: string;
387
+ version: number;
388
+ resourceHash: string;
389
+ publishedBy: string;
390
+ publishedAt: string;
391
+ snapshot: {
392
+ features: {
393
+ archived: boolean;
394
+ name: string;
395
+ key: string;
396
+ kind: "feature";
397
+ id: string;
398
+ tenantId: string;
399
+ projectId: string;
400
+ createdAt: string;
401
+ updatedAt: string;
402
+ valueType: "string" | "number" | "boolean" | "json";
403
+ defaultValue: string | number | boolean | unknown[] | Record<string, unknown>;
404
+ description?: string | undefined;
405
+ propertyId?: string | undefined;
406
+ }[];
407
+ rules: {
408
+ name: string;
409
+ kind: "rule";
410
+ id: string;
411
+ tenantId: string;
412
+ featureId: string;
413
+ createdAt: string;
414
+ updatedAt: string;
415
+ environmentId: string;
416
+ enabled: boolean;
417
+ priority: number;
418
+ rolloutPercentage: number;
419
+ value?: string | number | boolean | unknown[] | Record<string, unknown> | undefined;
420
+ audience?: unknown;
421
+ variants?: {
422
+ name: string;
423
+ key: string;
424
+ weight?: number | undefined;
425
+ js?: string | undefined;
426
+ css?: string | undefined;
427
+ domOps?: ({
428
+ value: string;
429
+ op: "replaceText";
430
+ selector: string;
431
+ waitForMs?: number | undefined;
432
+ } | {
433
+ value: string;
434
+ op: "replaceHTML";
435
+ selector: string;
436
+ waitForMs?: number | undefined;
437
+ } | {
438
+ value: string;
439
+ op: "setAttr";
440
+ selector: string;
441
+ name: string;
442
+ waitForMs?: number | undefined;
443
+ } | {
444
+ value: string;
445
+ op: "addClass";
446
+ selector: string;
447
+ waitForMs?: number | undefined;
448
+ } | {
449
+ value: string;
450
+ op: "removeClass";
451
+ selector: string;
452
+ waitForMs?: number | undefined;
453
+ } | {
454
+ value: string;
455
+ op: "setStyle";
456
+ selector: string;
457
+ name: string;
458
+ waitForMs?: number | undefined;
459
+ } | {
460
+ op: "remove";
461
+ selector: string;
462
+ waitForMs?: number | undefined;
463
+ } | {
464
+ value: string;
465
+ op: "injectCSS";
466
+ } | {
467
+ value: string;
468
+ op: "injectHTML";
469
+ selector: string;
470
+ position: "beforeend" | "afterbegin" | "beforebegin" | "afterend";
471
+ waitForMs?: number | undefined;
472
+ })[] | undefined;
473
+ recipeSampleRate?: number | undefined;
474
+ payload?: Record<string, unknown> | undefined;
475
+ }[] | undefined;
476
+ experimentId?: string | undefined;
477
+ }[];
478
+ };
479
+ }[];
480
+ }>;
481
+ promote: (environmentId: string, params: EndpointParams<"environments.promote">, orgId?: string) => Promise<{
482
+ sourceEnvironmentId: string;
483
+ sourceVersion: number;
484
+ targetEnvironmentId: string;
485
+ promotedRuleCount: number;
486
+ }>;
487
+ configuration: (environmentId: string, orgId?: string) => Promise<{
488
+ status: "published";
489
+ kind: "publication";
490
+ id: string;
491
+ tenantId: string;
492
+ manifestVersion: number;
493
+ environmentId: string;
494
+ version: number;
495
+ resourceHash: string;
496
+ publishedBy: string;
497
+ publishedAt: string;
498
+ snapshot: {
499
+ features: {
500
+ archived: boolean;
501
+ name: string;
502
+ key: string;
503
+ kind: "feature";
504
+ id: string;
505
+ tenantId: string;
506
+ projectId: string;
507
+ createdAt: string;
508
+ updatedAt: string;
509
+ valueType: "string" | "number" | "boolean" | "json";
510
+ defaultValue: string | number | boolean | unknown[] | Record<string, unknown>;
511
+ description?: string | undefined;
512
+ propertyId?: string | undefined;
513
+ }[];
514
+ rules: {
515
+ name: string;
516
+ kind: "rule";
517
+ id: string;
518
+ tenantId: string;
519
+ featureId: string;
520
+ createdAt: string;
521
+ updatedAt: string;
522
+ environmentId: string;
523
+ enabled: boolean;
524
+ priority: number;
525
+ rolloutPercentage: number;
526
+ value?: string | number | boolean | unknown[] | Record<string, unknown> | undefined;
527
+ audience?: unknown;
528
+ variants?: {
529
+ name: string;
530
+ key: string;
531
+ weight?: number | undefined;
532
+ js?: string | undefined;
533
+ css?: string | undefined;
534
+ domOps?: ({
535
+ value: string;
536
+ op: "replaceText";
537
+ selector: string;
538
+ waitForMs?: number | undefined;
539
+ } | {
540
+ value: string;
541
+ op: "replaceHTML";
542
+ selector: string;
543
+ waitForMs?: number | undefined;
544
+ } | {
545
+ value: string;
546
+ op: "setAttr";
547
+ selector: string;
548
+ name: string;
549
+ waitForMs?: number | undefined;
550
+ } | {
551
+ value: string;
552
+ op: "addClass";
553
+ selector: string;
554
+ waitForMs?: number | undefined;
555
+ } | {
556
+ value: string;
557
+ op: "removeClass";
558
+ selector: string;
559
+ waitForMs?: number | undefined;
560
+ } | {
561
+ value: string;
562
+ op: "setStyle";
563
+ selector: string;
564
+ name: string;
565
+ waitForMs?: number | undefined;
566
+ } | {
567
+ op: "remove";
568
+ selector: string;
569
+ waitForMs?: number | undefined;
570
+ } | {
571
+ value: string;
572
+ op: "injectCSS";
573
+ } | {
574
+ value: string;
575
+ op: "injectHTML";
576
+ selector: string;
577
+ position: "beforeend" | "afterbegin" | "beforebegin" | "afterend";
578
+ waitForMs?: number | undefined;
579
+ })[] | undefined;
580
+ recipeSampleRate?: number | undefined;
581
+ payload?: Record<string, unknown> | undefined;
582
+ }[] | undefined;
583
+ experimentId?: string | undefined;
584
+ }[];
585
+ };
586
+ }>;
587
+ };
588
+ features: {
589
+ list: (projectId: string, orgId?: string) => Promise<{
590
+ features: {
591
+ archived: boolean;
592
+ name: string;
593
+ key: string;
594
+ kind: "feature";
595
+ id: string;
596
+ tenantId: string;
597
+ projectId: string;
598
+ createdAt: string;
599
+ updatedAt: string;
600
+ valueType: "string" | "number" | "boolean" | "json";
601
+ defaultValue: string | number | boolean | unknown[] | Record<string, unknown>;
602
+ description?: string | undefined;
603
+ propertyId?: string | undefined;
604
+ }[];
605
+ }>;
606
+ create: (projectId: string, params: EndpointParams<"features.create">, orgId?: string) => Promise<{
607
+ archived: boolean;
608
+ name: string;
609
+ key: string;
610
+ kind: "feature";
611
+ id: string;
612
+ tenantId: string;
613
+ projectId: string;
614
+ createdAt: string;
615
+ updatedAt: string;
616
+ valueType: "string" | "number" | "boolean" | "json";
617
+ defaultValue: string | number | boolean | unknown[] | Record<string, unknown>;
618
+ description?: string | undefined;
619
+ propertyId?: string | undefined;
620
+ }>;
621
+ };
622
+ rules: {
623
+ list: (featureId: string, orgId?: string) => Promise<{
624
+ rules: {
625
+ name: string;
626
+ kind: "rule";
627
+ id: string;
628
+ tenantId: string;
629
+ featureId: string;
630
+ createdAt: string;
631
+ updatedAt: string;
632
+ environmentId: string;
633
+ enabled: boolean;
634
+ priority: number;
635
+ rolloutPercentage: number;
636
+ value?: string | number | boolean | unknown[] | Record<string, unknown> | undefined;
637
+ audience?: unknown;
638
+ variants?: {
639
+ name: string;
640
+ key: string;
641
+ weight?: number | undefined;
642
+ js?: string | undefined;
643
+ css?: string | undefined;
644
+ domOps?: ({
645
+ value: string;
646
+ op: "replaceText";
647
+ selector: string;
648
+ waitForMs?: number | undefined;
649
+ } | {
650
+ value: string;
651
+ op: "replaceHTML";
652
+ selector: string;
653
+ waitForMs?: number | undefined;
654
+ } | {
655
+ value: string;
656
+ op: "setAttr";
657
+ selector: string;
658
+ name: string;
659
+ waitForMs?: number | undefined;
660
+ } | {
661
+ value: string;
662
+ op: "addClass";
663
+ selector: string;
664
+ waitForMs?: number | undefined;
665
+ } | {
666
+ value: string;
667
+ op: "removeClass";
668
+ selector: string;
669
+ waitForMs?: number | undefined;
670
+ } | {
671
+ value: string;
672
+ op: "setStyle";
673
+ selector: string;
674
+ name: string;
675
+ waitForMs?: number | undefined;
676
+ } | {
677
+ op: "remove";
678
+ selector: string;
679
+ waitForMs?: number | undefined;
680
+ } | {
681
+ value: string;
682
+ op: "injectCSS";
683
+ } | {
684
+ value: string;
685
+ op: "injectHTML";
686
+ selector: string;
687
+ position: "beforeend" | "afterbegin" | "beforebegin" | "afterend";
688
+ waitForMs?: number | undefined;
689
+ })[] | undefined;
690
+ recipeSampleRate?: number | undefined;
691
+ payload?: Record<string, unknown> | undefined;
692
+ }[] | undefined;
693
+ experimentId?: string | undefined;
694
+ }[];
695
+ }>;
696
+ create: (featureId: string, params: EndpointParams<"rules.create">, orgId?: string) => Promise<{
697
+ name: string;
698
+ kind: "rule";
699
+ id: string;
700
+ tenantId: string;
701
+ featureId: string;
702
+ createdAt: string;
703
+ updatedAt: string;
704
+ environmentId: string;
705
+ enabled: boolean;
706
+ priority: number;
707
+ rolloutPercentage: number;
708
+ value?: string | number | boolean | unknown[] | Record<string, unknown> | undefined;
709
+ audience?: unknown;
710
+ variants?: {
711
+ name: string;
712
+ key: string;
713
+ weight?: number | undefined;
714
+ js?: string | undefined;
715
+ css?: string | undefined;
716
+ domOps?: ({
717
+ value: string;
718
+ op: "replaceText";
719
+ selector: string;
720
+ waitForMs?: number | undefined;
721
+ } | {
722
+ value: string;
723
+ op: "replaceHTML";
724
+ selector: string;
725
+ waitForMs?: number | undefined;
726
+ } | {
727
+ value: string;
728
+ op: "setAttr";
729
+ selector: string;
730
+ name: string;
731
+ waitForMs?: number | undefined;
732
+ } | {
733
+ value: string;
734
+ op: "addClass";
735
+ selector: string;
736
+ waitForMs?: number | undefined;
737
+ } | {
738
+ value: string;
739
+ op: "removeClass";
740
+ selector: string;
741
+ waitForMs?: number | undefined;
742
+ } | {
743
+ value: string;
744
+ op: "setStyle";
745
+ selector: string;
746
+ name: string;
747
+ waitForMs?: number | undefined;
748
+ } | {
749
+ op: "remove";
750
+ selector: string;
751
+ waitForMs?: number | undefined;
752
+ } | {
753
+ value: string;
754
+ op: "injectCSS";
755
+ } | {
756
+ value: string;
757
+ op: "injectHTML";
758
+ selector: string;
759
+ position: "beforeend" | "afterbegin" | "beforebegin" | "afterend";
760
+ waitForMs?: number | undefined;
761
+ })[] | undefined;
762
+ recipeSampleRate?: number | undefined;
763
+ payload?: Record<string, unknown> | undefined;
764
+ }[] | undefined;
765
+ experimentId?: string | undefined;
766
+ }>;
767
+ };
180
768
  manifests: {
181
769
  publish: (orgId?: string) => Promise<{
182
770
  manifestVersion: number;