@apicity/simplefunctions 0.5.4 → 0.6.0
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 +2093 -239
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/simplefunctions.d.ts.map +1 -1
- package/dist/src/simplefunctions.js +860 -1
- package/dist/src/simplefunctions.js.map +1 -1
- package/dist/src/types.d.ts +379 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/zod.d.ts +188 -47
- package/dist/src/zod.d.ts.map +1 -1
- package/dist/src/zod.js +51 -0
- package/dist/src/zod.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { attachExamples } from "./example.js";
|
|
2
2
|
import { SimpleFunctionsError } from "./types.js";
|
|
3
|
-
import { SimpleFunctionsAgentFeedRequestSchema, SimpleFunctionsBillRequestSchema, SimpleFunctionsBriefingRequestSchema, SimpleFunctionsCalendarRequestSchema, SimpleFunctionsCalibrationRequestSchema, SimpleFunctionsCandlesRequestSchema, SimpleFunctionsChangesRequestSchema, SimpleFunctionsCongressMemberRequestSchema, SimpleFunctionsCongressMembersRequestSchema, SimpleFunctionsContextRequestSchema, SimpleFunctionsContagionRequestSchema, SimpleFunctionsCrossVenueRequestSchema, SimpleFunctionsDiscussRequestSchema, SimpleFunctionsEconQueryRequestSchema, SimpleFunctionsEdgesRequestSchema, SimpleFunctionsEmptyRequestSchema, SimpleFunctionsFeaturedMarketsRequestSchema, SimpleFunctionsFredRequestSchema, SimpleFunctionsGovQueryRequestSchema, SimpleFunctionsIdeaRequestSchema, SimpleFunctionsIndexHistoryRequestSchema, SimpleFunctionsInspectRequestSchema, SimpleFunctionsLegislationRequestSchema, SimpleFunctionsMarketCandlesRequestSchema, SimpleFunctionsMarketDetailRequestSchema, SimpleFunctionsMarketDetailResponseSchema, SimpleFunctionsMarketHistoryResponseSchema, SimpleFunctionsMarketsRequestSchema, SimpleFunctionsMicrostructureHistoryRequestSchema, SimpleFunctionsMoversRequestSchema, SimpleFunctionsNoRequestSchema, SimpleFunctionsOddsRequestSchema, SimpleFunctionsPublicListRequestSchema, SimpleFunctionsPublicSearchRequestSchema, SimpleFunctionsQueryRequestSchema, SimpleFunctionsRegimeScanRequestSchema, SimpleFunctionsScanRequestSchema, SimpleFunctionsScreenByTickersRequestSchema, SimpleFunctionsScreenRequestSchema, SimpleFunctionsSearchRequestSchema, SimpleFunctionsSlugRequestSchema, SimpleFunctionsTickerRequestSchema, SimpleFunctionsTickerSchema, SimpleFunctionsTradesRequestSchema, SimpleFunctionsWorldDeltaRequestSchema, SimpleFunctionsWorldPathRequestSchema, SimpleFunctionsWorldRequestSchema, SimpleFunctionsYieldCurveRequestSchema, } from "./zod.js";
|
|
3
|
+
import { SimpleFunctionsAgentFeedRequestSchema, SimpleFunctionsBillRequestSchema, SimpleFunctionsBriefingRequestSchema, SimpleFunctionsCalendarRequestSchema, SimpleFunctionsCalibrationRequestSchema, SimpleFunctionsBodyRequestSchema, SimpleFunctionsCandlesRequestSchema, SimpleFunctionsChangesRequestSchema, SimpleFunctionsCongressMemberRequestSchema, SimpleFunctionsCongressMembersRequestSchema, SimpleFunctionsContextRequestSchema, SimpleFunctionsContagionRequestSchema, SimpleFunctionsCrossVenueRequestSchema, SimpleFunctionsDiscussRequestSchema, SimpleFunctionsEconQueryRequestSchema, SimpleFunctionsEdgesRequestSchema, SimpleFunctionsEmptyRequestSchema, SimpleFunctionsFeaturedMarketsRequestSchema, SimpleFunctionsFredRequestSchema, SimpleFunctionsGovQueryRequestSchema, SimpleFunctionsIdRequestSchema, SimpleFunctionsIdeaRequestSchema, SimpleFunctionsIndexHistoryRequestSchema, SimpleFunctionsInspectRequestSchema, SimpleFunctionsLegislationRequestSchema, SimpleFunctionsMarketCandlesRequestSchema, SimpleFunctionsMarketDetailRequestSchema, SimpleFunctionsMarketDetailResponseSchema, SimpleFunctionsMarketHistoryResponseSchema, SimpleFunctionsMarketsRequestSchema, SimpleFunctionsMicrostructureHistoryRequestSchema, SimpleFunctionsMoversRequestSchema, SimpleFunctionsNoRequestSchema, SimpleFunctionsOptionalQueryRequestSchema, SimpleFunctionsOddsRequestSchema, SimpleFunctionsPositionRequestSchema, SimpleFunctionsPublicListRequestSchema, SimpleFunctionsPublicSearchRequestSchema, SimpleFunctionsQueryRequestSchema, SimpleFunctionsRecordRequestSchema, SimpleFunctionsRegimeScanRequestSchema, SimpleFunctionsScanRequestSchema, SimpleFunctionsScreenByTickersRequestSchema, SimpleFunctionsScreenRequestSchema, SimpleFunctionsSearchRequestSchema, SimpleFunctionsSlugRequestSchema, SimpleFunctionsStrategyRequestSchema, SimpleFunctionsTickerPathRequestSchema, SimpleFunctionsTickerRequestSchema, SimpleFunctionsTickerSchema, SimpleFunctionsTokenRequestSchema, SimpleFunctionsTradesRequestSchema, SimpleFunctionsTransportRequestSchema, SimpleFunctionsWorldDeltaRequestSchema, SimpleFunctionsWorldPathRequestSchema, SimpleFunctionsWorldRequestSchema, SimpleFunctionsYieldCurveRequestSchema, } from "./zod.js";
|
|
4
4
|
function isErrorBody(value) {
|
|
5
5
|
return typeof value === "object" && value !== null;
|
|
6
6
|
}
|
|
@@ -67,6 +67,53 @@ function buildQuery(params) {
|
|
|
67
67
|
const query = qs.toString();
|
|
68
68
|
return query ? `?${query}` : "";
|
|
69
69
|
}
|
|
70
|
+
function queryFromRecord(req = {}) {
|
|
71
|
+
return buildQuery(req);
|
|
72
|
+
}
|
|
73
|
+
function queryFromBodyRequest(req) {
|
|
74
|
+
const query = req.query;
|
|
75
|
+
return query ? queryFromRecord(query) : "";
|
|
76
|
+
}
|
|
77
|
+
function queryFromExplicitQuery(req = {}) {
|
|
78
|
+
const query = req.query;
|
|
79
|
+
if (query && typeof query === "object") {
|
|
80
|
+
return queryFromRecord(query);
|
|
81
|
+
}
|
|
82
|
+
return "";
|
|
83
|
+
}
|
|
84
|
+
function queryFromRequest(req = {}, omitKeys = []) {
|
|
85
|
+
const explicitQuery = req.query;
|
|
86
|
+
if (explicitQuery && typeof explicitQuery === "object") {
|
|
87
|
+
return queryFromRecord(explicitQuery);
|
|
88
|
+
}
|
|
89
|
+
const omitted = new Set(["body", "query", ...omitKeys]);
|
|
90
|
+
const query = {};
|
|
91
|
+
for (const [key, value] of Object.entries(req)) {
|
|
92
|
+
if (!omitted.has(key) && value !== undefined) {
|
|
93
|
+
query[key] = value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return queryFromRecord(query);
|
|
97
|
+
}
|
|
98
|
+
function bodyFromRequest(req = {}, omitKeys = []) {
|
|
99
|
+
if (Object.prototype.hasOwnProperty.call(req, "body")) {
|
|
100
|
+
return req.body;
|
|
101
|
+
}
|
|
102
|
+
const omitted = new Set(["query", ...omitKeys]);
|
|
103
|
+
const body = {};
|
|
104
|
+
for (const [key, value] of Object.entries(req)) {
|
|
105
|
+
if (!omitted.has(key) && value !== undefined) {
|
|
106
|
+
body[key] = value;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return Object.keys(body).length > 0 ? body : undefined;
|
|
110
|
+
}
|
|
111
|
+
function requestId(req) {
|
|
112
|
+
return pathSegment(req.id.trim());
|
|
113
|
+
}
|
|
114
|
+
function requestTicker(req) {
|
|
115
|
+
return pathSegment(req.ticker.trim());
|
|
116
|
+
}
|
|
70
117
|
function buildQueryForQuery(req) {
|
|
71
118
|
return buildQuery({
|
|
72
119
|
q: req.q,
|
|
@@ -217,6 +264,9 @@ export function createSimpleFunctions(opts = {}) {
|
|
|
217
264
|
}
|
|
218
265
|
throw new SimpleFunctionsError(formatErrorMessage(res.status, resBody), res.status, resBody);
|
|
219
266
|
}
|
|
267
|
+
if (res.status === 204) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
220
270
|
return (await res.json());
|
|
221
271
|
}
|
|
222
272
|
catch (error) {
|
|
@@ -226,6 +276,60 @@ export function createSimpleFunctions(opts = {}) {
|
|
|
226
276
|
throw new SimpleFunctionsError(`SimpleFunctions request failed: ${error}`, 500);
|
|
227
277
|
}
|
|
228
278
|
}
|
|
279
|
+
async function makeRawRequest(method, path, body, signal) {
|
|
280
|
+
const controller = new AbortController();
|
|
281
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
282
|
+
if (signal) {
|
|
283
|
+
attachAbortHandler(signal, controller);
|
|
284
|
+
}
|
|
285
|
+
try {
|
|
286
|
+
const headers = {};
|
|
287
|
+
if (opts.apiKey) {
|
|
288
|
+
headers.Authorization = `Bearer ${opts.apiKey}`;
|
|
289
|
+
}
|
|
290
|
+
let requestBody;
|
|
291
|
+
if (body instanceof FormData ||
|
|
292
|
+
body instanceof Blob ||
|
|
293
|
+
body instanceof URLSearchParams ||
|
|
294
|
+
typeof body === "string") {
|
|
295
|
+
requestBody = body;
|
|
296
|
+
}
|
|
297
|
+
else if (body instanceof ArrayBuffer) {
|
|
298
|
+
requestBody = body;
|
|
299
|
+
}
|
|
300
|
+
else if (ArrayBuffer.isView(body)) {
|
|
301
|
+
requestBody = body;
|
|
302
|
+
}
|
|
303
|
+
else if (body !== undefined) {
|
|
304
|
+
headers["Content-Type"] = "application/json";
|
|
305
|
+
requestBody = JSON.stringify(body);
|
|
306
|
+
}
|
|
307
|
+
const res = await doFetch(`${baseURL}${path}`, {
|
|
308
|
+
method,
|
|
309
|
+
headers,
|
|
310
|
+
body: requestBody,
|
|
311
|
+
signal: controller.signal,
|
|
312
|
+
});
|
|
313
|
+
clearTimeout(timeoutId);
|
|
314
|
+
if (!res.ok) {
|
|
315
|
+
let resBody = null;
|
|
316
|
+
try {
|
|
317
|
+
resBody = await res.json();
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
// ignore parse errors
|
|
321
|
+
}
|
|
322
|
+
throw new SimpleFunctionsError(formatErrorMessage(res.status, resBody), res.status, resBody);
|
|
323
|
+
}
|
|
324
|
+
return res;
|
|
325
|
+
}
|
|
326
|
+
catch (error) {
|
|
327
|
+
clearTimeout(timeoutId);
|
|
328
|
+
if (error instanceof SimpleFunctionsError)
|
|
329
|
+
throw error;
|
|
330
|
+
throw new SimpleFunctionsError(`SimpleFunctions request failed: ${error}`, 500);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
229
333
|
async function makeGetTextRequest(path, signal, requestBaseURL = baseURL) {
|
|
230
334
|
const controller = new AbortController();
|
|
231
335
|
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
@@ -262,6 +366,30 @@ export function createSimpleFunctions(opts = {}) {
|
|
|
262
366
|
throw new SimpleFunctionsError(`SimpleFunctions request failed: ${error}`, 500);
|
|
263
367
|
}
|
|
264
368
|
}
|
|
369
|
+
function jsonGet(schema, path, endpoint, auth = true) {
|
|
370
|
+
return Object.assign(async (req = {}, signal) => {
|
|
371
|
+
if (auth)
|
|
372
|
+
requireApiKey(opts.apiKey, endpoint);
|
|
373
|
+
const parsed = parseWithSchema(schema, req ?? {});
|
|
374
|
+
return makeJsonRequest("GET", path(parsed), undefined, signal);
|
|
375
|
+
}, { schema });
|
|
376
|
+
}
|
|
377
|
+
function jsonBody(method, schema, path, endpoint, omitKeys = [], auth = true) {
|
|
378
|
+
return Object.assign(async (req, signal) => {
|
|
379
|
+
if (auth)
|
|
380
|
+
requireApiKey(opts.apiKey, endpoint);
|
|
381
|
+
const parsed = parseWithSchema(schema, req ?? {});
|
|
382
|
+
return makeJsonRequest(method, path(parsed), bodyFromRequest(parsed, omitKeys), signal);
|
|
383
|
+
}, { schema });
|
|
384
|
+
}
|
|
385
|
+
function jsonOptionalBody(method, schema, path, endpoint, auth = true) {
|
|
386
|
+
return Object.assign(async (req = {}, signal) => {
|
|
387
|
+
if (auth)
|
|
388
|
+
requireApiKey(opts.apiKey, endpoint);
|
|
389
|
+
const parsed = parseWithSchema(schema, req ?? {});
|
|
390
|
+
return makeJsonRequest(method, path(parsed), bodyFromRequest(parsed), signal);
|
|
391
|
+
}, { schema });
|
|
392
|
+
}
|
|
265
393
|
// GET https://simplefunctions.dev/api/public/query{query}
|
|
266
394
|
// Docs: https://docs.simplefunctions.dev/api-reference/query
|
|
267
395
|
const query = Object.assign(async (req, signal) => {
|
|
@@ -982,6 +1110,527 @@ export function createSimpleFunctions(opts = {}) {
|
|
|
982
1110
|
});
|
|
983
1111
|
return makeJsonRequest("GET", `/api/edges${query}`, undefined, signal);
|
|
984
1112
|
}, { schema: SimpleFunctionsEdgesRequestSchema });
|
|
1113
|
+
// GET https://simplefunctions.dev/api/keys{query}
|
|
1114
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/keys
|
|
1115
|
+
const keysList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/keys${queryFromRequest(req)}`, "/api/keys");
|
|
1116
|
+
// POST https://simplefunctions.dev/api/keys
|
|
1117
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/keys
|
|
1118
|
+
const keysCreate = jsonBody("POST", SimpleFunctionsBodyRequestSchema, () => "/api/keys", "/api/keys");
|
|
1119
|
+
// DELETE https://simplefunctions.dev/api/keys/{id}
|
|
1120
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/keys
|
|
1121
|
+
const keysDelete = jsonBody("DELETE", SimpleFunctionsIdRequestSchema, (req) => `/api/keys/${requestId(req)}`, "/api/keys/{id}", ["id"]);
|
|
1122
|
+
const keys = Object.assign(keysList, {
|
|
1123
|
+
create: keysCreate,
|
|
1124
|
+
delete: keysDelete,
|
|
1125
|
+
});
|
|
1126
|
+
// POST https://simplefunctions.dev/api/auth/cli
|
|
1127
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/keys
|
|
1128
|
+
const authCliInit = jsonBody("POST", SimpleFunctionsBodyRequestSchema, () => "/api/auth/cli", "/api/auth/cli", [], false);
|
|
1129
|
+
// GET https://simplefunctions.dev/api/auth/cli/poll{query}
|
|
1130
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/keys
|
|
1131
|
+
const authCliPoll = jsonGet(SimpleFunctionsTokenRequestSchema, (req) => `/api/auth/cli/poll${buildQuery({ token: req.token.trim() })}`, "/api/auth/cli/poll", false);
|
|
1132
|
+
// POST https://simplefunctions.dev/api/auth/cli/complete
|
|
1133
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/keys
|
|
1134
|
+
const authCliComplete = jsonBody("POST", SimpleFunctionsBodyRequestSchema, () => "/api/auth/cli/complete", "/api/auth/cli/complete", [], false);
|
|
1135
|
+
const authCli = Object.assign(authCliInit, {
|
|
1136
|
+
poll: authCliPoll,
|
|
1137
|
+
complete: authCliComplete,
|
|
1138
|
+
});
|
|
1139
|
+
// POST https://simplefunctions.dev/api/signup
|
|
1140
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/keys
|
|
1141
|
+
const signup = jsonBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/signup", "/api/signup", [], false);
|
|
1142
|
+
// GET https://simplefunctions.dev/api/feed{query}
|
|
1143
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/account
|
|
1144
|
+
const feed = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/feed${queryFromRequest(req)}`, "/api/feed");
|
|
1145
|
+
// GET https://simplefunctions.dev/api/dashboard/usage{query}
|
|
1146
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/account
|
|
1147
|
+
const dashboardUsage = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/dashboard/usage${queryFromRequest(req)}`, "/api/dashboard/usage");
|
|
1148
|
+
// GET https://simplefunctions.dev/api/thesis{query}
|
|
1149
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1150
|
+
const thesisList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/thesis${queryFromRequest(req)}`, "/api/thesis");
|
|
1151
|
+
// POST https://simplefunctions.dev/api/thesis/create{query}
|
|
1152
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1153
|
+
const thesisCreate = jsonBody("POST", SimpleFunctionsBodyRequestSchema, (req) => `/api/thesis/create${queryFromBodyRequest(req)}`, "/api/thesis/create");
|
|
1154
|
+
// GET https://simplefunctions.dev/api/thesis/{id}{query}
|
|
1155
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1156
|
+
const thesisRetrieve = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}${queryFromRequest(req, ["id"])}`, "/api/thesis/{id}");
|
|
1157
|
+
// PATCH https://simplefunctions.dev/api/thesis/{id}
|
|
1158
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1159
|
+
const thesisUpdate = jsonBody("PATCH", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}`, "/api/thesis/{id}", ["id"]);
|
|
1160
|
+
// DELETE https://simplefunctions.dev/api/thesis/{id}
|
|
1161
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1162
|
+
const thesisDelete = jsonBody("DELETE", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}`, "/api/thesis/{id}", ["id"]);
|
|
1163
|
+
// GET https://simplefunctions.dev/api/thesis/by-ticker/{ticker}
|
|
1164
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1165
|
+
const thesisByTicker = jsonGet(SimpleFunctionsTickerPathRequestSchema, (req) => `/api/thesis/by-ticker/${requestTicker(req)}`, "/api/thesis/by-ticker/{ticker}", false);
|
|
1166
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/signal
|
|
1167
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1168
|
+
const thesisSignal = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/signal`, "/api/thesis/{id}/signal", ["id"]);
|
|
1169
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/evaluate
|
|
1170
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1171
|
+
const thesisEvaluate = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/evaluate`, "/api/thesis/{id}/evaluate", ["id"]);
|
|
1172
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/augment{query}
|
|
1173
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1174
|
+
const thesisAugment = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/augment${queryFromRequest(req, ["id"])}`, "/api/thesis/{id}/augment", ["id"]);
|
|
1175
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/nodes
|
|
1176
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1177
|
+
const thesisNodes = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/nodes`, "/api/thesis/{id}/nodes", ["id"]);
|
|
1178
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/fork
|
|
1179
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1180
|
+
const thesisFork = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/fork`, "/api/thesis/{id}/fork", ["id"]);
|
|
1181
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/whatif
|
|
1182
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1183
|
+
const thesisWhatif = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/whatif`, "/api/thesis/{id}/whatif", ["id"]);
|
|
1184
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/context
|
|
1185
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1186
|
+
const thesisContext = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/context`, "/api/thesis/{id}/context");
|
|
1187
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/changes{query}
|
|
1188
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1189
|
+
const thesisChanges = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/changes${queryFromRequest(req, ["id"])}`, "/api/thesis/{id}/changes");
|
|
1190
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/prompt
|
|
1191
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1192
|
+
const thesisPrompt = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/prompt`, "/api/thesis/{id}/prompt");
|
|
1193
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/evaluations
|
|
1194
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1195
|
+
const thesisEvaluations = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/evaluations`, "/api/thesis/{id}/evaluations");
|
|
1196
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/heartbeat
|
|
1197
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1198
|
+
const thesisHeartbeatGet = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/heartbeat`, "/api/thesis/{id}/heartbeat");
|
|
1199
|
+
// PATCH https://simplefunctions.dev/api/thesis/{id}/heartbeat
|
|
1200
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1201
|
+
const thesisHeartbeatUpdate = jsonBody("PATCH", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/heartbeat`, "/api/thesis/{id}/heartbeat", ["id"]);
|
|
1202
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/positions
|
|
1203
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1204
|
+
const thesisPositionsList = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/positions`, "/api/thesis/{id}/positions");
|
|
1205
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/positions
|
|
1206
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1207
|
+
const thesisPositionsCreate = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/positions`, "/api/thesis/{id}/positions", ["id"]);
|
|
1208
|
+
// PATCH https://simplefunctions.dev/api/thesis/{id}/positions/{posId}
|
|
1209
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1210
|
+
const thesisPositionsUpdate = jsonBody("PATCH", SimpleFunctionsPositionRequestSchema, (req) => `/api/thesis/${pathSegment(req.id.trim())}/positions/${pathSegment(req.posId.trim())}`, "/api/thesis/{id}/positions/{posId}", ["id", "posId"]);
|
|
1211
|
+
// DELETE https://simplefunctions.dev/api/thesis/{id}/positions/{posId}
|
|
1212
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1213
|
+
const thesisPositionsDelete = jsonBody("DELETE", SimpleFunctionsPositionRequestSchema, (req) => `/api/thesis/${pathSegment(req.id.trim())}/positions/${pathSegment(req.posId.trim())}`, "/api/thesis/{id}/positions/{posId}", ["id", "posId"]);
|
|
1214
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/strategies{query}
|
|
1215
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1216
|
+
const thesisStrategiesList = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/strategies${queryFromRequest(req, [
|
|
1217
|
+
"id",
|
|
1218
|
+
])}`, "/api/thesis/{id}/strategies");
|
|
1219
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/strategies
|
|
1220
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1221
|
+
const thesisStrategiesCreate = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/strategies`, "/api/thesis/{id}/strategies", ["id"]);
|
|
1222
|
+
// PATCH https://simplefunctions.dev/api/thesis/{id}/strategies/{sid}
|
|
1223
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1224
|
+
const thesisStrategiesUpdate = jsonBody("PATCH", SimpleFunctionsStrategyRequestSchema, (req) => `/api/thesis/${pathSegment(req.id.trim())}/strategies/${pathSegment(req.sid.trim())}`, "/api/thesis/{id}/strategies/{sid}", ["id", "sid"]);
|
|
1225
|
+
// DELETE https://simplefunctions.dev/api/thesis/{id}/strategies/{sid}
|
|
1226
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1227
|
+
const thesisStrategiesDelete = jsonBody("DELETE", SimpleFunctionsStrategyRequestSchema, (req) => `/api/thesis/${pathSegment(req.id.trim())}/strategies/${pathSegment(req.sid.trim())}`, "/api/thesis/{id}/strategies/{sid}", ["id", "sid"]);
|
|
1228
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/publish
|
|
1229
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1230
|
+
const thesisPublish = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/publish`, "/api/thesis/{id}/publish", ["id"]);
|
|
1231
|
+
// sig-ok: unpublish is the JS-safe semantic alias for DELETE publish.
|
|
1232
|
+
// DELETE https://simplefunctions.dev/api/thesis/{id}/publish
|
|
1233
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1234
|
+
const thesisUnpublish = jsonBody("DELETE", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/publish`, "/api/thesis/{id}/publish", ["id"]);
|
|
1235
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/videos
|
|
1236
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1237
|
+
const thesisVideosList = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/videos`, "/api/thesis/{id}/videos");
|
|
1238
|
+
// POST https://simplefunctions.dev/api/thesis/{id}/videos
|
|
1239
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1240
|
+
const thesisVideosCreate = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/videos`, "/api/thesis/{id}/videos", ["id"]);
|
|
1241
|
+
// GET https://simplefunctions.dev/api/thesis/{id}/video-data
|
|
1242
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/thesis
|
|
1243
|
+
const thesisVideoData = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/thesis/${requestId(req)}/video-data`, "/api/thesis/{id}/video-data");
|
|
1244
|
+
const authThesis = Object.assign(thesisList, {
|
|
1245
|
+
create: thesisCreate,
|
|
1246
|
+
retrieve: thesisRetrieve,
|
|
1247
|
+
update: thesisUpdate,
|
|
1248
|
+
delete: thesisDelete,
|
|
1249
|
+
byTicker: thesisByTicker,
|
|
1250
|
+
signal: thesisSignal,
|
|
1251
|
+
evaluate: thesisEvaluate,
|
|
1252
|
+
augment: thesisAugment,
|
|
1253
|
+
nodes: thesisNodes,
|
|
1254
|
+
fork: thesisFork,
|
|
1255
|
+
whatif: thesisWhatif,
|
|
1256
|
+
context: thesisContext,
|
|
1257
|
+
changes: thesisChanges,
|
|
1258
|
+
prompt: thesisPrompt,
|
|
1259
|
+
evaluations: thesisEvaluations,
|
|
1260
|
+
heartbeat: {
|
|
1261
|
+
get: thesisHeartbeatGet,
|
|
1262
|
+
update: thesisHeartbeatUpdate,
|
|
1263
|
+
},
|
|
1264
|
+
positions: {
|
|
1265
|
+
list: thesisPositionsList,
|
|
1266
|
+
create: thesisPositionsCreate,
|
|
1267
|
+
update: thesisPositionsUpdate,
|
|
1268
|
+
delete: thesisPositionsDelete,
|
|
1269
|
+
},
|
|
1270
|
+
strategies: {
|
|
1271
|
+
list: thesisStrategiesList,
|
|
1272
|
+
create: thesisStrategiesCreate,
|
|
1273
|
+
update: thesisStrategiesUpdate,
|
|
1274
|
+
delete: thesisStrategiesDelete,
|
|
1275
|
+
},
|
|
1276
|
+
publish: thesisPublish,
|
|
1277
|
+
unpublish: thesisUnpublish,
|
|
1278
|
+
videos: {
|
|
1279
|
+
list: thesisVideosList,
|
|
1280
|
+
create: thesisVideosCreate,
|
|
1281
|
+
},
|
|
1282
|
+
videoData: thesisVideoData,
|
|
1283
|
+
});
|
|
1284
|
+
// GET https://simplefunctions.dev/api/portfolio/state
|
|
1285
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1286
|
+
const portfolioStateGet = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, () => "/api/portfolio/state", "/api/portfolio/state");
|
|
1287
|
+
// PUT https://simplefunctions.dev/api/portfolio/state{query}
|
|
1288
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1289
|
+
const portfolioStateUpdate = jsonBody("PUT", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/state${queryFromExplicitQuery(req)}`, "/api/portfolio/state");
|
|
1290
|
+
const portfolioState = Object.assign(portfolioStateGet, {
|
|
1291
|
+
update: portfolioStateUpdate,
|
|
1292
|
+
});
|
|
1293
|
+
// GET https://simplefunctions.dev/api/portfolio/config
|
|
1294
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1295
|
+
const portfolioConfigGet = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, () => "/api/portfolio/config", "/api/portfolio/config");
|
|
1296
|
+
// PUT https://simplefunctions.dev/api/portfolio/config{query}
|
|
1297
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1298
|
+
const portfolioConfigUpdate = jsonBody("PUT", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/config${queryFromExplicitQuery(req)}`, "/api/portfolio/config");
|
|
1299
|
+
const portfolioConfig = Object.assign(portfolioConfigGet, {
|
|
1300
|
+
update: portfolioConfigUpdate,
|
|
1301
|
+
});
|
|
1302
|
+
// GET https://simplefunctions.dev/api/portfolio/ticks{query}
|
|
1303
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1304
|
+
const portfolioTicksList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/ticks${queryFromRequest(req)}`, "/api/portfolio/ticks");
|
|
1305
|
+
// GET https://simplefunctions.dev/api/portfolio/ticks/{id}
|
|
1306
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1307
|
+
const portfolioTicksRetrieve = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/portfolio/ticks/${requestId(req)}`, "/api/portfolio/ticks/{id}");
|
|
1308
|
+
// POST https://simplefunctions.dev/api/portfolio/ticks{query}
|
|
1309
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1310
|
+
const portfolioTicksCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/ticks${queryFromExplicitQuery(req)}`, "/api/portfolio/ticks");
|
|
1311
|
+
const portfolioTicks = Object.assign(portfolioTicksList, {
|
|
1312
|
+
retrieve: portfolioTicksRetrieve,
|
|
1313
|
+
create: portfolioTicksCreate,
|
|
1314
|
+
});
|
|
1315
|
+
// GET https://simplefunctions.dev/api/portfolio/trades{query}
|
|
1316
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1317
|
+
const portfolioTradesList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/trades${queryFromRequest(req)}`, "/api/portfolio/trades");
|
|
1318
|
+
// GET https://simplefunctions.dev/api/portfolio/trades/{id}
|
|
1319
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1320
|
+
const portfolioTradesRetrieve = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/portfolio/trades/${requestId(req)}`, "/api/portfolio/trades/{id}");
|
|
1321
|
+
// POST https://simplefunctions.dev/api/portfolio/trades{query}
|
|
1322
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1323
|
+
const portfolioTradesCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/trades${queryFromExplicitQuery(req)}`, "/api/portfolio/trades");
|
|
1324
|
+
const portfolioTrades = Object.assign(portfolioTradesList, {
|
|
1325
|
+
retrieve: portfolioTradesRetrieve,
|
|
1326
|
+
create: portfolioTradesCreate,
|
|
1327
|
+
});
|
|
1328
|
+
// GET https://simplefunctions.dev/api/portfolio/ledger{query}
|
|
1329
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1330
|
+
const portfolioLedgerList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/ledger${queryFromRequest(req)}`, "/api/portfolio/ledger");
|
|
1331
|
+
// POST https://simplefunctions.dev/api/portfolio/ledger/import/kalshi{query}
|
|
1332
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1333
|
+
const portfolioLedgerImportKalshi = jsonBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/ledger/import/kalshi${queryFromExplicitQuery(req)}`, "/api/portfolio/ledger/import/kalshi");
|
|
1334
|
+
// POST https://simplefunctions.dev/api/portfolio/ledger/import/kalshi/pull{query}
|
|
1335
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1336
|
+
const portfolioLedgerImportKalshiPull = jsonBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/ledger/import/kalshi/pull${queryFromExplicitQuery(req)}`, "/api/portfolio/ledger/import/kalshi/pull");
|
|
1337
|
+
// POST https://simplefunctions.dev/api/portfolio/ledger/import/polymarket{query}
|
|
1338
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1339
|
+
const portfolioLedgerImportPolymarket = jsonBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/ledger/import/polymarket${queryFromExplicitQuery(req)}`, "/api/portfolio/ledger/import/polymarket");
|
|
1340
|
+
const portfolioLedgerImport = {
|
|
1341
|
+
kalshi: Object.assign(portfolioLedgerImportKalshi, {
|
|
1342
|
+
pull: portfolioLedgerImportKalshiPull,
|
|
1343
|
+
}),
|
|
1344
|
+
polymarket: portfolioLedgerImportPolymarket,
|
|
1345
|
+
};
|
|
1346
|
+
const portfolioLedger = Object.assign(portfolioLedgerList, {
|
|
1347
|
+
import: portfolioLedgerImport,
|
|
1348
|
+
});
|
|
1349
|
+
// GET https://simplefunctions.dev/api/portfolio/fills{query}
|
|
1350
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1351
|
+
const portfolioFills = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/fills${queryFromRequest(req)}`, "/api/portfolio/fills");
|
|
1352
|
+
// GET https://simplefunctions.dev/api/portfolio/positions{query}
|
|
1353
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1354
|
+
const portfolioPositions = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/positions${queryFromRequest(req)}`, "/api/portfolio/positions");
|
|
1355
|
+
// GET https://simplefunctions.dev/api/portfolio/activity{query}
|
|
1356
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1357
|
+
const portfolioActivity = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/activity${queryFromRequest(req)}`, "/api/portfolio/activity");
|
|
1358
|
+
// GET https://simplefunctions.dev/api/portfolio/attribution/daily{query}
|
|
1359
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1360
|
+
const portfolioAttributionDaily = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/attribution/daily${queryFromRequest(req)}`, "/api/portfolio/attribution/daily");
|
|
1361
|
+
// GET https://simplefunctions.dev/api/portfolio/attribution/grouped{query}
|
|
1362
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1363
|
+
const portfolioAttributionGrouped = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/attribution/grouped${queryFromRequest(req)}`, "/api/portfolio/attribution/grouped");
|
|
1364
|
+
// GET https://simplefunctions.dev/api/portfolio/risk{query}
|
|
1365
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1366
|
+
const portfolioRisk = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/risk${queryFromRequest(req)}`, "/api/portfolio/risk");
|
|
1367
|
+
// GET https://simplefunctions.dev/api/portfolio/views{query}
|
|
1368
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1369
|
+
const portfolioViewsList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/views${queryFromRequest(req)}`, "/api/portfolio/views");
|
|
1370
|
+
// POST https://simplefunctions.dev/api/portfolio/views{query}
|
|
1371
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1372
|
+
const portfolioViewsCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/views${queryFromExplicitQuery(req)}`, "/api/portfolio/views");
|
|
1373
|
+
// PUT https://simplefunctions.dev/api/portfolio/views{query}
|
|
1374
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1375
|
+
const portfolioViewsUpdate = jsonBody("PUT", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/views${queryFromExplicitQuery(req)}`, "/api/portfolio/views");
|
|
1376
|
+
// DELETE https://simplefunctions.dev/api/portfolio/views{query}
|
|
1377
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1378
|
+
const portfolioViewsDelete = jsonBody("DELETE", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/views${queryFromExplicitQuery(req)}`, "/api/portfolio/views");
|
|
1379
|
+
const portfolioViews = Object.assign(portfolioViewsList, {
|
|
1380
|
+
create: portfolioViewsCreate,
|
|
1381
|
+
update: portfolioViewsUpdate,
|
|
1382
|
+
delete: portfolioViewsDelete,
|
|
1383
|
+
});
|
|
1384
|
+
// GET https://simplefunctions.dev/api/portfolio/strategy{query}
|
|
1385
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1386
|
+
const portfolioStrategyList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/portfolio/strategy${queryFromRequest(req)}`, "/api/portfolio/strategy");
|
|
1387
|
+
// POST https://simplefunctions.dev/api/portfolio/strategy{query}
|
|
1388
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1389
|
+
const portfolioStrategyCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/strategy${queryFromExplicitQuery(req)}`, "/api/portfolio/strategy");
|
|
1390
|
+
// PUT https://simplefunctions.dev/api/portfolio/strategy{query}
|
|
1391
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1392
|
+
const portfolioStrategyUpdate = jsonBody("PUT", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/strategy${queryFromExplicitQuery(req)}`, "/api/portfolio/strategy");
|
|
1393
|
+
// DELETE https://simplefunctions.dev/api/portfolio/strategy{query}
|
|
1394
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1395
|
+
const portfolioStrategyDelete = jsonBody("DELETE", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/strategy${queryFromExplicitQuery(req)}`, "/api/portfolio/strategy");
|
|
1396
|
+
const portfolioStrategy = Object.assign(portfolioStrategyList, {
|
|
1397
|
+
create: portfolioStrategyCreate,
|
|
1398
|
+
update: portfolioStrategyUpdate,
|
|
1399
|
+
delete: portfolioStrategyDelete,
|
|
1400
|
+
});
|
|
1401
|
+
// POST https://simplefunctions.dev/api/portfolio/secrets{query}
|
|
1402
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1403
|
+
const portfolioSecretsCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/secrets${queryFromExplicitQuery(req)}`, "/api/portfolio/secrets");
|
|
1404
|
+
// DELETE https://simplefunctions.dev/api/portfolio/secrets{query}
|
|
1405
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1406
|
+
const portfolioSecretsDelete = jsonOptionalBody("DELETE", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/secrets${queryFromExplicitQuery(req)}`, "/api/portfolio/secrets");
|
|
1407
|
+
// POST https://simplefunctions.dev/api/portfolio/trigger{query}
|
|
1408
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/portfolio
|
|
1409
|
+
const portfolioTrigger = jsonOptionalBody("POST", SimpleFunctionsRecordRequestSchema, (req) => `/api/portfolio/trigger${queryFromExplicitQuery(req)}`, "/api/portfolio/trigger");
|
|
1410
|
+
const portfolio = {
|
|
1411
|
+
state: portfolioState,
|
|
1412
|
+
config: portfolioConfig,
|
|
1413
|
+
ticks: portfolioTicks,
|
|
1414
|
+
trades: portfolioTrades,
|
|
1415
|
+
ledger: portfolioLedger,
|
|
1416
|
+
fills: portfolioFills,
|
|
1417
|
+
positions: portfolioPositions,
|
|
1418
|
+
activity: portfolioActivity,
|
|
1419
|
+
attribution: {
|
|
1420
|
+
daily: portfolioAttributionDaily,
|
|
1421
|
+
grouped: portfolioAttributionGrouped,
|
|
1422
|
+
},
|
|
1423
|
+
risk: portfolioRisk,
|
|
1424
|
+
views: portfolioViews,
|
|
1425
|
+
strategy: portfolioStrategy,
|
|
1426
|
+
secrets: {
|
|
1427
|
+
create: portfolioSecretsCreate,
|
|
1428
|
+
delete: portfolioSecretsDelete,
|
|
1429
|
+
},
|
|
1430
|
+
trigger: portfolioTrigger,
|
|
1431
|
+
};
|
|
1432
|
+
// GET https://simplefunctions.dev/api/intents{query}
|
|
1433
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/execution-intents
|
|
1434
|
+
const intentsList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/intents${queryFromRequest(req)}`, "/api/intents");
|
|
1435
|
+
// POST https://simplefunctions.dev/api/intents
|
|
1436
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/execution-intents
|
|
1437
|
+
const intentsCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/intents", "/api/intents");
|
|
1438
|
+
// GET https://simplefunctions.dev/api/intents/{id}
|
|
1439
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/execution-intents
|
|
1440
|
+
const intentsRetrieve = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/intents/${requestId(req)}`, "/api/intents/{id}");
|
|
1441
|
+
// PATCH https://simplefunctions.dev/api/intents/{id}
|
|
1442
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/execution-intents
|
|
1443
|
+
const intentsUpdate = jsonBody("PATCH", SimpleFunctionsIdRequestSchema, (req) => `/api/intents/${requestId(req)}`, "/api/intents/{id}", ["id"]);
|
|
1444
|
+
// DELETE https://simplefunctions.dev/api/intents/{id}
|
|
1445
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/execution-intents
|
|
1446
|
+
const intentsDelete = jsonBody("DELETE", SimpleFunctionsIdRequestSchema, (req) => `/api/intents/${requestId(req)}`, "/api/intents/{id}", ["id"]);
|
|
1447
|
+
const intents = Object.assign(intentsList, {
|
|
1448
|
+
create: intentsCreate,
|
|
1449
|
+
retrieve: intentsRetrieve,
|
|
1450
|
+
update: intentsUpdate,
|
|
1451
|
+
delete: intentsDelete,
|
|
1452
|
+
});
|
|
1453
|
+
// GET https://simplefunctions.dev/api/runtime/exec{query}
|
|
1454
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/execution-intents
|
|
1455
|
+
const runtimeExecStatus = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/runtime/exec${queryFromRequest(req)}`, "/api/runtime/exec");
|
|
1456
|
+
// sig-ok: trigger distinguishes POST execution from GET status.
|
|
1457
|
+
// POST https://simplefunctions.dev/api/runtime/exec
|
|
1458
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/execution-intents
|
|
1459
|
+
const runtimeExecTrigger = jsonOptionalBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/runtime/exec", "/api/runtime/exec");
|
|
1460
|
+
const runtimeExec = Object.assign(runtimeExecStatus, {
|
|
1461
|
+
trigger: runtimeExecTrigger,
|
|
1462
|
+
});
|
|
1463
|
+
// GET https://simplefunctions.dev/api/watch{query}
|
|
1464
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1465
|
+
const watchList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/watch${queryFromRequest(req)}`, "/api/watch");
|
|
1466
|
+
// POST https://simplefunctions.dev/api/watch
|
|
1467
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1468
|
+
const watchCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/watch", "/api/watch");
|
|
1469
|
+
// POST https://simplefunctions.dev/api/watch/identify
|
|
1470
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1471
|
+
const watchIdentify = jsonBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/watch/identify", "/api/watch/identify");
|
|
1472
|
+
// GET https://simplefunctions.dev/api/watch/{id}
|
|
1473
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1474
|
+
const watchRetrieve = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/watch/${requestId(req)}`, "/api/watch/{id}");
|
|
1475
|
+
// PATCH https://simplefunctions.dev/api/watch/{id}
|
|
1476
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1477
|
+
const watchUpdate = jsonBody("PATCH", SimpleFunctionsIdRequestSchema, (req) => `/api/watch/${requestId(req)}`, "/api/watch/{id}", ["id"]);
|
|
1478
|
+
// DELETE https://simplefunctions.dev/api/watch/{id}
|
|
1479
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1480
|
+
const watchDelete = jsonBody("DELETE", SimpleFunctionsIdRequestSchema, (req) => `/api/watch/${requestId(req)}`, "/api/watch/{id}", ["id"]);
|
|
1481
|
+
// POST https://simplefunctions.dev/api/watch/{id}/refresh
|
|
1482
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1483
|
+
const watchRefresh = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/watch/${requestId(req)}/refresh`, "/api/watch/{id}/refresh", ["id"]);
|
|
1484
|
+
const watch = Object.assign(watchList, {
|
|
1485
|
+
create: watchCreate,
|
|
1486
|
+
identify: watchIdentify,
|
|
1487
|
+
retrieve: watchRetrieve,
|
|
1488
|
+
update: watchUpdate,
|
|
1489
|
+
delete: watchDelete,
|
|
1490
|
+
refresh: watchRefresh,
|
|
1491
|
+
});
|
|
1492
|
+
// GET https://simplefunctions.dev/api/alert-rules{query}
|
|
1493
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1494
|
+
const alertRulesList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/alert-rules${queryFromRequest(req)}`, "/api/alert-rules");
|
|
1495
|
+
// POST https://simplefunctions.dev/api/alert-rules
|
|
1496
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1497
|
+
const alertRulesCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/alert-rules", "/api/alert-rules");
|
|
1498
|
+
// GET https://simplefunctions.dev/api/alert-rules/{id}
|
|
1499
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1500
|
+
const alertRulesRetrieve = jsonGet(SimpleFunctionsIdRequestSchema, (req) => `/api/alert-rules/${requestId(req)}`, "/api/alert-rules/{id}");
|
|
1501
|
+
// PATCH https://simplefunctions.dev/api/alert-rules/{id}
|
|
1502
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1503
|
+
const alertRulesUpdate = jsonBody("PATCH", SimpleFunctionsIdRequestSchema, (req) => `/api/alert-rules/${requestId(req)}`, "/api/alert-rules/{id}", ["id"]);
|
|
1504
|
+
// DELETE https://simplefunctions.dev/api/alert-rules/{id}
|
|
1505
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1506
|
+
const alertRulesDelete = jsonBody("DELETE", SimpleFunctionsIdRequestSchema, (req) => `/api/alert-rules/${requestId(req)}`, "/api/alert-rules/{id}", ["id"]);
|
|
1507
|
+
// POST https://simplefunctions.dev/api/alert-rules/{id}/test
|
|
1508
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1509
|
+
const alertRulesTest = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/alert-rules/${requestId(req)}/test`, "/api/alert-rules/{id}/test", ["id"]);
|
|
1510
|
+
const alertRules = Object.assign(alertRulesList, {
|
|
1511
|
+
create: alertRulesCreate,
|
|
1512
|
+
retrieve: alertRulesRetrieve,
|
|
1513
|
+
update: alertRulesUpdate,
|
|
1514
|
+
delete: alertRulesDelete,
|
|
1515
|
+
test: alertRulesTest,
|
|
1516
|
+
});
|
|
1517
|
+
// GET https://simplefunctions.dev/api/webhook-endpoints{query}
|
|
1518
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1519
|
+
const webhookEndpointsList = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/webhook-endpoints${queryFromRequest(req)}`, "/api/webhook-endpoints");
|
|
1520
|
+
// POST https://simplefunctions.dev/api/webhook-endpoints
|
|
1521
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1522
|
+
const webhookEndpointsCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/webhook-endpoints", "/api/webhook-endpoints");
|
|
1523
|
+
// PATCH https://simplefunctions.dev/api/webhook-endpoints/{id}
|
|
1524
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1525
|
+
const webhookEndpointsUpdate = jsonBody("PATCH", SimpleFunctionsIdRequestSchema, (req) => `/api/webhook-endpoints/${requestId(req)}`, "/api/webhook-endpoints/{id}", ["id"]);
|
|
1526
|
+
// DELETE https://simplefunctions.dev/api/webhook-endpoints/{id}
|
|
1527
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1528
|
+
const webhookEndpointsDelete = jsonBody("DELETE", SimpleFunctionsIdRequestSchema, (req) => `/api/webhook-endpoints/${requestId(req)}`, "/api/webhook-endpoints/{id}", ["id"]);
|
|
1529
|
+
// POST https://simplefunctions.dev/api/webhook-endpoints/{id}/test
|
|
1530
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1531
|
+
const webhookEndpointsTest = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/webhook-endpoints/${requestId(req)}/test`, "/api/webhook-endpoints/{id}/test", ["id"]);
|
|
1532
|
+
const webhookEndpoints = Object.assign(webhookEndpointsList, {
|
|
1533
|
+
create: webhookEndpointsCreate,
|
|
1534
|
+
update: webhookEndpointsUpdate,
|
|
1535
|
+
delete: webhookEndpointsDelete,
|
|
1536
|
+
test: webhookEndpointsTest,
|
|
1537
|
+
});
|
|
1538
|
+
// GET https://simplefunctions.dev/api/alert-deliveries{query}
|
|
1539
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/watch-alerts
|
|
1540
|
+
const alertDeliveries = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/alert-deliveries${queryFromRequest(req)}`, "/api/alert-deliveries");
|
|
1541
|
+
// GET https://simplefunctions.dev/api/contracts/tools
|
|
1542
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/contract-tools
|
|
1543
|
+
const contractTools = jsonGet(SimpleFunctionsEmptyRequestSchema, () => "/api/contracts/tools", "/api/contracts/tools", false);
|
|
1544
|
+
// GET https://simplefunctions.dev/api/tools{query}
|
|
1545
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/tools
|
|
1546
|
+
const tools = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/tools${queryFromRequest(req)}`, "/api/tools", false);
|
|
1547
|
+
// GET https://simplefunctions.dev/api/skills{query}
|
|
1548
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/tools
|
|
1549
|
+
const apiSkills = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/skills${queryFromRequest(req)}`, "/api/skills", false);
|
|
1550
|
+
// GET https://simplefunctions.dev/api/prompt
|
|
1551
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/tools
|
|
1552
|
+
const prompt = jsonGet(SimpleFunctionsEmptyRequestSchema, () => "/api/prompt", "/api/prompt");
|
|
1553
|
+
// GET https://simplefunctions.dev/api/mcp/{transport}
|
|
1554
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/tools
|
|
1555
|
+
const mcpGet = Object.assign(async (req, signal) => {
|
|
1556
|
+
const parsed = parseWithSchema(SimpleFunctionsTransportRequestSchema, req);
|
|
1557
|
+
const transport = pathSegment(parsed.transport.trim());
|
|
1558
|
+
return makeGetTextRequest(`/api/mcp/${transport}`, signal);
|
|
1559
|
+
}, { schema: SimpleFunctionsTransportRequestSchema });
|
|
1560
|
+
// sig-ok: call distinguishes POST MCP calls from GET MCP metadata.
|
|
1561
|
+
// POST https://simplefunctions.dev/api/mcp/{transport}
|
|
1562
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/tools
|
|
1563
|
+
const mcpCall = jsonBody("POST", SimpleFunctionsTransportRequestSchema, (req) => `/api/mcp/${pathSegment(req.transport.trim())}`, "/api/mcp/{transport}", ["transport"], false);
|
|
1564
|
+
const mcp = Object.assign(mcpGet, {
|
|
1565
|
+
call: mcpCall,
|
|
1566
|
+
});
|
|
1567
|
+
// POST https://simplefunctions.dev/api/proxy/tts
|
|
1568
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/tools
|
|
1569
|
+
const proxyTts = Object.assign(async (req, signal) => {
|
|
1570
|
+
requireApiKey(opts.apiKey, "/api/proxy/tts");
|
|
1571
|
+
const parsed = parseWithSchema(SimpleFunctionsBodyRequestSchema, req);
|
|
1572
|
+
return makeRawRequest("POST", "/api/proxy/tts", bodyFromRequest(parsed), signal);
|
|
1573
|
+
}, { schema: SimpleFunctionsBodyRequestSchema });
|
|
1574
|
+
// POST https://simplefunctions.dev/api/proxy/stt
|
|
1575
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/tools
|
|
1576
|
+
const proxyStt = Object.assign(async (req, signal) => {
|
|
1577
|
+
requireApiKey(opts.apiKey, "/api/proxy/stt");
|
|
1578
|
+
const parsed = parseWithSchema(SimpleFunctionsBodyRequestSchema, req);
|
|
1579
|
+
return makeRawRequest("POST", "/api/proxy/stt", bodyFromRequest(parsed), signal);
|
|
1580
|
+
}, { schema: SimpleFunctionsBodyRequestSchema });
|
|
1581
|
+
const proxy = {
|
|
1582
|
+
tts: proxyTts,
|
|
1583
|
+
stt: proxyStt,
|
|
1584
|
+
};
|
|
1585
|
+
// GET https://simplefunctions.dev/api/x/search{query}
|
|
1586
|
+
// Docs: https://docs.simplefunctions.dev/inventory/surface-map
|
|
1587
|
+
const xSearch = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/x/search${queryFromRequest(req)}`, "/api/x/search");
|
|
1588
|
+
// GET https://simplefunctions.dev/api/x/volume{query}
|
|
1589
|
+
// Docs: https://docs.simplefunctions.dev/inventory/surface-map
|
|
1590
|
+
const xVolume = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/x/volume${queryFromRequest(req)}`, "/api/x/volume");
|
|
1591
|
+
// GET https://simplefunctions.dev/api/x/news{query}
|
|
1592
|
+
// Docs: https://docs.simplefunctions.dev/inventory/surface-map
|
|
1593
|
+
const xNews = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/x/news${queryFromRequest(req)}`, "/api/x/news");
|
|
1594
|
+
// GET https://simplefunctions.dev/api/x/account{query}
|
|
1595
|
+
// Docs: https://docs.simplefunctions.dev/inventory/surface-map
|
|
1596
|
+
const xAccount = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/x/account${queryFromRequest(req)}`, "/api/x/account");
|
|
1597
|
+
const x = {
|
|
1598
|
+
search: xSearch,
|
|
1599
|
+
volume: xVolume,
|
|
1600
|
+
news: xNews,
|
|
1601
|
+
account: xAccount,
|
|
1602
|
+
};
|
|
1603
|
+
// GET https://simplefunctions.dev/api/dashboard2/market-watch-v2{query}
|
|
1604
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/market-watch
|
|
1605
|
+
const marketWatchV2 = jsonGet(SimpleFunctionsOptionalQueryRequestSchema, (req) => `/api/dashboard2/market-watch-v2${queryFromRequest(req)}`, "/api/dashboard2/market-watch-v2", false);
|
|
1606
|
+
// POST https://simplefunctions.dev/api/dashboard2/market-watch/panels
|
|
1607
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/market-watch
|
|
1608
|
+
const marketWatchPanelsCreate = jsonBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/dashboard2/market-watch/panels", "/api/dashboard2/market-watch/panels", [], false);
|
|
1609
|
+
// PATCH https://simplefunctions.dev/api/dashboard2/market-watch/panels/{id}
|
|
1610
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/market-watch
|
|
1611
|
+
const marketWatchPanelsUpdate = jsonBody("PATCH", SimpleFunctionsIdRequestSchema, (req) => `/api/dashboard2/market-watch/panels/${requestId(req)}`, "/api/dashboard2/market-watch/panels/{id}", ["id"], false);
|
|
1612
|
+
// DELETE https://simplefunctions.dev/api/dashboard2/market-watch/panels/{id}
|
|
1613
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/market-watch
|
|
1614
|
+
const marketWatchPanelsDelete = jsonBody("DELETE", SimpleFunctionsIdRequestSchema, (req) => `/api/dashboard2/market-watch/panels/${requestId(req)}`, "/api/dashboard2/market-watch/panels/{id}", ["id"], false);
|
|
1615
|
+
// POST https://simplefunctions.dev/api/dashboard2/market-watch/panels/reorder
|
|
1616
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/market-watch
|
|
1617
|
+
const marketWatchPanelsReorder = jsonBody("POST", SimpleFunctionsRecordRequestSchema, () => "/api/dashboard2/market-watch/panels/reorder", "/api/dashboard2/market-watch/panels/reorder", [], false);
|
|
1618
|
+
// sig-ok: run is an action method on the panel resource.
|
|
1619
|
+
// POST https://simplefunctions.dev/api/dashboard2/market-watch/panels/{id}/run
|
|
1620
|
+
// Docs: https://docs.simplefunctions.dev/api-reference/market-watch
|
|
1621
|
+
const marketWatchPanelsRun = jsonBody("POST", SimpleFunctionsIdRequestSchema, (req) => `/api/dashboard2/market-watch/panels/${requestId(req)}/run`, "/api/dashboard2/market-watch/panels/{id}/run", ["id"], false);
|
|
1622
|
+
const dashboard2 = {
|
|
1623
|
+
marketWatchV2,
|
|
1624
|
+
marketWatch: {
|
|
1625
|
+
panels: {
|
|
1626
|
+
create: marketWatchPanelsCreate,
|
|
1627
|
+
update: marketWatchPanelsUpdate,
|
|
1628
|
+
delete: marketWatchPanelsDelete,
|
|
1629
|
+
reorder: marketWatchPanelsReorder,
|
|
1630
|
+
run: marketWatchPanelsRun,
|
|
1631
|
+
},
|
|
1632
|
+
},
|
|
1633
|
+
};
|
|
985
1634
|
const publicApi = {
|
|
986
1635
|
query,
|
|
987
1636
|
market,
|
|
@@ -1041,10 +1690,39 @@ export function createSimpleFunctions(opts = {}) {
|
|
|
1041
1690
|
inspect,
|
|
1042
1691
|
feed: agentFeed,
|
|
1043
1692
|
},
|
|
1693
|
+
auth: {
|
|
1694
|
+
cli: authCli,
|
|
1695
|
+
},
|
|
1044
1696
|
calibration,
|
|
1045
1697
|
changes,
|
|
1698
|
+
contracts: {
|
|
1699
|
+
tools: contractTools,
|
|
1700
|
+
},
|
|
1701
|
+
dashboard: {
|
|
1702
|
+
usage: dashboardUsage,
|
|
1703
|
+
},
|
|
1704
|
+
dashboard2,
|
|
1046
1705
|
edges,
|
|
1706
|
+
feed,
|
|
1707
|
+
intents,
|
|
1708
|
+
keys,
|
|
1709
|
+
mcp,
|
|
1710
|
+
portfolio,
|
|
1711
|
+
prompt,
|
|
1712
|
+
proxy,
|
|
1047
1713
|
public: publicApi,
|
|
1714
|
+
runtime: {
|
|
1715
|
+
exec: runtimeExec,
|
|
1716
|
+
},
|
|
1717
|
+
signup,
|
|
1718
|
+
skills: apiSkills,
|
|
1719
|
+
thesis: authThesis,
|
|
1720
|
+
tools,
|
|
1721
|
+
watch,
|
|
1722
|
+
alertRules,
|
|
1723
|
+
webhookEndpoints,
|
|
1724
|
+
alertDeliveries,
|
|
1725
|
+
x,
|
|
1048
1726
|
};
|
|
1049
1727
|
const data = {
|
|
1050
1728
|
v1: {
|
|
@@ -1067,9 +1745,190 @@ export function createSimpleFunctions(opts = {}) {
|
|
|
1067
1745
|
},
|
|
1068
1746
|
post: {
|
|
1069
1747
|
api: {
|
|
1748
|
+
auth: {
|
|
1749
|
+
cli: authCli,
|
|
1750
|
+
},
|
|
1751
|
+
dashboard2: {
|
|
1752
|
+
marketWatch: {
|
|
1753
|
+
panels: {
|
|
1754
|
+
create: marketWatchPanelsCreate,
|
|
1755
|
+
reorder: marketWatchPanelsReorder,
|
|
1756
|
+
run: marketWatchPanelsRun,
|
|
1757
|
+
},
|
|
1758
|
+
},
|
|
1759
|
+
},
|
|
1760
|
+
intents: {
|
|
1761
|
+
create: intentsCreate,
|
|
1762
|
+
},
|
|
1763
|
+
keys: {
|
|
1764
|
+
create: keysCreate,
|
|
1765
|
+
},
|
|
1766
|
+
mcp: {
|
|
1767
|
+
call: mcpCall,
|
|
1768
|
+
},
|
|
1769
|
+
portfolio: {
|
|
1770
|
+
ledger: {
|
|
1771
|
+
import: portfolioLedgerImport,
|
|
1772
|
+
},
|
|
1773
|
+
secrets: {
|
|
1774
|
+
create: portfolioSecretsCreate,
|
|
1775
|
+
},
|
|
1776
|
+
strategy: {
|
|
1777
|
+
create: portfolioStrategyCreate,
|
|
1778
|
+
},
|
|
1779
|
+
ticks: {
|
|
1780
|
+
create: portfolioTicksCreate,
|
|
1781
|
+
},
|
|
1782
|
+
trades: {
|
|
1783
|
+
create: portfolioTradesCreate,
|
|
1784
|
+
},
|
|
1785
|
+
trigger: portfolioTrigger,
|
|
1786
|
+
views: {
|
|
1787
|
+
create: portfolioViewsCreate,
|
|
1788
|
+
},
|
|
1789
|
+
},
|
|
1790
|
+
proxy,
|
|
1070
1791
|
public: {
|
|
1071
1792
|
discuss,
|
|
1072
1793
|
},
|
|
1794
|
+
runtime: {
|
|
1795
|
+
exec: {
|
|
1796
|
+
trigger: runtimeExecTrigger,
|
|
1797
|
+
},
|
|
1798
|
+
},
|
|
1799
|
+
signup,
|
|
1800
|
+
thesis: {
|
|
1801
|
+
create: thesisCreate,
|
|
1802
|
+
signal: thesisSignal,
|
|
1803
|
+
evaluate: thesisEvaluate,
|
|
1804
|
+
augment: thesisAugment,
|
|
1805
|
+
nodes: thesisNodes,
|
|
1806
|
+
fork: thesisFork,
|
|
1807
|
+
whatif: thesisWhatif,
|
|
1808
|
+
positions: {
|
|
1809
|
+
create: thesisPositionsCreate,
|
|
1810
|
+
},
|
|
1811
|
+
strategies: {
|
|
1812
|
+
create: thesisStrategiesCreate,
|
|
1813
|
+
},
|
|
1814
|
+
publish: thesisPublish,
|
|
1815
|
+
videos: {
|
|
1816
|
+
create: thesisVideosCreate,
|
|
1817
|
+
},
|
|
1818
|
+
},
|
|
1819
|
+
watch: {
|
|
1820
|
+
create: watchCreate,
|
|
1821
|
+
identify: watchIdentify,
|
|
1822
|
+
refresh: watchRefresh,
|
|
1823
|
+
},
|
|
1824
|
+
alertRules: {
|
|
1825
|
+
create: alertRulesCreate,
|
|
1826
|
+
test: alertRulesTest,
|
|
1827
|
+
},
|
|
1828
|
+
webhookEndpoints: {
|
|
1829
|
+
create: webhookEndpointsCreate,
|
|
1830
|
+
test: webhookEndpointsTest,
|
|
1831
|
+
},
|
|
1832
|
+
},
|
|
1833
|
+
},
|
|
1834
|
+
put: {
|
|
1835
|
+
api: {
|
|
1836
|
+
portfolio: {
|
|
1837
|
+
config: {
|
|
1838
|
+
update: portfolioConfigUpdate,
|
|
1839
|
+
},
|
|
1840
|
+
state: {
|
|
1841
|
+
update: portfolioStateUpdate,
|
|
1842
|
+
},
|
|
1843
|
+
strategy: {
|
|
1844
|
+
update: portfolioStrategyUpdate,
|
|
1845
|
+
},
|
|
1846
|
+
views: {
|
|
1847
|
+
update: portfolioViewsUpdate,
|
|
1848
|
+
},
|
|
1849
|
+
},
|
|
1850
|
+
},
|
|
1851
|
+
},
|
|
1852
|
+
patch: {
|
|
1853
|
+
api: {
|
|
1854
|
+
dashboard2: {
|
|
1855
|
+
marketWatch: {
|
|
1856
|
+
panels: {
|
|
1857
|
+
update: marketWatchPanelsUpdate,
|
|
1858
|
+
},
|
|
1859
|
+
},
|
|
1860
|
+
},
|
|
1861
|
+
intents: {
|
|
1862
|
+
update: intentsUpdate,
|
|
1863
|
+
},
|
|
1864
|
+
thesis: {
|
|
1865
|
+
update: thesisUpdate,
|
|
1866
|
+
heartbeat: {
|
|
1867
|
+
update: thesisHeartbeatUpdate,
|
|
1868
|
+
},
|
|
1869
|
+
positions: {
|
|
1870
|
+
update: thesisPositionsUpdate,
|
|
1871
|
+
},
|
|
1872
|
+
strategies: {
|
|
1873
|
+
update: thesisStrategiesUpdate,
|
|
1874
|
+
},
|
|
1875
|
+
},
|
|
1876
|
+
watch: {
|
|
1877
|
+
update: watchUpdate,
|
|
1878
|
+
},
|
|
1879
|
+
alertRules: {
|
|
1880
|
+
update: alertRulesUpdate,
|
|
1881
|
+
},
|
|
1882
|
+
webhookEndpoints: {
|
|
1883
|
+
update: webhookEndpointsUpdate,
|
|
1884
|
+
},
|
|
1885
|
+
},
|
|
1886
|
+
},
|
|
1887
|
+
delete: {
|
|
1888
|
+
api: {
|
|
1889
|
+
dashboard2: {
|
|
1890
|
+
marketWatch: {
|
|
1891
|
+
panels: {
|
|
1892
|
+
delete: marketWatchPanelsDelete,
|
|
1893
|
+
},
|
|
1894
|
+
},
|
|
1895
|
+
},
|
|
1896
|
+
intents: {
|
|
1897
|
+
delete: intentsDelete,
|
|
1898
|
+
},
|
|
1899
|
+
keys: {
|
|
1900
|
+
delete: keysDelete,
|
|
1901
|
+
},
|
|
1902
|
+
portfolio: {
|
|
1903
|
+
secrets: {
|
|
1904
|
+
delete: portfolioSecretsDelete,
|
|
1905
|
+
},
|
|
1906
|
+
strategy: {
|
|
1907
|
+
delete: portfolioStrategyDelete,
|
|
1908
|
+
},
|
|
1909
|
+
views: {
|
|
1910
|
+
delete: portfolioViewsDelete,
|
|
1911
|
+
},
|
|
1912
|
+
},
|
|
1913
|
+
thesis: {
|
|
1914
|
+
delete: thesisDelete,
|
|
1915
|
+
unpublish: thesisUnpublish,
|
|
1916
|
+
positions: {
|
|
1917
|
+
delete: thesisPositionsDelete,
|
|
1918
|
+
},
|
|
1919
|
+
strategies: {
|
|
1920
|
+
delete: thesisStrategiesDelete,
|
|
1921
|
+
},
|
|
1922
|
+
},
|
|
1923
|
+
watch: {
|
|
1924
|
+
delete: watchDelete,
|
|
1925
|
+
},
|
|
1926
|
+
alertRules: {
|
|
1927
|
+
delete: alertRulesDelete,
|
|
1928
|
+
},
|
|
1929
|
+
webhookEndpoints: {
|
|
1930
|
+
delete: webhookEndpointsDelete,
|
|
1931
|
+
},
|
|
1073
1932
|
},
|
|
1074
1933
|
},
|
|
1075
1934
|
});
|