struere 0.9.5 → 0.9.6
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/bin/struere.js
CHANGED
|
@@ -23176,8 +23176,8 @@ var statusCommand = new Command("status").description("Compare local vs remote s
|
|
|
23176
23176
|
if (!jsonMode)
|
|
23177
23177
|
spinner.start("Fetching remote state");
|
|
23178
23178
|
const [devResult, prodResult] = await Promise.all([
|
|
23179
|
-
getSyncState(
|
|
23180
|
-
getSyncState(
|
|
23179
|
+
getSyncState(project.organization.id, "development"),
|
|
23180
|
+
getSyncState(project.organization.id, "production")
|
|
23181
23181
|
]);
|
|
23182
23182
|
if (devResult.error || !devResult.state) {
|
|
23183
23183
|
if (jsonMode) {
|
|
@@ -23840,57 +23840,61 @@ async function convexMutation(path, args) {
|
|
|
23840
23840
|
return { error: String(json.errorMessage || "Unknown error") };
|
|
23841
23841
|
return { error: `Unexpected response: ${text}` };
|
|
23842
23842
|
}
|
|
23843
|
-
async function queryEntityTypes(env2) {
|
|
23844
|
-
return convexQuery("entityTypes:list", { environment: env2 });
|
|
23843
|
+
async function queryEntityTypes(env2, organizationId) {
|
|
23844
|
+
return convexQuery("entityTypes:list", { environment: env2, ...organizationId && { organizationId } });
|
|
23845
23845
|
}
|
|
23846
|
-
async function queryEntityTypeBySlug(slug, env2) {
|
|
23847
|
-
return convexQuery("entityTypes:getBySlug", { slug, environment: env2 });
|
|
23846
|
+
async function queryEntityTypeBySlug(slug, env2, organizationId) {
|
|
23847
|
+
return convexQuery("entityTypes:getBySlug", { slug, environment: env2, ...organizationId && { organizationId } });
|
|
23848
23848
|
}
|
|
23849
|
-
async function queryEntities(slug, env2, opts) {
|
|
23849
|
+
async function queryEntities(slug, env2, opts, organizationId) {
|
|
23850
23850
|
return convexQuery("entities:list", {
|
|
23851
23851
|
entityTypeSlug: slug,
|
|
23852
23852
|
environment: env2,
|
|
23853
23853
|
...opts?.status && { status: opts.status },
|
|
23854
|
-
...opts?.limit && { limit: opts.limit }
|
|
23854
|
+
...opts?.limit && { limit: opts.limit },
|
|
23855
|
+
...organizationId && { organizationId }
|
|
23855
23856
|
});
|
|
23856
23857
|
}
|
|
23857
|
-
async function resolveEntityId(partialId, env2) {
|
|
23858
|
-
const result = await convexQuery("entities:resolvePartialId", { partialId, environment: env2 });
|
|
23858
|
+
async function resolveEntityId(partialId, env2, organizationId) {
|
|
23859
|
+
const result = await convexQuery("entities:resolvePartialId", { partialId, environment: env2, ...organizationId && { organizationId } });
|
|
23859
23860
|
if (result.error)
|
|
23860
23861
|
return { error: result.error };
|
|
23861
23862
|
if (!result.data)
|
|
23862
23863
|
return { error: `No entity found matching ID "${partialId}"` };
|
|
23863
23864
|
return { data: result.data };
|
|
23864
23865
|
}
|
|
23865
|
-
async function queryEntity(id, env2) {
|
|
23866
|
-
return convexQuery("entities:getWithType", { id, environment: env2 });
|
|
23866
|
+
async function queryEntity(id, env2, organizationId) {
|
|
23867
|
+
return convexQuery("entities:getWithType", { id, environment: env2, ...organizationId && { organizationId } });
|
|
23867
23868
|
}
|
|
23868
|
-
async function searchEntities(slug, query, env2, limit) {
|
|
23869
|
+
async function searchEntities(slug, query, env2, limit, organizationId) {
|
|
23869
23870
|
return convexQuery("entities:search", {
|
|
23870
23871
|
entityTypeSlug: slug,
|
|
23871
23872
|
environment: env2,
|
|
23872
23873
|
query,
|
|
23873
|
-
...limit && { limit }
|
|
23874
|
+
...limit && { limit },
|
|
23875
|
+
...organizationId && { organizationId }
|
|
23874
23876
|
});
|
|
23875
23877
|
}
|
|
23876
|
-
async function createEntity(slug, data, env2, status) {
|
|
23878
|
+
async function createEntity(slug, data, env2, status, organizationId) {
|
|
23877
23879
|
return convexMutation("entities:create", {
|
|
23878
23880
|
entityTypeSlug: slug,
|
|
23879
23881
|
environment: env2,
|
|
23880
23882
|
data,
|
|
23881
|
-
...status && { status }
|
|
23883
|
+
...status && { status },
|
|
23884
|
+
...organizationId && { organizationId }
|
|
23882
23885
|
});
|
|
23883
23886
|
}
|
|
23884
|
-
async function updateEntity(id, data, env2, status) {
|
|
23887
|
+
async function updateEntity(id, data, env2, status, organizationId) {
|
|
23885
23888
|
return convexMutation("entities:update", {
|
|
23886
23889
|
id,
|
|
23887
23890
|
environment: env2,
|
|
23888
23891
|
data,
|
|
23889
|
-
...status && { status }
|
|
23892
|
+
...status && { status },
|
|
23893
|
+
...organizationId && { organizationId }
|
|
23890
23894
|
});
|
|
23891
23895
|
}
|
|
23892
|
-
async function removeEntity(id, env2) {
|
|
23893
|
-
return convexMutation("entities:remove", { id, environment: env2 });
|
|
23896
|
+
async function removeEntity(id, env2, organizationId) {
|
|
23897
|
+
return convexMutation("entities:remove", { id, environment: env2, ...organizationId && { organizationId } });
|
|
23894
23898
|
}
|
|
23895
23899
|
|
|
23896
23900
|
// src/cli/utils/table.ts
|
|
@@ -23951,6 +23955,10 @@ function deriveColumnsFromSchema(schema, displayConfig) {
|
|
|
23951
23955
|
}
|
|
23952
23956
|
|
|
23953
23957
|
// src/cli/commands/entities.ts
|
|
23958
|
+
function getOrgId() {
|
|
23959
|
+
const project = loadProject(process.cwd());
|
|
23960
|
+
return project?.organization.id;
|
|
23961
|
+
}
|
|
23954
23962
|
async function ensureAuth() {
|
|
23955
23963
|
const cwd = process.cwd();
|
|
23956
23964
|
const nonInteractive = !isInteractive2();
|
|
@@ -23998,8 +24006,9 @@ entitiesCommand.command("types").description("List available entity types").opti
|
|
|
23998
24006
|
await ensureAuth();
|
|
23999
24007
|
const spinner = ora();
|
|
24000
24008
|
const env2 = opts.env;
|
|
24009
|
+
const orgId = getOrgId();
|
|
24001
24010
|
spinner.start("Fetching entity types");
|
|
24002
|
-
const { data, error } = await queryEntityTypes(env2);
|
|
24011
|
+
const { data, error } = await queryEntityTypes(env2, orgId);
|
|
24003
24012
|
if (error || !data) {
|
|
24004
24013
|
spinner.fail("Failed to fetch entity types");
|
|
24005
24014
|
console.log(source_default.red("Error:"), error);
|
|
@@ -24032,13 +24041,14 @@ entitiesCommand.command("list <type>").description("List entities of a type").op
|
|
|
24032
24041
|
await ensureAuth();
|
|
24033
24042
|
const spinner = ora();
|
|
24034
24043
|
const env2 = opts.env;
|
|
24044
|
+
const orgId = getOrgId();
|
|
24035
24045
|
spinner.start(`Fetching ${type} entities`);
|
|
24036
24046
|
const [entitiesResult, typeResult] = await Promise.all([
|
|
24037
24047
|
queryEntities(type, env2, {
|
|
24038
24048
|
status: opts.status,
|
|
24039
24049
|
limit: parseInt(opts.limit, 10)
|
|
24040
|
-
}),
|
|
24041
|
-
queryEntityTypeBySlug(type, env2)
|
|
24050
|
+
}, orgId),
|
|
24051
|
+
queryEntityTypeBySlug(type, env2, orgId)
|
|
24042
24052
|
]);
|
|
24043
24053
|
if (entitiesResult.error || !entitiesResult.data) {
|
|
24044
24054
|
spinner.fail(`Failed to fetch ${type} entities`);
|
|
@@ -24063,8 +24073,9 @@ entitiesCommand.command("get <id>").description("Get entity details").option("--
|
|
|
24063
24073
|
await ensureAuth();
|
|
24064
24074
|
const spinner = ora();
|
|
24065
24075
|
const env2 = opts.env;
|
|
24076
|
+
const orgId = getOrgId();
|
|
24066
24077
|
spinner.start("Resolving entity ID");
|
|
24067
|
-
const resolved = await resolveEntityId(rawId, env2);
|
|
24078
|
+
const resolved = await resolveEntityId(rawId, env2, orgId);
|
|
24068
24079
|
if (resolved.error || !resolved.data) {
|
|
24069
24080
|
spinner.fail("Entity not found");
|
|
24070
24081
|
console.log(source_default.red("Error:"), resolved.error || `No entity matched "${rawId}"`);
|
|
@@ -24072,7 +24083,7 @@ entitiesCommand.command("get <id>").description("Get entity details").option("--
|
|
|
24072
24083
|
}
|
|
24073
24084
|
const id = resolved.data;
|
|
24074
24085
|
spinner.text = "Fetching entity";
|
|
24075
|
-
const { data, error } = await queryEntity(id, env2);
|
|
24086
|
+
const { data, error } = await queryEntity(id, env2, orgId);
|
|
24076
24087
|
if (error || !data) {
|
|
24077
24088
|
spinner.fail("Failed to fetch entity");
|
|
24078
24089
|
console.log(source_default.red("Error:"), error || "Entity not found");
|
|
@@ -24110,6 +24121,7 @@ entitiesCommand.command("create <type>").description("Create a new entity").opti
|
|
|
24110
24121
|
await ensureAuth();
|
|
24111
24122
|
const spinner = ora();
|
|
24112
24123
|
const env2 = opts.env;
|
|
24124
|
+
const orgId = getOrgId();
|
|
24113
24125
|
let data;
|
|
24114
24126
|
if (opts.data) {
|
|
24115
24127
|
try {
|
|
@@ -24123,7 +24135,7 @@ entitiesCommand.command("create <type>").description("Create a new entity").opti
|
|
|
24123
24135
|
process.exit(1);
|
|
24124
24136
|
} else {
|
|
24125
24137
|
spinner.start(`Fetching ${type} schema`);
|
|
24126
|
-
const { data: typeData, error: error2 } = await queryEntityTypeBySlug(type, env2);
|
|
24138
|
+
const { data: typeData, error: error2 } = await queryEntityTypeBySlug(type, env2, orgId);
|
|
24127
24139
|
if (error2 || !typeData) {
|
|
24128
24140
|
spinner.fail(`Entity type not found: ${type}`);
|
|
24129
24141
|
console.log(source_default.red("Error:"), error2 || "Not found");
|
|
@@ -24164,7 +24176,7 @@ entitiesCommand.command("create <type>").description("Create a new entity").opti
|
|
|
24164
24176
|
console.log();
|
|
24165
24177
|
}
|
|
24166
24178
|
spinner.start(`Creating ${type} entity`);
|
|
24167
|
-
const { data: result, error } = await createEntity(type, data, env2, opts.status);
|
|
24179
|
+
const { data: result, error } = await createEntity(type, data, env2, opts.status, orgId);
|
|
24168
24180
|
if (error) {
|
|
24169
24181
|
spinner.fail("Failed to create entity");
|
|
24170
24182
|
console.log(source_default.red("Error:"), error);
|
|
@@ -24183,6 +24195,7 @@ entitiesCommand.command("update <id>").description("Update an entity").option("-
|
|
|
24183
24195
|
await ensureAuth();
|
|
24184
24196
|
const spinner = ora();
|
|
24185
24197
|
const env2 = opts.env;
|
|
24198
|
+
const orgId = getOrgId();
|
|
24186
24199
|
if (!opts.data && !opts.status) {
|
|
24187
24200
|
console.log(source_default.red("Provide --data and/or --status"));
|
|
24188
24201
|
process.exit(1);
|
|
@@ -24197,7 +24210,7 @@ entitiesCommand.command("update <id>").description("Update an entity").option("-
|
|
|
24197
24210
|
}
|
|
24198
24211
|
}
|
|
24199
24212
|
spinner.start("Resolving entity ID");
|
|
24200
|
-
const resolved = await resolveEntityId(rawId, env2);
|
|
24213
|
+
const resolved = await resolveEntityId(rawId, env2, orgId);
|
|
24201
24214
|
if (resolved.error || !resolved.data) {
|
|
24202
24215
|
spinner.fail("Entity not found");
|
|
24203
24216
|
console.log(source_default.red("Error:"), resolved.error || `No entity matched "${rawId}"`);
|
|
@@ -24205,7 +24218,7 @@ entitiesCommand.command("update <id>").description("Update an entity").option("-
|
|
|
24205
24218
|
}
|
|
24206
24219
|
const id = resolved.data;
|
|
24207
24220
|
spinner.text = "Updating entity";
|
|
24208
|
-
const { data: result, error } = await updateEntity(id, data, env2, opts.status);
|
|
24221
|
+
const { data: result, error } = await updateEntity(id, data, env2, opts.status, orgId);
|
|
24209
24222
|
if (error) {
|
|
24210
24223
|
spinner.fail("Failed to update entity");
|
|
24211
24224
|
console.log(source_default.red("Error:"), error);
|
|
@@ -24224,10 +24237,11 @@ entitiesCommand.command("delete <id>").description("Delete an entity").option("-
|
|
|
24224
24237
|
await ensureAuth();
|
|
24225
24238
|
const spinner = ora();
|
|
24226
24239
|
const env2 = opts.env;
|
|
24240
|
+
const orgId = getOrgId();
|
|
24227
24241
|
const jsonMode = !!opts.json;
|
|
24228
24242
|
if (!jsonMode)
|
|
24229
24243
|
spinner.start("Resolving entity ID");
|
|
24230
|
-
const resolved = await resolveEntityId(rawId, env2);
|
|
24244
|
+
const resolved = await resolveEntityId(rawId, env2, orgId);
|
|
24231
24245
|
if (resolved.error || !resolved.data) {
|
|
24232
24246
|
if (jsonMode) {
|
|
24233
24247
|
console.log(JSON.stringify({ success: false, error: resolved.error || `No entity matched "${rawId}"` }));
|
|
@@ -24240,7 +24254,7 @@ entitiesCommand.command("delete <id>").description("Delete an entity").option("-
|
|
|
24240
24254
|
const id = resolved.data;
|
|
24241
24255
|
if (!jsonMode)
|
|
24242
24256
|
spinner.text = "Fetching entity";
|
|
24243
|
-
const { data, error: fetchError } = await queryEntity(id, env2);
|
|
24257
|
+
const { data, error: fetchError } = await queryEntity(id, env2, orgId);
|
|
24244
24258
|
if (fetchError || !data) {
|
|
24245
24259
|
if (jsonMode) {
|
|
24246
24260
|
console.log(JSON.stringify({ success: false, error: fetchError || "Entity not found" }));
|
|
@@ -24279,7 +24293,7 @@ entitiesCommand.command("delete <id>").description("Delete an entity").option("-
|
|
|
24279
24293
|
}
|
|
24280
24294
|
if (!jsonMode)
|
|
24281
24295
|
spinner.start("Deleting entity");
|
|
24282
|
-
const { error } = await removeEntity(id, env2);
|
|
24296
|
+
const { error } = await removeEntity(id, env2, orgId);
|
|
24283
24297
|
if (error) {
|
|
24284
24298
|
if (jsonMode) {
|
|
24285
24299
|
console.log(JSON.stringify({ success: false, error }));
|
|
@@ -24300,10 +24314,11 @@ entitiesCommand.command("search <type> <query>").description("Search entities").
|
|
|
24300
24314
|
await ensureAuth();
|
|
24301
24315
|
const spinner = ora();
|
|
24302
24316
|
const env2 = opts.env;
|
|
24317
|
+
const orgId = getOrgId();
|
|
24303
24318
|
spinner.start(`Searching ${type} for "${query}"`);
|
|
24304
24319
|
const [searchResult, typeResult] = await Promise.all([
|
|
24305
|
-
searchEntities(type, query, env2, parseInt(opts.limit, 10)),
|
|
24306
|
-
queryEntityTypeBySlug(type, env2)
|
|
24320
|
+
searchEntities(type, query, env2, parseInt(opts.limit, 10), orgId),
|
|
24321
|
+
queryEntityTypeBySlug(type, env2, orgId)
|
|
24307
24322
|
]);
|
|
24308
24323
|
if (searchResult.error || !searchResult.data) {
|
|
24309
24324
|
spinner.fail("Search failed");
|
|
@@ -25558,7 +25573,7 @@ var integrationCommand = new Command("integration").description("Manage integrat
|
|
|
25558
25573
|
// package.json
|
|
25559
25574
|
var package_default = {
|
|
25560
25575
|
name: "struere",
|
|
25561
|
-
version: "0.9.
|
|
25576
|
+
version: "0.9.6",
|
|
25562
25577
|
description: "Build, test, and deploy AI agents",
|
|
25563
25578
|
keywords: [
|
|
25564
25579
|
"ai",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA6EnC,eAAO,MAAM,eAAe,SACQ,CAAA"}
|
package/dist/cli/index.js
CHANGED
|
@@ -3801,8 +3801,8 @@ var statusCommand = new Command10("status").description("Compare local vs remote
|
|
|
3801
3801
|
if (!jsonMode)
|
|
3802
3802
|
spinner.start("Fetching remote state");
|
|
3803
3803
|
const [devResult, prodResult] = await Promise.all([
|
|
3804
|
-
getSyncState(
|
|
3805
|
-
getSyncState(
|
|
3804
|
+
getSyncState(project.organization.id, "development"),
|
|
3805
|
+
getSyncState(project.organization.id, "production")
|
|
3806
3806
|
]);
|
|
3807
3807
|
if (devResult.error || !devResult.state) {
|
|
3808
3808
|
if (jsonMode) {
|
|
@@ -4474,57 +4474,61 @@ async function convexMutation(path, args) {
|
|
|
4474
4474
|
return { error: String(json.errorMessage || "Unknown error") };
|
|
4475
4475
|
return { error: `Unexpected response: ${text}` };
|
|
4476
4476
|
}
|
|
4477
|
-
async function queryEntityTypes(env) {
|
|
4478
|
-
return convexQuery("entityTypes:list", { environment: env });
|
|
4477
|
+
async function queryEntityTypes(env, organizationId) {
|
|
4478
|
+
return convexQuery("entityTypes:list", { environment: env, ...organizationId && { organizationId } });
|
|
4479
4479
|
}
|
|
4480
|
-
async function queryEntityTypeBySlug(slug, env) {
|
|
4481
|
-
return convexQuery("entityTypes:getBySlug", { slug, environment: env });
|
|
4480
|
+
async function queryEntityTypeBySlug(slug, env, organizationId) {
|
|
4481
|
+
return convexQuery("entityTypes:getBySlug", { slug, environment: env, ...organizationId && { organizationId } });
|
|
4482
4482
|
}
|
|
4483
|
-
async function queryEntities(slug, env, opts) {
|
|
4483
|
+
async function queryEntities(slug, env, opts, organizationId) {
|
|
4484
4484
|
return convexQuery("entities:list", {
|
|
4485
4485
|
entityTypeSlug: slug,
|
|
4486
4486
|
environment: env,
|
|
4487
4487
|
...opts?.status && { status: opts.status },
|
|
4488
|
-
...opts?.limit && { limit: opts.limit }
|
|
4488
|
+
...opts?.limit && { limit: opts.limit },
|
|
4489
|
+
...organizationId && { organizationId }
|
|
4489
4490
|
});
|
|
4490
4491
|
}
|
|
4491
|
-
async function resolveEntityId(partialId, env) {
|
|
4492
|
-
const result = await convexQuery("entities:resolvePartialId", { partialId, environment: env });
|
|
4492
|
+
async function resolveEntityId(partialId, env, organizationId) {
|
|
4493
|
+
const result = await convexQuery("entities:resolvePartialId", { partialId, environment: env, ...organizationId && { organizationId } });
|
|
4493
4494
|
if (result.error)
|
|
4494
4495
|
return { error: result.error };
|
|
4495
4496
|
if (!result.data)
|
|
4496
4497
|
return { error: `No entity found matching ID "${partialId}"` };
|
|
4497
4498
|
return { data: result.data };
|
|
4498
4499
|
}
|
|
4499
|
-
async function queryEntity(id, env) {
|
|
4500
|
-
return convexQuery("entities:getWithType", { id, environment: env });
|
|
4500
|
+
async function queryEntity(id, env, organizationId) {
|
|
4501
|
+
return convexQuery("entities:getWithType", { id, environment: env, ...organizationId && { organizationId } });
|
|
4501
4502
|
}
|
|
4502
|
-
async function searchEntities(slug, query, env, limit) {
|
|
4503
|
+
async function searchEntities(slug, query, env, limit, organizationId) {
|
|
4503
4504
|
return convexQuery("entities:search", {
|
|
4504
4505
|
entityTypeSlug: slug,
|
|
4505
4506
|
environment: env,
|
|
4506
4507
|
query,
|
|
4507
|
-
...limit && { limit }
|
|
4508
|
+
...limit && { limit },
|
|
4509
|
+
...organizationId && { organizationId }
|
|
4508
4510
|
});
|
|
4509
4511
|
}
|
|
4510
|
-
async function createEntity(slug, data, env, status) {
|
|
4512
|
+
async function createEntity(slug, data, env, status, organizationId) {
|
|
4511
4513
|
return convexMutation("entities:create", {
|
|
4512
4514
|
entityTypeSlug: slug,
|
|
4513
4515
|
environment: env,
|
|
4514
4516
|
data,
|
|
4515
|
-
...status && { status }
|
|
4517
|
+
...status && { status },
|
|
4518
|
+
...organizationId && { organizationId }
|
|
4516
4519
|
});
|
|
4517
4520
|
}
|
|
4518
|
-
async function updateEntity(id, data, env, status) {
|
|
4521
|
+
async function updateEntity(id, data, env, status, organizationId) {
|
|
4519
4522
|
return convexMutation("entities:update", {
|
|
4520
4523
|
id,
|
|
4521
4524
|
environment: env,
|
|
4522
4525
|
data,
|
|
4523
|
-
...status && { status }
|
|
4526
|
+
...status && { status },
|
|
4527
|
+
...organizationId && { organizationId }
|
|
4524
4528
|
});
|
|
4525
4529
|
}
|
|
4526
|
-
async function removeEntity(id, env) {
|
|
4527
|
-
return convexMutation("entities:remove", { id, environment: env });
|
|
4530
|
+
async function removeEntity(id, env, organizationId) {
|
|
4531
|
+
return convexMutation("entities:remove", { id, environment: env, ...organizationId && { organizationId } });
|
|
4528
4532
|
}
|
|
4529
4533
|
|
|
4530
4534
|
// src/cli/utils/table.ts
|
|
@@ -4586,6 +4590,10 @@ function deriveColumnsFromSchema(schema, displayConfig) {
|
|
|
4586
4590
|
}
|
|
4587
4591
|
|
|
4588
4592
|
// src/cli/commands/entities.ts
|
|
4593
|
+
function getOrgId() {
|
|
4594
|
+
const project = loadProject(process.cwd());
|
|
4595
|
+
return project?.organization.id;
|
|
4596
|
+
}
|
|
4589
4597
|
async function ensureAuth() {
|
|
4590
4598
|
const cwd = process.cwd();
|
|
4591
4599
|
const nonInteractive = !isInteractive();
|
|
@@ -4633,8 +4641,9 @@ entitiesCommand.command("types").description("List available entity types").opti
|
|
|
4633
4641
|
await ensureAuth();
|
|
4634
4642
|
const spinner = ora10();
|
|
4635
4643
|
const env = opts.env;
|
|
4644
|
+
const orgId = getOrgId();
|
|
4636
4645
|
spinner.start("Fetching entity types");
|
|
4637
|
-
const { data, error } = await queryEntityTypes(env);
|
|
4646
|
+
const { data, error } = await queryEntityTypes(env, orgId);
|
|
4638
4647
|
if (error || !data) {
|
|
4639
4648
|
spinner.fail("Failed to fetch entity types");
|
|
4640
4649
|
console.log(chalk14.red("Error:"), error);
|
|
@@ -4667,13 +4676,14 @@ entitiesCommand.command("list <type>").description("List entities of a type").op
|
|
|
4667
4676
|
await ensureAuth();
|
|
4668
4677
|
const spinner = ora10();
|
|
4669
4678
|
const env = opts.env;
|
|
4679
|
+
const orgId = getOrgId();
|
|
4670
4680
|
spinner.start(`Fetching ${type} entities`);
|
|
4671
4681
|
const [entitiesResult, typeResult] = await Promise.all([
|
|
4672
4682
|
queryEntities(type, env, {
|
|
4673
4683
|
status: opts.status,
|
|
4674
4684
|
limit: parseInt(opts.limit, 10)
|
|
4675
|
-
}),
|
|
4676
|
-
queryEntityTypeBySlug(type, env)
|
|
4685
|
+
}, orgId),
|
|
4686
|
+
queryEntityTypeBySlug(type, env, orgId)
|
|
4677
4687
|
]);
|
|
4678
4688
|
if (entitiesResult.error || !entitiesResult.data) {
|
|
4679
4689
|
spinner.fail(`Failed to fetch ${type} entities`);
|
|
@@ -4698,8 +4708,9 @@ entitiesCommand.command("get <id>").description("Get entity details").option("--
|
|
|
4698
4708
|
await ensureAuth();
|
|
4699
4709
|
const spinner = ora10();
|
|
4700
4710
|
const env = opts.env;
|
|
4711
|
+
const orgId = getOrgId();
|
|
4701
4712
|
spinner.start("Resolving entity ID");
|
|
4702
|
-
const resolved = await resolveEntityId(rawId, env);
|
|
4713
|
+
const resolved = await resolveEntityId(rawId, env, orgId);
|
|
4703
4714
|
if (resolved.error || !resolved.data) {
|
|
4704
4715
|
spinner.fail("Entity not found");
|
|
4705
4716
|
console.log(chalk14.red("Error:"), resolved.error || `No entity matched "${rawId}"`);
|
|
@@ -4707,7 +4718,7 @@ entitiesCommand.command("get <id>").description("Get entity details").option("--
|
|
|
4707
4718
|
}
|
|
4708
4719
|
const id = resolved.data;
|
|
4709
4720
|
spinner.text = "Fetching entity";
|
|
4710
|
-
const { data, error } = await queryEntity(id, env);
|
|
4721
|
+
const { data, error } = await queryEntity(id, env, orgId);
|
|
4711
4722
|
if (error || !data) {
|
|
4712
4723
|
spinner.fail("Failed to fetch entity");
|
|
4713
4724
|
console.log(chalk14.red("Error:"), error || "Entity not found");
|
|
@@ -4745,6 +4756,7 @@ entitiesCommand.command("create <type>").description("Create a new entity").opti
|
|
|
4745
4756
|
await ensureAuth();
|
|
4746
4757
|
const spinner = ora10();
|
|
4747
4758
|
const env = opts.env;
|
|
4759
|
+
const orgId = getOrgId();
|
|
4748
4760
|
let data;
|
|
4749
4761
|
if (opts.data) {
|
|
4750
4762
|
try {
|
|
@@ -4758,7 +4770,7 @@ entitiesCommand.command("create <type>").description("Create a new entity").opti
|
|
|
4758
4770
|
process.exit(1);
|
|
4759
4771
|
} else {
|
|
4760
4772
|
spinner.start(`Fetching ${type} schema`);
|
|
4761
|
-
const { data: typeData, error: error2 } = await queryEntityTypeBySlug(type, env);
|
|
4773
|
+
const { data: typeData, error: error2 } = await queryEntityTypeBySlug(type, env, orgId);
|
|
4762
4774
|
if (error2 || !typeData) {
|
|
4763
4775
|
spinner.fail(`Entity type not found: ${type}`);
|
|
4764
4776
|
console.log(chalk14.red("Error:"), error2 || "Not found");
|
|
@@ -4799,7 +4811,7 @@ entitiesCommand.command("create <type>").description("Create a new entity").opti
|
|
|
4799
4811
|
console.log();
|
|
4800
4812
|
}
|
|
4801
4813
|
spinner.start(`Creating ${type} entity`);
|
|
4802
|
-
const { data: result, error } = await createEntity(type, data, env, opts.status);
|
|
4814
|
+
const { data: result, error } = await createEntity(type, data, env, opts.status, orgId);
|
|
4803
4815
|
if (error) {
|
|
4804
4816
|
spinner.fail("Failed to create entity");
|
|
4805
4817
|
console.log(chalk14.red("Error:"), error);
|
|
@@ -4818,6 +4830,7 @@ entitiesCommand.command("update <id>").description("Update an entity").option("-
|
|
|
4818
4830
|
await ensureAuth();
|
|
4819
4831
|
const spinner = ora10();
|
|
4820
4832
|
const env = opts.env;
|
|
4833
|
+
const orgId = getOrgId();
|
|
4821
4834
|
if (!opts.data && !opts.status) {
|
|
4822
4835
|
console.log(chalk14.red("Provide --data and/or --status"));
|
|
4823
4836
|
process.exit(1);
|
|
@@ -4832,7 +4845,7 @@ entitiesCommand.command("update <id>").description("Update an entity").option("-
|
|
|
4832
4845
|
}
|
|
4833
4846
|
}
|
|
4834
4847
|
spinner.start("Resolving entity ID");
|
|
4835
|
-
const resolved = await resolveEntityId(rawId, env);
|
|
4848
|
+
const resolved = await resolveEntityId(rawId, env, orgId);
|
|
4836
4849
|
if (resolved.error || !resolved.data) {
|
|
4837
4850
|
spinner.fail("Entity not found");
|
|
4838
4851
|
console.log(chalk14.red("Error:"), resolved.error || `No entity matched "${rawId}"`);
|
|
@@ -4840,7 +4853,7 @@ entitiesCommand.command("update <id>").description("Update an entity").option("-
|
|
|
4840
4853
|
}
|
|
4841
4854
|
const id = resolved.data;
|
|
4842
4855
|
spinner.text = "Updating entity";
|
|
4843
|
-
const { data: result, error } = await updateEntity(id, data, env, opts.status);
|
|
4856
|
+
const { data: result, error } = await updateEntity(id, data, env, opts.status, orgId);
|
|
4844
4857
|
if (error) {
|
|
4845
4858
|
spinner.fail("Failed to update entity");
|
|
4846
4859
|
console.log(chalk14.red("Error:"), error);
|
|
@@ -4859,10 +4872,11 @@ entitiesCommand.command("delete <id>").description("Delete an entity").option("-
|
|
|
4859
4872
|
await ensureAuth();
|
|
4860
4873
|
const spinner = ora10();
|
|
4861
4874
|
const env = opts.env;
|
|
4875
|
+
const orgId = getOrgId();
|
|
4862
4876
|
const jsonMode = !!opts.json;
|
|
4863
4877
|
if (!jsonMode)
|
|
4864
4878
|
spinner.start("Resolving entity ID");
|
|
4865
|
-
const resolved = await resolveEntityId(rawId, env);
|
|
4879
|
+
const resolved = await resolveEntityId(rawId, env, orgId);
|
|
4866
4880
|
if (resolved.error || !resolved.data) {
|
|
4867
4881
|
if (jsonMode) {
|
|
4868
4882
|
console.log(JSON.stringify({ success: false, error: resolved.error || `No entity matched "${rawId}"` }));
|
|
@@ -4875,7 +4889,7 @@ entitiesCommand.command("delete <id>").description("Delete an entity").option("-
|
|
|
4875
4889
|
const id = resolved.data;
|
|
4876
4890
|
if (!jsonMode)
|
|
4877
4891
|
spinner.text = "Fetching entity";
|
|
4878
|
-
const { data, error: fetchError } = await queryEntity(id, env);
|
|
4892
|
+
const { data, error: fetchError } = await queryEntity(id, env, orgId);
|
|
4879
4893
|
if (fetchError || !data) {
|
|
4880
4894
|
if (jsonMode) {
|
|
4881
4895
|
console.log(JSON.stringify({ success: false, error: fetchError || "Entity not found" }));
|
|
@@ -4914,7 +4928,7 @@ entitiesCommand.command("delete <id>").description("Delete an entity").option("-
|
|
|
4914
4928
|
}
|
|
4915
4929
|
if (!jsonMode)
|
|
4916
4930
|
spinner.start("Deleting entity");
|
|
4917
|
-
const { error } = await removeEntity(id, env);
|
|
4931
|
+
const { error } = await removeEntity(id, env, orgId);
|
|
4918
4932
|
if (error) {
|
|
4919
4933
|
if (jsonMode) {
|
|
4920
4934
|
console.log(JSON.stringify({ success: false, error }));
|
|
@@ -4935,10 +4949,11 @@ entitiesCommand.command("search <type> <query>").description("Search entities").
|
|
|
4935
4949
|
await ensureAuth();
|
|
4936
4950
|
const spinner = ora10();
|
|
4937
4951
|
const env = opts.env;
|
|
4952
|
+
const orgId = getOrgId();
|
|
4938
4953
|
spinner.start(`Searching ${type} for "${query}"`);
|
|
4939
4954
|
const [searchResult, typeResult] = await Promise.all([
|
|
4940
|
-
searchEntities(type, query, env, parseInt(opts.limit, 10)),
|
|
4941
|
-
queryEntityTypeBySlug(type, env)
|
|
4955
|
+
searchEntities(type, query, env, parseInt(opts.limit, 10), orgId),
|
|
4956
|
+
queryEntityTypeBySlug(type, env, orgId)
|
|
4942
4957
|
]);
|
|
4943
4958
|
if (searchResult.error || !searchResult.data) {
|
|
4944
4959
|
spinner.fail("Search failed");
|
|
@@ -6204,7 +6219,7 @@ var integrationCommand = new Command15("integration").description("Manage integr
|
|
|
6204
6219
|
// package.json
|
|
6205
6220
|
var package_default = {
|
|
6206
6221
|
name: "struere",
|
|
6207
|
-
version: "0.9.
|
|
6222
|
+
version: "0.9.6",
|
|
6208
6223
|
description: "Build, test, and deploy AI agents",
|
|
6209
6224
|
keywords: [
|
|
6210
6225
|
"ai",
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
type Environment = 'development' | 'production';
|
|
2
|
-
export declare function queryEntityTypes(env: Environment): Promise<{
|
|
2
|
+
export declare function queryEntityTypes(env: Environment, organizationId?: string): Promise<{
|
|
3
3
|
data?: unknown;
|
|
4
4
|
error?: string;
|
|
5
5
|
}>;
|
|
6
|
-
export declare function queryEntityTypeBySlug(slug: string, env: Environment): Promise<{
|
|
6
|
+
export declare function queryEntityTypeBySlug(slug: string, env: Environment, organizationId?: string): Promise<{
|
|
7
7
|
data?: unknown;
|
|
8
8
|
error?: string;
|
|
9
9
|
}>;
|
|
10
10
|
export declare function queryEntities(slug: string, env: Environment, opts?: {
|
|
11
11
|
status?: string;
|
|
12
12
|
limit?: number;
|
|
13
|
-
}): Promise<{
|
|
13
|
+
}, organizationId?: string): Promise<{
|
|
14
14
|
data?: unknown;
|
|
15
15
|
error?: string;
|
|
16
16
|
}>;
|
|
17
|
-
export declare function resolveEntityId(partialId: string, env: Environment): Promise<{
|
|
17
|
+
export declare function resolveEntityId(partialId: string, env: Environment, organizationId?: string): Promise<{
|
|
18
18
|
data?: string;
|
|
19
19
|
error?: string;
|
|
20
20
|
}>;
|
|
21
|
-
export declare function queryEntity(id: string, env: Environment): Promise<{
|
|
21
|
+
export declare function queryEntity(id: string, env: Environment, organizationId?: string): Promise<{
|
|
22
22
|
data?: unknown;
|
|
23
23
|
error?: string;
|
|
24
24
|
}>;
|
|
25
|
-
export declare function searchEntities(slug: string, query: string, env: Environment, limit?: number): Promise<{
|
|
25
|
+
export declare function searchEntities(slug: string, query: string, env: Environment, limit?: number, organizationId?: string): Promise<{
|
|
26
26
|
data?: unknown;
|
|
27
27
|
error?: string;
|
|
28
28
|
}>;
|
|
29
|
-
export declare function createEntity(slug: string, data: Record<string, unknown>, env: Environment, status?: string): Promise<{
|
|
29
|
+
export declare function createEntity(slug: string, data: Record<string, unknown>, env: Environment, status?: string, organizationId?: string): Promise<{
|
|
30
30
|
data?: unknown;
|
|
31
31
|
error?: string;
|
|
32
32
|
}>;
|
|
33
|
-
export declare function updateEntity(id: string, data: Record<string, unknown>, env: Environment, status?: string): Promise<{
|
|
33
|
+
export declare function updateEntity(id: string, data: Record<string, unknown>, env: Environment, status?: string, organizationId?: string): Promise<{
|
|
34
34
|
data?: unknown;
|
|
35
35
|
error?: string;
|
|
36
36
|
}>;
|
|
37
|
-
export declare function removeEntity(id: string, env: Environment): Promise<{
|
|
37
|
+
export declare function removeEntity(id: string, env: Environment, organizationId?: string): Promise<{
|
|
38
38
|
data?: unknown;
|
|
39
39
|
error?: string;
|
|
40
40
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/entities.ts"],"names":[],"mappings":"AAIA,KAAK,WAAW,GAAG,aAAa,GAAG,YAAY,CAAA;AAsE/C,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,WAAW;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/entities.ts"],"names":[],"mappings":"AAIA,KAAK,WAAW,GAAG,aAAa,GAAG,YAAY,CAAA;AAsE/C,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM;WA9DU,OAAO;YAAU,MAAM;GAgEhH;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM;WAlET,OAAO;YAAU,MAAM;GAoEhH;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAC1C,cAAc,CAAC,EAAE,MAAM;WA1EiE,OAAO;YAAU,MAAM;GAmFhH;AAED,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAK9I;AAED,wBAAsB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM;WA5FG,OAAO;YAAU,MAAM;GA8FhH;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,WAAW,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,cAAc,CAAC,EAAE,MAAM;WArGiE,OAAO;YAAU,MAAM;GA8GhH;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,WAAW,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,MAAM;WAtFoE,OAAO;YAAU,MAAM;GA+FnH;AAED,wBAAsB,YAAY,CAChC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,WAAW,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,MAAM;WAtGoE,OAAO;YAAU,MAAM;GA+GnH;AAED,wBAAsB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM;WAjHK,OAAO;YAAU,MAAM;GAmHnH"}
|