@agroyaar/sdk 1.0.4 → 1.0.6

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
@@ -92,7 +92,8 @@ var mappers = {
92
92
  },
93
93
  seasonProcessIds: response.seasonProcessIds,
94
94
  machineUsageIds: response.machineUsageIds
95
- })
95
+ }),
96
+ getMechanizationVarietyList: (response) => response.map(mappers.getMechanizationVariety)
96
97
  };
97
98
 
98
99
  // src/services/dashboard/mechanization/mechanization.service.ts
@@ -104,13 +105,15 @@ var createMechanizationServices = (client) => ({
104
105
  const { data } = await client.get(
105
106
  `/statics/mechanizations-varieties?kindName=${kindName}`
106
107
  );
107
- return data && import_ts_belt.R.Ok(
108
- mappers.getMechanizationVariety(
108
+ return import_ts_belt.R.Ok(
109
+ mappers.getMechanizationVarietyList(
109
110
  data.result.data.mechanizationVarieties
110
111
  )
111
112
  );
112
- } catch (_error) {
113
- return import_ts_belt.R.Error(new Error());
113
+ } catch (error) {
114
+ const err = error instanceof Error ? error : new Error(String(error));
115
+ console.error("MechanizationVariety API Error:", err);
116
+ return import_ts_belt.R.Error(err);
114
117
  }
115
118
  }
116
119
  });
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as _mobily_ts_belt from '@mobily/ts-belt';
2
+
1
3
  declare const __brand: unique symbol;
2
4
  type Brand<B> = {
3
5
  readonly [__brand]: B;
@@ -33,7 +35,7 @@ type ClientConfig = {
33
35
  declare const createSDK: (config: ClientConfig) => {
34
36
  dashboardServices: {
35
37
  mechanization: {
36
- getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<any>;
38
+ getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<_mobily_ts_belt.Ok<MechanizationVarietyModel[]> | _mobily_ts_belt.Error<Error>>;
37
39
  };
38
40
  };
39
41
  };
package/dist/index.mjs CHANGED
@@ -56,7 +56,8 @@ var mappers = {
56
56
  },
57
57
  seasonProcessIds: response.seasonProcessIds,
58
58
  machineUsageIds: response.machineUsageIds
59
- })
59
+ }),
60
+ getMechanizationVarietyList: (response) => response.map(mappers.getMechanizationVariety)
60
61
  };
61
62
 
62
63
  // src/services/dashboard/mechanization/mechanization.service.ts
@@ -68,13 +69,15 @@ var createMechanizationServices = (client) => ({
68
69
  const { data } = await client.get(
69
70
  `/statics/mechanizations-varieties?kindName=${kindName}`
70
71
  );
71
- return data && R.Ok(
72
- mappers.getMechanizationVariety(
72
+ return R.Ok(
73
+ mappers.getMechanizationVarietyList(
73
74
  data.result.data.mechanizationVarieties
74
75
  )
75
76
  );
76
- } catch (_error) {
77
- return R.Error(new Error());
77
+ } catch (error) {
78
+ const err = error instanceof Error ? error : new Error(String(error));
79
+ console.error("MechanizationVariety API Error:", err);
80
+ return R.Error(err);
78
81
  }
79
82
  }
80
83
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",