@firestartr/cli 1.51.1-snapshot-0 → 1.51.1-snapshot-01
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/index.js +201 -64
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/tfworkspaces/index.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/tfworkspaces/terraform.schema.d.ts +1 -0
- package/build/packages/operator/src/status.d.ts +2 -0
- package/build/packages/operator/src/syncCtl.d.ts +26 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -346931,6 +346931,7 @@ const DEFAULT_TIME_ZONE = 'Europe/Madrid';
|
|
|
346931
346931
|
function validateCron(cronLine, tz = DEFAULT_TIME_ZONE) {
|
|
346932
346932
|
try {
|
|
346933
346933
|
const interval = cron_parser_dist.CronExpressionParser.parse(cronLine, {
|
|
346934
|
+
// to enable the only minutes cron
|
|
346934
346935
|
strict: false,
|
|
346935
346936
|
tz,
|
|
346936
346937
|
});
|
|
@@ -358187,6 +358188,7 @@ const GithubSchemas = [
|
|
|
358187
358188
|
type: 'string',
|
|
358188
358189
|
},
|
|
358189
358190
|
},
|
|
358191
|
+
additionalProperties: false,
|
|
358190
358192
|
required: ['enabled'],
|
|
358191
358193
|
oneOf: [
|
|
358192
358194
|
{
|
|
@@ -367338,6 +367340,28 @@ async function needsProvisioningOnCreate(cr) {
|
|
|
367338
367340
|
operator_src_logger.debug(`Skipping the provisioning process for custom resource '${cr.kind}/${cr.metadata.name}' because its current state is not handled.`);
|
|
367339
367341
|
return false;
|
|
367340
367342
|
}
|
|
367343
|
+
async function updateSyncTransition(itemPath, reason, lastSyncTime, nextSyncTime, message, status) {
|
|
367344
|
+
operator_src_logger.info(`The item at '${itemPath}' transitioned to a new SYNCHRONIZED condition of '${status}'. The reason for the change is '${reason}' with the message: '${message}'.`);
|
|
367345
|
+
const k8sItem = await getItemByItemPath(itemPath);
|
|
367346
|
+
if (!('status' in k8sItem))
|
|
367347
|
+
k8sItem.status = {};
|
|
367348
|
+
if (!('conditions' in k8sItem.status))
|
|
367349
|
+
k8sItem.status.conditions = [];
|
|
367350
|
+
let conditionObject = getRelevantCondition(k8sItem.status.conditions, 'SYNCHRONIZED');
|
|
367351
|
+
conditionObject = {
|
|
367352
|
+
...conditionObject,
|
|
367353
|
+
reason,
|
|
367354
|
+
status,
|
|
367355
|
+
message,
|
|
367356
|
+
observedGeneration: k8sItem.metadata.generation,
|
|
367357
|
+
lastSyncTime,
|
|
367358
|
+
lastUpdateTime: new Date().toJSON(),
|
|
367359
|
+
nextSyncTime,
|
|
367360
|
+
};
|
|
367361
|
+
k8sItem.status.conditions = updateConditionByType(k8sItem.status.conditions, 'SYNCHRONIZED', conditionObject);
|
|
367362
|
+
const itemParameters = itemPath.split('/');
|
|
367363
|
+
await writeStatus(itemParameters[1], itemParameters[0], k8sItem);
|
|
367364
|
+
}
|
|
367341
367365
|
async function updateTransition(itemPath, reason, type, statusValue, message = '', updateStatusOnly = false) {
|
|
367342
367366
|
operator_src_logger.info(`The item at '${itemPath}' transitioned to a new status of '${statusValue}' (type: '${type}'). The reason for the change is '${reason}' with the message: '${message}'. This was a status-only update: '${updateStatusOnly}'.`);
|
|
367343
367367
|
const k8sItem = await getItemByItemPath(itemPath);
|
|
@@ -367398,12 +367422,115 @@ function updateConditionByType(conditionList, type, newCondition) {
|
|
|
367398
367422
|
return conditionList;
|
|
367399
367423
|
}
|
|
367400
367424
|
|
|
367401
|
-
;// CONCATENATED MODULE: ../operator/src/
|
|
367425
|
+
;// CONCATENATED MODULE: ../operator/src/syncCtl.ts
|
|
367426
|
+
// Machinery for syncing
|
|
367427
|
+
|
|
367428
|
+
|
|
367402
367429
|
|
|
367403
367430
|
|
|
367404
|
-
const syncWatchers = {};
|
|
367405
|
-
const FORCE_REVISION_TIME = 60 * 1000;
|
|
367406
367431
|
const DEFAULT_REVISION_TIME = '1m';
|
|
367432
|
+
async function createWatcherForItem(itemPath, itemCR) {
|
|
367433
|
+
const item = itemCR ?? await getItemByItemPath(itemPath);
|
|
367434
|
+
const syncStatus = await getSyncStatus(itemPath, item);
|
|
367435
|
+
let nextTimeoutInMS = syncStatus.nextTimeoutInMS;
|
|
367436
|
+
// we have lapsed last interval
|
|
367437
|
+
// we calculate from the lastSyncTime
|
|
367438
|
+
if (syncStatus.intervalLapsed) {
|
|
367439
|
+
operator_src_logger.debug(`Next sync interval have been lapsed for ${itemPath}`);
|
|
367440
|
+
if (syncStatus.syncMode === 'Period') {
|
|
367441
|
+
operator_src_logger.debug(`Next sync interval have been lapsed for ${itemPath} the sync will start now`);
|
|
367442
|
+
nextTimeoutInMS = -1;
|
|
367443
|
+
}
|
|
367444
|
+
}
|
|
367445
|
+
const watcher = {
|
|
367446
|
+
itemPath,
|
|
367447
|
+
lastRevision: setTimeout(() => {
|
|
367448
|
+
operator_src_logger.debug(`Item ${itemPath} needs revision`);
|
|
367449
|
+
watcher.needsRevision = true;
|
|
367450
|
+
}, nextTimeoutInMS),
|
|
367451
|
+
needsRevision: false,
|
|
367452
|
+
};
|
|
367453
|
+
return watcher;
|
|
367454
|
+
}
|
|
367455
|
+
async function destroyWatcherForItem(watcher) {
|
|
367456
|
+
clearTimeout(watcher.lastRevision);
|
|
367457
|
+
operator_src_logger.debug(`Disabled SyncWatcher for ${watcher.itemPath}`);
|
|
367458
|
+
}
|
|
367459
|
+
async function getSyncSpecs(itemPath, itemCR) {
|
|
367460
|
+
const item = itemCR ?? await getItemByItemPath(itemPath);
|
|
367461
|
+
return {
|
|
367462
|
+
item,
|
|
367463
|
+
syncable: item.metadata.annotations &&
|
|
367464
|
+
item.metadata.annotations['firestartr.dev/sync-enabled'] &&
|
|
367465
|
+
item.metadata.annotations['firestartr.dev/sync-enabled'] === 'true',
|
|
367466
|
+
period: item.metadata.annotations['firestartr.dev/sync-period'] ||
|
|
367467
|
+
DEFAULT_REVISION_TIME,
|
|
367468
|
+
schedule: item.metadata.annotations['firestartr.dev/sync-schedule'] || false,
|
|
367469
|
+
scheduleTZ: item.metadata.annotations['firestartr.dev/sync-schedule-timezone'] ||
|
|
367470
|
+
'Europe/Madrid',
|
|
367471
|
+
};
|
|
367472
|
+
}
|
|
367473
|
+
async function getSyncStatus(itemPath, itemCR) {
|
|
367474
|
+
const item = itemCR ?? await getItemByItemPath(itemPath);
|
|
367475
|
+
const syncCondition = getConditionByType(item.status?.conditions ?? [], 'SYNCHRONIZED');
|
|
367476
|
+
// no sync condition present
|
|
367477
|
+
if (!syncCondition) {
|
|
367478
|
+
return {
|
|
367479
|
+
syncStatusPresent: false,
|
|
367480
|
+
};
|
|
367481
|
+
}
|
|
367482
|
+
else {
|
|
367483
|
+
const nextSyncDate = new Date(syncCondition.nextSyncTime);
|
|
367484
|
+
const isLapsed = Date.now() >= nextSyncDate.getTime();
|
|
367485
|
+
const mode = (await getSyncSpecs(itemPath, item)).schedule
|
|
367486
|
+
? 'Scheduled'
|
|
367487
|
+
: 'Period';
|
|
367488
|
+
return {
|
|
367489
|
+
itemPath,
|
|
367490
|
+
syncMode: mode,
|
|
367491
|
+
conditions: [syncCondition],
|
|
367492
|
+
syncStatusPresent: true,
|
|
367493
|
+
nextTimeoutInMS: isLapsed ? -1 : nextSyncDate.getTime() - Date.now(),
|
|
367494
|
+
intervalLapsed: isLapsed,
|
|
367495
|
+
};
|
|
367496
|
+
}
|
|
367497
|
+
}
|
|
367498
|
+
async function setSyncStatus(itemPath, reason, status, message) {
|
|
367499
|
+
const item = await getItemByItemPath(itemPath);
|
|
367500
|
+
const machinery = assessSyncCalculationMachinery(item);
|
|
367501
|
+
const syncStatus = await machinery(item, reason, status, message);
|
|
367502
|
+
syncStatus.itemPath = itemPath;
|
|
367503
|
+
syncStatus.syncStatusPresent = true;
|
|
367504
|
+
operator_src_logger.info(`Setting sync status for ${itemPath}: ${JSON.stringify(syncStatus)}`);
|
|
367505
|
+
const syncTransition = syncStatus.conditions[0];
|
|
367506
|
+
await updateSyncTransition(itemPath, syncTransition.reason, syncTransition.lastSyncTime, syncTransition.nextSyncTime, syncTransition.message, syncTransition.status);
|
|
367507
|
+
return syncStatus;
|
|
367508
|
+
}
|
|
367509
|
+
function assessSyncCalculationMachinery(item) {
|
|
367510
|
+
if (item.metadata.annotations['firestartr.dev/sync-schedule'] ?? false) {
|
|
367511
|
+
return processScheduledSync;
|
|
367512
|
+
}
|
|
367513
|
+
else {
|
|
367514
|
+
return processPeriodSync;
|
|
367515
|
+
}
|
|
367516
|
+
}
|
|
367517
|
+
async function processPeriodSync(item, reason, status, message) {
|
|
367518
|
+
const period = item.metadata.annotations['firestartr.dev/sync-period'];
|
|
367519
|
+
const periodMS = helperCalculateRevisionTime(period);
|
|
367520
|
+
return {
|
|
367521
|
+
syncMode: 'Period',
|
|
367522
|
+
conditions: [
|
|
367523
|
+
{
|
|
367524
|
+
reason,
|
|
367525
|
+
type: 'SYNCHRONIZED',
|
|
367526
|
+
message,
|
|
367527
|
+
status,
|
|
367528
|
+
lastSyncTime: new Date().toISOString(),
|
|
367529
|
+
nextSyncTime: new Date(Date.now() + periodMS).toISOString(),
|
|
367530
|
+
},
|
|
367531
|
+
],
|
|
367532
|
+
};
|
|
367533
|
+
}
|
|
367407
367534
|
function helperCalculateRevisionTime(period) {
|
|
367408
367535
|
const [_, scalar, dimension] = period.split(/(\d+)/);
|
|
367409
367536
|
const multiplier = dimension === 's'
|
|
@@ -367417,24 +367544,50 @@ function helperCalculateRevisionTime(period) {
|
|
|
367417
367544
|
: 1;
|
|
367418
367545
|
return Number(scalar) * multiplier * 1000;
|
|
367419
367546
|
}
|
|
367547
|
+
async function processScheduledSync(item, reason, status, message) {
|
|
367548
|
+
const nextPeriod = catalog_common.cron.getCronNextInterval(item.metadata.annotations['firestartr.dev/sync-schedule'], item.metadata.annotations['firestartr.dev/sync-schedule-timezone'] ||
|
|
367549
|
+
undefined);
|
|
367550
|
+
const nextPeriodDate = new Date(nextPeriod);
|
|
367551
|
+
return {
|
|
367552
|
+
syncMode: 'Scheduled',
|
|
367553
|
+
conditions: [
|
|
367554
|
+
{
|
|
367555
|
+
reason,
|
|
367556
|
+
type: 'SYNCHRONIZED',
|
|
367557
|
+
message,
|
|
367558
|
+
status,
|
|
367559
|
+
lastSyncTime: new Date().toISOString(),
|
|
367560
|
+
nextSyncTime: nextPeriodDate.toISOString(),
|
|
367561
|
+
},
|
|
367562
|
+
],
|
|
367563
|
+
};
|
|
367564
|
+
}
|
|
367565
|
+
|
|
367566
|
+
;// CONCATENATED MODULE: ../operator/src/syncer.ts
|
|
367567
|
+
|
|
367568
|
+
|
|
367569
|
+
|
|
367570
|
+
const syncWatchers = {};
|
|
367571
|
+
const FORCE_REVISION_TIME = (/* unused pure expression or super */ null && (60 * 1000));
|
|
367420
367572
|
async function syncer(enqueue) {
|
|
367421
367573
|
// fork
|
|
367422
367574
|
void loop(enqueue);
|
|
367423
367575
|
return {
|
|
367424
367576
|
addItem(itemPath) {
|
|
367425
367577
|
operator_src_logger.info(`Added item of path '${itemPath}' for synchronization`);
|
|
367426
|
-
|
|
367578
|
+
getSyncSpecs(itemPath)
|
|
367579
|
+
.then(async (itemSyncInfo) => {
|
|
367427
367580
|
if (!itemSyncInfo.syncable) {
|
|
367428
367581
|
return;
|
|
367429
367582
|
}
|
|
367430
|
-
|
|
367431
|
-
|
|
367432
|
-
lastRevision: setInterval(() => {
|
|
367433
|
-
syncWatchers[itemPath].needsRevision = true;
|
|
367434
|
-
}, helperCalculateRevisionTime(itemSyncInfo.period)),
|
|
367435
|
-
needsRevision: false,
|
|
367436
|
-
};
|
|
367583
|
+
const syncCtl = await getSyncStatus(itemPath, itemSyncInfo.item);
|
|
367584
|
+
syncWatchers[itemPath] = await createWatcherForItem(itemPath, itemSyncInfo.item);
|
|
367437
367585
|
operator_src_logger.info(`Configured synchronization for item at path '${itemPath}'`);
|
|
367586
|
+
operator_src_logger.debug(`Sync information for '${itemPath}': ${JSON.stringify({ ...itemSyncInfo, item: null }, null)}`);
|
|
367587
|
+
})
|
|
367588
|
+
.catch((err) => {
|
|
367589
|
+
operator_src_logger.error(`Error on sync [add item]: ${err}`);
|
|
367590
|
+
throw `Error on sync [add item]: ${err}`;
|
|
367438
367591
|
});
|
|
367439
367592
|
},
|
|
367440
367593
|
updateItem(itemPath) {
|
|
@@ -367443,27 +367596,24 @@ async function syncer(enqueue) {
|
|
|
367443
367596
|
// return
|
|
367444
367597
|
//}
|
|
367445
367598
|
operator_src_logger.debug(`Updated item of path '${itemPath}' during synchronization`);
|
|
367446
|
-
|
|
367447
|
-
|
|
367448
|
-
|
|
367449
|
-
|
|
367450
|
-
|
|
367451
|
-
operator_src_logger.info(`Removed item of path '${itemPath}' from synchronization`);
|
|
367452
|
-
}
|
|
367599
|
+
getSyncSpecs(itemPath)
|
|
367600
|
+
.then(async (itemSyncInfo) => {
|
|
367601
|
+
if (syncWatchers[itemPath]) {
|
|
367602
|
+
await destroyWatcherForItem(syncWatchers[itemPath]);
|
|
367603
|
+
delete syncWatchers[itemPath];
|
|
367453
367604
|
}
|
|
367454
|
-
|
|
367455
|
-
|
|
367456
|
-
|
|
367457
|
-
|
|
367458
|
-
syncWatchers[itemPath] = {
|
|
367459
|
-
itemPath,
|
|
367460
|
-
lastRevision: setInterval(() => {
|
|
367461
|
-
syncWatchers[itemPath].needsRevision = true;
|
|
367462
|
-
}, helperCalculateRevisionTime(itemSyncInfo.period)),
|
|
367463
|
-
needsRevision: false,
|
|
367464
|
-
};
|
|
367465
|
-
operator_src_logger.debug(`Configured synchronization for item at path '${itemPath}' with watcher '${syncWatchers[itemPath]}'`);
|
|
367605
|
+
// we need to chedk if the item is not syncable anymore
|
|
367606
|
+
if (!itemSyncInfo.syncable) {
|
|
367607
|
+
operator_src_logger.info(`Removed item of path '${itemPath}' from synchronization`);
|
|
367608
|
+
return;
|
|
367466
367609
|
}
|
|
367610
|
+
// if it is syncable we need to recalculate everything
|
|
367611
|
+
syncWatchers[itemPath] = await createWatcherForItem(itemPath);
|
|
367612
|
+
operator_src_logger.info(`Configured synchronization for item at path '${itemPath}' with watcher`);
|
|
367613
|
+
})
|
|
367614
|
+
.catch((err) => {
|
|
367615
|
+
operator_src_logger.error(`Error on sync [updateItem]: ${err}`);
|
|
367616
|
+
throw `Error on sync [updateItem]: ${err}`;
|
|
367467
367617
|
});
|
|
367468
367618
|
},
|
|
367469
367619
|
deleteItem(itemPath) {
|
|
@@ -367471,10 +367621,15 @@ async function syncer(enqueue) {
|
|
|
367471
367621
|
operator_src_logger.debug(`Ignored deletion attempt for item at path '${itemPath}' as it was not found during synchronization`);
|
|
367472
367622
|
return;
|
|
367473
367623
|
}
|
|
367474
|
-
|
|
367475
|
-
|
|
367476
|
-
|
|
367477
|
-
|
|
367624
|
+
destroyWatcherForItem(syncWatchers[itemPath])
|
|
367625
|
+
.then(() => {
|
|
367626
|
+
operator_src_logger.debug(`Deleted item of path '${itemPath}' during synchronization`);
|
|
367627
|
+
delete syncWatchers[itemPath];
|
|
367628
|
+
})
|
|
367629
|
+
.catch((err) => {
|
|
367630
|
+
operator_src_logger.error(`Error deleting item of path ${itemPath} for synchronization: ${err}`);
|
|
367631
|
+
throw `Error deleting item of path ${itemPath} for synchronization: ${err}`;
|
|
367632
|
+
});
|
|
367478
367633
|
},
|
|
367479
367634
|
};
|
|
367480
367635
|
}
|
|
@@ -367484,23 +367639,14 @@ async function loop(enqueueIfNeeded) {
|
|
|
367484
367639
|
const needRevisionItems = Object.values(syncWatchers).filter((watcher) => watcher.needsRevision);
|
|
367485
367640
|
for (const watcher of needRevisionItems) {
|
|
367486
367641
|
const item = await getItemIfNeededSync(watcher);
|
|
367642
|
+
operator_src_logger.debug(`Item needs revision ${watcher.itemPath}`);
|
|
367487
367643
|
if (item !== null) {
|
|
367488
367644
|
enqueueIfNeeded(item);
|
|
367489
|
-
watcher.needsRevision = false;
|
|
367490
367645
|
}
|
|
367646
|
+
watcher.needsRevision = false;
|
|
367491
367647
|
}
|
|
367492
367648
|
}
|
|
367493
367649
|
}
|
|
367494
|
-
async function itemIsSyncable(itemPath) {
|
|
367495
|
-
const item = await getItemByItemPath(itemPath);
|
|
367496
|
-
return {
|
|
367497
|
-
syncable: item.metadata.annotations &&
|
|
367498
|
-
item.metadata.annotations['firestartr.dev/sync-enabled'] &&
|
|
367499
|
-
item.metadata.annotations['firestartr.dev/sync-enabled'] === 'true',
|
|
367500
|
-
period: item.metadata.annotations['firestartr.dev/sync-period'] ||
|
|
367501
|
-
DEFAULT_REVISION_TIME,
|
|
367502
|
-
};
|
|
367503
|
-
}
|
|
367504
367650
|
async function getItemIfNeededSync(watcher) {
|
|
367505
367651
|
const item = await getItemByItemPath(watcher.itemPath);
|
|
367506
367652
|
const isProvisioning = item.status?.conditions?.find((condition) => condition.type === 'PROVISIONING' && condition.status === 'True');
|
|
@@ -367509,13 +367655,7 @@ async function getItemIfNeededSync(watcher) {
|
|
|
367509
367655
|
const isDeleting = item.status?.conditions?.find((condition) => condition.type === 'DELETING' && condition.status === 'True');
|
|
367510
367656
|
if (isDeleting)
|
|
367511
367657
|
return null;
|
|
367512
|
-
|
|
367513
|
-
if (!synchronizedCondition)
|
|
367514
|
-
return item;
|
|
367515
|
-
const lastSync = new Date(synchronizedCondition.lastUpdateTime).getTime();
|
|
367516
|
-
if (lastSync <= Date.now() - FORCE_REVISION_TIME)
|
|
367517
|
-
return item;
|
|
367518
|
-
return null;
|
|
367658
|
+
return item;
|
|
367519
367659
|
}
|
|
367520
367660
|
function fWait(segs = 1) {
|
|
367521
367661
|
return new Promise((ok) => {
|
|
@@ -367771,6 +367911,7 @@ var WorkStatus;
|
|
|
367771
367911
|
|
|
367772
367912
|
|
|
367773
367913
|
|
|
367914
|
+
|
|
367774
367915
|
const kindsWithFinalizer = [
|
|
367775
367916
|
'FirestartrTerraformWorkspace',
|
|
367776
367917
|
'FirestartrGithubGroup',
|
|
@@ -367890,14 +368031,17 @@ function enqueue(pluralKind, workItem, queue, compute, syncCtl, retryCtl) {
|
|
|
367890
368031
|
success: () => retryCtl.successReconciling(informer_itemPath(pluralKind, workItem.item)),
|
|
367891
368032
|
};
|
|
367892
368033
|
workItem.process = async function* (item, operation, handler) {
|
|
367893
|
-
|
|
367894
|
-
yield transition;
|
|
367895
|
-
}
|
|
367896
|
-
if (operation === OperationType.RENAMED ||
|
|
368034
|
+
const needsUpdateSyncContidions = operation === OperationType.RENAMED ||
|
|
367897
368035
|
operation === OperationType.UPDATED ||
|
|
367898
368036
|
operation === OperationType.SYNC ||
|
|
367899
368037
|
operation === OperationType.CREATED ||
|
|
367900
|
-
operation === OperationType.RETRY
|
|
368038
|
+
operation === OperationType.RETRY;
|
|
368039
|
+
await setSyncStatus(workItem.handler.itemPath(), operation, 'False', 'Sync process started');
|
|
368040
|
+
for await (const transition of compute(item, operation, handler)) {
|
|
368041
|
+
yield transition;
|
|
368042
|
+
}
|
|
368043
|
+
if (needsUpdateSyncContidions) {
|
|
368044
|
+
await setSyncStatus(workItem.handler.itemPath(), operation, operation === OperationType.SYNC ? 'True' : 'False', 'Sync process finished');
|
|
367901
368045
|
syncCtl.updateItem(informer_itemPath(pluralKind, item));
|
|
367902
368046
|
}
|
|
367903
368047
|
else {
|
|
@@ -372023,13 +372167,6 @@ function isDestroyRetry(item) {
|
|
|
372023
372167
|
return false;
|
|
372024
372168
|
}
|
|
372025
372169
|
async function* process_operation_sync(item, op, handler, syncPolicy, generalPolicy) {
|
|
372026
|
-
yield {
|
|
372027
|
-
item,
|
|
372028
|
-
reason: op,
|
|
372029
|
-
type: 'SYNCHRONIZED',
|
|
372030
|
-
status: 'False',
|
|
372031
|
-
message: 'Sync process started',
|
|
372032
|
-
};
|
|
372033
372170
|
if (!syncPolicy) {
|
|
372034
372171
|
operator_src_logger.debug(`The Terraform processor is only observing item '${item.kind}/${item.metadata.name}' because no sync policy was found for operation '${op}'.`);
|
|
372035
372172
|
yield* doPlanJSONFormat(item, op, handler);
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare function needsProvisioningOnCreate(cr: any): Promise<boolean>;
|
|
2
|
+
export declare function updateSyncTransition(itemPath: string, reason: string, lastSyncTime: string, nextSyncTime: string, message: string, status: string): Promise<void>;
|
|
2
3
|
export declare function updateTransition(itemPath: string, reason: string, type: string, statusValue: string, message?: string, updateStatusOnly?: boolean): Promise<void>;
|
|
4
|
+
export declare function getConditionByType(conditionList: Array<any>, type: string): any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type Condition = {
|
|
2
|
+
type: string;
|
|
3
|
+
status: 'True' | 'False' | 'Unknown';
|
|
4
|
+
reason: string;
|
|
5
|
+
message: string;
|
|
6
|
+
lastSyncTime?: string;
|
|
7
|
+
nextSyncTime?: string;
|
|
8
|
+
};
|
|
9
|
+
export type SyncStatus = {
|
|
10
|
+
itemPath?: string;
|
|
11
|
+
conditions?: Condition[];
|
|
12
|
+
nextTimeoutInMS?: number;
|
|
13
|
+
syncStatusPresent?: boolean;
|
|
14
|
+
intervalLapsed?: boolean;
|
|
15
|
+
syncMode?: 'Scheduled' | 'Period';
|
|
16
|
+
};
|
|
17
|
+
export type SyncWatcher = {
|
|
18
|
+
itemPath: string;
|
|
19
|
+
lastRevision: any;
|
|
20
|
+
needsRevision: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare function createWatcherForItem(itemPath: string, itemCR?: any): Promise<SyncWatcher>;
|
|
23
|
+
export declare function destroyWatcherForItem(watcher: SyncWatcher): Promise<void>;
|
|
24
|
+
export declare function getSyncSpecs(itemPath: string, itemCR?: any): Promise<any>;
|
|
25
|
+
export declare function getSyncStatus(itemPath: string, itemCR?: any): Promise<SyncStatus>;
|
|
26
|
+
export declare function setSyncStatus(itemPath: string, reason: string, status: 'True' | 'False' | 'Unknown', message: string): Promise<SyncStatus>;
|