@agroyaar/sdk 2.0.3 → 2.0.4

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
@@ -229,9 +229,7 @@ var createMechanizationServices = (client) => ({
229
229
  }
230
230
  );
231
231
  return import_ts_belt2.R.Ok(
232
- mappers.getMechanizationsList(
233
- response.content["application/json"].result.data.mechanizations
234
- )
232
+ mappers.getMechanizationsList(response.result.data.mechanizations)
235
233
  );
236
234
  } catch (error) {
237
235
  return wrapError(error);
@@ -254,7 +252,7 @@ var createMechanizationServices = (client) => ({
254
252
  );
255
253
  return import_ts_belt2.R.Ok(
256
254
  mappers.getMotorizedMechanizationSensors(
257
- response.content["application/json"].result.data.motorizedMechanizationSensors
255
+ response.result.data.motorizedMechanizationSensors
258
256
  )
259
257
  );
260
258
  } catch (error) {
@@ -319,7 +317,7 @@ var createMechanizationServices = (client) => ({
319
317
  }
320
318
  }
321
319
  );
322
- const questions = data.result?.data?.mechanizationsQuestions;
320
+ const questions = data.result.data.mechanizationsQuestions;
323
321
  if (!questions) {
324
322
  throw new Error(
325
323
  "Invalid API response: 'mechanizationsQuestions' missing"
@@ -347,7 +345,7 @@ var createMechanizationServices = (client) => ({
347
345
  );
348
346
  return import_ts_belt2.R.Ok(
349
347
  mappers.getMechanizationMovementChanges(
350
- response.content["application/json"].result.data.movementChanges
348
+ response.result.data.movementChanges
351
349
  )
352
350
  );
353
351
  } catch (error) {
package/dist/index.d.ts CHANGED
@@ -925,8 +925,7 @@ interface components {
925
925
  readonly model: string;
926
926
  /** @example shrek */
927
927
  readonly commonName: string;
928
- /** @example 0 */
929
- readonly manufactureYear: number;
928
+ readonly manufactureYear: string;
930
929
  /** @example code */
931
930
  readonly code: string;
932
931
  /** @example deviceCode */
@@ -1364,7 +1363,6 @@ interface operations {
1364
1363
  responses: {
1365
1364
  /** @description لیست اطلاعات با موفقیت دریافت شد */
1366
1365
  200: {
1367
- result: any;
1368
1366
  headers: {
1369
1367
  [name: string]: unknown;
1370
1368
  };
@@ -2926,7 +2924,7 @@ type RequestParams<Op> = Op extends {
2926
2924
  };
2927
2925
  } ? Q extends object ? Q : never : never;
2928
2926
  type RequestBody<Op> = Op extends {
2929
- requestBody: {
2927
+ requestBody?: {
2930
2928
  content: {
2931
2929
  "application/json": infer B;
2932
2930
  };
@@ -2939,7 +2937,11 @@ type PathParams<Op> = Op extends {
2939
2937
  } ? P extends object ? P : never : never;
2940
2938
  type ResponseData<Op> = Op extends {
2941
2939
  responses: {
2942
- 200: infer R;
2940
+ 200: {
2941
+ content: {
2942
+ "application/json": infer R;
2943
+ };
2944
+ };
2943
2945
  };
2944
2946
  } ? R : unknown;
2945
2947
 
package/dist/index.mjs CHANGED
@@ -193,9 +193,7 @@ var createMechanizationServices = (client) => ({
193
193
  }
194
194
  );
195
195
  return R2.Ok(
196
- mappers.getMechanizationsList(
197
- response.content["application/json"].result.data.mechanizations
198
- )
196
+ mappers.getMechanizationsList(response.result.data.mechanizations)
199
197
  );
200
198
  } catch (error) {
201
199
  return wrapError(error);
@@ -218,7 +216,7 @@ var createMechanizationServices = (client) => ({
218
216
  );
219
217
  return R2.Ok(
220
218
  mappers.getMotorizedMechanizationSensors(
221
- response.content["application/json"].result.data.motorizedMechanizationSensors
219
+ response.result.data.motorizedMechanizationSensors
222
220
  )
223
221
  );
224
222
  } catch (error) {
@@ -283,7 +281,7 @@ var createMechanizationServices = (client) => ({
283
281
  }
284
282
  }
285
283
  );
286
- const questions = data.result?.data?.mechanizationsQuestions;
284
+ const questions = data.result.data.mechanizationsQuestions;
287
285
  if (!questions) {
288
286
  throw new Error(
289
287
  "Invalid API response: 'mechanizationsQuestions' missing"
@@ -311,7 +309,7 @@ var createMechanizationServices = (client) => ({
311
309
  );
312
310
  return R2.Ok(
313
311
  mappers.getMechanizationMovementChanges(
314
- response.content["application/json"].result.data.movementChanges
312
+ response.result.data.movementChanges
315
313
  )
316
314
  );
317
315
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",