@eleva-io/erp-sdk 0.1.7 → 0.1.9

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 (243) hide show
  1. package/dist/erp.d.ts +6 -4
  2. package/dist/erp.d.ts.map +1 -1
  3. package/dist/erp.js +7 -3
  4. package/dist/erp.js.map +1 -1
  5. package/dist/index.d.ts +4 -4
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/modules/contacts/api.d.ts +2 -2
  9. package/dist/modules/contacts/api.d.ts.map +1 -1
  10. package/dist/modules/contacts/api.js.map +1 -1
  11. package/dist/modules/contacts/index.d.ts +2 -2
  12. package/dist/modules/contacts/index.d.ts.map +1 -1
  13. package/dist/modules/contacts/index.js.map +1 -1
  14. package/dist/modules/contacts/persons/api/addresses.d.ts +2 -2
  15. package/dist/modules/contacts/persons/api/addresses.d.ts.map +1 -1
  16. package/dist/modules/contacts/persons/api/addresses.js.map +1 -1
  17. package/dist/modules/contacts/persons/api/index.d.ts +2 -2
  18. package/dist/modules/contacts/persons/api/index.d.ts.map +1 -1
  19. package/dist/modules/contacts/persons/api/index.js.map +1 -1
  20. package/dist/modules/contacts/persons/api/persons.d.ts +4 -4
  21. package/dist/modules/contacts/persons/api/persons.d.ts.map +1 -1
  22. package/dist/modules/contacts/persons/api/persons.js +1 -1
  23. package/dist/modules/contacts/persons/api/persons.js.map +1 -1
  24. package/dist/modules/contacts/persons/index.d.ts +2 -2
  25. package/dist/modules/contacts/persons/index.d.ts.map +1 -1
  26. package/dist/modules/contacts/persons/index.js.map +1 -1
  27. package/dist/modules/contacts/persons/types/address.d.ts +1 -1
  28. package/dist/modules/contacts/persons/types/address.d.ts.map +1 -1
  29. package/dist/modules/contacts/persons/types/index.d.ts +3 -3
  30. package/dist/modules/contacts/persons/types/index.d.ts.map +1 -1
  31. package/dist/modules/contacts/persons/types/index.js.map +1 -1
  32. package/dist/modules/contacts/persons/types/person.d.ts +13 -4
  33. package/dist/modules/contacts/persons/types/person.d.ts.map +1 -1
  34. package/dist/modules/contacts/persons/types/person_address.d.ts +3 -3
  35. package/dist/modules/contacts/persons/types/person_address.d.ts.map +1 -1
  36. package/dist/modules/global/agents/index.d.ts +2 -0
  37. package/dist/modules/global/agents/index.d.ts.map +1 -0
  38. package/dist/modules/global/agents/index.js +18 -0
  39. package/dist/modules/global/agents/index.js.map +1 -0
  40. package/dist/modules/global/agents/types.d.ts +16 -0
  41. package/dist/modules/global/agents/types.d.ts.map +1 -0
  42. package/dist/modules/global/agents/types.js +10 -0
  43. package/dist/modules/global/agents/types.js.map +1 -0
  44. package/dist/modules/global/api.d.ts +9 -0
  45. package/dist/modules/global/api.d.ts.map +1 -0
  46. package/dist/modules/global/api.js +17 -0
  47. package/dist/modules/global/api.js.map +1 -0
  48. package/dist/modules/global/index.d.ts +3 -0
  49. package/dist/modules/global/index.d.ts.map +1 -0
  50. package/dist/modules/global/index.js +19 -0
  51. package/dist/modules/global/index.js.map +1 -0
  52. package/dist/modules/global/search/api.d.ts +10 -0
  53. package/dist/modules/global/search/api.d.ts.map +1 -0
  54. package/dist/modules/global/search/api.js +19 -0
  55. package/dist/modules/global/search/api.js.map +1 -0
  56. package/dist/modules/global/search/index.d.ts +3 -0
  57. package/dist/modules/global/search/index.d.ts.map +1 -0
  58. package/dist/modules/global/search/index.js +19 -0
  59. package/dist/modules/global/search/index.js.map +1 -0
  60. package/dist/modules/global/search/types.d.ts +37 -0
  61. package/dist/modules/global/search/types.d.ts.map +1 -0
  62. package/dist/modules/global/search/types.js +10 -0
  63. package/dist/modules/global/search/types.js.map +1 -0
  64. package/dist/modules/horizontal/api.d.ts +2 -2
  65. package/dist/modules/horizontal/api.d.ts.map +1 -1
  66. package/dist/modules/horizontal/api.js.map +1 -1
  67. package/dist/modules/horizontal/communities/api/agents.d.ts +2 -2
  68. package/dist/modules/horizontal/communities/api/agents.d.ts.map +1 -1
  69. package/dist/modules/horizontal/communities/api/agents.js.map +1 -1
  70. package/dist/modules/horizontal/communities/api/blocks.d.ts +4 -4
  71. package/dist/modules/horizontal/communities/api/blocks.d.ts.map +1 -1
  72. package/dist/modules/horizontal/communities/api/blocks.js +1 -1
  73. package/dist/modules/horizontal/communities/api/blocks.js.map +1 -1
  74. package/dist/modules/horizontal/communities/api/communities.d.ts +13 -11
  75. package/dist/modules/horizontal/communities/api/communities.d.ts.map +1 -1
  76. package/dist/modules/horizontal/communities/api/communities.js +14 -7
  77. package/dist/modules/horizontal/communities/api/communities.js.map +1 -1
  78. package/dist/modules/horizontal/communities/api/communities_config.d.ts +3 -3
  79. package/dist/modules/horizontal/communities/api/communities_config.d.ts.map +1 -1
  80. package/dist/modules/horizontal/communities/api/communities_config.js.map +1 -1
  81. package/dist/modules/horizontal/communities/api/documents.d.ts +3 -3
  82. package/dist/modules/horizontal/communities/api/documents.d.ts.map +1 -1
  83. package/dist/modules/horizontal/communities/api/documents.js +6 -1
  84. package/dist/modules/horizontal/communities/api/documents.js.map +1 -1
  85. package/dist/modules/horizontal/communities/api/employees.d.ts +2 -2
  86. package/dist/modules/horizontal/communities/api/employees.d.ts.map +1 -1
  87. package/dist/modules/horizontal/communities/api/employees.js.map +1 -1
  88. package/dist/modules/horizontal/communities/api/index.d.ts +11 -10
  89. package/dist/modules/horizontal/communities/api/index.d.ts.map +1 -1
  90. package/dist/modules/horizontal/communities/api/index.js +1 -0
  91. package/dist/modules/horizontal/communities/api/index.js.map +1 -1
  92. package/dist/modules/horizontal/communities/api/properties.d.ts +3 -3
  93. package/dist/modules/horizontal/communities/api/properties.d.ts.map +1 -1
  94. package/dist/modules/horizontal/communities/api/properties.js +1 -1
  95. package/dist/modules/horizontal/communities/api/properties.js.map +1 -1
  96. package/dist/modules/horizontal/communities/api/providers.d.ts +2 -2
  97. package/dist/modules/horizontal/communities/api/providers.d.ts.map +1 -1
  98. package/dist/modules/horizontal/communities/api/providers.js.map +1 -1
  99. package/dist/modules/horizontal/communities/api/receipts.d.ts +4 -4
  100. package/dist/modules/horizontal/communities/api/receipts.d.ts.map +1 -1
  101. package/dist/modules/horizontal/communities/api/receipts.js +1 -1
  102. package/dist/modules/horizontal/communities/api/receipts.js.map +1 -1
  103. package/dist/modules/horizontal/communities/api/roles.d.ts +2 -2
  104. package/dist/modules/horizontal/communities/api/roles.d.ts.map +1 -1
  105. package/dist/modules/horizontal/communities/api/roles.js.map +1 -1
  106. package/dist/modules/horizontal/communities/api/route_trackings/index.d.ts +4 -0
  107. package/dist/modules/horizontal/communities/api/route_trackings/index.d.ts.map +1 -0
  108. package/dist/modules/horizontal/communities/api/route_trackings/index.js +20 -0
  109. package/dist/modules/horizontal/communities/api/route_trackings/index.js.map +1 -0
  110. package/dist/modules/horizontal/communities/api/route_trackings/route_trackings.d.ts +11 -0
  111. package/dist/modules/horizontal/communities/api/route_trackings/route_trackings.d.ts.map +1 -0
  112. package/dist/modules/horizontal/communities/api/route_trackings/route_trackings.js +21 -0
  113. package/dist/modules/horizontal/communities/api/route_trackings/route_trackings.js.map +1 -0
  114. package/dist/modules/horizontal/communities/api/route_trackings/routes.d.ts +27 -0
  115. package/dist/modules/horizontal/communities/api/route_trackings/routes.d.ts.map +1 -0
  116. package/dist/modules/horizontal/communities/api/route_trackings/routes.js +69 -0
  117. package/dist/modules/horizontal/communities/api/route_trackings/routes.js.map +1 -0
  118. package/dist/modules/horizontal/communities/api/route_trackings/zones.d.ts +11 -0
  119. package/dist/modules/horizontal/communities/api/route_trackings/zones.d.ts.map +1 -0
  120. package/dist/modules/horizontal/communities/api/route_trackings/zones.js +26 -0
  121. package/dist/modules/horizontal/communities/api/route_trackings/zones.js.map +1 -0
  122. package/dist/modules/horizontal/communities/index.d.ts +2 -2
  123. package/dist/modules/horizontal/communities/index.d.ts.map +1 -1
  124. package/dist/modules/horizontal/communities/index.js.map +1 -1
  125. package/dist/modules/horizontal/communities/types/address.d.ts +2 -2
  126. package/dist/modules/horizontal/communities/types/address.d.ts.map +1 -1
  127. package/dist/modules/horizontal/communities/types/agent.d.ts +2 -2
  128. package/dist/modules/horizontal/communities/types/agent.d.ts.map +1 -1
  129. package/dist/modules/horizontal/communities/types/block.d.ts +4 -5
  130. package/dist/modules/horizontal/communities/types/block.d.ts.map +1 -1
  131. package/dist/modules/horizontal/communities/types/community.d.ts +12 -5
  132. package/dist/modules/horizontal/communities/types/community.d.ts.map +1 -1
  133. package/dist/modules/horizontal/communities/types/community_config.d.ts.map +1 -1
  134. package/dist/modules/horizontal/communities/types/document.d.ts +2 -2
  135. package/dist/modules/horizontal/communities/types/document.d.ts.map +1 -1
  136. package/dist/modules/horizontal/communities/types/employee.d.ts +3 -3
  137. package/dist/modules/horizontal/communities/types/employee.d.ts.map +1 -1
  138. package/dist/modules/horizontal/communities/types/index.d.ts +10 -9
  139. package/dist/modules/horizontal/communities/types/index.d.ts.map +1 -1
  140. package/dist/modules/horizontal/communities/types/index.js +1 -0
  141. package/dist/modules/horizontal/communities/types/index.js.map +1 -1
  142. package/dist/modules/horizontal/communities/types/property.d.ts +6 -6
  143. package/dist/modules/horizontal/communities/types/property.d.ts.map +1 -1
  144. package/dist/modules/horizontal/communities/types/property.js.map +1 -1
  145. package/dist/modules/horizontal/communities/types/provider.d.ts +3 -3
  146. package/dist/modules/horizontal/communities/types/provider.d.ts.map +1 -1
  147. package/dist/modules/horizontal/communities/types/receipt.d.ts +7 -7
  148. package/dist/modules/horizontal/communities/types/receipt.d.ts.map +1 -1
  149. package/dist/modules/horizontal/communities/types/roles.d.ts +2 -2
  150. package/dist/modules/horizontal/communities/types/roles.d.ts.map +1 -1
  151. package/dist/modules/horizontal/communities/types/route_tracking.d.ts +53 -0
  152. package/dist/modules/horizontal/communities/types/route_tracking.d.ts.map +1 -0
  153. package/dist/modules/horizontal/communities/types/route_tracking.js +19 -0
  154. package/dist/modules/horizontal/communities/types/route_tracking.js.map +1 -0
  155. package/dist/modules/horizontal/communities/types/tag.d.ts.map +1 -1
  156. package/dist/modules/horizontal/index.d.ts +2 -2
  157. package/dist/modules/horizontal/index.d.ts.map +1 -1
  158. package/dist/modules/horizontal/index.js.map +1 -1
  159. package/dist/modules/index.d.ts +4 -3
  160. package/dist/modules/index.d.ts.map +1 -1
  161. package/dist/modules/index.js +1 -0
  162. package/dist/modules/index.js.map +1 -1
  163. package/dist/modules/ticketing/api.d.ts +6 -15
  164. package/dist/modules/ticketing/api.d.ts.map +1 -1
  165. package/dist/modules/ticketing/api.js +9 -38
  166. package/dist/modules/ticketing/api.js.map +1 -1
  167. package/dist/modules/ticketing/index.d.ts +2 -2
  168. package/dist/modules/ticketing/index.d.ts.map +1 -1
  169. package/dist/modules/ticketing/index.js +1 -1
  170. package/dist/modules/ticketing/index.js.map +1 -1
  171. package/dist/modules/ticketing/tasks/api/activity_logs.d.ts +10 -0
  172. package/dist/modules/ticketing/tasks/api/activity_logs.d.ts.map +1 -0
  173. package/dist/modules/ticketing/tasks/api/activity_logs.js +21 -0
  174. package/dist/modules/ticketing/tasks/api/activity_logs.js.map +1 -0
  175. package/dist/modules/ticketing/tasks/api/attachments.d.ts +8 -0
  176. package/dist/modules/ticketing/tasks/api/attachments.d.ts.map +1 -0
  177. package/dist/modules/ticketing/tasks/api/attachments.js +16 -0
  178. package/dist/modules/ticketing/tasks/api/attachments.js.map +1 -0
  179. package/dist/modules/ticketing/tasks/api/conversations.d.ts +11 -0
  180. package/dist/modules/ticketing/tasks/api/conversations.d.ts.map +1 -0
  181. package/dist/modules/ticketing/tasks/api/conversations.js +35 -0
  182. package/dist/modules/ticketing/tasks/api/conversations.js.map +1 -0
  183. package/dist/modules/ticketing/tasks/api/followers.d.ts +11 -0
  184. package/dist/modules/ticketing/tasks/api/followers.d.ts.map +1 -0
  185. package/dist/modules/ticketing/tasks/api/followers.js +24 -0
  186. package/dist/modules/ticketing/tasks/api/followers.js.map +1 -0
  187. package/dist/modules/ticketing/tasks/api/index.d.ts +7 -0
  188. package/dist/modules/ticketing/tasks/api/index.d.ts.map +1 -0
  189. package/dist/modules/ticketing/tasks/api/index.js +23 -0
  190. package/dist/modules/ticketing/tasks/api/index.js.map +1 -0
  191. package/dist/modules/ticketing/tasks/api/resources.d.ts +11 -0
  192. package/dist/modules/ticketing/tasks/api/resources.d.ts.map +1 -0
  193. package/dist/modules/ticketing/tasks/api/resources.js +24 -0
  194. package/dist/modules/ticketing/tasks/api/resources.js.map +1 -0
  195. package/dist/modules/ticketing/tasks/api/tasks.d.ts +18 -0
  196. package/dist/modules/ticketing/tasks/api/tasks.d.ts.map +1 -0
  197. package/dist/modules/ticketing/tasks/api/tasks.js +51 -0
  198. package/dist/modules/ticketing/tasks/api/tasks.js.map +1 -0
  199. package/dist/modules/ticketing/tasks/index.d.ts +3 -0
  200. package/dist/modules/ticketing/tasks/index.d.ts.map +1 -0
  201. package/dist/modules/ticketing/tasks/index.js +19 -0
  202. package/dist/modules/ticketing/tasks/index.js.map +1 -0
  203. package/dist/modules/ticketing/tasks/types/activity_log.d.ts +28 -0
  204. package/dist/modules/ticketing/tasks/types/activity_log.d.ts.map +1 -0
  205. package/dist/modules/ticketing/tasks/types/activity_log.js +24 -0
  206. package/dist/modules/ticketing/tasks/types/activity_log.js.map +1 -0
  207. package/dist/modules/ticketing/tasks/types/converstation.d.ts +31 -0
  208. package/dist/modules/ticketing/tasks/types/converstation.d.ts.map +1 -0
  209. package/dist/modules/ticketing/tasks/types/converstation.js +11 -0
  210. package/dist/modules/ticketing/tasks/types/converstation.js.map +1 -0
  211. package/dist/modules/ticketing/tasks/types/follower.d.ts +8 -0
  212. package/dist/modules/ticketing/tasks/types/follower.d.ts.map +1 -0
  213. package/dist/modules/ticketing/tasks/types/follower.js +3 -0
  214. package/dist/modules/ticketing/tasks/types/follower.js.map +1 -0
  215. package/dist/modules/ticketing/tasks/types/index.d.ts +6 -0
  216. package/dist/modules/ticketing/tasks/types/index.d.ts.map +1 -0
  217. package/dist/modules/ticketing/tasks/types/index.js +22 -0
  218. package/dist/modules/ticketing/tasks/types/index.js.map +1 -0
  219. package/dist/modules/ticketing/tasks/types/resource.d.ts +18 -0
  220. package/dist/modules/ticketing/tasks/types/resource.d.ts.map +1 -0
  221. package/dist/modules/ticketing/tasks/types/resource.js +15 -0
  222. package/dist/modules/ticketing/tasks/types/resource.js.map +1 -0
  223. package/dist/modules/ticketing/tasks/types/task.d.ts +64 -0
  224. package/dist/modules/ticketing/tasks/types/task.d.ts.map +1 -0
  225. package/dist/modules/ticketing/tasks/types/task.js +25 -0
  226. package/dist/modules/ticketing/tasks/types/task.js.map +1 -0
  227. package/dist/types.d.ts.map +1 -1
  228. package/dist/utils/crud.d.ts +2 -2
  229. package/dist/utils/crud.d.ts.map +1 -1
  230. package/dist/utils/crud.js +6 -6
  231. package/dist/utils/crud.js.map +1 -1
  232. package/dist/utils/http.d.ts +16 -8
  233. package/dist/utils/http.d.ts.map +1 -1
  234. package/dist/utils/http.js +69 -23
  235. package/dist/utils/http.js.map +1 -1
  236. package/dist/utils/index.d.ts +3 -3
  237. package/dist/utils/index.d.ts.map +1 -1
  238. package/dist/utils/index.js.map +1 -1
  239. package/dist/utils/signature.d.ts.map +1 -1
  240. package/dist/utils/signature.js +2 -5
  241. package/dist/utils/signature.js.map +1 -1
  242. package/dist/utils/types.d.ts.map +1 -1
  243. package/package.json +17 -3
