@ms-cloudpack/api-server 0.26.0 → 0.26.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isCachedResultValid.d.ts","sourceRoot":"","sources":["../../src/utilities/isCachedResultValid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,UAAU,0BAA0B;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"isCachedResultValid.d.ts","sourceRoot":"","sources":["../../src/utilities/isCachedResultValid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,UAAU,0BAA0B;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAwChF"}
|
|
@@ -23,8 +23,12 @@ export function isCachedResultValid(options) {
|
|
|
23
23
|
// outputPath used to be an optional field, however, we do not want it to be undefined anymore.
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
|
-
if (shouldCacheInternalPackages && !isExternal
|
|
27
|
-
// The package is internal, shouldCacheInternalPackages is
|
|
26
|
+
if (!shouldCacheInternalPackages && !isExternal) {
|
|
27
|
+
// The package is internal, shouldCacheInternalPackages is disabled, this is an invalid result.
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (!isExternal && (result.hash == undefined || result.hash != hash)) {
|
|
31
|
+
// Internal packages are invalid if the package hash has changed or it is undefined.
|
|
28
32
|
return false;
|
|
29
33
|
}
|
|
30
34
|
// Output files must be relative
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isCachedResultValid.js","sourceRoot":"","sources":["../../src/utilities/isCachedResultValid.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAmC;IACrE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,YAAY,EAAE,2BAA2B,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;IAExF,IAAI,YAAY,EAAE;QAChB,mDAAmD;QACnD,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,MAAM,EAAE;QACX,oDAAoD;QACpD,OAAO,KAAK,CAAC;KACd;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;QACzB,6CAA6C;QAC7C,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;QACtB,+FAA+F;QAC/F,OAAO,KAAK,CAAC;KACd;IAED,IAAI,2BAA2B,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"isCachedResultValid.js","sourceRoot":"","sources":["../../src/utilities/isCachedResultValid.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAmC;IACrE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,YAAY,EAAE,2BAA2B,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;IAExF,IAAI,YAAY,EAAE;QAChB,mDAAmD;QACnD,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,MAAM,EAAE;QACX,oDAAoD;QACpD,OAAO,KAAK,CAAC;KACd;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;QACzB,6CAA6C;QAC7C,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;QACtB,+FAA+F;QAC/F,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,2BAA2B,IAAI,CAAC,UAAU,EAAE;QAC/C,+FAA+F;QAC/F,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE;QACpE,oFAAoF;QACpF,OAAO,KAAK,CAAC;KACd;IAED,gCAAgC;IAChC,IAAI,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE;QAC7E,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\n\ninterface IsCachedResultValidOptions {\n bundleRequest: BundleRequest;\n hash?: string;\n}\n\n/**\n * Validates the result of a bundle request.\n * @param options - The options to use when validating the result.\n * @returns True if the result is valid, false otherwise.\n */\nexport function isCachedResultValid(options: IsCachedResultValidOptions): boolean {\n const { bundleRequest, hash } = options;\n const { disableCache, shouldCacheInternalPackages, isExternal, result } = bundleRequest;\n\n if (disableCache) {\n // The result is not valid if disableCache is true.\n return false;\n }\n\n if (!result) {\n // The result is undefined, so the result is invalid\n return false;\n }\n\n if (result.errors?.length) {\n // There are errors, so the result is invalid\n return false;\n }\n\n if (!result.outputPath) {\n // outputPath used to be an optional field, however, we do not want it to be undefined anymore.\n return false;\n }\n\n if (!shouldCacheInternalPackages && !isExternal) {\n // The package is internal, shouldCacheInternalPackages is disabled, this is an invalid result.\n return false;\n }\n\n if (!isExternal && (result.hash == undefined || result.hash != hash)) {\n // Internal packages are invalid if the package hash has changed or it is undefined.\n return false;\n }\n\n // Output files must be relative\n if (result.outputFiles?.find(({ outputPath }) => path.isAbsolute(outputPath))) {\n return false;\n }\n\n return true;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/api-server",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
4
4
|
"description": "An implementation of the API server that does interacts with a task scheduler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@lage-run/scheduler": "^1.1.9",
|
|
29
29
|
"@lage-run/target-graph": "^0.8.7",
|
|
30
30
|
"@lage-run/hasher": "^1.0.5",
|
|
31
|
-
"@ms-cloudpack/bundler": "^0.15.
|
|
31
|
+
"@ms-cloudpack/bundler": "^0.15.7",
|
|
32
32
|
"@ms-cloudpack/bundler-types": "^0.20.0",
|
|
33
33
|
"@ms-cloudpack/config": "^0.14.8",
|
|
34
34
|
"@ms-cloudpack/create-express-app": "^1.3.12",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@ms-cloudpack/path-utilities": "^2.3.5",
|
|
42
42
|
"@ms-cloudpack/task-reporter": "^0.10.0",
|
|
43
43
|
"@ms-cloudpack/telemetry": "^0.4.3",
|
|
44
|
-
"@ms-cloudpack/remote-cache": "^0.1.
|
|
44
|
+
"@ms-cloudpack/remote-cache": "^0.1.16",
|
|
45
45
|
"@trpc/client": "^10.41.0",
|
|
46
46
|
"@trpc/server": "^10.41.0",
|
|
47
47
|
"cors": "^2.8.5",
|