@agroyaar/sdk 2.2.0 → 2.2.1-1
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 +23 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.mjs +23 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -177,7 +177,11 @@ 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
|
+
verifyPhoneNumber: (dto) => ({
|
|
182
|
+
phoneNumber: dto.phoneNumber,
|
|
183
|
+
verificationToken: dto.verificationToken
|
|
184
|
+
})
|
|
181
185
|
};
|
|
182
186
|
|
|
183
187
|
// src/utils/wrapError.ts
|
|
@@ -220,7 +224,10 @@ var createMechanizationServices = (client) => ({
|
|
|
220
224
|
return wrapError(error);
|
|
221
225
|
}
|
|
222
226
|
},
|
|
223
|
-
getMechanization: async ({
|
|
227
|
+
getMechanization: async ({
|
|
228
|
+
farmerId,
|
|
229
|
+
mechanizationId
|
|
230
|
+
}) => {
|
|
224
231
|
try {
|
|
225
232
|
const response = await client.typed(
|
|
226
233
|
"get",
|
|
@@ -391,6 +398,20 @@ var createMechanizationServices = (client) => ({
|
|
|
391
398
|
} catch (error) {
|
|
392
399
|
return wrapError(error);
|
|
393
400
|
}
|
|
401
|
+
},
|
|
402
|
+
verifyPhoneNumber: async ({
|
|
403
|
+
phoneNumber,
|
|
404
|
+
otpCode
|
|
405
|
+
}) => {
|
|
406
|
+
try {
|
|
407
|
+
const { data } = await client.post(`/auth/verify-phone-number`, {
|
|
408
|
+
phoneNumber,
|
|
409
|
+
otpCode
|
|
410
|
+
});
|
|
411
|
+
return import_ts_belt2.R.Ok(mappers.verifyPhoneNumber(data));
|
|
412
|
+
} catch (error) {
|
|
413
|
+
return wrapError(error);
|
|
414
|
+
}
|
|
394
415
|
}
|
|
395
416
|
});
|
|
396
417
|
|
package/dist/index.d.ts
CHANGED
|
@@ -155,6 +155,14 @@ type MechanizationMovementChangesVariable = {
|
|
|
155
155
|
fromDate?: string | null | undefined;
|
|
156
156
|
toDate?: string | null | undefined;
|
|
157
157
|
};
|
|
158
|
+
type VerifyPhoneNumberModel = {
|
|
159
|
+
phoneNumber: string;
|
|
160
|
+
verificationToken: string;
|
|
161
|
+
};
|
|
162
|
+
type VerifyPhoneNumberVariables = {
|
|
163
|
+
phoneNumber: string;
|
|
164
|
+
otpCode: string;
|
|
165
|
+
};
|
|
158
166
|
|
|
159
167
|
/**
|
|
160
168
|
* This file was auto-generated by openapi-typescript.
|
|
@@ -2969,7 +2977,7 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
|
|
|
2969
2977
|
mechanization: {
|
|
2970
2978
|
getMechanizationVarieties: ({ kindName, }: MechanizationVarietyVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationVarietyModel[]>>;
|
|
2971
2979
|
getSpeedChangesChartData: ({ farmerId, mechanizationId, }: SpeedChangesChartVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<SpeedChangesChartModel[]>>;
|
|
2972
|
-
getMechanization: ({ farmerId, mechanizationId }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel>>;
|
|
2980
|
+
getMechanization: ({ farmerId, mechanizationId, }: MechanizationVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel>>;
|
|
2973
2981
|
getMechanizations: ({ farmerId, kindName, }: MechanizationsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationModel[]>>;
|
|
2974
2982
|
getMotorizedMechanizationSensors: ({ farmerId, mechanizationId, }: MotorizedMechanizationSensorsVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MotorizedMechanizationSensorsModel>>;
|
|
2975
2983
|
SubmitTrackingDeviceCode: ({ farmerId, mechanizationId, deviceCode, }: SubmitTrackingDeviceVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<TrackingDeviceCodeModel>>;
|
|
@@ -2978,8 +2986,9 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
|
|
|
2978
2986
|
getMechanizationQuestionList: ({ varietyId, }: GetMechanizationQuestionVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationQuestionModel[]>>;
|
|
2979
2987
|
getMechanizationMovementChanges: ({ farmerId, mechanizationId, fromDate, toDate, }: MechanizationMovementChangesVariable) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<MechanizationMovementChangesModel[]>>;
|
|
2980
2988
|
DeleteTrackingDeviceCode: ({ farmerId, mechanizationId, verificationToken, }: DeleteTrackingDeviceVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<TrackingDeviceCodeModel>>;
|
|
2989
|
+
verifyPhoneNumber: ({ phoneNumber, otpCode, }: VerifyPhoneNumberVariables) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<VerifyPhoneNumberModel>>;
|
|
2981
2990
|
};
|
|
2982
2991
|
};
|
|
2983
2992
|
};
|
|
2984
2993
|
|
|
2985
|
-
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 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, createSDK };
|
|
2994
|
+
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 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -141,7 +141,11 @@ 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
|
+
verifyPhoneNumber: (dto) => ({
|
|
146
|
+
phoneNumber: dto.phoneNumber,
|
|
147
|
+
verificationToken: dto.verificationToken
|
|
148
|
+
})
|
|
145
149
|
};
|
|
146
150
|
|
|
147
151
|
// src/utils/wrapError.ts
|
|
@@ -184,7 +188,10 @@ var createMechanizationServices = (client) => ({
|
|
|
184
188
|
return wrapError(error);
|
|
185
189
|
}
|
|
186
190
|
},
|
|
187
|
-
getMechanization: async ({
|
|
191
|
+
getMechanization: async ({
|
|
192
|
+
farmerId,
|
|
193
|
+
mechanizationId
|
|
194
|
+
}) => {
|
|
188
195
|
try {
|
|
189
196
|
const response = await client.typed(
|
|
190
197
|
"get",
|
|
@@ -355,6 +362,20 @@ var createMechanizationServices = (client) => ({
|
|
|
355
362
|
} catch (error) {
|
|
356
363
|
return wrapError(error);
|
|
357
364
|
}
|
|
365
|
+
},
|
|
366
|
+
verifyPhoneNumber: async ({
|
|
367
|
+
phoneNumber,
|
|
368
|
+
otpCode
|
|
369
|
+
}) => {
|
|
370
|
+
try {
|
|
371
|
+
const { data } = await client.post(`/auth/verify-phone-number`, {
|
|
372
|
+
phoneNumber,
|
|
373
|
+
otpCode
|
|
374
|
+
});
|
|
375
|
+
return R2.Ok(mappers.verifyPhoneNumber(data));
|
|
376
|
+
} catch (error) {
|
|
377
|
+
return wrapError(error);
|
|
378
|
+
}
|
|
358
379
|
}
|
|
359
380
|
});
|
|
360
381
|
|