@salesforce/core 8.32.4 → 8.32.6-eca.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.
@@ -1,4 +1,4 @@
1
- import { type Logger as PinoLogger } from 'pino';
1
+ import { type Logger as PinoLogger, pino } from 'pino';
2
2
  /**
3
3
  * The common set of `Logger` options.
4
4
  */
@@ -258,4 +258,6 @@ export declare class Logger {
258
258
  */
259
259
  fatal(...args: unknown[]): Logger;
260
260
  }
261
+ /** return various streams that the logger could send data to, depending on the options and env */
262
+ export declare const getWriteStream: (level?: string) => pino.TransportSingleOptions;
261
263
  export declare const computeLevel: (optionsLevel?: number | string) => string;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.computeLevel = exports.Logger = exports.LoggerLevel = void 0;
26
+ exports.computeLevel = exports.getWriteStream = exports.Logger = exports.LoggerLevel = void 0;
27
27
  /*
28
28
  * Copyright (c) 2020, salesforce.com, inc.
29
29
  * All rights reserved.
@@ -148,7 +148,7 @@ class Logger {
148
148
  {
149
149
  target: path.join('..', '..', 'lib', 'logger', 'transformStream'),
150
150
  },
151
- getWriteStream(level),
151
+ (0, exports.getWriteStream)(level),
152
152
  ],
153
153
  },
154
154
  });
@@ -411,16 +411,20 @@ const getWriteStream = (level = 'warn') => {
411
411
  ['1d', new Date().toISOString().split('T')[0]],
412
412
  ]);
413
413
  const logRotationPeriod = env.getString('SF_LOG_ROTATION_PERIOD') ?? '1d';
414
+ if (logRotationPeriod && !rotator.has(logRotationPeriod)) {
415
+ process.stderr.write(`Warning: Unrecognized SF_LOG_ROTATION_PERIOD value "${logRotationPeriod}". Expected 1m, 1h, or 1d. Falling back to 1d.\n`);
416
+ }
414
417
  return {
415
418
  // write to a rotating file
416
419
  target: 'pino/file',
417
420
  options: {
418
- destination: path.join(global_1.Global.SF_DIR, `sf-${(0, ts_types_1.ensureString)(rotator.get(logRotationPeriod)) ?? rotator.get('1d')}.log`),
421
+ destination: path.join(global_1.Global.SF_DIR, `sf-${rotator.get(logRotationPeriod) ?? rotator.get('1d')}.log`),
419
422
  mkdir: true,
420
423
  level,
421
424
  },
422
425
  };
423
426
  };
427
+ exports.getWriteStream = getWriteStream;
424
428
  const computeLevel = (optionsLevel) => {
425
429
  const env = new kit_1.Env();
426
430
  const envValue = isNaN(env.getNumber('SF_LOG_LEVEL') ?? NaN)
@@ -151,11 +151,11 @@ const generateScratchOrgInfo = async ({ hubOrg, scratchOrgInfoPayload, nonamespa
151
151
  return {
152
152
  ...payload,
153
153
  orgName: scratchOrgInfoPayload.orgName ?? 'Company',
154
- // we already have the info, and want to get rid of configApi, so this doesn't use that
155
- connectedAppCallbackUrl: `http://localhost:${await webOAuthServer_1.WebOAuthServer.determineOauthPort()}/OauthRedirect`,
154
+ connectedAppCallbackUrl: process.env.SF_SCRATCH_SIGNUP_CALLBACK_URL ??
155
+ `http://localhost:${await webOAuthServer_1.WebOAuthServer.determineOauthPort()}/OauthRedirect`,
156
156
  ...(!nonamespace && namespace ? { namespace } : {}),
157
- // Use the Hub org's client ID value, if one wasn't provided to us, or the default
158
157
  connectedAppConsumerKey: scratchOrgInfoPayload.connectedAppConsumerKey ??
158
+ process.env.SF_SCRATCH_SIGNUP_CONNECTED_APP ??
159
159
  hubOrg.getConnection().getAuthInfoFields().clientId ??
160
160
  authInfo_1.DEFAULT_CONNECTED_APP_INFO.clientId,
161
161
  package2AncestorIds: !ignoreAncestorIds && sfProject?.hasPackages()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "8.32.4",
3
+ "version": "8.32.6-eca.0",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",