@ms-cloudpack/api-server 0.61.17 → 0.61.18
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/common/createApiContext.d.ts.map +1 -1
- package/lib/common/createApiContext.js +6 -3
- package/lib/common/createApiContext.js.map +1 -1
- package/package.json +14 -14
- package/lib/utilities/createRemoteCacheClient.d.ts +0 -10
- package/lib/utilities/createRemoteCacheClient.d.ts.map +0 -1
- package/lib/utilities/createRemoteCacheClient.js +0 -22
- package/lib/utilities/createRemoteCacheClient.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApiContext.d.ts","sourceRoot":"","sources":["../../src/common/createApiContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"createApiContext.d.ts","sourceRoot":"","sources":["../../src/common/createApiContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,MAAM,WAAW,uBACf,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,iBAAiB,GAAG,YAAY,CAAC;IAC9D;;;OAGG;IACH,4BAA4B,CAAC,EAAE,WAAW,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC,CA6BvD;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBzF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createRemoteCacheClient } from '../utilities/createRemoteCacheClient.js';
|
|
2
1
|
import { createPackageDefinitions } from '@ms-cloudpack/config';
|
|
3
2
|
/**
|
|
4
3
|
* Asynchronously initialize a partial `Context`, encapsulating async importing of certain modules
|
|
@@ -20,8 +19,12 @@ export function createPartialApiContext(options) {
|
|
|
20
19
|
context: { config, packages, resolveMap: session.resolveMap },
|
|
21
20
|
});
|
|
22
21
|
let remoteCacheClient;
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const remoteCacheConfig = session.config.remoteCache;
|
|
23
|
+
if (remoteCacheClientLoginMethod && remoteCacheConfig) {
|
|
24
|
+
remoteCacheClient = await import('@ms-cloudpack/remote-cache').then(({ createRemoteCacheClient }) => createRemoteCacheClient({
|
|
25
|
+
context: { reporter, telemetryClient },
|
|
26
|
+
options: { cachePath: session.cachePath, loginMethod: remoteCacheClientLoginMethod, ...remoteCacheConfig },
|
|
27
|
+
}));
|
|
25
28
|
}
|
|
26
29
|
return { reporter, taskRunner, telemetryClient, packageHashes, packages, session, remoteCacheClient };
|
|
27
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApiContext.js","sourceRoot":"","sources":["../../src/common/createApiContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"createApiContext.js","sourceRoot":"","sources":["../../src/common/createApiContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAYhE;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAgC;IAEhC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,4BAA4B,EAAE,GAAG,OAAO,CAAC;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;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAgC;IACrE,OAAO,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QACrF,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAEvD,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,aAAa,CAAC;YAC5B,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SAChF,CAAC,CAAC;QAEH,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;QACjE,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;QAC5B,6CAA6C;QAC7C,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAErC,OAAO;YACL,GAAG,OAAO;YACV,GAAG;YACH,OAAO;YACP,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;SACjC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Context } from '../types/Context.js';\nimport type { CreateSessionOptions } from './createSession.js';\nimport type { LoginMethod } from '@ms-cloudpack/remote-cache';\nimport { createPackageDefinitions } from '@ms-cloudpack/config';\n\nexport interface CreateApiContextOptions\n extends CreateSessionOptions,\n Pick<Context, 'reporter' | 'telemetryClient' | 'taskRunner'> {\n /**\n * Login method for the remote cache.\n * If this isn't provided, `context.remoteCacheClient` will not be set.\n */\n remoteCacheClientLoginMethod?: LoginMethod;\n}\n\n/**\n * Asynchronously initialize a partial `Context`, encapsulating async importing of certain modules\n * to speed up boot time.\n *\n * This version skips some properties that are only needed for starting an app.\n * For a full context, use `createApiContext`.\n */\nexport function createPartialApiContext(\n options: CreateApiContextOptions,\n): Promise<Omit<Context, 'bus' | 'watcher' | 'dispose'>> {\n const { reporter, taskRunner, telemetryClient, config, remoteCacheClientLoginMethod } = options;\n\n return telemetryClient.tracer.startActiveSpan('CREATE_PARTIAL_API_CONTEXT', async () => {\n // Start by creating the properties that are always used\n const packages = createPackageDefinitions({ config });\n\n const { createSession } = await import('./createSession.js');\n const session = await createSession(options, { reporter, packages, telemetryClient });\n\n const { PackageHashes } = await import('@ms-cloudpack/package-hashes');\n const packageHashes = new PackageHashes({\n cwd: config.appPath,\n context: { config, packages, resolveMap: session.resolveMap },\n });\n\n let remoteCacheClient: Context['remoteCacheClient'] | undefined;\n const remoteCacheConfig = session.config.remoteCache;\n if (remoteCacheClientLoginMethod && remoteCacheConfig) {\n remoteCacheClient = await import('@ms-cloudpack/remote-cache').then(({ createRemoteCacheClient }) =>\n createRemoteCacheClient({\n context: { reporter, telemetryClient },\n options: { cachePath: session.cachePath, loginMethod: remoteCacheClientLoginMethod, ...remoteCacheConfig },\n }),\n );\n }\n\n return { reporter, taskRunner, telemetryClient, packageHashes, packages, session, remoteCacheClient };\n });\n}\n\n/**\n * Asynchronously initialize a `Context`, encapsulating async importing of certain packages/modules\n * to speed up boot time.\n *\n * When finished with the context, call `dispose` to clean up resources.\n *\n * NOTE: This version initializes the data bus and the file watcher, which are only needed when\n * starting a server (and add unnecessary overhead otherwise). For other commands, use\n * `createPartialApiContext`.\n */\nexport async function createApiContext(options: CreateApiContextOptions): Promise<Context> {\n return options.telemetryClient.tracer.startActiveSpan('CREATE_API_CONTEXT', async () => {\n const context = await createPartialApiContext(options);\n\n const { createWatcher } = await import('@ms-cloudpack/file-watcher');\n const watcher = createWatcher({\n type: context.session.config.features?.enableWatcherInFork ? 'fork' : 'default',\n });\n\n const { createDataBus } = await import('@ms-cloudpack/data-bus');\n const bus = createDataBus();\n // Without this line, the overlay won't work.\n context.taskRunner.connectToBus(bus);\n\n return {\n ...context,\n bus,\n watcher,\n dispose: () => watcher.dispose(),\n };\n });\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/api-server",
|
|
3
|
-
"version": "0.61.
|
|
3
|
+
"version": "0.61.18",
|
|
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,25 +27,25 @@
|
|
|
27
27
|
"@lage-run/logger": "^1.3.0",
|
|
28
28
|
"@lage-run/scheduler": "^1.2.1",
|
|
29
29
|
"@lage-run/target-graph": "^0.11.0",
|
|
30
|
-
"@ms-cloudpack/bundler": "^0.24.
|
|
31
|
-
"@ms-cloudpack/common-types": "^0.24.
|
|
32
|
-
"@ms-cloudpack/config": "^0.33.
|
|
33
|
-
"@ms-cloudpack/create-express-app": "^1.10.
|
|
30
|
+
"@ms-cloudpack/bundler": "^0.24.14",
|
|
31
|
+
"@ms-cloudpack/common-types": "^0.24.12",
|
|
32
|
+
"@ms-cloudpack/config": "^0.33.24",
|
|
33
|
+
"@ms-cloudpack/create-express-app": "^1.10.24",
|
|
34
34
|
"@ms-cloudpack/data-bus": "^0.4.3",
|
|
35
35
|
"@ms-cloudpack/environment": "^0.1.1",
|
|
36
|
-
"@ms-cloudpack/esm-stub-utilities": "^0.14.
|
|
36
|
+
"@ms-cloudpack/esm-stub-utilities": "^0.14.16",
|
|
37
37
|
"@ms-cloudpack/file-watcher": "^0.2.0",
|
|
38
|
-
"@ms-cloudpack/import-map": "^0.10.
|
|
38
|
+
"@ms-cloudpack/import-map": "^0.10.6",
|
|
39
39
|
"@ms-cloudpack/json-utilities": "^0.1.10",
|
|
40
|
-
"@ms-cloudpack/package-hashes": "^0.7.
|
|
41
|
-
"@ms-cloudpack/package-utilities": "^12.0.
|
|
40
|
+
"@ms-cloudpack/package-hashes": "^0.7.36",
|
|
41
|
+
"@ms-cloudpack/package-utilities": "^12.0.3",
|
|
42
42
|
"@ms-cloudpack/path-string-parsing": "^1.2.6",
|
|
43
|
-
"@ms-cloudpack/path-utilities": "^3.0.
|
|
44
|
-
"@ms-cloudpack/remote-cache": "^0.10.
|
|
43
|
+
"@ms-cloudpack/path-utilities": "^3.0.9",
|
|
44
|
+
"@ms-cloudpack/remote-cache": "^0.10.23",
|
|
45
45
|
"@ms-cloudpack/task-reporter": "^0.16.0",
|
|
46
|
-
"@ms-cloudpack/telemetry": "^0.11.
|
|
47
|
-
"@trpc/client": "11.0.1",
|
|
48
|
-
"@trpc/server": "11.0.1",
|
|
46
|
+
"@ms-cloudpack/telemetry": "^0.11.5",
|
|
47
|
+
"@trpc/client": "^11.0.1",
|
|
48
|
+
"@trpc/server": "^11.0.1",
|
|
49
49
|
"cors": "^2.8.5",
|
|
50
50
|
"es-module-lexer": "^1.4.1",
|
|
51
51
|
"filenamify": "^6.0.0",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { LoginMethod, RemoteCacheClient } from '@ms-cloudpack/remote-cache';
|
|
2
|
-
import type { PartialContext } from '../types/Context.js';
|
|
3
|
-
/**
|
|
4
|
-
* Lazy loads the remote cache client and returns it.
|
|
5
|
-
* @returns - The remote cache client if it is configured, otherwise undefined.
|
|
6
|
-
*/
|
|
7
|
-
export declare function createRemoteCacheClient(options: {
|
|
8
|
-
loginMethod: LoginMethod;
|
|
9
|
-
}, context: PartialContext<'reporter' | 'telemetryClient', 'cachePath' | 'config'>): Promise<RemoteCacheClient | undefined>;
|
|
10
|
-
//# sourceMappingURL=createRemoteCacheClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lazy loads the remote cache client and returns it.
|
|
3
|
-
* @returns - The remote cache client if it is configured, otherwise undefined.
|
|
4
|
-
*/
|
|
5
|
-
export async function createRemoteCacheClient(options, context) {
|
|
6
|
-
const { loginMethod } = options;
|
|
7
|
-
const { session, reporter, telemetryClient } = context;
|
|
8
|
-
if (!session.config.remoteCache) {
|
|
9
|
-
// Remote cache is not configured, return undefined.
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
const { container, storageAccount, tenantId } = session.config.remoteCache;
|
|
13
|
-
return telemetryClient.tracer.startActiveSpan('CREATE_REMOTE_CACHE_CLIENT', async () => {
|
|
14
|
-
const remoteCacheModule = await import('@ms-cloudpack/remote-cache');
|
|
15
|
-
const client = await remoteCacheModule.createRemoteCacheClient({
|
|
16
|
-
context: { reporter, telemetryClient },
|
|
17
|
-
options: { container, loginMethod, storageAccount, cachePath: session.cachePath, tenantId },
|
|
18
|
-
});
|
|
19
|
-
return client;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=createRemoteCacheClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|