-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Zendesk Connection Oauth UI behind FF (#7974)
* Zendesk Connection Oauth UI behind FF * Lint * Use Zendesklogo * fix: mock connector initialization for zendesk * feat: add a ConfigurationModel for zendesk * misc: remove a TODO (to be reconsidered) --------- Co-authored-by: Aubin <[email protected]>
- Loading branch information
1 parent
82a3143
commit b21288f
Showing
18 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import type { | ||
CreationOptional, | ||
ForeignKey, | ||
InferAttributes, | ||
InferCreationAttributes, | ||
} from "sequelize"; | ||
import { DataTypes, Model } from "sequelize"; | ||
|
||
import { sequelizeConnection } from "@connectors/resources/storage"; | ||
import { ConnectorModel } from "@connectors/resources/storage/models/connector_model"; | ||
|
||
export class ZendeskConfigurationModel extends Model< | ||
InferAttributes<ZendeskConfigurationModel>, | ||
InferCreationAttributes<ZendeskConfigurationModel> | ||
> { | ||
declare id: CreationOptional<number>; | ||
declare createdAt: CreationOptional<Date>; | ||
declare updatedAt: CreationOptional<Date>; | ||
|
||
declare conversationsSlidingWindow: number; | ||
|
||
declare connectorId: ForeignKey<ConnectorModel["id"]>; | ||
} | ||
ZendeskConfigurationModel.init( | ||
{ | ||
id: { | ||
type: DataTypes.INTEGER, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
}, | ||
createdAt: { | ||
type: DataTypes.DATE, | ||
allowNull: false, | ||
defaultValue: DataTypes.NOW, | ||
}, | ||
updatedAt: { | ||
type: DataTypes.DATE, | ||
allowNull: false, | ||
defaultValue: DataTypes.NOW, | ||
}, | ||
conversationsSlidingWindow: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
defaultValue: 90, | ||
}, | ||
}, | ||
{ | ||
sequelize: sequelizeConnection, | ||
modelName: "zendesk_configurations", | ||
indexes: [{ fields: ["connectorId"], unique: true }], | ||
} | ||
); | ||
ConnectorModel.hasMany(ZendeskConfigurationModel, { | ||
foreignKey: { allowNull: false }, | ||
onDelete: "RESTRICT", | ||
}); | ||
ZendeskConfigurationModel.belongsTo(ConnectorModel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ export const CONNECTOR_PROVIDERS = [ | |
"microsoft", | ||
"webcrawler", | ||
"snowflake", | ||
"zendesk", | ||
] as const; | ||
|
||
export const MANAGED_DS_DELETABLE: ConnectorProvider[] = [ | ||
|
@@ -29,6 +30,7 @@ export const CONNECTOR_TYPE_TO_NAME: Record<ConnectorProvider, string> = { | |
microsoft: "Microsoft", | ||
webcrawler: "Website", | ||
snowflake: "Snowflake", | ||
zendesk: "Zendesk", | ||
}; | ||
|
||
export const CONNECTOR_TYPE_TO_MISMATCH_ERROR: Record< | ||
|
@@ -49,6 +51,8 @@ export const CONNECTOR_TYPE_TO_MISMATCH_ERROR: Record< | |
webcrawler: "You cannot change the URL. Please add a new Public URL instead.", | ||
snowflake: | ||
"You cannot change the Snowflake account. Please add a new Snowflake connection instead.", | ||
zendesk: | ||
"You cannot select another Zendesk Workspace.\nPlease contact us at [email protected] if you initially selected a wrong Workspace.", | ||
}; | ||
|
||
export type ConnectorProvider = (typeof CONNECTOR_PROVIDERS)[number]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters