MCPcopy Create free account
hub / github.com/decaporg/decap-cms / constructor

Method constructor

packages/decap-cms-core/src/backend.ts:370–385  ·  view source on GitHub ↗
(implementation: Implementation, { backendName, authStore, config }: BackendOptions)

Source from the content-addressed store, hash-verified

368 backupSync: AsyncLock;
369
370 constructor(implementation: Implementation, { backendName, authStore, config }: BackendOptions) {
371 // We can't reliably run this on exit, so we do cleanup on load.
372 this.deleteAnonymousBackup();
373 this.config = config;
374 this.implementation = implementation.init(this.config, {
375 useWorkflow: selectUseWorkflow(this.config),
376 updateUserCredentials: this.updateUserCredentials,
377 initialWorkflowStatus: status.first(),
378 });
379 this.backendName = backendName;
380 this.authStore = authStore;
381 if (this.implementation === null) {
382 throw new Error('Cannot instantiate a Backend with no implementation');
383 }
384 this.backupSync = asyncLock();
385 }
386
387 async status() {
388 const attempts = 3;

Callers

nothing calls this directly

Calls 3

deleteAnonymousBackupMethod · 0.95
selectUseWorkflowFunction · 0.90
asyncLockFunction · 0.90

Tested by

no test coverage detected