mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:14:03 +01:00
Switch to BiomeJS (#306)
This commit is contained in:
@@ -8,8 +8,7 @@
|
||||
"build": "run-p build:*",
|
||||
"build:1-build": "yaakcli build",
|
||||
"build:2-cpywasm": "cpx '../../node_modules/@1password/sdk-core/nodejs/core_bg.*' build/",
|
||||
"dev": "yaakcli dev",
|
||||
"lint": "tsc --noEmit && eslint . --ext .ts,.tsx"
|
||||
"dev": "yaakcli dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@1password/sdk": "^0.4.0-beta.2"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import crypto from 'node:crypto';
|
||||
import type { Client } from '@1password/sdk';
|
||||
import { createClient } from '@1password/sdk';
|
||||
import type { CallTemplateFunctionArgs } from '@yaakapp-internal/plugins';
|
||||
import type { PluginDefinition } from '@yaakapp/api';
|
||||
import crypto from 'crypto';
|
||||
import type { CallTemplateFunctionArgs } from '@yaakapp-internal/plugins';
|
||||
|
||||
const _clients: Record<string, Client> = {};
|
||||
|
||||
@@ -34,6 +34,7 @@ export const plugin: PluginDefinition = {
|
||||
type: 'text',
|
||||
label: '1Password Service Account Token',
|
||||
description: '',
|
||||
// biome-ignore lint/suspicious/noTemplateCurlyInString: Yaak template syntax
|
||||
defaultValue: '${[ONEPASSWORD_TOKEN]}',
|
||||
password: true,
|
||||
},
|
||||
@@ -69,7 +70,7 @@ export const plugin: PluginDefinition = {
|
||||
const items = await client.items.list(vaultId);
|
||||
return {
|
||||
options: items.map((item) => ({
|
||||
label: item.title + ' ' + item.category,
|
||||
label: `${item.title} ${item.category}`,
|
||||
value: item.id,
|
||||
})),
|
||||
};
|
||||
@@ -114,7 +115,7 @@ export const plugin: PluginDefinition = {
|
||||
const item = await client.items.get(vaultId, itemId);
|
||||
const field = item.fields.find((f) => f.id === fieldId);
|
||||
if (field == null) {
|
||||
throw new Error('Field not found: ' + fieldId);
|
||||
throw new Error(`Field not found: ${fieldId}`);
|
||||
}
|
||||
return field.value ?? '';
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user