@cloudflare/deploy-helpers 0.23.0 → 0.24.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/dist/index.d.mts CHANGED
@@ -465,6 +465,7 @@ declare function getConfigPatch(configDiff: {
465
465
  nonDestructive: boolean;
466
466
  }["diff"], targetEnvironment?: string | undefined): RawConfig;
467
467
 
468
+ type DotEnvParser = (contents: string) => Record<string, string>;
468
469
  declare function validateFileSecrets(content: unknown, jsonFilePath: string): content is Record<string, string | null>;
469
470
  /** Error thrown when no input is provided to parseBulkInputToObject */
470
471
  declare class NoInputError extends Error {
@@ -482,10 +483,18 @@ type BulkInputNullableResult = {
482
483
  secretSource: "file" | "stdin";
483
484
  secretFormat: "json" | "dotenv";
484
485
  };
485
- /** Override for callers that need non-nullable */
486
- declare function parseBulkInputToObject(input?: string, includeNull?: false): Promise<BulkInputResult | undefined>;
486
+ /**
487
+ * Parses JSON or dotenv secrets from a file or stdin, excluding null values.
488
+ *
489
+ * @param input The file path, or `undefined` to read stdin.
490
+ * @param includeNull Whether to retain null values from JSON input.
491
+ * @param parseDotEnv The dotenv parser. Defaults to literal parsing; callers using
492
+ * `--secrets-file` can supply `parseAndExpandDotEnv` to opt into expansion.
493
+ * @returns Parsed secrets and input metadata, or `undefined` if stdin is invalid.
494
+ */
495
+ declare function parseBulkInputToObject(input?: string, includeNull?: false, parseDotEnv?: DotEnvParser): Promise<BulkInputResult | undefined>;
487
496
  /** Override for callers that need nullable */
488
- declare function parseBulkInputToObject(input?: string, includeNull?: true): Promise<BulkInputNullableResult | undefined>;
497
+ declare function parseBulkInputToObject(input?: string, includeNull?: true, parseDotEnv?: DotEnvParser): Promise<BulkInputNullableResult | undefined>;
489
498
 
490
499
  declare function handleUnsafeCapnp(capnp: CfCapnp): Buffer;
491
500