@gymspace/sdk 1.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.
Files changed (52) hide show
  1. package/README.md +160 -0
  2. package/dist/index.js +1379 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.mjs +1321 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/package.json +76 -0
  7. package/src/client.ts +200 -0
  8. package/src/errors.ts +49 -0
  9. package/src/index.ts +15 -0
  10. package/src/models/assets.ts +24 -0
  11. package/src/models/auth.ts +155 -0
  12. package/src/models/check-ins.ts +75 -0
  13. package/src/models/clients.ts +109 -0
  14. package/src/models/contracts.ts +61 -0
  15. package/src/models/dashboard.ts +32 -0
  16. package/src/models/evaluations.ts +91 -0
  17. package/src/models/files.ts +23 -0
  18. package/src/models/gyms.ts +73 -0
  19. package/src/models/index.ts +24 -0
  20. package/src/models/invitations.ts +29 -0
  21. package/src/models/leads.ts +52 -0
  22. package/src/models/membership-plans.ts +71 -0
  23. package/src/models/onboarding.ts +171 -0
  24. package/src/models/organizations.ts +25 -0
  25. package/src/models/products.ts +99 -0
  26. package/src/models/sales.ts +108 -0
  27. package/src/models/suppliers.ts +57 -0
  28. package/src/models/users.ts +17 -0
  29. package/src/resources/assets.ts +102 -0
  30. package/src/resources/auth.ts +137 -0
  31. package/src/resources/base.ts +50 -0
  32. package/src/resources/check-ins.ts +63 -0
  33. package/src/resources/clients.ts +57 -0
  34. package/src/resources/contracts.ts +59 -0
  35. package/src/resources/dashboard.ts +30 -0
  36. package/src/resources/evaluations.ts +63 -0
  37. package/src/resources/files.ts +95 -0
  38. package/src/resources/gyms.ts +61 -0
  39. package/src/resources/health.ts +28 -0
  40. package/src/resources/index.ts +20 -0
  41. package/src/resources/invitations.ts +38 -0
  42. package/src/resources/leads.ts +48 -0
  43. package/src/resources/membership-plans.ts +54 -0
  44. package/src/resources/onboarding.ts +58 -0
  45. package/src/resources/organizations.ts +23 -0
  46. package/src/resources/products.ts +91 -0
  47. package/src/resources/public-catalog.ts +61 -0
  48. package/src/resources/sales.ts +83 -0
  49. package/src/resources/suppliers.ts +44 -0
  50. package/src/resources/users.ts +27 -0
  51. package/src/sdk.ts +104 -0
  52. package/src/types.ts +41 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,1321 @@
