mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-31 06:23:08 +02:00
OAuth 2 (#158)
This commit is contained in:
25
packages/plugin-runtime/src/migrations.ts
Normal file
25
packages/plugin-runtime/src/migrations.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import {HttpRequestAction, TemplateFunction} from '@yaakapp/api';
|
||||
|
||||
export function migrateTemplateFunctionSelectOptions(f: TemplateFunction): TemplateFunction {
|
||||
const migratedArgs = f.args.map((a) => {
|
||||
if (a.type === 'select') {
|
||||
a.options = a.options.map((o) => ({
|
||||
...o,
|
||||
label: o.label || (o as any).name,
|
||||
}));
|
||||
}
|
||||
return a;
|
||||
});
|
||||
|
||||
return {
|
||||
...f,
|
||||
args: migratedArgs,
|
||||
};
|
||||
}
|
||||
|
||||
export function migrateHttpRequestActionKey(a: HttpRequestAction): HttpRequestAction {
|
||||
return {
|
||||
...a,
|
||||
name: a.name || (a as any).key,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user