-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transform EntityDefinition to support both import and export
- Loading branch information
Showing
19 changed files
with
82 additions
and
55 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { LanguageContracts } from "@kontent-ai/management-sdk"; | ||
|
||
import { EntityDefinition } from "../entityDefinition.js"; | ||
|
||
export const languagesExportEntity: EntityDefinition<ReadonlyArray<LanguageContracts.ILanguageModelContract>> = { | ||
name: "languages", | ||
fetchEntities: client => client.listLanguages().toAllPromise().then(res => res.data.items.map(l => l._raw)), | ||
serializeEntities: collections => JSON.stringify(collections), | ||
importEntities: () => { throw new Error("Not supported yet.")}, | ||
deserializeEntities: () => { throw new Error("Not supported yet.")}, | ||
}; |
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,11 @@ | ||
import { PreviewContracts } from "@kontent-ai/management-sdk"; | ||
|
||
import { EntityDefinition } from "../entityDefinition.js"; | ||
|
||
export const previewUrlsExportEntity: EntityDefinition<PreviewContracts.IPreviewConfigurationContract> = { | ||
name: "previewUrls", | ||
fetchEntities: client => client.getPreviewConfiguration().toPromise().then(res => res.rawData), | ||
serializeEntities: collections => JSON.stringify(collections), | ||
importEntities: () => { throw new Error("Not supported yet.")}, | ||
deserializeEntities: () => { throw new Error("Not supported yet.")}, | ||
}; |
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,11 @@ | ||
import { RoleContracts } from "@kontent-ai/management-sdk"; | ||
|
||
import { EntityDefinition } from "../entityDefinition.js"; | ||
|
||
export const rolesExportEntity: EntityDefinition<ReadonlyArray<RoleContracts.IRoleContract>> = { | ||
name: "roles", | ||
fetchEntities: client => client.listRoles().toPromise().then(res => res.rawData.roles), | ||
serializeEntities: collections => JSON.stringify(collections), | ||
importEntities: () => { throw new Error("Not supported yet.")}, | ||
deserializeEntities: () => { throw new Error("Not supported yet.")}, | ||
}; |
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,11 @@ | ||
import { WorkflowContracts } from "@kontent-ai/management-sdk"; | ||
|
||
import { EntityDefinition } from "../entityDefinition.js"; | ||
|
||
export const workflowsExportEntity: EntityDefinition<WorkflowContracts.IListWorkflowsResponseContract> = { | ||
name: "workflows", | ||
fetchEntities: client => client.listWorkflows().toPromise().then(res => res.rawData), | ||
serializeEntities: collections => JSON.stringify(collections), | ||
importEntities: () => { throw new Error("Not supported yet.")}, | ||
deserializeEntities: () => { throw new Error("Not supported yet.")}, | ||
}; |
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