@gymspace/sdk 1.2.15 → 1.2.18

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.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios';
2
+ import { z } from 'zod';
2
3
 
3
4
  // src/client.ts
4
5
 
@@ -55,6 +56,23 @@ var ApiClient = class {
55
56
  headers: {
56
57
  "Content-Type": "application/json",
57
58
  ...config.headers
59
+ },
60
+ paramsSerializer: (params) => {
61
+ const parts = [];
62
+ Object.entries(params).forEach(([key, value]) => {
63
+ if (value === void 0 || value === null) {
64
+ return;
65
+ }
66
+ if (Array.isArray(value)) {
67
+ if (value.length > 0) {
68
+ const encodedValues = value.map((v) => encodeURIComponent(String(v))).join(",");
69
+ parts.push(`${encodeURIComponent(key)}=${encodedValues}`);
70
+ }
71
+ } else {
72
+ parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
73
+ }
74
+ });
75
+ return parts.join("&");
58
76
  }
59
77
  });
60
78
  this.setupInterceptors();
@@ -1700,6 +1718,224 @@ var TagsResource = class extends BaseResource {
1700
1718
  }
1701
1719
  };
1702
1720
 
1721
+ // src/resources/commission-config.ts
1722
+ var CommissionConfigResource = class extends BaseResource {
1723
+ constructor() {
1724
+ super(...arguments);
1725
+ this.basePath = "commissions/config";
1726
+ }
1727
+ async createConfig(data, options) {
1728
+ return this.client.post(this.basePath, data, options);
1729
+ }
1730
+ async getActiveConfig(options) {
1731
+ return this.client.get(`${this.basePath}/active`, void 0, options);
1732
+ }
1733
+ async getConfig(id, options) {
1734
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
1735
+ }
1736
+ async listConfigs(params, options) {
1737
+ return this.paginate(this.basePath, params, options);
1738
+ }
1739
+ async updateConfig(id, data, options) {
1740
+ return this.client.put(`${this.basePath}/${id}`, data, options);
1741
+ }
1742
+ async deactivateConfig(id, options) {
1743
+ return this.client.put(`${this.basePath}/${id}/deactivate`, {}, options);
1744
+ }
1745
+ async getConfigHistory(id, params, options) {
1746
+ return this.paginate(`${this.basePath}/${id}/history`, params, options);
1747
+ }
1748
+ async validateConfig(data, options) {
1749
+ return this.client.post(
1750
+ `${this.basePath}/validate`,
1751
+ data,
1752
+ options
1753
+ );
1754
+ }
1755
+ };
1756
+
1757
+ // src/resources/commission-rules.ts
1758
+ var CommissionRulesResource = class extends BaseResource {
1759
+ constructor() {
1760
+ super(...arguments);
1761
+ this.basePath = "commissions/rules";
1762
+ }
1763
+ async createRule(data, options) {
1764
+ return this.client.post(this.basePath, data, options);
1765
+ }
1766
+ async getRule(id, options) {
1767
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
1768
+ }
1769
+ async listRules(params, options) {
1770
+ return this.paginate(this.basePath, params, options);
1771
+ }
1772
+ async updateRule(id, data, options) {
1773
+ return this.client.put(`${this.basePath}/${id}`, data, options);
1774
+ }
1775
+ async deleteRule(id, options) {
1776
+ return this.client.delete(`${this.basePath}/${id}`, options);
1777
+ }
1778
+ async activateRule(id, options) {
1779
+ return this.client.put(`${this.basePath}/${id}/activate`, {}, options);
1780
+ }
1781
+ async deactivateRule(id, options) {
1782
+ return this.client.put(`${this.basePath}/${id}/deactivate`, {}, options);
1783
+ }
1784
+ async getRuleHistory(id, params, options) {
1785
+ return this.paginate(`${this.basePath}/${id}/history`, params, options);
1786
+ }
1787
+ async validateRule(data, options) {
1788
+ return this.client.post(
1789
+ `${this.basePath}/validate`,
1790
+ data,
1791
+ options
1792
+ );
1793
+ }
1794
+ async getMyRules(options) {
1795
+ return this.client.get(`${this.basePath}/me`, void 0, options);
1796
+ }
1797
+ async getApplicableRule(params, options) {
1798
+ return this.client.get(
1799
+ `${this.basePath}/applicable`,
1800
+ params,
1801
+ options
1802
+ );
1803
+ }
1804
+ async reorderRules(data, options) {
1805
+ return this.client.patch(`${this.basePath}/reorder`, data, options);
1806
+ }
1807
+ };
1808
+
1809
+ // src/resources/commission-calculations.ts
1810
+ var CommissionCalculationsResource = class extends BaseResource {
1811
+ constructor() {
1812
+ super(...arguments);
1813
+ this.basePath = "commissions/calculations";
1814
+ }
1815
+ async createCalculation(data, options) {
1816
+ return this.client.post(this.basePath, data, options);
1817
+ }
1818
+ async getCalculation(id, options) {
1819
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
1820
+ }
1821
+ async getCalculations(params, options) {
1822
+ return this.paginate(this.basePath, params, options);
1823
+ }
1824
+ async getCollaboratorCalculations(collaboratorId, params, options) {
1825
+ return this.paginate(
1826
+ `${this.basePath}/collaborator/${collaboratorId}`,
1827
+ params,
1828
+ options
1829
+ );
1830
+ }
1831
+ async confirmCalculation(id, data, options) {
1832
+ return this.client.put(
1833
+ `${this.basePath}/${id}/confirm`,
1834
+ data,
1835
+ options
1836
+ );
1837
+ }
1838
+ async reverseCalculation(id, data, options) {
1839
+ return this.client.put(
1840
+ `${this.basePath}/${id}/reverse`,
1841
+ data,
1842
+ options
1843
+ );
1844
+ }
1845
+ async markAsPaid(id, data, options) {
1846
+ return this.client.put(`${this.basePath}/${id}/paid`, data, options);
1847
+ }
1848
+ async simulate(data, options) {
1849
+ return this.client.post("commissions/simulator", data, options);
1850
+ }
1851
+ async getMyCommissions(params, options) {
1852
+ return this.paginate("commissions/me", params, options);
1853
+ }
1854
+ async getMyCommissionsSummary(options) {
1855
+ return this.client.get("commissions/me/summary", void 0, options);
1856
+ }
1857
+ };
1858
+
1859
+ // src/resources/commission-reports.ts
1860
+ var CommissionReportsResource = class extends BaseResource {
1861
+ constructor() {
1862
+ super(...arguments);
1863
+ this.basePath = "commissions/reports";
1864
+ }
1865
+ async getSummary(params, options) {
1866
+ return this.client.get(`${this.basePath}/summary`, params, options);
1867
+ }
1868
+ async getByRule(params, options) {
1869
+ return this.client.get(`${this.basePath}/by-rule`, params, options);
1870
+ }
1871
+ async getByCollaborator(params, options) {
1872
+ return this.client.get(
1873
+ `${this.basePath}/by-collaborator`,
1874
+ params,
1875
+ options
1876
+ );
1877
+ }
1878
+ async getPromotionAnalytics(params, options) {
1879
+ return this.client.get(`${this.basePath}/promotions`, params, options);
1880
+ }
1881
+ async exportToCSV(params, options) {
1882
+ return this.client.get(`${this.basePath}/export/csv`, params, options);
1883
+ }
1884
+ async getTrends(params, options) {
1885
+ return this.client.get(
1886
+ `${this.basePath}/trends`,
1887
+ params,
1888
+ options
1889
+ );
1890
+ }
1891
+ async getTopPerformers(params, options) {
1892
+ return this.client.get(
1893
+ `${this.basePath}/top-performers`,
1894
+ params,
1895
+ options
1896
+ );
1897
+ }
1898
+ };
1899
+
1900
+ // src/resources/commission-promotions.ts
1901
+ var CommissionPromotionsResource = class extends BaseResource {
1902
+ constructor() {
1903
+ super(...arguments);
1904
+ this.basePath = "commissions/promotions";
1905
+ }
1906
+ async createPromotion(data, options) {
1907
+ return this.client.post(this.basePath, data, options);
1908
+ }
1909
+ async getPromotion(id, options) {
1910
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
1911
+ }
1912
+ async listPromotions(params, options) {
1913
+ return this.paginate(this.basePath, params, options);
1914
+ }
1915
+ async updatePromotion(id, data, options) {
1916
+ return this.client.put(`${this.basePath}/${id}`, data, options);
1917
+ }
1918
+ async deletePromotion(id, options) {
1919
+ return this.client.delete(`${this.basePath}/${id}`, options);
1920
+ }
1921
+ async activatePromotion(id, options) {
1922
+ return this.client.put(`${this.basePath}/${id}/activate`, {}, options);
1923
+ }
1924
+ async deactivatePromotion(id, options) {
1925
+ return this.client.put(`${this.basePath}/${id}/deactivate`, {}, options);
1926
+ }
1927
+ async validatePromotion(data, options) {
1928
+ return this.client.post(
1929
+ `${this.basePath}/validate`,
1930
+ data,
1931
+ options
1932
+ );
1933
+ }
1934
+ async estimateImpact(id, options) {
1935
+ return this.client.get(`${this.basePath}/${id}/impact`, void 0, options);
1936
+ }
1937
+ };
1938
+
1703
1939
  // src/sdk.ts
