|
|
@ -201,13 +201,14 @@ export default class Base implements BaseType { |
|
|
|
if (o) { |
|
|
|
if (o) { |
|
|
|
// delete <scope>:<id>
|
|
|
|
// delete <scope>:<id>
|
|
|
|
await NocoCache.del(`${CacheScope.PROJECT}:${baseId}`); |
|
|
|
await NocoCache.del(`${CacheScope.PROJECT}:${baseId}`); |
|
|
|
|
|
|
|
await NocoCache.del(`${CacheScope.PROJECT_ALIAS}:${baseId}`); |
|
|
|
// delete <scope>:<title>
|
|
|
|
// delete <scope>:<title>
|
|
|
|
await NocoCache.del(`${CacheScope.PROJECT}:${o.title}`); |
|
|
|
await NocoCache.del(`${CacheScope.PROJECT_ALIAS}:${o.title}`); |
|
|
|
// delete <scope>:<uuid>
|
|
|
|
// delete <scope>:<uuid>
|
|
|
|
await NocoCache.del(`${CacheScope.PROJECT}:${o.uuid}`); |
|
|
|
await NocoCache.del(`${CacheScope.PROJECT_ALIAS}:${o.uuid}`); |
|
|
|
// delete <scope>:ref:<titleOfId>
|
|
|
|
// delete <scope>:ref:<titleOfId>
|
|
|
|
await NocoCache.del(`${CacheScope.PROJECT}:ref:${o.title}`); |
|
|
|
await NocoCache.del(`${CacheScope.PROJECT_ALIAS}:ref:${o.title}`); |
|
|
|
await NocoCache.del(`${CacheScope.PROJECT}:ref:${o.id}`); |
|
|
|
await NocoCache.del(`${CacheScope.PROJECT_ALIAS}:ref:${o.id}`); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await NocoCache.del(CacheScope.INSTANCE_META); |
|
|
|
await NocoCache.del(CacheScope.INSTANCE_META); |
|
|
@ -334,8 +335,8 @@ export default class Base implements BaseType { |
|
|
|
const baseId = |
|
|
|
const baseId = |
|
|
|
uuid && |
|
|
|
uuid && |
|
|
|
(await NocoCache.get( |
|
|
|
(await NocoCache.get( |
|
|
|
`${CacheScope.PROJECT}:${uuid}`, |
|
|
|
`${CacheScope.PROJECT_ALIAS}:${uuid}`, |
|
|
|
CacheGetType.TYPE_OBJECT, |
|
|
|
CacheGetType.TYPE_STRING, |
|
|
|
)); |
|
|
|
)); |
|
|
|
let baseData = null; |
|
|
|
let baseData = null; |
|
|
|
if (!baseId) { |
|
|
|
if (!baseId) { |
|
|
@ -344,7 +345,10 @@ export default class Base implements BaseType { |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (baseData) { |
|
|
|
if (baseData) { |
|
|
|
baseData.meta = parseMetaProp(baseData); |
|
|
|
baseData.meta = parseMetaProp(baseData); |
|
|
|
await NocoCache.set(`${CacheScope.PROJECT}:${uuid}`, baseData?.id); |
|
|
|
await NocoCache.set( |
|
|
|
|
|
|
|
`${CacheScope.PROJECT_ALIAS}:${uuid}`, |
|
|
|
|
|
|
|
baseData?.id, |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return this.get(baseId); |
|
|
|
return this.get(baseId); |
|
|
@ -365,8 +369,8 @@ export default class Base implements BaseType { |
|
|
|
const baseId = |
|
|
|
const baseId = |
|
|
|
title && |
|
|
|
title && |
|
|
|
(await NocoCache.get( |
|
|
|
(await NocoCache.get( |
|
|
|
`${CacheScope.PROJECT}:${title}`, |
|
|
|
`${CacheScope.PROJECT_ALIAS}:${title}`, |
|
|
|
CacheGetType.TYPE_OBJECT, |
|
|
|
CacheGetType.TYPE_STRING, |
|
|
|
)); |
|
|
|
)); |
|
|
|
let baseData = null; |
|
|
|
let baseData = null; |
|
|
|
if (!baseId) { |
|
|
|
if (!baseId) { |
|
|
@ -376,7 +380,10 @@ export default class Base implements BaseType { |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (baseData) { |
|
|
|
if (baseData) { |
|
|
|
baseData.meta = parseMetaProp(baseData); |
|
|
|
baseData.meta = parseMetaProp(baseData); |
|
|
|
await NocoCache.set(`${CacheScope.PROJECT}:${title}`, baseData?.id); |
|
|
|
await NocoCache.set( |
|
|
|
|
|
|
|
`${CacheScope.PROJECT_ALIAS}:${title}`, |
|
|
|
|
|
|
|
baseData?.id, |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return this.get(baseId); |
|
|
|
return this.get(baseId); |
|
|
@ -388,8 +395,8 @@ export default class Base implements BaseType { |
|
|
|
const baseId = |
|
|
|
const baseId = |
|
|
|
titleOrId && |
|
|
|
titleOrId && |
|
|
|
(await NocoCache.get( |
|
|
|
(await NocoCache.get( |
|
|
|
`${CacheScope.PROJECT}:ref:${titleOrId}`, |
|
|
|
`${CacheScope.PROJECT_ALIAS}:ref:${titleOrId}`, |
|
|
|
CacheGetType.TYPE_OBJECT, |
|
|
|
CacheGetType.TYPE_STRING, |
|
|
|
)); |
|
|
|
)); |
|
|
|
let baseData = null; |
|
|
|
let baseData = null; |
|
|
|
if (!baseId) { |
|
|
|
if (!baseId) { |
|
|
@ -422,7 +429,7 @@ export default class Base implements BaseType { |
|
|
|
baseData.meta = parseMetaProp(baseData); |
|
|
|
baseData.meta = parseMetaProp(baseData); |
|
|
|
|
|
|
|
|
|
|
|
await NocoCache.set( |
|
|
|
await NocoCache.set( |
|
|
|
`${CacheScope.PROJECT}:ref:${titleOrId}`, |
|
|
|
`${CacheScope.PROJECT_ALIAS}:ref:${titleOrId}`, |
|
|
|
baseData?.id, |
|
|
|
baseData?.id, |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|