@agroyaar/sdk 2.1.3 → 2.2.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
@@ -220,7 +220,28 @@ var createMechanizationServices = (client) => ({
220
220
  return wrapError(error);
221
221
  }
222
222
  },
223
- getMechanizations: async ({ farmerId, kindName }) => {
223
+ getMechanization: async ({ farmerId, mechanizationId }) => {
224
+ try {
225
+ const response = await client.typed(
226
+ "get",
227
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}",
228
+ {
229
+ pathParams: {
230
+ farmerId,
231
+ mechanizationId
232
+ }
233
+ }
234
+ );
235
+ const mechanization = response.result.data.mechanization;
236
+ return import_ts_belt2.R.Ok(mappers.getMechanization(mechanization));
237
+ } catch (error) {
238
+ return wrapError(error);
239
+ }
240
+ },
241
+ getMechanizations: async ({
242
+ farmerId,
243
+ kindName
244
+ }) => {
224
245
  try {
225
246
  const response = await client.typed(
226
247
  "get",
package/dist/index.d.ts CHANGED
@@ -68,10 +68,14 @@ type MechanizationModel = {
68
68
  kindName: MechanizationType;
69
69
  variety: MechanizationVarietyModel;
70
70
  };
71
- type MechanizationVariables = {
71
+ type MechanizationsVariables = {
72
72
  farmerId: string;
73
73
  kindName: MechanizationType;
74
74
  };
75
+ type MechanizationVariables = {
76
+ farmerId: string;
77
+ mechanizationId: string;
78
+ };
75
79
  type SeasonsProcessModel = {
76
80
  id: Identifiers.SeasonsProcessId;
77
81
  name: string;
@@ -2965,7 +2969,8 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
2965
2969
  mechanization: {
2966
2970
  getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationVarietyModel[]>>;
2967
2971
  getSpeedChangesChartData: ({ farmerId, mechanizationId, }: SpeedChangesChartVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SpeedChangesChartModel[]>>;
2968
- getMechanizations: ({ farmerId, kindName }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
2972
+ getMechanization: ({ farmerId, mechanizationId }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel>>;
2973
+ getMechanizations: ({ farmerId, kindName, }: MechanizationsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
2969
2974
  getMotorizedMechanizationSensors: ({ farmerId, mechanizationId, }: MotorizedMechanizationSensorsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MotorizedMechanizationSensorsModel>>;
2970
2975
  SubmitTrackingDeviceCode: ({ farmerId, mechanizationId, deviceCode, }: SubmitTrackingDeviceVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<TrackingDeviceCodeModel>>;
2971
2976
  getSeasonsProcess: () => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SeasonsProcessModel[]>>;
@@ -2977,4 +2982,4 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
2977
2982
  };
2978
2983
  };
2979
2984
 
2980
- 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 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 };
2985
+ 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 };
package/dist/index.mjs CHANGED
@@ -184,7 +184,28 @@ var createMechanizationServices = (client) => ({
184
184
  return wrapError(error);
185
185
  }
186
186
  },
187
- getMechanizations: async ({ farmerId, kindName }) => {
187
+ getMechanization: async ({ farmerId, mechanizationId }) => {
188
+ try {
189
+ const response = await client.typed(
190
+ "get",
191
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}",
192
+ {
193
+ pathParams: {
194
+ farmerId,
195
+ mechanizationId
196
+ }
197
+ }
198
+ );
199
+ const mechanization = response.result.data.mechanization;
200
+ return R2.Ok(mappers.getMechanization(mechanization));
201
+ } catch (error) {
202
+ return wrapError(error);
203
+ }
204
+ },
205
+ getMechanizations: async ({
206
+ farmerId,
207
+ kindName
208
+ }) => {
188
209
  try {
189
210
  const response = await client.typed(
190
211
  "get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "2.1.3",
3
+ "version": "2.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",