@elek-io/core 0.11.0 → 0.11.1
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.
|
@@ -15621,7 +15621,7 @@ declare const projectUpgradeSchema: z$1.ZodObject<{
|
|
|
15621
15621
|
supported: ("bg" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "hu" | "it" | "ja" | "lt" | "lv" | "nl" | "pl" | "pt" | "ro" | "ru" | "sk" | "sl" | "sv" | "zh")[];
|
|
15622
15622
|
};
|
|
15623
15623
|
};
|
|
15624
|
-
}, ...
|
|
15624
|
+
}, ...args: unknown[]) => Promise<void>;
|
|
15625
15625
|
}, {
|
|
15626
15626
|
to: string;
|
|
15627
15627
|
run: (args_0: {
|
|
@@ -15640,7 +15640,7 @@ declare const projectUpgradeSchema: z$1.ZodObject<{
|
|
|
15640
15640
|
supported: ("bg" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "hu" | "it" | "ja" | "lt" | "lv" | "nl" | "pl" | "pt" | "ro" | "ru" | "sk" | "sl" | "sv" | "zh")[];
|
|
15641
15641
|
};
|
|
15642
15642
|
};
|
|
15643
|
-
}, ...
|
|
15643
|
+
}, ...args: unknown[]) => Promise<void>;
|
|
15644
15644
|
}>;
|
|
15645
15645
|
type ProjectUpgrade = z$1.infer<typeof projectUpgradeSchema>;
|
|
15646
15646
|
declare const cloneProjectSchema: z$1.ZodObject<{
|
|
@@ -17521,7 +17521,7 @@ declare const pathTo: {
|
|
|
17521
17521
|
assets: (projectId: string) => string;
|
|
17522
17522
|
assetFile: (projectId: string, id: string) => string;
|
|
17523
17523
|
asset: (projectId: string, id: string, extension: string) => string;
|
|
17524
|
-
tmpAsset: (id: string, extension: string) => string;
|
|
17524
|
+
tmpAsset: (id: string, commitHash: string, extension: string) => string;
|
|
17525
17525
|
};
|
|
17526
17526
|
/**
|
|
17527
17527
|
* Used as parameter for filter() methods to assure,
|
|
@@ -15621,7 +15621,7 @@ declare const projectUpgradeSchema: z$1.ZodObject<{
|
|
|
15621
15621
|
supported: ("bg" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "hu" | "it" | "ja" | "lt" | "lv" | "nl" | "pl" | "pt" | "ro" | "ru" | "sk" | "sl" | "sv" | "zh")[];
|
|
15622
15622
|
};
|
|
15623
15623
|
};
|
|
15624
|
-
}, ...
|
|
15624
|
+
}, ...args: unknown[]) => Promise<void>;
|
|
15625
15625
|
}, {
|
|
15626
15626
|
to: string;
|
|
15627
15627
|
run: (args_0: {
|
|
@@ -15640,7 +15640,7 @@ declare const projectUpgradeSchema: z$1.ZodObject<{
|
|
|
15640
15640
|
supported: ("bg" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "hu" | "it" | "ja" | "lt" | "lv" | "nl" | "pl" | "pt" | "ro" | "ru" | "sk" | "sl" | "sv" | "zh")[];
|
|
15641
15641
|
};
|
|
15642
15642
|
};
|
|
15643
|
-
}, ...
|
|
15643
|
+
}, ...args: unknown[]) => Promise<void>;
|
|
15644
15644
|
}>;
|
|
15645
15645
|
type ProjectUpgrade = z$1.infer<typeof projectUpgradeSchema>;
|
|
15646
15646
|
declare const cloneProjectSchema: z$1.ZodObject<{
|
|
@@ -17498,7 +17498,7 @@ declare const pathTo: {
|
|
|
17498
17498
|
assets: (projectId: string) => string;
|
|
17499
17499
|
assetFile: (projectId: string, id: string) => string;
|
|
17500
17500
|
asset: (projectId: string, id: string, extension: string) => string;
|
|
17501
|
-
tmpAsset: (id: string, extension: string) => string;
|
|
17501
|
+
tmpAsset: (id: string, commitHash: string, extension: string) => string;
|
|
17502
17502
|
};
|
|
17503
17503
|
/**
|
|
17504
17504
|
* Used as parameter for filter() methods to assure,
|
package/dist/node/index.node.js
CHANGED
|
@@ -8,7 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
import Fs7 from "fs-extra";
|
|
9
9
|
|
|
10
10
|
// package.json
|
|
11
|
-
var version = "0.11.
|
|
11
|
+
var version = "0.11.1";
|
|
12
12
|
|
|
13
13
|
// src/schema/assetSchema.ts
|
|
14
14
|
import z4 from "zod";
|
|
@@ -1027,8 +1027,8 @@ var pathTo = {
|
|
|
1027
1027
|
asset: (projectId, id, extension) => {
|
|
1028
1028
|
return Path.join(pathTo.lfs(projectId), `${id}.${extension}`);
|
|
1029
1029
|
},
|
|
1030
|
-
tmpAsset: (id, extension) => {
|
|
1031
|
-
return Path.join(pathTo.tmp, `${id}.${extension}`);
|
|
1030
|
+
tmpAsset: (id, commitHash, extension) => {
|
|
1031
|
+
return Path.join(pathTo.tmp, `${id}.${commitHash}.${extension}`);
|
|
1032
1032
|
}
|
|
1033
1033
|
};
|
|
1034
1034
|
function notEmpty(value) {
|
|
@@ -1107,6 +1107,7 @@ var AbstractCrudService = class {
|
|
|
1107
1107
|
throw new RequiredParameterMissingError("projectId");
|
|
1108
1108
|
}
|
|
1109
1109
|
return this.getFileReferences(pathTo.lfs(projectId));
|
|
1110
|
+
// LFS folder is correct, since we want the extension of the file itself, not the AssetFile (.json)
|
|
1110
1111
|
case objectTypeSchema.Enum.project:
|
|
1111
1112
|
return this.getFolderReferences(pathTo.projects);
|
|
1112
1113
|
case objectTypeSchema.Enum.collection:
|
|
@@ -1279,11 +1280,11 @@ var AssetService = class extends AbstractCrudService {
|
|
|
1279
1280
|
"binary"
|
|
1280
1281
|
);
|
|
1281
1282
|
await Fs2.writeFile(
|
|
1282
|
-
pathTo.tmpAsset(assetFile.id, assetFile.extension),
|
|
1283
|
+
pathTo.tmpAsset(assetFile.id, props.commitHash, assetFile.extension),
|
|
1283
1284
|
assetBlob,
|
|
1284
1285
|
"binary"
|
|
1285
1286
|
);
|
|
1286
|
-
return this.toAsset(props.projectId, assetFile,
|
|
1287
|
+
return this.toAsset(props.projectId, assetFile, props.commitHash);
|
|
1287
1288
|
}
|
|
1288
1289
|
}
|
|
1289
1290
|
/**
|
|
@@ -1407,8 +1408,8 @@ var AssetService = class extends AbstractCrudService {
|
|
|
1407
1408
|
* @param projectId The project's ID
|
|
1408
1409
|
* @param assetFile The AssetFile to convert
|
|
1409
1410
|
*/
|
|
1410
|
-
async toAsset(projectId, assetFile,
|
|
1411
|
-
const assetPath =
|
|
1411
|
+
async toAsset(projectId, assetFile, commitHash) {
|
|
1412
|
+
const assetPath = commitHash ? pathTo.tmpAsset(assetFile.id, commitHash, assetFile.extension) : pathTo.asset(projectId, assetFile.id, assetFile.extension);
|
|
1412
1413
|
const history = await this.gitService.log(pathTo.project(projectId), {
|
|
1413
1414
|
filePath: pathTo.assetFile(projectId, assetFile.id)
|
|
1414
1415
|
});
|
|
@@ -1914,6 +1915,11 @@ var EntryService = class extends AbstractCrudService {
|
|
|
1914
1915
|
collectionId: props.collectionId,
|
|
1915
1916
|
id: props.valueContentReference.id
|
|
1916
1917
|
});
|
|
1918
|
+
// case objectTypeSchema.Enum.sharedValue:
|
|
1919
|
+
// return this.resolveValueContentReferenceToSharedValue({
|
|
1920
|
+
// projectId: props.projectId,
|
|
1921
|
+
// valueContentReferenceToSharedValue: props.valueContentReference,
|
|
1922
|
+
// });
|
|
1917
1923
|
default:
|
|
1918
1924
|
throw new Error(
|
|
1919
1925
|
// @ts-ignore
|