matchlock-sdk 0.2.7 → 0.2.9

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/builder.d.ts CHANGED
@@ -21,6 +21,7 @@ export declare class Sandbox {
21
21
  allowPrivateIPs(): Sandbox;
22
22
  unsetBlockPrivateIPs(): Sandbox;
23
23
  addSecret(name: string, value: string, ...hosts: string[]): Sandbox;
24
+ addSecretWithPlaceholder(name: string, value: string, placeholder: string, ...hosts: string[]): Sandbox;
24
25
  withDNSServers(...servers: string[]): Sandbox;
25
26
  withHostname(hostname: string): Sandbox;
26
27
  withNetworkMTU(mtu: number): Sandbox;
package/dist/builder.js CHANGED
@@ -150,6 +150,12 @@ class Sandbox {
150
150
  this.opts.secrets.push(secret);
151
151
  return this;
152
152
  }
153
+ addSecretWithPlaceholder(name, value, placeholder, ...hosts) {
154
+ this.opts.secrets = this.opts.secrets ?? [];
155
+ const secret = { name, value, placeholder, hosts };
156
+ this.opts.secrets.push(secret);
157
+ return this;
158
+ }
153
159
  withDNSServers(...servers) {
154
160
  this.opts.dnsServers = this.opts.dnsServers ?? [];
155
161
  this.opts.dnsServers.push(...servers);
@@ -165,10 +165,14 @@ function buildCreateNetworkParams(opts, wireInterception) {
165
165
  if (hasSecrets) {
166
166
  const secrets = {};
167
167
  for (const secret of opts.secrets ?? []) {
168
- secrets[secret.name] = {
168
+ const wireSecret = {
169
169
  value: secret.value,
170
170
  hosts: secret.hosts ?? [],
171
171
  };
172
+ if (secret.placeholder) {
173
+ wireSecret.placeholder = secret.placeholder;
174
+ }
175
+ secrets[secret.name] = wireSecret;
172
176
  }
173
177
  network.secrets = secrets;
174
178
  }
package/dist/types.d.ts CHANGED
@@ -45,6 +45,7 @@ export interface MountConfig {
45
45
  export interface Secret {
46
46
  name: string;
47
47
  value: string;
48
+ placeholder?: string;
48
49
  hosts?: string[];
49
50
  }
50
51
  export interface ImageConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matchlock-sdk",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "TypeScript SDK for Matchlock sandboxes",
5
5
  "license": "MIT",
6
6
  "repository": {