@agroyaar/sdk 1.1.6-0 → 1.4.1-2

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
@@ -99,21 +99,13 @@ var mappers = {
99
99
  variety: mappers.getMechanizationVariety(response.variety)
100
100
  }),
101
101
  getMechanizationsList: (response) => response.map(mappers.getMechanization),
102
- getMotorizedMechanizationSensors: (response) => ({
102
+ getSeasonsProcess: (response) => ({
103
103
  id: response.id,
104
- speed: response.speed,
105
- heading: response.heading,
106
- latitude: response.latitude,
107
- longitude: response.longitude,
108
- fuelLevel: response.fuelLevel,
109
- engineRpm: response.engineRpm,
110
- deviceCode: response.deviceCode,
111
- stateEngine: response.stateEngine,
112
- engineOilPressure: response.engineOilPressure,
113
- engineWaterTemperature: response.engineWaterTemperature,
114
- batteryChargePercentage: response.batteryChargePercentage,
115
- mechanizationId: response.mechanizationId
116
- })
104
+ label: response.label,
105
+ mechanizationVarietyIds: response.mechanizationVarietyIds,
106
+ name: response.name
107
+ }),
108
+ getSeasonsProcessList: (response) => response.map(mappers.getSeasonsProcess)
117
109
  };
118
110
 
119
111
  // src/services/dashboard/mechanization/mechanization.service.ts
@@ -136,10 +128,10 @@ var createMechanizationServices = (client) => ({
136
128
  return import_ts_belt.R.Error(err);
137
129
  }
138
130
  },
