Skip to content

Commit

Permalink
Generate api for changes in #13370 and make code compatible (#14014)
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundito committed Jun 22, 2022
1 parent 2378b87 commit 595b559
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion airbyte-webapp/src/components/EntityTable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface ITableDataItem {
isSyncing?: boolean;
status?: string;
lastSync?: number | null;
schedule: ConnectionSchedule | undefined;
schedule?: ConnectionSchedule;
lastSyncStatus: string | null;
connectorIcon?: string;
entityIcon?: string;
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/config/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { ConnectionSchedule } from "core/request/AirbyteClient";
import { equal } from "utils/objects";

export const getFrequencyConfig = (schedule?: ConnectionSchedule) =>
FrequencyConfig.find((item) => (!schedule && !item) || equal(item.config, schedule));
FrequencyConfig.find((item) => (!schedule && !item.config) || equal(item.config, schedule));
34 changes: 18 additions & 16 deletions airbyte-webapp/src/core/request/AirbyteClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ export interface DbMigrationReadList {
/**
* optional resource requirements to run workers (blank for unbounded allocations)
*/
export type ResourceRequirements = {
export interface ResourceRequirements {
cpu_request?: string;
cpu_limit?: string;
memory_request?: string;
memory_limit?: string;
} | null;
}

/**
* enum that describes the different types of jobs that the platform runs.
Expand Down Expand Up @@ -527,18 +527,18 @@ export interface AttemptFailureReason {
timestamp: number;
}

export type AttemptFailureSummary = {
export interface AttemptFailureSummary {
failures: AttemptFailureReason[];
/** 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. */
partialSuccess?: boolean;
} | null;
}

export type AttemptStats = {
export interface AttemptStats {
recordsEmitted?: number;
bytesEmitted?: number;
stateMessagesEmitted?: number;
recordsCommitted?: number;
} | null;
}

export interface AttemptStreamStats {
streamName: string;
Expand Down Expand Up @@ -658,13 +658,13 @@ export interface AirbyteStream {
jsonSchema?: StreamJsonSchema;
supportedSyncModes?: SyncMode[];
/** 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. */
sourceDefinedCursor?: boolean | null;
sourceDefinedCursor?: boolean;
/** 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. */
defaultCursorField?: string[];
/** 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. */
sourceDefinedPrimaryKey?: string[][];
/** 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. */
namespace?: string | null;
namespace?: string;
}

/**
Expand Down Expand Up @@ -710,12 +710,12 @@ export interface CheckOperationRead {
message?: string;
}

export type OperatorDbt = {
export interface OperatorDbt {
gitRepoUrl: string;
gitRepoBranch?: string;
dockerImage?: string;
dbtArguments?: string;
} | null;
}

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

Expand Down Expand Up @@ -797,10 +797,10 @@ export const ConnectionScheduleTimeUnit = {
/**
* if null, then no schedule is set.
*/
export type ConnectionSchedule = {
export interface ConnectionSchedule {
units: number;
timeUnit: ConnectionScheduleTimeUnit;
} | null;
}

/**
* 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.
Expand Down Expand Up @@ -871,7 +871,7 @@ export interface ConnectionCreate {
schedule?: ConnectionSchedule;
status: ConnectionStatus;
resourceRequirements?: ResourceRequirements;
sourceCatalogId?: string | null;
sourceCatalogId?: string;
}

export interface DbMigrationRequestBody {
Expand Down Expand Up @@ -910,7 +910,7 @@ export interface ConnectionUpdate {
schedule?: ConnectionSchedule;
status: ConnectionStatus;
resourceRequirements?: ResourceRequirements;
sourceCatalogId?: string | null;
sourceCatalogId?: string;
}

export interface WebBackendConnectionRequestBody {
Expand Down Expand Up @@ -1010,7 +1010,7 @@ export interface ConnectionRead {
schedule?: ConnectionSchedule;
status: ConnectionStatus;
resourceRequirements?: ResourceRequirements;
sourceCatalogId?: string | null;
sourceCatalogId?: string;
}

export interface DestinationIdRequestBody {
Expand Down Expand Up @@ -1342,7 +1342,9 @@ export const NotificationType = {
customerio: "customerio",
} as const;

export type CustomerioNotificationConfiguration = { [key: string]: any };
export interface CustomerioNotificationConfiguration {
[key: string]: any;
}

export interface SlackNotificationConfiguration {
webhook: string;
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/hooks/services/useConnectionHook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const connectionsKeys = {

export interface ValuesProps {
name?: string;
schedule: ConnectionSchedule | null;
schedule?: ConnectionSchedule;
prefix: string;
syncCatalog: SyncSchema;
namespaceDefinition: NamespaceDefinitionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const CatalogSectionInner: React.FC<CatalogSectionInnerProps> = ({
const destNamespace = getDestinationNamespace({
namespaceDefinition,
namespaceFormat,
sourceNamespace: stream?.namespace ?? undefined,
sourceNamespace: stream?.namespace,
});

const fields = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const mockConnection: WebBackendConnectionRead = {
sourceId: "test-source",
destinationId: "test-destination",
status: ConnectionStatus.active,
schedule: null,
schedule: undefined,
syncCatalog: {
streams: [],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import calculateInitialCatalog from "./calculateInitialCatalog";
const mockSyncSchemaStream: SyncSchemaStream = {
id: "1",
stream: {
sourceDefinedCursor: null,
sourceDefinedCursor: undefined,
defaultCursorField: [],
sourceDefinedPrimaryKey: [],
jsonSchema: {},
Expand Down

0 comments on commit 595b559

Please sign in to comment.