@dataform/core 3.0.9 → 3.0.10

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/bundle.d.ts CHANGED
@@ -16,34 +16,6 @@ interface INamedConfig {
16
16
  type?: string;
17
17
  name?: string;
18
18
  }
19
- interface IActionConfig {
20
- tags?: string[];
21
- dependencies?: Resolvable | Resolvable[];
22
- disabled?: boolean;
23
- }
24
- interface ITargetableConfig {
25
- database?: string;
26
- schema?: string;
27
- }
28
- interface IDependenciesConfig {
29
- dependencies?: Resolvable | Resolvable[];
30
- hermetic?: boolean;
31
- dependOnDependencyAssertions?: boolean;
32
- }
33
- interface IDocumentableConfig {
34
- columns?: IColumnsDescriptor;
35
- description?: string;
36
- }
37
- interface IColumnsDescriptor {
38
- [name: string]: string | IRecordDescriptor;
39
- }
40
- interface IRecordDescriptor {
41
- description?: string;
42
- columns?: IColumnsDescriptor;
43
- displayName?: string;
44
- tags?: string | string[];
45
- bigqueryPolicyTags?: string | string[];
46
- }
47
19
  interface ITarget {
48
20
  database?: string;
49
21
  schema?: string;
@@ -2239,6 +2211,9 @@ namespace dataform {
2239
2211
 
2240
2212
  /** NotebookRuntimeOptionsConfig outputBucket */
2241
2213
  outputBucket?: (string|null);
2214
+
2215
+ /** NotebookRuntimeOptionsConfig runtimeTemplateName */
2216
+ runtimeTemplateName?: (string|null);
2242
2217
  }
2243
2218
 
2244
2219
  /** Represents a NotebookRuntimeOptionsConfig. */
@@ -2253,6 +2228,9 @@ namespace dataform {
2253
2228
  /** NotebookRuntimeOptionsConfig outputBucket. */
2254
2229
  public outputBucket?: (string|null);
2255
2230
 
2231
+ /** NotebookRuntimeOptionsConfig runtimeTemplateName. */
2232
+ public runtimeTemplateName: string;
2233
+
2256
2234
  /** NotebookRuntimeOptionsConfig outputSink. */
2257
2235
  public outputSink?: "outputBucket";
2258
2236
 
@@ -4198,6 +4176,9 @@ namespace dataform {
4198
4176
 
4199
4177
  /** NotebookRuntimeOptions outputBucket */
4200
4178
  outputBucket?: (string|null);
4179
+
4180
+ /** NotebookRuntimeOptions runtimeTemplateName */
4181
+ runtimeTemplateName?: (string|null);
4201
4182
  }
4202
4183
 
4203
4184
  /** Represents a NotebookRuntimeOptions. */
@@ -4212,6 +4193,9 @@ namespace dataform {
4212
4193
  /** NotebookRuntimeOptions outputBucket. */
4213
4194
  public outputBucket?: (string|null);
4214
4195
 
4196
+ /** NotebookRuntimeOptions runtimeTemplateName. */
4197
+ public runtimeTemplateName: string;
4198
+
4215
4199
  /** NotebookRuntimeOptions outputSink. */
4216
4200
  public outputSink?: "outputBucket";
4217
4201
 
@@ -7384,100 +7368,15 @@ declare class Declaration extends ActionBuilder<dataform.Declaration> {
7384
7368
  private verifyConfig;
7385
7369
  }
7386
7370
 
7387
- declare const TableType: readonly ["table", "view", "incremental"];
7388
- declare type TableType = typeof TableType[number];
7389
- interface IBigQueryOptions {
7390
- partitionBy?: string;
7391
- clusterBy?: string[];
7392
- updatePartitionFilter?: string;
7393
- labels?: {
7394
- [name: string]: string;
7395
- };
7396
- partitionExpirationDays?: number;
7397
- requirePartitionFilter?: boolean;
7398
- additionalOptions?: {
7399
- [name: string]: string;
7400
- };
7401
- }
7402
- interface ITableAssertions {
7403
- uniqueKey?: string | string[];
7404
- uniqueKeys?: string[][];
7405
- nonNull?: string | string[];
7406
- rowConditions?: string[];
7407
- }
7408
- interface ITableConfig extends IActionConfig, IDependenciesConfig, IDocumentableConfig, INamedConfig, ITargetableConfig {
7409
- type?: TableType;
7410
- protected?: boolean;
7411
- bigquery?: IBigQueryOptions;
7412
- assertions?: ITableAssertions;
7413
- uniqueKey?: string[];
7414
- materialized?: boolean;
7415
- }
7416
- interface ITableContext extends ICommonContext {
7417
- when: (cond: boolean, trueCase: string, falseCase?: string) => string;
7418
- incremental: () => boolean;
7419
- }
7420
- declare class Table extends ActionBuilder<dataform.Table> {
7421
- proto: dataform.ITable;
7422
- session: Session;
7423
- dependOnDependencyAssertions: boolean;
7424
- contextableQuery: Contextable<ITableContext, string>;
7425
- private contextableWhere;
7426
- private contextablePreOps;
7427
- private contextablePostOps;
7428
- private uniqueKeyAssertions;
7429
- private rowConditionsAssertion;
7430
- constructor(session?: Session, tableTypeConfig?: dataform.ActionConfig.TableConfig | dataform.ActionConfig.ViewConfig | dataform.ActionConfig.IncrementalTableConfig, tableType?: TableType, configPath?: string);
7431
- config(config: ITableConfig): this;
7432
- type(type: TableType): this;
7433
- query(query: Contextable<ITableContext, string>): this;
7434
- where(where: Contextable<ITableContext, string>): this;
7435
- preOps(pres: Contextable<ITableContext, string | string[]>): this;
7436
- postOps(posts: Contextable<ITableContext, string | string[]>): this;
7437
- disabled(disabled?: boolean): this;
7438
- protected(defaultsToTrueProtected: boolean): this;
7439
- uniqueKey(uniqueKey: string[]): void;
7440
- materialized(materialized: boolean): void;
7441
- bigquery(bigquery: dataform.IBigQueryOptions): this;
7442
- dependencies(value: Resolvable | Resolvable[]): this;
7443
- hermetic(hermetic: boolean): void;
7444
- tags(value: string | string[]): this;
7445
- description(description: string): this;
7446
- columns(columns: IColumnsDescriptor): this;
7447
- database(database: string): this;
7448
- schema(schema: string): this;
7449
- assertions(assertions: ITableAssertions): this;
7450
- setDependOnDependencyAssertions(dependOnDependencyAssertions: boolean): this;
7451
- getFileName(): string;
7452
- getTarget(): dataform.Target;
7453
- compile(): dataform.Table;
7454
- private contextifyOps;
7455
- private legacyMapConfigAssertions;
7456
- }
7457
- declare class TableContext implements ITableContext {
7458
- private table;
7459
- private isIncremental;
7460
- constructor(table: Table, isIncremental?: boolean);
7461
- config(config: ITableConfig): string;
7462
- self(): string;
7463
- name(): string;
7464
- ref(ref: Resolvable | string[], ...rest: string[]): string;
7465
- resolve(ref: Resolvable | string[], ...rest: string[]): string;
7466
- schema(): string;
7467
- database(): string;
7468
- type(type: TableType): string;
7469
- where(where: Contextable<ITableContext, string>): string;
7470
- when(cond: boolean, trueCase: string, falseCase?: string): string;
7471
- incremental(): boolean;
7472
- preOps(statement: Contextable<ITableContext, string | string[]>): string;
7473
- postOps(statement: Contextable<ITableContext, string | string[]>): string;
7474
- disabled(): string;
7475
- bigquery(bigquery: dataform.IBigQueryOptions): string;
7476
- dependencies(res: Resolvable): string;
7477
- apply<T>(value: Contextable<ITableContext, T>): T;
7478
- tags(tags: string[]): string;
7371
+ interface ILegacyIncrementalTableConfig extends dataform.ActionConfig.IncrementalTableConfig {
7372
+ dependencies: Resolvable[];
7373
+ database: string;
7374
+ schema: string;
7375
+ fileName: string;
7376
+ type: string;
7377
+ bigquery?: ILegacyTableBigqueryConfig;
7378
+ assertions: any;
7479
7379
  }
7480
-
7481
7380
  declare class IncrementalTable extends ActionBuilder<dataform.Table> {
7482
7381
  proto: dataform.ITable;
7483
7382
  session: Session;
@@ -7494,7 +7393,7 @@ declare class IncrementalTable extends ActionBuilder<dataform.Table> {
7494
7393
  preOps(pres: Contextable<ITableContext, string | string[]>): this;
7495
7394
  postOps(posts: Contextable<ITableContext, string | string[]>): this;
7496
7395
  disabled(disabled?: boolean): this;
7497
- protected(defaultsToTrueProtected: boolean): this;
7396
+ protected(isProtected: boolean): this;
7498
7397
  uniqueKey(uniqueKey: string[]): void;
7499
7398
  bigquery(bigquery: dataform.IBigQueryOptions): this;
7500
7399
  dependencies(value: Resolvable | Resolvable[]): this;
@@ -7564,6 +7463,23 @@ declare class OperationContext implements ICommonContext {
7564
7463
  apply<T>(value: Contextable<ICommonContext, T>): T;
7565
7464
  }
7566
7465
 
7466
+ interface ILegacyViewBigqueryConfig {
7467
+ labels: {
7468
+ [key: string]: string;
7469
+ };
7470
+ additionalOptions: {
7471
+ [key: string]: string;
7472
+ };
7473
+ }
7474
+ interface ILegacyViewConfig extends dataform.ActionConfig.ViewConfig {
7475
+ dependencies: Resolvable[];
7476
+ database: string;
7477
+ schema: string;
7478
+ fileName: string;
7479
+ type: string;
7480
+ bigquery: ILegacyViewBigqueryConfig;
7481
+ assertions: any;
7482
+ }
7567
7483
  declare class View extends ActionBuilder<dataform.Table> {
7568
7484
  proto: dataform.ITable;
7569
7485
  session: Session;
@@ -7598,6 +7514,73 @@ declare class View extends ActionBuilder<dataform.Table> {
7598
7514
  private verifyConfig;
7599
7515
  }
7600
7516
 
7517
+ declare const TableType: readonly ["table", "view", "incremental"];
7518
+ declare type TableType = typeof TableType[number];
7519
+ interface ILegacyTableConfig extends dataform.ActionConfig.TableConfig {
7520
+ dependencies: Resolvable[];
7521
+ database: string;
7522
+ schema: string;
7523
+ fileName: string;
7524
+ type: string;
7525
+ bigquery?: ILegacyTableBigqueryConfig;
7526
+ assertions: any;
7527
+ }
7528
+ declare class Table extends ActionBuilder<dataform.Table> {
7529
+ proto: dataform.ITable;
7530
+ session: Session;
7531
+ dependOnDependencyAssertions: boolean;
7532
+ contextableQuery: Contextable<ITableContext, string>;
7533
+ private contextableWhere;
7534
+ private contextablePreOps;
7535
+ private contextablePostOps;
7536
+ private uniqueKeyAssertions;
7537
+ private rowConditionsAssertion;
7538
+ constructor(session?: Session, unverifiedConfig?: any, configPath?: string);
7539
+ type(type: TableType): this | View | IncrementalTable;
7540
+ query(query: Contextable<ITableContext, string>): this;
7541
+ where(where: Contextable<ITableContext, string>): this;
7542
+ preOps(pres: Contextable<ITableContext, string | string[]>): this;
7543
+ postOps(posts: Contextable<ITableContext, string | string[]>): this;
7544
+ disabled(disabled?: boolean): this;
7545
+ bigquery(bigquery: dataform.IBigQueryOptions): this;
7546
+ dependencies(value: Resolvable | Resolvable[]): this;
7547
+ hermetic(hermetic: boolean): void;
7548
+ tags(value: string | string[]): this;
7549
+ description(description: string): this;
7550
+ columns(columns: dataform.ActionConfig.ColumnDescriptor[]): this;
7551
+ database(database: string): this;
7552
+ schema(schema: string): this;
7553
+ assertions(assertions: dataform.ActionConfig.TableAssertionsConfig): this;
7554
+ setDependOnDependencyAssertions(dependOnDependencyAssertions: boolean): this;
7555
+ getFileName(): string;
7556
+ getTarget(): dataform.Target;
7557
+ compile(): dataform.Table;
7558
+ private contextifyOps;
7559
+ private verifyConfig;
7560
+ }
7561
+ declare class TableContext implements ITableContext {
7562
+ private table;
7563
+ private isIncremental;
7564
+ constructor(table: Table, isIncremental?: boolean);
7565
+ self(): string;
7566
+ name(): string;
7567
+ ref(ref: Resolvable | string[], ...rest: string[]): string;
7568
+ resolve(ref: Resolvable | string[], ...rest: string[]): string;
7569
+ schema(): string;
7570
+ database(): string;
7571
+ type(type: TableType): string;
7572
+ where(where: Contextable<ITableContext, string>): string;
7573
+ when(cond: boolean, trueCase: string, falseCase?: string): string;
7574
+ incremental(): boolean;
7575
+ preOps(statement: Contextable<ITableContext, string | string[]>): string;
7576
+ postOps(statement: Contextable<ITableContext, string | string[]>): string;
7577
+ disabled(): string;
7578
+ bigquery(bigquery: dataform.IBigQueryOptions): string;
7579
+ dependencies(res: Resolvable): string;
7580
+ apply<T>(value: Contextable<ITableContext, T>): T;
7581
+ tags(tags: string[]): string;
7582
+ }
7583
+
7601
7584
  declare type Action = Table | View | IncrementalTable | Operation | Assertion | Declaration | Notebook | DataPreparation;
7602
7585
  declare abstract class ActionBuilder<T> {
7603
7586
  session: Session;
@@ -7610,6 +7593,23 @@ declare abstract class ActionBuilder<T> {
7610
7593
  abstract compile(): T;
7611
7594
  private validateTarget;
7612
7595
  }
7596
+ interface ITableContext extends ICommonContext {
7597
+ when: (cond: boolean, trueCase: string, falseCase?: string) => string;
7598
+ incremental: () => boolean;
7599
+ }
7600
+ interface ILegacyTableBigqueryConfig {
7601
+ partitionBy?: string;
7602
+ clusterBy?: string[];
7603
+ updatePartitionFilter?: string;
7604
+ labels?: {
7605
+ [key: string]: string;
7606
+ };
7607
+ partitionExpirationDays?: number;
7608
+ requirePartitionFilter?: boolean;
7609
+ additionalOptions?: {
7610
+ [key: string]: string;
7611
+ };
7612
+ }
7613
7613
 
7614
7614
  interface IStringifier<T> {
7615
7615
  stringify: (value: T) => string;
@@ -7690,7 +7690,7 @@ declare class Session {
7690
7690
  }): void;
7691
7691
  resolve(ref: Resolvable | string[], ...rest: string[]): string;
7692
7692
  operate(name: string, queries?: Contextable<ICommonContext, string | string[]>): Operation;
7693
- publish(name: string, queryOrConfig?: Contextable<ITableContext, string> | ITableConfig): Table;
7693
+ publish(name: string, queryOrConfig?: Contextable<ITableContext, string> | ILegacyTableConfig | ILegacyViewConfig | ILegacyIncrementalTableConfig): Table | IncrementalTable | View;
7694
7694
  assert(name: string, query?: AContextable<string>): Assertion;
7695
7695
  declare(dataset: dataform.ITarget): Declaration;
7696
7696
  test(name: string): Test;
@@ -7724,7 +7724,7 @@ declare class ActionMap {
7724
7724
  private setBySchemaLevel;
7725
7725
  }
7726
7726
 
7727
- declare const version = "3.0.9";
7727
+ declare const version = "3.0.10";
7728
7728
 
7729
7729
  declare const session: Session;
7730
7730
  declare const supportedFeatures: dataform.SupportedFeatures[];