@gymspace/sdk 1.2.11 → 1.2.13
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/.tsbuildinfo +1 -1
- package/dist/index.d.mts +210 -3
- package/dist/index.d.ts +210 -3
- package/dist/index.js +104 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/models/bulk-messaging.ts +119 -0
- package/src/models/clients.ts +0 -1
- package/src/models/gyms.ts +39 -1
- package/src/models/index.ts +1 -0
- package/src/models/onboarding.ts +4 -3
- package/src/models/products.ts +8 -0
- package/src/resources/bulk-messaging.ts +83 -0
- package/src/resources/gyms.ts +65 -27
- package/src/resources/index.ts +2 -1
- package/src/resources/subscription-plans.ts +9 -1
- package/src/sdk.ts +3 -0
package/dist/index.mjs
CHANGED
|
@@ -373,18 +373,10 @@ var GymsResource = class extends BaseResource {
|
|
|
373
373
|
this.basePath = "gyms";
|
|
374
374
|
}
|
|
375
375
|
async createGym(data, options) {
|
|
376
|
-
return this.client.post(
|
|
377
|
-
this.basePath,
|
|
378
|
-
data,
|
|
379
|
-
options
|
|
380
|
-
);
|
|
376
|
+
return this.client.post(this.basePath, data, options);
|
|
381
377
|
}
|
|
382
378
|
async getOrganizationGyms(options) {
|
|
383
|
-
return this.client.get(
|
|
384
|
-
this.basePath,
|
|
385
|
-
void 0,
|
|
386
|
-
options
|
|
387
|
-
);
|
|
379
|
+
return this.client.get(this.basePath, void 0, options);
|
|
388
380
|
}
|
|
389
381
|
async getGym(id, options) {
|
|
390
382
|
return this.client.get(`${this.basePath}/${id}`, void 0, options);
|
|
@@ -407,6 +399,44 @@ var GymsResource = class extends BaseResource {
|
|
|
407
399
|
async updateGymSocialMedia(id, data, options) {
|
|
408
400
|
return this.client.put(`${this.basePath}/${id}/social-media`, data, options);
|
|
409
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Update current gym inventory settings (stock configuration)
|
|
404
|
+
* Uses gym from context (x-gym-id header)
|
|
405
|
+
* @param data Inventory settings data
|
|
406
|
+
* @param options Request options
|
|
407
|
+
* @returns Updated gym with new settings
|
|
408
|
+
*
|
|
409
|
+
* @example
|
|
410
|
+
* ```typescript
|
|
411
|
+
* const gym = await sdk.gyms.updateInventorySettings({
|
|
412
|
+
* defaultMinStock: 15,
|
|
413
|
+
* defaultMaxStock: 1000,
|
|
414
|
+
* enableLowStockAlerts: true
|
|
415
|
+
* });
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
async updateInventorySettings(data, options) {
|
|
419
|
+
return this.client.patch(`${this.basePath}/current/inventory-settings`, data, options);
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Update current gym contract expiration settings
|
|
423
|
+
* Uses gym from context (x-gym-id header)
|
|
424
|
+
* @param data Contract settings data
|
|
425
|
+
* @param options Request options
|
|
426
|
+
* @returns Updated gym with new settings
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* ```typescript
|
|
430
|
+
* const gym = await sdk.gyms.updateContractSettings({
|
|
431
|
+
* expiringSoonDays: 7,
|
|
432
|
+
* gracePeriodDays: 0,
|
|
433
|
+
* enableExpirationNotifications: true
|
|
434
|
+
* });
|
|
435
|
+
* ```
|
|
436
|
+
*/
|
|
437
|
+
async updateContractSettings(data, options) {
|
|
438
|
+
return this.client.patch(`${this.basePath}/current/contract-settings`, data, options);
|
|
439
|
+
}
|
|
410
440
|
};
|
|
411
441
|
|
|
412
442
|
// src/resources/collaborators.ts
|
|
@@ -1161,6 +1191,13 @@ var SubscriptionPlansResource = class extends BaseResource {
|
|
|
1161
1191
|
constructor() {
|
|
1162
1192
|
super(...arguments);
|
|
1163
1193
|
this.basePath = "admin/subscription-plans";
|
|
1194
|
+
this.publicBasePath = "subscription-plans/public";
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* List all active subscription plans (Public - no authentication required)
|
|
1198
|
+
*/
|
|
1199
|
+
async listPublicPlans(options) {
|
|
1200
|
+
return this.client.get(`${this.publicBasePath}`, void 0, options);
|
|
1164
1201
|
}
|
|
1165
1202
|
/**
|
|
1166
1203
|
* List all subscription plans (Super Admin only)
|
|
@@ -1394,6 +1431,61 @@ var WhatsAppTemplatesResource = class extends BaseResource {
|
|
|
1394
1431
|
}
|
|
1395
1432
|
};
|
|
1396
1433
|
|
|
1434
|
+
// src/resources/bulk-messaging.ts
|
|
1435
|
+
var BulkMessagingResource = class extends BaseResource {
|
|
1436
|
+
constructor() {
|
|
1437
|
+
super(...arguments);
|
|
1438
|
+
this.basePath = "whatsapp/bulk-messaging";
|
|
1439
|
+
this.templatesPath = "whatsapp/bulk-templates";
|
|
1440
|
+
}
|
|
1441
|
+
async createTemplate(data, options) {
|
|
1442
|
+
return this.client.post(this.templatesPath, data, options);
|
|
1443
|
+
}
|
|
1444
|
+
async getTemplates(options) {
|
|
1445
|
+
return this.client.get(this.templatesPath, void 0, options);
|
|
1446
|
+
}
|
|
1447
|
+
async getTemplate(id, options) {
|
|
1448
|
+
return this.client.get(`${this.templatesPath}/${id}`, void 0, options);
|
|
1449
|
+
}
|
|
1450
|
+
async updateTemplate(id, data, options) {
|
|
1451
|
+
return this.client.put(`${this.templatesPath}/${id}`, data, options);
|
|
1452
|
+
}
|
|
1453
|
+
async deleteTemplate(id, options) {
|
|
1454
|
+
return this.client.delete(`${this.templatesPath}/${id}`, options);
|
|
1455
|
+
}
|
|
1456
|
+
async getAvailableVariables(options) {
|
|
1457
|
+
return this.client.get(
|
|
1458
|
+
`${this.basePath}/available-variables`,
|
|
1459
|
+
void 0,
|
|
1460
|
+
options
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* Generate AI message with streaming support
|
|
1465
|
+
* Note: This proxies to the agent endpoint for streaming responses
|
|
1466
|
+
*/
|
|
1467
|
+
async generateAIMessage(data, options) {
|
|
1468
|
+
return this.client.post(
|
|
1469
|
+
`${this.basePath}/generate-ai`,
|
|
1470
|
+
data,
|
|
1471
|
+
options
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
/**
|
|
1475
|
+
* Send bulk messages to multiple clients
|
|
1476
|
+
* Note: SDK sends clientIds, API fetches full client and gym data before sending to agent
|
|
1477
|
+
*/
|
|
1478
|
+
async send(data, options) {
|
|
1479
|
+
return this.client.post(`${this.basePath}/send`, data, options);
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Get logs for a bulk message send operation
|
|
1483
|
+
*/
|
|
1484
|
+
async getLogs(sendId, options) {
|
|
1485
|
+
return this.client.get(`${this.basePath}/logs`, { sendId }, options);
|
|
1486
|
+
}
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1397
1489
|
// src/sdk.ts
|
|
1398
1490
|
var GymSpaceSdk = class {
|
|
1399
1491
|
constructor(config) {
|
|
@@ -1424,6 +1516,7 @@ var GymSpaceSdk = class {
|
|
|
1424
1516
|
this.paymentMethods = new PaymentMethodsResource(this.client);
|
|
1425
1517
|
this.whatsapp = new WhatsAppResource(this.client);
|
|
1426
1518
|
this.whatsappTemplates = new WhatsAppTemplatesResource(this.client);
|
|
1519
|
+
this.bulkMessaging = new BulkMessagingResource(this.client);
|
|
1427
1520
|
}
|
|
1428
1521
|
/**
|
|
1429
1522
|
* Set the authentication token
|
|
@@ -1859,6 +1952,6 @@ var OnboardingStep = /* @__PURE__ */ ((OnboardingStep2) => {
|
|
|
1859
1952
|
return OnboardingStep2;
|
|
1860
1953
|
})(OnboardingStep || {});
|
|
1861
1954
|
|
|
1862
|
-
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, FILE_LIMITS, FilesResource, GymSpaceError, GymSpaceSdk, GymsResource, HEADERS, HealthResource, InvitationStatus, InvitationsResource, LeadStatus, MembershipPlansResource, NetworkError, NotFoundError, OnboardingResource, OnboardingStep, OrganizationsResource, PAGINATION_DEFAULTS, PERMISSIONS, PaymentFrequency, PaymentMethodsResource, PlanStatus, ProductsResource, PublicCatalogResource, ROLE_NAMES, ROLE_PERMISSIONS, RoleNames, RolesResource, SalesResource, SubscriptionPlansResource, SubscriptionStatus, SubscriptionsResource, SuppliersResource, UserType, UsersResource, ValidationError, WhatsAppResource, WhatsAppTemplatesResource, canAccessFeature, getRoleCapabilities, getRoleDescription, getRoleDisplayName, isAdminRole, isEncargadoRole };
|
|
1955
|
+
export { AdminSubscriptionManagementResource, ApiClient, AssetCategory, AssetStatus, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, BulkMessagingResource, CACHE_TTL, CheckInsResource, ClientStatus, ClientsResource, CollaboratorStatus, CollaboratorsResource, CommentType, ContractAssetType, ContractStatus, ContractsResource, DATE_FORMATS, DashboardResource, EvaluationAssetCategory, EvaluationAssetStage, EvaluationStatus, EvaluationType, FILE_LIMITS, FilesResource, GymSpaceError, GymSpaceSdk, GymsResource, HEADERS, HealthResource, InvitationStatus, InvitationsResource, LeadStatus, MembershipPlansResource, NetworkError, NotFoundError, OnboardingResource, OnboardingStep, OrganizationsResource, PAGINATION_DEFAULTS, PERMISSIONS, PaymentFrequency, PaymentMethodsResource, PlanStatus, ProductsResource, PublicCatalogResource, ROLE_NAMES, ROLE_PERMISSIONS, RoleNames, RolesResource, SalesResource, SubscriptionPlansResource, SubscriptionStatus, SubscriptionsResource, SuppliersResource, UserType, UsersResource, ValidationError, WhatsAppResource, WhatsAppTemplatesResource, canAccessFeature, getRoleCapabilities, getRoleDescription, getRoleDisplayName, isAdminRole, isEncargadoRole };
|
|
1863
1956
|
//# sourceMappingURL=index.mjs.map
|
|
1864
1957
|
//# sourceMappingURL=index.mjs.map
|