-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into sam/24_11_27/feat/get-integration-credentials
- Loading branch information
Showing
12 changed files
with
290 additions
and
28 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
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,34 @@ | ||
import type { DBEnvironment, DBTeam, OnEventScript, OnEventScriptsByProvider } from '@nangohq/types'; | ||
import { onEventScriptService } from '../services/on-event-scripts.service.js'; | ||
|
||
export async function createOnEventScript({ | ||
account, | ||
environment, | ||
providerConfigKey | ||
}: { | ||
account: DBTeam; | ||
environment: DBEnvironment; | ||
providerConfigKey: string; | ||
}): Promise<OnEventScript> { | ||
const scripts: OnEventScriptsByProvider[] = [ | ||
{ | ||
providerConfigKey, | ||
scripts: [ | ||
{ | ||
name: 'test-script', | ||
event: 'post-connection-creation', | ||
fileBody: { js: '', ts: '' } | ||
} | ||
] | ||
} | ||
]; | ||
const [added] = await onEventScriptService.update({ | ||
environment, | ||
account, | ||
onEventScriptsByProvider: scripts | ||
}); | ||
if (!added) { | ||
throw new Error('failed_to_create_on_event_script'); | ||
} | ||
return added; | ||
} |
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
Oops, something went wrong.