@agroyaar/sdk 1.0.5 → 1.0.7

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
@@ -85,11 +85,7 @@ var mappers = {
85
85
  id: response.id,
86
86
  name: response.name,
87
87
  iconURL: response.iconURL,
88
- kind: {
89
- id: response.kind.id,
90
- label: response.kind.label,
91
- name: response.kind.name
92
- },
88
+ kind: response.kind,
93
89
  seasonProcessIds: response.seasonProcessIds,
94
90
  machineUsageIds: response.machineUsageIds
95
91
  }),
@@ -105,13 +101,15 @@ var createMechanizationServices = (client) => ({
105
101
  const { data } = await client.get(
106
102
  `/statics/mechanizations-varieties?kindName=${kindName}`
107
103
  );
108
- return data && import_ts_belt.R.Ok(
104
+ return import_ts_belt.R.Ok(
109
105
  mappers.getMechanizationVarietyList(
110
106
  data.result.data.mechanizationVarieties
111
107
  )
112
108
  );
113
- } catch (_error) {
114
- return import_ts_belt.R.Error(new Error());
109
+ } catch (error) {
110
+ const err = error instanceof Error ? error : new Error(String(error));
111
+ console.error("MechanizationVariety API Error:", err);
112
+ return import_ts_belt.R.Error(err);
115
113
  }
116
114
  }
117
115
  });
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;
@@ -6,18 +8,13 @@ type Branded<T, B> = Brand<B> & T;
6
8
 
7
9
  declare namespace Identifiers {
8
10
  type MechanizationVarietyId = Branded<string, "mechanizationVarietyId-id">;
9
- type KindId = Branded<string, "kind-id">;
10
11
  }
11
12
 
12
13
  type MechanizationVarietyModel = {
13
14
  id: Identifiers.MechanizationVarietyId;
14
15
  name: string;
15
16
  iconURL: string;
16
- kind: {
17
- id: Identifiers.KindId;
18
- label: string;
19
- name: string;
20
- };
17
+ kind: string;
21
18
  seasonProcessIds: string[];
22
19
  machineUsageIds: string[];
23
20
  };
@@ -33,7 +30,7 @@ type ClientConfig = {
33
30
  declare const createSDK: (config: ClientConfig) => {
34
31
  dashboardServices: {
35
32
  mechanization: {
36
- getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<any>;
33
+ getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<_mobily_ts_belt.Ok<MechanizationVarietyModel[]> | _mobily_ts_belt.Error<Error>>;
37
34
  };
38
35
  };
39
36
  };
package/dist/index.mjs CHANGED
@@ -49,11 +49,7 @@ var mappers = {
49
49
  id: response.id,
50
50
  name: response.name,
51
51
  iconURL: response.iconURL,
52
- kind: {
53
- id: response.kind.id,
54
- label: response.kind.label,
55
- name: response.kind.name
56
- },
52
+ kind: response.kind,
57
53
  seasonProcessIds: response.seasonProcessIds,
58
54
  machineUsageIds: response.machineUsageIds
59
55
  }),
@@ -69,13 +65,15 @@ var createMechanizationServices = (client) => ({
69
65
  const { data } = await client.get(
70
66
  `/statics/mechanizations-varieties?kindName=${kindName}`
71
67
  );
72
- return data && R.Ok(
68
+ return R.Ok(
73
69
  mappers.getMechanizationVarietyList(
74
70
  data.result.data.mechanizationVarieties
75
71
  )
76
72
  );
77
- } catch (_error) {
78
- return R.Error(new Error());
73
+ } catch (error) {
74
+ const err = error instanceof Error ? error : new Error(String(error));
75
+ console.error("MechanizationVariety API Error:", err);
76
+ return R.Error(err);
79
77
  }
80
78
  }
81
79
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",