mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat: add endpoint for workflow sharing (#4172) (no changelog)
* feat: add endpoint for workflow sharing Co-authored-by: Ben Hesseldieck <b.hesseldieck@gmail.com>
This commit is contained in:
@@ -96,7 +96,12 @@ export async function init() {
|
||||
|
||||
try {
|
||||
const schema = config.getEnv('database.postgresdb.schema');
|
||||
await exec(`psql -d ${testDbName} -c "CREATE SCHEMA IF NOT EXISTS ${schema}";`);
|
||||
const exportPasswordCli = pgOptions.password
|
||||
? `export PGPASSWORD=${pgOptions.password} && `
|
||||
: '';
|
||||
await exec(
|
||||
`${exportPasswordCli} psql -h ${pgOptions.host} -U ${pgOptions.username} -d ${testDbName} -c "CREATE SCHEMA IF NOT EXISTS ${schema}";`,
|
||||
);
|
||||
} catch (error) {
|
||||
if (error instanceof Error && error.message.includes('command not found')) {
|
||||
console.error(
|
||||
@@ -647,6 +652,18 @@ export async function createWorkflowWithTrigger(
|
||||
return workflow;
|
||||
}
|
||||
|
||||
// ----------------------------------
|
||||
// workflow sharing
|
||||
// ----------------------------------
|
||||
|
||||
export async function getWorkflowSharing(workflow: WorkflowEntity) {
|
||||
return Db.collections.SharedWorkflow.find({
|
||||
where: {
|
||||
workflow,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// ----------------------------------
|
||||
// connection options
|
||||
// ----------------------------------
|
||||
|
||||
Reference in New Issue
Block a user