@agroyaar/sdk 2.4.2 → 2.4.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
@@ -179,6 +179,7 @@ var mappers = {
179
179
  heading
180
180
  }),
181
181
  getMechanizationMovementChanges: (response) => response.map(mappers.getMechanizationMovementChange),
182
+ createMechanization: (_dto) => ({}),
182
183
  verifyPhoneNumber: (dto) => ({
183
184
  phoneNumber: dto.phoneNumber,
184
185
  verificationToken: dto.verificationToken
@@ -527,6 +528,32 @@ var createMechanizationServices = (client) => ({
527
528
  } catch (error) {
528
529
  return wrapError(error);
529
530
  }
531
+ },
532
+ CreateMechanization: async ({
533
+ farmerId,
534
+ body
535
+ }) => {
536
+ try {
537
+ const response = await client.typed(
538
+ "post",
539
+ "/farmers/{farmerId}/mechanizations",
540
+ {
541
+ pathParams: {
542
+ farmerId
543
+ },
544
+ body: {
545
+ avatarURL: body.avatarURL,
546
+ information: body.information,
547
+ varietyId: body.varietyId
548
+ }
549
+ }
550
+ );
551
+ return import_ts_belt2.R.Ok(
552
+ mappers.createMechanization(response.result.data.mechanization)
553
+ );
554
+ } catch (error) {
555
+ return wrapError(error);
556
+ }
530
557
  }
531
558
  });
532
559
 
package/dist/index.d.ts CHANGED
@@ -1,190 +1,6 @@
1
1
  import * as _mobily_ts_belt from '@mobily/ts-belt';
2
2
  import { AxiosInstance, InternalAxiosRequestConfig } from 'axios';
3
3
 
