@agroyaar/sdk 1.1.6-1 → 1.1.6-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 +2 -4
- package/dist/index.d.ts +105 -1
- package/dist/index.mjs +2 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -155,13 +155,11 @@ var createMechanizationServices = (client) => ({
|
|
|
155
155
|
mechanizationId
|
|
156
156
|
}) => {
|
|
157
157
|
try {
|
|
158
|
-
const { data } = await client.get(
|
|
159
|
-
`/farmers/${farmerId}/mechanizations/${mechanizationId}/sensors`
|
|
160
|
-
);
|
|
158
|
+
const { data } = await client.get(`/farmers/${farmerId}/mechanizations/${mechanizationId}/sensors`);
|
|
161
159
|
console.log({ data });
|
|
162
160
|
return import_ts_belt.R.Ok(
|
|
163
161
|
mappers.getMotorizedMechanizationSensors(
|
|
164
|
-
data.result.data.
|
|
162
|
+
data.result.data.motorizedMechanizationSensors
|
|
165
163
|
)
|
|
166
164
|
);
|
|
167
165
|
} catch (error) {
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,93 @@ declare namespace Identifiers {
|
|
|
14
14
|
type MotorizedMechanizationSensorsId = Branded<string, "motorized-mechanization-sensorsId-id">;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
type FarmerDTO = {
|
|
18
|
+
id: string;
|
|
19
|
+
username: string;
|
|
20
|
+
firstName: string;
|
|
21
|
+
lastName: string;
|
|
22
|
+
fullName: string;
|
|
23
|
+
phoneNumber: string;
|
|
24
|
+
nationalCode: string;
|
|
25
|
+
farmerCode: string;
|
|
26
|
+
birthDate: string;
|
|
27
|
+
avatar: string;
|
|
28
|
+
province: string;
|
|
29
|
+
provinceId: number;
|
|
30
|
+
city: string;
|
|
31
|
+
cityId: number;
|
|
32
|
+
zone: string;
|
|
33
|
+
address: string;
|
|
34
|
+
postalCode: number;
|
|
35
|
+
role: string;
|
|
36
|
+
productsIds: number[];
|
|
37
|
+
status: string;
|
|
38
|
+
walletBalance: number;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type MechanizationAnswerOptionDTO = {
|
|
42
|
+
id: string;
|
|
43
|
+
label: string;
|
|
44
|
+
mechanizationQuestionId: string;
|
|
45
|
+
};
|
|
46
|
+
type InformationDTO = {
|
|
47
|
+
id: string;
|
|
48
|
+
status: Status;
|
|
49
|
+
answerOptions: MechanizationAnswerOptionDTO;
|
|
50
|
+
answerValue: string;
|
|
51
|
+
mechanizationId: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
declare namespace ServerResponseTypes {
|
|
55
|
+
namespace Dashboard {
|
|
56
|
+
type MechanizationVarietyDTO = {
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
code: string;
|
|
60
|
+
iconURL: string;
|
|
61
|
+
kind: VarietyKind;
|
|
62
|
+
kindName: MechanizationType;
|
|
63
|
+
seasonsProcess: MechanizationSeasonProcessKind[];
|
|
64
|
+
seasonProcessIds: string[];
|
|
65
|
+
machinesUsage: MechanizationMachineUsageKind[];
|
|
66
|
+
machineUsageIds: string[];
|
|
67
|
+
mechanizationQuestions: string[];
|
|
68
|
+
};
|
|
69
|
+
type MechanizationDTO = {
|
|
70
|
+
id: string;
|
|
71
|
+
model: string;
|
|
72
|
+
commonName: string;
|
|
73
|
+
avatarURL: string;
|
|
74
|
+
manufactureYear: string;
|
|
75
|
+
code: string;
|
|
76
|
+
kind: VarietyKind;
|
|
77
|
+
kindName: MechanizationType;
|
|
78
|
+
deviceCode: string;
|
|
79
|
+
status: Status;
|
|
80
|
+
farmer: FarmerDTO;
|
|
81
|
+
farmerId: string;
|
|
82
|
+
variety: MechanizationVarietyDTO;
|
|
83
|
+
information: InformationDTO[];
|
|
84
|
+
};
|
|
85
|
+
type MotorizedMechanizationSensorsDTO = {
|
|
86
|
+
id: string;
|
|
87
|
+
speed: number;
|
|
88
|
+
heading: string;
|
|
89
|
+
latitude: number;
|
|
90
|
+
longitude: number;
|
|
91
|
+
fuelLevel: number;
|
|
92
|
+
engineRpm: number;
|
|
93
|
+
deviceCode: string;
|
|
94
|
+
stateEngine: boolean;
|
|
95
|
+
engineOilPressure: boolean;
|
|
96
|
+
engineWaterTemperature: string;
|
|
97
|
+
batteryChargePercentage: string;
|
|
98
|
+
mechanizationId: string;
|
|
99
|
+
mechanization: MechanizationDTO;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
17
104
|
type ServiceType = "EXPERIMENT" | "VISIT" | "CHILLING_REQUIREMENT" | "CULTIVAR_RECOMMENDATION" | "FIRST_SAFFRON_IRRIGATION_DATE_RECOMMENDATION" | "HARVEST_DATE_RECOMMENDATION" | "QUESTIONNAIRE" | "SOWING_DATE_RECOMMENDATIONS" | "WEATHER_STATION" | "YIELD_GAP";
|
|
18
105
|
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";
|
|
19
106
|
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";
|
|
@@ -21,6 +108,14 @@ type MechanizationType = "MOTORIZED" | "NON_MOTORIZED";
|
|
|
21
108
|
type MechanizationSeasonProcessType = "GROWING" | "HARVESTING" | "PLANTING" | "TRANSPORTATION";
|
|
22
109
|
type MechanizationMachineUsageType = "BALER" | "CRUSHING" | "CRUST_BREAKER" | "FERTILIZER_SPREADER" | "FORAGE_COLLECTOR" | "FURROWER" | "GRASS_CUTTER" | "GRINDING" | "HARVESTING" | "LEVELING" | "LOADER" | "MULTI_PURPOSE" | "SEEDER" | "SPRAYER" | "TILLAGE" | "TRANSPORTATION" | "WEEDER";
|
|
23
110
|
|
|
111
|
+
type ServerResponse<T> = {
|
|
112
|
+
message: string;
|
|
113
|
+
code: string;
|
|
114
|
+
data: T;
|
|
115
|
+
};
|
|
116
|
+
type BaseResponse<T> = {
|
|
117
|
+
result: ServerResponse<T>;
|
|
118
|
+
};
|
|
24
119
|
type Status = {
|
|
25
120
|
id: string;
|
|
26
121
|
label: string;
|
|
@@ -41,6 +136,15 @@ type MechanizationMachineUsageKind = {
|
|
|
41
136
|
label: string;
|
|
42
137
|
name: MechanizationMachineUsageType;
|
|
43
138
|
};
|
|
139
|
+
type MechanizationListData = {
|
|
140
|
+
meta: Record<string, unknown>;
|
|
141
|
+
totalItems: number;
|
|
142
|
+
mechanizations: ServerResponseTypes.Dashboard.MechanizationDTO[];
|
|
143
|
+
};
|
|
144
|
+
type MotorizedMechanizationSensorsData = {
|
|
145
|
+
meta: Record<string, unknown>;
|
|
146
|
+
motorizedMechanizationSensors: ServerResponseTypes.Dashboard.MotorizedMechanizationSensorsDTO;
|
|
147
|
+
};
|
|
44
148
|
|
|
45
149
|
type MechanizationVarietyModel = {
|
|
46
150
|
id: Identifiers.MechanizationVarietyId;
|
|
@@ -103,4 +207,4 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
|
|
|
103
207
|
};
|
|
104
208
|
};
|
|
105
209
|
|
|
106
|
-
export { type MechanizationMachineUsageKind, type MechanizationMachineUsageType, type MechanizationModel, type MechanizationSeasonProcessKind, type MechanizationSeasonProcessType, type MechanizationType, type MechanizationVariables, type MechanizationVarietyModel, type MechanizationVarietyVariables, type MotorizedMechanizationSensorsModel, type MotorizedMechanizationSensorsVariables, type ServiceType, type Status, type StatusType, type TaskType, type VarietyKind, createSDK };
|
|
210
|
+
export { type BaseResponse, type MechanizationListData, type MechanizationMachineUsageKind, type MechanizationMachineUsageType, type MechanizationModel, type MechanizationSeasonProcessKind, type MechanizationSeasonProcessType, type MechanizationType, type MechanizationVariables, type MechanizationVarietyModel, type MechanizationVarietyVariables, type MotorizedMechanizationSensorsData, type MotorizedMechanizationSensorsModel, type MotorizedMechanizationSensorsVariables, type ServerResponse, type ServiceType, type Status, type StatusType, type TaskType, type VarietyKind, createSDK };
|
package/dist/index.mjs
CHANGED
|
@@ -119,13 +119,11 @@ var createMechanizationServices = (client) => ({
|
|
|
119
119
|
mechanizationId
|
|
120
120
|
}) => {
|
|
121
121
|
try {
|
|
122
|
-
const { data } = await client.get(
|
|
123
|
-
`/farmers/${farmerId}/mechanizations/${mechanizationId}/sensors`
|
|
124
|
-
);
|
|
122
|
+
const { data } = await client.get(`/farmers/${farmerId}/mechanizations/${mechanizationId}/sensors`);
|
|
125
123
|
console.log({ data });
|
|
126
124
|
return R.Ok(
|
|
127
125
|
mappers.getMotorizedMechanizationSensors(
|
|
128
|
-
data.result.data.
|
|
126
|
+
data.result.data.motorizedMechanizationSensors
|
|
129
127
|
)
|
|
130
128
|
);
|
|
131
129
|
} catch (error) {
|