@tinybirdco/sdk 0.0.77 → 0.0.79
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 +27 -2
- package/dist/api/branches.d.ts +4 -3
- package/dist/api/branches.d.ts.map +1 -1
- package/dist/api/branches.js +4 -4
- package/dist/api/branches.js.map +1 -1
- package/dist/api/branches.test.js +34 -1
- package/dist/api/branches.test.js.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +7 -1
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/build.test.js +159 -0
- package/dist/cli/commands/build.test.js.map +1 -1
- package/dist/cli/commands/clear.d.ts.map +1 -1
- package/dist/cli/commands/clear.js +4 -1
- package/dist/cli/commands/clear.js.map +1 -1
- package/dist/cli/commands/deploy.test.js +1 -0
- package/dist/cli/commands/deploy.test.js.map +1 -1
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +7 -1
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/generate.test.js +3 -0
- package/dist/cli/commands/generate.test.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +14 -1
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/migrate.test.js +60 -0
- package/dist/cli/commands/migrate.test.js.map +1 -1
- package/dist/cli/commands/preview.d.ts.map +1 -1
- package/dist/cli/commands/preview.js +4 -1
- package/dist/cli/commands/preview.js.map +1 -1
- package/dist/cli/commands/preview.test.js +116 -2
- package/dist/cli/commands/preview.test.js.map +1 -1
- package/dist/cli/config-types.d.ts +4 -0
- package/dist/cli/config-types.d.ts.map +1 -1
- package/dist/cli/config-types.js +1 -1
- package/dist/cli/config-types.js.map +1 -1
- package/dist/cli/config.d.ts +4 -2
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +27 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/config.test.js +79 -0
- package/dist/cli/config.test.js.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/client/base.d.ts.map +1 -1
- package/dist/client/base.js +4 -1
- package/dist/client/base.js.map +1 -1
- package/dist/client/base.test.js +2 -1
- package/dist/client/base.test.js.map +1 -1
- package/dist/generator/connection.d.ts.map +1 -1
- package/dist/generator/connection.js +15 -1
- package/dist/generator/connection.js.map +1 -1
- package/dist/generator/connection.test.js +10 -1
- package/dist/generator/connection.test.js.map +1 -1
- package/dist/generator/datasource.d.ts.map +1 -1
- package/dist/generator/datasource.js +17 -1
- package/dist/generator/datasource.js.map +1 -1
- package/dist/generator/datasource.test.js +44 -1
- package/dist/generator/datasource.test.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/migrate/emit-ts.d.ts.map +1 -1
- package/dist/migrate/emit-ts.js +28 -0
- package/dist/migrate/emit-ts.js.map +1 -1
- package/dist/migrate/parse-connection.d.ts +2 -2
- package/dist/migrate/parse-connection.d.ts.map +1 -1
- package/dist/migrate/parse-connection.js +60 -6
- package/dist/migrate/parse-connection.js.map +1 -1
- package/dist/migrate/parse-connection.test.js +18 -0
- package/dist/migrate/parse-connection.test.js.map +1 -1
- package/dist/migrate/parse-datasource.d.ts.map +1 -1
- package/dist/migrate/parse-datasource.js +27 -2
- package/dist/migrate/parse-datasource.js.map +1 -1
- package/dist/migrate/types.d.ts +15 -1
- package/dist/migrate/types.d.ts.map +1 -1
- package/dist/schema/connection.d.ts +46 -1
- package/dist/schema/connection.d.ts.map +1 -1
- package/dist/schema/connection.js +39 -0
- package/dist/schema/connection.js.map +1 -1
- package/dist/schema/connection.test.js +46 -1
- package/dist/schema/connection.test.js.map +1 -1
- package/dist/schema/datasource.d.ts +14 -1
- package/dist/schema/datasource.d.ts.map +1 -1
- package/dist/schema/datasource.js +2 -2
- package/dist/schema/datasource.js.map +1 -1
- package/dist/schema/datasource.test.js +2 -2
- package/dist/schema/datasource.test.js.map +1 -1
- package/package.json +1 -1
- package/src/api/branches.test.ts +38 -1
- package/src/api/branches.ts +8 -6
- package/src/cli/commands/build.test.ts +176 -0
- package/src/cli/commands/build.ts +9 -2
- package/src/cli/commands/clear.ts +8 -1
- package/src/cli/commands/deploy.test.ts +1 -0
- package/src/cli/commands/dev.ts +9 -1
- package/src/cli/commands/generate.test.ts +3 -0
- package/src/cli/commands/migrate.test.ts +95 -0
- package/src/cli/commands/migrate.ts +17 -1
- package/src/cli/commands/preview.test.ts +133 -2
- package/src/cli/commands/preview.ts +6 -2
- package/src/cli/config-types.ts +4 -0
- package/src/cli/config.test.ts +123 -0
- package/src/cli/config.ts +41 -3
- package/src/cli/index.ts +8 -2
- package/src/client/base.test.ts +3 -1
- package/src/client/base.ts +7 -1
- package/src/generator/connection.test.ts +17 -0
- package/src/generator/connection.ts +18 -0
- package/src/generator/datasource.test.ts +54 -1
- package/src/generator/datasource.ts +24 -1
- package/src/index.ts +6 -1
- package/src/migrate/emit-ts.ts +44 -3
- package/src/migrate/parse-connection.test.ts +41 -0
- package/src/migrate/parse-connection.ts +86 -7
- package/src/migrate/parse-datasource.ts +35 -2
- package/src/migrate/types.ts +18 -1
- package/src/schema/connection.test.ts +65 -0
- package/src/schema/connection.ts +76 -1
- package/src/schema/datasource.test.ts +2 -2
- package/src/schema/datasource.ts +21 -2
package/src/schema/datasource.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
KafkaConnectionDefinition,
|
|
10
10
|
S3ConnectionDefinition,
|
|
11
11
|
GCSConnectionDefinition,
|
|
12
|
+
DynamoDBConnectionDefinition,
|
|
12
13
|
} from "./connection.js";
|
|
13
14
|
import type { TokenDefinition, DatasourceTokenScope } from "./token.js";
|
|
14
15
|
|
|
@@ -102,6 +103,18 @@ export interface GCSConfig {
|
|
|
102
103
|
fromTimestamp?: string;
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
/**
|
|
107
|
+
* DynamoDB import configuration for a datasource
|
|
108
|
+
*/
|
|
109
|
+
export interface DynamoDBConfig {
|
|
110
|
+
/** DynamoDB connection to use */
|
|
111
|
+
connection: DynamoDBConnectionDefinition;
|
|
112
|
+
/** Source DynamoDB table ARN */
|
|
113
|
+
tableArn: string;
|
|
114
|
+
/** S3 bucket Tinybird uses to stage the initial table export */
|
|
115
|
+
exportBucket: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
105
118
|
/**
|
|
106
119
|
* Datasource index configuration.
|
|
107
120
|
* Emits as: `<name> <expr> TYPE <type> GRANULARITY <n>`
|
|
@@ -152,6 +165,8 @@ export interface DatasourceOptions<TSchema extends SchemaDefinition> {
|
|
|
152
165
|
s3?: S3Config;
|
|
153
166
|
/** GCS ingestion configuration */
|
|
154
167
|
gcs?: GCSConfig;
|
|
168
|
+
/** DynamoDB ingestion configuration */
|
|
169
|
+
dynamodb?: DynamoDBConfig;
|
|
155
170
|
}
|
|
156
171
|
|
|
157
172
|
/**
|
|
@@ -209,9 +224,13 @@ export function defineDatasource<TSchema extends SchemaDefinition>(
|
|
|
209
224
|
);
|
|
210
225
|
}
|
|
211
226
|
|
|
212
|
-
const ingestionConfigCount = [options.kafka, options.s3, options.gcs].filter(
|
|
227
|
+
const ingestionConfigCount = [options.kafka, options.s3, options.gcs, options.dynamodb].filter(
|
|
228
|
+
Boolean
|
|
229
|
+
).length;
|
|
213
230
|
if (ingestionConfigCount > 1) {
|
|
214
|
-
throw new Error(
|
|
231
|
+
throw new Error(
|
|
232
|
+
"Datasource can only define one ingestion option: `kafka`, `s3`, `gcs`, or `dynamodb`."
|
|
233
|
+
);
|
|
215
234
|
}
|
|
216
235
|
|
|
217
236
|
if (options.indexes) {
|