@devizovaburza/mdm-sdk 0.0.18 → 0.0.19
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/v1/index.cjs +35 -0
- package/dist/v1/index.d.cts +99 -0
- package/dist/v1/index.d.mts +99 -0
- package/dist/v1/index.d.ts +99 -0
- package/dist/v1/index.mjs +35 -0
- package/package.json +1 -1
package/dist/v1/index.cjs
CHANGED
|
@@ -14093,6 +14093,7 @@ new zodOpenapi.OpenAPIHono().openapi(
|
|
|
14093
14093
|
fromDate: new Date(dateOfEstablishment)
|
|
14094
14094
|
});
|
|
14095
14095
|
if (identityDocuments?.length) {
|
|
14096
|
+
const docService = context.env.DOCUMENT_SERVICE;
|
|
14096
14097
|
for (const doc of identityDocuments) {
|
|
14097
14098
|
await mdm.createIdDocument({
|
|
14098
14099
|
partyId: repParty.id,
|
|
@@ -14108,6 +14109,18 @@ new zodOpenapi.OpenAPIHono().openapi(
|
|
|
14108
14109
|
backImageUri: doc.backImageUri
|
|
14109
14110
|
}
|
|
14110
14111
|
});
|
|
14112
|
+
if (doc.frontImageUri) {
|
|
14113
|
+
await docService.acknowledgeDocument({
|
|
14114
|
+
storageUrl: doc.frontImageUri,
|
|
14115
|
+
entityId: repParty.id
|
|
14116
|
+
});
|
|
14117
|
+
}
|
|
14118
|
+
if (doc.backImageUri) {
|
|
14119
|
+
await docService.acknowledgeDocument({
|
|
14120
|
+
storageUrl: doc.backImageUri,
|
|
14121
|
+
entityId: repParty.id
|
|
14122
|
+
});
|
|
14123
|
+
}
|
|
14111
14124
|
}
|
|
14112
14125
|
}
|
|
14113
14126
|
}
|
|
@@ -14475,6 +14488,28 @@ new zodOpenapi.OpenAPIHono().openapi(
|
|
|
14475
14488
|
if (!updatedParty || partyError) {
|
|
14476
14489
|
return context.json({ message: "Could not update a Party" }, 404);
|
|
14477
14490
|
}
|
|
14491
|
+
if (party.legalRepresentatives?.length) {
|
|
14492
|
+
const docService = context.env.DOCUMENT_SERVICE;
|
|
14493
|
+
for (const rep of party.legalRepresentatives) {
|
|
14494
|
+
const repEntityId = rep.id ?? partyId;
|
|
14495
|
+
if (rep.identityDocuments?.length) {
|
|
14496
|
+
for (const doc of rep.identityDocuments) {
|
|
14497
|
+
if (doc.frontImageUri) {
|
|
14498
|
+
await docService.acknowledgeDocument({
|
|
14499
|
+
storageUrl: doc.frontImageUri,
|
|
14500
|
+
entityId: repEntityId
|
|
14501
|
+
});
|
|
14502
|
+
}
|
|
14503
|
+
if (doc.backImageUri) {
|
|
14504
|
+
await docService.acknowledgeDocument({
|
|
14505
|
+
storageUrl: doc.backImageUri,
|
|
14506
|
+
entityId: repEntityId
|
|
14507
|
+
});
|
|
14508
|
+
}
|
|
14509
|
+
}
|
|
14510
|
+
}
|
|
14511
|
+
}
|
|
14512
|
+
}
|
|
14478
14513
|
return context.json(
|
|
14479
14514
|
{
|
|
14480
14515
|
message: "Party updated successfully",
|
package/dist/v1/index.d.cts
CHANGED
|
@@ -235,6 +235,105 @@ declare const partnerApi: OpenAPIHono<hono.Env, hono_types.MergeSchemaPath<{
|
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
237
|
}, "/v1/party/state/update-client-status"> & hono_types.MergeSchemaPath<{
|
|
238
|
+
"/": {
|
|
239
|
+
$delete: {
|
|
240
|
+
input: {
|
|
241
|
+
param: {
|
|
242
|
+
documentId: string;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
output: {
|
|
246
|
+
message: string;
|
|
247
|
+
};
|
|
248
|
+
outputFormat: "json";
|
|
249
|
+
status: 200;
|
|
250
|
+
} | {
|
|
251
|
+
input: {
|
|
252
|
+
param: {
|
|
253
|
+
documentId: string;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
output: {
|
|
257
|
+
message: string;
|
|
258
|
+
};
|
|
259
|
+
outputFormat: "json";
|
|
260
|
+
status: 400;
|
|
261
|
+
} | {
|
|
262
|
+
input: {
|
|
263
|
+
param: {
|
|
264
|
+
documentId: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
output: {
|
|
268
|
+
message: string;
|
|
269
|
+
};
|
|
270
|
+
outputFormat: "json";
|
|
271
|
+
status: 500;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
}, "/v1/documents/:documentId"> & hono_types.MergeSchemaPath<{
|
|
275
|
+
"/": {
|
|
276
|
+
$post: {
|
|
277
|
+
input: {
|
|
278
|
+
form: {
|
|
279
|
+
entityType: string;
|
|
280
|
+
type: string;
|
|
281
|
+
file: any;
|
|
282
|
+
metadata?: string | undefined;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
output: {
|
|
286
|
+
message: string;
|
|
287
|
+
documentId: string;
|
|
288
|
+
storageUrl: string;
|
|
289
|
+
};
|
|
290
|
+
outputFormat: "json";
|
|
291
|
+
status: 200;
|
|
292
|
+
} | {
|
|
293
|
+
input: {
|
|
294
|
+
form: {
|
|
295
|
+
entityType: string;
|
|
296
|
+
type: string;
|
|
297
|
+
file: any;
|
|
298
|
+
metadata?: string | undefined;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
output: {
|
|
302
|
+
message: string;
|
|
303
|
+
};
|
|
304
|
+
outputFormat: "json";
|
|
305
|
+
status: 400;
|
|
306
|
+
} | {
|
|
307
|
+
input: {
|
|
308
|
+
form: {
|
|
309
|
+
entityType: string;
|
|
310
|
+
type: string;
|
|
311
|
+
file: any;
|
|
312
|
+
metadata?: string | undefined;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
output: {
|
|
316
|
+
message: string;
|
|
317
|
+
};
|
|
318
|
+
outputFormat: "json";
|
|
319
|
+
status: 413;
|
|
320
|
+
} | {
|
|
321
|
+
input: {
|
|
322
|
+
form: {
|
|
323
|
+
entityType: string;
|
|
324
|
+
type: string;
|
|
325
|
+
file: any;
|
|
326
|
+
metadata?: string | undefined;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
output: {
|
|
330
|
+
message: string;
|
|
331
|
+
};
|
|
332
|
+
outputFormat: "json";
|
|
333
|
+
status: 500;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
}, "/v1/documents"> & hono_types.MergeSchemaPath<{
|
|
238
337
|
"/": {
|
|
239
338
|
$delete: {
|
|
240
339
|
input: {
|
package/dist/v1/index.d.mts
CHANGED
|
@@ -235,6 +235,105 @@ declare const partnerApi: OpenAPIHono<hono.Env, hono_types.MergeSchemaPath<{
|
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
237
|
}, "/v1/party/state/update-client-status"> & hono_types.MergeSchemaPath<{
|
|
238
|
+
"/": {
|
|
239
|
+
$delete: {
|
|
240
|
+
input: {
|
|
241
|
+
param: {
|
|
242
|
+
documentId: string;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
output: {
|
|
246
|
+
message: string;
|
|
247
|
+
};
|
|
248
|
+
outputFormat: "json";
|
|
249
|
+
status: 200;
|
|
250
|
+
} | {
|
|
251
|
+
input: {
|
|
252
|
+
param: {
|
|
253
|
+
documentId: string;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
output: {
|
|
257
|
+
message: string;
|
|
258
|
+
};
|
|
259
|
+
outputFormat: "json";
|
|
260
|
+
status: 400;
|
|
261
|
+
} | {
|
|
262
|
+
input: {
|
|
263
|
+
param: {
|
|
264
|
+
documentId: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
output: {
|
|
268
|
+
message: string;
|
|
269
|
+
};
|
|
270
|
+
outputFormat: "json";
|
|
271
|
+
status: 500;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
}, "/v1/documents/:documentId"> & hono_types.MergeSchemaPath<{
|
|
275
|
+
"/": {
|
|
276
|
+
$post: {
|
|
277
|
+
input: {
|
|
278
|
+
form: {
|
|
279
|
+
entityType: string;
|
|
280
|
+
type: string;
|
|
281
|
+
file: any;
|
|
282
|
+
metadata?: string | undefined;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
output: {
|
|
286
|
+
message: string;
|
|
287
|
+
documentId: string;
|
|
288
|
+
storageUrl: string;
|
|
289
|
+
};
|
|
290
|
+
outputFormat: "json";
|
|
291
|
+
status: 200;
|
|
292
|
+
} | {
|
|
293
|
+
input: {
|
|
294
|
+
form: {
|
|
295
|
+
entityType: string;
|
|
296
|
+
type: string;
|
|
297
|
+
file: any;
|
|
298
|
+
metadata?: string | undefined;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
output: {
|
|
302
|
+
message: string;
|
|
303
|
+
};
|
|
304
|
+
outputFormat: "json";
|
|
305
|
+
status: 400;
|
|
306
|
+
} | {
|
|
307
|
+
input: {
|
|
308
|
+
form: {
|
|
309
|
+
entityType: string;
|
|
310
|
+
type: string;
|
|
311
|
+
file: any;
|
|
312
|
+
metadata?: string | undefined;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
output: {
|
|
316
|
+
message: string;
|
|
317
|
+
};
|
|
318
|
+
outputFormat: "json";
|
|
319
|
+
status: 413;
|
|
320
|
+
} | {
|
|
321
|
+
input: {
|
|
322
|
+
form: {
|
|
323
|
+
entityType: string;
|
|
324
|
+
type: string;
|
|
325
|
+
file: any;
|
|
326
|
+
metadata?: string | undefined;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
output: {
|
|
330
|
+
message: string;
|
|
331
|
+
};
|
|
332
|
+
outputFormat: "json";
|
|
333
|
+
status: 500;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
}, "/v1/documents"> & hono_types.MergeSchemaPath<{
|
|
238
337
|
"/": {
|
|
239
338
|
$delete: {
|
|
240
339
|
input: {
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -235,6 +235,105 @@ declare const partnerApi: OpenAPIHono<hono.Env, hono_types.MergeSchemaPath<{
|
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
237
|
}, "/v1/party/state/update-client-status"> & hono_types.MergeSchemaPath<{
|
|
238
|
+
"/": {
|
|
239
|
+
$delete: {
|
|
240
|
+
input: {
|
|
241
|
+
param: {
|
|
242
|
+
documentId: string;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
output: {
|
|
246
|
+
message: string;
|
|
247
|
+
};
|
|
248
|
+
outputFormat: "json";
|
|
249
|
+
status: 200;
|
|
250
|
+
} | {
|
|
251
|
+
input: {
|
|
252
|
+
param: {
|
|
253
|
+
documentId: string;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
output: {
|
|
257
|
+
message: string;
|
|
258
|
+
};
|
|
259
|
+
outputFormat: "json";
|
|
260
|
+
status: 400;
|
|
261
|
+
} | {
|
|
262
|
+
input: {
|
|
263
|
+
param: {
|
|
264
|
+
documentId: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
output: {
|
|
268
|
+
message: string;
|
|
269
|
+
};
|
|
270
|
+
outputFormat: "json";
|
|
271
|
+
status: 500;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
}, "/v1/documents/:documentId"> & hono_types.MergeSchemaPath<{
|
|
275
|
+
"/": {
|
|
276
|
+
$post: {
|
|
277
|
+
input: {
|
|
278
|
+
form: {
|
|
279
|
+
entityType: string;
|
|
280
|
+
type: string;
|
|
281
|
+
file: any;
|
|
282
|
+
metadata?: string | undefined;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
output: {
|
|
286
|
+
message: string;
|
|
287
|
+
documentId: string;
|
|
288
|
+
storageUrl: string;
|
|
289
|
+
};
|
|
290
|
+
outputFormat: "json";
|
|
291
|
+
status: 200;
|
|
292
|
+
} | {
|
|
293
|
+
input: {
|
|
294
|
+
form: {
|
|
295
|
+
entityType: string;
|
|
296
|
+
type: string;
|
|
297
|
+
file: any;
|
|
298
|
+
metadata?: string | undefined;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
output: {
|
|
302
|
+
message: string;
|
|
303
|
+
};
|
|
304
|
+
outputFormat: "json";
|
|
305
|
+
status: 400;
|
|
306
|
+
} | {
|
|
307
|
+
input: {
|
|
308
|
+
form: {
|
|
309
|
+
entityType: string;
|
|
310
|
+
type: string;
|
|
311
|
+
file: any;
|
|
312
|
+
metadata?: string | undefined;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
output: {
|
|
316
|
+
message: string;
|
|
317
|
+
};
|
|
318
|
+
outputFormat: "json";
|
|
319
|
+
status: 413;
|
|
320
|
+
} | {
|
|
321
|
+
input: {
|
|
322
|
+
form: {
|
|
323
|
+
entityType: string;
|
|
324
|
+
type: string;
|
|
325
|
+
file: any;
|
|
326
|
+
metadata?: string | undefined;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
output: {
|
|
330
|
+
message: string;
|
|
331
|
+
};
|
|
332
|
+
outputFormat: "json";
|
|
333
|
+
status: 500;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
}, "/v1/documents"> & hono_types.MergeSchemaPath<{
|
|
238
337
|
"/": {
|
|
239
338
|
$delete: {
|
|
240
339
|
input: {
|
package/dist/v1/index.mjs
CHANGED
|
@@ -14077,6 +14077,7 @@ new OpenAPIHono().openapi(
|
|
|
14077
14077
|
fromDate: new Date(dateOfEstablishment)
|
|
14078
14078
|
});
|
|
14079
14079
|
if (identityDocuments?.length) {
|
|
14080
|
+
const docService = context.env.DOCUMENT_SERVICE;
|
|
14080
14081
|
for (const doc of identityDocuments) {
|
|
14081
14082
|
await mdm.createIdDocument({
|
|
14082
14083
|
partyId: repParty.id,
|
|
@@ -14092,6 +14093,18 @@ new OpenAPIHono().openapi(
|
|
|
14092
14093
|
backImageUri: doc.backImageUri
|
|
14093
14094
|
}
|
|
14094
14095
|
});
|
|
14096
|
+
if (doc.frontImageUri) {
|
|
14097
|
+
await docService.acknowledgeDocument({
|
|
14098
|
+
storageUrl: doc.frontImageUri,
|
|
14099
|
+
entityId: repParty.id
|
|
14100
|
+
});
|
|
14101
|
+
}
|
|
14102
|
+
if (doc.backImageUri) {
|
|
14103
|
+
await docService.acknowledgeDocument({
|
|
14104
|
+
storageUrl: doc.backImageUri,
|
|
14105
|
+
entityId: repParty.id
|
|
14106
|
+
});
|
|
14107
|
+
}
|
|
14095
14108
|
}
|
|
14096
14109
|
}
|
|
14097
14110
|
}
|
|
@@ -14459,6 +14472,28 @@ new OpenAPIHono().openapi(
|
|
|
14459
14472
|
if (!updatedParty || partyError) {
|
|
14460
14473
|
return context.json({ message: "Could not update a Party" }, 404);
|
|
14461
14474
|
}
|
|
14475
|
+
if (party.legalRepresentatives?.length) {
|
|
14476
|
+
const docService = context.env.DOCUMENT_SERVICE;
|
|
14477
|
+
for (const rep of party.legalRepresentatives) {
|
|
14478
|
+
const repEntityId = rep.id ?? partyId;
|
|
14479
|
+
if (rep.identityDocuments?.length) {
|
|
14480
|
+
for (const doc of rep.identityDocuments) {
|
|
14481
|
+
if (doc.frontImageUri) {
|
|
14482
|
+
await docService.acknowledgeDocument({
|
|
14483
|
+
storageUrl: doc.frontImageUri,
|
|
14484
|
+
entityId: repEntityId
|
|
14485
|
+
});
|
|
14486
|
+
}
|
|
14487
|
+
if (doc.backImageUri) {
|
|
14488
|
+
await docService.acknowledgeDocument({
|
|
14489
|
+
storageUrl: doc.backImageUri,
|
|
14490
|
+
entityId: repEntityId
|
|
14491
|
+
});
|
|
14492
|
+
}
|
|
14493
|
+
}
|
|
14494
|
+
}
|
|
14495
|
+
}
|
|
14496
|
+
}
|
|
14462
14497
|
return context.json(
|
|
14463
14498
|
{
|
|
14464
14499
|
message: "Party updated successfully",
|