@substrio/sdk 0.1.0 → 0.1.1
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/package.json +1 -1
- package/substrio_errors.mjs +102 -22
- package/substrio_operations.d.mts +1192 -105
- package/substrio_operations.mjs +151 -37
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by packages/substrio-sdk/scripts/gen_operations.mjs from the server's operation catalog
|
|
2
|
-
// (GET /v1/_openapi, registry version 1,
|
|
2
|
+
// (GET /v1/_openapi, registry version 1, 548 operations with routes);
|
|
3
3
|
// never edit by hand. Regenerate: npm run gen:operations (packages/substrio-sdk).
|
|
4
4
|
|
|
5
5
|
/** Filter: a field name maps to a value (equality) or an operator object; $and, $or and $nor combine filters of this same form */
|
|
@@ -20,6 +20,7 @@ export type SubstrioErrorBody = {
|
|
|
20
20
|
fix?: {
|
|
21
21
|
operation: string;
|
|
22
22
|
tool?: string;
|
|
23
|
+
why?: string;
|
|
23
24
|
cli?: string;
|
|
24
25
|
method?: string;
|
|
25
26
|
path?: string;
|
|
@@ -28,13 +29,13 @@ export type SubstrioErrorBody = {
|
|
|
28
29
|
};
|
|
29
30
|
/** The offending request field */
|
|
30
31
|
field?: string;
|
|
31
|
-
code: "UNKNOWN" | "NOT_IMPLEMENTED" | "SYSTEM_CLOSED" | "SYSTEM_ALREADY_OPEN" | "INVALID_ARGUMENT" | "INVALID_HANDLE" | "THREAD_INIT_FAILED" | "SHUTDOWN_IN_PROGRESS" | "INTERNAL" | "NULL_TREE" | "NULL_SYSTEM" | "BARRIER_UNSUPPORTED" | "STORAGE_IO" | "DISK_FULL" | "FILE_NOT_FOUND" | "PERMISSION_DENIED" | "FILE_CORRUPT" | "MMAP_FAILED" | "FSYNC_FAILED" | "LOCK_FAILED" | "NOT_A_DATABASE" | "OLD_FORMAT" | "NEWER_FORMAT" | "OUT_OF_MEMORY" | "BUFFER_TOO_SMALL" | "ALLOCATOR_FAULT" | "TRANSACTION_CONFLICT" | "RETRY" | "TRANSACTION_READ_ONLY" | "TRANSACTION_NOT_FOUND" | "DEADLOCK_DETECTED" | "TIMEOUT" | "NO_ACTIVE_TRANSACTION" | "CANCELLED" | "LWW_STALE" | "KEY_NOT_FOUND" | "KEY_TOO_LARGE" | "VALUE_TOO_LARGE" | "KEY_EMPTY" | "KEY_EXISTS" | "MISSING_INDEX" | "OWNERSHIP_REQUIRED" | "KEY_PREFIX_COLLISION" | "KEY_DELETED" | "UNIQUE" | "ID_RESERVED" | "INVALID_ID" | "ID_MISMATCH" | "INDEX_DUPLICATES" | "FIELD_IDS_EXHAUSTED" | "ID_PAST_ROWS" | "ID_NOT_ISSUED" | "ENGINE_GATE_HELD" | "ROW_STALE" | "CURSOR_EXHAUSTED" | "CURSOR_INVALIDATED" | "INVALID_RANGE" | "BATCH_OP_FAILED" | "NODE_NOT_FOUND" | "EDGE_NOT_FOUND" | "PROPERTY_NOT_FOUND" | "INVALID_EDGE" | "PATH_NOT_FOUND" | "GRAPH_CYCLE_DETECTED" | "DIMENSION_MISMATCH" | "POINT_NOT_FOUND" | "INVALID_BOUNDS" | "INVALID_RADIUS" | "SCHEMA_VIOLATION" | "TYPE_MISMATCH" | "CONSTRAINT_VIOLATION" | "TOO_MANY_FIELDS" | "SCHEMA_REFUSED" | "SCHEMA_VIOLATORS" | "SECRET_FIELD" | "TYPE_TAG_NOT_FIRST" | "STORAGE_QUOTA_EXCEEDED" | "DOCUMENT_QUOTA_EXCEEDED" | "BANDWIDTH_QUOTA_EXCEEDED" | "RATE_LIMIT_EXCEEDED" | "REQUEST_TOO_LARGE" | "CONCURRENT_LIMIT" | "COLLECTION_LIMIT" | "INDEX_LIMIT" | "FUNCTION_LIMIT" | "CF_CPU_TIMEOUT" | "CF_MEMORY_EXCEEDED" | "CF_EXECUTION_FAILED" | "SERVER_BUSY" | "CF_TENANT_MEMORY" | "CF_WALL_TIMEOUT" | "CF_SERVER_MEMORY" | "KEY_RATE_LIMIT_EXCEEDED" | "REALTIME_LIMIT" | "CRON_LIMIT" | "SPACE_FULL" | "TOKEN_EXPIRED" | "TOKEN_INVALID" | "TOKEN_REVOKED" | "SESSION_EXPIRED" | "ACCOUNT_SUSPENDED" | "TENANT_SUSPENDED" | "TENANT_READ_ONLY" | "IP_BLOCKED" | "INSUFFICIENT_PERMISSIONS" | "APPROVAL_REQUIRED" | "APPROVAL_INVALID" | "APPROVAL_DENIED" | "AGENT_BUDGET_EXHAUSTED" | "KEY_BUDGET_EXHAUSTED" | "QUERY_TOO_COMPLEX" | "QUERY_TIMEOUT" | "RESULT_SET_TOO_LARGE" | "SORT_LIMIT_EXCEEDED" | "SCAN_LIMIT_EXCEEDED" | "INVALID_QUERY_SYNTAX" | "SQL_FAILED" | "TENANT_NOT_FOUND" | "TENANT_ALREADY_EXISTS" | "TENANT_INVALID" | "TENANT_CANNOT_DROP_DEFAULT" | "COLLECTION_NOT_FOUND" | "COLLECTION_ALREADY_EXISTS" | "FUNCTION_NOT_FOUND" | "THREAD_NOT_FOUND" | "MESSAGE_NOT_FOUND" | "DATABASE_ERROR" | "ACCOUNT_NOT_FOUND" | "ACCOUNT_MEMBER_NOT_FOUND" | "ACCOUNT_LAST_OWNER" | "ACCOUNT_HAS_APPS" | "ACCOUNT_LIMIT" | "ACCOUNT_KEY_NOT_FOUND" | "ACCOUNT_INVITE_NOT_FOUND" | "ACCOUNT_INVITE_EXPIRED" | "ACCOUNT_INVITE_EMAIL" | "UNDO_TOKEN_NOT_FOUND" | "UNDO_TOKEN_EXPIRED" | "UNDO_RESOURCE_CHANGED" | "APP_OWNED_BY_ANOTHER_ACCOUNT" | "KEY_EXPIRED" | "TENANT_KEY_NOT_FOUND" | "TENANT_SLUG_RESERVED" | "TENANT_NOTE_TOO_LONG" | "TENANT_JOBS_DISABLED" | "TOOL_BAD_NAME" | "TOOL_HASH_MISMATCH" | "TOOL_BAD_SIZE" | "TOOL_BAD_FORMAT" | "TOOL_TOO_MANY" | "TOOL_STORAGE_IO" | "TOOL_NOT_INSTALLED" | "TOOL_TOO_MANY_BYTES" | "TOOL_LIMIT_OUT_OF_RANGE" | "TOOL_BAD_ARGS" | "TOOL_CONFINEMENT_UNAVAILABLE" | "TOOL_SPAWN_FAILED" | "DIRECT_CHANGES" | "HOST_NOT_FOUND" | "HOST_HAS_NODES" | "NODE_LABEL_NOT_FOUND" | "NODE_LABEL_IN_USE" | "NODE_LABEL_LIMIT" | "HOST_CAPABILITY_MISSING" | "HOST_AT_CAPACITY" | "HOST_HAS_APPS" | "SETTING_IS_PLATFORM" | "NO_CALL_CONTEXT" | "LEDGER_UNAVAILABLE" | "APP_QUERY_NOT_INDEXED" | "APP_QUERY_FIELD_NOT_EXPOSED" | "APP_USE_UNKNOWN_APP" | "SECRET_NOT_FOUND" | "EDIT_NO_MATCH" | "EDIT_AMBIGUOUS" | "HOST_TAKEN" | "HOST_INVALID" | "HOST_RESERVED" | "ENV_HOST_NOT_FOUND" | "ENVIRONMENT_NOT_FOUND" | "ROOT_DOMAIN_UNKNOWN" | "ROOT_DOMAIN_DISABLED" | "ROOT_DOMAIN_IN_USE" | "FEATURED_APP_NOT_FOUND" | "
|
|
32
|
-
next_action: "retry" | "reauthenticate" | "request_permission" | "reduce_request_or_increase_limit" | "refresh_resource" | "choose_supported_operation" | "correct_request" | "inspect_detail" | "version.live.set" | "follow_location";
|
|
32
|
+
code: "UNKNOWN" | "NOT_IMPLEMENTED" | "SYSTEM_CLOSED" | "SYSTEM_ALREADY_OPEN" | "INVALID_ARGUMENT" | "INVALID_HANDLE" | "THREAD_INIT_FAILED" | "SHUTDOWN_IN_PROGRESS" | "INTERNAL" | "NULL_TREE" | "NULL_SYSTEM" | "BARRIER_UNSUPPORTED" | "STORAGE_IO" | "DISK_FULL" | "FILE_NOT_FOUND" | "PERMISSION_DENIED" | "FILE_CORRUPT" | "MMAP_FAILED" | "FSYNC_FAILED" | "LOCK_FAILED" | "NOT_A_DATABASE" | "OLD_FORMAT" | "NEWER_FORMAT" | "OUT_OF_MEMORY" | "BUFFER_TOO_SMALL" | "ALLOCATOR_FAULT" | "TRANSACTION_CONFLICT" | "RETRY" | "TRANSACTION_READ_ONLY" | "TRANSACTION_NOT_FOUND" | "DEADLOCK_DETECTED" | "TIMEOUT" | "NO_ACTIVE_TRANSACTION" | "CANCELLED" | "LWW_STALE" | "KEY_NOT_FOUND" | "KEY_TOO_LARGE" | "VALUE_TOO_LARGE" | "KEY_EMPTY" | "KEY_EXISTS" | "MISSING_INDEX" | "OWNERSHIP_REQUIRED" | "KEY_PREFIX_COLLISION" | "KEY_DELETED" | "UNIQUE" | "ID_RESERVED" | "INVALID_ID" | "ID_MISMATCH" | "INDEX_DUPLICATES" | "FIELD_IDS_EXHAUSTED" | "ID_PAST_ROWS" | "ID_NOT_ISSUED" | "ENGINE_GATE_HELD" | "ROW_STALE" | "CURSOR_EXHAUSTED" | "CURSOR_INVALIDATED" | "INVALID_RANGE" | "BATCH_OP_FAILED" | "NODE_NOT_FOUND" | "EDGE_NOT_FOUND" | "PROPERTY_NOT_FOUND" | "INVALID_EDGE" | "PATH_NOT_FOUND" | "GRAPH_CYCLE_DETECTED" | "DIMENSION_MISMATCH" | "POINT_NOT_FOUND" | "INVALID_BOUNDS" | "INVALID_RADIUS" | "SCHEMA_VIOLATION" | "TYPE_MISMATCH" | "CONSTRAINT_VIOLATION" | "TOO_MANY_FIELDS" | "SCHEMA_REFUSED" | "SCHEMA_VIOLATORS" | "SECRET_FIELD" | "TYPE_TAG_NOT_FIRST" | "STORAGE_QUOTA_EXCEEDED" | "DOCUMENT_QUOTA_EXCEEDED" | "BANDWIDTH_QUOTA_EXCEEDED" | "RATE_LIMIT_EXCEEDED" | "REQUEST_TOO_LARGE" | "CONCURRENT_LIMIT" | "COLLECTION_LIMIT" | "INDEX_LIMIT" | "FUNCTION_LIMIT" | "CF_CPU_TIMEOUT" | "CF_MEMORY_EXCEEDED" | "CF_EXECUTION_FAILED" | "SERVER_BUSY" | "CF_TENANT_MEMORY" | "CF_WALL_TIMEOUT" | "CF_SERVER_MEMORY" | "KEY_RATE_LIMIT_EXCEEDED" | "REALTIME_LIMIT" | "CRON_LIMIT" | "SPACE_FULL" | "TOKEN_EXPIRED" | "TOKEN_INVALID" | "TOKEN_REVOKED" | "SESSION_EXPIRED" | "ACCOUNT_SUSPENDED" | "TENANT_SUSPENDED" | "TENANT_READ_ONLY" | "IP_BLOCKED" | "INSUFFICIENT_PERMISSIONS" | "APPROVAL_REQUIRED" | "APPROVAL_INVALID" | "APPROVAL_DENIED" | "AGENT_BUDGET_EXHAUSTED" | "KEY_BUDGET_EXHAUSTED" | "QUERY_TOO_COMPLEX" | "QUERY_TIMEOUT" | "RESULT_SET_TOO_LARGE" | "SORT_LIMIT_EXCEEDED" | "SCAN_LIMIT_EXCEEDED" | "INVALID_QUERY_SYNTAX" | "SQL_FAILED" | "TENANT_NOT_FOUND" | "TENANT_ALREADY_EXISTS" | "TENANT_INVALID" | "TENANT_CANNOT_DROP_DEFAULT" | "COLLECTION_NOT_FOUND" | "COLLECTION_ALREADY_EXISTS" | "FUNCTION_NOT_FOUND" | "THREAD_NOT_FOUND" | "MESSAGE_NOT_FOUND" | "DATABASE_ERROR" | "ACCOUNT_NOT_FOUND" | "ACCOUNT_MEMBER_NOT_FOUND" | "ACCOUNT_LAST_OWNER" | "ACCOUNT_HAS_APPS" | "ACCOUNT_LIMIT" | "ACCOUNT_KEY_NOT_FOUND" | "ACCOUNT_INVITE_NOT_FOUND" | "ACCOUNT_INVITE_EXPIRED" | "ACCOUNT_INVITE_EMAIL" | "UNDO_TOKEN_NOT_FOUND" | "UNDO_TOKEN_EXPIRED" | "UNDO_RESOURCE_CHANGED" | "APP_OWNED_BY_ANOTHER_ACCOUNT" | "KEY_EXPIRED" | "TENANT_KEY_NOT_FOUND" | "TENANT_SLUG_RESERVED" | "TENANT_NOTE_TOO_LONG" | "TENANT_JOBS_DISABLED" | "TOOL_BAD_NAME" | "TOOL_HASH_MISMATCH" | "TOOL_BAD_SIZE" | "TOOL_BAD_FORMAT" | "TOOL_TOO_MANY" | "TOOL_STORAGE_IO" | "TOOL_NOT_INSTALLED" | "TOOL_TOO_MANY_BYTES" | "TOOL_LIMIT_OUT_OF_RANGE" | "TOOL_BAD_ARGS" | "TOOL_CONFINEMENT_UNAVAILABLE" | "TOOL_SPAWN_FAILED" | "DIRECT_CHANGES" | "HOST_NOT_FOUND" | "HOST_HAS_NODES" | "NODE_LABEL_NOT_FOUND" | "NODE_LABEL_IN_USE" | "NODE_LABEL_LIMIT" | "HOST_CAPABILITY_MISSING" | "HOST_AT_CAPACITY" | "HOST_HAS_APPS" | "SETTING_IS_PLATFORM" | "NO_CALL_CONTEXT" | "LEDGER_UNAVAILABLE" | "APP_QUERY_NOT_INDEXED" | "APP_QUERY_FIELD_NOT_EXPOSED" | "APP_USE_UNKNOWN_APP" | "SECRET_NOT_FOUND" | "EDIT_NO_MATCH" | "EDIT_AMBIGUOUS" | "SHELL_SYNTAX" | "SHELL_UNKNOWN_COMMAND" | "SHELL_UNKNOWN_VARIABLE" | "SHELL_PATH_OUTSIDE" | "SHELL_READ_ONLY" | "SHELL_WRITE_NOT_GRANTED" | "SHELL_FILES_DELETE" | "SHELL_OFFSET_WRITES" | "SHELL_CPU_BUDGET" | "SHELL_PIPE_BUDGET" | "HOST_TAKEN" | "HOST_INVALID" | "HOST_RESERVED" | "ENV_HOST_NOT_FOUND" | "ENVIRONMENT_NOT_FOUND" | "ROOT_DOMAIN_UNKNOWN" | "ROOT_DOMAIN_DISABLED" | "ROOT_DOMAIN_IN_USE" | "FEATURED_APP_NOT_FOUND" | "JET_KEY_NEEDS_APP" | "FEATURED_ALWAYS_ON" | "FEATURED_NEEDS_PLANS" | "BILLING_KEY_NOT_TEST" | "CART_EMPTY" | "CART_PLAN_NOT_FOUND" | "CART_PLAN_NOT_FOR_SALE" | "CART_APP_REPEATED" | "CART_COVERED" | "CART_MIXED" | "FUNDS_OUT_OF_RANGE" | "CART_NOT_FOUND" | "CART_CLOSED" | "CHECKOUT_PERSON_ONLY" | "PAYMENT_NOT_DONE" | "PAYMENT_PROCESSING" | "SUBSCRIPTION_NONE" | "PROVIDER_ANSWER_INVALID" | "PLAN_LIMIT" | "SPACE_ADDON_NOT_ON_PLAN" | "SPACE_ADDON_HELD" | "SPACE_ADDON_IN_USE" | "PLAN_NOT_ON_SALE" | "MODULE_NOT_FOUND" | "IMPORT_OUTSIDE_PROJECT" | "IMPORT_NEEDS_VERSION" | "PACKAGE_NOT_FOUND" | "PACKAGE_NOT_EXPORTED" | "PACKAGE_NOT_ESM" | "PACKAGE_MANIFEST_INVALID" | "PACKAGE_REGISTRY_UNSET" | "PACKAGE_UNKNOWN" | "PACKAGE_NAME_INVALID" | "PACKAGE_RANGE_INVALID" | "PACKAGE_VERSION_NOT_FOUND" | "PACKAGE_VERSION_CONFLICT" | "PACKAGE_REGISTRY_FAILED" | "PACKAGE_TARBALL_OUTSIDE_REGISTRY" | "PACKAGE_INTEGRITY_MISMATCH" | "PACKAGE_TARBALL_INVALID" | "PACKAGE_TOO_LARGE" | "KEY_AUTOMATION_NEEDS_PERSON" | "ADOPT_DISABLED" | "ADOPT_SOURCE_NOT_FOUND" | "ADOPT_SOURCE_OUTSIDE" | "ADOPT_SOURCE_SYMLINK" | "ADOPT_SOURCE_NOT_REGULAR" | "ADOPT_SOURCE_LINKED" | "ADOPT_CROSS_DEVICE" | "ADOPT_SOURCE_CHANGED" | "FILE_EXISTS" | "CONSOLE_LINK_NEEDS_PERSON" | "CONSOLE_LINK_UNKNOWN" | "CONSOLE_LINK_USED" | "CONSOLE_LINK_EXPIRED" | "CONSOLE_LINK_STEP_UP" | "AGENT_CODE_INVALID" | "AGENT_ALREADY_CONNECTED" | "AGENT_TOOL_UNKNOWN" | "APP_NOT_NAMED" | "SYSTEM_PROTECTED" | "CPU_HISTORY_OFF" | "SUBSCRIPTION_NOT_FOUND" | "PLAN_FEATURE_REQUIRED" | "SUBSCRIBERS_NOT_VISIBLE" | "SUBSCRIPTION_PERSON_REQUIRED" | "PLAN_FEATURE_UNKNOWN" | "DASHBOARD_INVALID" | "REGION_NOT_FOUND" | "REGION_IN_USE" | "REGION_LIMIT" | "REGION_UNAVAILABLE" | "REGION_FULL" | "HOST_NOT_PROBED" | "HOST_NO_SYSTEMD" | "HOST_NGINX_PRESENT" | "RELEASE_NOT_FOUND" | "RELEASE_NOT_PACKED" | "RELEASE_ISA_UNKNOWN" | "HOST_CPU_MISSING" | "HOST_NODE_LIMIT" | "NODE_BUSY" | "MCP_TOOL_NOT_FOUND" | "MCP_TEST_USER_NOT_FOUND" | "MCP_TOOL_FROM_ROUTE" | "MCP_RESULT_INVALID" | "MCP_OPERATIONS_IDENTITY_ONLY" | "MCP_LINK_NOT_LINKED" | "MCP_LINK_NOT_OFFERED" | "CALLER_USERS_REFUSED" | "NO_CALLER_APP" | "SELF_FIELD_REFUSED" | "MCP_IDENTITY_FUNCTION_NOT_DEPLOYED" | "MCP_TOOL_INVALID" | "TEST_TENANT_REQUIRED" | "ARCHIVE_INVALID" | "WASM_MODULE_INVALID" | "WASM_COMPILE_FAILED" | "WASM_CELLS_UNSUPPORTED" | "RUST_COMPILE_FAILED" | "RUST_TOOLCHAIN_UNAVAILABLE" | "ARCHIVE_PASSPHRASE_WRONG" | "SERIALIZATION" | "DESERIALIZATION" | "PIPELINE_TOO_LARGE" | "INVALID_JSON" | "EMPTY_PAYLOAD" | "BODY_REQUIRED" | "METHOD_NOT_ALLOWED" | "ENDPOINT_NOT_FOUND" | "MISSING_FIELD" | "UNSUPPORTED_OPERATION" | "NO_WAIT_IN_QUERY" | "NO_WAIT_IN_TRANSACTION" | "NO_WAIT_IN_UPSERT" | "NO_WAIT_IN_ENGINE_GATE" | "FETCH_FAILED" | "CREDENTIAL_REQUIRED" | "EMAIL_VERIFICATION_REQUIRED" | "OAUTH_INVALID" | "PROVIDER_NOT_CONFIGURED" | "PROVIDER_DISABLED" | "LIVE_BY_PROMOTE" | "TENANT_MOVED" | "GRANT_REQUIRED" | "KEY_ORIGIN_REFUSED" | "SECRET_KEY_IN_URL" | "APPROVAL_PENDING" | "APPROVAL_SPENT" | "APPROVAL_EXPIRED" | "APPROVAL_MISMATCH" | "WEBHOOK_SIGNATURE_INVALID" | "BILLING_NOT_SET_UP" | "EMAIL_TAKEN" | "CREDENTIALS_MISMATCH" | "PASSWORD_LENGTH" | "EMAIL_INVALID" | "USER_NOT_FOUND" | "ACCOUNT_LOCKED" | "RECIPIENT_UNSUBSCRIBED" | "APP_OVER_PLAN" | "CRITICAL_SEGFAULT";
|
|
33
|
+
next_action: "retry" | "reauthenticate" | "request_permission" | "reduce_request_or_increase_limit" | "refresh_resource" | "choose_supported_operation" | "correct_request" | "inspect_detail" | "version.live.set" | "follow_location" | "sign_in";
|
|
33
34
|
[field: string]: unknown;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
/** Every error code the server sends (SubstrioError.code). */
|
|
37
|
-
export type SubstrioErrorCode = "UNKNOWN" | "NOT_IMPLEMENTED" | "SYSTEM_CLOSED" | "SYSTEM_ALREADY_OPEN" | "INVALID_ARGUMENT" | "INVALID_HANDLE" | "THREAD_INIT_FAILED" | "SHUTDOWN_IN_PROGRESS" | "INTERNAL" | "NULL_TREE" | "NULL_SYSTEM" | "BARRIER_UNSUPPORTED" | "STORAGE_IO" | "DISK_FULL" | "FILE_NOT_FOUND" | "PERMISSION_DENIED" | "FILE_CORRUPT" | "MMAP_FAILED" | "FSYNC_FAILED" | "LOCK_FAILED" | "NOT_A_DATABASE" | "OLD_FORMAT" | "NEWER_FORMAT" | "OUT_OF_MEMORY" | "BUFFER_TOO_SMALL" | "ALLOCATOR_FAULT" | "TRANSACTION_CONFLICT" | "RETRY" | "TRANSACTION_READ_ONLY" | "TRANSACTION_NOT_FOUND" | "DEADLOCK_DETECTED" | "TIMEOUT" | "NO_ACTIVE_TRANSACTION" | "CANCELLED" | "LWW_STALE" | "KEY_NOT_FOUND" | "KEY_TOO_LARGE" | "VALUE_TOO_LARGE" | "KEY_EMPTY" | "KEY_EXISTS" | "MISSING_INDEX" | "OWNERSHIP_REQUIRED" | "KEY_PREFIX_COLLISION" | "KEY_DELETED" | "UNIQUE" | "ID_RESERVED" | "INVALID_ID" | "ID_MISMATCH" | "INDEX_DUPLICATES" | "FIELD_IDS_EXHAUSTED" | "ID_PAST_ROWS" | "ID_NOT_ISSUED" | "ENGINE_GATE_HELD" | "ROW_STALE" | "CURSOR_EXHAUSTED" | "CURSOR_INVALIDATED" | "INVALID_RANGE" | "BATCH_OP_FAILED" | "NODE_NOT_FOUND" | "EDGE_NOT_FOUND" | "PROPERTY_NOT_FOUND" | "INVALID_EDGE" | "PATH_NOT_FOUND" | "GRAPH_CYCLE_DETECTED" | "DIMENSION_MISMATCH" | "POINT_NOT_FOUND" | "INVALID_BOUNDS" | "INVALID_RADIUS" | "SCHEMA_VIOLATION" | "TYPE_MISMATCH" | "CONSTRAINT_VIOLATION" | "TOO_MANY_FIELDS" | "SCHEMA_REFUSED" | "SCHEMA_VIOLATORS" | "SECRET_FIELD" | "TYPE_TAG_NOT_FIRST" | "STORAGE_QUOTA_EXCEEDED" | "DOCUMENT_QUOTA_EXCEEDED" | "BANDWIDTH_QUOTA_EXCEEDED" | "RATE_LIMIT_EXCEEDED" | "REQUEST_TOO_LARGE" | "CONCURRENT_LIMIT" | "COLLECTION_LIMIT" | "INDEX_LIMIT" | "FUNCTION_LIMIT" | "CF_CPU_TIMEOUT" | "CF_MEMORY_EXCEEDED" | "CF_EXECUTION_FAILED" | "SERVER_BUSY" | "CF_TENANT_MEMORY" | "CF_WALL_TIMEOUT" | "CF_SERVER_MEMORY" | "KEY_RATE_LIMIT_EXCEEDED" | "REALTIME_LIMIT" | "CRON_LIMIT" | "SPACE_FULL" | "TOKEN_EXPIRED" | "TOKEN_INVALID" | "TOKEN_REVOKED" | "SESSION_EXPIRED" | "ACCOUNT_SUSPENDED" | "TENANT_SUSPENDED" | "TENANT_READ_ONLY" | "IP_BLOCKED" | "INSUFFICIENT_PERMISSIONS" | "APPROVAL_REQUIRED" | "APPROVAL_INVALID" | "APPROVAL_DENIED" | "AGENT_BUDGET_EXHAUSTED" | "KEY_BUDGET_EXHAUSTED" | "QUERY_TOO_COMPLEX" | "QUERY_TIMEOUT" | "RESULT_SET_TOO_LARGE" | "SORT_LIMIT_EXCEEDED" | "SCAN_LIMIT_EXCEEDED" | "INVALID_QUERY_SYNTAX" | "SQL_FAILED" | "TENANT_NOT_FOUND" | "TENANT_ALREADY_EXISTS" | "TENANT_INVALID" | "TENANT_CANNOT_DROP_DEFAULT" | "COLLECTION_NOT_FOUND" | "COLLECTION_ALREADY_EXISTS" | "FUNCTION_NOT_FOUND" | "THREAD_NOT_FOUND" | "MESSAGE_NOT_FOUND" | "DATABASE_ERROR" | "ACCOUNT_NOT_FOUND" | "ACCOUNT_MEMBER_NOT_FOUND" | "ACCOUNT_LAST_OWNER" | "ACCOUNT_HAS_APPS" | "ACCOUNT_LIMIT" | "ACCOUNT_KEY_NOT_FOUND" | "ACCOUNT_INVITE_NOT_FOUND" | "ACCOUNT_INVITE_EXPIRED" | "ACCOUNT_INVITE_EMAIL" | "UNDO_TOKEN_NOT_FOUND" | "UNDO_TOKEN_EXPIRED" | "UNDO_RESOURCE_CHANGED" | "APP_OWNED_BY_ANOTHER_ACCOUNT" | "KEY_EXPIRED" | "TENANT_KEY_NOT_FOUND" | "TENANT_SLUG_RESERVED" | "TENANT_NOTE_TOO_LONG" | "TENANT_JOBS_DISABLED" | "TOOL_BAD_NAME" | "TOOL_HASH_MISMATCH" | "TOOL_BAD_SIZE" | "TOOL_BAD_FORMAT" | "TOOL_TOO_MANY" | "TOOL_STORAGE_IO" | "TOOL_NOT_INSTALLED" | "TOOL_TOO_MANY_BYTES" | "TOOL_LIMIT_OUT_OF_RANGE" | "TOOL_BAD_ARGS" | "TOOL_CONFINEMENT_UNAVAILABLE" | "TOOL_SPAWN_FAILED" | "DIRECT_CHANGES" | "HOST_NOT_FOUND" | "HOST_HAS_NODES" | "NODE_LABEL_NOT_FOUND" | "NODE_LABEL_IN_USE" | "NODE_LABEL_LIMIT" | "HOST_CAPABILITY_MISSING" | "HOST_AT_CAPACITY" | "HOST_HAS_APPS" | "SETTING_IS_PLATFORM" | "NO_CALL_CONTEXT" | "LEDGER_UNAVAILABLE" | "APP_QUERY_NOT_INDEXED" | "APP_QUERY_FIELD_NOT_EXPOSED" | "APP_USE_UNKNOWN_APP" | "SECRET_NOT_FOUND" | "EDIT_NO_MATCH" | "EDIT_AMBIGUOUS" | "HOST_TAKEN" | "HOST_INVALID" | "HOST_RESERVED" | "ENV_HOST_NOT_FOUND" | "ENVIRONMENT_NOT_FOUND" | "ROOT_DOMAIN_UNKNOWN" | "ROOT_DOMAIN_DISABLED" | "ROOT_DOMAIN_IN_USE" | "FEATURED_APP_NOT_FOUND" | "
|
|
38
|
+
export type SubstrioErrorCode = "UNKNOWN" | "NOT_IMPLEMENTED" | "SYSTEM_CLOSED" | "SYSTEM_ALREADY_OPEN" | "INVALID_ARGUMENT" | "INVALID_HANDLE" | "THREAD_INIT_FAILED" | "SHUTDOWN_IN_PROGRESS" | "INTERNAL" | "NULL_TREE" | "NULL_SYSTEM" | "BARRIER_UNSUPPORTED" | "STORAGE_IO" | "DISK_FULL" | "FILE_NOT_FOUND" | "PERMISSION_DENIED" | "FILE_CORRUPT" | "MMAP_FAILED" | "FSYNC_FAILED" | "LOCK_FAILED" | "NOT_A_DATABASE" | "OLD_FORMAT" | "NEWER_FORMAT" | "OUT_OF_MEMORY" | "BUFFER_TOO_SMALL" | "ALLOCATOR_FAULT" | "TRANSACTION_CONFLICT" | "RETRY" | "TRANSACTION_READ_ONLY" | "TRANSACTION_NOT_FOUND" | "DEADLOCK_DETECTED" | "TIMEOUT" | "NO_ACTIVE_TRANSACTION" | "CANCELLED" | "LWW_STALE" | "KEY_NOT_FOUND" | "KEY_TOO_LARGE" | "VALUE_TOO_LARGE" | "KEY_EMPTY" | "KEY_EXISTS" | "MISSING_INDEX" | "OWNERSHIP_REQUIRED" | "KEY_PREFIX_COLLISION" | "KEY_DELETED" | "UNIQUE" | "ID_RESERVED" | "INVALID_ID" | "ID_MISMATCH" | "INDEX_DUPLICATES" | "FIELD_IDS_EXHAUSTED" | "ID_PAST_ROWS" | "ID_NOT_ISSUED" | "ENGINE_GATE_HELD" | "ROW_STALE" | "CURSOR_EXHAUSTED" | "CURSOR_INVALIDATED" | "INVALID_RANGE" | "BATCH_OP_FAILED" | "NODE_NOT_FOUND" | "EDGE_NOT_FOUND" | "PROPERTY_NOT_FOUND" | "INVALID_EDGE" | "PATH_NOT_FOUND" | "GRAPH_CYCLE_DETECTED" | "DIMENSION_MISMATCH" | "POINT_NOT_FOUND" | "INVALID_BOUNDS" | "INVALID_RADIUS" | "SCHEMA_VIOLATION" | "TYPE_MISMATCH" | "CONSTRAINT_VIOLATION" | "TOO_MANY_FIELDS" | "SCHEMA_REFUSED" | "SCHEMA_VIOLATORS" | "SECRET_FIELD" | "TYPE_TAG_NOT_FIRST" | "STORAGE_QUOTA_EXCEEDED" | "DOCUMENT_QUOTA_EXCEEDED" | "BANDWIDTH_QUOTA_EXCEEDED" | "RATE_LIMIT_EXCEEDED" | "REQUEST_TOO_LARGE" | "CONCURRENT_LIMIT" | "COLLECTION_LIMIT" | "INDEX_LIMIT" | "FUNCTION_LIMIT" | "CF_CPU_TIMEOUT" | "CF_MEMORY_EXCEEDED" | "CF_EXECUTION_FAILED" | "SERVER_BUSY" | "CF_TENANT_MEMORY" | "CF_WALL_TIMEOUT" | "CF_SERVER_MEMORY" | "KEY_RATE_LIMIT_EXCEEDED" | "REALTIME_LIMIT" | "CRON_LIMIT" | "SPACE_FULL" | "TOKEN_EXPIRED" | "TOKEN_INVALID" | "TOKEN_REVOKED" | "SESSION_EXPIRED" | "ACCOUNT_SUSPENDED" | "TENANT_SUSPENDED" | "TENANT_READ_ONLY" | "IP_BLOCKED" | "INSUFFICIENT_PERMISSIONS" | "APPROVAL_REQUIRED" | "APPROVAL_INVALID" | "APPROVAL_DENIED" | "AGENT_BUDGET_EXHAUSTED" | "KEY_BUDGET_EXHAUSTED" | "QUERY_TOO_COMPLEX" | "QUERY_TIMEOUT" | "RESULT_SET_TOO_LARGE" | "SORT_LIMIT_EXCEEDED" | "SCAN_LIMIT_EXCEEDED" | "INVALID_QUERY_SYNTAX" | "SQL_FAILED" | "TENANT_NOT_FOUND" | "TENANT_ALREADY_EXISTS" | "TENANT_INVALID" | "TENANT_CANNOT_DROP_DEFAULT" | "COLLECTION_NOT_FOUND" | "COLLECTION_ALREADY_EXISTS" | "FUNCTION_NOT_FOUND" | "THREAD_NOT_FOUND" | "MESSAGE_NOT_FOUND" | "DATABASE_ERROR" | "ACCOUNT_NOT_FOUND" | "ACCOUNT_MEMBER_NOT_FOUND" | "ACCOUNT_LAST_OWNER" | "ACCOUNT_HAS_APPS" | "ACCOUNT_LIMIT" | "ACCOUNT_KEY_NOT_FOUND" | "ACCOUNT_INVITE_NOT_FOUND" | "ACCOUNT_INVITE_EXPIRED" | "ACCOUNT_INVITE_EMAIL" | "UNDO_TOKEN_NOT_FOUND" | "UNDO_TOKEN_EXPIRED" | "UNDO_RESOURCE_CHANGED" | "APP_OWNED_BY_ANOTHER_ACCOUNT" | "KEY_EXPIRED" | "TENANT_KEY_NOT_FOUND" | "TENANT_SLUG_RESERVED" | "TENANT_NOTE_TOO_LONG" | "TENANT_JOBS_DISABLED" | "TOOL_BAD_NAME" | "TOOL_HASH_MISMATCH" | "TOOL_BAD_SIZE" | "TOOL_BAD_FORMAT" | "TOOL_TOO_MANY" | "TOOL_STORAGE_IO" | "TOOL_NOT_INSTALLED" | "TOOL_TOO_MANY_BYTES" | "TOOL_LIMIT_OUT_OF_RANGE" | "TOOL_BAD_ARGS" | "TOOL_CONFINEMENT_UNAVAILABLE" | "TOOL_SPAWN_FAILED" | "DIRECT_CHANGES" | "HOST_NOT_FOUND" | "HOST_HAS_NODES" | "NODE_LABEL_NOT_FOUND" | "NODE_LABEL_IN_USE" | "NODE_LABEL_LIMIT" | "HOST_CAPABILITY_MISSING" | "HOST_AT_CAPACITY" | "HOST_HAS_APPS" | "SETTING_IS_PLATFORM" | "NO_CALL_CONTEXT" | "LEDGER_UNAVAILABLE" | "APP_QUERY_NOT_INDEXED" | "APP_QUERY_FIELD_NOT_EXPOSED" | "APP_USE_UNKNOWN_APP" | "SECRET_NOT_FOUND" | "EDIT_NO_MATCH" | "EDIT_AMBIGUOUS" | "SHELL_SYNTAX" | "SHELL_UNKNOWN_COMMAND" | "SHELL_UNKNOWN_VARIABLE" | "SHELL_PATH_OUTSIDE" | "SHELL_READ_ONLY" | "SHELL_WRITE_NOT_GRANTED" | "SHELL_FILES_DELETE" | "SHELL_OFFSET_WRITES" | "SHELL_CPU_BUDGET" | "SHELL_PIPE_BUDGET" | "HOST_TAKEN" | "HOST_INVALID" | "HOST_RESERVED" | "ENV_HOST_NOT_FOUND" | "ENVIRONMENT_NOT_FOUND" | "ROOT_DOMAIN_UNKNOWN" | "ROOT_DOMAIN_DISABLED" | "ROOT_DOMAIN_IN_USE" | "FEATURED_APP_NOT_FOUND" | "JET_KEY_NEEDS_APP" | "FEATURED_ALWAYS_ON" | "FEATURED_NEEDS_PLANS" | "BILLING_KEY_NOT_TEST" | "CART_EMPTY" | "CART_PLAN_NOT_FOUND" | "CART_PLAN_NOT_FOR_SALE" | "CART_APP_REPEATED" | "CART_COVERED" | "CART_MIXED" | "FUNDS_OUT_OF_RANGE" | "CART_NOT_FOUND" | "CART_CLOSED" | "CHECKOUT_PERSON_ONLY" | "PAYMENT_NOT_DONE" | "PAYMENT_PROCESSING" | "SUBSCRIPTION_NONE" | "PROVIDER_ANSWER_INVALID" | "PLAN_LIMIT" | "SPACE_ADDON_NOT_ON_PLAN" | "SPACE_ADDON_HELD" | "SPACE_ADDON_IN_USE" | "PLAN_NOT_ON_SALE" | "MODULE_NOT_FOUND" | "IMPORT_OUTSIDE_PROJECT" | "IMPORT_NEEDS_VERSION" | "PACKAGE_NOT_FOUND" | "PACKAGE_NOT_EXPORTED" | "PACKAGE_NOT_ESM" | "PACKAGE_MANIFEST_INVALID" | "PACKAGE_REGISTRY_UNSET" | "PACKAGE_UNKNOWN" | "PACKAGE_NAME_INVALID" | "PACKAGE_RANGE_INVALID" | "PACKAGE_VERSION_NOT_FOUND" | "PACKAGE_VERSION_CONFLICT" | "PACKAGE_REGISTRY_FAILED" | "PACKAGE_TARBALL_OUTSIDE_REGISTRY" | "PACKAGE_INTEGRITY_MISMATCH" | "PACKAGE_TARBALL_INVALID" | "PACKAGE_TOO_LARGE" | "KEY_AUTOMATION_NEEDS_PERSON" | "ADOPT_DISABLED" | "ADOPT_SOURCE_NOT_FOUND" | "ADOPT_SOURCE_OUTSIDE" | "ADOPT_SOURCE_SYMLINK" | "ADOPT_SOURCE_NOT_REGULAR" | "ADOPT_SOURCE_LINKED" | "ADOPT_CROSS_DEVICE" | "ADOPT_SOURCE_CHANGED" | "FILE_EXISTS" | "CONSOLE_LINK_NEEDS_PERSON" | "CONSOLE_LINK_UNKNOWN" | "CONSOLE_LINK_USED" | "CONSOLE_LINK_EXPIRED" | "CONSOLE_LINK_STEP_UP" | "AGENT_CODE_INVALID" | "AGENT_ALREADY_CONNECTED" | "AGENT_TOOL_UNKNOWN" | "APP_NOT_NAMED" | "SYSTEM_PROTECTED" | "CPU_HISTORY_OFF" | "SUBSCRIPTION_NOT_FOUND" | "PLAN_FEATURE_REQUIRED" | "SUBSCRIBERS_NOT_VISIBLE" | "SUBSCRIPTION_PERSON_REQUIRED" | "PLAN_FEATURE_UNKNOWN" | "DASHBOARD_INVALID" | "REGION_NOT_FOUND" | "REGION_IN_USE" | "REGION_LIMIT" | "REGION_UNAVAILABLE" | "REGION_FULL" | "HOST_NOT_PROBED" | "HOST_NO_SYSTEMD" | "HOST_NGINX_PRESENT" | "RELEASE_NOT_FOUND" | "RELEASE_NOT_PACKED" | "RELEASE_ISA_UNKNOWN" | "HOST_CPU_MISSING" | "HOST_NODE_LIMIT" | "NODE_BUSY" | "MCP_TOOL_NOT_FOUND" | "MCP_TEST_USER_NOT_FOUND" | "MCP_TOOL_FROM_ROUTE" | "MCP_RESULT_INVALID" | "MCP_OPERATIONS_IDENTITY_ONLY" | "MCP_LINK_NOT_LINKED" | "MCP_LINK_NOT_OFFERED" | "CALLER_USERS_REFUSED" | "NO_CALLER_APP" | "SELF_FIELD_REFUSED" | "MCP_IDENTITY_FUNCTION_NOT_DEPLOYED" | "MCP_TOOL_INVALID" | "TEST_TENANT_REQUIRED" | "ARCHIVE_INVALID" | "WASM_MODULE_INVALID" | "WASM_COMPILE_FAILED" | "WASM_CELLS_UNSUPPORTED" | "RUST_COMPILE_FAILED" | "RUST_TOOLCHAIN_UNAVAILABLE" | "ARCHIVE_PASSPHRASE_WRONG" | "SERIALIZATION" | "DESERIALIZATION" | "PIPELINE_TOO_LARGE" | "INVALID_JSON" | "EMPTY_PAYLOAD" | "BODY_REQUIRED" | "METHOD_NOT_ALLOWED" | "ENDPOINT_NOT_FOUND" | "MISSING_FIELD" | "UNSUPPORTED_OPERATION" | "NO_WAIT_IN_QUERY" | "NO_WAIT_IN_TRANSACTION" | "NO_WAIT_IN_UPSERT" | "NO_WAIT_IN_ENGINE_GATE" | "FETCH_FAILED" | "CREDENTIAL_REQUIRED" | "EMAIL_VERIFICATION_REQUIRED" | "OAUTH_INVALID" | "PROVIDER_NOT_CONFIGURED" | "PROVIDER_DISABLED" | "LIVE_BY_PROMOTE" | "TENANT_MOVED" | "GRANT_REQUIRED" | "KEY_ORIGIN_REFUSED" | "SECRET_KEY_IN_URL" | "APPROVAL_PENDING" | "APPROVAL_SPENT" | "APPROVAL_EXPIRED" | "APPROVAL_MISMATCH" | "WEBHOOK_SIGNATURE_INVALID" | "BILLING_NOT_SET_UP" | "EMAIL_TAKEN" | "CREDENTIALS_MISMATCH" | "PASSWORD_LENGTH" | "EMAIL_INVALID" | "USER_NOT_FOUND" | "ACCOUNT_LOCKED" | "RECIPIENT_UNSUBSCRIBED" | "APP_OVER_PLAN" | "CRITICAL_SEGFAULT";
|
|
38
39
|
|
|
39
40
|
export type SubstrioMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
40
41
|
|
|
@@ -77,10 +78,12 @@ export type AccountAppAttachResult = {
|
|
|
77
78
|
[field: string]: unknown;
|
|
78
79
|
};
|
|
79
80
|
|
|
80
|
-
/** Input of account.app.create: Create an app owned by the account */
|
|
81
|
+
/** Input of account.app.create: Create an app owned by the account. A region (a slug region.choices lists) places it there; one that is not listed is refused with REGION_UNAVAILABLE */
|
|
81
82
|
export type AccountAppCreateInput = {
|
|
82
83
|
id: number;
|
|
83
84
|
slug: string;
|
|
85
|
+
/** A slug region.choices lists: the region to create the app in. Refused with REGION_UNAVAILABLE when it is not listed */
|
|
86
|
+
region?: string;
|
|
84
87
|
[field: string]: unknown;
|
|
85
88
|
};
|
|
86
89
|
/** Result of account.app.create. */
|
|
@@ -143,6 +146,25 @@ export type AccountAppOpenSetResult = {
|
|
|
143
146
|
[field: string]: unknown;
|
|
144
147
|
};
|
|
145
148
|
|
|
149
|
+
/** Input of account.apps.order: Set the order the account's apps run in: apps lists every app id of the account once (any other list is refused, INVALID_ARGUMENT naming apps). The first max_apps run; the rest are paused, keeping every byte, and their requests answer APP_OVER_PLAN until they move up, an app is deleted or the plan allows more. Answers each app in order with active, and max_apps (0: no limit) */
|
|
150
|
+
export type AccountAppsOrderInput = {
|
|
151
|
+
id: number;
|
|
152
|
+
/** Every app id of the account (account.app.list's id), each once, in the order they run: the first max_apps run, the rest are paused (APP_OVER_PLAN) */
|
|
153
|
+
apps: number[];
|
|
154
|
+
[field: string]: unknown;
|
|
155
|
+
};
|
|
156
|
+
/** Result of account.apps.order. */
|
|
157
|
+
export type AccountAppsOrderResult = {
|
|
158
|
+
apps: Array<{
|
|
159
|
+
id: number;
|
|
160
|
+
slug: string;
|
|
161
|
+
/** true: inside the first max_apps, it runs; false: paused, its requests answer APP_OVER_PLAN */
|
|
162
|
+
active: boolean;
|
|
163
|
+
}>;
|
|
164
|
+
/** the apps the account may run; 0: no limit */
|
|
165
|
+
max_apps: number;
|
|
166
|
+
};
|
|
167
|
+
|
|
146
168
|
/** Input of account.audit.list: Read an account's audit trail (its keys, members, invites, apps and clients), newest first; the filters, limit and cursor of audit.list */
|
|
147
169
|
export type AccountAuditListInput = {
|
|
148
170
|
id: number;
|
|
@@ -178,6 +200,17 @@ export type AccountAuditListResult = {
|
|
|
178
200
|
[field: string]: unknown;
|
|
179
201
|
};
|
|
180
202
|
|
|
203
|
+
/** Input of account.console.link: Mint the person you act for a one-time console sign-in, then open its url in their browser: it lands them signed in on their dashboard. Only a person mints one (an agent session for its own person, or the person signed in to the console); a key, the master key or an agent token is refused CONSOLE_LINK_NEEDS_PERSON. The link lives 5 minutes (the server's --console-link-seconds), signs in once, and a new one replaces the last; its token rides in the url's fragment, so no server receives or logs it. Answers {url, expires_at} */
|
|
204
|
+
export type AccountConsoleLinkInput = Record<string, never>;
|
|
205
|
+
/** Result of account.console.link. */
|
|
206
|
+
export type AccountConsoleLinkResult = {
|
|
207
|
+
/** The console address with the one-time link in its fragment (#link=...): open it in the person's browser */
|
|
208
|
+
url: string;
|
|
209
|
+
/** Unix seconds */
|
|
210
|
+
expires_at: number;
|
|
211
|
+
[field: string]: unknown;
|
|
212
|
+
};
|
|
213
|
+
|
|
181
214
|
/** Input of account.create: Create an account owned by the signed-in person */
|
|
182
215
|
export type AccountCreateInput = {
|
|
183
216
|
name: string;
|
|
@@ -195,6 +228,8 @@ export type AccountCreateResult = {
|
|
|
195
228
|
/** Input of account.delete: Delete an account that owns no apps, with its members and keys */
|
|
196
229
|
export type AccountDeleteInput = {
|
|
197
230
|
id: number;
|
|
231
|
+
/** true deletes every app the account owns first (each app with its data, one at a time), then the account; without it an account that owns apps is refused */
|
|
232
|
+
with_apps?: boolean;
|
|
198
233
|
};
|
|
199
234
|
/** Result of account.delete. */
|
|
200
235
|
export type AccountDeleteResult = {
|
|
@@ -407,10 +442,10 @@ export type AccountMemberSetResult = {
|
|
|
407
442
|
[field: string]: unknown;
|
|
408
443
|
};
|
|
409
444
|
|
|
410
|
-
/** Input of account.mfa.set: Require every member of an account to sign in with
|
|
445
|
+
/** Input of account.mfa.set: Require every member of an account to sign in with 2FA, or stop requiring it */
|
|
411
446
|
export type AccountMfaSetInput = {
|
|
412
447
|
id: number;
|
|
413
|
-
/** Every member signs in with
|
|
448
|
+
/** Every member signs in with 2FA; one without it enrols at sign-in */
|
|
414
449
|
required: boolean;
|
|
415
450
|
[field: string]: unknown;
|
|
416
451
|
};
|
|
@@ -441,12 +476,22 @@ export type AccountOverviewResult = {
|
|
|
441
476
|
stored_bytes?: number;
|
|
442
477
|
/** present only when open is true */
|
|
443
478
|
documents?: number;
|
|
479
|
+
/** present only when open is true: the app's API requests since its database opened (total, status, the latency percentiles, cpu_ns), the counters and the writer of tenant.usage's and app.overview's requests */
|
|
480
|
+
requests?: Record<string, unknown>;
|
|
481
|
+
/** the app's function calls, API requests and their 5xx this month (UTC, the plan's metering month), open or not: durable totals kept in the app's record, reset when the month turns */
|
|
482
|
+
this_month: {
|
|
483
|
+
calls: number;
|
|
484
|
+
requests: number;
|
|
485
|
+
requests_5xx: number;
|
|
486
|
+
[field: string]: unknown;
|
|
487
|
+
};
|
|
444
488
|
[field: string]: unknown;
|
|
445
489
|
}>;
|
|
446
490
|
totals: {
|
|
447
491
|
apps: number;
|
|
448
492
|
suspended: number;
|
|
449
493
|
open: number;
|
|
494
|
+
/** every app's this_month calls */
|
|
450
495
|
calls: number;
|
|
451
496
|
stored_bytes: number;
|
|
452
497
|
documents: number;
|
|
@@ -494,6 +539,27 @@ export type AccountPlanSummaryResult = {
|
|
|
494
539
|
[field: string]: unknown;
|
|
495
540
|
};
|
|
496
541
|
|
|
542
|
+
/** Input of account.storage: Read what each app of the account holds on disk (disk_bytes: its database, files, logs, backups, code and the rest, as of its last fold, open or not), the account's total (its apps and their sandboxes, the figure its space is held against) and the space in force (null while none). Supersedes account.overview's stored_bytes, which counts only open apps' document bytes */
|
|
543
|
+
export type AccountStorageInput = {
|
|
544
|
+
id: number;
|
|
545
|
+
};
|
|
546
|
+
/** Result of account.storage. */
|
|
547
|
+
export type AccountStorageResult = {
|
|
548
|
+
apps: Array<{
|
|
549
|
+
slug: string;
|
|
550
|
+
/** the app's tenant id */
|
|
551
|
+
id: number;
|
|
552
|
+
/** what the app's folder holds on disk (its database, files, logs, backups, code and the rest) as of its last fold, open or not: an app that is not open answers the figure it had when it closed */
|
|
553
|
+
disk_bytes: number;
|
|
554
|
+
[field: string]: unknown;
|
|
555
|
+
}>;
|
|
556
|
+
/** what the account's apps hold on disk, their sandboxes included: the figure its space is held against */
|
|
557
|
+
total_bytes: number;
|
|
558
|
+
/** the account's space in force; null while it has none */
|
|
559
|
+
space_bytes: number | null;
|
|
560
|
+
[field: string]: unknown;
|
|
561
|
+
};
|
|
562
|
+
|
|
497
563
|
/** Input of account.update: Rename an account; the system key also sets its services, space and max_apps, and suspends it */
|
|
498
564
|
export type AccountUpdateInput = {
|
|
499
565
|
id: number;
|
|
@@ -502,11 +568,11 @@ export type AccountUpdateInput = {
|
|
|
502
568
|
services?: number;
|
|
503
569
|
/** System key only */
|
|
504
570
|
suspended?: boolean;
|
|
505
|
-
/** System key only: its owners and admins who sign in to the identity app with
|
|
571
|
+
/** System key only: its owners and admins who sign in to the identity app with 2FA operate the platform */
|
|
506
572
|
platform_operator?: boolean;
|
|
507
|
-
/** System key only: the bytes the account's apps may hold together, records and files; 0 is unlimited, null
|
|
573
|
+
/** System key only: the bytes the account's apps may hold together, records and files; 0 is unlimited, null returns the account to the server-wide account_space_bytes (1 GiB by default). The account makes apps while they fit */
|
|
508
574
|
space_bytes?: number | null;
|
|
509
|
-
/** System key only: the apps the account may own, beside its space; 0 is unlimited, null
|
|
575
|
+
/** System key only: the apps the account may own, beside its space; 0 is unlimited, null returns the account to the server-wide account_max_apps (unlimited by default) */
|
|
510
576
|
max_apps?: number | null;
|
|
511
577
|
[field: string]: unknown;
|
|
512
578
|
};
|
|
@@ -528,6 +594,59 @@ export type AccountUsageResult = {
|
|
|
528
594
|
[field: string]: unknown;
|
|
529
595
|
};
|
|
530
596
|
|
|
597
|
+
/** Input of account.usage.cpu: Read the CPU the account's apps used in each of the last 60 finished minutes, the hour's mean, the last 15 minutes' mean, the peak minute, the plan's CPU slices and the hour against them (used, of_share), the requests and calls held back while the server was saturated (holds) and each app's minutes and holds, each in CPU slices (1 is the Free plan's CPU under load; Standard holds 4). Explains how close the account runs to its plan's share and who waited for it */
|
|
598
|
+
export type AccountUsageCpuInput = {
|
|
599
|
+
id: number;
|
|
600
|
+
};
|
|
601
|
+
/** Result of account.usage.cpu. */
|
|
602
|
+
export type AccountUsageCpuResult = {
|
|
603
|
+
account: number;
|
|
604
|
+
/** the last 60 finished minutes, oldest first; a minute with no CPU is 0 */
|
|
605
|
+
minutes: Array<{
|
|
606
|
+
/** Unix seconds, the start of the minute */
|
|
607
|
+
at: number;
|
|
608
|
+
/** the CPU the account's apps used in it: their function calls' thread CPU and their API requests' CPU sampled every 10 ms, in nanoseconds */
|
|
609
|
+
cpu_ns: number;
|
|
610
|
+
/** cpu_ns in CPU slices (1: one CPU busy the whole minute, 60e9 ns, the Free plan's CPU under load) */
|
|
611
|
+
used: number;
|
|
612
|
+
[field: string]: unknown;
|
|
613
|
+
}>;
|
|
614
|
+
/** the hour's mean, in CPU slices */
|
|
615
|
+
mean_used: number;
|
|
616
|
+
/** the mean of its last 15 minutes, the trend against the hour */
|
|
617
|
+
recent_used: number;
|
|
618
|
+
/** the busiest minute (the latest of equal ones); null in an hour with no CPU */
|
|
619
|
+
peak: {
|
|
620
|
+
/** Unix seconds, the start of the minute */
|
|
621
|
+
at: number;
|
|
622
|
+
used: number;
|
|
623
|
+
[field: string]: unknown;
|
|
624
|
+
} | null;
|
|
625
|
+
/** the CPU slices of the account's plan, the Free plan's 1 (the identity app's plans file, cpu_share); null when the plan sets none or no plans are set */
|
|
626
|
+
share: number | null;
|
|
627
|
+
/** the account's plan id; null when no plans are set */
|
|
628
|
+
plan: string | null;
|
|
629
|
+
/** the hour's mean in CPU slices (mean_used) */
|
|
630
|
+
used: number;
|
|
631
|
+
/** used over share: 1 is the plan's whole slices on average; null when share is */
|
|
632
|
+
of_share: number | null;
|
|
633
|
+
/** the hour's requests and function calls queued behind other accounts' work while the server's CPU was saturated (CPU slices are a priority, never a cap); 0 on a server never saturated */
|
|
634
|
+
holds: number;
|
|
635
|
+
/** each of the account's apps with CPU or holds this hour */
|
|
636
|
+
apps: Array<{
|
|
637
|
+
/** the app's tenant id */
|
|
638
|
+
app: number;
|
|
639
|
+
/** empty for an app since removed */
|
|
640
|
+
slug: string;
|
|
641
|
+
/** its CPU in nanoseconds in each of the 60 minutes, oldest first */
|
|
642
|
+
minutes: number[];
|
|
643
|
+
/** its holds in each of the 60 minutes, oldest first */
|
|
644
|
+
holds: number[];
|
|
645
|
+
[field: string]: unknown;
|
|
646
|
+
}>;
|
|
647
|
+
[field: string]: unknown;
|
|
648
|
+
};
|
|
649
|
+
|
|
531
650
|
/** Input of agent.alert.list: List the account's agent alerts (a spent key used again revokes its session and leaves one), newest first */
|
|
532
651
|
export type AgentAlertListInput = {
|
|
533
652
|
id: number;
|
|
@@ -607,7 +726,7 @@ export type AgentEnrollCreateResult = {
|
|
|
607
726
|
[field: string]: unknown;
|
|
608
727
|
};
|
|
609
728
|
|
|
610
|
-
/** Input of agent.enroll.exchange: Exchange a one-time enrollment code for an agent session: a
|
|
729
|
+
/** Input of agent.enroll.exchange: Exchange a one-time enrollment code (substrio_ae_...) for an agent session acting as the member who made it: a bearer one unless a kind is named or a public key is sent (key-bound). Answers the credential once and next, what to do with it; the code is spent. Over MCP it is the tool substrio_connect on any /mcp, with no credential */
|
|
611
730
|
export type AgentEnrollExchangeInput = {
|
|
612
731
|
/** bearer: one static secret (substrio_ab_...), short-lived (agent_bearer_max_seconds), for an agent that can hold only one string; absent: key_bound with a public_key, else bearer. ratcheted: a key that changes on every request */
|
|
613
732
|
kind?: "key_bound" | "ratcheted" | "bearer";
|
|
@@ -665,7 +784,7 @@ export type AgentSessionDelegateResult = {
|
|
|
665
784
|
[field: string]: unknown;
|
|
666
785
|
};
|
|
667
786
|
|
|
668
|
-
/** Input of agent.session.list: List the account's agent sessions, oldest first, a page at a time (limit, cursor; next_cursor), or only those reaching one app (app); never a key */
|
|
787
|
+
/** Input of agent.session.list: List the account's live agent sessions (an ended one leaves the list; its log is still read by id), oldest first, a page at a time (limit, cursor; next_cursor), or only those reaching one app (app); never a key */
|
|
669
788
|
export type AgentSessionListInput = {
|
|
670
789
|
id: number;
|
|
671
790
|
/** only this app's rows: its slug, as account.app.list names it; a session whose grant names no app reaches every app */
|
|
@@ -998,6 +1117,125 @@ export type AiToolsResult = {
|
|
|
998
1117
|
[field: string]: unknown;
|
|
999
1118
|
};
|
|
1000
1119
|
|
|
1120
|
+
/** Input of app.archive: Download the app as one .substrio.zip, its backup and its portable export: every collection as NDJSON (data/<collection>.ndjson), its users (users.ndjson), versions, config and site files, and manifest.json with each entry's SHA-256. Optional body passphrase seals secret values, password hashes, TOTP enrolments and passkeys into sealed.bin; without it they are left out. Optional backup_id archives that backup instead. app.restore or app.import reads it back on any server version */
|
|
1121
|
+
export type AppArchiveInput = {
|
|
1122
|
+
/** Seals secret values, users' password hashes, TOTP enrolments and passkeys into sealed.bin (Argon2id, AES-256-GCM), so a restore with the same passphrase keeps sign-ins and secrets; without it they are left out */
|
|
1123
|
+
passphrase?: string;
|
|
1124
|
+
/** Archive this backup (an id from backup.list) instead of the app as it is now */
|
|
1125
|
+
backup_id?: string;
|
|
1126
|
+
[field: string]: unknown;
|
|
1127
|
+
};
|
|
1128
|
+
/** Result of app.archive. */
|
|
1129
|
+
export type AppArchiveResult = {
|
|
1130
|
+
data?: unknown;
|
|
1131
|
+
error?: unknown;
|
|
1132
|
+
[field: string]: unknown;
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
/** Input of app.deploy: Ship files in one call: commit the units and removals (as version.commit takes them), check the version's functions (unless check is false), make it live where to names (live, or a sandbox), test it there with app.test (unless test is false), and, with promote and a sandbox in to, make it live on the app once the test is green. Stops at the first step that fails: a refused commit, check or live answers that step's own error with stage; a failed test answers ok false, stage test and the test's failures with their fixes, and promotes nothing. Answers ok, stage, deployed {commit, live}, test and promote, each the answer of that step's own tool. Over HTTP it runs the commit, the check and live; test and promote run in the MCP tool */
|
|
1136
|
+
export type AppDeployInput = {
|
|
1137
|
+
/** What this commit did */
|
|
1138
|
+
message: string;
|
|
1139
|
+
/** The units this commit writes, as version.commit takes them */
|
|
1140
|
+
units?: Array<{
|
|
1141
|
+
/** The unit's path inside the version: site/index.html, functions/hello.js, functions/hello.json */
|
|
1142
|
+
path: string;
|
|
1143
|
+
/** The unit's bytes as text */
|
|
1144
|
+
text?: string;
|
|
1145
|
+
/** The unit's bytes as base64, for a unit that is not text */
|
|
1146
|
+
base64?: string;
|
|
1147
|
+
/** An object this app already holds (64 hex), instead of sending the bytes again */
|
|
1148
|
+
id?: string;
|
|
1149
|
+
[field: string]: unknown;
|
|
1150
|
+
}>;
|
|
1151
|
+
/** The paths this commit removes */
|
|
1152
|
+
removals?: string[];
|
|
1153
|
+
/** The branch to commit on (default: main) */
|
|
1154
|
+
branch?: string;
|
|
1155
|
+
/** changes applies units and removals to the parent version (default); snapshot makes the units the whole content */
|
|
1156
|
+
mode?: "changes" | "snapshot";
|
|
1157
|
+
/** The version the branch must still point at (64 hex, or an empty string for a branch with no version yet). 409 when it moved: nothing is written */
|
|
1158
|
+
expected?: string;
|
|
1159
|
+
/** true says the branch's required checks are green, which a protected branch needs */
|
|
1160
|
+
checks_green?: boolean;
|
|
1161
|
+
/** Where the version goes live: live for the app, or a sandbox name from sandbox.list */
|
|
1162
|
+
to: string;
|
|
1163
|
+
/** false skips function.check over the version's functions before it goes live */
|
|
1164
|
+
check?: boolean;
|
|
1165
|
+
/** true runs app.test on where the version went live, with its defaults; a failure stops the deploy there */
|
|
1166
|
+
test?: boolean;
|
|
1167
|
+
/** With a sandbox in to: once the test is green, make what the sandbox runs live on the app (live.set from the sandbox) */
|
|
1168
|
+
promote?: boolean;
|
|
1169
|
+
/** false skips the data backup a version going live on the app takes first */
|
|
1170
|
+
backup?: boolean;
|
|
1171
|
+
/** As live.set: what to do with a function deployed outside a version that this would overwrite */
|
|
1172
|
+
direct?: "refuse" | "replace" | "keep";
|
|
1173
|
+
[field: string]: unknown;
|
|
1174
|
+
};
|
|
1175
|
+
/** Result of app.deploy. */
|
|
1176
|
+
export type AppDeployResult = {
|
|
1177
|
+
/** true when every step asked for passed */
|
|
1178
|
+
ok: boolean;
|
|
1179
|
+
/** done, or the step that stopped the deploy (a refused commit, check or live answers its own error, stage commit, check or live) */
|
|
1180
|
+
stage: "done" | "test" | "promote";
|
|
1181
|
+
deployed: {
|
|
1182
|
+
/** version.commit's answer */
|
|
1183
|
+
commit: Record<string, unknown>;
|
|
1184
|
+
/** live.set's answer for to; its url is the https address to open in a browser */
|
|
1185
|
+
live: Record<string, unknown>;
|
|
1186
|
+
[field: string]: unknown;
|
|
1187
|
+
};
|
|
1188
|
+
/** app.test's answer; null when test was false */
|
|
1189
|
+
test: Record<string, unknown> | null;
|
|
1190
|
+
/** live.set's answer on the app (its url the app's address); null when promote was not asked or the test failed */
|
|
1191
|
+
promote: Record<string, unknown> | null;
|
|
1192
|
+
[field: string]: unknown;
|
|
1193
|
+
};
|
|
1194
|
+
|
|
1195
|
+
/** Input of app.diagnose: What is wrong with the app (or a sandbox) and how to fix it, in one call: which version each environment runs against main's head, function.check over the version that runs where the call looks (its diagnostics), its newest function errors, and app.test of its website and GET routes, each finding with its fix. Answers ok, sandbox, live {main, environments}, check, errors {recent, fix}, test and fixes, every fix in order. Read only; the MCP server runs it */
|
|
1196
|
+
export type AppDiagnoseInput = {
|
|
1197
|
+
/** A sandbox name from sandbox.list: look at what it runs instead of the app */
|
|
1198
|
+
sandbox?: string;
|
|
1199
|
+
[field: string]: unknown;
|
|
1200
|
+
};
|
|
1201
|
+
/** Result of app.diagnose. */
|
|
1202
|
+
export type AppDiagnoseResult = {
|
|
1203
|
+
/** something is live where the call looks, its functions pass function.check and app.test passed */
|
|
1204
|
+
ok: boolean;
|
|
1205
|
+
sandbox: string | null;
|
|
1206
|
+
live: {
|
|
1207
|
+
/** main's head, by number */
|
|
1208
|
+
main: number | null;
|
|
1209
|
+
environments: Array<{
|
|
1210
|
+
/** null: the app */
|
|
1211
|
+
sandbox: string | null;
|
|
1212
|
+
live: number | null;
|
|
1213
|
+
/** when it does not run main's head */
|
|
1214
|
+
fix?: string;
|
|
1215
|
+
[field: string]: unknown;
|
|
1216
|
+
}>;
|
|
1217
|
+
[field: string]: unknown;
|
|
1218
|
+
};
|
|
1219
|
+
check: {
|
|
1220
|
+
version: number | null;
|
|
1221
|
+
ok: boolean;
|
|
1222
|
+
diagnostics: Array<Record<string, unknown>>;
|
|
1223
|
+
fix?: string;
|
|
1224
|
+
[field: string]: unknown;
|
|
1225
|
+
};
|
|
1226
|
+
errors: {
|
|
1227
|
+
/** the newest function errors, as function.errors pages them */
|
|
1228
|
+
recent: Record<string, unknown>;
|
|
1229
|
+
fix: string;
|
|
1230
|
+
[field: string]: unknown;
|
|
1231
|
+
};
|
|
1232
|
+
/** app.test's answer; null when nothing runs there */
|
|
1233
|
+
test: Record<string, unknown> | null;
|
|
1234
|
+
/** every finding's fix, in order; empty when ok */
|
|
1235
|
+
fixes: string[];
|
|
1236
|
+
[field: string]: unknown;
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1001
1239
|
/** Input of app.export: Stream the app as one bundle (versions, blobs, live stack, views, AI config, database, secrets), sealed whole to seal_to, for that server's POST /v1/_import */
|
|
1002
1240
|
export type AppExportInput = {
|
|
1003
1241
|
/** the importing server's seal key (GET /v1/_seal-key); required */
|
|
@@ -1010,11 +1248,48 @@ export type AppExportResult = {
|
|
|
1010
1248
|
[field: string]: unknown;
|
|
1011
1249
|
};
|
|
1012
1250
|
|
|
1251
|
+
/** Input of app.get: Read this app's own record: slug, hosts, domains, suspended, readonly, live_by_promote, account_id, created_at and its limits. The app is the one the request names (X-Substrio-Tenant or its host) */
|
|
1252
|
+
export type AppGetInput = Record<string, never>;
|
|
1253
|
+
/** Result of app.get. */
|
|
1254
|
+
export type AppGetResult = {
|
|
1255
|
+
suspended: boolean;
|
|
1256
|
+
/** present only while suspended is true */
|
|
1257
|
+
suspend_reason?: "billing" | "abuse" | "owner_request" | "maintenance";
|
|
1258
|
+
/** present only while suspended is true */
|
|
1259
|
+
suspend_note?: string;
|
|
1260
|
+
readonly: boolean;
|
|
1261
|
+
/** the live version changes only by promote (version.live.set): a function is changed in a version, never deployed straight to live */
|
|
1262
|
+
live_by_promote: boolean;
|
|
1263
|
+
hosts: string[];
|
|
1264
|
+
_id: number;
|
|
1265
|
+
/** the account that owns the app (account.get); 0: the platform */
|
|
1266
|
+
account_id: number;
|
|
1267
|
+
slug: string;
|
|
1268
|
+
subdomain: string;
|
|
1269
|
+
createdAt: number;
|
|
1270
|
+
customDomain: string;
|
|
1271
|
+
domains: string[];
|
|
1272
|
+
flags: number;
|
|
1273
|
+
active: boolean;
|
|
1274
|
+
storageBytesLimit: number;
|
|
1275
|
+
storageBytesUsed: number;
|
|
1276
|
+
documentsLimit: number;
|
|
1277
|
+
documentsCount: number;
|
|
1278
|
+
requestsPerMinute: number;
|
|
1279
|
+
maxDocumentSize: number;
|
|
1280
|
+
cfCpuLimitMs: number;
|
|
1281
|
+
cfMemoryLimitMb: number;
|
|
1282
|
+
cfTenantMemoryLimitMb: number;
|
|
1283
|
+
cfConcurrentLimit: number;
|
|
1284
|
+
cfTimeoutS: number;
|
|
1285
|
+
[field: string]: unknown;
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1013
1288
|
/** Input of app.import: Make an app from a bundle GET /v1/_export streamed (the request body): its data, versions, live version, secrets sealed to this server, views and sandboxes */
|
|
1014
1289
|
export type AppImportInput = {
|
|
1015
1290
|
/** the app slug to import as (default: the bundle's app) */
|
|
1016
1291
|
slug?: string;
|
|
1017
|
-
/** true replaces an existing app of that slug */
|
|
1292
|
+
/** true replaces an existing app of that slug (app.restore: the caller's own app) that holds data */
|
|
1018
1293
|
replace?: boolean;
|
|
1019
1294
|
[field: string]: unknown;
|
|
1020
1295
|
};
|
|
@@ -1065,7 +1340,7 @@ export type AppMeshResult = {
|
|
|
1065
1340
|
[field: string]: unknown;
|
|
1066
1341
|
};
|
|
1067
1342
|
|
|
1068
|
-
/** Input of app.overview: Read everything a dashboard's first paint needs for this app in one call: app (slug, tenant_id, created_at, hosts, domains, suspended, live_by_promote, is_sandbox), usage (the same body as tenant.usage), storage (database_bytes on disk and backups: count, bytes, latest_at), versions (live, rollback_to, count, sandboxes), functions (count, names), collections (count), cron (count), queues (count), alerts (log alerts fired in their last window), audit (the last 5 entries, newest first) and mesh (this app's mesh position, in short) */
|
|
1343
|
+
/** Input of app.overview: Read everything a dashboard's first paint needs for this app in one call: app (slug, tenant_id, created_at, hosts, domains, suspended, live_by_promote, is_sandbox), usage (the same body as tenant.usage.self), storage (database_bytes on disk and backups: count, bytes, latest_at), versions (live, rollback_to, count, sandboxes), functions (count, names), collections (count), cron (count), queues (count), alerts (log alerts fired in their last window), audit (the last 5 entries, newest first) and mesh (this app's mesh position, in short) */
|
|
1069
1344
|
export type AppOverviewInput = Record<string, never>;
|
|
1070
1345
|
/** Result of app.overview. */
|
|
1071
1346
|
export type AppOverviewResult = {
|
|
@@ -1082,16 +1357,18 @@ export type AppOverviewResult = {
|
|
|
1082
1357
|
is_sandbox: boolean;
|
|
1083
1358
|
[field: string]: unknown;
|
|
1084
1359
|
};
|
|
1085
|
-
/** the same body as tenant.usage */
|
|
1360
|
+
/** the same body as tenant.usage.self */
|
|
1086
1361
|
usage: Record<string, unknown>;
|
|
1087
1362
|
storage: {
|
|
1088
|
-
/**
|
|
1363
|
+
/** the database file: its used end, page-rounded (tenant.storage's kinds.database) */
|
|
1089
1364
|
database_bytes: number;
|
|
1090
|
-
/**
|
|
1365
|
+
/** the logs and the sync log, each at its used end (tenant.storage's kinds.logs) */
|
|
1091
1366
|
logs_bytes?: number;
|
|
1092
|
-
/** allocated bytes
|
|
1367
|
+
/** the backups and set-aside copies, their allocated bytes: a part of folder_bytes, held against the storage limit like the rest */
|
|
1368
|
+
backups_bytes?: number;
|
|
1369
|
+
/** the rest of folder_bytes: the stored files, code and every other file */
|
|
1093
1370
|
other_bytes?: number;
|
|
1094
|
-
/** the three above together:
|
|
1371
|
+
/** the three above together: what the app's folder holds on disk, tenant.storage's disk_bytes, the figure its storage limit is held against */
|
|
1095
1372
|
folder_bytes?: number;
|
|
1096
1373
|
backups: {
|
|
1097
1374
|
count: number;
|
|
@@ -1134,11 +1411,24 @@ export type AppOverviewResult = {
|
|
|
1134
1411
|
alerts: unknown[];
|
|
1135
1412
|
/** the last 5 entries, newest first */
|
|
1136
1413
|
audit: unknown[];
|
|
1137
|
-
/**
|
|
1414
|
+
/** the servers this app runs on, for the operator */
|
|
1138
1415
|
mesh: Record<string, unknown>;
|
|
1139
1416
|
[field: string]: unknown;
|
|
1140
1417
|
};
|
|
1141
1418
|
|
|
1419
|
+
/** Input of app.restore: Restore a .substrio.zip (the request body, as app.archive made it) into this app through the normal write paths: users, data, versions, site files, config, and with the X-Substrio-Passphrase header the sealed secrets and sign-ins. Every entry is checked against manifest.json before anything is written. An app that holds data is refused unless replace=true. Answers the counts restored and what was left out */
|
|
1420
|
+
export type AppRestoreInput = {
|
|
1421
|
+
/** true replaces an existing app of that slug (app.restore: the caller's own app) that holds data */
|
|
1422
|
+
replace?: boolean;
|
|
1423
|
+
[field: string]: unknown;
|
|
1424
|
+
};
|
|
1425
|
+
/** Result of app.restore. */
|
|
1426
|
+
export type AppRestoreResult = {
|
|
1427
|
+
data?: unknown;
|
|
1428
|
+
error?: unknown;
|
|
1429
|
+
[field: string]: unknown;
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1142
1432
|
/** Input of app.runtime_level.set: Set one app's runtime compatibility level: which behaviour of the function runtime it gets. Never above the level this release carries (a higher level refuses the call), and the app's isolates pick the new level up as they are made */
|
|
1143
1433
|
export type AppRuntimeLevelSetInput = {
|
|
1144
1434
|
slug: string;
|
|
@@ -1153,6 +1443,29 @@ export type AppRuntimeLevelSetResult = {
|
|
|
1153
1443
|
[field: string]: unknown;
|
|
1154
1444
|
};
|
|
1155
1445
|
|
|
1446
|
+
/** Input of app.scaffold: Start an app from a template compiled into the release: commits the app's first version on main, one snapshot of the template's units, each of which passes app.test. site is a page with its stylesheet and script; site-api adds a function route (GET /api/hello) the page calls; site-data-auth is a notes page anyone reads and a signed-in person adds to (GET /api/notes, POST /api/notes auth, GET /api/me auth). Refused with 409 when main already holds a version: change an app that has one with version.commit or app.deploy. Answers version.commit's answer and template; make it live with live.set (with sandbox to try it first) */
|
|
1447
|
+
export type AppScaffoldInput = {
|
|
1448
|
+
/** site: a page, its stylesheet and script; site-api: that and a function route, GET /api/hello, the page calls; site-data-auth: a notes page anyone reads, a signed-in person adds to (GET /api/notes, POST /api/notes auth, GET /api/me auth) */
|
|
1449
|
+
template: "site" | "site-api" | "site-data-auth";
|
|
1450
|
+
/** The commit's message (default: app.scaffold: and the template) */
|
|
1451
|
+
message?: string;
|
|
1452
|
+
[field: string]: unknown;
|
|
1453
|
+
};
|
|
1454
|
+
/** Result of app.scaffold. */
|
|
1455
|
+
export type AppScaffoldResult = {
|
|
1456
|
+
branch: string;
|
|
1457
|
+
/** the version's id (64 hex) */
|
|
1458
|
+
version: string;
|
|
1459
|
+
root?: string;
|
|
1460
|
+
/** the version number, promotable at once with live.set (with sandbox to run it there first) */
|
|
1461
|
+
number: number;
|
|
1462
|
+
generation?: number;
|
|
1463
|
+
blobs_written?: number;
|
|
1464
|
+
trees_written?: number;
|
|
1465
|
+
template: "site" | "site-api" | "site-data-auth";
|
|
1466
|
+
[field: string]: unknown;
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1156
1469
|
/** Input of app.seal_key.get: Read the X25519 public key bundles this server imports are sealed to (seal_to of an export) */
|
|
1157
1470
|
export type AppSealKeyGetInput = Record<string, never>;
|
|
1158
1471
|
/** Result of app.seal_key.get. */
|
|
@@ -1162,6 +1475,63 @@ export type AppSealKeyGetResult = {
|
|
|
1162
1475
|
[field: string]: unknown;
|
|
1163
1476
|
};
|
|
1164
1477
|
|
|
1478
|
+
/** Input of app.test: Test the app's website (or a sandbox's) as a browser loads it, in one call: each page of paths (default /) and every same-site page it links, every stylesheet, script, image, icon and CSS url() or @import they name, and every GET function route with no parameter, each fetched in process as route.call does, as a visitor with no credentials. Each is checked for its status, its content type (a stylesheet must be text/css, a script JavaScript, an image image/*, never the site's page in their place) and its size. Answers ok, the table of every resource (path, kind, from, status, type, bytes, ok) and each failure with its problem and its fix. References to another origin are counted, never fetched */
|
|
1479
|
+
export type AppTestInput = {
|
|
1480
|
+
/** A sandbox name from sandbox.list: test what it runs instead of the app */
|
|
1481
|
+
sandbox?: string;
|
|
1482
|
+
/** The pages to start from (default ["/"]); every same-site <a href> page they link is tested too, up to max_pages */
|
|
1483
|
+
paths?: string[];
|
|
1484
|
+
/** true also calls every GET function route that has no parameter, as a visitor with no credentials, and fails one answering 500 or above */
|
|
1485
|
+
routes?: boolean;
|
|
1486
|
+
/** Pages fetched at most, paths and links together */
|
|
1487
|
+
max_pages?: number;
|
|
1488
|
+
/** Requests made at most; a run that stops there answers truncated: true */
|
|
1489
|
+
max_fetches?: number;
|
|
1490
|
+
[field: string]: unknown;
|
|
1491
|
+
};
|
|
1492
|
+
/** Result of app.test. */
|
|
1493
|
+
export type AppTestResult = {
|
|
1494
|
+
/** true when no resource failed */
|
|
1495
|
+
ok: boolean;
|
|
1496
|
+
sandbox: string | null;
|
|
1497
|
+
pages: number;
|
|
1498
|
+
/** requests made */
|
|
1499
|
+
checked: number;
|
|
1500
|
+
failed: number;
|
|
1501
|
+
/** references to another origin, not fetched */
|
|
1502
|
+
external: number;
|
|
1503
|
+
/** function routes with a parameter, a * or a method other than GET, not called */
|
|
1504
|
+
skipped_routes: number;
|
|
1505
|
+
/** max_pages or max_fetches stopped the run */
|
|
1506
|
+
truncated: boolean;
|
|
1507
|
+
resources: Array<{
|
|
1508
|
+
path: string;
|
|
1509
|
+
kind: "page" | "stylesheet" | "script" | "image" | "css_url" | "link" | "route";
|
|
1510
|
+
/** the page or stylesheet that names it; null for one this call named */
|
|
1511
|
+
from: string | null;
|
|
1512
|
+
status: number;
|
|
1513
|
+
/** the media type answered */
|
|
1514
|
+
type: string;
|
|
1515
|
+
bytes: number;
|
|
1516
|
+
ok: boolean;
|
|
1517
|
+
[field: string]: unknown;
|
|
1518
|
+
}>;
|
|
1519
|
+
failures: Array<{
|
|
1520
|
+
path: string;
|
|
1521
|
+
kind: string;
|
|
1522
|
+
from: string | null;
|
|
1523
|
+
status: number;
|
|
1524
|
+
type: string;
|
|
1525
|
+
problem: "not_found" | "status" | "wrong_type" | "empty" | "server_error";
|
|
1526
|
+
/** what to do, naming the unit to commit, the reference or header to change, or the log to read */
|
|
1527
|
+
fix: string;
|
|
1528
|
+
/** a failing route's body, its first 300 bytes */
|
|
1529
|
+
detail?: string;
|
|
1530
|
+
[field: string]: unknown;
|
|
1531
|
+
}>;
|
|
1532
|
+
[field: string]: unknown;
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1165
1535
|
/** Input of apps.calls.get: Read the app's word on calls between apps: the functions it offers other apps (each to the apps named, or @account: every app of its own account) and the functions of other apps it calls as substrio.apps.<app>.<entry>(...) */
|
|
1166
1536
|
export type AppsCallsGetInput = Record<string, never>;
|
|
1167
1537
|
/** Result of apps.calls.get. */
|
|
@@ -1439,7 +1809,20 @@ export type AuthClientRedirectUrisSetResult = {
|
|
|
1439
1809
|
[field: string]: unknown;
|
|
1440
1810
|
};
|
|
1441
1811
|
|
|
1442
|
-
/** Input of auth.
|
|
1812
|
+
/** Input of auth.devices: Count the signed-in person's remembered devices: each signs in with the authenticator code and no email until it ends (30 days, or every session of the person ending) */
|
|
1813
|
+
export type AuthDevicesInput = Record<string, never>;
|
|
1814
|
+
/** Result of auth.devices. */
|
|
1815
|
+
export type AuthDevicesResult = {
|
|
1816
|
+
count: number;
|
|
1817
|
+
[field: string]: unknown;
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1820
|
+
/** Input of auth.devices.forget: Forget every remembered device of the signed-in person: each signs in by the email code again. No session ends */
|
|
1821
|
+
export type AuthDevicesForgetInput = Record<string, never>;
|
|
1822
|
+
/** Result of auth.devices.forget. */
|
|
1823
|
+
export type AuthDevicesForgetResult = void;
|
|
1824
|
+
|
|
1825
|
+
/** Input of auth.email.code_request: Mail a short code and a link that prove an address; nobody need be signed in. One pair an address: asked again while it lives, the same code and link are mailed again (every mail sent works) and its life starts over; a spent, expired or locked pair gives way to a new one. Paced by the app's request interval. Answers {accepted, expires_at} whether or not anyone holds the address. On a device remembered for the person the address names (the substrio_device cookie auth.mfa set), their 2FA on, no mail is sent: {accepted, expires_at, mfa_required, challenge}, finished by auth.mfa with the authenticator code */
|
|
1443
1826
|
export type AuthEmailCodeRequestInput = {
|
|
1444
1827
|
email: string;
|
|
1445
1828
|
[field: string]: unknown;
|
|
@@ -1447,8 +1830,12 @@ export type AuthEmailCodeRequestInput = {
|
|
|
1447
1830
|
/** Result of auth.email.code_request. */
|
|
1448
1831
|
export type AuthEmailCodeRequestResult = {
|
|
1449
1832
|
accepted: true;
|
|
1450
|
-
/** Unix seconds */
|
|
1833
|
+
/** Unix seconds: the code's end, or the challenge's */
|
|
1451
1834
|
expires_at: number;
|
|
1835
|
+
/** A remembered device: no email was sent; answer the challenge with auth.mfa */
|
|
1836
|
+
mfa_required?: true;
|
|
1837
|
+
/** With mfa_required: the challenge auth.mfa takes with the authenticator code */
|
|
1838
|
+
challenge?: string;
|
|
1452
1839
|
[field: string]: unknown;
|
|
1453
1840
|
};
|
|
1454
1841
|
|
|
@@ -1467,10 +1854,10 @@ export type AuthEmailCodeVerifyResult = {
|
|
|
1467
1854
|
created: boolean;
|
|
1468
1855
|
/** A one-time password reset token; absent for a suspended or deleted person */
|
|
1469
1856
|
password_grant?: string;
|
|
1470
|
-
/** A session: the code proves the mailbox, so the person is signed in; absent when
|
|
1857
|
+
/** A session: the code proves the mailbox, so the person is signed in; absent when 2FA is due */
|
|
1471
1858
|
token?: string;
|
|
1472
1859
|
keyring?: string;
|
|
1473
|
-
/** The
|
|
1860
|
+
/** The 2FA step due instead of a session: the challenge to answer with auth.mfa */
|
|
1474
1861
|
mfa?: Record<string, unknown>;
|
|
1475
1862
|
[field: string]: unknown;
|
|
1476
1863
|
};
|
|
@@ -1531,6 +1918,24 @@ export type AuthGoogleResult = {
|
|
|
1531
1918
|
[field: string]: unknown;
|
|
1532
1919
|
};
|
|
1533
1920
|
|
|
1921
|
+
/** Input of auth.link.redeem: For the console: spend a one-time console link (token, from the url's #link fragment) and sign its person in at the identity app, marked: an irreversible call waits for an approval and it decides none (CONSOLE_LINK_STEP_UP) until the person signs in again by the email code or 2FA. Answers {user_id, account_id, token, keyring} as auth.email.code_verify signs in, or the 2FA step due under mfa; a link that signs nobody in is refused CONSOLE_LINK_UNKNOWN (made up, or replaced by a newer link), CONSOLE_LINK_USED or CONSOLE_LINK_EXPIRED */
|
|
1922
|
+
export type AuthLinkRedeemInput = {
|
|
1923
|
+
token: string;
|
|
1924
|
+
[field: string]: unknown;
|
|
1925
|
+
};
|
|
1926
|
+
/** Result of auth.link.redeem. */
|
|
1927
|
+
export type AuthLinkRedeemResult = {
|
|
1928
|
+
user_id: number;
|
|
1929
|
+
/** The account the agent acts in; 0 when the link names none */
|
|
1930
|
+
account_id: number;
|
|
1931
|
+
/** The person's session; absent when 2FA is due */
|
|
1932
|
+
token?: string;
|
|
1933
|
+
keyring?: string;
|
|
1934
|
+
/** The 2FA step due instead of a session: the challenge to answer with auth.mfa */
|
|
1935
|
+
mfa?: Record<string, unknown>;
|
|
1936
|
+
[field: string]: unknown;
|
|
1937
|
+
};
|
|
1938
|
+
|
|
1534
1939
|
/** Input of auth.login: Authenticate a user */
|
|
1535
1940
|
export type AuthLoginInput = {
|
|
1536
1941
|
email: string;
|
|
@@ -1564,7 +1969,7 @@ export type AuthLoginSetResult = {
|
|
|
1564
1969
|
[field: string]: unknown;
|
|
1565
1970
|
};
|
|
1566
1971
|
|
|
1567
|
-
/** Input of auth.logout: End this session; its token stops working at once */
|
|
1972
|
+
/** Input of auth.logout: End this session; its token stops working at once, and this browser's substrio_session cookie ends and is cleared (a remembered device stays) */
|
|
1568
1973
|
export type AuthLogoutInput = Record<string, never>;
|
|
1569
1974
|
/** Result of auth.logout. */
|
|
1570
1975
|
export type AuthLogoutResult = void;
|
|
@@ -1595,7 +2000,22 @@ export type AuthMeDeleteResult = {
|
|
|
1595
2000
|
[field: string]: unknown;
|
|
1596
2001
|
};
|
|
1597
2002
|
|
|
1598
|
-
/** Input of auth.
|
|
2003
|
+
/** Input of auth.me.update: Edit the signed-in person's own profile: name always, and each member of fields only when the app's _users schema marks that field "self": true (a member not marked refuses the whole edit with 403 SELF_FIELD_REFUSED naming it; a value the schema refuses is 400 SCHEMA_REFUSED; a key is refused 403, a key is not a user). Email and password change through their own verified flows. Answers the profile as auth.me does */
|
|
2004
|
+
export type AuthMeUpdateInput = {
|
|
2005
|
+
/** The person's display name */
|
|
2006
|
+
name?: string;
|
|
2007
|
+
/** Members of the person object, each one the app's _users schema marks self */
|
|
2008
|
+
fields?: Record<string, unknown>;
|
|
2009
|
+
[field: string]: unknown;
|
|
2010
|
+
};
|
|
2011
|
+
/** Result of auth.me.update. */
|
|
2012
|
+
export type AuthMeUpdateResult = {
|
|
2013
|
+
data?: unknown;
|
|
2014
|
+
error?: unknown;
|
|
2015
|
+
[field: string]: unknown;
|
|
2016
|
+
};
|
|
2017
|
+
|
|
2018
|
+
/** Input of auth.mfa: Finish a sign-in that answered mfa_required: trade its challenge and a code, or a recovery code, for the session. After the email code, remember true also remembers the device (the substrio_device cookie, 30 days) */
|
|
1599
2019
|
export type AuthMfaInput = {
|
|
1600
2020
|
/** From the sign-in that answered mfa_required */
|
|
1601
2021
|
challenge: string;
|
|
@@ -1603,6 +2023,8 @@ export type AuthMfaInput = {
|
|
|
1603
2023
|
code?: string;
|
|
1604
2024
|
/** One of the recovery codes, instead of code; each works once */
|
|
1605
2025
|
recovery_code?: string;
|
|
2026
|
+
/** Remember this device (a sign-in that began with the email code only): its next sign-in asks for the authenticator code with no email. The answer sets the substrio_device cookie; false when absent */
|
|
2027
|
+
remember?: boolean;
|
|
1606
2028
|
[field: string]: unknown;
|
|
1607
2029
|
};
|
|
1608
2030
|
/** Result of auth.mfa. */
|
|
@@ -1766,7 +2188,7 @@ export type AuthPasskeyRenameResult = {
|
|
|
1766
2188
|
[field: string]: unknown;
|
|
1767
2189
|
};
|
|
1768
2190
|
|
|
1769
|
-
/** Input of auth.passkey.sign_in: Sign in with a passkey and no password: verifies the assertion and returns a session; a passkey that verified the person needs no
|
|
2191
|
+
/** Input of auth.passkey.sign_in: Sign in with a passkey and no password: verifies the assertion and returns a session; a passkey that verified the person needs no 2FA */
|
|
1770
2192
|
export type AuthPasskeySignInInput = {
|
|
1771
2193
|
/** The credential id, base64url */
|
|
1772
2194
|
id: string;
|
|
@@ -1891,8 +2313,12 @@ export type AuthProviderUpdateResult = {
|
|
|
1891
2313
|
[field: string]: unknown;
|
|
1892
2314
|
};
|
|
1893
2315
|
|
|
1894
|
-
/** Input of auth.refresh: Refresh a session */
|
|
1895
|
-
export type AuthRefreshInput =
|
|
2316
|
+
/** Input of auth.refresh: Refresh a session: the Bearer token for a new one (the old one stops working). stay true also sets the substrio_session cookie (30 days, renewed by each refresh); with no Bearer, that cookie alone signs its person in again as their sign-in did */
|
|
2317
|
+
export type AuthRefreshInput = {
|
|
2318
|
+
/** Stay signed in on this browser: the answer sets the substrio_session cookie (HttpOnly), which auth.refresh with no Bearer trades for a session for 30 days, each refresh renewing it; false when absent */
|
|
2319
|
+
stay?: boolean;
|
|
2320
|
+
[field: string]: unknown;
|
|
2321
|
+
};
|
|
1896
2322
|
/** Result of auth.refresh. */
|
|
1897
2323
|
export type AuthRefreshResult = {
|
|
1898
2324
|
success: true;
|
|
@@ -2020,7 +2446,7 @@ export type BackupCloneIntoResult = {
|
|
|
2020
2446
|
[field: string]: unknown;
|
|
2021
2447
|
};
|
|
2022
2448
|
|
|
2023
|
-
/** Input of backup.create: Start a backup of the app's database as a background job: optional body description. Answers 202 {job_id, status:'running'} at once; backup.get with
|
|
2449
|
+
/** Input of backup.create: Start a backup of the app's database as a background job: optional body description. Answers 202 {job_id, backup_id, status:'running'} at once, the backup already listed by backup.list as running; backup.get with the job id shows the progress, and with the backup id the backup that backup.restore takes once it completes */
|
|
2024
2450
|
export type BackupCreateInput = {
|
|
2025
2451
|
/** A note kept with the backup */
|
|
2026
2452
|
description?: string;
|
|
@@ -2152,6 +2578,8 @@ export type BillingCartCreateInput = {
|
|
|
2152
2578
|
}>;
|
|
2153
2579
|
/** credit to add, in the minor unit (cents), 500 to 1000000 */
|
|
2154
2580
|
funds?: number;
|
|
2581
|
+
/** the space add-on blocks the account holds once the cart is paid (a plan with space_addon, Scale); 0 releases them */
|
|
2582
|
+
space_blocks?: number;
|
|
2155
2583
|
[field: string]: unknown;
|
|
2156
2584
|
};
|
|
2157
2585
|
/** Result of billing.cart.create. */
|
|
@@ -2184,6 +2612,7 @@ export type BillingCartUpdateInput = {
|
|
|
2184
2612
|
[field: string]: unknown;
|
|
2185
2613
|
}>;
|
|
2186
2614
|
funds?: number;
|
|
2615
|
+
space_blocks?: number;
|
|
2187
2616
|
[field: string]: unknown;
|
|
2188
2617
|
};
|
|
2189
2618
|
/** Result of billing.cart.update. */
|
|
@@ -2241,6 +2670,27 @@ export type BillingCreditGetResult = {
|
|
|
2241
2670
|
[field: string]: unknown;
|
|
2242
2671
|
};
|
|
2243
2672
|
|
|
2673
|
+
/** Input of billing.person_cart.create: Make a cart of plans that are the person's own, paid by the account: they hold them at every app wherever they sign in, apart from the account's (subscriptions.mine lists them). The plans, the offer and checkout_url as billing.cart.create gives them; the subject is the person whose own session starts the checkout. No space_blocks: the add-on is the account's */
|
|
2674
|
+
export type BillingPersonCartCreateInput = {
|
|
2675
|
+
/** the account that pays */
|
|
2676
|
+
id: number;
|
|
2677
|
+
items?: Array<{
|
|
2678
|
+
/** the app whose plan it is: any app with a priced plan (a featured app, a customer's app), or the identity app for a Substrio plan */
|
|
2679
|
+
jet: string;
|
|
2680
|
+
plan: string;
|
|
2681
|
+
[field: string]: unknown;
|
|
2682
|
+
}>;
|
|
2683
|
+
/** credit to add to the account, in the minor unit (cents), 500 to 1000000 */
|
|
2684
|
+
funds?: number;
|
|
2685
|
+
[field: string]: unknown;
|
|
2686
|
+
};
|
|
2687
|
+
/** Result of billing.person_cart.create. */
|
|
2688
|
+
export type BillingPersonCartCreateResult = {
|
|
2689
|
+
data?: unknown;
|
|
2690
|
+
error?: unknown;
|
|
2691
|
+
[field: string]: unknown;
|
|
2692
|
+
};
|
|
2693
|
+
|
|
2244
2694
|
/** Input of billing.revenue: What every account has paid the platform (paid: the identity ledger's maintained balance of the platform party, in USD, with how many payments) and how many accounts' newest invoice is unpaid (past_due). Platform operator only */
|
|
2245
2695
|
export type BillingRevenueInput = Record<string, never>;
|
|
2246
2696
|
/** Result of billing.revenue. */
|
|
@@ -2326,7 +2776,7 @@ export type ClusterReadyResult = {
|
|
|
2326
2776
|
[field: string]: unknown;
|
|
2327
2777
|
};
|
|
2328
2778
|
|
|
2329
|
-
/** Input of cluster.version: Read the
|
|
2779
|
+
/** Input of cluster.version: Read the versions in use: the wire range this release speaks, the version chosen for the mesh (the lowest max over the members), the version the mesh has FINALIZED, the storage format, the runtime level this release carries, and every member with its range and whether its link is live */
|
|
2330
2780
|
export type ClusterVersionInput = Record<string, never>;
|
|
2331
2781
|
/** Result of cluster.version. */
|
|
2332
2782
|
export type ClusterVersionResult = {
|
|
@@ -2421,6 +2871,20 @@ export type CollectionStatsResult = {
|
|
|
2421
2871
|
[field: string]: unknown;
|
|
2422
2872
|
};
|
|
2423
2873
|
|
|
2874
|
+
/** Input of dashboard.get: Read the dashboard an app declares, the file its live version shipped (nav items and their panels, canonical), for the console to draw. The app is one of the account's own or a featured app the account has enabled; any other answers TENANT_NOT_FOUND. An app that declares none answers an empty nav. With version (a number or id), that version's dashboard instead, checked against its own routes as a push's is: what the console will draw once it goes live (an app of the account's own) */
|
|
2875
|
+
export type DashboardGetInput = {
|
|
2876
|
+
id: number;
|
|
2877
|
+
slug: string;
|
|
2878
|
+
/** the dashboard of this version instead of the live one, by number or id (64 hex digits), checked against that version's own routes as version.check checks a push's; an app of the caller's own account only */
|
|
2879
|
+
version?: string;
|
|
2880
|
+
};
|
|
2881
|
+
/** Result of dashboard.get. */
|
|
2882
|
+
export type DashboardGetResult = {
|
|
2883
|
+
/** the console's nav items in order, each {id, title, icon, panels, role?, params?}; empty when the app declares no dashboard */
|
|
2884
|
+
nav: Array<Record<string, unknown>>;
|
|
2885
|
+
[field: string]: unknown;
|
|
2886
|
+
};
|
|
2887
|
+
|
|
2424
2888
|
/** Input of data.delete: Delete one record by its _id; 404 when it does not exist, 403 when the key may not delete it */
|
|
2425
2889
|
export type DataDeleteInput = {
|
|
2426
2890
|
/** The collection's name, as collection.list names it */
|
|
@@ -2655,6 +3119,33 @@ export type DocumentationAgentGuideResult = {
|
|
|
2655
3119
|
[field: string]: unknown;
|
|
2656
3120
|
};
|
|
2657
3121
|
|
|
3122
|
+
/** Input of documentation.brief: Start here, in at most 3 KB. Answers the app, what this key is, the live version number, the goals an app is built for (website, api, database, auth, events: each with its summary, its skill and the tools it needs), the build loop's tools in order, and how to reach every other tool. Takes no input; substrio_tools {area: <goal>} answers a goal's full definitions, substrio_start every area's tools */
|
|
3123
|
+
export type DocumentationBriefInput = Record<string, never>;
|
|
3124
|
+
/** Result of documentation.brief. */
|
|
3125
|
+
export type DocumentationBriefResult = {
|
|
3126
|
+
/** the app's slug */
|
|
3127
|
+
tenant: string;
|
|
3128
|
+
/** what the calling key is: system (the master key), tenant (this app's administrator key) or user */
|
|
3129
|
+
key_scope: "system" | "tenant" | "user";
|
|
3130
|
+
/** the version number live on this app (a sandbox: on this sandbox); null when none was made live */
|
|
3131
|
+
live_version: number | null;
|
|
3132
|
+
/** what an app is built for; substrio_tools {area: <goal name>} answers a goal's full tool definitions */
|
|
3133
|
+
goals: Array<{
|
|
3134
|
+
name: string;
|
|
3135
|
+
summary: string;
|
|
3136
|
+
/** the skill that teaches it: substrio_skill {name} */
|
|
3137
|
+
skill: string;
|
|
3138
|
+
/** the MCP tools it needs beyond the loop's */
|
|
3139
|
+
tools: string[];
|
|
3140
|
+
[field: string]: unknown;
|
|
3141
|
+
}>;
|
|
3142
|
+
/** the build loop in order, by MCP tool name */
|
|
3143
|
+
next_steps: string[];
|
|
3144
|
+
/** how to reach every other tool and the full guide */
|
|
3145
|
+
more: string;
|
|
3146
|
+
[field: string]: unknown;
|
|
3147
|
+
};
|
|
3148
|
+
|
|
2658
3149
|
/** Input of documentation.capabilities: Describe typed capabilities */
|
|
2659
3150
|
export type DocumentationCapabilitiesInput = Record<string, never>;
|
|
2660
3151
|
/** Result of documentation.capabilities. */
|
|
@@ -2754,7 +3245,7 @@ export type DocumentationStartInput = Record<string, never>;
|
|
|
2754
3245
|
export type DocumentationStartResult = {
|
|
2755
3246
|
/** the app's slug */
|
|
2756
3247
|
tenant: string;
|
|
2757
|
-
/** what the calling key is: system (the
|
|
3248
|
+
/** what the calling key is: system (the master key), tenant (this app's administrator key) or user */
|
|
2758
3249
|
key_scope: "system" | "tenant" | "user";
|
|
2759
3250
|
/** the version number live on this app (a sandbox: on this sandbox); null when none was made live */
|
|
2760
3251
|
live_version: number | null;
|
|
@@ -2858,7 +3349,7 @@ export type EnvHostRemoveInput = {
|
|
|
2858
3349
|
/** Result of env.host.remove. */
|
|
2859
3350
|
export type EnvHostRemoveResult = void;
|
|
2860
3351
|
|
|
2861
|
-
/** Input of env.host.set: Bind a host of the app's choosing, <label>.<root> under an enabled root domain (my-app-v2.substrio.com), to one of its environments: live, or a sandbox (with version, a new sandbox running that version). The host answers exactly what that environment runs, with its data. A label has one owner across the platform: HOST_TAKEN when another app holds it, HOST_RESERVED for
|
|
3352
|
+
/** Input of env.host.set: Bind a host of the app's choosing, <label>.<root> under an enabled root domain (my-app-v2.substrio.com), to one of its environments: live, or a sandbox (with version, a new sandbox running that version). The host answers exactly what that environment runs, with its data. A label has one owner across the platform: HOST_TAKEN when another app holds it, HOST_RESERVED for a reserved name or an app host, HOST_INVALID (with suggestion) for a label that is not a hostname label, ROOT_DOMAIN_UNKNOWN or ROOT_DOMAIN_DISABLED for the root. Binding a host the app holds again moves it. version.live.set with from: <host> pushes what it runs live */
|
|
2862
3353
|
export type EnvHostSetInput = {
|
|
2863
3354
|
/** <label>.<root>: one DNS label (lowercase letters, digits, inner hyphens, 1 to 63) under a root domain env.host.list names, such as my-app-v2.substrio.com */
|
|
2864
3355
|
host: string;
|
|
@@ -2881,7 +3372,7 @@ export type EnvHostSetResult = {
|
|
|
2881
3372
|
[field: string]: unknown;
|
|
2882
3373
|
};
|
|
2883
3374
|
|
|
2884
|
-
/** Input of featured.disable:
|
|
3375
|
+
/** Input of featured.disable: Deprecated: every account has every jet, always on, so it is refused FEATURED_ALWAYS_ON. A key stops with account.key.revoke; an app's keys go with the app */
|
|
2885
3376
|
export type FeaturedDisableInput = {
|
|
2886
3377
|
id: number;
|
|
2887
3378
|
/** the featured app's slug (featured.list names it app) */
|
|
@@ -2894,7 +3385,7 @@ export type FeaturedDisableResult = {
|
|
|
2894
3385
|
[field: string]: unknown;
|
|
2895
3386
|
};
|
|
2896
3387
|
|
|
2897
|
-
/** Input of featured.enable:
|
|
3388
|
+
/** Input of featured.enable: Deprecated: every account has every jet, always on. Answers the jet's entry as featured.list writes it and changes nothing */
|
|
2898
3389
|
export type FeaturedEnableInput = {
|
|
2899
3390
|
id: number;
|
|
2900
3391
|
/** the featured app's slug (featured.list names it app) */
|
|
@@ -2907,7 +3398,7 @@ export type FeaturedEnableResult = {
|
|
|
2907
3398
|
[field: string]: unknown;
|
|
2908
3399
|
};
|
|
2909
3400
|
|
|
2910
|
-
/** Input of featured.key.create:
|
|
3401
|
+
/** Input of featured.key.create: Deprecated: a jet key belongs to one of the account's apps, so it is refused JET_KEY_NEEDS_APP; jet.key.create makes it */
|
|
2911
3402
|
export type FeaturedKeyCreateInput = {
|
|
2912
3403
|
id: number;
|
|
2913
3404
|
/** the featured app the key is scoped to; the account must have it enabled */
|
|
@@ -2927,7 +3418,7 @@ export type FeaturedKeyCreateResult = {
|
|
|
2927
3418
|
[field: string]: unknown;
|
|
2928
3419
|
};
|
|
2929
3420
|
|
|
2930
|
-
/** Input of featured.list: List the featured apps (the jets: MapJet, SendJet, AuthJet and every later one)
|
|
3421
|
+
/** Input of featured.list: List the featured apps (the jets: MapJet, SendJet, AuthJet and every later one) for the account: what each does, the plan it is metered against and the account's use this day and month (every app of the account summed) against that plan's limits. Every account has every jet: there is nothing to enable */
|
|
2931
3422
|
export type FeaturedListInput = {
|
|
2932
3423
|
id: number;
|
|
2933
3424
|
};
|
|
@@ -2938,7 +3429,7 @@ export type FeaturedListResult = {
|
|
|
2938
3429
|
[field: string]: unknown;
|
|
2939
3430
|
};
|
|
2940
3431
|
|
|
2941
|
-
/** Input of featured.set: Feature an app for every account, or stop featuring it (platform admin). It must be open to other accounts' keys and its plans file must have a featured block (title, summary, admin).
|
|
3432
|
+
/** Input of featured.set: Feature an app for every account, or stop featuring it (platform admin). It must be open to other accounts' keys and its plans file must have a featured block (title, summary, admin). An account on a plan there keeps it when it stops being featured */
|
|
2942
3433
|
export type FeaturedSetInput = {
|
|
2943
3434
|
jet: string;
|
|
2944
3435
|
/** true lists the app for every account; it must be open to other accounts' keys and its plans file must have a featured block */
|
|
@@ -2952,6 +3443,27 @@ export type FeaturedSetResult = {
|
|
|
2952
3443
|
[field: string]: unknown;
|
|
2953
3444
|
};
|
|
2954
3445
|
|
|
3446
|
+
/** Input of file.adopt: Platform operator only: store a file that is already on this server's own disk (under the server's --adopt-dir) at a path of the app the request names, with 0 bytes written: hashed in one read, then renamed in. Answers what file.upload answers */
|
|
3447
|
+
export type FileAdoptInput = {
|
|
3448
|
+
/** Where to store the file, as file.upload takes it */
|
|
3449
|
+
path: string;
|
|
3450
|
+
/** The file on the server's disk, named relative to the directory the server was started with as --adopt-dir (for example tiles/planet.pmtiles); no symlink, no .. past it. It is renamed into the store: its name is gone afterwards */
|
|
3451
|
+
source: string;
|
|
3452
|
+
/** Its MIME type; the one its path's extension gives when absent */
|
|
3453
|
+
content_type?: string;
|
|
3454
|
+
/** Its Cache-Control response header when served */
|
|
3455
|
+
cache_control?: string;
|
|
3456
|
+
/** true serves it without authentication */
|
|
3457
|
+
public?: boolean;
|
|
3458
|
+
[field: string]: unknown;
|
|
3459
|
+
};
|
|
3460
|
+
/** Result of file.adopt. */
|
|
3461
|
+
export type FileAdoptResult = {
|
|
3462
|
+
data?: unknown;
|
|
3463
|
+
error?: unknown;
|
|
3464
|
+
[field: string]: unknown;
|
|
3465
|
+
};
|
|
3466
|
+
|
|
2955
3467
|
/** Input of file.delete: Delete one stored file by its path (the route's tail, as file.list shows it) */
|
|
2956
3468
|
export type FileDeleteInput = {
|
|
2957
3469
|
/** The file's path, as file.list or file.upload returned it */
|
|
@@ -2991,6 +3503,34 @@ export type FileListResult = {
|
|
|
2991
3503
|
[field: string]: unknown;
|
|
2992
3504
|
};
|
|
2993
3505
|
|
|
3506
|
+
/** Input of file.move: Rename a stored file's path from one path to another, its content never copied. Refused with FILE_EXISTS when a file is at to, unless replace is true; FILE_NOT_FOUND when none is at from. Answers the file at its new path, as file.upload answers */
|
|
3507
|
+
export type FileMoveInput = {
|
|
3508
|
+
/** The file's path now */
|
|
3509
|
+
from: string;
|
|
3510
|
+
/** Its new path, as file.upload takes one */
|
|
3511
|
+
to: string;
|
|
3512
|
+
/** true replaces a file already at to; false refuses it with FILE_EXISTS */
|
|
3513
|
+
replace?: boolean;
|
|
3514
|
+
[field: string]: unknown;
|
|
3515
|
+
};
|
|
3516
|
+
/** Result of file.move. */
|
|
3517
|
+
export type FileMoveResult = {
|
|
3518
|
+
data?: unknown;
|
|
3519
|
+
error?: unknown;
|
|
3520
|
+
[field: string]: unknown;
|
|
3521
|
+
};
|
|
3522
|
+
|
|
3523
|
+
/** Input of file.public.get: Read a stored file marked public, with no key, on the app's own hosts; a private or missing path is the same 404 */
|
|
3524
|
+
export type FilePublicGetInput = {
|
|
3525
|
+
path: string;
|
|
3526
|
+
};
|
|
3527
|
+
/** Result of file.public.get. */
|
|
3528
|
+
export type FilePublicGetResult = {
|
|
3529
|
+
data?: unknown;
|
|
3530
|
+
error?: unknown;
|
|
3531
|
+
[field: string]: unknown;
|
|
3532
|
+
};
|
|
3533
|
+
|
|
2994
3534
|
/** Input of file.site_root.get: Read the tenant site's index page (the app named by Host or X-Substrio-Tenant) */
|
|
2995
3535
|
export type FileSiteRootGetInput = Record<string, never>;
|
|
2996
3536
|
/** Result of file.site_root.get. */
|
|
@@ -3011,6 +3551,25 @@ export type FileStaticAssetGetResult = {
|
|
|
3011
3551
|
[field: string]: unknown;
|
|
3012
3552
|
};
|
|
3013
3553
|
|
|
3554
|
+
/** Input of file.update: Change a stored file's settings (public, content_type, cache_control) by its path, with no byte of it sent again: its bytes and hash are untouched and an absent setting keeps its value. Answers what file.upload answers; FILE_NOT_FOUND when no file is at the path */
|
|
3555
|
+
export type FileUpdateInput = {
|
|
3556
|
+
/** The file's path, as file.list or file.upload returned it */
|
|
3557
|
+
path: string;
|
|
3558
|
+
/** true serves it with no key at /_files/<path> on the app's own hosts; false takes that away */
|
|
3559
|
+
public?: boolean;
|
|
3560
|
+
/** Its MIME type; empty or application/octet-stream is the type its path's extension gives */
|
|
3561
|
+
content_type?: string;
|
|
3562
|
+
/** Its Cache-Control response header when served; empty clears it (no-cache is sent) */
|
|
3563
|
+
cache_control?: string;
|
|
3564
|
+
[field: string]: unknown;
|
|
3565
|
+
};
|
|
3566
|
+
/** Result of file.update. */
|
|
3567
|
+
export type FileUpdateResult = {
|
|
3568
|
+
data?: unknown;
|
|
3569
|
+
error?: unknown;
|
|
3570
|
+
[field: string]: unknown;
|
|
3571
|
+
};
|
|
3572
|
+
|
|
3014
3573
|
/** Input of file.upload: Upload a file into the app's file storage at its path; see the schema for the body. Answers its path, which file.download and file.delete take */
|
|
3015
3574
|
export type FileUploadInput = {
|
|
3016
3575
|
/** Where to store the file, for example docs/report.pdf; no leading or trailing /, no empty, . or .. segment */
|
|
@@ -3051,8 +3610,10 @@ export type FunctionCatalogResult = {
|
|
|
3051
3610
|
export type FunctionCheckInput = {
|
|
3052
3611
|
/** The function's name: letters, digits, - _ and . (required by function.deploy; function.update takes it from the path; function.check names it in its diagnostics) */
|
|
3053
3612
|
name?: string;
|
|
3054
|
-
/**
|
|
3055
|
-
script
|
|
3613
|
+
/** A JavaScript function's whole source (this or rust, one of the two): a script, CommonJS or ES module. It must compile to a handler (module.exports = async function (event) {...} or export default { fetch }) */
|
|
3614
|
+
script?: string;
|
|
3615
|
+
/** A Rust function's whole source (this or script, one of the two): one file using the substrio_wasm crate, ending in substrio_wasm::export!(fetch) (docs/runtime/wasm-functions.md). The server compiles it; nothing is built by the caller. Source that does not compile is refused with rustc's own diagnostics (RUST_COMPILE_FAILED) */
|
|
3616
|
+
rust?: string;
|
|
3056
3617
|
/** The entry file name (default index.js) */
|
|
3057
3618
|
main?: string;
|
|
3058
3619
|
/** HTTP routes the function answers: [METHOD ]/path, METHOD one of GET POST PUT PATCH DELETE ANY, :name for a parameter segment, a last * segment for any remainder */
|
|
@@ -3118,12 +3679,14 @@ export type FunctionDeleteResult = {
|
|
|
3118
3679
|
[field: string]: unknown;
|
|
3119
3680
|
};
|
|
3120
3681
|
|
|
3121
|
-
/** Input of function.deploy: Deploy one function now, outside a version: body name and
|
|
3682
|
+
/** Input of function.deploy: Deploy one function now, outside a version: body name and its source (required): script for JavaScript, or rust for a Rust function's source, which the server compiles; optional main, routes (like 'GET /orders/:id' or 'ANY /hooks/*'), vars, bindings and deploy_nodes. The source is compiled to a handler first; a source that does not compile, or that calls require(), is refused and nothing changes. On success it is live at once and the answer is the function's metadata (id, content_hash, routes, env_vars, bindings). To ship several functions together, or to try them first, use version.create, sandbox.create and version.live.set; function.check shows the problems without writing */
|
|
3122
3683
|
export type FunctionDeployInput = {
|
|
3123
3684
|
/** The function's name: letters, digits, - _ and . (required by function.deploy; function.update takes it from the path; function.check names it in its diagnostics) */
|
|
3124
3685
|
name?: string;
|
|
3125
|
-
/**
|
|
3126
|
-
script
|
|
3686
|
+
/** A JavaScript function's whole source (this or rust, one of the two): a script, CommonJS or ES module. It must compile to a handler (module.exports = async function (event) {...} or export default { fetch }) */
|
|
3687
|
+
script?: string;
|
|
3688
|
+
/** A Rust function's whole source (this or script, one of the two): one file using the substrio_wasm crate, ending in substrio_wasm::export!(fetch) (docs/runtime/wasm-functions.md). The server compiles it; nothing is built by the caller. Source that does not compile is refused with rustc's own diagnostics (RUST_COMPILE_FAILED) */
|
|
3689
|
+
rust?: string;
|
|
3127
3690
|
/** The entry file name (default index.js) */
|
|
3128
3691
|
main?: string;
|
|
3129
3692
|
/** HTTP routes the function answers: [METHOD ]/path, METHOD one of GET POST PUT PATCH DELETE ANY, :name for a parameter segment, a last * segment for any remainder */
|
|
@@ -3244,7 +3807,7 @@ export type FunctionErrorsResult = {
|
|
|
3244
3807
|
[field: string]: unknown;
|
|
3245
3808
|
};
|
|
3246
3809
|
|
|
3247
|
-
/** Input of function.eval: Run a Lua script against the tenant's default key-value store, Redis style
|
|
3810
|
+
/** Input of function.eval: Run a Lua script against the tenant's default key-value store, Redis style, in a build with the Redis frontend (not in this release, where the Redis frontend is a build switch, off, and the call answers NOT_IMPLEMENTED). Body script (or sha of a script loaded earlier with load:true, which answers {sha}), keys and args as arrays of strings. Answers {result}. This is Lua over key-value data, not JavaScript: to run JavaScript use function.invoke, route.call or function.execute_inline */
|
|
3248
3811
|
export type FunctionEvalInput = {
|
|
3249
3812
|
/** The Lua source to run */
|
|
3250
3813
|
script?: string;
|
|
@@ -3421,7 +3984,7 @@ export type FunctionPatchApprovalRevokeResult = {
|
|
|
3421
3984
|
[field: string]: unknown;
|
|
3422
3985
|
};
|
|
3423
3986
|
|
|
3424
|
-
/** Input of function.source.edit: Replace one byte range or one exclusive line range of a function's source: body replacement, an approval_token from function.source.preview (required: preview the patch first), the range, and expected_hash (defaults to the current content_hash; a source that changed since is refused with 409). The edited source is compiled before it is stored */
|
|
3987
|
+
/** Input of function.source.edit: Replace one byte range or one exclusive line range of a function's source: body replacement, an approval_token from function.source.preview (required: preview the patch first), the range, and expected_hash (defaults to the current content_hash; a source that changed since is refused with 409). The edited source is compiled before it is stored, JavaScript or Rust (a Rust edit that does not compile is RUST_COMPILE_FAILED with rustc's diagnostics, and the function keeps serving its last source) */
|
|
3425
3988
|
export type FunctionSourceEditInput = {
|
|
3426
3989
|
/** The function's name, as function.list names it */
|
|
3427
3990
|
name: string;
|
|
@@ -3482,11 +4045,14 @@ export type FunctionSourceReadResult = {
|
|
|
3482
4045
|
[field: string]: unknown;
|
|
3483
4046
|
};
|
|
3484
4047
|
|
|
3485
|
-
/** Input of function.source.replace: Replace one function's whole source with a compare-and-swap: body script (required, compiled before it is stored), optional expected_hash (the content_hash you last read; it defaults to the current one, and a source that changed since is refused with a conflict), main, routes, vars, bindings and deploy_nodes. Fields left out keep their values; an empty array clears. The function must exist (404). Answers the function's metadata */
|
|
4048
|
+
/** Input of function.source.replace: Replace one function's whole source with a compare-and-swap: body script for a JavaScript function or rust for a Rust one (required, compiled before it is stored; a replace keeps the function's language), optional expected_hash (the content_hash you last read; it defaults to the current one, and a source that changed since is refused with a conflict), main, routes, vars, bindings and deploy_nodes. Fields left out keep their values; an empty array clears. The function must exist (404). Answers the function's metadata */
|
|
3486
4049
|
export type FunctionSourceReplaceInput = {
|
|
3487
4050
|
/** The function's name, as function.list names it */
|
|
3488
4051
|
name: string;
|
|
3489
|
-
|
|
4052
|
+
/** A JavaScript function's whole new source */
|
|
4053
|
+
script?: string;
|
|
4054
|
+
/** A Rust function's whole new source, compiled by the server */
|
|
4055
|
+
rust?: string;
|
|
3490
4056
|
expected_hash?: string;
|
|
3491
4057
|
main?: string;
|
|
3492
4058
|
routes?: string[];
|
|
@@ -3569,12 +4135,14 @@ export type FunctionToggleResult = {
|
|
|
3569
4135
|
[field: string]: unknown;
|
|
3570
4136
|
};
|
|
3571
4137
|
|
|
3572
|
-
/** Input of function.update: Replace one function's source: PATCH with the body function.deploy takes (script is required); the name comes from the path and a name in the body is ignored. A source that does not compile to a handler is refused with 400 and nothing changes. On success it is live at once and the answer is the function's metadata. For a change to part of the source use function.source.edit */
|
|
4138
|
+
/** Input of function.update: Replace one function's source: PATCH with the body function.deploy takes (script or rust is required); the name comes from the path and a name in the body is ignored. A source that does not compile to a handler is refused with 400 and nothing changes. On success it is live at once and the answer is the function's metadata. For a change to part of the source use function.source.edit */
|
|
3573
4139
|
export type FunctionUpdateInput = {
|
|
3574
4140
|
/** The function's name: letters, digits, - _ and . (required by function.deploy; function.update takes it from the path; function.check names it in its diagnostics) */
|
|
3575
4141
|
name: string;
|
|
3576
|
-
/**
|
|
3577
|
-
script
|
|
4142
|
+
/** A JavaScript function's whole source (this or rust, one of the two): a script, CommonJS or ES module. It must compile to a handler (module.exports = async function (event) {...} or export default { fetch }) */
|
|
4143
|
+
script?: string;
|
|
4144
|
+
/** A Rust function's whole source (this or script, one of the two): one file using the substrio_wasm crate, ending in substrio_wasm::export!(fetch) (docs/runtime/wasm-functions.md). The server compiles it; nothing is built by the caller. Source that does not compile is refused with rustc's own diagnostics (RUST_COMPILE_FAILED) */
|
|
4145
|
+
rust?: string;
|
|
3578
4146
|
/** The entry file name (default index.js) */
|
|
3579
4147
|
main?: string;
|
|
3580
4148
|
/** HTTP routes the function answers: [METHOD ]/path, METHOD one of GET POST PUT PATCH DELETE ANY, :name for a parameter segment, a last * segment for any remainder */
|
|
@@ -3812,6 +4380,12 @@ export type HostAddResult = {
|
|
|
3812
4380
|
cores: number;
|
|
3813
4381
|
capabilities: Array<"own_kernel" | "systemd" | "zram_module" | "zram_active">;
|
|
3814
4382
|
labels: string[];
|
|
4383
|
+
/** the region the host serves, an id from region.list; 0: none */
|
|
4384
|
+
region?: number;
|
|
4385
|
+
/** the instruction-set features host.probe found, comma separated; empty: never probed */
|
|
4386
|
+
cpu_features?: string;
|
|
4387
|
+
/** the nodes installed on the host */
|
|
4388
|
+
nodes?: number;
|
|
3815
4389
|
[field: string]: unknown;
|
|
3816
4390
|
};
|
|
3817
4391
|
|
|
@@ -3852,6 +4426,12 @@ export type HostBootstrapResult = {
|
|
|
3852
4426
|
cores: number;
|
|
3853
4427
|
capabilities: Array<"own_kernel" | "systemd" | "zram_module" | "zram_active">;
|
|
3854
4428
|
labels: string[];
|
|
4429
|
+
/** the region the host serves, an id from region.list; 0: none */
|
|
4430
|
+
region?: number;
|
|
4431
|
+
/** the instruction-set features host.probe found, comma separated; empty: never probed */
|
|
4432
|
+
cpu_features?: string;
|
|
4433
|
+
/** the nodes installed on the host */
|
|
4434
|
+
nodes?: number;
|
|
3855
4435
|
[field: string]: unknown;
|
|
3856
4436
|
};
|
|
3857
4437
|
|
|
@@ -3892,6 +4472,12 @@ export type HostGetResult = {
|
|
|
3892
4472
|
cores: number;
|
|
3893
4473
|
capabilities: Array<"own_kernel" | "systemd" | "zram_module" | "zram_active">;
|
|
3894
4474
|
labels: string[];
|
|
4475
|
+
/** the region the host serves, an id from region.list; 0: none */
|
|
4476
|
+
region?: number;
|
|
4477
|
+
/** the instruction-set features host.probe found, comma separated; empty: never probed */
|
|
4478
|
+
cpu_features?: string;
|
|
4479
|
+
/** the nodes installed on the host */
|
|
4480
|
+
nodes?: number;
|
|
3895
4481
|
[field: string]: unknown;
|
|
3896
4482
|
};
|
|
3897
4483
|
|
|
@@ -3931,11 +4517,68 @@ export type HostListResult = {
|
|
|
3931
4517
|
cores: number;
|
|
3932
4518
|
capabilities: Array<"own_kernel" | "systemd" | "zram_module" | "zram_active">;
|
|
3933
4519
|
labels: string[];
|
|
4520
|
+
/** the region the host serves, an id from region.list; 0: none */
|
|
4521
|
+
region?: number;
|
|
4522
|
+
/** the instruction-set features host.probe found, comma separated; empty: never probed */
|
|
4523
|
+
cpu_features?: string;
|
|
4524
|
+
/** the nodes installed on the host */
|
|
4525
|
+
nodes?: number;
|
|
3934
4526
|
[field: string]: unknown;
|
|
3935
4527
|
}>;
|
|
3936
4528
|
[field: string]: unknown;
|
|
3937
4529
|
};
|
|
3938
4530
|
|
|
4531
|
+
/** Input of host.node.deploy: Install a packed release on a host as a node (a new slot) or onto an existing node (its slot): the release streams over the host's SSH into the release's own installer, which preflights, installs the unit, health checks and rolls back. Refused before anything is copied with HOST_NOT_PROBED, HOST_NO_SYSTEMD, HOST_NGINX_PRESENT, RELEASE_NOT_FOUND, RELEASE_NOT_PACKED, RELEASE_ISA_UNKNOWN, HOST_CPU_MISSING (the detail names the features), HOST_NODE_LIMIT or NODE_BUSY. Answers 202 with the node as it stands; host.node.list then answers running, failed or rolled_back */
|
|
4532
|
+
export type HostNodeDeployInput = {
|
|
4533
|
+
id: number;
|
|
4534
|
+
/** A release release.list names that the master holds packed (its .tar.zst and .sha256 beside the folder) */
|
|
4535
|
+
release: string;
|
|
4536
|
+
/** 0 (the default) installs a new node on the lowest free slot; another number deploys a new release onto that node */
|
|
4537
|
+
slot?: number;
|
|
4538
|
+
[field: string]: unknown;
|
|
4539
|
+
};
|
|
4540
|
+
/** Result of host.node.deploy. */
|
|
4541
|
+
export type HostNodeDeployResult = {
|
|
4542
|
+
slot: number;
|
|
4543
|
+
port: number;
|
|
4544
|
+
state: "deploying" | "running" | "failed" | "rolled_back" | "undeploying";
|
|
4545
|
+
/** the release last asked of the node */
|
|
4546
|
+
release: string;
|
|
4547
|
+
deployed_at: number;
|
|
4548
|
+
};
|
|
4549
|
+
|
|
4550
|
+
/** Input of host.node.list: List the nodes installed on a host in slot order, each with its slot, port, state (deploying, running, failed, rolled_back, undeploying), the release last asked of it and when. A run that stays deploying for 30 minutes reads failed */
|
|
4551
|
+
export type HostNodeListInput = {
|
|
4552
|
+
id: number;
|
|
4553
|
+
};
|
|
4554
|
+
/** Result of host.node.list. */
|
|
4555
|
+
export type HostNodeListResult = {
|
|
4556
|
+
nodes: Array<{
|
|
4557
|
+
slot: number;
|
|
4558
|
+
port: number;
|
|
4559
|
+
state: "deploying" | "running" | "failed" | "rolled_back" | "undeploying";
|
|
4560
|
+
/** the release last asked of the node */
|
|
4561
|
+
release: string;
|
|
4562
|
+
deployed_at: number;
|
|
4563
|
+
}>;
|
|
4564
|
+
[field: string]: unknown;
|
|
4565
|
+
};
|
|
4566
|
+
|
|
4567
|
+
/** Input of host.node.undeploy: Stop and remove a node's service and unit on a host; its data folder stays. Refused with HOST_HAS_APPS for the last node of a host while apps are placed on it and NODE_BUSY while its run is under way. Answers 202 with the node as it stands */
|
|
4568
|
+
export type HostNodeUndeployInput = {
|
|
4569
|
+
id: number;
|
|
4570
|
+
slot: number;
|
|
4571
|
+
};
|
|
4572
|
+
/** Result of host.node.undeploy. */
|
|
4573
|
+
export type HostNodeUndeployResult = {
|
|
4574
|
+
slot: number;
|
|
4575
|
+
port: number;
|
|
4576
|
+
state: "deploying" | "running" | "failed" | "rolled_back" | "undeploying";
|
|
4577
|
+
/** the release last asked of the node */
|
|
4578
|
+
release: string;
|
|
4579
|
+
deployed_at: number;
|
|
4580
|
+
};
|
|
4581
|
+
|
|
3939
4582
|
/** Input of host.probe: Probe a host over its orchestrator's SSH, read only: whether it runs its own kernel (bare metal, kvm, another VM) or shares one (openvz, lxc, another container), systemd, the zram module, and zram swap active with zstd. Answers 202 with the host as it stands; the run lands on the host record in one transaction, and host.get answers virt, capabilities, probe (ok, unreachable, failed) and probed_at */
|
|
3940
4583
|
export type HostProbeInput = {
|
|
3941
4584
|
id: number;
|
|
@@ -3973,6 +4616,12 @@ export type HostProbeResult = {
|
|
|
3973
4616
|
cores: number;
|
|
3974
4617
|
capabilities: Array<"own_kernel" | "systemd" | "zram_module" | "zram_active">;
|
|
3975
4618
|
labels: string[];
|
|
4619
|
+
/** the region the host serves, an id from region.list; 0: none */
|
|
4620
|
+
region?: number;
|
|
4621
|
+
/** the instruction-set features host.probe found, comma separated; empty: never probed */
|
|
4622
|
+
cpu_features?: string;
|
|
4623
|
+
/** the nodes installed on the host */
|
|
4624
|
+
nodes?: number;
|
|
3976
4625
|
[field: string]: unknown;
|
|
3977
4626
|
};
|
|
3978
4627
|
|
|
@@ -4010,6 +4659,8 @@ export type HostTenantsResult = {
|
|
|
4010
4659
|
/** Input of host.update: Change a host: its state (available, draining, offline), address, SSH port and user, location, group settings or labels; a field left out keeps its value. An ssh_key rotates the key: the new one is sealed and the old one gone */
|
|
4011
4660
|
export type HostUpdateInput = {
|
|
4012
4661
|
id: number;
|
|
4662
|
+
/** The region the host serves, by id (region.list); 0 serves none. A region still named by a host cannot be removed */
|
|
4663
|
+
region?: number;
|
|
4013
4664
|
/** The host's DNS name or IP address, as its orchestrator reaches it */
|
|
4014
4665
|
address?: string;
|
|
4015
4666
|
/** Default 22 */
|
|
@@ -4073,6 +4724,12 @@ export type HostUpdateResult = {
|
|
|
4073
4724
|
cores: number;
|
|
4074
4725
|
capabilities: Array<"own_kernel" | "systemd" | "zram_module" | "zram_active">;
|
|
4075
4726
|
labels: string[];
|
|
4727
|
+
/** the region the host serves, an id from region.list; 0: none */
|
|
4728
|
+
region?: number;
|
|
4729
|
+
/** the instruction-set features host.probe found, comma separated; empty: never probed */
|
|
4730
|
+
cpu_features?: string;
|
|
4731
|
+
/** the nodes installed on the host */
|
|
4732
|
+
nodes?: number;
|
|
4076
4733
|
[field: string]: unknown;
|
|
4077
4734
|
};
|
|
4078
4735
|
|
|
@@ -4287,6 +4944,43 @@ export type IndexListResult = {
|
|
|
4287
4944
|
[field: string]: unknown;
|
|
4288
4945
|
};
|
|
4289
4946
|
|
|
4947
|
+
/** Input of jet.key.create: Make a key of one of the account's apps scoped to one jet; the secret is returned once. The jet sees each call as that app (request.auth.app) and meters it to the account's plan, the app's own use counted beside; removing the app revokes the key. With origins the key is publishable (safe in a page's source, answering only those origins). An unscoped account key may make one; a scoped key may not */
|
|
4948
|
+
export type JetKeyCreateInput = {
|
|
4949
|
+
id: number;
|
|
4950
|
+
/** the account's app the key belongs to: the jet sees it as request.auth.app, and removing the app revokes the key */
|
|
4951
|
+
slug: string;
|
|
4952
|
+
/** the featured app (jet) the key is scoped to (jet.list and featured.list name each as app) */
|
|
4953
|
+
jet: string;
|
|
4954
|
+
name: string;
|
|
4955
|
+
mode?: "live" | "test";
|
|
4956
|
+
/** makes the key publishable: it answers only a request from one of these origins (https://host[:port]), so it is safe in a page's source */
|
|
4957
|
+
origins?: string[];
|
|
4958
|
+
/** the key's own request limit; 0 or absent: no limit of its own */
|
|
4959
|
+
requests_per_minute?: number;
|
|
4960
|
+
/** the key's own lifetime request budget; 0 or absent: none */
|
|
4961
|
+
request_budget?: number;
|
|
4962
|
+
[field: string]: unknown;
|
|
4963
|
+
};
|
|
4964
|
+
/** Result of jet.key.create. */
|
|
4965
|
+
export type JetKeyCreateResult = {
|
|
4966
|
+
data?: unknown;
|
|
4967
|
+
error?: unknown;
|
|
4968
|
+
[field: string]: unknown;
|
|
4969
|
+
};
|
|
4970
|
+
|
|
4971
|
+
/** Input of jet.list: List the jets of one of the account's apps: each jet's menu in the app's dashboard (app_nav: its pages, each a list, form or detail over the jet's own routes), the account's plan and use there (every app summed: the limit is the account's) and this app's own use this day and month */
|
|
4972
|
+
export type JetListInput = {
|
|
4973
|
+
id: number;
|
|
4974
|
+
/** one of the account's apps: the jets it has, each with its menu, the account's plan and use and this app's own use */
|
|
4975
|
+
slug: string;
|
|
4976
|
+
};
|
|
4977
|
+
/** Result of jet.list. */
|
|
4978
|
+
export type JetListResult = {
|
|
4979
|
+
data?: unknown;
|
|
4980
|
+
error?: unknown;
|
|
4981
|
+
[field: string]: unknown;
|
|
4982
|
+
};
|
|
4983
|
+
|
|
4290
4984
|
/** Input of job.cancel: Cancel one running background job by id: answers the job; 404 when no such job, and refused when it already ended */
|
|
4291
4985
|
export type JobCancelInput = {
|
|
4292
4986
|
id: string;
|
|
@@ -4941,6 +5635,18 @@ export type McpToolSetInput = {
|
|
|
4941
5635
|
outputSchema?: Record<string, unknown>;
|
|
4942
5636
|
/** MCP tool annotations (readOnlyHint, destructiveHint, ...) */
|
|
4943
5637
|
annotations?: Record<string, unknown>;
|
|
5638
|
+
/** The tools that come after a success, each a Next line and an entry of _meta substrio/next */
|
|
5639
|
+
next?: Array<{
|
|
5640
|
+
tool: string;
|
|
5641
|
+
why: string;
|
|
5642
|
+
/** A member of this tool's result to hand on */
|
|
5643
|
+
pass?: string;
|
|
5644
|
+
/** The next tool's argument pass fills */
|
|
5645
|
+
as?: string;
|
|
5646
|
+
[field: string]: unknown;
|
|
5647
|
+
}>;
|
|
5648
|
+
/** The tool's place in the app's flow: _meta substrio/stage */
|
|
5649
|
+
stage?: string;
|
|
4944
5650
|
[field: string]: unknown;
|
|
4945
5651
|
};
|
|
4946
5652
|
/** Result of mcp.tool.set. */
|
|
@@ -5004,6 +5710,14 @@ export type McpToolsGetResult = {
|
|
|
5004
5710
|
/** Input of mcp.tools.set: Replace the app's MCP tool manifest (its own tools and instructions) with the body; see the schema. A version can carry the manifest too (version.create) */
|
|
5005
5711
|
export type McpToolsSetInput = {
|
|
5006
5712
|
instructions?: string;
|
|
5713
|
+
/** The text the first result of a person's connection opens with */
|
|
5714
|
+
welcome?: string;
|
|
5715
|
+
/** The app's function run for that welcome instead: its _mcp content and _meta lead the result */
|
|
5716
|
+
welcome_function?: string;
|
|
5717
|
+
/** The app's function whose answer ends every result of a person's call */
|
|
5718
|
+
line_function?: string;
|
|
5719
|
+
/** How long a person's line is kept before line_function runs again (60) */
|
|
5720
|
+
line_ttl_seconds?: number;
|
|
5007
5721
|
tools: Array<{
|
|
5008
5722
|
name: string;
|
|
5009
5723
|
title?: string;
|
|
@@ -5013,6 +5727,8 @@ export type McpToolsSetInput = {
|
|
|
5013
5727
|
inputSchema?: Record<string, unknown>;
|
|
5014
5728
|
outputSchema?: Record<string, unknown>;
|
|
5015
5729
|
annotations?: Record<string, unknown>;
|
|
5730
|
+
next?: Array<Record<string, unknown>>;
|
|
5731
|
+
stage?: string;
|
|
5016
5732
|
[field: string]: unknown;
|
|
5017
5733
|
}>;
|
|
5018
5734
|
[field: string]: unknown;
|
|
@@ -5578,6 +6294,17 @@ export type PlansAccountSetResult = {
|
|
|
5578
6294
|
[field: string]: unknown;
|
|
5579
6295
|
};
|
|
5580
6296
|
|
|
6297
|
+
/** Input of plans.catalog: Read every plan sold, with no account and no person data: the Substrio plans (each with the jet plan it bundles per jet) and every featured app's (jet's) own plans, each with its limits and standalone price, each plans file as plans.get answers it. The sites build their prices from this. No key needed */
|
|
6298
|
+
export type PlansCatalogInput = Record<string, never>;
|
|
6299
|
+
/** Result of plans.catalog. */
|
|
6300
|
+
export type PlansCatalogResult = {
|
|
6301
|
+
/** the identity app's plans file as plans.get answers it: every Substrio plan, each with the jet plan it bundles per jet (apps); null when none is set */
|
|
6302
|
+
substrio: Record<string, unknown> | null;
|
|
6303
|
+
/** each featured app (jet) by slug: its plans file as plans.get answers it, every plan with its limits and standalone price */
|
|
6304
|
+
apps: Record<string, Record<string, unknown>>;
|
|
6305
|
+
[field: string]: unknown;
|
|
6306
|
+
};
|
|
6307
|
+
|
|
5581
6308
|
/** Input of plans.delete: Delete the app's plans file: every plan definition is gone and cannot be restored by this call (keep the plans.get answer to put it back with plans.set). Answers 204 with no body; accounts keep no plan and fall back to the default */
|
|
5582
6309
|
export type PlansDeleteInput = Record<string, never>;
|
|
5583
6310
|
/** Result of plans.delete. */
|
|
@@ -5619,7 +6346,7 @@ export type PlansSetResult = {
|
|
|
5619
6346
|
[field: string]: unknown;
|
|
5620
6347
|
};
|
|
5621
6348
|
|
|
5622
|
-
/** Input of platform.audit.list: Read the
|
|
6349
|
+
/** Input of platform.audit.list: Read the server-wide audit trail (tenant create, update and delete, platform settings, shared providers, key rotations), newest first; the filters, limit and cursor of audit.list */
|
|
5623
6350
|
export type PlatformAuditListInput = {
|
|
5624
6351
|
/** asc lists oldest first; desc (the default) newest first */
|
|
5625
6352
|
order?: "asc" | "desc";
|
|
@@ -5653,7 +6380,7 @@ export type PlatformAuditListResult = {
|
|
|
5653
6380
|
[field: string]: unknown;
|
|
5654
6381
|
};
|
|
5655
6382
|
|
|
5656
|
-
/** Input of platform.counts: Read the
|
|
6383
|
+
/** Input of platform.counts: Read the account and host counts for the operator, each kept with the accounts and hosts it counts */
|
|
5657
6384
|
export type PlatformCountsInput = Record<string, never>;
|
|
5658
6385
|
/** Result of platform.counts. */
|
|
5659
6386
|
export type PlatformCountsResult = {
|
|
@@ -5688,7 +6415,7 @@ export type PlatformSettingsGetResult = {
|
|
|
5688
6415
|
[field: string]: unknown;
|
|
5689
6416
|
};
|
|
5690
6417
|
|
|
5691
|
-
/** Input of platform.usage.history: Read the
|
|
6418
|
+
/** Input of platform.usage.history: Read the KPI history of every app on this server for the operator, oldest first: one point per finished minute (step=minute, the default) or hour (step=hour), each with what every app's API requests (total, status classes 2xx to 5xx, latency buckets and percentiles) and function calls added in it, summed as each app's minute is written. since and until are Unix seconds (default: the last hour of minutes, or the last two days of hours); limit caps the points. Counted on the node that answers; platform calls (no app) are not counted */
|
|
5692
6419
|
export type PlatformUsageHistoryInput = {
|
|
5693
6420
|
/** the most items to return */
|
|
5694
6421
|
limit?: number;
|
|
@@ -6241,6 +6968,69 @@ export type RefRestoreResult = {
|
|
|
6241
6968
|
[field: string]: unknown;
|
|
6242
6969
|
};
|
|
6243
6970
|
|
|
6971
|
+
/** Input of region.choices: List the regions an app can be created in: those that are available and serving, each with its slug, public name and country. Empty until a region serves. Pass a slug as region to account.app.create to place the app there */
|
|
6972
|
+
export type RegionChoicesInput = {
|
|
6973
|
+
id: number;
|
|
6974
|
+
};
|
|
6975
|
+
/** Result of region.choices. */
|
|
6976
|
+
export type RegionChoicesResult = {
|
|
6977
|
+
regions: Array<{
|
|
6978
|
+
slug: string;
|
|
6979
|
+
name: string;
|
|
6980
|
+
country: string;
|
|
6981
|
+
}>;
|
|
6982
|
+
};
|
|
6983
|
+
|
|
6984
|
+
/** Input of region.list: List the regions in id order, each with its slug, public name, country, state (available or hidden) and whether it is serving (answers app traffic; the operator cannot set that) */
|
|
6985
|
+
export type RegionListInput = Record<string, never>;
|
|
6986
|
+
/** Result of region.list. */
|
|
6987
|
+
export type RegionListResult = {
|
|
6988
|
+
regions: Array<{
|
|
6989
|
+
id: number;
|
|
6990
|
+
slug: string;
|
|
6991
|
+
name: string;
|
|
6992
|
+
/** two upper case letters, empty when none is named */
|
|
6993
|
+
country: string;
|
|
6994
|
+
state: "available" | "hidden";
|
|
6995
|
+
/** true once the region answers app traffic; the operator cannot set it */
|
|
6996
|
+
serving: boolean;
|
|
6997
|
+
created_at: number;
|
|
6998
|
+
}>;
|
|
6999
|
+
[field: string]: unknown;
|
|
7000
|
+
};
|
|
7001
|
+
|
|
7002
|
+
/** Input of region.remove: Remove a region by slug; refused with REGION_IN_USE while a host names it. Answers 204 with no body */
|
|
7003
|
+
export type RegionRemoveInput = {
|
|
7004
|
+
slug: string;
|
|
7005
|
+
};
|
|
7006
|
+
/** Result of region.remove. */
|
|
7007
|
+
export type RegionRemoveResult = void;
|
|
7008
|
+
|
|
7009
|
+
/** Input of region.set: Create the region of this slug (the name is required) or change its name, country or state; a field left out keeps its value. A host joins a region through host.update */
|
|
7010
|
+
export type RegionSetInput = {
|
|
7011
|
+
/** The region's name on the wire (eu-central); it is the key and never changes */
|
|
7012
|
+
slug: string;
|
|
7013
|
+
/** The public name; required when the region is new */
|
|
7014
|
+
name?: string;
|
|
7015
|
+
/** ISO 3166-1 alpha-2 code */
|
|
7016
|
+
country?: string;
|
|
7017
|
+
/** hidden: not offered to anyone; a region starts available. Whether it is serving is not settable */
|
|
7018
|
+
state?: "available" | "hidden";
|
|
7019
|
+
[field: string]: unknown;
|
|
7020
|
+
};
|
|
7021
|
+
/** Result of region.set. */
|
|
7022
|
+
export type RegionSetResult = {
|
|
7023
|
+
id: number;
|
|
7024
|
+
slug: string;
|
|
7025
|
+
name: string;
|
|
7026
|
+
/** two upper case letters, empty when none is named */
|
|
7027
|
+
country: string;
|
|
7028
|
+
state: "available" | "hidden";
|
|
7029
|
+
/** true once the region answers app traffic; the operator cannot set it */
|
|
7030
|
+
serving: boolean;
|
|
7031
|
+
created_at: number;
|
|
7032
|
+
};
|
|
7033
|
+
|
|
6244
7034
|
/** Input of release.list: List this host's platform releases, newest first: every folder of <root>/releases holding the server binary (the folder's name is the commit it was built from, with the binary's size and time), which one this process runs, which one the current link names (the next restart's) and which one the previous link names (a rollback's), and restart_pending when current is not the running one. A release is switched on the host by deploy-stax.sh, which health-checks it and rolls back */
|
|
6245
7035
|
export type ReleaseListInput = Record<string, never>;
|
|
6246
7036
|
/** Result of release.list. */
|
|
@@ -6342,7 +7132,7 @@ export type RoleUpdateResult = {
|
|
|
6342
7132
|
[field: string]: unknown;
|
|
6343
7133
|
};
|
|
6344
7134
|
|
|
6345
|
-
/** Input of root_domain.add: Add a root domain (onstax.com)
|
|
7135
|
+
/** Input of root_domain.add: Add a root domain (onstax.com) that apps answer under as <slug>.<root> and their test hosts as <label>.<root>: stored before the call answers, published to the front as *.<root> and, when the platform has a DNS-01 token, its wildcard certificate requested from the configured ACME provider. Answers 201 with domain, enabled, source, hosts and added_at; KEY_EXISTS (field domain) when the platform has it, INVALID_ARGUMENT (field domain) when it is not a domain */
|
|
6346
7136
|
export type RootDomainAddInput = {
|
|
6347
7137
|
/** A root domain, two or more lowercase DNS labels joined by dots (onstax.com) */
|
|
6348
7138
|
domain: string;
|
|
@@ -6359,7 +7149,7 @@ export type RootDomainAddResult = {
|
|
|
6359
7149
|
[field: string]: unknown;
|
|
6360
7150
|
};
|
|
6361
7151
|
|
|
6362
|
-
/** Input of root_domain.list: List the
|
|
7152
|
+
/** Input of root_domain.list: List the root domains: those of substrio.conf (source config) then the ones added (source admin), each with enabled and its count of test hosts */
|
|
6363
7153
|
export type RootDomainListInput = Record<string, never>;
|
|
6364
7154
|
/** Result of root_domain.list. */
|
|
6365
7155
|
export type RootDomainListResult = {
|
|
@@ -6580,7 +7370,7 @@ export type SandboxStubListResult = {
|
|
|
6580
7370
|
[field: string]: unknown;
|
|
6581
7371
|
};
|
|
6582
7372
|
|
|
6583
|
-
/** Input of sandbox.stub.set: Stub one outbound request of a test tenant: its functions' fetch() of the given method, origin and path resolves with the stub's status, headers and body instead of going out. Only a test tenant
|
|
7373
|
+
/** Input of sandbox.stub.set: Stub one outbound request of a test tenant: its functions' fetch() of the given method, origin and path resolves with the stub's status, headers and body instead of going out. Only a test tenant takes stubs, any other is refused with TEST_TENANT_REQUIRED. The newest matching stub that is not spent answers; a fetch no stub matches is rejected. Answers {id} */
|
|
6584
7374
|
export type SandboxStubSetInput = {
|
|
6585
7375
|
/** The request method this stub answers; absent: any method */
|
|
6586
7376
|
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
|
|
@@ -6918,7 +7708,7 @@ export type SecurityAuditResult = {
|
|
|
6918
7708
|
[field: string]: unknown;
|
|
6919
7709
|
};
|
|
6920
7710
|
|
|
6921
|
-
/** Input of security.rate_limit: Manage the
|
|
7711
|
+
/** Input of security.rate_limit: Manage the per-address rate limit (the --rate-limit server option): GET shows it, POST sets max_tokens and tokens_per_second, DELETE with clear turns it off */
|
|
6922
7712
|
export type SecurityRateLimitInput = {
|
|
6923
7713
|
/** the burst each client address may make at once */
|
|
6924
7714
|
max_tokens?: number;
|
|
@@ -6993,7 +7783,7 @@ export type SettingsGetResult = {
|
|
|
6993
7783
|
[field: string]: unknown;
|
|
6994
7784
|
};
|
|
6995
7785
|
|
|
6996
|
-
/** Input of settings.set: Set one app setting: body key and value (a string, or true or false). Any key is stored; substrio reads changes.history (keep change history so change streams can resume) and webhooks.brand (the webhook signature and delivery id header names, <brand>-Signature and <brand>-Delivery-Id) and the delivery settings webhooks.max_attempts, webhooks.backoff_ms, triggers.max_attempts, triggers.backoff_ms, cron.max_attempts, cron.backoff_ms, delivery.backoff_cap_ms (milliseconds) and delivery.retain_days (days a delivered record stays replayable, 0 keeps none), each a whole number (the attempt counts at least 1), and refuses a value that does not suit them. A server-wide runtime limit (jsc.*, queue.*, objects.*) is a platform setting and is refused here with SETTING_IS_PLATFORM
|
|
7786
|
+
/** Input of settings.set: Set one app setting: body key and value (a string, or true or false). Any key is stored; substrio reads changes.history (keep change history so change streams can resume) and webhooks.brand (the webhook signature and delivery id header names, <brand>-Signature and <brand>-Delivery-Id) and the delivery settings webhooks.max_attempts, webhooks.backoff_ms, triggers.max_attempts, triggers.backoff_ms, cron.max_attempts, cron.backoff_ms, delivery.backoff_cap_ms (milliseconds) and delivery.retain_days (days a delivered record stays replayable, 0 keeps none), each a whole number (the attempt counts at least 1), and refuses a value that does not suit them. A server-wide runtime limit (jsc.*, queue.*, objects.*) is a platform setting and is refused here with SETTING_IS_PLATFORM */
|
|
6997
7787
|
export type SettingsSetInput = {
|
|
6998
7788
|
/** The setting's name; substrio reads changes.history and webhooks.brand, any other key is only stored */
|
|
6999
7789
|
key: string;
|
|
@@ -7133,6 +7923,27 @@ export type SourceSearchResult = {
|
|
|
7133
7923
|
[field: string]: unknown;
|
|
7134
7924
|
};
|
|
7135
7925
|
|
|
7926
|
+
/** Input of source.shell: Run one shell command over the app, the way you work on a checkout: no process, a POSIX shell subset interpreted in the server. Mounts: /src is the branch's tree (writable, default main, the starting directory), /site the live release's site/ (read only), /files the app's stored files (writable; rm there is refused, file.delete does it). Any other path is refused. Builtins: grep (-r -n -l -L -c -i -v -w -o -q -E -F -A -B -C -m --include --exclude), sed (-n -E -i -e, addresses N $ /re/ ranges !, s///g with \1 groups, p d q a i c y { }), find (-name -iname -path -type -maxdepth -mindepth -empty -exec {} + -delete), cat, head, tail, wc, sort, uniq, cut, tr, diff (unified), ls, cd, pwd, mv, cp, rm, mkdir, touch, echo, printf, tee, test and [ ], xargs, basename, dirname, true, false, commit -m, and js (a script in the app's own runtime with fs.readFile, writeFile, readdir, stat, exists, rm, rename, mkdir on the same mounts; input is stdin). Variables: $PWD $HOME $SRC $SITE $FILES $BRANCH $?. Every /src change of one call lands as ONE commit (message: the command, or commit -m) when the command ends with status 0; any other status, or any refusal, lands nothing. No state is kept between calls. Answers {stdout, stderr, exit_code, offset, truncated, next_offset, commit: {version, number, changed}}; output past the budget is cut with truncated:true and continued with offset. Examples: grep -rn 'TODO' /src; sed -n 10,40p src/app.js; find /src/functions -name '*.js' | xargs sed -i 's/oldName/newName/g'; cat > /src/site/about.html <<'EOF' (lines) EOF; js 'fs.writeFile("notes.txt", input.toUpperCase())' < notes.txt */
|
|
7927
|
+
export type SourceShellInput = {
|
|
7928
|
+
/** One shell command line: pipes, ; && ||, redirections, quotes, globs and heredocs, over the builtins (grep, sed, find, cat, head, tail, wc, sort, uniq, cut, tr, diff, ls, mv, cp, rm, mkdir, touch, echo, printf, tee, test, xargs, js and more) */
|
|
7929
|
+
command: string;
|
|
7930
|
+
/** The branch /src is (default main) */
|
|
7931
|
+
branch?: string;
|
|
7932
|
+
/** The directory the command starts in (default /src) */
|
|
7933
|
+
cwd?: string;
|
|
7934
|
+
/** Continue a truncated output from this byte: the next_offset of the last answer. Refused for a command that writes */
|
|
7935
|
+
offset?: number;
|
|
7936
|
+
/** The commit's message (default: the command itself, or what commit -m set) */
|
|
7937
|
+
message?: string;
|
|
7938
|
+
[field: string]: unknown;
|
|
7939
|
+
};
|
|
7940
|
+
/** Result of source.shell. */
|
|
7941
|
+
export type SourceShellResult = {
|
|
7942
|
+
data?: unknown;
|
|
7943
|
+
error?: unknown;
|
|
7944
|
+
[field: string]: unknown;
|
|
7945
|
+
};
|
|
7946
|
+
|
|
7136
7947
|
/** Input of source.tree: List the paths a version holds (the route's {version}: an id, a number, a branch, live or a sandbox name), ordered by path, each with its kind (file or dir). prefix walks only that directory; glob keeps the files whose path matches (* and ? also match /); sizes:true adds each file's size. Answers {version, entries, count} */
|
|
7137
7948
|
export type SourceTreeInput = {
|
|
7138
7949
|
/** The version: its id (64 hex), its number on the branch, a branch name whose head it is, live for the version the app runs, or a sandbox name for the version that sandbox runs */
|
|
@@ -7244,6 +8055,121 @@ export type SqlSchemaResult = {
|
|
|
7244
8055
|
[field: string]: unknown;
|
|
7245
8056
|
};
|
|
7246
8057
|
|
|
8058
|
+
/** Input of subscriptions.cancel: End one of the signed-in person's own subscriptions now: a paid one leaves the account's provider subscription that pays it (that line, or the whole subscription when it was the last) and the person falls back to what else they hold there (a bundle's plan, else the app's default). A bundle child ends only with its Substrio plan (SUBSCRIPTION_NOT_FOUND). The person's own session only, never a key or an agent (SUBSCRIPTION_PERSON_REQUIRED). Answers the subscription, ended */
|
|
8059
|
+
export type SubscriptionsCancelInput = {
|
|
8060
|
+
/** The subscription's id, from subscriptions.mine */
|
|
8061
|
+
id: string;
|
|
8062
|
+
};
|
|
8063
|
+
/** Result of subscriptions.cancel. */
|
|
8064
|
+
export type SubscriptionsCancelResult = {
|
|
8065
|
+
/** 0: the plan the app granted */
|
|
8066
|
+
id?: number;
|
|
8067
|
+
subject?: {
|
|
8068
|
+
kind?: "account" | "person" | "app_user";
|
|
8069
|
+
id?: number;
|
|
8070
|
+
app?: string;
|
|
8071
|
+
[field: string]: unknown;
|
|
8072
|
+
};
|
|
8073
|
+
/** the seller: the app whose plans file the plan is in */
|
|
8074
|
+
app?: string;
|
|
8075
|
+
plan?: string;
|
|
8076
|
+
source?: "grant" | "purchase" | "bundle";
|
|
8077
|
+
status?: "active" | "canceling" | "ended";
|
|
8078
|
+
/** a bundle: the Substrio plan's subscription it came with */
|
|
8079
|
+
parent?: number;
|
|
8080
|
+
since?: number;
|
|
8081
|
+
period_end?: number | null;
|
|
8082
|
+
ended_at?: number;
|
|
8083
|
+
[field: string]: unknown;
|
|
8084
|
+
};
|
|
8085
|
+
|
|
8086
|
+
/** Input of subscriptions.list: List an app's subscribers a page at a time: every subscription to its plans (a purchase, a bundle child of a Substrio plan, or a grant), by subject (an account, a person, or an app's own user) and id. The caller's own app, or (app) another app of the same owning account; any other app's is refused SUBSCRIBERS_NOT_VISIBLE */
|
|
8087
|
+
export type SubscriptionsListInput = {
|
|
8088
|
+
/** The seller app's slug: the caller's own app (the default) or another app of the same owning account */
|
|
8089
|
+
app?: string;
|
|
8090
|
+
/** The cursor a page answered */
|
|
8091
|
+
cursor?: string;
|
|
8092
|
+
/** Subscriptions a page (default 100) */
|
|
8093
|
+
limit?: number;
|
|
8094
|
+
};
|
|
8095
|
+
/** Result of subscriptions.list. */
|
|
8096
|
+
export type SubscriptionsListResult = {
|
|
8097
|
+
subscriptions: Array<{
|
|
8098
|
+
/** 0: the plan the app granted */
|
|
8099
|
+
id?: number;
|
|
8100
|
+
subject?: {
|
|
8101
|
+
kind?: "account" | "person" | "app_user";
|
|
8102
|
+
id?: number;
|
|
8103
|
+
app?: string;
|
|
8104
|
+
[field: string]: unknown;
|
|
8105
|
+
};
|
|
8106
|
+
/** the seller: the app whose plans file the plan is in */
|
|
8107
|
+
app?: string;
|
|
8108
|
+
plan?: string;
|
|
8109
|
+
source?: "grant" | "purchase" | "bundle";
|
|
8110
|
+
status?: "active" | "canceling" | "ended";
|
|
8111
|
+
/** a bundle: the Substrio plan's subscription it came with */
|
|
8112
|
+
parent?: number;
|
|
8113
|
+
since?: number;
|
|
8114
|
+
period_end?: number | null;
|
|
8115
|
+
ended_at?: number;
|
|
8116
|
+
[field: string]: unknown;
|
|
8117
|
+
}>;
|
|
8118
|
+
/** subscriptions.mine: the plan in force at each app where one is active (the highest of the stack per counter and period) */
|
|
8119
|
+
entitlements?: Array<{
|
|
8120
|
+
app?: string;
|
|
8121
|
+
plan?: string;
|
|
8122
|
+
default?: boolean;
|
|
8123
|
+
since?: number;
|
|
8124
|
+
limits?: Record<string, unknown>;
|
|
8125
|
+
features?: Record<string, unknown>;
|
|
8126
|
+
[field: string]: unknown;
|
|
8127
|
+
}>;
|
|
8128
|
+
/** the next page's cursor; null at the end */
|
|
8129
|
+
cursor?: string | null;
|
|
8130
|
+
[field: string]: unknown;
|
|
8131
|
+
};
|
|
8132
|
+
|
|
8133
|
+
/** Input of subscriptions.mine: List the signed-in person's own subscriptions at every app, active and ended: what they bought for themselves (a cart for the person), each Substrio plan's bundle children, and the plans apps granted them. A person's session only (at the console or at any app); a key is refused SUBSCRIPTION_PERSON_REQUIRED */
|
|
8134
|
+
export type SubscriptionsMineInput = Record<string, never>;
|
|
8135
|
+
/** Result of subscriptions.mine. */
|
|
8136
|
+
export type SubscriptionsMineResult = {
|
|
8137
|
+
subscriptions: Array<{
|
|
8138
|
+
/** 0: the plan the app granted */
|
|
8139
|
+
id?: number;
|
|
8140
|
+
subject?: {
|
|
8141
|
+
kind?: "account" | "person" | "app_user";
|
|
8142
|
+
id?: number;
|
|
8143
|
+
app?: string;
|
|
8144
|
+
[field: string]: unknown;
|
|
8145
|
+
};
|
|
8146
|
+
/** the seller: the app whose plans file the plan is in */
|
|
8147
|
+
app?: string;
|
|
8148
|
+
plan?: string;
|
|
8149
|
+
source?: "grant" | "purchase" | "bundle";
|
|
8150
|
+
status?: "active" | "canceling" | "ended";
|
|
8151
|
+
/** a bundle: the Substrio plan's subscription it came with */
|
|
8152
|
+
parent?: number;
|
|
8153
|
+
since?: number;
|
|
8154
|
+
period_end?: number | null;
|
|
8155
|
+
ended_at?: number;
|
|
8156
|
+
[field: string]: unknown;
|
|
8157
|
+
}>;
|
|
8158
|
+
/** subscriptions.mine: the plan in force at each app where one is active (the highest of the stack per counter and period) */
|
|
8159
|
+
entitlements?: Array<{
|
|
8160
|
+
app?: string;
|
|
8161
|
+
plan?: string;
|
|
8162
|
+
default?: boolean;
|
|
8163
|
+
since?: number;
|
|
8164
|
+
limits?: Record<string, unknown>;
|
|
8165
|
+
features?: Record<string, unknown>;
|
|
8166
|
+
[field: string]: unknown;
|
|
8167
|
+
}>;
|
|
8168
|
+
/** the next page's cursor; null at the end */
|
|
8169
|
+
cursor?: string | null;
|
|
8170
|
+
[field: string]: unknown;
|
|
8171
|
+
};
|
|
8172
|
+
|
|
7247
8173
|
/** Input of sync.push: Push replication operations */
|
|
7248
8174
|
export type SyncPushInput = Record<string, unknown>;
|
|
7249
8175
|
/** Result of sync.push. */
|
|
@@ -7532,6 +8458,8 @@ export type TenantGetResult = {
|
|
|
7532
8458
|
/** present only while suspended is true */
|
|
7533
8459
|
suspend_note?: string;
|
|
7534
8460
|
readonly: boolean;
|
|
8461
|
+
/** the live version changes only by promote (version.live.set): a function is changed in a version, never deployed straight to live */
|
|
8462
|
+
live_by_promote: boolean;
|
|
7535
8463
|
hosts: string[];
|
|
7536
8464
|
_id: number;
|
|
7537
8465
|
/** the account that owns the app (account.get); 0: the platform */
|
|
@@ -7661,7 +8589,7 @@ export type TenantKeyUpdateResult = {
|
|
|
7661
8589
|
|
|
7662
8590
|
/** Input of tenant.limits: Read a tenant's quota, document and request limits and their live usage */
|
|
7663
8591
|
export type TenantLimitsInput = {
|
|
7664
|
-
/** The app's slug, as
|
|
8592
|
+
/** The app's slug, as account.app.list names it */
|
|
7665
8593
|
slug?: string;
|
|
7666
8594
|
};
|
|
7667
8595
|
/** Result of tenant.limits. */
|
|
@@ -7792,6 +8720,8 @@ export type TenantRenameResult = {
|
|
|
7792
8720
|
/** present only while suspended is true */
|
|
7793
8721
|
suspend_note?: string;
|
|
7794
8722
|
readonly: boolean;
|
|
8723
|
+
/** the live version changes only by promote (version.live.set): a function is changed in a version, never deployed straight to live */
|
|
8724
|
+
live_by_promote: boolean;
|
|
7795
8725
|
hosts: string[];
|
|
7796
8726
|
_id: number;
|
|
7797
8727
|
/** the account that owns the app (account.get); 0: the platform */
|
|
@@ -7829,6 +8759,8 @@ export type TenantResumeResult = {
|
|
|
7829
8759
|
/** present only while suspended is true */
|
|
7830
8760
|
suspend_note?: string;
|
|
7831
8761
|
readonly: boolean;
|
|
8762
|
+
/** the live version changes only by promote (version.live.set): a function is changed in a version, never deployed straight to live */
|
|
8763
|
+
live_by_promote: boolean;
|
|
7832
8764
|
hosts: string[];
|
|
7833
8765
|
_id: number;
|
|
7834
8766
|
/** the account that owns the app (account.get); 0: the platform */
|
|
@@ -7854,6 +8786,37 @@ export type TenantResumeResult = {
|
|
|
7854
8786
|
[field: string]: unknown;
|
|
7855
8787
|
};
|
|
7856
8788
|
|
|
8789
|
+
/** Input of tenant.storage: Read what this app's folder holds on disk (disk_bytes, as of the last fold, each second) by kind (database, files, logs, backups, code, other), its storage limit and the room left (null while no limit is set). The storage limit is held against disk_bytes; tenant.usage's used_bytes and blob_bytes count only document and file bytes */
|
|
8790
|
+
export type TenantStorageInput = Record<string, never>;
|
|
8791
|
+
/** Result of tenant.storage. */
|
|
8792
|
+
export type TenantStorageResult = {
|
|
8793
|
+
tenant_id: number;
|
|
8794
|
+
slug: string;
|
|
8795
|
+
/** what the app's folder holds on disk as of the last fold (each second): the figure the storage limit is held against */
|
|
8796
|
+
disk_bytes: number;
|
|
8797
|
+
/** disk_bytes by kind */
|
|
8798
|
+
kinds: {
|
|
8799
|
+
/** the database file: its used end, page-rounded (it never shrinks; freed room inside it is reused) */
|
|
8800
|
+
database: number;
|
|
8801
|
+
/** the stored files, each the blocks it takes on disk (its length rounded up to the filesystem's block), once whatever uploads it */
|
|
8802
|
+
files: number;
|
|
8803
|
+
/** the function and delivery logs (logs.db) and the sync log (oplog.db), each its used end */
|
|
8804
|
+
logs: number;
|
|
8805
|
+
/** the backups and a restore's set-aside copy */
|
|
8806
|
+
backups: number;
|
|
8807
|
+
/** functions, their bytecode cache, the site releases and tools */
|
|
8808
|
+
code: number;
|
|
8809
|
+
/** every other file: the app's config, keys and the rest */
|
|
8810
|
+
other: number;
|
|
8811
|
+
[field: string]: unknown;
|
|
8812
|
+
};
|
|
8813
|
+
/** the app's storage limit; null while none is set */
|
|
8814
|
+
limit_bytes: number | null;
|
|
8815
|
+
/** limit_bytes less disk_bytes, at least 0; null while no limit is set */
|
|
8816
|
+
available_bytes: number | null;
|
|
8817
|
+
[field: string]: unknown;
|
|
8818
|
+
};
|
|
8819
|
+
|
|
7857
8820
|
/** Input of tenant.suspend: Suspend a tenant with a typed reason and an optional note */
|
|
7858
8821
|
export type TenantSuspendInput = {
|
|
7859
8822
|
slug: string;
|
|
@@ -7871,6 +8834,8 @@ export type TenantSuspendResult = {
|
|
|
7871
8834
|
/** present only while suspended is true */
|
|
7872
8835
|
suspend_note?: string;
|
|
7873
8836
|
readonly: boolean;
|
|
8837
|
+
/** the live version changes only by promote (version.live.set): a function is changed in a version, never deployed straight to live */
|
|
8838
|
+
live_by_promote: boolean;
|
|
7874
8839
|
hosts: string[];
|
|
7875
8840
|
_id: number;
|
|
7876
8841
|
/** the account that owns the app (account.get); 0: the platform */
|
|
@@ -7940,6 +8905,8 @@ export type TenantUpdateResult = {
|
|
|
7940
8905
|
/** present only while suspended is true */
|
|
7941
8906
|
suspend_note?: string;
|
|
7942
8907
|
readonly: boolean;
|
|
8908
|
+
/** the live version changes only by promote (version.live.set): a function is changed in a version, never deployed straight to live */
|
|
8909
|
+
live_by_promote: boolean;
|
|
7943
8910
|
hosts: string[];
|
|
7944
8911
|
_id: number;
|
|
7945
8912
|
/** the account that owns the app (account.get); 0: the platform */
|
|
@@ -7976,10 +8943,11 @@ export type TenantUsageResult = {
|
|
|
7976
8943
|
storage: {
|
|
7977
8944
|
/** the bytes of the stored documents, exact */
|
|
7978
8945
|
used_bytes: number;
|
|
7979
|
-
/** the bytes of the stored files (a file counts once, whatever uploads it)
|
|
8946
|
+
/** the bytes of the stored files, each its length (a file counts once, whatever uploads it). The storage limit is held against everything the app's folder holds on disk: tenant.storage */
|
|
7980
8947
|
blob_bytes: number;
|
|
7981
8948
|
/** null while no limit is set */
|
|
7982
8949
|
limit_bytes: number | null;
|
|
8950
|
+
/** the room the storage limit leaves: limit_bytes less tenant.storage's disk_bytes, at least 0; null while no limit is set */
|
|
7983
8951
|
available_bytes: number | null;
|
|
7984
8952
|
[field: string]: unknown;
|
|
7985
8953
|
};
|
|
@@ -8116,6 +9084,13 @@ export type TenantUsageResult = {
|
|
|
8116
9084
|
active: boolean;
|
|
8117
9085
|
/** tools/call runs of each of the app's own MCP tools on its /mcp, by tool name, kept in the app's database (APP-MCP) */
|
|
8118
9086
|
mcp_tools?: Record<string, number>;
|
|
9087
|
+
/** the app's function calls, API requests and their 5xx this month (UTC, the plan's metering month): durable totals kept in the app's record, reset when the month turns */
|
|
9088
|
+
this_month: {
|
|
9089
|
+
calls: number;
|
|
9090
|
+
requests: number;
|
|
9091
|
+
requests_5xx: number;
|
|
9092
|
+
[field: string]: unknown;
|
|
9093
|
+
};
|
|
8119
9094
|
[field: string]: unknown;
|
|
8120
9095
|
};
|
|
8121
9096
|
|
|
@@ -8145,16 +9120,16 @@ export type TenantUsageHistoryResult = {
|
|
|
8145
9120
|
documents?: number;
|
|
8146
9121
|
stored_bytes?: number;
|
|
8147
9122
|
blob_bytes?: number;
|
|
8148
|
-
/** what the app's function calls added in it: the counters of tenant.usage calls (invocations, direct_calls, cpu_us, wall_us, wall_ns, refused, ended, status, latency, p50_under_ms, p95_under_ms, p99_under_ms) */
|
|
9123
|
+
/** what the app's function calls added in it: the counters of tenant.usage.self calls (invocations, direct_calls, cpu_us, wall_us, wall_ns, refused, ended, status, latency, p50_under_ms, p95_under_ms, p99_under_ms) */
|
|
8149
9124
|
calls?: Record<string, unknown>;
|
|
8150
|
-
/** what the app's API requests over HTTP added in it: total, status, latency, p50_under_ms, p95_under_ms, p99_under_ms, as tenant.usage requests */
|
|
9125
|
+
/** what the app's API requests over HTTP added in it: total, status, latency, p50_under_ms, p95_under_ms, p99_under_ms, as tenant.usage.self requests */
|
|
8151
9126
|
requests?: Record<string, unknown>;
|
|
8152
9127
|
[field: string]: unknown;
|
|
8153
9128
|
}>;
|
|
8154
9129
|
[field: string]: unknown;
|
|
8155
9130
|
};
|
|
8156
9131
|
|
|
8157
|
-
/** Input of tenant.usage.self: Read this tenant's own exact usage and limits: storage bytes, documents, requests per minute (a limit is null until one is set) and the function limits (cpu, memory, concurrency, timeout, body and value sizes)
|
|
9132
|
+
/** Input of tenant.usage.self: Read this tenant's own exact usage and limits: storage bytes, documents, requests per minute (a limit is null until one is set) and the function limits (cpu, memory, concurrency, timeout, body and value sizes), for the tenant the key belongs to */
|
|
8158
9133
|
export type TenantUsageSelfInput = Record<string, never>;
|
|
8159
9134
|
/** Result of tenant.usage.self. */
|
|
8160
9135
|
export type TenantUsageSelfResult = {
|
|
@@ -8163,10 +9138,11 @@ export type TenantUsageSelfResult = {
|
|
|
8163
9138
|
storage: {
|
|
8164
9139
|
/** the bytes of the stored documents, exact */
|
|
8165
9140
|
used_bytes: number;
|
|
8166
|
-
/** the bytes of the stored files (a file counts once, whatever uploads it)
|
|
9141
|
+
/** the bytes of the stored files, each its length (a file counts once, whatever uploads it). The storage limit is held against everything the app's folder holds on disk: tenant.storage */
|
|
8167
9142
|
blob_bytes: number;
|
|
8168
9143
|
/** null while no limit is set */
|
|
8169
9144
|
limit_bytes: number | null;
|
|
9145
|
+
/** the room the storage limit leaves: limit_bytes less tenant.storage's disk_bytes, at least 0; null while no limit is set */
|
|
8170
9146
|
available_bytes: number | null;
|
|
8171
9147
|
[field: string]: unknown;
|
|
8172
9148
|
};
|
|
@@ -8303,6 +9279,13 @@ export type TenantUsageSelfResult = {
|
|
|
8303
9279
|
active: boolean;
|
|
8304
9280
|
/** tools/call runs of each of the app's own MCP tools on its /mcp, by tool name, kept in the app's database (APP-MCP) */
|
|
8305
9281
|
mcp_tools?: Record<string, number>;
|
|
9282
|
+
/** the app's function calls, API requests and their 5xx this month (UTC, the plan's metering month): durable totals kept in the app's record, reset when the month turns */
|
|
9283
|
+
this_month: {
|
|
9284
|
+
calls: number;
|
|
9285
|
+
requests: number;
|
|
9286
|
+
requests_5xx: number;
|
|
9287
|
+
[field: string]: unknown;
|
|
9288
|
+
};
|
|
8306
9289
|
[field: string]: unknown;
|
|
8307
9290
|
};
|
|
8308
9291
|
|
|
@@ -8728,7 +9711,7 @@ export type UserCreateInput = {
|
|
|
8728
9711
|
metadata?: Record<string, unknown>;
|
|
8729
9712
|
/** The person's display name, a member of the person object (collection _users) */
|
|
8730
9713
|
name?: string;
|
|
8731
|
-
/** The person's own fields, written as members of the person object (_users, keyed by the user id) in the same insert: the
|
|
9714
|
+
/** The person's own fields, written as members of the person object (_users, keyed by the user id) in the same insert: the standard ones (given_name, family_name, phone, picture, locale, timezone, birthday, consent, tags) and the ones the app declares in the _users schema. email, created_at, email_verified and a name starting with an underscore are reserved (400). A member the schema does not declare answers 400 SCHEMA_REFUSED with each violation and nothing is created */
|
|
8732
9715
|
fields?: Record<string, unknown>;
|
|
8733
9716
|
[field: string]: unknown;
|
|
8734
9717
|
};
|
|
@@ -8930,10 +9913,10 @@ export type VersionChangesResult = {
|
|
|
8930
9913
|
[field: string]: unknown;
|
|
8931
9914
|
};
|
|
8932
9915
|
|
|
8933
|
-
/** Input of version.check: Check an app version before it is pushed or made live: the body is the version.create body. Runs function.check over every function whose source is uploaded (parsed as script, CommonJS or ES module, with deploy's require() refusal) and answers ok, diagnostics (function, severity, message, line, column) and the blobs still missing. Nothing is stored or run. version.create and version.live.set run this same check unless they are sent check:false */
|
|
9916
|
+
/** Input of version.check: Check an app version before it is pushed or made live: the body is the version.create body, or {version} naming one already committed (a number, an id, a branch, live or a sandbox's name; no manifest). Runs function.check over every function whose source is uploaded (parsed as script, CommonJS or ES module, with deploy's require() refusal) and answers ok, diagnostics (function, severity, message, line, column) and the blobs still missing. Nothing is stored or run. version.create and version.live.set run this same check unless they are sent check:false */
|
|
8934
9917
|
export type VersionCheckInput = {
|
|
8935
9918
|
/** Every function of the app. A function not listed here is not part of the version */
|
|
8936
|
-
functions
|
|
9919
|
+
functions?: Array<{
|
|
8937
9920
|
/** Letters, digits, - _ and . only; also the file named in check diagnostics */
|
|
8938
9921
|
name: string;
|
|
8939
9922
|
/** SHA-256 of the body, lowercase hex */
|
|
@@ -9031,6 +10014,8 @@ export type VersionCheckInput = {
|
|
|
9031
10014
|
body: Record<string, unknown>;
|
|
9032
10015
|
[field: string]: unknown;
|
|
9033
10016
|
}> | null;
|
|
10017
|
+
/** Instead of a manifest: the committed version to check, a number from version.list, an id (64 hex digits), a branch, live or a sandbox's name. The answer then names its number in version */
|
|
10018
|
+
version?: number | string;
|
|
9034
10019
|
/** Ignored; kept so a version.create body can be sent as it is */
|
|
9035
10020
|
message?: string;
|
|
9036
10021
|
[field: string]: unknown;
|
|
@@ -9052,6 +10037,8 @@ export type VersionCheckResult = {
|
|
|
9052
10037
|
}>;
|
|
9053
10038
|
/** hashes of blobs (any part of the version) not uploaded yet */
|
|
9054
10039
|
missing: string[];
|
|
10040
|
+
/** the number of the committed version checked, when the call named one */
|
|
10041
|
+
version?: number;
|
|
9055
10042
|
[field: string]: unknown;
|
|
9056
10043
|
};
|
|
9057
10044
|
|
|
@@ -9552,7 +10539,7 @@ export interface SubstrioOperations {
|
|
|
9552
10539
|
app: {
|
|
9553
10540
|
/** Make an existing app one of an account's apps (platform admin) (account.app.attach; PUT /v1/_tenants/{slug}/account) */
|
|
9554
10541
|
attach(input: AccountAppAttachInput, options?: SubstrioCallOptions<'PUT'>): Promise<AccountAppAttachResult>;
|
|
9555
|
-
/** Create an app owned by the account (account.app.create; POST /v1/_accounts/{id}/apps) */
|
|
10542
|
+
/** Create an app owned by the account. A region (a slug region.choices lists) places it there; one that is not listed is refused with REGION_UNAVAILABLE (account.app.create; POST /v1/_accounts/{id}/apps) */
|
|
9556
10543
|
create(input: AccountAppCreateInput, options?: SubstrioCallOptions<'POST'>): Promise<AccountAppCreateResult>;
|
|
9557
10544
|
/** Delete one of the account's apps and its data (account.app.delete; DELETE /v1/_accounts/{id}/apps/{slug}) */
|
|
9558
10545
|
delete(input: AccountAppDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<AccountAppDeleteResult>;
|
|
@@ -9565,10 +10552,18 @@ export interface SubstrioOperations {
|
|
|
9565
10552
|
set(input: AccountAppOpenSetInput, options?: SubstrioCallOptions<'PUT'>): Promise<AccountAppOpenSetResult>;
|
|
9566
10553
|
};
|
|
9567
10554
|
};
|
|
10555
|
+
apps: {
|
|
10556
|
+
/** Set the order the account's apps run in: apps lists every app id of the account once (any other list is refused, INVALID_ARGUMENT naming apps). The first max_apps run; the rest are paused, keeping every byte, and their requests answer APP_OVER_PLAN until they move up, an app is deleted or the plan allows more. Answers each app in order with active, and max_apps (0: no limit) (account.apps.order; PUT /v1/_accounts/{id}/apps/order) */
|
|
10557
|
+
order(input: AccountAppsOrderInput, options?: SubstrioCallOptions<'PUT'>): Promise<AccountAppsOrderResult>;
|
|
10558
|
+
};
|
|
9568
10559
|
audit: {
|
|
9569
10560
|
/** Read an account's audit trail (its keys, members, invites, apps and clients), newest first; the filters, limit and cursor of audit.list (account.audit.list; GET /v1/_accounts/{id}/audit) */
|
|
9570
10561
|
list(input: AccountAuditListInput, options?: SubstrioCallOptions<'GET'>): Promise<AccountAuditListResult>;
|
|
9571
10562
|
};
|
|
10563
|
+
console: {
|
|
10564
|
+
/** Mint the person you act for a one-time console sign-in, then open its url in their browser: it lands them signed in on their dashboard. Only a person mints one (an agent session for its own person, or the person signed in to the console); a key, the master key or an agent token is refused CONSOLE_LINK_NEEDS_PERSON. The link lives 5 minutes (the server's --console-link-seconds), signs in once, and a new one replaces the last; its token rides in the url's fragment, so no server receives or logs it. Answers {url, expires_at} (account.console.link; POST /v1/_accounts/console/link) */
|
|
10565
|
+
link(input?: AccountConsoleLinkInput, options?: SubstrioCallOptions<'POST'>): Promise<AccountConsoleLinkResult>;
|
|
10566
|
+
};
|
|
9572
10567
|
/** Create an account owned by the signed-in person (account.create; POST /v1/_accounts) */
|
|
9573
10568
|
create(input: AccountCreateInput, options?: SubstrioCallOptions<'POST'>): Promise<AccountCreateResult>;
|
|
9574
10569
|
/** Delete an account that owns no apps, with its members and keys (account.delete; DELETE /v1/_accounts/{id}) */
|
|
@@ -9610,7 +10605,7 @@ export interface SubstrioOperations {
|
|
|
9610
10605
|
set(input: AccountMemberSetInput, options?: SubstrioCallOptions<'PUT'>): Promise<AccountMemberSetResult>;
|
|
9611
10606
|
};
|
|
9612
10607
|
mfa: {
|
|
9613
|
-
/** Require every member of an account to sign in with
|
|
10608
|
+
/** Require every member of an account to sign in with 2FA, or stop requiring it (account.mfa.set; PUT /v1/_accounts/{id}/mfa) */
|
|
9614
10609
|
set(input: AccountMfaSetInput, options?: SubstrioCallOptions<'PUT'>): Promise<AccountMfaSetResult>;
|
|
9615
10610
|
};
|
|
9616
10611
|
/** Read every app of the account with slug, tenant_id, suspended, live version and calls (invocations, status classes, p95_under_ms, from memory); stored_bytes and documents are present only when open is true (the app's database was already open: never opened here to total it), then the account's totals (apps, suspended, open, calls, stored_bytes, documents) across every app (account.overview; GET /v1/_accounts/{id}/overview) */
|
|
@@ -9623,10 +10618,16 @@ export interface SubstrioOperations {
|
|
|
9623
10618
|
/** Read what the account's plan allows beside what it uses, and every plan with what it adds and its price. An agent explains the plans and the upgrade from this alone (account.plan.summary; GET /v1/_accounts/{id}/plan) */
|
|
9624
10619
|
summary(input: AccountPlanSummaryInput, options?: SubstrioCallOptions<'GET'>): Promise<AccountPlanSummaryResult>;
|
|
9625
10620
|
};
|
|
10621
|
+
/** Read what each app of the account holds on disk (disk_bytes: its database, files, logs, backups, code and the rest, as of its last fold, open or not), the account's total (its apps and their sandboxes, the figure its space is held against) and the space in force (null while none). Supersedes account.overview's stored_bytes, which counts only open apps' document bytes (account.storage; GET /v1/_accounts/{id}/storage) */
|
|
10622
|
+
storage(input: AccountStorageInput, options?: SubstrioCallOptions<'GET'>): Promise<AccountStorageResult>;
|
|
9626
10623
|
/** Rename an account; the system key also sets its services, space and max_apps, and suspends it (account.update; PATCH /v1/_accounts/{id}) */
|
|
9627
10624
|
update(input: AccountUpdateInput, options?: SubstrioCallOptions<'PATCH'>): Promise<AccountUpdateResult>;
|
|
9628
|
-
|
|
9629
|
-
|
|
10625
|
+
usage: {
|
|
10626
|
+
/** Read the account's plan and usage counters at each app it has a plan or usage at (account.usage) */
|
|
10627
|
+
(input: AccountUsageInput, options?: SubstrioCallOptions<'GET'>): Promise<AccountUsageResult>;
|
|
10628
|
+
/** Read the CPU the account's apps used in each of the last 60 finished minutes, the hour's mean, the last 15 minutes' mean, the peak minute, the plan's CPU slices and the hour against them (used, of_share), the requests and calls held back while the server was saturated (holds) and each app's minutes and holds, each in CPU slices (1 is the Free plan's CPU under load; Standard holds 4). Explains how close the account runs to its plan's share and who waited for it (account.usage.cpu; GET /v1/_accounts/{id}/usage/cpu) */
|
|
10629
|
+
cpu(input: AccountUsageCpuInput, options?: SubstrioCallOptions<'GET'>): Promise<AccountUsageCpuResult>;
|
|
10630
|
+
};
|
|
9630
10631
|
};
|
|
9631
10632
|
agent: {
|
|
9632
10633
|
alert: {
|
|
@@ -9644,13 +10645,13 @@ export interface SubstrioOperations {
|
|
|
9644
10645
|
enroll: {
|
|
9645
10646
|
/** Make a one-time code that an AI agent exchanges for a session acting as you in the account; the code is returned once (agent.enroll.create; POST /v1/_accounts/{id}/agent/enrollments) */
|
|
9646
10647
|
create(input: AgentEnrollCreateInput, options?: SubstrioCallOptions<'POST'>): Promise<AgentEnrollCreateResult>;
|
|
9647
|
-
/** Exchange a one-time enrollment code for an agent session: a
|
|
10648
|
+
/** Exchange a one-time enrollment code (substrio_ae_...) for an agent session acting as the member who made it: a bearer one unless a kind is named or a public key is sent (key-bound). Answers the credential once and next, what to do with it; the code is spent. Over MCP it is the tool substrio_connect on any /mcp, with no credential (agent.enroll.exchange; POST /v1/_agent/exchange) */
|
|
9648
10649
|
exchange(input: AgentEnrollExchangeInput, options?: SubstrioCallOptions<'POST'>): Promise<AgentEnrollExchangeResult>;
|
|
9649
10650
|
};
|
|
9650
10651
|
session: {
|
|
9651
10652
|
/** An agent session makes a narrower child session for a sub-agent: the child's capabilities and apps are within the caller's, it ends no later than the caller, and it dies with the caller. Returns the child's credentials once (agent.session.delegate; POST /v1/_accounts/{id}/agent/delegations) */
|
|
9652
10653
|
delegate(input: AgentSessionDelegateInput, options?: SubstrioCallOptions<'POST'>): Promise<AgentSessionDelegateResult>;
|
|
9653
|
-
/** List the account's agent sessions, oldest first, a page at a time (limit, cursor; next_cursor), or only those reaching one app (app); never a key (agent.session.list; GET /v1/_accounts/{id}/agent/sessions) */
|
|
10654
|
+
/** List the account's live agent sessions (an ended one leaves the list; its log is still read by id), oldest first, a page at a time (limit, cursor; next_cursor), or only those reaching one app (app); never a key (agent.session.list; GET /v1/_accounts/{id}/agent/sessions) */
|
|
9654
10655
|
list(input: AgentSessionListInput, options?: SubstrioCallOptions<'GET'>): Promise<AgentSessionListResult>;
|
|
9655
10656
|
/** List the requests an agent session made, oldest first, each with its operation, outcome (ran, refused, approval asked, approved, denied, spent), status, app and time; pages by limit and cursor (a member sees their own agents, an admin or owner the account's). Kept for agent_log_retention_seconds (agent.session.log; GET /v1/_accounts/{id}/agent/sessions/{session_id}/log) */
|
|
9656
10657
|
log(input: AgentSessionLogInput, options?: SubstrioCallOptions<'GET'>): Promise<AgentSessionLogResult>;
|
|
@@ -9707,22 +10708,36 @@ export interface SubstrioOperations {
|
|
|
9707
10708
|
tools(input?: AiToolsInput, options?: SubstrioCallOptions<'GET'>): Promise<AiToolsResult>;
|
|
9708
10709
|
};
|
|
9709
10710
|
app: {
|
|
10711
|
+
/** Download the app as one .substrio.zip, its backup and its portable export: every collection as NDJSON (data/<collection>.ndjson), its users (users.ndjson), versions, config and site files, and manifest.json with each entry's SHA-256. Optional body passphrase seals secret values, password hashes, TOTP enrolments and passkeys into sealed.bin; without it they are left out. Optional backup_id archives that backup instead. app.restore or app.import reads it back on any server version (app.archive; POST /v1/_archive/download) */
|
|
10712
|
+
archive(input?: AppArchiveInput, options?: SubstrioCallOptions<'POST'>): Promise<AppArchiveResult>;
|
|
10713
|
+
/** Ship files in one call: commit the units and removals (as version.commit takes them), check the version's functions (unless check is false), make it live where to names (live, or a sandbox), test it there with app.test (unless test is false), and, with promote and a sandbox in to, make it live on the app once the test is green. Stops at the first step that fails: a refused commit, check or live answers that step's own error with stage; a failed test answers ok false, stage test and the test's failures with their fixes, and promotes nothing. Answers ok, stage, deployed {commit, live}, test and promote, each the answer of that step's own tool. Over HTTP it runs the commit, the check and live; test and promote run in the MCP tool (app.deploy; POST /v1/_app/deploy) */
|
|
10714
|
+
deploy(input: AppDeployInput, options?: SubstrioCallOptions<'POST'>): Promise<AppDeployResult>;
|
|
10715
|
+
/** What is wrong with the app (or a sandbox) and how to fix it, in one call: which version each environment runs against main's head, function.check over the version that runs where the call looks (its diagnostics), its newest function errors, and app.test of its website and GET routes, each finding with its fix. Answers ok, sandbox, live {main, environments}, check, errors {recent, fix}, test and fixes, every fix in order. Read only; the MCP server runs it (app.diagnose; POST /v1/_app/diagnose) */
|
|
10716
|
+
diagnose(input?: AppDiagnoseInput, options?: SubstrioCallOptions<'POST'>): Promise<AppDiagnoseResult>;
|
|
9710
10717
|
/** Stream the app as one bundle (versions, blobs, live stack, views, AI config, database, secrets), sealed whole to seal_to, for that server's POST /v1/_import (app.export; GET /v1/_export) */
|
|
9711
10718
|
export(input?: AppExportInput, options?: SubstrioCallOptions<'GET'>): Promise<AppExportResult>;
|
|
10719
|
+
/** Read this app's own record: slug, hosts, domains, suspended, readonly, live_by_promote, account_id, created_at and its limits. The app is the one the request names (X-Substrio-Tenant or its host) (app.get; GET /v1/_app) */
|
|
10720
|
+
get(input?: AppGetInput, options?: SubstrioCallOptions<'GET'>): Promise<AppGetResult>;
|
|
9712
10721
|
/** Make an app from a bundle GET /v1/_export streamed (the request body): its data, versions, live version, secrets sealed to this server, views and sandboxes (app.import; POST /v1/_import) */
|
|
9713
10722
|
import(input?: AppImportInput, options?: SubstrioCallOptions<'POST'>): Promise<AppImportResult>;
|
|
9714
10723
|
/** Read the mesh as this app sees it: enabled, node_id (hex), origin_seq (this node's own last origin sequence), max_applied_hlc (the highest HLC applied), entries (applied, streamed, deduped, pending), peer_count and peers (peer_id, node_id, address, connected, last_sent_seq, latency_us, state, acked_seq and behind, from gossip, null until the peer has gossiped since this process started). An app with no sync answers {"enabled": false} (app.mesh; GET /v1/_mesh/app) */
|
|
9715
10724
|
mesh(input?: AppMeshInput, options?: SubstrioCallOptions<'GET'>): Promise<AppMeshResult>;
|
|
9716
|
-
/** Read everything a dashboard's first paint needs for this app in one call: app (slug, tenant_id, created_at, hosts, domains, suspended, live_by_promote, is_sandbox), usage (the same body as tenant.usage), storage (database_bytes on disk and backups: count, bytes, latest_at), versions (live, rollback_to, count, sandboxes), functions (count, names), collections (count), cron (count), queues (count), alerts (log alerts fired in their last window), audit (the last 5 entries, newest first) and mesh (this app's mesh position, in short) (app.overview; GET /v1/_overview) */
|
|
10725
|
+
/** Read everything a dashboard's first paint needs for this app in one call: app (slug, tenant_id, created_at, hosts, domains, suspended, live_by_promote, is_sandbox), usage (the same body as tenant.usage.self), storage (database_bytes on disk and backups: count, bytes, latest_at), versions (live, rollback_to, count, sandboxes), functions (count, names), collections (count), cron (count), queues (count), alerts (log alerts fired in their last window), audit (the last 5 entries, newest first) and mesh (this app's mesh position, in short) (app.overview; GET /v1/_overview) */
|
|
9717
10726
|
overview(input?: AppOverviewInput, options?: SubstrioCallOptions<'GET'>): Promise<AppOverviewResult>;
|
|
10727
|
+
/** Restore a .substrio.zip (the request body, as app.archive made it) into this app through the normal write paths: users, data, versions, site files, config, and with the X-Substrio-Passphrase header the sealed secrets and sign-ins. Every entry is checked against manifest.json before anything is written. An app that holds data is refused unless replace=true. Answers the counts restored and what was left out (app.restore; POST /v1/_archive) */
|
|
10728
|
+
restore(input?: AppRestoreInput, options?: SubstrioCallOptions<'POST'>): Promise<AppRestoreResult>;
|
|
9718
10729
|
runtime_level: {
|
|
9719
10730
|
/** Set one app's runtime compatibility level: which behaviour of the function runtime it gets. Never above the level this release carries (a higher level refuses the call), and the app's isolates pick the new level up as they are made (app.runtime_level.set; PATCH /v1/_tenants/{slug}/runtime_level) */
|
|
9720
10731
|
set(input: AppRuntimeLevelSetInput, options?: SubstrioCallOptions<'PATCH'>): Promise<AppRuntimeLevelSetResult>;
|
|
9721
10732
|
};
|
|
10733
|
+
/** Start an app from a template compiled into the release: commits the app's first version on main, one snapshot of the template's units, each of which passes app.test. site is a page with its stylesheet and script; site-api adds a function route (GET /api/hello) the page calls; site-data-auth is a notes page anyone reads and a signed-in person adds to (GET /api/notes, POST /api/notes auth, GET /api/me auth). Refused with 409 when main already holds a version: change an app that has one with version.commit or app.deploy. Answers version.commit's answer and template; make it live with live.set (with sandbox to try it first) (app.scaffold; POST /v1/_app/scaffold) */
|
|
10734
|
+
scaffold(input: AppScaffoldInput, options?: SubstrioCallOptions<'POST'>): Promise<AppScaffoldResult>;
|
|
9722
10735
|
seal_key: {
|
|
9723
10736
|
/** Read the X25519 public key bundles this server imports are sealed to (seal_to of an export) (app.seal_key.get; GET /v1/_seal-key) */
|
|
9724
10737
|
get(input?: AppSealKeyGetInput, options?: SubstrioCallOptions<'GET'>): Promise<AppSealKeyGetResult>;
|
|
9725
10738
|
};
|
|
10739
|
+
/** Test the app's website (or a sandbox's) as a browser loads it, in one call: each page of paths (default /) and every same-site page it links, every stylesheet, script, image, icon and CSS url() or @import they name, and every GET function route with no parameter, each fetched in process as route.call does, as a visitor with no credentials. Each is checked for its status, its content type (a stylesheet must be text/css, a script JavaScript, an image image/*, never the site's page in their place) and its size. Answers ok, the table of every resource (path, kind, from, status, type, bytes, ok) and each failure with its problem and its fix. References to another origin are counted, never fetched (app.test; POST /v1/_app/test) */
|
|
10740
|
+
test(input?: AppTestInput, options?: SubstrioCallOptions<'POST'>): Promise<AppTestResult>;
|
|
9726
10741
|
};
|
|
9727
10742
|
apps: {
|
|
9728
10743
|
calls: {
|
|
@@ -9763,8 +10778,14 @@ export interface SubstrioOperations {
|
|
|
9763
10778
|
set(input: AuthClientRedirectUrisSetInput, options?: SubstrioCallOptions<'PUT'>): Promise<AuthClientRedirectUrisSetResult>;
|
|
9764
10779
|
};
|
|
9765
10780
|
};
|
|
10781
|
+
devices: {
|
|
10782
|
+
/** Count the signed-in person's remembered devices: each signs in with the authenticator code and no email until it ends (30 days, or every session of the person ending) (auth.devices) */
|
|
10783
|
+
(input?: AuthDevicesInput, options?: SubstrioCallOptions<'GET'>): Promise<AuthDevicesResult>;
|
|
10784
|
+
/** Forget every remembered device of the signed-in person: each signs in by the email code again. No session ends (auth.devices.forget; POST /v1/_auth/devices/forget) */
|
|
10785
|
+
forget(input?: AuthDevicesForgetInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthDevicesForgetResult>;
|
|
10786
|
+
};
|
|
9766
10787
|
email: {
|
|
9767
|
-
/** Mail a short code and a link that prove an address; nobody need be signed in. One
|
|
10788
|
+
/** Mail a short code and a link that prove an address; nobody need be signed in. One pair an address: asked again while it lives, the same code and link are mailed again (every mail sent works) and its life starts over; a spent, expired or locked pair gives way to a new one. Paced by the app's request interval. Answers {accepted, expires_at} whether or not anyone holds the address. On a device remembered for the person the address names (the substrio_device cookie auth.mfa set), their 2FA on, no mail is sent: {accepted, expires_at, mfa_required, challenge}, finished by auth.mfa with the authenticator code (auth.email.code_request; POST /v1/_auth/email/code_request) */
|
|
9768
10789
|
code_request(input: AuthEmailCodeRequestInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthEmailCodeRequestResult>;
|
|
9769
10790
|
/** Prove an address with its mailed code (email and code) or its link (token): the person holding it, made when nobody does, is verified. Answers {verified, email, user_id, created, password_grant?}; a code or link that proves nothing is 400 with its reason (MISSING, USED, EXPIRED, TOO_MANY_ATTEMPTS, WRONG and attempts_remaining) (auth.email.code_verify; POST /v1/_auth/email/code_verify) */
|
|
9770
10791
|
code_verify(input?: AuthEmailCodeVerifyInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthEmailCodeVerifyResult>;
|
|
@@ -9777,13 +10798,17 @@ export interface SubstrioOperations {
|
|
|
9777
10798
|
github(input?: AuthGithubInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthGithubResult>;
|
|
9778
10799
|
/** Authenticate with Google OAuth (auth.google; POST /v1/_auth/google) */
|
|
9779
10800
|
google(input: AuthGoogleInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthGoogleResult>;
|
|
10801
|
+
link: {
|
|
10802
|
+
/** For the console: spend a one-time console link (token, from the url's #link fragment) and sign its person in at the identity app, marked: an irreversible call waits for an approval and it decides none (CONSOLE_LINK_STEP_UP) until the person signs in again by the email code or 2FA. Answers {user_id, account_id, token, keyring} as auth.email.code_verify signs in, or the 2FA step due under mfa; a link that signs nobody in is refused CONSOLE_LINK_UNKNOWN (made up, or replaced by a newer link), CONSOLE_LINK_USED or CONSOLE_LINK_EXPIRED (auth.link.redeem; POST /v1/_auth/link/redeem) */
|
|
10803
|
+
redeem(input: AuthLinkRedeemInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthLinkRedeemResult>;
|
|
10804
|
+
};
|
|
9780
10805
|
login: {
|
|
9781
10806
|
/** Authenticate a user (auth.login) */
|
|
9782
10807
|
(input: AuthLoginInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthLoginResult>;
|
|
9783
10808
|
/** Join the shared login ([login]): make the app a client of the identity app with a callback on each of its hosts (auth.login.set; PUT /v1/_auth/login) */
|
|
9784
10809
|
set(input?: AuthLoginSetInput, options?: SubstrioCallOptions<'PUT'>): Promise<AuthLoginSetResult>;
|
|
9785
10810
|
};
|
|
9786
|
-
/** End this session; its token stops working at once (auth.logout; POST /v1/_auth/logout) */
|
|
10811
|
+
/** End this session; its token stops working at once, and this browser's substrio_session cookie ends and is cleared (a remembered device stays) (auth.logout; POST /v1/_auth/logout) */
|
|
9787
10812
|
logout(input?: AuthLogoutInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthLogoutResult>;
|
|
9788
10813
|
/** End every session of the signed-in user, this one included (auth.logout_all; POST /v1/_auth/logout_all) */
|
|
9789
10814
|
logout_all(input?: AuthLogoutAllInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthLogoutAllResult>;
|
|
@@ -9792,9 +10817,11 @@ export interface SubstrioOperations {
|
|
|
9792
10817
|
(input?: AuthMeInput, options?: SubstrioCallOptions<'GET'>): Promise<AuthMeResult>;
|
|
9793
10818
|
/** Erase the signed-in user and their auth records; dry_run checks only (auth.me.delete; DELETE /v1/_auth/me) */
|
|
9794
10819
|
delete(input?: AuthMeDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<AuthMeDeleteResult>;
|
|
10820
|
+
/** Edit the signed-in person's own profile: name always, and each member of fields only when the app's _users schema marks that field "self": true (a member not marked refuses the whole edit with 403 SELF_FIELD_REFUSED naming it; a value the schema refuses is 400 SCHEMA_REFUSED; a key is refused 403, a key is not a user). Email and password change through their own verified flows. Answers the profile as auth.me does (auth.me.update; PATCH /v1/_auth/me) */
|
|
10821
|
+
update(input?: AuthMeUpdateInput, options?: SubstrioCallOptions<'PATCH'>): Promise<AuthMeUpdateResult>;
|
|
9795
10822
|
};
|
|
9796
10823
|
mfa: {
|
|
9797
|
-
/** Finish a sign-in that answered mfa_required: trade its challenge and a code, or a recovery code, for the session (auth.mfa) */
|
|
10824
|
+
/** Finish a sign-in that answered mfa_required: trade its challenge and a code, or a recovery code, for the session. After the email code, remember true also remembers the device (the substrio_device cookie, 30 days) (auth.mfa) */
|
|
9798
10825
|
(input: AuthMfaInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthMfaResult>;
|
|
9799
10826
|
/** Turn MFA off with a code or a recovery code; every older session ends at its refresh (auth.mfa.disable; POST /v1/_auth/mfa/disable) */
|
|
9800
10827
|
disable(input?: AuthMfaDisableInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthMfaDisableResult>;
|
|
@@ -9831,7 +10858,7 @@ export interface SubstrioOperations {
|
|
|
9831
10858
|
/** Rename one of the signed-in person's passkeys (auth.passkey.rename; PATCH /v1/_auth/passkeys/{id}) */
|
|
9832
10859
|
rename(input: AuthPasskeyRenameInput, options?: SubstrioCallOptions<'PATCH'>): Promise<AuthPasskeyRenameResult>;
|
|
9833
10860
|
sign_in: {
|
|
9834
|
-
/** Sign in with a passkey and no password: verifies the assertion and returns a session; a passkey that verified the person needs no
|
|
10861
|
+
/** Sign in with a passkey and no password: verifies the assertion and returns a session; a passkey that verified the person needs no 2FA (auth.passkey.sign_in) */
|
|
9835
10862
|
(input: AuthPasskeySignInInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthPasskeySignInResult>;
|
|
9836
10863
|
/** Start a passkey sign-in: returns the WebAuthn request options for navigator.credentials.get, for a discoverable passkey or a person's by email (auth.passkey.sign_in.options; POST /v1/_auth/passkeys/sign-in/options) */
|
|
9837
10864
|
options(input?: AuthPasskeySignInOptionsInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthPasskeySignInOptionsResult>;
|
|
@@ -9855,7 +10882,7 @@ export interface SubstrioOperations {
|
|
|
9855
10882
|
/** Configure one identity provider of the app for social sign-in; see the schema for its body (auth.provider.update; POST /v1/_auth/providers) */
|
|
9856
10883
|
update(input: AuthProviderUpdateInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthProviderUpdateResult>;
|
|
9857
10884
|
};
|
|
9858
|
-
/** Refresh a session (auth.refresh; POST /v1/_auth/refresh) */
|
|
10885
|
+
/** Refresh a session: the Bearer token for a new one (the old one stops working). stay true also sets the substrio_session cookie (30 days, renewed by each refresh); with no Bearer, that cookie alone signs its person in again as their sign-in did (auth.refresh; POST /v1/_auth/refresh) */
|
|
9859
10886
|
refresh(input?: AuthRefreshInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthRefreshResult>;
|
|
9860
10887
|
/** Create a user session (auth.register; POST /v1/_auth/register) */
|
|
9861
10888
|
register(input: AuthRegisterInput, options?: SubstrioCallOptions<'POST'>): Promise<AuthRegisterResult>;
|
|
@@ -9881,7 +10908,7 @@ export interface SubstrioOperations {
|
|
|
9881
10908
|
backup: {
|
|
9882
10909
|
/** Replace another tenant's database (body target_slug) with a backup of this app (the route's {id} from backup.list), then catch it up with this app's history from the backup's point to now, so it ends up current, not frozen at the backup. Everything target_slug held is lost; it must be a different tenant. Answers {status:'cloned', backup_id, target_slug, history_position, history_through, history_applied} (backup.clone_into; POST /v1/_backups/{id}/clone_into) */
|
|
9883
10910
|
clone_into(input: BackupCloneIntoInput, options?: SubstrioCallOptions<'POST'>): Promise<BackupCloneIntoResult>;
|
|
9884
|
-
/** Start a backup of the app's database as a background job: optional body description. Answers 202 {job_id, status:'running'} at once; backup.get with
|
|
10911
|
+
/** Start a backup of the app's database as a background job: optional body description. Answers 202 {job_id, backup_id, status:'running'} at once, the backup already listed by backup.list as running; backup.get with the job id shows the progress, and with the backup id the backup that backup.restore takes once it completes (backup.create; POST /v1/_backups) */
|
|
9885
10912
|
create(input?: BackupCreateInput, options?: SubstrioCallOptions<'POST'>): Promise<BackupCreateResult>;
|
|
9886
10913
|
/** Delete one backup by its id (the route's {id}, as backup.list shows it) (backup.delete; DELETE /v1/_backups/{id}) */
|
|
9887
10914
|
delete(input: BackupDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<BackupDeleteResult>;
|
|
@@ -9919,6 +10946,10 @@ export interface SubstrioOperations {
|
|
|
9919
10946
|
/** Read the account's credit: the funds it added, in the minor unit, and how many payments made it (billing.credit.get; GET /v1/_accounts/{id}/billing/credit) */
|
|
9920
10947
|
get(input: BillingCreditGetInput, options?: SubstrioCallOptions<'GET'>): Promise<BillingCreditGetResult>;
|
|
9921
10948
|
};
|
|
10949
|
+
person_cart: {
|
|
10950
|
+
/** Make a cart of plans that are the person's own, paid by the account: they hold them at every app wherever they sign in, apart from the account's (subscriptions.mine lists them). The plans, the offer and checkout_url as billing.cart.create gives them; the subject is the person whose own session starts the checkout. No space_blocks: the add-on is the account's (billing.person_cart.create; POST /v1/_accounts/{id}/billing/person-carts) */
|
|
10951
|
+
create(input: BillingPersonCartCreateInput, options?: SubstrioCallOptions<'POST'>): Promise<BillingPersonCartCreateResult>;
|
|
10952
|
+
};
|
|
9922
10953
|
/** What every account has paid the platform (paid: the identity ledger's maintained balance of the platform party, in USD, with how many payments) and how many accounts' newest invoice is unpaid (past_due). Platform operator only (billing.revenue; GET /v1/_billing/revenue) */
|
|
9923
10954
|
revenue(input?: BillingRevenueInput, options?: SubstrioCallOptions<'GET'>): Promise<BillingRevenueResult>;
|
|
9924
10955
|
subscription: {
|
|
@@ -9940,7 +10971,7 @@ export interface SubstrioOperations {
|
|
|
9940
10971
|
/** Whether this node has caught up with the mesh: 200 when every app's replication has nothing outstanding (its links up, no catch-up in flight, and every position its peers have gossiped already held here) and 503 while one has, naming the app it waits on and what it waits for. A rolling upgrade asks this between nodes, with curl alone, before it installs on the next one (cluster.ready; GET /v1/_cluster/ready) */
|
|
9941
10972
|
ready(input?: ClusterReadyInput, options?: SubstrioCallOptions<'GET'>): Promise<ClusterReadyResult>;
|
|
9942
10973
|
version: {
|
|
9943
|
-
/** Read the
|
|
10974
|
+
/** Read the versions in use: the wire range this release speaks, the version chosen for the mesh (the lowest max over the members), the version the mesh has FINALIZED, the storage format, the runtime level this release carries, and every member with its range and whether its link is live (cluster.version) */
|
|
9944
10975
|
(input?: ClusterVersionInput, options?: SubstrioCallOptions<'GET'>): Promise<ClusterVersionResult>;
|
|
9945
10976
|
/** Finalize the mesh at wire version {version}: allowed only when this node and every member already speak it (a member whose link is down or whose max is lower refuses the call and is named). It is written durably before the call answers and never goes back: from then on a node that does not speak it is refused at the handshake, so finalize only once every node runs the new release (cluster.version.finalize; POST /v1/_cluster/version/finalize) */
|
|
9946
10977
|
finalize(input: ClusterVersionFinalizeInput, options?: SubstrioCallOptions<'POST'>): Promise<ClusterVersionFinalizeResult>;
|
|
@@ -9956,6 +10987,10 @@ export interface SubstrioOperations {
|
|
|
9956
10987
|
/** Read one collection's statistics: doc_count, indexes (each named: {kind: field, field, unique} for a declared field, {kind: vector|text|sparse} for a search index) with index_count, their number, and has_rag; 404 when it does not exist (collection.stats; GET /v1/{collection}/_stats) */
|
|
9957
10988
|
stats(input: CollectionStatsInput, options?: SubstrioCallOptions<'GET'>): Promise<CollectionStatsResult>;
|
|
9958
10989
|
};
|
|
10990
|
+
dashboard: {
|
|
10991
|
+
/** Read the dashboard an app declares, the file its live version shipped (nav items and their panels, canonical), for the console to draw. The app is one of the account's own or a featured app the account has enabled; any other answers TENANT_NOT_FOUND. An app that declares none answers an empty nav. With version (a number or id), that version's dashboard instead, checked against its own routes as a push's is: what the console will draw once it goes live (an app of the account's own) (dashboard.get; GET /v1/_accounts/{id}/apps/{slug}/dashboard) */
|
|
10992
|
+
get(input: DashboardGetInput, options?: SubstrioCallOptions<'GET'>): Promise<DashboardGetResult>;
|
|
10993
|
+
};
|
|
9959
10994
|
data: {
|
|
9960
10995
|
/** Delete one record by its _id; 404 when it does not exist, 403 when the key may not delete it (data.delete; DELETE /v1/{collection}/{id}) */
|
|
9961
10996
|
delete(input: DataDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<DataDeleteResult>;
|
|
@@ -9979,6 +11014,8 @@ export interface SubstrioOperations {
|
|
|
9979
11014
|
documentation: {
|
|
9980
11015
|
/** Read the guide for AI agents building on substrio (text/plain); a tenant's own /llms.txt function route or site file is served instead (documentation.agent_guide; GET /llms.txt) */
|
|
9981
11016
|
agent_guide(input?: DocumentationAgentGuideInput, options?: SubstrioCallOptions<'GET'>): Promise<DocumentationAgentGuideResult>;
|
|
11017
|
+
/** Start here, in at most 3 KB. Answers the app, what this key is, the live version number, the goals an app is built for (website, api, database, auth, events: each with its summary, its skill and the tools it needs), the build loop's tools in order, and how to reach every other tool. Takes no input; substrio_tools {area: <goal>} answers a goal's full definitions, substrio_start every area's tools (documentation.brief; GET /v1/_brief) */
|
|
11018
|
+
brief(input?: DocumentationBriefInput, options?: SubstrioCallOptions<'GET'>): Promise<DocumentationBriefResult>;
|
|
9982
11019
|
/** Describe typed capabilities (documentation.capabilities; GET /v1/_capabilities) */
|
|
9983
11020
|
capabilities(input?: DocumentationCapabilitiesInput, options?: SubstrioCallOptions<'GET'>): Promise<DocumentationCapabilitiesResult>;
|
|
9984
11021
|
/** Read generated OpenAPI (documentation.openapi; GET /v1/_openapi) */
|
|
@@ -10018,31 +11055,39 @@ export interface SubstrioOperations {
|
|
|
10018
11055
|
list(input?: EnvHostListInput, options?: SubstrioCallOptions<'GET'>): Promise<EnvHostListResult>;
|
|
10019
11056
|
/** Remove one of the app's hosts: it answers nothing from then on and its label is free. ENV_HOST_NOT_FOUND when the app holds no such host. Answers 204 (env.host.remove; DELETE /v1/_env_hosts/{host}) */
|
|
10020
11057
|
remove(input: EnvHostRemoveInput, options?: SubstrioCallOptions<'DELETE'>): Promise<EnvHostRemoveResult>;
|
|
10021
|
-
/** Bind a host of the app's choosing, <label>.<root> under an enabled root domain (my-app-v2.substrio.com), to one of its environments: live, or a sandbox (with version, a new sandbox running that version). The host answers exactly what that environment runs, with its data. A label has one owner across the platform: HOST_TAKEN when another app holds it, HOST_RESERVED for
|
|
11058
|
+
/** Bind a host of the app's choosing, <label>.<root> under an enabled root domain (my-app-v2.substrio.com), to one of its environments: live, or a sandbox (with version, a new sandbox running that version). The host answers exactly what that environment runs, with its data. A label has one owner across the platform: HOST_TAKEN when another app holds it, HOST_RESERVED for a reserved name or an app host, HOST_INVALID (with suggestion) for a label that is not a hostname label, ROOT_DOMAIN_UNKNOWN or ROOT_DOMAIN_DISABLED for the root. Binding a host the app holds again moves it. version.live.set with from: <host> pushes what it runs live (env.host.set; POST /v1/_env_hosts) */
|
|
10022
11059
|
set(input: EnvHostSetInput, options?: SubstrioCallOptions<'POST'>): Promise<EnvHostSetResult>;
|
|
10023
11060
|
};
|
|
10024
11061
|
};
|
|
10025
11062
|
featured: {
|
|
10026
|
-
/**
|
|
11063
|
+
/** Deprecated: every account has every jet, always on, so it is refused FEATURED_ALWAYS_ON. A key stops with account.key.revoke; an app's keys go with the app (featured.disable; DELETE /v1/_accounts/{id}/featured/{jet}) */
|
|
10027
11064
|
disable(input: FeaturedDisableInput, options?: SubstrioCallOptions<'DELETE'>): Promise<FeaturedDisableResult>;
|
|
10028
|
-
/**
|
|
11065
|
+
/** Deprecated: every account has every jet, always on. Answers the jet's entry as featured.list writes it and changes nothing (featured.enable; PUT /v1/_accounts/{id}/featured/{jet}) */
|
|
10029
11066
|
enable(input: FeaturedEnableInput, options?: SubstrioCallOptions<'PUT'>): Promise<FeaturedEnableResult>;
|
|
10030
11067
|
key: {
|
|
10031
|
-
/**
|
|
11068
|
+
/** Deprecated: a jet key belongs to one of the account's apps, so it is refused JET_KEY_NEEDS_APP; jet.key.create makes it (featured.key.create; POST /v1/_accounts/{id}/featured/{jet}/keys) */
|
|
10032
11069
|
create(input: FeaturedKeyCreateInput, options?: SubstrioCallOptions<'POST'>): Promise<FeaturedKeyCreateResult>;
|
|
10033
11070
|
};
|
|
10034
|
-
/** List the featured apps (the jets: MapJet, SendJet, AuthJet and every later one)
|
|
11071
|
+
/** List the featured apps (the jets: MapJet, SendJet, AuthJet and every later one) for the account: what each does, the plan it is metered against and the account's use this day and month (every app of the account summed) against that plan's limits. Every account has every jet: there is nothing to enable (featured.list; GET /v1/_accounts/{id}/featured) */
|
|
10035
11072
|
list(input: FeaturedListInput, options?: SubstrioCallOptions<'GET'>): Promise<FeaturedListResult>;
|
|
10036
|
-
/** Feature an app for every account, or stop featuring it (platform admin). It must be open to other accounts' keys and its plans file must have a featured block (title, summary, admin).
|
|
11073
|
+
/** Feature an app for every account, or stop featuring it (platform admin). It must be open to other accounts' keys and its plans file must have a featured block (title, summary, admin). An account on a plan there keeps it when it stops being featured (featured.set; PUT /v1/_featured/{jet}) */
|
|
10037
11074
|
set(input: FeaturedSetInput, options?: SubstrioCallOptions<'PUT'>): Promise<FeaturedSetResult>;
|
|
10038
11075
|
};
|
|
10039
11076
|
file: {
|
|
11077
|
+
/** Platform operator only: store a file that is already on this server's own disk (under the server's --adopt-dir) at a path of the app the request names, with 0 bytes written: hashed in one read, then renamed in. Answers what file.upload answers (file.adopt; POST /v1/_files/adopt) */
|
|
11078
|
+
adopt(input: FileAdoptInput, options?: SubstrioCallOptions<'POST'>): Promise<FileAdoptResult>;
|
|
10040
11079
|
/** Delete one stored file by its path (the route's tail, as file.list shows it) (file.delete; DELETE /v1/_files/{path}) */
|
|
10041
11080
|
delete(input: FileDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<FileDeleteResult>;
|
|
10042
11081
|
/** Download one stored file by path (from file.list) (file.download; GET /v1/_files/{path}) */
|
|
10043
11082
|
download(input: FileDownloadInput, options?: SubstrioCallOptions<'GET'>): Promise<FileDownloadResult>;
|
|
10044
11083
|
/** List the app's stored files by path (optionally under a prefix): the path is what file.download and file.delete take (file.list; GET /v1/_files) */
|
|
10045
11084
|
list(input?: FileListInput, options?: SubstrioCallOptions<'GET'>): Promise<FileListResult>;
|
|
11085
|
+
/** Rename a stored file's path from one path to another, its content never copied. Refused with FILE_EXISTS when a file is at to, unless replace is true; FILE_NOT_FOUND when none is at from. Answers the file at its new path, as file.upload answers (file.move; POST /v1/_files/move) */
|
|
11086
|
+
move(input: FileMoveInput, options?: SubstrioCallOptions<'POST'>): Promise<FileMoveResult>;
|
|
11087
|
+
public: {
|
|
11088
|
+
/** Read a stored file marked public, with no key, on the app's own hosts; a private or missing path is the same 404 (file.public.get; GET /_files/{path}) */
|
|
11089
|
+
get(input: FilePublicGetInput, options?: SubstrioCallOptions<'GET'>): Promise<FilePublicGetResult>;
|
|
11090
|
+
};
|
|
10046
11091
|
site_root: {
|
|
10047
11092
|
/** Read the tenant site's index page (the app named by Host or X-Substrio-Tenant) (file.site_root.get; GET /) */
|
|
10048
11093
|
get(input?: FileSiteRootGetInput, options?: SubstrioCallOptions<'GET'>): Promise<FileSiteRootGetResult>;
|
|
@@ -10051,6 +11096,8 @@ export interface SubstrioOperations {
|
|
|
10051
11096
|
/** Read a tenant static asset (file.static_asset.get; GET /_/{path}) */
|
|
10052
11097
|
get(input: FileStaticAssetGetInput, options?: SubstrioCallOptions<'GET'>): Promise<FileStaticAssetGetResult>;
|
|
10053
11098
|
};
|
|
11099
|
+
/** Change a stored file's settings (public, content_type, cache_control) by its path, with no byte of it sent again: its bytes and hash are untouched and an absent setting keeps its value. Answers what file.upload answers; FILE_NOT_FOUND when no file is at the path (file.update; PATCH /v1/_files/{path}) */
|
|
11100
|
+
update(input: FileUpdateInput, options?: SubstrioCallOptions<'PATCH'>): Promise<FileUpdateResult>;
|
|
10054
11101
|
/** Upload a file into the app's file storage at its path; see the schema for the body. Answers its path, which file.download and file.delete take (file.upload; POST /v1/_files) */
|
|
10055
11102
|
upload(input: FileUploadInput, options?: SubstrioCallOptions<'POST'>): Promise<FileUploadResult>;
|
|
10056
11103
|
};
|
|
@@ -10058,13 +11105,13 @@ export interface SubstrioOperations {
|
|
|
10058
11105
|
/** Summarize tenant databases and deployed functions (function.catalog; GET /v1/_functions/_catalog) */
|
|
10059
11106
|
catalog(input?: FunctionCatalogInput, options?: SubstrioCallOptions<'GET'>): Promise<FunctionCatalogResult>;
|
|
10060
11107
|
/** Check a function before deploying it: the same body as function.deploy (script, name, routes, vars, bindings); parses the source as a script, CommonJS or ES module without running it and applies deploy's manifest and require() refusals; answers ok and diagnostics (severity, message, file, line, column); nothing is written or executed (function.check; POST /v1/_functions/_check) */
|
|
10061
|
-
check(input
|
|
11108
|
+
check(input?: FunctionCheckInput, options?: SubstrioCallOptions<'POST'>): Promise<FunctionCheckResult>;
|
|
10062
11109
|
/** Invoke a function through the compatibility endpoint (function.compat; GET /fn/{function}) */
|
|
10063
11110
|
compat(input?: FunctionCompatInput, options?: SubstrioCallOptions<'GET' | 'POST' | 'PUT' | 'DELETE'>): Promise<FunctionCompatResult>;
|
|
10064
11111
|
/** Delete one function by name; answers {success, deleted}, 404 when no such function (function.delete; DELETE /v1/functions/{name}) */
|
|
10065
11112
|
delete(input: FunctionDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<FunctionDeleteResult>;
|
|
10066
|
-
/** Deploy one function now, outside a version: body name and
|
|
10067
|
-
deploy(input
|
|
11113
|
+
/** Deploy one function now, outside a version: body name and its source (required): script for JavaScript, or rust for a Rust function's source, which the server compiles; optional main, routes (like 'GET /orders/:id' or 'ANY /hooks/*'), vars, bindings and deploy_nodes. The source is compiled to a handler first; a source that does not compile, or that calls require(), is refused and nothing changes. On success it is live at once and the answer is the function's metadata (id, content_hash, routes, env_vars, bindings). To ship several functions together, or to try them first, use version.create, sandbox.create and version.live.set; function.check shows the problems without writing (function.deploy; POST /v1/functions) */
|
|
11114
|
+
deploy(input?: FunctionDeployInput, options?: SubstrioCallOptions<'POST'>): Promise<FunctionDeployResult>;
|
|
10068
11115
|
environment: {
|
|
10069
11116
|
/** Delete one environment variable of a function: the route's {name} and {key}, optional body expected_hash (the content_hash you last read; a function that changed since is refused). Takes effect on the next call; answers the function's metadata (function.environment.delete; DELETE /v1/functions/{name}/env/{key}) */
|
|
10070
11117
|
delete(input: FunctionEnvironmentDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<FunctionEnvironmentDeleteResult>;
|
|
@@ -10075,7 +11122,7 @@ export interface SubstrioOperations {
|
|
|
10075
11122
|
};
|
|
10076
11123
|
/** Read the errors the app's functions threw, newest first: each has an id (also a cursor), function, revision (the function's newest revision when it threw), request_id, timestamp, error name, message and the stack as frames (function, file, line, column). Options: function, request_id, revision (only errors of one deploy), since and until (Unix seconds), limit and cursor. Answers errors, count and next_cursor. Check the revision against version.log with the function path: a deploy that fixed a bug stops adding errors under the new revision (function.errors; GET /v1/_function_errors) */
|
|
10077
11124
|
errors(input?: FunctionErrorsInput, options?: SubstrioCallOptions<'GET'>): Promise<FunctionErrorsResult>;
|
|
10078
|
-
/** Run a Lua script against the tenant's default key-value store, Redis style
|
|
11125
|
+
/** Run a Lua script against the tenant's default key-value store, Redis style, in a build with the Redis frontend (not in this release, where the Redis frontend is a build switch, off, and the call answers NOT_IMPLEMENTED). Body script (or sha of a script loaded earlier with load:true, which answers {sha}), keys and args as arrays of strings. Answers {result}. This is Lua over key-value data, not JavaScript: to run JavaScript use function.invoke, route.call or function.execute_inline (function.eval; POST /v1/eval) */
|
|
10079
11126
|
eval(input?: FunctionEvalInput, options?: SubstrioCallOptions<'POST'>): Promise<FunctionEvalResult>;
|
|
10080
11127
|
/** Run inline JavaScript in the app's runtime: body code (required, not empty). It runs with the caller's own permissions through the same data API a function uses, and nothing is deployed or stored. For a deployed function use function.invoke; to check source without running it use function.check (function.execute_inline; POST /v1/_exec) */
|
|
10081
11128
|
execute_inline(input: FunctionExecuteInlineInput, options?: SubstrioCallOptions<'POST'>): Promise<FunctionExecuteInlineResult>;
|
|
@@ -10104,13 +11151,13 @@ export interface SubstrioOperations {
|
|
|
10104
11151
|
};
|
|
10105
11152
|
};
|
|
10106
11153
|
source: {
|
|
10107
|
-
/** Replace one byte range or one exclusive line range of a function's source: body replacement, an approval_token from function.source.preview (required: preview the patch first), the range, and expected_hash (defaults to the current content_hash; a source that changed since is refused with 409). The edited source is compiled before it is stored (function.source.edit; PATCH /v1/functions/{name}/source) */
|
|
11154
|
+
/** Replace one byte range or one exclusive line range of a function's source: body replacement, an approval_token from function.source.preview (required: preview the patch first), the range, and expected_hash (defaults to the current content_hash; a source that changed since is refused with 409). The edited source is compiled before it is stored, JavaScript or Rust (a Rust edit that does not compile is RUST_COMPILE_FAILED with rustc's diagnostics, and the function keeps serving its last source) (function.source.edit; PATCH /v1/functions/{name}/source) */
|
|
10108
11155
|
edit(input: FunctionSourceEditInput, options?: SubstrioCallOptions<'PATCH'>): Promise<FunctionSourceEditResult>;
|
|
10109
11156
|
/** Preview and approve one bounded function source edit (function.source.preview; POST /v1/functions/{name}/source/preview) */
|
|
10110
11157
|
preview(input: FunctionSourcePreviewInput, options?: SubstrioCallOptions<'POST'>): Promise<FunctionSourcePreviewResult>;
|
|
10111
11158
|
/** Read a bounded line range from the current function source (function.source.read; GET /v1/functions/{name}/source) */
|
|
10112
11159
|
read(input: FunctionSourceReadInput, options?: SubstrioCallOptions<'GET'>): Promise<FunctionSourceReadResult>;
|
|
10113
|
-
/** Replace one function's whole source with a compare-and-swap: body script (required, compiled before it is stored), optional expected_hash (the content_hash you last read; it defaults to the current one, and a source that changed since is refused with a conflict), main, routes, vars, bindings and deploy_nodes. Fields left out keep their values; an empty array clears. The function must exist (404). Answers the function's metadata (function.source.replace; PUT /v1/functions/{name}/source) */
|
|
11160
|
+
/** Replace one function's whole source with a compare-and-swap: body script for a JavaScript function or rust for a Rust one (required, compiled before it is stored; a replace keeps the function's language), optional expected_hash (the content_hash you last read; it defaults to the current one, and a source that changed since is refused with a conflict), main, routes, vars, bindings and deploy_nodes. Fields left out keep their values; an empty array clears. The function must exist (404). Answers the function's metadata (function.source.replace; PUT /v1/functions/{name}/source) */
|
|
10114
11161
|
replace(input: FunctionSourceReplaceInput, options?: SubstrioCallOptions<'PUT'>): Promise<FunctionSourceReplaceResult>;
|
|
10115
11162
|
/** Search bounded source snippets in the current function (function.source.search; GET /v1/functions/{name}/search) */
|
|
10116
11163
|
search(input: FunctionSourceSearchInput, options?: SubstrioCallOptions<'GET'>): Promise<FunctionSourceSearchResult>;
|
|
@@ -10123,7 +11170,7 @@ export interface SubstrioOperations {
|
|
|
10123
11170
|
};
|
|
10124
11171
|
/** Enable or disable one function without deleting it: body enabled (required boolean). Answers {success, enabled}, 404 when no such function. A disabled function is left out of route.list (function.toggle; POST /v1/functions/{name}/toggle) */
|
|
10125
11172
|
toggle(input: FunctionToggleInput, options?: SubstrioCallOptions<'POST'>): Promise<FunctionToggleResult>;
|
|
10126
|
-
/** Replace one function's source: PATCH with the body function.deploy takes (script is required); the name comes from the path and a name in the body is ignored. A source that does not compile to a handler is refused with 400 and nothing changes. On success it is live at once and the answer is the function's metadata. For a change to part of the source use function.source.edit (function.update; PATCH /v1/functions/{name}) */
|
|
11173
|
+
/** Replace one function's source: PATCH with the body function.deploy takes (script or rust is required); the name comes from the path and a name in the body is ignored. A source that does not compile to a handler is refused with 400 and nothing changes. On success it is live at once and the answer is the function's metadata. For a change to part of the source use function.source.edit (function.update; PATCH /v1/functions/{name}) */
|
|
10127
11174
|
update(input: FunctionUpdateInput, options?: SubstrioCallOptions<'PATCH'>): Promise<FunctionUpdateResult>;
|
|
10128
11175
|
};
|
|
10129
11176
|
graph: {
|
|
@@ -10157,6 +11204,14 @@ export interface SubstrioOperations {
|
|
|
10157
11204
|
get(input: HostGetInput, options?: SubstrioCallOptions<'GET'>): Promise<HostGetResult>;
|
|
10158
11205
|
/** List the hosts of the manifest in id order, each with its state, location, group settings, labels and key fingerprint (never the key) (host.list; GET /v1/_hosts) */
|
|
10159
11206
|
list(input?: HostListInput, options?: SubstrioCallOptions<'GET'>): Promise<HostListResult>;
|
|
11207
|
+
node: {
|
|
11208
|
+
/** Install a packed release on a host as a node (a new slot) or onto an existing node (its slot): the release streams over the host's SSH into the release's own installer, which preflights, installs the unit, health checks and rolls back. Refused before anything is copied with HOST_NOT_PROBED, HOST_NO_SYSTEMD, HOST_NGINX_PRESENT, RELEASE_NOT_FOUND, RELEASE_NOT_PACKED, RELEASE_ISA_UNKNOWN, HOST_CPU_MISSING (the detail names the features), HOST_NODE_LIMIT or NODE_BUSY. Answers 202 with the node as it stands; host.node.list then answers running, failed or rolled_back (host.node.deploy; POST /v1/_hosts/{id}/nodes) */
|
|
11209
|
+
deploy(input: HostNodeDeployInput, options?: SubstrioCallOptions<'POST'>): Promise<HostNodeDeployResult>;
|
|
11210
|
+
/** List the nodes installed on a host in slot order, each with its slot, port, state (deploying, running, failed, rolled_back, undeploying), the release last asked of it and when. A run that stays deploying for 30 minutes reads failed (host.node.list; GET /v1/_hosts/{id}/nodes) */
|
|
11211
|
+
list(input: HostNodeListInput, options?: SubstrioCallOptions<'GET'>): Promise<HostNodeListResult>;
|
|
11212
|
+
/** Stop and remove a node's service and unit on a host; its data folder stays. Refused with HOST_HAS_APPS for the last node of a host while apps are placed on it and NODE_BUSY while its run is under way. Answers 202 with the node as it stands (host.node.undeploy; DELETE /v1/_hosts/{id}/nodes/{slot}) */
|
|
11213
|
+
undeploy(input: HostNodeUndeployInput, options?: SubstrioCallOptions<'DELETE'>): Promise<HostNodeUndeployResult>;
|
|
11214
|
+
};
|
|
10160
11215
|
/** Probe a host over its orchestrator's SSH, read only: whether it runs its own kernel (bare metal, kvm, another VM) or shares one (openvz, lxc, another container), systemd, the zram module, and zram swap active with zstd. Answers 202 with the host as it stands; the run lands on the host record in one transaction, and host.get answers virt, capabilities, probe (ok, unreachable, failed) and probed_at (host.probe; POST /v1/_hosts/{id}/probe) */
|
|
10161
11216
|
probe(input: HostProbeInput, options?: SubstrioCallOptions<'POST'>): Promise<HostProbeResult>;
|
|
10162
11217
|
/** Remove a host and its sealed key from the manifest; refused with HOST_HAS_NODES while it carries nodes and HOST_HAS_APPS while apps are placed on it (tenant.place moves them). Answers 204 with no body (host.remove; DELETE /v1/_hosts/{id}) */
|
|
@@ -10174,6 +11229,14 @@ export interface SubstrioOperations {
|
|
|
10174
11229
|
/** List the indexes of the SQL tables with each one's value-key state: state ready (every row has its key and every write keeps it), building (a first query is posting the keys now) or none (no key kept; reason says why; a failed build reports none and the engine retries it). Pass table for one table. A collection's field is keyed by its first query, or declared with index.create kind collection: pass kind collection with collection and field to read whether the field is declared (unique, or indexed: a unique field is indexed too) and its key state and the reason it has no key; without field it lists every field the collection declares. Pass kind conflicts with collection and field (or fields, a JSON array, for a compound, with nulls skip or count) to list what stops the field from being declared unique (a declaration over duplicates answers INDEX_DUPLICATES with the first and the count): {conflicts: [{_id, value}], count, next_cursor}, the documents that hold a value another document holds, in id order, paged with limit and cursor; it builds the field's keys when they are not kept yet. Pass kind space to list the unique spaces: {spaces: [{space, members: [{collection, field}]}], count}. Pass kind expiry with collection to read the collection's expiry declaration {field, after_ms, armed_ms}. A collection's keyword and element declarations are listed beside its fields, each its own entry: keyword true with keyword_term_bytes, or elements (the tuple's members), with state and reason. Pass kind aggregate with collection to list the collection's declared live aggregates (index.create kind aggregate): {name, group, metrics, where, state} (index.list; GET /v1/_indexes) */
|
|
10175
11230
|
list(input?: IndexListInput, options?: SubstrioCallOptions<'GET'>): Promise<IndexListResult>;
|
|
10176
11231
|
};
|
|
11232
|
+
jet: {
|
|
11233
|
+
key: {
|
|
11234
|
+
/** Make a key of one of the account's apps scoped to one jet; the secret is returned once. The jet sees each call as that app (request.auth.app) and meters it to the account's plan, the app's own use counted beside; removing the app revokes the key. With origins the key is publishable (safe in a page's source, answering only those origins). An unscoped account key may make one; a scoped key may not (jet.key.create; POST /v1/_accounts/{id}/apps/{slug}/jets/{jet}/keys) */
|
|
11235
|
+
create(input: JetKeyCreateInput, options?: SubstrioCallOptions<'POST'>): Promise<JetKeyCreateResult>;
|
|
11236
|
+
};
|
|
11237
|
+
/** List the jets of one of the account's apps: each jet's menu in the app's dashboard (app_nav: its pages, each a list, form or detail over the jet's own routes), the account's plan and use there (every app summed: the limit is the account's) and this app's own use this day and month (jet.list; GET /v1/_accounts/{id}/apps/{slug}/jets) */
|
|
11238
|
+
list(input: JetListInput, options?: SubstrioCallOptions<'GET'>): Promise<JetListResult>;
|
|
11239
|
+
};
|
|
10177
11240
|
job: {
|
|
10178
11241
|
/** Cancel one running background job by id: answers the job; 404 when no such job, and refused when it already ended (job.cancel; POST /v1/_jobs/{id}/cancel) */
|
|
10179
11242
|
cancel(input: JobCancelInput, options?: SubstrioCallOptions<'POST'>): Promise<JobCancelResult>;
|
|
@@ -10421,6 +11484,8 @@ export interface SubstrioOperations {
|
|
|
10421
11484
|
/** Put an account on one of the tenant's plans (plans.account.set; PUT /v1/_plans/accounts/{account}) */
|
|
10422
11485
|
set(input: PlansAccountSetInput, options?: SubstrioCallOptions<'PUT'>): Promise<PlansAccountSetResult>;
|
|
10423
11486
|
};
|
|
11487
|
+
/** Read every plan sold, with no account and no person data: the Substrio plans (each with the jet plan it bundles per jet) and every featured app's (jet's) own plans, each with its limits and standalone price, each plans file as plans.get answers it. The sites build their prices from this. No key needed (plans.catalog; GET /v1/_billing/catalog) */
|
|
11488
|
+
catalog(input?: PlansCatalogInput, options?: SubstrioCallOptions<'GET'>): Promise<PlansCatalogResult>;
|
|
10424
11489
|
/** Delete the app's plans file: every plan definition is gone and cannot be restored by this call (keep the plans.get answer to put it back with plans.set). Answers 204 with no body; accounts keep no plan and fall back to the default (plans.delete; DELETE /v1/_plans) */
|
|
10425
11490
|
delete(input?: PlansDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<PlansDeleteResult>;
|
|
10426
11491
|
/** Read the app's plans file: the plans an account can be put on, each with its limits and features. Answers 404 when no plans are set, so a first plans.set is a create, not an update (plans.get; GET /v1/_plans) */
|
|
@@ -10430,10 +11495,10 @@ export interface SubstrioOperations {
|
|
|
10430
11495
|
};
|
|
10431
11496
|
platform: {
|
|
10432
11497
|
audit: {
|
|
10433
|
-
/** Read the
|
|
11498
|
+
/** Read the server-wide audit trail (tenant create, update and delete, platform settings, shared providers, key rotations), newest first; the filters, limit and cursor of audit.list (platform.audit.list; GET /v1/_platform/audit) */
|
|
10434
11499
|
list(input?: PlatformAuditListInput, options?: SubstrioCallOptions<'GET'>): Promise<PlatformAuditListResult>;
|
|
10435
11500
|
};
|
|
10436
|
-
/** Read the
|
|
11501
|
+
/** Read the account and host counts for the operator, each kept with the accounts and hosts it counts (platform.counts; GET /v1/_platform/counts) */
|
|
10437
11502
|
counts(input?: PlatformCountsInput, options?: SubstrioCallOptions<'GET'>): Promise<PlatformCountsResult>;
|
|
10438
11503
|
setting: {
|
|
10439
11504
|
/** Set one platform setting on the running server; it takes effect at once, is kept in the system database and wins over substrio.conf. The server-wide runtime limits (jsc.*, queue.*, objects.*) are set here; an empty value unsets one, restoring its default (platform.setting.set; PUT /v1/_platform/settings/{key}) */
|
|
@@ -10444,7 +11509,7 @@ export interface SubstrioOperations {
|
|
|
10444
11509
|
get(input?: PlatformSettingsGetInput, options?: SubstrioCallOptions<'GET'>): Promise<PlatformSettingsGetResult>;
|
|
10445
11510
|
};
|
|
10446
11511
|
usage: {
|
|
10447
|
-
/** Read the
|
|
11512
|
+
/** Read the KPI history of every app on this server for the operator, oldest first: one point per finished minute (step=minute, the default) or hour (step=hour), each with what every app's API requests (total, status classes 2xx to 5xx, latency buckets and percentiles) and function calls added in it, summed as each app's minute is written. since and until are Unix seconds (default: the last hour of minutes, or the last two days of hours); limit caps the points. Counted on the node that answers; platform calls (no app) are not counted (platform.usage.history; GET /v1/_platform/usage/history) */
|
|
10448
11513
|
history(input?: PlatformUsageHistoryInput, options?: SubstrioCallOptions<'GET'>): Promise<PlatformUsageHistoryResult>;
|
|
10449
11514
|
};
|
|
10450
11515
|
};
|
|
@@ -10514,6 +11579,16 @@ export interface SubstrioOperations {
|
|
|
10514
11579
|
/** Put a name back to a version its own log holds (the route's {kind} and {name}): name the version, or the log entry by sequence. A name that was deleted is made again, and one that still lives is moved, which is itself one more log entry. A tag is never moved, only made again at the version it marked. Answers {name, version, previous} (ref.restore; POST /v1/_refs/{kind}/{name}/restore) */
|
|
10515
11580
|
restore(input: RefRestoreInput, options?: SubstrioCallOptions<'POST'>): Promise<RefRestoreResult>;
|
|
10516
11581
|
};
|
|
11582
|
+
region: {
|
|
11583
|
+
/** List the regions an app can be created in: those that are available and serving, each with its slug, public name and country. Empty until a region serves. Pass a slug as region to account.app.create to place the app there (region.choices; GET /v1/_accounts/{id}/regions) */
|
|
11584
|
+
choices(input: RegionChoicesInput, options?: SubstrioCallOptions<'GET'>): Promise<RegionChoicesResult>;
|
|
11585
|
+
/** List the regions in id order, each with its slug, public name, country, state (available or hidden) and whether it is serving (answers app traffic; the operator cannot set that) (region.list; GET /v1/_regions) */
|
|
11586
|
+
list(input?: RegionListInput, options?: SubstrioCallOptions<'GET'>): Promise<RegionListResult>;
|
|
11587
|
+
/** Remove a region by slug; refused with REGION_IN_USE while a host names it. Answers 204 with no body (region.remove; DELETE /v1/_regions/{slug}) */
|
|
11588
|
+
remove(input: RegionRemoveInput, options?: SubstrioCallOptions<'DELETE'>): Promise<RegionRemoveResult>;
|
|
11589
|
+
/** Create the region of this slug (the name is required) or change its name, country or state; a field left out keeps its value. A host joins a region through host.update (region.set; PUT /v1/_regions/{slug}) */
|
|
11590
|
+
set(input: RegionSetInput, options?: SubstrioCallOptions<'PUT'>): Promise<RegionSetResult>;
|
|
11591
|
+
};
|
|
10517
11592
|
release: {
|
|
10518
11593
|
/** List this host's platform releases, newest first: every folder of <root>/releases holding the server binary (the folder's name is the commit it was built from, with the binary's size and time), which one this process runs, which one the current link names (the next restart's) and which one the previous link names (a rollback's), and restart_pending when current is not the running one. A release is switched on the host by deploy-stax.sh, which health-checks it and rolls back (release.list; GET /v1/_releases) */
|
|
10519
11594
|
list(input?: ReleaseListInput, options?: SubstrioCallOptions<'GET'>): Promise<ReleaseListResult>;
|
|
@@ -10531,9 +11606,9 @@ export interface SubstrioOperations {
|
|
|
10531
11606
|
update(input: RoleUpdateInput, options?: SubstrioCallOptions<'PATCH' | 'PUT'>): Promise<RoleUpdateResult>;
|
|
10532
11607
|
};
|
|
10533
11608
|
root_domain: {
|
|
10534
|
-
/** Add a root domain (onstax.com)
|
|
11609
|
+
/** Add a root domain (onstax.com) that apps answer under as <slug>.<root> and their test hosts as <label>.<root>: stored before the call answers, published to the front as *.<root> and, when the platform has a DNS-01 token, its wildcard certificate requested from the configured ACME provider. Answers 201 with domain, enabled, source, hosts and added_at; KEY_EXISTS (field domain) when the platform has it, INVALID_ARGUMENT (field domain) when it is not a domain (root_domain.add; POST /v1/_root_domains) */
|
|
10535
11610
|
add(input: RootDomainAddInput, options?: SubstrioCallOptions<'POST'>): Promise<RootDomainAddResult>;
|
|
10536
|
-
/** List the
|
|
11611
|
+
/** List the root domains: those of substrio.conf (source config) then the ones added (source admin), each with enabled and its count of test hosts (root_domain.list; GET /v1/_root_domains) */
|
|
10537
11612
|
list(input?: RootDomainListInput, options?: SubstrioCallOptions<'GET'>): Promise<RootDomainListResult>;
|
|
10538
11613
|
/** Remove an added root domain; refused ROOT_DOMAIN_IN_USE (hosts: the count) while a test host is bound under it, UNSUPPORTED_OPERATION (field domain) for one of substrio.conf. Answers 204 (root_domain.remove; DELETE /v1/_root_domains/{domain}) */
|
|
10539
11614
|
remove(input: RootDomainRemoveInput, options?: SubstrioCallOptions<'DELETE'>): Promise<RootDomainRemoveResult>;
|
|
@@ -10570,7 +11645,7 @@ export interface SubstrioOperations {
|
|
|
10570
11645
|
clear(input?: SandboxStubClearInput, options?: SubstrioCallOptions<'DELETE'>): Promise<SandboxStubClearResult>;
|
|
10571
11646
|
/** Read a test tenant's stubs, with how often each answered, and every fetch its functions made since the last clear (method, URL, headers, body, the tenant's clock, stubbed or unmatched) (sandbox.stub.list; GET /v1/_stubs) */
|
|
10572
11647
|
list(input?: SandboxStubListInput, options?: SubstrioCallOptions<'GET'>): Promise<SandboxStubListResult>;
|
|
10573
|
-
/** Stub one outbound request of a test tenant: its functions' fetch() of the given method, origin and path resolves with the stub's status, headers and body instead of going out. Only a test tenant
|
|
11648
|
+
/** Stub one outbound request of a test tenant: its functions' fetch() of the given method, origin and path resolves with the stub's status, headers and body instead of going out. Only a test tenant takes stubs, any other is refused with TEST_TENANT_REQUIRED. The newest matching stub that is not spent answers; a fetch no stub matches is rejected. Answers {id} (sandbox.stub.set; POST /v1/_stubs) */
|
|
10574
11649
|
set(input: SandboxStubSetInput, options?: SubstrioCallOptions<'POST'>): Promise<SandboxStubSetResult>;
|
|
10575
11650
|
};
|
|
10576
11651
|
};
|
|
@@ -10615,7 +11690,7 @@ export interface SubstrioOperations {
|
|
|
10615
11690
|
allowlist(input?: SecurityAllowlistInput, options?: SubstrioCallOptions<'GET' | 'POST' | 'DELETE'>): Promise<SecurityAllowlistResult>;
|
|
10616
11691
|
/** Read the failed sign-ins of the audit trail (action auth.failure in audit.list), newest first: the key id of the key that proved nothing, or the caller's address when no key was presented; since, until, order, limit, cursor, actor_kind and actor filter it (security.audit; GET /v1/_security/audit) */
|
|
10617
11692
|
audit(input?: SecurityAuditInput, options?: SubstrioCallOptions<'GET'>): Promise<SecurityAuditResult>;
|
|
10618
|
-
/** Manage the
|
|
11693
|
+
/** Manage the per-address rate limit (the --rate-limit server option): GET shows it, POST sets max_tokens and tokens_per_second, DELETE with clear turns it off (security.rate_limit; GET /v1/_security/rate_limit) */
|
|
10619
11694
|
rate_limit(input?: SecurityRateLimitInput, options?: SubstrioCallOptions<'GET' | 'POST' | 'DELETE'>): Promise<SecurityRateLimitResult>;
|
|
10620
11695
|
rules: {
|
|
10621
11696
|
/** Delete the app's collection security rules; answers {ok} (security.rules.delete; DELETE /v1/_rules) */
|
|
@@ -10631,7 +11706,7 @@ export interface SubstrioOperations {
|
|
|
10631
11706
|
delete(input: SettingsDeleteInput, options?: SubstrioCallOptions<'DELETE'>): Promise<SettingsDeleteResult>;
|
|
10632
11707
|
/** List the app's settings: answers settings (each {key, value}) and count (settings.get; GET /v1/_settings) */
|
|
10633
11708
|
get(input?: SettingsGetInput, options?: SubstrioCallOptions<'GET'>): Promise<SettingsGetResult>;
|
|
10634
|
-
/** Set one app setting: body key and value (a string, or true or false). Any key is stored; substrio reads changes.history (keep change history so change streams can resume) and webhooks.brand (the webhook signature and delivery id header names, <brand>-Signature and <brand>-Delivery-Id) and the delivery settings webhooks.max_attempts, webhooks.backoff_ms, triggers.max_attempts, triggers.backoff_ms, cron.max_attempts, cron.backoff_ms, delivery.backoff_cap_ms (milliseconds) and delivery.retain_days (days a delivered record stays replayable, 0 keeps none), each a whole number (the attempt counts at least 1), and refuses a value that does not suit them. A server-wide runtime limit (jsc.*, queue.*, objects.*) is a platform setting and is refused here with SETTING_IS_PLATFORM
|
|
11709
|
+
/** Set one app setting: body key and value (a string, or true or false). Any key is stored; substrio reads changes.history (keep change history so change streams can resume) and webhooks.brand (the webhook signature and delivery id header names, <brand>-Signature and <brand>-Delivery-Id) and the delivery settings webhooks.max_attempts, webhooks.backoff_ms, triggers.max_attempts, triggers.backoff_ms, cron.max_attempts, cron.backoff_ms, delivery.backoff_cap_ms (milliseconds) and delivery.retain_days (days a delivered record stays replayable, 0 keeps none), each a whole number (the attempt counts at least 1), and refuses a value that does not suit them. A server-wide runtime limit (jsc.*, queue.*, objects.*) is a platform setting and is refused here with SETTING_IS_PLATFORM (settings.set; PUT /v1/_settings) */
|
|
10635
11710
|
set(input: SettingsSetInput, options?: SubstrioCallOptions<'PUT' | 'POST'>): Promise<SettingsSetResult>;
|
|
10636
11711
|
};
|
|
10637
11712
|
site: {
|
|
@@ -10655,6 +11730,8 @@ export interface SubstrioOperations {
|
|
|
10655
11730
|
move(input: SourceMoveInput, options?: SubstrioCallOptions<'POST'>): Promise<SourceMoveResult>;
|
|
10656
11731
|
/** Search the text units of a version (the route's {version}) for pattern: exact bytes, or a regular expression with regex:true (linear time, line by line). glob narrows the files; context adds lines before and after. Answers {version, matches: [{path, line, text, before, after}], count, truncated}, bounded by max_matches and max_bytes (source.search; GET /v1/_commits/{version}/search) */
|
|
10657
11732
|
search(input: SourceSearchInput, options?: SubstrioCallOptions<'GET'>): Promise<SourceSearchResult>;
|
|
11733
|
+
/** Run one shell command over the app, the way you work on a checkout: no process, a POSIX shell subset interpreted in the server. Mounts: /src is the branch's tree (writable, default main, the starting directory), /site the live release's site/ (read only), /files the app's stored files (writable; rm there is refused, file.delete does it). Any other path is refused. Builtins: grep (-r -n -l -L -c -i -v -w -o -q -E -F -A -B -C -m --include --exclude), sed (-n -E -i -e, addresses N $ /re/ ranges !, s///g with \1 groups, p d q a i c y { }), find (-name -iname -path -type -maxdepth -mindepth -empty -exec {} + -delete), cat, head, tail, wc, sort, uniq, cut, tr, diff (unified), ls, cd, pwd, mv, cp, rm, mkdir, touch, echo, printf, tee, test and [ ], xargs, basename, dirname, true, false, commit -m, and js (a script in the app's own runtime with fs.readFile, writeFile, readdir, stat, exists, rm, rename, mkdir on the same mounts; input is stdin). Variables: $PWD $HOME $SRC $SITE $FILES $BRANCH $?. Every /src change of one call lands as ONE commit (message: the command, or commit -m) when the command ends with status 0; any other status, or any refusal, lands nothing. No state is kept between calls. Answers {stdout, stderr, exit_code, offset, truncated, next_offset, commit: {version, number, changed}}; output past the budget is cut with truncated:true and continued with offset. Examples: grep -rn 'TODO' /src; sed -n 10,40p src/app.js; find /src/functions -name '*.js' | xargs sed -i 's/oldName/newName/g'; cat > /src/site/about.html <<'EOF' (lines) EOF; js 'fs.writeFile("notes.txt", input.toUpperCase())' < notes.txt (source.shell; POST /v1/_source/shell) */
|
|
11734
|
+
shell(input: SourceShellInput, options?: SubstrioCallOptions<'POST'>): Promise<SourceShellResult>;
|
|
10658
11735
|
/** List the paths a version holds (the route's {version}: an id, a number, a branch, live or a sandbox name), ordered by path, each with its kind (file or dir). prefix walks only that directory; glob keeps the files whose path matches (* and ? also match /); sizes:true adds each file's size. Answers {version, entries, count} (source.tree; GET /v1/_commits/{version}/tree) */
|
|
10659
11736
|
tree(input: SourceTreeInput, options?: SubstrioCallOptions<'GET'>): Promise<SourceTreeResult>;
|
|
10660
11737
|
};
|
|
@@ -10664,6 +11741,14 @@ export interface SubstrioOperations {
|
|
|
10664
11741
|
/** Describe the SQL catalog from the engine's typed descriptors: tables and views with columns (name, declared type, nullable, default, key, generated), indexes (columns with order, unique), foreign keys, and routines; pass table for one table (sql.schema; GET /v1/_sql/schema) */
|
|
10665
11742
|
schema(input?: SqlSchemaInput, options?: SubstrioCallOptions<'GET'>): Promise<SqlSchemaResult>;
|
|
10666
11743
|
};
|
|
11744
|
+
subscriptions: {
|
|
11745
|
+
/** End one of the signed-in person's own subscriptions now: a paid one leaves the account's provider subscription that pays it (that line, or the whole subscription when it was the last) and the person falls back to what else they hold there (a bundle's plan, else the app's default). A bundle child ends only with its Substrio plan (SUBSCRIPTION_NOT_FOUND). The person's own session only, never a key or an agent (SUBSCRIPTION_PERSON_REQUIRED). Answers the subscription, ended (subscriptions.cancel; POST /v1/_subscriptions/{id}/cancel) */
|
|
11746
|
+
cancel(input: SubscriptionsCancelInput, options?: SubstrioCallOptions<'POST'>): Promise<SubscriptionsCancelResult>;
|
|
11747
|
+
/** List an app's subscribers a page at a time: every subscription to its plans (a purchase, a bundle child of a Substrio plan, or a grant), by subject (an account, a person, or an app's own user) and id. The caller's own app, or (app) another app of the same owning account; any other app's is refused SUBSCRIBERS_NOT_VISIBLE (subscriptions.list; GET /v1/_subscriptions) */
|
|
11748
|
+
list(input?: SubscriptionsListInput, options?: SubstrioCallOptions<'GET'>): Promise<SubscriptionsListResult>;
|
|
11749
|
+
/** List the signed-in person's own subscriptions at every app, active and ended: what they bought for themselves (a cart for the person), each Substrio plan's bundle children, and the plans apps granted them. A person's session only (at the console or at any app); a key is refused SUBSCRIPTION_PERSON_REQUIRED (subscriptions.mine; GET /v1/_subscriptions/mine) */
|
|
11750
|
+
mine(input?: SubscriptionsMineInput, options?: SubstrioCallOptions<'GET'>): Promise<SubscriptionsMineResult>;
|
|
11751
|
+
};
|
|
10667
11752
|
sync: {
|
|
10668
11753
|
/** Push replication operations (sync.push; POST /v1/_sync) */
|
|
10669
11754
|
push(input?: SyncPushInput, options?: SubstrioCallOptions<'POST'>): Promise<SyncPushResult>;
|
|
@@ -10741,6 +11826,8 @@ export interface SubstrioOperations {
|
|
|
10741
11826
|
rename(input: TenantRenameInput, options?: SubstrioCallOptions<'POST'>): Promise<TenantRenameResult>;
|
|
10742
11827
|
/** Resume a suspended tenant, restoring the state before it was suspended (tenant.resume; POST /v1/_tenants/{slug}/resume) */
|
|
10743
11828
|
resume(input: TenantResumeInput, options?: SubstrioCallOptions<'POST'>): Promise<TenantResumeResult>;
|
|
11829
|
+
/** Read what this app's folder holds on disk (disk_bytes, as of the last fold, each second) by kind (database, files, logs, backups, code, other), its storage limit and the room left (null while no limit is set). The storage limit is held against disk_bytes; tenant.usage's used_bytes and blob_bytes count only document and file bytes (tenant.storage; GET /v1/_storage) */
|
|
11830
|
+
storage(input?: TenantStorageInput, options?: SubstrioCallOptions<'GET'>): Promise<TenantStorageResult>;
|
|
10744
11831
|
/** Suspend a tenant with a typed reason and an optional note (tenant.suspend; POST /v1/_tenants/{slug}/suspend) */
|
|
10745
11832
|
suspend(input: TenantSuspendInput, options?: SubstrioCallOptions<'POST'>): Promise<TenantSuspendResult>;
|
|
10746
11833
|
/** Update tenant configuration (tenant.update; PATCH /v1/_tenants/{slug}) */
|
|
@@ -10750,7 +11837,7 @@ export interface SubstrioOperations {
|
|
|
10750
11837
|
(input: TenantUsageInput, options?: SubstrioCallOptions<'GET'>): Promise<TenantUsageResult>;
|
|
10751
11838
|
/** Read this app's KPI history, oldest first: one point per finished minute (step=minute, the default; kept two days) or hour (step=hour; kept 90 days), each with what the app's function calls added in it (calls, status classes, latency buckets and percentiles, refusals, CPU and wall time) and its stored documents and bytes at its end. since and until are Unix seconds (default: the last hour of minutes, or the last two days of hours); limit caps the points. Counted on the node that answers (tenant.usage.history; GET /v1/_usage/history) */
|
|
10752
11839
|
history(input?: TenantUsageHistoryInput, options?: SubstrioCallOptions<'GET'>): Promise<TenantUsageHistoryResult>;
|
|
10753
|
-
/** Read this tenant's own exact usage and limits: storage bytes, documents, requests per minute (a limit is null until one is set) and the function limits (cpu, memory, concurrency, timeout, body and value sizes)
|
|
11840
|
+
/** Read this tenant's own exact usage and limits: storage bytes, documents, requests per minute (a limit is null until one is set) and the function limits (cpu, memory, concurrency, timeout, body and value sizes), for the tenant the key belongs to (tenant.usage.self; GET /v1/_usage) */
|
|
10754
11841
|
self(input?: TenantUsageSelfInput, options?: SubstrioCallOptions<'GET'>): Promise<TenantUsageSelfResult>;
|
|
10755
11842
|
};
|
|
10756
11843
|
};
|
|
@@ -10847,8 +11934,8 @@ export interface SubstrioOperations {
|
|
|
10847
11934
|
version: {
|
|
10848
11935
|
/** What one commit changed (the route's {version}): every path that differs from the version it is compared against, added, removed or changed, with the object ids on both sides. against names another version (default: the commit's first parent, so the answer is the commit's own change) (version.changes; GET /v1/_commits/{version}/changes) */
|
|
10849
11936
|
changes(input: VersionChangesInput, options?: SubstrioCallOptions<'GET'>): Promise<VersionChangesResult>;
|
|
10850
|
-
/** Check an app version before it is pushed or made live: the body is the version.create body. Runs function.check over every function whose source is uploaded (parsed as script, CommonJS or ES module, with deploy's require() refusal) and answers ok, diagnostics (function, severity, message, line, column) and the blobs still missing. Nothing is stored or run. version.create and version.live.set run this same check unless they are sent check:false (version.check; POST /v1/_versions/_check) */
|
|
10851
|
-
check(input
|
|
11937
|
+
/** Check an app version before it is pushed or made live: the body is the version.create body, or {version} naming one already committed (a number, an id, a branch, live or a sandbox's name; no manifest). Runs function.check over every function whose source is uploaded (parsed as script, CommonJS or ES module, with deploy's require() refusal) and answers ok, diagnostics (function, severity, message, line, column) and the blobs still missing. Nothing is stored or run. version.create and version.live.set run this same check unless they are sent check:false (version.check; POST /v1/_versions/_check) */
|
|
11938
|
+
check(input?: VersionCheckInput, options?: SubstrioCallOptions<'POST'>): Promise<VersionCheckResult>;
|
|
10852
11939
|
/** Write one commit on a branch of the app's history: the units it changes (bytes as text, as base64, or the id of an object the app already holds, such as the hash site.blob.upload answered), the paths it removes, and what it did. This is how a file is written or deleted: one file is {message, units: [{path: "site/index.html", text: "<h1>Hi</h1>"}]}, one removal is {message, removals: ["site/old.css"]}; no hash is computed by the caller. A function is functions/<name>.js with its routes in functions/<name>.json ({"routes": ["GET /hello"]}), a site file site/<path>. The answered number is promotable at once: version.live.set {version: number}, with sandbox to run it there first. mode changes applies them to the parent version, mode snapshot makes the units the whole content. expected is the version the branch must still point at, so a racing commit is refused rather than overwritten. Answers {version, root, number, generation, branch, blobs_written, trees_written} (version.commit; POST /v1/_commits) */
|
|
10853
11940
|
commit(input: VersionCommitInput, options?: SubstrioCallOptions<'POST'>): Promise<VersionCommitResult>;
|
|
10854
11941
|
/** Push an app version: the functions (each by the SHA-256 of its source), rules, MCP manifest, site files, cron, triggers, plans, auth and login settings, and the permission and ledger catalogs (declared first when it goes live, append only). Answers 201 {version, missing, existed}: missing lists the blobs you still have to upload with site.blob.upload, and existed is true when the same content was pushed before. Pushing does not change what is live: make it live with version.live.set. The version is committed on the branch named by branch (main when none is), which is created at this version when it has no version yet. Sources already uploaded are checked like function.check unless check is false; a failing one refuses the push with 400 and its diagnostics (version.create; POST /v1/_versions) */
|