fleetbo-svro 1.0.1 → 1.0.3
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/dist/cli.cjs +194 -73
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`),b("\u2192 Created svro.schema.json at project root.")}function
|
|
2
|
+
var j=(t,n)=>()=>{try{return n||t((n={exports:{}}).exports,n),n.exports}catch(o){throw n=0,o}};var k=j((ne,w)=>{var c=require("fs"),u=require("path"),C=require("https"),{execSync:N}=require("child_process"),L="\x1B[38;2;231;233;237m",A="\x1B[31m",x="\x1B[0m";function b(t){console.log(` ${L}${t}${x}`)}function g(t){console.error(` ${A}${t}${x}`)}function D(t){let n={};return t.forEach(o=>{if(o.startsWith("--")){let[r,i]=o.slice(2).split("=");r&&i&&(n[r]=i)}}),n}function E(t,n){try{let o=JSON.parse(c.readFileSync(t,"utf8"));return!!(o.dependencies&&o.dependencies[n]||o.devDependencies&&o.devDependencies[n])}catch{return!1}}function $(t,n){if(!E(n,"fleetbo-svro")){b("\u2192 Installing fleetbo-svro into the project...");try{N("npm install fleetbo-svro",{cwd:t,stdio:"inherit"}),b("fleetbo-svro installed successfully!")}catch{g("\u26A0\uFE0F Automatic installation failed. Please run 'npm install fleetbo-svro' manually.")}}}function J(t){let n=u.join(t,"svro.schema.json");if(c.existsSync(n))return;let o=new Date().toISOString(),r={createdAt:o,patchedAt:o,schemaVersion:1,collections:{}};c.writeFileSync(n,JSON.stringify(r,null,2)+`
|
|
3
|
+
`),b("\u2192 Created svro.schema.json at project root.")}function M(t){let n=u.join(t,"src");if(!c.existsSync(n))return;let o=u.join(n,"auto-imports.d.ts");if(c.existsSync(o))return;let r=`/* eslint-disable */
|
|
4
4
|
/* prettier-ignore */
|
|
5
5
|
// @ts-nocheck
|
|
6
6
|
// Generated by fleetbo-svro setup
|
|
@@ -9,8 +9,7 @@ declare global {
|
|
|
9
9
|
const Fleetbo: typeof import('fleetbo-svro')['Fleetbo']
|
|
10
10
|
const FleetboUI: typeof import('fleetbo-svro')['FleetboUI']
|
|
11
11
|
}
|
|
12
|
-
`;try{
|
|
13
|
-
import type React from 'react';
|
|
12
|
+
`;try{c.writeFileSync(o,r),b("\u2192 Created src/auto-imports.d.ts stub for instant IDE auto-completion.")}catch(i){g(`\u26A0\uFE0F Unable to create src/auto-imports.d.ts: ${i.message}`)}}function B(t){let n=["tsconfig.json","jsconfig.json"];for(let o of n){let r=u.join(t,o);if(c.existsSync(r)){let i=new Date;c.utimesSync(r,i,i);break}}}function q(t){let n=u.join(t,"index.d.ts");if(c.existsSync(n))return;c.writeFileSync(n,`// File generated/synchronized by fleetbo-svro \u2014 do not edit manually
|
|
14
13
|
|
|
15
14
|
export type FleetboTables = string;
|
|
16
15
|
|
|
@@ -26,8 +25,18 @@ declare global {
|
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
export interface FleetboWriteResult {
|
|
30
|
-
|
|
28
|
+
export interface FleetboWriteResult {
|
|
29
|
+
success: boolean;
|
|
30
|
+
documentId?: string;
|
|
31
|
+
mediaUrl?: string;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FleetboCallResult<T = any> {
|
|
36
|
+
success: boolean;
|
|
37
|
+
data?: T;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
31
40
|
|
|
32
41
|
export interface FleetboAuthUser {
|
|
33
42
|
uid: string;
|
|
@@ -42,24 +51,13 @@ export interface FleetboAuthResult {
|
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
export declare const FleetboUI: {
|
|
45
|
-
Text:
|
|
46
|
-
Number:
|
|
47
|
-
Toggle:
|
|
48
|
-
Date:
|
|
49
|
-
Enum:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
id?: string;
|
|
53
|
-
render?: (doc: any) => React.ReactNode;
|
|
54
|
-
orphanFallback?: React.ReactNode;
|
|
55
|
-
malformedFallback?: React.ReactNode;
|
|
56
|
-
loadingFallback?: React.ReactNode;
|
|
57
|
-
className?: string;
|
|
58
|
-
}>;
|
|
59
|
-
List: React.FC<{ value?: any[]; render?: (item: any, index: number) => React.ReactNode; className?: string }>;
|
|
60
|
-
Media: React.FC<{ value?: any; alt?: string; className?: string; fallback?: React.ReactNode }>;
|
|
61
|
-
Geo: React.FC<{ value?: any; className?: string; render?: (coords: { lat: number; lng: number }) => React.ReactNode }>;
|
|
62
|
-
Smart: React.FC<any>;
|
|
54
|
+
Text: string;
|
|
55
|
+
Number: string;
|
|
56
|
+
Toggle: string;
|
|
57
|
+
Date: string;
|
|
58
|
+
Enum: string;
|
|
59
|
+
Media: string;
|
|
60
|
+
Reference: string;
|
|
63
61
|
};
|
|
64
62
|
|
|
65
63
|
export interface FleetboAclResult {
|
|
@@ -79,10 +77,11 @@ export interface FleetboJoinOptions {
|
|
|
79
77
|
export declare const Fleetbo: typeof FleetboUI & {
|
|
80
78
|
call: {
|
|
81
79
|
[key: string]: <T = any>(payload?: Record<string, any>) => Promise<FleetboCallResult<T>>;
|
|
82
|
-
};
|
|
80
|
+
};
|
|
83
81
|
add(table: FleetboTables, data: Record<string, any>): Promise<FleetboWriteResult>;
|
|
84
82
|
addWithId(table: FleetboTables, data: Record<string, any>, customId: string): Promise<FleetboWriteResult>;
|
|
85
83
|
addWithUserId(table: FleetboTables, data: Record<string, any>): Promise<FleetboWriteResult>;
|
|
84
|
+
addWithMedia(table: FleetboTables, data: Record<string, any>, fileBase64?: string, fileName?: string): Promise<FleetboWriteResult>;
|
|
86
85
|
|
|
87
86
|
getDocsG<T = any>(table: FleetboTables): Promise<T[]>;
|
|
88
87
|
getDocsU<T = any>(table: FleetboTables): Promise<T[]>;
|
|
@@ -109,6 +108,73 @@ export declare const Fleetbo: typeof FleetboUI & {
|
|
|
109
108
|
};
|
|
110
109
|
|
|
111
110
|
declare global {
|
|
111
|
+
namespace JSX {
|
|
112
|
+
interface IntrinsicElements {
|
|
113
|
+
'fleetbo-text': {
|
|
114
|
+
value?: any;
|
|
115
|
+
fallback?: string;
|
|
116
|
+
class?: string;
|
|
117
|
+
className?: string;
|
|
118
|
+
};
|
|
119
|
+
'fleetbo-number': {
|
|
120
|
+
value?: any;
|
|
121
|
+
'invalid-fallback'?: string;
|
|
122
|
+
currency?: string;
|
|
123
|
+
class?: string;
|
|
124
|
+
className?: string;
|
|
125
|
+
};
|
|
126
|
+
'fleetbo-toggle': {
|
|
127
|
+
value?: any;
|
|
128
|
+
'label-true'?: string;
|
|
129
|
+
'label-false'?: string;
|
|
130
|
+
'invalid-fallback'?: string;
|
|
131
|
+
class?: string;
|
|
132
|
+
className?: string;
|
|
133
|
+
};
|
|
134
|
+
'fleetbo-date': {
|
|
135
|
+
value?: any;
|
|
136
|
+
locale?: string;
|
|
137
|
+
'invalid-fallback'?: string;
|
|
138
|
+
class?: string;
|
|
139
|
+
className?: string;
|
|
140
|
+
};
|
|
141
|
+
'fleetbo-enum': {
|
|
142
|
+
value?: any;
|
|
143
|
+
allowed?: string;
|
|
144
|
+
'invalid-fallback'?: string;
|
|
145
|
+
class?: string;
|
|
146
|
+
className?: string;
|
|
147
|
+
};
|
|
148
|
+
'fleetbo-media': {
|
|
149
|
+
value?: any;
|
|
150
|
+
alt?: string;
|
|
151
|
+
fallback?: string;
|
|
152
|
+
class?: string;
|
|
153
|
+
className?: string;
|
|
154
|
+
};
|
|
155
|
+
'fleetbo-reference': {
|
|
156
|
+
table: FleetboTables;
|
|
157
|
+
id?: string;
|
|
158
|
+
field?: string;
|
|
159
|
+
'orphan-fallback'?: string;
|
|
160
|
+
'loading-fallback'?: string;
|
|
161
|
+
'malformed-fallback'?: string;
|
|
162
|
+
class?: string;
|
|
163
|
+
className?: string;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface HTMLElementTagNameMap {
|
|
169
|
+
'fleetbo-text': HTMLElement;
|
|
170
|
+
'fleetbo-number': HTMLElement;
|
|
171
|
+
'fleetbo-toggle': HTMLElement;
|
|
172
|
+
'fleetbo-date': HTMLElement;
|
|
173
|
+
'fleetbo-enum': HTMLElement;
|
|
174
|
+
'fleetbo-media': HTMLElement;
|
|
175
|
+
'fleetbo-reference': HTMLElement;
|
|
176
|
+
}
|
|
177
|
+
|
|
112
178
|
const Fleetbo: typeof import('./index').Fleetbo;
|
|
113
179
|
const FleetboUI: typeof import('./index').FleetboUI;
|
|
114
180
|
|
|
@@ -117,13 +183,13 @@ declare global {
|
|
|
117
183
|
FleetboUI: typeof FleetboUI;
|
|
118
184
|
}
|
|
119
185
|
}
|
|
120
|
-
`),b("\u2192 Initialized index.d.ts.")}function
|
|
121
|
-
VITE_FLEETBO_DB_KEY=${
|
|
122
|
-
VITE_FLEETBO_ENTERPRISE_ID=${
|
|
123
|
-
VITE_FLEETBO_KEY_APP=${
|
|
186
|
+
`),b("\u2192 Initialized index.d.ts.")}function W(t){return new Promise((n,o)=>{let r=JSON.stringify({token:t}),i={hostname:"bootstrapproject-jqycakhlxa-uc.a.run.app",path:"/",method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(r)}},d=C.request(i,e=>{let l="";e.on("data",s=>{l+=s}),e.on("end",()=>{if(e.statusCode>=200&&e.statusCode<300)try{n(JSON.parse(l))}catch{o(new Error("Invalid response received from Fleetbo server."))}else try{let s=JSON.parse(l);o(new Error(s.error||`Server error ${e.statusCode}`))}catch{o(new Error(`Server error ${e.statusCode}`))}})});d.on("error",e=>o(e)),d.write(r),d.end()})}async function H(t,n=[]){let o=u.join(t,".env");if(c.existsSync(o)&&c.readFileSync(o,"utf8").includes("VITE_FLEETBO_DB_KEY")){b("\u2192 Fleetbo environment variables already present in .env \u2014 skipping step.");return}let r=D(n),i=r.keyApp,d=r.token||r.bootstrapToken,e=r.email||"";(!i||!d)&&(g("\u26A0\uFE0F Missing required parameters."),g("\u{1F449} Usage: npx fleetbo-svro init --keyApp=YOUR_KEY --token=YOUR_TOKEN"),process.exit(1)),b("\u2192 Exchanging bootstrap token for project keys...");let l;try{l=await W(d)}catch(a){g(`\u26A0\uFE0F Token exchange failed: ${a.message}`),g("\u{1F449} The token may have expired (15 min limit) or was already used. Please regenerate one from the Fleetbo dashboard."),process.exit(1)}(!l.enterpriseId||!l.fleetboDBKey)&&(g("\u26A0\uFE0F Incomplete response from Fleetbo server."),process.exit(1));let s=`
|
|
187
|
+
VITE_FLEETBO_DB_KEY=${l.fleetboDBKey}
|
|
188
|
+
VITE_FLEETBO_ENTERPRISE_ID=${l.enterpriseId}
|
|
189
|
+
VITE_FLEETBO_KEY_APP=${i}
|
|
124
190
|
${e?`VITE_FLEETBO_TESTER_EMAIL=${e}
|
|
125
|
-
`:""}`;
|
|
126
|
-
`),b(`\u2192 Updated ${u.basename(
|
|
191
|
+
`:""}`;c.appendFileSync(o,s),b(".env file updated successfully with Fleetbo keys!")}function O(t){let n=u.join(t,"svro.d.ts");if(c.existsSync(n))try{c.unlinkSync(n),b("\u2192 Removed legacy svro.d.ts from project root.")}catch{}}function P(t,n){if(process.env.FLEETBO_SKIP_TYPECHECK_SETUP)return;let o=u.join(t,"tsconfig.json"),r=u.join(t,"jsconfig.json"),i=c.existsSync(o)?o:r,d=!c.existsSync(i),e={};if(!d)try{e=JSON.parse(c.readFileSync(i,"utf8"))}catch{g(`\u26A0\uFE0F Unable to read ${u.basename(i)} (Invalid JSON).`);return}e.compilerOptions=e.compilerOptions||{};let l=!1,s=E(n,"react"),a=E(n,"vite");d?(e.compilerOptions.checkJs=!0,e.compilerOptions.allowJs=!0,e.compilerOptions.target=e.compilerOptions.target||"ES2020",e.compilerOptions.module=e.compilerOptions.module||"ESNext",e.compilerOptions.moduleResolution=e.compilerOptions.moduleResolution||"bundler",e.include=e.include||["src"],l=!0):(e.compilerOptions.checkJs===void 0&&(e.compilerOptions.checkJs=!0,l=!0),e.compilerOptions.allowJs===void 0&&(e.compilerOptions.allowJs=!0,l=!0)),s&&e.compilerOptions.jsx===void 0&&(e.compilerOptions.jsx="react-jsx",l=!0),a&&e.compilerOptions.types===void 0&&(e.compilerOptions.types=["vite/client"],l=!0),l&&(c.writeFileSync(i,JSON.stringify(e,null,2)+`
|
|
192
|
+
`),b(`\u2192 Updated ${u.basename(i)}.`))}function R(t,n){if(process.env.FLEETBO_SKIP_AUTOIMPORT_SETUP)return;let r=["vite.config.ts","vite.config.js","vite.config.mjs"].map(s=>u.join(t,s)).find(s=>c.existsSync(s));if(!r)return;let i;try{i=c.readFileSync(r,"utf8")}catch{return}let d="fleetbo-svro",e=i,l=`{
|
|
127
193
|
name: 'fleetbo-schema-sync-middleware',
|
|
128
194
|
configureServer(server) {
|
|
129
195
|
server.middlewares.use('/__fleetbo_sync_schema', (req, res) => {
|
|
@@ -166,23 +232,22 @@ ${e?`VITE_FLEETBO_TESTER_EMAIL=${e}
|
|
|
166
232
|
watch: {
|
|
167
233
|
ignored: ['**/svro.schema.json', '**/src/auto-imports.d.ts']
|
|
168
234
|
}
|
|
169
|
-
},`))),e.includes("unplugin-auto-import"))e.includes("fleetbo-svro")&&!e.includes("FleetboUI")&&(e=e.replace(/imports\s*:\s*\[\s*\{\s*['"]fleetbo-svro(?:|\/vue)['"]\s*:\s*\[[^\]]*\]\s*\}\s*\]/g,`imports: [{ '${
|
|
235
|
+
},`))),e.includes("unplugin-auto-import"))e.includes("fleetbo-svro")&&!e.includes("FleetboUI")&&(e=e.replace(/imports\s*:\s*\[\s*\{\s*['"]fleetbo-svro(?:|\/vue)['"]\s*:\s*\[[^\]]*\]\s*\}\s*\]/g,`imports: [{ '${d}': ['Fleetbo', 'FleetboUI'] }]`));else{let s=e.match(/plugins\s*:\s*\[/);if(s){let a=s.index+s[0].length,F=`
|
|
170
236
|
AutoImport({
|
|
171
|
-
imports: [{ '${
|
|
237
|
+
imports: [{ '${d}': ['Fleetbo', 'FleetboUI'] }],
|
|
172
238
|
dts: 'src/auto-imports.d.ts'
|
|
173
|
-
}),`;if(e=e.slice(0,
|
|
174
|
-
`;if(
|
|
175
|
-
`+v+e.slice(
|
|
176
|
-
`+
|
|
177
|
-
`),b("\u2192 Added unplugin-auto-import to devDependencies."))}catch(
|
|
178
|
-
`).forEach(
|
|
179
|
-
[Fleetbo] Initializing and configuring Fleetbo...`),await
|
|
239
|
+
}),`;if(e=e.slice(0,a)+F+e.slice(a),!e.includes("import AutoImport")){let T=[...e.matchAll(/^import .+;?$/gm)].pop(),v=`import AutoImport from 'unplugin-auto-import/vite';
|
|
240
|
+
`;if(T){let f=T.index+T[0].length;e=e.slice(0,f)+`
|
|
241
|
+
`+v+e.slice(f)}else e=v+e}}}if(e.includes("__fleetbo_sync_schema")){if(e.includes("require('fs')")||e.includes('require("fs")')){let s=/\{\s*name:\s*['"]fleetbo-schema-sync-middleware['"][\s\S]*?\},/g;s.test(e)&&(e=e.replace(s,l),b("\u2192 Updated legacy Fleetbo middleware to modern ESM version."))}}else{let s=e.match(/plugins\s*:\s*\[/);if(s){let a=s.index+s[0].length;e=e.slice(0,a)+`
|
|
242
|
+
`+l+e.slice(a)}}if(e!==i)try{c.writeFileSync(r,e),b(`\u2192 Updated ${u.basename(r)} with Watcher and AutoImport configuration.`)}catch(s){g(`\u26A0\uFE0F Failed to write to ${u.basename(r)}: ${s.message}`)}try{let s=JSON.parse(c.readFileSync(n,"utf8"));s.devDependencies=s.devDependencies||{},s.devDependencies["unplugin-auto-import"]||(s.devDependencies["unplugin-auto-import"]="^0.18.0",c.writeFileSync(n,JSON.stringify(s,null,2)+`
|
|
243
|
+
`),b("\u2192 Added unplugin-auto-import to devDependencies."))}catch(s){g(`\u26A0\uFE0F Failed to update ${u.basename(n)}: ${s.message}`)}}function V(t,n,o={}){let{skipSelfInstall:r=!1}=o,i=u.join(__dirname,"..");r||$(t,n),J(t),q(i),M(t),O(t),P(t,n),R(t,n)}w.exports={touchTsConfig:B,log:b,logError:g,handleAuthAndEnv:H,detectDependency:E,cleanupLegacyRootDts:O,patchJsOrTsConfig:P,attemptViteAutoImportPatch:R,runFullSetup:V}});var p=require("fs"),y=require("path"),_=require("https"),{runFullSetup:K,handleAuthAndEnv:Y,touchTsConfig:G}=k(),z="\x1B[34m",X="\x1B[31m",U="\x1B[0m";function m(t){console.log(`${z}${t}${U}`)}function h(t){console.error(`${X}${t}${U}`)}function Q(t,n){return new Promise((o,r)=>{let i=JSON.stringify({enterpriseID:t,schema:n}),d={hostname:"fleetbo-gatekeeper.fleetbo.workers.dev",path:"/sync-schema",method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(i)}},e=_.request(d,l=>{let s="";l.on("data",a=>{s+=a}),l.on("end",()=>{l.statusCode>=200&&l.statusCode<300?o(JSON.parse(s)):r(new Error(`Edge sync failed with HTTP ${l.statusCode}`))})});e.on("error",l=>r(l)),e.write(i),e.end()})}function Z(t){let n=y.join(t,".env");if(!p.existsSync(n))return{};let o=p.readFileSync(n,"utf8"),r={};return o.split(`
|
|
244
|
+
`).forEach(i=>{let[d,...e]=i.split("=");d&&e.length>0&&(r[d.trim()]=e.join("=").trim())}),r}function ee(t){return new Promise((n,o)=>{let r=JSON.stringify({projectId:t,moduleName:"svro.schema.json"}),i={hostname:"getmodulecache-jqycakhlxa-uc.a.run.app",path:"/",method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(r)}},d=_.request(i,e=>{let l="";e.on("data",s=>{l+=s}),e.on("end",()=>{if(e.statusCode>=200&&e.statusCode<300)try{let s=JSON.parse(l);if(s.success&&s.found&&s.module){let a=s.module.code||s.module.mockCode;n(typeof a=="string"?JSON.parse(a):a)}else o(new Error("Schema not found in Fleetbo Cloud."))}catch{o(new Error("Invalid JSON response received from Fleetbo server."))}else o(new Error(`Server error ${e.statusCode}`))})});d.on("error",e=>o(e)),d.write(r),d.end()})}var I=process.argv.slice(2),S=I[0];async function te(){let t=process.cwd(),n=y.join(t,"package.json");if(S==="init"||S==="doctor")m(`
|
|
245
|
+
[Fleetbo] Initializing and configuring Fleetbo...`),await Y(t,I),K(t,n),m(`
|
|
180
246
|
[Fleetbo] Configuration completed successfully!
|
|
181
|
-
`);else if(S==="sql"&&
|
|
182
|
-
`),
|
|
183
|
-
import type React from 'react';
|
|
247
|
+
`);else if(S==="sql"&&I[1]==="sync"){let o=I.includes("--dry-run");m(`[Fleetbo] Syncing schema...${o?" (dry-run)":""}`);let r=y.join(t,"svro.schema.json"),i=y.join(__dirname,".."),d=y.join(i,"index.d.ts"),e=y.join(t,"src","auto-imports.d.ts"),s=Z(t).VITE_FLEETBO_ENTERPRISE_ID;if(s)try{m("\u2192 Fetching latest svro.schema.json from Fleetbo OS...");let a=await ee(s);p.writeFileSync(r,JSON.stringify(a,null,2)+`
|
|
248
|
+
`),m("\u2192 Local svro.schema.json updated from FLeetbo OS.")}catch(a){h(`\u26A0\uFE0F Cloud fetch bypassed: ${a.message}. Using local file fallback.`)}else h("\u26A0\uFE0F VITE_FLEETBO_ENTERPRISE_ID missing in .env. Skipping cloud fetch.");p.existsSync(r)||(h("Error: svro.schema.json not found."),process.exit(1));try{let a=JSON.parse(p.readFileSync(r,"utf8")),F=Object.keys(a.collections||{});if(s)try{await Q(s,a),m("\u2192 Schema successfully sealed at Fleetbo Global Edge (O(1)).")}catch(f){h(`\u26A0\uFE0F Fleetbo Edge Shield sync warning: ${f.message}`)}let T=F.length>0?F.map(f=>`'${f}'`).join(" | "):"string",v=`// Generated by fleetbo-svro \u2014 Updated via fleetbo sql sync
|
|
184
249
|
|
|
185
|
-
export type FleetboTables = ${
|
|
250
|
+
export type FleetboTables = ${T};
|
|
186
251
|
|
|
187
252
|
declare global {
|
|
188
253
|
interface ImportMetaEnv {
|
|
@@ -222,24 +287,13 @@ export interface FleetboAuthResult {
|
|
|
222
287
|
}
|
|
223
288
|
|
|
224
289
|
export declare const FleetboUI: {
|
|
225
|
-
Text:
|
|
226
|
-
Number:
|
|
227
|
-
Toggle:
|
|
228
|
-
Date:
|
|
229
|
-
Enum:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
id?: string;
|
|
233
|
-
render?: (doc: any) => React.ReactNode;
|
|
234
|
-
orphanFallback?: React.ReactNode;
|
|
235
|
-
malformedFallback?: React.ReactNode;
|
|
236
|
-
loadingFallback?: React.ReactNode;
|
|
237
|
-
className?: string;
|
|
238
|
-
}>;
|
|
239
|
-
List: React.FC<{ value?: any[]; render?: (item: any, index: number) => React.ReactNode; className?: string }>;
|
|
240
|
-
Media: React.FC<{ value?: any; alt?: string; className?: string; fallback?: React.ReactNode }>;
|
|
241
|
-
Geo: React.FC<{ value?: any; className?: string; render?: (coords: { lat: number; lng: number }) => React.ReactNode }>;
|
|
242
|
-
Smart: React.FC<any>;
|
|
290
|
+
Text: string;
|
|
291
|
+
Number: string;
|
|
292
|
+
Toggle: string;
|
|
293
|
+
Date: string;
|
|
294
|
+
Enum: string;
|
|
295
|
+
Media: string;
|
|
296
|
+
Reference: string;
|
|
243
297
|
};
|
|
244
298
|
|
|
245
299
|
export interface FleetboAclResult {
|
|
@@ -290,6 +344,73 @@ export declare const Fleetbo: typeof FleetboUI & {
|
|
|
290
344
|
};
|
|
291
345
|
|
|
292
346
|
declare global {
|
|
347
|
+
namespace JSX {
|
|
348
|
+
interface IntrinsicElements {
|
|
349
|
+
'fleetbo-text': {
|
|
350
|
+
value?: any;
|
|
351
|
+
fallback?: string;
|
|
352
|
+
class?: string;
|
|
353
|
+
className?: string;
|
|
354
|
+
};
|
|
355
|
+
'fleetbo-number': {
|
|
356
|
+
value?: any;
|
|
357
|
+
'invalid-fallback'?: string;
|
|
358
|
+
currency?: string;
|
|
359
|
+
class?: string;
|
|
360
|
+
className?: string;
|
|
361
|
+
};
|
|
362
|
+
'fleetbo-toggle': {
|
|
363
|
+
value?: any;
|
|
364
|
+
'label-true'?: string;
|
|
365
|
+
'label-false'?: string;
|
|
366
|
+
'invalid-fallback'?: string;
|
|
367
|
+
class?: string;
|
|
368
|
+
className?: string;
|
|
369
|
+
};
|
|
370
|
+
'fleetbo-date': {
|
|
371
|
+
value?: any;
|
|
372
|
+
locale?: string;
|
|
373
|
+
'invalid-fallback'?: string;
|
|
374
|
+
class?: string;
|
|
375
|
+
className?: string;
|
|
376
|
+
};
|
|
377
|
+
'fleetbo-enum': {
|
|
378
|
+
value?: any;
|
|
379
|
+
allowed?: string;
|
|
380
|
+
'invalid-fallback'?: string;
|
|
381
|
+
class?: string;
|
|
382
|
+
className?: string;
|
|
383
|
+
};
|
|
384
|
+
'fleetbo-media': {
|
|
385
|
+
value?: any;
|
|
386
|
+
alt?: string;
|
|
387
|
+
fallback?: string;
|
|
388
|
+
class?: string;
|
|
389
|
+
className?: string;
|
|
390
|
+
};
|
|
391
|
+
'fleetbo-reference': {
|
|
392
|
+
table: FleetboTables;
|
|
393
|
+
id?: string;
|
|
394
|
+
field?: string;
|
|
395
|
+
'orphan-fallback'?: string;
|
|
396
|
+
'loading-fallback'?: string;
|
|
397
|
+
'malformed-fallback'?: string;
|
|
398
|
+
class?: string;
|
|
399
|
+
className?: string;
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
interface HTMLElementTagNameMap {
|
|
405
|
+
'fleetbo-text': HTMLElement;
|
|
406
|
+
'fleetbo-number': HTMLElement;
|
|
407
|
+
'fleetbo-toggle': HTMLElement;
|
|
408
|
+
'fleetbo-date': HTMLElement;
|
|
409
|
+
'fleetbo-enum': HTMLElement;
|
|
410
|
+
'fleetbo-media': HTMLElement;
|
|
411
|
+
'fleetbo-reference': HTMLElement;
|
|
412
|
+
}
|
|
413
|
+
|
|
293
414
|
const Fleetbo: typeof import('./index').Fleetbo;
|
|
294
415
|
const FleetboUI: typeof import('./index').FleetboUI;
|
|
295
416
|
|
|
@@ -298,14 +419,14 @@ declare global {
|
|
|
298
419
|
FleetboUI: typeof FleetboUI;
|
|
299
420
|
}
|
|
300
421
|
}
|
|
301
|
-
`;if(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
422
|
+
`;if(p.writeFileSync(d,v),p.existsSync(y.dirname(e))){let f=`/* eslint-disable */
|
|
423
|
+
/* prettier-ignore */
|
|
424
|
+
// @ts-nocheck
|
|
425
|
+
// Generated by fleetbo-svro \u2014 Updated via fleetbo sql sync
|
|
426
|
+
export {}
|
|
427
|
+
declare global {
|
|
428
|
+
type FleetboTables = ${T};
|
|
429
|
+
const Fleetbo: typeof import('fleetbo-svro')['Fleetbo'];
|
|
430
|
+
const FleetboUI: typeof import('fleetbo-svro')['FleetboUI'];
|
|
431
|
+
}
|
|
432
|
+
`;p.writeFileSync(e,f)}G(t),m(`[Fleetbo] Schema synced successfully (${F.length} collection(s)).`),o&&m("\u2192 [Dry-run] Schema is valid.")}catch(a){h(`Error during synchronization: ${a.message}`),process.exit(1)}}else h('Unknown command. Usage: "npx fleetbo-svro init --keyApp=xxx --token=yyy"'),process.exit(1)}te().catch(t=>{h(`Fleetbo CLI Error: ${t.message}`),process.exit(1)});
|