@tinybirdco/sdk 0.0.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/README.md +518 -0
- package/bin/tinybird.js +7 -0
- package/dist/api/branches.d.ts +98 -0
- package/dist/api/branches.d.ts.map +1 -0
- package/dist/api/branches.js +203 -0
- package/dist/api/branches.js.map +1 -0
- package/dist/api/branches.test.d.ts +2 -0
- package/dist/api/branches.test.d.ts.map +1 -0
- package/dist/api/branches.test.js +286 -0
- package/dist/api/branches.test.js.map +1 -0
- package/dist/api/build.d.ts +130 -0
- package/dist/api/build.d.ts.map +1 -0
- package/dist/api/build.js +143 -0
- package/dist/api/build.js.map +1 -0
- package/dist/api/build.test.d.ts +2 -0
- package/dist/api/build.test.d.ts.map +1 -0
- package/dist/api/build.test.js +138 -0
- package/dist/api/build.test.js.map +1 -0
- package/dist/api/deploy.d.ts +39 -0
- package/dist/api/deploy.d.ts.map +1 -0
- package/dist/api/deploy.js +135 -0
- package/dist/api/deploy.js.map +1 -0
- package/dist/api/deploy.test.d.ts +2 -0
- package/dist/api/deploy.test.d.ts.map +1 -0
- package/dist/api/deploy.test.js +118 -0
- package/dist/api/deploy.test.js.map +1 -0
- package/dist/api/workspaces.d.ts +46 -0
- package/dist/api/workspaces.d.ts.map +1 -0
- package/dist/api/workspaces.js +39 -0
- package/dist/api/workspaces.js.map +1 -0
- package/dist/api/workspaces.test.d.ts +2 -0
- package/dist/api/workspaces.test.d.ts.map +1 -0
- package/dist/api/workspaces.test.js +65 -0
- package/dist/api/workspaces.test.js.map +1 -0
- package/dist/cli/auth.d.ts +86 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/auth.js +284 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/branch-store.d.ts +53 -0
- package/dist/cli/branch-store.d.ts.map +1 -0
- package/dist/cli/branch-store.js +91 -0
- package/dist/cli/branch-store.js.map +1 -0
- package/dist/cli/branch-store.test.d.ts +2 -0
- package/dist/cli/branch-store.test.d.ts.map +1 -0
- package/dist/cli/branch-store.test.js +115 -0
- package/dist/cli/branch-store.test.js.map +1 -0
- package/dist/cli/commands/branch.d.ts +82 -0
- package/dist/cli/commands/branch.d.ts.map +1 -0
- package/dist/cli/commands/branch.js +215 -0
- package/dist/cli/commands/branch.js.map +1 -0
- package/dist/cli/commands/build.d.ts +43 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +138 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/dev.d.ts +78 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/dev.js +226 -0
- package/dist/cli/commands/dev.js.map +1 -0
- package/dist/cli/commands/init.d.ts +45 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +277 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/init.test.d.ts +2 -0
- package/dist/cli/commands/init.test.d.ts.map +1 -0
- package/dist/cli/commands/init.test.js +158 -0
- package/dist/cli/commands/init.test.js.map +1 -0
- package/dist/cli/commands/login.d.ts +37 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +64 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/config.d.ts +114 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +258 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/config.test.d.ts +2 -0
- package/dist/cli/config.test.d.ts.map +1 -0
- package/dist/cli/config.test.js +243 -0
- package/dist/cli/config.test.js.map +1 -0
- package/dist/cli/env.d.ts +29 -0
- package/dist/cli/env.d.ts.map +1 -0
- package/dist/cli/env.js +66 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/git.d.ts +29 -0
- package/dist/cli/git.d.ts.map +1 -0
- package/dist/cli/git.js +114 -0
- package/dist/cli/git.js.map +1 -0
- package/dist/cli/git.test.d.ts +2 -0
- package/dist/cli/git.test.d.ts.map +1 -0
- package/dist/cli/git.test.js +125 -0
- package/dist/cli/git.test.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +337 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/utils/schema-validation.d.ts +95 -0
- package/dist/cli/utils/schema-validation.d.ts.map +1 -0
- package/dist/cli/utils/schema-validation.js +175 -0
- package/dist/cli/utils/schema-validation.js.map +1 -0
- package/dist/cli/utils/schema-validation.test.d.ts +5 -0
- package/dist/cli/utils/schema-validation.test.d.ts.map +1 -0
- package/dist/cli/utils/schema-validation.test.js +173 -0
- package/dist/cli/utils/schema-validation.test.js.map +1 -0
- package/dist/client/base.d.ts +116 -0
- package/dist/client/base.d.ts.map +1 -0
- package/dist/client/base.js +328 -0
- package/dist/client/base.js.map +1 -0
- package/dist/client/types.d.ts +137 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +43 -0
- package/dist/client/types.js.map +1 -0
- package/dist/generator/client.d.ts +44 -0
- package/dist/generator/client.d.ts.map +1 -0
- package/dist/generator/client.js +144 -0
- package/dist/generator/client.js.map +1 -0
- package/dist/generator/datasource.d.ts +57 -0
- package/dist/generator/datasource.d.ts.map +1 -0
- package/dist/generator/datasource.js +169 -0
- package/dist/generator/datasource.js.map +1 -0
- package/dist/generator/datasource.test.d.ts +2 -0
- package/dist/generator/datasource.test.d.ts.map +1 -0
- package/dist/generator/datasource.test.js +254 -0
- package/dist/generator/datasource.test.js.map +1 -0
- package/dist/generator/index.d.ts +131 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +121 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/generator/index.test.d.ts +2 -0
- package/dist/generator/index.test.d.ts.map +1 -0
- package/dist/generator/index.test.js +175 -0
- package/dist/generator/index.test.js.map +1 -0
- package/dist/generator/loader.d.ts +156 -0
- package/dist/generator/loader.d.ts.map +1 -0
- package/dist/generator/loader.js +295 -0
- package/dist/generator/loader.js.map +1 -0
- package/dist/generator/pipe.d.ts +72 -0
- package/dist/generator/pipe.d.ts.map +1 -0
- package/dist/generator/pipe.js +174 -0
- package/dist/generator/pipe.js.map +1 -0
- package/dist/generator/pipe.test.d.ts +2 -0
- package/dist/generator/pipe.test.d.ts.map +1 -0
- package/dist/generator/pipe.test.js +393 -0
- package/dist/generator/pipe.test.js.map +1 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/infer/index.d.ts +202 -0
- package/dist/infer/index.d.ts.map +1 -0
- package/dist/infer/index.js +5 -0
- package/dist/infer/index.js.map +1 -0
- package/dist/schema/datasource.d.ts +135 -0
- package/dist/schema/datasource.d.ts.map +1 -0
- package/dist/schema/datasource.js +105 -0
- package/dist/schema/datasource.js.map +1 -0
- package/dist/schema/datasource.test.d.ts +2 -0
- package/dist/schema/datasource.test.d.ts.map +1 -0
- package/dist/schema/datasource.test.js +142 -0
- package/dist/schema/datasource.test.js.map +1 -0
- package/dist/schema/engines.d.ts +157 -0
- package/dist/schema/engines.d.ts.map +1 -0
- package/dist/schema/engines.js +155 -0
- package/dist/schema/engines.js.map +1 -0
- package/dist/schema/engines.test.d.ts +2 -0
- package/dist/schema/engines.test.d.ts.map +1 -0
- package/dist/schema/engines.test.js +221 -0
- package/dist/schema/engines.test.js.map +1 -0
- package/dist/schema/params.d.ts +106 -0
- package/dist/schema/params.d.ts.map +1 -0
- package/dist/schema/params.js +138 -0
- package/dist/schema/params.js.map +1 -0
- package/dist/schema/params.test.d.ts +2 -0
- package/dist/schema/params.test.d.ts.map +1 -0
- package/dist/schema/params.test.js +175 -0
- package/dist/schema/params.test.js.map +1 -0
- package/dist/schema/pipe.d.ts +436 -0
- package/dist/schema/pipe.d.ts.map +1 -0
- package/dist/schema/pipe.js +484 -0
- package/dist/schema/pipe.js.map +1 -0
- package/dist/schema/pipe.test.d.ts +2 -0
- package/dist/schema/pipe.test.d.ts.map +1 -0
- package/dist/schema/pipe.test.js +488 -0
- package/dist/schema/pipe.test.js.map +1 -0
- package/dist/schema/project.d.ts +202 -0
- package/dist/schema/project.d.ts.map +1 -0
- package/dist/schema/project.js +188 -0
- package/dist/schema/project.js.map +1 -0
- package/dist/schema/project.test.d.ts +2 -0
- package/dist/schema/project.test.d.ts.map +1 -0
- package/dist/schema/project.test.js +180 -0
- package/dist/schema/project.test.js.map +1 -0
- package/dist/schema/types.d.ts +140 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/types.js +174 -0
- package/dist/schema/types.js.map +1 -0
- package/dist/schema/types.test.d.ts +2 -0
- package/dist/schema/types.test.d.ts.map +1 -0
- package/dist/schema/types.test.js +176 -0
- package/dist/schema/types.test.js.map +1 -0
- package/dist/test/handlers.d.ts +58 -0
- package/dist/test/handlers.d.ts.map +1 -0
- package/dist/test/handlers.js +62 -0
- package/dist/test/handlers.js.map +1 -0
- package/dist/test/setup.d.ts +5 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +11 -0
- package/dist/test/setup.js.map +1 -0
- package/package.json +57 -0
- package/src/api/branches.test.ts +377 -0
- package/src/api/branches.ts +334 -0
- package/src/api/build.test.ts +216 -0
- package/src/api/build.ts +266 -0
- package/src/api/deploy.test.ts +193 -0
- package/src/api/deploy.ts +163 -0
- package/src/api/workspaces.test.ts +81 -0
- package/src/api/workspaces.ts +77 -0
- package/src/cli/auth.ts +358 -0
- package/src/cli/branch-store.test.ts +139 -0
- package/src/cli/branch-store.ts +137 -0
- package/src/cli/commands/branch.ts +306 -0
- package/src/cli/commands/build.ts +183 -0
- package/src/cli/commands/dev.ts +334 -0
- package/src/cli/commands/init.test.ts +249 -0
- package/src/cli/commands/init.ts +323 -0
- package/src/cli/commands/login.ts +98 -0
- package/src/cli/config.test.ts +359 -0
- package/src/cli/config.ts +335 -0
- package/src/cli/env.ts +86 -0
- package/src/cli/git.test.ts +147 -0
- package/src/cli/git.ts +125 -0
- package/src/cli/index.ts +382 -0
- package/src/cli/utils/schema-validation.test.ts +222 -0
- package/src/cli/utils/schema-validation.ts +272 -0
- package/src/client/base.ts +414 -0
- package/src/client/types.ts +165 -0
- package/src/generator/client.ts +194 -0
- package/src/generator/datasource.test.ts +297 -0
- package/src/generator/datasource.ts +217 -0
- package/src/generator/index.test.ts +209 -0
- package/src/generator/index.ts +203 -0
- package/src/generator/loader.ts +406 -0
- package/src/generator/pipe.test.ts +441 -0
- package/src/generator/pipe.ts +220 -0
- package/src/index.ts +191 -0
- package/src/infer/index.ts +247 -0
- package/src/schema/datasource.test.ts +187 -0
- package/src/schema/datasource.ts +195 -0
- package/src/schema/engines.test.ts +247 -0
- package/src/schema/engines.ts +271 -0
- package/src/schema/params.test.ts +208 -0
- package/src/schema/params.ts +249 -0
- package/src/schema/pipe.test.ts +588 -0
- package/src/schema/pipe.ts +832 -0
- package/src/schema/project.test.ts +236 -0
- package/src/schema/project.ts +394 -0
- package/src/schema/types.test.ts +212 -0
- package/src/schema/types.ts +366 -0
- package/src/test/handlers.ts +79 -0
- package/src/test/setup.ts +13 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client types for Tinybird API interactions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the Tinybird client
|
|
6
|
+
*/
|
|
7
|
+
export interface ClientConfig {
|
|
8
|
+
/** Tinybird API base URL (e.g., 'https://api.tinybird.co' or 'https://api.us-east.tinybird.co') */
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
/** API token for authentication */
|
|
11
|
+
token: string;
|
|
12
|
+
/** Custom fetch implementation (optional, defaults to global fetch) */
|
|
13
|
+
fetch?: typeof fetch;
|
|
14
|
+
/** Default timeout in milliseconds (optional) */
|
|
15
|
+
timeout?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Enable dev mode to automatically use branch tokens when on a feature branch.
|
|
18
|
+
* When enabled, the client will detect the git branch and use the corresponding
|
|
19
|
+
* Tinybird branch token instead of the workspace token.
|
|
20
|
+
*/
|
|
21
|
+
devMode?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Column metadata from query response
|
|
25
|
+
*/
|
|
26
|
+
export interface ColumnMeta {
|
|
27
|
+
/** Column name */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Column type (Tinybird/ClickHouse type) */
|
|
30
|
+
type: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Query statistics from response
|
|
34
|
+
*/
|
|
35
|
+
export interface QueryStatistics {
|
|
36
|
+
/** Time elapsed in seconds */
|
|
37
|
+
elapsed: number;
|
|
38
|
+
/** Number of rows read */
|
|
39
|
+
rows_read: number;
|
|
40
|
+
/** Number of bytes read */
|
|
41
|
+
bytes_read: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Result of a query operation
|
|
45
|
+
*/
|
|
46
|
+
export interface QueryResult<T> {
|
|
47
|
+
/** Query result data */
|
|
48
|
+
data: T[];
|
|
49
|
+
/** Column metadata */
|
|
50
|
+
meta: ColumnMeta[];
|
|
51
|
+
/** Number of rows returned */
|
|
52
|
+
rows: number;
|
|
53
|
+
/** Query statistics */
|
|
54
|
+
statistics: QueryStatistics;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Result of an ingest operation
|
|
58
|
+
*/
|
|
59
|
+
export interface IngestResult {
|
|
60
|
+
/** Number of rows successfully ingested */
|
|
61
|
+
successful_rows: number;
|
|
62
|
+
/** Number of rows that failed to ingest */
|
|
63
|
+
quarantined_rows: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Error response from Tinybird API
|
|
67
|
+
*/
|
|
68
|
+
export interface TinybirdErrorResponse {
|
|
69
|
+
/** Error message */
|
|
70
|
+
error: string;
|
|
71
|
+
/** HTTP status code */
|
|
72
|
+
status?: number;
|
|
73
|
+
/** Additional error details */
|
|
74
|
+
documentation?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Custom error class for Tinybird API errors
|
|
78
|
+
*/
|
|
79
|
+
export declare class TinybirdError extends Error {
|
|
80
|
+
/** HTTP status code */
|
|
81
|
+
readonly statusCode: number;
|
|
82
|
+
/** Raw error response */
|
|
83
|
+
readonly response?: TinybirdErrorResponse;
|
|
84
|
+
constructor(message: string, statusCode: number, response?: TinybirdErrorResponse);
|
|
85
|
+
/**
|
|
86
|
+
* Check if this is a rate limit error
|
|
87
|
+
*/
|
|
88
|
+
isRateLimitError(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Check if this is an authentication error
|
|
91
|
+
*/
|
|
92
|
+
isAuthError(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Check if this is a not found error
|
|
95
|
+
*/
|
|
96
|
+
isNotFoundError(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Check if this is a server error
|
|
99
|
+
*/
|
|
100
|
+
isServerError(): boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Options for query requests
|
|
104
|
+
*/
|
|
105
|
+
export interface QueryOptions {
|
|
106
|
+
/** Request timeout in milliseconds */
|
|
107
|
+
timeout?: number;
|
|
108
|
+
/** AbortController signal for cancellation */
|
|
109
|
+
signal?: AbortSignal;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Options for ingest requests
|
|
113
|
+
*/
|
|
114
|
+
export interface IngestOptions {
|
|
115
|
+
/** Request timeout in milliseconds */
|
|
116
|
+
timeout?: number;
|
|
117
|
+
/** AbortController signal for cancellation */
|
|
118
|
+
signal?: AbortSignal;
|
|
119
|
+
/** Wait for the ingestion to complete before returning */
|
|
120
|
+
wait?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Base interface for typed pipe endpoints
|
|
124
|
+
*/
|
|
125
|
+
export interface TypedPipeEndpoint<TParams, TOutput> {
|
|
126
|
+
(params: TParams, options?: QueryOptions): Promise<QueryResult<TOutput>>;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Base interface for typed datasource ingestion
|
|
130
|
+
*/
|
|
131
|
+
export interface TypedDatasourceIngest<TRow> {
|
|
132
|
+
/** Send a single event */
|
|
133
|
+
send(event: TRow, options?: IngestOptions): Promise<IngestResult>;
|
|
134
|
+
/** Send multiple events in a batch */
|
|
135
|
+
sendBatch(events: TRow[], options?: IngestOptions): Promise<IngestResult>;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mGAAmG;IACnG,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,wBAAwB;IACxB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,sBAAsB;IACtB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;I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AAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;CAC1E;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,IAAI;IACzC,0BAA0B;IAC1B,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAClE,sCAAsC;IACtC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC3E"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client types for Tinybird API interactions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Custom error class for Tinybird API errors
|
|
6
|
+
*/
|
|
7
|
+
export class TinybirdError extends Error {
|
|
8
|
+
/** HTTP status code */
|
|
9
|
+
statusCode;
|
|
10
|
+
/** Raw error response */
|
|
11
|
+
response;
|
|
12
|
+
constructor(message, statusCode, response) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = "TinybirdError";
|
|
15
|
+
this.statusCode = statusCode;
|
|
16
|
+
this.response = response;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Check if this is a rate limit error
|
|
20
|
+
*/
|
|
21
|
+
isRateLimitError() {
|
|
22
|
+
return this.statusCode === 429;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Check if this is an authentication error
|
|
26
|
+
*/
|
|
27
|
+
isAuthError() {
|
|
28
|
+
return this.statusCode === 401 || this.statusCode === 403;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if this is a not found error
|
|
32
|
+
*/
|
|
33
|
+
isNotFoundError() {
|
|
34
|
+
return this.statusCode === 404;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check if this is a server error
|
|
38
|
+
*/
|
|
39
|
+
isServerError() {
|
|
40
|
+
return this.statusCode >= 500;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgFH;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,uBAAuB;IACd,UAAU,CAAS;IAC5B,yBAAyB;IAChB,QAAQ,CAAyB;IAE1C,YAAY,OAAe,EAAE,UAAkB,EAAE,QAAgC;QAC/E,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,IAAI,GAAG,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client file generator
|
|
3
|
+
* Generates a typed tinybird.ts client file from discovered entities
|
|
4
|
+
*/
|
|
5
|
+
import type { LoadedEntities } from "./loader.js";
|
|
6
|
+
/**
|
|
7
|
+
* Options for generating the client file
|
|
8
|
+
*/
|
|
9
|
+
export interface GenerateClientOptions {
|
|
10
|
+
/** Loaded entities from source files */
|
|
11
|
+
entities: LoadedEntities;
|
|
12
|
+
/** Output file path (relative to cwd) */
|
|
13
|
+
outputPath: string;
|
|
14
|
+
/** Working directory */
|
|
15
|
+
cwd: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Result of generating the client file
|
|
19
|
+
*/
|
|
20
|
+
export interface GeneratedClient {
|
|
21
|
+
/** The generated file content */
|
|
22
|
+
content: string;
|
|
23
|
+
/** Absolute path to output file */
|
|
24
|
+
absolutePath: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Generate the client file content
|
|
28
|
+
*
|
|
29
|
+
* @param options - Generation options
|
|
30
|
+
* @returns Generated client file info
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const result = generateClientFile({
|
|
35
|
+
* entities: loadedEntities,
|
|
36
|
+
* outputPath: 'src/tinybird.ts',
|
|
37
|
+
* cwd: '/path/to/project',
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* fs.writeFileSync(result.absolutePath, result.content);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function generateClientFile(options: GenerateClientOptions): GeneratedClient;
|
|
44
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/generator/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,QAAQ,EAAE,cAAc,CAAC;IACzB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB;AAkCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,GAAG,eAAe,CAkHlF"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client file generator
|
|
3
|
+
* Generates a typed tinybird.ts client file from discovered entities
|
|
4
|
+
*/
|
|
5
|
+
import * as path from "path";
|
|
6
|
+
/**
|
|
7
|
+
* Convert a file path to a relative import path
|
|
8
|
+
* e.g., "src/datasources.ts" -> "./datasources" when output is "src/tinybird.ts"
|
|
9
|
+
*/
|
|
10
|
+
function toRelativeImport(fromPath, toPath) {
|
|
11
|
+
// Get directory of the from file
|
|
12
|
+
const fromDir = path.dirname(fromPath);
|
|
13
|
+
// Get relative path from output dir to source file
|
|
14
|
+
let relativePath = path.relative(fromDir, toPath);
|
|
15
|
+
// Normalize Windows separators to forward slashes for TS imports
|
|
16
|
+
relativePath = relativePath.replace(/\\/g, "/");
|
|
17
|
+
// Remove .ts extension
|
|
18
|
+
relativePath = relativePath.replace(/\.tsx?$/, "");
|
|
19
|
+
// Ensure it starts with ./ or ../
|
|
20
|
+
if (!relativePath.startsWith(".") && !relativePath.startsWith("/")) {
|
|
21
|
+
relativePath = "./" + relativePath;
|
|
22
|
+
}
|
|
23
|
+
return relativePath;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Convert camelCase to PascalCase
|
|
27
|
+
*/
|
|
28
|
+
function toPascalCase(str) {
|
|
29
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate the client file content
|
|
33
|
+
*
|
|
34
|
+
* @param options - Generation options
|
|
35
|
+
* @returns Generated client file info
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const result = generateClientFile({
|
|
40
|
+
* entities: loadedEntities,
|
|
41
|
+
* outputPath: 'src/tinybird.ts',
|
|
42
|
+
* cwd: '/path/to/project',
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* fs.writeFileSync(result.absolutePath, result.content);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export function generateClientFile(options) {
|
|
49
|
+
const { entities, outputPath, cwd } = options;
|
|
50
|
+
const absolutePath = path.isAbsolute(outputPath) ? outputPath : path.join(cwd, outputPath);
|
|
51
|
+
// Group entities by source file for imports
|
|
52
|
+
const importsByFile = new Map();
|
|
53
|
+
for (const [name, { info }] of Object.entries(entities.datasources)) {
|
|
54
|
+
if (!importsByFile.has(info.sourceFile)) {
|
|
55
|
+
importsByFile.set(info.sourceFile, { datasources: [], pipes: [] });
|
|
56
|
+
}
|
|
57
|
+
importsByFile.get(info.sourceFile).datasources.push(name);
|
|
58
|
+
}
|
|
59
|
+
for (const [name, { info }] of Object.entries(entities.pipes)) {
|
|
60
|
+
if (!importsByFile.has(info.sourceFile)) {
|
|
61
|
+
importsByFile.set(info.sourceFile, { datasources: [], pipes: [] });
|
|
62
|
+
}
|
|
63
|
+
importsByFile.get(info.sourceFile).pipes.push(name);
|
|
64
|
+
}
|
|
65
|
+
// Build import statements
|
|
66
|
+
const importLines = [];
|
|
67
|
+
const reexportLines = [];
|
|
68
|
+
// SDK imports
|
|
69
|
+
const sdkTypes = ["InferRow"];
|
|
70
|
+
if (Object.keys(entities.pipes).length > 0) {
|
|
71
|
+
sdkTypes.push("InferParams", "InferOutputRow");
|
|
72
|
+
}
|
|
73
|
+
importLines.push(`import { createTinybirdClient, type ${sdkTypes.join(", type ")} } from "@tinybirdco/sdk";`);
|
|
74
|
+
importLines.push("");
|
|
75
|
+
// Entity imports and re-exports
|
|
76
|
+
for (const [sourceFile, { datasources, pipes }] of importsByFile) {
|
|
77
|
+
const allExports = [...datasources, ...pipes];
|
|
78
|
+
if (allExports.length === 0)
|
|
79
|
+
continue;
|
|
80
|
+
// Resolve to absolute paths for correct relative path calculation
|
|
81
|
+
const sourceAbsolute = path.isAbsolute(sourceFile) ? sourceFile : path.join(cwd, sourceFile);
|
|
82
|
+
const relativePath = toRelativeImport(absolutePath, sourceAbsolute);
|
|
83
|
+
importLines.push(`import { ${allExports.join(", ")} } from "${relativePath}";`);
|
|
84
|
+
reexportLines.push(`export { ${allExports.join(", ")} } from "${relativePath}";`);
|
|
85
|
+
}
|
|
86
|
+
// Build createTinybirdClient call
|
|
87
|
+
const datasourceNames = Object.keys(entities.datasources);
|
|
88
|
+
const pipeNames = Object.keys(entities.pipes);
|
|
89
|
+
const clientLines = [];
|
|
90
|
+
clientLines.push("export const tinybird = createTinybirdClient({");
|
|
91
|
+
if (datasourceNames.length > 0) {
|
|
92
|
+
clientLines.push(` datasources: { ${datasourceNames.join(", ")} },`);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
clientLines.push(" datasources: {},");
|
|
96
|
+
}
|
|
97
|
+
if (pipeNames.length > 0) {
|
|
98
|
+
clientLines.push(` pipes: { ${pipeNames.join(", ")} },`);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
clientLines.push(" pipes: {},");
|
|
102
|
+
}
|
|
103
|
+
clientLines.push("});");
|
|
104
|
+
// Build type exports
|
|
105
|
+
const typeLines = [];
|
|
106
|
+
for (const name of datasourceNames) {
|
|
107
|
+
const pascalName = toPascalCase(name);
|
|
108
|
+
typeLines.push(`export type ${pascalName}Row = InferRow<typeof ${name}>;`);
|
|
109
|
+
}
|
|
110
|
+
for (const name of pipeNames) {
|
|
111
|
+
const { definition } = entities.pipes[name];
|
|
112
|
+
const pascalName = toPascalCase(name);
|
|
113
|
+
typeLines.push(`export type ${pascalName}Params = InferParams<typeof ${name}>;`);
|
|
114
|
+
// Only generate Output type for pipes with output schema
|
|
115
|
+
if (definition._output) {
|
|
116
|
+
typeLines.push(`export type ${pascalName}Output = InferOutputRow<typeof ${name}>;`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Combine all sections
|
|
120
|
+
const sections = [
|
|
121
|
+
"// Auto-generated by @tinybirdco/sdk - DO NOT EDIT",
|
|
122
|
+
"// This file is regenerated on every build. Manual changes will be overwritten.",
|
|
123
|
+
"",
|
|
124
|
+
importLines.join("\n"),
|
|
125
|
+
"",
|
|
126
|
+
"// Typed Tinybird client",
|
|
127
|
+
clientLines.join("\n"),
|
|
128
|
+
"",
|
|
129
|
+
"// Re-export entities for convenience",
|
|
130
|
+
reexportLines.join("\n"),
|
|
131
|
+
];
|
|
132
|
+
if (typeLines.length > 0) {
|
|
133
|
+
sections.push("");
|
|
134
|
+
sections.push("// Inferred types from entity definitions");
|
|
135
|
+
sections.push(typeLines.join("\n"));
|
|
136
|
+
}
|
|
137
|
+
sections.push(""); // Trailing newline
|
|
138
|
+
const content = sections.join("\n");
|
|
139
|
+
return {
|
|
140
|
+
content,
|
|
141
|
+
absolutePath,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/generator/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAyB7B;;;GAGG;AACH,SAAS,gBAAgB,CAAC,QAAgB,EAAE,MAAc;IACxD,iCAAiC;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEvC,mDAAmD;IACnD,IAAI,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAElD,iEAAiE;IACjE,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEhD,uBAAuB;IACvB,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAEnD,kCAAkC;IAClC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GA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asourceDefinition to native .datasource file format
|
|
4
|
+
*/
|
|
5
|
+
import type { DatasourceDefinition } from "../schema/datasource.js";
|
|
6
|
+
/**
|
|
7
|
+
* Generated datasource content
|
|
8
|
+
*/
|
|
9
|
+
export interface GeneratedDatasource {
|
|
10
|
+
/** Datasource name */
|
|
11
|
+
name: string;
|
|
12
|
+
/** The generated .datasource file content */
|
|
13
|
+
content: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Generate a .datasource file content from a DatasourceDefinition
|
|
17
|
+
*
|
|
18
|
+
* @param datasource - The datasource definition
|
|
19
|
+
* @returns Generated datasource content
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const events = defineDatasource('events', {
|
|
24
|
+
* description: 'User events',
|
|
25
|
+
* schema: {
|
|
26
|
+
* timestamp: t.dateTime(),
|
|
27
|
+
* user_id: t.string(),
|
|
28
|
+
* event: t.string(),
|
|
29
|
+
* },
|
|
30
|
+
* engine: engine.mergeTree({
|
|
31
|
+
* sortingKey: ['user_id', 'timestamp'],
|
|
32
|
+
* }),
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* const { content } = generateDatasource(events);
|
|
36
|
+
* // Returns:
|
|
37
|
+
* // DESCRIPTION >
|
|
38
|
+
* // User events
|
|
39
|
+
* //
|
|
40
|
+
* // SCHEMA >
|
|
41
|
+
* // timestamp DateTime,
|
|
42
|
+
* // user_id String,
|
|
43
|
+
* // event String
|
|
44
|
+
* //
|
|
45
|
+
* // ENGINE "MergeTree"
|
|
46
|
+
* // ENGINE_SORTING_KEY "user_id, timestamp"
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function generateDatasource(datasource: DatasourceDefinition): GeneratedDatasource;
|
|
50
|
+
/**
|
|
51
|
+
* Generate .datasource files for all datasources in a project
|
|
52
|
+
*
|
|
53
|
+
* @param datasources - Record of datasource definitions
|
|
54
|
+
* @returns Array of generated datasource content
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateAllDatasources(datasources: Record<string, DatasourceDefinition>): GeneratedDatasource[];
|
|
57
|
+
//# sourceMappingURL=datasource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/generator/datasource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAsC,MAAM,yBAAyB,CAAC;AAKxG;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;CACjB;AA+HD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,oBAAoB,GAC/B,mBAAmB,CAuBrB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAChD,mBAAmB,EAAE,CAEvB"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Datasource content generator
|
|
3
|
+
* Converts DatasourceDefinition to native .datasource file format
|
|
4
|
+
*/
|
|
5
|
+
import { getColumnType, getColumnJsonPath } from "../schema/datasource.js";
|
|
6
|
+
import { getEngineClause } from "../schema/engines.js";
|
|
7
|
+
/**
|
|
8
|
+
* Get the Tinybird type string from a type validator
|
|
9
|
+
* Handles the internal structure of validators
|
|
10
|
+
*/
|
|
11
|
+
function getTinybirdTypeFromValidator(validator) {
|
|
12
|
+
// The validator has _tinybirdType as the type string
|
|
13
|
+
return validator._tinybirdType;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get modifiers from a validator
|
|
17
|
+
*/
|
|
18
|
+
function getModifiersFromValidator(validator) {
|
|
19
|
+
return validator._modifiers;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Format a default value for the datasource file
|
|
23
|
+
*/
|
|
24
|
+
function formatDefaultValue(value, tinybirdType) {
|
|
25
|
+
if (value === null) {
|
|
26
|
+
return "NULL";
|
|
27
|
+
}
|
|
28
|
+
if (typeof value === "string") {
|
|
29
|
+
// Escape single quotes
|
|
30
|
+
return `'${value.replace(/'/g, "\\'")}'`;
|
|
31
|
+
}
|
|
32
|
+
if (typeof value === "number" || typeof value === "bigint") {
|
|
33
|
+
return String(value);
|
|
34
|
+
}
|
|
35
|
+
if (typeof value === "boolean") {
|
|
36
|
+
return value ? "1" : "0";
|
|
37
|
+
}
|
|
38
|
+
if (value instanceof Date) {
|
|
39
|
+
// Format based on type
|
|
40
|
+
if (tinybirdType.startsWith("Date") && !tinybirdType.includes("Time")) {
|
|
41
|
+
return `'${value.toISOString().split("T")[0]}'`;
|
|
42
|
+
}
|
|
43
|
+
return `'${value.toISOString().replace("T", " ").slice(0, 19)}'`;
|
|
44
|
+
}
|
|
45
|
+
// For arrays and objects, use raw JSON (no quotes)
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
return JSON.stringify(value);
|
|
48
|
+
}
|
|
49
|
+
if (typeof value === "object" && value !== null) {
|
|
50
|
+
return JSON.stringify(value);
|
|
51
|
+
}
|
|
52
|
+
// Fallback for other types - stringify as string literal
|
|
53
|
+
return `'${String(value).replace(/'/g, "\\'")}'`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Generate a column definition line for the schema
|
|
57
|
+
*/
|
|
58
|
+
function generateColumnLine(columnName, column, includeJsonPaths) {
|
|
59
|
+
const validator = getColumnType(column);
|
|
60
|
+
const jsonPath = getColumnJsonPath(column);
|
|
61
|
+
const tinybirdType = getTinybirdTypeFromValidator(validator);
|
|
62
|
+
const modifiers = getModifiersFromValidator(validator);
|
|
63
|
+
const parts = [` ${columnName} ${tinybirdType}`];
|
|
64
|
+
// Add JSON path for Events API ingestion support if enabled
|
|
65
|
+
// Use explicit jsonPath if defined, otherwise default to $.columnName
|
|
66
|
+
if (includeJsonPaths) {
|
|
67
|
+
const effectiveJsonPath = jsonPath ?? `$.${columnName}`;
|
|
68
|
+
parts.push(`\`json:${effectiveJsonPath}\``);
|
|
69
|
+
}
|
|
70
|
+
// Add default value if defined
|
|
71
|
+
if (modifiers.hasDefault && modifiers.defaultValue !== undefined) {
|
|
72
|
+
const defaultStr = formatDefaultValue(modifiers.defaultValue, tinybirdType);
|
|
73
|
+
parts.push(`DEFAULT ${defaultStr}`);
|
|
74
|
+
}
|
|
75
|
+
// Add codec if defined
|
|
76
|
+
if (modifiers.codec) {
|
|
77
|
+
parts.push(`CODEC(${modifiers.codec})`);
|
|
78
|
+
}
|
|
79
|
+
return parts.join(" ");
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generate the SCHEMA section
|
|
83
|
+
*/
|
|
84
|
+
function generateSchema(schema, includeJsonPaths) {
|
|
85
|
+
const lines = ["SCHEMA >"];
|
|
86
|
+
const columnNames = Object.keys(schema);
|
|
87
|
+
columnNames.forEach((name, index) => {
|
|
88
|
+
const column = schema[name];
|
|
89
|
+
const line = generateColumnLine(name, column, includeJsonPaths);
|
|
90
|
+
// Add comma if not the last column
|
|
91
|
+
const suffix = index < columnNames.length - 1 ? "," : "";
|
|
92
|
+
lines.push(line + suffix);
|
|
93
|
+
});
|
|
94
|
+
return lines.join("\n");
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Generate the engine configuration
|
|
98
|
+
* Uses the helper from engines.ts if an engine is provided
|
|
99
|
+
*/
|
|
100
|
+
function generateEngineConfig(engine) {
|
|
101
|
+
if (!engine) {
|
|
102
|
+
// Default to MergeTree with first column as sorting key
|
|
103
|
+
return 'ENGINE "MergeTree"';
|
|
104
|
+
}
|
|
105
|
+
return getEngineClause(engine);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Generate a .datasource file content from a DatasourceDefinition
|
|
109
|
+
*
|
|
110
|
+
* @param datasource - The datasource definition
|
|
111
|
+
* @returns Generated datasource content
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* const events = defineDatasource('events', {
|
|
116
|
+
* description: 'User events',
|
|
117
|
+
* schema: {
|
|
118
|
+
* timestamp: t.dateTime(),
|
|
119
|
+
* user_id: t.string(),
|
|
120
|
+
* event: t.string(),
|
|
121
|
+
* },
|
|
122
|
+
* engine: engine.mergeTree({
|
|
123
|
+
* sortingKey: ['user_id', 'timestamp'],
|
|
124
|
+
* }),
|
|
125
|
+
* });
|
|
126
|
+
*
|
|
127
|
+
* const { content } = generateDatasource(events);
|
|
128
|
+
* // Returns:
|
|
129
|
+
* // DESCRIPTION >
|
|
130
|
+
* // User events
|
|
131
|
+
* //
|
|
132
|
+
* // SCHEMA >
|
|
133
|
+
* // timestamp DateTime,
|
|
134
|
+
* // user_id String,
|
|
135
|
+
* // event String
|
|
136
|
+
* //
|
|
137
|
+
* // ENGINE "MergeTree"
|
|
138
|
+
* // ENGINE_SORTING_KEY "user_id, timestamp"
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export function generateDatasource(datasource) {
|
|
142
|
+
const parts = [];
|
|
143
|
+
// Add description if present
|
|
144
|
+
if (datasource.options.description) {
|
|
145
|
+
parts.push(`DESCRIPTION >\n ${datasource.options.description}`);
|
|
146
|
+
parts.push("");
|
|
147
|
+
}
|
|
148
|
+
// Check if JSON paths should be included (defaults to true)
|
|
149
|
+
const includeJsonPaths = datasource.options.jsonPaths !== false;
|
|
150
|
+
// Add schema
|
|
151
|
+
parts.push(generateSchema(datasource._schema, includeJsonPaths));
|
|
152
|
+
parts.push("");
|
|
153
|
+
// Add engine configuration
|
|
154
|
+
parts.push(generateEngineConfig(datasource.options.engine));
|
|
155
|
+
return {
|
|
156
|
+
name: datasource._name,
|
|
157
|
+
content: parts.join("\n"),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Generate .datasource files for all datasources in a project
|
|
162
|
+
*
|
|
163
|
+
* @param datasources - Record of datasource definitions
|
|
164
|
+
* @returns Array of generated datasource content
|
|
165
|
+
*/
|
|
166
|
+
export function generateAllDatasources(datasources) {
|
|
167
|
+
return Object.values(datasources).map(generateDatasource);
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=datasource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource.js","sourceRoot":"","sources":["../../src/generator/datasource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAqB,MAAM,sBAAsB,CAAC;AAY1E;;;GAGG;AACH,SAAS,4BAA4B,CAAC,SAA2B;IAC/D,qDAAqD;IACrD,OAAO,SAAS,CAAC,aAAa,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,yBAAyB,CAAC,SAA2B;IAC5D,OAAO,SAAS,CAAC,UAAU,CAAC;AAC9B,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,KAAc,EAAE,YAAoB;IAC9D,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,uBAAuB;QACvB,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAC3C,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3B,CAAC;IAED,IAAI,KA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