@databricks/sdk-features 0.1.0-dev.3 → 0.1.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/v1/model.js CHANGED
@@ -6,69 +6,66 @@ import { z } from 'zod';
6
6
  * Scalar data types for request-time field definitions.
7
7
  * Only flat (non-nested) types are supported.
8
8
  */
9
- export var ScalarDataType;
10
- (function (ScalarDataType) {
11
- ScalarDataType["SCALAR_DATA_TYPE_UNSPECIFIED"] = "SCALAR_DATA_TYPE_UNSPECIFIED";
12
- ScalarDataType["INTEGER"] = "INTEGER";
13
- ScalarDataType["FLOAT"] = "FLOAT";
14
- ScalarDataType["BOOLEAN"] = "BOOLEAN";
15
- ScalarDataType["STRING"] = "STRING";
16
- ScalarDataType["DOUBLE"] = "DOUBLE";
17
- ScalarDataType["LONG"] = "LONG";
18
- ScalarDataType["TIMESTAMP"] = "TIMESTAMP";
19
- ScalarDataType["DATE"] = "DATE";
20
- ScalarDataType["SHORT"] = "SHORT";
21
- ScalarDataType["BINARY"] = "BINARY";
22
- ScalarDataType["DECIMAL"] = "DECIMAL";
23
- })(ScalarDataType || (ScalarDataType = {}));
9
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
10
+ export const ScalarDataType = {
11
+ SCALAR_DATA_TYPE_UNSPECIFIED: 'SCALAR_DATA_TYPE_UNSPECIFIED',
12
+ INTEGER: 'INTEGER',
13
+ FLOAT: 'FLOAT',
14
+ BOOLEAN: 'BOOLEAN',
15
+ STRING: 'STRING',
16
+ DOUBLE: 'DOUBLE',
17
+ LONG: 'LONG',
18
+ TIMESTAMP: 'TIMESTAMP',
19
+ DATE: 'DATE',
20
+ SHORT: 'SHORT',
21
+ BINARY: 'BINARY',
22
+ DECIMAL: 'DECIMAL',
23
+ };
24
24
  /** Deprecated: Use the function-specific messages in AggregationFunction.function_type oneof instead. Kept for backwards compatibility. */
