@gymspace/sdk 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +176 -8
- package/dist/index.d.ts +176 -8
- package/dist/index.js +64 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +63 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/models/auth.ts +18 -2
- package/src/models/collaborators.ts +84 -0
- package/src/models/index.ts +2 -0
- package/src/models/invitations.ts +20 -3
- package/src/models/roles.ts +27 -0
- package/src/resources/collaborators.ts +68 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/invitations.ts +14 -7
- package/src/resources/roles.ts +28 -0
- package/src/sdk.ts +6 -0
package/dist/index.mjs
CHANGED
|
@@ -365,6 +365,61 @@ var GymsResource = class extends BaseResource {
|
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
367
|
|
|
368
|
+
// src/resources/collaborators.ts
|
|
369
|
+
var CollaboratorsResource = class extends BaseResource {
|
|
370
|
+
constructor() {
|
|
371
|
+
super(...arguments);
|
|
372
|
+
this.basePath = "collaborators";
|
|
373
|
+
}
|
|
374
|
+
async list(params, options) {
|
|
375
|
+
return this.paginate(this.basePath, params, options);
|
|
376
|
+
}
|
|
377
|
+
async get(id, options) {
|
|
378
|
+
return this.client.get(`${this.basePath}/${id}`, void 0, options);
|
|
379
|
+
}
|
|
380
|
+
async update(id, data, options) {
|
|
381
|
+
return this.client.patch(`${this.basePath}/${id}`, data, options);
|
|
382
|
+
}
|
|
383
|
+
async updateRole(id, roleId, options) {
|
|
384
|
+
return this.client.patch(`${this.basePath}/${id}/role`, { roleId }, options);
|
|
385
|
+
}
|
|
386
|
+
async updateStatus(id, status, options) {
|
|
387
|
+
return this.client.patch(`${this.basePath}/${id}/status`, { status }, options);
|
|
388
|
+
}
|
|
389
|
+
async getActivity(id, params, options) {
|
|
390
|
+
return this.client.get(`${this.basePath}/${id}/activity`, params, options);
|
|
391
|
+
}
|
|
392
|
+
async getStats(id, params, options) {
|
|
393
|
+
return this.client.get(`${this.basePath}/${id}/stats`, params, options);
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
// src/resources/roles.ts
|
|
398
|
+
var RolesResource = class extends BaseResource {
|
|
399
|
+
constructor() {
|
|
400
|
+
super(...arguments);
|
|
401
|
+
this.basePath = "roles";
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Get all roles of the organization (without pagination)
|
|
405
|
+
*/
|
|
406
|
+
async getRoles(options) {
|
|
407
|
+
return this.client.get(this.basePath, void 0, options);
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Get a specific role by ID
|
|
411
|
+
*/
|
|
412
|
+
async getRole(id, options) {
|
|
413
|
+
return this.client.get(`${this.basePath}/${id}`, void 0, options);
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Get all available permissions organized by category
|
|
417
|
+
*/
|
|
418
|
+
async getAvailablePermissions(options) {
|
|
419
|
+
return this.client.get(`${this.basePath}/permissions`, void 0, options);
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
|
|
368
423
|
// src/resources/clients.ts
|
|
369
424
|
var ClientsResource = class extends BaseResource {
|
|
370
425
|
constructor() {
|
|
@@ -619,8 +674,11 @@ var InvitationsResource = class extends BaseResource {
|
|
|
619
674
|
async getGymInvitations(params, options) {
|
|
620
675
|
return this.client.get(this.basePath, params, options);
|
|
621
676
|
}
|
|
622
|
-
async
|
|
623
|
-
return this.client.post(`${this.basePath}
|
|
677
|
+
async validateByCode(data, options) {
|
|
678
|
+
return this.client.post(`${this.basePath}/validate-by-code`, data, options);
|
|
679
|
+
}
|
|
680
|
+
async acceptInvitation(data, options) {
|
|
681
|
+
return this.client.post(`${this.basePath}/accept`, data, options);
|
|
624
682
|
}
|
|
625
683
|
async cancelInvitation(id, options) {
|
|
626
684
|
return this.client.put(`${this.basePath}/${id}/cancel`, void 0, options);
|
|
@@ -1221,6 +1279,8 @@ var GymSpaceSdk = class {
|
|
|
1221
1279
|
this.auth = new AuthResource(this.client);
|
|
1222
1280
|
this.organizations = new OrganizationsResource(this.client);
|
|
1223
1281
|
this.gyms = new GymsResource(this.client);
|
|
1282
|
+
this.collaborators = new CollaboratorsResource(this.client);
|
|
1283
|
+
this.roles = new RolesResource(this.client);
|
|
1224
1284
|
this.clients = new ClientsResource(this.client);
|
|
1225
1285
|
this.membershipPlans = new MembershipPlansResource(this.client);
|
|
1226
1286
|
this.contracts = new ContractsResource(this.client);
|
|
@@ -1582,6 +1642,6 @@ var OnboardingStep = /* @__PURE__ */ ((OnboardingStep2) => {
|
|
|
1582
1642
|
return OnboardingStep2;
|
|
1583
1643
|
})(OnboardingStep || {});
|
|
1584
1644
|
|
|
1585
|
-
export { AdminSubscriptionManagementResource, 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, PaymentMethodsResource, PlanStatus, ProductsResource, PublicCatalogResource, ROLE_PERMISSIONS, SalesResource, SubscriptionPlansResource, SubscriptionStatus, SubscriptionsResource, SuppliersResource, UserType, UsersResource, ValidationError };
|
|
1645
|
+
export { AdminSubscriptionManagementResource, ApiClient, AssetCategory, AssetStatus, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, CACHE_TTL, CheckInsResource, ClientStatus, ClientsResource, CollaboratorStatus, CollaboratorsResource, 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, PaymentMethodsResource, PlanStatus, ProductsResource, PublicCatalogResource, ROLE_PERMISSIONS, RolesResource, SalesResource, SubscriptionPlansResource, SubscriptionStatus, SubscriptionsResource, SuppliersResource, UserType, UsersResource, ValidationError };
|
|
1586
1646
|
//# sourceMappingURL=index.mjs.map
|
|
1587
1647
|
//# sourceMappingURL=index.mjs.map
|