@casual-simulation/aux-records 3.6.0 → 3.7.0-alpha.17049743052
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/AuthController.d.ts +1 -2
- package/AuthController.js +5 -24
- package/AuthController.js.map +1 -1
- package/DataRecordsController.d.ts +4 -0
- package/DataRecordsController.js +21 -0
- package/DataRecordsController.js.map +1 -1
- package/DataRecordsStore.d.ts +5 -0
- package/DataRecordsStore.js.map +1 -1
- package/PolicyController.js +2 -1
- package/PolicyController.js.map +1 -1
- package/PolicyStore.d.ts +13 -0
- package/PolicyStore.js +16 -0
- package/PolicyStore.js.map +1 -1
- package/RecordsController.js +2 -2
- package/RecordsController.js.map +1 -1
- package/RecordsServer.d.ts +142 -4
- package/RecordsServer.js +205 -1
- package/RecordsServer.js.map +1 -1
- package/ServerConfig.d.ts +447 -0
- package/ServerConfig.js +54 -0
- package/ServerConfig.js.map +1 -1
- package/SubscriptionConfigBuilder.d.ts +3 -1
- package/SubscriptionConfigBuilder.js +10 -0
- package/SubscriptionConfigBuilder.js.map +1 -1
- package/SubscriptionConfiguration.d.ts +245 -1
- package/SubscriptionConfiguration.js +73 -19
- package/SubscriptionConfiguration.js.map +1 -1
- package/SubscriptionController.d.ts +1 -1
- package/SubscriptionController.js.map +1 -1
- package/TestUtils.js +1 -1
- package/TestUtils.js.map +1 -1
- package/crud/CrudRecordsController.d.ts +12 -8
- package/crud/CrudRecordsController.js +29 -12
- package/crud/CrudRecordsController.js.map +1 -1
- package/crud/CrudRecordsControllerTests.d.ts +5 -5
- package/crud/CrudRecordsControllerTests.js +128 -69
- package/crud/CrudRecordsControllerTests.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/notifications/NotificationRecordsController.d.ts +1 -1
- package/notifications/NotificationRecordsController.js.map +1 -1
- package/package.json +4 -3
- package/packages/PackageRecordsController.d.ts +1 -1
- package/packages/PackageRecordsController.js.map +1 -1
- package/queue/MemoryQueue.d.ts +24 -0
- package/queue/MemoryQueue.js +45 -0
- package/queue/MemoryQueue.js.map +1 -0
- package/queue/Queue.d.ts +12 -0
- package/queue/Queue.js +19 -0
- package/queue/Queue.js.map +1 -0
- package/queue/index.d.ts +2 -0
- package/queue/index.js +19 -0
- package/queue/index.js.map +1 -0
- package/search/MemorySearchInterface.d.ts +25 -0
- package/search/MemorySearchInterface.js +192 -0
- package/search/MemorySearchInterface.js.map +1 -0
- package/search/MemorySearchRecordsStore.d.ts +21 -0
- package/search/MemorySearchRecordsStore.js +80 -0
- package/search/MemorySearchRecordsStore.js.map +1 -0
- package/search/SearchInterface.d.ts +329 -0
- package/search/SearchInterface.js +19 -0
- package/search/SearchInterface.js.map +1 -0
- package/search/SearchRecordsController.d.ts +491 -0
- package/search/SearchRecordsController.js +521 -0
- package/search/SearchRecordsController.js.map +1 -0
- package/search/SearchRecordsStore.d.ts +176 -0
- package/search/SearchRecordsStore.js +2 -0
- package/search/SearchRecordsStore.js.map +1 -0
- package/search/SearchSyncProcessor.d.ts +162 -0
- package/search/SearchSyncProcessor.js +256 -0
- package/search/SearchSyncProcessor.js.map +1 -0
- package/search/TypesenseSearchInterface.d.ts +18 -0
- package/search/TypesenseSearchInterface.js +171 -0
- package/search/TypesenseSearchInterface.js.map +1 -0
- package/search/index.d.ts +7 -0
- package/search/index.js +24 -0
- package/search/index.js.map +1 -0
- package/webhooks/WebhookRecordsController.d.ts +3 -3
- package/webhooks/WebhookRecordsController.js +3 -3
- package/webhooks/WebhookRecordsController.js.map +1 -1
- package/websockets/WebsocketController.js +30 -25
- package/websockets/WebsocketController.js.map +1 -1
|
@@ -343,6 +343,16 @@ export declare const subscriptionFeaturesSchema: z.ZodObject<{
|
|
|
343
343
|
maxPackageVersionSizeInBytes?: number;
|
|
344
344
|
maxPackageBytesTotal?: number;
|
|
345
345
|
}>>>;
|
|
346
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
347
|
+
allowed: z.ZodBoolean;
|
|
348
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
349
|
+
}, "strip", z.ZodTypeAny, {
|
|
350
|
+
allowed?: boolean;
|
|
351
|
+
maxItems?: number;
|
|
352
|
+
}, {
|
|
353
|
+
allowed?: boolean;
|
|
354
|
+
maxItems?: number;
|
|
355
|
+
}>>>;
|
|
346
356
|
}, "strip", z.ZodTypeAny, {
|
|
347
357
|
records?: {
|
|
348
358
|
allowed?: boolean;
|
|
@@ -438,6 +448,10 @@ export declare const subscriptionFeaturesSchema: z.ZodObject<{
|
|
|
438
448
|
maxPackageVersionSizeInBytes?: number;
|
|
439
449
|
maxPackageBytesTotal?: number;
|
|
440
450
|
};
|
|
451
|
+
search?: {
|
|
452
|
+
allowed?: boolean;
|
|
453
|
+
maxItems?: number;
|
|
454
|
+
};
|
|
441
455
|
}, {
|
|
442
456
|
records?: {
|
|
443
457
|
allowed?: boolean;
|
|
@@ -533,6 +547,10 @@ export declare const subscriptionFeaturesSchema: z.ZodObject<{
|
|
|
533
547
|
maxPackageVersionSizeInBytes?: number;
|
|
534
548
|
maxPackageBytesTotal?: number;
|
|
535
549
|
};
|
|
550
|
+
search?: {
|
|
551
|
+
allowed?: boolean;
|
|
552
|
+
maxItems?: number;
|
|
553
|
+
};
|
|
536
554
|
}>;
|
|
537
555
|
export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
538
556
|
webhookSecret: z.ZodString;
|
|
@@ -892,6 +910,16 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
892
910
|
maxPackageVersionSizeInBytes?: number;
|
|
893
911
|
maxPackageBytesTotal?: number;
|
|
894
912
|
}>>>;
|
|
913
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
914
|
+
allowed: z.ZodBoolean;
|
|
915
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
916
|
+
}, "strip", z.ZodTypeAny, {
|
|
917
|
+
allowed?: boolean;
|
|
918
|
+
maxItems?: number;
|
|
919
|
+
}, {
|
|
920
|
+
allowed?: boolean;
|
|
921
|
+
maxItems?: number;
|
|
922
|
+
}>>>;
|
|
895
923
|
}, "strip", z.ZodTypeAny, {
|
|
896
924
|
records?: {
|
|
897
925
|
allowed?: boolean;
|
|
@@ -987,6 +1015,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
987
1015
|
maxPackageVersionSizeInBytes?: number;
|
|
988
1016
|
maxPackageBytesTotal?: number;
|
|
989
1017
|
};
|
|
1018
|
+
search?: {
|
|
1019
|
+
allowed?: boolean;
|
|
1020
|
+
maxItems?: number;
|
|
1021
|
+
};
|
|
990
1022
|
}, {
|
|
991
1023
|
records?: {
|
|
992
1024
|
allowed?: boolean;
|
|
@@ -1082,6 +1114,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
1082
1114
|
maxPackageVersionSizeInBytes?: number;
|
|
1083
1115
|
maxPackageBytesTotal?: number;
|
|
1084
1116
|
};
|
|
1117
|
+
search?: {
|
|
1118
|
+
allowed?: boolean;
|
|
1119
|
+
maxItems?: number;
|
|
1120
|
+
};
|
|
1085
1121
|
}>>;
|
|
1086
1122
|
}, "strip", z.ZodTypeAny, {
|
|
1087
1123
|
features?: {
|
|
@@ -1179,6 +1215,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
1179
1215
|
maxPackageVersionSizeInBytes?: number;
|
|
1180
1216
|
maxPackageBytesTotal?: number;
|
|
1181
1217
|
};
|
|
1218
|
+
search?: {
|
|
1219
|
+
allowed?: boolean;
|
|
1220
|
+
maxItems?: number;
|
|
1221
|
+
};
|
|
1182
1222
|
};
|
|
1183
1223
|
}, {
|
|
1184
1224
|
features?: {
|
|
@@ -1276,6 +1316,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
1276
1316
|
maxPackageVersionSizeInBytes?: number;
|
|
1277
1317
|
maxPackageBytesTotal?: number;
|
|
1278
1318
|
};
|
|
1319
|
+
search?: {
|
|
1320
|
+
allowed?: boolean;
|
|
1321
|
+
maxItems?: number;
|
|
1322
|
+
};
|
|
1279
1323
|
};
|
|
1280
1324
|
}>, z.objectOutputType<{}, z.ZodObject<{
|
|
1281
1325
|
features: z.ZodOptional<z.ZodObject<{
|
|
@@ -1591,6 +1635,16 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
1591
1635
|
maxPackageVersionSizeInBytes?: number;
|
|
1592
1636
|
maxPackageBytesTotal?: number;
|
|
1593
1637
|
}>>>;
|
|
1638
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1639
|
+
allowed: z.ZodBoolean;
|
|
1640
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
1641
|
+
}, "strip", z.ZodTypeAny, {
|
|
1642
|
+
allowed?: boolean;
|
|
1643
|
+
maxItems?: number;
|
|
1644
|
+
}, {
|
|
1645
|
+
allowed?: boolean;
|
|
1646
|
+
maxItems?: number;
|
|
1647
|
+
}>>>;
|
|
1594
1648
|
}, "strip", z.ZodTypeAny, {
|
|
1595
1649
|
records?: {
|
|
1596
1650
|
allowed?: boolean;
|
|
@@ -1686,6 +1740,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
1686
1740
|
maxPackageVersionSizeInBytes?: number;
|
|
1687
1741
|
maxPackageBytesTotal?: number;
|
|
1688
1742
|
};
|
|
1743
|
+
search?: {
|
|
1744
|
+
allowed?: boolean;
|
|
1745
|
+
maxItems?: number;
|
|
1746
|
+
};
|
|
1689
1747
|
}, {
|
|
1690
1748
|
records?: {
|
|
1691
1749
|
allowed?: boolean;
|
|
@@ -1781,6 +1839,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
1781
1839
|
maxPackageVersionSizeInBytes?: number;
|
|
1782
1840
|
maxPackageBytesTotal?: number;
|
|
1783
1841
|
};
|
|
1842
|
+
search?: {
|
|
1843
|
+
allowed?: boolean;
|
|
1844
|
+
maxItems?: number;
|
|
1845
|
+
};
|
|
1784
1846
|
}>>;
|
|
1785
1847
|
}, "strip", z.ZodTypeAny, {
|
|
1786
1848
|
features?: {
|
|
@@ -1878,6 +1940,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
1878
1940
|
maxPackageVersionSizeInBytes?: number;
|
|
1879
1941
|
maxPackageBytesTotal?: number;
|
|
1880
1942
|
};
|
|
1943
|
+
search?: {
|
|
1944
|
+
allowed?: boolean;
|
|
1945
|
+
maxItems?: number;
|
|
1946
|
+
};
|
|
1881
1947
|
};
|
|
1882
1948
|
}, {
|
|
1883
1949
|
features?: {
|
|
@@ -1975,6 +2041,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
1975
2041
|
maxPackageVersionSizeInBytes?: number;
|
|
1976
2042
|
maxPackageBytesTotal?: number;
|
|
1977
2043
|
};
|
|
2044
|
+
search?: {
|
|
2045
|
+
allowed?: boolean;
|
|
2046
|
+
maxItems?: number;
|
|
2047
|
+
};
|
|
1978
2048
|
};
|
|
1979
2049
|
}>, "strip">, z.objectInputType<{}, z.ZodObject<{
|
|
1980
2050
|
features: z.ZodOptional<z.ZodObject<{
|
|
@@ -2290,6 +2360,16 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
2290
2360
|
maxPackageVersionSizeInBytes?: number;
|
|
2291
2361
|
maxPackageBytesTotal?: number;
|
|
2292
2362
|
}>>>;
|
|
2363
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
2364
|
+
allowed: z.ZodBoolean;
|
|
2365
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
2366
|
+
}, "strip", z.ZodTypeAny, {
|
|
2367
|
+
allowed?: boolean;
|
|
2368
|
+
maxItems?: number;
|
|
2369
|
+
}, {
|
|
2370
|
+
allowed?: boolean;
|
|
2371
|
+
maxItems?: number;
|
|
2372
|
+
}>>>;
|
|
2293
2373
|
}, "strip", z.ZodTypeAny, {
|
|
2294
2374
|
records?: {
|
|
2295
2375
|
allowed?: boolean;
|
|
@@ -2385,6 +2465,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
2385
2465
|
maxPackageVersionSizeInBytes?: number;
|
|
2386
2466
|
maxPackageBytesTotal?: number;
|
|
2387
2467
|
};
|
|
2468
|
+
search?: {
|
|
2469
|
+
allowed?: boolean;
|
|
2470
|
+
maxItems?: number;
|
|
2471
|
+
};
|
|
2388
2472
|
}, {
|
|
2389
2473
|
records?: {
|
|
2390
2474
|
allowed?: boolean;
|
|
@@ -2480,6 +2564,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
2480
2564
|
maxPackageVersionSizeInBytes?: number;
|
|
2481
2565
|
maxPackageBytesTotal?: number;
|
|
2482
2566
|
};
|
|
2567
|
+
search?: {
|
|
2568
|
+
allowed?: boolean;
|
|
2569
|
+
maxItems?: number;
|
|
2570
|
+
};
|
|
2483
2571
|
}>>;
|
|
2484
2572
|
}, "strip", z.ZodTypeAny, {
|
|
2485
2573
|
features?: {
|
|
@@ -2577,6 +2665,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
2577
2665
|
maxPackageVersionSizeInBytes?: number;
|
|
2578
2666
|
maxPackageBytesTotal?: number;
|
|
2579
2667
|
};
|
|
2668
|
+
search?: {
|
|
2669
|
+
allowed?: boolean;
|
|
2670
|
+
maxItems?: number;
|
|
2671
|
+
};
|
|
2580
2672
|
};
|
|
2581
2673
|
}, {
|
|
2582
2674
|
features?: {
|
|
@@ -2674,6 +2766,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
2674
2766
|
maxPackageVersionSizeInBytes?: number;
|
|
2675
2767
|
maxPackageBytesTotal?: number;
|
|
2676
2768
|
};
|
|
2769
|
+
search?: {
|
|
2770
|
+
allowed?: boolean;
|
|
2771
|
+
maxItems?: number;
|
|
2772
|
+
};
|
|
2677
2773
|
};
|
|
2678
2774
|
}>, "strip">>>;
|
|
2679
2775
|
defaultFeatures: z.ZodOptional<z.ZodObject<{
|
|
@@ -2990,6 +3086,16 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
2990
3086
|
maxPackageVersionSizeInBytes?: number;
|
|
2991
3087
|
maxPackageBytesTotal?: number;
|
|
2992
3088
|
}>>>;
|
|
3089
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
3090
|
+
allowed: z.ZodBoolean;
|
|
3091
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
3092
|
+
}, "strip", z.ZodTypeAny, {
|
|
3093
|
+
allowed?: boolean;
|
|
3094
|
+
maxItems?: number;
|
|
3095
|
+
}, {
|
|
3096
|
+
allowed?: boolean;
|
|
3097
|
+
maxItems?: number;
|
|
3098
|
+
}>>>;
|
|
2993
3099
|
}, "strip", z.ZodTypeAny, {
|
|
2994
3100
|
records?: {
|
|
2995
3101
|
allowed?: boolean;
|
|
@@ -3085,6 +3191,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
3085
3191
|
maxPackageVersionSizeInBytes?: number;
|
|
3086
3192
|
maxPackageBytesTotal?: number;
|
|
3087
3193
|
};
|
|
3194
|
+
search?: {
|
|
3195
|
+
allowed?: boolean;
|
|
3196
|
+
maxItems?: number;
|
|
3197
|
+
};
|
|
3088
3198
|
}, {
|
|
3089
3199
|
records?: {
|
|
3090
3200
|
allowed?: boolean;
|
|
@@ -3180,6 +3290,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
3180
3290
|
maxPackageVersionSizeInBytes?: number;
|
|
3181
3291
|
maxPackageBytesTotal?: number;
|
|
3182
3292
|
};
|
|
3293
|
+
search?: {
|
|
3294
|
+
allowed?: boolean;
|
|
3295
|
+
maxItems?: number;
|
|
3296
|
+
};
|
|
3183
3297
|
}>>;
|
|
3184
3298
|
studio: z.ZodOptional<z.ZodObject<{
|
|
3185
3299
|
records: z.ZodOptional<z.ZodObject<{
|
|
@@ -3494,6 +3608,16 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
3494
3608
|
maxPackageVersionSizeInBytes?: number;
|
|
3495
3609
|
maxPackageBytesTotal?: number;
|
|
3496
3610
|
}>>>;
|
|
3611
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
3612
|
+
allowed: z.ZodBoolean;
|
|
3613
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
3614
|
+
}, "strip", z.ZodTypeAny, {
|
|
3615
|
+
allowed?: boolean;
|
|
3616
|
+
maxItems?: number;
|
|
3617
|
+
}, {
|
|
3618
|
+
allowed?: boolean;
|
|
3619
|
+
maxItems?: number;
|
|
3620
|
+
}>>>;
|
|
3497
3621
|
}, "strip", z.ZodTypeAny, {
|
|
3498
3622
|
records?: {
|
|
3499
3623
|
allowed?: boolean;
|
|
@@ -3589,6 +3713,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
3589
3713
|
maxPackageVersionSizeInBytes?: number;
|
|
3590
3714
|
maxPackageBytesTotal?: number;
|
|
3591
3715
|
};
|
|
3716
|
+
search?: {
|
|
3717
|
+
allowed?: boolean;
|
|
3718
|
+
maxItems?: number;
|
|
3719
|
+
};
|
|
3592
3720
|
}, {
|
|
3593
3721
|
records?: {
|
|
3594
3722
|
allowed?: boolean;
|
|
@@ -3684,6 +3812,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
3684
3812
|
maxPackageVersionSizeInBytes?: number;
|
|
3685
3813
|
maxPackageBytesTotal?: number;
|
|
3686
3814
|
};
|
|
3815
|
+
search?: {
|
|
3816
|
+
allowed?: boolean;
|
|
3817
|
+
maxItems?: number;
|
|
3818
|
+
};
|
|
3687
3819
|
}>>;
|
|
3688
3820
|
defaultPeriodLength: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
3689
3821
|
days: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3804,6 +3936,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
3804
3936
|
maxPackageVersionSizeInBytes?: number;
|
|
3805
3937
|
maxPackageBytesTotal?: number;
|
|
3806
3938
|
};
|
|
3939
|
+
search?: {
|
|
3940
|
+
allowed?: boolean;
|
|
3941
|
+
maxItems?: number;
|
|
3942
|
+
};
|
|
3807
3943
|
};
|
|
3808
3944
|
studio?: {
|
|
3809
3945
|
records?: {
|
|
@@ -3900,6 +4036,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
3900
4036
|
maxPackageVersionSizeInBytes?: number;
|
|
3901
4037
|
maxPackageBytesTotal?: number;
|
|
3902
4038
|
};
|
|
4039
|
+
search?: {
|
|
4040
|
+
allowed?: boolean;
|
|
4041
|
+
maxItems?: number;
|
|
4042
|
+
};
|
|
3903
4043
|
};
|
|
3904
4044
|
defaultPeriodLength?: {
|
|
3905
4045
|
days?: number;
|
|
@@ -4006,6 +4146,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
4006
4146
|
maxPackageVersionSizeInBytes?: number;
|
|
4007
4147
|
maxPackageBytesTotal?: number;
|
|
4008
4148
|
};
|
|
4149
|
+
search?: {
|
|
4150
|
+
allowed?: boolean;
|
|
4151
|
+
maxItems?: number;
|
|
4152
|
+
};
|
|
4009
4153
|
};
|
|
4010
4154
|
studio?: {
|
|
4011
4155
|
records?: {
|
|
@@ -4102,6 +4246,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
4102
4246
|
maxPackageVersionSizeInBytes?: number;
|
|
4103
4247
|
maxPackageBytesTotal?: number;
|
|
4104
4248
|
};
|
|
4249
|
+
search?: {
|
|
4250
|
+
allowed?: boolean;
|
|
4251
|
+
maxItems?: number;
|
|
4252
|
+
};
|
|
4105
4253
|
};
|
|
4106
4254
|
defaultPeriodLength?: {
|
|
4107
4255
|
days?: number;
|
|
@@ -4447,6 +4595,16 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
4447
4595
|
maxPackageVersionSizeInBytes?: number;
|
|
4448
4596
|
maxPackageBytesTotal?: number;
|
|
4449
4597
|
}>>>;
|
|
4598
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
4599
|
+
allowed: z.ZodBoolean;
|
|
4600
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
4601
|
+
}, "strip", z.ZodTypeAny, {
|
|
4602
|
+
allowed?: boolean;
|
|
4603
|
+
maxItems?: number;
|
|
4604
|
+
}, {
|
|
4605
|
+
allowed?: boolean;
|
|
4606
|
+
maxItems?: number;
|
|
4607
|
+
}>>>;
|
|
4450
4608
|
}, "strip", z.ZodTypeAny, {
|
|
4451
4609
|
records?: {
|
|
4452
4610
|
allowed?: boolean;
|
|
@@ -4542,6 +4700,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
4542
4700
|
maxPackageVersionSizeInBytes?: number;
|
|
4543
4701
|
maxPackageBytesTotal?: number;
|
|
4544
4702
|
};
|
|
4703
|
+
search?: {
|
|
4704
|
+
allowed?: boolean;
|
|
4705
|
+
maxItems?: number;
|
|
4706
|
+
};
|
|
4545
4707
|
}, {
|
|
4546
4708
|
records?: {
|
|
4547
4709
|
allowed?: boolean;
|
|
@@ -4637,6 +4799,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
4637
4799
|
maxPackageVersionSizeInBytes?: number;
|
|
4638
4800
|
maxPackageBytesTotal?: number;
|
|
4639
4801
|
};
|
|
4802
|
+
search?: {
|
|
4803
|
+
allowed?: boolean;
|
|
4804
|
+
maxItems?: number;
|
|
4805
|
+
};
|
|
4640
4806
|
}>>;
|
|
4641
4807
|
}, "strip", z.ZodTypeAny, {
|
|
4642
4808
|
features?: {
|
|
@@ -4734,6 +4900,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
4734
4900
|
maxPackageVersionSizeInBytes?: number;
|
|
4735
4901
|
maxPackageBytesTotal?: number;
|
|
4736
4902
|
};
|
|
4903
|
+
search?: {
|
|
4904
|
+
allowed?: boolean;
|
|
4905
|
+
maxItems?: number;
|
|
4906
|
+
};
|
|
4737
4907
|
};
|
|
4738
4908
|
}, {
|
|
4739
4909
|
features?: {
|
|
@@ -4831,6 +5001,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
4831
5001
|
maxPackageVersionSizeInBytes?: number;
|
|
4832
5002
|
maxPackageBytesTotal?: number;
|
|
4833
5003
|
};
|
|
5004
|
+
search?: {
|
|
5005
|
+
allowed?: boolean;
|
|
5006
|
+
maxItems?: number;
|
|
5007
|
+
};
|
|
4834
5008
|
};
|
|
4835
5009
|
}>, "strip">;
|
|
4836
5010
|
defaultFeatures?: {
|
|
@@ -4929,6 +5103,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
4929
5103
|
maxPackageVersionSizeInBytes?: number;
|
|
4930
5104
|
maxPackageBytesTotal?: number;
|
|
4931
5105
|
};
|
|
5106
|
+
search?: {
|
|
5107
|
+
allowed?: boolean;
|
|
5108
|
+
maxItems?: number;
|
|
5109
|
+
};
|
|
4932
5110
|
};
|
|
4933
5111
|
studio?: {
|
|
4934
5112
|
records?: {
|
|
@@ -5025,6 +5203,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
5025
5203
|
maxPackageVersionSizeInBytes?: number;
|
|
5026
5204
|
maxPackageBytesTotal?: number;
|
|
5027
5205
|
};
|
|
5206
|
+
search?: {
|
|
5207
|
+
allowed?: boolean;
|
|
5208
|
+
maxItems?: number;
|
|
5209
|
+
};
|
|
5028
5210
|
};
|
|
5029
5211
|
defaultPeriodLength?: {
|
|
5030
5212
|
days?: number;
|
|
@@ -5370,6 +5552,16 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
5370
5552
|
maxPackageVersionSizeInBytes?: number;
|
|
5371
5553
|
maxPackageBytesTotal?: number;
|
|
5372
5554
|
}>>>;
|
|
5555
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
5556
|
+
allowed: z.ZodBoolean;
|
|
5557
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
5558
|
+
}, "strip", z.ZodTypeAny, {
|
|
5559
|
+
allowed?: boolean;
|
|
5560
|
+
maxItems?: number;
|
|
5561
|
+
}, {
|
|
5562
|
+
allowed?: boolean;
|
|
5563
|
+
maxItems?: number;
|
|
5564
|
+
}>>>;
|
|
5373
5565
|
}, "strip", z.ZodTypeAny, {
|
|
5374
5566
|
records?: {
|
|
5375
5567
|
allowed?: boolean;
|
|
@@ -5465,6 +5657,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
5465
5657
|
maxPackageVersionSizeInBytes?: number;
|
|
5466
5658
|
maxPackageBytesTotal?: number;
|
|
5467
5659
|
};
|
|
5660
|
+
search?: {
|
|
5661
|
+
allowed?: boolean;
|
|
5662
|
+
maxItems?: number;
|
|
5663
|
+
};
|
|
5468
5664
|
}, {
|
|
5469
5665
|
records?: {
|
|
5470
5666
|
allowed?: boolean;
|
|
@@ -5560,6 +5756,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
5560
5756
|
maxPackageVersionSizeInBytes?: number;
|
|
5561
5757
|
maxPackageBytesTotal?: number;
|
|
5562
5758
|
};
|
|
5759
|
+
search?: {
|
|
5760
|
+
allowed?: boolean;
|
|
5761
|
+
maxItems?: number;
|
|
5762
|
+
};
|
|
5563
5763
|
}>>;
|
|
5564
5764
|
}, "strip", z.ZodTypeAny, {
|
|
5565
5765
|
features?: {
|
|
@@ -5657,6 +5857,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
5657
5857
|
maxPackageVersionSizeInBytes?: number;
|
|
5658
5858
|
maxPackageBytesTotal?: number;
|
|
5659
5859
|
};
|
|
5860
|
+
search?: {
|
|
5861
|
+
allowed?: boolean;
|
|
5862
|
+
maxItems?: number;
|
|
5863
|
+
};
|
|
5660
5864
|
};
|
|
5661
5865
|
}, {
|
|
5662
5866
|
features?: {
|
|
@@ -5754,6 +5958,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
5754
5958
|
maxPackageVersionSizeInBytes?: number;
|
|
5755
5959
|
maxPackageBytesTotal?: number;
|
|
5756
5960
|
};
|
|
5961
|
+
search?: {
|
|
5962
|
+
allowed?: boolean;
|
|
5963
|
+
maxItems?: number;
|
|
5964
|
+
};
|
|
5757
5965
|
};
|
|
5758
5966
|
}>, "strip">;
|
|
5759
5967
|
defaultFeatures?: {
|
|
@@ -5852,6 +6060,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
5852
6060
|
maxPackageVersionSizeInBytes?: number;
|
|
5853
6061
|
maxPackageBytesTotal?: number;
|
|
5854
6062
|
};
|
|
6063
|
+
search?: {
|
|
6064
|
+
allowed?: boolean;
|
|
6065
|
+
maxItems?: number;
|
|
6066
|
+
};
|
|
5855
6067
|
};
|
|
5856
6068
|
studio?: {
|
|
5857
6069
|
records?: {
|
|
@@ -5948,6 +6160,10 @@ export declare const subscriptionConfigSchema: z.ZodObject<{
|
|
|
5948
6160
|
maxPackageVersionSizeInBytes?: number;
|
|
5949
6161
|
maxPackageBytesTotal?: number;
|
|
5950
6162
|
};
|
|
6163
|
+
search?: {
|
|
6164
|
+
allowed?: boolean;
|
|
6165
|
+
maxItems?: number;
|
|
6166
|
+
};
|
|
5951
6167
|
};
|
|
5952
6168
|
defaultPeriodLength?: {
|
|
5953
6169
|
days?: number;
|
|
@@ -6152,6 +6368,10 @@ export interface FeaturesConfiguration {
|
|
|
6152
6368
|
* The configuration for package features.
|
|
6153
6369
|
*/
|
|
6154
6370
|
packages?: PackageFeaturesConfiguration;
|
|
6371
|
+
/**
|
|
6372
|
+
* The configuration for search features.
|
|
6373
|
+
*/
|
|
6374
|
+
search?: SearchFeaturesConfiguration;
|
|
6155
6375
|
}
|
|
6156
6376
|
export interface RecordFeaturesConfiguration {
|
|
6157
6377
|
/**
|
|
@@ -6347,8 +6567,17 @@ export type StudioLoomFeaturesConfiguration = z.infer<typeof subscriptionFeature
|
|
|
6347
6567
|
export type WebhooksFeaturesConfiguration = z.infer<typeof subscriptionFeaturesSchema>['webhooks'];
|
|
6348
6568
|
export type NotificationFeaturesConfiguration = z.infer<typeof subscriptionFeaturesSchema>['notifications'];
|
|
6349
6569
|
export type PackageFeaturesConfiguration = z.infer<typeof subscriptionFeaturesSchema>['packages'];
|
|
6570
|
+
export type SearchFeaturesConfiguration = z.infer<typeof subscriptionFeaturesSchema>['search'];
|
|
6350
6571
|
export declare function allowAllFeatures(): FeaturesConfiguration;
|
|
6351
6572
|
export declare function denyAllFeatures(): FeaturesConfiguration;
|
|
6573
|
+
/**
|
|
6574
|
+
* Gets the search features that are available for the given subscription.
|
|
6575
|
+
* @param config The configuration. If null, then all default features are allowed.
|
|
6576
|
+
* @param subscriptionStatus The status of the subscription.
|
|
6577
|
+
* @param subscriptionId The ID of the subscription.
|
|
6578
|
+
* @param type The type of the user.
|
|
6579
|
+
*/
|
|
6580
|
+
export declare function getSearchFeatures(config: SubscriptionConfiguration | null, subscriptionStatus: string, subscriptionId: string, type: 'user' | 'studio', periodStartMs?: number | null, periodEndMs?: number | null, nowMs?: number): SearchFeaturesConfiguration;
|
|
6352
6581
|
/**
|
|
6353
6582
|
* Gets the package features that are available for the given subscription.
|
|
6354
6583
|
* @param config The configuration. If null, then all default features are allowed.
|
|
@@ -6426,7 +6655,22 @@ export declare function getOpenAiFeatures(config: SubscriptionConfiguration | nu
|
|
|
6426
6655
|
* @param nowMs The current time in milliseconds.
|
|
6427
6656
|
*/
|
|
6428
6657
|
export declare function getSubscriptionFeatures(config: SubscriptionConfiguration | null, subscriptionStatus: string, subscriptionId: string, type: 'user' | 'studio', periodStartMs?: number | null, periodEndMs?: number | null, nowMs?: number): FeaturesConfiguration;
|
|
6429
|
-
|
|
6658
|
+
/**
|
|
6659
|
+
* Gets the subscription for the given configuration, subscription status, subscription ID, user type and period.
|
|
6660
|
+
*
|
|
6661
|
+
* If there is no subscription configuration, then undefined is returned.
|
|
6662
|
+
* If no subscription could be found that matches the given parameters, then null is returned.
|
|
6663
|
+
*
|
|
6664
|
+
* @param config The configuration. If null, then all features are allowed.
|
|
6665
|
+
* @param subscriptionStatus The status of the subscription.
|
|
6666
|
+
* @param subscriptionId The ID of the subscription.
|
|
6667
|
+
* @param type The type of the user.
|
|
6668
|
+
* @param periodStartMs The start of the subscription period in unix time in miliseconds. If omitted, then the period won't be checked.
|
|
6669
|
+
* @param periodEndMs The end of the subscription period in unix time in miliseconds. If omitted, then the period won't be checked.
|
|
6670
|
+
* @param nowMs The current time in milliseconds.
|
|
6671
|
+
*/
|
|
6672
|
+
export declare function getSubscription(config: SubscriptionConfiguration | null, subscriptionStatus: string, subscriptionId: string, type: 'user' | 'studio', periodStartMs?: number | null, periodEndMs?: number | null, nowMs?: number): APISubscription;
|
|
6673
|
+
export declare function getSubscriptionTier(config: SubscriptionConfiguration, subscriptionStatus: string, subId: string, type: 'user' | 'studio'): string | null;
|
|
6430
6674
|
/**
|
|
6431
6675
|
* Determines if the subscription is allowed to be used for the given role.
|
|
6432
6676
|
* @param subscription The subscription.
|
|
@@ -410,6 +410,23 @@ export const subscriptionFeaturesSchema = z.object({
|
|
|
410
410
|
.default({
|
|
411
411
|
allowed: true,
|
|
412
412
|
}),
|
|
413
|
+
search: z
|
|
414
|
+
.object({
|
|
415
|
+
allowed: z
|
|
416
|
+
.boolean()
|
|
417
|
+
.describe('Whether search records are allowed for the subscription.'),
|
|
418
|
+
maxItems: z
|
|
419
|
+
.number()
|
|
420
|
+
.describe('The maximum number of search records that can be created for the subscription. If not specified, then there is no limit.')
|
|
421
|
+
.int()
|
|
422
|
+
.positive()
|
|
423
|
+
.optional(),
|
|
424
|
+
})
|
|
425
|
+
.describe('The configuration for search records features. Defaults to allowed.')
|
|
426
|
+
.optional()
|
|
427
|
+
.default({
|
|
428
|
+
allowed: true,
|
|
429
|
+
}),
|
|
413
430
|
});
|
|
414
431
|
export const subscriptionConfigSchema = z.object({
|
|
415
432
|
webhookSecret: z
|
|
@@ -599,6 +616,9 @@ export function allowAllFeatures() {
|
|
|
599
616
|
packages: {
|
|
600
617
|
allowed: true,
|
|
601
618
|
},
|
|
619
|
+
search: {
|
|
620
|
+
allowed: true,
|
|
621
|
+
},
|
|
602
622
|
};
|
|
603
623
|
}
|
|
604
624
|
export function denyAllFeatures() {
|
|
@@ -646,8 +666,23 @@ export function denyAllFeatures() {
|
|
|
646
666
|
packages: {
|
|
647
667
|
allowed: false,
|
|
648
668
|
},
|
|
669
|
+
search: {
|
|
670
|
+
allowed: false,
|
|
671
|
+
},
|
|
649
672
|
};
|
|
650
673
|
}
|
|
674
|
+
/**
|
|
675
|
+
* Gets the search features that are available for the given subscription.
|
|
676
|
+
* @param config The configuration. If null, then all default features are allowed.
|
|
677
|
+
* @param subscriptionStatus The status of the subscription.
|
|
678
|
+
* @param subscriptionId The ID of the subscription.
|
|
679
|
+
* @param type The type of the user.
|
|
680
|
+
*/
|
|
681
|
+
export function getSearchFeatures(config, subscriptionStatus, subscriptionId, type, periodStartMs, periodEndMs, nowMs = Date.now()) {
|
|
682
|
+
var _a;
|
|
683
|
+
const features = getSubscriptionFeatures(config, subscriptionStatus, subscriptionId, type, periodStartMs, periodEndMs, nowMs);
|
|
684
|
+
return (_a = features.search) !== null && _a !== void 0 ? _a : { allowed: true };
|
|
685
|
+
}
|
|
651
686
|
/**
|
|
652
687
|
* Gets the package features that are available for the given subscription.
|
|
653
688
|
* @param config The configuration. If null, then all default features are allowed.
|
|
@@ -765,39 +800,58 @@ export function getOpenAiFeatures(config, subscriptionStatus, subscriptionId, ty
|
|
|
765
800
|
*/
|
|
766
801
|
export function getSubscriptionFeatures(config, subscriptionStatus, subscriptionId, type, periodStartMs, periodEndMs, nowMs = Date.now()) {
|
|
767
802
|
var _a, _b, _c, _d;
|
|
768
|
-
|
|
803
|
+
const sub = getSubscription(config, subscriptionStatus, subscriptionId, type, periodStartMs, periodEndMs, nowMs);
|
|
804
|
+
if (typeof sub === 'undefined') {
|
|
769
805
|
return allowAllFeatures();
|
|
770
806
|
}
|
|
807
|
+
else if (sub) {
|
|
808
|
+
const tier = sub === null || sub === void 0 ? void 0 : sub.tier;
|
|
809
|
+
const features = tier ? (_b = (_a = config === null || config === void 0 ? void 0 : config.tiers) === null || _a === void 0 ? void 0 : _a[tier]) === null || _b === void 0 ? void 0 : _b.features : null;
|
|
810
|
+
if (features) {
|
|
811
|
+
return features;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return (_d = (_c = config.defaultFeatures) === null || _c === void 0 ? void 0 : _c[type]) !== null && _d !== void 0 ? _d : allowAllFeatures();
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Gets the subscription for the given configuration, subscription status, subscription ID, user type and period.
|
|
818
|
+
*
|
|
819
|
+
* If there is no subscription configuration, then undefined is returned.
|
|
820
|
+
* If no subscription could be found that matches the given parameters, then null is returned.
|
|
821
|
+
*
|
|
822
|
+
* @param config The configuration. If null, then all features are allowed.
|
|
823
|
+
* @param subscriptionStatus The status of the subscription.
|
|
824
|
+
* @param subscriptionId The ID of the subscription.
|
|
825
|
+
* @param type The type of the user.
|
|
826
|
+
* @param periodStartMs The start of the subscription period in unix time in miliseconds. If omitted, then the period won't be checked.
|
|
827
|
+
* @param periodEndMs The end of the subscription period in unix time in miliseconds. If omitted, then the period won't be checked.
|
|
828
|
+
* @param nowMs The current time in milliseconds.
|
|
829
|
+
*/
|
|
830
|
+
export function getSubscription(config, subscriptionStatus, subscriptionId, type, periodStartMs, periodEndMs, nowMs = Date.now()) {
|
|
831
|
+
if (!config) {
|
|
832
|
+
return undefined;
|
|
833
|
+
}
|
|
771
834
|
if (config.tiers) {
|
|
772
835
|
const roleSubscriptions = config.subscriptions.filter((s) => subscriptionMatchesRole(s, type));
|
|
773
836
|
if (isActiveSubscription(subscriptionStatus, periodStartMs, periodEndMs, nowMs)) {
|
|
774
837
|
const sub = roleSubscriptions.find((s) => s.id === subscriptionId);
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
if (features) {
|
|
778
|
-
return features;
|
|
838
|
+
if (sub) {
|
|
839
|
+
return sub;
|
|
779
840
|
}
|
|
780
841
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
const features = tier ? (_b = config.tiers[tier]) === null || _b === void 0 ? void 0 : _b.features : null;
|
|
785
|
-
if (features) {
|
|
786
|
-
return features;
|
|
787
|
-
}
|
|
842
|
+
const sub = roleSubscriptions.find((s) => s.defaultSubscription);
|
|
843
|
+
if (sub) {
|
|
844
|
+
return sub;
|
|
788
845
|
}
|
|
789
846
|
}
|
|
790
|
-
return
|
|
847
|
+
return null;
|
|
791
848
|
}
|
|
792
|
-
export function getSubscriptionTier(config, subscriptionStatus, subId) {
|
|
849
|
+
export function getSubscriptionTier(config, subscriptionStatus, subId, type) {
|
|
793
850
|
var _a;
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
}
|
|
797
|
-
if (!isActiveSubscription(subscriptionStatus)) {
|
|
851
|
+
const sub = getSubscription(config, subscriptionStatus, subId, type);
|
|
852
|
+
if (!sub) {
|
|
798
853
|
return null;
|
|
799
854
|
}
|
|
800
|
-
const sub = config.subscriptions.find((s) => s.id === subId);
|
|
801
855
|
return (_a = sub === null || sub === void 0 ? void 0 : sub.tier) !== null && _a !== void 0 ? _a : null;
|
|
802
856
|
}
|
|
803
857
|
/**
|