25
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
26
- export var Function_FunctionType;
27
- (function (Function_FunctionType) {
28
- Function_FunctionType["FUNCTION_TYPE_UNSPECIFIED"] = "FUNCTION_TYPE_UNSPECIFIED";
29
- Function_FunctionType["AVG"] = "AVG";
30
- Function_FunctionType["COUNT"] = "COUNT";
31
- Function_FunctionType["SUM"] = "SUM";
32
- Function_FunctionType["MIN"] = "MIN";
33
- Function_FunctionType["MAX"] = "MAX";
34
- Function_FunctionType["FIRST"] = "FIRST";
35
- Function_FunctionType["LAST"] = "LAST";
36
- Function_FunctionType["APPROX_COUNT_DISTINCT"] = "APPROX_COUNT_DISTINCT";
37
- Function_FunctionType["APPROX_PERCENTILE"] = "APPROX_PERCENTILE";
38
- Function_FunctionType["STDDEV_POP"] = "STDDEV_POP";
39
- Function_FunctionType["STDDEV_SAMP"] = "STDDEV_SAMP";
40
- Function_FunctionType["VAR_POP"] = "VAR_POP";
41
- Function_FunctionType["VAR_SAMP"] = "VAR_SAMP";
42
- })(Function_FunctionType || (Function_FunctionType = {}));
43
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
44
- export var MaterializedFeature_PipelineScheduleState;
45
- (function (MaterializedFeature_PipelineScheduleState) {
25
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
26
+ export const Function_FunctionType = {
27
+ FUNCTION_TYPE_UNSPECIFIED: 'FUNCTION_TYPE_UNSPECIFIED',
28
+ AVG: 'AVG',
29
+ COUNT: 'COUNT',
30
+ SUM: 'SUM',
31
+ MIN: 'MIN',
32
+ MAX: 'MAX',
33
+ FIRST: 'FIRST',
34
+ LAST: 'LAST',
35
+ APPROX_COUNT_DISTINCT: 'APPROX_COUNT_DISTINCT',
36
+ APPROX_PERCENTILE: 'APPROX_PERCENTILE',
37
+ STDDEV_POP: 'STDDEV_POP',
38
+ STDDEV_SAMP: 'STDDEV_SAMP',
39
+ VAR_POP: 'VAR_POP',
40
+ VAR_SAMP: 'VAR_SAMP',
41
+ };
42
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
43
+ export const MaterializedFeature_PipelineScheduleState = {
46
44
  /** Default value, not used. */
47
- MaterializedFeature_PipelineScheduleState["PIPELINE_SCHEDULE_STATE_UNSPECIFIED"] = "PIPELINE_SCHEDULE_STATE_UNSPECIFIED";
45
+ PIPELINE_SCHEDULE_STATE_UNSPECIFIED: 'PIPELINE_SCHEDULE_STATE_UNSPECIFIED',
48
46
  /** Pipeline was configured to run once then stop. */
49
- MaterializedFeature_PipelineScheduleState["SNAPSHOT"] = "SNAPSHOT";
47
+ SNAPSHOT: 'SNAPSHOT',
50
48
  /** Pipeline is actively running and computing features. */
51
- MaterializedFeature_PipelineScheduleState["ACTIVE"] = "ACTIVE";
49
+ ACTIVE: 'ACTIVE',
52
50
  /** Pipeline is paused and not computing features. */
53
- MaterializedFeature_PipelineScheduleState["PAUSED"] = "PAUSED";
54
- })(MaterializedFeature_PipelineScheduleState || (MaterializedFeature_PipelineScheduleState = {}));
55
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
56
- export var StreamingMode_StreamingModeType;
57
- (function (StreamingMode_StreamingModeType) {
51
+ PAUSED: 'PAUSED',
52
+ };
53
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
54
+ export const StreamingMode_StreamingModeType = {
58
55
  /** Default value, not used. */
59
- StreamingMode_StreamingModeType["STREAMING_MODE_TYPE_UNSPECIFIED"] = "STREAMING_MODE_TYPE_UNSPECIFIED";
56
+ STREAMING_MODE_TYPE_UNSPECIFIED: 'STREAMING_MODE_TYPE_UNSPECIFIED',
60
57
  /**
61
58
  * Real-time mode. Ultra-low-latency trigger intended for operational workloads
62
59
  * that need responses in milliseconds or sub-second latency.
63
60
  */
64
- StreamingMode_StreamingModeType["STREAMING_MODE_TYPE_RTM"] = "STREAMING_MODE_TYPE_RTM";
61
+ STREAMING_MODE_TYPE_RTM: 'STREAMING_MODE_TYPE_RTM',
65
62
  /**
66
63
  * Micro-batch mode in Structured Streaming. Better suited for ETL and analytics
67
64
  * workloads where latency is measured in seconds or minutes and cost efficiency
68
65
  * matters more.
69
66
  */
70
- StreamingMode_StreamingModeType["STREAMING_MODE_TYPE_MBM"] = "STREAMING_MODE_TYPE_MBM";
71
- })(StreamingMode_StreamingModeType || (StreamingMode_StreamingModeType = {}));
67
+ STREAMING_MODE_TYPE_MBM: 'STREAMING_MODE_TYPE_MBM',
68
+ };
72
69
  export const unmarshalAggregationFunctionSchema = z
73
70
  .object({
74
71
  avg: z.lazy(() => unmarshalAvgFunctionSchema).optional(),
@@ -259,6 +256,7 @@ export const unmarshalDataSourceSchema = z
259
256
  .optional(),
260
257
  kafka_source: z.lazy(() => unmarshalKafkaSourceSchema).optional(),
261
258
  request_source: z.lazy(() => unmarshalRequestSourceSchema).optional(),
259
+ stream_source: z.lazy(() => unmarshalStreamSourceSchema).optional(),
262
260
  })
263
261
  .transform(d => ({
264
262
  dataSource: d.delta_table_source !== undefined
@@ -270,7 +268,9 @@ export const unmarshalDataSourceSchema = z
270
268
  ? { $case: 'kafkaSource', kafkaSource: d.kafka_source }
271
269
  : d.request_source !== undefined
272
270
  ? { $case: 'requestSource', requestSource: d.request_source }
273
- : undefined,
271
+ : d.stream_source !== undefined
272
+ ? { $case: 'streamSource', streamSource: d.stream_source }
273
+ : undefined,
274
274
  }));
275
275
  export const unmarshalDeltaTableSourceSchema = z
