2024-03-21 11:22:36 +00:00
|
|
|
import * as Factory from "factory.ts";
|
2025-01-15 05:59:32 +00:00
|
|
|
import { PaginationType, type QueryAction } from "entities/Action";
|
|
|
|
|
import { PluginPackageName, PluginType } from "entities/Plugin";
|
2024-03-21 11:22:36 +00:00
|
|
|
import { PluginIDs } from "test/factories/MockPluginsState";
|
|
|
|
|
|
2024-06-11 09:44:54 +00:00
|
|
|
const pageId = "0123456789abcdef00000000";
|
|
|
|
|
|
2024-03-21 11:22:36 +00:00
|
|
|
export const PostgresFactory = Factory.Sync.makeFactory<QueryAction>({
|
|
|
|
|
cacheResponse: "",
|
|
|
|
|
id: "query_id",
|
2024-07-31 02:54:51 +00:00
|
|
|
baseId: "query_base_id",
|
2024-03-21 11:22:36 +00:00
|
|
|
workspaceId: "workspaceId",
|
2024-07-31 02:54:51 +00:00
|
|
|
applicationId: "applicationId",
|
2024-03-21 11:22:36 +00:00
|
|
|
pluginType: PluginType.DB,
|
|
|
|
|
pluginId: PluginIDs[PluginPackageName.POSTGRES],
|
|
|
|
|
name: Factory.each((i) => `Query${i + 1}`),
|
|
|
|
|
datasource: {
|
|
|
|
|
id: "PostgresDatasourceID",
|
|
|
|
|
name: "ExampleDatabase",
|
|
|
|
|
pluginId: PluginIDs[PluginPackageName.POSTGRES],
|
|
|
|
|
},
|
2024-06-11 09:44:54 +00:00
|
|
|
pageId: pageId,
|
2024-03-21 11:22:36 +00:00
|
|
|
actionConfiguration: {
|
|
|
|
|
timeoutInMillisecond: 10000,
|
|
|
|
|
paginationType: PaginationType.NONE,
|
|
|
|
|
body: "select * from public.users limit 10",
|
|
|
|
|
pluginSpecifiedTemplates: [
|
|
|
|
|
{
|
|
|
|
|
key: "preparedStatement",
|
|
|
|
|
value: false,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-05-02 12:28:26 +00:00
|
|
|
runBehaviour: "MANUAL",
|
2024-03-21 11:22:36 +00:00
|
|
|
dynamicBindingPathList: [],
|
|
|
|
|
isValid: true,
|
|
|
|
|
invalids: [],
|
|
|
|
|
messages: [],
|
|
|
|
|
jsonPathKeys: [],
|
|
|
|
|
confirmBeforeExecute: false,
|
|
|
|
|
userPermissions: [
|
|
|
|
|
"read:actions",
|
|
|
|
|
"delete:actions",
|
|
|
|
|
"execute:actions",
|
|
|
|
|
"manage:actions",
|
|
|
|
|
],
|
2025-03-24 08:38:43 +00:00
|
|
|
isDirtyMap: {
|
|
|
|
|
SCHEMA_GENERATION: false,
|
|
|
|
|
},
|
2024-03-21 11:22:36 +00:00
|
|
|
});
|