@salesforce/core
Version:
Core libraries to interact with SFDX projects, orgs, and APIs.
44 lines • 1.59 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScratchOrgCache = void 0;
/*
* Copyright 2026, Salesforce, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const kit_1 = require("@salesforce/kit");
const global_1 = require("../global");
const ttlConfig_1 = require("../config/ttlConfig");
class ScratchOrgCache extends ttlConfig_1.TTLConfig {
static encryptedKeys = ['clientSecret'];
static getFileName() {
return 'scratch-create-cache.json';
}
static getDefaultOptions() {
return {
isGlobal: true,
isState: true,
filename: ScratchOrgCache.getFileName(),
stateFolder: global_1.Global.SF_STATE_FOLDER,
encryptedKeys: ScratchOrgCache.encryptedKeys,
ttl: kit_1.Duration.days(1),
};
}
static async unset(key) {
const cache = await ScratchOrgCache.create();
cache.unset(key);
await cache.write();
}
}
exports.ScratchOrgCache = ScratchOrgCache;
//# sourceMappingURL=scratchOrgCache.js.map