Skip to content

Commit 6a1fdc5

Browse files
committed
Generate api for changes in #13370 and make code compatible
1 parent 2cbee5a commit 6a1fdc5

File tree

7 files changed

+24
-22
lines changed

7 files changed

+24
-22
lines changed

airbyte-webapp/src/components/EntityTable/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface ITableDataItem {
2424
isSyncing?: boolean;
2525
status?: string;
2626
lastSync?: number | null;
27-
schedule: ConnectionSchedule | undefined;
27+
schedule?: ConnectionSchedule;
2828
lastSyncStatus: string | null;
2929
connectorIcon?: string;
3030
entityIcon?: string;

airbyte-webapp/src/config/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import { ConnectionSchedule } from "core/request/AirbyteClient";
33
import { equal } from "utils/objects";
44

55
export const getFrequencyConfig = (schedule?: ConnectionSchedule) =>
6-
FrequencyConfig.find((item) => (!schedule && !item) || equal(item.config, schedule));
6+
FrequencyConfig.find((item) => (!schedule && !item.config) || equal(item.config, schedule));

airbyte-webapp/src/core/request/AirbyteClient.ts

+18-16
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,12 @@ export interface DbMigrationReadList {
374374
/**
375375
* optional resource requirements to run workers (blank for unbounded allocations)
376376
*/
377-
export type ResourceRequirements = {
377+
export interface ResourceRequirements {
378378
cpu_request?: string;
379379
cpu_limit?: string;
380380
memory_request?: string;
381381
memory_limit?: string;
382-
} | null;
382+
}
383383

384384
/**
385385
* enum that describes the different types of jobs that the platform runs.
@@ -527,18 +527,18 @@ export interface AttemptFailureReason {
527527
timestamp: number;
528528
}
529529

530-
export type AttemptFailureSummary = {
530+
export interface AttemptFailureSummary {
531531
failures: AttemptFailureReason[];
532532
/** True if the number of committed records for this attempt was greater than 0. False if 0 records were committed. If not set, the number of committed records is unknown. */
533533
partialSuccess?: boolean;
534-
} | null;
534+
}
535535

536-
export type AttemptStats = {
536+
export interface AttemptStats {
537537
recordsEmitted?: number;
538538
bytesEmitted?: number;
539539
stateMessagesEmitted?: number;
540540
recordsCommitted?: number;
541-
} | null;
541+
}
542542

