@agroyaar/sdk 1.4.1 → 1.5.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 +25 -1
- package/dist/index.d.ts +12 -3
- package/dist/index.mjs +25 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -84,7 +84,8 @@ var mappers = {
|
|
|
84
84
|
iconURL: response.iconURL,
|
|
85
85
|
kind: response.kind,
|
|
86
86
|
seasonProcessIds: response.seasonProcessIds,
|
|
87
|
-
machineUsageIds: response.machineUsageIds
|
|
87
|
+
machineUsageIds: response.machineUsageIds,
|
|
88
|
+
seasonsProcess: response.seasonsProcess
|
|
88
89
|
}),
|
|
89
90
|
getMechanizationVarietyList: (response) => response.map(mappers.getMechanizationVariety),
|
|
90
91
|
getSpeedChangesChart: (response) => ({
|
|
@@ -104,6 +105,13 @@ var mappers = {
|
|
|
104
105
|
variety: mappers.getMechanizationVariety(response.variety)
|
|
105
106
|
}),
|
|
106
107
|
getMechanizationsList: (response) => response.map(mappers.getMechanization),
|
|
108
|
+
getSeasonsProcess: (response) => ({
|
|
109
|
+
id: response.id,
|
|
110
|
+
label: response.label,
|
|
111
|
+
mechanizationVarietyIds: response.mechanizationVarietyIds,
|
|
112
|
+
name: response.name
|
|
113
|
+
}),
|
|
114
|
+
getSeasonsProcessList: (response) => response.map(mappers.getSeasonsProcess),
|
|
107
115
|
getMotorizedMechanizationSensors: (response) => ({
|
|
108
116
|
id: response.id,
|
|
109
117
|
speed: response.speed,
|
|
@@ -206,6 +214,22 @@ var createMechanizationServices = (client) => ({
|
|
|
206
214
|
console.error("SubmitTrackingDevice API Error:", err);
|
|
207
215
|
return import_ts_belt.R.Error(err);
|
|
208
216
|
}
|
|
217
|
+
},
|
|
218
|
+
getSeasonsProcess: async () => {
|
|
219
|
+
try {
|
|
220
|
+
const { data } = await client.get(
|
|
221
|
+
"/statics/mechanizations-seasons-process-kinds"
|
|
222
|
+
);
|
|
223
|
+
return import_ts_belt.R.Ok(
|
|
224
|
+
mappers.getSeasonsProcessList(
|
|
225
|
+
data.result.data.mechanizationSeasonProcessKinds
|
|
226
|
+
)
|
|
227
|
+
);
|
|
228
|
+
} catch (error) {
|
|
229
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
230
|
+
console.error("getSeasonsProcess API Error:", err);
|
|
231
|
+
return import_ts_belt.R.Error(err);
|
|
232
|
+
}
|
|
209
233
|
}
|
|
210
234
|
});
|
|
211
235
|
|
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,9 @@ type Brand<B> = {
|
|
|
9
9
|
type Branded<T, B> = Brand<B> & T;
|
|
10
10
|
|
|
11
11
|
declare namespace Identifiers {
|
|
12
|
-
type MechanizationVarietyId = Branded<string, "
|
|
13
|
-
type MechanizationId = Branded<string, "
|
|
12
|
+
type MechanizationVarietyId = Branded<string, "mechanizationVariety-id">;
|
|
13
|
+
type MechanizationId = Branded<string, "mechanization-id">;
|
|
14
|
+
type SeasonsProcessId = Branded<string, " seasonsProcess-id">;
|
|
14
15
|
type MotorizedMechanizationSensorsId = Branded<string, "motorized-mechanization-sensorsId-id">;
|
|
15
16
|
type FarmerId = Branded<string, "farmer-id">;
|
|
16
17
|
}
|
|
@@ -233,6 +234,7 @@ type MechanizationVarietyModel = {
|
|
|
233
234
|
kind: VarietyKind;
|
|
234
235
|
seasonProcessIds: string[];
|
|
235
236
|
machineUsageIds: string[];
|
|
237
|
+
seasonsProcess: MechanizationSeasonProcessKind[];
|
|
236
238
|
};
|
|
237
239
|
type MechanizationVarietyVariables = {
|
|
238
240
|
kindName: MechanizationType;
|
|
@@ -252,6 +254,12 @@ type MechanizationVariables = {
|
|
|
252
254
|
farmerId: string;
|
|
253
255
|
kindName: MechanizationType;
|
|
254
256
|
};
|
|
257
|
+
type SeasonsProcessModel = {
|
|
258
|
+
id: Identifiers.SeasonsProcessId;
|
|
259
|
+
name: string;
|
|
260
|
+
label: string;
|
|
261
|
+
mechanizationVarietyIds: string[];
|
|
262
|
+
};
|
|
255
263
|
type MotorizedMechanizationSensorsModel = {
|
|
256
264
|
id: string;
|
|
257
265
|
speed: number;
|
|
@@ -301,8 +309,9 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
|
|
|
301
309
|
getMechanizations: ({ kindName, farmerId }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
|
|
302
310
|
getMotorizedMechanizationSensors: ({ farmerId, mechanizationId, }: MotorizedMechanizationSensorsVariables) => Promise<_mobily_ts_belt.Ok<MotorizedMechanizationSensorsModel> | undefined>;
|
|
303
311
|
SubmitTrackingDeviceCode: ({ farmerId, mechanizationId, deviceCode, }: SubmitTrackingDeviceVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SubmitTrackingDeviceModel>>;
|
|
312
|
+
getSeasonsProcess: () => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SeasonsProcessModel[]>>;
|
|
304
313
|
};
|
|
305
314
|
};
|
|
306
315
|
};
|
|
307
316
|
|
|
308
|
-
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 SpeedChangesChartModel, type SpeedChangesChartVariables, type Status, type StatusType, type SubmitTrackingDeviceModel, type SubmitTrackingDeviceVariables, type TaskType, type VarietyKind, createSDK };
|
|
317
|
+
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 SeasonsProcessModel, type ServerResponse, type ServiceType, type SpeedChangesChartModel, type SpeedChangesChartVariables, type Status, type StatusType, type SubmitTrackingDeviceModel, type SubmitTrackingDeviceVariables, type TaskType, type VarietyKind, createSDK };
|
package/dist/index.mjs
CHANGED
|
@@ -48,7 +48,8 @@ var mappers = {
|
|
|
48
48
|
iconURL: response.iconURL,
|
|
49
49
|
kind: response.kind,
|
|
50
50
|
seasonProcessIds: response.seasonProcessIds,
|
|
51
|
-
machineUsageIds: response.machineUsageIds
|
|
51
|
+
machineUsageIds: response.machineUsageIds,
|
|
52
|
+
seasonsProcess: response.seasonsProcess
|
|
52
53
|
}),
|
|
53
54
|
getMechanizationVarietyList: (response) => response.map(mappers.getMechanizationVariety),
|
|
54
55
|
getSpeedChangesChart: (response) => ({
|
|
@@ -68,6 +69,13 @@ var mappers = {
|
|
|
68
69
|
variety: mappers.getMechanizationVariety(response.variety)
|
|
69
70
|
}),
|
|
70
71
|
getMechanizationsList: (response) => response.map(mappers.getMechanization),
|
|
72
|
+
getSeasonsProcess: (response) => ({
|
|
73
|
+
id: response.id,
|
|
74
|
+
label: response.label,
|
|
75
|
+
mechanizationVarietyIds: response.mechanizationVarietyIds,
|
|
76
|
+
name: response.name
|
|
77
|
+
}),
|
|
78
|
+
getSeasonsProcessList: (response) => response.map(mappers.getSeasonsProcess),
|
|
71
79
|
getMotorizedMechanizationSensors: (response) => ({
|
|
72
80
|
id: response.id,
|
|
73
81
|
speed: response.speed,
|
|
@@ -170,6 +178,22 @@ var createMechanizationServices = (client) => ({
|
|
|
170
178
|
console.error("SubmitTrackingDevice API Error:", err);
|
|
171
179
|
return R.Error(err);
|
|
172
180
|
}
|
|
181
|
+
},
|
|
182
|
+
getSeasonsProcess: async () => {
|
|
183
|
+
try {
|
|
184
|
+
const { data } = await client.get(
|
|
185
|
+
"/statics/mechanizations-seasons-process-kinds"
|
|
186
|
+
);
|
|
187
|
+
return R.Ok(
|
|
188
|
+
mappers.getSeasonsProcessList(
|
|
189
|
+
data.result.data.mechanizationSeasonProcessKinds
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
} catch (error) {
|
|
193
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
194
|
+
console.error("getSeasonsProcess API Error:", err);
|
|
195
|
+
return R.Error(err);
|
|
196
|
+
}
|
|
173
197
|
}
|
|
174
198
|
});
|
|
175
199
|
|