@ms-cloudpack/api-server 0.60.1 → 0.61.0
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.
- package/lib/apis/addPackageOverride.d.ts +3 -38
- package/lib/apis/addPackageOverride.d.ts.map +1 -1
- package/lib/apis/addPackageOverride.js +2 -13
- package/lib/apis/addPackageOverride.js.map +1 -1
- package/lib/apis/ensurePackageBundled.d.ts +4 -4
- package/lib/apis/ensurePackageBundled.d.ts.map +1 -1
- package/lib/apis/ensurePackageBundled.js +6 -15
- package/lib/apis/ensurePackageBundled.js.map +1 -1
- package/lib/apis/getSessionId.d.ts +1 -1
- package/lib/apis/getSessionId.d.ts.map +1 -1
- package/lib/apis/getSessionId.js.map +1 -1
- package/lib/apis/linkPath.d.ts +1 -1
- package/lib/apis/linkPath.d.ts.map +1 -1
- package/lib/apis/linkPath.js.map +1 -1
- package/lib/apis/openConfigEditor.d.ts +1 -1
- package/lib/apis/openConfigEditor.d.ts.map +1 -1
- package/lib/apis/openConfigEditor.js +5 -2
- package/lib/apis/openConfigEditor.js.map +1 -1
- package/lib/apis/openFilePath.d.ts +1 -1
- package/lib/apis/openFilePath.d.ts.map +1 -1
- package/lib/apis/openFilePath.js.map +1 -1
- package/lib/apis/reportSpan.d.ts +1 -1
- package/lib/apis/reportSpan.d.ts.map +1 -1
- package/lib/apis/reportSpan.js.map +1 -1
- package/lib/apis/restartAllTasks.d.ts +1 -1
- package/lib/apis/restartAllTasks.d.ts.map +1 -1
- package/lib/apis/restartAllTasks.js.map +1 -1
- package/lib/apis/restartTask.d.ts +1 -1
- package/lib/apis/restartTask.d.ts.map +1 -1
- package/lib/apis/restartTask.js.map +1 -1
- package/lib/apis/syncDownload.d.ts +5 -2
- package/lib/apis/syncDownload.d.ts.map +1 -1
- package/lib/apis/syncDownload.js +4 -2
- package/lib/apis/syncDownload.js.map +1 -1
- package/lib/apis/syncUpload.d.ts +7 -4
- package/lib/apis/syncUpload.d.ts.map +1 -1
- package/lib/apis/syncUpload.js +30 -13
- package/lib/apis/syncUpload.js.map +1 -1
- package/lib/apis/unlinkPath.d.ts +1 -1
- package/lib/apis/unlinkPath.d.ts.map +1 -1
- package/lib/apis/unlinkPath.js.map +1 -1
- package/lib/apis/validatePackageOverride.d.ts +7 -32
- package/lib/apis/validatePackageOverride.d.ts.map +1 -1
- package/lib/apis/validatePackageOverride.js +3 -2
- package/lib/apis/validatePackageOverride.js.map +1 -1
- package/lib/common/createApiContext.d.ts +3 -2
- package/lib/common/createApiContext.d.ts.map +1 -1
- package/lib/common/createApiContext.js +4 -8
- package/lib/common/createApiContext.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/ApiParams.d.ts +9 -6
- package/lib/types/ApiParams.d.ts.map +1 -1
- package/lib/types/ApiParams.js.map +1 -1
- package/lib/types/Context.d.ts +10 -6
- package/lib/types/Context.d.ts.map +1 -1
- package/lib/types/Context.js.map +1 -1
- package/lib/utilities/TaskRunner.d.ts.map +1 -1
- package/lib/utilities/TaskRunner.js +7 -1
- package/lib/utilities/TaskRunner.js.map +1 -1
- package/lib/utilities/addOverride.d.ts +2 -2
- package/lib/utilities/addOverride.d.ts.map +1 -1
- package/lib/utilities/addOverride.js.map +1 -1
- package/lib/utilities/createBundleTask.d.ts.map +1 -1
- package/lib/utilities/createBundleTask.js +2 -4
- package/lib/utilities/createBundleTask.js.map +1 -1
- package/lib/utilities/createRemoteCacheClient.d.ts +3 -3
- package/lib/utilities/createRemoteCacheClient.d.ts.map +1 -1
- package/lib/utilities/createRemoteCacheClient.js +3 -4
- package/lib/utilities/createRemoteCacheClient.js.map +1 -1
- package/lib/utilities/notifyReload.d.ts +2 -2
- package/lib/utilities/notifyReload.d.ts.map +1 -1
- package/lib/utilities/notifyReload.js.map +1 -1
- package/lib/utilities/validateOverride.d.ts +2 -2
- package/lib/utilities/validateOverride.d.ts.map +1 -1
- package/lib/utilities/validateOverride.js.map +1 -1
- package/package.json +3 -3
- package/lib/utilities/editCloudpackConfig.d.ts +0 -5
- package/lib/utilities/editCloudpackConfig.d.ts.map +0 -1
- package/lib/utilities/editCloudpackConfig.js +0 -10
- package/lib/utilities/editCloudpackConfig.js.map +0 -1
- package/lib/utilities/getDefaultTaskStats.d.ts +0 -3
- package/lib/utilities/getDefaultTaskStats.d.ts.map +0 -1
- package/lib/utilities/getDefaultTaskStats.js +0 -8
- package/lib/utilities/getDefaultTaskStats.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addOverride.js","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAWnF;;;;;GAKG;AACH,IAAI,iBAAiB,GAA4B,OAAO,CAAC,OAAO,CAAC;IAC/D,aAAa,EAAE,KAAK;IACpB,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAwB,EACxB,
|
|
1
|
+
{"version":3,"file":"addOverride.js","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GACd,MAAM,iCAAiC,CAAC;AAC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C1E,MAAM,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAEnD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["import type { ResolveMapEntry } from '@ms-cloudpack/common-types';\nimport { ensureGeneratedSettingsForPackage, readGeneratedConfig, writeGeneratedConfig } from '@ms-cloudpack/config';\nimport { parseRequestInfo } from '@ms-cloudpack/import-map';\nimport {\n addExportsMapEntry,\n findResolveMapEntry,\n flattenExportsMap,\n getExportsMap,\n} from '@ms-cloudpack/package-utilities';\nimport { makeUrl, normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';\nimport type { PartialContext } from '../types/Context.js';\nimport type { OverrideOptions } from '../types/OverrideOptions.js';\n\ntype OverrideReturn = {\n /** Whether the override was successfully added */\n addedOverride: boolean;\n /** The entry (if any) in the resolve map the override was added to */\n entry: ResolveMapEntry | undefined;\n};\n\n/**\n * Helper so that when addOverride is called multiple times in quick succession, we only process one at a time.\n * This is to avoid that multiple calls of addOverride first read the same version of the generated config,\n * then write the same version of the config with its corresponding update,\n * which would result in the last call overwriting the changes of the previous calls.\n */\nlet overrideInProcess: Promise<OverrideReturn> = Promise.resolve({\n addedOverride: false,\n entry: undefined,\n});\n\n/**\n * The addOverride method is triggered by a user action in the overlay, when we detect new usage of an import path\n * that isn't recognized. When the user triggers this override, we write it to the cloudpack generated config.\n */\nexport async function addOverride(\n options: OverrideOptions,\n context: PartialContext<'packages', 'config' | 'resolveMap'>,\n): Promise<OverrideReturn> {\n overrideInProcess = overrideInProcess.then(async () => {\n const { packageName, importPath, version, issuerUrl } = options;\n const { session, packages } = context;\n const { appPath } = session.config;\n let addedOverride = false;\n let deletedNullExport = false;\n let requiredBy = undefined;\n\n if (importPath.endsWith('/')) {\n console.error(`The import path \"${importPath}\" is invalid. Please remove the trailing slash and try again.`);\n return { addedOverride, entry: undefined };\n }\n\n if (issuerUrl) {\n const { packageName: issuerName, version: issuerVersion } = parseRequestInfo(makeUrl(issuerUrl).pathname);\n requiredBy = { name: issuerName, version: issuerVersion };\n }\n\n const entry = findResolveMapEntry({\n packageName,\n resolveMap: session.resolveMap,\n definition: requiredBy,\n version,\n });\n\n if (!entry) {\n console.error(`Could not find entry of package \"${packageName}\" in resolve map`);\n return { addedOverride, entry };\n }\n\n const packagePath = entry.path;\n\n // Get current exports. We want to add an additional entry to what's there - not replace the default exports,\n // so we need the full map for the package.\n const exports = await getExportsMap({ packagePath }, { packages, config: session.config });\n const flattenedExports = flattenExportsMap(exports);\n const normalizedImportPath = normalizeRelativePath(importPath);\n\n // Return false if the import path already exists in the exports map.\n if (flattenedExports[normalizedImportPath]) {\n console.debug(`The import path \"${importPath}\" already exists in the exports map for \"${packageName}\".`);\n return { addedOverride, entry };\n }\n\n // Parse the generated config if it exists.\n const generatedConfig = await readGeneratedConfig(appPath);\n\n // Ensure packageSettings exists.\n const generatedPackageSettings = await ensureGeneratedSettingsForPackage(\n { packagePath },\n { config: { generated: generatedConfig }, packages },\n );\n\n if (generatedPackageSettings?.exports && generatedPackageSettings.exports[normalizedImportPath] === null) {\n delete generatedPackageSettings.exports[normalizedImportPath];\n deletedNullExport = true;\n\n if (Object.keys(generatedPackageSettings.exports).length === 0) {\n delete generatedPackageSettings.exports;\n }\n addedOverride = true;\n } else {\n const generatedExports = (generatedPackageSettings.exports ??= {});\n\n // Add the single new exports entry to the exports map.\n addedOverride = await addExportsMapEntry(\n {\n exports: generatedExports,\n packagePath,\n importPath,\n },\n { packages, config: session.config },\n );\n\n if (!addedOverride) {\n console.warn(\n `Unable to add override for package \"${packageName}\" to \"cloudpack.generated.json\".` +\n ` The file \"${normalizedImportPath}\" could not be found.` +\n ` Please check the import path and try again.`,\n );\n return { addedOverride, entry };\n }\n }\n\n // Write the updated generated config\n session.config.generated = generatedConfig;\n const result = await writeGeneratedConfig(generatedConfig, appPath);\n const desc = `\"${packageName}\" (path \"${normalizedImportPath}\")`;\n if (result !== 'no-op') {\n if (deletedNullExport) {\n console.log(`Removed generated null export for ${desc} from \"cloudpack.generated.json\".`);\n if (result === 'deleted') {\n console.log(`Deleted \"cloudpack.generated.json\" because it's now empty.`);\n }\n } else if (result === 'written') {\n console.log(`Added override for ${desc} to \"cloudpack.generated.json\".`);\n }\n }\n\n // Apply the generated exports again to ensure the exports are up to date.\n await packages.get(packagePath, { refresh: true });\n\n return { addedOverride, entry };\n });\n\n return overrideInProcess;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAc,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,iBAAiB,GACxB,cAAc,CAAC,eAAe,EAAE,MAAM,iBAAiB,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,oBAAoB,GAAG,MAAM,CAAC,GAClH,IAAI,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAc,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,iBAAiB,GACxB,cAAc,CAAC,eAAe,EAAE,MAAM,iBAAiB,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,oBAAoB,GAAG,MAAM,CAAC,GAClH,IAAI,CAAC,aAAa,CAAC,CA0DrB"}
|
|
@@ -23,11 +23,9 @@ export function createBundleTask(options, context) {
|
|
|
23
23
|
try {
|
|
24
24
|
// Add a hash to the import map for this package.
|
|
25
25
|
// (Read the session properties here rather than above because they might not be set yet.)
|
|
26
|
-
|
|
27
|
-
const { bundleServer, appServer } = session.urls;
|
|
28
|
-
if (importMap && bundleServer && appServer) {
|
|
26
|
+
if (session.importMap && session.urls.bundleServer && session.urls.appServer) {
|
|
29
27
|
const importMapHash = sourceHash || hash || (await packageHashes.get({ packagePath, isSourceHashingEnabled: !isExternal }));
|
|
30
|
-
addImportMapHash({ packageName, version, hash: importMapHash },
|
|
28
|
+
addImportMapHash({ packageName, version, hash: importMapHash }, context);
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
31
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAkD,MAAM,iBAAiB,CAAC;AAG7F;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA0B,EAC1B,OACmH;IAEnH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,W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AO,EAAE,EAAE,CAAC;QACpC,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;QAC7C,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1B,EAAE;YACF,kCAAkC;YAClC,IAAI;YACJ,SAAS,EAAE,WAAW,IAAI,EAAE;SAC7B,CAAC;QACF,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAClC,EAAE;YACF,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;YACtC,UAAU,EAAE,aAAa,CAAC,MAAM,EAAE,UAAU,IAAI,EAAE;SACnD,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { addImportMapHash } from '@ms-cloudpack/import-map';\nimport fs from 'fs';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport { bundleTask, type BundleTaskContext, type BundleTaskOptions } from './bundleTask.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.\n * This allows active tasks to be tracked remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n options: BundleTaskOptions,\n context: BundleTaskContext &\n PartialContext<'packageHashes', keyof BundleTaskContext['session'] | 'importMap' | 'packageImportPaths' | 'urls'>,\n): Task<BundleRequest> {\n const { bundleRequest } = options;\n const { id, packageName, version, packagePath, isExternal } = bundleRequest;\n const { packageHashes, session } = context;\n const { hash, sourceHash } = options;\n const name = `Bundle ${packageName}@${version}`;\n\n return {\n // Name for task runner logging.\n name,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask(options, context);\n\n try {\n // Add a hash to the import map for this package.\n // (Read the session properties here rather than above because they might not be set yet.)\n if (session.importMap && session.urls.bundleServer && session.urls.appServer) {\n const importMapHash =\n sourceHash || hash || (await packageHashes.get({ packagePath, isSourceHashingEnabled: !isExternal }));\n addImportMapHash({ packageName, version, hash: importMapHash }, context);\n }\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}:`, (e as Error).stack || e);\n }\n\n return bundleRequest;\n },\n clear: () => {\n if (!bundleRequest.result?.outputPath) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n fs.rmSync(bundleRequest.result.outputPath, { recursive: true, force: true });\n\n bundleRequest.result = undefined;\n },\n onDispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getErrors: () => bundleRequest.result?.errors,\n getStartDescription: () => ({\n id,\n // Name to display in the overlay.\n name,\n inputPath: packagePath || '',\n }),\n getEndDescription: (taskResult) => ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n outputPath: bundleRequest.result?.outputPath || '',\n }),\n };\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { LoginMethod, RemoteCacheClient } from '@ms-cloudpack/remote-cache';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PartialContext } from '../types/Context.js';
|
|
3
3
|
/**
|
|
4
4
|
* Lazy loads the remote cache client and returns it.
|
|
5
5
|
* @returns - The remote cache client if it is configured, otherwise undefined.
|
|
6
6
|
*/
|
|
7
|
-
export declare function createRemoteCacheClient(
|
|
7
|
+
export declare function createRemoteCacheClient(options: {
|
|
8
8
|
loginMethod: LoginMethod;
|
|
9
|
-
}, '
|
|
9
|
+
}, context: PartialContext<'reporter' | 'telemetryClient', 'cachePath' | 'config'>): Promise<RemoteCacheClient | undefined>;
|
|
10
10
|
//# sourceMappingURL=createRemoteCacheClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRemoteCacheClient.d.ts","sourceRoot":"","sources":["../../src/utilities/createRemoteCacheClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"createRemoteCacheClient.d.ts","sourceRoot":"","sources":["../../src/utilities/createRemoteCacheClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE;IACP,WAAW,EAAE,WAAW,CAAC;CAC1B,EACD,OAAO,EAAE,cAAc,CAAC,UAAU,GAAG,iBAAiB,EAAE,WAAW,GAAG,QAAQ,CAAC,GAC9E,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAoBxC"}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* Lazy loads the remote cache client and returns it.
|
|
3
3
|
* @returns - The remote cache client if it is configured, otherwise undefined.
|
|
4
4
|
*/
|
|
5
|
-
export async function createRemoteCacheClient(
|
|
6
|
-
const {
|
|
7
|
-
const {
|
|
8
|
-
const { session, reporter, telemetryClient } = ctx;
|
|
5
|
+
export async function createRemoteCacheClient(options, context) {
|
|
6
|
+
const { loginMethod } = options;
|
|
7
|
+
const { session, reporter, telemetryClient } = context;
|
|
9
8
|
if (!session.config.remoteCache) {
|
|
10
9
|
// Remote cache is not configured, return undefined.
|
|
11
10
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRemoteCacheClient.js","sourceRoot":"","sources":["../../src/utilities/createRemoteCacheClient.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,
|
|
1
|
+
{"version":3,"file":"createRemoteCacheClient.js","sourceRoot":"","sources":["../../src/utilities/createRemoteCacheClient.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAEC,EACD,OAA+E;IAE/E,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAChC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAEvD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAChC,oDAAoD;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;IAE3E,OAAO,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QACrF,MAAM,iBAAiB,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;QAErE,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,uBAAuB,CAAC;YAC7D,OAAO,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE;YACtC,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE;SAC5F,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { LoginMethod, RemoteCacheClient } from '@ms-cloudpack/remote-cache';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Lazy loads the remote cache client and returns it.\n * @returns - The remote cache client if it is configured, otherwise undefined.\n */\nexport async function createRemoteCacheClient(\n options: {\n loginMethod: LoginMethod;\n },\n context: PartialContext<'reporter' | 'telemetryClient', 'cachePath' | 'config'>,\n): Promise<RemoteCacheClient | undefined> {\n const { loginMethod } = options;\n const { session, reporter, telemetryClient } = context;\n\n if (!session.config.remoteCache) {\n // Remote cache is not configured, return undefined.\n return undefined;\n }\n const { container, storageAccount, tenantId } = session.config.remoteCache;\n\n return telemetryClient.tracer.startActiveSpan('CREATE_REMOTE_CACHE_CLIENT', async () => {\n const remoteCacheModule = await import('@ms-cloudpack/remote-cache');\n\n const client = await remoteCacheModule.createRemoteCacheClient({\n context: { reporter, telemetryClient },\n options: { container, loginMethod, storageAccount, cachePath: session.cachePath, tenantId },\n });\n\n return client;\n });\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PartialContext } from '../types/Context.js';
|
|
2
2
|
/**
|
|
3
3
|
* Notifies clients that a reload is needed by incrementing the session version.
|
|
4
4
|
*/
|
|
5
5
|
export declare function notifyReload(options: {
|
|
6
6
|
reason: string;
|
|
7
|
-
}, context:
|
|
7
|
+
}, context: PartialContext<'bus' | 'telemetryClient', 'sequence'>): Promise<void>;
|
|
8
8
|
//# sourceMappingURL=notifyReload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifyReload.d.ts","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"notifyReload.d.ts","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAC3B,OAAO,EAAE,cAAc,CAAC,KAAK,GAAG,iBAAiB,EAAE,UAAU,CAAC,GAC7D,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifyReload.js","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"notifyReload.js","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA2B,EAC3B,OAA8D;IAE9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QACrE,OAAO,CAAC,QAAQ,EAAE,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAE3D,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { reloadCountSource } from '../data/busSources.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Notifies clients that a reload is needed by incrementing the session version.\n */\nexport async function notifyReload(\n options: { reason: string },\n context: PartialContext<'bus' | 'telemetryClient', 'sequence'>,\n): Promise<void> {\n const { reason } = options;\n const { bus, session, telemetryClient } = context;\n\n await telemetryClient.tracer.startActiveSpan('NOTIFY_RELOAD', (span) => {\n session.sequence++;\n\n span.setAttributes({ sequence: session.sequence, reason });\n\n bus.publish(reloadCountSource, session.sequence);\n });\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PartialContext } from '../types/Context.js';
|
|
2
2
|
import type { OverrideOptions } from '../types/OverrideOptions.js';
|
|
3
3
|
/**
|
|
4
4
|
* Given a package name, import path, and optional issuerUrl, returns a boolean indicating if the given
|
|
5
5
|
* override is valid.
|
|
6
6
|
*/
|
|
7
|
-
export declare function validateOverride(options: OverrideOptions, context:
|
|
7
|
+
export declare function validateOverride(options: Omit<OverrideOptions, 'version'>, context: PartialContext<'packages', 'config' | 'resolveMap'>): Promise<boolean>;
|
|
8
8
|
//# sourceMappingURL=validateOverride.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateOverride.d.ts","sourceRoot":"","sources":["../../src/utilities/validateOverride.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"validateOverride.d.ts","sourceRoot":"","sources":["../../src/utilities/validateOverride.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACzC,OAAO,EAAE,cAAc,CAAC,UAAU,EAAE,QAAQ,GAAG,YAAY,CAAC,GAC3D,OAAO,CAAC,OAAO,CAAC,CAqDlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateOverride.js","sourceRoot":"","sources":["../../src/utilities/validateOverride.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAGnF,OAAO,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,
|
|
1
|
+
{"version":3,"file":"validateOverride.js","sourceRoot":"","sources":["../../src/utilities/validateOverride.ts"],"names":[],"mappings":"AACA,OA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;QACvB,QAAQ,EAAE,UAAU;KACrB,EACD,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CACrC,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2CAA2C;IAC3C,MAAM,eAAe,GAAG,MAAM,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAE3D,iCAAiC;IACjC,MAAM,wBAAwB,GAAG,MAAM,iCAAiC,CACtE,EAAE,WAAW,EAAE,KAAK,CAAC,IAAI,EAAE,EAC3B,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,QAAQ,EAAE,CACrD,CAAC;IAEF,OAAO,CACL,CAAC,CAAC,wBAAwB,EAAE,OAAO,IAAI,wBAAwB,CAAC,OAAO,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,KAAK,IAAI,CACpH,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageJson } from '@ms-cloudpack/common-types';\nimport { parseRequestInfo } from '@ms-cloudpack/import-map';\nimport { findFileInPackage, findResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { makeUrl, normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';\nimport type { PartialContext } from '../types/Context.js';\nimport type { OverrideOptions } from '../types/OverrideOptions.js';\nimport { ensureGeneratedSettingsForPackage, readGeneratedConfig } from '@ms-cloudpack/config';\n\n/**\n * Given a package name, import path, and optional issuerUrl, returns a boolean indicating if the given\n * override is valid.\n */\nexport async function validateOverride(\n options: Omit<OverrideOptions, 'version'>,\n context: PartialContext<'packages', 'config' | 'resolveMap'>,\n): Promise<boolean> {\n const { packageName, importPath, issuerUrl } = options;\n const { session, packages } = context;\n const { config } = session;\n const { appPath } = config;\n\n let requiredBy: PackageJson | undefined = undefined;\n\n // Import paths with trailing slashes are not supported by import maps\n // in browser as they interpret the trailing slash as a wildcard partial match.\n if (importPath.endsWith('/')) {\n return false;\n }\n\n if (issuerUrl) {\n const { packageName: name, version } = parseRequestInfo(makeUrl(issuerUrl).pathname);\n requiredBy = { name, version };\n }\n\n const entry = findResolveMapEntry({\n packageName,\n resolveMap: session.resolveMap,\n definition: requiredBy,\n });\n\n if (!entry) {\n return false;\n }\n\n const { filePath } = await findFileInPackage(\n {\n packagePath: entry.path,\n filePath: importPath,\n },\n { packages, config: session.config },\n );\n\n if (filePath) {\n return true;\n }\n\n // Parse the generated config if it exists.\n const generatedConfig = await readGeneratedConfig(appPath);\n\n // Ensure packageSettings exists.\n const generatedPackageSettings = await ensureGeneratedSettingsForPackage(\n { packagePath: entry.path },\n { config: { generated: generatedConfig }, packages },\n );\n\n return (\n !!generatedPackageSettings?.exports && generatedPackageSettings.exports[normalizeRelativePath(importPath)] === null\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/api-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"description": "An implementation of the API server that does interacts with a task scheduler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"@ms-cloudpack/data-bus": "^0.4.3",
|
|
35
35
|
"@ms-cloudpack/esm-stub-utilities": "^0.14.8",
|
|
36
36
|
"@ms-cloudpack/file-watcher": "^0.2.0",
|
|
37
|
-
"@ms-cloudpack/import-map": "^0.
|
|
37
|
+
"@ms-cloudpack/import-map": "^0.9.0",
|
|
38
38
|
"@ms-cloudpack/json-utilities": "^0.1.10",
|
|
39
39
|
"@ms-cloudpack/package-hashes": "^0.7.28",
|
|
40
40
|
"@ms-cloudpack/package-utilities": "^11.3.4",
|
|
41
41
|
"@ms-cloudpack/path-string-parsing": "^1.2.6",
|
|
42
42
|
"@ms-cloudpack/path-utilities": "^3.0.4",
|
|
43
|
-
"@ms-cloudpack/remote-cache": "^0.10.
|
|
43
|
+
"@ms-cloudpack/remote-cache": "^0.10.11",
|
|
44
44
|
"@ms-cloudpack/task-reporter": "^0.15.1",
|
|
45
45
|
"@ms-cloudpack/telemetry": "^0.10.14",
|
|
46
46
|
"@trpc/client": "11.0.0-rc.682",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editCloudpackConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/editCloudpackConfig.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import { ensureAppConfig } from '@ms-cloudpack/config';
|
|
3
|
-
/**
|
|
4
|
-
* Opens the cloudpack config file in the editor.
|
|
5
|
-
*/
|
|
6
|
-
export async function editCloudpackConfig(cwd) {
|
|
7
|
-
const appConfigPath = await ensureAppConfig(cwd);
|
|
8
|
-
execSync(`code --goto ${JSON.stringify(appConfigPath)}`, { cwd });
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=editCloudpackConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editCloudpackConfig.js","sourceRoot":"","sources":["../../src/utilities/editCloudpackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,GAAW;IACnD,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IAEjD,QAAQ,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { execSync } from 'child_process';\nimport { ensureAppConfig } from '@ms-cloudpack/config';\n\n/**\n * Opens the cloudpack config file in the editor.\n */\nexport async function editCloudpackConfig(cwd: string): Promise<void> {\n const appConfigPath = await ensureAppConfig(cwd);\n\n execSync(`code --goto ${JSON.stringify(appConfigPath)}`, { cwd });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultTaskStats.d.ts","sourceRoot":"","sources":["../../src/utilities/getDefaultTaskStats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAO,MAAM,mBAAmB,EAAE,MAAM,SAMtC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultTaskStats.js","sourceRoot":"","sources":["../../src/utilities/getDefaultTaskStats.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAoB,GAAG,EAAE,CAAC,CAAC;IACzD,MAAM,EAAE,MAAM;IACd,cAAc,EAAE,CAAC;IACjB,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;CACjB,CAAC,CAAC","sourcesContent":["import type { TaskStats } from '../types/TaskStats.js';\n\nexport const getDefaultTaskStats: () => TaskStats = () => ({\n status: 'idle',\n remainingTasks: 0,\n totalTasks: 0,\n totalErrors: 0,\n totalWarnings: 0,\n});\n"]}
|