specra-cli 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/LICENSE.MD +33 -0
  2. package/README.md +246 -0
  3. package/dist/api-client-VHQARPDT.js +15 -0
  4. package/dist/api-client-VHQARPDT.js.map +1 -0
  5. package/dist/chunk-5765WX4D.js +192 -0
  6. package/dist/chunk-5765WX4D.js.map +1 -0
  7. package/dist/chunk-72RDEJR2.js +94 -0
  8. package/dist/chunk-72RDEJR2.js.map +1 -0
  9. package/dist/chunk-SQ2MMFUZ.js +102 -0
  10. package/dist/chunk-SQ2MMFUZ.js.map +1 -0
  11. package/dist/cli.d.ts +2 -0
  12. package/dist/cli.js +242 -0
  13. package/dist/cli.js.map +1 -0
  14. package/dist/deploy-V4JO2D6B.js +179 -0
  15. package/dist/deploy-V4JO2D6B.js.map +1 -0
  16. package/dist/doctor-ICALAJ4N.js +309 -0
  17. package/dist/doctor-ICALAJ4N.js.map +1 -0
  18. package/dist/login-UG3WU7DY.js +92 -0
  19. package/dist/login-UG3WU7DY.js.map +1 -0
  20. package/dist/logout-WJKHJZT6.js +24 -0
  21. package/dist/logout-WJKHJZT6.js.map +1 -0
  22. package/dist/logs-BLUJPWNO.js +77 -0
  23. package/dist/logs-BLUJPWNO.js.map +1 -0
  24. package/dist/projects-LJ57GK3D.js +49 -0
  25. package/dist/projects-LJ57GK3D.js.map +1 -0
  26. package/package.json +50 -0
  27. package/templates/book-docs/.env.sample +1 -0
  28. package/templates/book-docs/docs/v1.0.0/concepts.mdx +89 -0
  29. package/templates/book-docs/docs/v1.0.0/content/_category_.json +7 -0
  30. package/templates/book-docs/docs/v1.0.0/content/formatting.mdx +128 -0
  31. package/templates/book-docs/docs/v1.0.0/content/reusable-content.mdx +116 -0
  32. package/templates/book-docs/docs/v1.0.0/content/structure.mdx +92 -0
  33. package/templates/book-docs/docs/v1.0.0/customization/_category_.json +7 -0
  34. package/templates/book-docs/docs/v1.0.0/customization/branding.mdx +115 -0
  35. package/templates/book-docs/docs/v1.0.0/customization/themes.mdx +81 -0
  36. package/templates/book-docs/docs/v1.0.0/introduction.mdx +38 -0
  37. package/templates/book-docs/docs/v1.0.0/quickstart.mdx +112 -0
  38. package/templates/book-docs/docs/v2.0.0/concepts.mdx +89 -0
  39. package/templates/book-docs/docs/v2.0.0/content/_category_.json +7 -0
  40. package/templates/book-docs/docs/v2.0.0/content/formatting.mdx +128 -0
  41. package/templates/book-docs/docs/v2.0.0/content/reusable-content.mdx +116 -0
  42. package/templates/book-docs/docs/v2.0.0/content/structure.mdx +92 -0
  43. package/templates/book-docs/docs/v2.0.0/customization/_category_.json +7 -0
  44. package/templates/book-docs/docs/v2.0.0/customization/branding.mdx +115 -0
  45. package/templates/book-docs/docs/v2.0.0/customization/themes.mdx +81 -0
  46. package/templates/book-docs/docs/v2.0.0/introduction.mdx +39 -0
  47. package/templates/book-docs/docs/v2.0.0/quickstart.mdx +112 -0
  48. package/templates/book-docs/gitignore +7 -0
  49. package/templates/book-docs/package.json +28 -0
  50. package/templates/book-docs/postcss.config.mjs +8 -0
  51. package/templates/book-docs/public/api-specs/openapi-example.json +259 -0
  52. package/templates/book-docs/public/api-specs/postman-example.json +205 -0
  53. package/templates/book-docs/public/api-specs/test-api.json +256 -0
  54. package/templates/book-docs/public/api-specs/users-api.json +264 -0
  55. package/templates/book-docs/specra.config.json +77 -0
  56. package/templates/book-docs/src/app.css +86 -0
  57. package/templates/book-docs/src/app.html +17 -0
  58. package/templates/book-docs/src/params/product.ts +7 -0
  59. package/templates/book-docs/src/routes/+layout.server.ts +14 -0
  60. package/templates/book-docs/src/routes/+layout.svelte +21 -0
  61. package/templates/book-docs/src/routes/+page.server.ts +9 -0
  62. package/templates/book-docs/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  63. package/templates/book-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  64. package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  65. package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  66. package/templates/book-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
  67. package/templates/book-docs/src/routes/docs/[version]/+page.server.ts +27 -0
  68. package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  69. package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  70. package/templates/book-docs/static/favicon.svg +4 -0
  71. package/templates/book-docs/svelte.config.js +13 -0
  72. package/templates/book-docs/tsconfig.json +12 -0
  73. package/templates/book-docs/vite.config.ts +6 -0
  74. package/templates/jbrains-docs/.env.sample +1 -0
  75. package/templates/jbrains-docs/docs/v1.0.0/advanced/_category_.json +8 -0
  76. package/templates/jbrains-docs/docs/v1.0.0/advanced/async.mdx +95 -0
  77. package/templates/jbrains-docs/docs/v1.0.0/advanced/generics.mdx +126 -0
  78. package/templates/jbrains-docs/docs/v1.0.0/basics/_category_.json +8 -0
  79. package/templates/jbrains-docs/docs/v1.0.0/basics/control-flow.mdx +106 -0
  80. package/templates/jbrains-docs/docs/v1.0.0/basics/syntax.mdx +129 -0
  81. package/templates/jbrains-docs/docs/v1.0.0/basics/types.mdx +135 -0
  82. package/templates/jbrains-docs/docs/v1.0.0/getting-started.mdx +111 -0
  83. package/templates/jbrains-docs/docs/v1.0.0/home.mdx +37 -0
  84. package/templates/jbrains-docs/docs/v1.0.0/tools/_category_.json +8 -0
  85. package/templates/jbrains-docs/docs/v1.0.0/tools/build-tools.mdx +165 -0
  86. package/templates/jbrains-docs/docs/v1.0.0/tools/testing.mdx +112 -0
  87. package/templates/jbrains-docs/docs/v2.0.0/advanced/_category_.json +8 -0
  88. package/templates/jbrains-docs/docs/v2.0.0/advanced/async.mdx +95 -0
  89. package/templates/jbrains-docs/docs/v2.0.0/advanced/generics.mdx +126 -0
  90. package/templates/jbrains-docs/docs/v2.0.0/basics/_category_.json +8 -0
  91. package/templates/jbrains-docs/docs/v2.0.0/basics/control-flow.mdx +106 -0
  92. package/templates/jbrains-docs/docs/v2.0.0/basics/syntax.mdx +129 -0
  93. package/templates/jbrains-docs/docs/v2.0.0/basics/types.mdx +135 -0
  94. package/templates/jbrains-docs/docs/v2.0.0/getting-started.mdx +111 -0
  95. package/templates/jbrains-docs/docs/v2.0.0/home.mdx +37 -0
  96. package/templates/jbrains-docs/docs/v2.0.0/tools/_category_.json +8 -0
  97. package/templates/jbrains-docs/docs/v2.0.0/tools/build-tools.mdx +165 -0
  98. package/templates/jbrains-docs/docs/v2.0.0/tools/testing.mdx +112 -0
  99. package/templates/jbrains-docs/gitignore +7 -0
  100. package/templates/jbrains-docs/package.json +28 -0
  101. package/templates/jbrains-docs/postcss.config.mjs +8 -0
  102. package/templates/jbrains-docs/public/api-specs/openapi-example.json +259 -0
  103. package/templates/jbrains-docs/public/api-specs/postman-example.json +205 -0
  104. package/templates/jbrains-docs/public/api-specs/test-api.json +256 -0
  105. package/templates/jbrains-docs/public/api-specs/users-api.json +264 -0
  106. package/templates/jbrains-docs/specra.config.json +80 -0
  107. package/templates/jbrains-docs/src/app.css +86 -0
  108. package/templates/jbrains-docs/src/app.html +17 -0
  109. package/templates/jbrains-docs/src/params/product.ts +7 -0
  110. package/templates/jbrains-docs/src/routes/+layout.server.ts +14 -0
  111. package/templates/jbrains-docs/src/routes/+layout.svelte +21 -0
  112. package/templates/jbrains-docs/src/routes/+page.server.ts +9 -0
  113. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  114. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  115. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  116. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  117. package/templates/jbrains-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
  118. package/templates/jbrains-docs/src/routes/docs/[version]/+page.server.ts +27 -0
  119. package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  120. package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  121. package/templates/jbrains-docs/static/favicon.svg +4 -0
  122. package/templates/jbrains-docs/svelte.config.js +13 -0
  123. package/templates/jbrains-docs/tsconfig.json +12 -0
  124. package/templates/jbrains-docs/vite.config.ts +6 -0
  125. package/templates/minimal/.env.sample +1 -0
  126. package/templates/minimal/docs/v1.0.0/about.mdx +57 -0
  127. package/templates/minimal/docs/v1.0.0/components/_category_.json +8 -0
  128. package/templates/minimal/docs/v1.0.0/components/callout.mdx +83 -0
  129. package/templates/minimal/docs/v1.0.0/components/code-block.mdx +103 -0
  130. package/templates/minimal/docs/v1.0.0/components/index.mdx +8 -0
  131. package/templates/minimal/docs/v1.0.0/components/tabs.mdx +92 -0
  132. package/templates/minimal/docs/v1.0.0/configuration.mdx +322 -0
  133. package/templates/minimal/docs/v1.0.0/features.mdx +197 -0
  134. package/templates/minimal/docs/v1.0.0/getting-started.mdx +183 -0
  135. package/templates/minimal/docs/v2.0.0/about.mdx +57 -0
  136. package/templates/minimal/docs/v2.0.0/components/_category_.json +8 -0
  137. package/templates/minimal/docs/v2.0.0/components/callout.mdx +83 -0
  138. package/templates/minimal/docs/v2.0.0/components/code-block.mdx +103 -0
  139. package/templates/minimal/docs/v2.0.0/components/index.mdx +8 -0
  140. package/templates/minimal/docs/v2.0.0/components/tabs.mdx +92 -0
  141. package/templates/minimal/docs/v2.0.0/configuration.mdx +322 -0
  142. package/templates/minimal/docs/v2.0.0/features.mdx +197 -0
  143. package/templates/minimal/docs/v2.0.0/getting-started.mdx +183 -0
  144. package/templates/minimal/gitignore +7 -0
  145. package/templates/minimal/package.json +29 -0
  146. package/templates/minimal/postcss.config.mjs +8 -0
  147. package/templates/minimal/specra.config.json +91 -0
  148. package/templates/minimal/src/app.css +86 -0
  149. package/templates/minimal/src/app.html +17 -0
  150. package/templates/minimal/src/hooks.server.ts +8 -0
  151. package/templates/minimal/src/params/product.ts +7 -0
  152. package/templates/minimal/src/routes/+error.svelte +10 -0
  153. package/templates/minimal/src/routes/+layout.server.ts +14 -0
  154. package/templates/minimal/src/routes/+layout.svelte +21 -0
  155. package/templates/minimal/src/routes/+page.server.ts +9 -0
  156. package/templates/minimal/src/routes/+page.svelte +149 -0
  157. package/templates/minimal/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  158. package/templates/minimal/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  159. package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  160. package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  161. package/templates/minimal/src/routes/docs/[version]/+layout.server.ts +42 -0
  162. package/templates/minimal/src/routes/docs/[version]/+page.server.ts +27 -0
  163. package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  164. package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  165. package/templates/minimal/static/api-specs/openapi-example.json +259 -0
  166. package/templates/minimal/static/api-specs/postman-example.json +205 -0
  167. package/templates/minimal/static/api-specs/test-api.json +256 -0
  168. package/templates/minimal/static/api-specs/users-api.json +264 -0
  169. package/templates/minimal/static/favicon.svg +4 -0
  170. package/templates/minimal/svelte.config.js +13 -0
  171. package/templates/minimal/tsconfig.json +12 -0
  172. package/templates/minimal/vite.config.ts +6 -0