276
276
  .object({
@@ -355,7 +355,7 @@ export const unmarshalFeatureSchema = z
355
355
  export const unmarshalFieldDefinitionSchema = z
356
356
  .object({
357
357
  name: z.string().optional(),
358
- data_type: z.enum(ScalarDataType).optional(),
358
+ data_type: z.string().optional(),
359
359
  })
360
360
  .transform(d => ({
361
361
  name: d.name,
@@ -377,7 +377,7 @@ export const unmarshalFlatSchemaSchema = z
377
377
  }));
378
378
  export const unmarshalFunctionSchema = z
379
379
  .object({
380
- function_type: z.enum(Function_FunctionType).optional(),
380
+ function_type: z.string().optional(),
381
381
  extra_parameters: z
382
382
  .array(z.lazy(() => unmarshalFunction_ExtraParameterSchema))
383
383
  .optional(),
@@ -473,6 +473,7 @@ export const unmarshalKafkaConfigSchema = z
473
473
  value_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(),
474
474
  extra_options: z.record(z.string(), z.string()).optional(),
475
475
  backfill_source: z.lazy(() => unmarshalBackfillSourceSchema).optional(),
476
+ ingestion_config: z.lazy(() => unmarshalIngestionConfigSchema).optional(),
476
477
  })
477
478
  .transform(d => ({
478
479
  name: d.name,
@@ -483,6 +484,7 @@ export const unmarshalKafkaConfigSchema = z
483
484
  valueSchema: d.value_schema,
484
485
  extraOptions: d.extra_options,
485
486
  backfillSource: d.backfill_source,
487
+ ingestionConfig: d.ingestion_config,
486
488
  }));
487
489
  export const unmarshalKafkaSourceSchema = z
488
490
  .object({
@@ -600,9 +602,7 @@ export const unmarshalMaterializedFeatureSchema = z
600
602
  .lazy(() => unmarshalOnlineStoreConfigSchema)
601
603
  .optional(),
602
604
  table_name: z.string().optional(),
603
- pipeline_schedule_state: z
604
- .enum(MaterializedFeature_PipelineScheduleState)
605
- .optional(),
605
+ pipeline_schedule_state: z.string().optional(),
606
606
  last_materialization_time: z
607
607
  .string()
608
608
  .transform(s => Temporal.Instant.from(s))
@@ -844,6 +844,15 @@ export const unmarshalStreamSchemaConfigSchema = z
844
844
  ? { $case: 'directSchemas', directSchemas: d.direct_schemas }
845
845
  : undefined,
846
846
  }));
847
+ export const unmarshalStreamSourceSchema = z
848
+ .object({
849
+ full_name: z.string().optional(),
850
+ filter_condition: z.string().optional(),
851
+ })
852
+ .transform(d => ({
853
+ fullName: d.full_name,
854
+ filterCondition: d.filter_condition,
855
+ }));
847
856
  export const unmarshalStreamSourceConfigSchema = z
848
857
  .object({
849
858
  kafka_stream_config: z
@@ -860,7 +869,7 @@ export const unmarshalStreamSourceConfigSchema = z
860
869
  }));
861
870
  export const unmarshalStreamingModeSchema = z
862
871
  .object({
863
- mode: z.enum(StreamingMode_StreamingModeType).optional(),
872
+ mode: z.string().optional(),
864
873
  })
865
874
  .transform(d => ({
866
875
  mode: d.mode,
@@ -1176,6 +1185,10 @@ export const marshalDataSourceSchema = z
1176
1185
  $case: z.literal('requestSource'),
1177
1186
  requestSource: z.lazy(() => marshalRequestSourceSchema),
1178
1187
  }),
1188
+ z.object({
1189
+ $case: z.literal('streamSource'),
1190
+ streamSource: z.lazy(() => marshalStreamSourceSchema),
1191
+ }),
1179
1192
  ])
1180
1193
  .optional(),
1181
1194
  })
@@ -1189,6 +1202,9 @@ export const marshalDataSourceSchema = z
1189
1202
  ...(d.dataSource?.$case === 'requestSource' && {
1190
1203
  request_source: d.dataSource.requestSource,
1191
1204
  }),
1205
+ ...(d.dataSource?.$case === 'streamSource' && {
1206
+ stream_source: d.dataSource.streamSource,
1207
+ }),
1192
1208
  }));
1193
1209
  export const marshalDeltaTableSourceSchema = z
