2020-03-10 11:05:09 +01:00
|
|
|
exports.getRecordKey = (appname, wholePath) =>
|
2020-03-11 17:42:19 +01:00
|
|
|
this.getAppRelativePath(appname, wholePath)
|
|
|
|
.replace(`/api/files/`, "/")
|
|
|
|
.replace(`/api/lookup_field/`, "/")
|
|
|
|
.replace(`/api/record/`, "/")
|
|
|
|
.replace(`/api/listRecords/`, "/")
|
|
|
|
.replace(`/api/aggregates/`, "/")
|
|
|
|
|
|
|
|
exports.getAppRelativePath = (appname, wholePath) => {
|
|
|
|
const builderInstanceRegex = new RegExp(
|
|
|
|
`\\/_builder\\/instance\\/[^\\/]*\\/[^\\/]*\\/`
|
|
|
|
)
|
|
|
|
|
|
|
|
return wholePath.replace(builderInstanceRegex, "/").replace(`/${appname}`, "")
|
|
|
|
}
|