@@ -0,0 +1,264 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "title": "Users API",
4
+ "description": "Complete API reference for managing users in the system",
5
+ "baseUrl": "https://api.example.com/v1",
6
+ "env": {
7
+ "AUTH_TOKEN": "your_api_token_here"
8
+ },
9
+ "auth": {
10
+ "type": "bearer",
11
+ "description": "All requests require a valid API token in the Authorization header",
12
+ "tokenPrefix": "Bearer"
13
+ },
14
+ "globalHeaders": [
15
+ {
16
+ "name": "Authorization",
17
+ "value": "Bearer {AUTH_TOKEN}",
18
+ "description": "Your API authentication token"
19
+ },
20
+ {
21
+ "name": "Content-Type",
22
+ "value": "application/json"
23
+ }
24
+ ],
25
+ "endpoints": [
26
+ {
27
+ "title": "Get User by ID",
28
+ "method": "GET",
29
+ "path": "/users/:id",
30
+ "description": "Retrieve detailed information about a specific user",
31
+ "pathParams": [
32
+ {
33
+ "name": "id",
34
+ "type": "string",
35
+ "required": true,
36
+ "description": "The unique identifier of the user",
37
+ "example": "user_123"
38
+ }
39
+ ],
40
+ "queryParams": [
41
+ {
42
+ "name": "fields",
43
+ "type": "string",
44
+ "description": "Comma-separated list of fields to include",
45
+ "example": "name,email,created_at"
46
+ },
47
+ {
48
+ "name": "include_metadata",
49
+ "type": "boolean",
50
+ "description": "Include additional metadata in the response",
51
+ "default": false
52
+ }
53
+ ],
54
+ "successResponse": {
55
+ "status": 200,
56
+ "description": "User retrieved successfully",
57
+ "example": {
58
+ "id": "user_123",
59
+ "name": "John Doe",
60
+ "email": "john@example.com",
61
+ "role": "admin",
62
+ "created_at": "2024-01-15T10:30:00Z",
63
+ "updated_at": "2024-01-20T14:22:00Z"
64
+ }
65
+ },
66
+ "errorResponses": [
67
+ {
68
+ "status": 404,
69
+ "description": "User not found",
70
+ "example": {
71
+ "error": "User not found",
72
+ "code": "USER_NOT_FOUND",
73
+ "message": "No user exists with the provided ID"
74
+ }
75
+ },
76
+ {
77
+ "status": 401,
78
+ "description": "Unauthorized",
79
+ "example": {
80
+ "error": "Unauthorized",
81
+ "code": "UNAUTHORIZED",
82
+ "message": "Invalid or missing authentication token"
83
+ }
84
+ }
85
+ ],
86
+ "examples": [
87
+ {
88
+ "title": "cURL",
89
+ "language": "bash",
90
+ "code": "curl -X GET \"https://api.example.com/v1/users/user_123\" \\\n -H \"Authorization: Bearer your_api_token_here\""
91
+ },
92
+ {
93
+ "title": "JavaScript (fetch)",
94
+ "language": "javascript",
95
+ "code": "const response = await fetch('https://api.example.com/v1/users/user_123', {\n headers: {\n 'Authorization': 'Bearer your_api_token_here'\n }\n});\nconst user = await response.json();"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "title": "List All Users",
101
+ "method": "GET",
102
+ "path": "/users",
103
+ "description": "Retrieve a paginated list of all users",
104
+ "queryParams": [
105
+ {
106
+ "name": "page",
107
+ "type": "number",
108
+ "description": "Page number for pagination",
109
+ "default": 1
110
+ },
111
+ {
112
+ "name": "limit",
113
+ "type": "number",
114
+ "description": "Number of users per page",
115
+ "default": 20
116
+ },
117
+ {
118
+ "name": "role",
119
+ "type": "string",
120
+ "description": "Filter users by role",
121
+ "example": "admin"
122
+ }
123
+ ],
124
+ "successResponse": {
125
+ "status": 200,
126
+ "description": "List of users retrieved successfully",
127
+ "example": {
128
+ "data": [
129
+ {
130
+ "id": "user_123",
131
+ "name": "John Doe",
132
+ "email": "john@example.com",
133
+ "role": "admin"
134
+ },
135
+ {
136
+ "id": "user_124",
137
+ "name": "Jane Smith",
138
+ "email": "jane@example.com",
139
+ "role": "user"
140
+ }
141
+ ],
142
+ "pagination": {
143
+ "page": 1,
144
+ "limit": 20,
145
+ "total": 42,
146
+ "pages": 3
147
+ }
148
+ }
149
+ }
150
+ },
151
+ {
152
+ "title": "Create New User",
153
+ "method": "POST",
154
+ "path": "/users",
155
+ "description": "Create a new user account",
156
+ "body": {
157
+ "description": "User data to create",
158
+ "example": {
159
+ "name": "Alice Johnson",
160
+ "email": "alice@example.com",
161
+ "role": "user",
162
+ "password": "secure_password_123"
163
+ }
164
+ },
165
+ "successResponse": {
166
+ "status": 201,
167
+ "description": "User created successfully",
168
+ "example": {
169
+ "id": "user_125",
170
+ "name": "Alice Johnson",
171
+ "email": "alice@example.com",
172
+ "role": "user",
173
+ "created_at": "2024-01-21T09:15:00Z"
174
+ }
175
+ },
176
+ "errorResponses": [
177
+ {
178
+ "status": 400,
179
+ "description": "Validation error",
180
+ "example": {
181
+ "error": "Validation failed",
182
+ "code": "VALIDATION_ERROR",
183
+ "details": {
184
+ "email": "Email address already exists"
185
+ }
186
+ }
187
+ }
188
+ ],
189
+ "examples": [
190
+ {
191
+ "title": "cURL",
192
+ "language": "bash",
193
+ "code": "curl -X POST \"https://api.example.com/v1/users\" \\\n -H \"Authorization: Bearer your_api_token_here\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Alice Johnson\",\n \"email\": \"alice@example.com\",\n \"role\": \"user\",\n \"password\": \"secure_password_123\"\n }'"
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "title": "Update User",
199
+ "method": "PATCH",
200
+ "path": "/users/:id",
201
+ "description": "Update user information",
202
+ "pathParams": [
203
+ {
204
+ "name": "id",
205
+ "type": "string",
206
+ "required": true,
207
+ "description": "User ID to update"
208
+ }
209
+ ],
210
+ "body": {
211
+ "description": "Fields to update (all optional)",
212
+ "example": {
213
+ "name": "John Updated",
214
+ "email": "john.updated@example.com",
215
+ "role": "moderator"
216
+ }
217
+ },
218
+ "successResponse": {
219
+ "status": 200,
220
+ "description": "User updated successfully",
221
+ "example": {
222
+ "id": "user_123",
223
+ "name": "John Updated",
224
+ "email": "john.updated@example.com",
225
+ "role": "moderator",
226
+ "updated_at": "2024-01-21T10:00:00Z"
227
+ }
228
+ }
229
+ },
230
+ {
231
+ "title": "Delete User",
232
+ "method": "DELETE",
233
+ "path": "/users/:id",
234
+ "description": "Permanently delete a user account",
235
+ "pathParams": [
236
+ {
237
+ "name": "id",
238
+ "type": "string",
239
+ "required": true,
240
+ "description": "User ID to delete"
241
+ }
242
+ ],
243
+ "successResponse": {
244
+ "status": 204,
245
+ "description": "User deleted successfully"
246
+ },
247
+ "errorResponses": [
248
+ {
249
+ "status": 404,
250
+ "description": "User not found"
251
+ },
252
+ {
253
+ "status": 403,
254
+ "description": "Forbidden - Cannot delete this user",
255
+ "example": {
256
+ "error": "Forbidden",
257
+ "code": "CANNOT_DELETE_ADMIN",
258
+ "message": "Cannot delete the primary admin account"
259
+ }
260
+ }
261
+ ]
262
+ }
263
+ ]
264
+ }
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
+ <rect width="32" height="32" rx="6" fill="#6366f1"/>
3
+ <text x="16" y="23" font-family="system-ui,sans-serif" font-size="20" font-weight="bold" fill="white" text-anchor="middle">S</text>
4
+ </svg>
@@ -0,0 +1,13 @@
1
+ import adapter from '@sveltejs/adapter-static';
2
+ import { specraConfig } from 'specra/svelte-config';
3
+ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
4
+
5
+ const config = specraConfig({
6
+ vitePreprocess: { vitePreprocess },
7
+ kit: {
8
+ adapter: adapter(),
9
+ prerender: { handleHttpError: 'warn', handleMissingId: 'warn', handleUnseenRoutes: 'warn' }
10
+ }
11
+ });
12
+
13
+ export default config;
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./.svelte-kit/tsconfig.json",
3
+ "compilerOptions": {
4
+ "allowJs": true,
5
+ "checkJs": true,
6
+ "esModuleInterop": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "resolveJsonModule": true,
9
+ "skipLibCheck": true,
10
+ "strict": true
11
+ }
12
+ }
@@ -0,0 +1,6 @@
1
+ import { sveltekit } from '@sveltejs/kit/vite';
2
+ import { defineConfig } from 'vite';
3
+
4
+ export default defineConfig({
5
+ plugins: [sveltekit()]
6
+ });