@agroyaar/sdk 1.5.7 → 2.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.
package/dist/index.cjs CHANGED
@@ -65,6 +65,15 @@ var createClient = (config, middlewares = []) => {
65
65
  "Content-Type": "application/json"
66
66
  }
67
67
  });
68
+ client.typed = async function(method, path, config2) {
69
+ const res = await client.request({
70
+ method,
71
+ url: path,
72
+ params: config2?.params,
73
+ data: config2?.body
74
+ });
75
+ return res.data;
76
+ };
68
77
  for (const middleware of middlewares) {
69
78
  client.interceptors.request.use(middleware);
70
79
  }
@@ -261,8 +270,14 @@ var createMechanizationServices = (client) => ({
261
270
  varietyId
262
271
  }) => {
263
272
  try {
264
- const { data } = await client.get(
265
- `/statics/mechanizations-questions?mechanizationVarietyId=${varietyId}`
273
+ const data = await client.typed(
274
+ "get",
275
+ "/statics/mechanizations-questions",
276
+ {
277
+ params: {
278
+ mechanizationVarietyId: varietyId
279
+ }
280
+ }
266
281
  );
267
282
  return import_ts_belt2.R.Ok(
268
283
  mappers.getQuestions(data.result.data.mechanizationsQuestions)