1
+ import axios from 'axios';
2
+
3
+ // src/client.ts
4
+
5
+ // src/errors.ts
6
+ var GymSpaceError = class extends Error {
7
+ constructor(message, statusCode, code, details) {
8
+ super(message);
9
+ this.statusCode = statusCode;
10
+ this.code = code;
11
+ this.details = details;
12
+ this.name = "GymSpaceError";
13
+ }
14
+ };
15
+ var AuthenticationError = class extends GymSpaceError {
16
+ constructor(message = "Authentication failed") {
17
+ super(message, 401, "AUTHENTICATION_ERROR");
18
+ this.name = "AuthenticationError";
19
+ }
20
+ };
21
+ var AuthorizationError = class extends GymSpaceError {
22
+ constructor(message = "Access denied") {
23
+ super(message, 403, "AUTHORIZATION_ERROR");
24
+ this.name = "AuthorizationError";
25
+ }
26
+ };
27
+ var NotFoundError = class extends GymSpaceError {
28
+ constructor(resource, id) {
29
+ const message = id ? `${resource} with id ${id} not found` : `${resource} not found`;
30
+ super(message, 404, "NOT_FOUND");
31
+ this.name = "NotFoundError";
32
+ }
33
+ };
34
+ var ValidationError = class extends GymSpaceError {
35
+ constructor(message, errors) {
36
+ super(message, 400, "VALIDATION_ERROR", errors);
37
+ this.name = "ValidationError";
38
+ }
39
+ };
40
+ var NetworkError = class extends GymSpaceError {
41
+ constructor(message = "Network request failed") {
42
+ super(message, 0, "NETWORK_ERROR");
43
+ this.name = "NetworkError";
44
+ }
45
+ };
46
+
47
+ // src/client.ts
48
+ var ApiClient = class {
49
+ constructor(config) {
50
+ this.config = config;
51
+ this.axiosInstance = axios.create({
52
+ baseURL: config.baseURL,
53
+ timeout: config.timeout || 3e4,
54
+ headers: {
55
+ "Content-Type": "application/json",
56
+ ...config.headers
57
+ }
58
+ });
59
+ this.setupInterceptors();
60
+ }
61
+ setupInterceptors() {
62
+ this.axiosInstance.interceptors.request.use(
63
+ (config) => {
64
+ if (this.config.apiKey && config.headers) {
65
+ config.headers["Authorization"] = `Bearer ${this.config.apiKey}`;
66
+ }
67
+ return config;
68
+ },
69
+ (error) => {
70
+ return Promise.reject(error);
71
+ }
72
+ );
73
+ this.axiosInstance.interceptors.response.use(
74
+ (response) => response,
75
+ (error) => {
76
+ throw this.handleError(error);
77
+ }
78
+ );
79
+ }
80
+ handleError(error) {
81
+ const requestPath = error.config?.url || "unknown";
82
+ const method = error.config?.method?.toUpperCase() || "unknown";
83
+ console.error(
84
+ "API Error:",
85
+ JSON.stringify(
86
+ {
87
+ method,
88
+ path: requestPath,
89
+ message: error.message,
90
+ baseURL: error.config?.baseURL
91
+ },
92
+ null,
93
+ 3
94
+ )
95
+ );
96
+ if (!error.response) {
97
+ console.error("Network Error:", {
98
+ method,
99
+ path: requestPath,
100
+ error: error.message
101
+ });
102
+ return new NetworkError(error.message);
103
+ }
104
+ const { status, data } = error.response;
105
+ const errorData = data;
106
+ const resource = errorData?.resource || "unknown";
107
+ console.error("HTTP Error:", {
108
+ method,
109
+ path: requestPath,
110
+ status,
111
+ resource,
112
+ message: errorData?.message || error.message,
113
+ errorCode: errorData?.code,
114
+ details: errorData
115
+ });
116
+ switch (status) {
117
+ case 401:
118
+ return new AuthenticationError(errorData?.message || "Authentication failed");
119
+ case 403:
120
+ return new AuthorizationError(errorData?.message || "Access denied");
121
+ case 404:
122
+ return new NotFoundError(errorData?.resource || "Resource", errorData?.id);
123
+ case 400:
124
+ return new ValidationError(errorData?.message || "Validation failed", errorData?.errors);
125
+ default:
126
+ return new GymSpaceError(
127
+ errorData?.message || error.message,
128
+ status,
129
+ errorData?.code,
130
+ errorData
131
+ );
132
+ }
133
+ }
134
+ mergeOptions(options) {
135
+ const headers = { ...options?.headers };
136
+ if (options?.gymId) {
137
+ headers["X-Gym-Id"] = options.gymId;
138
+ }
139
+ return { headers };
140
+ }
141
+ async request(method, path, data, options) {
142
+ const { headers, ...axiosConfig } = options || {};
143
+ const config = {
144
+ method,
145
+ url: path,
146
+ ...this.mergeOptions({ headers }),
147
+ ...axiosConfig
148
+ };
149
+ if (data && ["POST", "PUT", "PATCH"].includes(method.toUpperCase())) {
150
+ config.data = data;
151
+ } else if (data && method.toUpperCase() === "GET") {
152
+ config.params = data;
153
+ }
154
+ const response = await this.axiosInstance.request(config);
155
+ return response.data;
156
+ }
157
+ get(path, params, options) {
158
+ return this.request("GET", path, params, options);
159
+ }
160
+ post(path, data, options) {
161
+ return this.request("POST", path, data, options);
162
+ }
163
+ put(path, data, options) {
164
+ return this.request("PUT", path, data, options);
165
+ }
166
+ patch(path, data, options) {
167
+ return this.request("PATCH", path, data, options);
168
+ }
169
+ delete(path, options) {
170
+ return this.request("DELETE", path, void 0, options);
171
+ }
172
+ setAuthToken(token) {
173
+ this.config.apiKey = token;
174
+ }
175
+ setTokens(accessToken, refreshToken) {
176
+ this.config.apiKey = accessToken;
177
+ this.config.refreshToken = refreshToken;
178
+ }
179
+ setGymId(gymId) {
180
+ this.axiosInstance.defaults.headers.common["X-Gym-Id"] = gymId;
181
+ }
182
+ clearAuth() {
183
+ delete this.config.apiKey;
184
+ delete this.config.refreshToken;
185
+ delete this.axiosInstance.defaults.headers.common["Authorization"];
186
+ delete this.axiosInstance.defaults.headers.common["X-Gym-Id"];
187
+ }
188
+ getBaseUrl() {
189
+ return this.config.baseURL;
190
+ }
191
+ };
192
+
193
+ // src/resources/base.ts
194
+ var BaseResource = class {
195
+ constructor(client) {
196
+ this.client = client;
197
+ }
198
+ async request(path, options) {
199
+ const data = options.body ? JSON.parse(options.body) : void 0;
200
+ switch (options.method) {
201
+ case "GET":
202
+ return this.client.get(path, data, { headers: options.headers });
203
+ case "POST":
204
+ return this.client.post(path, data, { headers: options.headers });
205
+ case "PUT":
206
+ return this.client.put(path, data, { headers: options.headers });
207
+ case "PATCH":
208
+ return this.client.patch(path, data, { headers: options.headers });
209
+ case "DELETE":
210
+ return this.client.delete(path, { headers: options.headers });
211
+ default:
212
+ throw new Error(`Unsupported HTTP method: ${options.method}`);
213
+ }
214
+ }
215
+ buildPath(base, ...segments) {
216
+ const parts = [base];
217
+ for (const segment of segments) {
218
+ if (segment !== void 0) {
219
+ parts.push(segment);
220
+ }
221
+ }
222
+ return parts.join("/");
223
+ }
224
+ async paginate(path, params, options) {
225
+ return this.client.get(path, params, options);
226
+ }
227
+ };
228
+
229
+ // src/resources/auth.ts
230
+ var AuthResource = class extends BaseResource {
231
+ constructor() {
232
+ super(...arguments);
233
+ this.basePath = "auth";
234
+ }
235
+ async registerOwner(data, options) {
236
+ return this.client.post(`${this.basePath}/register/owner`, data, options);
237
+ }
238
+ async login(data, options) {
239
+ return this.client.post(`${this.basePath}/login`, data, options);
240
+ }
241
+ async refreshToken(options) {
242
+ return this.client.post(`${this.basePath}/refresh`, void 0, options);
243
+ }
244
+ async verifyEmail(data, options) {
245
+ return this.client.post(`${this.basePath}/verify-email`, data, options);
246
+ }
247
+ async resendVerification(data, options) {
248
+ console.log("the path", `${this.basePath}/resend-verification`);
249
+ return this.client.post(`${this.basePath}/resend-verification`, data, options);
250
+ }
251
+ async getSubscriptionPlans(options) {
252
+ return this.client.get(`${this.basePath}/subscription-plans`, options);
253
+ }
254
+ async validateInvitation(token, options) {
255
+ return this.client.get(`${this.basePath}/invitation/${token}`, options);
256
+ }
257
+ async registerCollaborator(data, options) {
258
+ return this.client.post(
259
+ `${this.basePath}/register/collaborator`,
260
+ data,
261
+ options
262
+ );
263
+ }
264
+ async getCurrentSession(options) {
265
+ return this.client.get(`${this.basePath}/current-session`, options);
266
+ }
267
+ async changePassword(data, options) {
268
+ return this.client.post(
269
+ `${this.basePath}/change-password`,
270
+ data,
271
+ options
272
+ );
273
+ }
274
+ async requestPasswordReset(data, options) {
275
+ return this.client.post(
276
+ `${this.basePath}/password-reset/request`,
277
+ data,
278
+ options
279
+ );
280
+ }
281
+ async verifyResetCode(data, options) {
282
+ return this.client.post(
283
+ `${this.basePath}/password-reset/verify-code`,
284
+ data,
285
+ options
286
+ );
287
+ }
288
+ async resetPassword(data, options) {
289
+ return this.client.post(
290
+ `${this.basePath}/password-reset/reset`,
291
+ data,
292
+ options
293
+ );
294
+ }
295
+ async resendResetCode(data, options) {
296
+ return this.client.post(
297
+ `${this.basePath}/password-reset/resend-code`,
298
+ data,
299
+ options
300
+ );
301
+ }
302
+ };
303
+
304
+ // src/resources/organizations.ts
305
+ var OrganizationsResource = class extends BaseResource {
306
+ constructor() {
307
+ super(...arguments);
308
+ this.basePath = "organizations";
309
+ }
310
+ async getOrganization(id, options) {
311
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
312
+ }
313
+ async updateOrganization(id, data, options) {
314
+ return this.client.put(`${this.basePath}/${id}`, data, options);
315
+ }
316
+ async getOrganizationStats(id, options) {
317
+ return this.client.get(`${this.basePath}/${id}/stats`, void 0, options);
318
+ }
319
+ };
320
+
321
+ // src/resources/gyms.ts
322
+ var GymsResource = class extends BaseResource {
323
+ constructor() {
324
+ super(...arguments);
325
+ this.basePath = "gyms";
326
+ }
327
+ async createGym(data, options) {
328
+ return this.client.post(
329
+ this.basePath,
330
+ data,
331
+ options
332
+ );
333
+ }
334
+ async getOrganizationGyms(options) {
335
+ return this.client.get(
336
+ this.basePath,
337
+ void 0,
338
+ options
339
+ );
340
+ }
341
+ async getGym(id, options) {
342
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
343
+ }
344
+ async updateGym(id, data, options) {
345
+ return this.client.put(`${this.basePath}/${id}`, data, options);
346
+ }
347
+ async getGymStats(id, options) {
348
+ return this.client.get(`${this.basePath}/${id}/stats`, void 0, options);
349
+ }
350
+ async toggleGymStatus(id, options) {
351
+ return this.client.put(`${this.basePath}/${id}/toggle-status`, void 0, options);
352
+ }
353
+ async updateCurrentGym(data, options) {
354
+ return this.client.put(`${this.basePath}/current`, data, options);
355
+ }
356
+ };
357
+
358
+ // src/resources/clients.ts
359
+ var ClientsResource = class extends BaseResource {
360
+ constructor() {
361
+ super(...arguments);
362
+ this.basePath = "clients";
363
+ }
364
+ async createClient(data, options) {
365
+ return this.client.post(this.basePath, data, options);
366
+ }
367
+ async searchClients(params, options) {
368
+ return this.paginate(this.basePath, params, options);
369
+ }
370
+ async getClient(id, options) {
371
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
372
+ }
373
+ async updateClient(id, data, options) {
374
+ return this.client.put(`${this.basePath}/${id}`, data, options);
375
+ }
376
+ async toggleClientStatus(id, options) {
377
+ return this.client.put(`${this.basePath}/${id}/toggle-status`, void 0, options);
378
+ }
379
+ async getClientStats(id, options) {
380
+ return this.client.get(`${this.basePath}/${id}/stats`, void 0, options);
381
+ }
382
+ async searchClientsForCheckIn(params, options) {
383
+ return this.client.get(
384
+ `${this.basePath}/search/check-in`,
385
+ params,
386
+ options
387
+ );
388
+ }
389
+ };
390
+
391
+ // src/resources/membership-plans.ts
392
+ var MembershipPlansResource = class extends BaseResource {
393
+ constructor() {
394
+ super(...arguments);
395
+ this.basePath = "membership-plans";
396
+ }
397
+ async createMembershipPlan(data, options) {
398
+ return this.client.post(this.basePath, data, options);
399
+ }
400
+ async getGymMembershipPlans(params, options) {
401
+ return this.client.get(this.basePath, params, options);
402
+ }
403
+ async getMembershipPlan(id, options) {
404
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
405
+ }
406
+ async updateMembershipPlan(id, data, options) {
407
+ return this.client.put(`${this.basePath}/${id}`, data, options);
408
+ }
409
+ async deleteMembershipPlan(id, options) {
410
+ return this.client.delete(`${this.basePath}/${id}`, options);
411
+ }
412
+ async getMembershipPlanStats(id, options) {
413
+ return this.client.get(
414
+ `${this.basePath}/${id}/stats`,
415
+ void 0,
416
+ options
417
+ );
418
+ }
419
+ };
420
+
421
+ // src/resources/contracts.ts
422
+ var ContractsResource = class extends BaseResource {
423
+ constructor() {
424
+ super(...arguments);
425
+ this.basePath = "contracts";
426
+ }
427
+ async createContract(data, options) {
428
+ return this.client.post(this.basePath, data, options);
429
+ }
430
+ async getGymContracts(params, options) {
431
+ return this.paginate(this.basePath, params, options);
432
+ }
433
+ async getContract(id, options) {
434
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
435
+ }
436
+ async getClientContracts(clientId, options) {
437
+ return this.client.get(
438
+ `${this.basePath}/client/${clientId}`,
439
+ void 0,
440
+ options
441
+ );
442
+ }
443
+ async renewContract(id, data, options) {
444
+ return this.client.post(`${this.basePath}/${id}/renew`, data, options);
445
+ }
446
+ async freezeContract(id, data, options) {
447
+ return this.client.post(`${this.basePath}/${id}/freeze`, data, options);
448
+ }
449
+ async cancelContract(id, data, options) {
450
+ return this.client.put(`${this.basePath}/${id}/cancel`, data, options);
451
+ }
452
+ };
453
+
454
+ // src/resources/dashboard.ts
455
+ var DashboardResource = class extends BaseResource {
456
+ /**
457
+ * Get dashboard statistics
458
+ * @returns Dashboard statistics including clients, contracts, revenue, and check-ins
459
+ */
460
+ async getStats() {
461
+ return this.client.get("/dashboard/stats");
462
+ }
463
+ /**
464
+ * Get recent activity
465
+ * @param limit Maximum number of activities to return (default: 10)
466
+ * @returns List of recent activities in the gym
467
+ */
468
+ async getRecentActivity(limit = 10) {
469
+ return this.client.get("/dashboard/recent-activity", { limit });
470
+ }
471
+ /**
472
+ * Get expiring contracts
473
+ * @param limit Maximum number of contracts to return (default: 10)
474
+ * @returns List of contracts expiring in the next 30 days
475
+ */
476
+ async getExpiringContracts(limit = 10) {
477
+ return this.client.get("/dashboard/expiring-contracts", { limit });
478
+ }
479
+ };
480
+
481
+ // src/resources/evaluations.ts
482
+ var EvaluationsResource = class extends BaseResource {
483
+ constructor() {
484
+ super(...arguments);
485
+ this.basePath = "evaluations";
486
+ }
487
+ async createEvaluation(data, options) {
488
+ return this.client.post(this.basePath, data, options);
489
+ }
490
+ async getEvaluation(id, options) {
491
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
492
+ }
493
+ async updateEvaluation(id, data, options) {
494
+ return this.client.put(`${this.basePath}/${id}`, data, options);
495
+ }
496
+ async deleteEvaluation(id, options) {
497
+ return this.client.delete(`${this.basePath}/${id}`, options);
498
+ }
499
+ async getClientEvaluations(clientId, params, options) {
500
+ return this.paginate(
501
+ `${this.basePath}/client/${clientId}`,
502
+ params,
503
+ options
504
+ );
505
+ }
506
+ async getGymEvaluationStats(options) {
507
+ return this.client.get(`${this.basePath}/gym/stats`, void 0, options);
508
+ }
509
+ async generateEvaluationReport(id, options) {
510
+ return this.client.get(
511
+ `${this.basePath}/${id}/report`,
512
+ void 0,
513
+ options
514
+ );
515
+ }
516
+ };
517
+
518
+ // src/resources/check-ins.ts
519
+ var CheckInsResource = class extends BaseResource {
520
+ constructor() {
521
+ super(...arguments);
522
+ this.basePath = "check-ins";
523
+ }
524
+ async createCheckIn(data, options) {
525
+ return this.client.post(this.basePath, data, options);
526
+ }
527
+ async searchCheckIns(params, options) {
528
+ return this.client.get(this.basePath, params, options);
529
+ }
530
+ async getCurrentlyInGym(options) {
531
+ return this.client.get(`${this.basePath}/current`, void 0, options);
532
+ }
533
+ async getCheckIn(id, options) {
534
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
535
+ }
536
+ async deleteCheckIn(id, options) {
537
+ return this.client.delete(`${this.basePath}/${id}`, options);
538
+ }
539
+ async getGymCheckInStats(params, options) {
540
+ return this.client.get(
541
+ `${this.basePath}/stats/${params.period}`,
542
+ void 0,
543
+ options
544
+ );
545
+ }
546
+ async getClientCheckInHistory(clientId, params, options) {
547
+ return this.client.get(
548
+ `${this.basePath}/client/${clientId}/history`,
549
+ params,
550
+ options
551
+ );
552
+ }
553
+ };
554
+
555
+ // src/resources/invitations.ts
556
+ var InvitationsResource = class extends BaseResource {
557
+ constructor() {
558
+ super(...arguments);
559
+ this.basePath = "invitations";
560
+ }
561
+ async createInvitation(data, options) {
562
+ return this.client.post(this.basePath, data, options);
563
+ }
564
+ async getGymInvitations(params, options) {
565
+ return this.client.get(this.basePath, params, options);
566
+ }
567
+ async acceptInvitation(token, data, options) {
568
+ return this.client.post(`${this.basePath}/${token}/accept`, data, options);
569
+ }
570
+ async cancelInvitation(id, options) {
571
+ return this.client.put(`${this.basePath}/${id}/cancel`, void 0, options);
572
+ }
573
+ };
574
+
575
+ // src/resources/leads.ts
576
+ var LeadsResource = class extends BaseResource {
577
+ constructor() {
578
+ super(...arguments);
579
+ this.basePath = "leads";
580
+ }
581
+ async createLead(data, options) {
582
+ return this.client.post(this.basePath, data, options);
583
+ }
584
+ async searchLeads(params, options) {
585
+ return this.paginate(this.basePath, params, options);
586
+ }
587
+ async getLead(id, options) {
588
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
589
+ }
590
+ async updateLead(id, data, options) {
591
+ return this.client.put(`${this.basePath}/${id}`, data, options);
592
+ }
593
+ async getLeadStats(options) {
594
+ return this.client.get(`${this.basePath}/stats/gym`, void 0, options);
595
+ }
596
+ async convertLead(id, options) {
597
+ return this.client.post(
598
+ `${this.basePath}/${id}/convert`,
599
+ void 0,
600
+ options
601
+ );
602
+ }
603
+ };
604
+
605
+ // src/resources/assets.ts
606
+ var AssetsResource = class extends BaseResource {
607
+ /**
608
+ * Upload a new asset
609
+ */
610
+ async upload(data) {
611
+ const formData = new FormData();
612
+ formData.append("file", data.file);
613
+ if (data.description) {
614
+ formData.append("description", data.description);
615
+ }
616
+ if (data.metadata) {
617
+ formData.append("metadata", JSON.stringify(data.metadata));
618
+ }
619
+ return await this.client.post("/assets/upload", formData, {
620
+ headers: {
621
+ "Content-Type": "multipart/form-data"
622
+ }
623
+ });
624
+ }
625
+ /**
626
+ * Get a single asset by ID
627
+ */
628
+ async findOne(id) {
629
+ return await this.client.get(`/assets/${id}`);
630
+ }
631
+ /**
632
+ * Get multiple assets by IDs
633
+ */
634
+ async findByIds(ids) {
635
+ if (!ids || ids.length === 0) {
636
+ return [];
637
+ }
638
+ return await this.client.get("/assets/by-ids", {
639
+ ids: ids.join(",")
640
+ });
641
+ }
642
+ /**
643
+ * Get all assets for the current gym
644
+ */
645
+ async findAll() {
646
+ return await this.client.get("/assets");
647
+ }
648
+ /**
649
+ * Delete an asset
650
+ */
651
+ async delete(id) {
652
+ await this.client.delete(`/assets/${id}`);
653
+ }
654
+ /**
655
+ * Get a signed download URL for an asset
656
+ */
657
+ async getDownloadUrl(id) {
658
+ return await this.client.get(`/assets/${id}/download-url`);
659
+ }
660
+ /**
661
+ * Download an asset as a blob
662
+ */
663
+ async download(id) {
664
+ const response = await this.client.get(`/assets/${id}/download`, {
665
+ responseType: "arraybuffer"
666
+ });
667
+ return new Blob([response]);
668
+ }
669
+ /**
670
+ * Get the render URL for an asset (for inline display)
671
+ * This returns the URL directly without making an API call
672
+ */
673
+ getRenderUrl(id) {
674
+ return `${this.client.getBaseUrl()}/assets/${id}/render`;
675
+ }
676
+ /**
677
+ * Get asset blob for rendering/preview
678
+ */
679
+ async render(id) {
680
+ const response = await this.client.get(`/assets/${id}/render`, {
681
+ responseType: "arraybuffer"
682
+ });
683
+ return new Blob([response]);
684
+ }
685
+ };
686
+
687
+ // src/resources/files.ts
688
+ var FilesResource = class extends BaseResource {
689
+ /**
690
+ * Upload a new file
691
+ */
692
+ async upload(data) {
693
+ const formData = new FormData();
694
+ formData.append("file", data.file);
695
+ if (data.description) {
696
+ formData.append("description", data.description);
697
+ }
698
+ if (data.metadata) {
699
+ formData.append("metadata", JSON.stringify(data.metadata));
700
+ }
701
+ return await this.client.post("/files/upload", formData, {
702
+ headers: {
703
+ "Content-Type": "multipart/form-data"
704
+ }
705
+ });
706
+ }
707
+ /**
708
+ * Get all files for the current user
709
+ */
710
+ async findAll() {
711
+ return await this.client.get("/files");
712
+ }
713
+ /**
714
+ * Get a single file by ID
715
+ */
716
+ async findOne(id) {
717
+ return await this.client.get(`/files/${id}`);
718
+ }
719
+ /**
720
+ * Get multiple files by IDs
721
+ */
722
+ async findByIds(ids) {
723
+ if (!ids || ids.length === 0) {
724
+ return [];
725
+ }
726
+ return await this.client.get("/files/by-ids", {
727
+ ids: ids.join(",")
728
+ });
729
+ }
730
+ /**
731
+ * Delete a file
732
+ */
733
+ async delete(id) {
734
+ await this.client.delete(`/files/${id}`);
735
+ }
736
+ /**
737
+ * Download a file as a blob
738
+ */
739
+ async download(id) {
740
+ const response = await this.client.get(`/files/${id}/download`, {
741
+ responseType: "arraybuffer"
742
+ });
743
+ return new Blob([response]);
744
+ }
745
+ /**
746
+ * Get the render URL for a file (for inline display)
747
+ * This returns the URL directly without making an API call
748
+ */
749
+ getRenderUrl(id) {
750
+ return `${this.client.getBaseUrl()}/files/${id}/render`;
751
+ }
752
+ /**
753
+ * Get file blob for rendering/preview
754
+ */
755
+ async render(id) {
756
+ const response = await this.client.get(`/files/${id}/render`, {
757
+ responseType: "arraybuffer"
758
+ });
759
+ return new Blob([response]);
760
+ }
761
+ };
762
+
763
+ // src/resources/public-catalog.ts
764
+ var PublicCatalogResource = class extends BaseResource {
765
+ constructor() {
766
+ super(...arguments);
767
+ this.basePath = "catalog";
768
+ }
769
+ async searchCatalog(params, options) {
770
+ return this.paginate(`${this.basePath}/search`, params, options);
771
+ }
772
+ async getFeaturedGyms(params, options) {
773
+ return this.client.get(`${this.basePath}/featured`, params, options);
774
+ }
775
+ async getCitiesWithGyms(options) {
776
+ return this.client.get(`${this.basePath}/cities`, void 0, options);
777
+ }
778
+ async getGymBySlug(slug, options) {
779
+ return this.client.get(`${this.basePath}/${slug}`, void 0, options);
780
+ }
781
+ };
782
+
783
+ // src/resources/health.ts
784
+ var HealthResource = class extends BaseResource {
785
+ constructor() {
786
+ super(...arguments);
787
+ this.basePath = "health";
788
+ }
789
+ async health(options) {
790
+ return this.client.get(this.basePath, void 0, options);
791
+ }
792
+ async ready(options) {
793
+ return this.client.get(`${this.basePath}/ready`, void 0, options);
794
+ }
795
+ };
796
+
797
+ // src/resources/onboarding.ts
798
+ var OnboardingResource = class extends BaseResource {
799
+ /**
800
+ * Creates owner account, organization, and initial gym
801
+ * Now also sends verification and organization codes via email
802
+ */
803
+ async start(data) {
804
+ const response = await this.client.post("/onboarding/start", data);
805
+ if (response.access_token && response.refresh_token) {
806
+ this.client.setTokens(response.access_token, response.refresh_token);
807
+ }
808
+ return response;
809
+ }
810
+ /**
811
+ * Updates basic gym settings (step 2 of onboarding)
812
+ * Configure basic gym information like name, address, etc.
813
+ */
814
+ async updateGymSettings(data) {
815
+ return this.client.put("/onboarding/gym-settings", data);
816
+ }
817
+ /**
818
+ * Configure gym features (step 3 of onboarding)
819
+ * Enable/disable various management features
820
+ */
821
+ async configureFeatures(data) {
822
+ return this.client.put("/onboarding/configure-features", data);
823
+ }
824
+ /**
825
+ * Mark onboarding as complete
826
+ */
827
+ async completeSetup(data) {
828
+ return this.client.post("/onboarding/complete", data);
829
+ }
830
+ /**
831
+ * Get current onboarding status
832
+ * Check progress and next steps
833
+ */
834
+ async getStatus(gymId) {
835
+ return this.client.get(`/onboarding/status/${gymId}`);
836
+ }
837
+ };
838
+
839
+ // src/resources/products.ts
840
+ var ProductsResource = class extends BaseResource {
841
+ constructor() {
842
+ super(...arguments);
843
+ this.basePath = "products";
844
+ }
845
+ // Product Category Methods
846
+ async createCategory(data, options) {
847
+ return this.client.post(`${this.basePath}/categories`, data, options);
848
+ }
849
+ async getCategories(options) {
850
+ return this.client.get(`${this.basePath}/categories`, void 0, options);
851
+ }
852
+ async updateCategory(id, data, options) {
853
+ return this.client.put(`${this.basePath}/categories/${id}`, data, options);
854
+ }
855
+ async deleteCategory(id, options) {
856
+ return this.client.delete(`${this.basePath}/categories/${id}`, options);
857
+ }
858
+ // Product Methods
859
+ async createProduct(data, options) {
860
+ return this.client.post(this.basePath, data, options);
861
+ }
862
+ async searchProducts(params, options) {
863
+ return this.paginate(this.basePath, params, options);
864
+ }
865
+ async getProduct(id, options) {
866
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
867
+ }
868
+ async updateProduct(id, data, options) {
869
+ return this.client.put(`${this.basePath}/${id}`, data, options);
870
+ }
871
+ async deleteProduct(id, options) {
872
+ return this.client.delete(`${this.basePath}/${id}`, options);
873
+ }
874
+ async toggleProductStatus(id, options) {
875
+ return this.client.patch(`${this.basePath}/${id}/toggle-status`, void 0, options);
876
+ }
877
+ async updateStock(id, data, options) {
878
+ return this.client.patch(`${this.basePath}/${id}/stock`, data, options);
879
+ }
880
+ async getLowStockProducts(threshold = 10, options) {
881
+ return this.client.get(
882
+ `${this.basePath}/low-stock`,
883
+ { threshold },
884
+ options
885
+ );
886
+ }
887
+ };
888
+
889
+ // src/resources/sales.ts
890
+ var SalesResource = class extends BaseResource {
891
+ constructor() {
892
+ super(...arguments);
893
+ this.basePath = "sales";
894
+ }
895
+ async createSale(data, options) {
896
+ return this.client.post(this.basePath, data, options);
897
+ }
898
+ async searchSales(params, options) {
899
+ return this.paginate(this.basePath, params, options);
900
+ }
901
+ async getSale(id, options) {
902
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
903
+ }
904
+ async updateSale(id, data, options) {
905
+ return this.client.put(`${this.basePath}/${id}`, data, options);
906
+ }
907
+ async updatePaymentStatus(id, data, options) {
908
+ return this.client.put(`${this.basePath}/${id}/payment-status`, data, options);
909
+ }
910
+ async deleteSale(id, options) {
911
+ return this.client.delete(`${this.basePath}/${id}`, options);
912
+ }
913
+ async getSalesStats(startDate, endDate, options) {
914
+ const params = {};
915
+ if (startDate) params.startDate = startDate;
916
+ if (endDate) params.endDate = endDate;
917
+ return this.client.get(
918
+ `${this.basePath}/stats`,
919
+ Object.keys(params).length > 0 ? params : void 0,
920
+ options
921
+ );
922
+ }
923
+ async getTopSellingProducts(limit = 10, startDate, endDate, options) {
924
+ const params = { limit };
925
+ if (startDate) params.startDate = startDate;
926
+ if (endDate) params.endDate = endDate;
927
+ return this.client.get(
928
+ `${this.basePath}/top-products`,
929
+ params,
930
+ options
931
+ );
932
+ }
933
+ };
934
+
935
+ // src/resources/suppliers.ts
936
+ var SuppliersResource = class extends BaseResource {
937
+ constructor() {
938
+ super(...arguments);
939
+ this.basePath = "suppliers";
940
+ }
941
+ async createSupplier(data, options) {
942
+ return this.client.post(this.basePath, data, options);
943
+ }
944
+ async searchSuppliers(params, options) {
945
+ return this.paginate(this.basePath, params, options);
946
+ }
947
+ async getSupplier(id, options) {
948
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
949
+ }
950
+ async updateSupplier(id, data, options) {
951
+ return this.client.put(`${this.basePath}/${id}`, data, options);
952
+ }
953
+ async deleteSupplier(id, options) {
954
+ return this.client.delete(`${this.basePath}/${id}`, options);
955
+ }
956
+ async getSuppliersStats(options) {
957
+ return this.client.get(`${this.basePath}/stats`, void 0, options);
958
+ }
959
+ };
960
+
961
+ // src/resources/users.ts
962
+ var UsersResource = class extends BaseResource {
963
+ /**
964
+ * Get the current user's profile
965
+ * @param options - Request options
966
+ * @returns User profile data
967
+ */
968
+ async getProfile(options) {
969
+ return this.client.get("/users/profile", void 0, options);
970
+ }
971
+ /**
972
+ * Update the current user's profile
973
+ * @param data - Profile update data
974
+ * @param options - Request options
975
+ * @returns Updated user profile
976
+ */
977
+ async updateProfile(data, options) {
978
+ return this.client.put("/users/profile", data, options);
979
+ }
980
+ };
981
+
982
+ // src/sdk.ts
983
+ var GymSpaceSdk = class {
984
+ constructor(config) {
985
+ this.client = new ApiClient(config);
986
+ this.auth = new AuthResource(this.client);
987
+ this.organizations = new OrganizationsResource(this.client);
988
+ this.gyms = new GymsResource(this.client);
989
+ this.clients = new ClientsResource(this.client);
990
+ this.membershipPlans = new MembershipPlansResource(this.client);
991
+ this.contracts = new ContractsResource(this.client);
992
+ this.dashboard = new DashboardResource(this.client);
993
+ this.evaluations = new EvaluationsResource(this.client);
994
+ this.checkIns = new CheckInsResource(this.client);
995
+ this.invitations = new InvitationsResource(this.client);
996
+ this.leads = new LeadsResource(this.client);
997
+ this.assets = new AssetsResource(this.client);
998
+ this.files = new FilesResource(this.client);
999
+ this.publicCatalog = new PublicCatalogResource(this.client);
1000
+ this.health = new HealthResource(this.client);
1001
+ this.onboarding = new OnboardingResource(this.client);
1002
+ this.products = new ProductsResource(this.client);
1003
+ this.sales = new SalesResource(this.client);
1004
+ this.suppliers = new SuppliersResource(this.client);
1005
+ this.users = new UsersResource(this.client);
1006
+ }
1007
+ /**
1008
+ * Set the authentication token
1009
+ */
1010
+ setAuthToken(token) {
1011
+ this.client.setAuthToken(token);
1012
+ }
1013
+ /**
1014
+ * Set the current gym context
1015
+ */
1016
+ setGymId(gymId) {
1017
+ this.client.setGymId(gymId);
1018
+ }
1019
+ /**
1020
+ * Clear authentication
1021
+ */
1022
+ clearAuth() {
1023
+ this.client.clearAuth();
1024
+ }
1025
+ /**
1026
+ * Get the underlying API client
1027
+ */
1028
+ getClient() {
1029
+ return this.client;
1030
+ }
1031
+ };
1032
+
1033
+ // node_modules/@gymspace/shared/dist/index.mjs
1034
+ var UserType = /* @__PURE__ */ ((UserType2) => {
1035
+ UserType2["OWNER"] = "owner";
1036
+ UserType2["COLLABORATOR"] = "collaborator";
1037
+ return UserType2;
1038
+ })(UserType || {});
1039
+ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
1040
+ SubscriptionStatus2["ACTIVE"] = "active";
1041
+ SubscriptionStatus2["INACTIVE"] = "inactive";
1042
+ SubscriptionStatus2["EXPIRED"] = "expired";
1043
+ return SubscriptionStatus2;
1044
+ })(SubscriptionStatus || {});
1045
+ var CollaboratorStatus = /* @__PURE__ */ ((CollaboratorStatus2) => {
1046
+ CollaboratorStatus2["PENDING"] = "pending";
1047
+ CollaboratorStatus2["ACTIVE"] = "active";
1048
+ CollaboratorStatus2["INACTIVE"] = "inactive";
1049
+ return CollaboratorStatus2;
1050
+ })(CollaboratorStatus || {});
1051
+ var InvitationStatus = /* @__PURE__ */ ((InvitationStatus2) => {
1052
+ InvitationStatus2["PENDING"] = "pending";
1053
+ InvitationStatus2["ACCEPTED"] = "accepted";
1054
+ InvitationStatus2["EXPIRED"] = "expired";
1055
+ return InvitationStatus2;
1056
+ })(InvitationStatus || {});
1057
+ var ClientStatus = /* @__PURE__ */ ((ClientStatus2) => {
1058
+ ClientStatus2["ACTIVE"] = "active";
1059
+ ClientStatus2["INACTIVE"] = "inactive";
1060
+ return ClientStatus2;
1061
+ })(ClientStatus || {});
1062
+ var PlanStatus = /* @__PURE__ */ ((PlanStatus2) => {
1063
+ PlanStatus2["ACTIVE"] = "active";
1064
+ PlanStatus2["INACTIVE"] = "inactive";
1065
+ PlanStatus2["ARCHIVED"] = "archived";
1066
+ return PlanStatus2;
1067
+ })(PlanStatus || {});
1068
+ var ContractStatus = /* @__PURE__ */ ((ContractStatus2) => {
1069
+ ContractStatus2["PENDING"] = "pending";
1070
+ ContractStatus2["ACTIVE"] = "active";
1071
+ ContractStatus2["EXPIRING_SOON"] = "expiring_soon";
1072
+ ContractStatus2["EXPIRED"] = "expired";
1073
+ ContractStatus2["CANCELLED"] = "cancelled";
1074
+ return ContractStatus2;
1075
+ })(ContractStatus || {});
1076
+ var PaymentFrequency = /* @__PURE__ */ ((PaymentFrequency2) => {
1077
+ PaymentFrequency2["MONTHLY"] = "monthly";
1078
+ PaymentFrequency2["QUARTERLY"] = "quarterly";
1079
+ PaymentFrequency2["ANNUAL"] = "annual";
1080
+ return PaymentFrequency2;
1081
+ })(PaymentFrequency || {});
1082
+ var AssetStatus = /* @__PURE__ */ ((AssetStatus2) => {
1083
+ AssetStatus2["ACTIVE"] = "active";
1084
+ AssetStatus2["DELETED"] = "deleted";
1085
+ return AssetStatus2;
1086
+ })(AssetStatus || {});
1087
+ var EvaluationType = /* @__PURE__ */ ((EvaluationType2) => {
1088
+ EvaluationType2["INITIAL"] = "initial";
1089
+ EvaluationType2["PROGRESS"] = "progress";
1090
+ EvaluationType2["FINAL"] = "final";
1091
+ return EvaluationType2;
1092
+ })(EvaluationType || {});
1093
+ var EvaluationStatus = /* @__PURE__ */ ((EvaluationStatus2) => {
1094
+ EvaluationStatus2["OPEN"] = "open";
1095
+ EvaluationStatus2["IN_PROGRESS"] = "in_progress";
1096
+ EvaluationStatus2["COMPLETED"] = "completed";
1097
+ EvaluationStatus2["CANCELLED"] = "cancelled";
1098
+ return EvaluationStatus2;
1099
+ })(EvaluationStatus || {});
1100
+ var CommentType = /* @__PURE__ */ ((CommentType2) => {
1101
+ CommentType2["PROGRESS_NOTE"] = "progress_note";
1102
+ CommentType2["PHONE_CALL"] = "phone_call";
1103
+ CommentType2["MEETING"] = "meeting";
1104
+ CommentType2["REMINDER"] = "reminder";
1105
+ CommentType2["OTHER"] = "other";
1106
+ return CommentType2;
1107
+ })(CommentType || {});
1108
+ var AssetCategory = /* @__PURE__ */ ((AssetCategory2) => {
1109
+ AssetCategory2["MEDICAL_DOCUMENT"] = "medical_document";
1110
+ AssetCategory2["IDENTIFICATION"] = "identification";
1111
+ AssetCategory2["INSURANCE"] = "insurance";
1112
+ AssetCategory2["CONTRACT_COPY"] = "contract_copy";
1113
+ AssetCategory2["OTHER"] = "other";
1114
+ return AssetCategory2;
1115
+ })(AssetCategory || {});
1116
+ var ContractAssetType = /* @__PURE__ */ ((ContractAssetType2) => {
1117
+ ContractAssetType2["PAYMENT_RECEIPT"] = "payment_receipt";
1118
+ ContractAssetType2["CONTRACT_DOCUMENT"] = "contract_document";
1119
+ ContractAssetType2["IDENTIFICATION"] = "identification";
1120
+ ContractAssetType2["OTHER"] = "other";
1121
+ return ContractAssetType2;
1122
+ })(ContractAssetType || {});
1123
+ var EvaluationAssetStage = /* @__PURE__ */ ((EvaluationAssetStage2) => {
1124
+ EvaluationAssetStage2["INITIAL"] = "initial";
1125
+ EvaluationAssetStage2["PROGRESS"] = "progress";
1126
+ EvaluationAssetStage2["FINAL"] = "final";
1127
+ return EvaluationAssetStage2;
1128
+ })(EvaluationAssetStage || {});
1129
+ var EvaluationAssetCategory = /* @__PURE__ */ ((EvaluationAssetCategory2) => {
1130
+ EvaluationAssetCategory2["BODY_PHOTO"] = "body_photo";
1131
+ EvaluationAssetCategory2["MEASUREMENT_PHOTO"] = "measurement_photo";
1132
+ EvaluationAssetCategory2["DOCUMENT"] = "document";
1133
+ EvaluationAssetCategory2["REPORT"] = "report";
1134
+ EvaluationAssetCategory2["OTHER"] = "other";
1135
+ return EvaluationAssetCategory2;
1136
+ })(EvaluationAssetCategory || {});
1137
+ var LeadStatus = /* @__PURE__ */ ((LeadStatus2) => {
1138
+ LeadStatus2["NEW"] = "NEW";
1139
+ LeadStatus2["CONTACTED"] = "CONTACTED";
1140
+ LeadStatus2["INTERESTED"] = "INTERESTED";
1141
+ LeadStatus2["CONVERTED"] = "CONVERTED";
1142
+ LeadStatus2["LOST"] = "LOST";
1143
+ return LeadStatus2;
1144
+ })(LeadStatus || {});
1145
+ var PERMISSIONS = {
1146
+ // Organizations
1147
+ ORGANIZATIONS_CREATE: "ORGANIZATIONS_CREATE",
1148
+ ORGANIZATIONS_READ: "ORGANIZATIONS_READ",
1149
+ ORGANIZATIONS_UPDATE: "ORGANIZATIONS_UPDATE",
1150
+ ORGANIZATIONS_DELETE: "ORGANIZATIONS_DELETE",
1151
+ // Gyms
1152
+ GYMS_CREATE: "GYMS_CREATE",
1153
+ GYMS_READ: "GYMS_READ",
1154
+ GYMS_UPDATE: "GYMS_UPDATE",
1155
+ GYMS_DELETE: "GYMS_DELETE",
1156
+ // Collaborators
1157
+ COLLABORATORS_CREATE: "COLLABORATORS_CREATE",
1158
+ COLLABORATORS_READ: "COLLABORATORS_READ",
1159
+ COLLABORATORS_UPDATE: "COLLABORATORS_UPDATE",
1160
+ COLLABORATORS_DELETE: "COLLABORATORS_DELETE",
1161
+ // Clients
1162
+ CLIENTS_CREATE: "CLIENTS_CREATE",
1163
+ CLIENTS_READ: "CLIENTS_READ",
1164
+ CLIENTS_UPDATE: "CLIENTS_UPDATE",
1165
+ CLIENTS_DELETE: "CLIENTS_DELETE",
1166
+ // Contracts
1167
+ CONTRACTS_CREATE: "CONTRACTS_CREATE",
1168
+ CONTRACTS_READ: "CONTRACTS_READ",
1169
+ CONTRACTS_UPDATE: "CONTRACTS_UPDATE",
1170
+ CONTRACTS_APPROVE: "CONTRACTS_APPROVE",
1171
+ CONTRACTS_CANCEL: "CONTRACTS_CANCEL",
1172
+ // Evaluations
1173
+ EVALUATIONS_CREATE: "EVALUATIONS_CREATE",
1174
+ EVALUATIONS_READ: "EVALUATIONS_READ",
1175
+ EVALUATIONS_UPDATE: "EVALUATIONS_UPDATE",
1176
+ EVALUATIONS_DELETE: "EVALUATIONS_DELETE",
1177
+ // Check-ins
1178
+ CHECKINS_CREATE: "CHECKINS_CREATE",
1179
+ CHECKINS_READ: "CHECKINS_READ",
1180
+ // Leads
1181
+ LEADS_CREATE: "LEADS_CREATE",
1182
+ LEADS_READ: "LEADS_READ",
1183
+ LEADS_UPDATE: "LEADS_UPDATE",
1184
+ LEADS_DELETE: "LEADS_DELETE",
1185
+ // Reports
1186
+ REPORTS_VIEW: "REPORTS_VIEW",
1187
+ REPORTS_FINANCIAL: "REPORTS_FINANCIAL",
1188
+ // Settings
1189
+ SETTINGS_UPDATE: "SETTINGS_UPDATE",
1190
+ // Assets
1191
+ ASSETS_CREATE: "ASSETS_CREATE",
1192
+ ASSETS_READ: "ASSETS_READ",
1193
+ ASSETS_DELETE: "ASSETS_DELETE",
1194
+ // Files
1195
+ FILES_CREATE: "FILES_CREATE",
1196
+ FILES_READ: "FILES_READ",
1197
+ FILES_DELETE: "FILES_DELETE",
1198
+ // Products
1199
+ PRODUCTS_CREATE: "PRODUCTS_CREATE",
1200
+ PRODUCTS_READ: "PRODUCTS_READ",
1201
+ PRODUCTS_UPDATE: "PRODUCTS_UPDATE",
1202
+ PRODUCTS_DELETE: "PRODUCTS_DELETE",
1203
+ // Product Categories
1204
+ PRODUCT_CATEGORIES_CREATE: "PRODUCT_CATEGORIES_CREATE",
1205
+ PRODUCT_CATEGORIES_READ: "PRODUCT_CATEGORIES_READ",
1206
+ PRODUCT_CATEGORIES_UPDATE: "PRODUCT_CATEGORIES_UPDATE",
1207
+ PRODUCT_CATEGORIES_DELETE: "PRODUCT_CATEGORIES_DELETE",
1208
+ // Sales
1209
+ SALES_CREATE: "SALES_CREATE",
1210
+ SALES_READ: "SALES_READ",
1211
+ SALES_UPDATE: "SALES_UPDATE",
1212
+ SALES_DELETE: "SALES_DELETE",
1213
+ // Suppliers
1214
+ SUPPLIERS_CREATE: "SUPPLIERS_CREATE",
1215
+ SUPPLIERS_READ: "SUPPLIERS_READ",
1216
+ SUPPLIERS_UPDATE: "SUPPLIERS_UPDATE",
1217
+ SUPPLIERS_DELETE: "SUPPLIERS_DELETE"
1218
+ };
1219
+ var ROLE_PERMISSIONS = {
1220
+ OWNER: Object.values(PERMISSIONS),
1221
+ MANAGER: [
1222
+ PERMISSIONS.GYMS_READ,
1223
+ PERMISSIONS.COLLABORATORS_READ,
1224
+ PERMISSIONS.CLIENTS_CREATE,
1225
+ PERMISSIONS.CLIENTS_READ,
1226
+ PERMISSIONS.CLIENTS_UPDATE,
1227
+ PERMISSIONS.CONTRACTS_CREATE,
1228
+ PERMISSIONS.CONTRACTS_READ,
1229
+ PERMISSIONS.EVALUATIONS_CREATE,
1230
+ PERMISSIONS.EVALUATIONS_READ,
1231
+ PERMISSIONS.EVALUATIONS_UPDATE,
1232
+ PERMISSIONS.CHECKINS_CREATE,
1233
+ PERMISSIONS.CHECKINS_READ,
1234
+ PERMISSIONS.REPORTS_VIEW,
1235
+ PERMISSIONS.ASSETS_CREATE,
1236
+ PERMISSIONS.ASSETS_READ,
1237
+ PERMISSIONS.ASSETS_DELETE,
1238
+ PERMISSIONS.FILES_CREATE,
1239
+ PERMISSIONS.FILES_READ,
1240
+ PERMISSIONS.FILES_DELETE,
1241
+ PERMISSIONS.PRODUCTS_CREATE,
1242
+ PERMISSIONS.PRODUCTS_READ,
1243
+ PERMISSIONS.PRODUCTS_UPDATE,
1244
+ PERMISSIONS.PRODUCTS_DELETE,
1245
+ PERMISSIONS.PRODUCT_CATEGORIES_CREATE,
1246
+ PERMISSIONS.PRODUCT_CATEGORIES_READ,
1247
+ PERMISSIONS.PRODUCT_CATEGORIES_UPDATE,
1248
+ PERMISSIONS.PRODUCT_CATEGORIES_DELETE,
1249
+ PERMISSIONS.SALES_CREATE,
1250
+ PERMISSIONS.SALES_READ,
1251
+ PERMISSIONS.SALES_UPDATE,
1252
+ PERMISSIONS.SUPPLIERS_CREATE,
1253
+ PERMISSIONS.SUPPLIERS_READ,
1254
+ PERMISSIONS.SUPPLIERS_UPDATE,
1255
+ PERMISSIONS.SUPPLIERS_DELETE
1256
+ ],
1257
+ STAFF: [
1258
+ PERMISSIONS.CLIENTS_READ,
1259
+ PERMISSIONS.CHECKINS_CREATE,
1260
+ PERMISSIONS.CHECKINS_READ,
1261
+ PERMISSIONS.PRODUCTS_READ,
1262
+ PERMISSIONS.PRODUCT_CATEGORIES_READ,
1263
+ PERMISSIONS.SALES_CREATE,
1264
+ PERMISSIONS.SALES_READ
1265
+ ],
1266
+ ADVISOR: [
1267
+ PERMISSIONS.CLIENTS_READ,
1268
+ PERMISSIONS.EVALUATIONS_CREATE,
1269
+ PERMISSIONS.EVALUATIONS_READ,
1270
+ PERMISSIONS.EVALUATIONS_UPDATE,
1271
+ PERMISSIONS.ASSETS_CREATE,
1272
+ PERMISSIONS.ASSETS_READ,
1273
+ PERMISSIONS.FILES_CREATE,
1274
+ PERMISSIONS.FILES_READ
1275
+ ]
1276
+ };
1277
+ var CACHE_TTL = {
1278
+ USER_PERMISSIONS: 900,
1279
+ // 15 minutes
1280
+ GYM_DATA: 1800,
1281
+ // 30 minutes
1282
+ STATIC_DATA: 3600,
1283
+ // 60 minutes
1284
+ REPORTS: 300
1285
+ // 5 minutes
1286
+ };
1287
+ var FILE_LIMITS = {
1288
+ MAX_FILE_SIZE: 10 * 1024 * 1024,
1289
+ // 10MB
1290
+ MAX_IMAGE_SIZE: 5 * 1024 * 1024,
1291
+ // 5MB
1292
+ MAX_DOCUMENT_SIZE: 10 * 1024 * 1024
1293
+ // 10MB
1294
+ };
1295
+ var PAGINATION_DEFAULTS = {
1296
+ PAGE: 1,
1297
+ LIMIT: 20,
1298
+ MAX_LIMIT: 100
1299
+ };
1300
+ var DATE_FORMATS = {
1301
+ DATE_ONLY: "YYYY-MM-DD",
1302
+ DATETIME: "YYYY-MM-DD HH:mm:ss",
1303
+ TIME_ONLY: "HH:mm:ss"
1304
+ };
1305
+ var HEADERS = {
1306
+ GYM_ID: "X-Gym-Id",
1307
+ REQUEST_ID: "X-Request-Id"
1308
+ };
1309
+
1310
+ // src/models/onboarding.ts
1311
+ var OnboardingStep = /* @__PURE__ */ ((OnboardingStep2) => {
1312
+ OnboardingStep2["ACCOUNT_CREATED"] = "account_created";
1313
+ OnboardingStep2["GYM_SETTINGS"] = "gym_settings";
1314
+ OnboardingStep2["FEATURES_CONFIGURED"] = "features_configured";
1315
+ OnboardingStep2["COMPLETED"] = "completed";
1316
+ return OnboardingStep2;
1317
+ })(OnboardingStep || {});
1318
+
1319
+ export { ApiClient, AssetCategory, AssetStatus, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, CACHE_TTL, CheckInsResource, ClientStatus, ClientsResource, CollaboratorStatus, CommentType, ContractAssetType, ContractStatus, ContractsResource, DATE_FORMATS, DashboardResource, EvaluationAssetCategory, EvaluationAssetStage, EvaluationStatus, EvaluationType, EvaluationsResource, FILE_LIMITS, FilesResource, GymSpaceError, GymSpaceSdk, GymsResource, HEADERS, HealthResource, InvitationStatus, InvitationsResource, LeadStatus, LeadsResource, MembershipPlansResource, NetworkError, NotFoundError, OnboardingResource, OnboardingStep, OrganizationsResource, PAGINATION_DEFAULTS, PERMISSIONS, PaymentFrequency, PlanStatus, ProductsResource, PublicCatalogResource, ROLE_PERMISSIONS, SalesResource, SubscriptionStatus, SuppliersResource, UserType, UsersResource, ValidationError };
1320
+ //# sourceMappingURL=index.mjs.map
1321
+ //# sourceMappingURL=index.mjs.map