@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,175 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { p, isParamValidator, getParamTinybirdType, isParamRequired, getParamDefault, getParamDescription } from './params.js';
|
|
3
|
+
describe('Parameter Validators (p.*)', () => {
|
|
4
|
+
describe('String types', () => {
|
|
5
|
+
it('generates String parameter', () => {
|
|
6
|
+
const param = p.string();
|
|
7
|
+
expect(param._tinybirdType).toBe('String');
|
|
8
|
+
});
|
|
9
|
+
it('generates UUID parameter', () => {
|
|
10
|
+
const param = p.uuid();
|
|
11
|
+
expect(param._tinybirdType).toBe('UUID');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
describe('Integer types', () => {
|
|
15
|
+
it('generates Int8 parameter', () => {
|
|
16
|
+
const param = p.int8();
|
|
17
|
+
expect(param._tinybirdType).toBe('Int8');
|
|
18
|
+
});
|
|
19
|
+
it('generates Int16 parameter', () => {
|
|
20
|
+
const param = p.int16();
|
|
21
|
+
expect(param._tinybirdType).toBe('Int16');
|
|
22
|
+
});
|
|
23
|
+
it('generates Int32 parameter', () => {
|
|
24
|
+
const param = p.int32();
|
|
25
|
+
expect(param._tinybirdType).toBe('Int32');
|
|
26
|
+
});
|
|
27
|
+
it('generates Int64 parameter', () => {
|
|
28
|
+
const param = p.int64();
|
|
29
|
+
expect(param._tinybirdType).toBe('Int64');
|
|
30
|
+
});
|
|
31
|
+
it('generates UInt8 parameter', () => {
|
|
32
|
+
const param = p.uint8();
|
|
33
|
+
expect(param._tinybirdType).toBe('UInt8');
|
|
34
|
+
});
|
|
35
|
+
it('generates UInt16 parameter', () => {
|
|
36
|
+
const param = p.uint16();
|
|
37
|
+
expect(param._tinybirdType).toBe('UInt16');
|
|
38
|
+
});
|
|
39
|
+
it('generates UInt32 parameter', () => {
|
|
40
|
+
const param = p.uint32();
|
|
41
|
+
expect(param._tinybirdType).toBe('UInt32');
|
|
42
|
+
});
|
|
43
|
+
it('generates UInt64 parameter', () => {
|
|
44
|
+
const param = p.uint64();
|
|
45
|
+
expect(param._tinybirdType).toBe('UInt64');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('Float types', () => {
|
|
49
|
+
it('generates Float32 parameter', () => {
|
|
50
|
+
const param = p.float32();
|
|
51
|
+
expect(param._tinybirdType).toBe('Float32');
|
|
52
|
+
});
|
|
53
|
+
it('generates Float64 parameter', () => {
|
|
54
|
+
const param = p.float64();
|
|
55
|
+
expect(param._tinybirdType).toBe('Float64');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('Boolean type', () => {
|
|
59
|
+
it('generates Boolean parameter', () => {
|
|
60
|
+
const param = p.boolean();
|
|
61
|
+
expect(param._tinybirdType).toBe('Boolean');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
describe('Date/Time types', () => {
|
|
65
|
+
it('generates Date parameter', () => {
|
|
66
|
+
const param = p.date();
|
|
67
|
+
expect(param._tinybirdType).toBe('Date');
|
|
68
|
+
});
|
|
69
|
+
it('generates DateTime parameter', () => {
|
|
70
|
+
const param = p.dateTime();
|
|
71
|
+
expect(param._tinybirdType).toBe('DateTime');
|
|
72
|
+
});
|
|
73
|
+
it('generates DateTime64 parameter', () => {
|
|
74
|
+
const param = p.dateTime64();
|
|
75
|
+
expect(param._tinybirdType).toBe('DateTime64');
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe('Special types', () => {
|
|
79
|
+
it('generates column parameter', () => {
|
|
80
|
+
const param = p.column();
|
|
81
|
+
expect(param._tinybirdType).toBe('column');
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
describe('Required by default', () => {
|
|
85
|
+
it('parameters are required by default', () => {
|
|
86
|
+
const param = p.string();
|
|
87
|
+
expect(param._required).toBe(true);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
describe('Optional modifier', () => {
|
|
91
|
+
it('makes parameter optional without default', () => {
|
|
92
|
+
const param = p.int32().optional();
|
|
93
|
+
expect(param._required).toBe(false);
|
|
94
|
+
expect(param._default).toBeUndefined();
|
|
95
|
+
});
|
|
96
|
+
it('makes parameter optional with default value', () => {
|
|
97
|
+
const param = p.int32().optional(10);
|
|
98
|
+
expect(param._required).toBe(false);
|
|
99
|
+
expect(param._default).toBe(10);
|
|
100
|
+
});
|
|
101
|
+
it('preserves type when optional', () => {
|
|
102
|
+
const param = p.string().optional('default');
|
|
103
|
+
expect(param._tinybirdType).toBe('String');
|
|
104
|
+
expect(param._default).toBe('default');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
describe('Required modifier', () => {
|
|
108
|
+
it('makes optional parameter required again', () => {
|
|
109
|
+
const param = p.int32().optional(10).required();
|
|
110
|
+
expect(param._required).toBe(true);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
describe('Description modifier', () => {
|
|
114
|
+
it('sets description', () => {
|
|
115
|
+
const param = p.string().describe('User ID');
|
|
116
|
+
expect(param._description).toBe('User ID');
|
|
117
|
+
});
|
|
118
|
+
it('preserves description when chaining', () => {
|
|
119
|
+
const param = p.int32().describe('Limit value').optional(10);
|
|
120
|
+
expect(param._description).toBe('Limit value');
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
describe('Combined modifiers', () => {
|
|
124
|
+
it('supports optional with description', () => {
|
|
125
|
+
const param = p.int32().optional(10).describe('Limit');
|
|
126
|
+
expect(param._required).toBe(false);
|
|
127
|
+
expect(param._default).toBe(10);
|
|
128
|
+
expect(param._description).toBe('Limit');
|
|
129
|
+
});
|
|
130
|
+
it('supports description then optional', () => {
|
|
131
|
+
const param = p.int32().describe('Limit').optional(10);
|
|
132
|
+
expect(param._required).toBe(false);
|
|
133
|
+
expect(param._default).toBe(10);
|
|
134
|
+
expect(param._description).toBe('Limit');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
describe('Helper functions', () => {
|
|
138
|
+
it('isParamValidator returns true for validators', () => {
|
|
139
|
+
expect(isParamValidator(p.string())).toBe(true);
|
|
140
|
+
});
|
|
141
|
+
it('isParamValidator returns false for non-validators', () => {
|
|
142
|
+
expect(isParamValidator('string')).toBe(false);
|
|
143
|
+
expect(isParamValidator({})).toBe(false);
|
|
144
|
+
expect(isParamValidator(null)).toBe(false);
|
|
145
|
+
});
|
|
146
|
+
it('getParamTinybirdType returns type string', () => {
|
|
147
|
+
expect(getParamTinybirdType(p.string())).toBe('String');
|
|
148
|
+
});
|
|
149
|
+
it('isParamRequired returns required status', () => {
|
|
150
|
+
expect(isParamRequired(p.string())).toBe(true);
|
|
151
|
+
expect(isParamRequired(p.string().optional())).toBe(false);
|
|
152
|
+
});
|
|
153
|
+
it('getParamDefault returns default value', () => {
|
|
154
|
+
expect(getParamDefault(p.int32().optional(10))).toBe(10);
|
|
155
|
+
expect(getParamDefault(p.int32())).toBeUndefined();
|
|
156
|
+
});
|
|
157
|
+
it('getParamDescription returns description', () => {
|
|
158
|
+
expect(getParamDescription(p.string().describe('Test'))).toBe('Test');
|
|
159
|
+
expect(getParamDescription(p.string())).toBeUndefined();
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
describe('Array parameter', () => {
|
|
163
|
+
it('creates array parameter', () => {
|
|
164
|
+
const param = p.array(p.string());
|
|
165
|
+
expect(param._tinybirdType).toBe('Array');
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
describe('JSON parameter', () => {
|
|
169
|
+
it('creates JSON parameter', () => {
|
|
170
|
+
const param = p.json();
|
|
171
|
+
expect(param._tinybirdType).toBe('JSON');
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
//# sourceMappingURL=params.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.test.js","sourceRoot":"","sources":["../../src/schema/params.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE/H,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;QAC5B,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;YACpC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;YAClC,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;YACvB,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAA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,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipe definition for Tinybird
|
|
3
|
+
* Define SQL transformations and endpoints as TypeScript with full type safety
|
|
4
|
+
*/
|
|
5
|
+
import type { AnyTypeValidator } from "./types.js";
|
|
6
|
+
import type { AnyParamValidator } from "./params.js";
|
|
7
|
+
import type { DatasourceDefinition, SchemaDefinition, ColumnDefinition } from "./datasource.js";
|
|
8
|
+
/** Symbol for brand typing pipes */
|
|
9
|
+
export declare const PIPE_BRAND: unique symbol;
|
|
10
|
+
/** Symbol for brand typing nodes */
|
|
11
|
+
export declare const NODE_BRAND: unique symbol;
|
|
12
|
+
/**
|
|
13
|
+
* Parameter definition for a pipe
|
|
14
|
+
*/
|
|
15
|
+
export type ParamsDefinition = Record<string, AnyParamValidator>;
|
|
16
|
+
/**
|
|
17
|
+
* Output schema definition for a pipe
|
|
18
|
+
*/
|
|
19
|
+
export type OutputDefinition = Record<string, AnyTypeValidator>;
|
|
20
|
+
/**
|
|
21
|
+
* Node configuration options
|
|
22
|
+
*/
|
|
23
|
+
export interface NodeOptions {
|
|
24
|
+
/** Node name (must be valid identifier) */
|
|
25
|
+
name: string;
|
|
26
|
+
/** SQL query for this node */
|
|
27
|
+
sql: string;
|
|
28
|
+
/** Human-readable description */
|
|
29
|
+
description?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A node definition within a pipe
|
|
33
|
+
*/
|
|
34
|
+
export interface NodeDefinition {
|
|
35
|
+
readonly [NODE_BRAND]: true;
|
|
36
|
+
/** Node name */
|
|
37
|
+
readonly _name: string;
|
|
38
|
+
/** Type marker for inference */
|
|
39
|
+
readonly _type: "node";
|
|
40
|
+
/** SQL query */
|
|
41
|
+
readonly sql: string;
|
|
42
|
+
/** Description */
|
|
43
|
+
readonly description?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create a node within a pipe
|
|
47
|
+
*
|
|
48
|
+
* @param options - Node configuration
|
|
49
|
+
* @returns A node definition
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { node } from '@tinybirdco/sdk';
|
|
54
|
+
*
|
|
55
|
+
* const filteredNode = node({
|
|
56
|
+
* name: 'filtered',
|
|
57
|
+
* sql: `
|
|
58
|
+
* SELECT *
|
|
59
|
+
* FROM events
|
|
60
|
+
* WHERE timestamp >= {{DateTime(start_date)}}
|
|
61
|
+
* `,
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function node(options: NodeOptions): NodeDefinition;
|
|
66
|
+
/**
|
|
67
|
+
* Check if a value is a node definition
|
|
68
|
+
*/
|
|
69
|
+
export declare function isNodeDefinition(value: unknown): value is NodeDefinition;
|
|
70
|
+
/**
|
|
71
|
+
* Endpoint configuration for a pipe
|
|
72
|
+
*/
|
|
73
|
+
export interface EndpointConfig {
|
|
74
|
+
/** Whether this pipe is exposed as an API endpoint */
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
/** Cache configuration */
|
|
77
|
+
cache?: {
|
|
78
|
+
/** Whether caching is enabled */
|
|
79
|
+
enabled: boolean;
|
|
80
|
+
/** Cache TTL in seconds */
|
|
81
|
+
ttl?: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Materialized view configuration for a pipe
|
|
86
|
+
*/
|
|
87
|
+
export interface MaterializedConfig<TDatasource extends DatasourceDefinition<SchemaDefinition> = DatasourceDefinition<SchemaDefinition>> {
|
|
88
|
+
/** Target datasource where materialized data is written */
|
|
89
|
+
datasource: TDatasource;
|
|
90
|
+
/**
|
|
91
|
+
* Deployment method for materialized views.
|
|
92
|
+
* Use 'alter' to update existing materialized views using ALTER TABLE ... MODIFY QUERY
|
|
93
|
+
* instead of recreating the table. This preserves existing data and reduces deployment time.
|
|
94
|
+
*/
|
|
95
|
+
deploymentMethod?: "alter";
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Copy pipe configuration
|
|
99
|
+
*/
|
|
100
|
+
export interface CopyConfig<TDatasource extends DatasourceDefinition<SchemaDefinition> = DatasourceDefinition<SchemaDefinition>> {
|
|
101
|
+
/** Target datasource where copied data is written */
|
|
102
|
+
datasource: TDatasource;
|
|
103
|
+
/**
|
|
104
|
+
* Copy mode: how data is ingested
|
|
105
|
+
* - 'append': Appends the result to the target data source (default)
|
|
106
|
+
* - 'replace': Every run completely replaces the destination Data Source content
|
|
107
|
+
*/
|
|
108
|
+
copy_mode?: "append" | "replace";
|
|
109
|
+
/**
|
|
110
|
+
* Copy schedule: when the copy job runs
|
|
111
|
+
* - A cron expression (e.g., "0 * * * *" for hourly)
|
|
112
|
+
* - "@on-demand" for manual execution only
|
|
113
|
+
* Defaults to "@on-demand" if not specified
|
|
114
|
+
*/
|
|
115
|
+
copy_schedule?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Token configuration for pipe access
|
|
119
|
+
*/
|
|
120
|
+
export interface PipeTokenConfig {
|
|
121
|
+
/** Token name */
|
|
122
|
+
name: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Options for defining a pipe (reusable SQL logic, no endpoint)
|
|
126
|
+
*/
|
|
127
|
+
export interface PipeOptions<TParams extends ParamsDefinition, TOutput extends OutputDefinition> {
|
|
128
|
+
/** Human-readable description of the pipe */
|
|
129
|
+
description?: string;
|
|
130
|
+
/** Parameter definitions for query inputs */
|
|
131
|
+
params?: TParams;
|
|
132
|
+
/** Nodes in the transformation pipeline */
|
|
133
|
+
nodes: readonly NodeDefinition[];
|
|
134
|
+
/** Output schema (optional for reusable pipes, required for endpoints) */
|
|
135
|
+
output?: TOutput;
|
|
136
|
+
/** Whether this pipe is an API endpoint (shorthand for { enabled: true }). Mutually exclusive with materialized and copy. */
|
|
137
|
+
endpoint?: boolean | EndpointConfig;
|
|
138
|
+
/** Materialized view configuration. Mutually exclusive with endpoint and copy. */
|
|
139
|
+
materialized?: MaterializedConfig;
|
|
140
|
+
/** Copy pipe configuration. Mutually exclusive with endpoint and materialized. */
|
|
141
|
+
copy?: CopyConfig;
|
|
142
|
+
/** Access tokens for this pipe */
|
|
143
|
+
tokens?: readonly PipeTokenConfig[];
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Options for defining an endpoint (API-exposed pipe)
|
|
147
|
+
*/
|
|
148
|
+
export interface EndpointOptions<TParams extends ParamsDefinition, TOutput extends OutputDefinition> {
|
|
149
|
+
/** Human-readable description of the endpoint */
|
|
150
|
+
description?: string;
|
|
151
|
+
/** Parameter definitions for query inputs */
|
|
152
|
+
params?: TParams;
|
|
153
|
+
/** Nodes in the transformation pipeline */
|
|
154
|
+
nodes: readonly NodeDefinition[];
|
|
155
|
+
/** Output schema (required for type safety) */
|
|
156
|
+
output: TOutput;
|
|
157
|
+
/** Cache configuration */
|
|
158
|
+
cache?: {
|
|
159
|
+
/** Whether caching is enabled */
|
|
160
|
+
enabled: boolean;
|
|
161
|
+
/** Cache TTL in seconds */
|
|
162
|
+
ttl?: number;
|
|
163
|
+
};
|
|
164
|
+
/** Access tokens for this endpoint */
|
|
165
|
+
tokens?: readonly PipeTokenConfig[];
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Options for defining a copy pipe
|
|
169
|
+
*/
|
|
170
|
+
export interface CopyPipeOptions<TSchema extends SchemaDefinition, TDatasource extends DatasourceDefinition<TSchema>> {
|
|
171
|
+
/** Human-readable description of the copy pipe */
|
|
172
|
+
description?: string;
|
|
173
|
+
/** Nodes in the transformation pipeline */
|
|
174
|
+
nodes: readonly NodeDefinition[];
|
|
175
|
+
/** Target datasource where copied data is written */
|
|
176
|
+
datasource: TDatasource;
|
|
177
|
+
/**
|
|
178
|
+
* Copy mode: how data is ingested
|
|
179
|
+
* - 'append': Appends the result to the target data source (default)
|
|
180
|
+
* - 'replace': Every run completely replaces the destination Data Source content
|
|
181
|
+
*/
|
|
182
|
+
copy_mode?: "append" | "replace";
|
|
183
|
+
/**
|
|
184
|
+
* Copy schedule: when the copy job runs
|
|
185
|
+
* - A cron expression (e.g., "0 * * * *" for hourly)
|
|
186
|
+
* - "@on-demand" for manual execution only
|
|
187
|
+
* Defaults to "@on-demand" if not specified
|
|
188
|
+
*/
|
|
189
|
+
copy_schedule?: string;
|
|
190
|
+
/** Access tokens for this copy pipe */
|
|
191
|
+
tokens?: readonly PipeTokenConfig[];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* A pipe definition with full type information
|
|
195
|
+
*/
|
|
196
|
+
export interface PipeDefinition<TParams extends ParamsDefinition = ParamsDefinition, TOutput extends OutputDefinition = OutputDefinition> {
|
|
197
|
+
readonly [PIPE_BRAND]: true;
|
|
198
|
+
/** Pipe name */
|
|
199
|
+
readonly _name: string;
|
|
200
|
+
/** Type marker for inference */
|
|
201
|
+
readonly _type: "pipe";
|
|
202
|
+
/** Parameter definitions */
|
|
203
|
+
readonly _params: TParams;
|
|
204
|
+
/** Output schema (optional for reusable pipes) */
|
|
205
|
+
readonly _output?: TOutput;
|
|
206
|
+
/** Full options */
|
|
207
|
+
readonly options: PipeOptions<TParams, TOutput>;
|
|
208
|
+
}
|
|
209
|
+
export declare function definePipe<TParams extends ParamsDefinition, TOutput extends OutputDefinition>(name: string, options: PipeOptions<TParams, TOutput>): PipeDefinition<TParams, TOutput>;
|
|
210
|
+
/**
|
|
211
|
+
* Options for defining a materialized view
|
|
212
|
+
*/
|
|
213
|
+
export interface MaterializedViewOptions<TDatasource extends DatasourceDefinition<SchemaDefinition>> {
|
|
214
|
+
/** Human-readable description of the materialized view */
|
|
215
|
+
description?: string;
|
|
216
|
+
/** Nodes in the transformation pipeline */
|
|
217
|
+
nodes: readonly NodeDefinition[];
|
|
218
|
+
/** Target datasource where materialized data is written */
|
|
219
|
+
datasource: TDatasource;
|
|
220
|
+
/**
|
|
221
|
+
* Deployment method for materialized views.
|
|
222
|
+
* Use 'alter' to update existing materialized views using ALTER TABLE ... MODIFY QUERY
|
|
223
|
+
* instead of recreating the table. This preserves existing data and reduces deployment time.
|
|
224
|
+
*/
|
|
225
|
+
deploymentMethod?: "alter";
|
|
226
|
+
/** Access tokens for this pipe */
|
|
227
|
+
tokens?: readonly PipeTokenConfig[];
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Helper type to extract the output definition from a datasource schema
|
|
231
|
+
*/
|
|
232
|
+
type DatasourceSchemaToOutput<TSchema extends SchemaDefinition> = {
|
|
233
|
+
[K in keyof TSchema]: TSchema[K] extends ColumnDefinition<infer V> ? V : TSchema[K] extends AnyTypeValidator ? TSchema[K] : never;
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Define a Tinybird materialized view
|
|
237
|
+
*
|
|
238
|
+
* This is a convenience function that simplifies creating materialized views.
|
|
239
|
+
* The output schema is automatically derived from the target datasource, ensuring
|
|
240
|
+
* type safety between the pipe output and the target.
|
|
241
|
+
*
|
|
242
|
+
* @param name - The pipe name (must be valid identifier)
|
|
243
|
+
* @param options - Materialized view configuration
|
|
244
|
+
* @returns A pipe definition configured as a materialized view
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```ts
|
|
248
|
+
* import { defineDatasource, defineMaterializedView, node, t, engine } from '@tinybirdco/sdk';
|
|
249
|
+
*
|
|
250
|
+
* // Target datasource for aggregated data
|
|
251
|
+
* const salesByHour = defineDatasource('sales_by_hour', {
|
|
252
|
+
* schema: {
|
|
253
|
+
* day: t.date(),
|
|
254
|
+
* country: t.string().lowCardinality(),
|
|
255
|
+
* total_sales: t.simpleAggregateFunction('sum', t.uint64()),
|
|
256
|
+
* },
|
|
257
|
+
* engine: engine.aggregatingMergeTree({
|
|
258
|
+
* sortingKey: ['day', 'country'],
|
|
259
|
+
* }),
|
|
260
|
+
* });
|
|
261
|
+
*
|
|
262
|
+
* // Materialized view - output schema is inferred from datasource
|
|
263
|
+
* export const salesByHourMv = defineMaterializedView('sales_by_hour_mv', {
|
|
264
|
+
* description: 'Aggregate sales per hour',
|
|
265
|
+
* datasource: salesByHour,
|
|
266
|
+
* nodes: [
|
|
267
|
+
* node({
|
|
268
|
+
* name: 'daily_sales',
|
|
269
|
+
* sql: `
|
|
270
|
+
* SELECT
|
|
271
|
+
* toStartOfDay(starting_date) as day,
|
|
272
|
+
* country,
|
|
273
|
+
* sum(sales) as total_sales
|
|
274
|
+
* FROM teams
|
|
275
|
+
* GROUP BY day, country
|
|
276
|
+
* `,
|
|
277
|
+
* }),
|
|
278
|
+
* ],
|
|
279
|
+
* deploymentMethod: 'alter', // optional
|
|
280
|
+
* });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
export declare function defineMaterializedView<TSchema extends SchemaDefinition, TDatasource extends DatasourceDefinition<TSchema>>(name: string, options: MaterializedViewOptions<TDatasource>): PipeDefinition<Record<string, never>, DatasourceSchemaToOutput<TSchema>>;
|
|
284
|
+
/**
|
|
285
|
+
* Define a Tinybird endpoint
|
|
286
|
+
*
|
|
287
|
+
* This is a convenience function for creating API endpoints.
|
|
288
|
+
* Endpoints are pipes that are exposed as HTTP API endpoints.
|
|
289
|
+
*
|
|
290
|
+
* @param name - The endpoint name (must be valid identifier)
|
|
291
|
+
* @param options - Endpoint configuration including params, nodes, and output schema
|
|
292
|
+
* @returns A pipe definition configured as an endpoint
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```ts
|
|
296
|
+
* import { defineEndpoint, node, p, t } from '@tinybirdco/sdk';
|
|
297
|
+
*
|
|
298
|
+
* export const topEvents = defineEndpoint('top_events', {
|
|
299
|
+
* description: 'Get top events by count',
|
|
300
|
+
* params: {
|
|
301
|
+
* start_date: p.dateTime(),
|
|
302
|
+
* end_date: p.dateTime(),
|
|
303
|
+
* limit: p.int32().optional(10),
|
|
304
|
+
* },
|
|
305
|
+
* nodes: [
|
|
306
|
+
* node({
|
|
307
|
+
* name: 'aggregated',
|
|
308
|
+
* sql: `
|
|
309
|
+
* SELECT
|
|
310
|
+
* event_type,
|
|
311
|
+
* count() as event_count
|
|
312
|
+
* FROM events
|
|
313
|
+
* WHERE timestamp BETWEEN {{DateTime(start_date)}} AND {{DateTime(end_date)}}
|
|
314
|
+
* GROUP BY event_type
|
|
315
|
+
* ORDER BY event_count DESC
|
|
316
|
+
* LIMIT {{Int32(limit, 10)}}
|
|
317
|
+
* `,
|
|
318
|
+
* }),
|
|
319
|
+
* ],
|
|
320
|
+
* output: {
|
|
321
|
+
* event_type: t.string(),
|
|
322
|
+
* event_count: t.uint64(),
|
|
323
|
+
* },
|
|
324
|
+
* });
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
export declare function defineEndpoint<TParams extends ParamsDefinition, TOutput extends OutputDefinition>(name: string, options: EndpointOptions<TParams, TOutput>): PipeDefinition<TParams, TOutput>;
|
|
328
|
+
/**
|
|
329
|
+
* Define a Tinybird copy pipe
|
|
330
|
+
*
|
|
331
|
+
* Copy pipes capture the result of a pipe at a moment in time and write
|
|
332
|
+
* the result into a target data source. They can be run on a schedule,
|
|
333
|
+
* or executed on demand.
|
|
334
|
+
*
|
|
335
|
+
* Unlike materialized views which continuously update as new events are inserted,
|
|
336
|
+
* copy pipes generate a single snapshot at a specific point in time.
|
|
337
|
+
*
|
|
338
|
+
* @param name - The copy pipe name (must be valid identifier)
|
|
339
|
+
* @param options - Copy pipe configuration
|
|
340
|
+
* @returns A pipe definition configured as a copy pipe
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```ts
|
|
344
|
+
* import { defineCopyPipe, defineDatasource, node, t, engine } from '@tinybirdco/sdk';
|
|
345
|
+
*
|
|
346
|
+
* // Target datasource for daily snapshots
|
|
347
|
+
* const dailySalesSnapshot = defineDatasource('daily_sales_snapshot', {
|
|
348
|
+
* schema: {
|
|
349
|
+
* snapshot_date: t.date(),
|
|
350
|
+
* country: t.string(),
|
|
351
|
+
* total_sales: t.uint64(),
|
|
352
|
+
* },
|
|
353
|
+
* engine: engine.mergeTree({
|
|
354
|
+
* sortingKey: ['snapshot_date', 'country'],
|
|
355
|
+
* }),
|
|
356
|
+
* });
|
|
357
|
+
*
|
|
358
|
+
* // Copy pipe that runs daily at midnight
|
|
359
|
+
* export const dailySalesCopy = defineCopyPipe('daily_sales_copy', {
|
|
360
|
+
* description: 'Daily snapshot of sales by country',
|
|
361
|
+
* datasource: dailySalesSnapshot,
|
|
362
|
+
* copy_schedule: '0 0 * * *', // Daily at midnight UTC
|
|
363
|
+
* copy_mode: 'append',
|
|
364
|
+
* nodes: [
|
|
365
|
+
* node({
|
|
366
|
+
* name: 'snapshot',
|
|
367
|
+
* sql: `
|
|
368
|
+
* SELECT
|
|
369
|
+
* today() AS snapshot_date,
|
|
370
|
+
* country,
|
|
371
|
+
* sum(sales) AS total_sales
|
|
372
|
+
* FROM sales
|
|
373
|
+
* WHERE date = today() - 1
|
|
374
|
+
* GROUP BY country
|
|
375
|
+
* `,
|
|
376
|
+
* }),
|
|
377
|
+
* ],
|
|
378
|
+
* });
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
export declare function defineCopyPipe<TSchema extends SchemaDefinition, TDatasource extends DatasourceDefinition<TSchema>>(name: string, options: CopyPipeOptions<TSchema, TDatasource>): PipeDefinition<Record<string, never>, DatasourceSchemaToOutput<TSchema>>;
|
|
382
|
+
/**
|
|
383
|
+
* Check if a value is a pipe definition
|
|
384
|
+
*/
|
|
385
|
+
export declare function isPipeDefinition(value: unknown): value is PipeDefinition;
|
|
386
|
+
/**
|
|
387
|
+
* Get the endpoint configuration from a pipe
|
|
388
|
+
*/
|
|
389
|
+
export declare function getEndpointConfig(pipe: PipeDefinition): EndpointConfig | null;
|
|
390
|
+
/**
|
|
391
|
+
* Get the materialized view configuration from a pipe
|
|
392
|
+
*/
|
|
393
|
+
export declare function getMaterializedConfig(pipe: PipeDefinition): MaterializedConfig | null;
|
|
394
|
+
/**
|
|
395
|
+
* Check if a pipe is a materialized view
|
|
396
|
+
*/
|
|
397
|
+
export declare function isMaterializedView(pipe: PipeDefinition): boolean;
|
|
398
|
+
/**
|
|
399
|
+
* Get the copy pipe configuration from a pipe
|
|
400
|
+
*/
|
|
401
|
+
export declare function getCopyConfig(pipe: PipeDefinition): CopyConfig | null;
|
|
402
|
+
/**
|
|
403
|
+
* Check if a pipe is a copy pipe
|
|
404
|
+
*/
|
|
405
|
+
export declare function isCopyPipe(pipe: PipeDefinition): boolean;
|
|
406
|
+
/**
|
|
407
|
+
* Get all node names from a pipe
|
|
408
|
+
*/
|
|
409
|
+
export declare function getNodeNames(pipe: PipeDefinition): string[];
|
|
410
|
+
/**
|
|
411
|
+
* Get a specific node by name
|
|
412
|
+
*/
|
|
413
|
+
export declare function getNode(pipe: PipeDefinition, name: string): NodeDefinition | undefined;
|
|
414
|
+
/**
|
|
415
|
+
* Helper type to extract params from a pipe definition
|
|
416
|
+
*/
|
|
417
|
+
export type ExtractParams<T> = T extends PipeDefinition<infer P, OutputDefinition> ? P : never;
|
|
418
|
+
/**
|
|
419
|
+
* Helper type to extract output from a pipe definition
|
|
420
|
+
*/
|
|
421
|
+
export type ExtractOutput<T> = T extends PipeDefinition<ParamsDefinition, infer O> ? O : never;
|
|
422
|
+
/**
|
|
423
|
+
* SQL template helper for referencing datasources and other nodes
|
|
424
|
+
* This is a simple helper - for complex templating, use raw strings
|
|
425
|
+
*
|
|
426
|
+
* @example
|
|
427
|
+
* ```ts
|
|
428
|
+
* import { sql, events } from './datasources/events';
|
|
429
|
+
*
|
|
430
|
+
* const query = sql`SELECT * FROM ${events} WHERE id = 1`;
|
|
431
|
+
* // Results in: "SELECT * FROM events WHERE id = 1"
|
|
432
|
+
* ```
|
|
433
|
+
*/
|
|
434
|
+
export declare function sql(strings: TemplateStringsArray, ...values: (DatasourceDefinition | NodeDefinition | string | number)[]): string;
|
|
435
|
+
export {};
|
|
436
|
+
//# sourceMappingURL=pipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe.d.ts","sourceRoot":"","sources":["../../src/schema/pipe.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIhG,oCAAoC;AACpC,eAAO,MAAM,UAAU,EAAE,OAAO,MAAgC,CAAC;AACjE,oCAAoC;AACpC,eAAO,MAAM,UAAU,EAAE,OAAO,MAAgC,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IAC5B,gBAAgB;IAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gBAAgB;IAChB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;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