@commet/better-auth 1.3.3 → 1.3.4
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/client.d.cts +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/index.cjs +249 -254
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -63
- package/dist/index.d.ts +8 -63
- package/dist/index.js +269 -254
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as better_auth_client from 'better-auth/client';
|
|
2
2
|
import { BetterFetchOption } from 'better-auth/client';
|
|
3
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
3
4
|
import * as zod from 'zod';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
import * as _commet_node from '@commet/node';
|
|
@@ -43,8 +44,6 @@ declare const features: (_config?: FeaturesConfig) => (commet: Commet) => {
|
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
}>)[];
|
|
46
|
-
} & {
|
|
47
|
-
use: any[];
|
|
48
47
|
}, _commet_node.FeatureAccess[] | null>;
|
|
49
48
|
getFeature: better_auth.StrictEndpoint<"/commet/features/:code", {
|
|
50
49
|
method: "GET";
|
|
@@ -71,8 +70,6 @@ declare const features: (_config?: FeaturesConfig) => (commet: Commet) => {
|
|
|
71
70
|
};
|
|
72
71
|
};
|
|
73
72
|
}>)[];
|
|
74
|
-
} & {
|
|
75
|
-
use: any[];
|
|
76
73
|
}, _commet_node.FeatureAccess | null>;
|
|
77
74
|
checkFeature: better_auth.StrictEndpoint<"/commet/features/:code/check", {
|
|
78
75
|
method: "GET";
|
|
@@ -99,8 +96,6 @@ declare const features: (_config?: FeaturesConfig) => (commet: Commet) => {
|
|
|
99
96
|
};
|
|
100
97
|
};
|
|
101
98
|
}>)[];
|
|
102
|
-
} & {
|
|
103
|
-
use: any[];
|
|
104
99
|
}, _commet_node.CheckResult | null>;
|
|
105
100
|
canUseFeature: better_auth.StrictEndpoint<"/commet/features/:code/can-use", {
|
|
106
101
|
method: "GET";
|
|
@@ -127,8 +122,6 @@ declare const features: (_config?: FeaturesConfig) => (commet: Commet) => {
|
|
|
127
122
|
};
|
|
128
123
|
};
|
|
129
124
|
}>)[];
|
|
130
|
-
} & {
|
|
131
|
-
use: any[];
|
|
132
125
|
}, _commet_node.CanUseResult | null>;
|
|
133
126
|
};
|
|
134
127
|
|
|
@@ -170,8 +163,6 @@ declare const portal: ({ returnUrl }?: PortalConfig) => (commet: Commet) => {
|
|
|
170
163
|
};
|
|
171
164
|
};
|
|
172
165
|
}>)[];
|
|
173
|
-
} & {
|
|
174
|
-
use: any[];
|
|
175
166
|
}, {
|
|
176
167
|
url: string;
|
|
177
168
|
redirect: boolean;
|
|
@@ -215,8 +206,6 @@ declare const seats: (_config?: SeatsConfig) => (commet: Commet) => {
|
|
|
215
206
|
};
|
|
216
207
|
};
|
|
217
208
|
}>)[];
|
|
218
|
-
} & {
|
|
219
|
-
use: any[];
|
|
220
209
|
}, Record<string, _commet_node.SeatBalance> | null>;
|
|
221
210
|
addSeats: better_auth.StrictEndpoint<"/commet/seats/add", {
|
|
222
211
|
method: "POST";
|
|
@@ -247,8 +236,6 @@ declare const seats: (_config?: SeatsConfig) => (commet: Commet) => {
|
|
|
247
236
|
};
|
|
248
237
|
};
|
|
249
238
|
}>)[];
|
|
250
|
-
} & {
|
|
251
|
-
use: any[];
|
|
252
239
|
}, _commet_node.SeatEvent | null>;
|
|
253
240
|
removeSeats: better_auth.StrictEndpoint<"/commet/seats/remove", {
|
|
254
241
|
method: "POST";
|
|
@@ -279,8 +266,6 @@ declare const seats: (_config?: SeatsConfig) => (commet: Commet) => {
|
|
|
279
266
|
};
|
|
280
267
|
};
|
|
281
268
|
}>)[];
|
|
282
|
-
} & {
|
|
283
|
-
use: any[];
|
|
284
269
|
}, _commet_node.SeatEvent | null>;
|
|
285
270
|
setSeats: better_auth.StrictEndpoint<"/commet/seats/set", {
|
|
286
271
|
method: "POST";
|
|
@@ -311,8 +296,6 @@ declare const seats: (_config?: SeatsConfig) => (commet: Commet) => {
|
|
|
311
296
|
};
|
|
312
297
|
};
|
|
313
298
|
}>)[];
|
|
314
|
-
} & {
|
|
315
|
-
use: any[];
|
|
316
299
|
}, _commet_node.SeatEvent | null>;
|
|
317
300
|
setAllSeats: better_auth.StrictEndpoint<"/commet/seats/set-all", {
|
|
318
301
|
method: "POST";
|
|
@@ -342,8 +325,6 @@ declare const seats: (_config?: SeatsConfig) => (commet: Commet) => {
|
|
|
342
325
|
};
|
|
343
326
|
};
|
|
344
327
|
}>)[];
|
|
345
|
-
} & {
|
|
346
|
-
use: any[];
|
|
347
328
|
}, _commet_node.SeatEvent[] | null>;
|
|
348
329
|
};
|
|
349
330
|
|
|
@@ -363,7 +344,7 @@ interface SubscriptionsConfig {
|
|
|
363
344
|
* - GET /subscription - Get active subscription for the authenticated user
|
|
364
345
|
* - POST /subscription/cancel - Cancel the subscription
|
|
365
346
|
*/
|
|
366
|
-
declare const subscriptions: (
|
|
347
|
+
declare const subscriptions: (_config?: SubscriptionsConfig) => (commet: Commet) => {
|
|
367
348
|
getSubscription: better_auth.StrictEndpoint<"/commet/subscription", {
|
|
368
349
|
method: "GET";
|
|
369
350
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
@@ -389,8 +370,6 @@ declare const subscriptions: (config?: SubscriptionsConfig) => (commet: Commet)
|
|
|
389
370
|
};
|
|
390
371
|
};
|
|
391
372
|
}>)[];
|
|
392
|
-
} & {
|
|
393
|
-
use: any[];
|
|
394
373
|
}, _commet_node.ActiveSubscription | null>;
|
|
395
374
|
cancelSubscription: better_auth.StrictEndpoint<"/commet/subscription/cancel", {
|
|
396
375
|
method: "POST";
|
|
@@ -421,8 +400,6 @@ declare const subscriptions: (config?: SubscriptionsConfig) => (commet: Commet)
|
|
|
421
400
|
};
|
|
422
401
|
};
|
|
423
402
|
}>)[];
|
|
424
|
-
} & {
|
|
425
|
-
use: any[];
|
|
426
403
|
}, _commet_node.Subscription | null>;
|
|
427
404
|
};
|
|
428
405
|
|
|
@@ -465,8 +442,6 @@ declare const usage: (_config?: UsageConfig) => (commet: Commet) => {
|
|
|
465
442
|
};
|
|
466
443
|
};
|
|
467
444
|
}>)[];
|
|
468
|
-
} & {
|
|
469
|
-
use: any[];
|
|
470
445
|
}, _commet_node.UsageEvent | null>;
|
|
471
446
|
};
|
|
472
447
|
|
|
@@ -530,8 +505,6 @@ declare const webhooks: (config: WebhooksConfig) => (commet: Commet) => {
|
|
|
530
505
|
isAction: false;
|
|
531
506
|
};
|
|
532
507
|
cloneRequest: true;
|
|
533
|
-
} & {
|
|
534
|
-
use: any[];
|
|
535
508
|
}, {
|
|
536
509
|
received: boolean;
|
|
537
510
|
}>;
|
|
@@ -679,8 +652,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
679
652
|
};
|
|
680
653
|
};
|
|
681
654
|
}>)[];
|
|
682
|
-
} & {
|
|
683
|
-
use: any[];
|
|
684
655
|
}, {
|
|
685
656
|
url: string;
|
|
686
657
|
redirect: boolean;
|
|
@@ -711,15 +682,13 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
711
682
|
};
|
|
712
683
|
};
|
|
713
684
|
}>)[];
|
|
714
|
-
} & {
|
|
715
|
-
use: any[];
|
|
716
685
|
}, _commet_node.ActiveSubscription | null>;
|
|
717
686
|
cancelSubscription: better_auth.StrictEndpoint<"/commet/subscription/cancel", {
|
|
718
687
|
method: "POST";
|
|
719
688
|
body: zod.ZodOptional<zod.ZodObject<{
|
|
720
689
|
reason: zod.ZodOptional<zod.ZodString>;
|
|
721
690
|
immediate: zod.ZodOptional<zod.ZodBoolean>;
|
|
722
|
-
},
|
|
691
|
+
}, zod_v4_core.$strip>>;
|
|
723
692
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
724
693
|
session: {
|
|
725
694
|
session: Record<string, any> & {
|
|
@@ -743,8 +712,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
743
712
|
};
|
|
744
713
|
};
|
|
745
714
|
}>)[];
|
|
746
|
-
} & {
|
|
747
|
-
use: any[];
|
|
748
715
|
}, _commet_node.Subscription | null>;
|
|
749
716
|
} | {
|
|
750
717
|
listFeatures: better_auth.StrictEndpoint<"/commet/features", {
|
|
@@ -772,8 +739,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
772
739
|
};
|
|
773
740
|
};
|
|
774
741
|
}>)[];
|
|
775
|
-
} & {
|
|
776
|
-
use: any[];
|
|
777
742
|
}, _commet_node.FeatureAccess[] | null>;
|
|
778
743
|
getFeature: better_auth.StrictEndpoint<"/commet/features/:code", {
|
|
779
744
|
method: "GET";
|
|
@@ -800,8 +765,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
800
765
|
};
|
|
801
766
|
};
|
|
802
767
|
}>)[];
|
|
803
|
-
} & {
|
|
804
|
-
use: any[];
|
|
805
768
|
}, _commet_node.FeatureAccess | null>;
|
|
806
769
|
checkFeature: better_auth.StrictEndpoint<"/commet/features/:code/check", {
|
|
807
770
|
method: "GET";
|
|
@@ -828,8 +791,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
828
791
|
};
|
|
829
792
|
};
|
|
830
793
|
}>)[];
|
|
831
|
-
} & {
|
|
832
|
-
use: any[];
|
|
833
794
|
}, _commet_node.CheckResult | null>;
|
|
834
795
|
canUseFeature: better_auth.StrictEndpoint<"/commet/features/:code/can-use", {
|
|
835
796
|
method: "GET";
|
|
@@ -856,8 +817,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
856
817
|
};
|
|
857
818
|
};
|
|
858
819
|
}>)[];
|
|
859
|
-
} & {
|
|
860
|
-
use: any[];
|
|
861
820
|
}, _commet_node.CanUseResult | null>;
|
|
862
821
|
} | {
|
|
863
822
|
trackUsage: better_auth.StrictEndpoint<"/commet/usage/track", {
|
|
@@ -867,7 +826,7 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
867
826
|
value: zod.ZodOptional<zod.ZodNumber>;
|
|
868
827
|
idempotencyKey: zod.ZodOptional<zod.ZodString>;
|
|
869
828
|
properties: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
|
|
870
|
-
},
|
|
829
|
+
}, zod_v4_core.$strip>;
|
|
871
830
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
872
831
|
session: {
|
|
873
832
|
session: Record<string, any> & {
|
|
@@ -891,8 +850,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
891
850
|
};
|
|
892
851
|
};
|
|
893
852
|
}>)[];
|
|
894
|
-
} & {
|
|
895
|
-
use: any[];
|
|
896
853
|
}, _commet_node.UsageEvent | null>;
|
|
897
854
|
} | {
|
|
898
855
|
listSeats: better_auth.StrictEndpoint<"/commet/seats", {
|
|
@@ -920,15 +877,13 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
920
877
|
};
|
|
921
878
|
};
|
|
922
879
|
}>)[];
|
|
923
|
-
} & {
|
|
924
|
-
use: any[];
|
|
925
880
|
}, Record<string, _commet_node.SeatBalance> | null>;
|
|
926
881
|
addSeats: better_auth.StrictEndpoint<"/commet/seats/add", {
|
|
927
882
|
method: "POST";
|
|
928
883
|
body: zod.ZodObject<{
|
|
929
884
|
seatType: zod.ZodString;
|
|
930
885
|
count: zod.ZodNumber;
|
|
931
|
-
},
|
|
886
|
+
}, zod_v4_core.$strip>;
|
|
932
887
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
933
888
|
session: {
|
|
934
889
|
session: Record<string, any> & {
|
|
@@ -952,15 +907,13 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
952
907
|
};
|
|
953
908
|
};
|
|
954
909
|
}>)[];
|
|
955
|
-
} & {
|
|
956
|
-
use: any[];
|
|
957
910
|
}, _commet_node.SeatEvent | null>;
|
|
958
911
|
removeSeats: better_auth.StrictEndpoint<"/commet/seats/remove", {
|
|
959
912
|
method: "POST";
|
|
960
913
|
body: zod.ZodObject<{
|
|
961
914
|
seatType: zod.ZodString;
|
|
962
915
|
count: zod.ZodNumber;
|
|
963
|
-
},
|
|
916
|
+
}, zod_v4_core.$strip>;
|
|
964
917
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
965
918
|
session: {
|
|
966
919
|
session: Record<string, any> & {
|
|
@@ -984,15 +937,13 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
984
937
|
};
|
|
985
938
|
};
|
|
986
939
|
}>)[];
|
|
987
|
-
} & {
|
|
988
|
-
use: any[];
|
|
989
940
|
}, _commet_node.SeatEvent | null>;
|
|
990
941
|
setSeats: better_auth.StrictEndpoint<"/commet/seats/set", {
|
|
991
942
|
method: "POST";
|
|
992
943
|
body: zod.ZodObject<{
|
|
993
944
|
seatType: zod.ZodString;
|
|
994
945
|
count: zod.ZodNumber;
|
|
995
|
-
},
|
|
946
|
+
}, zod_v4_core.$strip>;
|
|
996
947
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
997
948
|
session: {
|
|
998
949
|
session: Record<string, any> & {
|
|
@@ -1016,14 +967,12 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
1016
967
|
};
|
|
1017
968
|
};
|
|
1018
969
|
}>)[];
|
|
1019
|
-
} & {
|
|
1020
|
-
use: any[];
|
|
1021
970
|
}, _commet_node.SeatEvent | null>;
|
|
1022
971
|
setAllSeats: better_auth.StrictEndpoint<"/commet/seats/set-all", {
|
|
1023
972
|
method: "POST";
|
|
1024
973
|
body: zod.ZodObject<{
|
|
1025
974
|
seats: zod.ZodRecord<zod.ZodString, zod.ZodNumber>;
|
|
1026
|
-
},
|
|
975
|
+
}, zod_v4_core.$strip>;
|
|
1027
976
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
1028
977
|
session: {
|
|
1029
978
|
session: Record<string, any> & {
|
|
@@ -1047,8 +996,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
1047
996
|
};
|
|
1048
997
|
};
|
|
1049
998
|
}>)[];
|
|
1050
|
-
} & {
|
|
1051
|
-
use: any[];
|
|
1052
999
|
}, _commet_node.SeatEvent[] | null>;
|
|
1053
1000
|
} | {
|
|
1054
1001
|
commetWebhooks: better_auth.StrictEndpoint<"/commet/webhooks", {
|
|
@@ -1057,8 +1004,6 @@ declare const commet: <O extends CommetOptions>(options: O) => {
|
|
|
1057
1004
|
isAction: false;
|
|
1058
1005
|
};
|
|
1059
1006
|
cloneRequest: true;
|
|
1060
|
-
} & {
|
|
1061
|
-
use: any[];
|
|
1062
1007
|
}, {
|
|
1063
1008
|
received: boolean;
|
|
1064
1009
|
}>;
|