ppio-sandbox 2.1.0-a5 → 2.1.0-a7

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.
@@ -60,7 +60,7 @@ import createClient from "openapi-fetch";
60
60
  import platform2 from "platform";
61
61
 
62
62
  // package.json
63
- var version = "2.1.0-a5";
63
+ var version = "2.1.0-a7";
64
64
 
65
65
  // src/core/utils.ts
66
66
  import platform from "platform";
@@ -420,6 +420,10 @@ function validateDomain(domain) {
420
420
  throw new Error("Domain cannot be empty");
421
421
  }
422
422
  }
423
+ function normalizeApiUrl(apiUrl) {
424
+ if (!apiUrl) return apiUrl;
425
+ return /^[a-z][a-z\d+.-]*:\/\//i.test(apiUrl) ? apiUrl : `https://${apiUrl}`;
426
+ }
423
427
  function getDefaultApiUrl(domain, debug) {
424
428
  var _a3;
425
429
  if (debug) {
@@ -439,7 +443,7 @@ var _ConnectionConfig = class _ConnectionConfig {
439
443
  this.logger = opts == null ? void 0 : opts.logger;
440
444
  this.headers = (opts == null ? void 0 : opts.headers) || {};
441
445
  this.headers["User-Agent"] = `ppio-sandbox-sdk-js/${version}`;
442
- this.apiUrl = (opts == null ? void 0 : opts.apiUrl) || _ConnectionConfig.apiUrl || getDefaultApiUrl(this.domain, this.debug);
446
+ this.apiUrl = normalizeApiUrl(opts == null ? void 0 : opts.apiUrl) || normalizeApiUrl(_ConnectionConfig.apiUrl) || getDefaultApiUrl(this.domain, this.debug);
443
447
  this.sandboxUrl = (opts == null ? void 0 : opts.sandboxUrl) || _ConnectionConfig.sandboxUrl;
444
448
  }
445
449
  static get domain() {
@@ -6176,6 +6180,7 @@ var TemplateBase = class _TemplateBase {
6176
6180
  */
6177
6181
  static async getBuildStatus(data, options) {
6178
6182
  const config = new ConnectionConfig(options);
6183
+ raiseIfLegacy(config, "Template.getBuildStatus", BuildError);
6179
6184
  const client = new ApiClient(config);
6180
6185
  return await getBuildStatus(client, {
6181
6186
  templateID: data.templateId,
@@ -7689,12 +7694,12 @@ var PPIO = class {
7689
7694
  this.secret = new SecretNamespace(opts);
7690
7695
  this.codeInterpreter = new RuntimeSandboxNamespace(
7691
7696
  opts,
7692
- () => import("./sandbox-VMOVM5KY.mjs")
7697
+ () => import("./sandbox-E6T32R3Z.mjs")
7693
7698
  );
7694
7699
  this.code_interpreter = this.codeInterpreter;
7695
7700
  this.desktop = new RuntimeSandboxNamespace(
7696
7701
  opts,
7697
- () => import("./sandbox-7CAGPGIQ.mjs")
7702
+ () => import("./sandbox-CK3EHN3N.mjs")
7698
7703
  );
7699
7704
  }
7700
7705
  async create(templateOrOpts, opts) {
@@ -7772,4 +7777,4 @@ export {
7772
7777
  ALL_TRAFFIC,
7773
7778
  core_default
7774
7779
  };
7775
- //# sourceMappingURL=chunk-FTZEUGFE.mjs.map
7780
+ //# sourceMappingURL=chunk-GFAVCROP.mjs.map