tonightpass 0.0.207 → 0.0.209

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.mts CHANGED
@@ -23,6 +23,31 @@ declare const REGEX: {
23
23
  IMAGE_URL: RegExp;
24
24
  };
25
25
 
26
+ interface CacheEntry<T> {
27
+ data: T;
28
+ timestamp: number;
29
+ }
30
+ interface CacheOptions {
31
+ enabled: boolean;
32
+ ttl?: number;
33
+ methods?: Options["method"][];
34
+ }
35
+ declare class CacheManager {
36
+ private cache;
37
+ private options;
38
+ constructor(options: CacheOptions);
39
+ private generateKey;
40
+ private shouldCache;
41
+ private isValid;
42
+ get<T>(method: Options["method"], url: string): T | null;
43
+ set<T>(method: Options["method"], url: string, data: T): void;
44
+ clear(): void;
45
+ stats(): {
46
+ size: number;
47
+ keys: string[];
48
+ };
49
+ }
50
+
26
51
  type CreateApiKeyDto = {
27
52
  name: string;
28
53
  };
@@ -36,46 +61,253 @@ declare class AddParticipantDto {
36
61
  username: string;
37
62
  }
38
63
 
39
- type Endpoint<M extends Options["method"], Path extends string, Res, Body = undefined> = {
40
- method: M;
41
- path: Path;
42
- res: Res;
43
- body: Body;
44
- };
45
- type Endpoints = ApiKeyEndpoints | AuthEndpoints | CareerEndpoints | ChannelEndpoints | ChannelMessageEndpoints | CurrenciesEndpoints | FeedEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
64
+ declare class CreateChannelDto {
65
+ type: ChannelType;
66
+ participantUsernames: string[];
67
+ name?: string;
68
+ }
46
69
 
