@fastgpt-sdk/sandbox-adapter 0.0.40-beta.2 → 0.0.40-beta.4

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.cjs CHANGED
@@ -45649,7 +45649,10 @@ class DevboxApi {
45649
45649
  }
45650
45650
  const res = await fetch(input, { ...init, headers });
45651
45651
  const result = await res.json();
45652
- return result;
45652
+ return {
45653
+ ...result,
45654
+ code: result.code ?? res.status
45655
+ };
45653
45656
  }
45654
45657
  async create(req) {
45655
45658
  return this.request(this.url("/api/v1/devbox"), {
@@ -45738,8 +45741,9 @@ function parseImageSpec(image) {
45738
45741
  if (atIndex > -1) {
45739
45742
  return { repository: image.slice(0, atIndex), digest: image.slice(atIndex + 1) };
45740
45743
  }
45741
- const colonIndex = image.indexOf(":");
45742
- if (colonIndex > -1) {
45744
+ const slashIndex = image.lastIndexOf("/");
45745
+ const colonIndex = image.lastIndexOf(":");
45746
+ if (colonIndex > slashIndex) {
45743
45747
  return { repository: image.slice(0, colonIndex), tag: image.slice(colonIndex + 1) };
45744
45748
  }
45745
45749
  return { repository: image };
package/dist/index.js CHANGED
@@ -45633,7 +45633,10 @@ class DevboxApi {
45633
45633
  }
45634
45634
  const res = await fetch(input, { ...init, headers });
45635
45635
  const result = await res.json();
45636
- return result;
45636
+ return {
45637
+ ...result,
45638
+ code: result.code ?? res.status
45639
+ };
45637
45640
  }
45638
45641
  async create(req) {
45639
45642
  return this.request(this.url("/api/v1/devbox"), {
@@ -45722,8 +45725,9 @@ function parseImageSpec(image) {
45722
45725
  if (atIndex > -1) {
45723
45726
  return { repository: image.slice(0, atIndex), digest: image.slice(atIndex + 1) };
45724
45727
  }
45725
- const colonIndex = image.indexOf(":");
45726
- if (colonIndex > -1) {
45728
+ const slashIndex = image.lastIndexOf("/");
45729
+ const colonIndex = image.lastIndexOf(":");
45730
+ if (colonIndex > slashIndex) {
45727
45731
  return { repository: image.slice(0, colonIndex), tag: image.slice(colonIndex + 1) };
45728
45732
  }
45729
45733
  return { repository: image };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastgpt-sdk/sandbox-adapter",
3
- "version": "0.0.40-beta.2",
3
+ "version": "0.0.40-beta.4",
4
4
  "description": "Unified abstraction layer for cloud sandbox providers with adapter pattern and feature polyfilling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",