139
- getMechanizations: async ({ farmerId, kindName }) => {
131
+ getMechanizations: async ({ kindName }) => {
140
132
  try {
141
133
  const { data } = await client.get(
142
- `/farmers/${farmerId}/mechanizations?kindName=${kindName}`
134
+ `/farmers/681f11f87eeba74f9bb8f422/mechanizations?kindName=${kindName}`
143
135
  );
144
136
  return import_ts_belt.R.Ok(
145
137
  mappers.getMechanizationsList(data.result.data.mechanizations)
@@ -150,22 +142,19 @@ var createMechanizationServices = (client) => ({
150
142
  return import_ts_belt.R.Error(err);
151
143
  }
152
144
  },
153
- getMotorizedMechanizationSensors: async ({
154
- farmerId,
155
- mechanizationId
156
- }) => {
145
+ getSeasonsProcess: async () => {
157
146
  try {
158
147
  const { data } = await client.get(
159
- `/farmers/${farmerId}/mechanizations/${mechanizationId}/sensors`
148
+ "/statics/mechanizations-seasons-process-kinds"
160
149
  );
161
150
  return import_ts_belt.R.Ok(
162
- mappers.getMotorizedMechanizationSensors(
163
- data.result.data.mechanizations
151
+ mappers.getSeasonsProcessList(
152
+ data.result.data.mechanizationSeasonProcessKinds
164
153
  )
165
154
  );
166
155
  } catch (error) {
167
156
  const err = error instanceof Error ? error : new Error(String(error));
168
- console.error("Mechanization API Error:", err);
157
+ console.error("getSeasonsProcess API Error:", err);
169
158
  return import_ts_belt.R.Error(err);
170
159
  }
171
160
  }
package/dist/index.d.ts CHANGED
@@ -9,9 +9,9 @@ type Brand<B> = {
9
9
  type Branded<T, B> = Brand<B> & T;
10
10
 
11
11
  declare namespace Identifiers {
12
- type MechanizationVarietyId = Branded<string, "mechanizationVarietyId-id">;
13
- type MechanizationId = Branded<string, "mechanizationId-id">;
14
- type MotorizedMechanizationSensorsId = Branded<string, "motorized-mechanization-sensorsId-id">;
12
+ type MechanizationVarietyId = Branded<string, "mechanizationVariety-id">;
13
+ type MechanizationId = Branded<string, "mechanization-id">;
14
+ type SeasonsProcessId = Branded<string, " seasonsProcess-id">;
15
15
  }
16
16
 
17
17
  type ServiceType = "EXPERIMENT" | "VISIT" | "CHILLING_REQUIREMENT" | "CULTIVAR_RECOMMENDATION" | "FIRST_SAFFRON_IRRIGATION_DATE_RECOMMENDATION" | "HARVEST_DATE_RECOMMENDATION" | "QUESTIONNAIRE" | "SOWING_DATE_RECOMMENDATIONS" | "WEATHER_STATION" | "YIELD_GAP";
@@ -65,27 +65,13 @@ type MechanizationModel = {
65
65
  variety: MechanizationVarietyModel;
66
66
  };
67
67
  type MechanizationVariables = {
68
- farmerId: string;
69
68
  kindName: MechanizationType;
70
69
  };
71
- type MotorizedMechanizationSensorsModel = {
72
- id: string;
73
- speed: number;
74
- heading: string;
75
- latitude: number;
76
- longitude: number;
77
- fuelLevel: number;
78
- engineRpm: number;
79
- deviceCode: string;
80
- stateEngine: boolean;
81
- engineOilPressure: boolean;
82
- engineWaterTemperature: string;
83
- batteryChargePercentage: string;
84
- mechanizationId: string;
85
- };
86
- type MotorizedMechanizationSensorsVariables = {
87
- farmerId: string;
88
- mechanizationId: string;
70
+ type SeasonsProcessModel = {
71
+ id: Identifiers.SeasonsProcessId;
72
+ name: string;
73
+ label: string;
74
+ mechanizationVarietyIds: string[];
89
75
  };
90
76
 
91
77
  type ClientConfig = {
@@ -97,10 +83,10 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
97
83
  dashboardServices: {
98
84
  mechanization: {
99
85
  getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<_mobily_ts_belt.Ok<MechanizationVarietyModel[]> | _mobily_ts_belt.Error<Error>>;
100
- getMechanizations: ({ farmerId, kindName }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
101
- getMotorizedMechanizationSensors: ({ farmerId, mechanizationId, }: MotorizedMechanizationSensorsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MotorizedMechanizationSensorsModel>>;
86
+ getMechanizations: ({ kindName }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
87
+ getSeasonsProcess: () => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SeasonsProcessModel[]>>;
102
88
  };
103
89
  };
104
90
  };
105
91
 
106
- export { type MechanizationMachineUsageKind, type MechanizationMachineUsageType, type MechanizationModel, type MechanizationSeasonProcessKind, type MechanizationSeasonProcessType, type MechanizationType, type MechanizationVariables, type MechanizationVarietyModel, type MechanizationVarietyVariables, type MotorizedMechanizationSensorsModel, type MotorizedMechanizationSensorsVariables, type ServiceType, type Status, type StatusType, type TaskType, type VarietyKind, createSDK };
92
+ export { type MechanizationMachineUsageKind, type MechanizationMachineUsageType, type MechanizationModel, type MechanizationSeasonProcessKind, type MechanizationSeasonProcessType, type MechanizationType, type MechanizationVariables, type MechanizationVarietyModel, type MechanizationVarietyVariables, type SeasonsProcessModel, type ServiceType, type Status, type StatusType, type TaskType, type VarietyKind, createSDK };
package/dist/index.mjs CHANGED
@@ -63,21 +63,13 @@ var mappers = {
63
63
  variety: mappers.getMechanizationVariety(response.variety)
64
64
  }),
65
65
  getMechanizationsList: (response) => response.map(mappers.getMechanization),
66
- getMotorizedMechanizationSensors: (response) => ({
66
+ getSeasonsProcess: (response) => ({
67
67
  id: response.id,
68
- speed: response.speed,
69
- heading: response.heading,
70
- latitude: response.latitude,
71
- longitude: response.longitude,
72
- fuelLevel: response.fuelLevel,
73
- engineRpm: response.engineRpm,
74
- deviceCode: response.deviceCode,
75
- stateEngine: response.stateEngine,
76
- engineOilPressure: response.engineOilPressure,
77
- engineWaterTemperature: response.engineWaterTemperature,
78
- batteryChargePercentage: response.batteryChargePercentage,
79
- mechanizationId: response.mechanizationId
80
- })
68
+ label: response.label,
69
+ mechanizationVarietyIds: response.mechanizationVarietyIds,
70
+ name: response.name
71
+ }),
72
+ getSeasonsProcessList: (response) => response.map(mappers.getSeasonsProcess)
81
73
  };
82
74
 
83
75
  // src/services/dashboard/mechanization/mechanization.service.ts
@@ -100,10 +92,10 @@ var createMechanizationServices = (client) => ({
100
92
  return R.Error(err);
101
93
  }
102
94
  },
103
- getMechanizations: async ({ farmerId, kindName }) => {
95
+ getMechanizations: async ({ kindName }) => {
104
96
  try {
105
97
  const { data } = await client.get(
106
- `/farmers/${farmerId}/mechanizations?kindName=${kindName}`
98
+ `/farmers/681f11f87eeba74f9bb8f422/mechanizations?kindName=${kindName}`
107
99
  );
108
100
  return R.Ok(
109
101
  mappers.getMechanizationsList(data.result.data.mechanizations)
@@ -114,22 +106,19 @@ var createMechanizationServices = (client) => ({
114
106
  return R.Error(err);
115
107
  }
116
108
  },
117
- getMotorizedMechanizationSensors: async ({
118
- farmerId,
119
- mechanizationId
120
- }) => {
109
+ getSeasonsProcess: async () => {
121
110
  try {
122
111
  const { data } = await client.get(
123
- `/farmers/${farmerId}/mechanizations/${mechanizationId}/sensors`
112
+ "/statics/mechanizations-seasons-process-kinds"
124
113
  );
125
114
  return R.Ok(
126
- mappers.getMotorizedMechanizationSensors(
127
- data.result.data.mechanizations
115
+ mappers.getSeasonsProcessList(
116
+ data.result.data.mechanizationSeasonProcessKinds
128
117
  )
129
118
  );
130
119
  } catch (error) {
131
120
  const err = error instanceof Error ? error : new Error(String(error));
132
- console.error("Mechanization API Error:", err);
121
+ console.error("getSeasonsProcess API Error:", err);
133
122
  return R.Error(err);
134
123
  }
135
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "1.1.6-0",
3
+ "version": "1.4.1-2",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",