@watasu/sdk 0.1.50 → 0.1.53

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/volume.js CHANGED
@@ -10,21 +10,41 @@ export var VolumeFileType;
10
10
  VolumeFileType["DIRECTORY"] = "directory";
11
11
  VolumeFileType["SYMLINK"] = "symlink";
12
12
  })(VolumeFileType || (VolumeFileType = {}));
13
- export const VolumeConnectionConfig = ConnectionConfig;
13
+ export class VolumeConnectionConfig extends ConnectionConfig {
14
+ token;
15
+ constructor(volume, opts = {}) {
16
+ super(opts);
17
+ this.token = volume.token;
18
+ }
19
+ }
14
20
  /** Persistent volume that can be mounted into sandboxes and edited while detached. */
15
21
  export class Volume {
16
22
  volumeId;
17
23
  id;
18
24
  name;
19
25
  token;
26
+ domain;
27
+ debug;
28
+ proxy;
20
29
  config;
21
30
  control;
22
- constructor(opts) {
31
+ constructor(volumeOrOpts, name, token, domain, debug, proxy) {
32
+ const opts = typeof volumeOrOpts === 'string'
33
+ ? {
34
+ volumeId: volumeOrOpts,
35
+ name,
36
+ token,
37
+ connectionConfig: new ConnectionConfig({ domain, debug, proxy }),
38
+ }
39
+ : volumeOrOpts;
23
40
  this.volumeId = String(opts.volumeId);
24
41
  this.id = this.volumeId;
25
42
  this.name = opts.name ?? this.volumeId;
26
43
  this.token = opts.token;
27
44
  this.config = opts.connectionConfig;
45
+ this.domain = this.config.domain;
46
+ this.debug = this.config.debug;
47
+ this.proxy = this.config.proxy;
28
48
  this.control = opts.control ?? new ControlClient(this.config);
29
49
  }
30
50
  /** Create a persistent volume and return a connected SDK object. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@watasu/sdk",
3
- "version": "0.1.50",
3
+ "version": "0.1.53",
4
4
  "type": "module",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "description": "TypeScript SDK for Watasu",