tonightpass 0.0.208 → 0.0.210

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;
@@ -620,16 +885,7 @@ type Distance<T> = T & {
620
885
  distance: number;
621
886
  };
622
887
 
623
- type OrganizationEventOrderEndpoints = Endpoint<"POST", "/organizations/:organizationSlug/events/:eventSlug/orders", Order, CreateOrganizationEventOrderDto>;
624
-
625
- declare class CreateOrganizationEventStyleDto {
626
- type: OrganizationEventStyleType;
627
- emoji: string;
628
- name: string;
629
- }
630
-
631
- declare class UpdateOrganizationEventStyleDto extends CreateOrganizationEventStyleDto {
632
- }
888
+ type OrganizationEventOrderEndpoints = Endpoint<"POST", "/organizations/:organizationSlug/events/:eventSlug/orders", Order, CreateOrganizationEventOrderDto>;
633
889
 
634
890
  type OrganizationEventStyle = Base & {
635
891
  type: OrganizationEventStyleType;
@@ -745,10 +1001,10 @@ type OrganizationEventArrayOptions = ArrayOptions<OrganizationEvent> & {
745
1001
  types?: OrganizationEventType | OrganizationEventType[];
746
1002
  styles?: string | string[];
747
1003
  };
748
- type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/events/search", OrganizationEvent[], {
1004
+ type SearchOrganizationEventsOptions = ArrayOptions<OrganizationEvent> & {
749
1005
  q: string;
750
- limit?: number;
751
- }> | Endpoint<"GET", "/organizations/events", ArrayResult<OrganizationEvent>, OrganizationEventArrayOptions> | Endpoint<"GET", "/organizations/events/suggestions", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/events/nearby", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent> & {
1006
+ };
1007
+ type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/events/search", ArrayResult<OrganizationEvent>, SearchOrganizationEventsOptions> | Endpoint<"GET", "/organizations/events", ArrayResult<OrganizationEvent>, OrganizationEventArrayOptions> | Endpoint<"GET", "/organizations/events/suggestions", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/events/nearby", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent> & {
752
1008
  latitude: number;
753
1009
  longitude: number;
754
1010
  radius?: number;
@@ -802,18 +1058,6 @@ type EventAnalyticsOptions = AnalyticsOptions & {
802
1058
  };
803
1059
  type OrganizationAnalyticsEndpoints = Endpoint<"GET", "/organizations/:organizationSlug/analytics/overview", OrganizationAnalyticsOverview, AnalyticsOptions> | Endpoint<"GET", "/organizations/:organizationSlug/analytics/events", ArrayResult<OrganizationEventAnalytics>, ArrayOptions<OrganizationEventAnalytics> & EventAnalyticsOptions>;
804
1060
 
805
- declare class AcceptOrganizationMemberInvitationDto {
806
- token: string;
807
- }
808
-
809
- declare class CreateOrganizationMemberInvitationLinkDto {
810
- role?: OrganizationMemberRole;
811
- }
812
-
813
- declare class UpdateOrganizationMemberDto {
814
- role: OrganizationMemberRole;
815
- }
816
-
817
1061
  type OrganizationToken = Omit<Base, "updatedAt"> & {
818
1062
  type: OrganizationTokenType;
819
1063
  value: string;
@@ -912,7 +1156,10 @@ type OrganizationProfileMetadata = BaseProfileMetadata & {
912
1156
  membersCount: number;
913
1157
  };
914
1158
  type ProfileMetadata = UserProfileMetadata | OrganizationProfileMetadata;
915
- type ProfileEndpoints = Endpoint<"GET", "/profiles/:username", Profile> | Endpoint<"GET", "/profiles/@me/relationships/suggestions", ArrayResult<Profile>, ArrayOptions<OrganizationProfile | UserProfile>> | Endpoint<"GET", "/profiles/:username/relationships/followers", ArrayResult<UserProfile>, ArrayOptions<UserProfile>> | Endpoint<"POST", "/profiles/:username/relationships/follow", boolean, null> | Endpoint<"POST", "/profiles/:username/relationships/unfollow", boolean, null>;
1159
+ type SearchProfilesOptions = ArrayOptions<Profile> & {
1160
+ q: string;
1161
+ };
1162
+ type ProfileEndpoints = Endpoint<"GET", "/profiles", ArrayResult<Profile>, ArrayOptions<Profile>> | Endpoint<"GET", "/profiles/search", ArrayResult<Profile>, SearchProfilesOptions> | Endpoint<"GET", "/profiles/:username", Profile> | Endpoint<"GET", "/profiles/@me/relationships/suggestions", ArrayResult<Profile>, ArrayOptions<OrganizationProfile | UserProfile>> | Endpoint<"GET", "/profiles/:username/relationships/followers", ArrayResult<UserProfile>, ArrayOptions<UserProfile>> | Endpoint<"POST", "/profiles/:username/relationships/follow", boolean, null> | Endpoint<"POST", "/profiles/:username/relationships/unfollow", boolean, null>;
916
1163
 
917
1164
  type WebhookEndpoints = Endpoint<"POST", "/webhooks/stripe", boolean, Stripe__default.Event>;
918
1165
 
@@ -979,232 +1226,18 @@ type ArrayResult<T> = {
979
1226
  limit: number;
980
1227
  };
981
1228
 
982
- declare class CreateChannelDto {
983
- type: ChannelType;
984
- participantUsernames: string[];
985
- name?: string;
986
- }
987
-
988
- declare class UpdateChannelDto {
989
- name?: string;
990
- }
991
-
992
- declare class AddReactionDto {
993
- emoji: string;
994
- }
995
-
996
- declare class ContentOrAttachmentsConstraint implements ValidatorConstraintInterface {
997
- validate(_value: unknown, args: ValidationArguments): boolean;
998
- defaultMessage(_args: ValidationArguments): string;
999
- }
1000
- declare class CreateChannelMessageDto {
1001
- content?: string;
1002
- attachments?: string[];
1003
- replyToId?: string;
1004
- }
1005
-
1006
- declare class UpdateChannelMessageDto {
1007
- content?: string;
1008
- }
1009
-
1010
- declare class ReportChannelMessageDto {
1011
- reason: ChannelMessageReportReason;
1012
- description?: string;
1013
- }
1014
-
1015
- declare class GeoPointDto implements GeoPoint {
1016
- type: "Point";
1017
- coordinates: [number, number];
1018
- constructor();
1019
- }
1020
- declare class CreateLocationDto implements Location$1 {
1021
- name?: string;
1022
- address: string;
1023
- zipCode: string;
1024
- city: string;
1025
- country: string;
1026
- geometry: GeoPointDto;
1027
- }
1028
-
1029
- declare class UpdateLocationDto implements Partial<Location$1> {
1030
- name?: string;
1031
- address?: string;
1032
- zipCode?: string;
1033
- city?: string;
1034
- country?: string;
1035
- geometry?: GeoPointDto;
1036
- }
1037
-
1038
- declare class CreateOrganizationMemberDto {
1039
- user: string;
1040
- role: OrganizationMemberRole;
1041
- }
1042
-
1043
- declare class CreateOrganizationDto {
1044
- organizationSlug?: string;
1045
- identity: CreateOrganizationIdentityDto;
1046
- members: CreateOrganizationMemberDto[];
1047
- location?: Location$1;
1048
- }
1049
- declare class CreateOrganizationIdentityDto {
1050
- displayName: string;
1051
- description?: string;
1052
- avatarUrl?: string;
1053
- bannerUrl?: string;
1054
- links?: string[];
1055
- }
1056
-
1057
- declare class UpdateOrganizationDto {
1058
- slug?: string;
1059
- identity?: UpdateOrganizationIdentityDto;
1060
- members?: UpdateOrganizationMemberDto[];
1061
- location?: Location;
1062
- }
1063
- declare class UpdateOrganizationIdentityDto {
1064
- displayName?: string;
1065
- description?: string;
1066
- avatarUrl?: string;
1067
- bannerUrl?: string;
1068
- links?: string[];
1069
- }
1070
-
1071
- declare class CreateOrganizationEventOrderDto {
1072
- cart: string[];
1073
- }
1074
-
1075
- type CreateOrganizationEventTicketInput = Omit<ExcludeBase<OrganizationEventTicket>, "price" | "product" | "event" | "fee"> & {
1076
- price: number;
1077
- };
1078
- declare class CreateOrganizationEventTicketDto implements CreateOrganizationEventTicketInput {
1079
- name: string;
1080
- description?: string;
1081
- price: number;
1082
- quantity: number;
1083
- type: OrganizationEventTicketType;
1084
- category: OrganizationEventTicketCategory;
1085
- currency: Currency;
1086
- isVisible: boolean;
1087
- isFeesIncluded: boolean;
1088
- startAt?: Date;
1089
- endAt?: Date;
1090
- }
1091
-
1092
- declare class UpdateOrganizationEventTicketDto implements DeepPartial<CreateOrganizationEventTicketInput> {
1093
- name?: string;
1094
- description?: string;
1095
- price?: number;
1096
- quantity?: number;
1097
- type?: OrganizationEventTicketType;
1098
- category?: OrganizationEventTicketCategory;
1099
- currency?: Currency;
1100
- isVisible?: boolean;
1101
- isFeesIncluded?: boolean;
1102
- startAt?: Date;
1103
- endAt?: Date;
1104
- }
1105
-
1106
- declare class AtLeastOneMediaConstraint implements ValidatorConstraintInterface {
1107
- validate(_value: unknown, args: ValidationArguments): boolean;
1108
- defaultMessage(): string;
1109
- }
1110
- declare function AtLeastOneMedia(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
1111
- type CreateOrganizationEventInput = Omit<ExcludeBase<OrganizationEvent>, "slug" | "styles" | "tickets" | "organization" | "status" | "viewsCount" | "sessionsCount" | "totalViewsCount" | "averageViewsPerSessionCount"> & {
1112
- slug?: string;
1113
- styles: string[];
1114
- tickets: CreateOrganizationEventTicketInput[];
1229
+ type Endpoint<M extends Options["method"], Path extends string, Res, Body = undefined> = {
1230
+ method: M;
1231
+ path: Path;
1232
+ res: Res;
1233
+ body: Body;
1115
1234
  };
1116
- declare class BaseOrganizationEventDto {
1117
- title: string;
1118
- slug?: string;
1119
- description: string;
1120
- type: OrganizationEventType;
1121
- visibility: OrganizationEventVisibilityType;
1122
- flyers: string[];
1123
- trailers: string[];
1124
- location: CreateLocationDto;
1125
- styles: string[];
1126
- startAt: Date;
1127
- endAt: Date;
1128
- }
1129
- declare class CreateOrganizationEventDto extends BaseOrganizationEventDto implements CreateOrganizationEventInput {
1130
- tickets: CreateOrganizationEventTicketDto[];
1131
- }
1132
-
1133
- declare class AtLeastOneMediaOnUpdateConstraint implements ValidatorConstraintInterface {
1134
- validate(_value: unknown, args: ValidationArguments): boolean;
1135
- defaultMessage(): string;
1136
- }
1137
- declare function AtLeastOneMediaOnUpdate(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
1138
- declare class UpdateOrganizationEventDto implements DeepPartial<CreateOrganizationEventInput> {
1139
- title?: string;
1140
- slug?: string;
1141
- description?: string;
1142
- type?: OrganizationEventType;
1143
- visibility?: OrganizationEventVisibilityType;
1144
- flyers?: string[];
1145
- trailers?: string[];
1146
- location?: UpdateLocationDto;
1147
- tickets?: UpdateOrganizationEventTicketDto[];
1148
- styles?: string[];
1149
- startAt?: Date;
1150
- endAt?: Date;
1151
- }
1152
-
1153
- declare class CreateUserDto {
1154
- identifier: CreateUserIdentifierDto;
1155
- identity: CreateUserIdentityDto;
1156
- password: string;
1157
- }
1158
- declare class CreateUserIdentifierDto implements Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">> {
1159
- email?: string;
1160
- phoneNumber?: string;
1161
- username: string;
1162
- }
1163
- declare class CreateUserIdentityDto {
1164
- firstName: string;
1165
- lastName: string;
1166
- gender: UserIdentityGender;
1167
- avatarUrl?: string;
1168
- birthDate: Date;
1169
- links?: string[];
1170
- }
1171
-
1172
- declare class RecoveryDto {
1173
- identifier: string;
1174
- }
1175
-
1176
- declare class RecoveryResetDto {
1177
- tokenId: string;
1178
- tokenValue: string;
1179
- password: string;
1180
- }
1181
-
1182
- declare class SignInUserDto {
1183
- identifier: string;
1184
- password: string;
1185
- }
1235
+ type Endpoints = ApiKeyEndpoints | AuthEndpoints | CareerEndpoints | ChannelEndpoints | ChannelMessageEndpoints | CurrenciesEndpoints | FeedEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
1186
1236
 
1187
- declare class UpdateUserDto {
1188
- identifier?: UpdateUserIdentifierDto;
1189
- identity?: UpdateUserIdentityDto;
1190
- password?: string;
1191
- }
1192
- declare class UpdateUserIdentifierDto implements Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">> {
1193
- email?: string;
1194
- phoneNumber?: string;
1195
- username?: string;
1196
- }
1197
- declare class UpdateUserIdentityDto implements Partial<Pick<UserIdentity, "firstName" | "lastName" | "displayName" | "description" | "avatarUrl" | "bannerUrl" | "gender" | "birthDate">> {
1198
- firstName?: string;
1199
- lastName?: string;
1200
- displayName?: string;
1201
- description?: string;
1202
- avatarUrl?: string | undefined;
1203
- bannerUrl?: string | undefined;
1204
- gender?: UserIdentityGender;
1205
- birthDate?: Date;
1206
- links?: string[];
1237
+ interface APIRequestOptions extends Options {
1238
+ apiKey?: string;
1207
1239
  }
1240
+ declare const request: <T>(url: string, options?: APIRequestOptions) => Promise<Response$1<APIResponse<T>>>;
1208
1241
 
1209
1242
  type SuccessfulAPIResponse<T> = {
1210
1243
  success: true;
@@ -1256,13 +1289,20 @@ declare class TonightPassAPIError<T> extends Error {
1256
1289
  interface ClientOptions {
1257
1290
  readonly baseURL: string;
1258
1291
  readonly apiKey?: string;
1292
+ readonly cache?: CacheOptions;
1259
1293
  }
1260
1294
  declare class Client {
1261
1295
  private options;
1262
1296
  private apiKey?;
1297
+ private cacheManager?;
1263
1298
  readonly url: (path: string, params: Record<string, ParamValue>) => string;
1264
1299
  constructor(options: ClientOptions);
1265
1300
  setOptions(options: ClientOptions): void;
1301
+ clearCache(): void;
1302
+ getCacheStats(): {
1303
+ size: number;
1304
+ keys: string[];
1305
+ } | undefined;
1266
1306
  get<Path extends PathsFor<"GET">>(path: Path, query?: Query<Path>, options?: APIRequestOptions): Promise<ResponseFor<"GET", Path>>;
1267
1307
  post<Path extends PathsFor<"POST">>(path: Path, body: Body<"POST", Path>, query?: Query<Path>, options?: APIRequestOptions): Promise<ResponseFor<"POST", Path>>;
1268
1308
  put<Path extends PathsFor<"PUT">>(path: Path, body: Body<"PUT", Path>, query?: Query<Path>, options?: APIRequestOptions): Promise<ResponseFor<"PUT", Path>>;
@@ -1271,11 +1311,6 @@ declare class Client {
1271
1311
  private requester;
1272
1312
  }
1273
1313
 
1274
- interface APIRequestOptions extends Options {
1275
- apiKey?: string;
1276
- }
1277
- declare const request: <T>(url: string, options?: APIRequestOptions) => Promise<Response$1<APIResponse<T>>>;
1278
-
1279
1314
  declare const apiKeys: (client: Client) => {
1280
1315
  getAll: () => Promise<ArrayResult<ApiKey>>;
1281
1316
  get: (apiKeyId: string) => Promise<ApiKey>;
@@ -1395,7 +1430,7 @@ declare const organizations: (client: Client) => {
1395
1430
  dashboard: (organizationSlug: string) => void;
1396
1431
  };
1397
1432
  events: {
1398
- search: (query: string, limit?: number) => Promise<OrganizationEvent[]>;
1433
+ search: (query: string, options?: ArrayOptions<OrganizationEvent>) => Promise<ArrayResult<OrganizationEvent>>;
1399
1434
  getAll: (organizationSlug?: string, options?: OrganizationEventArrayOptions) => Promise<ArrayResult<OrganizationEvent>>;
1400
1435
  getSuggestions: (options?: ArrayOptions<OrganizationEvent>) => Promise<ArrayResult<OrganizationEvent>>;
1401
1436
  getNearby: (options: ArrayOptions<OrganizationEvent> & {
@@ -1448,6 +1483,8 @@ declare const organizations: (client: Client) => {
1448
1483
  };
1449
1484
 
1450
1485
  declare const profiles: (client: Client) => {
1486
+ getAll: (options?: ArrayOptions<Profile>) => Promise<ArrayResult<Profile>>;
1487
+ search: (query: string, options?: ArrayOptions<Profile>) => Promise<ArrayResult<Profile>>;
1451
1488
  get: (username: string) => Promise<Profile>;
1452
1489
  relationships: {
1453
1490
  follow: (username: string) => Promise<boolean>;
@@ -1621,7 +1658,7 @@ declare class TonightPass {
1621
1658
  dashboard: (organizationSlug: string) => void;
1622
1659
  };
1623
1660
  events: {
1624
- search: (query: string, limit?: number) => Promise<OrganizationEvent[]>;
1661
+ search: (query: string, options?: ArrayOptions<OrganizationEvent>) => Promise<ArrayResult<OrganizationEvent>>;
1625
1662
  getAll: (organizationSlug?: string, options?: OrganizationEventArrayOptions) => Promise<ArrayResult<OrganizationEvent>>;
1626
1663
  getSuggestions: (options?: ArrayOptions<OrganizationEvent>) => Promise<ArrayResult<OrganizationEvent>>;
1627
1664
  getNearby: (options: ArrayOptions<OrganizationEvent> & {
@@ -1673,6 +1710,8 @@ declare class TonightPass {
1673
1710
  };
1674
1711
  };
1675
1712
  readonly profiles: {
1713
+ getAll: (options?: ArrayOptions<Profile>) => Promise<ArrayResult<Profile>>;
1714
+ search: (query: string, options?: ArrayOptions<Profile>) => Promise<ArrayResult<Profile>>;
1676
1715
  get: (username: string) => Promise<Profile>;
1677
1716
  relationships: {
1678
1717
  follow: (username: string) => Promise<boolean>;
@@ -1894,4 +1933,4 @@ declare function channelsWS(options?: Partial<WebSocketClientOptions>): {
1894
1933
  client: ChannelWebSocketClient;
1895
1934
  };
1896
1935
 
1897
- 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 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 };
1936
+ 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, type SearchOrganizationEventsOptions, type SearchProfilesOptions, 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 };