Skip to content

Commit

Permalink
feat: deprecate the usage of integration.schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
EiffelFly committed Nov 27, 2024
1 parent fbbd708 commit 2bad8ce
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
12 changes: 0 additions & 12 deletions packages/sdk/src/core/integration/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ export const OAuthConfigSchema = z.object({
scopes: z.array(z.string()),
});

export type IntegrationSchema = {
method: IntegrationMethod;
schema: InstillJSONSchema;
};

export const IntegrationSchemaSchema = z.object({
method: z.string(),
schema: z.any(),
});

export type Integration = {
uid: string;
id: string;
Expand All @@ -48,7 +38,6 @@ export type Integration = {
setupSchema: InstillJSONSchema;
oAuthConfig: Nullable<OAuthConfig>;
view: ResourceView;
schemas: IntegrationSchema[];
};

export const IntegrationSchema = z.object({
Expand All @@ -62,7 +51,6 @@ export const IntegrationSchema = z.object({
setupSchema: z.any(),
oAuthConfig: OAuthConfigSchema.nullable(),
view: ResourceViewSchema,
schemas: z.array(IntegrationSchemaSchema),
});

export type IntegrationConnection = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ export const ManualSettingDialog = ({
<ConnectionForm
id={integration.id}
method="METHOD_DICTIONARY"
schema={
integrationFull.data.schemas.find(
(item) => item.method === "METHOD_DICTIONARY",
)?.schema
}
schema={integrationFull.data.setupSchema}
onSubmit={onSubmit}
className="max-h-[600px] overflow-y-auto"
isProcessing={isProcessing}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ export const EditConnectionDialog = ({
<ConnectionForm
id={`${editingConnection.id}-${editingConnection.method}`}
method={editingConnection.method}
schema={
integrationFull.data.schemas.find(
(item) => item.method === editingConnection.method,
)?.schema
}
schema={integrationFull.data.setupSchema}
className="mt-6 max-h-[600px] overflow-y-auto"
values={{
...connectionFull.data.setup,
Expand Down

0 comments on commit 2bad8ce

Please sign in to comment.