@agroyaar/sdk 2.1.4 → 2.2.1-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
@@ -177,7 +177,11 @@ var mappers = {
177
177
  date,
178
178
  heading
179
179
  }),
180
- getMechanizationMovementChanges: (response) => response.map(mappers.getMechanizationMovementChange)
180
+ getMechanizationMovementChanges: (response) => response.map(mappers.getMechanizationMovementChange),
181
+ verifyPhoneNumber: (dto) => ({
182
+ phoneNumber: dto.phoneNumber,
183
+ verificationToken: dto.verificationToken
184
+ })
181
185
  };
182
186
 
183
187
  // src/utils/wrapError.ts
@@ -189,16 +193,6 @@ var wrapError = (error) => {
189
193
 
190
194
  // src/services/dashboard/mechanization/verifyPhoneNumber/v.service.ts
191
195
  var import_ts_belt2 = require("@mobily/ts-belt");
192
-
193
- // src/services/dashboard/mechanization/verifyPhoneNumber/mapper.ts
194
- var mappers2 = {
195
- verifyPhoneNumber: (dto) => ({
196
- phoneNumber: dto.phoneNumber,
197
- verificationToken: dto.verificationToken
198
- })
199
- };
200
-
201
- // src/services/dashboard/mechanization/verifyPhoneNumber/v.service.ts
202
196
  var vfn = (client) => ({
203
197
  verifyPhoneNumber: async ({
204
198
  phoneNumber,
@@ -209,7 +203,7 @@ var vfn = (client) => ({
209
203
  phoneNumber,
210
204
  otpCode
211
205
  });
212
- return import_ts_belt2.R.Ok(mappers2.verifyPhoneNumber(data));
206
+ return import_ts_belt2.R.Ok(mappers.verifyPhoneNumber(data));
213
207
  } catch (error) {
214
208
  return wrapError(error);
215
209
  }
@@ -249,7 +243,28 @@ var createMechanizationServices = (client) => ({
249
243
  return wrapError(error);
250
244
  }
251
245
  },
252
- getMechanizations: async ({ farmerId, kindName }) => {
246
+ getMechanization: async ({ farmerId, mechanizationId }) => {
247
+ try {
248
+ const response = await client.typed(
249
+ "get",
250
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}",
251
+ {
252
+ pathParams: {
253
+ farmerId,
254
+ mechanizationId
255
+ }
256
+ }
257
+ );
258
+ const mechanization = response.result.data.mechanization;
259
+ return import_ts_belt3.R.Ok(mappers.getMechanization(mechanization));
260
+ } catch (error) {
261
+ return wrapError(error);
262
+ }
263
+ },
264
+ getMechanizations: async ({
265
+ farmerId,
266
+ kindName
267
+ }) => {
253
268
  try {
254
269
  const response = await client.typed(
255
270
  "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;
@@ -151,7 +155,6 @@ type MechanizationMovementChangesVariable = {
151
155
  fromDate?: string | null | undefined;
152
156
  toDate?: string | null | undefined;
153
157
  };
154
-
155
158
  type VerifyPhoneNumberModel = {
156
159
  phoneNumber: string;
157
160
  verificationToken: string;
@@ -2975,7 +2978,8 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
2975
2978
  verifyPhoneNumber: ({ phoneNumber, otpCode, }: VerifyPhoneNumberVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<VerifyPhoneNumberModel>>;
2976
2979
  getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationVarietyModel[]>>;
2977
2980
  getSpeedChangesChartData: ({ farmerId, mechanizationId, }: SpeedChangesChartVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SpeedChangesChartModel[]>>;
2978
- getMechanizations: ({ farmerId, kindName }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
2981
+ getMechanization: ({ farmerId, mechanizationId }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel>>;
2982
+ getMechanizations: ({ farmerId, kindName, }: MechanizationsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
2979
2983
  getMotorizedMechanizationSensors: ({ farmerId, mechanizationId, }: MotorizedMechanizationSensorsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MotorizedMechanizationSensorsModel>>;
2980
2984
  SubmitTrackingDeviceCode: ({ farmerId, mechanizationId, deviceCode, }: SubmitTrackingDeviceVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<TrackingDeviceCodeModel>>;
2981
2985
  getSeasonsProcess: () => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SeasonsProcessModel[]>>;
@@ -2987,4 +2991,4 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
2987
2991
  };
2988
2992
  };
2989
2993
 
2990
- 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 };
2994
+ 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, type VerifyPhoneNumberModel, type VerifyPhoneNumberVariables, createSDK };
package/dist/index.mjs CHANGED
@@ -141,7 +141,11 @@ var mappers = {
141
141
  date,
142
142
  heading
143
143
  }),
144
- getMechanizationMovementChanges: (response) => response.map(mappers.getMechanizationMovementChange)
144
+ getMechanizationMovementChanges: (response) => response.map(mappers.getMechanizationMovementChange),
145
+ verifyPhoneNumber: (dto) => ({
146
+ phoneNumber: dto.phoneNumber,
147
+ verificationToken: dto.verificationToken
148
+ })
145
149
  };
146
150
 
147
151
  // src/utils/wrapError.ts
@@ -153,16 +157,6 @@ var wrapError = (error) => {
153
157
 
154
158
  // src/services/dashboard/mechanization/verifyPhoneNumber/v.service.ts
155
159
  import { R as R2 } from "@mobily/ts-belt";
156
-
157
- // src/services/dashboard/mechanization/verifyPhoneNumber/mapper.ts
158
- var mappers2 = {
159
- verifyPhoneNumber: (dto) => ({
160
- phoneNumber: dto.phoneNumber,
161
- verificationToken: dto.verificationToken
162
- })
163
- };
164
-
165
- // src/services/dashboard/mechanization/verifyPhoneNumber/v.service.ts
166
160
  var vfn = (client) => ({
167
161
  verifyPhoneNumber: async ({
168
162
  phoneNumber,
@@ -173,7 +167,7 @@ var vfn = (client) => ({
173
167
  phoneNumber,
174
168
  otpCode
175
169
  });
176
- return R2.Ok(mappers2.verifyPhoneNumber(data));
170
+ return R2.Ok(mappers.verifyPhoneNumber(data));
177
171
  } catch (error) {
178
172
  return wrapError(error);
179
173
  }
@@ -213,7 +207,28 @@ var createMechanizationServices = (client) => ({
213
207
  return wrapError(error);
214
208
  }
215
209
  },
216
- getMechanizations: async ({ farmerId, kindName }) => {
210
+ getMechanization: async ({ farmerId, mechanizationId }) => {
211
+ try {
212
+ const response = await client.typed(
213
+ "get",
214
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}",
215
+ {
216
+ pathParams: {
217
+ farmerId,
218
+ mechanizationId
219
+ }
220
+ }
221
+ );
222
+ const mechanization = response.result.data.mechanization;
223
+ return R3.Ok(mappers.getMechanization(mechanization));
224
+ } catch (error) {
225
+ return wrapError(error);
226
+ }
227
+ },
228
+ getMechanizations: async ({
229
+ farmerId,
230
+ kindName
231
+ }) => {
217
232
  try {
218
233
  const response = await client.typed(
219
234
  "get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "2.1.4",
3
+ "version": "2.2.1-0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",