Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rest Hooks to latest 5; use legacy package for Resource #6002

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 50 additions & 31 deletions airbyte-webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions airbyte-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@fullstory/browser": "^1.4.9",
"@papercups-io/chat-widget": "^1.1.5",
"@papercups-io/storytime": "^1.0.6",
"@rest-hooks/legacy": "^2.0.5",
"@rest-hooks/legacy": "^3.0.0",
"@sentry/react": "^6.11.0",
"@sentry/tracing": "^6.11.0",
"@storybook/preset-create-react-app": "^3.2.0",
Expand All @@ -46,14 +46,14 @@
"react-table": "^7.5.0",
"react-use": "^15.3.8",
"react-widgets": "^4.6.1",
"rest-hooks": "^5.0.20",
"rest-hooks": "^5.3.4",
"sanitize-html": "^2.3.3",
"styled-components": "^5.1.1",
"typesafe-actions": "^5.1.0",
"yup": "^0.32.9"
},
"devDependencies": {
"@rest-hooks/test": "^6.2.0",
"@rest-hooks/test": "^7.0.0",
"@storybook/addon-essentials": "^6.3.6",
"@storybook/preset-create-react-app": "^3.2.0",
"@storybook/react": "^6.3.2",
Expand Down
12 changes: 4 additions & 8 deletions airbyte-webapp/src/core/resources/BaseResource.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
AbstractInstanceType,
Method,
MutateShape,
ReadShape,
Resource,
SchemaDetail,
SchemaList,
schemas,
} from "rest-hooks";
Delete,
} from "@rest-hooks/legacy";
import { AbstractInstanceType } from "@rest-hooks/normalizr";

import { parseResponse } from "core/request/AirbyteRequestService";
import { getService } from "core/servicesProvider";
Expand Down Expand Up @@ -136,11 +136,7 @@ export default abstract class BaseResource extends Resource {

static deleteShape<T extends typeof Resource>(
this: T
): MutateShape<
schemas.Delete<T>,
Readonly<Record<string, unknown>>,
unknown
> {
): MutateShape<Delete<T>, Readonly<Record<string, unknown>>, unknown> {
return {
...super.deleteShape(),
getFetchKey: (params: Readonly<Record<string, unknown>>) =>
Expand Down
4 changes: 2 additions & 2 deletions airbyte-webapp/src/core/resources/Connection.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
FetchOptions,
FetchShape,
MutateShape,
ReadShape,
Resource,
SchemaDetail,
} from "rest-hooks";
} from "@rest-hooks/legacy";
import { FetchOptions } from "rest-hooks";

import { SyncSchema } from "core/domain/catalog";
import { CommonRequestError } from "core/request/CommonRequestError";
Expand Down
7 changes: 6 additions & 1 deletion airbyte-webapp/src/core/resources/Destination.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { MutateShape, ReadShape, Resource, SchemaDetail } from "rest-hooks";
import {
MutateShape,
ReadShape,
Resource,
SchemaDetail,
} from "@rest-hooks/legacy";

import { ConnectionConfiguration } from "core/domain/connection";
import BaseResource from "./BaseResource";
Expand Down
7 changes: 6 additions & 1 deletion airbyte-webapp/src/core/resources/DestinationDefinition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { MutateShape, ReadShape, Resource, SchemaDetail } from "rest-hooks";
import {
MutateShape,
ReadShape,
Resource,
SchemaDetail,
} from "@rest-hooks/legacy";

import { getService } from "core/servicesProvider";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadShape, Resource, SchemaDetail } from "rest-hooks";
import { ReadShape, Resource, SchemaDetail } from "@rest-hooks/legacy";
import BaseResource from "./BaseResource";
import { ConnectionSpecification } from "core/domain/connection";
import { DestinationSyncMode } from "../domain/catalog";
Expand Down
4 changes: 2 additions & 2 deletions airbyte-webapp/src/core/resources/Job.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
FetchOptions,
MutateShape,
ReadShape,
Resource,
SchemaDetail,
} from "rest-hooks";
} from "@rest-hooks/legacy";
import { FetchOptions } from "rest-hooks";
import BaseResource from "./BaseResource";
import Status from "../statuses";

Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/resources/Logs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadShape, Resource, SchemaDetail } from "rest-hooks";
import { ReadShape, Resource, SchemaDetail } from "@rest-hooks/legacy";
import BaseResource from "./BaseResource";

export interface Logs {
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/resources/Notifications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MutateShape, Resource, SchemaDetail } from "rest-hooks";
import { MutateShape, Resource, SchemaDetail } from "@rest-hooks/legacy";
import BaseResource from "./BaseResource";

export interface Notifications {
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/resources/Scheduler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadShape, Resource, SchemaDetail } from "rest-hooks";
import { ReadShape, Resource, SchemaDetail } from "@rest-hooks/legacy";
import BaseResource from "./BaseResource";
import Status from "core/statuses";
import { CommonRequestError } from "core/request/CommonRequestError";
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/resources/Schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadShape, Resource, SchemaDetail } from "rest-hooks";
import { ReadShape, Resource, SchemaDetail } from "@rest-hooks/legacy";

import BaseResource from "./BaseResource";
import { JobInfo } from "./Scheduler";
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/resources/Source.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadShape, Resource, SchemaDetail } from "rest-hooks";
import { ReadShape, Resource, SchemaDetail } from "@rest-hooks/legacy";
import BaseResource from "./BaseResource";
import { ConnectionConfiguration } from "core/domain/connection";

Expand Down
3 changes: 2 additions & 1 deletion airbyte-webapp/src/core/resources/SourceDefinition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MutateShape, ReadShape, Resource, SchemaDetail } from "rest-hooks";
import { MutateShape, ReadShape, SchemaDetail } from "@rest-hooks/legacy";
import { Resource } from "@rest-hooks/legacy";
import BaseResource from "./BaseResource";
import { getService } from "core/servicesProvider";
import { SourceDefinitionService } from "../domain/connector/SourceDefinitionService";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadShape, Resource, SchemaDetail } from "rest-hooks";
import { ReadShape, Resource, SchemaDetail } from "@rest-hooks/legacy";
import BaseResource from "./BaseResource";
import { ConnectionSpecification } from "core/domain/connection";

Expand Down
7 changes: 6 additions & 1 deletion airbyte-webapp/src/core/resources/Workspace.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { MutateShape, ReadShape, Resource, SchemaDetail } from "rest-hooks";
import {
MutateShape,
ReadShape,
Resource,
SchemaDetail,
} from "@rest-hooks/legacy";
import BaseResource from "./BaseResource";

export interface Notification {
Expand Down