@ms-cloudpack/api-server 0.27.4 → 0.27.5

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":"openConfigEditor.d.ts","sourceRoot":"","sources":["../../src/apis/openConfigEditor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,iBAErE;yBAFqB,gBAAgB"}
1
+ {"version":3,"file":"openConfigEditor.d.ts","sourceRoot":"","sources":["../../src/apis/openConfigEditor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,iBAErE;yBAFqB,gBAAgB"}
@@ -1,7 +1,6 @@
1
1
  import { publicProcedure } from '../trpc/common.js';
2
2
  import { editCloudpackConfig } from '../utilities/editCloudpackConfig.js';
3
3
  // This has no parameters, but include an empty parameter object to keep the signature consistent with other APIs
4
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
4
  export async function openConfigEditor(_params) {
6
5
  await editCloudpackConfig();
7
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"openConfigEditor.js","sourceRoot":"","sources":["../../src/apis/openConfigEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,iHAAiH;AACjH,6DAA6D;AAC7D,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAA+B;IACpE,MAAM,mBAAmB,EAAE,CAAC;AAC9B,CAAC;AAED,2CAA2C;AAC3C,gBAAgB,CAAC,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { editCloudpackConfig } from '../utilities/editCloudpackConfig.js';\n\n// This has no parameters, but include an empty parameter object to keep the signature consistent with other APIs\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport async function openConfigEditor(_params: ApiParams<void, never>) {\n await editCloudpackConfig();\n}\n\n// Attach a trpc procedure to the function.\nopenConfigEditor.procedure = publicProcedure.mutation(openConfigEditor);\n"]}
1
+ {"version":3,"file":"openConfigEditor.js","sourceRoot":"","sources":["../../src/apis/openConfigEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,iHAAiH;AACjH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAA+B;IACpE,MAAM,mBAAmB,EAAE,CAAC;AAC9B,CAAC;AAED,2CAA2C;AAC3C,gBAAgB,CAAC,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { editCloudpackConfig } from '../utilities/editCloudpackConfig.js';\n\n// This has no parameters, but include an empty parameter object to keep the signature consistent with other APIs\nexport async function openConfigEditor(_params: ApiParams<void, never>) {\n await editCloudpackConfig();\n}\n\n// Attach a trpc procedure to the function.\nopenConfigEditor.procedure = publicProcedure.mutation(openConfigEditor);\n"]}
@@ -7,7 +7,7 @@ import { addImportMapHash } from '@ms-cloudpack/package-utilities';
7
7
  * remotely (e.g. in the browser) and allows the user to cancel tasks.
8
8
  */
9
9
  export function createBundleTask(bundleRequest, context, options) {
10
- const { id, packageName, version, outputPath, packagePath, isExternal, packageHashes } = bundleRequest;
10
+ const { id, packageName, version, packagePath, isExternal, packageHashes } = bundleRequest;
11
11
  const { session, reporter, telemetryClient, packageImportPaths } = context;
12
12
  const { config } = session;
13
13
  return {
@@ -47,12 +47,12 @@ export function createBundleTask(bundleRequest, context, options) {
47
47
  id,
48
48
  name: `Bundle ${packageName}@${version}`,
49
49
  inputPath: packagePath || '',
50
- outputPath,
51
50
  }),
52
51
  getEndDescription: (taskResult) => ({
53
52
  id,
54
53
  errors: taskResult?.result?.errors,
55
54
  warnings: taskResult?.result?.warnings,
55
+ outputPath: bundleRequest.result?.outputPath || '',
56
56
  }),
57
57
  };
58
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAIA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKnE;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,aAA4B,EAC5B,OAKC,EACD,OAA2B;IAE3B,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IACvG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC;IAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,OAAO;QACL,IAAI,EAAE,UAAU,WAAW,IAAI,OAAO,EAAE;QACxC,EAAE;QACF,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;QACvC,KAAK,EAAE,CAAC,UAAU;QAClB,KAAK,CAAC,OAAO;YACX,MAAM,UAAU,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,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AU,EAAE,EAAE,CAChC,CAAC;YACC,EAAE;YACF,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;SACvC,CAAuB;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import type { BundleTaskOptions } from '../types/BundleTaskOptions.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport type { TaskEndDescription } from '../types/TaskEndDescription.js';\nimport path from 'path';\nimport fs from 'fs';\nimport { bundleTask } from './bundleTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { addImportMapHash } from '@ms-cloudpack/package-utilities';\nimport type { Session } from '../types/Session.js';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\nimport type { PackageImportPaths } from '@ms-cloudpack/package-utilities';\n\n/**\n * Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked\n * remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n bundleRequest: BundleRequest,\n context: {\n packageImportPaths: PackageImportPaths;\n session: Session;\n reporter?: TaskReporter;\n telemetryClient?: TelemetryClient;\n },\n options?: BundleTaskOptions,\n): Task<BundleRequest> {\n const { id, packageName, version, outputPath, packagePath, isExternal, packageHashes } = bundleRequest;\n const { session, reporter, telemetryClient, packageImportPaths } = context;\n const { config } = session;\n\n return {\n name: `Bundle ${packageName}@${version}`,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask({ bundleRequest, options, reporter, telemetryClient });\n if (config?.features?.hashPackages) {\n try {\n const hash = await packageHashes.get({ packagePath, isSourceHashingEnabled: true });\n addImportMapHash(\n { packageName, version, importMap: session.getImportMap(), resolveMap: session.resolveMap, hash },\n {\n packageImportPaths,\n },\n );\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}`, e);\n }\n }\n return bundleRequest;\n },\n clear: () => {\n if (!bundleRequest.result) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem -- this function can't be async\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: `Bundle ${packageName}@${version}`,\n inputPath: packagePath || '',\n outputPath,\n }),\n getEndDescription: (taskResult) =>\n ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n }) as TaskEndDescription,\n };\n}\n"]}
1
+ {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAIA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKnE;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,aAA4B,EAC5B,OAKC,EACD,OAA2B;IAE3B,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAC3F,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC;IAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,OAAO;QACL,IAAI,EAAE,UAAU,WAAW,IAAI,OAAO,EAAE;QACxC,EAAE;QACF,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;QACvC,KAAK,EAAE,CAAC,UAAU;QAClB,KAAK,CAAC,OAAO;YACX,MAAM,UAAU,CAA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SAC7B,CAAC;QACF,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAChC,CAAC;YACC,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,CAAuB;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import type { BundleTaskOptions } from '../types/BundleTaskOptions.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport type { TaskEndDescription } from '../types/TaskEndDescription.js';\nimport path from 'path';\nimport fs from 'fs';\nimport { bundleTask } from './bundleTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { addImportMapHash } from '@ms-cloudpack/package-utilities';\nimport type { Session } from '../types/Session.js';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\nimport type { PackageImportPaths } from '@ms-cloudpack/package-utilities';\n\n/**\n * Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked\n * remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n bundleRequest: BundleRequest,\n context: {\n packageImportPaths: PackageImportPaths;\n session: Session;\n reporter?: TaskReporter;\n telemetryClient?: TelemetryClient;\n },\n options?: BundleTaskOptions,\n): Task<BundleRequest> {\n const { id, packageName, version, packagePath, isExternal, packageHashes } = bundleRequest;\n const { session, reporter, telemetryClient, packageImportPaths } = context;\n const { config } = session;\n\n return {\n name: `Bundle ${packageName}@${version}`,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask({ bundleRequest, options, reporter, telemetryClient });\n if (config?.features?.hashPackages) {\n try {\n const hash = await packageHashes.get({ packagePath, isSourceHashingEnabled: true });\n addImportMapHash(\n { packageName, version, importMap: session.getImportMap(), resolveMap: session.resolveMap, hash },\n {\n packageImportPaths,\n },\n );\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}`, e);\n }\n }\n return bundleRequest;\n },\n clear: () => {\n if (!bundleRequest.result) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem -- this function can't be async\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: `Bundle ${packageName}@${version}`,\n inputPath: packagePath || '',\n }),\n getEndDescription: (taskResult) =>\n ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n outputPath: bundleRequest.result?.outputPath || '',\n }) as TaskEndDescription,\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.27.4",
3
+ "version": "0.27.5",
4
4
  "description": "An implementation of the API server that does interacts with a task scheduler.",
5
5
  "license": "MIT",
6
6
  "type": "module",