1194
1210
  .object({
@@ -1273,7 +1289,7 @@ export const marshalFeatureSchema = z
1273
1289
  export const marshalFieldDefinitionSchema = z
1274
1290
  .object({
1275
1291
  name: z.string().optional(),
1276
- dataType: z.enum(ScalarDataType).optional(),
1292
+ dataType: z.string().optional(),
1277
1293
  })
1278
1294
  .transform(d => ({
1279
1295
  name: d.name,
@@ -1295,7 +1311,7 @@ export const marshalFlatSchemaSchema = z
1295
1311
  }));
1296
1312
  export const marshalFunctionSchema = z
1297
1313
  .object({
1298
- functionType: z.enum(Function_FunctionType).optional(),
1314
+ functionType: z.string().optional(),
1299
1315
  extraParameters: z
1300
1316
  .array(z.lazy(() => marshalFunction_ExtraParameterSchema))
1301
1317
  .optional(),
@@ -1386,6 +1402,7 @@ export const marshalKafkaConfigSchema = z
1386
1402
  valueSchema: z.lazy(() => marshalSchemaConfigSchema).optional(),
1387
1403
  extraOptions: z.record(z.string(), z.string()).optional(),
1388
1404
  backfillSource: z.lazy(() => marshalBackfillSourceSchema).optional(),
1405
+ ingestionConfig: z.lazy(() => marshalIngestionConfigSchema).optional(),
1389
1406
  })
1390
1407
  .transform(d => ({
1391
1408
  name: d.name,
@@ -1396,6 +1413,7 @@ export const marshalKafkaConfigSchema = z
1396
1413
  value_schema: d.valueSchema,
1397
1414
  extra_options: d.extraOptions,
1398
1415
  backfill_source: d.backfillSource,
1416
+ ingestion_config: d.ingestionConfig,
1399
1417
  }));
1400
1418
  export const marshalKafkaSourceSchema = z
1401
1419
  .object({
@@ -1482,9 +1500,7 @@ export const marshalMaterializedFeatureSchema = z
1482
1500
  ])
1483
1501
  .optional(),
1484
1502
  tableName: z.string().optional(),
1485
- pipelineScheduleState: z
1486
- .enum(MaterializedFeature_PipelineScheduleState)
1487
- .optional(),
1503
+ pipelineScheduleState: z.string().optional(),
1488
1504
  lastMaterializationTime: z
1489
1505
  .any()
1490
1506
  .transform((d) => d.toString())
@@ -1743,6 +1759,15 @@ export const marshalStreamSchemaConfigSchema = z
1743
1759
  direct_schemas: d.schemaConfig.directSchemas,
1744
1760
  }),
1745
1761
  }));
1762
+ export const marshalStreamSourceSchema = z
1763
+ .object({
1764
+ fullName: z.string().optional(),
1765
+ filterCondition: z.string().optional(),
1766
+ })
1767
+ .transform(d => ({
1768
+ full_name: d.fullName,
1769
+ filter_condition: d.filterCondition,
1770
+ }));
1746
1771
  export const marshalStreamSourceConfigSchema = z
1747
1772
  .object({
1748
1773
  sourceConfig: z
@@ -1761,7 +1786,7 @@ export const marshalStreamSourceConfigSchema = z
1761
1786
  }));
1762
1787
  export const marshalStreamingModeSchema = z
1763
1788
  .object({
1764
- mode: z.enum(StreamingMode_StreamingModeType).optional(),
1789
+ mode: z.string().optional(),
1765
1790
  })
1766
1791
  .transform(d => ({
1767
1792
  mode: d.mode,
@@ -1945,6 +1970,10 @@ const dataSourceFieldMaskSchema = {
1945
1970
  wire: 'request_source',
1946
1971
  children: () => requestSourceFieldMaskSchema,
1947
1972
  },
1973
+ streamSource: {
1974
+ wire: 'stream_source',
1975
+ children: () => streamSourceFieldMaskSchema,
1976
+ },
1948
1977
  };
1949
1978
  const deltaTableSourceFieldMaskSchema = {
1950
1979
  dataframeSchema: { wire: 'dataframe_schema' },
@@ -2038,6 +2067,10 @@ const kafkaConfigFieldMaskSchema = {
2038
2067
  },
2039
2068
  bootstrapServers: { wire: 'bootstrap_servers' },
2040
2069
  extraOptions: { wire: 'extra_options' },
2070
+ ingestionConfig: {
2071
+ wire: 'ingestion_config',
2072
+ children: () => ingestionConfigFieldMaskSchema,
2073
+ },
2041
2074
  keySchema: { wire: 'key_schema', children: () => schemaConfigFieldMaskSchema },
2042
2075
  name: { wire: 'name' },
2043
2076
  subscriptionMode: {
@@ -2211,6 +2244,10 @@ const streamSchemaConfigFieldMaskSchema = {
2211
2244
  children: () => directSchemasFieldMaskSchema,
2212
2245
  },
2213
2246
  };
2247
+ const streamSourceFieldMaskSchema = {
2248
+ filterCondition: { wire: 'filter_condition' },
2249
+ fullName: { wire: 'full_name' },
2250
+ };
2214
2251
  const streamSourceConfigFieldMaskSchema = {
2215
2252
  kafkaStreamConfig: {
2216
2253
  wire: 'kafka_stream_config',