4
- declare const __brand: unique symbol;
5
- type Brand<B> = {
6
- readonly [__brand]: B;
7
- };
8
- type Branded<T, B> = Brand<B> & T;
9
-
10
- declare namespace Identifiers {
11
- type MechanizationVarietyId = Branded<string, "mechanizationVariety-id">;
12
- type MechanizationId = Branded<string, "mechanization-id">;
13
- type SeasonsProcessId = Branded<string, " seasonsProcess-id">;
14
- type MotorizedMechanizationSensorId = Branded<string, "motorized-mechanization-sensorsId-id">;
15
- type FarmerId = Branded<string, "farmer-id">;
16
- type QuestionId = Branded<string, "question-id">;
17
- type MechanizationMovementChangeId = Branded<string, " movement-changes-id">;
18
- }
19
-
20
- type ServiceType = "EXPERIMENT" | "VISIT" | "CHILLING_REQUIREMENT" | "CULTIVAR_RECOMMENDATION" | "FIRST_SAFFRON_IRRIGATION_DATE_RECOMMENDATION" | "HARVEST_DATE_RECOMMENDATION" | "QUESTIONNAIRE" | "SOWING_DATE_RECOMMENDATIONS" | "WEATHER_STATION" | "YIELD_GAP";
21
- type StatusType = "ACTIVE" | "ACTIVE_LEADING_EXPERT" | "APPROVED_EXPERIMENT_ANALYSIS_REQUEST" | "APPROVED_MISSION" | "APPROVED_RESIDENT_LEADING_EXPERT" | "ARCHIVED" | "AWAITING_APPROVAL_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_APPROVAL_MISSION" | "AWAITING_APPROVAL_RESIDENT_LEADING_EXPERT" | "AWAITING_COLLEAGUE_APPROVAL_REQUEST" | "AWAITING_MISSION_COMPLETION_REQUEST" | "AWAITING_PAYMENT_REQUEST" | "AWAITING_PURCHASE_REQUEST" | "AWAITING_REVIEW_ACTIVATION" | "AWAITING_REVIEW_DATA_MISSION" | "AWAITING_REVIEW_INQUIRY" | "AWAITING_REVIEW_MISSION_DATA_REQUEST" | "AWAITING_REVIEW_MODIFICATION" | "AWAITING_REVIEW_OFFER" | "AWAITING_REVIEW_REGISTRATION" | "AWAITING_REVIEW_REQUEST" | "AWAITING_SAMPLE_DELIVERY_LABORATORY_MISSION" | "AWAITING_SEND_REQUEST" | "AWAITING_SIGNING_CONTRACT" | "AWAITING_START_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_START_MISSION" | "AWAITING_SUBMIT_ACTIVATION" | "AWAITING_VERIFICATION_CHARGE_WALLET_TRANSACTION" | "CANCELED_EXPERIMENT_ANALYSIS_REQUEST" | "CANCELED_MISSION" | "CANCELED_REQUEST" | "COMPLETED" | "COMPLETED_EXPERIMENT_ANALYSIS_REQUEST" | "COMPLETED_MISSION" | "COMPLETED_REGISTRATION" | "COMPLETED_REQUEST" | "CONFIRMED" | "CONFIRMED_ACTIVATION" | "CONFIRMED_REGISTRATION" | "DONE" | "DRAFT" | "DRAFT_EXPERIMENT_ANALYSIS_REQUEST" | "DRAFT_MISSION" | "FAILED" | "FAILED_CHARGE_WALLET_TRANSACTION" | "INACTIVE" | "INVALID" | "INVALID_DEVICE_PUSH_TOKEN" | "IN_PROGRESS_EXPERIMENT_ANALYSIS_REQUEST" | "IN_PROGRESS_MISSION" | "PAID" | "PASS_PAYMENT" | "PENDING" | "PROCESSING" | "REJECTED" | "REJECTED_ACTIVATION" | "REJECTED_EXPERIMENT_ANALYSIS_REQUEST" | "REJECTED_MISSION" | "REJECTED_MODIFICATION" | "REJECTED_REGISTRATION" | "REJECTED_RESIDENT_LEADING_EXPERT" | "SUBMIT" | "SUCCESS" | "SUCCESS_PAYMENT_WALLET_TRANSACTION" | "VALID" | "VALID_DEVICE_PUSH_TOKEN" | "VERIFIED" | "VERIFIED_CHARGE_WALLET_TRANSACTION" | "WRITING" | "AWAITING_APPROVAL_RESIDENT_LEADING_EXPERT" | "APPROVED_RESIDENT_LEADING_EXPERT" | "REJECTED_RESIDENT_LEADING_EXPERT";
22
- type TaskType = "SAMPLING_REQUEST" | "SAMPLING_MISSION" | "ANALYSIS_REQUEST" | "MAP_DRAWING" | "WATER_SAMPLE_CONTROL" | "WATER_ANALYSIS_MEASUREMENT" | "WATER_EXPERIMENT_TECHNICAL_REVIEW" | "PLANT_SAMPLE_CONTROL" | "PLANT_ANALYSIS_MEASUREMENT" | "PLANT_EXPERIMENT_TECHNICAL_REVIEW" | "SOIL_SAMPLE_CONTROL" | "SOIL_ANALYSIS_MEASUREMENT" | "SOIL_EXPERIMENT_TECHNICAL_REVIEW" | "SENDING_REPORTS" | "TECHNICAL_REVIEW" | "EXPERIMENT_ANALYSIS_RESULTS_CONTROL" | "EXPERIMENT_RECOMMENDATION_ANALYSIS_RESULTS" | "SUPPORT_EXPERIMENTS" | "VISIT_REQUEST" | "FOLLOW_UP_VISIT" | "VISIT_MAP_DRAWING" | "VISIT_SENDING_REPORTS" | "SUPPORT_VISITS";
23
- type MechanizationType = "MOTORIZED" | "NON_MOTORIZED";
24
- type MechanizationSeasonProcessType = "GROWING" | "HARVESTING" | "PLANTING" | "TRANSPORTATION";
25
- type MechanizationMachineUsageType = "BALER" | "CRUSHING" | "CRUST_BREAKER" | "FERTILIZER_SPREADER" | "FORAGE_COLLECTOR" | "FURROWER" | "GRASS_CUTTER" | "GRINDING" | "HARVESTING" | "LEVELING" | "LOADER" | "MULTI_PURPOSE" | "SEEDER" | "SPRAYER" | "TILLAGE" | "TRANSPORTATION" | "WEEDER";
26
-
27
- type Status = {
28
- id: string;
29
- label: string;
30
- name: StatusType;
31
- };
32
- type VarietyKind = {
33
- id: string;
34
- label: string;
35
- name: MechanizationType;
36
- };
37
- type MechanizationSeasonProcessKind = {
38
- id: string;
39
- label: string;
40
- name: MechanizationSeasonProcessType;
41
- };
42
- type MechanizationMachineUsageKind = {
43
- id: string;
44
- label: string;
45
- name: MechanizationMachineUsageType;
46
- };
47
-
48
- type MechanizationVarietyModel = {
49
- id: Identifiers.MechanizationVarietyId;
50
- name: string;
51
- iconURL: string;
52
- kind: VarietyKind;
53
- seasonProcessIds: string[];
54
- machineUsageIds: string[];
55
- seasonsProcess: MechanizationSeasonProcessKind[];
56
- };
57
- type MechanizationVarietyVariables = {
58
- kindName: MechanizationType;
59
- };
60
- type MechanizationModel = {
61
- id: Identifiers.MechanizationId;
62
- model: string;
63
- commonName: string;
64
- avatarURL: string;
65
- manufactureYear: string;
66
- code: string;
67
- deviceCode: string;
68
- kind: VarietyKind;
69
- kindName: MechanizationType;
70
- variety: MechanizationVarietyModel;
71
- };
72
- type MechanizationsVariables = {
73
- farmerId: string;
74
- kindName: MechanizationType;
75
- };
76
- type MechanizationVariables = {
77
- farmerId: string;
78
- mechanizationId: string;
79
- };
80
- type SeasonsProcessModel = {
81
- id: Identifiers.SeasonsProcessId;
82
- name: string;
83
- label: string;
84
- mechanizationVarietyIds: string[];
85
- };
86
- type MotorizedMechanizationSensorsModel = {
87
- id: string;
88
- speed: number;
89
- heading: number;
90
- latitude: number;
91
- longitude: number;
92
- fuelLevel: number;
93
- engineRpm: number;
94
- deviceCode: string;
95
- stateEngine: boolean;
96
- engineOilPressure: boolean;
97
- engineWaterTemperature: number;
98
- batteryChargePercentage: number;
99
- mechanizationId: string;
100
- };
101
- type MotorizedMechanizationSensorsVariables = {
102
- farmerId: string;
103
- mechanizationId: string;
104
- };
105
- type TrackingDeviceCodeModel = {
106
- deviceCode: string;
107
- };
108
- type SubmitTrackingDeviceVariables = {
109
- farmerId: string;
110
- mechanizationId: string;
111
- deviceCode: string;
112
- };
113
- type SpeedChangesChartModel = {
114
- speed: number;
115
- date: string;
116
- };
117
- type SpeedChangesChartVariables = {
118
- farmerId: string;
119
- mechanizationId: string;
120
- };
121
- type UpdateTrackingDeviceVariables = {
122
- farmerId: string;
123
- mechanizationId: string;
124
- deviceCode: string;
125
- verificationToken: string;
126
- };
127
- type DeleteTrackingDeviceVariables = {
128
- farmerId: string;
129
- mechanizationId: string;
130
- verificationToken: string;
131
- };
132
- type MechanizationQuestionModel = {
133
- id: Identifiers.QuestionId;
134
- name: string;
135
- label: string;
136
- placeholder: string;
137
- isRequired: boolean;
138
- options?: {
139
- value: string | number;
140
- label: string;
141
- }[];
142
- type: "TEXT" | "FILE" | "DATE" | "RADIO" | "NUMBER" | "SELECT" | "PASSWORD" | "CHECK_BOX" | "MULTI_SELECT" | "RADIO";
143
- };
144
- type GetMechanizationQuestionVariable = {
145
- varietyId: string;
146
- };
147
- type MechanizationMovementChangesModel = {
148
- longitude: number;
149
- latitude: number;
150
- heading: number;
151
- date: string;
152
- };
153
- type MechanizationMovementChangesVariable = {
154
- farmerId: string;
155
- mechanizationId: string;
156
- fromDate?: string | null | undefined;
157
- toDate?: string | null | undefined;
158
- };
159
- type VerifyPhoneNumberModel = {
160
- phoneNumber: string;
161
- verificationToken: string;
162
- };
163
- type VerifyPhoneNumberVariables = {
164
- phoneNumber: string;
165
- otpCode: string;
166
- };
167
- type MechanizationTemperatureChangesModel = {
168
- engineWaterTemperature: number;
169
- date: string;
170
- };
171
- type MechanizationTemperatureChangesVariable = {
172
- farmerId: string;
173
- mechanizationId: string;
174
- fromDate?: string | null | undefined;
175
- toDate?: string | null | undefined;
176
- };
177
- type MechanizationFuelConsumptionChangesModel = {
178
- fuelConsumption: number;
179
- date: string;
180
- };
181
- type MechanizationFuelConsumptionChangesVariable = {
182
- farmerId: string;
183
- mechanizationId: string;
184
- fromDate?: string | null | undefined;
185
- toDate?: string | null | undefined;
186
- };
187
-
188
4
  /**
189
5
  * This file was auto-generated by openapi-typescript.
190
6
  * Do not make direct changes to the file.
@@ -3027,6 +2843,199 @@ interface operations {
3027
2843
  };
3028
2844
  }
3029
2845
 
2846
+ declare const __brand: unique symbol;
2847
+ type Brand<B> = {
2848
+ readonly [__brand]: B;
2849
+ };
2850
+ type Branded<T, B> = Brand<B> & T;
2851
+
2852
+ declare namespace Identifiers {
2853
+ type MechanizationVarietyId = Branded<string, "mechanizationVariety-id">;
2854
+ type MechanizationId = Branded<string, "mechanization-id">;
2855
+ type SeasonsProcessId = Branded<string, " seasonsProcess-id">;
2856
+ type MotorizedMechanizationSensorId = Branded<string, "motorized-mechanization-sensorsId-id">;
2857
+ type FarmerId = Branded<string, "farmer-id">;
2858
+ type QuestionId = Branded<string, "question-id">;
2859
+ type MechanizationMovementChangeId = Branded<string, " movement-changes-id">;
2860
+ }
2861
+
2862
+ type ServiceType = "EXPERIMENT" | "VISIT" | "CHILLING_REQUIREMENT" | "CULTIVAR_RECOMMENDATION" | "FIRST_SAFFRON_IRRIGATION_DATE_RECOMMENDATION" | "HARVEST_DATE_RECOMMENDATION" | "QUESTIONNAIRE" | "SOWING_DATE_RECOMMENDATIONS" | "WEATHER_STATION" | "YIELD_GAP";
2863
+ type StatusType = "ACTIVE" | "ACTIVE_LEADING_EXPERT" | "APPROVED_EXPERIMENT_ANALYSIS_REQUEST" | "APPROVED_MISSION" | "APPROVED_RESIDENT_LEADING_EXPERT" | "ARCHIVED" | "AWAITING_APPROVAL_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_APPROVAL_MISSION" | "AWAITING_APPROVAL_RESIDENT_LEADING_EXPERT" | "AWAITING_COLLEAGUE_APPROVAL_REQUEST" | "AWAITING_MISSION_COMPLETION_REQUEST" | "AWAITING_PAYMENT_REQUEST" | "AWAITING_PURCHASE_REQUEST" | "AWAITING_REVIEW_ACTIVATION" | "AWAITING_REVIEW_DATA_MISSION" | "AWAITING_REVIEW_INQUIRY" | "AWAITING_REVIEW_MISSION_DATA_REQUEST" | "AWAITING_REVIEW_MODIFICATION" | "AWAITING_REVIEW_OFFER" | "AWAITING_REVIEW_REGISTRATION" | "AWAITING_REVIEW_REQUEST" | "AWAITING_SAMPLE_DELIVERY_LABORATORY_MISSION" | "AWAITING_SEND_REQUEST" | "AWAITING_SIGNING_CONTRACT" | "AWAITING_START_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_START_MISSION" | "AWAITING_SUBMIT_ACTIVATION" | "AWAITING_VERIFICATION_CHARGE_WALLET_TRANSACTION" | "CANCELED_EXPERIMENT_ANALYSIS_REQUEST" | "CANCELED_MISSION" | "CANCELED_REQUEST" | "COMPLETED" | "COMPLETED_EXPERIMENT_ANALYSIS_REQUEST" | "COMPLETED_MISSION" | "COMPLETED_REGISTRATION" | "COMPLETED_REQUEST" | "CONFIRMED" | "CONFIRMED_ACTIVATION" | "CONFIRMED_REGISTRATION" | "DONE" | "DRAFT" | "DRAFT_EXPERIMENT_ANALYSIS_REQUEST" | "DRAFT_MISSION" | "FAILED" | "FAILED_CHARGE_WALLET_TRANSACTION" | "INACTIVE" | "INVALID" | "INVALID_DEVICE_PUSH_TOKEN" | "IN_PROGRESS_EXPERIMENT_ANALYSIS_REQUEST" | "IN_PROGRESS_MISSION" | "PAID" | "PASS_PAYMENT" | "PENDING" | "PROCESSING" | "REJECTED" | "REJECTED_ACTIVATION" | "REJECTED_EXPERIMENT_ANALYSIS_REQUEST" | "REJECTED_MISSION" | "REJECTED_MODIFICATION" | "REJECTED_REGISTRATION" | "REJECTED_RESIDENT_LEADING_EXPERT" | "SUBMIT" | "SUCCESS" | "SUCCESS_PAYMENT_WALLET_TRANSACTION" | "VALID" | "VALID_DEVICE_PUSH_TOKEN" | "VERIFIED" | "VERIFIED_CHARGE_WALLET_TRANSACTION" | "WRITING" | "AWAITING_APPROVAL_RESIDENT_LEADING_EXPERT" | "APPROVED_RESIDENT_LEADING_EXPERT" | "REJECTED_RESIDENT_LEADING_EXPERT";
2864
+ type TaskType = "SAMPLING_REQUEST" | "SAMPLING_MISSION" | "ANALYSIS_REQUEST" | "MAP_DRAWING" | "WATER_SAMPLE_CONTROL" | "WATER_ANALYSIS_MEASUREMENT" | "WATER_EXPERIMENT_TECHNICAL_REVIEW" | "PLANT_SAMPLE_CONTROL" | "PLANT_ANALYSIS_MEASUREMENT" | "PLANT_EXPERIMENT_TECHNICAL_REVIEW" | "SOIL_SAMPLE_CONTROL" | "SOIL_ANALYSIS_MEASUREMENT" | "SOIL_EXPERIMENT_TECHNICAL_REVIEW" | "SENDING_REPORTS" | "TECHNICAL_REVIEW" | "EXPERIMENT_ANALYSIS_RESULTS_CONTROL" | "EXPERIMENT_RECOMMENDATION_ANALYSIS_RESULTS" | "SUPPORT_EXPERIMENTS" | "VISIT_REQUEST" | "FOLLOW_UP_VISIT" | "VISIT_MAP_DRAWING" | "VISIT_SENDING_REPORTS" | "SUPPORT_VISITS";
2865
+ type MechanizationType = "MOTORIZED" | "NON_MOTORIZED";
2866
+ type MechanizationSeasonProcessType = "GROWING" | "HARVESTING" | "PLANTING" | "TRANSPORTATION";
2867
+ type MechanizationMachineUsageType = "BALER" | "CRUSHING" | "CRUST_BREAKER" | "FERTILIZER_SPREADER" | "FORAGE_COLLECTOR" | "FURROWER" | "GRASS_CUTTER" | "GRINDING" | "HARVESTING" | "LEVELING" | "LOADER" | "MULTI_PURPOSE" | "SEEDER" | "SPRAYER" | "TILLAGE" | "TRANSPORTATION" | "WEEDER";
2868
+
2869
+ type Status = {
2870
+ id: string;
2871
+ label: string;
2872
+ name: StatusType;
2873
+ };
2874
+ type VarietyKind = {
2875
+ id: string;
2876
+ label: string;
2877
+ name: MechanizationType;
2878
+ };
2879
+ type MechanizationSeasonProcessKind = {
2880
+ id: string;
2881
+ label: string;
2882
+ name: MechanizationSeasonProcessType;
2883
+ };
2884
+ type MechanizationMachineUsageKind = {
2885
+ id: string;
2886
+ label: string;
2887
+ name: MechanizationMachineUsageType;
2888
+ };
2889
+
2890
+ type MechanizationVarietyModel = {
2891
+ id: Identifiers.MechanizationVarietyId;
2892
+ name: string;
2893
+ iconURL: string;
2894
+ kind: VarietyKind;
2895
+ seasonProcessIds: string[];
2896
+ machineUsageIds: string[];
2897
+ seasonsProcess: MechanizationSeasonProcessKind[];
2898
+ };
2899
+ type MechanizationVarietyVariables = {
2900
+ kindName: MechanizationType;
2901
+ };
2902
+ type MechanizationModel = {
2903
+ id: Identifiers.MechanizationId;
2904
+ model: string;
2905
+ commonName: string;
2906
+ avatarURL: string;
2907
+ manufactureYear: string;
2908
+ code: string;
2909
+ deviceCode: string;
2910
+ kind: VarietyKind;
2911
+ kindName: MechanizationType;
2912
+ variety: MechanizationVarietyModel;
2913
+ };
2914
+ type MechanizationsVariables = {
2915
+ farmerId: string;
2916
+ kindName: MechanizationType;
2917
+ };
2918
+ type MechanizationVariables = {
2919
+ farmerId: string;
2920
+ mechanizationId: string;
2921
+ };
2922
+ type SeasonsProcessModel = {
2923
+ id: Identifiers.SeasonsProcessId;
2924
+ name: string;
2925
+ label: string;
2926
+ mechanizationVarietyIds: string[];
2927
+ };
2928
+ type MotorizedMechanizationSensorsModel = {
2929
+ id: string;
2930
+ speed: number;
2931
+ heading: number;
2932
+ latitude: number;
2933
+ longitude: number;
2934
+ fuelLevel: number;
2935
+ engineRpm: number;
2936
+ deviceCode: string;
2937
+ stateEngine: boolean;
2938
+ engineOilPressure: boolean;
2939
+ engineWaterTemperature: number;
2940
+ batteryChargePercentage: number;
2941
+ mechanizationId: string;
2942
+ };
2943
+ type MotorizedMechanizationSensorsVariables = {
2944
+ farmerId: string;
2945
+ mechanizationId: string;
2946
+ };
2947
+ type TrackingDeviceCodeModel = {
2948
+ deviceCode: string;
2949
+ };
2950
+ type SubmitTrackingDeviceVariables = {
2951
+ farmerId: string;
2952
+ mechanizationId: string;
2953
+ deviceCode: string;
2954
+ };
2955
+ type SpeedChangesChartModel = {
2956
+ speed: number;
2957
+ date: string;
2958
+ };
2959
+ type SpeedChangesChartVariables = {
2960
+ farmerId: string;
2961
+ mechanizationId: string;
2962
+ };
2963
+ type UpdateTrackingDeviceVariables = {
2964
+ farmerId: string;
2965
+ mechanizationId: string;
2966
+ deviceCode: string;
2967
+ verificationToken: string;
2968
+ };
2969
+ type DeleteTrackingDeviceVariables = {
2970
+ farmerId: string;
2971
+ mechanizationId: string;
2972
+ verificationToken: string;
2973
+ };
2974
+ type MechanizationQuestionModel = {
2975
+ id: Identifiers.QuestionId;
2976
+ name: string;
2977
+ label: string;
2978
+ placeholder: string;
2979
+ isRequired: boolean;
2980
+ options?: {
2981
+ value: string | number;
2982
+ label: string;
2983
+ }[];
2984
+ type: "TEXT" | "FILE" | "DATE" | "RADIO" | "NUMBER" | "SELECT" | "PASSWORD" | "CHECK_BOX" | "MULTI_SELECT" | "RADIO";
2985
+ };
2986
+ type GetMechanizationQuestionVariable = {
2987
+ varietyId: string;
2988
+ };
2989
+ type MechanizationMovementChangesModel = {
2990
+ longitude: number;
2991
+ latitude: number;
2992
+ heading: number;
2993
+ date: string;
2994
+ };
2995
+ type MechanizationMovementChangesVariable = {
2996
+ farmerId: string;
2997
+ mechanizationId: string;
2998
+ fromDate?: string | null | undefined;
2999
+ toDate?: string | null | undefined;
3000
+ };
3001
+ type QuestionInformation = components["schemas"]["MechanizationInformationInput"];
3002
+ type CreateMechanizationVariables = {
3003
+ farmerId: string;
3004
+ body: {
3005
+ avatarURL: string;
3006
+ information: QuestionInformation[];
3007
+ varietyId: string;
3008
+ };
3009
+ };
3010
+ type VerifyPhoneNumberModel = {
3011
+ phoneNumber: string;
3012
+ verificationToken: string;
3013
+ };
3014
+ type VerifyPhoneNumberVariables = {
3015
+ phoneNumber: string;
3016
+ otpCode: string;
3017
+ };
3018
+ type MechanizationTemperatureChangesModel = {
3019
+ engineWaterTemperature: number;
3020
+ date: string;
3021
+ };
3022
+ type MechanizationTemperatureChangesVariable = {
3023
+ farmerId: string;
3024
+ mechanizationId: string;
3025
+ fromDate?: string | null | undefined;
3026
+ toDate?: string | null | undefined;
3027
+ };
3028
+ type MechanizationFuelConsumptionChangesModel = {
3029
+ fuelConsumption: number;
3030
+ date: string;
3031
+ };
3032
+ type MechanizationFuelConsumptionChangesVariable = {
3033
+ farmerId: string;
3034
+ mechanizationId: string;
3035
+ fromDate?: string | null | undefined;
3036
+ toDate?: string | null | undefined;
3037
+ };
3038
+
3030
3039
  type HttpMethod = "get" | "post" | "put" | "delete" | "patch";
3031
3040
  type ExtractPathsByMethod<M extends HttpMethod> = {
3032
3041
  [K in keyof paths]: M extends keyof paths[K] ? K : never;
@@ -3050,14 +3059,18 @@ type PathParams<Op> = Op extends {
3050
3059
  };
3051
3060
  } ? P extends object ? P : never : never;
3052
3061
  type ResponseData<Op> = Op extends {
3053
- responses: {
3054
- 200: {
3055
- content: {
3056
- "application/json": infer R;
3057
- };
3062
+ responses: Record<string, {
3063
+ content?: {
3064
+ "application/json"?: infer _R;
3058
3065
  };
3059
- };
3060
- } ? R : unknown;
3066
+ }>;
3067
+ } ? {
3068
+ [K in keyof Op["responses"]]: Op["responses"][K] extends {
3069
+ content: {
3070
+ "application/json": infer R;
3071
+ };
3072
+ } ? R : never;
3073
+ }[keyof Op["responses"]] : unknown;
3061
3074
 
3062
3075
  type ExtendedClient = AxiosInstance & {
3063
3076
  typed: <M extends HttpMethod, P extends ExtractPathsByMethod<M>, Op extends PathOperation<M, P>>(_method: M, _path: P, _config?: {
@@ -3088,8 +3101,9 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
3088
3101
  DeleteTrackingDeviceCode: ({ farmerId, mechanizationId, verificationToken, }: DeleteTrackingDeviceVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<TrackingDeviceCodeModel>>;
3089
3102
  getMechanizationTemperatureChanges: ({ farmerId, mechanizationId, fromDate, toDate, }: MechanizationTemperatureChangesVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationTemperatureChangesModel[]>>;
3090
3103
  getMechanizationFuelConsumptionChanges: ({ farmerId, mechanizationId, fromDate, toDate, }: MechanizationFuelConsumptionChangesVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationFuelConsumptionChangesModel[]>>;
3104
+ CreateMechanization: ({ farmerId, body, }: CreateMechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<unknown>>;
3091
3105
  };
3092
3106
  };
3093
3107
  };
3094
3108
 
3095
- 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, type VerifyPhoneNumberModel, type VerifyPhoneNumberVariables, createSDK };
3109
+ export { type CreateMechanizationVariables, 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 QuestionInformation, 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
@@ -143,6 +143,7 @@ var mappers = {
143
143
  heading
144
144
  }),
145
145
  getMechanizationMovementChanges: (response) => response.map(mappers.getMechanizationMovementChange),
146
+ createMechanization: (_dto) => ({}),
146
147
  verifyPhoneNumber: (dto) => ({
147
148
  phoneNumber: dto.phoneNumber,
148
149
  verificationToken: dto.verificationToken
@@ -491,6 +492,32 @@ var createMechanizationServices = (client) => ({
491
492
  } catch (error) {
492
493
  return wrapError(error);
493
494
  }
495
+ },
496
+ CreateMechanization: async ({
497
+ farmerId,
498
+ body
499
+ }) => {
500
+ try {
501
+ const response = await client.typed(
502
+ "post",
503
+ "/farmers/{farmerId}/mechanizations",
504
+ {
505
+ pathParams: {
506
+ farmerId
507
+ },
508
+ body: {
509
+ avatarURL: body.avatarURL,
510
+ information: body.information,
511
+ varietyId: body.varietyId
512
+ }
513
+ }
514
+ );
515
+ return R2.Ok(
516
+ mappers.createMechanization(response.result.data.mechanization)
517
+ );
518
+ } catch (error) {
519
+ return wrapError(error);
520
+ }
494
521
  }
495
522
  });
496
523
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",