Switch to BiomeJS (#306)

This commit is contained in:
Gregory Schier
2025-11-23 08:38:13 -08:00
committed by GitHub
parent 2bac610efe
commit ec3e2e16a9
332 changed files with 3007 additions and 4097 deletions

View File

@@ -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"

View File

@@ -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 ?? '';
},