@agroyaar/sdk 2.3.0-0 → 2.3.0-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
@@ -197,7 +197,15 @@ var mappers2 = {
197
197
  engineWaterTemperature,
198
198
  date
199
199
  }),
200
- getMechanizationTemperatureChanges: (response) => response.map(mappers2.getMechanizationTemperatureChange)
200
+ getMechanizationTemperatureChanges: (response) => response.map(mappers2.getMechanizationTemperatureChange),
201
+ getMechanizationFuelConsumptionChange: ({
202
+ fuelConsumption,
203
+ date
204
+ }) => ({
205
+ fuelConsumption,
206
+ date
207
+ }),
208
+ getMechanizationFuelConsumptionChanges: (response) => response.map(mappers2.getMechanizationFuelConsumptionChange)
201
209
  };
202
210
  var createMechanizationTemperatureChangesServices = (client) => ({
203
211
  getMechanizationTemperatureChanges: async ({
@@ -228,6 +236,35 @@ var createMechanizationTemperatureChangesServices = (client) => ({
228
236
  } catch (error) {
229
237
  return wrapError(error);
230
238
  }
239
+ },
240
+ getMechanizationFuelConsumptionChanges: async ({
241
+ farmerId,
242
+ mechanizationId,
243
+ fromDate,
244
+ toDate
245
+ }) => {
246
+ try {
247
+ const response = await client.typed(
248
+ "get",
249
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}/sensors/fuel-consumption-changes",
250
+ {
251
+ params: {
252
+ fromDate,
253
+ toDate
254
+ },
255
+ pathParams: {
256
+ farmerId,
257
+ mechanizationId
258
+ }
259
+ }
260
+ );
261
+ const fuelConsumptionChanges = response.result.data.fuelConsumptionChanges;
262
+ return import_ts_belt2.R.Ok(
263
+ mappers2.getMechanizationFuelConsumptionChanges(fuelConsumptionChanges)
264
+ );
265
+ } catch (error) {
266
+ return wrapError(error);
267
+ }
231
268
  }
232
269
  });
233
270
 
package/dist/index.d.ts CHANGED
@@ -2969,6 +2969,16 @@ type MechanizationTemperatureChangesVariable = {
2969
2969
  fromDate?: string | null | undefined;
2970
2970
  toDate?: string | null | undefined;
2971
2971
  };
2972
+ type MechanizationFuelConsumptionChangesModel = {
2973
+ fuelConsumption: number;
2974
+ date: string;
2975
+ };
2976
+ type MechanizationFuelConsumptionChangesVariable = {
2977
+ farmerId: string;
2978
+ mechanizationId: string;
2979
+ fromDate?: string | null | undefined;
2980
+ toDate?: string | null | undefined;
2981
+ };
2972
2982
 
2973
2983
  type ClientConfig = {
2974
2984
  readonly baseURL: string;
@@ -2979,6 +2989,7 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
2979
2989
  dashboardServices: {
2980
2990
  mechanization: {
2981
2991
  getMechanizationTemperatureChanges: ({ farmerId, mechanizationId, fromDate, toDate, }: MechanizationTemperatureChangesVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationTemperatureChangesModel[]>>;
2992
+ getMechanizationFuelConsumptionChanges: ({ farmerId, mechanizationId, fromDate, toDate, }: MechanizationFuelConsumptionChangesVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationFuelConsumptionChangesModel[]>>;
2982
2993
  getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationVarietyModel[]>>;
2983
2994
  getSpeedChangesChartData: ({ farmerId, mechanizationId, }: SpeedChangesChartVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SpeedChangesChartModel[]>>;
2984
2995
  getMechanization: ({ farmerId, mechanizationId, }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel>>;
@@ -2994,4 +3005,4 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
2994
3005
  };
2995
3006
  };
2996
3007
 
2997
- export { type DeleteTrackingDeviceVariables, type GetMechanizationQuestionVariable, Identifiers, type MechanizationMachineUsageKind, type MechanizationMachineUsageType, type MechanizationModel, type MechanizationMovementChangesModel, type MechanizationMovementChangesVariable, type MechanizationQuestionModel, type MechanizationSeasonProcessKind, type MechanizationSeasonProcessType, type MechanizationType, type MechanizationVariables, type MechanizationVarietyModel, type MechanizationVarietyVariables, type MechanizationsVariables, type MotorizedMechanizationSensorsModel, type MotorizedMechanizationSensorsVariables, type SeasonsProcessModel, type ServiceType, type SpeedChangesChartModel, type SpeedChangesChartVariables, type Status, type StatusType, type SubmitTrackingDeviceVariables, type TaskType, type TrackingDeviceCodeModel, type UpdateTrackingDeviceVariables, type VarietyKind, createSDK };
3008
+ export { type DeleteTrackingDeviceVariables, type GetMechanizationQuestionVariable, Identifiers, type MechanizationFuelConsumptionChangesModel, type MechanizationFuelConsumptionChangesVariable, type MechanizationMachineUsageKind, type MechanizationMachineUsageType, type MechanizationModel, type MechanizationMovementChangesModel, type MechanizationMovementChangesVariable, type MechanizationQuestionModel, type MechanizationSeasonProcessKind, type MechanizationSeasonProcessType, type MechanizationTemperatureChangesModel, type MechanizationTemperatureChangesVariable, type MechanizationType, type MechanizationVariables, type MechanizationVarietyModel, type MechanizationVarietyVariables, type MechanizationsVariables, type MotorizedMechanizationSensorsModel, type MotorizedMechanizationSensorsVariables, type SeasonsProcessModel, type ServiceType, type SpeedChangesChartModel, type SpeedChangesChartVariables, type Status, type StatusType, type SubmitTrackingDeviceVariables, type TaskType, type TrackingDeviceCodeModel, type UpdateTrackingDeviceVariables, type VarietyKind, createSDK };
package/dist/index.mjs CHANGED
@@ -161,7 +161,15 @@ var mappers2 = {
161
161
  engineWaterTemperature,
162
162
  date
163
163
  }),
164
- getMechanizationTemperatureChanges: (response) => response.map(mappers2.getMechanizationTemperatureChange)
164
+ getMechanizationTemperatureChanges: (response) => response.map(mappers2.getMechanizationTemperatureChange),
165
+ getMechanizationFuelConsumptionChange: ({
166
+ fuelConsumption,
167
+ date
168
+ }) => ({
169
+ fuelConsumption,
170
+ date
171
+ }),
172
+ getMechanizationFuelConsumptionChanges: (response) => response.map(mappers2.getMechanizationFuelConsumptionChange)
165
173
  };
166
174
  var createMechanizationTemperatureChangesServices = (client) => ({
167
175
  getMechanizationTemperatureChanges: async ({
@@ -192,6 +200,35 @@ var createMechanizationTemperatureChangesServices = (client) => ({
192
200
  } catch (error) {
193
201
  return wrapError(error);
194
202
  }
203
+ },
204
+ getMechanizationFuelConsumptionChanges: async ({
205
+ farmerId,
206
+ mechanizationId,
207
+ fromDate,
208
+ toDate
209
+ }) => {
210
+ try {
211
+ const response = await client.typed(
212
+ "get",
213
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}/sensors/fuel-consumption-changes",
214
+ {
215
+ params: {
216
+ fromDate,
217
+ toDate
218
+ },
219
+ pathParams: {
220
+ farmerId,
221
+ mechanizationId
222
+ }
223
+ }
224
+ );
225
+ const fuelConsumptionChanges = response.result.data.fuelConsumptionChanges;
226
+ return R2.Ok(
227
+ mappers2.getMechanizationFuelConsumptionChanges(fuelConsumptionChanges)
228
+ );
229
+ } catch (error) {
230
+ return wrapError(error);
231
+ }
195
232
  }
196
233
  });
197
234
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "2.3.0-0",
3
+ "version": "2.3.0-2",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",