@semiont/cli 0.2.39 → 0.2.40
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/README.md +1 -1
- package/dist/cli.mjs +293 -290
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -341,10 +341,10 @@ function mergeDefs(...defs) {
|
|
|
341
341
|
function cloneDef(schema2) {
|
|
342
342
|
return mergeDefs(schema2._zod.def);
|
|
343
343
|
}
|
|
344
|
-
function getElementAtPath(obj,
|
|
345
|
-
if (!
|
|
344
|
+
function getElementAtPath(obj, path39) {
|
|
345
|
+
if (!path39)
|
|
346
346
|
return obj;
|
|
347
|
-
return
|
|
347
|
+
return path39.reduce((acc, key) => acc?.[key], obj);
|
|
348
348
|
}
|
|
349
349
|
function promiseAllObject(promisesObj) {
|
|
350
350
|
const keys = Object.keys(promisesObj);
|
|
@@ -634,11 +634,11 @@ function aborted(x, startIndex = 0) {
|
|
|
634
634
|
}
|
|
635
635
|
return false;
|
|
636
636
|
}
|
|
637
|
-
function prefixIssues(
|
|
637
|
+
function prefixIssues(path39, issues) {
|
|
638
638
|
return issues.map((iss) => {
|
|
639
639
|
var _a4;
|
|
640
640
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
641
|
-
iss.path.unshift(
|
|
641
|
+
iss.path.unshift(path39);
|
|
642
642
|
return iss;
|
|
643
643
|
});
|
|
644
644
|
}
|
|
@@ -859,7 +859,7 @@ function formatError(error46, mapper = (issue2) => issue2.message) {
|
|
|
859
859
|
}
|
|
860
860
|
function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
861
861
|
const result = { errors: [] };
|
|
862
|
-
const processError = (error47,
|
|
862
|
+
const processError = (error47, path39 = []) => {
|
|
863
863
|
var _a4, _b;
|
|
864
864
|
for (const issue2 of error47.issues) {
|
|
865
865
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -869,7 +869,7 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
|
869
869
|
} else if (issue2.code === "invalid_element") {
|
|
870
870
|
processError({ issues: issue2.issues }, issue2.path);
|
|
871
871
|
} else {
|
|
872
|
-
const fullpath = [...
|
|
872
|
+
const fullpath = [...path39, ...issue2.path];
|
|
873
873
|
if (fullpath.length === 0) {
|
|
874
874
|
result.errors.push(mapper(issue2));
|
|
875
875
|
continue;
|
|
@@ -901,8 +901,8 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
|
901
901
|
}
|
|
902
902
|
function toDotPath(_path) {
|
|
903
903
|
const segs = [];
|
|
904
|
-
const
|
|
905
|
-
for (const seg of
|
|
904
|
+
const path39 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
905
|
+
for (const seg of path39) {
|
|
906
906
|
if (typeof seg === "number")
|
|
907
907
|
segs.push(`[${seg}]`);
|
|
908
908
|
else if (typeof seg === "symbol")
|
|
@@ -15826,28 +15826,31 @@ function resolveBackendNpmPackage() {
|
|
|
15826
15826
|
}
|
|
15827
15827
|
}
|
|
15828
15828
|
function getBackendPaths(context) {
|
|
15829
|
+
const projectRoot = context.service.projectRoot;
|
|
15830
|
+
const runtimeDir = path10.join(projectRoot, "backend");
|
|
15829
15831
|
const semiontRepo = context.options?.semiontRepo;
|
|
15830
15832
|
if (semiontRepo) {
|
|
15831
15833
|
const sourceDir = path10.join(semiontRepo, "apps", "backend");
|
|
15832
|
-
return buildPaths(sourceDir, false);
|
|
15834
|
+
return buildPaths(sourceDir, runtimeDir, false);
|
|
15833
15835
|
}
|
|
15834
15836
|
const npmDir = resolveBackendNpmPackage();
|
|
15835
15837
|
if (npmDir) {
|
|
15836
|
-
return buildPaths(npmDir, true);
|
|
15838
|
+
return buildPaths(npmDir, runtimeDir, true);
|
|
15837
15839
|
}
|
|
15838
15840
|
throw new Error(
|
|
15839
15841
|
"Cannot find backend source. Either:\n - Set SEMIONT_REPO to your semiont clone, or\n - Run: npm install @semiont/backend"
|
|
15840
15842
|
);
|
|
15841
15843
|
}
|
|
15842
|
-
function buildPaths(sourceDir, fromNpmPackage) {
|
|
15844
|
+
function buildPaths(sourceDir, runtimeDir, fromNpmPackage) {
|
|
15843
15845
|
return {
|
|
15844
15846
|
sourceDir,
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
15848
|
-
|
|
15849
|
-
|
|
15850
|
-
|
|
15847
|
+
runtimeDir,
|
|
15848
|
+
pidFile: path10.join(runtimeDir, ".pid"),
|
|
15849
|
+
envFile: path10.join(runtimeDir, ".env"),
|
|
15850
|
+
logsDir: path10.join(runtimeDir, "logs"),
|
|
15851
|
+
appLogFile: path10.join(runtimeDir, "logs", "app.log"),
|
|
15852
|
+
errorLogFile: path10.join(runtimeDir, "logs", "error.log"),
|
|
15853
|
+
tmpDir: path10.join(runtimeDir, "tmp"),
|
|
15851
15854
|
distDir: path10.join(sourceDir, "dist"),
|
|
15852
15855
|
fromNpmPackage
|
|
15853
15856
|
};
|
|
@@ -15880,7 +15883,8 @@ var init_backend_check = __esm({
|
|
|
15880
15883
|
let healthy = false;
|
|
15881
15884
|
let details = {
|
|
15882
15885
|
backendDir,
|
|
15883
|
-
port: config2.port
|
|
15886
|
+
port: config2.port,
|
|
15887
|
+
source: paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"
|
|
15884
15888
|
};
|
|
15885
15889
|
if (!fs10.existsSync(backendDir)) {
|
|
15886
15890
|
details.message = "Backend not provisioned";
|
|
@@ -16026,28 +16030,31 @@ function resolveFrontendNpmPackage() {
|
|
|
16026
16030
|
}
|
|
16027
16031
|
}
|
|
16028
16032
|
function getFrontendPaths(context) {
|
|
16033
|
+
const projectRoot = context.service.projectRoot;
|
|
16034
|
+
const runtimeDir = path11.join(projectRoot, "frontend");
|
|
16029
16035
|
const semiontRepo = context.options?.semiontRepo;
|
|
16030
16036
|
if (semiontRepo) {
|
|
16031
16037
|
const sourceDir = path11.join(semiontRepo, "apps", "frontend");
|
|
16032
|
-
return buildPaths2(sourceDir, false);
|
|
16038
|
+
return buildPaths2(sourceDir, runtimeDir, false);
|
|
16033
16039
|
}
|
|
16034
16040
|
const npmDir = resolveFrontendNpmPackage();
|
|
16035
16041
|
if (npmDir) {
|
|
16036
|
-
return buildPaths2(npmDir, true);
|
|
16042
|
+
return buildPaths2(npmDir, runtimeDir, true);
|
|
16037
16043
|
}
|
|
16038
16044
|
throw new Error(
|
|
16039
16045
|
"Cannot find frontend source. Either:\n - Set SEMIONT_REPO to your semiont clone, or\n - Run: npm install @semiont/frontend"
|
|
16040
16046
|
);
|
|
16041
16047
|
}
|
|
16042
|
-
function buildPaths2(sourceDir, fromNpmPackage) {
|
|
16048
|
+
function buildPaths2(sourceDir, runtimeDir, fromNpmPackage) {
|
|
16043
16049
|
return {
|
|
16044
16050
|
sourceDir,
|
|
16045
|
-
|
|
16046
|
-
|
|
16047
|
-
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
+
runtimeDir,
|
|
16052
|
+
pidFile: path11.join(runtimeDir, ".pid"),
|
|
16053
|
+
envLocalFile: path11.join(runtimeDir, ".env.local"),
|
|
16054
|
+
logsDir: path11.join(runtimeDir, "logs"),
|
|
16055
|
+
appLogFile: path11.join(runtimeDir, "logs", "app.log"),
|
|
16056
|
+
errorLogFile: path11.join(runtimeDir, "logs", "error.log"),
|
|
16057
|
+
tmpDir: path11.join(runtimeDir, "tmp"),
|
|
16051
16058
|
nextDir: path11.join(sourceDir, ".next"),
|
|
16052
16059
|
fromNpmPackage
|
|
16053
16060
|
};
|
|
@@ -16078,7 +16085,8 @@ var init_frontend_check = __esm({
|
|
|
16078
16085
|
let healthy = false;
|
|
16079
16086
|
let details = {
|
|
16080
16087
|
frontendDir,
|
|
16081
|
-
port: config2.port
|
|
16088
|
+
port: config2.port,
|
|
16089
|
+
source: paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"
|
|
16082
16090
|
};
|
|
16083
16091
|
if (!fs11.existsSync(frontendDir)) {
|
|
16084
16092
|
details.message = "Frontend not provisioned";
|
|
@@ -16854,9 +16862,9 @@ async function startJanusGraph(context) {
|
|
|
16854
16862
|
}
|
|
16855
16863
|
};
|
|
16856
16864
|
}
|
|
16857
|
-
async function fileExists(
|
|
16865
|
+
async function fileExists(path39) {
|
|
16858
16866
|
try {
|
|
16859
|
-
await fs15.access(
|
|
16867
|
+
await fs15.access(path39);
|
|
16860
16868
|
return true;
|
|
16861
16869
|
} catch {
|
|
16862
16870
|
return false;
|
|
@@ -16917,6 +16925,10 @@ var init_backend_start = __esm({
|
|
|
16917
16925
|
const config2 = service.config;
|
|
16918
16926
|
const paths = getBackendPaths(context);
|
|
16919
16927
|
const { sourceDir: backendSourceDir, envFile, pidFile, logsDir, tmpDir } = paths;
|
|
16928
|
+
if (service.verbose) {
|
|
16929
|
+
printInfo(`Source: ${backendSourceDir}`);
|
|
16930
|
+
printInfo(`Mode: ${paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"}`);
|
|
16931
|
+
}
|
|
16920
16932
|
if (!fs16.existsSync(backendSourceDir)) {
|
|
16921
16933
|
return {
|
|
16922
16934
|
success: false,
|
|
@@ -17135,6 +17147,10 @@ var init_frontend_start = __esm({
|
|
|
17135
17147
|
const config2 = service.config;
|
|
17136
17148
|
const paths = getFrontendPaths(context);
|
|
17137
17149
|
const { sourceDir: frontendSourceDir, envLocalFile: envFile, pidFile, logsDir, tmpDir } = paths;
|
|
17150
|
+
if (service.verbose) {
|
|
17151
|
+
printInfo(`Source: ${frontendSourceDir}`);
|
|
17152
|
+
printInfo(`Mode: ${paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"}`);
|
|
17153
|
+
}
|
|
17138
17154
|
if (!fs17.existsSync(frontendSourceDir)) {
|
|
17139
17155
|
return {
|
|
17140
17156
|
success: false,
|
|
@@ -17788,9 +17804,9 @@ Files placed here will persist across service restarts.
|
|
|
17788
17804
|
// src/platforms/posix/handlers/graph-provision.ts
|
|
17789
17805
|
import * as fs21 from "fs/promises";
|
|
17790
17806
|
import { execSync as execSync10 } from "child_process";
|
|
17791
|
-
async function fileExists2(
|
|
17807
|
+
async function fileExists2(path39) {
|
|
17792
17808
|
try {
|
|
17793
|
-
await fs21.access(
|
|
17809
|
+
await fs21.access(path39);
|
|
17794
17810
|
return true;
|
|
17795
17811
|
} catch {
|
|
17796
17812
|
return false;
|
|
@@ -18004,7 +18020,7 @@ var init_backend_provision = __esm({
|
|
|
18004
18020
|
}
|
|
18005
18021
|
}
|
|
18006
18022
|
const paths = getBackendPaths(context);
|
|
18007
|
-
const { sourceDir: backendSourceDir, envFile, logsDir, tmpDir } = paths;
|
|
18023
|
+
const { sourceDir: backendSourceDir, runtimeDir, envFile, logsDir, tmpDir } = paths;
|
|
18008
18024
|
if (!service.quiet) {
|
|
18009
18025
|
printInfo(`Provisioning backend service ${service.name}...`);
|
|
18010
18026
|
if (paths.fromNpmPackage) {
|
|
@@ -18012,11 +18028,13 @@ var init_backend_provision = __esm({
|
|
|
18012
18028
|
} else {
|
|
18013
18029
|
printInfo(`Using semiont repo: ${options.semiontRepo}`);
|
|
18014
18030
|
}
|
|
18031
|
+
printInfo(`Runtime directory: ${runtimeDir}`);
|
|
18015
18032
|
}
|
|
18033
|
+
fs22.mkdirSync(runtimeDir, { recursive: true });
|
|
18016
18034
|
fs22.mkdirSync(logsDir, { recursive: true });
|
|
18017
18035
|
fs22.mkdirSync(tmpDir, { recursive: true });
|
|
18018
18036
|
if (!service.quiet) {
|
|
18019
|
-
printInfo(`Created runtime directories in: ${
|
|
18037
|
+
printInfo(`Created runtime directories in: ${runtimeDir}`);
|
|
18020
18038
|
}
|
|
18021
18039
|
const envConfig = service.environmentConfig;
|
|
18022
18040
|
const dbConfig = envConfig.services?.database;
|
|
@@ -18246,7 +18264,7 @@ var init_backend_provision = __esm({
|
|
|
18246
18264
|
printInfo("You may need to run migrations manually: npx prisma migrate deploy");
|
|
18247
18265
|
}
|
|
18248
18266
|
}
|
|
18249
|
-
const readmePath = path18.join(
|
|
18267
|
+
const readmePath = path18.join(runtimeDir, "RUNTIME.md");
|
|
18250
18268
|
if (!fs22.existsSync(readmePath)) {
|
|
18251
18269
|
const readmeContent = `# Backend Runtime Directory
|
|
18252
18270
|
|
|
@@ -18254,37 +18272,28 @@ This directory contains runtime files for the backend service.
|
|
|
18254
18272
|
|
|
18255
18273
|
## Structure
|
|
18256
18274
|
|
|
18257
|
-
- \`.env\` - Environment configuration
|
|
18275
|
+
- \`.env\` - Environment configuration
|
|
18258
18276
|
- \`logs/\` - Application logs
|
|
18259
18277
|
- \`tmp/\` - Temporary files
|
|
18260
18278
|
- \`.pid\` - Process ID when running
|
|
18261
18279
|
|
|
18262
|
-
## Configuration
|
|
18263
|
-
|
|
18264
|
-
Edit \`.env\` to configure:
|
|
18265
|
-
- Database connection (DATABASE_URL)
|
|
18266
|
-
- Backend URL (BACKEND_URL)
|
|
18267
|
-
- JWT secret (JWT_SECRET)
|
|
18268
|
-
- Port (PORT)
|
|
18269
|
-
- Other environment-specific settings
|
|
18270
|
-
|
|
18271
18280
|
## Source Code
|
|
18272
18281
|
|
|
18273
|
-
|
|
18274
|
-
${backendSourceDir}
|
|
18282
|
+
${paths.fromNpmPackage ? `Installed npm package: ${backendSourceDir}` : `Semiont repo: ${backendSourceDir}`}
|
|
18275
18283
|
|
|
18276
18284
|
## Commands
|
|
18277
18285
|
|
|
18278
18286
|
- Start: \`semiont start --service backend --environment ${service.environment}\`
|
|
18279
18287
|
- Check: \`semiont check --service backend --environment ${service.environment}\`
|
|
18280
18288
|
- Stop: \`semiont stop --service backend --environment ${service.environment}\`
|
|
18281
|
-
- Logs: \`tail -f
|
|
18289
|
+
- Logs: \`tail -f ${logsDir}/app.log\`
|
|
18282
18290
|
`;
|
|
18283
18291
|
fs22.writeFileSync(readmePath, readmeContent);
|
|
18284
18292
|
}
|
|
18285
18293
|
const metadata = {
|
|
18286
18294
|
serviceType: "backend",
|
|
18287
18295
|
backendSourceDir,
|
|
18296
|
+
runtimeDir,
|
|
18288
18297
|
envFile,
|
|
18289
18298
|
logsDir,
|
|
18290
18299
|
tmpDir,
|
|
@@ -18295,6 +18304,7 @@ ${backendSourceDir}
|
|
|
18295
18304
|
printInfo("");
|
|
18296
18305
|
printInfo("Backend details:");
|
|
18297
18306
|
printInfo(` Source directory: ${backendSourceDir}`);
|
|
18307
|
+
printInfo(` Runtime directory: ${runtimeDir}`);
|
|
18298
18308
|
printInfo(` Environment file: ${envFile}`);
|
|
18299
18309
|
printInfo(` Logs directory: ${logsDir}`);
|
|
18300
18310
|
printInfo("");
|
|
@@ -18370,7 +18380,7 @@ var init_frontend_provision = __esm({
|
|
|
18370
18380
|
}
|
|
18371
18381
|
}
|
|
18372
18382
|
const paths = getFrontendPaths(context);
|
|
18373
|
-
const { sourceDir: frontendSourceDir, logsDir, tmpDir, envLocalFile: envFile } = paths;
|
|
18383
|
+
const { sourceDir: frontendSourceDir, runtimeDir, logsDir, tmpDir, envLocalFile: envFile } = paths;
|
|
18374
18384
|
if (!service.quiet) {
|
|
18375
18385
|
printInfo(`Provisioning frontend service ${service.name}...`);
|
|
18376
18386
|
if (paths.fromNpmPackage) {
|
|
@@ -18378,11 +18388,13 @@ var init_frontend_provision = __esm({
|
|
|
18378
18388
|
} else {
|
|
18379
18389
|
printInfo(`Using source directory: ${frontendSourceDir}`);
|
|
18380
18390
|
}
|
|
18391
|
+
printInfo(`Runtime directory: ${runtimeDir}`);
|
|
18381
18392
|
}
|
|
18393
|
+
fs23.mkdirSync(runtimeDir, { recursive: true });
|
|
18382
18394
|
fs23.mkdirSync(logsDir, { recursive: true });
|
|
18383
18395
|
fs23.mkdirSync(tmpDir, { recursive: true });
|
|
18384
18396
|
if (!service.quiet) {
|
|
18385
|
-
printInfo(`Created runtime directories in: ${
|
|
18397
|
+
printInfo(`Created runtime directories in: ${runtimeDir}`);
|
|
18386
18398
|
}
|
|
18387
18399
|
const envExamplePath = path19.join(frontendSourceDir, ".env.example");
|
|
18388
18400
|
if (fs23.existsSync(envFile)) {
|
|
@@ -18594,7 +18606,7 @@ NEXT_PUBLIC_OAUTH_ALLOWED_DOMAINS=${oauthAllowedDomains.join(",")}
|
|
|
18594
18606
|
}
|
|
18595
18607
|
}
|
|
18596
18608
|
}
|
|
18597
|
-
const readmePath = path19.join(
|
|
18609
|
+
const readmePath = path19.join(runtimeDir, "RUNTIME.md");
|
|
18598
18610
|
if (!fs23.existsSync(readmePath)) {
|
|
18599
18611
|
const readmeContent = `# Frontend Runtime Directory
|
|
18600
18612
|
|
|
@@ -18602,35 +18614,28 @@ This directory contains runtime files for the frontend service.
|
|
|
18602
18614
|
|
|
18603
18615
|
## Structure
|
|
18604
18616
|
|
|
18605
|
-
- \`.env.local\` - Environment configuration
|
|
18617
|
+
- \`.env.local\` - Environment configuration
|
|
18606
18618
|
- \`logs/\` - Application logs
|
|
18607
18619
|
- \`tmp/\` - Temporary files
|
|
18608
18620
|
- \`.pid\` - Process ID when running
|
|
18609
18621
|
|
|
18610
|
-
## Configuration
|
|
18611
|
-
|
|
18612
|
-
Edit \`.env.local\` to configure:
|
|
18613
|
-
- Server API URL (SERVER_API_URL) - set to localhost for POSIX platform
|
|
18614
|
-
- Port (PORT)
|
|
18615
|
-
- Other environment-specific settings
|
|
18616
|
-
|
|
18617
18622
|
## Source Code
|
|
18618
18623
|
|
|
18619
|
-
|
|
18620
|
-
${frontendSourceDir}
|
|
18624
|
+
${paths.fromNpmPackage ? `Installed npm package: ${frontendSourceDir}` : `Semiont repo: ${frontendSourceDir}`}
|
|
18621
18625
|
|
|
18622
18626
|
## Commands
|
|
18623
18627
|
|
|
18624
18628
|
- Start: \`semiont start --service frontend --environment ${service.environment}\`
|
|
18625
18629
|
- Check: \`semiont check --service frontend --environment ${service.environment}\`
|
|
18626
18630
|
- Stop: \`semiont stop --service frontend --environment ${service.environment}\`
|
|
18627
|
-
- Logs: \`tail -f
|
|
18631
|
+
- Logs: \`tail -f ${logsDir}/app.log\`
|
|
18628
18632
|
`;
|
|
18629
18633
|
fs23.writeFileSync(readmePath, readmeContent);
|
|
18630
18634
|
}
|
|
18631
18635
|
const metadata = {
|
|
18632
18636
|
serviceType: "frontend",
|
|
18633
18637
|
frontendSourceDir,
|
|
18638
|
+
runtimeDir,
|
|
18634
18639
|
envFile,
|
|
18635
18640
|
logsDir,
|
|
18636
18641
|
tmpDir,
|
|
@@ -18641,6 +18646,7 @@ ${frontendSourceDir}
|
|
|
18641
18646
|
printInfo("");
|
|
18642
18647
|
printInfo("Frontend details:");
|
|
18643
18648
|
printInfo(` Source directory: ${frontendSourceDir}`);
|
|
18649
|
+
printInfo(` Runtime directory: ${runtimeDir}`);
|
|
18644
18650
|
printInfo(` Environment file: ${envFile}`);
|
|
18645
18651
|
printInfo(` Logs directory: ${logsDir}`);
|
|
18646
18652
|
printInfo("");
|
|
@@ -19051,9 +19057,9 @@ async function stopJanusGraph(context) {
|
|
|
19051
19057
|
};
|
|
19052
19058
|
}
|
|
19053
19059
|
}
|
|
19054
|
-
async function fileExists3(
|
|
19060
|
+
async function fileExists3(path39) {
|
|
19055
19061
|
try {
|
|
19056
|
-
await fs25.access(
|
|
19062
|
+
await fs25.access(path39);
|
|
19057
19063
|
return true;
|
|
19058
19064
|
} catch {
|
|
19059
19065
|
return false;
|
|
@@ -19350,7 +19356,6 @@ var init_process_manager = __esm({
|
|
|
19350
19356
|
|
|
19351
19357
|
// src/platforms/posix/handlers/backend-stop.ts
|
|
19352
19358
|
import * as fs27 from "fs";
|
|
19353
|
-
import * as path24 from "path";
|
|
19354
19359
|
var stopBackendService, backendStopDescriptor;
|
|
19355
19360
|
var init_backend_stop = __esm({
|
|
19356
19361
|
"src/platforms/posix/handlers/backend-stop.ts"() {
|
|
@@ -19358,21 +19363,15 @@ var init_backend_stop = __esm({
|
|
|
19358
19363
|
init_cli_logger();
|
|
19359
19364
|
init_process_manager();
|
|
19360
19365
|
init_preflight_utils();
|
|
19366
|
+
init_backend_paths();
|
|
19361
19367
|
stopBackendService = async (context) => {
|
|
19362
19368
|
const { service } = context;
|
|
19363
|
-
const
|
|
19364
|
-
|
|
19365
|
-
|
|
19366
|
-
|
|
19367
|
-
|
|
19368
|
-
metadata: { serviceType: "backend" }
|
|
19369
|
-
};
|
|
19369
|
+
const paths = getBackendPaths(context);
|
|
19370
|
+
const { sourceDir: backendSourceDir, pidFile, appLogFile: appLogPath, errorLogFile: errorLogPath } = paths;
|
|
19371
|
+
if (service.verbose) {
|
|
19372
|
+
printInfo(`Source: ${backendSourceDir}`);
|
|
19373
|
+
printInfo(`Mode: ${paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"}`);
|
|
19370
19374
|
}
|
|
19371
|
-
const backendSourceDir = path24.join(semiontRepo, "apps", "backend");
|
|
19372
|
-
const pidFile = path24.join(backendSourceDir, ".pid");
|
|
19373
|
-
const logsDir = path24.join(backendSourceDir, "logs");
|
|
19374
|
-
const appLogPath = path24.join(logsDir, "app.log");
|
|
19375
|
-
const errorLogPath = path24.join(logsDir, "error.log");
|
|
19376
19375
|
if (!fs27.existsSync(backendSourceDir)) {
|
|
19377
19376
|
return {
|
|
19378
19377
|
success: false,
|
|
@@ -19526,6 +19525,10 @@ var init_frontend_stop = __esm({
|
|
|
19526
19525
|
const { service } = context;
|
|
19527
19526
|
const paths = getFrontendPaths(context);
|
|
19528
19527
|
const { sourceDir: frontendSourceDir, pidFile, appLogFile: appLogPath, errorLogFile: errorLogPath } = paths;
|
|
19528
|
+
if (service.verbose) {
|
|
19529
|
+
printInfo(`Source: ${frontendSourceDir}`);
|
|
19530
|
+
printInfo(`Mode: ${paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"}`);
|
|
19531
|
+
}
|
|
19529
19532
|
if (!fs28.existsSync(frontendSourceDir)) {
|
|
19530
19533
|
return {
|
|
19531
19534
|
success: false,
|
|
@@ -19842,7 +19845,7 @@ var init_handlers = __esm({
|
|
|
19842
19845
|
// src/platforms/posix/platform.ts
|
|
19843
19846
|
import { execSync as execSync17 } from "child_process";
|
|
19844
19847
|
import * as fs30 from "fs";
|
|
19845
|
-
import * as
|
|
19848
|
+
import * as path24 from "path";
|
|
19846
19849
|
var PosixPlatform;
|
|
19847
19850
|
var init_platform2 = __esm({
|
|
19848
19851
|
"src/platforms/posix/platform.ts"() {
|
|
@@ -19975,19 +19978,19 @@ var init_platform2 = __esm({
|
|
|
19975
19978
|
}
|
|
19976
19979
|
if (logs.length === 0) {
|
|
19977
19980
|
const logPaths = [
|
|
19978
|
-
|
|
19979
|
-
|
|
19980
|
-
|
|
19981
|
+
path24.join("/var/log", service.name, "*.log"),
|
|
19982
|
+
path24.join(service.projectRoot, "logs", "*.log"),
|
|
19983
|
+
path24.join(service.projectRoot, ".logs", "*.log")
|
|
19981
19984
|
];
|
|
19982
19985
|
for (const pattern of logPaths) {
|
|
19983
|
-
const dir =
|
|
19984
|
-
const filePattern =
|
|
19986
|
+
const dir = path24.dirname(pattern);
|
|
19987
|
+
const filePattern = path24.basename(pattern);
|
|
19985
19988
|
if (fs30.existsSync(dir)) {
|
|
19986
19989
|
const files = fs30.readdirSync(dir).filter(
|
|
19987
19990
|
(f) => f.match(filePattern.replace("*", ".*"))
|
|
19988
19991
|
);
|
|
19989
19992
|
for (const file2 of files) {
|
|
19990
|
-
const fullPath =
|
|
19993
|
+
const fullPath = path24.join(dir, file2);
|
|
19991
19994
|
const content = this.tailFile(fullPath, tail);
|
|
19992
19995
|
if (content) {
|
|
19993
19996
|
const lines = content.split("\n");
|
|
@@ -20021,17 +20024,17 @@ var init_platform2 = __esm({
|
|
|
20021
20024
|
"/var/log/postgresql/*.log",
|
|
20022
20025
|
"/var/log/mysql/*.log",
|
|
20023
20026
|
"/var/log/mongodb/*.log",
|
|
20024
|
-
|
|
20027
|
+
path24.join(service.projectRoot, "data", "logs", "*.log")
|
|
20025
20028
|
];
|
|
20026
20029
|
for (const pattern of logPaths) {
|
|
20027
|
-
const dir =
|
|
20028
|
-
const filePattern =
|
|
20030
|
+
const dir = path24.dirname(pattern);
|
|
20031
|
+
const filePattern = path24.basename(pattern);
|
|
20029
20032
|
if (fs30.existsSync(dir)) {
|
|
20030
20033
|
const files = fs30.readdirSync(dir).filter(
|
|
20031
20034
|
(f) => f.match(filePattern.replace("*", ".*"))
|
|
20032
20035
|
);
|
|
20033
20036
|
for (const file2 of files.slice(-1)) {
|
|
20034
|
-
const fullPath =
|
|
20037
|
+
const fullPath = path24.join(dir, file2);
|
|
20035
20038
|
const content = this.tailFile(fullPath, tail);
|
|
20036
20039
|
if (content) {
|
|
20037
20040
|
const lines = content.split("\n");
|
|
@@ -20985,11 +20988,11 @@ var init_database_start2 = __esm({
|
|
|
20985
20988
|
|
|
20986
20989
|
// src/platforms/container/handlers/graph-start.ts
|
|
20987
20990
|
import * as fs31 from "fs/promises";
|
|
20988
|
-
import * as
|
|
20991
|
+
import * as path25 from "path";
|
|
20989
20992
|
import { execSync as execSync23 } from "child_process";
|
|
20990
20993
|
async function startJanusGraph2(context) {
|
|
20991
20994
|
const { service, containerName } = context;
|
|
20992
|
-
const composePath =
|
|
20995
|
+
const composePath = path25.join(service.projectRoot, "docker-compose.janusgraph.yml");
|
|
20993
20996
|
if (!await fileExists4(composePath)) {
|
|
20994
20997
|
return {
|
|
20995
20998
|
success: false,
|
|
@@ -21115,9 +21118,9 @@ async function startJanusGraph2(context) {
|
|
|
21115
21118
|
};
|
|
21116
21119
|
}
|
|
21117
21120
|
}
|
|
21118
|
-
async function fileExists4(
|
|
21121
|
+
async function fileExists4(path39) {
|
|
21119
21122
|
try {
|
|
21120
|
-
await fs31.access(
|
|
21123
|
+
await fs31.access(path39);
|
|
21121
21124
|
return true;
|
|
21122
21125
|
} catch {
|
|
21123
21126
|
return false;
|
|
@@ -21167,7 +21170,7 @@ var init_graph_start2 = __esm({
|
|
|
21167
21170
|
// src/platforms/container/handlers/database-provision.ts
|
|
21168
21171
|
import { execSync as execSync24 } from "child_process";
|
|
21169
21172
|
import * as fs32 from "fs";
|
|
21170
|
-
import * as
|
|
21173
|
+
import * as path26 from "path";
|
|
21171
21174
|
var provisionDatabaseContainer, preflightDatabaseProvision, databaseProvisionDescriptor;
|
|
21172
21175
|
var init_database_provision = __esm({
|
|
21173
21176
|
"src/platforms/container/handlers/database-provision.ts"() {
|
|
@@ -21204,9 +21207,9 @@ var init_database_provision = __esm({
|
|
|
21204
21207
|
} catch (error46) {
|
|
21205
21208
|
printWarning(`Failed to pull image ${image}, will try to use local`);
|
|
21206
21209
|
}
|
|
21207
|
-
const initScriptsPath =
|
|
21208
|
-
const migrationsPath =
|
|
21209
|
-
const seedDataPath =
|
|
21210
|
+
const initScriptsPath = path26.join(service.projectRoot, "db", "init");
|
|
21211
|
+
const migrationsPath = path26.join(service.projectRoot, "db", "migrations");
|
|
21212
|
+
const seedDataPath = path26.join(service.projectRoot, "db", "seed");
|
|
21210
21213
|
const hasInitScripts = fs32.existsSync(initScriptsPath);
|
|
21211
21214
|
const hasMigrations = fs32.existsSync(migrationsPath);
|
|
21212
21215
|
const hasSeedData = fs32.existsSync(seedDataPath);
|
|
@@ -23957,7 +23960,7 @@ var init_js_yaml = __esm({
|
|
|
23957
23960
|
|
|
23958
23961
|
// src/platforms/container/handlers/graph-provision.ts
|
|
23959
23962
|
import * as fs33 from "fs/promises";
|
|
23960
|
-
import * as
|
|
23963
|
+
import * as path27 from "path";
|
|
23961
23964
|
import { execSync as execSync25 } from "child_process";
|
|
23962
23965
|
var provisionGraphService2, preflightGraphProvision2, graphProvisionDescriptor2;
|
|
23963
23966
|
var init_graph_provision2 = __esm({
|
|
@@ -24102,7 +24105,7 @@ var init_graph_provision2 = __esm({
|
|
|
24102
24105
|
...withElasticsearch && { "elasticsearch-data": {} }
|
|
24103
24106
|
}
|
|
24104
24107
|
};
|
|
24105
|
-
const composePath =
|
|
24108
|
+
const composePath = path27.join(service.projectRoot, "docker-compose.janusgraph.yml");
|
|
24106
24109
|
await fs33.writeFile(
|
|
24107
24110
|
composePath,
|
|
24108
24111
|
`# Generated by semiont provision --service janusgraph
|
|
@@ -24171,12 +24174,12 @@ var init_graph_provision2 = __esm({
|
|
|
24171
24174
|
});
|
|
24172
24175
|
|
|
24173
24176
|
// src/platforms/container/handlers/graph-stop.ts
|
|
24174
|
-
import * as
|
|
24177
|
+
import * as path28 from "path";
|
|
24175
24178
|
import { execSync as execSync26 } from "child_process";
|
|
24176
24179
|
import * as fs34 from "fs/promises";
|
|
24177
24180
|
async function stopJanusGraph2(context) {
|
|
24178
24181
|
const { service, options, containerName } = context;
|
|
24179
|
-
const composePath =
|
|
24182
|
+
const composePath = path28.join(service.projectRoot, "docker-compose.janusgraph.yml");
|
|
24180
24183
|
if (!await fileExists5(composePath)) {
|
|
24181
24184
|
if (!service.quiet) {
|
|
24182
24185
|
printWarning("JanusGraph is not provisioned.");
|
|
@@ -24272,9 +24275,9 @@ async function stopJanusGraph2(context) {
|
|
|
24272
24275
|
};
|
|
24273
24276
|
}
|
|
24274
24277
|
}
|
|
24275
|
-
async function fileExists5(
|
|
24278
|
+
async function fileExists5(path39) {
|
|
24276
24279
|
try {
|
|
24277
|
-
await fs34.access(
|
|
24280
|
+
await fs34.access(path39);
|
|
24278
24281
|
return true;
|
|
24279
24282
|
} catch {
|
|
24280
24283
|
return false;
|
|
@@ -24463,18 +24466,18 @@ var init_database_stop = __esm({
|
|
|
24463
24466
|
});
|
|
24464
24467
|
|
|
24465
24468
|
// src/platforms/container/handlers/proxy-paths.ts
|
|
24466
|
-
import * as
|
|
24469
|
+
import * as path29 from "path";
|
|
24467
24470
|
function getProxyPaths2(context) {
|
|
24468
24471
|
const projectRoot = context.service.projectRoot;
|
|
24469
|
-
const runtimeDir =
|
|
24472
|
+
const runtimeDir = path29.join(projectRoot, "proxy");
|
|
24470
24473
|
return {
|
|
24471
24474
|
runtimeDir,
|
|
24472
|
-
logsDir:
|
|
24473
|
-
pidFile:
|
|
24474
|
-
configFile:
|
|
24475
|
-
containerLogFile:
|
|
24476
|
-
accessLogFile:
|
|
24477
|
-
adminLogFile:
|
|
24475
|
+
logsDir: path29.join(runtimeDir, "logs"),
|
|
24476
|
+
pidFile: path29.join(runtimeDir, "proxy.pid"),
|
|
24477
|
+
configFile: path29.join(runtimeDir, "envoy.yaml"),
|
|
24478
|
+
containerLogFile: path29.join(runtimeDir, "logs", "container.log"),
|
|
24479
|
+
accessLogFile: path29.join(runtimeDir, "logs", "access.log"),
|
|
24480
|
+
adminLogFile: path29.join(runtimeDir, "logs", "admin.log")
|
|
24478
24481
|
};
|
|
24479
24482
|
}
|
|
24480
24483
|
var init_proxy_paths2 = __esm({
|
|
@@ -24485,7 +24488,7 @@ var init_proxy_paths2 = __esm({
|
|
|
24485
24488
|
|
|
24486
24489
|
// src/platforms/container/handlers/proxy-provision.ts
|
|
24487
24490
|
import * as fs35 from "fs";
|
|
24488
|
-
import * as
|
|
24491
|
+
import * as path30 from "path";
|
|
24489
24492
|
import { execSync as execSync28 } from "child_process";
|
|
24490
24493
|
function getHostAddress() {
|
|
24491
24494
|
const platform = process.platform;
|
|
@@ -24552,7 +24555,7 @@ var init_proxy_provision2 = __esm({
|
|
|
24552
24555
|
const backendPort = config2.backendPort || 4e3;
|
|
24553
24556
|
const frontendPort = config2.frontendPort || 3e3;
|
|
24554
24557
|
if (config2.type === "envoy") {
|
|
24555
|
-
const templatePath =
|
|
24558
|
+
const templatePath = path30.join(getTemplatesDir(import.meta.url), "envoy.yaml");
|
|
24556
24559
|
if (!fs35.existsSync(templatePath)) {
|
|
24557
24560
|
return {
|
|
24558
24561
|
success: false,
|
|
@@ -26387,7 +26390,7 @@ var init_rds_start = __esm({
|
|
|
26387
26390
|
|
|
26388
26391
|
// src/platforms/aws/handlers/stack-provision.ts
|
|
26389
26392
|
import { spawnSync } from "child_process";
|
|
26390
|
-
import * as
|
|
26393
|
+
import * as path31 from "path";
|
|
26391
26394
|
import * as fs38 from "fs";
|
|
26392
26395
|
var provisionStackService, preflightStackProvision, stackProvisionDescriptor;
|
|
26393
26396
|
var init_stack_provision = __esm({
|
|
@@ -26458,7 +26461,7 @@ var init_stack_provision = __esm({
|
|
|
26458
26461
|
continue;
|
|
26459
26462
|
}
|
|
26460
26463
|
try {
|
|
26461
|
-
const cdkContextPath =
|
|
26464
|
+
const cdkContextPath = path31.join(projectRoot, "cdk.context.json");
|
|
26462
26465
|
const cdkContext = fs38.existsSync(cdkContextPath) ? JSON.parse(fs38.readFileSync(cdkContextPath, "utf-8")) : {};
|
|
26463
26466
|
cdkContext[`availability-zones:account=${awsConfig.accountId}:region=${awsConfig.region}`] = cdkContext[`availability-zones:account=${awsConfig.accountId}:region=${awsConfig.region}`] || [`${awsConfig.region}a`, `${awsConfig.region}b`];
|
|
26464
26467
|
fs38.writeFileSync(cdkContextPath, JSON.stringify(cdkContext, null, 2));
|
|
@@ -26562,7 +26565,7 @@ var init_stack_provision = __esm({
|
|
|
26562
26565
|
|
|
26563
26566
|
// src/platforms/aws/handlers/ecs-publish.ts
|
|
26564
26567
|
import { execSync as execSync37 } from "child_process";
|
|
26565
|
-
import * as
|
|
26568
|
+
import * as path32 from "path";
|
|
26566
26569
|
import * as fs39 from "fs";
|
|
26567
26570
|
async function createNewTaskDefinition(service, imageUri, region, _accountId, cfnDiscoveredResources, resourceName) {
|
|
26568
26571
|
if (!service || !imageUri) return "";
|
|
@@ -26699,7 +26702,7 @@ var init_ecs_publish = __esm({
|
|
|
26699
26702
|
}
|
|
26700
26703
|
}
|
|
26701
26704
|
try {
|
|
26702
|
-
const apiTypesPath =
|
|
26705
|
+
const apiTypesPath = path32.join(buildContext, "packages", "api-types");
|
|
26703
26706
|
if (fs39.existsSync(apiTypesPath)) {
|
|
26704
26707
|
execSync37("npm run build", {
|
|
26705
26708
|
cwd: apiTypesPath,
|
|
@@ -26707,7 +26710,7 @@ var init_ecs_publish = __esm({
|
|
|
26707
26710
|
stdio: service.verbose ? "inherit" : "pipe"
|
|
26708
26711
|
});
|
|
26709
26712
|
}
|
|
26710
|
-
const appPath =
|
|
26713
|
+
const appPath = path32.join(buildContext, "apps", service.name);
|
|
26711
26714
|
if (fs39.existsSync(appPath)) {
|
|
26712
26715
|
execSync37("npm run build", {
|
|
26713
26716
|
cwd: appPath,
|
|
@@ -29671,17 +29674,17 @@ var init_headers = __esm({
|
|
|
29671
29674
|
function encodeURIPath(str3) {
|
|
29672
29675
|
return str3.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
29673
29676
|
}
|
|
29674
|
-
var EMPTY, createPathTagFunction,
|
|
29677
|
+
var EMPTY, createPathTagFunction, path33;
|
|
29675
29678
|
var init_path = __esm({
|
|
29676
29679
|
"../../node_modules/@anthropic-ai/sdk/internal/utils/path.mjs"() {
|
|
29677
29680
|
init_error();
|
|
29678
29681
|
EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
29679
|
-
createPathTagFunction = (pathEncoder = encodeURIPath) => function
|
|
29682
|
+
createPathTagFunction = (pathEncoder = encodeURIPath) => function path39(statics, ...params) {
|
|
29680
29683
|
if (statics.length === 1)
|
|
29681
29684
|
return statics[0];
|
|
29682
29685
|
let postPath = false;
|
|
29683
29686
|
const invalidSegments = [];
|
|
29684
|
-
const
|
|
29687
|
+
const path40 = statics.reduce((previousValue, currentValue, index) => {
|
|
29685
29688
|
if (/[?#]/.test(currentValue)) {
|
|
29686
29689
|
postPath = true;
|
|
29687
29690
|
}
|
|
@@ -29698,7 +29701,7 @@ var init_path = __esm({
|
|
|
29698
29701
|
}
|
|
29699
29702
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
29700
29703
|
}, "");
|
|
29701
|
-
const pathOnly =
|
|
29704
|
+
const pathOnly = path40.split(/[?#]/, 1)[0];
|
|
29702
29705
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
29703
29706
|
let match;
|
|
29704
29707
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -29719,12 +29722,12 @@ var init_path = __esm({
|
|
|
29719
29722
|
}, "");
|
|
29720
29723
|
throw new AnthropicError(`Path parameters result in path with invalid segments:
|
|
29721
29724
|
${invalidSegments.map((e) => e.error).join("\n")}
|
|
29722
|
-
${
|
|
29725
|
+
${path40}
|
|
29723
29726
|
${underline}`);
|
|
29724
29727
|
}
|
|
29725
|
-
return
|
|
29728
|
+
return path40;
|
|
29726
29729
|
};
|
|
29727
|
-
|
|
29730
|
+
path33 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
29728
29731
|
}
|
|
29729
29732
|
});
|
|
29730
29733
|
|
|
@@ -29772,7 +29775,7 @@ var init_files = __esm({
|
|
|
29772
29775
|
*/
|
|
29773
29776
|
delete(fileID, params = {}, options) {
|
|
29774
29777
|
const { betas } = params ?? {};
|
|
29775
|
-
return this._client.delete(
|
|
29778
|
+
return this._client.delete(path33`/v1/files/${fileID}`, {
|
|
29776
29779
|
...options,
|
|
29777
29780
|
headers: buildHeaders([
|
|
29778
29781
|
{ "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() },
|
|
@@ -29795,7 +29798,7 @@ var init_files = __esm({
|
|
|
29795
29798
|
*/
|
|
29796
29799
|
download(fileID, params = {}, options) {
|
|
29797
29800
|
const { betas } = params ?? {};
|
|
29798
|
-
return this._client.get(
|
|
29801
|
+
return this._client.get(path33`/v1/files/${fileID}/content`, {
|
|
29799
29802
|
...options,
|
|
29800
29803
|
headers: buildHeaders([
|
|
29801
29804
|
{
|
|
@@ -29818,7 +29821,7 @@ var init_files = __esm({
|
|
|
29818
29821
|
*/
|
|
29819
29822
|
retrieveMetadata(fileID, params = {}, options) {
|
|
29820
29823
|
const { betas } = params ?? {};
|
|
29821
|
-
return this._client.get(
|
|
29824
|
+
return this._client.get(path33`/v1/files/${fileID}`, {
|
|
29822
29825
|
...options,
|
|
29823
29826
|
headers: buildHeaders([
|
|
29824
29827
|
{ "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() },
|
|
@@ -29875,7 +29878,7 @@ var init_models = __esm({
|
|
|
29875
29878
|
*/
|
|
29876
29879
|
retrieve(modelID, params = {}, options) {
|
|
29877
29880
|
const { betas } = params ?? {};
|
|
29878
|
-
return this._client.get(
|
|
29881
|
+
return this._client.get(path33`/v1/models/${modelID}?beta=true`, {
|
|
29879
29882
|
...options,
|
|
29880
29883
|
headers: buildHeaders([
|
|
29881
29884
|
{ ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
|
|
@@ -30028,7 +30031,7 @@ var init_batches = __esm({
|
|
|
30028
30031
|
*/
|
|
30029
30032
|
retrieve(messageBatchID, params = {}, options) {
|
|
30030
30033
|
const { betas } = params ?? {};
|
|
30031
|
-
return this._client.get(
|
|
30034
|
+
return this._client.get(path33`/v1/messages/batches/${messageBatchID}?beta=true`, {
|
|
30032
30035
|
...options,
|
|
30033
30036
|
headers: buildHeaders([
|
|
30034
30037
|
{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() },
|
|
@@ -30081,7 +30084,7 @@ var init_batches = __esm({
|
|
|
30081
30084
|
*/
|
|
30082
30085
|
delete(messageBatchID, params = {}, options) {
|
|
30083
30086
|
const { betas } = params ?? {};
|
|
30084
|
-
return this._client.delete(
|
|
30087
|
+
return this._client.delete(path33`/v1/messages/batches/${messageBatchID}?beta=true`, {
|
|
30085
30088
|
...options,
|
|
30086
30089
|
headers: buildHeaders([
|
|
30087
30090
|
{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() },
|
|
@@ -30113,7 +30116,7 @@ var init_batches = __esm({
|
|
|
30113
30116
|
*/
|
|
30114
30117
|
cancel(messageBatchID, params = {}, options) {
|
|
30115
30118
|
const { betas } = params ?? {};
|
|
30116
|
-
return this._client.post(
|
|
30119
|
+
return this._client.post(path33`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {
|
|
30117
30120
|
...options,
|
|
30118
30121
|
headers: buildHeaders([
|
|
30119
30122
|
{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() },
|
|
@@ -32017,7 +32020,7 @@ var init_batches2 = __esm({
|
|
|
32017
32020
|
* ```
|
|
32018
32021
|
*/
|
|
32019
32022
|
retrieve(messageBatchID, options) {
|
|
32020
|
-
return this._client.get(
|
|
32023
|
+
return this._client.get(path33`/v1/messages/batches/${messageBatchID}`, options);
|
|
32021
32024
|
}
|
|
32022
32025
|
/**
|
|
32023
32026
|
* List all Message Batches within a Workspace. Most recently created batches are
|
|
@@ -32053,7 +32056,7 @@ var init_batches2 = __esm({
|
|
|
32053
32056
|
* ```
|
|
32054
32057
|
*/
|
|
32055
32058
|
delete(messageBatchID, options) {
|
|
32056
|
-
return this._client.delete(
|
|
32059
|
+
return this._client.delete(path33`/v1/messages/batches/${messageBatchID}`, options);
|
|
32057
32060
|
}
|
|
32058
32061
|
/**
|
|
32059
32062
|
* Batches may be canceled any time before processing ends. Once cancellation is
|
|
@@ -32077,7 +32080,7 @@ var init_batches2 = __esm({
|
|
|
32077
32080
|
* ```
|
|
32078
32081
|
*/
|
|
32079
32082
|
cancel(messageBatchID, options) {
|
|
32080
|
-
return this._client.post(
|
|
32083
|
+
return this._client.post(path33`/v1/messages/batches/${messageBatchID}/cancel`, options);
|
|
32081
32084
|
}
|
|
32082
32085
|
/**
|
|
32083
32086
|
* Streams the results of a Message Batch as a `.jsonl` file.
|
|
@@ -32204,7 +32207,7 @@ var init_models2 = __esm({
|
|
|
32204
32207
|
*/
|
|
32205
32208
|
retrieve(modelID, params = {}, options) {
|
|
32206
32209
|
const { betas } = params ?? {};
|
|
32207
|
-
return this._client.get(
|
|
32210
|
+
return this._client.get(path33`/v1/models/${modelID}`, {
|
|
32208
32211
|
...options,
|
|
32209
32212
|
headers: buildHeaders([
|
|
32210
32213
|
{ ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
|
|
@@ -32405,9 +32408,9 @@ var init_client = __esm({
|
|
|
32405
32408
|
makeStatusError(status, error46, message, headers) {
|
|
32406
32409
|
return APIError.generate(status, error46, message, headers);
|
|
32407
32410
|
}
|
|
32408
|
-
buildURL(
|
|
32411
|
+
buildURL(path39, query, defaultBaseURL) {
|
|
32409
32412
|
const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
32410
|
-
const url2 = isAbsoluteURL(
|
|
32413
|
+
const url2 = isAbsoluteURL(path39) ? new URL(path39) : new URL(baseURL + (baseURL.endsWith("/") && path39.startsWith("/") ? path39.slice(1) : path39));
|
|
32411
32414
|
const defaultQuery = this.defaultQuery();
|
|
32412
32415
|
if (!isEmptyObj(defaultQuery)) {
|
|
32413
32416
|
query = { ...defaultQuery, ...query };
|
|
@@ -32438,24 +32441,24 @@ var init_client = __esm({
|
|
|
32438
32441
|
*/
|
|
32439
32442
|
async prepareRequest(request, { url: url2, options }) {
|
|
32440
32443
|
}
|
|
32441
|
-
get(
|
|
32442
|
-
return this.methodRequest("get",
|
|
32444
|
+
get(path39, opts) {
|
|
32445
|
+
return this.methodRequest("get", path39, opts);
|
|
32443
32446
|
}
|
|
32444
|
-
post(
|
|
32445
|
-
return this.methodRequest("post",
|
|
32447
|
+
post(path39, opts) {
|
|
32448
|
+
return this.methodRequest("post", path39, opts);
|
|
32446
32449
|
}
|
|
32447
|
-
patch(
|
|
32448
|
-
return this.methodRequest("patch",
|
|
32450
|
+
patch(path39, opts) {
|
|
32451
|
+
return this.methodRequest("patch", path39, opts);
|
|
32449
32452
|
}
|
|
32450
|
-
put(
|
|
32451
|
-
return this.methodRequest("put",
|
|
32453
|
+
put(path39, opts) {
|
|
32454
|
+
return this.methodRequest("put", path39, opts);
|
|
32452
32455
|
}
|
|
32453
|
-
delete(
|
|
32454
|
-
return this.methodRequest("delete",
|
|
32456
|
+
delete(path39, opts) {
|
|
32457
|
+
return this.methodRequest("delete", path39, opts);
|
|
32455
32458
|
}
|
|
32456
|
-
methodRequest(method,
|
|
32459
|
+
methodRequest(method, path39, opts) {
|
|
32457
32460
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
32458
|
-
return { method, path:
|
|
32461
|
+
return { method, path: path39, ...opts2 };
|
|
32459
32462
|
}));
|
|
32460
32463
|
}
|
|
32461
32464
|
request(options, remainingRetries = null) {
|
|
@@ -32559,8 +32562,8 @@ var init_client = __esm({
|
|
|
32559
32562
|
}));
|
|
32560
32563
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
32561
32564
|
}
|
|
32562
|
-
getAPIList(
|
|
32563
|
-
return this.requestAPIList(Page3, { method: "get", path:
|
|
32565
|
+
getAPIList(path39, Page3, opts) {
|
|
32566
|
+
return this.requestAPIList(Page3, { method: "get", path: path39, ...opts });
|
|
32564
32567
|
}
|
|
32565
32568
|
requestAPIList(Page3, options) {
|
|
32566
32569
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -32647,8 +32650,8 @@ var init_client = __esm({
|
|
|
32647
32650
|
}
|
|
32648
32651
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
32649
32652
|
const options = { ...inputOptions };
|
|
32650
|
-
const { method, path:
|
|
32651
|
-
const url2 = this.buildURL(
|
|
32653
|
+
const { method, path: path39, query, defaultBaseURL } = options;
|
|
32654
|
+
const url2 = this.buildURL(path39, query, defaultBaseURL);
|
|
32652
32655
|
if ("timeout" in options)
|
|
32653
32656
|
validatePositiveInteger("timeout", options.timeout);
|
|
32654
32657
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -34521,17 +34524,17 @@ var init_resource2 = __esm({
|
|
|
34521
34524
|
function encodeURIPath2(str3) {
|
|
34522
34525
|
return str3.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
34523
34526
|
}
|
|
34524
|
-
var EMPTY2, createPathTagFunction2,
|
|
34527
|
+
var EMPTY2, createPathTagFunction2, path34;
|
|
34525
34528
|
var init_path2 = __esm({
|
|
34526
34529
|
"../../node_modules/openai/internal/utils/path.mjs"() {
|
|
34527
34530
|
init_error3();
|
|
34528
34531
|
EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
34529
|
-
createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function
|
|
34532
|
+
createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path39(statics, ...params) {
|
|
34530
34533
|
if (statics.length === 1)
|
|
34531
34534
|
return statics[0];
|
|
34532
34535
|
let postPath = false;
|
|
34533
34536
|
const invalidSegments = [];
|
|
34534
|
-
const
|
|
34537
|
+
const path40 = statics.reduce((previousValue, currentValue, index) => {
|
|
34535
34538
|
if (/[?#]/.test(currentValue)) {
|
|
34536
34539
|
postPath = true;
|
|
34537
34540
|
}
|
|
@@ -34548,7 +34551,7 @@ var init_path2 = __esm({
|
|
|
34548
34551
|
}
|
|
34549
34552
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
34550
34553
|
}, "");
|
|
34551
|
-
const pathOnly =
|
|
34554
|
+
const pathOnly = path40.split(/[?#]/, 1)[0];
|
|
34552
34555
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
34553
34556
|
let match;
|
|
34554
34557
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -34569,12 +34572,12 @@ var init_path2 = __esm({
|
|
|
34569
34572
|
}, "");
|
|
34570
34573
|
throw new OpenAIError(`Path parameters result in path with invalid segments:
|
|
34571
34574
|
${invalidSegments.map((e) => e.error).join("\n")}
|
|
34572
|
-
${
|
|
34575
|
+
${path40}
|
|
34573
34576
|
${underline}`);
|
|
34574
34577
|
}
|
|
34575
|
-
return
|
|
34578
|
+
return path40;
|
|
34576
34579
|
};
|
|
34577
|
-
|
|
34580
|
+
path34 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2);
|
|
34578
34581
|
}
|
|
34579
34582
|
});
|
|
34580
34583
|
|
|
@@ -34601,7 +34604,7 @@ var init_messages3 = __esm({
|
|
|
34601
34604
|
* ```
|
|
34602
34605
|
*/
|
|
34603
34606
|
list(completionID, query = {}, options) {
|
|
34604
|
-
return this._client.getAPIList(
|
|
34607
|
+
return this._client.getAPIList(path34`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options });
|
|
34605
34608
|
}
|
|
34606
34609
|
};
|
|
34607
34610
|
}
|
|
@@ -35996,7 +35999,7 @@ var init_completions2 = __esm({
|
|
|
35996
35999
|
* ```
|
|
35997
36000
|
*/
|
|
35998
36001
|
retrieve(completionID, options) {
|
|
35999
|
-
return this._client.get(
|
|
36002
|
+
return this._client.get(path34`/chat/completions/${completionID}`, options);
|
|
36000
36003
|
}
|
|
36001
36004
|
/**
|
|
36002
36005
|
* Modify a stored chat completion. Only Chat Completions that have been created
|
|
@@ -36012,7 +36015,7 @@ var init_completions2 = __esm({
|
|
|
36012
36015
|
* ```
|
|
36013
36016
|
*/
|
|
36014
36017
|
update(completionID, body, options) {
|
|
36015
|
-
return this._client.post(
|
|
36018
|
+
return this._client.post(path34`/chat/completions/${completionID}`, { body, ...options });
|
|
36016
36019
|
}
|
|
36017
36020
|
/**
|
|
36018
36021
|
* List stored Chat Completions. Only Chat Completions that have been stored with
|
|
@@ -36040,7 +36043,7 @@ var init_completions2 = __esm({
|
|
|
36040
36043
|
* ```
|
|
36041
36044
|
*/
|
|
36042
36045
|
delete(completionID, options) {
|
|
36043
|
-
return this._client.delete(
|
|
36046
|
+
return this._client.delete(path34`/chat/completions/${completionID}`, options);
|
|
36044
36047
|
}
|
|
36045
36048
|
parse(body, options) {
|
|
36046
36049
|
validateInputTools(body.tools);
|
|
@@ -36288,7 +36291,7 @@ var init_batches3 = __esm({
|
|
|
36288
36291
|
* Retrieves a batch.
|
|
36289
36292
|
*/
|
|
36290
36293
|
retrieve(batchID, options) {
|
|
36291
|
-
return this._client.get(
|
|
36294
|
+
return this._client.get(path34`/batches/${batchID}`, options);
|
|
36292
36295
|
}
|
|
36293
36296
|
/**
|
|
36294
36297
|
* List your organization's batches.
|
|
@@ -36302,7 +36305,7 @@ var init_batches3 = __esm({
|
|
|
36302
36305
|
* (if any) available in the output file.
|
|
36303
36306
|
*/
|
|
36304
36307
|
cancel(batchID, options) {
|
|
36305
|
-
return this._client.post(
|
|
36308
|
+
return this._client.post(path34`/batches/${batchID}/cancel`, options);
|
|
36306
36309
|
}
|
|
36307
36310
|
};
|
|
36308
36311
|
}
|
|
@@ -36345,7 +36348,7 @@ var init_assistants = __esm({
|
|
|
36345
36348
|
* ```
|
|
36346
36349
|
*/
|
|
36347
36350
|
retrieve(assistantID, options) {
|
|
36348
|
-
return this._client.get(
|
|
36351
|
+
return this._client.get(path34`/assistants/${assistantID}`, {
|
|
36349
36352
|
...options,
|
|
36350
36353
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
36351
36354
|
});
|
|
@@ -36361,7 +36364,7 @@ var init_assistants = __esm({
|
|
|
36361
36364
|
* ```
|
|
36362
36365
|
*/
|
|
36363
36366
|
update(assistantID, body, options) {
|
|
36364
|
-
return this._client.post(
|
|
36367
|
+
return this._client.post(path34`/assistants/${assistantID}`, {
|
|
36365
36368
|
body,
|
|
36366
36369
|
...options,
|
|
36367
36370
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36395,7 +36398,7 @@ var init_assistants = __esm({
|
|
|
36395
36398
|
* ```
|
|
36396
36399
|
*/
|
|
36397
36400
|
delete(assistantID, options) {
|
|
36398
|
-
return this._client.delete(
|
|
36401
|
+
return this._client.delete(path34`/assistants/${assistantID}`, {
|
|
36399
36402
|
...options,
|
|
36400
36403
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
36401
36404
|
});
|
|
@@ -36506,7 +36509,7 @@ var init_messages4 = __esm({
|
|
|
36506
36509
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
36507
36510
|
*/
|
|
36508
36511
|
create(threadID, body, options) {
|
|
36509
|
-
return this._client.post(
|
|
36512
|
+
return this._client.post(path34`/threads/${threadID}/messages`, {
|
|
36510
36513
|
body,
|
|
36511
36514
|
...options,
|
|
36512
36515
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36519,7 +36522,7 @@ var init_messages4 = __esm({
|
|
|
36519
36522
|
*/
|
|
36520
36523
|
retrieve(messageID, params, options) {
|
|
36521
36524
|
const { thread_id } = params;
|
|
36522
|
-
return this._client.get(
|
|
36525
|
+
return this._client.get(path34`/threads/${thread_id}/messages/${messageID}`, {
|
|
36523
36526
|
...options,
|
|
36524
36527
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
36525
36528
|
});
|
|
@@ -36531,7 +36534,7 @@ var init_messages4 = __esm({
|
|
|
36531
36534
|
*/
|
|
36532
36535
|
update(messageID, params, options) {
|
|
36533
36536
|
const { thread_id, ...body } = params;
|
|
36534
|
-
return this._client.post(
|
|
36537
|
+
return this._client.post(path34`/threads/${thread_id}/messages/${messageID}`, {
|
|
36535
36538
|
body,
|
|
36536
36539
|
...options,
|
|
36537
36540
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36543,7 +36546,7 @@ var init_messages4 = __esm({
|
|
|
36543
36546
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
36544
36547
|
*/
|
|
36545
36548
|
list(threadID, query = {}, options) {
|
|
36546
|
-
return this._client.getAPIList(
|
|
36549
|
+
return this._client.getAPIList(path34`/threads/${threadID}/messages`, CursorPage, {
|
|
36547
36550
|
query,
|
|
36548
36551
|
...options,
|
|
36549
36552
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36556,7 +36559,7 @@ var init_messages4 = __esm({
|
|
|
36556
36559
|
*/
|
|
36557
36560
|
delete(messageID, params, options) {
|
|
36558
36561
|
const { thread_id } = params;
|
|
36559
|
-
return this._client.delete(
|
|
36562
|
+
return this._client.delete(path34`/threads/${thread_id}/messages/${messageID}`, {
|
|
36560
36563
|
...options,
|
|
36561
36564
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
36562
36565
|
});
|
|
@@ -36581,7 +36584,7 @@ var init_steps = __esm({
|
|
|
36581
36584
|
*/
|
|
36582
36585
|
retrieve(stepID, params, options) {
|
|
36583
36586
|
const { thread_id, run_id, ...query } = params;
|
|
36584
|
-
return this._client.get(
|
|
36587
|
+
return this._client.get(path34`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
|
|
36585
36588
|
query,
|
|
36586
36589
|
...options,
|
|
36587
36590
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36594,7 +36597,7 @@ var init_steps = __esm({
|
|
|
36594
36597
|
*/
|
|
36595
36598
|
list(runID, params, options) {
|
|
36596
36599
|
const { thread_id, ...query } = params;
|
|
36597
|
-
return this._client.getAPIList(
|
|
36600
|
+
return this._client.getAPIList(path34`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, {
|
|
36598
36601
|
query,
|
|
36599
36602
|
...options,
|
|
36600
36603
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -37200,7 +37203,7 @@ var init_runs = __esm({
|
|
|
37200
37203
|
}
|
|
37201
37204
|
create(threadID, params, options) {
|
|
37202
37205
|
const { include, ...body } = params;
|
|
37203
|
-
return this._client.post(
|
|
37206
|
+
return this._client.post(path34`/threads/${threadID}/runs`, {
|
|
37204
37207
|
query: { include },
|
|
37205
37208
|
body,
|
|
37206
37209
|
...options,
|
|
@@ -37215,7 +37218,7 @@ var init_runs = __esm({
|
|
|
37215
37218
|
*/
|
|
37216
37219
|
retrieve(runID, params, options) {
|
|
37217
37220
|
const { thread_id } = params;
|
|
37218
|
-
return this._client.get(
|
|
37221
|
+
return this._client.get(path34`/threads/${thread_id}/runs/${runID}`, {
|
|
37219
37222
|
...options,
|
|
37220
37223
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
37221
37224
|
});
|
|
@@ -37227,7 +37230,7 @@ var init_runs = __esm({
|
|
|
37227
37230
|
*/
|
|
37228
37231
|
update(runID, params, options) {
|
|
37229
37232
|
const { thread_id, ...body } = params;
|
|
37230
|
-
return this._client.post(
|
|
37233
|
+
return this._client.post(path34`/threads/${thread_id}/runs/${runID}`, {
|
|
37231
37234
|
body,
|
|
37232
37235
|
...options,
|
|
37233
37236
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -37239,7 +37242,7 @@ var init_runs = __esm({
|
|
|
37239
37242
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
37240
37243
|
*/
|
|
37241
37244
|
list(threadID, query = {}, options) {
|
|
37242
|
-
return this._client.getAPIList(
|
|
37245
|
+
return this._client.getAPIList(path34`/threads/${threadID}/runs`, CursorPage, {
|
|
37243
37246
|
query,
|
|
37244
37247
|
...options,
|
|
37245
37248
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -37252,7 +37255,7 @@ var init_runs = __esm({
|
|
|
37252
37255
|
*/
|
|
37253
37256
|
cancel(runID, params, options) {
|
|
37254
37257
|
const { thread_id } = params;
|
|
37255
|
-
return this._client.post(
|
|
37258
|
+
return this._client.post(path34`/threads/${thread_id}/runs/${runID}/cancel`, {
|
|
37256
37259
|
...options,
|
|
37257
37260
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
37258
37261
|
});
|
|
@@ -37330,7 +37333,7 @@ var init_runs = __esm({
|
|
|
37330
37333
|
}
|
|
37331
37334
|
submitToolOutputs(runID, params, options) {
|
|
37332
37335
|
const { thread_id, ...body } = params;
|
|
37333
|
-
return this._client.post(
|
|
37336
|
+
return this._client.post(path34`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, {
|
|
37334
37337
|
body,
|
|
37335
37338
|
...options,
|
|
37336
37339
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
|
|
@@ -37395,7 +37398,7 @@ var init_threads = __esm({
|
|
|
37395
37398
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
37396
37399
|
*/
|
|
37397
37400
|
retrieve(threadID, options) {
|
|
37398
|
-
return this._client.get(
|
|
37401
|
+
return this._client.get(path34`/threads/${threadID}`, {
|
|
37399
37402
|
...options,
|
|
37400
37403
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
37401
37404
|
});
|
|
@@ -37406,7 +37409,7 @@ var init_threads = __esm({
|
|
|
37406
37409
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
37407
37410
|
*/
|
|
37408
37411
|
update(threadID, body, options) {
|
|
37409
|
-
return this._client.post(
|
|
37412
|
+
return this._client.post(path34`/threads/${threadID}`, {
|
|
37410
37413
|
body,
|
|
37411
37414
|
...options,
|
|
37412
37415
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -37418,7 +37421,7 @@ var init_threads = __esm({
|
|
|
37418
37421
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
37419
37422
|
*/
|
|
37420
37423
|
delete(threadID, options) {
|
|
37421
|
-
return this._client.delete(
|
|
37424
|
+
return this._client.delete(path34`/threads/${threadID}`, {
|
|
37422
37425
|
...options,
|
|
37423
37426
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
37424
37427
|
});
|
|
@@ -37503,7 +37506,7 @@ var init_content = __esm({
|
|
|
37503
37506
|
*/
|
|
37504
37507
|
retrieve(fileID, params, options) {
|
|
37505
37508
|
const { container_id } = params;
|
|
37506
|
-
return this._client.get(
|
|
37509
|
+
return this._client.get(path34`/containers/${container_id}/files/${fileID}/content`, {
|
|
37507
37510
|
...options,
|
|
37508
37511
|
headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]),
|
|
37509
37512
|
__binaryResponse: true
|
|
@@ -37536,20 +37539,20 @@ var init_files2 = __esm({
|
|
|
37536
37539
|
* a JSON request with a file ID.
|
|
37537
37540
|
*/
|
|
37538
37541
|
create(containerID, body, options) {
|
|
37539
|
-
return this._client.post(
|
|
37542
|
+
return this._client.post(path34`/containers/${containerID}/files`, multipartFormRequestOptions2({ body, ...options }, this._client));
|
|
37540
37543
|
}
|
|
37541
37544
|
/**
|
|
37542
37545
|
* Retrieve Container File
|
|
37543
37546
|
*/
|
|
37544
37547
|
retrieve(fileID, params, options) {
|
|
37545
37548
|
const { container_id } = params;
|
|
37546
|
-
return this._client.get(
|
|
37549
|
+
return this._client.get(path34`/containers/${container_id}/files/${fileID}`, options);
|
|
37547
37550
|
}
|
|
37548
37551
|
/**
|
|
37549
37552
|
* List Container files
|
|
37550
37553
|
*/
|
|
37551
37554
|
list(containerID, query = {}, options) {
|
|
37552
|
-
return this._client.getAPIList(
|
|
37555
|
+
return this._client.getAPIList(path34`/containers/${containerID}/files`, CursorPage, {
|
|
37553
37556
|
query,
|
|
37554
37557
|
...options
|
|
37555
37558
|
});
|
|
@@ -37559,7 +37562,7 @@ var init_files2 = __esm({
|
|
|
37559
37562
|
*/
|
|
37560
37563
|
delete(fileID, params, options) {
|
|
37561
37564
|
const { container_id } = params;
|
|
37562
|
-
return this._client.delete(
|
|
37565
|
+
return this._client.delete(path34`/containers/${container_id}/files/${fileID}`, {
|
|
37563
37566
|
...options,
|
|
37564
37567
|
headers: buildHeaders2([{ Accept: "*/*" }, options?.headers])
|
|
37565
37568
|
});
|
|
@@ -37594,7 +37597,7 @@ var init_containers = __esm({
|
|
|
37594
37597
|
* Retrieve Container
|
|
37595
37598
|
*/
|
|
37596
37599
|
retrieve(containerID, options) {
|
|
37597
|
-
return this._client.get(
|
|
37600
|
+
return this._client.get(path34`/containers/${containerID}`, options);
|
|
37598
37601
|
}
|
|
37599
37602
|
/**
|
|
37600
37603
|
* List Containers
|
|
@@ -37606,7 +37609,7 @@ var init_containers = __esm({
|
|
|
37606
37609
|
* Delete Container
|
|
37607
37610
|
*/
|
|
37608
37611
|
delete(containerID, options) {
|
|
37609
|
-
return this._client.delete(
|
|
37612
|
+
return this._client.delete(path34`/containers/${containerID}`, {
|
|
37610
37613
|
...options,
|
|
37611
37614
|
headers: buildHeaders2([{ Accept: "*/*" }, options?.headers])
|
|
37612
37615
|
});
|
|
@@ -37629,7 +37632,7 @@ var init_items = __esm({
|
|
|
37629
37632
|
*/
|
|
37630
37633
|
create(conversationID, params, options) {
|
|
37631
37634
|
const { include, ...body } = params;
|
|
37632
|
-
return this._client.post(
|
|
37635
|
+
return this._client.post(path34`/conversations/${conversationID}/items`, {
|
|
37633
37636
|
query: { include },
|
|
37634
37637
|
body,
|
|
37635
37638
|
...options
|
|
@@ -37640,20 +37643,20 @@ var init_items = __esm({
|
|
|
37640
37643
|
*/
|
|
37641
37644
|
retrieve(itemID, params, options) {
|
|
37642
37645
|
const { conversation_id, ...query } = params;
|
|
37643
|
-
return this._client.get(
|
|
37646
|
+
return this._client.get(path34`/conversations/${conversation_id}/items/${itemID}`, { query, ...options });
|
|
37644
37647
|
}
|
|
37645
37648
|
/**
|
|
37646
37649
|
* List all items for a conversation with the given ID.
|
|
37647
37650
|
*/
|
|
37648
37651
|
list(conversationID, query = {}, options) {
|
|
37649
|
-
return this._client.getAPIList(
|
|
37652
|
+
return this._client.getAPIList(path34`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
|
|
37650
37653
|
}
|
|
37651
37654
|
/**
|
|
37652
37655
|
* Delete an item from a conversation with the given IDs.
|
|
37653
37656
|
*/
|
|
37654
37657
|
delete(itemID, params, options) {
|
|
37655
37658
|
const { conversation_id } = params;
|
|
37656
|
-
return this._client.delete(
|
|
37659
|
+
return this._client.delete(path34`/conversations/${conversation_id}/items/${itemID}`, options);
|
|
37657
37660
|
}
|
|
37658
37661
|
};
|
|
37659
37662
|
}
|
|
@@ -37682,19 +37685,19 @@ var init_conversations = __esm({
|
|
|
37682
37685
|
* Get a conversation
|
|
37683
37686
|
*/
|
|
37684
37687
|
retrieve(conversationID, options) {
|
|
37685
|
-
return this._client.get(
|
|
37688
|
+
return this._client.get(path34`/conversations/${conversationID}`, options);
|
|
37686
37689
|
}
|
|
37687
37690
|
/**
|
|
37688
37691
|
* Update a conversation
|
|
37689
37692
|
*/
|
|
37690
37693
|
update(conversationID, body, options) {
|
|
37691
|
-
return this._client.post(
|
|
37694
|
+
return this._client.post(path34`/conversations/${conversationID}`, { body, ...options });
|
|
37692
37695
|
}
|
|
37693
37696
|
/**
|
|
37694
37697
|
* Delete a conversation. Items in the conversation will not be deleted.
|
|
37695
37698
|
*/
|
|
37696
37699
|
delete(conversationID, options) {
|
|
37697
|
-
return this._client.delete(
|
|
37700
|
+
return this._client.delete(path34`/conversations/${conversationID}`, options);
|
|
37698
37701
|
}
|
|
37699
37702
|
};
|
|
37700
37703
|
Conversations.Items = Items;
|
|
@@ -37764,14 +37767,14 @@ var init_output_items = __esm({
|
|
|
37764
37767
|
*/
|
|
37765
37768
|
retrieve(outputItemID, params, options) {
|
|
37766
37769
|
const { eval_id, run_id } = params;
|
|
37767
|
-
return this._client.get(
|
|
37770
|
+
return this._client.get(path34`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, options);
|
|
37768
37771
|
}
|
|
37769
37772
|
/**
|
|
37770
37773
|
* Get a list of output items for an evaluation run.
|
|
37771
37774
|
*/
|
|
37772
37775
|
list(runID, params, options) {
|
|
37773
37776
|
const { eval_id, ...query } = params;
|
|
37774
|
-
return this._client.getAPIList(
|
|
37777
|
+
return this._client.getAPIList(path34`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options });
|
|
37775
37778
|
}
|
|
37776
37779
|
};
|
|
37777
37780
|
}
|
|
@@ -37797,20 +37800,20 @@ var init_runs2 = __esm({
|
|
|
37797
37800
|
* schema specified in the config of the evaluation.
|
|
37798
37801
|
*/
|
|
37799
37802
|
create(evalID, body, options) {
|
|
37800
|
-
return this._client.post(
|
|
37803
|
+
return this._client.post(path34`/evals/${evalID}/runs`, { body, ...options });
|
|
37801
37804
|
}
|
|
37802
37805
|
/**
|
|
37803
37806
|
* Get an evaluation run by ID.
|
|
37804
37807
|
*/
|
|
37805
37808
|
retrieve(runID, params, options) {
|
|
37806
37809
|
const { eval_id } = params;
|
|
37807
|
-
return this._client.get(
|
|
37810
|
+
return this._client.get(path34`/evals/${eval_id}/runs/${runID}`, options);
|
|
37808
37811
|
}
|
|
37809
37812
|
/**
|
|
37810
37813
|
* Get a list of runs for an evaluation.
|
|
37811
37814
|
*/
|
|
37812
37815
|
list(evalID, query = {}, options) {
|
|
37813
|
-
return this._client.getAPIList(
|
|
37816
|
+
return this._client.getAPIList(path34`/evals/${evalID}/runs`, CursorPage, {
|
|
37814
37817
|
query,
|
|
37815
37818
|
...options
|
|
37816
37819
|
});
|
|
@@ -37820,14 +37823,14 @@ var init_runs2 = __esm({
|
|
|
37820
37823
|
*/
|
|
37821
37824
|
delete(runID, params, options) {
|
|
37822
37825
|
const { eval_id } = params;
|
|
37823
|
-
return this._client.delete(
|
|
37826
|
+
return this._client.delete(path34`/evals/${eval_id}/runs/${runID}`, options);
|
|
37824
37827
|
}
|
|
37825
37828
|
/**
|
|
37826
37829
|
* Cancel an ongoing evaluation run.
|
|
37827
37830
|
*/
|
|
37828
37831
|
cancel(runID, params, options) {
|
|
37829
37832
|
const { eval_id } = params;
|
|
37830
|
-
return this._client.post(
|
|
37833
|
+
return this._client.post(path34`/evals/${eval_id}/runs/${runID}`, options);
|
|
37831
37834
|
}
|
|
37832
37835
|
};
|
|
37833
37836
|
Runs2.OutputItems = OutputItems;
|
|
@@ -37863,13 +37866,13 @@ var init_evals = __esm({
|
|
|
37863
37866
|
* Get an evaluation by ID.
|
|
37864
37867
|
*/
|
|
37865
37868
|
retrieve(evalID, options) {
|
|
37866
|
-
return this._client.get(
|
|
37869
|
+
return this._client.get(path34`/evals/${evalID}`, options);
|
|
37867
37870
|
}
|
|
37868
37871
|
/**
|
|
37869
37872
|
* Update certain properties of an evaluation.
|
|
37870
37873
|
*/
|
|
37871
37874
|
update(evalID, body, options) {
|
|
37872
|
-
return this._client.post(
|
|
37875
|
+
return this._client.post(path34`/evals/${evalID}`, { body, ...options });
|
|
37873
37876
|
}
|
|
37874
37877
|
/**
|
|
37875
37878
|
* List evaluations for a project.
|
|
@@ -37881,7 +37884,7 @@ var init_evals = __esm({
|
|
|
37881
37884
|
* Delete an evaluation.
|
|
37882
37885
|
*/
|
|
37883
37886
|
delete(evalID, options) {
|
|
37884
|
-
return this._client.delete(
|
|
37887
|
+
return this._client.delete(path34`/evals/${evalID}`, options);
|
|
37885
37888
|
}
|
|
37886
37889
|
};
|
|
37887
37890
|
Evals.Runs = Runs2;
|
|
@@ -37930,7 +37933,7 @@ var init_files3 = __esm({
|
|
|
37930
37933
|
* Returns information about a specific file.
|
|
37931
37934
|
*/
|
|
37932
37935
|
retrieve(fileID, options) {
|
|
37933
|
-
return this._client.get(
|
|
37936
|
+
return this._client.get(path34`/files/${fileID}`, options);
|
|
37934
37937
|
}
|
|
37935
37938
|
/**
|
|
37936
37939
|
* Returns a list of files.
|
|
@@ -37942,13 +37945,13 @@ var init_files3 = __esm({
|
|
|
37942
37945
|
* Delete a file.
|
|
37943
37946
|
*/
|
|
37944
37947
|
delete(fileID, options) {
|
|
37945
|
-
return this._client.delete(
|
|
37948
|
+
return this._client.delete(path34`/files/${fileID}`, options);
|
|
37946
37949
|
}
|
|
37947
37950
|
/**
|
|
37948
37951
|
* Returns the contents of the specified file.
|
|
37949
37952
|
*/
|
|
37950
37953
|
content(fileID, options) {
|
|
37951
|
-
return this._client.get(
|
|
37954
|
+
return this._client.get(path34`/files/${fileID}/content`, {
|
|
37952
37955
|
...options,
|
|
37953
37956
|
headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]),
|
|
37954
37957
|
__binaryResponse: true
|
|
@@ -38079,7 +38082,7 @@ var init_permissions = __esm({
|
|
|
38079
38082
|
* ```
|
|
38080
38083
|
*/
|
|
38081
38084
|
create(fineTunedModelCheckpoint, body, options) {
|
|
38082
|
-
return this._client.getAPIList(
|
|
38085
|
+
return this._client.getAPIList(path34`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page2, { body, method: "post", ...options });
|
|
38083
38086
|
}
|
|
38084
38087
|
/**
|
|
38085
38088
|
* **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
|
|
@@ -38096,7 +38099,7 @@ var init_permissions = __esm({
|
|
|
38096
38099
|
* ```
|
|
38097
38100
|
*/
|
|
38098
38101
|
retrieve(fineTunedModelCheckpoint, query = {}, options) {
|
|
38099
|
-
return this._client.get(
|
|
38102
|
+
return this._client.get(path34`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
|
|
38100
38103
|
query,
|
|
38101
38104
|
...options
|
|
38102
38105
|
});
|
|
@@ -38121,7 +38124,7 @@ var init_permissions = __esm({
|
|
|
38121
38124
|
*/
|
|
38122
38125
|
delete(permissionID, params, options) {
|
|
38123
38126
|
const { fine_tuned_model_checkpoint } = params;
|
|
38124
|
-
return this._client.delete(
|
|
38127
|
+
return this._client.delete(path34`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, options);
|
|
38125
38128
|
}
|
|
38126
38129
|
};
|
|
38127
38130
|
}
|
|
@@ -38166,7 +38169,7 @@ var init_checkpoints2 = __esm({
|
|
|
38166
38169
|
* ```
|
|
38167
38170
|
*/
|
|
38168
38171
|
list(fineTuningJobID, query = {}, options) {
|
|
38169
|
-
return this._client.getAPIList(
|
|
38172
|
+
return this._client.getAPIList(path34`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options });
|
|
38170
38173
|
}
|
|
38171
38174
|
};
|
|
38172
38175
|
}
|
|
@@ -38219,7 +38222,7 @@ var init_jobs = __esm({
|
|
|
38219
38222
|
* ```
|
|
38220
38223
|
*/
|
|
38221
38224
|
retrieve(fineTuningJobID, options) {
|
|
38222
|
-
return this._client.get(
|
|
38225
|
+
return this._client.get(path34`/fine_tuning/jobs/${fineTuningJobID}`, options);
|
|
38223
38226
|
}
|
|
38224
38227
|
/**
|
|
38225
38228
|
* List your organization's fine-tuning jobs
|
|
@@ -38246,7 +38249,7 @@ var init_jobs = __esm({
|
|
|
38246
38249
|
* ```
|
|
38247
38250
|
*/
|
|
38248
38251
|
cancel(fineTuningJobID, options) {
|
|
38249
|
-
return this._client.post(
|
|
38252
|
+
return this._client.post(path34`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
|
|
38250
38253
|
}
|
|
38251
38254
|
/**
|
|
38252
38255
|
* Get status updates for a fine-tuning job.
|
|
@@ -38262,7 +38265,7 @@ var init_jobs = __esm({
|
|
|
38262
38265
|
* ```
|
|
38263
38266
|
*/
|
|
38264
38267
|
listEvents(fineTuningJobID, query = {}, options) {
|
|
38265
|
-
return this._client.getAPIList(
|
|
38268
|
+
return this._client.getAPIList(path34`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options });
|
|
38266
38269
|
}
|
|
38267
38270
|
/**
|
|
38268
38271
|
* Pause a fine-tune job.
|
|
@@ -38275,7 +38278,7 @@ var init_jobs = __esm({
|
|
|
38275
38278
|
* ```
|
|
38276
38279
|
*/
|
|
38277
38280
|
pause(fineTuningJobID, options) {
|
|
38278
|
-
return this._client.post(
|
|
38281
|
+
return this._client.post(path34`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
|
|
38279
38282
|
}
|
|
38280
38283
|
/**
|
|
38281
38284
|
* Resume a fine-tune job.
|
|
@@ -38288,7 +38291,7 @@ var init_jobs = __esm({
|
|
|
38288
38291
|
* ```
|
|
38289
38292
|
*/
|
|
38290
38293
|
resume(fineTuningJobID, options) {
|
|
38291
|
-
return this._client.post(
|
|
38294
|
+
return this._client.post(path34`/fine_tuning/jobs/${fineTuningJobID}/resume`, options);
|
|
38292
38295
|
}
|
|
38293
38296
|
};
|
|
38294
38297
|
Jobs.Checkpoints = Checkpoints2;
|
|
@@ -38394,7 +38397,7 @@ var init_models3 = __esm({
|
|
|
38394
38397
|
* the owner and permissioning.
|
|
38395
38398
|
*/
|
|
38396
38399
|
retrieve(model, options) {
|
|
38397
|
-
return this._client.get(
|
|
38400
|
+
return this._client.get(path34`/models/${model}`, options);
|
|
38398
38401
|
}
|
|
38399
38402
|
/**
|
|
38400
38403
|
* Lists the currently available models, and provides basic information about each
|
|
@@ -38408,7 +38411,7 @@ var init_models3 = __esm({
|
|
|
38408
38411
|
* delete a model.
|
|
38409
38412
|
*/
|
|
38410
38413
|
delete(model, options) {
|
|
38411
|
-
return this._client.delete(
|
|
38414
|
+
return this._client.delete(path34`/models/${model}`, options);
|
|
38412
38415
|
}
|
|
38413
38416
|
};
|
|
38414
38417
|
}
|
|
@@ -38876,7 +38879,7 @@ var init_input_items = __esm({
|
|
|
38876
38879
|
* ```
|
|
38877
38880
|
*/
|
|
38878
38881
|
list(responseID, query = {}, options) {
|
|
38879
|
-
return this._client.getAPIList(
|
|
38882
|
+
return this._client.getAPIList(path34`/responses/${responseID}/input_items`, CursorPage, { query, ...options });
|
|
38880
38883
|
}
|
|
38881
38884
|
};
|
|
38882
38885
|
}
|
|
@@ -38907,7 +38910,7 @@ var init_responses = __esm({
|
|
|
38907
38910
|
});
|
|
38908
38911
|
}
|
|
38909
38912
|
retrieve(responseID, query = {}, options) {
|
|
38910
|
-
return this._client.get(
|
|
38913
|
+
return this._client.get(path34`/responses/${responseID}`, {
|
|
38911
38914
|
query,
|
|
38912
38915
|
...options,
|
|
38913
38916
|
stream: query?.stream ?? false
|
|
@@ -38929,7 +38932,7 @@ var init_responses = __esm({
|
|
|
38929
38932
|
* ```
|
|
38930
38933
|
*/
|
|
38931
38934
|
delete(responseID, options) {
|
|
38932
|
-
return this._client.delete(
|
|
38935
|
+
return this._client.delete(path34`/responses/${responseID}`, {
|
|
38933
38936
|
...options,
|
|
38934
38937
|
headers: buildHeaders2([{ Accept: "*/*" }, options?.headers])
|
|
38935
38938
|
});
|
|
@@ -38956,7 +38959,7 @@ var init_responses = __esm({
|
|
|
38956
38959
|
* ```
|
|
38957
38960
|
*/
|
|
38958
38961
|
cancel(responseID, options) {
|
|
38959
|
-
return this._client.post(
|
|
38962
|
+
return this._client.post(path34`/responses/${responseID}/cancel`, options);
|
|
38960
38963
|
}
|
|
38961
38964
|
};
|
|
38962
38965
|
Responses.InputItems = InputItems;
|
|
@@ -38985,7 +38988,7 @@ var init_parts = __esm({
|
|
|
38985
38988
|
* [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
|
|
38986
38989
|
*/
|
|
38987
38990
|
create(uploadID, body, options) {
|
|
38988
|
-
return this._client.post(
|
|
38991
|
+
return this._client.post(path34`/uploads/${uploadID}/parts`, multipartFormRequestOptions2({ body, ...options }, this._client));
|
|
38989
38992
|
}
|
|
38990
38993
|
};
|
|
38991
38994
|
}
|
|
@@ -39032,7 +39035,7 @@ var init_uploads5 = __esm({
|
|
|
39032
39035
|
* Cancels the Upload. No Parts may be added after an Upload is cancelled.
|
|
39033
39036
|
*/
|
|
39034
39037
|
cancel(uploadID, options) {
|
|
39035
|
-
return this._client.post(
|
|
39038
|
+
return this._client.post(path34`/uploads/${uploadID}/cancel`, options);
|
|
39036
39039
|
}
|
|
39037
39040
|
/**
|
|
39038
39041
|
* Completes the
|
|
@@ -39050,7 +39053,7 @@ var init_uploads5 = __esm({
|
|
|
39050
39053
|
* an Upload is completed.
|
|
39051
39054
|
*/
|
|
39052
39055
|
complete(uploadID, body, options) {
|
|
39053
|
-
return this._client.post(
|
|
39056
|
+
return this._client.post(path34`/uploads/${uploadID}/complete`, { body, ...options });
|
|
39054
39057
|
}
|
|
39055
39058
|
};
|
|
39056
39059
|
Uploads.Parts = Parts;
|
|
@@ -39096,7 +39099,7 @@ var init_file_batches = __esm({
|
|
|
39096
39099
|
* Create a vector store file batch.
|
|
39097
39100
|
*/
|
|
39098
39101
|
create(vectorStoreID, body, options) {
|
|
39099
|
-
return this._client.post(
|
|
39102
|
+
return this._client.post(path34`/vector_stores/${vectorStoreID}/file_batches`, {
|
|
39100
39103
|
body,
|
|
39101
39104
|
...options,
|
|
39102
39105
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39107,7 +39110,7 @@ var init_file_batches = __esm({
|
|
|
39107
39110
|
*/
|
|
39108
39111
|
retrieve(batchID, params, options) {
|
|
39109
39112
|
const { vector_store_id } = params;
|
|
39110
|
-
return this._client.get(
|
|
39113
|
+
return this._client.get(path34`/vector_stores/${vector_store_id}/file_batches/${batchID}`, {
|
|
39111
39114
|
...options,
|
|
39112
39115
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39113
39116
|
});
|
|
@@ -39118,7 +39121,7 @@ var init_file_batches = __esm({
|
|
|
39118
39121
|
*/
|
|
39119
39122
|
cancel(batchID, params, options) {
|
|
39120
39123
|
const { vector_store_id } = params;
|
|
39121
|
-
return this._client.post(
|
|
39124
|
+
return this._client.post(path34`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, {
|
|
39122
39125
|
...options,
|
|
39123
39126
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39124
39127
|
});
|
|
@@ -39135,7 +39138,7 @@ var init_file_batches = __esm({
|
|
|
39135
39138
|
*/
|
|
39136
39139
|
listFiles(batchID, params, options) {
|
|
39137
39140
|
const { vector_store_id, ...query } = params;
|
|
39138
|
-
return this._client.getAPIList(
|
|
39141
|
+
return this._client.getAPIList(path34`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { query, ...options, headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
|
|
39139
39142
|
}
|
|
39140
39143
|
/**
|
|
39141
39144
|
* Wait for the given file batch to be processed.
|
|
@@ -39225,7 +39228,7 @@ var init_files4 = __esm({
|
|
|
39225
39228
|
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object).
|
|
39226
39229
|
*/
|
|
39227
39230
|
create(vectorStoreID, body, options) {
|
|
39228
|
-
return this._client.post(
|
|
39231
|
+
return this._client.post(path34`/vector_stores/${vectorStoreID}/files`, {
|
|
39229
39232
|
body,
|
|
39230
39233
|
...options,
|
|
39231
39234
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39236,7 +39239,7 @@ var init_files4 = __esm({
|
|
|
39236
39239
|
*/
|
|
39237
39240
|
retrieve(fileID, params, options) {
|
|
39238
39241
|
const { vector_store_id } = params;
|
|
39239
|
-
return this._client.get(
|
|
39242
|
+
return this._client.get(path34`/vector_stores/${vector_store_id}/files/${fileID}`, {
|
|
39240
39243
|
...options,
|
|
39241
39244
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39242
39245
|
});
|
|
@@ -39246,7 +39249,7 @@ var init_files4 = __esm({
|
|
|
39246
39249
|
*/
|
|
39247
39250
|
update(fileID, params, options) {
|
|
39248
39251
|
const { vector_store_id, ...body } = params;
|
|
39249
|
-
return this._client.post(
|
|
39252
|
+
return this._client.post(path34`/vector_stores/${vector_store_id}/files/${fileID}`, {
|
|
39250
39253
|
body,
|
|
39251
39254
|
...options,
|
|
39252
39255
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39256,7 +39259,7 @@ var init_files4 = __esm({
|
|
|
39256
39259
|
* Returns a list of vector store files.
|
|
39257
39260
|
*/
|
|
39258
39261
|
list(vectorStoreID, query = {}, options) {
|
|
39259
|
-
return this._client.getAPIList(
|
|
39262
|
+
return this._client.getAPIList(path34`/vector_stores/${vectorStoreID}/files`, CursorPage, {
|
|
39260
39263
|
query,
|
|
39261
39264
|
...options,
|
|
39262
39265
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39270,7 +39273,7 @@ var init_files4 = __esm({
|
|
|
39270
39273
|
*/
|
|
39271
39274
|
delete(fileID, params, options) {
|
|
39272
39275
|
const { vector_store_id } = params;
|
|
39273
|
-
return this._client.delete(
|
|
39276
|
+
return this._client.delete(path34`/vector_stores/${vector_store_id}/files/${fileID}`, {
|
|
39274
39277
|
...options,
|
|
39275
39278
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39276
39279
|
});
|
|
@@ -39345,7 +39348,7 @@ var init_files4 = __esm({
|
|
|
39345
39348
|
*/
|
|
39346
39349
|
content(fileID, params, options) {
|
|
39347
39350
|
const { vector_store_id } = params;
|
|
39348
|
-
return this._client.getAPIList(
|
|
39351
|
+
return this._client.getAPIList(path34`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page2, { ...options, headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
|
|
39349
39352
|
}
|
|
39350
39353
|
};
|
|
39351
39354
|
}
|
|
@@ -39383,7 +39386,7 @@ var init_vector_stores = __esm({
|
|
|
39383
39386
|
* Retrieves a vector store.
|
|
39384
39387
|
*/
|
|
39385
39388
|
retrieve(vectorStoreID, options) {
|
|
39386
|
-
return this._client.get(
|
|
39389
|
+
return this._client.get(path34`/vector_stores/${vectorStoreID}`, {
|
|
39387
39390
|
...options,
|
|
39388
39391
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39389
39392
|
});
|
|
@@ -39392,7 +39395,7 @@ var init_vector_stores = __esm({
|
|
|
39392
39395
|
* Modifies a vector store.
|
|
39393
39396
|
*/
|
|
39394
39397
|
update(vectorStoreID, body, options) {
|
|
39395
|
-
return this._client.post(
|
|
39398
|
+
return this._client.post(path34`/vector_stores/${vectorStoreID}`, {
|
|
39396
39399
|
body,
|
|
39397
39400
|
...options,
|
|
39398
39401
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39412,7 +39415,7 @@ var init_vector_stores = __esm({
|
|
|
39412
39415
|
* Delete a vector store.
|
|
39413
39416
|
*/
|
|
39414
39417
|
delete(vectorStoreID, options) {
|
|
39415
|
-
return this._client.delete(
|
|
39418
|
+
return this._client.delete(path34`/vector_stores/${vectorStoreID}`, {
|
|
39416
39419
|
...options,
|
|
39417
39420
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39418
39421
|
});
|
|
@@ -39422,7 +39425,7 @@ var init_vector_stores = __esm({
|
|
|
39422
39425
|
* filter.
|
|
39423
39426
|
*/
|
|
39424
39427
|
search(vectorStoreID, body, options) {
|
|
39425
|
-
return this._client.getAPIList(
|
|
39428
|
+
return this._client.getAPIList(path34`/vector_stores/${vectorStoreID}/search`, Page2, {
|
|
39426
39429
|
body,
|
|
39427
39430
|
method: "post",
|
|
39428
39431
|
...options,
|
|
@@ -39725,9 +39728,9 @@ var init_client2 = __esm({
|
|
|
39725
39728
|
this.apiKey = token;
|
|
39726
39729
|
return true;
|
|
39727
39730
|
}
|
|
39728
|
-
buildURL(
|
|
39731
|
+
buildURL(path39, query, defaultBaseURL) {
|
|
39729
39732
|
const baseURL = !__classPrivateFieldGet2(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
39730
|
-
const url2 = isAbsoluteURL2(
|
|
39733
|
+
const url2 = isAbsoluteURL2(path39) ? new URL(path39) : new URL(baseURL + (baseURL.endsWith("/") && path39.startsWith("/") ? path39.slice(1) : path39));
|
|
39731
39734
|
const defaultQuery = this.defaultQuery();
|
|
39732
39735
|
if (!isEmptyObj2(defaultQuery)) {
|
|
39733
39736
|
query = { ...defaultQuery, ...query };
|
|
@@ -39751,24 +39754,24 @@ var init_client2 = __esm({
|
|
|
39751
39754
|
*/
|
|
39752
39755
|
async prepareRequest(request, { url: url2, options }) {
|
|
39753
39756
|
}
|
|
39754
|
-
get(
|
|
39755
|
-
return this.methodRequest("get",
|
|
39757
|
+
get(path39, opts) {
|
|
39758
|
+
return this.methodRequest("get", path39, opts);
|
|
39756
39759
|
}
|
|
39757
|
-
post(
|
|
39758
|
-
return this.methodRequest("post",
|
|
39760
|
+
post(path39, opts) {
|
|
39761
|
+
return this.methodRequest("post", path39, opts);
|
|
39759
39762
|
}
|
|
39760
|
-
patch(
|
|
39761
|
-
return this.methodRequest("patch",
|
|
39763
|
+
patch(path39, opts) {
|
|
39764
|
+
return this.methodRequest("patch", path39, opts);
|
|
39762
39765
|
}
|
|
39763
|
-
put(
|
|
39764
|
-
return this.methodRequest("put",
|
|
39766
|
+
put(path39, opts) {
|
|
39767
|
+
return this.methodRequest("put", path39, opts);
|
|
39765
39768
|
}
|
|
39766
|
-
delete(
|
|
39767
|
-
return this.methodRequest("delete",
|
|
39769
|
+
delete(path39, opts) {
|
|
39770
|
+
return this.methodRequest("delete", path39, opts);
|
|
39768
39771
|
}
|
|
39769
|
-
methodRequest(method,
|
|
39772
|
+
methodRequest(method, path39, opts) {
|
|
39770
39773
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
39771
|
-
return { method, path:
|
|
39774
|
+
return { method, path: path39, ...opts2 };
|
|
39772
39775
|
}));
|
|
39773
39776
|
}
|
|
39774
39777
|
request(options, remainingRetries = null) {
|
|
@@ -39872,8 +39875,8 @@ var init_client2 = __esm({
|
|
|
39872
39875
|
}));
|
|
39873
39876
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
39874
39877
|
}
|
|
39875
|
-
getAPIList(
|
|
39876
|
-
return this.requestAPIList(Page3, { method: "get", path:
|
|
39878
|
+
getAPIList(path39, Page3, opts) {
|
|
39879
|
+
return this.requestAPIList(Page3, { method: "get", path: path39, ...opts });
|
|
39877
39880
|
}
|
|
39878
39881
|
requestAPIList(Page3, options) {
|
|
39879
39882
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -39951,8 +39954,8 @@ var init_client2 = __esm({
|
|
|
39951
39954
|
}
|
|
39952
39955
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
39953
39956
|
const options = { ...inputOptions };
|
|
39954
|
-
const { method, path:
|
|
39955
|
-
const url2 = this.buildURL(
|
|
39957
|
+
const { method, path: path39, query, defaultBaseURL } = options;
|
|
39958
|
+
const url2 = this.buildURL(path39, query, defaultBaseURL);
|
|
39956
39959
|
if ("timeout" in options)
|
|
39957
39960
|
validatePositiveInteger2("timeout", options.timeout);
|
|
39958
39961
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -40753,7 +40756,7 @@ __export(config_loader_exports, {
|
|
|
40753
40756
|
loadEnvironmentConfig: () => loadEnvironmentConfig
|
|
40754
40757
|
});
|
|
40755
40758
|
import * as fs40 from "fs";
|
|
40756
|
-
import * as
|
|
40759
|
+
import * as path35 from "path";
|
|
40757
40760
|
import { createConfigLoader, listEnvironmentNames, ConfigurationError } from "@semiont/core";
|
|
40758
40761
|
function findProjectRoot() {
|
|
40759
40762
|
const root = process.env.SEMIONT_ROOT;
|
|
@@ -40771,8 +40774,8 @@ function findProjectRoot() {
|
|
|
40771
40774
|
"Check that SEMIONT_ROOT environment variable is set correctly"
|
|
40772
40775
|
);
|
|
40773
40776
|
}
|
|
40774
|
-
const hasSemiontJson = fs40.existsSync(
|
|
40775
|
-
const hasEnvironments = fs40.existsSync(
|
|
40777
|
+
const hasSemiontJson = fs40.existsSync(path35.join(root, "semiont.json"));
|
|
40778
|
+
const hasEnvironments = fs40.existsSync(path35.join(root, "environments"));
|
|
40776
40779
|
if (!hasSemiontJson && !hasEnvironments) {
|
|
40777
40780
|
throw new ConfigurationError(
|
|
40778
40781
|
`SEMIONT_ROOT does not point to a valid Semiont project: ${root}`,
|
|
@@ -40785,7 +40788,7 @@ function findProjectRoot() {
|
|
|
40785
40788
|
function getAvailableEnvironments() {
|
|
40786
40789
|
try {
|
|
40787
40790
|
const projectRoot = findProjectRoot();
|
|
40788
|
-
const configDir =
|
|
40791
|
+
const configDir = path35.join(projectRoot, "environments");
|
|
40789
40792
|
if (!fs40.existsSync(configDir)) {
|
|
40790
40793
|
return [];
|
|
40791
40794
|
}
|
|
@@ -40804,11 +40807,11 @@ var init_config_loader = __esm({
|
|
|
40804
40807
|
"use strict";
|
|
40805
40808
|
nodeFileReader = {
|
|
40806
40809
|
readIfExists: (filePath) => {
|
|
40807
|
-
const absolutePath =
|
|
40810
|
+
const absolutePath = path35.resolve(filePath);
|
|
40808
40811
|
return fs40.existsSync(absolutePath) ? fs40.readFileSync(absolutePath, "utf-8") : null;
|
|
40809
40812
|
},
|
|
40810
40813
|
readRequired: (filePath) => {
|
|
40811
|
-
const absolutePath =
|
|
40814
|
+
const absolutePath = path35.resolve(filePath);
|
|
40812
40815
|
if (!fs40.existsSync(absolutePath)) {
|
|
40813
40816
|
throw new ConfigurationError(
|
|
40814
40817
|
`Configuration file not found: ${absolutePath}`,
|
|
@@ -41947,7 +41950,7 @@ import express from "express";
|
|
|
41947
41950
|
import { createServer as createServer4 } from "http";
|
|
41948
41951
|
import { Server as SocketIOServer } from "socket.io";
|
|
41949
41952
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
41950
|
-
import { dirname as dirname11, join as
|
|
41953
|
+
import { dirname as dirname11, join as join34 } from "path";
|
|
41951
41954
|
import fs41 from "fs";
|
|
41952
41955
|
var __filename, __dirname, embeddedJS, embeddedCSS, WebDashboardServer;
|
|
41953
41956
|
var init_web_dashboard_server = __esm({
|
|
@@ -41998,15 +42001,15 @@ var init_web_dashboard_server = __esm({
|
|
|
41998
42001
|
});
|
|
41999
42002
|
} else {
|
|
42000
42003
|
const possibleDirs = [
|
|
42001
|
-
|
|
42002
|
-
|
|
42003
|
-
|
|
42004
|
-
|
|
42005
|
-
|
|
42004
|
+
join34(__dirname, "..", "..", "..", "dist", "dashboard"),
|
|
42005
|
+
join34(__dirname, "dashboard"),
|
|
42006
|
+
join34(__dirname, "..", "dashboard"),
|
|
42007
|
+
join34(process.cwd(), "dist", "dashboard"),
|
|
42008
|
+
join34(process.cwd(), "apps", "cli", "dist", "dashboard")
|
|
42006
42009
|
];
|
|
42007
42010
|
let distDir = null;
|
|
42008
42011
|
for (const dir of possibleDirs) {
|
|
42009
|
-
if (fs41.existsSync(
|
|
42012
|
+
if (fs41.existsSync(join34(dir, "dashboard.js"))) {
|
|
42010
42013
|
distDir = dir;
|
|
42011
42014
|
bundleExists = true;
|
|
42012
42015
|
console.log(`Found dashboard bundle at: ${dir}`);
|
|
@@ -42407,7 +42410,7 @@ var require_package = __commonJS({
|
|
|
42407
42410
|
"package.json"(exports, module) {
|
|
42408
42411
|
module.exports = {
|
|
42409
42412
|
name: "@semiont/cli",
|
|
42410
|
-
version: "0.2.
|
|
42413
|
+
version: "0.2.40",
|
|
42411
42414
|
description: "Semiont CLI - Unified environment management tool",
|
|
42412
42415
|
_comment: "AWS SDK dependencies (@aws-sdk/*) are only used by platforms/aws",
|
|
42413
42416
|
type: "module",
|
|
@@ -42471,9 +42474,8 @@ var require_package = __commonJS({
|
|
|
42471
42474
|
"@aws-sdk/client-secrets-manager": "^3.600.0",
|
|
42472
42475
|
"@aws-sdk/client-sts": "^3.859.0",
|
|
42473
42476
|
"@aws-sdk/client-wafv2": "^3.859.0",
|
|
42474
|
-
"@
|
|
42475
|
-
"@semiont/
|
|
42476
|
-
"@semiont/core": "^0.2.39",
|
|
42477
|
+
"@semiont/api-client": "^0.2.40",
|
|
42478
|
+
"@semiont/core": "^0.2.40",
|
|
42477
42479
|
"@testcontainers/postgresql": "^11.5.1",
|
|
42478
42480
|
arg: "^5.0.2",
|
|
42479
42481
|
argon2: "^0.43.0",
|
|
@@ -42491,6 +42493,7 @@ var require_package = __commonJS({
|
|
|
42491
42493
|
zod: "^3.23.8"
|
|
42492
42494
|
},
|
|
42493
42495
|
devDependencies: {
|
|
42496
|
+
"@prisma/client": "^6.13.0",
|
|
42494
42497
|
"@types/express": "^4.17.17",
|
|
42495
42498
|
"@types/ink": "^0.5.2",
|
|
42496
42499
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -43843,7 +43846,7 @@ function isCommandDefinition(obj) {
|
|
|
43843
43846
|
|
|
43844
43847
|
// src/core/service-discovery.ts
|
|
43845
43848
|
init_config_loader();
|
|
43846
|
-
import * as
|
|
43849
|
+
import * as path36 from "path";
|
|
43847
43850
|
import * as fs42 from "fs";
|
|
43848
43851
|
var BUILT_IN_SERVICES = ["frontend", "backend", "database", "filesystem"];
|
|
43849
43852
|
var environmentServicesCache = /* @__PURE__ */ new Map();
|
|
@@ -43853,7 +43856,7 @@ async function loadEnvironmentServices(environment) {
|
|
|
43853
43856
|
}
|
|
43854
43857
|
try {
|
|
43855
43858
|
const PROJECT_ROOT = findProjectRoot();
|
|
43856
|
-
const configPath =
|
|
43859
|
+
const configPath = path36.join(PROJECT_ROOT, "environments", `${environment}.json`);
|
|
43857
43860
|
if (!fs42.existsSync(configPath)) {
|
|
43858
43861
|
return [...BUILT_IN_SERVICES];
|
|
43859
43862
|
}
|
|
@@ -43888,7 +43891,7 @@ async function isValidService(service, environment) {
|
|
|
43888
43891
|
import { parseEnvironment as parseEnvironment2 } from "@semiont/core";
|
|
43889
43892
|
|
|
43890
43893
|
// src/core/service-resolver.ts
|
|
43891
|
-
import * as
|
|
43894
|
+
import * as path37 from "path";
|
|
43892
43895
|
import { ConfigurationError as ConfigurationError2 } from "@semiont/core";
|
|
43893
43896
|
function getServicePlatform(serviceName, config2) {
|
|
43894
43897
|
const environment = config2._metadata?.environment;
|
|
@@ -43936,7 +43939,7 @@ function resolveServiceDeployments(serviceNames, config2) {
|
|
|
43936
43939
|
const serviceConfig = config2.services?.[serviceName];
|
|
43937
43940
|
if (!serviceConfig) {
|
|
43938
43941
|
const availableServices = Object.keys(config2.services || {});
|
|
43939
|
-
const configPath =
|
|
43942
|
+
const configPath = path37.join(projectRoot, "environments", `${environment}.json`);
|
|
43940
43943
|
console.warn(`\u274C Service '${serviceName}' not found in environment '${environment}'`);
|
|
43941
43944
|
if (availableServices.length > 0) {
|
|
43942
43945
|
console.warn(` Available services: ${availableServices.join(", ")}`);
|
|
@@ -43975,7 +43978,7 @@ function resolveServiceDeployments(serviceNames, config2) {
|
|
|
43975
43978
|
// src/core/command-service-matcher.ts
|
|
43976
43979
|
init_service_factory();
|
|
43977
43980
|
init_service_command_capabilities();
|
|
43978
|
-
import * as
|
|
43981
|
+
import * as path38 from "path";
|
|
43979
43982
|
async function checkServiceSupportsCommand(serviceName, command, envConfig) {
|
|
43980
43983
|
try {
|
|
43981
43984
|
const projectRoot = envConfig._metadata?.projectRoot;
|
|
@@ -44059,7 +44062,7 @@ async function resolveServiceSelector(selector, capability, envConfig) {
|
|
|
44059
44062
|
if (!projectRoot) {
|
|
44060
44063
|
throw new Error("Project root is required in envConfig._metadata");
|
|
44061
44064
|
}
|
|
44062
|
-
const configPath =
|
|
44065
|
+
const configPath = path38.join(projectRoot, "environments", `${environment}.json`);
|
|
44063
44066
|
const errorMessage = [
|
|
44064
44067
|
`Unknown service '${selector}' in environment '${environment}'`,
|
|
44065
44068
|
`Available services: ${availableServices.join(", ")}`,
|
|
@@ -44555,14 +44558,14 @@ var OutputFormatter = class {
|
|
|
44555
44558
|
/**
|
|
44556
44559
|
* Get nested value from object using dot notation
|
|
44557
44560
|
*/
|
|
44558
|
-
static getNestedValue(obj,
|
|
44559
|
-
return
|
|
44561
|
+
static getNestedValue(obj, path39) {
|
|
44562
|
+
return path39.split(".").reduce((current, key) => current?.[key], obj);
|
|
44560
44563
|
}
|
|
44561
44564
|
/**
|
|
44562
44565
|
* Set nested value in object using dot notation
|
|
44563
44566
|
*/
|
|
44564
|
-
static setNestedValue(obj,
|
|
44565
|
-
const keys =
|
|
44567
|
+
static setNestedValue(obj, path39, value) {
|
|
44568
|
+
const keys = path39.split(".");
|
|
44566
44569
|
const lastKey = keys.pop();
|
|
44567
44570
|
const target = keys.reduce((current, key) => {
|
|
44568
44571
|
if (!(key in current)) {
|