@withgateway/sdk 0.2.2 → 0.2.3
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/cli.js +129 -22
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +130 -23
- package/dist/cli.mjs.map +1 -1
- package/dist/files/index.js +9 -5
- package/dist/files/index.js.map +1 -1
- package/dist/files/index.mjs +9 -5
- package/dist/files/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +1 -1
- package/dist/traces/index.js +9 -5
- package/dist/traces/index.js.map +1 -1
- package/dist/traces/index.mjs +9 -5
- package/dist/traces/index.mjs.map +1 -1
- package/dist/tracing/index.js +1 -1
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/index.mjs +1 -1
- package/dist/tracing/index.mjs.map +1 -1
- package/dist/worlds/index.d.mts +7 -1
- package/dist/worlds/index.d.ts +7 -1
- package/dist/worlds/index.js +12 -7
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +12 -7
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +1 -1
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +5 -5
- package/skills/worlds-getting-started/SKILL.md +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1344,7 +1344,7 @@ async function push(dir, opts = {}) {
|
|
|
1344
1344
|
const pyproject = readPyproject(dir);
|
|
1345
1345
|
const contractVersion = pyproject.version ? void 0 : readWorldContractVersion(dir).version;
|
|
1346
1346
|
if (contractVersion) pyproject.version = contractVersion;
|
|
1347
|
-
const slug = opts.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
|
|
1347
|
+
const slug = opts.slug ?? localMeta.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
|
|
1348
1348
|
const resolve7 = await apiRequest(
|
|
1349
1349
|
options,
|
|
1350
1350
|
"POST",
|
|
@@ -3473,6 +3473,7 @@ var init_ingest = __esm({
|
|
|
3473
3473
|
// src/worlds/index.ts
|
|
3474
3474
|
var worlds_exports = {};
|
|
3475
3475
|
__export(worlds_exports, {
|
|
3476
|
+
ApiError: () => ApiError2,
|
|
3476
3477
|
BrowserActionRecorder: () => BrowserActionRecorder,
|
|
3477
3478
|
COMPUTER_USE_SPECS: () => COMPUTER_USE_SPECS,
|
|
3478
3479
|
DEFAULT_BRANCH: () => DEFAULT_BRANCH,
|
|
@@ -3581,11 +3582,7 @@ async function apiRequest(options, method, path9, body) {
|
|
|
3581
3582
|
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
3582
3583
|
});
|
|
3583
3584
|
const text2 = await res.text();
|
|
3584
|
-
if (!res.ok)
|
|
3585
|
-
throw new Error(
|
|
3586
|
-
`${method} ${path9} -> ${res.status}: ${text2.slice(0, 400)}`
|
|
3587
|
-
);
|
|
3588
|
-
}
|
|
3585
|
+
if (!res.ok) throw new ApiError2(res.status, method, path9, text2.slice(0, 400));
|
|
3589
3586
|
return JSON.parse(text2);
|
|
3590
3587
|
}
|
|
3591
3588
|
async function setEnvSecret(slug, key, value, options = {}) {
|
|
@@ -3737,7 +3734,7 @@ async function openWorld(slugRef, options = {}) {
|
|
|
3737
3734
|
}
|
|
3738
3735
|
return world;
|
|
3739
3736
|
}
|
|
3740
|
-
var WorldTask, WorldSet;
|
|
3737
|
+
var ApiError2, WorldTask, WorldSet;
|
|
3741
3738
|
var init_worlds = __esm({
|
|
3742
3739
|
"src/worlds/index.ts"() {
|
|
3743
3740
|
"use strict";
|
|
@@ -3752,6 +3749,13 @@ var init_worlds = __esm({
|
|
|
3752
3749
|
init_query();
|
|
3753
3750
|
init_migrate();
|
|
3754
3751
|
init_ingest();
|
|
3752
|
+
ApiError2 = class extends Error {
|
|
3753
|
+
constructor(status, method, path9, body) {
|
|
3754
|
+
super(`${method} ${path9} -> ${status}: ${body}`);
|
|
3755
|
+
this.status = status;
|
|
3756
|
+
this.name = "ApiError";
|
|
3757
|
+
}
|
|
3758
|
+
};
|
|
3755
3759
|
WorldTask = class {
|
|
3756
3760
|
constructor(world, name, variant) {
|
|
3757
3761
|
this.world = world;
|
|
@@ -3822,7 +3826,7 @@ var require_package = __commonJS({
|
|
|
3822
3826
|
"package.json"(exports, module) {
|
|
3823
3827
|
module.exports = {
|
|
3824
3828
|
name: "@withgateway/sdk",
|
|
3825
|
-
version: "0.2.
|
|
3829
|
+
version: "0.2.3",
|
|
3826
3830
|
description: "Gateway SDK for TypeScript - A/B experiments, tracing, and observability",
|
|
3827
3831
|
main: "./dist/index.js",
|
|
3828
3832
|
module: "./dist/index.mjs",
|
|
@@ -7977,6 +7981,7 @@ var tracing = {
|
|
|
7977
7981
|
};
|
|
7978
7982
|
export {
|
|
7979
7983
|
AGENT_ID_KEY,
|
|
7984
|
+
ApiError2 as ApiError,
|
|
7980
7985
|
BrowserActionRecorder,
|
|
7981
7986
|
COMPUTER_USE_SPECS,
|
|
7982
7987
|
DEFAULT_BRANCH,
|