@@ -16,7 +16,7 @@ class HTTPClient {
16
16
  this._client = axios_1.default.create({
17
17
  baseURL: this._config.baseURL,
18
18
  headers: {
19
- "Content-Type": "application/json",
19
+ 'Content-Type': 'application/json',
20
20
  },
21
21
  });
22
22
  // Interceptor para agregar headers de autenticación
@@ -26,22 +26,22 @@ class HTTPClient {
26
26
  data = {};
27
27
  // Remover Content-Type para que axios lo establezca automáticamente con el boundary
28
28
  if (config.headers) {
29
- config.headers.delete("Content-Type");
29
+ config.headers.delete('Content-Type');
30
30
  }
31
31
  }
32
32
  const signatureData = (0, signature_1.generateSignature)(data, this._config.apiKey, this._config.apiSecret);
33
33
  // Manejar query params
34
34
  if (config.params) {
35
- const queryStr = querystring_1.default.stringify(config.params);
35
+ const queryStr = _buildQueryString(config.params);
36
36
  config.url = `${config.url}?${queryStr}`;
37
37
  config.params = undefined; // Limpiamos params ya que los incluimos en la URL
38
38
  }
39
39
  if (config.headers) {
40
- config.headers.set("x-api-key", this._config.apiKey);
41
- config.headers.set("x-timestamp", signatureData.timestamp.toString());
42
- config.headers.set("x-signature", signatureData.signature);
40
+ config.headers.set('x-api-key', this._config.apiKey);
41
+ config.headers.set('x-timestamp', signatureData.timestamp.toString());
42
+ config.headers.set('x-signature', signatureData.signature);
43
43
  }
44
- console.log("config", config.headers);
44
+ console.log(`>> HTTP REQUEST: [${config.method?.toLocaleUpperCase()}] ${config.url}`);
45
45
  return config;
46
46
  });
