@agroyaar/sdk 2.1.3 → 2.1.4-2
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 +28 -1
- package/dist/index.d.ts +173 -159
- package/dist/index.mjs +28 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -177,7 +177,8 @@ 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
|
+
createMechanization: (_dto) => ({})
|
|
181
182
|
};
|
|
182
183
|
|
|
183
184
|
// src/utils/wrapError.ts
|
|
@@ -370,6 +371,32 @@ var createMechanizationServices = (client) => ({
|
|
|
370
371
|
} catch (error) {
|
|
371
372
|
return wrapError(error);
|
|
372
373
|
}
|
|
374
|
+
},
|
|
375
|
+
CreateMechanization: async ({
|
|
376
|
+
farmerId,
|
|
377
|
+
body
|
|
378
|
+
}) => {
|
|
379
|
+
try {
|
|
380
|
+
const response = await client.typed(
|
|
381
|
+
"post",
|
|
382
|
+
"/farmers/{farmerId}/mechanizations",
|
|
383
|
+
{
|
|
384
|
+
pathParams: {
|
|
385
|
+
farmerId
|
|
386
|
+
},
|
|
387
|
+
body: {
|
|
388
|
+
avatarURL: body.avatarURL,
|
|
389
|
+
information: body.information,
|
|
390
|
+
varietyId: body.varietyId
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
return import_ts_belt2.R.Ok(
|
|
395
|
+
mappers.createMechanization(response.result.data.mechanization)
|
|
396
|
+
);
|
|
397
|
+
} catch (error) {
|
|
398
|
+
return wrapError(error);
|
|
399
|
+
}
|
|
373
400
|
}
|
|
374
401
|
});
|
|
375
402
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,157 +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
|
-
kind: VarietyKind;
|
|
68
|
-
kindName: MechanizationType;
|
|
69
|
-
variety: MechanizationVarietyModel;
|
|
70
|
-
};
|
|
71
|
-
type MechanizationVariables = {
|
|
72
|
-
farmerId: string;
|
|
73
|
-
kindName: MechanizationType;
|
|
74
|
-
};
|
|
75
|
-
type SeasonsProcessModel = {
|
|
76
|
-
id: Identifiers.SeasonsProcessId;
|
|
77
|
-
name: string;
|
|
78
|
-
label: string;
|
|
79
|
-
mechanizationVarietyIds: string[];
|
|
80
|
-
};
|
|
81
|
-
type MotorizedMechanizationSensorsModel = {
|
|
82
|
-
id: string;
|
|
83
|
-
speed: number;
|
|
84
|
-
heading: number;
|
|
85
|
-
latitude: number;
|
|
86
|
-
longitude: number;
|
|
87
|
-
fuelLevel: number;
|
|
88
|
-
engineRpm: number;
|
|
89
|
-
deviceCode: string;
|
|
90
|
-
stateEngine: boolean;
|
|
91
|
-
engineOilPressure: boolean;
|
|
92
|
-
engineWaterTemperature: number;
|
|
93
|
-
batteryChargePercentage: number;
|
|
94
|
-
mechanizationId: string;
|
|
95
|
-
};
|
|
96
|
-
type MotorizedMechanizationSensorsVariables = {
|
|
97
|
-
farmerId: string;
|
|
98
|
-
mechanizationId: string;
|
|
99
|
-
};
|
|
100
|
-
type TrackingDeviceCodeModel = {
|
|
101
|
-
deviceCode: string;
|
|
102
|
-
};
|
|
103
|
-
type SubmitTrackingDeviceVariables = {
|
|
104
|
-
farmerId: string;
|
|
105
|
-
mechanizationId: string;
|
|
106
|
-
deviceCode: string;
|
|
107
|
-
};
|
|
108
|
-
type SpeedChangesChartModel = {
|
|
109
|
-
speed: number;
|
|
110
|
-
date: string;
|
|
111
|
-
};
|
|
112
|
-
type SpeedChangesChartVariables = {
|
|
113
|
-
farmerId: string;
|
|
114
|
-
mechanizationId: string;
|
|
115
|
-
};
|
|
116
|
-
type UpdateTrackingDeviceVariables = {
|
|
117
|
-
farmerId: string;
|
|
118
|
-
mechanizationId: string;
|
|
119
|
-
deviceCode: string;
|
|
120
|
-
verificationToken: string;
|
|
121
|
-
};
|
|
122
|
-
type DeleteTrackingDeviceVariables = {
|
|
123
|
-
farmerId: string;
|
|
124
|
-
mechanizationId: string;
|
|
125
|
-
verificationToken: string;
|
|
126
|
-
};
|
|
127
|
-
type MechanizationQuestionModel = {
|
|
128
|
-
id: Identifiers.QuestionId;
|
|
129
|
-
name: string;
|
|
130
|
-
label: string;
|
|
131
|
-
placeholder: string;
|
|
132
|
-
isRequired: boolean;
|
|
133
|
-
options?: {
|
|
134
|
-
value: string | number;
|
|
135
|
-
label: string;
|
|
136
|
-
}[];
|
|
137
|
-
type: "TEXT" | "FILE" | "DATE" | "RADIO" | "NUMBER" | "SELECT" | "PASSWORD" | "CHECK_BOX" | "MULTI_SELECT" | "RADIO";
|
|
138
|
-
};
|
|
139
|
-
type GetMechanizationQuestionVariable = {
|
|
140
|
-
varietyId: string;
|
|
141
|
-
};
|
|
142
|
-
type MechanizationMovementChangesModel = {
|
|
143
|
-
longitude: number;
|
|
144
|
-
latitude: number;
|
|
145
|
-
heading: number;
|
|
146
|
-
date: string;
|
|
147
|
-
};
|
|
148
|
-
type MechanizationMovementChangesVariable = {
|
|
149
|
-
farmerId: string;
|
|
150
|
-
mechanizationId: string;
|
|
151
|
-
fromDate?: string | null | undefined;
|
|
152
|
-
toDate?: string | null | undefined;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
4
|
/**
|
|
156
5
|
* This file was auto-generated by openapi-typescript.
|
|
157
6
|
* Do not make direct changes to the file.
|
|
@@ -2915,6 +2764,166 @@ interface operations {
|
|
|
2915
2764
|
};
|
|
2916
2765
|
}
|
|
2917
2766
|
|
|
2767
|
+
declare const __brand: unique symbol;
|
|
2768
|
+
type Brand<B> = {
|
|
2769
|
+
readonly [__brand]: B;
|
|
2770
|
+
};
|
|
2771
|
+
type Branded<T, B> = Brand<B> & T;
|
|
2772
|
+
|
|
2773
|
+
declare namespace Identifiers {
|
|
2774
|
+
type MechanizationVarietyId = Branded<string, "mechanizationVariety-id">;
|
|
2775
|
+
type MechanizationId = Branded<string, "mechanization-id">;
|
|
2776
|
+
type SeasonsProcessId = Branded<string, " seasonsProcess-id">;
|
|
2777
|
+
type MotorizedMechanizationSensorId = Branded<string, "motorized-mechanization-sensorsId-id">;
|
|
2778
|
+
type FarmerId = Branded<string, "farmer-id">;
|
|
2779
|
+
type QuestionId = Branded<string, "question-id">;
|
|
2780
|
+
type MechanizationMovementChangeId = Branded<string, " movement-changes-id">;
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2783
|
+
type ServiceType = "EXPERIMENT" | "VISIT" | "CHILLING_REQUIREMENT" | "CULTIVAR_RECOMMENDATION" | "FIRST_SAFFRON_IRRIGATION_DATE_RECOMMENDATION" | "HARVEST_DATE_RECOMMENDATION" | "QUESTIONNAIRE" | "SOWING_DATE_RECOMMENDATIONS" | "WEATHER_STATION" | "YIELD_GAP";
|
|
2784
|
+
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";
|
|
2785
|
+
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";
|
|
2786
|
+
type MechanizationType = "MOTORIZED" | "NON_MOTORIZED";
|
|
2787
|
+
type MechanizationSeasonProcessType = "GROWING" | "HARVESTING" | "PLANTING" | "TRANSPORTATION";
|
|
2788
|
+
type MechanizationMachineUsageType = "BALER" | "CRUSHING" | "CRUST_BREAKER" | "FERTILIZER_SPREADER" | "FORAGE_COLLECTOR" | "FURROWER" | "GRASS_CUTTER" | "GRINDING" | "HARVESTING" | "LEVELING" | "LOADER" | "MULTI_PURPOSE" | "SEEDER" | "SPRAYER" | "TILLAGE" | "TRANSPORTATION" | "WEEDER";
|
|
2789
|
+
|
|
2790
|
+
type Status = {
|
|
2791
|
+
id: string;
|
|
2792
|
+
label: string;
|
|
2793
|
+
name: StatusType;
|
|
2794
|
+
};
|
|
2795
|
+
type VarietyKind = {
|
|
2796
|
+
id: string;
|
|
2797
|
+
label: string;
|
|
2798
|
+
name: MechanizationType;
|
|
2799
|
+
};
|
|
2800
|
+
type MechanizationSeasonProcessKind = {
|
|
2801
|
+
id: string;
|
|
2802
|
+
label: string;
|
|
2803
|
+
name: MechanizationSeasonProcessType;
|
|
2804
|
+
};
|
|
2805
|
+
type MechanizationMachineUsageKind = {
|
|
2806
|
+
id: string;
|
|
2807
|
+
label: string;
|
|
2808
|
+
name: MechanizationMachineUsageType;
|
|
2809
|
+
};
|
|
2810
|
+
|
|
2811
|
+
type MechanizationVarietyModel = {
|
|
2812
|
+
id: Identifiers.MechanizationVarietyId;
|
|
2813
|
+
name: string;
|
|
2814
|
+
iconURL: string;
|
|
2815
|
+
kind: VarietyKind;
|
|
2816
|
+
seasonProcessIds: string[];
|
|
2817
|
+
machineUsageIds: string[];
|
|
2818
|
+
seasonsProcess: MechanizationSeasonProcessKind[];
|
|
2819
|
+
};
|
|
2820
|
+
type MechanizationVarietyVariables = {
|
|
2821
|
+
kindName: MechanizationType;
|
|
2822
|
+
};
|
|
2823
|
+
type MechanizationModel = {
|
|
2824
|
+
id: Identifiers.MechanizationId;
|
|
2825
|
+
model: string;
|
|
2826
|
+
commonName: string;
|
|
2827
|
+
avatarURL: string;
|
|
2828
|
+
manufactureYear: string;
|
|
2829
|
+
code: string;
|
|
2830
|
+
kind: VarietyKind;
|
|
2831
|
+
kindName: MechanizationType;
|
|
2832
|
+
variety: MechanizationVarietyModel;
|
|
2833
|
+
};
|
|
2834
|
+
type MechanizationVariables = {
|
|
2835
|
+
farmerId: string;
|
|
2836
|
+
kindName: MechanizationType;
|
|
2837
|
+
};
|
|
2838
|
+
type SeasonsProcessModel = {
|
|
2839
|
+
id: Identifiers.SeasonsProcessId;
|
|
2840
|
+
name: string;
|
|
2841
|
+
label: string;
|
|
2842
|
+
mechanizationVarietyIds: string[];
|
|
2843
|
+
};
|
|
2844
|
+
type MotorizedMechanizationSensorsModel = {
|
|
2845
|
+
id: string;
|
|
2846
|
+
speed: number;
|
|
2847
|
+
heading: number;
|
|
2848
|
+
latitude: number;
|
|
2849
|
+
longitude: number;
|
|
2850
|
+
fuelLevel: number;
|
|
2851
|
+
engineRpm: number;
|
|
2852
|
+
deviceCode: string;
|
|
2853
|
+
stateEngine: boolean;
|
|
2854
|
+
engineOilPressure: boolean;
|
|
2855
|
+
engineWaterTemperature: number;
|
|
2856
|
+
batteryChargePercentage: number;
|
|
2857
|
+
mechanizationId: string;
|
|
2858
|
+
};
|
|
2859
|
+
type MotorizedMechanizationSensorsVariables = {
|
|
2860
|
+
farmerId: string;
|
|
2861
|
+
mechanizationId: string;
|
|
2862
|
+
};
|
|
2863
|
+
type TrackingDeviceCodeModel = {
|
|
2864
|
+
deviceCode: string;
|
|
2865
|
+
};
|
|
2866
|
+
type SubmitTrackingDeviceVariables = {
|
|
2867
|
+
farmerId: string;
|
|
2868
|
+
mechanizationId: string;
|
|
2869
|
+
deviceCode: string;
|
|
2870
|
+
};
|
|
2871
|
+
type SpeedChangesChartModel = {
|
|
2872
|
+
speed: number;
|
|
2873
|
+
date: string;
|
|
2874
|
+
};
|
|
2875
|
+
type SpeedChangesChartVariables = {
|
|
2876
|
+
farmerId: string;
|
|
2877
|
+
mechanizationId: string;
|
|
2878
|
+
};
|
|
2879
|
+
type UpdateTrackingDeviceVariables = {
|
|
2880
|
+
farmerId: string;
|
|
2881
|
+
mechanizationId: string;
|
|
2882
|
+
deviceCode: string;
|
|
2883
|
+
verificationToken: string;
|
|
2884
|
+
};
|
|
2885
|
+
type DeleteTrackingDeviceVariables = {
|
|
2886
|
+
farmerId: string;
|
|
2887
|
+
mechanizationId: string;
|
|
2888
|
+
verificationToken: string;
|
|
2889
|
+
};
|
|
2890
|
+
type MechanizationQuestionModel = {
|
|
2891
|
+
id: Identifiers.QuestionId;
|
|
2892
|
+
name: string;
|
|
2893
|
+
label: string;
|
|
2894
|
+
placeholder: string;
|
|
2895
|
+
isRequired: boolean;
|
|
2896
|
+
options?: {
|
|
2897
|
+
value: string | number;
|
|
2898
|
+
label: string;
|
|
2899
|
+
}[];
|
|
2900
|
+
type: "TEXT" | "FILE" | "DATE" | "RADIO" | "NUMBER" | "SELECT" | "PASSWORD" | "CHECK_BOX" | "MULTI_SELECT" | "RADIO";
|
|
2901
|
+
};
|
|
2902
|
+
type GetMechanizationQuestionVariable = {
|
|
2903
|
+
varietyId: string;
|
|
2904
|
+
};
|
|
2905
|
+
type MechanizationMovementChangesModel = {
|
|
2906
|
+
longitude: number;
|
|
2907
|
+
latitude: number;
|
|
2908
|
+
heading: number;
|
|
2909
|
+
date: string;
|
|
2910
|
+
};
|
|
2911
|
+
type MechanizationMovementChangesVariable = {
|
|
2912
|
+
farmerId: string;
|
|
2913
|
+
mechanizationId: string;
|
|
2914
|
+
fromDate?: string | null | undefined;
|
|
2915
|
+
toDate?: string | null | undefined;
|
|
2916
|
+
};
|
|
2917
|
+
type QuestionInformation = components["schemas"]["MechanizationInformationInput"][];
|
|
2918
|
+
type CreateMechanizationVariables = {
|
|
2919
|
+
farmerId: string;
|
|
2920
|
+
body: {
|
|
2921
|
+
avatarURL: string;
|
|
2922
|
+
information: QuestionInformation[];
|
|
2923
|
+
varietyId: string;
|
|
2924
|
+
};
|
|
2925
|
+
};
|
|
2926
|
+
|
|
2918
2927
|
type HttpMethod = "get" | "post" | "put" | "delete" | "patch";
|
|
2919
2928
|
type ExtractPathsByMethod<M extends HttpMethod> = {
|
|
2920
2929
|
[K in keyof paths]: M extends keyof paths[K] ? K : never;
|
|
@@ -2938,14 +2947,18 @@ type PathParams<Op> = Op extends {
|
|
|
2938
2947
|
};
|
|
2939
2948
|
} ? P extends object ? P : never : never;
|
|
2940
2949
|
type ResponseData<Op> = Op extends {
|
|
2941
|
-
responses: {
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
"application/json": infer R;
|
|
2945
|
-
};
|
|
2950
|
+
responses: Record<string, {
|
|
2951
|
+
content?: {
|
|
2952
|
+
"application/json"?: infer _R;
|
|
2946
2953
|
};
|
|
2947
|
-
}
|
|
2948
|
-
} ?
|
|
2954
|
+
}>;
|
|
2955
|
+
} ? {
|
|
2956
|
+
[K in keyof Op["responses"]]: Op["responses"][K] extends {
|
|
2957
|
+
content: {
|
|
2958
|
+
"application/json": infer R;
|
|
2959
|
+
};
|
|
2960
|
+
} ? R : never;
|
|
2961
|
+
}[keyof Op["responses"]] : unknown;
|
|
2949
2962
|
|
|
2950
2963
|
type ExtendedClient = AxiosInstance & {
|
|
2951
2964
|
typed: <M extends HttpMethod, P extends ExtractPathsByMethod<M>, Op extends PathOperation<M, P>>(_method: M, _path: P, _config?: {
|
|
@@ -2973,8 +2986,9 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
|
|
|
2973
2986
|
getMechanizationQuestionList: ({ varietyId, }: GetMechanizationQuestionVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationQuestionModel[]>>;
|
|
2974
2987
|
getMechanizationMovementChanges: ({ farmerId, mechanizationId, fromDate, toDate, }: MechanizationMovementChangesVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationMovementChangesModel[]>>;
|
|
2975
2988
|
DeleteTrackingDeviceCode: ({ farmerId, mechanizationId, verificationToken, }: DeleteTrackingDeviceVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<TrackingDeviceCodeModel>>;
|
|
2989
|
+
CreateMechanization: ({ farmerId, body, }: CreateMechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<unknown>>;
|
|
2976
2990
|
};
|
|
2977
2991
|
};
|
|
2978
2992
|
};
|
|
2979
2993
|
|
|
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 };
|
|
2994
|
+
export { type CreateMechanizationVariables, 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 QuestionInformation, 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
|
@@ -141,7 +141,8 @@ 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
|
+
createMechanization: (_dto) => ({})
|
|
145
146
|
};
|
|
146
147
|
|
|
147
148
|
// src/utils/wrapError.ts
|
|
@@ -334,6 +335,32 @@ var createMechanizationServices = (client) => ({
|
|
|
334
335
|
} catch (error) {
|
|
335
336
|
return wrapError(error);
|
|
336
337
|
}
|
|
338
|
+
},
|
|
339
|
+
CreateMechanization: async ({
|
|
340
|
+
farmerId,
|
|
341
|
+
body
|
|
342
|
+
}) => {
|
|
343
|
+
try {
|
|
344
|
+
const response = await client.typed(
|
|
345
|
+
"post",
|
|
346
|
+
"/farmers/{farmerId}/mechanizations",
|
|
347
|
+
{
|
|
348
|
+
pathParams: {
|
|
349
|
+
farmerId
|
|
350
|
+
},
|
|
351
|
+
body: {
|
|
352
|
+
avatarURL: body.avatarURL,
|
|
353
|
+
information: body.information,
|
|
354
|
+
varietyId: body.varietyId
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
);
|
|
358
|
+
return R2.Ok(
|
|
359
|
+
mappers.createMechanization(response.result.data.mechanization)
|
|
360
|
+
);
|
|
361
|
+
} catch (error) {
|
|
362
|
+
return wrapError(error);
|
|
363
|
+
}
|
|
337
364
|
}
|
|
338
365
|
});
|
|
339
366
|
|