@agroyaar/sdk 2.1.4 → 2.3.0-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
@@ -187,29 +187,44 @@ var wrapError = (error) => {
187
187
  return import_ts_belt.R.Error(err);
188
188
  };
189
189
 
190
- // src/services/dashboard/mechanization/verifyPhoneNumber/v.service.ts
190
+ // src/services/dashboard/mechanization/temperature-changes.ts
191
191
  var import_ts_belt2 = require("@mobily/ts-belt");
192
-
193
- // src/services/dashboard/mechanization/verifyPhoneNumber/mapper.ts
194
192
  var mappers2 = {
195
- verifyPhoneNumber: (dto) => ({
196
- phoneNumber: dto.phoneNumber,
197
- verificationToken: dto.verificationToken
198
- })
193
+ getMechanizationTemperatureChange: ({
194
+ engineWaterTemperature,
195
+ date
196
+ }) => ({
197
+ engineWaterTemperature,
198
+ date
199
+ }),
200
+ getMechanizationTemperatureChanges: (response) => response.map(mappers2.getMechanizationTemperatureChange)
199
201
  };
200
-
201
- // src/services/dashboard/mechanization/verifyPhoneNumber/v.service.ts
202
- var vfn = (client) => ({
203
- verifyPhoneNumber: async ({
204
- phoneNumber,
205
- otpCode
202
+ var createMechanizationTemperatureChangesServices = (client) => ({
203
+ getMechanizationTemperatureChanges: async ({
204
+ farmerId,
205
+ mechanizationId,
206
+ fromDate,
207
+ toDate
206
208
  }) => {
207
209
  try {
208
- const { data } = await client.post(`/auth/verify-phone-number`, {
209
- phoneNumber,
210
- otpCode
211
- });
212
- return import_ts_belt2.R.Ok(mappers2.verifyPhoneNumber(data));
210
+ const response = await client.typed(
211
+ "get",
212
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}/sensors/temperature-changes",
213
+ {
214
+ params: {
215
+ fromDate,
216
+ toDate
217
+ },
218
+ pathParams: {
219
+ farmerId,
220
+ mechanizationId
221
+ }
222
+ }
223
+ );
224
+ const temperatureChanges = response.result.data.temperatureChanges;
225
+ return import_ts_belt2.R.Ok(
226
+ mappers2.getMechanizationTemperatureChanges(temperatureChanges)
227
+ );
213
228
  } catch (error) {
214
229
  return wrapError(error);
215
230
  }
@@ -249,7 +264,31 @@ var createMechanizationServices = (client) => ({
249
264
  return wrapError(error);
250
265
  }
251
266
  },
252
- getMechanizations: async ({ farmerId, kindName }) => {
267
+ getMechanization: async ({
268
+ farmerId,
269
+ mechanizationId
270
+ }) => {
271
+ try {
272
+ const response = await client.typed(
273
+ "get",
274
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}",
275
+ {
276
+ pathParams: {
277
+ farmerId,
278
+ mechanizationId
279
+ }
280
+ }
281
+ );
282
+ const mechanization = response.result.data.mechanization;
283
+ return import_ts_belt3.R.Ok(mappers.getMechanization(mechanization));
284
+ } catch (error) {
285
+ return wrapError(error);
286
+ }
287
+ },
288
+ getMechanizations: async ({
289
+ farmerId,
290
+ kindName
291
+ }) => {
253
292
  try {
254
293
  const response = await client.typed(
255
294
  "get",
@@ -400,7 +439,7 @@ var createMechanizationServices = (client) => ({
400
439
  return wrapError(error);
401
440
  }
402
441
  },
403
- ...vfn(client)
442
+ ...createMechanizationTemperatureChangesServices(client)
404
443
  });
405
444
 
406
445
  // src/index.ts
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;
@@ -152,15 +156,6 @@ type MechanizationMovementChangesVariable = {
152
156
  toDate?: string | null | undefined;
153
157
  };
154
158
 
155
- type VerifyPhoneNumberModel = {
156
- phoneNumber: string;
157
- verificationToken: string;
158
- };
159
- type VerifyPhoneNumberVariables = {
160
- phoneNumber: string;
161
- otpCode: string;
162
- };
163
-
164
159
  /**
165
160
  * This file was auto-generated by openapi-typescript.
166
161
  * Do not make direct changes to the file.
@@ -2964,6 +2959,17 @@ type ExtendedClient = AxiosInstance & {
2964
2959
  }) => Promise<ResponseData<Op>>;
2965
2960
  };
2966
2961
 
2962
+ type MechanizationTemperatureChangesModel = {
2963
+ engineWaterTemperature: number;
2964
+ date: string;
2965
+ };
2966
+ type MechanizationTemperatureChangesVariable = {
2967
+ farmerId: string;
2968
+ mechanizationId: string;
2969
+ fromDate?: string | null | undefined;
2970
+ toDate?: string | null | undefined;
2971
+ };
2972
+
2967
2973
  type ClientConfig = {
2968
2974
  readonly baseURL: string;
2969
2975
  };
@@ -2972,10 +2978,11 @@ declare const createClient: (config: ClientConfig, middlewares?: ((_config: Inte
2972
2978
  declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof createClient>[1]) => {
2973
2979
  dashboardServices: {
2974
2980
  mechanization: {
2975
- verifyPhoneNumber: ({ phoneNumber, otpCode, }: VerifyPhoneNumberVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<VerifyPhoneNumberModel>>;
2981
+ getMechanizationTemperatureChanges: ({ farmerId, mechanizationId, fromDate, toDate, }: MechanizationTemperatureChangesVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationTemperatureChangesModel[]>>;
2976
2982
  getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationVarietyModel[]>>;
2977
2983
  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[]>>;
2984
+ getMechanization: ({ farmerId, mechanizationId, }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel>>;
2985
+ getMechanizations: ({ farmerId, kindName, }: MechanizationsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
2979
2986
  getMotorizedMechanizationSensors: ({ farmerId, mechanizationId, }: MotorizedMechanizationSensorsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MotorizedMechanizationSensorsModel>>;
2980
2987
  SubmitTrackingDeviceCode: ({ farmerId, mechanizationId, deviceCode, }: SubmitTrackingDeviceVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<TrackingDeviceCodeModel>>;
2981
2988
  getSeasonsProcess: () => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SeasonsProcessModel[]>>;
@@ -2987,4 +2994,4 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
2987
2994
  };
2988
2995
  };
2989
2996
 
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 };
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 };
package/dist/index.mjs CHANGED
@@ -151,29 +151,44 @@ var wrapError = (error) => {
151
151
  return R.Error(err);
152
152
  };
153
153
 
154
- // src/services/dashboard/mechanization/verifyPhoneNumber/v.service.ts
154
+ // src/services/dashboard/mechanization/temperature-changes.ts
155
155
  import { R as R2 } from "@mobily/ts-belt";
156
-
157
- // src/services/dashboard/mechanization/verifyPhoneNumber/mapper.ts
158
156
  var mappers2 = {
159
- verifyPhoneNumber: (dto) => ({
160
- phoneNumber: dto.phoneNumber,
161
- verificationToken: dto.verificationToken
162
- })
157
+ getMechanizationTemperatureChange: ({
158
+ engineWaterTemperature,
159
+ date
160
+ }) => ({
161
+ engineWaterTemperature,
162
+ date
163
+ }),
164
+ getMechanizationTemperatureChanges: (response) => response.map(mappers2.getMechanizationTemperatureChange)
163
165
  };
164
-
165
- // src/services/dashboard/mechanization/verifyPhoneNumber/v.service.ts
166
- var vfn = (client) => ({
167
- verifyPhoneNumber: async ({
168
- phoneNumber,
169
- otpCode
166
+ var createMechanizationTemperatureChangesServices = (client) => ({
167
+ getMechanizationTemperatureChanges: async ({
168
+ farmerId,
169
+ mechanizationId,
170
+ fromDate,
171
+ toDate
170
172
  }) => {
171
173
  try {
172
- const { data } = await client.post(`/auth/verify-phone-number`, {
173
- phoneNumber,
174
- otpCode
175
- });
176
- return R2.Ok(mappers2.verifyPhoneNumber(data));
174
+ const response = await client.typed(
175
+ "get",
176
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}/sensors/temperature-changes",
177
+ {
178
+ params: {
179
+ fromDate,
180
+ toDate
181
+ },
182
+ pathParams: {
183
+ farmerId,
184
+ mechanizationId
185
+ }
186
+ }
187
+ );
188
+ const temperatureChanges = response.result.data.temperatureChanges;
189
+ return R2.Ok(
190
+ mappers2.getMechanizationTemperatureChanges(temperatureChanges)
191
+ );
177
192
  } catch (error) {
178
193
  return wrapError(error);
179
194
  }
@@ -213,7 +228,31 @@ var createMechanizationServices = (client) => ({
213
228
  return wrapError(error);
214
229
  }
215
230
  },
216
- getMechanizations: async ({ farmerId, kindName }) => {
231
+ getMechanization: async ({
232
+ farmerId,
233
+ mechanizationId
234
+ }) => {
235
+ try {
236
+ const response = await client.typed(
237
+ "get",
238
+ "/farmers/{farmerId}/mechanizations/{mechanizationId}",
239
+ {
240
+ pathParams: {
241
+ farmerId,
242
+ mechanizationId
243
+ }
244
+ }
245
+ );
246
+ const mechanization = response.result.data.mechanization;
247
+ return R3.Ok(mappers.getMechanization(mechanization));
248
+ } catch (error) {
249
+ return wrapError(error);
250
+ }
251
+ },
252
+ getMechanizations: async ({
253
+ farmerId,
254
+ kindName
255
+ }) => {
217
256
  try {
218
257
  const response = await client.typed(
219
258
  "get",
@@ -364,7 +403,7 @@ var createMechanizationServices = (client) => ({
364
403
  return wrapError(error);
365
404
  }
366
405
  },
367
- ...vfn(client)
406
+ ...createMechanizationTemperatureChangesServices(client)
368
407
  });
369
408
 
370
409
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "2.1.4",
3
+ "version": "2.3.0-0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",