@xano/developer-mcp 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/dist/cli_docs/format.d.ts +12 -0
- package/dist/cli_docs/format.js +98 -0
- package/dist/{api_docs → cli_docs}/index.d.ts +6 -11
- package/dist/cli_docs/index.js +86 -0
- package/dist/cli_docs/topics/function.js +114 -0
- package/dist/cli_docs/topics/integration.d.ts +2 -0
- package/dist/cli_docs/topics/integration.js +157 -0
- package/dist/{api_docs/topics/agent.d.ts → cli_docs/topics/profile.d.ts} +1 -1
- package/dist/cli_docs/topics/profile.js +153 -0
- package/dist/{api_docs/topics/api.d.ts → cli_docs/topics/run.d.ts} +1 -1
- package/dist/cli_docs/topics/run.js +248 -0
- package/dist/cli_docs/topics/start.js +111 -0
- package/dist/cli_docs/topics/static_host.d.ts +2 -0
- package/dist/cli_docs/topics/static_host.js +77 -0
- package/dist/cli_docs/topics/workspace.js +119 -0
- package/dist/cli_docs/types.d.ts +44 -0
- package/dist/cli_docs/types.js +4 -0
- package/dist/index.js +42 -0
- package/dist/xanoscript_docs/README.md +78 -64
- package/dist/xanoscript_docs/apis.md +81 -27
- package/dist/xanoscript_docs/branch.md +13 -13
- package/dist/xanoscript_docs/database.md +57 -17
- package/dist/xanoscript_docs/functions.md +43 -71
- package/dist/xanoscript_docs/performance.md +14 -23
- package/dist/xanoscript_docs/tables.md +47 -1
- package/dist/xanoscript_docs/tools.md +9 -7
- package/dist/xanoscript_docs/types.md +12 -10
- package/package.json +1 -1
- package/dist/api_docs/format.d.ts +0 -5
- package/dist/api_docs/format.js +0 -171
- package/dist/api_docs/index.js +0 -111
- package/dist/api_docs/topics/agent.js +0 -142
- package/dist/api_docs/topics/api.js +0 -176
- package/dist/api_docs/topics/apigroup.d.ts +0 -2
- package/dist/api_docs/topics/apigroup.js +0 -124
- package/dist/api_docs/topics/authentication.d.ts +0 -2
- package/dist/api_docs/topics/authentication.js +0 -61
- package/dist/api_docs/topics/branch.d.ts +0 -2
- package/dist/api_docs/topics/branch.js +0 -73
- package/dist/api_docs/topics/file.d.ts +0 -2
- package/dist/api_docs/topics/file.js +0 -70
- package/dist/api_docs/topics/function.js +0 -164
- package/dist/api_docs/topics/history.d.ts +0 -2
- package/dist/api_docs/topics/history.js +0 -149
- package/dist/api_docs/topics/mcp_server.d.ts +0 -2
- package/dist/api_docs/topics/mcp_server.js +0 -139
- package/dist/api_docs/topics/middleware.d.ts +0 -2
- package/dist/api_docs/topics/middleware.js +0 -156
- package/dist/api_docs/topics/realtime.d.ts +0 -2
- package/dist/api_docs/topics/realtime.js +0 -112
- package/dist/api_docs/topics/start.js +0 -107
- package/dist/api_docs/topics/table.d.ts +0 -2
- package/dist/api_docs/topics/table.js +0 -195
- package/dist/api_docs/topics/task.d.ts +0 -2
- package/dist/api_docs/topics/task.js +0 -165
- package/dist/api_docs/topics/tool.d.ts +0 -2
- package/dist/api_docs/topics/tool.js +0 -150
- package/dist/api_docs/topics/workflows.d.ts +0 -2
- package/dist/api_docs/topics/workflows.js +0 -131
- package/dist/api_docs/topics/workspace.js +0 -153
- package/dist/api_docs/types.d.ts +0 -79
- package/dist/api_docs/types.js +0 -4
- package/dist/templates/init-workspace.d.ts +0 -10
- package/dist/templates/init-workspace.js +0 -278
- package/dist/templates/xanoscript-index.d.ts +0 -11
- package/dist/templates/xanoscript-index.js +0 -72
- package/dist/xanoscript_docs/ephemeral.md +0 -330
- package/dist/xanoscript_docs_auto/README.md +0 -119
- package/dist/xanoscript_docs_auto/agents.md +0 -446
- package/dist/xanoscript_docs_auto/apis.md +0 -517
- package/dist/xanoscript_docs_auto/control-flow.md +0 -543
- package/dist/xanoscript_docs_auto/database.md +0 -551
- package/dist/xanoscript_docs_auto/debugging.md +0 -527
- package/dist/xanoscript_docs_auto/filters.md +0 -464
- package/dist/xanoscript_docs_auto/functions.md +0 -431
- package/dist/xanoscript_docs_auto/integrations.md +0 -657
- package/dist/xanoscript_docs_auto/mcp-servers.md +0 -408
- package/dist/xanoscript_docs_auto/operators.md +0 -368
- package/dist/xanoscript_docs_auto/syntax.md +0 -287
- package/dist/xanoscript_docs_auto/tables.md +0 -447
- package/dist/xanoscript_docs_auto/tasks.md +0 -479
- package/dist/xanoscript_docs_auto/testing.md +0 -574
- package/dist/xanoscript_docs_auto/tools.md +0 -485
- package/dist/xanoscript_docs_auto/triggers.md +0 -595
- package/dist/xanoscript_docs_auto/types.md +0 -323
- package/dist/xanoscript_docs_auto/variables.md +0 -462
- package/dist/xanoscript_docs_auto/version.json +0 -5
- /package/dist/{api_docs → cli_docs}/topics/function.d.ts +0 -0
- /package/dist/{api_docs → cli_docs}/topics/start.d.ts +0 -0
- /package/dist/{api_docs → cli_docs}/topics/workspace.d.ts +0 -0
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
export const workspaceDoc = {
|
|
2
|
-
topic: "workspace",
|
|
3
|
-
title: "Workspace Management",
|
|
4
|
-
description: `Workspaces are the top-level container for all Xano resources. Each workspace contains databases, APIs, functions, tasks, agents, and more.
|
|
5
|
-
|
|
6
|
-
## Key Operations
|
|
7
|
-
- List/get workspaces
|
|
8
|
-
- Export/import workspace data
|
|
9
|
-
- Generate workspace context for AI
|
|
10
|
-
- Get OpenAPI specifications
|
|
11
|
-
- Convert between XanoScript and JSON`,
|
|
12
|
-
ai_hints: `- Use \`getWorkspaceContext\` first to understand workspace structure
|
|
13
|
-
- Export before making major changes (backup)
|
|
14
|
-
- Check branch before modifying (prod vs dev)
|
|
15
|
-
- \`export-schema\` is lighter than \`export\` (schema only vs full data)
|
|
16
|
-
- OpenAPI spec useful for understanding available endpoints`,
|
|
17
|
-
endpoints: [
|
|
18
|
-
{
|
|
19
|
-
method: "GET",
|
|
20
|
-
path: "/workspace",
|
|
21
|
-
tool_name: "listWorkspaces",
|
|
22
|
-
description: "List all accessible workspaces with pagination and filtering.",
|
|
23
|
-
parameters: [
|
|
24
|
-
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
25
|
-
{ name: "per_page", type: "integer", default: 50, description: "Items per page (max 10000)" },
|
|
26
|
-
{ name: "search", type: "string", description: "Search by workspace name" },
|
|
27
|
-
{ name: "sort", type: "string", enum: ["id", "name", "created_at"], default: "created_at", description: "Sort field" },
|
|
28
|
-
{ name: "order", type: "string", enum: ["asc", "desc"], default: "desc", description: "Sort direction" }
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
method: "GET",
|
|
33
|
-
path: "/workspace/{workspace_id}",
|
|
34
|
-
tool_name: "getWorkspace",
|
|
35
|
-
description: "Get details of a specific workspace.",
|
|
36
|
-
parameters: [
|
|
37
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
method: "POST",
|
|
42
|
-
path: "/workspace/{workspace_id}/export-schema",
|
|
43
|
-
tool_name: "exportWorkspaceSchema",
|
|
44
|
-
description: "Export database schemas and branch configuration only (lighter than full export).",
|
|
45
|
-
parameters: [
|
|
46
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
47
|
-
{ name: "password", type: "string", description: "Optional encryption password" }
|
|
48
|
-
]
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
method: "POST",
|
|
52
|
-
path: "/workspace/{workspace_id}/export",
|
|
53
|
-
tool_name: "exportWorkspace",
|
|
54
|
-
description: "Export complete workspace data and configuration including APIs, functions, data.",
|
|
55
|
-
parameters: [
|
|
56
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
57
|
-
{ name: "password", type: "string", description: "Optional encryption password" }
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
method: "POST",
|
|
62
|
-
path: "/workspace/{workspace_id}/import",
|
|
63
|
-
tool_name: "importWorkspace",
|
|
64
|
-
description: "Import and restore workspace content from an export file.",
|
|
65
|
-
parameters: [
|
|
66
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
67
|
-
],
|
|
68
|
-
request_body: {
|
|
69
|
-
type: "multipart/form-data",
|
|
70
|
-
properties: {
|
|
71
|
-
file: { type: "file", description: "Export file to import", required: true },
|
|
72
|
-
password: { type: "string", description: "Decryption password if encrypted" }
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
method: "POST",
|
|
78
|
-
path: "/workspace/{workspace_id}/import-schema",
|
|
79
|
-
tool_name: "importWorkspaceSchema",
|
|
80
|
-
description: "Import database schema into a new branch.",
|
|
81
|
-
parameters: [
|
|
82
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
83
|
-
],
|
|
84
|
-
request_body: {
|
|
85
|
-
type: "multipart/form-data",
|
|
86
|
-
properties: {
|
|
87
|
-
file: { type: "file", description: "Schema export file", required: true },
|
|
88
|
-
password: { type: "string", description: "Decryption password if encrypted" }
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
method: "GET",
|
|
94
|
-
path: "/workspace/{workspace_id}/openapi",
|
|
95
|
-
tool_name: "getWorkspaceOpenAPI",
|
|
96
|
-
description: "Get OpenAPI v3 specification for all APIs in the workspace.",
|
|
97
|
-
parameters: [
|
|
98
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
method: "GET",
|
|
103
|
-
path: "/workspace/{workspace_id}/context",
|
|
104
|
-
tool_name: "getWorkspaceContext",
|
|
105
|
-
description: "Generate complete workspace context map for AI agents. Essential for understanding workspace structure.",
|
|
106
|
-
parameters: [
|
|
107
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
108
|
-
{ name: "format", type: "string", enum: ["json", "yaml"], default: "json", description: "Output format" },
|
|
109
|
-
{ name: "user_descriptions", type: "boolean", default: false, description: "Include user-provided descriptions" },
|
|
110
|
-
{ name: "ai_descriptions", type: "boolean", default: false, description: "Include AI-generated descriptions" }
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
method: "POST",
|
|
115
|
-
path: "/workspace/{workspace_id}/convert/fromXS",
|
|
116
|
-
tool_name: "convertFromXanoScript",
|
|
117
|
-
description: "Convert XanoScript code to JSON format for programmatic manipulation.",
|
|
118
|
-
parameters: [
|
|
119
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
120
|
-
],
|
|
121
|
-
request_body: {
|
|
122
|
-
type: "text/x-xanoscript",
|
|
123
|
-
description: "XanoScript code to convert"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
method: "POST",
|
|
128
|
-
path: "/workspace/{workspace_id}/convert/toXS",
|
|
129
|
-
tool_name: "convertToXanoScript",
|
|
130
|
-
description: "Convert JSON to XanoScript format for human-readable code.",
|
|
131
|
-
parameters: [
|
|
132
|
-
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
133
|
-
],
|
|
134
|
-
request_body: {
|
|
135
|
-
type: "application/json",
|
|
136
|
-
description: "JSON structure to convert to XanoScript"
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
],
|
|
140
|
-
schemas: {
|
|
141
|
-
Workspace: {
|
|
142
|
-
type: "object",
|
|
143
|
-
properties: {
|
|
144
|
-
id: { type: "integer", description: "Unique workspace ID" },
|
|
145
|
-
name: { type: "string", description: "Workspace name" },
|
|
146
|
-
description: { type: "string", description: "Workspace description" },
|
|
147
|
-
created_at: { type: "string", format: "date-time" },
|
|
148
|
-
updated_at: { type: "string", format: "date-time" }
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
related_topics: ["apigroup", "table", "function", "branch"]
|
|
153
|
-
};
|
package/dist/api_docs/types.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type definitions for Xano Meta API documentation
|
|
3
|
-
*/
|
|
4
|
-
export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";
|
|
5
|
-
export interface ParameterDoc {
|
|
6
|
-
name: string;
|
|
7
|
-
type: string;
|
|
8
|
-
required?: boolean;
|
|
9
|
-
default?: unknown;
|
|
10
|
-
description: string;
|
|
11
|
-
enum?: string[];
|
|
12
|
-
in?: "path" | "query" | "header";
|
|
13
|
-
}
|
|
14
|
-
export interface RequestBodyDoc {
|
|
15
|
-
type: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
properties?: Record<string, {
|
|
18
|
-
type: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
required?: boolean;
|
|
21
|
-
}>;
|
|
22
|
-
example?: unknown;
|
|
23
|
-
}
|
|
24
|
-
export interface ResponseDoc {
|
|
25
|
-
type: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
properties?: Record<string, unknown>;
|
|
28
|
-
}
|
|
29
|
-
export interface RequestExampleDoc {
|
|
30
|
-
method: string;
|
|
31
|
-
path: string;
|
|
32
|
-
headers?: Record<string, string>;
|
|
33
|
-
body?: unknown;
|
|
34
|
-
}
|
|
35
|
-
export interface EndpointDoc {
|
|
36
|
-
method: HttpMethod;
|
|
37
|
-
path: string;
|
|
38
|
-
tool_name?: string;
|
|
39
|
-
description: string;
|
|
40
|
-
tags?: string[];
|
|
41
|
-
parameters?: ParameterDoc[];
|
|
42
|
-
request_body?: RequestBodyDoc;
|
|
43
|
-
response?: ResponseDoc;
|
|
44
|
-
example?: RequestExampleDoc;
|
|
45
|
-
}
|
|
46
|
-
export interface ExampleDoc {
|
|
47
|
-
title: string;
|
|
48
|
-
description: string;
|
|
49
|
-
request: {
|
|
50
|
-
method: string;
|
|
51
|
-
path: string;
|
|
52
|
-
headers?: Record<string, string>;
|
|
53
|
-
body?: unknown;
|
|
54
|
-
};
|
|
55
|
-
response?: unknown;
|
|
56
|
-
}
|
|
57
|
-
export interface PatternDoc {
|
|
58
|
-
name: string;
|
|
59
|
-
description?: string;
|
|
60
|
-
steps: string[];
|
|
61
|
-
example?: string;
|
|
62
|
-
}
|
|
63
|
-
export interface TopicDoc {
|
|
64
|
-
topic: string;
|
|
65
|
-
title: string;
|
|
66
|
-
description: string;
|
|
67
|
-
endpoints?: EndpointDoc[];
|
|
68
|
-
examples?: ExampleDoc[];
|
|
69
|
-
related_topics?: string[];
|
|
70
|
-
schemas?: Record<string, unknown>;
|
|
71
|
-
patterns?: PatternDoc[];
|
|
72
|
-
ai_hints?: string;
|
|
73
|
-
}
|
|
74
|
-
export type DetailLevel = "overview" | "detailed" | "examples";
|
|
75
|
-
export interface ApiDocsArgs {
|
|
76
|
-
topic: string;
|
|
77
|
-
detail_level?: DetailLevel;
|
|
78
|
-
include_schemas?: boolean;
|
|
79
|
-
}
|
package/dist/api_docs/types.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template for init_workspace tool documentation
|
|
3
|
-
* Edit this file to update the workspace initialization guide
|
|
4
|
-
*/
|
|
5
|
-
export interface ObjectTypeConfig {
|
|
6
|
-
type: string;
|
|
7
|
-
path: string;
|
|
8
|
-
endpoint: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function generateInitWorkspaceTemplate(objectTypes: ObjectTypeConfig[]): string;
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template for init_workspace tool documentation
|
|
3
|
-
* Edit this file to update the workspace initialization guide
|
|
4
|
-
*/
|
|
5
|
-
export function generateInitWorkspaceTemplate(objectTypes) {
|
|
6
|
-
const objectTypesTable = objectTypes
|
|
7
|
-
.map(({ type, path, endpoint }) => `| \`${type}\` | \`${path}/\` | \`${endpoint}\` |`)
|
|
8
|
-
.join("\n");
|
|
9
|
-
return `# Xano Workspace Initialization Guide
|
|
10
|
-
|
|
11
|
-
This guide explains how to set up a local development workspace that syncs with the Xano Headless API.
|
|
12
|
-
|
|
13
|
-
## Directory Structure
|
|
14
|
-
|
|
15
|
-
Initialize your workspace with these directories:
|
|
16
|
-
|
|
17
|
-
\`\`\`
|
|
18
|
-
your-project/
|
|
19
|
-
├── .xano/
|
|
20
|
-
│ └── registry.json # Tracks all objects and their sync state
|
|
21
|
-
├── functions/ # Custom reusable functions
|
|
22
|
-
│ ├── calculate_total.xs
|
|
23
|
-
│ └── validate_email.xs
|
|
24
|
-
├── tables/ # Database table schemas
|
|
25
|
-
│ ├── user.xs
|
|
26
|
-
│ └── order.xs
|
|
27
|
-
├── tasks/ # Scheduled background tasks
|
|
28
|
-
│ └── cleanup_sessions.xs
|
|
29
|
-
├── apis/ # API groups and endpoints
|
|
30
|
-
│ └── auth/ # API group directory
|
|
31
|
-
│ ├── api_group.xs # Group definition
|
|
32
|
-
│ ├── POST_login.xs # Endpoint: POST /auth/login
|
|
33
|
-
│ └── GET_me.xs # Endpoint: GET /auth/me
|
|
34
|
-
├── tools/ # AI-callable tools
|
|
35
|
-
├── agents/ # AI agents
|
|
36
|
-
├── middlewares/ # Request/response middleware
|
|
37
|
-
├── addons/ # Query addons
|
|
38
|
-
├── mcp_servers/ # MCP servers
|
|
39
|
-
└── realtime/ # Realtime channels
|
|
40
|
-
\`\`\`
|
|
41
|
-
|
|
42
|
-
## Object Types
|
|
43
|
-
|
|
44
|
-
| Type | Directory | API Endpoint |
|
|
45
|
-
|------|-----------|--------------|
|
|
46
|
-
${objectTypesTable}
|
|
47
|
-
|
|
48
|
-
## File Naming Convention
|
|
49
|
-
|
|
50
|
-
Files should follow snake_case naming with the \`.xs\` extension:
|
|
51
|
-
- \`{name}.xs\` - Basic format (e.g., \`calculate_total.xs\`)
|
|
52
|
-
- \`{id}_{name}.xs\` - With ID prefix for disambiguation (e.g., \`42_calculate_total.xs\`)
|
|
53
|
-
- API endpoints: \`{VERB}_{path}.xs\` (e.g., \`POST_login.xs\`, \`GET_users_id.xs\`)
|
|
54
|
-
|
|
55
|
-
## Registry Format
|
|
56
|
-
|
|
57
|
-
The \`.xano/registry.json\` file tracks the sync state between local files and the Xano API:
|
|
58
|
-
|
|
59
|
-
\`\`\`json
|
|
60
|
-
{
|
|
61
|
-
"workspace_id": 12345,
|
|
62
|
-
"workspace_name": "My Project",
|
|
63
|
-
"branch": "",
|
|
64
|
-
"base_url": "https://your-instance.xano.io/api:headless",
|
|
65
|
-
"created_at": "2025-01-15T10:30:00Z",
|
|
66
|
-
"updated_at": "2025-01-15T10:30:00Z",
|
|
67
|
-
"objects": [
|
|
68
|
-
{
|
|
69
|
-
"id": 1,
|
|
70
|
-
"type": "function",
|
|
71
|
-
"name": "calculate_total",
|
|
72
|
-
"path": "functions/calculate_total.xs",
|
|
73
|
-
"sha256": "abc123...",
|
|
74
|
-
"status": "unchanged",
|
|
75
|
-
"original": "ZnVuY3Rpb24gY2FsY3VsYXRlX3RvdGFsIHsgLi4uIH0=",
|
|
76
|
-
"updated_at": "2025-01-15T10:30:00Z"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"id": 0,
|
|
80
|
-
"type": "function",
|
|
81
|
-
"name": "new_function",
|
|
82
|
-
"path": "functions/new_function.xs",
|
|
83
|
-
"status": "new"
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
\`\`\`
|
|
88
|
-
|
|
89
|
-
### Registry Record Fields
|
|
90
|
-
|
|
91
|
-
| Field | Description |
|
|
92
|
-
|-------|-------------|
|
|
93
|
-
| \`id\` | Xano object ID (0 = new, not yet synced) |
|
|
94
|
-
| \`type\` | Object type (function, table, task, etc.) |
|
|
95
|
-
| \`name\` | Object name extracted from XanoScript |
|
|
96
|
-
| \`path\` | Relative file path from workspace root |
|
|
97
|
-
| \`sha256\` | SHA256 hash of file content for change detection |
|
|
98
|
-
| \`status\` | Sync status: "new", "unchanged", "changed", "deleted" |
|
|
99
|
-
| \`original\` | Base64-encoded original content (for conflict detection) |
|
|
100
|
-
| \`updated_at\` | Last sync timestamp |
|
|
101
|
-
|
|
102
|
-
### Status Values
|
|
103
|
-
|
|
104
|
-
| Status | Description |
|
|
105
|
-
|--------|-------------|
|
|
106
|
-
| \`new\` | Created locally, not yet pushed to Xano |
|
|
107
|
-
| \`unchanged\` | In sync with remote |
|
|
108
|
-
| \`changed\` | Modified locally since last sync |
|
|
109
|
-
| \`deleted\` | Marked for deletion (file removed locally) |
|
|
110
|
-
|
|
111
|
-
## Fetching Objects from the API
|
|
112
|
-
|
|
113
|
-
Use the Headless API to fetch objects.
|
|
114
|
-
|
|
115
|
-
### List Objects
|
|
116
|
-
|
|
117
|
-
\`\`\`
|
|
118
|
-
GET /workspace/{workspace_id}/{type}
|
|
119
|
-
Headers:
|
|
120
|
-
Authorization: Bearer {token}
|
|
121
|
-
|
|
122
|
-
Query Parameters:
|
|
123
|
-
- branch: Branch label (empty = live branch)
|
|
124
|
-
- page: Page number (default: 1)
|
|
125
|
-
- per_page: Items per page (default: 50, max: 10000)
|
|
126
|
-
- search: Text search filter
|
|
127
|
-
- sort: Sort field (created_at, updated_at, name)
|
|
128
|
-
- order: asc or desc
|
|
129
|
-
\`\`\`
|
|
130
|
-
|
|
131
|
-
### Get Single Object with XanoScript
|
|
132
|
-
|
|
133
|
-
\`\`\`
|
|
134
|
-
GET /workspace/{workspace_id}/{type}/{id}
|
|
135
|
-
Headers:
|
|
136
|
-
Authorization: Bearer {token}
|
|
137
|
-
|
|
138
|
-
Query Parameters:
|
|
139
|
-
- branch: Branch label
|
|
140
|
-
\`\`\`
|
|
141
|
-
|
|
142
|
-
The response includes the \`xanoscript\` field with the code content:
|
|
143
|
-
\`\`\`json
|
|
144
|
-
{
|
|
145
|
-
"id": 1,
|
|
146
|
-
"name": "calculate_total",
|
|
147
|
-
"xanoscript": {
|
|
148
|
-
"status": "ok",
|
|
149
|
-
"value": "function calculate_total { ... }"
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
\`\`\`
|
|
153
|
-
|
|
154
|
-
### API Endpoints (Nested Under API Groups)
|
|
155
|
-
|
|
156
|
-
**Important:** API endpoints are nested resources under API groups. You must first fetch API groups to obtain their IDs, then use those IDs to fetch the endpoints within each group.
|
|
157
|
-
|
|
158
|
-
\`\`\`
|
|
159
|
-
# 1. First, list API groups
|
|
160
|
-
GET /workspace/{workspace_id}/apigroup
|
|
161
|
-
|
|
162
|
-
# 2. Then, list endpoints for each group using the apigroup_id
|
|
163
|
-
GET /workspace/{workspace_id}/apigroup/{apigroup_id}/api
|
|
164
|
-
|
|
165
|
-
# 3. Get a single endpoint
|
|
166
|
-
GET /workspace/{workspace_id}/apigroup/{apigroup_id}/api/{api_id}
|
|
167
|
-
\`\`\`
|
|
168
|
-
|
|
169
|
-
This hierarchical structure is reflected in the local directory layout:
|
|
170
|
-
\`\`\`
|
|
171
|
-
apis/
|
|
172
|
-
└── auth/ # API group (apigroup_id required)
|
|
173
|
-
├── api_group.xs # Group definition
|
|
174
|
-
├── POST_login.xs # Endpoint within this group
|
|
175
|
-
└── GET_me.xs # Another endpoint
|
|
176
|
-
\`\`\`
|
|
177
|
-
|
|
178
|
-
API groups contain endpoints that share common configuration.
|
|
179
|
-
|
|
180
|
-
## Pull Workflow
|
|
181
|
-
|
|
182
|
-
1. **Fetch object list** from API (paginated)
|
|
183
|
-
2. **For each object**, get the full definition including XanoScript
|
|
184
|
-
3. **Generate file path** based on type and name
|
|
185
|
-
4. **Write file** to the appropriate directory
|
|
186
|
-
5. **Update registry** with object metadata and SHA256 hash
|
|
187
|
-
|
|
188
|
-
### Example Pull Request Sequence
|
|
189
|
-
|
|
190
|
-
\`\`\`javascript
|
|
191
|
-
// 1. List all functions
|
|
192
|
-
const response = await fetch(
|
|
193
|
-
\`\${baseUrl}/workspace/\${workspaceId}/function?branch=\${branch}&per_page=100\`,
|
|
194
|
-
{ headers: { Authorization: \`Bearer \${token}\` } }
|
|
195
|
-
);
|
|
196
|
-
const { items, nextPage } = await response.json();
|
|
197
|
-
|
|
198
|
-
// 2. For each function, save to file
|
|
199
|
-
for (const func of items) {
|
|
200
|
-
const xanoscript = func.xanoscript?.value || '';
|
|
201
|
-
const fileName = \`\${snakeCase(func.name)}.xs\`;
|
|
202
|
-
const filePath = \`functions/\${fileName}\`;
|
|
203
|
-
|
|
204
|
-
// Write file
|
|
205
|
-
await writeFile(filePath, xanoscript);
|
|
206
|
-
|
|
207
|
-
// Add to registry
|
|
208
|
-
registry.objects.push({
|
|
209
|
-
id: func.id,
|
|
210
|
-
type: 'function',
|
|
211
|
-
name: func.name,
|
|
212
|
-
path: filePath,
|
|
213
|
-
sha256: sha256(xanoscript),
|
|
214
|
-
status: 'unchanged',
|
|
215
|
-
original: btoa(xanoscript),
|
|
216
|
-
updated_at: func.updated_at
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
\`\`\`
|
|
220
|
-
|
|
221
|
-
## Push Workflow
|
|
222
|
-
|
|
223
|
-
1. **Read registry** to find changed/new objects
|
|
224
|
-
2. **For each changed file**, read content and detect changes
|
|
225
|
-
3. **Create or update** via API with XanoScript content
|
|
226
|
-
4. **Update registry** with new IDs and hashes
|
|
227
|
-
|
|
228
|
-
### Example Push Request
|
|
229
|
-
|
|
230
|
-
\`\`\`javascript
|
|
231
|
-
// Create new function
|
|
232
|
-
const response = await fetch(
|
|
233
|
-
\`\${baseUrl}/workspace/\${workspaceId}/function?branch=\${branch}\`,
|
|
234
|
-
{
|
|
235
|
-
method: 'POST',
|
|
236
|
-
headers: {
|
|
237
|
-
'Authorization': \`Bearer \${token}\`,
|
|
238
|
-
'Content-Type': 'text/x-xanoscript'
|
|
239
|
-
},
|
|
240
|
-
body: xanoscriptContent
|
|
241
|
-
}
|
|
242
|
-
);
|
|
243
|
-
|
|
244
|
-
// Update existing function
|
|
245
|
-
const response = await fetch(
|
|
246
|
-
\`\${baseUrl}/workspace/\${workspaceId}/function/\${functionId}?publish=true\`,
|
|
247
|
-
{
|
|
248
|
-
method: 'PUT',
|
|
249
|
-
headers: {
|
|
250
|
-
'Authorization': \`Bearer \${token}\`,
|
|
251
|
-
'Content-Type': 'text/x-xanoscript'
|
|
252
|
-
},
|
|
253
|
-
body: xanoscriptContent
|
|
254
|
-
}
|
|
255
|
-
);
|
|
256
|
-
\`\`\`
|
|
257
|
-
|
|
258
|
-
## XanoScript Documentation References
|
|
259
|
-
|
|
260
|
-
For writing XanoScript code, use:
|
|
261
|
-
|
|
262
|
-
- \`xanoscript_docs()\` - Full documentation index
|
|
263
|
-
- \`xanoscript_docs({ topic: "functions" })\` - Function syntax
|
|
264
|
-
- \`xanoscript_docs({ topic: "tables" })\` - Table schema syntax
|
|
265
|
-
- \`xanoscript_docs({ topic: "apis" })\` - API endpoint syntax
|
|
266
|
-
- \`xanoscript_docs({ topic: "syntax" })\` - Language reference
|
|
267
|
-
|
|
268
|
-
## Validating XanoScript
|
|
269
|
-
|
|
270
|
-
Before pushing changes, validate the XanoScript syntax:
|
|
271
|
-
|
|
272
|
-
\`\`\`
|
|
273
|
-
validate_xanoscript({ code: "function foo { ... }" })
|
|
274
|
-
\`\`\`
|
|
275
|
-
|
|
276
|
-
This will check for syntax errors and return line/column positions for any issues.
|
|
277
|
-
`;
|
|
278
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template for xanoscript_docs index documentation
|
|
3
|
-
* Edit this file to update the XanoScript documentation index
|
|
4
|
-
*
|
|
5
|
-
* NOTE: This template is currently unused. The actual documentation is served
|
|
6
|
-
* directly from the XANOSCRIPT_DOCS_V2 config in index.ts.
|
|
7
|
-
*/
|
|
8
|
-
export interface XanoscriptIndexParams {
|
|
9
|
-
version: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function generateXanoscriptIndexTemplate(params: XanoscriptIndexParams): string;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template for xanoscript_docs index documentation
|
|
3
|
-
* Edit this file to update the XanoScript documentation index
|
|
4
|
-
*
|
|
5
|
-
* NOTE: This template is currently unused. The actual documentation is served
|
|
6
|
-
* directly from the XANOSCRIPT_DOCS_V2 config in index.ts.
|
|
7
|
-
*/
|
|
8
|
-
export function generateXanoscriptIndexTemplate(params) {
|
|
9
|
-
const { version } = params;
|
|
10
|
-
return `# XanoScript Documentation Index
|
|
11
|
-
Version: ${version}
|
|
12
|
-
|
|
13
|
-
Use \`xanoscript_docs({ topic: "<topic>" })\` to retrieve documentation.
|
|
14
|
-
|
|
15
|
-
## Core Language
|
|
16
|
-
| Topic | Description |
|
|
17
|
-
|-------|-------------|
|
|
18
|
-
| \`syntax\` | Expressions, operators, filters, system variables |
|
|
19
|
-
| \`types\` | Data types, validation, input blocks |
|
|
20
|
-
| \`functions\` | Reusable function stacks, async, loops |
|
|
21
|
-
| \`schema\` | Runtime schema parsing and validation |
|
|
22
|
-
|
|
23
|
-
## Data
|
|
24
|
-
| Topic | Description |
|
|
25
|
-
|-------|-------------|
|
|
26
|
-
| \`tables\` | Database schema definitions with indexes and relationships |
|
|
27
|
-
| \`database\` | All db.* operations: query, get, add, edit, patch, delete |
|
|
28
|
-
| \`addons\` | Reusable subqueries for fetching related data |
|
|
29
|
-
| \`streaming\` | Streaming data from files, requests, and responses |
|
|
30
|
-
|
|
31
|
-
## APIs & Endpoints
|
|
32
|
-
| Topic | Description |
|
|
33
|
-
|-------|-------------|
|
|
34
|
-
| \`apis\` | HTTP endpoint definitions with authentication and CRUD patterns |
|
|
35
|
-
| \`tasks\` | Scheduled and cron jobs |
|
|
36
|
-
| \`triggers\` | Event-driven handlers (table, realtime, workspace, agent, MCP) |
|
|
37
|
-
| \`realtime\` | Real-time channels and events for push updates |
|
|
38
|
-
|
|
39
|
-
## AI & Agents
|
|
40
|
-
| Topic | Description |
|
|
41
|
-
|-------|-------------|
|
|
42
|
-
| \`agents\` | AI agent configuration with LLM providers and tools |
|
|
43
|
-
| \`tools\` | AI tools for agents and MCP servers |
|
|
44
|
-
| \`mcp-servers\` | MCP server definitions exposing tools |
|
|
45
|
-
|
|
46
|
-
## Integrations
|
|
47
|
-
| Topic | Description |
|
|
48
|
-
|-------|-------------|
|
|
49
|
-
| \`integrations\` | Cloud storage, Redis, security, and external APIs |
|
|
50
|
-
|
|
51
|
-
## Configuration
|
|
52
|
-
| Topic | Description |
|
|
53
|
-
|-------|-------------|
|
|
54
|
-
| \`workspace\` | Workspace-level settings: environment variables, preferences, realtime |
|
|
55
|
-
| \`branch\` | Branch-level settings: middleware, history retention, visual styling |
|
|
56
|
-
| \`middleware\` | Request/response interceptors for functions, queries, tasks, and tools |
|
|
57
|
-
|
|
58
|
-
## Development
|
|
59
|
-
| Topic | Description |
|
|
60
|
-
|-------|-------------|
|
|
61
|
-
| \`testing\` | Unit tests, mocks, and assertions |
|
|
62
|
-
| \`debugging\` | Logging, inspecting, and debugging XanoScript execution |
|
|
63
|
-
| \`frontend\` | Static frontend development and deployment |
|
|
64
|
-
| \`run\` | Run job and service configurations for the Xano Job Runner |
|
|
65
|
-
|
|
66
|
-
## Best Practices
|
|
67
|
-
| Topic | Description |
|
|
68
|
-
|-------|-------------|
|
|
69
|
-
| \`performance\` | Performance optimization best practices |
|
|
70
|
-
| \`security\` | Security best practices for authentication and authorization |
|
|
71
|
-
`;
|
|
72
|
-
}
|