tonightpass 0.0.0 → 0.0.2
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/.turbo/turbo-build.log +21 -17
- package/CHANGELOG.md +13 -0
- package/dist/index.d.mts +615 -0
- package/dist/index.d.ts +258 -52
- package/dist/index.js +44 -471
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +15 -6
- package/src/constants/api.ts +1 -0
- package/src/constants/index.ts +2 -0
- package/src/constants/regex.ts +20 -0
- package/src/index.ts +5 -3
- package/src/rest/client.ts +154 -0
- package/src/rest/dtos/index.ts +3 -0
- package/src/rest/dtos/users/create-user.dto.ts +16 -0
- package/src/rest/dtos/users/index.ts +3 -0
- package/src/rest/dtos/users/sign-in-user.dto.ts +4 -0
- package/src/rest/dtos/users/update-user.dto.ts +116 -0
- package/src/rest/endpoints.ts +41 -0
- package/src/rest/index.ts +5 -0
- package/src/rest/request/index.ts +1 -0
- package/src/rest/request/request.ts +30 -0
- package/src/rest/types/api/index.ts +0 -0
- package/src/rest/types/careers/index.ts +87 -0
- package/src/rest/types/event/index.ts +60 -0
- package/src/rest/types/event/ticket/index.ts +36 -0
- package/src/rest/types/health/index.ts +17 -0
- package/src/rest/types/index.ts +33 -0
- package/src/rest/types/order/index.ts +46 -0
- package/src/rest/types/organizations/index.ts +54 -0
- package/src/rest/types/profiles/index.ts +30 -0
- package/src/rest/types/token/index.ts +15 -0
- package/src/rest/types/users/index.ts +104 -0
- package/src/sdk/builder.ts +5 -0
- package/src/sdk/careers.ts +22 -0
- package/src/sdk/health.ts +6 -0
- package/src/sdk/index.ts +3 -0
- package/src/sdk/profiles.ts +6 -0
- package/src/sdk/users.ts +12 -0
- package/src/tonightpass.ts +19 -0
- package/src/utils/index.ts +1 -0
- package/tests/careers/index.ts +28 -0
- package/tests/index.ts +57 -0
- package/tsconfig.json +3 -1
- package/tsup.config.ts +5 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
> tonightpass@0.0.
|
|
3
|
-
> tsup
|
|
4
|
-
|
|
5
|
-
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.0.2
|
|
8
|
-
[34mCLI[39m Using tsup config: /
|
|
9
|
-
[34mCLI[39m Target: esnext
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
13
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
1
|
+
|
|
2
|
+
> tonightpass@0.0.2 build /home/runner/work/tonightpass/tonightpass/packages/node
|
|
3
|
+
> tsup
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.0.2
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/tonightpass/tonightpass/packages/node/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: esnext
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.27 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m24.96 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 227ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m6.39 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m24.96 KB[39m
|
|
17
|
+
[32mESM[39m ⚡️ Build success in 228ms
|
|
18
|
+
[34mDTS[39m Build start
|
|
19
|
+
[32mDTS[39m ⚡️ Build success in 2585ms
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m18.43 KB[39m
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m18.43 KB[39m
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# tonightpass
|
|
2
|
+
|
|
3
|
+
## 0.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`276f52e`](https://github.com/tonightpass/tonightpass/commit/276f52eb551e2dce6173c3331119a68780cea8d0) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Add TonightPass exports
|
|
8
|
+
|
|
9
|
+
## 0.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#187](https://github.com/tonightpass/tonightpass/pull/187) [`3218ecc`](https://github.com/tonightpass/tonightpass/commit/3218ecc8bdfda8d5bc1ca3988d8eb56de39d9ccb) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Add tonightpass
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import * as redaxios from 'redaxios';
|
|
2
|
+
import { Options, Response } from 'redaxios';
|
|
3
|
+
import { ParamValue } from 'pathcat';
|
|
4
|
+
|
|
5
|
+
declare const DEFAULT_API_URL = "https://api.tonightpass.com";
|
|
6
|
+
|
|
7
|
+
declare const EMAIL_REGEX: RegExp;
|
|
8
|
+
declare const PASSWORD_REGEX: RegExp;
|
|
9
|
+
declare const NAME_REGEX: RegExp;
|
|
10
|
+
declare const SLUG_REGEX: RegExp;
|
|
11
|
+
declare const BCRYPT_HASH: RegExp;
|
|
12
|
+
declare const PHONE_NUMBER_REGEX: RegExp;
|
|
13
|
+
declare const IMAGE_URL_REGEX: RegExp;
|
|
14
|
+
|
|
15
|
+
type SuccessfulAPIResponse<T> = {
|
|
16
|
+
success: true;
|
|
17
|
+
data: T;
|
|
18
|
+
};
|
|
19
|
+
type ErroredAPIResponse = {
|
|
20
|
+
success: false;
|
|
21
|
+
message: string;
|
|
22
|
+
errors?: {
|
|
23
|
+
[key: string]: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
type APIResponse<T> = SuccessfulAPIResponse<T> | ErroredAPIResponse;
|
|
27
|
+
type Endpoint<M extends Options["method"], Path extends string, Res, Body = undefined> = {
|
|
28
|
+
method: M;
|
|
29
|
+
path: Path;
|
|
30
|
+
res: Res;
|
|
31
|
+
body: Body;
|
|
32
|
+
};
|
|
33
|
+
type Endpoints = CareersEndpoints | HealthEndpoints | ProfileEndpoints | UserEndpoints;
|
|
34
|
+
|
|
35
|
+
type CareersOffice = {
|
|
36
|
+
id: number | null;
|
|
37
|
+
isDefault: boolean | null;
|
|
38
|
+
name: string | null;
|
|
39
|
+
city: string | null;
|
|
40
|
+
countryIso: string | null;
|
|
41
|
+
};
|
|
42
|
+
type CareersJob = {
|
|
43
|
+
id: number;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
lastUpdatedAt: string;
|
|
46
|
+
externalId: null | string;
|
|
47
|
+
title: string;
|
|
48
|
+
status: "ALL" | "ONLINE" | "ARCHIVED";
|
|
49
|
+
remote: boolean;
|
|
50
|
+
office: CareersOffice;
|
|
51
|
+
workplaceType: string;
|
|
52
|
+
remoteType?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
categoryId?: number;
|
|
55
|
+
employmentTypeId?: number;
|
|
56
|
+
};
|
|
57
|
+
type CareersCategory = {
|
|
58
|
+
slug: string;
|
|
59
|
+
name: string;
|
|
60
|
+
subCategories?: (CareersCategory & {
|
|
61
|
+
id: number;
|
|
62
|
+
})[];
|
|
63
|
+
};
|
|
64
|
+
type CareersEmploymentType = {
|
|
65
|
+
id: number;
|
|
66
|
+
name: string;
|
|
67
|
+
slug: string;
|
|
68
|
+
};
|
|
69
|
+
type CareersEndpoints = Endpoint<"GET", "/careers/categories", CareersCategory[], {
|
|
70
|
+
language?: string;
|
|
71
|
+
}> | Endpoint<"GET", "/careers/employmentTypes", CareersEmploymentType[], {
|
|
72
|
+
language?: string;
|
|
73
|
+
}> | Endpoint<"GET", "/careers/jobs", CareersJob[], {
|
|
74
|
+
page?: number;
|
|
75
|
+
pageSize?: number;
|
|
76
|
+
createdAtGte: string;
|
|
77
|
+
createdAtLt?: string;
|
|
78
|
+
updatedAtGte?: string;
|
|
79
|
+
updatedAtLt?: string;
|
|
80
|
+
status?: "ALL" | "ONLINE" | "ARCHIVED";
|
|
81
|
+
content?: boolean;
|
|
82
|
+
titleLike?: string;
|
|
83
|
+
countryCode?: string;
|
|
84
|
+
externalId?: string;
|
|
85
|
+
}> | Endpoint<"GET", "/careers/jobs/:id", CareersJob, {
|
|
86
|
+
id: number;
|
|
87
|
+
}> | Endpoint<"GET", "/careers/offices", CareersOffice[], {
|
|
88
|
+
page?: number;
|
|
89
|
+
pageSize?: number;
|
|
90
|
+
countryCode?: string;
|
|
91
|
+
cityNameLike?: string;
|
|
92
|
+
}>;
|
|
93
|
+
|
|
94
|
+
type EventTicket = {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
price: number;
|
|
99
|
+
displayPrice: number;
|
|
100
|
+
quantity: number;
|
|
101
|
+
type: EventTicketType;
|
|
102
|
+
category: EventTicketCategory;
|
|
103
|
+
currency: Currency;
|
|
104
|
+
vatRate: number;
|
|
105
|
+
externalId?: string;
|
|
106
|
+
isVisible: boolean;
|
|
107
|
+
isFeesIncluded: boolean;
|
|
108
|
+
startAt: Date;
|
|
109
|
+
endAt: Date;
|
|
110
|
+
updatedAt: Date;
|
|
111
|
+
createdAt: Date;
|
|
112
|
+
};
|
|
113
|
+
type EventTicketType = "e-ticket" | "other";
|
|
114
|
+
declare enum EventTicketCategory {
|
|
115
|
+
ENTRY = "entry",
|
|
116
|
+
PACKAGE = "package",
|
|
117
|
+
MEAL = "meal",
|
|
118
|
+
DRINK = "drink",
|
|
119
|
+
PARKING = "parking",
|
|
120
|
+
ACCOMMODATION = "accommodation",
|
|
121
|
+
CAMPING = "camping",
|
|
122
|
+
LOCKER = "locker",
|
|
123
|
+
SHUTTLE = "shuttle",
|
|
124
|
+
OTHER = "other"
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
type User = {
|
|
128
|
+
id: string;
|
|
129
|
+
identifier: UserIdentifier;
|
|
130
|
+
password: string;
|
|
131
|
+
identity: UserIdentity;
|
|
132
|
+
role: UserRole;
|
|
133
|
+
addresses: Location$1[];
|
|
134
|
+
preferences: UserPreferences;
|
|
135
|
+
connections: UserConnection[];
|
|
136
|
+
verified: boolean;
|
|
137
|
+
updatedAt: Date;
|
|
138
|
+
createdAt: Date;
|
|
139
|
+
};
|
|
140
|
+
type UserIdentifier = {
|
|
141
|
+
email?: string;
|
|
142
|
+
phoneNumber?: string;
|
|
143
|
+
username: string;
|
|
144
|
+
[key: string]: string | undefined;
|
|
145
|
+
};
|
|
146
|
+
type UserIdentity = Profile & {
|
|
147
|
+
firstName: string;
|
|
148
|
+
lastName: string;
|
|
149
|
+
fullName: string;
|
|
150
|
+
gender: UserIdentityGender;
|
|
151
|
+
birthDate: Date;
|
|
152
|
+
metadata: ProfileMetadata & {
|
|
153
|
+
followingCount: number;
|
|
154
|
+
hasPassPlus: boolean;
|
|
155
|
+
idValid: boolean;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
declare enum UserRole {
|
|
159
|
+
USER = 0,
|
|
160
|
+
DEVELOPER = 8,
|
|
161
|
+
ADMINISTRATOR = 10
|
|
162
|
+
}
|
|
163
|
+
type UserIdentityGender = "male" | "female" | "non-binary" | "gender-fluid" | "neutral" | "other" | string;
|
|
164
|
+
type UserPreferences = {
|
|
165
|
+
language: Language;
|
|
166
|
+
currency: Currency;
|
|
167
|
+
notifications: {
|
|
168
|
+
email: {
|
|
169
|
+
newsletter: boolean;
|
|
170
|
+
message: boolean;
|
|
171
|
+
};
|
|
172
|
+
push: {
|
|
173
|
+
message: boolean;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
type UserConnection = {
|
|
178
|
+
ip: string;
|
|
179
|
+
os: UserConnectionOS;
|
|
180
|
+
device: UserConnectionDevice;
|
|
181
|
+
client: UserConnectionClient;
|
|
182
|
+
updatedAt: Date;
|
|
183
|
+
createdAt: Date;
|
|
184
|
+
};
|
|
185
|
+
type UserConnectionOS = {
|
|
186
|
+
name: string;
|
|
187
|
+
version: string;
|
|
188
|
+
};
|
|
189
|
+
type UserConnectionDevice = {
|
|
190
|
+
type: string;
|
|
191
|
+
brand: string;
|
|
192
|
+
};
|
|
193
|
+
type UserConnectionClient = {
|
|
194
|
+
name: string;
|
|
195
|
+
version: string;
|
|
196
|
+
};
|
|
197
|
+
type UserEndpoints = Endpoint<"GET", "/users", User[]> | Endpoint<"GET", "/users/:id", User, {
|
|
198
|
+
id: string;
|
|
199
|
+
}> | Endpoint<"GET", "/users/me", User> | Endpoint<"GET", "/check/:identifier", UserIdentifier, {
|
|
200
|
+
identifier: string;
|
|
201
|
+
}> | Endpoint<"PUT", "/users/:id", User, UpdateUserDto>;
|
|
202
|
+
|
|
203
|
+
type Organization = {
|
|
204
|
+
id: string;
|
|
205
|
+
slug: string;
|
|
206
|
+
identity: OrganizationIdentity;
|
|
207
|
+
members: OrganizationMember[];
|
|
208
|
+
location?: Location$1;
|
|
209
|
+
events: Event[];
|
|
210
|
+
savedTickets: EventTicket[];
|
|
211
|
+
verified: boolean;
|
|
212
|
+
updatedAt: Date;
|
|
213
|
+
createdAt: Date;
|
|
214
|
+
};
|
|
215
|
+
type OrganizationIdentity = Profile & {
|
|
216
|
+
socialLinks: OrganizationSocialLink[];
|
|
217
|
+
metadata: ProfileMetadata & {
|
|
218
|
+
eventsCount: number;
|
|
219
|
+
viewsCount: number;
|
|
220
|
+
membersCount: number;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
type OrganizationSocialLink = {
|
|
224
|
+
type: OrganizationSocialType;
|
|
225
|
+
url: string;
|
|
226
|
+
};
|
|
227
|
+
declare enum OrganizationSocialType {
|
|
228
|
+
Facebook = "facebook",
|
|
229
|
+
Twitter = "twitter",
|
|
230
|
+
Instagram = "instagram",
|
|
231
|
+
Linkedin = "linkedin",
|
|
232
|
+
Youtube = "youtube",
|
|
233
|
+
Website = "website"
|
|
234
|
+
}
|
|
235
|
+
type OrganizationMember = {
|
|
236
|
+
user: User;
|
|
237
|
+
role: OrganizationMemberRole;
|
|
238
|
+
createdAt: Date;
|
|
239
|
+
};
|
|
240
|
+
declare enum OrganizationMemberRole {
|
|
241
|
+
EMPLOYEE = 0,
|
|
242
|
+
MANAGER = 1,
|
|
243
|
+
ADMINISTRATOR = 2,
|
|
244
|
+
OWNER = 3
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
type Event = {
|
|
248
|
+
title: string;
|
|
249
|
+
description: string;
|
|
250
|
+
slug: string;
|
|
251
|
+
organization: Organization;
|
|
252
|
+
type: EventType;
|
|
253
|
+
public: boolean;
|
|
254
|
+
flyers: string[];
|
|
255
|
+
trailers: string[];
|
|
256
|
+
location: Location$1;
|
|
257
|
+
tickets: EventTicket[];
|
|
258
|
+
styles: EventStyle[];
|
|
259
|
+
startAt: Date;
|
|
260
|
+
endAt: Date;
|
|
261
|
+
updatedAt: Date;
|
|
262
|
+
createdAt: Date;
|
|
263
|
+
};
|
|
264
|
+
declare enum EventType {
|
|
265
|
+
Clubbing = "clubbing",
|
|
266
|
+
Concert = "concert",
|
|
267
|
+
Afterwork = "afterwork",
|
|
268
|
+
DancingLunch = "dancing_lunch",
|
|
269
|
+
Diner = "diner",
|
|
270
|
+
Garden = "garden",
|
|
271
|
+
AfterBeach = "after_beach",
|
|
272
|
+
Festival = "festival",
|
|
273
|
+
Spectacle = "spectacle",
|
|
274
|
+
Cruise = "cruise",
|
|
275
|
+
OutsideAnimation = "outside_animation",
|
|
276
|
+
Sport = "sport",
|
|
277
|
+
Match = "match",
|
|
278
|
+
Seminar = "seminar",
|
|
279
|
+
Conference = "conference",
|
|
280
|
+
WellnessDay = "wellness_day",
|
|
281
|
+
Workshop = "workshop",
|
|
282
|
+
TradeFair = "trade_fair",
|
|
283
|
+
ConsumerShow = "consumer_show",
|
|
284
|
+
Membership = "membership"
|
|
285
|
+
}
|
|
286
|
+
type EventStyle = {
|
|
287
|
+
type: EventStyleType;
|
|
288
|
+
emoji: string;
|
|
289
|
+
name: string;
|
|
290
|
+
};
|
|
291
|
+
declare enum EventStyleType {
|
|
292
|
+
Music = "music",
|
|
293
|
+
Dress = "dress",
|
|
294
|
+
Sport = "sport",
|
|
295
|
+
Food = "food",
|
|
296
|
+
Art = "art"
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
type Health<Key extends string> = {
|
|
300
|
+
status: string;
|
|
301
|
+
details: {
|
|
302
|
+
[key in Key]: {
|
|
303
|
+
status: string;
|
|
304
|
+
details: {
|
|
305
|
+
status: string;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
type HealthEndpoints = Endpoint<"GET", "/health/database", Health<"database">> | Endpoint<"GET", "/health/http", Health<"app">>;
|
|
311
|
+
|
|
312
|
+
type UserToken = {
|
|
313
|
+
id: string;
|
|
314
|
+
type: UserTokenType;
|
|
315
|
+
value: string;
|
|
316
|
+
createdAt: Date;
|
|
317
|
+
expiresAt: Date;
|
|
318
|
+
};
|
|
319
|
+
declare enum UserTokenType {
|
|
320
|
+
Authentication = "authentication",
|
|
321
|
+
OrganizationInvite = "organization_invite",
|
|
322
|
+
PasswordRecovery = "password_recovery",
|
|
323
|
+
EmailValidation = "email_validation",
|
|
324
|
+
PhoneValidation = "phone_validation"
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
declare enum OrderStatus {
|
|
328
|
+
Created = "created",
|
|
329
|
+
Cancelled = "cancelled",
|
|
330
|
+
Completed = "completed",
|
|
331
|
+
Pending = "pending",
|
|
332
|
+
Confirmed = "confirmed",
|
|
333
|
+
Declined = "declined",
|
|
334
|
+
Refunded = "refunded",
|
|
335
|
+
PartiallyRefunded = "partially_refunded",
|
|
336
|
+
Expired = "expired"
|
|
337
|
+
}
|
|
338
|
+
type OrderItem = {
|
|
339
|
+
id: string;
|
|
340
|
+
ticket: EventTicket;
|
|
341
|
+
isUsed: boolean;
|
|
342
|
+
updatedAt: Date;
|
|
343
|
+
createdAt: Date;
|
|
344
|
+
};
|
|
345
|
+
type Order = {
|
|
346
|
+
id: string;
|
|
347
|
+
owner: User;
|
|
348
|
+
members: User[];
|
|
349
|
+
status: OrderStatus;
|
|
350
|
+
event: Event;
|
|
351
|
+
items: OrderItem[];
|
|
352
|
+
promoCode?: PromoCode;
|
|
353
|
+
total: number;
|
|
354
|
+
currency: Currency;
|
|
355
|
+
createdAt: Date;
|
|
356
|
+
};
|
|
357
|
+
type PromoCode = {
|
|
358
|
+
id: string;
|
|
359
|
+
code: string;
|
|
360
|
+
used: number;
|
|
361
|
+
discount: number;
|
|
362
|
+
isActive: boolean;
|
|
363
|
+
expirationAt: Date;
|
|
364
|
+
createdAt: Date;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
interface Profile {
|
|
368
|
+
type: "user" | "organization";
|
|
369
|
+
displayName: string;
|
|
370
|
+
description: string;
|
|
371
|
+
profilePictureUrl?: string;
|
|
372
|
+
bannerUrl?: string;
|
|
373
|
+
metadata: ProfileMetadata;
|
|
374
|
+
createdAt: Date;
|
|
375
|
+
}
|
|
376
|
+
interface ProfileMetadata {
|
|
377
|
+
followersCount: number;
|
|
378
|
+
isBlocked: boolean;
|
|
379
|
+
hasBlocked: boolean;
|
|
380
|
+
canDM: boolean;
|
|
381
|
+
}
|
|
382
|
+
type ProfileEndpoints = Endpoint<"GET", "/profiles/:username", UserIdentity>;
|
|
383
|
+
|
|
384
|
+
type Location$1 = {
|
|
385
|
+
name?: string;
|
|
386
|
+
address: string;
|
|
387
|
+
zipCode: string;
|
|
388
|
+
city: string;
|
|
389
|
+
country: string;
|
|
390
|
+
geometry?: {
|
|
391
|
+
latitude: number;
|
|
392
|
+
longitude: number;
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
declare enum Currency {
|
|
396
|
+
EUR = "EUR",
|
|
397
|
+
USD = "USD",
|
|
398
|
+
GBP = "GBP"
|
|
399
|
+
}
|
|
400
|
+
declare enum Language {
|
|
401
|
+
FR = "fr",
|
|
402
|
+
EN = "en"
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
declare class CreateUserDto {
|
|
406
|
+
identifier: UserIdentifier;
|
|
407
|
+
password: string;
|
|
408
|
+
identity: CreateUserIdentituDto;
|
|
409
|
+
addresses: Location[];
|
|
410
|
+
}
|
|
411
|
+
declare class CreateUserIdentituDto {
|
|
412
|
+
firstName: string;
|
|
413
|
+
lastName: string;
|
|
414
|
+
gender: UserIdentityGender;
|
|
415
|
+
profilePictureUrl?: string;
|
|
416
|
+
birthDate: Date;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
declare class SignInUserDto {
|
|
420
|
+
identifier: string;
|
|
421
|
+
password: string;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
declare class UpdateUserDto {
|
|
425
|
+
identifier?: UpdateIdentifierDto;
|
|
426
|
+
identity?: UpdateIdentityDto;
|
|
427
|
+
password?: string;
|
|
428
|
+
}
|
|
429
|
+
declare class UpdateIdentifierDto implements Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">> {
|
|
430
|
+
email?: string;
|
|
431
|
+
phoneNumber?: string;
|
|
432
|
+
username?: string;
|
|
433
|
+
}
|
|
434
|
+
declare class UpdateIdentityDto implements Partial<Pick<UserIdentity, "firstName" | "lastName" | "displayName" | "description" | "profilePictureUrl" | "bannerUrl" | "gender" | "birthDate">> {
|
|
435
|
+
firstName?: string;
|
|
436
|
+
lastName?: string;
|
|
437
|
+
displayName?: string;
|
|
438
|
+
description?: string;
|
|
439
|
+
profilePictureUrl?: string | undefined;
|
|
440
|
+
bannerUrl?: string | undefined;
|
|
441
|
+
gender?: string;
|
|
442
|
+
birthDate?: Date;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
interface APIRequestOptions extends Options {
|
|
446
|
+
}
|
|
447
|
+
declare const request: <T>(url: string, options?: Options) => Promise<redaxios.Response<APIResponse<T>>>;
|
|
448
|
+
|
|
449
|
+
type ExtractRouteParams<T extends string> = string extends T ? Record<string, string | number | undefined> : T extends `${string}:${infer Param}/${infer Rest}` ? {
|
|
450
|
+
[k in Param | keyof ExtractRouteParams<Rest>]: string | number;
|
|
451
|
+
} : T extends `${string}:${infer Param}` ? {
|
|
452
|
+
[k in Param]: string | number;
|
|
453
|
+
} : object;
|
|
454
|
+
type ExtractEndpoint<Method extends string, Path extends string> = Extract<Endpoints, {
|
|
455
|
+
path: Path;
|
|
456
|
+
method: Method;
|
|
457
|
+
}>;
|
|
458
|
+
type PathsFor<M extends Options["method"]> = Extract<Endpoints, {
|
|
459
|
+
method: M;
|
|
460
|
+
}>["path"];
|
|
461
|
+
type Query<Path extends string> = ExtractRouteParams<Path> & Record<string, string | number | undefined>;
|
|
462
|
+
declare class TonightPassAPIError<T> extends Error {
|
|
463
|
+
readonly response: Response<APIResponse<T>>;
|
|
464
|
+
readonly data: ErroredAPIResponse;
|
|
465
|
+
readonly status: number;
|
|
466
|
+
constructor(response: Response<APIResponse<T>>, data: ErroredAPIResponse);
|
|
467
|
+
}
|
|
468
|
+
interface ClientOptions {
|
|
469
|
+
readonly baseURL: string;
|
|
470
|
+
}
|
|
471
|
+
declare class Client {
|
|
472
|
+
private options;
|
|
473
|
+
readonly url: (path: string, params: Record<string, ParamValue>) => string;
|
|
474
|
+
constructor(options: ClientOptions);
|
|
475
|
+
setOptions(options: ClientOptions): void;
|
|
476
|
+
get<Path extends PathsFor<"GET">>(path: Path, query?: Query<Path>, options?: APIRequestOptions): Promise<(Extract<Endpoint<"GET", "/careers/categories", CareersCategory[], {
|
|
477
|
+
language?: string | undefined;
|
|
478
|
+
}>, {
|
|
479
|
+
path: Path;
|
|
480
|
+
method: "GET";
|
|
481
|
+
}> | Extract<Endpoint<"GET", "/careers/employmentTypes", CareersEmploymentType[], {
|
|
482
|
+
language?: string | undefined;
|
|
483
|
+
}>, {
|
|
484
|
+
path: Path;
|
|
485
|
+
method: "GET";
|
|
486
|
+
}> | Extract<Endpoint<"GET", "/careers/jobs", CareersJob[], {
|
|
487
|
+
page?: number | undefined;
|
|
488
|
+
pageSize?: number | undefined;
|
|
489
|
+
createdAtGte: string;
|
|
490
|
+
createdAtLt?: string | undefined;
|
|
491
|
+
updatedAtGte?: string | undefined;
|
|
492
|
+
updatedAtLt?: string | undefined;
|
|
493
|
+
status?: "ALL" | "ONLINE" | "ARCHIVED" | undefined;
|
|
494
|
+
content?: boolean | undefined;
|
|
495
|
+
titleLike?: string | undefined;
|
|
496
|
+
countryCode?: string | undefined;
|
|
497
|
+
externalId?: string | undefined;
|
|
498
|
+
}>, {
|
|
499
|
+
path: Path;
|
|
500
|
+
method: "GET";
|
|
501
|
+
}> | Extract<Endpoint<"GET", "/careers/jobs/:id", CareersJob, {
|
|
502
|
+
id: number;
|
|
503
|
+
}>, {
|
|
504
|
+
path: Path;
|
|
505
|
+
method: "GET";
|
|
506
|
+
}> | Extract<Endpoint<"GET", "/careers/offices", CareersOffice[], {
|
|
507
|
+
page?: number | undefined;
|
|
508
|
+
pageSize?: number | undefined;
|
|
509
|
+
countryCode?: string | undefined;
|
|
510
|
+
cityNameLike?: string | undefined;
|
|
511
|
+
}>, {
|
|
512
|
+
path: Path;
|
|
513
|
+
method: "GET";
|
|
514
|
+
}> | Extract<Endpoint<"GET", "/health/database", Health<"database">>, {
|
|
515
|
+
path: Path;
|
|
516
|
+
method: "GET";
|
|
517
|
+
}> | Extract<Endpoint<"GET", "/health/http", Health<"app">>, {
|
|
518
|
+
path: Path;
|
|
519
|
+
method: "GET";
|
|
520
|
+
}> | Extract<ProfileEndpoints, {
|
|
521
|
+
path: Path;
|
|
522
|
+
method: "GET";
|
|
523
|
+
}> | Extract<Endpoint<"GET", "/users", User[]>, {
|
|
524
|
+
path: Path;
|
|
525
|
+
method: "GET";
|
|
526
|
+
}> | Extract<Endpoint<"GET", "/users/:id", User, {
|
|
527
|
+
id: string;
|
|
528
|
+
}>, {
|
|
529
|
+
path: Path;
|
|
530
|
+
method: "GET";
|
|
531
|
+
}> | Extract<Endpoint<"GET", "/users/me", User>, {
|
|
532
|
+
path: Path;
|
|
533
|
+
method: "GET";
|
|
534
|
+
}> | Extract<Endpoint<"GET", "/check/:identifier", UserIdentifier, {
|
|
535
|
+
identifier: string;
|
|
536
|
+
}>, {
|
|
537
|
+
path: Path;
|
|
538
|
+
method: "GET";
|
|
539
|
+
}>)["res"]>;
|
|
540
|
+
post<Path extends Extract<Endpoints, {
|
|
541
|
+
method: "POST";
|
|
542
|
+
}>["path"]>(path: Path, body: Extract<Endpoints, {
|
|
543
|
+
path: Path;
|
|
544
|
+
method: "POST";
|
|
545
|
+
}>["body"], query?: Query<Path>, options?: APIRequestOptions): Promise<never>;
|
|
546
|
+
put<Path extends Extract<Endpoints, {
|
|
547
|
+
method: "PUT";
|
|
548
|
+
}>["path"]>(path: Path, body: Extract<Endpoints, {
|
|
549
|
+
path: Path;
|
|
550
|
+
method: "PUT";
|
|
551
|
+
}>["body"], query?: Query<Path>, options?: APIRequestOptions): Promise<Extract<Endpoint<"PUT", "/users/:id", User, UpdateUserDto>, {
|
|
552
|
+
path: Path;
|
|
553
|
+
method: "PUT";
|
|
554
|
+
}>["res"]>;
|
|
555
|
+
patch<Path extends Extract<Endpoints, {
|
|
556
|
+
method: "PATCH";
|
|
557
|
+
}>["path"]>(path: Path, body: Extract<Endpoints, {
|
|
558
|
+
path: Path;
|
|
559
|
+
method: "PATCH";
|
|
560
|
+
}>["body"], query?: Query<Path>, options?: APIRequestOptions): Promise<never>;
|
|
561
|
+
delete<Path extends Extract<Endpoints, {
|
|
562
|
+
method: "DELETE";
|
|
563
|
+
}>["path"]>(path: Path, query?: Query<Path>, options?: APIRequestOptions): Promise<never>;
|
|
564
|
+
private requester;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
declare function sdk<T>(builder: (client: Client) => T): (client: Client) => T;
|
|
568
|
+
|
|
569
|
+
declare const health: (client: Client) => {
|
|
570
|
+
database: () => Promise<Health<"database">>;
|
|
571
|
+
http: () => Promise<Health<"app">>;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
declare const users: (client: Client) => {
|
|
575
|
+
getAll: () => Promise<User[]>;
|
|
576
|
+
get: (id: string) => Promise<CareersCategory[] | CareersEmploymentType[] | CareersJob[] | CareersJob | CareersOffice[] | Health<"database"> | Health<"app"> | UserIdentity | User[] | User | UserIdentifier>;
|
|
577
|
+
me: () => Promise<User>;
|
|
578
|
+
check: (identifier: string) => Promise<CareersCategory[] | CareersEmploymentType[] | CareersJob[] | CareersJob | CareersOffice[] | Health<"database"> | Health<"app"> | UserIdentity | User[] | User | UserIdentifier>;
|
|
579
|
+
update: (id: string, data: UpdateUserDto) => Promise<User>;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
declare class TonightPass {
|
|
583
|
+
readonly client: Client;
|
|
584
|
+
readonly careers: {
|
|
585
|
+
categories: {
|
|
586
|
+
getAll: (query?: Query<"/careers/categories"> | undefined) => Promise<CareersCategory[]>;
|
|
587
|
+
};
|
|
588
|
+
employmentTypes: {
|
|
589
|
+
getAll: (query?: Query<"/careers/employmentTypes"> | undefined) => Promise<CareersEmploymentType[]>;
|
|
590
|
+
};
|
|
591
|
+
jobs: {
|
|
592
|
+
getAll: (query?: Query<"/careers/jobs"> | undefined) => Promise<CareersJob[]>;
|
|
593
|
+
get: (id: number) => Promise<CareersJob>;
|
|
594
|
+
};
|
|
595
|
+
offices: {
|
|
596
|
+
getAll: (query?: Query<"/careers/offices"> | undefined) => Promise<CareersOffice[]>;
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
readonly health: {
|
|
600
|
+
database: () => Promise<Health<"database">>;
|
|
601
|
+
http: () => Promise<Health<"app">>;
|
|
602
|
+
};
|
|
603
|
+
readonly users: {
|
|
604
|
+
getAll: () => Promise<User[]>;
|
|
605
|
+
get: (id: string) => Promise<CareersCategory[] | CareersEmploymentType[] | CareersJob[] | CareersJob | CareersOffice[] | Health<"database"> | Health<"app"> | UserIdentity | User[] | User | UserIdentifier>;
|
|
606
|
+
me: () => Promise<User>;
|
|
607
|
+
check: (identifier: string) => Promise<CareersCategory[] | CareersEmploymentType[] | CareersJob[] | CareersJob | CareersOffice[] | Health<"database"> | Health<"app"> | UserIdentity | User[] | User | UserIdentifier>;
|
|
608
|
+
update: (id: string, data: UpdateUserDto) => Promise<User>;
|
|
609
|
+
};
|
|
610
|
+
constructor(options: ClientOptions);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
declare const isBrowser: boolean;
|
|
614
|
+
|
|
615
|
+
export { type APIRequestOptions, type APIResponse, BCRYPT_HASH, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, type Event, type EventStyle, EventStyleType, type EventTicket, EventTicketCategory, type EventTicketType, EventType, type ExtractEndpoint, type ExtractRouteParams, type Health, type HealthEndpoints, IMAGE_URL_REGEX, Language, type Location$1 as Location, NAME_REGEX, type Order, type OrderItem, OrderStatus, type Organization, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, type OrganizationSocialLink, OrganizationSocialType, PASSWORD_REGEX, PHONE_NUMBER_REGEX, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, type PromoCode, type Query, SLUG_REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, type UserIdentityGender, type UserPreferences, UserRole, type UserToken, UserTokenType, health, isBrowser, request, sdk, users };
|