@ms-cloudpack/api-server 0.56.16 → 0.56.17
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/syncDownload.d.ts +2 -1
- 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 +2 -1
- package/lib/apis/syncUpload.d.ts.map +1 -1
- package/lib/apis/syncUpload.js +6 -4
- package/lib/apis/syncUpload.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/SyncResult.d.ts +3 -0
- package/lib/types/SyncResult.d.ts.map +1 -0
- package/lib/types/SyncResult.js +2 -0
- package/lib/types/SyncResult.js.map +1 -0
- package/lib/utilities/getRemoteCachePromiseResultCounts.d.ts +1 -1
- package/lib/utilities/getRemoteCachePromiseResultCounts.d.ts.map +1 -1
- package/lib/utilities/getRemoteCachePromiseResultCounts.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ApiParams } from '../types/ApiParams.js';
|
|
2
2
|
import type { SyncInput } from '../types/SyncInput.js';
|
|
3
|
-
|
|
3
|
+
import type { SyncResult } from '../types/SyncResult.js';
|
|
4
|
+
export declare function syncDownload(params: ApiParams<SyncInput, 'session' | 'packages' | 'reporter' | 'telemetryClient' | 'packageHashes'>): Promise<SyncResult>;
|
|
4
5
|
//# sourceMappingURL=syncDownload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncDownload.d.ts","sourceRoot":"","sources":["../../src/apis/syncDownload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"syncDownload.d.ts","sourceRoot":"","sources":["../../src/apis/syncDownload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,iBAAiB,GAAG,eAAe,CAAC,GACtG,OAAO,CAAC,UAAU,CAAC,CA0BrB"}
|
package/lib/apis/syncDownload.js
CHANGED
|
@@ -6,7 +6,7 @@ export async function syncDownload(params) {
|
|
|
6
6
|
const { input, ctx } = params;
|
|
7
7
|
const { loginMethod } = input;
|
|
8
8
|
const { telemetryClient } = ctx;
|
|
9
|
-
await telemetryClient.tracer.startActiveSpan(PerfMeasurementSyncDownload, async (span) => {
|
|
9
|
+
return await telemetryClient.tracer.startActiveSpan(PerfMeasurementSyncDownload, async (span) => {
|
|
10
10
|
const [client, packagesToSync] = await Promise.all([
|
|
11
11
|
createRemoteCacheClient({
|
|
12
12
|
input: {
|
|
@@ -19,7 +19,9 @@ export async function syncDownload(params) {
|
|
|
19
19
|
const downloads = packagesToSync.map((pkg) => client.downloadFolder(pkg));
|
|
20
20
|
// Do not reject if there is a failure. Failed downloads will be logged in the task reporter.
|
|
21
21
|
const promiseResults = await Promise.allSettled(downloads);
|
|
22
|
-
|
|
22
|
+
const result = getRemoteCachePromiseResultCounts(promiseResults);
|
|
23
|
+
span.setAttributes(result);
|
|
24
|
+
return result;
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
// This function doesn't have an attached procedure because it's never called via the TRPC server.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncDownload.js","sourceRoot":"","sources":["../../src/apis/syncDownload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAA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MAAM,MAAM,GAAG,iCAAiC,CAAC,cAAc,CAAC,CAAC;QACjE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAE3B,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,kGAAkG","sourcesContent":["import { getPackagesToSync } from '../utilities/getPackagesToSync.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { PerfMeasurementSyncDownload } from '../performance/markers.js';\nimport { getRemoteCachePromiseResultCounts } from '../utilities/getRemoteCachePromiseResultCounts.js';\nimport { createRemoteCacheClient } from '../utilities/createRemoteCacheClient.js';\nimport type { SyncInput } from '../types/SyncInput.js';\nimport type { SyncResult } from '../types/SyncResult.js';\n\nexport async function syncDownload(\n params: ApiParams<SyncInput, 'session' | 'packages' | 'reporter' | 'telemetryClient' | 'packageHashes'>,\n): Promise<SyncResult> {\n const { input, ctx } = params;\n const { loginMethod } = input;\n const { telemetryClient } = ctx;\n\n return await telemetryClient.tracer.startActiveSpan(PerfMeasurementSyncDownload, async (span) => {\n const [client, packagesToSync] = await Promise.all([\n createRemoteCacheClient({\n input: {\n loginMethod,\n },\n ctx,\n }),\n getPackagesToSync(ctx),\n ]);\n\n const downloads = packagesToSync.map((pkg) => client.downloadFolder(pkg));\n\n // Do not reject if there is a failure. Failed downloads will be logged in the task reporter.\n const promiseResults = await Promise.allSettled(downloads);\n\n const result = getRemoteCachePromiseResultCounts(promiseResults);\n span.setAttributes(result);\n\n return result;\n });\n}\n\n// This function doesn't have an attached procedure because it's never called via the TRPC server.\n"]}
|
package/lib/apis/syncUpload.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ApiParams } from '../types/ApiParams.js';
|
|
2
2
|
import type { SyncInput } from '../types/SyncInput.js';
|
|
3
|
-
|
|
3
|
+
import type { SyncResult } from '../types/SyncResult.js';
|
|
4
|
+
export declare function syncUpload(params: ApiParams<SyncInput, 'session' | 'packages' | 'reporter' | 'bus' | 'taskRunner' | 'watcher' | 'telemetryClient' | 'packageImportPaths' | 'packageHashes'>): Promise<SyncResult>;
|
|
4
5
|
//# sourceMappingURL=syncUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncUpload.d.ts","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"syncUpload.d.ts","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,wBAAsB,UAAU,CAC9B,MAAM,EAAE,SAAS,CACf,SAAS,EACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,KAAK,GACL,YAAY,GACZ,SAAS,GACT,iBAAiB,GACjB,oBAAoB,GACpB,eAAe,CAClB,GACA,OAAO,CAAC,UAAU,CAAC,CAsErB"}
|
package/lib/apis/syncUpload.js
CHANGED
|
@@ -18,9 +18,9 @@ export async function syncUpload(params) {
|
|
|
18
18
|
const syncInternalPackages = config?.features?.syncInternalPackages ?? false;
|
|
19
19
|
// Glob pattern for the files to upload.
|
|
20
20
|
const globMatches = ['**/*', '!**/*-input.json', '!**/*-output.json'];
|
|
21
|
-
await telemetryClient.tracer.startActiveSpan(PerfMeasurementSyncUpload, async (span) => {
|
|
21
|
+
return await telemetryClient.tracer.startActiveSpan(PerfMeasurementSyncUpload, async (span) => {
|
|
22
22
|
const { name, version } = await ctx.packages.get(appPath);
|
|
23
|
-
const [client, { dependencies, result }] = await Promise.all([
|
|
23
|
+
const [client, { dependencies, result: bundleResult }] = await Promise.all([
|
|
24
24
|
createRemoteCacheClient({
|
|
25
25
|
input: {
|
|
26
26
|
loginMethod,
|
|
@@ -36,7 +36,7 @@ export async function syncUpload(params) {
|
|
|
36
36
|
ctx,
|
|
37
37
|
}),
|
|
38
38
|
]);
|
|
39
|
-
const bundledPackages = [
|
|
39
|
+
const bundledPackages = [bundleResult, ...(await dependencies)];
|
|
40
40
|
const packagesToUpload = await Promise.all(bundledPackages
|
|
41
41
|
.filter((p) => p.inputPath && (p.isExternal || syncInternalPackages))
|
|
42
42
|
.map((p) => createRemoteCacheClientOperationOptions(
|
|
@@ -58,7 +58,9 @@ export async function syncUpload(params) {
|
|
|
58
58
|
const uploads = packagesToUpload.map((pkg) => taskRunner.add(createUploadTask({ client, options: { ...pkg, globMatches } })));
|
|
59
59
|
// Do not reject if there is a failure. Failed uploads will be logged in the task reporter.
|
|
60
60
|
const promiseResults = await Promise.allSettled(uploads);
|
|
61
|
-
|
|
61
|
+
const result = getRemoteCachePromiseResultCounts(promiseResults);
|
|
62
|
+
span.setAttributes(result);
|
|
63
|
+
return result;
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
// This function doesn't have an attached procedure because it's never called via the TRPC server.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncUpload.js","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,iCAAiC,EAAE,MAAM,mDAAmD,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,uCAAuC,EAAE,MAAM,yDAAyD,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,O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["import { ensurePackageBundled } from './ensurePackageBundled.js';\nimport { PerfMeasurementSyncUpload } from '../performance/markers.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { getRemoteCachePromiseResultCounts } from '../utilities/getRemoteCachePromiseResultCounts.js';\nimport { createRemoteCacheClient } from '../utilities/createRemoteCacheClient.js';\nimport { createRemoteCacheClientOperationOptions } from '../utilities/createRemoteCacheClientOperationOptions.js';\nimport { createUploadTask } from '../utilities/createUploadTask.js';\nimport type { SyncInput } from '../types/SyncInput.js';\nimport { isStaticRoute } from '@ms-cloudpack/common-types';\nimport path from 'path';\nimport { getBundleLocation } from '../utilities/getBundleLocation.js';\nimport { cp } from 'fs/promises';\nimport objectHash from 'object-hash';\nimport type { SyncResult } from '../types/SyncResult.js';\n\nexport async function syncUpload(\n params: ApiParams<\n SyncInput,\n | 'session'\n | 'packages'\n | 'reporter'\n | 'bus'\n | 'taskRunner'\n | 'watcher'\n | 'telemetryClient'\n | 'packageImportPaths'\n | 'packageHashes'\n >,\n): Promise<SyncResult> {\n const { ctx, input } = params;\n const { session, telemetryClient, taskRunner } = ctx;\n const { config } = session;\n const { appPath } = config;\n const { loginMethod } = input;\n const syncInternalPackages = config?.features?.syncInternalPackages ?? false;\n\n // Glob pattern for the files to upload.\n const globMatches = ['**/*', '!**/*-input.json', '!**/*-output.json'];\n\n return await telemetryClient.tracer.startActiveSpan(PerfMeasurementSyncUpload, async (span) => {\n const { name, version } = await ctx.packages.get(appPath);\n\n const [client, { dependencies, result: bundleResult }] = await Promise.all([\n createRemoteCacheClient({\n input: {\n loginMethod,\n },\n ctx,\n }),\n ensurePackageBundled({\n input: {\n name,\n version,\n enqueueDependencies: true,\n },\n ctx,\n }),\n ]);\n\n const bundledPackages = [bundleResult, ...(await dependencies)];\n const packagesToUpload = await Promise.all(\n bundledPackages\n .filter((p) => p.inputPath && (p.isExternal || syncInternalPackages))\n .map((p) =>\n createRemoteCacheClientOperationOptions(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- verified above that it's set\n { packagePath: p.inputPath!, packageName: p.name, packageVersion: p.version },\n ctx,\n ),\n ),\n );\n\n if (config.features?.enableCloudHosted) {\n const appOutputPath = (await getBundleLocation({ packagePath: appPath }, ctx)).path;\n const destinationFolder = path.join(appOutputPath, '__cloudpack');\n const routesPath = path.join(destinationFolder, 'routes');\n for (const route of config.routes ?? []) {\n if (isStaticRoute(route)) {\n const staticPath = path.resolve(appPath, route.staticPath);\n const routeHash = objectHash(route);\n const folderPath = path.join(routesPath, routeHash);\n await cp(staticPath, path.join(folderPath, staticPath), { recursive: true });\n }\n }\n }\n\n const uploads = packagesToUpload.map((pkg) =>\n taskRunner.add(createUploadTask({ client, options: { ...pkg, globMatches } })),\n );\n\n // Do not reject if there is a failure. Failed uploads will be logged in the task reporter.\n const promiseResults = await Promise.allSettled(uploads);\n\n const result = getRemoteCachePromiseResultCounts(promiseResults);\n span.setAttributes(result);\n\n return result;\n });\n}\n\n// This function doesn't have an attached procedure because it's never called via the TRPC server.\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -21,4 +21,5 @@ export { addPackageOverride } from './apis/addPackageOverride.js';
|
|
|
21
21
|
export { ensurePackageBundled } from './apis/ensurePackageBundled.js';
|
|
22
22
|
export { syncDownload } from './apis/syncDownload.js';
|
|
23
23
|
export { syncUpload } from './apis/syncUpload.js';
|
|
24
|
+
export type { SyncResult } from './types/SyncResult.js';
|
|
24
25
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9F,YAAY,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAA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,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,uBAAuB,EAA8B,MAAM,qCAAqC,CAAC;AAE1G,iDAAiD;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export type { Context, PartialContext } from './types/Context.js';\nexport type { BundleInfo, BundleEntryInfo, BundleEntryConsumes } from './types/BundleInfo.js';\nexport type { Session } from '@ms-cloudpack/common-types';\nexport type { TaskStats } from './types/TaskStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { EnsurePackageBundledContext } from './apis/ensurePackageBundled.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport { errorEntrySource } from './data/busSources.js';\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer, type CloudpackServer } from './trpc/createCloudpackServer.js';\nexport { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';\nexport { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\n\n// Utilities\nexport { createPartialApiContext, type LazyApiContextOptions } from './common/createPartialApiContext.js';\n\n// API methods directly used outside this package\nexport { addPackageOverride } from './apis/addPackageOverride.js';\nexport { ensurePackageBundled } from './apis/ensurePackageBundled.js';\nexport { syncDownload } from './apis/syncDownload.js';\nexport { syncUpload } from './apis/syncUpload.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,uBAAuB,EAA8B,MAAM,qCAAqC,CAAC;AAE1G,iDAAiD;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export type { Context, PartialContext } from './types/Context.js';\nexport type { BundleInfo, BundleEntryInfo, BundleEntryConsumes } from './types/BundleInfo.js';\nexport type { Session } from '@ms-cloudpack/common-types';\nexport type { TaskStats } from './types/TaskStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { EnsurePackageBundledContext } from './apis/ensurePackageBundled.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport { errorEntrySource } from './data/busSources.js';\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer, type CloudpackServer } from './trpc/createCloudpackServer.js';\nexport { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';\nexport { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\n\n// Utilities\nexport { createPartialApiContext, type LazyApiContextOptions } from './common/createPartialApiContext.js';\n\n// API methods directly used outside this package\nexport { addPackageOverride } from './apis/addPackageOverride.js';\nexport { ensurePackageBundled } from './apis/ensurePackageBundled.js';\nexport { syncDownload } from './apis/syncDownload.js';\nexport { syncUpload } from './apis/syncUpload.js';\nexport type { SyncResult } from './types/SyncResult.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncResult.d.ts","sourceRoot":"","sources":["../../src/types/SyncResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAEnF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,gCAAgC,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncResult.js","sourceRoot":"","sources":["../../src/types/SyncResult.ts"],"names":[],"mappings":"","sourcesContent":["import type { RemoteCacheClientOperationResult } from '@ms-cloudpack/remote-cache';\n\nexport type SyncResult = Record<RemoteCacheClientOperationResult | 'failed', number>;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RemoteCacheClientOperationResult } from '@ms-cloudpack/remote-cache';
|
|
2
|
-
export declare function getRemoteCachePromiseResultCounts(promiseResults: PromiseSettledResult<RemoteCacheClientOperationResult>[]): Record<RemoteCacheClientOperationResult |
|
|
2
|
+
export declare function getRemoteCachePromiseResultCounts(promiseResults: PromiseSettledResult<RemoteCacheClientOperationResult>[]): Record<RemoteCacheClientOperationResult | 'failed', number>;
|
|
3
3
|
//# sourceMappingURL=getRemoteCachePromiseResultCounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRemoteCachePromiseResultCounts.d.ts","sourceRoot":"","sources":["../../src/utilities/getRemoteCachePromiseResultCounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAMnF,wBAAgB,iCAAiC,CAC/C,cAAc,EAAE,oBAAoB,CAAC,gCAAgC,CAAC,EAAE
|
|
1
|
+
{"version":3,"file":"getRemoteCachePromiseResultCounts.d.ts","sourceRoot":"","sources":["../../src/utilities/getRemoteCachePromiseResultCounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAMnF,wBAAgB,iCAAiC,CAC/C,cAAc,EAAE,oBAAoB,CAAC,gCAAgC,CAAC,EAAE,GACvE,MAAM,CAAC,gCAAgC,GAAG,QAAQ,EAAE,MAAM,CAAC,CAiB7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRemoteCachePromiseResultCounts.js","sourceRoot":"","sources":["../../src/utilities/getRemoteCachePromiseResultCounts.ts"],"names":[],"mappings":"AAEA,SAAS,WAAW,CAAI,MAA+B;IACrD,OAAO,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,cAAwE;IAExE,MAAM,MAAM,GAAgE;QAC1E,eAAe,EAAE,CAAC;QAClB,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC;KACV,CAAC;IAEF,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,IAAI,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { RemoteCacheClientOperationResult } from '@ms-cloudpack/remote-cache';\n\nfunction isFulfilled<T>(result: PromiseSettledResult<T>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled';\n}\n\nexport function getRemoteCachePromiseResultCounts(\n promiseResults: PromiseSettledResult<RemoteCacheClientOperationResult>[],\n) {\n const counts: Record<RemoteCacheClientOperationResult | 'failed', number> = {\n 'already-exist': 0,\n 'not-found': 0,\n success: 0,\n failed: 0,\n };\n\n for (const promiseResult of promiseResults) {\n if (isFulfilled(promiseResult)) {\n counts[promiseResult.value]++;\n } else {\n counts.failed++;\n }\n }\n\n return counts;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getRemoteCachePromiseResultCounts.js","sourceRoot":"","sources":["../../src/utilities/getRemoteCachePromiseResultCounts.ts"],"names":[],"mappings":"AAEA,SAAS,WAAW,CAAI,MAA+B;IACrD,OAAO,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,cAAwE;IAExE,MAAM,MAAM,GAAgE;QAC1E,eAAe,EAAE,CAAC;QAClB,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC;KACV,CAAC;IAEF,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,IAAI,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { RemoteCacheClientOperationResult } from '@ms-cloudpack/remote-cache';\n\nfunction isFulfilled<T>(result: PromiseSettledResult<T>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled';\n}\n\nexport function getRemoteCachePromiseResultCounts(\n promiseResults: PromiseSettledResult<RemoteCacheClientOperationResult>[],\n): Record<RemoteCacheClientOperationResult | 'failed', number> {\n const counts: Record<RemoteCacheClientOperationResult | 'failed', number> = {\n 'already-exist': 0,\n 'not-found': 0,\n success: 0,\n failed: 0,\n };\n\n for (const promiseResult of promiseResults) {\n if (isFulfilled(promiseResult)) {\n counts[promiseResult.value]++;\n } else {\n counts.failed++;\n }\n }\n\n return counts;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/api-server",
|
|
3
|
-
"version": "0.56.
|
|
3
|
+
"version": "0.56.17",
|
|
4
4
|
"description": "An implementation of the API server that does interacts with a task scheduler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"@lage-run/logger": "^1.3.0",
|
|
28
28
|
"@lage-run/scheduler": "^1.2.1",
|
|
29
29
|
"@lage-run/target-graph": "^0.9.0",
|
|
30
|
-
"@ms-cloudpack/bundler": "^0.23.
|
|
30
|
+
"@ms-cloudpack/bundler": "^0.23.26",
|
|
31
31
|
"@ms-cloudpack/common-types": "^0.23.7",
|
|
32
32
|
"@ms-cloudpack/config": "^0.33.4",
|
|
33
33
|
"@ms-cloudpack/create-express-app": "^1.10.10",
|
|
34
34
|
"@ms-cloudpack/data-bus": "^0.4.3",
|
|
35
|
-
"@ms-cloudpack/esm-stub-utilities": "^0.13.
|
|
35
|
+
"@ms-cloudpack/esm-stub-utilities": "^0.13.22",
|
|
36
36
|
"@ms-cloudpack/file-watcher": "^0.1.3",
|
|
37
37
|
"@ms-cloudpack/import-map": "^0.8.19",
|
|
38
38
|
"@ms-cloudpack/json-utilities": "^0.1.9",
|