543543
export interface AttemptStreamStats {
544544
streamName: string;
@@ -658,13 +658,13 @@ export interface AirbyteStream {
658658
jsonSchema?: StreamJsonSchema;
659659
supportedSyncModes?: SyncMode[];
660660
/** If the source defines the cursor field, then any other cursor field inputs will be ignored. If it does not, either the user_provided one is used, or the default one is used as a backup. */
661-
sourceDefinedCursor?: boolean | null;
661+
sourceDefinedCursor?: boolean;
662662
/** Path to the field that will be used to determine if a record is new or modified since the last sync. If not provided by the source, the end user will have to specify the comparable themselves. */
663663
defaultCursorField?: string[];
664664
/** If the source defines the primary key, paths to the fields that will be used as a primary key. If not provided by the source, the end user will have to specify the primary key themselves. */
665665
sourceDefinedPrimaryKey?: string[][];
666666
/** Optional Source-defined namespace. Airbyte streams from the same sources should have the same namespace. Currently only used by JDBC destinations to determine what schema to write to. */
667-
namespace?: string | null;
667+
namespace?: string;
668668
}
669669

670670
/**
@@ -710,12 +710,12 @@ export interface CheckOperationRead {
710710
message?: string;
711711
}
712712

713-
export type OperatorDbt = {
713+
export interface OperatorDbt {
714714
gitRepoUrl: string;
715715
gitRepoBranch?: string;
716716
dockerImage?: string;
717717
dbtArguments?: string;
718-
} | null;
718+
}
719719

720720
export type OperatorNormalizationOption = typeof OperatorNormalizationOption[keyof typeof OperatorNormalizationOption];
721721

@@ -797,10 +797,10 @@ export const ConnectionScheduleTimeUnit = {
797797
/**
798798
* if null, then no schedule is set.
799799
*/
800-
export type ConnectionSchedule = {
800+
export interface ConnectionSchedule {
801801
units: number;
802802
timeUnit: ConnectionScheduleTimeUnit;
803-
} | null;
803+
}
804804

805805
/**
806806
* Active means that data is flowing through the connection. Inactive means it is not. Deprecated means the connection is off and cannot be re-activated. the schema field describes the elements of the schema that will be synced.
@@ -871,7 +871,7 @@ export interface ConnectionCreate {
871871
schedule?: ConnectionSchedule;
872872
status: ConnectionStatus;
873873
resourceRequirements?: ResourceRequirements;
874-
sourceCatalogId?: string | null;
874+
sourceCatalogId?: string;
875875
}
876876

877877
export interface DbMigrationRequestBody {
@@ -910,7 +910,7 @@ export interface ConnectionUpdate {
910910
schedule?: ConnectionSchedule;
911911
status: ConnectionStatus;
912912
resourceRequirements?: ResourceRequirements;
913-
sourceCatalogId?: string | null;
913+
sourceCatalogId?: string;
914914
}
915915

916916
export interface WebBackendConnectionRequestBody {
@@ -1010,7 +1010,7 @@ export interface ConnectionRead {
10101010
schedule?: ConnectionSchedule;
10111011
status: ConnectionStatus;
10121012
resourceRequirements?: ResourceRequirements;
1013-
sourceCatalogId?: string | null;
1013+
sourceCatalogId?: string;
10141014
}
10151015

10161016
export interface DestinationIdRequestBody {
@@ -1342,7 +1342,9 @@ export const NotificationType = {
13421342
customerio: "customerio",
13431343
} as const;
13441344

1345-
export type CustomerioNotificationConfiguration = { [key: string]: any };
1345+
export interface CustomerioNotificationConfiguration {
1346+
[key: string]: any;
1347+
}
13461348

13471349
export interface SlackNotificationConfiguration {
13481350
webhook: string;

airbyte-webapp/src/hooks/services/useConnectionHook.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const connectionsKeys = {
3333

3434
export interface ValuesProps {
3535
name?: string;
36-
schedule: ConnectionSchedule | null;
36+
schedule?: ConnectionSchedule;
3737
prefix: string;
3838
syncCatalog: SyncSchema;
3939
namespaceDefinition: NamespaceDefinitionType;

airbyte-webapp/src/views/Connection/CatalogTree/CatalogSection.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const CatalogSectionInner: React.FC<CatalogSectionInnerProps> = ({
109109
const destNamespace = getDestinationNamespace({
110110
namespaceDefinition,
111111
namespaceFormat,
112-
sourceNamespace: stream?.namespace ?? undefined,
112+
sourceNamespace: stream?.namespace,
113113
});
114114

115115
const fields = useMemo(() => {

airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionForm.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const mockConnection: WebBackendConnectionRead = {
3838
sourceId: "test-source",
3939
destinationId: "test-destination",
4040
status: ConnectionStatus.active,
41-
schedule: null,
41+
schedule: undefined,
4242
syncCatalog: {
4343
streams: [],
4444
},

airbyte-webapp/src/views/Connection/ConnectionForm/calculateInitialCatalog.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import calculateInitialCatalog from "./calculateInitialCatalog";
66
const mockSyncSchemaStream: SyncSchemaStream = {
77
id: "1",
88
stream: {
9-
sourceDefinedCursor: null,
9+
sourceDefinedCursor: undefined,
1010
defaultCursorField: [],
1111
sourceDefinedPrimaryKey: [],
1212
jsonSchema: {},

0 commit comments

Comments
 (0)