47
47
  // Interceptor para manejar respuestas
@@ -50,66 +50,112 @@ class HTTPClient {
50
50
  return response;
51
51
  }, (error) => {
52
52
  const apiError = {
53
- code: error.response?.data?.code || "UNKNOWN_ERROR",
54
- message: error.response?.data?.message || "An unexpected error occurred",
53
+ code: error.response?.data?.code || 'UNKNOWN_ERROR',
54
+ message: error.response?.data?.message || 'An unexpected error occurred',
55
55
  errors: error.response?.data?.errors || [],
56
56
  };
57
57
  return Promise.reject(apiError);
58
58
  });
59
59
  }
60
60
  async get(path, params) {
61
- console.log("get", path, params);
62
61
  const response = await this._client.get(path, { params });
63
62
  return response.data;
64
63
  }
65
64
  async post(path, data, params) {
66
- console.log("post", path, data, params);
67
65
  const response = await this._client.post(path, data, {
68
66
  params,
69
67
  });
70
68
  return response.data;
71
69
  }
72
70
  async put(path, data, params) {
73
- console.log("put", path, data, params);
74
71
  const response = await this._client.put(path, data, {
75
72
  params,
76
73
  });
77
74
  return response.data;
78
75
  }
79
76
  async patch(path, data, params) {
80
- console.log("patch", path, data, params);
81
77
  const response = await this._client.patch(path, data, {
82
78
  params,
83
79
  });
84
80
  return response.data;
85
81
  }
