tonightpass 0.0.0

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.
@@ -0,0 +1,17 @@
1
+
2
+ > tonightpass@0.0.0 build /Users/antoine/workspace/dev/javascript/tonightpass/tonightpass/packages/node
3
+ > tsup
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.0.2
8
+ CLI Using tsup config: /Users/antoine/workspace/dev/javascript/tonightpass/tonightpass/packages/node/tsup.config.ts
9
+ CLI Target: esnext
10
+ CLI Cleaning output folder
11
+ CJS Build start
12
+ CJS dist/index.js 1012.00 B
13
+ CJS dist/index.js.map 210.00 B
14
+ CJS ⚡️ Build success in 19ms
15
+ DTS Build start
16
+ DTS ⚡️ Build success in 6642ms
17
+ DTS dist/index.d.ts 55.00 B
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Tonight Pass <developers@tonightpass.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,409 @@
1
+ import { Options } from 'redaxios';
2
+ import * as src from 'src';
3
+ import { ParamValue } from 'pathcat';
4
+ import * as _tonightpass_shared_types from '@tonightpass/shared-types';
5
+
6
+ declare const EMAIL_REGEX: RegExp;
7
+ declare const PASSWORD_REGEX: RegExp;
8
+ declare const NAME_REGEX: RegExp;
9
+ declare const SLUG_REGEX: RegExp;
10
+ declare const BCRYPT_HASH: RegExp;
11
+ declare const PHONE_NUMBER_REGEX: RegExp;
12
+ declare const IMAGE_URL_REGEX: RegExp;
13
+
14
+ type EventTicket = {
15
+ id: string;
16
+ name: string;
17
+ description?: string;
18
+ price: number;
19
+ displayPrice: number;
20
+ quantity: number;
21
+ type: EventTicketType;
22
+ category: EventTicketCategory;
23
+ currency: Currency;
24
+ vatRate: number;
25
+ externalId?: string;
26
+ isVisible: boolean;
27
+ isFeesIncluded: boolean;
28
+ startAt: Date;
29
+ endAt: Date;
30
+ updatedAt: Date;
31
+ createdAt: Date;
32
+ };
33
+ type EventTicketType = "e-ticket" | "other";
34
+ declare enum EventTicketCategory {
35
+ ENTRY = "entry",
36
+ PACKAGE = "package",
37
+ MEAL = "meal",
38
+ DRINK = "drink",
39
+ PARKING = "parking",
40
+ ACCOMMODATION = "accommodation",
41
+ CAMPING = "camping",
42
+ LOCKER = "locker",
43
+ SHUTTLE = "shuttle",
44
+ OTHER = "other"
45
+ }
46
+
47
+ type User = {
48
+ id: string;
49
+ identifier: UserIdentifier;
50
+ password: string;
51
+ identity: UserIdentity;
52
+ role: UserRole;
53
+ addresses: Location$1[];
54
+ preferences: UserPreferences;
55
+ connections: UserConnection[];
56
+ verified: boolean;
57
+ updatedAt: Date;
58
+ createdAt: Date;
59
+ };
60
+ type UserIdentifier = {
61
+ email?: string;
62
+ phoneNumber?: string;
63
+ username: string;
64
+ [key: string]: string | undefined;
65
+ };
66
+ type UserIdentity = Profile & {
67
+ firstName: string;
68
+ lastName: string;
69
+ fullName: string;
70
+ gender: UserIdentityGender;
71
+ birthDate: Date;
72
+ metadata: ProfileMetadata & {
73
+ followingCount: number;
74
+ hasPassPlus: boolean;
75
+ idValid: boolean;
76
+ };
77
+ };
78
+ declare enum UserRole {
79
+ USER = 0,
80
+ DEVELOPER = 8,
81
+ ADMINISTRATOR = 10
82
+ }
83
+ type UserIdentityGender = "male" | "female" | "non-binary" | "gender-fluid" | "neutral" | "other" | string;
84
+ type UserPreferences = {
85
+ language: Language;
86
+ currency: Currency;
87
+ notifications: {
88
+ email: {
89
+ newsletter: boolean;
90
+ message: boolean;
91
+ };
92
+ push: {
93
+ message: boolean;
94
+ };
95
+ };
96
+ };
97
+ type UserConnection = {
98
+ ip: string;
99
+ os: UserConnectionOS;
100
+ device: UserConnectionDevice;
101
+ client: UserConnectionClient;
102
+ updatedAt: Date;
103
+ createdAt: Date;
104
+ };
105
+ type UserConnectionOS = {
106
+ name: string;
107
+ version: string;
108
+ };
109
+ type UserConnectionDevice = {
110
+ type: string;
111
+ brand: string;
112
+ };
113
+ type UserConnectionClient = {
114
+ name: string;
115
+ version: string;
116
+ };
117
+
118
+ type Organization = {
119
+ id: string;
120
+ slug: string;
121
+ identity: OrganizationIdentity;
122
+ members: OrganizationMember[];
123
+ location?: Location$1;
124
+ events: Event[];
125
+ savedTickets: EventTicket[];
126
+ verified: boolean;
127
+ updatedAt: Date;
128
+ createdAt: Date;
129
+ };
130
+ type OrganizationIdentity = Profile & {
131
+ socialLinks: OrganizationSocialLink[];
132
+ metadata: ProfileMetadata & {
133
+ eventsCount: number;
134
+ viewsCount: number;
135
+ membersCount: number;
136
+ };
137
+ };
138
+ type OrganizationSocialLink = {
139
+ type: OrganizationSocialType;
140
+ url: string;
141
+ };
142
+ declare enum OrganizationSocialType {
143
+ Facebook = "facebook",
144
+ Twitter = "twitter",
145
+ Instagram = "instagram",
146
+ Linkedin = "linkedin",
147
+ Youtube = "youtube",
148
+ Website = "website"
149
+ }
150
+ type OrganizationMember = {
151
+ user: User;
152
+ role: OrganizationMemberRole;
153
+ createdAt: Date;
154
+ };
155
+ declare enum OrganizationMemberRole {
156
+ EMPLOYEE = 0,
157
+ MANAGER = 1,
158
+ ADMINISTRATOR = 2,
159
+ OWNER = 3
160
+ }
161
+
162
+ type Event = {
163
+ title: string;
164
+ description: string;
165
+ slug: string;
166
+ organization: Organization;
167
+ type: EventType;
168
+ public: boolean;
169
+ flyers: string[];
170
+ trailers: string[];
171
+ location: Location$1;
172
+ tickets: EventTicket[];
173
+ styles: EventStyle[];
174
+ startAt: Date;
175
+ endAt: Date;
176
+ updatedAt: Date;
177
+ createdAt: Date;
178
+ };
179
+ declare enum EventType {
180
+ Clubbing = "clubbing",
181
+ Concert = "concert",
182
+ Afterwork = "afterwork",
183
+ DancingLunch = "dancing_lunch",
184
+ Diner = "diner",
185
+ Garden = "garden",
186
+ AfterBeach = "after_beach",
187
+ Festival = "festival",
188
+ Spectacle = "spectacle",
189
+ Cruise = "cruise",
190
+ OutsideAnimation = "outside_animation",
191
+ Sport = "sport",
192
+ Match = "match",
193
+ Seminar = "seminar",
194
+ Conference = "conference",
195
+ WellnessDay = "wellness_day",
196
+ Workshop = "workshop",
197
+ TradeFair = "trade_fair",
198
+ ConsumerShow = "consumer_show",
199
+ Membership = "membership"
200
+ }
201
+ type EventStyle = {
202
+ type: EventStyleType;
203
+ emoji: string;
204
+ name: string;
205
+ };
206
+ declare enum EventStyleType {
207
+ Music = "music",
208
+ Dress = "dress",
209
+ Sport = "sport",
210
+ Food = "food",
211
+ Art = "art"
212
+ }
213
+
214
+ type UserToken = {
215
+ id: string;
216
+ type: UserTokenType;
217
+ value: string;
218
+ createdAt: Date;
219
+ expiresAt: Date;
220
+ };
221
+ declare enum UserTokenType {
222
+ Authentication = "authentication",
223
+ OrganizationInvite = "organization_invite",
224
+ PasswordRecovery = "password_recovery",
225
+ EmailValidation = "email_validation",
226
+ PhoneValidation = "phone_validation"
227
+ }
228
+
229
+ declare enum OrderStatus {
230
+ Created = "created",
231
+ Cancelled = "cancelled",
232
+ Completed = "completed",
233
+ Pending = "pending",
234
+ Confirmed = "confirmed",
235
+ Declined = "declined",
236
+ Refunded = "refunded",
237
+ PartiallyRefunded = "partially_refunded",
238
+ Expired = "expired"
239
+ }
240
+ type OrderItem = {
241
+ id: string;
242
+ ticket: EventTicket;
243
+ isUsed: boolean;
244
+ updatedAt: Date;
245
+ createdAt: Date;
246
+ };
247
+ type Order = {
248
+ id: string;
249
+ owner: User;
250
+ members: User[];
251
+ status: OrderStatus;
252
+ event: Event;
253
+ items: OrderItem[];
254
+ promoCode?: PromoCode;
255
+ total: number;
256
+ currency: Currency;
257
+ createdAt: Date;
258
+ };
259
+ type PromoCode = {
260
+ id: string;
261
+ code: string;
262
+ used: number;
263
+ discount: number;
264
+ isActive: boolean;
265
+ expirationAt: Date;
266
+ createdAt: Date;
267
+ };
268
+
269
+ interface Profile {
270
+ type: "user" | "organization";
271
+ displayName: string;
272
+ description: string;
273
+ profilePictureUrl?: string;
274
+ bannerUrl?: string;
275
+ metadata: ProfileMetadata;
276
+ createdAt: Date;
277
+ }
278
+ interface ProfileMetadata {
279
+ followersCount: number;
280
+ isBlocked: boolean;
281
+ hasBlocked: boolean;
282
+ canDM: boolean;
283
+ }
284
+
285
+ type APIResponse<TData = any> = ({
286
+ success: true;
287
+ data: TData;
288
+ } | APIError) & {
289
+ statusCode: number;
290
+ };
291
+ type APIError = {
292
+ success: false;
293
+ message: string;
294
+ errors?: {
295
+ [key: string]: string;
296
+ };
297
+ };
298
+
299
+ type Location$1 = {
300
+ name?: string;
301
+ address: string;
302
+ zipCode: string;
303
+ city: string;
304
+ country: string;
305
+ geometry?: {
306
+ latitude: number;
307
+ longitude: number;
308
+ };
309
+ };
310
+ declare enum Currency {
311
+ EUR = "EUR",
312
+ USD = "USD",
313
+ GBP = "GBP"
314
+ }
315
+ declare enum Language {
316
+ FR = "fr",
317
+ EN = "en"
318
+ }
319
+
320
+ declare class CreateUserDto {
321
+ identifier: UserIdentifier;
322
+ password: string;
323
+ identity: CreateUserIdentituDto;
324
+ addresses: Location[];
325
+ }
326
+ declare class CreateUserIdentituDto {
327
+ firstName: string;
328
+ lastName: string;
329
+ gender: UserIdentityGender;
330
+ profilePictureUrl?: string;
331
+ birthDate: Date;
332
+ }
333
+
334
+ declare class SignInUserDto {
335
+ identifier: string;
336
+ password: string;
337
+ }
338
+
339
+ declare class UpdateUserDto {
340
+ identifier?: UpdateIdentifierDto;
341
+ identity?: UpdateIdentityDto;
342
+ password?: string;
343
+ }
344
+ declare class UpdateIdentifierDto implements Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">> {
345
+ email?: string;
346
+ phoneNumber?: string;
347
+ username?: string;
348
+ }
349
+ declare class UpdateIdentityDto implements Partial<Pick<UserIdentity, "firstName" | "lastName" | "displayName" | "description" | "profilePictureUrl" | "bannerUrl" | "gender" | "birthDate">> {
350
+ firstName?: string;
351
+ lastName?: string;
352
+ displayName?: string;
353
+ description?: string;
354
+ profilePictureUrl?: string | undefined;
355
+ bannerUrl?: string | undefined;
356
+ gender?: string;
357
+ birthDate?: Date;
358
+ }
359
+
360
+ type ApiRequestConfig = Exclude<Options, "method">;
361
+ declare const request: <TData>(url: string, options?: ApiRequestConfig) => Promise<APIResponse<TData>>;
362
+
363
+ type BaseRequest = <TData>(url: string, options?: ApiRequestConfig) => Promise<APIResponse<TData>>;
364
+ type RequestResponse = {
365
+ get: BaseRequest;
366
+ post: BaseRequest;
367
+ put: BaseRequest;
368
+ delete: BaseRequest;
369
+ };
370
+ declare const requester: (auth?: boolean) => RequestResponse;
371
+
372
+ interface ClientOptions {
373
+ readonly baseUrl: string;
374
+ }
375
+ declare class Client {
376
+ private readonly options;
377
+ readonly url: (path: string, params: Record<string, ParamValue>) => string;
378
+ private request;
379
+ constructor(options: ClientOptions);
380
+ get<T>(url: string, options?: ApiRequestConfig): Promise<src.APIResponse<T>>;
381
+ post<T>(url: string, options?: ApiRequestConfig): Promise<src.APIResponse<T>>;
382
+ put<T>(url: string, options?: ApiRequestConfig): Promise<src.APIResponse<T>>;
383
+ delete<T>(url: string, options?: ApiRequestConfig): Promise<src.APIResponse<T>>;
384
+ }
385
+
386
+ declare function sdk<T>(builder: (client: Client) => T): (client: Client) => T;
387
+
388
+ declare const health: (client: src.Client) => {
389
+ http: () => Promise<_tonightpass_shared_types.APIResponse<{
390
+ status: string;
391
+ details: {
392
+ app: {
393
+ status: string;
394
+ details: {
395
+ status: string;
396
+ };
397
+ };
398
+ };
399
+ }>>;
400
+ };
401
+
402
+ declare const users: (client: Client) => {
403
+ me: {
404
+ get: () => Promise<_tonightpass_shared_types.APIResponse<User>>;
405
+ update: (data: UpdateUserDto) => Promise<_tonightpass_shared_types.APIResponse<User>>;
406
+ };
407
+ };
408
+
409
+ export { type APIError, type APIResponse, type ApiRequestConfig, BCRYPT_HASH, Client, type ClientOptions, CreateUserDto, Currency, EMAIL_REGEX, type Event, type EventStyle, EventStyleType, type EventTicket, EventTicketCategory, type EventTicketType, EventType, 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 Profile, type ProfileMetadata, type PromoCode, SLUG_REGEX, SignInUserDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserIdentifier, type UserIdentity, type UserIdentityGender, type UserPreferences, UserRole, type UserToken, UserTokenType, health, request, requester, sdk, users };
package/dist/index.js ADDED
@@ -0,0 +1,472 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __decorateClass = (decorators, target, key, kind) => {
20
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
21
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
22
+ if (decorator = decorators[i])
23
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
24
+ if (kind && result)
25
+ __defProp(target, key, result);
26
+ return result;
27
+ };
28
+
29
+ // src/index.ts
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ BCRYPT_HASH: () => BCRYPT_HASH,
33
+ Client: () => Client,
34
+ CreateUserDto: () => CreateUserDto,
35
+ Currency: () => Currency,
36
+ EMAIL_REGEX: () => EMAIL_REGEX,
37
+ EventStyleType: () => EventStyleType,
38
+ EventTicketCategory: () => EventTicketCategory,
39
+ EventType: () => EventType,
40
+ IMAGE_URL_REGEX: () => IMAGE_URL_REGEX,
41
+ Language: () => Language,
42
+ NAME_REGEX: () => NAME_REGEX,
43
+ OrderStatus: () => OrderStatus,
44
+ OrganizationMemberRole: () => OrganizationMemberRole,
45
+ OrganizationSocialType: () => OrganizationSocialType,
46
+ PASSWORD_REGEX: () => PASSWORD_REGEX,
47
+ PHONE_NUMBER_REGEX: () => PHONE_NUMBER_REGEX,
48
+ SLUG_REGEX: () => SLUG_REGEX,
49
+ SignInUserDto: () => SignInUserDto,
50
+ UpdateUserDto: () => UpdateUserDto,
51
+ UserRole: () => UserRole,
52
+ UserTokenType: () => UserTokenType,
53
+ health: () => health,
54
+ request: () => request,
55
+ requester: () => requester,
56
+ sdk: () => sdk,
57
+ users: () => users
58
+ });
59
+ module.exports = __toCommonJS(src_exports);
60
+
61
+ // src/constants/regex.ts
62
+ var EMAIL_REGEX = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/;
63
+ var PASSWORD_REGEX = /((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/;
64
+ var NAME_REGEX = /(^[\p{L}\d'\\.\s\\-]*$)/u;
65
+ var SLUG_REGEX = /^[a-z\d]+(?:(\.|-|_)[a-z\d]+)*$/;
66
+ var BCRYPT_HASH = /\$2[abxy]?\$\d{1,2}\$[A-Za-z\d\\./]{53}/;
67
+ var PHONE_NUMBER_REGEX = /^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/;
68
+ var IMAGE_URL_REGEX = /(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;
69
+
70
+ // src/rest/dtos/index.ts
71
+ var import_reflect_metadata = require("reflect-metadata");
72
+
73
+ // src/rest/dtos/users/create-user.dto.ts
74
+ var CreateUserDto = class {
75
+ identifier;
76
+ password;
77
+ identity;
78
+ addresses;
79
+ };
80
+
81
+ // src/rest/dtos/users/sign-in-user.dto.ts
82
+ var SignInUserDto = class {
83
+ identifier;
84
+ password;
85
+ };
86
+
87
+ // src/rest/dtos/users/update-user.dto.ts
88
+ var import_class_transformer = require("class-transformer");
89
+ var import_class_validator = require("class-validator");
90
+ var UpdateUserDto = class {
91
+ identifier;
92
+ identity;
93
+ password;
94
+ };
95
+ __decorateClass([
96
+ (0, import_class_validator.IsOptional)(),
97
+ (0, import_class_validator.IsObject)(),
98
+ (0, import_class_validator.ValidateNested)(),
99
+ (0, import_class_transformer.Type)(() => UpdateIdentifierDto)
100
+ ], UpdateUserDto.prototype, "identifier", 2);
101
+ __decorateClass([
102
+ (0, import_class_validator.IsOptional)(),
103
+ (0, import_class_validator.IsObject)(),
104
+ (0, import_class_validator.ValidateNested)(),
105
+ (0, import_class_transformer.Type)(() => UpdateIdentityDto)
106
+ ], UpdateUserDto.prototype, "identity", 2);
107
+ __decorateClass([
108
+ (0, import_class_validator.IsOptional)(),
109
+ (0, import_class_validator.IsString)(),
110
+ (0, import_class_validator.MinLength)(6),
111
+ (0, import_class_validator.MaxLength)(130)
112
+ ], UpdateUserDto.prototype, "password", 2);
113
+ var UpdateIdentifierDto = class {
114
+ email;
115
+ phoneNumber;
116
+ username;
117
+ };
118
+ __decorateClass([
119
+ (0, import_class_validator.IsOptional)(),
120
+ (0, import_class_validator.IsString)(),
121
+ (0, import_class_validator.IsEmail)()
122
+ ], UpdateIdentifierDto.prototype, "email", 2);
123
+ __decorateClass([
124
+ (0, import_class_validator.IsOptional)(),
125
+ (0, import_class_validator.IsString)(),
126
+ (0, import_class_validator.IsPhoneNumber)()
127
+ ], UpdateIdentifierDto.prototype, "phoneNumber", 2);
128
+ __decorateClass([
129
+ (0, import_class_validator.IsOptional)(),
130
+ (0, import_class_validator.IsString)(),
131
+ (0, import_class_validator.MinLength)(3)
132
+ ], UpdateIdentifierDto.prototype, "username", 2);
133
+ var UpdateIdentityDto = class {
134
+ firstName;
135
+ lastName;
136
+ displayName;
137
+ description;
138
+ profilePictureUrl;
139
+ bannerUrl;
140
+ gender;
141
+ birthDate;
142
+ };
143
+ __decorateClass([
144
+ (0, import_class_validator.IsOptional)(),
145
+ (0, import_class_validator.IsString)(),
146
+ (0, import_class_validator.Length)(2, 50),
147
+ (0, import_class_validator.Matches)(NAME_REGEX, {
148
+ message: "First name must be composed of letters only"
149
+ })
150
+ ], UpdateIdentityDto.prototype, "firstName", 2);
151
+ __decorateClass([
152
+ (0, import_class_validator.IsOptional)(),
153
+ (0, import_class_validator.IsString)(),
154
+ (0, import_class_validator.Length)(2, 50),
155
+ (0, import_class_validator.Matches)(NAME_REGEX, {
156
+ message: "Last name must be composed of letters only"
157
+ })
158
+ ], UpdateIdentityDto.prototype, "lastName", 2);
159
+ __decorateClass([
160
+ (0, import_class_validator.IsOptional)(),
161
+ (0, import_class_validator.IsString)(),
162
+ (0, import_class_validator.Length)(1, 32)
163
+ ], UpdateIdentityDto.prototype, "displayName", 2);
164
+ __decorateClass([
165
+ (0, import_class_validator.IsOptional)(),
166
+ (0, import_class_validator.IsString)(),
167
+ (0, import_class_validator.Length)(15, 500)
168
+ ], UpdateIdentityDto.prototype, "description", 2);
169
+ __decorateClass([
170
+ (0, import_class_validator.IsOptional)(),
171
+ (0, import_class_validator.IsUrl)()
172
+ ], UpdateIdentityDto.prototype, "profilePictureUrl", 2);
173
+ __decorateClass([
174
+ (0, import_class_validator.IsOptional)(),
175
+ (0, import_class_validator.IsUrl)()
176
+ ], UpdateIdentityDto.prototype, "bannerUrl", 2);
177
+ __decorateClass([
178
+ (0, import_class_validator.IsOptional)()
179
+ ], UpdateIdentityDto.prototype, "gender", 2);
180
+ __decorateClass([
181
+ (0, import_class_validator.IsOptional)(),
182
+ (0, import_class_validator.IsDateString)()
183
+ ], UpdateIdentityDto.prototype, "birthDate", 2);
184
+
185
+ // ../../node_modules/redaxios/dist/redaxios.module.js
186
+ var redaxios_module_default = function e(t) {
187
+ function n(e2, t2, r2) {
188
+ var a, o = {};
189
+ if (Array.isArray(e2))
190
+ return e2.concat(t2);
191
+ for (a in e2)
192
+ o[r2 ? a.toLowerCase() : a] = e2[a];
193
+ for (a in t2) {
194
+ var i = r2 ? a.toLowerCase() : a, u = t2[a];
195
+ o[i] = i in o && "object" == typeof u ? n(o[i], u, "headers" == i) : u;
196
+ }
197
+ return o;
198
+ }
199
+ function r(e2, r2, a, o, i) {
200
+ var u = "string" != typeof e2 ? (r2 = e2).url : e2, c = { config: r2 }, s = n(t, r2), f = {};
201
+ o = o || s.data, (s.transformRequest || []).map(function(e3) {
202
+ o = e3(o, s.headers) || o;
203
+ }), s.auth && (f.authorization = s.auth), o && "object" == typeof o && "function" != typeof o.append && "function" != typeof o.text && (o = JSON.stringify(o), f["content-type"] = "application/json");
204
+ try {
205
+ f[s.xsrfHeaderName] = decodeURIComponent(document.cookie.match(RegExp("(^|; )" + s.xsrfCookieName + "=([^;]*)"))[2]);
206
+ } catch (e3) {
207
+ }
208
+ return s.baseURL && (u = u.replace(/^(?!.*\/\/)\/?/, s.baseURL + "/")), s.params && (u += (~u.indexOf("?") ? "&" : "?") + (s.paramsSerializer ? s.paramsSerializer(s.params) : new URLSearchParams(s.params))), (s.fetch || fetch)(u, { method: (a || s.method || "get").toUpperCase(), body: o, headers: n(s.headers, f, true), credentials: s.withCredentials ? "include" : i }).then(function(e3) {
209
+ for (var t2 in e3)
210
+ "function" != typeof e3[t2] && (c[t2] = e3[t2]);
211
+ return "stream" == s.responseType ? (c.data = e3.body, c) : e3[s.responseType || "text"]().then(function(e4) {
212
+ c.data = e4, c.data = JSON.parse(e4);
213
+ }).catch(Object).then(function() {
214
+ return (s.validateStatus ? s.validateStatus(e3.status) : e3.ok) ? c : Promise.reject(c);
215
+ });
216
+ });
217
+ }
218
+ return t = t || {}, r.request = r, r.get = function(e2, t2) {
219
+ return r(e2, t2, "get");
220
+ }, r.delete = function(e2, t2) {
221
+ return r(e2, t2, "delete");
222
+ }, r.head = function(e2, t2) {
223
+ return r(e2, t2, "head");
224
+ }, r.options = function(e2, t2) {
225
+ return r(e2, t2, "options");
226
+ }, r.post = function(e2, t2, n2) {
227
+ return r(e2, n2, "post", t2);
228
+ }, r.put = function(e2, t2, n2) {
229
+ return r(e2, n2, "put", t2);
230
+ }, r.patch = function(e2, t2, n2) {
231
+ return r(e2, n2, "patch", t2);
232
+ }, r.all = Promise.all.bind(Promise), r.spread = function(e2) {
233
+ return e2.apply.bind(e2, e2);
234
+ }, r.CancelToken = "function" == typeof AbortController ? AbortController : Object, r.defaults = t, r.create = e, r;
235
+ }();
236
+
237
+ // src/rest/request/request.ts
238
+ var instance = redaxios_module_default.create({
239
+ baseURL: process.env.NEXT_PUBLIC_API_URL,
240
+ headers: {
241
+ "Content-Type": "application/json",
242
+ Accept: "application/json"
243
+ },
244
+ responseType: "json",
245
+ transformRequest: [
246
+ function(data) {
247
+ return JSON.stringify(data);
248
+ }
249
+ ]
250
+ });
251
+ var request = async (url, options) => {
252
+ const response = instance(url, { ...options }).then((response2) => response2.data).catch((error) => {
253
+ throw error;
254
+ });
255
+ return response;
256
+ };
257
+
258
+ // src/rest/request/requester.ts
259
+ var createAuthHeaders = (jwtToken) => ({
260
+ Authorization: `${process.env.NEXT_PUBLIC_AUTH_PREFIX || "Bearer"} ${jwtToken}`
261
+ });
262
+ var requester = (auth = true) => {
263
+ let baseOptions = {};
264
+ if (auth) {
265
+ createAuthHeaders;
266
+ baseOptions = {
267
+ ...baseOptions,
268
+ withCredentials: true
269
+ };
270
+ }
271
+ const get = async (url, options) => request(url, { ...baseOptions, ...options, method: "GET" });
272
+ const post = async (url, options) => request(url, { ...baseOptions, ...options, method: "POST" });
273
+ const put = async (url, options) => request(url, { ...baseOptions, ...options, method: "PUT" });
274
+ const del = async (url, options) => request(url, { ...baseOptions, ...options, method: "DELETE" });
275
+ return {
276
+ get,
277
+ post,
278
+ put,
279
+ delete: del
280
+ };
281
+ };
282
+
283
+ // src/rest/types/event/ticket/index.ts
284
+ var EventTicketCategory = /* @__PURE__ */ ((EventTicketCategory2) => {
285
+ EventTicketCategory2["ENTRY"] = "entry";
286
+ EventTicketCategory2["PACKAGE"] = "package";
287
+ EventTicketCategory2["MEAL"] = "meal";
288
+ EventTicketCategory2["DRINK"] = "drink";
289
+ EventTicketCategory2["PARKING"] = "parking";
290
+ EventTicketCategory2["ACCOMMODATION"] = "accommodation";
291
+ EventTicketCategory2["CAMPING"] = "camping";
292
+ EventTicketCategory2["LOCKER"] = "locker";
293
+ EventTicketCategory2["SHUTTLE"] = "shuttle";
294
+ EventTicketCategory2["OTHER"] = "other";
295
+ return EventTicketCategory2;
296
+ })(EventTicketCategory || {});
297
+
298
+ // src/rest/types/event/index.ts
299
+ var EventType = /* @__PURE__ */ ((EventType2) => {
300
+ EventType2["Clubbing"] = "clubbing";
301
+ EventType2["Concert"] = "concert";
302
+ EventType2["Afterwork"] = "afterwork";
303
+ EventType2["DancingLunch"] = "dancing_lunch";
304
+ EventType2["Diner"] = "diner";
305
+ EventType2["Garden"] = "garden";
306
+ EventType2["AfterBeach"] = "after_beach";
307
+ EventType2["Festival"] = "festival";
308
+ EventType2["Spectacle"] = "spectacle";
309
+ EventType2["Cruise"] = "cruise";
310
+ EventType2["OutsideAnimation"] = "outside_animation";
311
+ EventType2["Sport"] = "sport";
312
+ EventType2["Match"] = "match";
313
+ EventType2["Seminar"] = "seminar";
314
+ EventType2["Conference"] = "conference";
315
+ EventType2["WellnessDay"] = "wellness_day";
316
+ EventType2["Workshop"] = "workshop";
317
+ EventType2["TradeFair"] = "trade_fair";
318
+ EventType2["ConsumerShow"] = "consumer_show";
319
+ EventType2["Membership"] = "membership";
320
+ return EventType2;
321
+ })(EventType || {});
322
+ var EventStyleType = /* @__PURE__ */ ((EventStyleType2) => {
323
+ EventStyleType2["Music"] = "music";
324
+ EventStyleType2["Dress"] = "dress";
325
+ EventStyleType2["Sport"] = "sport";
326
+ EventStyleType2["Food"] = "food";
327
+ EventStyleType2["Art"] = "art";
328
+ return EventStyleType2;
329
+ })(EventStyleType || {});
330
+
331
+ // src/rest/types/organization/index.ts
332
+ var OrganizationSocialType = /* @__PURE__ */ ((OrganizationSocialType2) => {
333
+ OrganizationSocialType2["Facebook"] = "facebook";
334
+ OrganizationSocialType2["Twitter"] = "twitter";
335
+ OrganizationSocialType2["Instagram"] = "instagram";
336
+ OrganizationSocialType2["Linkedin"] = "linkedin";
337
+ OrganizationSocialType2["Youtube"] = "youtube";
338
+ OrganizationSocialType2["Website"] = "website";
339
+ return OrganizationSocialType2;
340
+ })(OrganizationSocialType || {});
341
+ var OrganizationMemberRole = /* @__PURE__ */ ((OrganizationMemberRole2) => {
342
+ OrganizationMemberRole2[OrganizationMemberRole2["EMPLOYEE"] = 0] = "EMPLOYEE";
343
+ OrganizationMemberRole2[OrganizationMemberRole2["MANAGER"] = 1] = "MANAGER";
344
+ OrganizationMemberRole2[OrganizationMemberRole2["ADMINISTRATOR"] = 2] = "ADMINISTRATOR";
345
+ OrganizationMemberRole2[OrganizationMemberRole2["OWNER"] = 3] = "OWNER";
346
+ return OrganizationMemberRole2;
347
+ })(OrganizationMemberRole || {});
348
+
349
+ // src/rest/types/token/index.ts
350
+ var UserTokenType = /* @__PURE__ */ ((UserTokenType2) => {
351
+ UserTokenType2["Authentication"] = "authentication";
352
+ UserTokenType2["OrganizationInvite"] = "organization_invite";
353
+ UserTokenType2["PasswordRecovery"] = "password_recovery";
354
+ UserTokenType2["EmailValidation"] = "email_validation";
355
+ UserTokenType2["PhoneValidation"] = "phone_validation";
356
+ return UserTokenType2;
357
+ })(UserTokenType || {});
358
+
359
+ // src/rest/types/user/index.ts
360
+ var UserRole = /* @__PURE__ */ ((UserRole2) => {
361
+ UserRole2[UserRole2["USER"] = 0] = "USER";
362
+ UserRole2[UserRole2["DEVELOPER"] = 8] = "DEVELOPER";
363
+ UserRole2[UserRole2["ADMINISTRATOR"] = 10] = "ADMINISTRATOR";
364
+ return UserRole2;
365
+ })(UserRole || {});
366
+
367
+ // src/rest/types/order/index.ts
368
+ var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
369
+ OrderStatus2["Created"] = "created";
370
+ OrderStatus2["Cancelled"] = "cancelled";
371
+ OrderStatus2["Completed"] = "completed";
372
+ OrderStatus2["Pending"] = "pending";
373
+ OrderStatus2["Confirmed"] = "confirmed";
374
+ OrderStatus2["Declined"] = "declined";
375
+ OrderStatus2["Refunded"] = "refunded";
376
+ OrderStatus2["PartiallyRefunded"] = "partially_refunded";
377
+ OrderStatus2["Expired"] = "expired";
378
+ return OrderStatus2;
379
+ })(OrderStatus || {});
380
+
381
+ // src/rest/types/index.ts
382
+ var Currency = /* @__PURE__ */ ((Currency2) => {
383
+ Currency2["EUR"] = "EUR";
384
+ Currency2["USD"] = "USD";
385
+ Currency2["GBP"] = "GBP";
386
+ return Currency2;
387
+ })(Currency || {});
388
+ var Language = /* @__PURE__ */ ((Language2) => {
389
+ Language2["FR"] = "fr";
390
+ Language2["EN"] = "en";
391
+ return Language2;
392
+ })(Language || {});
393
+
394
+ // src/rest/client.ts
395
+ var import_pathcat = require("pathcat");
396
+
397
+ // src/constants/api.ts
398
+ var DEFAULT_API_URL = "https://api.staging.tonightpass.com";
399
+
400
+ // src/rest/client.ts
401
+ var Client = class {
402
+ options;
403
+ url;
404
+ request = requester();
405
+ constructor(options) {
406
+ this.options = options;
407
+ this.url = (path, params) => {
408
+ const baseUrl = DEFAULT_API_URL || this.options.baseUrl;
409
+ return (0, import_pathcat.pathcat)(baseUrl, path, params);
410
+ };
411
+ }
412
+ async get(url, options) {
413
+ return this.request.get(url, options);
414
+ }
415
+ async post(url, options) {
416
+ return this.request.post(url, options);
417
+ }
418
+ async put(url, options) {
419
+ return this.request.put(url, options);
420
+ }
421
+ async delete(url, options) {
422
+ return this.request.delete(url, options);
423
+ }
424
+ };
425
+
426
+ // src/sdk/builder.ts
427
+ function sdk(builder) {
428
+ return builder;
429
+ }
430
+
431
+ // src/sdk/health.ts
432
+ var health = sdk((client) => ({
433
+ http: async () => client.get("/health/http")
434
+ }));
435
+
436
+ // src/sdk/users.ts
437
+ var users = sdk((client) => ({
438
+ me: {
439
+ get: async () => client.get("/users/me"),
440
+ update: async (data) => client.put("/users/me", { data })
441
+ }
442
+ }));
443
+ // Annotate the CommonJS export names for ESM import in node:
444
+ 0 && (module.exports = {
445
+ BCRYPT_HASH,
446
+ Client,
447
+ CreateUserDto,
448
+ Currency,
449
+ EMAIL_REGEX,
450
+ EventStyleType,
451
+ EventTicketCategory,
452
+ EventType,
453
+ IMAGE_URL_REGEX,
454
+ Language,
455
+ NAME_REGEX,
456
+ OrderStatus,
457
+ OrganizationMemberRole,
458
+ OrganizationSocialType,
459
+ PASSWORD_REGEX,
460
+ PHONE_NUMBER_REGEX,
461
+ SLUG_REGEX,
462
+ SignInUserDto,
463
+ UpdateUserDto,
464
+ UserRole,
465
+ UserTokenType,
466
+ health,
467
+ request,
468
+ requester,
469
+ sdk,
470
+ users
471
+ });
472
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/constants/regex.ts","../src/rest/dtos/index.ts","../src/rest/dtos/users/create-user.dto.ts","../src/rest/dtos/users/sign-in-user.dto.ts","../src/rest/dtos/users/update-user.dto.ts","../../../node_modules/redaxios/src/index.js","../src/rest/request/request.ts","../src/rest/request/requester.ts","../src/rest/types/event/ticket/index.ts","../src/rest/types/event/index.ts","../src/rest/types/organization/index.ts","../src/rest/types/token/index.ts","../src/rest/types/user/index.ts","../src/rest/types/order/index.ts","../src/rest/types/index.ts","../src/rest/client.ts","../src/constants/api.ts","../src/sdk/builder.ts","../src/sdk/health.ts","../src/sdk/users.ts"],"sourcesContent":["export * from \"./constants/regex\";\nexport * from \"./rest\";\nexport * from \"./sdk\";\n","export const EMAIL_REGEX = /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$/;\n\n// checks if a password has at least one uppercase letter and a number or special character\nexport const PASSWORD_REGEX =\n /((?=.*\\d)|(?=.*\\W+))(?![.\\n])(?=.*[A-Z])(?=.*[a-z]).*$/;\n\n// checks if a string has only letters, numbers, spaces, apostrophes, dots and dashes\nexport const NAME_REGEX = /(^[\\p{L}\\d'\\\\.\\s\\\\-]*$)/u;\n\n// checks if a string is a valid slug, useful for usernames\nexport const SLUG_REGEX = /^[a-z\\d]+(?:(\\.|-|_)[a-z\\d]+)*$/;\n\n// validates if passwords are valid bcrypt hashes\nexport const BCRYPT_HASH = /\\$2[abxy]?\\$\\d{1,2}\\$[A-Za-z\\d\\\\./]{53}/;\n\nexport const PHONE_NUMBER_REGEX =\n /^\\s*(?:\\+?(\\d{1,3}))?([-. (]*(\\d{3})[-. )]*)?((\\d{3})[-. ]*(\\d{2,4})(?:[-.x ]*(\\d+))?)\\s*$/;\n\nexport const IMAGE_URL_REGEX =\n /(((http:\\/\\/www)|(http:\\/\\/)|(www))[-a-zA-Z0-9@:%_\\\\+.~#?&//=]+)\\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;\n","import \"reflect-metadata\";\n\nexport * from \"./users\";\n","import { UserIdentifier, UserIdentityGender } from \"../../types\";\n\nexport class CreateUserDto {\n identifier: UserIdentifier;\n password: string;\n identity: CreateUserIdentituDto;\n addresses: Location[];\n}\n\nclass CreateUserIdentituDto {\n firstName: string;\n lastName: string;\n gender: UserIdentityGender;\n profilePictureUrl?: string;\n birthDate: Date;\n}\n","export class SignInUserDto {\n identifier: string;\n password: string;\n}\n","import { Type } from \"class-transformer\";\nimport {\n IsDateString,\n IsEmail,\n IsObject,\n IsOptional,\n IsPhoneNumber,\n IsString,\n IsUrl,\n Length,\n Matches,\n MaxLength,\n MinLength,\n ValidateNested,\n} from \"class-validator\";\n\nimport { NAME_REGEX } from \"../../../constants/regex\";\nimport { UserIdentifier, UserIdentity } from \"../../types\";\n\nexport class UpdateUserDto {\n @IsOptional()\n @IsObject()\n @ValidateNested()\n @Type(() => UpdateIdentifierDto)\n identifier?: UpdateIdentifierDto;\n\n @IsOptional()\n @IsObject()\n @ValidateNested()\n @Type(() => UpdateIdentityDto)\n identity?: UpdateIdentityDto;\n\n @IsOptional()\n @IsString()\n @MinLength(6)\n @MaxLength(130)\n password?: string;\n}\n\nclass UpdateIdentifierDto\n implements\n Partial<Pick<UserIdentifier, \"email\" | \"phoneNumber\" | \"username\">>\n{\n @IsOptional()\n @IsString()\n @IsEmail()\n email?: string;\n\n @IsOptional()\n @IsString()\n @IsPhoneNumber()\n phoneNumber?: string;\n\n @IsOptional()\n @IsString()\n @MinLength(3)\n username?: string;\n}\n\nclass UpdateIdentityDto\n implements\n Partial<\n Pick<\n UserIdentity,\n | \"firstName\"\n | \"lastName\"\n | \"displayName\"\n | \"description\"\n | \"profilePictureUrl\"\n | \"bannerUrl\"\n | \"gender\"\n | \"birthDate\"\n >\n >\n{\n @IsOptional()\n @IsString()\n @Length(2, 50)\n @Matches(NAME_REGEX, {\n message: \"First name must be composed of letters only\",\n })\n firstName?: string;\n\n @IsOptional()\n @IsString()\n @Length(2, 50)\n @Matches(NAME_REGEX, {\n message: \"Last name must be composed of letters only\",\n })\n lastName?: string;\n\n @IsOptional()\n @IsString()\n @Length(1, 32)\n displayName?: string;\n\n @IsOptional()\n @IsString()\n @Length(15, 500)\n description?: string;\n\n @IsOptional()\n @IsUrl()\n profilePictureUrl?: string | undefined;\n\n @IsOptional()\n @IsUrl()\n bannerUrl?: string | undefined;\n\n @IsOptional()\n gender?: string;\n\n @IsOptional()\n @IsDateString()\n birthDate?: Date;\n}\n","/**\n * Copyright 2018 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @public\n * @typedef Options\n * @property {string} [url] the URL to request\n * @property {'get'|'post'|'put'|'patch'|'delete'|'options'|'head'|'GET'|'POST'|'PUT'|'PATCH'|'DELETE'|'OPTIONS'|'HEAD'} [method=\"get\"] HTTP method, case-insensitive\n * @property {RequestHeaders} [headers] Request headers\n * @property {FormData|string|object} [body] a body, optionally encoded, to send\n * @property {'text'|'json'|'stream'|'blob'|'arrayBuffer'|'formData'|'stream'} [responseType=\"json\"] An encoding to use for the response\n * @property {Record<string,any>|URLSearchParams} [params] querystring parameters\n * @property {(params: Options['params']) => string} [paramsSerializer] custom function to stringify querystring parameters\n * @property {boolean} [withCredentials] Send the request with credentials like cookies\n * @property {string} [auth] Authorization header value to send with the request\n * @property {string} [xsrfCookieName] Pass an Cross-site Request Forgery prevention cookie value as a header defined by `xsrfHeaderName`\n * @property {string} [xsrfHeaderName] The name of a header to use for passing XSRF cookies\n * @property {(status: number) => boolean} [validateStatus] Override status code handling (default: 200-399 is a success)\n * @property {Array<(body: any, headers?: RequestHeaders) => any?>} [transformRequest] An array of transformations to apply to the outgoing request\n * @property {string} [baseURL] a base URL from which to resolve all URLs\n * @property {typeof window.fetch} [fetch] Custom window.fetch implementation\n * @property {any} [data]\n */\n\n/**\n * @public\n * @typedef RequestHeaders\n * @type {{[name: string]: string} | Headers}\n */\n\n/**\n * @public\n * @template T\n * @typedef Response\n * @property {number} status\n * @property {string} statusText\n * @property {Options} config the request configuration\n * @property {T} data the decoded response body\n * @property {Headers} headers\n * @property {boolean} redirect\n * @property {string} url\n * @property {ResponseType} type\n * @property {ReadableStream<Uint8Array> | null} body\n * @property {boolean} bodyUsed\n */\n\n/**\n * @typedef BodylessMethod\n * @type {<T=any>(url: string, config?: Options) => Promise<Response<T>>}\n */\n\n/**\n * @typedef BodyMethod\n * @type {<T=any>(url: string, body?: any, config?: Options) => Promise<Response<T>>}\n */\n\n/**\n * @public\n * @param {Options} [defaults = {}]\n * @returns {redaxios}\n */\nfunction create(defaults) {\n\tdefaults = defaults || {};\n\n\t/**\n\t * @public\n\t * @template T\n\t * @type {(<T = any>(config?: Options) => Promise<Response<T>>) | (<T = any>(url: string, config?: Options) => Promise<Response<T>>)}\n\t */\n\tredaxios.request = redaxios;\n\n\t/** @public @type {BodylessMethod} */\n\tredaxios.get = (url, config) => redaxios(url, config, 'get');\n\n\t/** @public @type {BodylessMethod} */\n\tredaxios.delete = (url, config) => redaxios(url, config, 'delete');\n\n\t/** @public @type {BodylessMethod} */\n\tredaxios.head = (url, config) => redaxios(url, config, 'head');\n\n\t/** @public @type {BodylessMethod} */\n\tredaxios.options = (url, config) => redaxios(url, config, 'options');\n\n\t/** @public @type {BodyMethod} */\n\tredaxios.post = (url, data, config) => redaxios(url, config, 'post', data);\n\n\t/** @public @type {BodyMethod} */\n\tredaxios.put = (url, data, config) => redaxios(url, config, 'put', data);\n\n\t/** @public @type {BodyMethod} */\n\tredaxios.patch = (url, data, config) => redaxios(url, config, 'patch', data);\n\n\t/** @public */\n\tredaxios.all = Promise.all.bind(Promise);\n\n\t/**\n\t * @public\n\t * @template Args, R\n\t * @param {(...args: Args[]) => R} fn\n\t * @returns {(array: Args[]) => R}\n\t */\n\tredaxios.spread = (fn) => /** @type {any} */ (fn.apply.bind(fn, fn));\n\n\t/**\n\t * @private\n\t * @template T, U\n\t * @param {T} opts\n\t * @param {U} [overrides]\n\t * @param {boolean} [lowerCase]\n\t * @returns {{} & (T | U)}\n\t */\n\tfunction deepMerge(opts, overrides, lowerCase) {\n\t\tlet out = /** @type {any} */ ({}),\n\t\t\ti;\n\t\tif (Array.isArray(opts)) {\n\t\t\t// @ts-ignore\n\t\t\treturn opts.concat(overrides);\n\t\t}\n\t\tfor (i in opts) {\n\t\t\tconst key = lowerCase ? i.toLowerCase() : i;\n\t\t\tout[key] = opts[i];\n\t\t}\n\t\tfor (i in overrides) {\n\t\t\tconst key = lowerCase ? i.toLowerCase() : i;\n\t\t\tconst value = /** @type {any} */ (overrides)[i];\n\t\t\tout[key] = key in out && typeof value == 'object' ? deepMerge(out[key], value, key == 'headers') : value;\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t * Issues a request.\n\t * @public\n\t * @template T\n\t * @param {string | Options} urlOrConfig\n\t * @param {Options} [config = {}]\n\t * @param {any} [_method] (internal)\n\t * @param {any} [data] (internal)\n\t * @param {never} [_undefined] (internal)\n\t * @returns {Promise<Response<T>>}\n\t */\n\tfunction redaxios(urlOrConfig, config, _method, data, _undefined) {\n\t\tlet url = /** @type {string} */ (typeof urlOrConfig != 'string' ? (config = urlOrConfig).url : urlOrConfig);\n\n\t\tconst response = /** @type {Response<any>} */ ({ config });\n\n\t\t/** @type {Options} */\n\t\tconst options = deepMerge(defaults, config);\n\n\t\t/** @type {RequestHeaders} */\n\t\tconst customHeaders = {};\n\n\t\tdata = data || options.data;\n\n\t\t(options.transformRequest || []).map((f) => {\n\t\t\tdata = f(data, options.headers) || data;\n\t\t});\n\n\t\tif (options.auth) {\n\t\t\tcustomHeaders.authorization = options.auth;\n\t\t}\n\n\t\tif (data && typeof data === 'object' && typeof data.append !== 'function' && typeof data.text !== 'function') {\n\t\t\tdata = JSON.stringify(data);\n\t\t\tcustomHeaders['content-type'] = 'application/json';\n\t\t}\n\n\t\ttry {\n\t\t\t// @ts-ignore providing the cookie name without header name is nonsensical anyway\n\t\t\tcustomHeaders[options.xsrfHeaderName] = decodeURIComponent(\n\t\t\t\t// @ts-ignore accessing match()[2] throws for no match, which is intentional\n\t\t\t\tdocument.cookie.match(RegExp('(^|; )' + options.xsrfCookieName + '=([^;]*)'))[2]\n\t\t\t);\n\t\t} catch (e) {}\n\n\t\tif (options.baseURL) {\n\t\t\turl = url.replace(/^(?!.*\\/\\/)\\/?/, options.baseURL + '/');\n\t\t}\n\n\t\tif (options.params) {\n\t\t\turl +=\n\t\t\t\t(~url.indexOf('?') ? '&' : '?') +\n\t\t\t\t(options.paramsSerializer ? options.paramsSerializer(options.params) : new URLSearchParams(options.params));\n\t\t}\n\n\t\tconst fetchFunc = options.fetch || fetch;\n\n\t\treturn fetchFunc(url, {\n\t\t\tmethod: (_method || options.method || 'get').toUpperCase(),\n\t\t\tbody: data,\n\t\t\theaders: deepMerge(options.headers, customHeaders, true),\n\t\t\tcredentials: options.withCredentials ? 'include' : _undefined\n\t\t}).then((res) => {\n\t\t\tfor (const i in res) {\n\t\t\t\tif (typeof res[i] != 'function') response[i] = res[i];\n\t\t\t}\n\n\t\t\tif (options.responseType == 'stream') {\n\t\t\t\tresponse.data = res.body;\n\t\t\t\treturn response;\n\t\t\t}\n\n\t\t\treturn res[options.responseType || 'text']()\n\t\t\t\t.then((data) => {\n\t\t\t\t\tresponse.data = data;\n\t\t\t\t\t// its okay if this fails: response.data will be the unparsed value:\n\t\t\t\t\tresponse.data = JSON.parse(data);\n\t\t\t\t})\n\t\t\t\t.catch(Object)\n\t\t\t\t.then(() => {\n\t\t\t\t\tconst ok = options.validateStatus ? options.validateStatus(res.status) : res.ok;\n\t\t\t\t\treturn ok ? response : Promise.reject(response);\n\t\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * @public\n\t * @type {AbortController}\n\t */\n\tredaxios.CancelToken = /** @type {any} */ (typeof AbortController == 'function' ? AbortController : Object);\n\n\t/**\n\t * @public\n\t * @type {Options}\n\t */\n\tredaxios.defaults = defaults;\n\n\t/**\n\t * @public\n\t */\n\tredaxios.create = create;\n\n\treturn redaxios;\n}\n\nexport default create();\n","import axios, { Options } from \"redaxios\";\n\nimport { APIError, APIResponse } from \"../types\";\n\ntype ApiRequestConfig = Exclude<Options, \"method\">;\n\nconst instance = axios.create({\n baseURL: process.env.NEXT_PUBLIC_API_URL,\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n responseType: \"json\",\n transformRequest: [\n function (data) {\n return JSON.stringify(data);\n },\n ],\n});\n\nexport const request = async <TData>(\n url: string,\n options?: ApiRequestConfig,\n): Promise<APIResponse<TData>> => {\n const response = instance<APIResponse<TData>>(url, { ...options })\n .then((response) => response.data)\n .catch((error: APIError) => {\n throw error;\n });\n\n return response;\n};\n\nexport type { ApiRequestConfig };\n","import { ApiRequestConfig, request } from \"./request\";\nimport { APIResponse } from \"../types\";\n\nconst createAuthHeaders = (jwtToken: string) => ({\n Authorization: `${\n process.env.NEXT_PUBLIC_AUTH_PREFIX || \"Bearer\"\n } ${jwtToken}`,\n});\n\ntype BaseRequest = <TData>(\n url: string,\n options?: ApiRequestConfig,\n) => Promise<APIResponse<TData>>;\n\ntype RequestResponse = {\n get: BaseRequest;\n post: BaseRequest;\n put: BaseRequest;\n delete: BaseRequest;\n};\n\nconst requester = (auth = true): RequestResponse => {\n let baseOptions: ApiRequestConfig = {};\n\n if (auth) {\n // eslint-disable-next-line no-unused-expressions\n createAuthHeaders; // - Waiting usage\n\n baseOptions = {\n ...baseOptions,\n withCredentials: true,\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const get: BaseRequest = async <TData = any>(\n url: string,\n options?: ApiRequestConfig,\n ): Promise<APIResponse<TData>> =>\n request<TData>(url, { ...baseOptions, ...options, method: \"GET\" });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const post: BaseRequest = async <TData = any>(\n url: string,\n options?: ApiRequestConfig,\n ): Promise<APIResponse<TData>> =>\n request<TData>(url, { ...baseOptions, ...options, method: \"POST\" });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const put: BaseRequest = async <TData = any>(\n url: string,\n options?: ApiRequestConfig,\n ): Promise<APIResponse<TData>> =>\n request<TData>(url, { ...baseOptions, ...options, method: \"PUT\" });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const del: BaseRequest = async <TData = any>(\n url: string,\n options?: ApiRequestConfig,\n ): Promise<APIResponse<TData>> =>\n request<TData>(url, { ...baseOptions, ...options, method: \"DELETE\" });\n\n return {\n get,\n post,\n put,\n delete: del,\n };\n};\n\nexport { requester };\n","import { Currency } from \"../..\";\n\nexport type EventTicket = {\n id: string;\n name: string;\n description?: string;\n price: number;\n displayPrice: number;\n quantity: number;\n type: EventTicketType;\n category: EventTicketCategory;\n currency: Currency;\n vatRate: number;\n externalId?: string;\n isVisible: boolean;\n isFeesIncluded: boolean;\n startAt: Date;\n endAt: Date;\n updatedAt: Date;\n createdAt: Date;\n};\n\nexport type EventTicketType = \"e-ticket\" | \"other\";\n\nexport enum EventTicketCategory {\n ENTRY = \"entry\",\n PACKAGE = \"package\",\n MEAL = \"meal\",\n DRINK = \"drink\",\n PARKING = \"parking\",\n ACCOMMODATION = \"accommodation\",\n CAMPING = \"camping\",\n LOCKER = \"locker\",\n SHUTTLE = \"shuttle\",\n OTHER = \"other\",\n}\n","import { EventTicket } from \"./ticket\";\nimport { Location } from \"..\";\nimport { Organization } from \"../organization\";\n\nexport * from \"./ticket\";\n\nexport type Event = {\n title: string;\n description: string;\n slug: string;\n organization: Organization;\n type: EventType;\n public: boolean;\n flyers: string[];\n trailers: string[];\n location: Location;\n tickets: EventTicket[];\n styles: EventStyle[];\n startAt: Date;\n endAt: Date;\n updatedAt: Date;\n createdAt: Date;\n};\n\nexport enum EventType {\n Clubbing = \"clubbing\",\n Concert = \"concert\",\n Afterwork = \"afterwork\",\n DancingLunch = \"dancing_lunch\",\n Diner = \"diner\",\n Garden = \"garden\",\n AfterBeach = \"after_beach\",\n Festival = \"festival\",\n Spectacle = \"spectacle\",\n Cruise = \"cruise\",\n OutsideAnimation = \"outside_animation\",\n Sport = \"sport\",\n Match = \"match\",\n Seminar = \"seminar\",\n Conference = \"conference\",\n WellnessDay = \"wellness_day\",\n Workshop = \"workshop\",\n TradeFair = \"trade_fair\",\n ConsumerShow = \"consumer_show\",\n Membership = \"membership\",\n}\n\nexport type EventStyle = {\n type: EventStyleType;\n emoji: string;\n name: string;\n};\n\nexport enum EventStyleType {\n Music = \"music\",\n Dress = \"dress\",\n Sport = \"sport\",\n Food = \"food\",\n Art = \"art\",\n}\n","import { Location, Profile, ProfileMetadata } from \"..\";\nimport { Event } from \"../event\";\nimport { EventTicket } from \"../event/ticket\";\nimport { User } from \"../user\";\n\nexport type Organization = {\n id: string;\n slug: string;\n identity: OrganizationIdentity;\n members: OrganizationMember[];\n location?: Location;\n events: Event[];\n savedTickets: EventTicket[];\n verified: boolean;\n updatedAt: Date;\n createdAt: Date;\n};\n\nexport type OrganizationIdentity = Profile & {\n socialLinks: OrganizationSocialLink[];\n\n metadata: ProfileMetadata & {\n eventsCount: number;\n viewsCount: number;\n membersCount: number;\n };\n};\n\nexport type OrganizationSocialLink = {\n type: OrganizationSocialType;\n url: string;\n};\n\nexport enum OrganizationSocialType {\n Facebook = \"facebook\",\n Twitter = \"twitter\",\n Instagram = \"instagram\",\n Linkedin = \"linkedin\",\n Youtube = \"youtube\",\n Website = \"website\",\n}\n\nexport type OrganizationMember = {\n user: User;\n role: OrganizationMemberRole;\n createdAt: Date;\n};\n\nexport enum OrganizationMemberRole {\n EMPLOYEE = 0,\n MANAGER = 1,\n ADMINISTRATOR = 2,\n OWNER = 3,\n}\n","export type UserToken = {\n id: string;\n type: UserTokenType;\n value: string;\n createdAt: Date;\n expiresAt: Date;\n};\n\nexport enum UserTokenType {\n Authentication = \"authentication\",\n OrganizationInvite = \"organization_invite\",\n PasswordRecovery = \"password_recovery\",\n EmailValidation = \"email_validation\",\n PhoneValidation = \"phone_validation\",\n}\n","import { Currency, Language, Location, Profile, ProfileMetadata } from \"..\";\n\nexport type User = {\n id: string;\n identifier: UserIdentifier;\n password: string;\n identity: UserIdentity;\n role: UserRole;\n addresses: Location[];\n preferences: UserPreferences;\n connections: UserConnection[];\n verified: boolean;\n updatedAt: Date;\n createdAt: Date;\n};\n\nexport type UserIdentifier = {\n email?: string;\n phoneNumber?: string;\n username: string;\n\n [key: string]: string | undefined;\n};\n\nexport type UserIdentity = Profile & {\n firstName: string;\n lastName: string;\n fullName: string;\n gender: UserIdentityGender;\n birthDate: Date;\n\n metadata: ProfileMetadata & {\n followingCount: number;\n hasPassPlus: boolean;\n idValid: boolean;\n };\n};\n\nexport enum UserRole {\n USER = 0,\n DEVELOPER = 8,\n ADMINISTRATOR = 10,\n}\n\nexport type UserIdentityGender =\n | \"male\"\n | \"female\"\n | \"non-binary\"\n | \"gender-fluid\"\n | \"neutral\"\n | \"other\"\n | string;\n\nexport type UserPreferences = {\n language: Language;\n currency: Currency;\n notifications: {\n email: {\n newsletter: boolean;\n message: boolean;\n };\n push: {\n message: boolean;\n };\n };\n};\n\nexport type UserConnection = {\n ip: string;\n os: UserConnectionOS;\n device: UserConnectionDevice;\n client: UserConnectionClient;\n updatedAt: Date;\n createdAt: Date;\n};\n\nexport type UserConnectionOS = {\n name: string;\n version: string;\n};\n\nexport type UserConnectionDevice = {\n type: string;\n brand: string;\n};\n\nexport type UserConnectionClient = {\n name: string;\n version: string;\n};\n","import { Currency } from \"..\";\nimport { Event, EventTicket } from \"../event\";\nimport { User } from \"../user\";\n\nexport enum OrderStatus {\n Created = \"created\",\n Cancelled = \"cancelled\",\n Completed = \"completed\",\n Pending = \"pending\",\n Confirmed = \"confirmed\",\n Declined = \"declined\",\n Refunded = \"refunded\",\n PartiallyRefunded = \"partially_refunded\",\n Expired = \"expired\",\n}\n\nexport type OrderItem = {\n id: string;\n ticket: EventTicket;\n isUsed: boolean;\n updatedAt: Date;\n createdAt: Date;\n};\n\nexport type Order = {\n id: string;\n owner: User;\n members: User[];\n status: OrderStatus;\n event: Event;\n items: OrderItem[];\n promoCode?: PromoCode;\n total: number;\n currency: Currency;\n createdAt: Date;\n};\n\nexport type PromoCode = {\n id: string;\n code: string;\n used: number;\n discount: number;\n isActive: boolean;\n expirationAt: Date;\n createdAt: Date;\n};\n","export * from \"./event\";\nexport * from \"./organization\";\nexport * from \"./token\";\nexport * from \"./user\";\nexport * from \"./order\";\nexport * from \"./profile\";\n\n// - API\nexport * from \"./api\";\n\nexport type Location = {\n name?: string;\n address: string;\n zipCode: string;\n city: string;\n country: string;\n geometry?: {\n latitude: number;\n longitude: number;\n };\n};\n\n// Currency\nexport enum Currency {\n EUR = \"EUR\",\n USD = \"USD\",\n GBP = \"GBP\",\n}\n\n// I18n\nexport enum Language {\n FR = \"fr\",\n EN = \"en\",\n}\n","import { ParamValue, pathcat } from \"pathcat\";\n\nimport { ApiRequestConfig, requester } from \"./request\";\nimport { DEFAULT_API_URL } from \"../constants\";\n\nexport interface ClientOptions {\n readonly baseUrl: string;\n}\n\nexport class Client {\n private readonly options;\n public readonly url;\n private request = requester();\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.url = (path: string, params: Record<string, ParamValue>) => {\n const baseUrl = DEFAULT_API_URL || this.options.baseUrl;\n return pathcat(baseUrl, path, params);\n };\n }\n\n async get<T>(url: string, options?: ApiRequestConfig) {\n return this.request.get<T>(url, options);\n }\n\n async post<T>(url: string, options?: ApiRequestConfig) {\n return this.request.post<T>(url, options);\n }\n\n async put<T>(url: string, options?: ApiRequestConfig) {\n return this.request.put<T>(url, options);\n }\n\n async delete<T>(url: string, options?: ApiRequestConfig) {\n return this.request.delete<T>(url, options);\n }\n}\n","export const DEFAULT_API_URL = \"https://api.staging.tonightpass.com\";\n","import { Client } from \"../rest\";\n\nexport function sdk<T>(builder: (client: Client) => T) {\n return builder;\n}\n","import { sdk } from \"./builder\";\n\nexport const health = sdk((client) => ({\n http: async () =>\n client.get<{\n status: string;\n details: {\n app: {\n status: string;\n details: {\n status: string;\n };\n };\n };\n }>(\"/health/http\"),\n}));\n","import { sdk } from \"./builder\";\nimport { UpdateUserDto } from \"../rest\";\nimport { User } from \"../rest/types\";\n\nexport const users = sdk((client) => ({\n me: {\n get: async () => client.get<User>(\"/users/me\"),\n update: async (data: UpdateUserDto) =>\n client.put<User>(\"/users/me\", { data }),\n },\n}));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,cAAc;AAGpB,IAAM,iBACX;AAGK,IAAM,aAAa;AAGnB,IAAM,aAAa;AAGnB,IAAM,cAAc;AAEpB,IAAM,qBACX;AAEK,IAAM,kBACX;;;ACnBF,8BAAO;;;ACEA,IAAM,gBAAN,MAAoB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACPO,IAAM,gBAAN,MAAoB;AAAA,EACzB;AAAA,EACA;AACF;;;ACHA,+BAAqB;AACrB,6BAaO;AAKA,IAAM,gBAAN,MAAoB;AAAA,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AAY,SAAwB;AAClC,SAAK,UAAU;AACf,SAAK,MAAM,CAAC,MAAc,WAAuC;AAC/D,YAAM,UAAU,mBAAmB,KAAK,QAAQ;AAChD,iBAAO,wBAAQ,SAAS,MAAM,MAAM;AAAA,IACtC;AAAA,EACF;AAAA,EAEA,MAAM,IAAO,KAAa,SAA4B;AACpD,WAAO,KAAK,QAAQ,IAAO,KAAK,OAAO;AAAA,EACzC;AAAA,EAEA,MAAM,KAAQ,KAAa,SAA4B;AACrD,WAAO,KAAK,QAAQ,KAAQ,KAAK,OAAO;AAAA,EAC1C;AAAA,EAEA,MAAM,IAAO,KAAa,SAA4B;AACpD,WAAO,KAAK,QAAQ,IAAO,KAAK,OAAO;AAAA,EACzC;AAAA,EAEA,MAAM,OAAU,KAAa,SAA4B;AACvD,WAAO,KAAK,QAAQ,OAAU,KAAK,OAAO;AAAA,EAC5C;AACF;;;AEnCO,SAAS,IAAO,SAAgC;AACrD,SAAO;AACT;;;ACFO,IAAM,SAAS,IAAI,CAAC,YAAY;AAAA,EACrC,MAAM,YACJ,OAAO,IAUJ,cAAc;AACrB,EAAE;;;ACXK,IAAM,QAAQ,IAAI,CAAC,YAAY;AAAA,EACpC,IAAI;AAAA,IACF,KAAK,YAAY,OAAO,IAAU,WAAW;AAAA,IAC7C,QAAQ,OAAO,SACb,OAAO,IAAU,aAAa,EAAE,KAAK,CAAC;AAAA,EAC1C;AACF,EAAE;","names":["create","defaults","deepMerge","opts","overrides","lowerCase","i","out","Array","isArray","concat","toLowerCase","key","value","redaxios","urlOrConfig","config","_method","data","_undefined","url","response","options","customHeaders","transformRequest","map","f","headers","auth","authorization","append","text","JSON","stringify","xsrfHeaderName","decodeURIComponent","document","cookie","match","RegExp","xsrfCookieName","e","baseURL","replace","params","indexOf","paramsSerializer","URLSearchParams","fetch","method","toUpperCase","body","credentials","withCredentials","then","res","responseType","parse","catch","Object","validateStatus","status","ok","Promise","reject","request","get","delete","head","post","put","patch","all","bind","spread","fn","apply","CancelToken","AbortController","response","EventTicketCategory","EventType","EventStyleType","OrganizationSocialType","OrganizationMemberRole","UserTokenType","UserRole","OrderStatus","Currency","Language"]}
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "tonightpass",
3
+ "version": "0.0.0",
4
+ "description": "@tonightpass sdk and tools.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/tonightpass/tonightpass.git",
8
+ "directory": "packages/node"
9
+ },
10
+ "bugs": "https://github.com/tonightpass/tonightpass/issues",
11
+ "homepage": "https://github.com/tonightpass/tonightpass",
12
+ "license": "MIT",
13
+ "main": "dist/index.cjs.js",
14
+ "module": "dist/index.esm.js",
15
+ "types": "dist/index.d.ts",
16
+ "devDependencies": {
17
+ "@types/node": "20.11.26",
18
+ "typescript": "^5.0.0"
19
+ },
20
+ "scripts": {
21
+ "build": "tsup",
22
+ "dev": "tsup --watch"
23
+ }
24
+ }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ const foo = "bar";
2
+
3
+ export default foo;
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "resolveJsonModule": true,
5
+ "esModuleInterop": true,
6
+ "forceConsistentCasingInFileNames": true,
7
+ "isolatedModules": true,
8
+ "moduleResolution": "node",
9
+ "preserveWatchOutput": true,
10
+ "skipLibCheck": true,
11
+ "noEmit": true,
12
+ "strict": true
13
+ },
14
+ "exclude": ["node_modules"]
15
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { defineConfig, Options } from "tsup";
2
+
3
+ const config: Options = {
4
+ entry: ["src/index.ts"],
5
+ splitting: false,
6
+ sourcemap: true,
7
+ clean: true,
8
+ platform: "node",
9
+ dts: true,
10
+ };
11
+
12
+ export default defineConfig(config);