47
- declare enum ApiKeyTier {
48
- PUBLIC = "public",
49
- BUILD = "build",
50
- PREMIUM = "premium",
51
- INTERNAL = "internal"
70
+ declare class UpdateChannelDto {
71
+ name?: string;
52
72
  }
53
- type ApiKey = Base & {
54
- key: string;
73
+
74
+ declare class AddReactionDto {
75
+ emoji: string;
76
+ }
77
+
78
+ declare class ContentOrAttachmentsConstraint implements ValidatorConstraintInterface {
79
+ validate(_value: unknown, args: ValidationArguments): boolean;
80
+ defaultMessage(_args: ValidationArguments): string;
81
+ }
82
+ declare class CreateChannelMessageDto {
83
+ content?: string;
84
+ attachments?: string[];
85
+ replyToId?: string;
86
+ }
87
+
88
+ declare class UpdateChannelMessageDto {
89
+ content?: string;
90
+ }
91
+
92
+ declare class ReportChannelMessageDto {
93
+ reason: ChannelMessageReportReason;
94
+ description?: string;
95
+ }
96
+
97
+ declare class GeoPointDto implements GeoPoint {
98
+ type: "Point";
99
+ coordinates: [number, number];
100
+ constructor();
101
+ }
102
+ declare class CreateLocationDto implements Location$1 {
103
+ name?: string;
104
+ address: string;
105
+ zipCode: string;
106
+ city: string;
107
+ country: string;
108
+ geometry: GeoPointDto;
109
+ }
110
+
111
+ declare class UpdateLocationDto implements Partial<Location$1> {
112
+ name?: string;
113
+ address?: string;
114
+ zipCode?: string;
115
+ city?: string;
116
+ country?: string;
117
+ geometry?: GeoPointDto;
118
+ }
119
+
120
+ declare class CreateOrganizationMemberDto {
121
+ user: string;
122
+ role: OrganizationMemberRole;
123
+ }
124
+
125
+ declare class CreateOrganizationDto {
126
+ organizationSlug?: string;
127
+ identity: CreateOrganizationIdentityDto;
128
+ members: CreateOrganizationMemberDto[];
129
+ location?: Location$1;
130
+ }
131
+ declare class CreateOrganizationIdentityDto {
132
+ displayName: string;
133
+ description?: string;
134
+ avatarUrl?: string;
135
+ bannerUrl?: string;
136
+ links?: string[];
137
+ }
138
+
139
+ declare class UpdateOrganizationMemberDto {
140
+ role: OrganizationMemberRole;
141
+ }
142
+
143
+ declare class AcceptOrganizationMemberInvitationDto {
144
+ token: string;
145
+ }
146
+
147
+ declare class CreateOrganizationMemberInvitationLinkDto {
148
+ role?: OrganizationMemberRole;
149
+ }
150
+
151
+ declare class UpdateOrganizationDto {
152
+ slug?: string;
153
+ identity?: UpdateOrganizationIdentityDto;
154
+ members?: UpdateOrganizationMemberDto[];
155
+ location?: Location;
156
+ }
157
+ declare class UpdateOrganizationIdentityDto {
158
+ displayName?: string;
159
+ description?: string;
160
+ avatarUrl?: string;
161
+ bannerUrl?: string;
162
+ links?: string[];
163
+ }
164
+
165
+ declare class CreateOrganizationEventOrderDto {
166
+ cart: string[];
167
+ }
168
+
169
+ declare class CreateOrganizationEventStyleDto {
170
+ type: OrganizationEventStyleType;
171
+ emoji: string;
55
172
  name: string;
56
- tier: ApiKeyTier;
57
- rateLimit: number;
58
- user: UserProfile;
59
- lastUsedAt?: Date;
60
- isActive: boolean;
61
- };
62
- type ApiKeyEndpoints = Endpoint<"GET", "/api-keys", ArrayResult<ApiKey>> | Endpoint<"GET", "/api-keys/:apiKeyId", ApiKey> | Endpoint<"POST", "/api-keys", ApiKey, CreateApiKeyDto> | Endpoint<"PUT", "/api-keys/:apiKeyId", ApiKey, UpdateApiKeyDto> | Endpoint<"DELETE", "/api-keys/:apiKeyId", ApiKey>;
173
+ }
63
174
 
64
- declare enum UserNotificationType {
65
- Follow = "follow"
175
+ declare class UpdateOrganizationEventStyleDto extends CreateOrganizationEventStyleDto {
66
176
  }
67
- type UserNotificationBase = Base & {
68
- type: UserNotificationType.Follow;
69
- isSeen: boolean;
177
+
178
+ type CreateOrganizationEventTicketInput = Omit<ExcludeBase<OrganizationEventTicket>, "price" | "product" | "event" | "fee"> & {
179
+ price: number;
70
180
  };
71
- type UserNotificationFollow = UserNotificationBase & {
72
- type: UserNotificationType.Follow;
73
- follower: UserProfile;
181
+ declare class CreateOrganizationEventTicketDto implements CreateOrganizationEventTicketInput {
182
+ name: string;
183
+ description?: string;
184
+ price: number;
185
+ quantity: number;
186
+ type: OrganizationEventTicketType;
187
+ category: OrganizationEventTicketCategory;
188
+ currency: Currency;
189
+ isVisible: boolean;
190
+ isFeesIncluded: boolean;
191
+ startAt?: Date;
192
+ endAt?: Date;
193
+ }
194
+
195
+ declare class UpdateOrganizationEventTicketDto implements DeepPartial<CreateOrganizationEventTicketInput> {
196
+ name?: string;
197
+ description?: string;
198
+ price?: number;
199
+ quantity?: number;
200
+ type?: OrganizationEventTicketType;
201
+ category?: OrganizationEventTicketCategory;
202
+ currency?: Currency;
203
+ isVisible?: boolean;
204
+ isFeesIncluded?: boolean;
205
+ startAt?: Date;
206
+ endAt?: Date;
207
+ }
208
+
209
+ declare class AtLeastOneMediaConstraint implements ValidatorConstraintInterface {
210
+ validate(_value: unknown, args: ValidationArguments): boolean;
211
+ defaultMessage(): string;
212
+ }
213
+ declare function AtLeastOneMedia(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
214
+ type CreateOrganizationEventInput = Omit<ExcludeBase<OrganizationEvent>, "slug" | "styles" | "tickets" | "organization" | "status" | "viewsCount" | "sessionsCount" | "totalViewsCount" | "averageViewsPerSessionCount"> & {
215
+ slug?: string;
216
+ styles: string[];
217
+ tickets: CreateOrganizationEventTicketInput[];
74
218
  };
75
- type UserNotification = UserNotificationFollow;
76
- type UserNotificationEndpoints = Endpoint<"GET", "/users/@me/notifications", ArrayResult<UserNotification>, ArrayOptions<UserNotification>> | Endpoint<"GET", "/users/@me/notifications/count", number, {
77
- unseen?: boolean;
78
- }> | Endpoint<"PUT", "/users/@me/notifications/read", void>;
219
+ declare class BaseOrganizationEventDto {
220
+ title: string;
221
+ slug?: string;
222
+ description: string;
223
+ type: OrganizationEventType;
224
+ visibility: OrganizationEventVisibilityType;
225
+ flyers: string[];
226
+ trailers: string[];
227
+ location: CreateLocationDto;
228
+ styles: string[];
229
+ startAt: Date;
230
+ endAt: Date;
231
+ }
232
+ declare class CreateOrganizationEventDto extends BaseOrganizationEventDto implements CreateOrganizationEventInput {
233
+ tickets: CreateOrganizationEventTicketDto[];
234
+ }
235
+
236
+ declare class AtLeastOneMediaOnUpdateConstraint implements ValidatorConstraintInterface {
237
+ validate(_value: unknown, args: ValidationArguments): boolean;
238
+ defaultMessage(): string;
239
+ }
240
+ declare function AtLeastOneMediaOnUpdate(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
241
+ declare class UpdateOrganizationEventDto implements DeepPartial<CreateOrganizationEventInput> {
242
+ title?: string;
243
+ slug?: string;
244
+ description?: string;
245
+ type?: OrganizationEventType;
246
+ visibility?: OrganizationEventVisibilityType;
247
+ flyers?: string[];
248
+ trailers?: string[];
249
+ location?: UpdateLocationDto;
250
+ tickets?: UpdateOrganizationEventTicketDto[];
251
+ styles?: string[];
252
+ startAt?: Date;
253
+ endAt?: Date;
254
+ }
255
+
256
+ declare class CreateUserDto {
257
+ identifier: CreateUserIdentifierDto;
258
+ identity: CreateUserIdentityDto;
259
+ password: string;
260
+ }
261
+ declare class CreateUserIdentifierDto implements Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">> {
262
+ email?: string;
263
+ phoneNumber?: string;
264
+ username: string;
265
+ }
266
+ declare class CreateUserIdentityDto {
267
+ firstName: string;
268
+ lastName: string;
269
+ gender: UserIdentityGender;
270
+ avatarUrl?: string;
271
+ birthDate: Date;
272
+ links?: string[];
273
+ }
274
+
275
+ declare class RecoveryDto {
276
+ identifier: string;
277
+ }
278
+
279
+ declare class RecoveryResetDto {
280
+ tokenId: string;
281
+ tokenValue: string;
282
+ password: string;
283
+ }
284
+
285
+ declare class SignInUserDto {
286
+ identifier: string;
287
+ password: string;
288
+ }
289
+
290
+ declare class UpdateUserDto {
291
+ identifier?: UpdateUserIdentifierDto;
292
+ identity?: UpdateUserIdentityDto;
293
+ password?: string;
294
+ }
295
+ declare class UpdateUserIdentifierDto implements Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">> {
296
+ email?: string;
297
+ phoneNumber?: string;
298
+ username?: string;
299
+ }
300
+ declare class UpdateUserIdentityDto implements Partial<Pick<UserIdentity, "firstName" | "lastName" | "displayName" | "description" | "avatarUrl" | "bannerUrl" | "gender" | "birthDate">> {
301
+ firstName?: string;
302
+ lastName?: string;
303
+ displayName?: string;
304
+ description?: string;
305
+ avatarUrl?: string | undefined;
306
+ bannerUrl?: string | undefined;
307
+ gender?: UserIdentityGender;
308
+ birthDate?: Date;
309
+ links?: string[];
310
+ }
79
311
 
80
312
  declare class CreateUserPostCommentDto {
81
313
  content: string;
@@ -125,17 +357,6 @@ type UserPostRepostEndpoints = Endpoint<"GET", "/users/:username/reposts", Array
125
357
 
126
358
  type UserPostViewEndpoints = Endpoint<"POST", "/users/:username/posts/:postId/views", boolean, null>;
127
359
 
128
- declare class CreateUserPostDto {
129
- content?: string;
130
- mediaUrls: string[];
131
- visibility?: UserPostVisibility;
132
- }
133
-
134
- declare class UpdateUserPostDto {
135
- content?: string;
136
- visibility?: UserPostVisibility;
137
- }
138
-
139
360
  declare enum UserPostVisibility {
140
361
  Public = "public",
141
362
  Followers = "followers",
@@ -157,6 +378,50 @@ type UserPost = Base & {
157
378
  };
158
379
  type UserPostEndpoints = Endpoint<"GET", "/users/:username/posts", ArrayResult<UserPost>, ArrayOptions<UserPost>> | Endpoint<"GET", "/users/:username/posts/:postId", UserPost> | Endpoint<"POST", "/users/@me/posts", UserPost, CreateUserPostDto> | Endpoint<"PUT", "/users/@me/posts/:postId", UserPost, UpdateUserPostDto> | Endpoint<"DELETE", "/users/@me/posts/:postId", void> | UserPostCommentEndpoints | UserPostRepostEndpoints | UserPostViewEndpoints | UserPostMediaEndpoints;
159
380
 
381
+ declare class CreateUserPostDto {
382
+ content?: string;
383
+ mediaUrls: string[];
384
+ visibility?: UserPostVisibility;
385
+ }
386
+
387
+ declare class UpdateUserPostDto {
388
+ content?: string;
389
+ visibility?: UserPostVisibility;
390
+ }
391
+
392
+ declare enum ApiKeyTier {
393
+ PUBLIC = "public",
394
+ BUILD = "build",
395
+ PREMIUM = "premium",
396
+ INTERNAL = "internal"
397
+ }
398
+ type ApiKey = Base & {
399
+ key: string;
400
+ name: string;
401
+ tier: ApiKeyTier;
402
+ rateLimit: number;
403
+ user: UserProfile;
404
+ lastUsedAt?: Date;
405
+ isActive: boolean;
406
+ };
407
+ type ApiKeyEndpoints = Endpoint<"GET", "/api-keys", ArrayResult<ApiKey>> | Endpoint<"GET", "/api-keys/:apiKeyId", ApiKey> | Endpoint<"POST", "/api-keys", ApiKey, CreateApiKeyDto> | Endpoint<"PUT", "/api-keys/:apiKeyId", ApiKey, UpdateApiKeyDto> | Endpoint<"DELETE", "/api-keys/:apiKeyId", ApiKey>;
408
+
409
+ declare enum UserNotificationType {
410
+ Follow = "follow"
411
+ }
412
+ type UserNotificationBase = Base & {
413
+ type: UserNotificationType.Follow;
414
+ isSeen: boolean;
415
+ };
416
+ type UserNotificationFollow = UserNotificationBase & {
417
+ type: UserNotificationType.Follow;
418
+ follower: UserProfile;
419
+ };
420
+ type UserNotification = UserNotificationFollow;
421
+ type UserNotificationEndpoints = Endpoint<"GET", "/users/@me/notifications", ArrayResult<UserNotification>, ArrayOptions<UserNotification>> | Endpoint<"GET", "/users/@me/notifications/count", number, {
422
+ unseen?: boolean;
423
+ }> | Endpoint<"PUT", "/users/@me/notifications/read", void>;
424
+
160
425
  type Order = Base & {
161
426
  invoice: Stripe__default.Invoice;
162
427
  user: User;
@@ -295,10 +560,7 @@ declare enum OAuth2Provider {
295
560
  type RecoveryResponse = {
296
561
  to: string;
297
562
  };
298
- type OAuth2ProviderParams = {
299
- provider: OAuth2Provider;
300
- };
301
- type AuthEndpoints = Endpoint<"POST", "/auth/sign-up", User, CreateUserDto> | Endpoint<"POST", "/auth/sign-in", User, SignInUserDto> | Endpoint<"POST", "/auth/sign-out", null, null> | Endpoint<"POST", "/auth/refresh-token", null, null> | Endpoint<"POST", "/auth/recovery", RecoveryResponse, RecoveryDto> | Endpoint<"POST", "/auth/recovery/reset", null, RecoveryResetDto> | Endpoint<"GET", "/oauth2/:provider", void, OAuth2ProviderParams> | Endpoint<"GET", "/oauth2/:provider/callback", void, OAuth2ProviderParams> | Endpoint<"DELETE", "/oauth2/:provider", void>;
563
+ type AuthEndpoints = Endpoint<"POST", "/auth/sign-up", User, CreateUserDto> | Endpoint<"POST", "/auth/sign-in", User, SignInUserDto> | Endpoint<"POST", "/auth/sign-out", null, null> | Endpoint<"POST", "/auth/refresh-token", null, null> | Endpoint<"POST", "/auth/recovery", RecoveryResponse, RecoveryDto> | Endpoint<"POST", "/auth/recovery/reset", null, RecoveryResetDto> | Endpoint<"GET", "/oauth2/:provider", void> | Endpoint<"GET", "/oauth2/:provider/callback", void> | Endpoint<"GET", `/oauth2/${OAuth2Provider.Google}`, void> | Endpoint<"GET", `/oauth2/${OAuth2Provider.Google}/callback`, void> | Endpoint<"GET", `/oauth2/${OAuth2Provider.Facebook}`, void> | Endpoint<"GET", `/oauth2/${OAuth2Provider.Facebook}/callback`, void> | Endpoint<"GET", `/oauth2/${OAuth2Provider.Twitter}`, void> | Endpoint<"GET", `/oauth2/${OAuth2Provider.Twitter}/callback`, void> | Endpoint<"DELETE", "/oauth2/:provider", void>;
302
564
 
303
565
  type CareersOffice = {
304
566
  id: number | null;
@@ -623,16 +885,7 @@ type Distance<T> = T & {
623
885
  distance: number;
624
886
  };
625
887
 
626
- type OrganizationEventOrderEndpoints = Endpoint<"POST", "/organizations/:organizationSlug/events/:eventSlug/orders", Order, CreateOrganizationEventOrderDto>;
627
-
628
- declare class CreateOrganizationEventStyleDto {
629
- type: OrganizationEventStyleType;
630
- emoji: string;
631
- name: string;
632
- }
633
-
634
- declare class UpdateOrganizationEventStyleDto extends CreateOrganizationEventStyleDto {
635
- }
888
+ type OrganizationEventOrderEndpoints = Endpoint<"POST", "/organizations/:organizationSlug/events/:eventSlug/orders", Order, CreateOrganizationEventOrderDto>;
636
889
 
637
890
  type OrganizationEventStyle = Base & {
638
891
  type: OrganizationEventStyleType;
@@ -805,18 +1058,6 @@ type EventAnalyticsOptions = AnalyticsOptions & {
805
1058
  };
806
1059
  type OrganizationAnalyticsEndpoints = Endpoint<"GET", "/organizations/:organizationSlug/analytics/overview", OrganizationAnalyticsOverview, AnalyticsOptions> | Endpoint<"GET", "/organizations/:organizationSlug/analytics/events", ArrayResult<OrganizationEventAnalytics>, ArrayOptions<OrganizationEventAnalytics> & EventAnalyticsOptions>;
807
1060
 
808
- declare class AcceptOrganizationMemberInvitationDto {
809
- token: string;
810
- }
811
-
812
- declare class CreateOrganizationMemberInvitationLinkDto {
813
- role?: OrganizationMemberRole;
814
- }
815
-
816
- declare class UpdateOrganizationMemberDto {
817
- role: OrganizationMemberRole;
818
- }
819
-
820
1061
  type OrganizationToken = Omit<Base, "updatedAt"> & {
821
1062
  type: OrganizationTokenType;
822
1063
  value: string;
@@ -982,232 +1223,18 @@ type ArrayResult<T> = {
982
1223
  limit: number;
983
1224
  };
984
1225
 
985
- declare class CreateChannelDto {
986
- type: ChannelType;
987
- participantUsernames: string[];
988
- name?: string;
989
- }
990
-
991
- declare class UpdateChannelDto {
992
- name?: string;
993
- }
994
-
995
- declare class AddReactionDto {
996
- emoji: string;
997
- }
998
-
999
- declare class ContentOrAttachmentsConstraint implements ValidatorConstraintInterface {
1000
- validate(_value: unknown, args: ValidationArguments): boolean;
1001
- defaultMessage(_args: ValidationArguments): string;
1002
- }
1003
- declare class CreateChannelMessageDto {
1004
- content?: string;
1005
- attachments?: string[];
1006
- replyToId?: string;
1007
- }
1008
-
1009
- declare class UpdateChannelMessageDto {
1010
- content?: string;
1011
- }
1012
-
1013
- declare class ReportChannelMessageDto {
1014
- reason: ChannelMessageReportReason;
1015
- description?: string;
1016
- }
1017
-
1018
- declare class GeoPointDto implements GeoPoint {
1019
- type: "Point";
1020
- coordinates: [number, number];
1021
- constructor();
1022
- }
1023
- declare class CreateLocationDto implements Location$1 {
1024
- name?: string;
1025
- address: string;
1026
- zipCode: string;
1027
- city: string;
1028
- country: string;
1029
- geometry: GeoPointDto;
1030
- }
1031
-
1032
- declare class UpdateLocationDto implements Partial<Location$1> {
1033
- name?: string;
1034
- address?: string;
1035
- zipCode?: string;
1036
- city?: string;
1037
- country?: string;
1038
- geometry?: GeoPointDto;
1039
- }
1040
-
1041
- declare class CreateOrganizationMemberDto {
1042
- user: string;
1043
- role: OrganizationMemberRole;
1044
- }
1045
-
1046
- declare class CreateOrganizationDto {
1047
- organizationSlug?: string;
1048
- identity: CreateOrganizationIdentityDto;
1049
- members: CreateOrganizationMemberDto[];
1050
- location?: Location$1;
1051
- }
1052
- declare class CreateOrganizationIdentityDto {
1053
- displayName: string;
1054
- description?: string;
1055
- avatarUrl?: string;
1056
- bannerUrl?: string;
1057
- links?: string[];
1058
- }
1059
-
1060
- declare class UpdateOrganizationDto {
1061
- slug?: string;
1062
- identity?: UpdateOrganizationIdentityDto;
1063
- members?: UpdateOrganizationMemberDto[];
1064
- location?: Location;
1065
- }
1066
- declare class UpdateOrganizationIdentityDto {
1067
- displayName?: string;
1068
- description?: string;
1069
- avatarUrl?: string;
1070
- bannerUrl?: string;
1071
- links?: string[];
1072
- }
1073
-
1074
- declare class CreateOrganizationEventOrderDto {
1075
- cart: string[];
1076
- }
1077
-
1078
- type CreateOrganizationEventTicketInput = Omit<ExcludeBase<OrganizationEventTicket>, "price" | "product" | "event" | "fee"> & {
1079
- price: number;
1080
- };
1081
- declare class CreateOrganizationEventTicketDto implements CreateOrganizationEventTicketInput {
1082
- name: string;
1083
- description?: string;
1084
- price: number;
1085
- quantity: number;
1086
- type: OrganizationEventTicketType;
1087
- category: OrganizationEventTicketCategory;
1088
- currency: Currency;
1089
- isVisible: boolean;
1090
- isFeesIncluded: boolean;
1091
- startAt?: Date;
1092
- endAt?: Date;
1093
- }
1094
-
1095
- declare class UpdateOrganizationEventTicketDto implements DeepPartial<CreateOrganizationEventTicketInput> {
1096
- name?: string;
1097
- description?: string;
1098
- price?: number;
1099
- quantity?: number;
1100
- type?: OrganizationEventTicketType;
1101
- category?: OrganizationEventTicketCategory;
1102
- currency?: Currency;
1103
- isVisible?: boolean;
1104
- isFeesIncluded?: boolean;
1105
- startAt?: Date;
1106
- endAt?: Date;
1107
- }
1108
-
1109
- declare class AtLeastOneMediaConstraint implements ValidatorConstraintInterface {
1110
- validate(_value: unknown, args: ValidationArguments): boolean;
1111
- defaultMessage(): string;
1112
- }
1113
- declare function AtLeastOneMedia(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
1114
- type CreateOrganizationEventInput = Omit<ExcludeBase<OrganizationEvent>, "slug" | "styles" | "tickets" | "organization" | "status" | "viewsCount" | "sessionsCount" | "totalViewsCount" | "averageViewsPerSessionCount"> & {
1115
- slug?: string;
1116
- styles: string[];
1117
- tickets: CreateOrganizationEventTicketInput[];
1226
+ type Endpoint<M extends Options["method"], Path extends string, Res, Body = undefined> = {
1227
+ method: M;
1228
+ path: Path;
1229
+ res: Res;
1230
+ body: Body;
1118
1231
  };
1119
- declare class BaseOrganizationEventDto {
1120
- title: string;
1121
- slug?: string;
1122
- description: string;
1123
- type: OrganizationEventType;
1124
- visibility: OrganizationEventVisibilityType;
1125
- flyers: string[];
1126
- trailers: string[];
1127
- location: CreateLocationDto;
1128
- styles: string[];
1129
- startAt: Date;
1130
- endAt: Date;
1131
- }
1132
- declare class CreateOrganizationEventDto extends BaseOrganizationEventDto implements CreateOrganizationEventInput {
1133
- tickets: CreateOrganizationEventTicketDto[];
1134
- }
1135
-
1136
- declare class AtLeastOneMediaOnUpdateConstraint implements ValidatorConstraintInterface {
1137
- validate(_value: unknown, args: ValidationArguments): boolean;
1138
- defaultMessage(): string;
1139
- }
1140
- declare function AtLeastOneMediaOnUpdate(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
1141
- declare class UpdateOrganizationEventDto implements DeepPartial<CreateOrganizationEventInput> {
1142
- title?: string;
1143
- slug?: string;
1144
- description?: string;
1145
- type?: OrganizationEventType;
1146
- visibility?: OrganizationEventVisibilityType;
1147
- flyers?: string[];
1148
- trailers?: string[];
1149
- location?: UpdateLocationDto;
1150
- tickets?: UpdateOrganizationEventTicketDto[];
1151
- styles?: string[];
1152
- startAt?: Date;
1153
- endAt?: Date;
1154
- }
1155
-
1156
- declare class CreateUserDto {
1157
- identifier: CreateUserIdentifierDto;
1158
- identity: CreateUserIdentityDto;
1159
- password: string;
1160
- }
1161
- declare class CreateUserIdentifierDto implements Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">> {
1162
- email?: string;
1163
- phoneNumber?: string;
1164
- username: string;
1165
- }
1166
- declare class CreateUserIdentityDto {
1167
- firstName: string;
1168
- lastName: string;
1169
- gender: UserIdentityGender;
1170
- avatarUrl?: string;
1171
- birthDate: Date;
1172
- links?: string[];
1173
- }
1174
-
1175
- declare class RecoveryDto {
1176
- identifier: string;
1177
- }
1178
-
1179
- declare class RecoveryResetDto {
1180
- tokenId: string;
1181
- tokenValue: string;
1182
- password: string;
1183
- }
1184
-
1185
- declare class SignInUserDto {
1186
- identifier: string;
1187
- password: string;
1188
- }
1232
+ type Endpoints = ApiKeyEndpoints | AuthEndpoints | CareerEndpoints | ChannelEndpoints | ChannelMessageEndpoints | CurrenciesEndpoints | FeedEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
1189
1233
 
1190
- declare class UpdateUserDto {
1191
- identifier?: UpdateUserIdentifierDto;
1192
- identity?: UpdateUserIdentityDto;
1193
- password?: string;
1194
- }
1195
- declare class UpdateUserIdentifierDto implements Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">> {
1196
- email?: string;
1197
- phoneNumber?: string;
1198
- username?: string;
1199
- }
1200
- declare class UpdateUserIdentityDto implements Partial<Pick<UserIdentity, "firstName" | "lastName" | "displayName" | "description" | "avatarUrl" | "bannerUrl" | "gender" | "birthDate">> {
1201
- firstName?: string;
1202
- lastName?: string;
1203
- displayName?: string;
1204
- description?: string;
1205
- avatarUrl?: string | undefined;
1206
- bannerUrl?: string | undefined;
1207
- gender?: UserIdentityGender;
1208
- birthDate?: Date;
1209
- links?: string[];
1234
+ interface APIRequestOptions extends Options {
1235
+ apiKey?: string;
1210
1236
  }
1237
+ declare const request: <T>(url: string, options?: APIRequestOptions) => Promise<Response$1<APIResponse<T>>>;
1211
1238
 
1212
1239
  type SuccessfulAPIResponse<T> = {
1213
1240
  success: true;
@@ -1259,13 +1286,20 @@ declare class TonightPassAPIError<T> extends Error {
1259
1286
  interface ClientOptions {
1260
1287
  readonly baseURL: string;
1261
1288
  readonly apiKey?: string;
1289
+ readonly cache?: CacheOptions;
1262
1290
  }
1263
1291
  declare class Client {
1264
1292
  private options;
1265
1293
  private apiKey?;
1294
+ private cacheManager?;
1266
1295
  readonly url: (path: string, params: Record<string, ParamValue>) => string;
1267
1296
  constructor(options: ClientOptions);
1268
1297
  setOptions(options: ClientOptions): void;
1298
+ clearCache(): void;
1299
+ getCacheStats(): {
1300
+ size: number;
1301
+ keys: string[];
1302
+ } | undefined;
1269
1303
  get<Path extends PathsFor<"GET">>(path: Path, query?: Query<Path>, options?: APIRequestOptions): Promise<ResponseFor<"GET", Path>>;
1270
1304
  post<Path extends PathsFor<"POST">>(path: Path, body: Body<"POST", Path>, query?: Query<Path>, options?: APIRequestOptions): Promise<ResponseFor<"POST", Path>>;
1271
1305
  put<Path extends PathsFor<"PUT">>(path: Path, body: Body<"PUT", Path>, query?: Query<Path>, options?: APIRequestOptions): Promise<ResponseFor<"PUT", Path>>;
@@ -1274,11 +1308,6 @@ declare class Client {
1274
1308
  private requester;
1275
1309
  }
1276
1310
 
1277
- interface APIRequestOptions extends Options {
1278
- apiKey?: string;
1279
- }
1280
- declare const request: <T>(url: string, options?: APIRequestOptions) => Promise<Response$1<APIResponse<T>>>;
1281
-
1282
1311
  declare const apiKeys: (client: Client) => {
1283
1312
  getAll: () => Promise<ArrayResult<ApiKey>>;
1284
1313
  get: (apiKeyId: string) => Promise<ApiKey>;
@@ -1295,8 +1324,8 @@ declare const auth: (client: Client) => {
1295
1324
  recovery: (data: RecoveryDto) => Promise<RecoveryResponse>;
1296
1325
  recoveryReset: (data: RecoveryResetDto) => Promise<null>;
1297
1326
  oauth2: {
1298
- disconnect: (provider: OAuth2Provider) => Promise<void>;
1299
1327
  connect: (provider: OAuth2Provider, params?: Record<string, ParamValue>) => void;
1328
+ disconnect: (provider: OAuth2Provider) => Promise<void>;
1300
1329
  };
1301
1330
  };
1302
1331
 
@@ -1530,8 +1559,8 @@ declare class TonightPass {
1530
1559
  recovery: (data: RecoveryDto) => Promise<RecoveryResponse>;
1531
1560
  recoveryReset: (data: RecoveryResetDto) => Promise<null>;
1532
1561
  oauth2: {
1533
- disconnect: (provider: OAuth2Provider) => Promise<void>;
1534
1562
  connect: (provider: OAuth2Provider, params?: Record<string, pathcat.ParamValue>) => void;
1563
+ disconnect: (provider: OAuth2Provider) => Promise<void>;
1535
1564
  };
1536
1565
  };
1537
1566
  readonly careers: {
@@ -1897,4 +1926,4 @@ declare function channelsWS(options?: Partial<WebSocketClientOptions>): {
1897
1926
  client: ChannelWebSocketClient;
1898
1927
  };
1899
1928
 
1900
- export { type APIRequestOptions, type APIResponse, AcceptOrganizationMemberInvitationDto, AddParticipantDto, AddReactionDto, type AnalyticsOptions, type ApiKey, type ApiKeyEndpoints, ApiKeyTier, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, AtLeastOneMedia, AtLeastOneMediaConstraint, AtLeastOneMediaOnUpdate, AtLeastOneMediaOnUpdateConstraint, type AuthEndpoints, type Base, BaseOrganizationEventDto, type BaseProfile, type BaseProfileMetadata, type Body, type CareerEndpoints, type CareersCategory, type CareersEmploymentType, type CareersJob, type CareersOffice, type Channel, type ChannelDeleteEvent, type ChannelEndpoints, type ChannelMember, type ChannelMemberJoinEvent, type ChannelMemberLeaveEvent, ChannelMemberRole, type ChannelMessage, type ChannelMessageCreateEvent, type ChannelMessageDeleteEvent, type ChannelMessageEndpoints, type ChannelMessageReaction, type ChannelMessageReadByEntry, ChannelMessageReportReason, type ChannelMessageUpdateEvent, type ChannelParticipant, ChannelStatus, ChannelType, type ChannelUpdateEvent, ChannelWebSocketClient, type ChannelWebSocketEvent, Client, type ClientOptions, ContentOrAttachmentsConstraint, type CreateApiKeyDto, CreateChannelDto, CreateChannelMessageDto, CreateLocationDto, CreateOrganizationDto, CreateOrganizationEventDto, type CreateOrganizationEventInput, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, type CreateOrganizationEventTicketInput, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateOrganizationMemberInvitationLinkDto, CreateUserDto, CreateUserIdentityDto, CreateUserPostCommentDto, CreateUserPostDto, CreateUserPostRepostDto, type CurrenciesEndpoints, Currency, type CurrencyConversion, type CurrencyConversionResult, DEFAULT_API_URL, type DeepPartial, type Distance, type Endpoint, type Endpoints, ErrorType, type ErroredAPIResponse, type EventAnalyticsOptions, type ExchangeRates, type ExcludeBase, type FeedEndpoints, type FeedPost, FeedType, type GeoPoint, GeoPointDto, type GeoSearchAggregation, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationEndpoints, OAuth2Provider, type OAuth2ProviderParams, type Order, type OrderEndpoints, type Organization, type OrganizationAnalyticsEndpoints, type OrganizationAnalyticsOverview, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventAnalytics, type OrganizationEventArrayOptions, type OrganizationEventEndpoints, OrganizationEventFileType, type OrganizationEventOrderEndpoints, OrganizationEventStatus, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, OrganizationFileType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationToken, OrganizationTokenType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, type PromisedResponse, type QueryParams, REGEX, RecoveryDto, RecoveryResetDto, type RecoveryResponse, ReportChannelMessageDto, type Response, type ResponseFor, SignInUserDto, type StringifiedQuery, type StringifiedQueryValue, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, type TypingStartEvent, type TypingStopEvent, type UpdateApiKeyDto, UpdateChannelDto, UpdateChannelMessageDto, UpdateLocationDto, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, UpdateUserPostCommentDto, UpdateUserPostDto, type User, type UserBooking, type UserBookingEndpoints, type UserBookingTicket, type UserBookingWithoutTickets, type UserChannelCountOptions, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, UserFileType, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserNotification, type UserNotificationBase, type UserNotificationEndpoints, type UserNotificationFollow, UserNotificationType, type UserOAuthProvider, type UserPost, type UserPostComment, type UserPostCommentEndpoints, type UserPostEndpoints, type UserPostMedia, type UserPostMediaEndpoints, UserPostMediaType, type UserPostRepost, type UserPostRepostEndpoints, type UserPostViewEndpoints, UserPostVisibility, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, WebSocketClient, type WebSocketClientOptions, type WebSocketConnectOptions, type WebSocketEndpoint, type WebSocketEndpoints, type WebSocketEvent, type WebSocketEventHandler, type WebSocketOptionsFor, type WebSocketPath, type WebSocketPaths, type WebSocketPathsFor, type WebhookEndpoints, apiKeys, auth, buildFileFormData, careers, channels, channelsWS, currencies, feed, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
1929
+ export { type APIRequestOptions, type APIResponse, AcceptOrganizationMemberInvitationDto, AddParticipantDto, AddReactionDto, type AnalyticsOptions, type ApiKey, type ApiKeyEndpoints, ApiKeyTier, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, AtLeastOneMedia, AtLeastOneMediaConstraint, AtLeastOneMediaOnUpdate, AtLeastOneMediaOnUpdateConstraint, type AuthEndpoints, type Base, BaseOrganizationEventDto, type BaseProfile, type BaseProfileMetadata, type Body, type CacheEntry, CacheManager, type CacheOptions, type CareerEndpoints, type CareersCategory, type CareersEmploymentType, type CareersJob, type CareersOffice, type Channel, type ChannelDeleteEvent, type ChannelEndpoints, type ChannelMember, type ChannelMemberJoinEvent, type ChannelMemberLeaveEvent, ChannelMemberRole, type ChannelMessage, type ChannelMessageCreateEvent, type ChannelMessageDeleteEvent, type ChannelMessageEndpoints, type ChannelMessageReaction, type ChannelMessageReadByEntry, ChannelMessageReportReason, type ChannelMessageUpdateEvent, type ChannelParticipant, ChannelStatus, ChannelType, type ChannelUpdateEvent, ChannelWebSocketClient, type ChannelWebSocketEvent, Client, type ClientOptions, ContentOrAttachmentsConstraint, type CreateApiKeyDto, CreateChannelDto, CreateChannelMessageDto, CreateLocationDto, CreateOrganizationDto, CreateOrganizationEventDto, type CreateOrganizationEventInput, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, type CreateOrganizationEventTicketInput, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateOrganizationMemberInvitationLinkDto, CreateUserDto, CreateUserIdentityDto, CreateUserPostCommentDto, CreateUserPostDto, CreateUserPostRepostDto, type CurrenciesEndpoints, Currency, type CurrencyConversion, type CurrencyConversionResult, DEFAULT_API_URL, type DeepPartial, type Distance, type Endpoint, type Endpoints, ErrorType, type ErroredAPIResponse, type EventAnalyticsOptions, type ExchangeRates, type ExcludeBase, type FeedEndpoints, type FeedPost, FeedType, type GeoPoint, GeoPointDto, type GeoSearchAggregation, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationEndpoints, OAuth2Provider, type Order, type OrderEndpoints, type Organization, type OrganizationAnalyticsEndpoints, type OrganizationAnalyticsOverview, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventAnalytics, type OrganizationEventArrayOptions, type OrganizationEventEndpoints, OrganizationEventFileType, type OrganizationEventOrderEndpoints, OrganizationEventStatus, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, OrganizationFileType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationToken, OrganizationTokenType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, type PromisedResponse, type QueryParams, REGEX, RecoveryDto, RecoveryResetDto, type RecoveryResponse, ReportChannelMessageDto, type Response, type ResponseFor, SignInUserDto, type StringifiedQuery, type StringifiedQueryValue, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, type TypingStartEvent, type TypingStopEvent, type UpdateApiKeyDto, UpdateChannelDto, UpdateChannelMessageDto, UpdateLocationDto, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, UpdateUserPostCommentDto, UpdateUserPostDto, type User, type UserBooking, type UserBookingEndpoints, type UserBookingTicket, type UserBookingWithoutTickets, type UserChannelCountOptions, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, UserFileType, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserNotification, type UserNotificationBase, type UserNotificationEndpoints, type UserNotificationFollow, UserNotificationType, type UserOAuthProvider, type UserPost, type UserPostComment, type UserPostCommentEndpoints, type UserPostEndpoints, type UserPostMedia, type UserPostMediaEndpoints, UserPostMediaType, type UserPostRepost, type UserPostRepostEndpoints, type UserPostViewEndpoints, UserPostVisibility, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, WebSocketClient, type WebSocketClientOptions, type WebSocketConnectOptions, type WebSocketEndpoint, type WebSocketEndpoints, type WebSocketEvent, type WebSocketEventHandler, type WebSocketOptionsFor, type WebSocketPath, type WebSocketPaths, type WebSocketPathsFor, type WebhookEndpoints, apiKeys, auth, buildFileFormData, careers, channels, channelsWS, currencies, feed, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };