@kumori/aurora-backend-handler 1.0.78 → 1.0.80
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/api/account-api-service.ts +237 -6
- package/helpers/revision-helper.ts +1 -45
- package/package.json +1 -1
- package/websocket-manager.ts +47 -34
|
@@ -319,7 +319,7 @@ export const createAccount = async (account: Account, security: Security) => {
|
|
|
319
319
|
},
|
|
320
320
|
},
|
|
321
321
|
};
|
|
322
|
-
} else if (providerName === "oasix"
|
|
322
|
+
} else if (providerName === "oasix") {
|
|
323
323
|
accountBody = {
|
|
324
324
|
tenant: account.tenant,
|
|
325
325
|
account: account.name,
|
|
@@ -335,7 +335,8 @@ export const createAccount = async (account: Account, security: Security) => {
|
|
|
335
335
|
domain: account.cloudProvider?.domain || "",
|
|
336
336
|
project_name: account.cloudProvider?.project_name || "",
|
|
337
337
|
}
|
|
338
|
-
:
|
|
338
|
+
:
|
|
339
|
+
{
|
|
339
340
|
method: providerName,
|
|
340
341
|
// ovh: {
|
|
341
342
|
// endpoint: "string",
|
|
@@ -431,7 +432,123 @@ export const createAccount = async (account: Account, security: Security) => {
|
|
|
431
432
|
},
|
|
432
433
|
},
|
|
433
434
|
};
|
|
434
|
-
}
|
|
435
|
+
}
|
|
436
|
+
else if (providerName === "cloudos") {
|
|
437
|
+
accountBody = {
|
|
438
|
+
tenant: account.tenant,
|
|
439
|
+
account: account.name,
|
|
440
|
+
provision_infrastructure: false,
|
|
441
|
+
spec: {
|
|
442
|
+
spec: {
|
|
443
|
+
api: providerName,
|
|
444
|
+
credentials:
|
|
445
|
+
// account.cloudProvider.password
|
|
446
|
+
// ? {
|
|
447
|
+
// username: account.cloudProvider.username || "",
|
|
448
|
+
// password: account.cloudProvider.password || "",
|
|
449
|
+
// region: account.cloudProvider?.region || "",
|
|
450
|
+
// domain: account.cloudProvider?.domain || "",
|
|
451
|
+
// project_name: account.cloudProvider?.project_name || "",
|
|
452
|
+
// }
|
|
453
|
+
// :
|
|
454
|
+
{
|
|
455
|
+
method: providerName,
|
|
456
|
+
// ovh: {
|
|
457
|
+
// endpoint: "string",
|
|
458
|
+
// application_key: "string",
|
|
459
|
+
// application_secret: "string",
|
|
460
|
+
// consumer_key: "string",
|
|
461
|
+
// },
|
|
462
|
+
openstack: {
|
|
463
|
+
region_name: account.cloudProvider?.region || "",
|
|
464
|
+
interface: account.cloudProvider?.interface || "",
|
|
465
|
+
identity_api_version: Number(
|
|
466
|
+
account.cloudProvider?.apiVersion || 3,
|
|
467
|
+
),
|
|
468
|
+
auth_type: account.cloudProvider?.authType || "",
|
|
469
|
+
auth: {
|
|
470
|
+
auth_url: account.cloudProvider?.authUrl || "",
|
|
471
|
+
application_credential_id:
|
|
472
|
+
account.cloudProvider?.credentialId || "",
|
|
473
|
+
application_credential_secret:
|
|
474
|
+
account.cloudProvider?.credentialSecret || "",
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
highlyAvailable: true,
|
|
479
|
+
marks: {
|
|
480
|
+
vcpu: {
|
|
481
|
+
lowmark: account.usage.limit.cpu.min * 1000,
|
|
482
|
+
highmark: account.usage.limit.cpu.max * 1000,
|
|
483
|
+
unit: "m",
|
|
484
|
+
},
|
|
485
|
+
memory: {
|
|
486
|
+
lowmark: account.usage.limit.memory.min * 1000,
|
|
487
|
+
highmark: account.usage.limit.memory.max * 1000,
|
|
488
|
+
unit: "MB",
|
|
489
|
+
},
|
|
490
|
+
vstorage: {
|
|
491
|
+
lowmark: account.usage.limit.volatileStorage.min * 1000,
|
|
492
|
+
highmark: account.usage.limit.volatileStorage.max * 1000,
|
|
493
|
+
unit: "MB",
|
|
494
|
+
},
|
|
495
|
+
nrstorage: {
|
|
496
|
+
lowmark: account.usage.limit.nonReplicatedStorage.min * 1000,
|
|
497
|
+
highmark: account.usage.limit.nonReplicatedStorage.max * 1000,
|
|
498
|
+
unit: "MB",
|
|
499
|
+
},
|
|
500
|
+
rstorage: {
|
|
501
|
+
lowmark: account.usage.limit.persistentStorage.min * 1000,
|
|
502
|
+
highmark: account.usage.limit.persistentStorage.max * 1000,
|
|
503
|
+
unit: "MB",
|
|
504
|
+
},
|
|
505
|
+
storage: {
|
|
506
|
+
lowmark: account.usage.limit.storage.min * 1000,
|
|
507
|
+
highmark: account.usage.limit.storage.max * 1000,
|
|
508
|
+
unit: "MB",
|
|
509
|
+
},
|
|
510
|
+
cost: {
|
|
511
|
+
lowmark: account.usage.cost,
|
|
512
|
+
highmark: account.usage.cost,
|
|
513
|
+
unit: "EUR",
|
|
514
|
+
},
|
|
515
|
+
nodes: {
|
|
516
|
+
lowmark: account.nodes?.max || 0,
|
|
517
|
+
highmark: account.nodes?.max || 0,
|
|
518
|
+
unit: "",
|
|
519
|
+
},
|
|
520
|
+
},
|
|
521
|
+
iaasconfig: {
|
|
522
|
+
...(account.flavors?.volatile?.[0] && {
|
|
523
|
+
volatile: account.flavors.volatile[0],
|
|
524
|
+
}),
|
|
525
|
+
...(account.flavors?.persistent?.[0] && {
|
|
526
|
+
persistent: account.flavors.persistent[0],
|
|
527
|
+
}),
|
|
528
|
+
...(account.flavors?.nonReplicated?.[0] && {
|
|
529
|
+
nonreplicated: account.flavors.nonReplicated[0],
|
|
530
|
+
}),
|
|
531
|
+
// shared: "classic",
|
|
532
|
+
...(account.flavors?.small?.[0] && {
|
|
533
|
+
smallVMFlavor: account.flavors?.small?.[0],
|
|
534
|
+
}),
|
|
535
|
+
...(account.flavors?.medium?.[0] && {
|
|
536
|
+
mediumVMFlavor: account.flavors.medium[0],
|
|
537
|
+
}),
|
|
538
|
+
// ...(account.flavors?.large?.[0] && { largeVMFlavor: account.flavors.large[0] }),
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
meta: {
|
|
542
|
+
labels: {
|
|
543
|
+
additionalProp1: "string",
|
|
544
|
+
additionalProp2: "string",
|
|
545
|
+
additionalProp3: "string",
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
else if (providerName === "opennebula") {
|
|
435
552
|
accountBody = {
|
|
436
553
|
tenant: account.tenant,
|
|
437
554
|
account: account.name,
|
|
@@ -615,7 +732,7 @@ export const deleteAccount = async (account: Account, security: Security) => {
|
|
|
615
732
|
},
|
|
616
733
|
},
|
|
617
734
|
};
|
|
618
|
-
} else if (providerName === "oasix"
|
|
735
|
+
} else if (providerName === "oasix") {
|
|
619
736
|
payload = {
|
|
620
737
|
tenant: account.tenant,
|
|
621
738
|
account: account.name,
|
|
@@ -1088,7 +1205,7 @@ export const updateAccount = async (account: Account, security: Security) => {
|
|
|
1088
1205
|
},
|
|
1089
1206
|
},
|
|
1090
1207
|
};
|
|
1091
|
-
} else if (providerName === "oasix"
|
|
1208
|
+
} else if (providerName === "oasix") {
|
|
1092
1209
|
accountBody = {
|
|
1093
1210
|
tenant: account.tenant,
|
|
1094
1211
|
account: account.name,
|
|
@@ -1198,7 +1315,121 @@ export const updateAccount = async (account: Account, security: Security) => {
|
|
|
1198
1315
|
},
|
|
1199
1316
|
},
|
|
1200
1317
|
};
|
|
1201
|
-
}
|
|
1318
|
+
}
|
|
1319
|
+
else if (providerName === "cloudos") {
|
|
1320
|
+
accountBody = {
|
|
1321
|
+
tenant: account.tenant,
|
|
1322
|
+
account: account.name,
|
|
1323
|
+
provision_infrastructure: false,
|
|
1324
|
+
spec: {
|
|
1325
|
+
api: providerName,
|
|
1326
|
+
credentials:
|
|
1327
|
+
// account.cloudProvider.password
|
|
1328
|
+
// ? {
|
|
1329
|
+
// username: account.cloudProvider.username || "",
|
|
1330
|
+
// password: account.cloudProvider.password || "",
|
|
1331
|
+
// region: account.cloudProvider?.region || "",
|
|
1332
|
+
// domain: account.cloudProvider?.domain || "",
|
|
1333
|
+
// project_name: account.cloudProvider?.project_name || "",
|
|
1334
|
+
// }
|
|
1335
|
+
// :
|
|
1336
|
+
{
|
|
1337
|
+
method: providerName,
|
|
1338
|
+
// ovh: {
|
|
1339
|
+
// endpoint: "string",
|
|
1340
|
+
// application_key: "string",
|
|
1341
|
+
// application_secret: "string",
|
|
1342
|
+
// consumer_key: "string",
|
|
1343
|
+
// },
|
|
1344
|
+
openstack: {
|
|
1345
|
+
region_name: account.cloudProvider?.region || "",
|
|
1346
|
+
interface: account.cloudProvider?.interface || "",
|
|
1347
|
+
identity_api_version: Number(
|
|
1348
|
+
account.cloudProvider?.apiVersion || 3,
|
|
1349
|
+
),
|
|
1350
|
+
auth_type: account.cloudProvider?.authType || "",
|
|
1351
|
+
auth: {
|
|
1352
|
+
auth_url: account.cloudProvider?.authUrl || "",
|
|
1353
|
+
application_credential_id:
|
|
1354
|
+
account.cloudProvider?.credentialId || "",
|
|
1355
|
+
application_credential_secret:
|
|
1356
|
+
account.cloudProvider?.credentialSecret || "",
|
|
1357
|
+
},
|
|
1358
|
+
},
|
|
1359
|
+
},
|
|
1360
|
+
highlyAvailable: true,
|
|
1361
|
+
marks: {
|
|
1362
|
+
vcpu: {
|
|
1363
|
+
lowmark: account.usage.limit.cpu.min * 1000,
|
|
1364
|
+
highmark: account.usage.limit.cpu.max * 1000,
|
|
1365
|
+
unit: "m",
|
|
1366
|
+
},
|
|
1367
|
+
memory: {
|
|
1368
|
+
lowmark: account.usage.limit.memory.min * 1000,
|
|
1369
|
+
highmark: account.usage.limit.memory.max * 1000,
|
|
1370
|
+
unit: "MB",
|
|
1371
|
+
},
|
|
1372
|
+
vstorage: {
|
|
1373
|
+
lowmark: account.usage.limit.volatileStorage.min * 1000,
|
|
1374
|
+
highmark: account.usage.limit.volatileStorage.max * 1000,
|
|
1375
|
+
unit: "MB",
|
|
1376
|
+
},
|
|
1377
|
+
nrstorage: {
|
|
1378
|
+
lowmark: account.usage.limit.nonReplicatedStorage.min * 1000,
|
|
1379
|
+
highmark: account.usage.limit.nonReplicatedStorage.max * 1000,
|
|
1380
|
+
unit: "MB",
|
|
1381
|
+
},
|
|
1382
|
+
rstorage: {
|
|
1383
|
+
lowmark: account.usage.limit.persistentStorage.min * 1000,
|
|
1384
|
+
highmark: account.usage.limit.persistentStorage.max * 1000,
|
|
1385
|
+
unit: "MB",
|
|
1386
|
+
},
|
|
1387
|
+
storage: {
|
|
1388
|
+
lowmark: account.usage.limit.storage.min * 1000,
|
|
1389
|
+
highmark: account.usage.limit.storage.max * 1000,
|
|
1390
|
+
unit: "MB",
|
|
1391
|
+
},
|
|
1392
|
+
cost: {
|
|
1393
|
+
lowmark: account.usage.cost,
|
|
1394
|
+
highmark: account.usage.cost,
|
|
1395
|
+
unit: "EUR",
|
|
1396
|
+
},
|
|
1397
|
+
nodes: {
|
|
1398
|
+
lowmark: account.nodes?.min || 0,
|
|
1399
|
+
highmark: account.nodes?.max || 0,
|
|
1400
|
+
unit: "",
|
|
1401
|
+
},
|
|
1402
|
+
},
|
|
1403
|
+
iaasconfig: {
|
|
1404
|
+
...(account.flavors?.volatile?.[0] && {
|
|
1405
|
+
volatile: account.flavors.volatile[0],
|
|
1406
|
+
}),
|
|
1407
|
+
...(account.flavors?.persistent?.[0] && {
|
|
1408
|
+
persistent: account.flavors.persistent[0],
|
|
1409
|
+
}),
|
|
1410
|
+
...(account.flavors?.nonReplicated?.[0] && {
|
|
1411
|
+
nonreplicated: account.flavors.nonReplicated[0],
|
|
1412
|
+
}),
|
|
1413
|
+
// shared: "classic",
|
|
1414
|
+
...(account.flavors?.small?.[0] && {
|
|
1415
|
+
smallVMFlavor: account.flavors?.small?.[0],
|
|
1416
|
+
}),
|
|
1417
|
+
...(account.flavors?.medium?.[0] && {
|
|
1418
|
+
mediumVMFlavor: account.flavors.medium[0],
|
|
1419
|
+
}),
|
|
1420
|
+
// ...(account.flavors?.large?.[0] && { largeVMFlavor: account.flavors.large[0] }),
|
|
1421
|
+
},
|
|
1422
|
+
},
|
|
1423
|
+
meta: {
|
|
1424
|
+
labels: {
|
|
1425
|
+
additionalProp1: "string",
|
|
1426
|
+
additionalProp2: "string",
|
|
1427
|
+
additionalProp3: "string",
|
|
1428
|
+
},
|
|
1429
|
+
},
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
else if (providerName === "opennebula") {
|
|
1202
1433
|
accountBody = {
|
|
1203
1434
|
tenant: account.tenant,
|
|
1204
1435
|
account: account.name,
|
|
@@ -242,56 +242,12 @@ const updateServiceWithRevision = (
|
|
|
242
242
|
const updatedService: Service = {
|
|
243
243
|
...existingService,
|
|
244
244
|
revisions: updatedRevisions,
|
|
245
|
-
currentRevision:
|
|
246
|
-
Number(entityId) >= Number(existingService.currentRevision ?? 0)
|
|
247
|
-
? entityId
|
|
248
|
-
: existingService.currentRevision,
|
|
249
245
|
role: roles.length > 0 ? roles : existingService.role,
|
|
250
246
|
usage: newRevision.usage,
|
|
251
247
|
startedAt: newRevision.createdAt || existingService.startedAt,
|
|
252
248
|
};
|
|
253
249
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const incomingStatus = eventData.status.state;
|
|
257
|
-
const incomingTs = getTimestamp(incomingStatus.timestamp);
|
|
258
|
-
const currentTs = getTimestamp(existingService.status?.timestamp);
|
|
259
|
-
const incomingRevisionId = Number(entityId);
|
|
260
|
-
const currentRevisionId = Number(existingService.currentRevision ?? 0);
|
|
261
|
-
|
|
262
|
-
if (incomingTs > currentTs) {
|
|
263
|
-
updatedService.status = incomingStatus;
|
|
264
|
-
if (eventData.status.error) {
|
|
265
|
-
if (incomingRevisionId >= currentRevisionId) {
|
|
266
|
-
updatedService.error = {
|
|
267
|
-
code: eventData.status.error.code,
|
|
268
|
-
message: eventData.status.error.message,
|
|
269
|
-
timestamp:
|
|
270
|
-
eventData.status.error.timestamp || incomingStatus.timestamp,
|
|
271
|
-
};
|
|
272
|
-
deploymentErrorEvent = updatedService;
|
|
273
|
-
}
|
|
274
|
-
} else {
|
|
275
|
-
updatedService.error = undefined;
|
|
276
|
-
}
|
|
277
|
-
} else if (eventData.status.error) {
|
|
278
|
-
if (incomingRevisionId >= currentRevisionId) {
|
|
279
|
-
const incomingErrorTs = getTimestamp(eventData.status.error.timestamp);
|
|
280
|
-
const currentErrorTs = getTimestamp(existingService.error?.timestamp);
|
|
281
|
-
if (incomingErrorTs > currentErrorTs) {
|
|
282
|
-
updatedService.error = {
|
|
283
|
-
code: eventData.status.error.code,
|
|
284
|
-
message: eventData.status.error.message,
|
|
285
|
-
timestamp: eventData.status.error.timestamp,
|
|
286
|
-
};
|
|
287
|
-
deploymentErrorEvent = updatedService;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
if (incomingRevisionId >= currentRevisionId && !eventData.status.error) {
|
|
293
|
-
updatedService.error = undefined;
|
|
294
|
-
}
|
|
250
|
+
const deploymentErrorEvent = eventData.status?.error ? updatedService : null;
|
|
295
251
|
|
|
296
252
|
return { updatedService, deploymentErrorEvent };
|
|
297
253
|
};
|
package/package.json
CHANGED
package/websocket-manager.ts
CHANGED
|
@@ -684,22 +684,17 @@ const handleEvent = async (message: WSMessage) => {
|
|
|
684
684
|
roleMap.set(revisionResult.serviceId, revisionResult.roles);
|
|
685
685
|
}
|
|
686
686
|
if (revisionResult.updatedService) {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
revisionResult.updatedService,
|
|
690
|
-
);
|
|
687
|
+
const resolved = resolveServiceStatus(revisionResult.updatedService);
|
|
688
|
+
servicesMap.set(revisionResult.serviceId, resolved);
|
|
691
689
|
}
|
|
692
690
|
if (revisionResult.updatedEnvironment) {
|
|
693
691
|
const envId = revisionResult.updatedService?.environment;
|
|
694
|
-
if (envId)
|
|
692
|
+
if (envId)
|
|
695
693
|
environmentsMap.set(envId, revisionResult.updatedEnvironment);
|
|
696
|
-
}
|
|
697
694
|
}
|
|
698
695
|
if (revisionResult.updatedAccount) {
|
|
699
696
|
const accId = revisionResult.updatedService?.account;
|
|
700
|
-
if (accId)
|
|
701
|
-
accountsMap.set(accId, revisionResult.updatedAccount);
|
|
702
|
-
}
|
|
697
|
+
if (accId) accountsMap.set(accId, revisionResult.updatedAccount);
|
|
703
698
|
}
|
|
704
699
|
if (revisionResult.pendingRevisionError) {
|
|
705
700
|
pendingRevisionErrors.push(revisionResult.pendingRevisionError);
|
|
@@ -716,14 +711,12 @@ const handleEvent = async (message: WSMessage) => {
|
|
|
716
711
|
getChannelsInfo(
|
|
717
712
|
revisionResult.channelsFetchInfo.serviceId,
|
|
718
713
|
revisionResult.channelsFetchInfo.tenantId,
|
|
719
|
-
)
|
|
720
|
-
.
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
});
|
|
726
|
-
});
|
|
714
|
+
).catch((error) => {
|
|
715
|
+
console.error(
|
|
716
|
+
"[ws] Error fetching channels info for revision",
|
|
717
|
+
error,
|
|
718
|
+
);
|
|
719
|
+
});
|
|
727
720
|
}
|
|
728
721
|
break;
|
|
729
722
|
case "service":
|
|
@@ -742,25 +735,15 @@ const handleEvent = async (message: WSMessage) => {
|
|
|
742
735
|
pendingRevisionErrors.push(
|
|
743
736
|
...serviceResult.updatedPendingRevisionErrors,
|
|
744
737
|
);
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
if (savedService.error && savedService.currentRevision) {
|
|
749
|
-
const currentRevId = Number(savedService.currentRevision);
|
|
750
|
-
const errorTs = Number(savedService.error.timestamp ?? 0);
|
|
751
|
-
if (currentRevId > errorTs) {
|
|
752
|
-
savedService.error = undefined;
|
|
753
|
-
servicesMap.set(serviceResult.serviceFullKey, savedService);
|
|
754
|
-
}
|
|
755
|
-
}
|
|
738
|
+
|
|
739
|
+
const resolvedService = resolveServiceStatus(serviceResult.service);
|
|
740
|
+
servicesMap.set(serviceResult.serviceFullKey, resolvedService);
|
|
756
741
|
|
|
757
742
|
const projectLabel = eventData.meta?.labels?.project;
|
|
758
743
|
if (projectLabel) {
|
|
759
744
|
const tenant = tenantsMap.get(parentParts.tenant);
|
|
760
745
|
if (tenant) {
|
|
761
|
-
if (!tenant.projects)
|
|
762
|
-
tenant.projects = [];
|
|
763
|
-
}
|
|
746
|
+
if (!tenant.projects) tenant.projects = [];
|
|
764
747
|
if (!tenant.projects.includes(projectLabel)) {
|
|
765
748
|
tenant.projects.push(projectLabel);
|
|
766
749
|
tenantsMap.set(parentParts.tenant, tenant);
|
|
@@ -770,7 +753,7 @@ const handleEvent = async (message: WSMessage) => {
|
|
|
770
753
|
}
|
|
771
754
|
}
|
|
772
755
|
if (serviceResult.wasDeployed) {
|
|
773
|
-
eventHelper.service.publish.deployed(
|
|
756
|
+
eventHelper.service.publish.deployed(resolvedService);
|
|
774
757
|
}
|
|
775
758
|
const serviceState = eventData.status?.state?.code;
|
|
776
759
|
if (serviceState === "SERVICE_READY") {
|
|
@@ -1158,7 +1141,7 @@ export const getReferenceDomain = () => {
|
|
|
1158
1141
|
};
|
|
1159
1142
|
const handleOperationSuccess = (operation: PendingOperation, response: any) => {
|
|
1160
1143
|
const { action, entityType, entityName, originalData } = operation;
|
|
1161
|
-
|
|
1144
|
+
if (action === "UPDATE_CONFIG") {
|
|
1162
1145
|
const tenant = originalData?.payload?.tenant;
|
|
1163
1146
|
const serviceName = originalData?.payload?.service;
|
|
1164
1147
|
if (tenant && serviceName) {
|
|
@@ -1316,7 +1299,7 @@ const handleOperationSuccess = (operation: PendingOperation, response: any) => {
|
|
|
1316
1299
|
eventHelper.service.publish.updated(svcSuccessResult.updatedService);
|
|
1317
1300
|
}
|
|
1318
1301
|
}
|
|
1319
|
-
break
|
|
1302
|
+
break;
|
|
1320
1303
|
case "account":
|
|
1321
1304
|
const accSuccessResult = handleAccountOperationSuccess({
|
|
1322
1305
|
action,
|
|
@@ -1922,3 +1905,33 @@ export const updateUserComplete = (updatedUserData: UserData): User => {
|
|
|
1922
1905
|
return user;
|
|
1923
1906
|
}
|
|
1924
1907
|
};
|
|
1908
|
+
const resolveServiceStatus = (service: Service): Service => {
|
|
1909
|
+
const revisionKey = `${service.tenant}/${service.name}-${service.currentRevision}`;
|
|
1910
|
+
const currentRevision = revisionsMap.get(revisionKey);
|
|
1911
|
+
|
|
1912
|
+
if (service.error) {
|
|
1913
|
+
return service;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
if (!currentRevision) {
|
|
1917
|
+
return service;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
if (currentRevision.errorCode) {
|
|
1921
|
+
return {
|
|
1922
|
+
...service,
|
|
1923
|
+
status: currentRevision.status,
|
|
1924
|
+
error: {
|
|
1925
|
+
code: currentRevision.errorCode,
|
|
1926
|
+
message: currentRevision.errorMsg || "",
|
|
1927
|
+
timestamp: currentRevision.status?.timestamp,
|
|
1928
|
+
},
|
|
1929
|
+
};
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
return {
|
|
1933
|
+
...service,
|
|
1934
|
+
error: undefined,
|
|
1935
|
+
status: currentRevision.status,
|
|
1936
|
+
};
|
|
1937
|
+
};
|