86
82
  async delete(path, params) {
87
- console.log("delete", path, params);
88
83
  const response = await this._client.delete(path, {
89
84
  params,
90
85
  });
91
86
  return response.data;
92
87
  }
93
88
  async getBinary(path, params) {
94
- console.log("getBinary", path, params);
95
89
  const response = await this._client.get(path, {
96
90
  params,
97
- responseType: "arraybuffer",
91
+ responseType: 'arraybuffer',
98
92
  });
99
93
  return Buffer.from(response.data);
100
94
  }
101
- async uploadFile(path, fileName, fileData, fieldName = "file", params) {
102
- console.log("uploadFile", path, fileName, fieldName);
103
- const file = new File([fileData], fileName, {
104
- type: mime_types_1.default.lookup(fileName).toString(),
95
+ async uploadFile(path, data, params) {
96
+ const file = new File([data.file.data], data.file.name, {
97
+ type: mime_types_1.default.lookup(data.file.name).toString(),
105
98
  });
106
- const formData = new FormData();
107
- formData.append(fieldName, file, fileName);
108
- const response = await this._client.post(path, formData, {
99
+ const fd = new FormData();
100
+ fd.append(data.file.field || 'file', file, data.file.name);
101
+ Object.entries(data).forEach(([key, value]) => {
102
+ if (key === 'file')
103
+ return;
104
+ if (value === undefined)
105
+ return;
106
+ if (Array.isArray(value)) {
107
+ value.forEach((sv, i) => {
108
+ fd.append(`${key}[${i}]`, sv.toString());
109
+ });
110
+ }
111
+ else if (typeof value === 'object' && value !== null) {
112
+ Object.entries(value).forEach(([sk, sv]) => {
113
+ if (sv === undefined)
114
+ return;
115
+ fd.append(`${key}[${sk}]`, sv === null ? 'null' : sv.toString());
116
+ });
117
+ }
118
+ else {
119
+ fd.append(key, value === null ? 'null' : value.toString());
120
+ }
121
+ });
122
+ const response = await this._client.post(path, fd, {
109
123
  params,
110
124
  });
111
125
  return response.data;
112
126
  }
113
127
  }
114
128
  exports.HTTPClient = HTTPClient;
129
+ function _deepBuildQuery(acc, obj, prefix) {
130
+ Object.entries(obj).forEach(([key, val]) => {
131
+ if (!val)
132
+ return;
133
+ const newPrefix = prefix ? `${prefix}[${key}]` : key;
134
+ if (Array.isArray(val)) {
135
+ val.forEach((v, i) => {
136
+ acc[`${newPrefix}[${i}]`] = v.toString();
137
+ });
138
+ }
139
+ else if (typeof val === 'object' && val !== null) {
140
+ _deepBuildQuery(acc, val, newPrefix);
141
+ }
142
+ else {
143
+ acc[newPrefix] = val.toString();
144
+ }
145
+ });
146
+ }
147
+ function _buildQueryString(query) {
148
+ const reqQuery = {};
149
+ Object.entries(query).forEach(([key, value]) => {
150
+ if (!value)
151
+ return;
152
+ if (typeof value === 'object' && value !== null) {
153
+ _deepBuildQuery(reqQuery, value, key);
154
+ }
155
+ else {
156
+ reqQuery[key] = value.toString();
157
+ }
158
+ });
159
+ return querystring_1.default.stringify(reqQuery);
160
+ }
115
161
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/utils/http.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAE7C,2CAAgD;AAChD,8DAAsC;AACtC,4DAA8B;AAQ9B,MAAa,UAAU;IAGD;IAFZ,OAAO,CAAgB;IAE/B,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QAC3C,IAAI,CAAC,OAAO,GAAG,eAAK,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAC;QAEH,oDAAoD;QACpD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC/C,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YAE7B,IAAI,MAAM,CAAC,IAAI,YAAY,QAAQ,EAAE,CAAC;gBACpC,IAAI,GAAG,EAAE,CAAC;gBAEV,oFAAoF;gBACpF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC;YAED,MAAM,aAAa,GAAG,IAAA,6BAAiB,EACrC,IAAI,EACJ,IAAI,CAAC,OAAO,CAAC,MAAM,E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,IAAI,EAAE,CAAC;YACnD,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAA;QACjC,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAmB,KAAQ;IACnD,MAAM,QAAQ,GAA2B,EAAE,CAAA;IAE3C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC7C,IAAI,CAAC,KAAK;YAAE,OAAM;QAElB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAChD,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QACvC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;QAClC,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,qBAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;AACxC,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from "./http";
2
- export * from "./signature";
3
- export * from "./crud";
1
+ export * from './http';
2
+ export * from './signature';
3
+ export * from './crud';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,8CAA4B;AAC5B,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,8CAA2B;AAC3B,yCAAsB"}
@@ -1 +1 @@
1
- {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/utils/signature.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,aAAa,CAaf"}
1
+ {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/utils/signature.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa,CAUjG"}
@@ -6,12 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.generateSignature = generateSignature;
7
7
  const crypto_1 = __importDefault(require("crypto"));
8
8
  function generateSignature(body, apiKey, apiSecret) {
9
- const bodyStr = JSON.stringify(body, null, 0) || "";
9
+ const bodyStr = JSON.stringify(body, null, 0) || '';
10
10
  const timestamp = Date.now();
11
- const signature = crypto_1.default
12
- .createHmac("sha256", apiSecret)
13
- .update(`${bodyStr}:${timestamp}:${apiKey}`)
14
- .digest("hex");
11
+ const signature = crypto_1.default.createHmac('sha256', apiSecret).update(`${bodyStr}:${timestamp}:${apiKey}`).digest('hex');
15
12
  return {
16
13
  signature,
17
14
  timestamp,
@@ -1 +1 @@
1
- {"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src/utils/signature.ts"],"names":[],"mappings":";;;;;AAOA,8CAiBC;AAxBD,oDAA4B;AAO5B,SAAgB,iBAAiB,CAC/B,IAAa,EACb,MAAc,EACd,SAAiB;IAEjB,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,MAAM,SAAS,GAAG,gBAAM;SACrB,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC/B,MAAM,CAAC,GAAG,OAAO,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;SAC3C,MAAM,CAAC,KAAK,CAAC,CAAC;IAEjB,OAAO;QACL,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src/utils/signature.ts"],"names":[],"mappings":";;;;;AAOA,8CAUC;AAjBD,oDAA2B;AAO3B,SAAgB,iBAAiB,CAAC,IAAa,EAAE,MAAc,EAAE,SAAiB;IAChF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAE5B,MAAM,SAAS,GAAG,gBAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,OAAO,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAElH,OAAO;QACL,SAAS;QACT,SAAS;KACV,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleva-io/erp-sdk",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "SDK oficial para el ERP de Eleva",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,14 +16,27 @@
16
16
  "author": "Eleva",
17
17
  "license": "MIT",
18
18
  "devDependencies": {
19
+ "@types/jest": "30.0.0",
19
20
  "@types/mime-types": "3.0.1",
20
21
  "@types/node": "^20.19.1",
22
+ "@typescript-eslint/eslint-plugin": "8.35.0",
23
+ "@typescript-eslint/parser": "8.35.0",
21
24
  "dotenv": "^16.5.0",
25
+ "eslint": "9.29.0",
26
+ "eslint-config-prettier": "10.1.5",
27
+ "eslint-plugin-jest": "29.0.1",
28
+ "eslint-plugin-prettier": "5.5.1",
29
+ "jest": "30.0.3",
30
+ "prettier": "3.6.1",
31
+ "ts-jest": "29.4.0",
32
+ "ts-node": "10.9.2",
22
33
  "tsc-alias": "1.8.16",
23
34
  "tsx": "^4.20.3",
24
35
  "typescript": "^5.8.3"
25
36
  },
26
37
  "dependencies": {
38
+ "@eslint/eslintrc": "3.3.1",
39
+ "@eslint/js": "9.29.0",
27
40
  "axios": "^1.10.0",
28
41
  "mime-types": "3.0.1",
29
42
  "moment": "2.30.1"
@@ -37,8 +50,9 @@
37
50
  },
38
51
  "scripts": {
39
52
  "build": "pnpm tsc && pnpm tsc-alias",
40
- "test": "jest",
41
- "dev": "pnpm tsc --watch",
53
+ "test": "jest --config ./jest.config.ts",
54
+ "lint": "eslint 'src/**/*.{ts,tsx}' --fix",
55
+ "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
42
56
  "sandbox": "tsx sandbox/index.ts",
43
57
  "sandbox:watch": "tsx watch sandbox/index.ts"
44
58
  }