@tap-payments/auth-jsconnect 2.0.113-test → 2.0.114-test
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/build/api/entity.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export declare type UploadFileBody = {
|
|
|
52
52
|
file?: File;
|
|
53
53
|
title: string | undefined;
|
|
54
54
|
purpose: string;
|
|
55
|
+
type?: string;
|
|
55
56
|
};
|
|
56
57
|
export declare type UpdateEntityBody = {
|
|
57
58
|
id: string;
|
|
@@ -72,6 +73,7 @@ export declare type UpdateEntityBody = {
|
|
|
72
73
|
ar: string;
|
|
73
74
|
en: string;
|
|
74
75
|
};
|
|
76
|
+
AOA_file_id?: string;
|
|
75
77
|
encryption_contract?: Array<string>;
|
|
76
78
|
};
|
|
77
79
|
export declare type DocumentInfo = {
|
|
@@ -216,7 +216,7 @@ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', f
|
|
|
216
216
|
});
|
|
217
217
|
}); });
|
|
218
218
|
export var updateEntity = createAsyncThunk('entityUpdateEntity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
219
|
-
var _a, settings, entity, id, brandId,
|
|
219
|
+
var _a, settings, entity, id, brandId, articleId, requestBody, brandData, payload, data;
|
|
220
220
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
221
221
|
return __generator(this, function (_j) {
|
|
222
222
|
switch (_j.label) {
|
|
@@ -224,22 +224,7 @@ export var updateEntity = createAsyncThunk('entityUpdateEntity', function (param
|
|
|
224
224
|
_a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
|
|
225
225
|
id = (_c = (_b = entity.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id;
|
|
226
226
|
brandId = (_e = (_d = entity.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.brand) === null || _e === void 0 ? void 0 : _e.id;
|
|
227
|
-
documentData = undefined;
|
|
228
227
|
articleId = entity.data.entityData.articleId;
|
|
229
|
-
if (!articleId) return [3, 2];
|
|
230
|
-
documentBody = {
|
|
231
|
-
entity_id: id || '',
|
|
232
|
-
documents: [
|
|
233
|
-
{
|
|
234
|
-
images: [articleId]
|
|
235
|
-
}
|
|
236
|
-
]
|
|
237
|
-
};
|
|
238
|
-
return [4, API.entityService.updateDocumentInfo(documentBody)];
|
|
239
|
-
case 1:
|
|
240
|
-
documentData = _j.sent();
|
|
241
|
-
_j.label = 2;
|
|
242
|
-
case 2:
|
|
243
228
|
requestBody = {
|
|
244
229
|
id: brandId,
|
|
245
230
|
activities: (_f = (params.activities || [])) === null || _f === void 0 ? void 0 : _f.map(function (_a) {
|
|
@@ -252,7 +237,7 @@ export var updateEntity = createAsyncThunk('entityUpdateEntity', function (param
|
|
|
252
237
|
encryption_contract: ['operations.start_date']
|
|
253
238
|
};
|
|
254
239
|
return [4, API.brandService.updateBrandInfo(requestBody)];
|
|
255
|
-
case
|
|
240
|
+
case 1:
|
|
256
241
|
brandData = (_j.sent()).data;
|
|
257
242
|
payload = {
|
|
258
243
|
id: id,
|
|
@@ -263,28 +248,33 @@ export var updateEntity = createAsyncThunk('entityUpdateEntity', function (param
|
|
|
263
248
|
ar: params.licenseName,
|
|
264
249
|
en: params.licenseName
|
|
265
250
|
},
|
|
251
|
+
AOA_file_id: articleId,
|
|
266
252
|
encryption_contract: ['license.number', 'legal_name.ar', 'legal_name.en']
|
|
267
253
|
};
|
|
268
254
|
return [4, API.entityService.updateEntity(payload)];
|
|
269
|
-
case
|
|
255
|
+
case 2:
|
|
270
256
|
data = _j.sent();
|
|
271
257
|
thunkApi.dispatch(handleNextScreenStep());
|
|
272
258
|
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, id);
|
|
273
|
-
return [2, { data: __assign(__assign(
|
|
259
|
+
return [2, { data: __assign(__assign({}, data), brandData), formData: params }];
|
|
274
260
|
}
|
|
275
261
|
});
|
|
276
262
|
}); });
|
|
277
263
|
export var uploadArticle = createAsyncThunk('entityUploadArticle', function (_a) {
|
|
278
264
|
var file = _a.file, onProgress = _a.onProgress;
|
|
279
265
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
280
|
-
var uploadPayload, onUploadProgress, data;
|
|
281
|
-
|
|
282
|
-
|
|
266
|
+
var typeArray, type, uploadPayload, onUploadProgress, data;
|
|
267
|
+
var _b;
|
|
268
|
+
return __generator(this, function (_c) {
|
|
269
|
+
switch (_c.label) {
|
|
283
270
|
case 0:
|
|
271
|
+
typeArray = ((_b = file === null || file === void 0 ? void 0 : file.type) === null || _b === void 0 ? void 0 : _b.split('/')) || [];
|
|
272
|
+
type = typeArray[1] || '';
|
|
284
273
|
uploadPayload = {
|
|
285
274
|
file_link_create: true,
|
|
286
275
|
title: file === null || file === void 0 ? void 0 : file.name,
|
|
287
276
|
purpose: 'identity_document',
|
|
277
|
+
type: type,
|
|
288
278
|
file: file
|
|
289
279
|
};
|
|
290
280
|
onUploadProgress = function (progressEvent) {
|
|
@@ -293,7 +283,7 @@ export var uploadArticle = createAsyncThunk('entityUploadArticle', function (_a)
|
|
|
293
283
|
};
|
|
294
284
|
return [4, API.entityService.uploadFileInfo(uploadPayload, { onUploadProgress: onUploadProgress })];
|
|
295
285
|
case 1:
|
|
296
|
-
data =
|
|
286
|
+
data = _c.sent();
|
|
297
287
|
return [2, { data: data }];
|
|
298
288
|
}
|
|
299
289
|
});
|