1704
1940
  var GymSpaceSdk = class {
1705
1941
  constructor(config) {
@@ -1733,6 +1969,11 @@ var GymSpaceSdk = class {
1733
1969
  this.bulkMessaging = new BulkMessagingResource(this.client);
1734
1970
  this.activities = new ActivitiesResource(this.client);
1735
1971
  this.tags = new TagsResource(this.client);
1972
+ this.commissionConfig = new CommissionConfigResource(this.client);
1973
+ this.commissionRules = new CommissionRulesResource(this.client);
1974
+ this.commissionCalculations = new CommissionCalculationsResource(this.client);
1975
+ this.commissionReports = new CommissionReportsResource(this.client);
1976
+ this.commissionPromotions = new CommissionPromotionsResource(this.client);
1736
1977
  }
1737
1978
  /**
1738
1979
  * Set the authentication token
@@ -1792,8 +2033,19 @@ var GymSpaceSdk = class {
1792
2033
  return this.client;
1793
2034
  }
1794
2035
  };
1795
-
1796
- // node_modules/@gymspace/shared/dist/index.mjs
2036
+ var TemplateCode = {
2037
+ WELCOME: "WELCOME",
2038
+ MEMBERSHIP_PURCHASE: "MEMBERSHIP_PURCHASE",
2039
+ MEMBERSHIP_RENEWAL: "MEMBERSHIP_RENEWAL",
2040
+ MEMBERSHIP_EXPIRING: "MEMBERSHIP_EXPIRING",
2041
+ PAYMENT_REMINDER: "PAYMENT_REMINDER",
2042
+ BIRTHDAY: "BIRTHDAY",
2043
+ PAYMENT_RECEIPT: "PAYMENT_RECEIPT"
2044
+ };
2045
+ var TemplateType = {
2046
+ STATIC: "STATIC",
2047
+ PROMPT: "PROMPT"
2048
+ };
1797
2049
  var UserType = /* @__PURE__ */ ((UserType2) => {
1798
2050
  UserType2["OWNER"] = "owner";
1799
2051
  UserType2["COLLABORATOR"] = "collaborator";
@@ -1838,8 +2090,28 @@ var ContractStatus = /* @__PURE__ */ ((ContractStatus2) => {
1838
2090
  ContractStatus2["EXPIRED"] = "expired";
1839
2091
  ContractStatus2["CANCELLED"] = "cancelled";
1840
2092
  ContractStatus2["FOR_RENEW"] = "for_renew";
2093
+ ContractStatus2["SUSPENDED"] = "suspended";
2094
+ ContractStatus2["GRACE_PERIOD"] = "grace_period";
2095
+ ContractStatus2["TERMINATED"] = "terminated";
1841
2096
  return ContractStatus2;
1842
2097
  })(ContractStatus || {});
2098
+ var CancellationReason = /* @__PURE__ */ ((CancellationReason2) => {
2099
+ CancellationReason2["PRICE_TOO_HIGH"] = "PRICE_TOO_HIGH";
2100
+ CancellationReason2["NOT_USING_SERVICE"] = "NOT_USING_SERVICE";
2101
+ CancellationReason2["MOVING_LOCATION"] = "MOVING_LOCATION";
2102
+ CancellationReason2["FINANCIAL_ISSUES"] = "FINANCIAL_ISSUES";
2103
+ CancellationReason2["SERVICE_DISSATISFACTION"] = "SERVICE_DISSATISFACTION";
2104
+ CancellationReason2["TEMPORARY_BREAK"] = "TEMPORARY_BREAK";
2105
+ CancellationReason2["OTHER"] = "OTHER";
2106
+ return CancellationReason2;
2107
+ })(CancellationReason || {});
2108
+ var SuspensionType = /* @__PURE__ */ ((SuspensionType2) => {
2109
+ SuspensionType2["VACATION"] = "vacation";
2110
+ SuspensionType2["MEDICAL"] = "medical";
2111
+ SuspensionType2["FINANCIAL"] = "financial";
2112
+ SuspensionType2["OTHER"] = "other";
2113
+ return SuspensionType2;
2114
+ })(SuspensionType || {});
1843
2115
  var PaymentFrequency = /* @__PURE__ */ ((PaymentFrequency2) => {
1844
2116
  PaymentFrequency2["MONTHLY"] = "monthly";
1845
2117
  PaymentFrequency2["QUARTERLY"] = "quarterly";
@@ -1851,27 +2123,6 @@ var AssetStatus = /* @__PURE__ */ ((AssetStatus2) => {
1851
2123
  AssetStatus2["DELETED"] = "deleted";
1852
2124
  return AssetStatus2;
1853
2125
  })(AssetStatus || {});
1854
- var EvaluationType = /* @__PURE__ */ ((EvaluationType2) => {
1855
- EvaluationType2["INITIAL"] = "initial";
1856
- EvaluationType2["PROGRESS"] = "progress";
1857
- EvaluationType2["FINAL"] = "final";
1858
- return EvaluationType2;
1859
- })(EvaluationType || {});
1860
- var EvaluationStatus = /* @__PURE__ */ ((EvaluationStatus2) => {
1861
- EvaluationStatus2["OPEN"] = "open";
1862
- EvaluationStatus2["IN_PROGRESS"] = "in_progress";
1863
- EvaluationStatus2["COMPLETED"] = "completed";
1864
- EvaluationStatus2["CANCELLED"] = "cancelled";
1865
- return EvaluationStatus2;
1866
- })(EvaluationStatus || {});
1867
- var CommentType = /* @__PURE__ */ ((CommentType2) => {
1868
- CommentType2["PROGRESS_NOTE"] = "progress_note";
1869
- CommentType2["PHONE_CALL"] = "phone_call";
1870
- CommentType2["MEETING"] = "meeting";
1871
- CommentType2["REMINDER"] = "reminder";
1872
- CommentType2["OTHER"] = "other";
1873
- return CommentType2;
1874
- })(CommentType || {});
1875
2126
  var AssetCategory = /* @__PURE__ */ ((AssetCategory2) => {
1876
2127
  AssetCategory2["MEDICAL_DOCUMENT"] = "medical_document";
1877
2128
  AssetCategory2["IDENTIFICATION"] = "identification";
@@ -1887,28 +2138,273 @@ var ContractAssetType = /* @__PURE__ */ ((ContractAssetType2) => {
1887
2138
  ContractAssetType2["OTHER"] = "other";
1888
2139
  return ContractAssetType2;
1889
2140
  })(ContractAssetType || {});
1890
- var EvaluationAssetStage = /* @__PURE__ */ ((EvaluationAssetStage2) => {
1891
- EvaluationAssetStage2["INITIAL"] = "initial";
1892
- EvaluationAssetStage2["PROGRESS"] = "progress";
1893
- EvaluationAssetStage2["FINAL"] = "final";
1894
- return EvaluationAssetStage2;
1895
- })(EvaluationAssetStage || {});
1896
- var EvaluationAssetCategory = /* @__PURE__ */ ((EvaluationAssetCategory2) => {
1897
- EvaluationAssetCategory2["BODY_PHOTO"] = "body_photo";
1898
- EvaluationAssetCategory2["MEASUREMENT_PHOTO"] = "measurement_photo";
1899
- EvaluationAssetCategory2["DOCUMENT"] = "document";
1900
- EvaluationAssetCategory2["REPORT"] = "report";
1901
- EvaluationAssetCategory2["OTHER"] = "other";
1902
- return EvaluationAssetCategory2;
1903
- })(EvaluationAssetCategory || {});
1904
- var LeadStatus = /* @__PURE__ */ ((LeadStatus2) => {
1905
- LeadStatus2["NEW"] = "NEW";
1906
- LeadStatus2["CONTACTED"] = "CONTACTED";
1907
- LeadStatus2["INTERESTED"] = "INTERESTED";
1908
- LeadStatus2["CONVERTED"] = "CONVERTED";
1909
- LeadStatus2["LOST"] = "LOST";
1910
- return LeadStatus2;
1911
- })(LeadStatus || {});
2141
+ var TEMPLATE_CODES = {
2142
+ WELCOME: TemplateCode.WELCOME,
2143
+ MEMBERSHIP_PURCHASE: TemplateCode.MEMBERSHIP_PURCHASE,
2144
+ MEMBERSHIP_RENEWAL: TemplateCode.MEMBERSHIP_RENEWAL,
2145
+ MEMBERSHIP_EXPIRING: TemplateCode.MEMBERSHIP_EXPIRING,
2146
+ PAYMENT_REMINDER: TemplateCode.PAYMENT_REMINDER,
2147
+ BIRTHDAY: TemplateCode.BIRTHDAY,
2148
+ PAYMENT_RECEIPT: TemplateCode.PAYMENT_RECEIPT
2149
+ };
2150
+ var WHATSAPP_TEMPLATE_EVENTS = {
2151
+ SEND_TEMPLATE: "whatsapp/template.send",
2152
+ TEMPLATE_SENT: "whatsapp/template.sent",
2153
+ TEMPLATE_FAILED: "whatsapp/template.failed"
2154
+ };
2155
+ var TEMPLATE_METADATA = {
2156
+ [TemplateCode.WELCOME]: {
2157
+ code: TemplateCode.WELCOME,
2158
+ title: "Mensaje de Bienvenida",
2159
+ description: "Mensaje para nuevos clientes",
2160
+ icon: "UserPlus",
2161
+ variables: ["clientName", "gymName", "registrationDate"],
2162
+ exampleValues: {
2163
+ clientName: "Juan P\xE9rez",
2164
+ gymName: "GymSpace",
2165
+ registrationDate: "15/01/2024"
2166
+ }
2167
+ },
2168
+ [TemplateCode.MEMBERSHIP_PURCHASE]: {
2169
+ code: TemplateCode.MEMBERSHIP_PURCHASE,
2170
+ title: "Compra de Membres\xEDa",
2171
+ description: "Confirmaci\xF3n de nueva membres\xEDa",
2172
+ icon: "ShoppingCart",
2173
+ variables: ["clientName", "planName", "startDate", "endDate", "amount", "paymentFrequency"],
2174
+ exampleValues: {
2175
+ clientName: "Mar\xEDa L\xF3pez",
2176
+ planName: "Premium",
2177
+ startDate: "01/02/2024",
2178
+ endDate: "01/03/2024",
2179
+ amount: "$50.00",
2180
+ paymentFrequency: "mensual"
2181
+ }
2182
+ },
2183
+ [TemplateCode.MEMBERSHIP_RENEWAL]: {
2184
+ code: TemplateCode.MEMBERSHIP_RENEWAL,
2185
+ title: "Renovaci\xF3n de Membres\xEDa",
2186
+ description: "Confirmaci\xF3n de renovaci\xF3n",
2187
+ icon: "RefreshCw",
2188
+ variables: ["clientName", "planName", "newEndDate", "amount"],
2189
+ exampleValues: {
2190
+ clientName: "Carlos Ruiz",
2191
+ planName: "B\xE1sico",
2192
+ newEndDate: "15/04/2024",
2193
+ amount: "$30.00"
2194
+ }
2195
+ },
2196
+ [TemplateCode.MEMBERSHIP_EXPIRING]: {
2197
+ code: TemplateCode.MEMBERSHIP_EXPIRING,
2198
+ title: "Membres\xEDa Por Vencer",
2199
+ description: "Recordatorio de expiraci\xF3n pr\xF3xima",
2200
+ icon: "AlertCircle",
2201
+ variables: ["clientName", "planName", "expirationDate", "daysRemaining"],
2202
+ exampleValues: {
2203
+ clientName: "Ana Garc\xEDa",
2204
+ planName: "Premium",
2205
+ expirationDate: "20/02/2024",
2206
+ daysRemaining: "3"
2207
+ }
2208
+ },
2209
+ [TemplateCode.PAYMENT_REMINDER]: {
2210
+ code: TemplateCode.PAYMENT_REMINDER,
2211
+ title: "Recordatorio de Pago",
2212
+ description: "Recordatorio de pago pendiente",
2213
+ icon: "DollarSign",
2214
+ variables: ["clientName", "amount", "dueDate", "planName"],
2215
+ exampleValues: {
2216
+ clientName: "Pedro S\xE1nchez",
2217
+ amount: "$40.00",
2218
+ dueDate: "25/02/2024",
2219
+ planName: "Est\xE1ndar"
2220
+ }
2221
+ },
2222
+ [TemplateCode.BIRTHDAY]: {
2223
+ code: TemplateCode.BIRTHDAY,
2224
+ title: "Cumplea\xF1os",
2225
+ description: "Felicitaci\xF3n de cumplea\xF1os",
2226
+ icon: "Cake",
2227
+ variables: ["clientName", "gymName", "age"],
2228
+ exampleValues: {
2229
+ clientName: "Laura Mart\xEDnez",
2230
+ gymName: "GymSpace",
2231
+ age: "28"
2232
+ }
2233
+ },
2234
+ [TemplateCode.PAYMENT_RECEIPT]: {
2235
+ code: TemplateCode.PAYMENT_RECEIPT,
2236
+ title: "Comprobante de Pago",
2237
+ description: "Comprobante de venta pagada",
2238
+ icon: "Receipt",
2239
+ variables: [
2240
+ "gymName",
2241
+ "receiptNumber",
2242
+ "date",
2243
+ "clientName",
2244
+ "items",
2245
+ "amount",
2246
+ "paymentMethod"
2247
+ ],
2248
+ exampleValues: {
2249
+ gymName: "GymSpace",
2250
+ receiptNumber: "V-001",
2251
+ date: "15/01/2024",
2252
+ clientName: "Juan P\xE9rez",
2253
+ items: "\u2022 Prote\xEDna x2 = Q100.00\n\u2022 Creatina x1 = Q50.00",
2254
+ amount: "Q150.00",
2255
+ paymentMethod: "Efectivo"
2256
+ }
2257
+ }
2258
+ };
2259
+ var BULK_MESSAGE_VARIABLES = [
2260
+ // Variables de Cliente
2261
+ {
2262
+ name: "clientName",
2263
+ placeholder: "{{clientName}}",
2264
+ description: "Nombre completo del cliente",
2265
+ example: "Juan P\xE9rez",
2266
+ category: "client",
2267
+ required: false,
2268
+ formatter: "text"
2269
+ },
2270
+ {
2271
+ name: "clientEmail",
2272
+ placeholder: "{{clientEmail}}",
2273
+ description: "Email del cliente",
2274
+ example: "juan@example.com",
2275
+ category: "client",
2276
+ required: false,
2277
+ formatter: "text"
2278
+ },
2279
+ {
2280
+ name: "clientPhone",
2281
+ placeholder: "{{clientPhone}}",
2282
+ description: "Tel\xE9fono del cliente",
2283
+ example: "+51 999 999 999",
2284
+ category: "client",
2285
+ required: false,
2286
+ formatter: "text"
2287
+ },
2288
+ // Variables de Gimnasio
2289
+ {
2290
+ name: "gymName",
2291
+ placeholder: "{{gymName}}",
2292
+ description: "Nombre del gimnasio",
2293
+ example: "Gym Fitness",
2294
+ category: "gym",
2295
+ required: false,
2296
+ formatter: "text"
2297
+ },
2298
+ {
2299
+ name: "gymPhone",
2300
+ placeholder: "{{gymPhone}}",
2301
+ description: "Tel\xE9fono del gimnasio",
2302
+ example: "+51 999 888 777",
2303
+ category: "gym",
2304
+ required: false,
2305
+ formatter: "text"
2306
+ },
2307
+ {
2308
+ name: "gymAddress",
2309
+ placeholder: "{{gymAddress}}",
2310
+ description: "Direcci\xF3n del gimnasio",
2311
+ example: "Av. Principal 123",
2312
+ category: "gym",
2313
+ required: false,
2314
+ formatter: "text"
2315
+ },
2316
+ // Variables de Membresía
2317
+ {
2318
+ name: "planName",
2319
+ placeholder: "{{planName}}",
2320
+ description: "Nombre del plan de membres\xEDa",
2321
+ example: "Plan Premium",
2322
+ category: "membership",
2323
+ required: false,
2324
+ formatter: "text"
2325
+ },
2326
+ {
2327
+ name: "membershipStatus",
2328
+ placeholder: "{{membershipStatus}}",
2329
+ description: "Estado de la membres\xEDa",
2330
+ example: "Activa",
2331
+ category: "membership",
2332
+ required: false,
2333
+ formatter: "text"
2334
+ },
2335
+ {
2336
+ name: "daysUntilExpiration",
2337
+ placeholder: "{{daysUntilExpiration}}",
2338
+ description: "D\xEDas restantes hasta vencimiento",
2339
+ example: "15",
2340
+ category: "membership",
2341
+ required: false,
2342
+ formatter: "number"
2343
+ },
2344
+ {
2345
+ name: "expirationDate",
2346
+ placeholder: "{{expirationDate}}",
2347
+ description: "Fecha de vencimiento",
2348
+ example: "31/12/2024",
2349
+ category: "membership",
2350
+ required: false,
2351
+ formatter: "date"
2352
+ },
2353
+ {
2354
+ name: "amount",
2355
+ placeholder: "{{amount}}",
2356
+ description: "Monto con formato de moneda",
2357
+ example: "S/ 150.00",
2358
+ category: "membership",
2359
+ required: false,
2360
+ formatter: "currency"
2361
+ },
2362
+ // Variables de Fecha/Hora
2363
+ {
2364
+ name: "date",
2365
+ placeholder: "{{date}}",
2366
+ description: "Fecha actual",
2367
+ example: "15/10/2024",
2368
+ category: "datetime",
2369
+ required: false,
2370
+ formatter: "date"
2371
+ },
2372
+ {
2373
+ name: "time",
2374
+ placeholder: "{{time}}",
2375
+ description: "Hora actual",
2376
+ example: "14:30",
2377
+ category: "datetime",
2378
+ required: false,
2379
+ formatter: "text"
2380
+ },
2381
+ {
2382
+ name: "dayOfWeek",
2383
+ placeholder: "{{dayOfWeek}}",
2384
+ description: "D\xEDa de la semana",
2385
+ example: "Lunes",
2386
+ category: "datetime",
2387
+ required: false,
2388
+ formatter: "text"
2389
+ },
2390
+ // Variables Personalizadas
2391
+ {
2392
+ name: "customField",
2393
+ placeholder: "{{customField}}",
2394
+ description: "Campo personalizado del cliente",
2395
+ example: "Valor personalizado",
2396
+ category: "custom",
2397
+ required: false,
2398
+ formatter: "text"
2399
+ }
2400
+ ];
2401
+ var BULK_MESSAGE_VARIABLE_CATEGORIES = {
2402
+ client: "Cliente",
2403
+ gym: "Gimnasio",
2404
+ membership: "Membres\xEDa",
2405
+ datetime: "Fecha/Hora",
2406
+ custom: "Personalizado"
2407
+ };
1912
2408
  var PERMISSIONS = {
1913
2409
  // Organizations
1914
2410
  ORGANIZATIONS_CREATE: "ORGANIZATIONS_CREATE",
@@ -1936,19 +2432,9 @@ var PERMISSIONS = {
1936
2432
  CONTRACTS_UPDATE: "CONTRACTS_UPDATE",
1937
2433
  CONTRACTS_APPROVE: "CONTRACTS_APPROVE",
1938
2434
  CONTRACTS_CANCEL: "CONTRACTS_CANCEL",
1939
- // Evaluations
1940
- EVALUATIONS_CREATE: "EVALUATIONS_CREATE",
1941
- EVALUATIONS_READ: "EVALUATIONS_READ",
1942
- EVALUATIONS_UPDATE: "EVALUATIONS_UPDATE",
1943
- EVALUATIONS_DELETE: "EVALUATIONS_DELETE",
1944
2435
  // Check-ins
1945
2436
  CHECKINS_CREATE: "CHECKINS_CREATE",
1946
2437
  CHECKINS_READ: "CHECKINS_READ",
1947
- // Leads
1948
- LEADS_CREATE: "LEADS_CREATE",
1949
- LEADS_READ: "LEADS_READ",
1950
- LEADS_UPDATE: "LEADS_UPDATE",
1951
- LEADS_DELETE: "LEADS_DELETE",
1952
2438
  // Reports
1953
2439
  REPORTS_VIEW: "REPORTS_VIEW",
1954
2440
  REPORTS_FINANCIAL: "REPORTS_FINANCIAL",
@@ -1987,6 +2473,23 @@ var PERMISSIONS = {
1987
2473
  PAYMENT_METHODS_READ: "PAYMENT_METHODS_READ",
1988
2474
  PAYMENT_METHODS_UPDATE: "PAYMENT_METHODS_UPDATE",
1989
2475
  PAYMENT_METHODS_DELETE: "PAYMENT_METHODS_DELETE",
2476
+ // WhatsApp
2477
+ WHATSAPP_READ: "WHATSAPP_READ",
2478
+ WHATSAPP_SEND: "WHATSAPP_SEND",
2479
+ WHATSAPP_MANAGE: "WHATSAPP_MANAGE",
2480
+ WHATSAPP_BULK_SEND: "WHATSAPP_BULK_SEND",
2481
+ WHATSAPP_BULK_MANAGE: "WHATSAPP_BULK_MANAGE",
2482
+ // Activities
2483
+ ACTIVITIES_CREATE: "ACTIVITIES_CREATE",
2484
+ ACTIVITIES_READ: "ACTIVITIES_READ",
2485
+ ACTIVITIES_UPDATE: "ACTIVITIES_UPDATE",
2486
+ ACTIVITIES_DELETE: "ACTIVITIES_DELETE",
2487
+ ACTIVITIES_MANAGE_NOTIFICATIONS: "ACTIVITIES_MANAGE_NOTIFICATIONS",
2488
+ // Tags
2489
+ TAGS_CREATE: "TAGS_CREATE",
2490
+ TAGS_READ: "TAGS_READ",
2491
+ TAGS_UPDATE: "TAGS_UPDATE",
2492
+ TAGS_DELETE: "TAGS_DELETE",
1990
2493
  // Special permissions
1991
2494
  SUPER_ADMIN: "SUPER_ADMIN",
1992
2495
  OWNER: "OWNER",
@@ -2002,9 +2505,6 @@ var ROLE_PERMISSIONS = {
2002
2505
  PERMISSIONS.CLIENTS_UPDATE,
2003
2506
  PERMISSIONS.CONTRACTS_CREATE,
2004
2507
  PERMISSIONS.CONTRACTS_READ,
2005
- PERMISSIONS.EVALUATIONS_CREATE,
2006
- PERMISSIONS.EVALUATIONS_READ,
2007
- PERMISSIONS.EVALUATIONS_UPDATE,
2008
2508
  PERMISSIONS.CHECKINS_CREATE,
2009
2509
  PERMISSIONS.CHECKINS_READ,
2010
2510
  PERMISSIONS.REPORTS_VIEW,
@@ -2036,16 +2536,18 @@ var ROLE_PERMISSIONS = {
2036
2536
  ]
2037
2537
  };
2038
2538
  var CACHE_TTL = {
2039
- USER_PERMISSIONS: 900,
2539
+ USER_PERMISSIONS: 9e5,
2040
2540
  // 15 minutes
2041
- GYM_DATA: 1800,
2541
+ GYM_DATA: 18e5,
2042
2542
  // 30 minutes
2043
- STATIC_DATA: 3600,
2543
+ STATIC_DATA: 36e5,
2044
2544
  // 60 minutes
2045
- REPORTS: 300,
2545
+ REPORTS: 3e5,
2046
2546
  // 5 minutes
2047
- DASHBOARD: 180
2547
+ DASHBOARD: 18e4,
2048
2548
  // 3 minutes
2549
+ WHATSAPP_MESSAGE_STATUS: 3e5
2550
+ // 5 minutes
2049
2551
  };
2050
2552
  var FILE_LIMITS = {
2051
2553
  MAX_FILE_SIZE: 10 * 1024 * 1024,
@@ -2158,25 +2660,48 @@ function getRoleCapabilities(roleName) {
2158
2660
  return [];
2159
2661
  }
2160
2662
  }
2161
-
2162
- // src/models/contracts.ts
2163
- var CancellationReason = /* @__PURE__ */ ((CancellationReason2) => {
2164
- CancellationReason2["PRICE_TOO_HIGH"] = "PRICE_TOO_HIGH";
2165
- CancellationReason2["NOT_USING_SERVICE"] = "NOT_USING_SERVICE";
2166
- CancellationReason2["MOVING_LOCATION"] = "MOVING_LOCATION";
2167
- CancellationReason2["FINANCIAL_ISSUES"] = "FINANCIAL_ISSUES";
2168
- CancellationReason2["SERVICE_DISSATISFACTION"] = "SERVICE_DISSATISFACTION";
2169
- CancellationReason2["TEMPORARY_BREAK"] = "TEMPORARY_BREAK";
2170
- CancellationReason2["OTHER"] = "OTHER";
2171
- return CancellationReason2;
2172
- })(CancellationReason || {});
2173
- var SuspensionType = /* @__PURE__ */ ((SuspensionType2) => {
2174
- SuspensionType2["VACATION"] = "vacation";
2175
- SuspensionType2["MEDICAL"] = "medical";
2176
- SuspensionType2["FINANCIAL"] = "financial";
2177
- SuspensionType2["OTHER"] = "other";
2178
- return SuspensionType2;
2179
- })(SuspensionType || {});
2663
+ var WHATSAPP_EVENTS = {
2664
+ MESSAGE_SEND: "whatsapp/message.send",
2665
+ MESSAGE_RECEIVED: "whatsapp/message.received",
2666
+ CONNECTION_UPDATE: "whatsapp/connection.update"
2667
+ };
2668
+ var BULK_MESSAGING_EVENTS = {
2669
+ GENERATE_BULK_MESSAGE: "whatsapp/bulk-message.generate",
2670
+ SEND_BULK_MESSAGES: "whatsapp/bulk-messages.send"
2671
+ };
2672
+ var ACTIVITY_EVENTS = {
2673
+ SEND_ACTIVITY_NOTIFICATION: "activity/notification.send"
2674
+ };
2675
+ var templateGenerationRequestSchema = z.object({
2676
+ templateCode: z.string(),
2677
+ templateMetadata: z.object({
2678
+ title: z.string(),
2679
+ description: z.string(),
2680
+ variables: z.array(z.string()),
2681
+ exampleValues: z.record(z.string())
2682
+ }),
2683
+ userPrompt: z.string().optional(),
2684
+ language: z.string().default("es")
2685
+ });
2686
+ var aiGeneratedTemplateSchema = z.object({
2687
+ message: z.string().describe("Mensaje generado con variables en formato {{variable}}"),
2688
+ tone: z.enum(["professional", "friendly", "casual", "urgent"]).describe("Tono del mensaje"),
2689
+ usedVariables: z.array(z.string()).describe("Variables utilizadas en el mensaje"),
2690
+ suggestions: z.array(z.string()).optional().describe("Sugerencias adicionales")
2691
+ });
2692
+ var bulkMessageGenerationRequestSchema = z.object({
2693
+ prompt: z.string().describe("Prompt or context for message generation"),
2694
+ tone: z.enum(["promotional", "informational", "reminder", "greeting", "friendly"]).optional().describe("Tone of the message"),
2695
+ includeVariables: z.array(z.string()).optional().describe("Variables to include in the message"),
2696
+ additionalRequirements: z.string().optional().describe("Additional requirements for the message"),
2697
+ language: z.string().default("es").describe("Language for generation")
2698
+ });
2699
+ var bulkMessageSchema = z.object({
2700
+ message: z.string().describe("Generated message with variables"),
2701
+ tone: z.enum(["promotional", "informational", "reminder", "greeting", "friendly"]).describe("Tone of the message"),
2702
+ usedVariables: z.array(z.string()).describe("Variables used in the message"),
2703
+ suggestions: z.array(z.string()).optional().describe("Additional message suggestions")
2704
+ });
2180
2705
 
2181
2706
  // src/models/onboarding.ts
2182
2707
  var OnboardingStep = /* @__PURE__ */ ((OnboardingStep2) => {
@@ -2187,6 +2712,32 @@ var OnboardingStep = /* @__PURE__ */ ((OnboardingStep2) => {
2187
2712
  return OnboardingStep2;
2188
2713
  })(OnboardingStep || {});
2189
2714
 
2190
- export { ActivitiesResource, AdminSubscriptionManagementResource, ApiClient, AssetCategory, AssetStatus, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, BulkMessagingResource, CACHE_TTL, CancellationReason, 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, SuspensionType, TagsResource, UserType, UsersResource, ValidationError, WhatsAppResource, WhatsAppTemplatesResource, canAccessFeature, getRoleCapabilities, getRoleDescription, getRoleDisplayName, isAdminRole, isEncargadoRole };
2715
+ // src/models/commissions.ts
2716
+ var CommissionRuleType = /* @__PURE__ */ ((CommissionRuleType2) => {
2717
+ CommissionRuleType2["PLAN"] = "PLAN";
2718
+ CommissionRuleType2["AMOUNT"] = "AMOUNT";
2719
+ CommissionRuleType2["PROMOTION"] = "PROMOTION";
2720
+ return CommissionRuleType2;
2721
+ })(CommissionRuleType || {});
2722
+ var CommissionStatus = /* @__PURE__ */ ((CommissionStatus2) => {
2723
+ CommissionStatus2["PENDING"] = "PENDING";
2724
+ CommissionStatus2["CONFIRMED"] = "CONFIRMED";
2725
+ CommissionStatus2["PAID"] = "PAID";
2726
+ CommissionStatus2["REVERSED"] = "REVERSED";
2727
+ return CommissionStatus2;
2728
+ })(CommissionStatus || {});
2729
+ var CommissionChangeType = /* @__PURE__ */ ((CommissionChangeType2) => {
2730
+ CommissionChangeType2["CREATED"] = "CREATED";
2731
+ CommissionChangeType2["UPDATED"] = "UPDATED";
2732
+ CommissionChangeType2["DELETED"] = "DELETED";
2733
+ return CommissionChangeType2;
2734
+ })(CommissionChangeType || {});
2735
+ var CommissionEntityType = /* @__PURE__ */ ((CommissionEntityType2) => {
2736
+ CommissionEntityType2["CONFIG"] = "CONFIG";
2737
+ CommissionEntityType2["RULE"] = "RULE";
2738
+ return CommissionEntityType2;
2739
+ })(CommissionEntityType || {});
2740
+
2741
+ export { ACTIVITY_EVENTS, ActivitiesResource, AdminSubscriptionManagementResource, ApiClient, AssetCategory, AssetStatus, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, BULK_MESSAGE_VARIABLES, BULK_MESSAGE_VARIABLE_CATEGORIES, BULK_MESSAGING_EVENTS, BulkMessagingResource, CACHE_TTL, CancellationReason, CheckInsResource, ClientStatus, ClientsResource, CollaboratorStatus, CollaboratorsResource, CommissionCalculationsResource, CommissionChangeType, CommissionConfigResource, CommissionEntityType, CommissionPromotionsResource, CommissionReportsResource, CommissionRuleType, CommissionRulesResource, CommissionStatus, ContractAssetType, ContractStatus, ContractsResource, DATE_FORMATS, DashboardResource, FILE_LIMITS, FilesResource, GymSpaceError, GymSpaceSdk, GymsResource, HEADERS, HealthResource, InvitationStatus, InvitationsResource, 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, SuspensionType, TEMPLATE_CODES, TEMPLATE_METADATA, TagsResource, TemplateCode, TemplateType, UserType, UsersResource, ValidationError, WHATSAPP_EVENTS, WHATSAPP_TEMPLATE_EVENTS, WhatsAppResource, WhatsAppTemplatesResource, aiGeneratedTemplateSchema, bulkMessageGenerationRequestSchema, bulkMessageSchema, canAccessFeature, getRoleCapabilities, getRoleDescription, getRoleDisplayName, isAdminRole, isEncargadoRole, templateGenerationRequestSchema };
2191
2742
  //# sourceMappingURL=index.mjs.map
2192
2743
  //# sourceMappingURL=index.mjs.map