mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
feat(plugins): migrate Gitea and Linear issue providers to plugins (#8204)
* feat(plugins): migrate Gitea and Linear issue providers to plugins * feat(plugins): localize Gitea issue provider config form Port the existing Gitea translations (F.GITEA.* + shared issue-content keys) into the plugin's own i18n so non-English users keep localized config labels after the plugin migration. Generated for all 28 app locales. * docs(plugins): note Linear teamId/projectId filter is now active The built-in Linear provider defined teamId/projectId config fields but never passed them to the search, so they were inert. The plugin honors them as the field labels promise; document this as a deliberate behavior change. * test(issue): fix unknown casts in issue-provider migration spec The spec compiled clean under the app tsconfig (which excludes *.spec.ts) but failed CI's tsconfig.spec.json build: casting state.entities[id] (IssueProvider | undefined) straight to Record<string, unknown> is a TS2352 non-overlap error, and .toBe(already) on a bare literal is a TS2345. Add the intermediate 'as unknown' so the spec type-checks. * ci(lighthouse): raise total resource-count budget to 260 Migrating the Gitea and Linear issue providers to bundled plugins adds two more entries to BUNDLED_PLUGIN_PATHS. Each bundled plugin is discovered at startup, fetching its manifest.json plus icon.svg, which pushed the Lighthouse total request count to 251, one over the previous 250 budget. The increase is an inherent, accepted consequence of the built-in -> bundled-plugin migration (same as github/clickup); bump the budget to 260 to reflect the new baseline with modest headroom.
This commit is contained in:
parent
1c53656889
commit
4c869c2e15
78 changed files with 2905 additions and 1924 deletions
22
packages/plugin-dev/gitea-issue-provider/i18n/ar.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/ar.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "المضيف (على سبيل المثال: \nhttps://try.gitea.io)",
|
||||
"TOKEN": "رمز الوصول",
|
||||
"REPO_FULL_NAME": "اسم المستخدم أو اسم المؤسسة/المشروع",
|
||||
"SCOPE": "النطاق",
|
||||
"SCOPE_ALL": "الكل",
|
||||
"SCOPE_CREATED": "تم إنشاؤه بواسطتي",
|
||||
"SCOPE_ASSIGNED": "تم تعيينه لي",
|
||||
"FILTER_LABELS": "التصفية حسب التسميات (اختياري)",
|
||||
"EXCLUDE_LABELS": "استبعاد التسميات (اختياري)",
|
||||
"HOW_TO_GET_TOKEN": "كيف تحصل على الرمز المميز؟"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "ملخص",
|
||||
"STATE": "حالة",
|
||||
"ASSIGNEE": "المحال",
|
||||
"LABELS": "تسميات",
|
||||
"DESCRIPTION": "وصف"
|
||||
},
|
||||
"FORM_HELP": "<p>هنا يمكنك تهيئة 'سوبر برودكتيفيتي' لإدراج مشكلات ’جيتيا’ المفتوحة لمستودع معين في لوحة إنشاء المهام في عرض التخطيط اليومي. سيتم سردها كاقتراحات وستوفر رابطًا للمشكلة بالإضافة إلى مزيد من المعلومات عنها.</p> <p>بالإضافة إلى ذلك يمكنك إضافة واستيراد جميع المشكلات المفتوحة تلقائيًا.</p><p>للحصول على حدود الاستخدام والوصول يمكنك توفير رمز وصول مميز."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/cs.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/cs.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Hostitel (např.: https://try.gitea.io)",
|
||||
"TOKEN": "Přístupový token",
|
||||
"REPO_FULL_NAME": "Uživatelské jméno nebo název organizace/projektu",
|
||||
"SCOPE": "Rozsah",
|
||||
"SCOPE_ALL": "Všechny",
|
||||
"SCOPE_CREATED": "Vytvořeno mnou",
|
||||
"SCOPE_ASSIGNED": "Přiřazeno mně",
|
||||
"FILTER_LABELS": "Filter by labels (optional)",
|
||||
"EXCLUDE_LABELS": "Exclude labels (optional)",
|
||||
"HOW_TO_GET_TOKEN": "Jak získat token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Shrnutí",
|
||||
"STATE": "Stav",
|
||||
"ASSIGNEE": "Přiřazený",
|
||||
"LABELS": "Štítky",
|
||||
"DESCRIPTION": "Popis"
|
||||
},
|
||||
"FORM_HELP": "<p>Zde můžete nakonfigurovat SuperProductivity tak, aby zobrazoval otevřené problémy Gitea pro konkrétní repozitář v panelu vytváření úkolů v denním plánovacím zobrazení. Budou uvedeny jako návrhy a poskytnou odkaz na problém a další informace o něm.</p> <p>Kromě toho můžete automaticky přidat a importovat všechny otevřené problémy.</p><p>Pro překročení omezení a přístup můžete poskytnout přístupový token."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/de.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/de.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Host (z. B. : https://try.gitea.io)",
|
||||
"TOKEN": "Zugangstoken",
|
||||
"REPO_FULL_NAME": "Benutzername oder Organisationsname/Projekt",
|
||||
"SCOPE": "Umfang",
|
||||
"SCOPE_ALL": "Alle",
|
||||
"SCOPE_CREATED": "Von mir erstellt",
|
||||
"SCOPE_ASSIGNED": "Mir zugewiesen",
|
||||
"FILTER_LABELS": "Nach Labels filtern (optional)",
|
||||
"EXCLUDE_LABELS": "Labels ausschließen (optional)",
|
||||
"HOW_TO_GET_TOKEN": "Wie bekomme ich einen Token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Zusammenfassung",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Zuständiger",
|
||||
"LABELS": "Beschriftungen",
|
||||
"DESCRIPTION": "Beschreibung"
|
||||
},
|
||||
"FORM_HELP": "<p>Hier kannst du SuperProductivity so konfigurieren, dass offene Gitea-Issues für ein bestimmtes Repository im Aufgabenerstellungsfenster in der Tagesplanungsansicht aufgelistet werden. Sie werden als Vorschläge angezeigt und enthalten einen Link zum Issue sowie weitere Informationen dazu.</p><p> Darüber hinaus kannst du alle offenen Issues automatisch hinzufügen und importieren.</p><p> Um Nutzungsbeschränkungen zu umgehen und Zugriff zu erhalten, kannst du ein Zugriffstoken bereitstellen."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/en.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/en.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Host (e.g. https://try.gitea.io)",
|
||||
"TOKEN": "Access Token",
|
||||
"REPO_FULL_NAME": "Username or Organization name/repository",
|
||||
"SCOPE": "Scope",
|
||||
"SCOPE_ALL": "All",
|
||||
"SCOPE_CREATED": "Created by me",
|
||||
"SCOPE_ASSIGNED": "Assigned to me",
|
||||
"FILTER_LABELS": "Filter by labels (optional)",
|
||||
"EXCLUDE_LABELS": "Exclude labels (optional)",
|
||||
"HOW_TO_GET_TOKEN": "How to get a token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Summary",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Assignee",
|
||||
"LABELS": "Labels",
|
||||
"DESCRIPTION": "Description"
|
||||
},
|
||||
"FORM_HELP": "<p>Here you can configure Super Productivity to list open Gitea issues for a specific repository in the task creation panel in the daily planning view. They will be listed as suggestions and will provide a link to the issue as well as more information about it.</p><p>In addition, you can automatically add and import all open issues.</p><p>To get by usage limits and gain access, you can provide an access token."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/es.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/es.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Host (p. ej.: https://try.gitea.io)",
|
||||
"TOKEN": "Token de acceso",
|
||||
"REPO_FULL_NAME": "Nombre de usuario o nombre de la organización/proyecto",
|
||||
"SCOPE": "Alcance",
|
||||
"SCOPE_ALL": "Todos",
|
||||
"SCOPE_CREATED": "Creado por mí",
|
||||
"SCOPE_ASSIGNED": "Asignado a mí",
|
||||
"FILTER_LABELS": "Filtrar por etiquetas (opcional)",
|
||||
"EXCLUDE_LABELS": "Excluir etiquetas (opcional)",
|
||||
"HOW_TO_GET_TOKEN": "¿Cómo obtener un token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Resumen",
|
||||
"STATE": "Estado",
|
||||
"ASSIGNEE": "Asignado",
|
||||
"LABELS": "Etiquetas",
|
||||
"DESCRIPTION": "Descripción"
|
||||
},
|
||||
"FORM_HELP": "<p>Aquí puedes configurar SuperProductivity para listar las incidencias de Gitea abiertas para un repositorio específico en el panel de creación de tareas en la vista de planificación diaria. Se listarán como sugerencias y proporcionarán un enlace a la incidencia así como más información sobre ella.</p> <p>Además, puedes añadir e importar automáticamente todas las incidencias abiertas.</p><p>Para superar los límites de uso y acceder puedes proporcionar un token de acceso."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/fa.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/fa.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "میزبان (به عنوان مثال: https://try.gitea.io)",
|
||||
"TOKEN": "توکن دسترسی",
|
||||
"REPO_FULL_NAME": "نام کاربری یا نام سازمان/پروژه",
|
||||
"SCOPE": "دامنه",
|
||||
"SCOPE_ALL": "همه",
|
||||
"SCOPE_CREATED": "ایجاد شده توسط من",
|
||||
"SCOPE_ASSIGNED": "به من اختصاص داده است",
|
||||
"FILTER_LABELS": "Filter by labels (optional)",
|
||||
"EXCLUDE_LABELS": "Exclude labels (optional)",
|
||||
"HOW_TO_GET_TOKEN": "چگونه یک توکن دریافت کنیم؟"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "خلاصه",
|
||||
"STATE": "وضعیت",
|
||||
"ASSIGNEE": "وکیل",
|
||||
"LABELS": "برچسب",
|
||||
"DESCRIPTION": "توضیحات"
|
||||
},
|
||||
"FORM_HELP": "<p>در اینجا میتوانید SuperProductivity را پیکربندی کنید تا مشکلات باز Gitea را برای یک مخزن خاص در پانل ایجاد کار در نمای برنامهریزی روزانه فهرست کند. آنها به عنوان پیشنهاد فهرست می شوند و پیوندی به موضوع و همچنین اطلاعات بیشتری در مورد آن ارائه می دهند.</p> <p>علاوه بر این، میتوانید بهطور خودکار همه مسائل باز را اضافه و وارد کنید.</p><p>برای دریافت محدودیتهای استفاده و دسترسی، میتوانید یک نشانه دسترسی ارائه کنید."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/fi.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/fi.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Isäntä (esim.: https://try.gitea.io)",
|
||||
"TOKEN": "Käyttöoikeustunnus",
|
||||
"REPO_FULL_NAME": "Käyttäjänimi tai organisaation nimi/projekti",
|
||||
"SCOPE": "Laajuus",
|
||||
"SCOPE_ALL": "Kaikki",
|
||||
"SCOPE_CREATED": "Minun luomat",
|
||||
"SCOPE_ASSIGNED": "Minulle osoitetut",
|
||||
"FILTER_LABELS": "Filter by labels (optional)",
|
||||
"EXCLUDE_LABELS": "Exclude labels (optional)",
|
||||
"HOW_TO_GET_TOKEN": "Miten saan tunnuksen?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Yhteenveto",
|
||||
"STATE": "Tila",
|
||||
"ASSIGNEE": "Vastuuhenkilö",
|
||||
"LABELS": "Tunnisteet",
|
||||
"DESCRIPTION": "Kuvaus"
|
||||
},
|
||||
"FORM_HELP": "<p>Tässä voit määrittää SuperProductivityn listamaan avoimet Gitea-ongelmat tietystä arkistosta tehtävänluontipaneelissa päivittäisessä suunnittelinäkymässä. Ne listataan ehdotuksina ja tarjoavat linkin ongelmaan sekä lisätietoja siitä.</p> <p>Lisäksi voit automaattisesti lisätä ja tuoda kaikki avoimet ongelmat.</p><p>Käyttörajoitusten ja pääsyn saamiseksi voit antaa käyttöoikeustunnuksen."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/fr.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/fr.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Hôte (e.g.: https://try.gitea.io)",
|
||||
"TOKEN": "Jeton d'accès",
|
||||
"REPO_FULL_NAME": "Nom d'utilisateur ou nom de l'organisation/projet",
|
||||
"SCOPE": "Portée",
|
||||
"SCOPE_ALL": "Tout",
|
||||
"SCOPE_CREATED": "Créé par moi",
|
||||
"SCOPE_ASSIGNED": "Attribués à moi",
|
||||
"FILTER_LABELS": "Filtrer par étiquettes (facultatif)",
|
||||
"EXCLUDE_LABELS": "Exclure des étiquettes (facultatif)",
|
||||
"HOW_TO_GET_TOKEN": "Comment obtenir un jeton ?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Résumé",
|
||||
"STATE": "Statut",
|
||||
"ASSIGNEE": "Bénéficiaire",
|
||||
"LABELS": "Étiquettes",
|
||||
"DESCRIPTION": "Description"
|
||||
},
|
||||
"FORM_HELP": "<p>Ici, vous pouvez configurer SuperProductivity pour lister les problèmes ouverts de Gitea pour un dépôt spécifique dans le panneau de création de tâches dans la vue de planification quotidienne. Ils seront listés comme suggestions et fourniront un lien vers le problème ainsi que plus d'informations à son sujet.</p> <p>En plus, vous pouvez automatiquement ajouter et importer tous les problèmes ouverts.</p><p>Pour contourner les limites d'utilisation et pour accéder, vous pouvez fournir un jeton d'accès.</p>"
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/hr.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/hr.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Host (npr. https://try.gitea.io)",
|
||||
"TOKEN": "Token za pristup",
|
||||
"REPO_FULL_NAME": "Korisničko ime ili ime organizacije/repozitorija",
|
||||
"SCOPE": "Opseg",
|
||||
"SCOPE_ALL": "Sve",
|
||||
"SCOPE_CREATED": "Stvoreno od mene",
|
||||
"SCOPE_ASSIGNED": "Dodijeljeno meni",
|
||||
"FILTER_LABELS": "Filtriraj prema oznakama (opcionalno)",
|
||||
"EXCLUDE_LABELS": "Isključi oznake (opcionalno)",
|
||||
"HOW_TO_GET_TOKEN": "Kako dobiti token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Sažetak",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Dodijeljeno",
|
||||
"LABELS": "Oznake",
|
||||
"DESCRIPTION": "Opis"
|
||||
},
|
||||
"FORM_HELP": "<p>Ovdje možeš podesiti Super Productivity da prikazuje otvorene Gitea probleme za određeni repozitorij u ploči za stvaranje zadataka u dnevnom planiranju. Prikazat će se kao prijedlozi i imat će poveznicu na problem kao i dodatne informacije.</p> <p>Također možeš automatski dodati i uvesti sve otvorene probleme.</p><p>Za izbjegavanja ograničenja i dobivanja pristupa, unesi token za pristup.</p>"
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/id.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/id.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Host (contoh: https://try.gitea.io)",
|
||||
"TOKEN": "Akses Token",
|
||||
"REPO_FULL_NAME": "Nama pengguna atau nama/proyek Organisasi",
|
||||
"SCOPE": "Cakupan",
|
||||
"SCOPE_ALL": "Semua",
|
||||
"SCOPE_CREATED": "Dibuat oleh saya",
|
||||
"SCOPE_ASSIGNED": "Ditugaskan kepada saya",
|
||||
"FILTER_LABELS": "Filter berdasarkan label (opsional)",
|
||||
"EXCLUDE_LABELS": "Kecualikan label (opsional)",
|
||||
"HOW_TO_GET_TOKEN": "Bagaimana cara mendapatkan token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Ringkasan",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Penanggung jawab",
|
||||
"LABELS": "Label",
|
||||
"DESCRIPTION": "Deskripsi"
|
||||
},
|
||||
"FORM_HELP": "<p>Di sini Anda dapat mengonfigurasi SuperProductivity untuk membuat daftar open Gitea issues untuk repositori tertentu di panel pembuatan tugas dalam tampilan perencanaan harian. Mereka akan dicantumkan sebagai saran dan akan memberikan tautan ke masalah tersebut serta informasi lebih lanjut tentangnya.</p> <p>Selain itu, Anda dapat secara otomatis menambahkan dan menyinkronkan semua open issues ke backlog tugas Anda.</p><p>Untuk mencapai batas penggunaan dan untuk mengakses, Anda dapat memberikan token akses.</p>"
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/it.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/it.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Host (es.: https://try.gitea.io)",
|
||||
"TOKEN": "Token di accesso",
|
||||
"REPO_FULL_NAME": "Username o nome Organizzazione/Progetto",
|
||||
"SCOPE": "Scopo",
|
||||
"SCOPE_ALL": "Tutti",
|
||||
"SCOPE_CREATED": "Create da me",
|
||||
"SCOPE_ASSIGNED": "Assegnate a me",
|
||||
"FILTER_LABELS": "Filtra per etichette (facoltativo)",
|
||||
"EXCLUDE_LABELS": "Escludi etichette (facoltativo)",
|
||||
"HOW_TO_GET_TOKEN": "Come ottenere un token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Riepilogo",
|
||||
"STATE": "Stato",
|
||||
"ASSIGNEE": "Assegnatario",
|
||||
"LABELS": "Etichette",
|
||||
"DESCRIPTION": "Descrizione"
|
||||
},
|
||||
"FORM_HELP": "<p>Qui è possibile configurare SuperProductivity in modo che elenchi le issue aperte di Gitea per uno specifico repository nel pannello di creazione delle attività nella vista di pianificazione giornaliera. Saranno elencati come suggerimenti e forniranno un link all'issue e ulteriori informazioni su di esso.</p> <p>Inoltre è possibile aggiungere e importare automaticamente tutte le issue aperte.</p><p>Per superare i limiti di utilizzo e accedere è possibile fornire un token di accesso."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/ja.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/ja.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "ホスト (例:https://try.gitea.io)",
|
||||
"TOKEN": "アクセストークン",
|
||||
"REPO_FULL_NAME": "ユーザー名または組織名/プロジェクト名",
|
||||
"SCOPE": "範囲",
|
||||
"SCOPE_ALL": "全て",
|
||||
"SCOPE_CREATED": "私が作った",
|
||||
"SCOPE_ASSIGNED": "私に割り当てられた",
|
||||
"FILTER_LABELS": "ラベルで絞り込み(任意)",
|
||||
"EXCLUDE_LABELS": "ラベルを除外(任意)",
|
||||
"HOW_TO_GET_TOKEN": "トークンの入手方法は?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "概要",
|
||||
"STATE": "地位",
|
||||
"ASSIGNEE": "担当者",
|
||||
"LABELS": "ラベル",
|
||||
"DESCRIPTION": "形容"
|
||||
},
|
||||
"FORM_HELP": "<p>ここで SuperProductivity を設定し、日次計画ビューのタスク作成パネルで特定のリポジトリに対して未解決の Gitea 課題を一覧表示させることができます。それらは提案としてリストされ、課題へのリンクとそれに関する詳細情報が提供されます。</p> <p>さらに、すべてのオープン課題を自動的に追加してインポートすることもできます。</p><p>利用制限を通過してアクセスするには、アクセストークンを提供することができます。"
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/ko.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/ko.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "호스트(예: https://try.gitea.io)",
|
||||
"TOKEN": "액세스 토큰",
|
||||
"REPO_FULL_NAME": "사용자 이름 또는 조직 이름/프로젝트",
|
||||
"SCOPE": "범위",
|
||||
"SCOPE_ALL": "모두",
|
||||
"SCOPE_CREATED": "작성자: 나",
|
||||
"SCOPE_ASSIGNED": "나에게 할당됨",
|
||||
"FILTER_LABELS": "라벨로 필터링(선택 사항)",
|
||||
"EXCLUDE_LABELS": "라벨 제외(선택 사항)",
|
||||
"HOW_TO_GET_TOKEN": "토큰은 어떻게 받나요?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "요약",
|
||||
"STATE": "상태",
|
||||
"ASSIGNEE": "담당자",
|
||||
"LABELS": "레이블",
|
||||
"DESCRIPTION": "묘사"
|
||||
},
|
||||
"FORM_HELP": "<p>여기에서 일일 계획 보기의 작업 만들기 패널에서 특정 리포지토리에 대해 열려 있는 Gitea 이슈를 나열하도록 SuperProductivity를 구성할 수 있습니다. 이슈는 제안 사항으로 나열되며 이슈에 대한 링크와 자세한 정보를 제공합니다.</p> <p>또한 열려 있는 모든 이슈를 자동으로 추가하고 가져올 수 있습니다.</p><p>사용량 제한을 통과하고 액세스하려면 액세스 토큰을 제공할 수 있습니다."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/nb.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/nb.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Vert (f.eks.: https://try.gitea.io)",
|
||||
"TOKEN": "Access Token",
|
||||
"REPO_FULL_NAME": "Brukernavn eller organisasjonsnavn/prosjekt",
|
||||
"SCOPE": "Omfang",
|
||||
"SCOPE_ALL": "Alle",
|
||||
"SCOPE_CREATED": "Laget av meg",
|
||||
"SCOPE_ASSIGNED": "Tildelt til meg",
|
||||
"FILTER_LABELS": "Filter by labels (optional)",
|
||||
"EXCLUDE_LABELS": "Exclude labels (optional)",
|
||||
"HOW_TO_GET_TOKEN": "Hvordan får man et token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Sammendrag",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Tildelt",
|
||||
"LABELS": "Etiketter",
|
||||
"DESCRIPTION": "Beskrivelse"
|
||||
},
|
||||
"FORM_HELP": "<p>Her kan du konfigurere SuperProductivity til å liste åpne Gitea-problemer for et spesifikt repository i opprettingspanelet for oppgaver i den daglige planleggingsvisningen. De vil bli listet som forslag og vil gi en lenke til problemet samt mer informasjon om det.<\\/p> <p>I tillegg kan du automatisk legge til og importere alle åpne problemer.<\\/p><p>For å komme forbi bruksgrensene og få tilgang kan du gi et tilgangstoken."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/nl.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/nl.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Host (bijv. https://try.gitea.io)",
|
||||
"TOKEN": "Access Token",
|
||||
"REPO_FULL_NAME": "Gebruikersnaam of Organisatie naam/project",
|
||||
"SCOPE": "Toepassingsgebied",
|
||||
"SCOPE_ALL": "Alle",
|
||||
"SCOPE_CREATED": "Aangemaakt door mij",
|
||||
"SCOPE_ASSIGNED": "Aan mij toegewezen",
|
||||
"FILTER_LABELS": "Filteren op labels (optioneel)",
|
||||
"EXCLUDE_LABELS": "Labels uitsluiten (optioneel)",
|
||||
"HOW_TO_GET_TOKEN": "Hoe krijg ik een token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Samenvatting",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Toegewezen persoon",
|
||||
"LABELS": "Labels",
|
||||
"DESCRIPTION": "Beschrijving"
|
||||
},
|
||||
"FORM_HELP": "<p>Hier kun je SuperProductivity configureren om open Gitea kwesties voor een specifieke repository te tonen in het paneel voor het aanmaken van taken in de dagelijkse planningsweergave. Ze worden weergegeven als suggesties en geven een link naar het issue en meer informatie over het issue.</p> <p>Daarnaast kun je automatisch alle openstaande issues toevoegen en importeren.</p><p>Om de gebruikslimieten te omzeilen en toegang te krijgen kun je een toegangstoken geven."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/pl.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/pl.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Host (np. https://try.gitea.io)",
|
||||
"TOKEN": "Token dostępu",
|
||||
"REPO_FULL_NAME": "Nazwa użytkownika lub nazwa organizacji/projektu",
|
||||
"SCOPE": "Zakres",
|
||||
"SCOPE_ALL": "Wszystkie",
|
||||
"SCOPE_CREATED": "Stworzony przeze mnie",
|
||||
"SCOPE_ASSIGNED": "Przydzielony do mnie",
|
||||
"FILTER_LABELS": "Filtruj według etykiet (opcjonalnie)",
|
||||
"EXCLUDE_LABELS": "Wyklucz etykiety (opcjonalnie)",
|
||||
"HOW_TO_GET_TOKEN": "Jak zdobyć token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Podsumowanie",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Osoba przypisana",
|
||||
"LABELS": "Etykiety",
|
||||
"DESCRIPTION": "Opis"
|
||||
},
|
||||
"FORM_HELP": "<p>Tutaj można skonfigurować SuperProductivity tak, aby wyświetlał listę otwartych zgłoszeń Gitea dla określonego repozytorium w panelu tworzenia zadań w widoku planowania dziennego. Będą one wyświetlane jako sugestie i będą zawierać link do zgłoszenia oraz więcej informacji na jego temat.</p> <p>Ponadto możesz automatycznie dodawać i importować wszystkie otwarte zgłoszenia.</p><p>Aby ominąć limity użytkowania i uzyskać dostęp, możesz podać token dostępu."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/pt-br.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/pt-br.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Servidor (ex: https://try.gitea.io)",
|
||||
"TOKEN": "Token de Acesso",
|
||||
"REPO_FULL_NAME": "Nome do Usuário ou Organização/repositório",
|
||||
"SCOPE": "Escopo",
|
||||
"SCOPE_ALL": "Todos",
|
||||
"SCOPE_CREATED": "Criado por mim",
|
||||
"SCOPE_ASSIGNED": "Atribuído a mim",
|
||||
"FILTER_LABELS": "Filtrar por rótulos (opcional)",
|
||||
"EXCLUDE_LABELS": "Excluir rótulos (opcional)",
|
||||
"HOW_TO_GET_TOKEN": "Como obter um token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Resumo",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Responsável",
|
||||
"LABELS": "Etiquetas",
|
||||
"DESCRIPTION": "Descrição"
|
||||
},
|
||||
"FORM_HELP": "<p>Aqui você pode configurar o Super Productivity para listar issues abertas do Gitea de um repositório específico no painel de criação de tarefas na visualização de planejador. Elas serão listadas como sugestões e fornecerão um link para a issue, bem como mais informações sobre ela.</p><p>Além disso, você pode adicionar e importar automaticamente todas as issues abertas.</p><p>Para contornar limites de uso e para ter acesso, você pode fornecer um token de acesso."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/pt.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/pt.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Endereço do servidor (ex: https://try.gitea.io)",
|
||||
"TOKEN": "Token de acesso",
|
||||
"REPO_FULL_NAME": "Nome do usuário ou organização/projeto",
|
||||
"SCOPE": "Escopo",
|
||||
"SCOPE_ALL": "Todos",
|
||||
"SCOPE_CREATED": "Criados por mim",
|
||||
"SCOPE_ASSIGNED": "Atribuídos a mim",
|
||||
"FILTER_LABELS": "Filtrar por etiquetas (opcional)",
|
||||
"EXCLUDE_LABELS": "Excluir etiquetas (opcional)",
|
||||
"HOW_TO_GET_TOKEN": "Como obter um token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Resumo",
|
||||
"STATE": "Estado",
|
||||
"ASSIGNEE": "Atribuído",
|
||||
"LABELS": "Etiquetas",
|
||||
"DESCRIPTION": "Descrição"
|
||||
},
|
||||
"FORM_HELP": "<p>Aqui você pode configurar o SuperProductivity para listar tarefas do Gitea de um repositório específico no painel de tarefas na tela de planejamento diário. Elas também serão listadas como sugestões e será disponibilizado um link para a tarefa bem como mais informações sobre a mesma.</p> <p>Além disso você pode adicionar e sincronizar todas as tarefas abertas para o seu backlog.</p><p>"
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/ro-md.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/ro-md.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Gazdă (d.e. https://try.gitea.io)",
|
||||
"TOKEN": "Jeton de acces",
|
||||
"REPO_FULL_NAME": "Nume utilizator sau nume organizație/proiect",
|
||||
"SCOPE": "Domeniu de aplicare",
|
||||
"SCOPE_ALL": "Toate",
|
||||
"SCOPE_CREATED": "Create de mine",
|
||||
"SCOPE_ASSIGNED": "Atribuite mie",
|
||||
"FILTER_LABELS": "Filtrează după etichete (opțional)",
|
||||
"EXCLUDE_LABELS": "Exclude etichetele (opțional)",
|
||||
"HOW_TO_GET_TOKEN": "Cum se obține un jeton?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Sumar",
|
||||
"STATE": "Stare",
|
||||
"ASSIGNEE": "Asignat lui",
|
||||
"LABELS": "Etichete",
|
||||
"DESCRIPTION": "Descriere"
|
||||
},
|
||||
"FORM_HELP": "<p>Aici poți configura Super Productivity pentru a lista problemele deschise pe Gitea pentru un repository specific în panoul de creare a sarcinilor în modul de planificare zilnic. Acestea vor fi listate ca sugestii și vor conține o legătură către problemă și mai multe informații despre acesta.</p> <p>În plus, poți adăuga și importa automat toate problemele deschise.</p><p>Pentru a fenta limitele de utilizare și acces, poți folosi un jeton de acces."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/ro.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/ro.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Gazdă (d.e. https://try.gitea.io)",
|
||||
"TOKEN": "Jeton de acces",
|
||||
"REPO_FULL_NAME": "Nume utilizator sau nume organizație/proiect",
|
||||
"SCOPE": "Domeniu de aplicare",
|
||||
"SCOPE_ALL": "Toate",
|
||||
"SCOPE_CREATED": "Create de mine",
|
||||
"SCOPE_ASSIGNED": "Atribuite mie",
|
||||
"FILTER_LABELS": "Filtrează după etichete (opțional)",
|
||||
"EXCLUDE_LABELS": "Exclude etichetele (opțional)",
|
||||
"HOW_TO_GET_TOKEN": "Cum se obține un jeton?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Sumar",
|
||||
"STATE": "Stare",
|
||||
"ASSIGNEE": "Asignat lui",
|
||||
"LABELS": "Etichete",
|
||||
"DESCRIPTION": "Descriere"
|
||||
},
|
||||
"FORM_HELP": "<p>Aici poți configura Super Productivity pentru a lista problemele deschise pe Gitea pentru un repository specific în panoul de creare a sarcinilor în modul de planificare zilnic. Acestea vor fi listate ca sugestii și vor conține o legătură către problemă și mai multe informații despre acesta.</p> <p>În plus, poți adăuga și importa automat toate problemele deschise.</p><p>Pentru a fenta limitele de utilizare și acces, poți folosi un jeton de acces."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/ru.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/ru.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Хост (н-р: https://try.gitea.io)",
|
||||
"TOKEN": "Токен доступа",
|
||||
"REPO_FULL_NAME": "Имя пользователя или название организации/проекта",
|
||||
"SCOPE": "Скоуп",
|
||||
"SCOPE_ALL": "Все",
|
||||
"SCOPE_CREATED": "Создано мной",
|
||||
"SCOPE_ASSIGNED": "Назначено мне",
|
||||
"FILTER_LABELS": "Фильтровать по меткам (необязательно)",
|
||||
"EXCLUDE_LABELS": "Исключить метки (необязательно)",
|
||||
"HOW_TO_GET_TOKEN": "Как получить токен?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Резюме",
|
||||
"STATE": "Статус",
|
||||
"ASSIGNEE": "Исполнитель",
|
||||
"LABELS": "Метки",
|
||||
"DESCRIPTION": "Описание"
|
||||
},
|
||||
"FORM_HELP": "<p>Здесь вы можете настроить SuperProductivity чтобы отображать проблемы Gitea для конкретного репозитория на панели создания задач в представлении ежедневного планирования. Они будут перечислены в качестве предложений и предоставят ссылку на проблему, а также дополнительную информацию о ней.</p> <p>Кроме того, вы можете автоматически добавлять и синхронизировать все открытые проблемы.</p></p>Чтобы получить доступ к закрытым репозиториям, вы можете предоставить токен доступа."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/sk.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/sk.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Hostiteľ (napr.: https://try.gitea.io)",
|
||||
"TOKEN": "Prístupový token",
|
||||
"REPO_FULL_NAME": "Používateľské meno alebo názov organizácie/projektu",
|
||||
"SCOPE": "Rozsah pôsobnosti",
|
||||
"SCOPE_ALL": "Všetky",
|
||||
"SCOPE_CREATED": "Vytvorené mnou",
|
||||
"SCOPE_ASSIGNED": "Pridelené mne",
|
||||
"FILTER_LABELS": "Filter by labels (optional)",
|
||||
"EXCLUDE_LABELS": "Exclude labels (optional)",
|
||||
"HOW_TO_GET_TOKEN": "Ako získať token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Zhrnutie",
|
||||
"STATE": "Stav",
|
||||
"ASSIGNEE": "Priradený",
|
||||
"LABELS": "Štítky",
|
||||
"DESCRIPTION": "Popis"
|
||||
},
|
||||
"FORM_HELP": "<p>Tu môžete nakonfigurovať program SuperProductivity tak, aby na paneli vytvárania úloh v zobrazení denného plánovania zobrazoval zoznam otvorených problémov Gitea pre konkrétny repozitár. Budú uvedené ako návrhy a budú obsahovať odkaz na problém, ako aj ďalšie informácie o ňom.</p> <p>Okrem toho môžete automaticky pridať a importovať všetky otvorené problémy.</p><p>Ak chcete obísť obmedzenia používania a získať prístup, môžete zadať prístupový token."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/sv.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/sv.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Värd (t.ex. https://try.gitea.io)",
|
||||
"TOKEN": "Åtkomsttoken",
|
||||
"REPO_FULL_NAME": "Användarnamn eller organisationsnamn/projekt",
|
||||
"SCOPE": "Omfattning",
|
||||
"SCOPE_ALL": "Alla",
|
||||
"SCOPE_CREATED": "Skapade av mig",
|
||||
"SCOPE_ASSIGNED": "Ålagda mig",
|
||||
"FILTER_LABELS": "Filter by labels (optional)",
|
||||
"EXCLUDE_LABELS": "Exclude labels (optional)",
|
||||
"HOW_TO_GET_TOKEN": "Hur får man en token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Sammanfattning",
|
||||
"STATE": "Status",
|
||||
"ASSIGNEE": "Mottagare",
|
||||
"LABELS": "Etiketter",
|
||||
"DESCRIPTION": "Beskrivning"
|
||||
},
|
||||
"FORM_HELP": "<p>Här kan du konfigurera SuperProductivity så att öppna Gitea-ärenden för ett specifikt arkiv listas i panelen för uppgiftskapande i den dagliga planeringsvyn. De listas som förslag och innehåller en länk till ärendet samt mer information om det. </p> <p>Dessutom kan du automatiskt lägga till och importera alla öppna ärenden. </p><p>För att komma förbi användningsbegränsningar och få åtkomst kan du ange en åtkomsttoken."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/tr.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/tr.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Sağlayıcı (örneğin: https://try.gitea.io)",
|
||||
"TOKEN": "Erişim Jetonu",
|
||||
"REPO_FULL_NAME": "Kullanıcı adı veya Organizasyon adı/projesi",
|
||||
"SCOPE": "Kapsam",
|
||||
"SCOPE_ALL": "Hepsi",
|
||||
"SCOPE_CREATED": "Benim tarafımdan oluşturuldu",
|
||||
"SCOPE_ASSIGNED": "Bana atanan",
|
||||
"FILTER_LABELS": "Etiketlere göre filtrele (isteğe bağlı)",
|
||||
"EXCLUDE_LABELS": "Etiketleri hariç tut (isteğe bağlı)",
|
||||
"HOW_TO_GET_TOKEN": "Bir token nasıl alınır?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Özet",
|
||||
"STATE": "Durum",
|
||||
"ASSIGNEE": "Atanan",
|
||||
"LABELS": "Etiketler",
|
||||
"DESCRIPTION": "Açıklama"
|
||||
},
|
||||
"FORM_HELP": "<p>Burada SuperProductivity'yi, günlük planlama görünümündeki görev oluşturma panelinde belirli bir depo için açık Gitea sorunlarını listeleyecek şekilde yapılandırabilirsiniz. Öneriler olarak listelenecekler ve konuyla ilgili bir bağlantının yanı sıra konuyla ilgili daha fazla bilgi sağlayacaklar.</p> <p>Ek olarak, tüm açık sorunları otomatik olarak görev biriktirme listenize ekleyebilir ve senkronize edebilirsiniz.</p><p>Kullanım sınırlarını aşmak ve erişim sağlamak için bir erişim jetonu sağlayabilirsiniz."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/uk.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/uk.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Хост (наприклад: https://try.gitea.io)",
|
||||
"TOKEN": "Токен доступу",
|
||||
"REPO_FULL_NAME": "Ім'я користувача або назва організації/проекту",
|
||||
"SCOPE": "Область пошуку (Scope)",
|
||||
"SCOPE_ALL": "Усі",
|
||||
"SCOPE_CREATED": "Створені мною",
|
||||
"SCOPE_ASSIGNED": "Призначені мені",
|
||||
"FILTER_LABELS": "Filter by labels (optional)",
|
||||
"EXCLUDE_LABELS": "Exclude labels (optional)",
|
||||
"HOW_TO_GET_TOKEN": "Як отримати токен?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Підсумок",
|
||||
"STATE": "Статус",
|
||||
"ASSIGNEE": "Виконавець",
|
||||
"LABELS": "Мітки",
|
||||
"DESCRIPTION": "Опис"
|
||||
},
|
||||
"FORM_HELP": "<p>Тут ви можете налаштувати SuperProductivity для відображення відкритих завдань Gitea для конкретного репозиторію в панелі створення завдань у вікні щоденного планування. Вони будуть показані як пропозиції та надаватимуть посилання на завдання, а також додаткову інформацію про нього.</p> <p>Крім того, ви можете автоматично додавати та імпортувати всі відкриті завдання.</p><p>Щоб обійти обмеження використання та отримати доступ, ви можете надати токен доступу."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/vi.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/vi.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "Máy chủ (ví dụ: https://try.gitea.io)",
|
||||
"TOKEN": "Token truy cập",
|
||||
"REPO_FULL_NAME": "Tên người dùng hoặc Tổ chức/kho lưu trữ",
|
||||
"SCOPE": "Phạm vi",
|
||||
"SCOPE_ALL": "Tất cả",
|
||||
"SCOPE_CREATED": "Do tôi tạo",
|
||||
"SCOPE_ASSIGNED": "Được giao cho tôi",
|
||||
"FILTER_LABELS": "Lọc theo nhãn (tùy chọn)",
|
||||
"EXCLUDE_LABELS": "Loại trừ nhãn (tùy chọn)",
|
||||
"HOW_TO_GET_TOKEN": "Cách lấy token?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Tóm tắt",
|
||||
"STATE": "Trạng thái",
|
||||
"ASSIGNEE": "Người được giao",
|
||||
"LABELS": "Nhãn",
|
||||
"DESCRIPTION": "Mô tả"
|
||||
},
|
||||
"FORM_HELP": "<p>Tại đây bạn có thể cấu hình Super Productivity để liệt kê các sự cố Gitea mở cho một kho lưu trữ cụ thể trong bảng tạo công việc ở chế độ xem lên kế hoạch hàng ngày. Chúng sẽ được liệt kê làm gợi ý và cung cấp liên kết đến sự cố cũng như thêm thông tin về nó.</p><p>Ngoài ra, bạn có thể tự động thêm và nhập tất cả sự cố mở.</p><p>Để vượt qua giới hạn sử dụng và truy cập, bạn có thể cung cấp token truy cập."
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/zh-tw.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/zh-tw.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "主機(例如:https://try.gitea.io)",
|
||||
"TOKEN": "存取權杖",
|
||||
"REPO_FULL_NAME": "使用者名稱或組織名稱/專案",
|
||||
"SCOPE": "範圍",
|
||||
"SCOPE_ALL": "全部",
|
||||
"SCOPE_CREATED": "由我建立",
|
||||
"SCOPE_ASSIGNED": "指派給我",
|
||||
"FILTER_LABELS": "依標籤篩選(選填)",
|
||||
"EXCLUDE_LABELS": "排除標籤(選填)",
|
||||
"HOW_TO_GET_TOKEN": "如何取得權杖?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "摘要",
|
||||
"STATE": "狀態",
|
||||
"ASSIGNEE": "指派人",
|
||||
"LABELS": "標籤",
|
||||
"DESCRIPTION": "描述"
|
||||
},
|
||||
"FORM_HELP": "<p>在此您可以設定 Super Productivity 在每日規劃檢視的工作建立面板中列出特定程式碼庫的開放 Gitea 議題。它們將作為建議列出,並提供議題的連結以及更多相關資訊。</p> <p>此外,您可以自動新增和匯入所有開放議題。</p><p>為了繞過使用限制並存取,您可以提供存取權杖。"
|
||||
}
|
||||
22
packages/plugin-dev/gitea-issue-provider/i18n/zh.json
Normal file
22
packages/plugin-dev/gitea-issue-provider/i18n/zh.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"CFG": {
|
||||
"HOST": "主机(例如:https://try.gitea.io)",
|
||||
"TOKEN": "访问令牌",
|
||||
"REPO_FULL_NAME": "用户名或组织名称/项目",
|
||||
"SCOPE": "范围",
|
||||
"SCOPE_ALL": "全部",
|
||||
"SCOPE_CREATED": "由我创建",
|
||||
"SCOPE_ASSIGNED": "分配给我",
|
||||
"FILTER_LABELS": "按标签筛选(可选)",
|
||||
"EXCLUDE_LABELS": "排除标签(可选)",
|
||||
"HOW_TO_GET_TOKEN": "如何获取令牌?"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "摘要",
|
||||
"STATE": "状态",
|
||||
"ASSIGNEE": "负责人",
|
||||
"LABELS": "标签",
|
||||
"DESCRIPTION": "描述"
|
||||
},
|
||||
"FORM_HELP": "<p>在这里,您可以将 SuperProductivity 配置为在每日规划视图的任务创建看板中列出特定存储库的未结 Gitea 问题。它们将列为建议,并提供指向问题的链接以及有关它的更多信息。</p> <p>此外,您还可以自动添加和导入所有未结问题。</p><p>为了通过使用限制并访问,您可以提供一个访问令牌。"
|
||||
}
|
||||
1
packages/plugin-dev/gitea-issue-provider/icon.svg
Normal file
1
packages/plugin-dev/gitea-issue-provider/icon.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m4.186 5.421c-1.845-.004-4.316 1.169-4.18 4.11.213 4.594 4.92 5.02 6.801 5.057.206.862 2.42 3.834 4.059 3.99h7.18c4.306-.286 7.53-13.022 5.14-13.07-3.953.186-6.296.28-8.305.296v3.975l-.626-.277-.004-3.696c-2.306-.001-4.336-.108-8.189-.298-.482-.003-1.154-.085-1.876-.087zm.261 1.625h.22c.262 2.355.688 3.732 1.55 5.836-2.2-.26-4.072-.899-4.416-3.285-.178-1.235.422-2.524 2.646-2.552zm8.557 2.315c.15.002.303.03.447.096l.749.323-.537.979a.672.597 0 0 0 -.241.038.672.597 0 0 0 -.405.764.672.597 0 0 0 .112.174l-.926 1.686a.672.597 0 0 0 -.222.038.672.597 0 0 0 -.405.764.672.597 0 0 0 .86.36.672.597 0 0 0 .404-.765.672.597 0 0 0 -.158-.22l.902-1.642a.672.597 0 0 0 .293-.03.672.597 0 0 0 .213-.112c.348.146.633.265.838.366.308.152.417.253.45.365.033.11-.003.322-.177.694-.13.277-.345.67-.599 1.133a.672.597 0 0 0 -.251.038.672.597 0 0 0 -.405.764.672.597 0 0 0 .86.36.672.597 0 0 0 .404-.764.672.597 0 0 0 -.137-.202c.251-.458.467-.852.606-1.148.188-.402.286-.701.2-.99s-.35-.477-.7-.65c-.23-.113-.517-.233-.86-.377a.672.597 0 0 0 -.038-.239.672.597 0 0 0 -.145-.209l.528-.963 2.924 1.263c.528.229.746.79.49 1.26l-2.01 3.68c-.257.469-.888.663-1.416.435l-4.137-1.788c-.528-.228-.747-.79-.49-1.26l2.01-3.679c.176-.323.53-.515.905-.53h.064z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
532
packages/plugin-dev/gitea-issue-provider/package-lock.json
generated
Normal file
532
packages/plugin-dev/gitea-issue-provider/package-lock.json
generated
Normal file
|
|
@ -0,0 +1,532 @@
|
|||
{
|
||||
"name": "gitea-issue-provider",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gitea-issue-provider",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@super-productivity/plugin-api": "file:../../plugin-api"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.25.11",
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
},
|
||||
"../../plugin-api": {
|
||||
"name": "@super-productivity/plugin-api",
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
|
||||
"integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
|
||||
"integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
|
||||
"integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
|
||||
"integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openharmony"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@super-productivity/plugin-api": {
|
||||
"resolved": "../../plugin-api",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
|
||||
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.25.12",
|
||||
"@esbuild/android-arm": "0.25.12",
|
||||
"@esbuild/android-arm64": "0.25.12",
|
||||
"@esbuild/android-x64": "0.25.12",
|
||||
"@esbuild/darwin-arm64": "0.25.12",
|
||||
"@esbuild/darwin-x64": "0.25.12",
|
||||
"@esbuild/freebsd-arm64": "0.25.12",
|
||||
"@esbuild/freebsd-x64": "0.25.12",
|
||||
"@esbuild/linux-arm": "0.25.12",
|
||||
"@esbuild/linux-arm64": "0.25.12",
|
||||
"@esbuild/linux-ia32": "0.25.12",
|
||||
"@esbuild/linux-loong64": "0.25.12",
|
||||
"@esbuild/linux-mips64el": "0.25.12",
|
||||
"@esbuild/linux-ppc64": "0.25.12",
|
||||
"@esbuild/linux-riscv64": "0.25.12",
|
||||
"@esbuild/linux-s390x": "0.25.12",
|
||||
"@esbuild/linux-x64": "0.25.12",
|
||||
"@esbuild/netbsd-arm64": "0.25.12",
|
||||
"@esbuild/netbsd-x64": "0.25.12",
|
||||
"@esbuild/openbsd-arm64": "0.25.12",
|
||||
"@esbuild/openbsd-x64": "0.25.12",
|
||||
"@esbuild/openharmony-arm64": "0.25.12",
|
||||
"@esbuild/sunos-x64": "0.25.12",
|
||||
"@esbuild/win32-arm64": "0.25.12",
|
||||
"@esbuild/win32-ia32": "0.25.12",
|
||||
"@esbuild/win32-x64": "0.25.12"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
packages/plugin-dev/gitea-issue-provider/package.json
Normal file
17
packages/plugin-dev/gitea-issue-provider/package.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "gitea-issue-provider",
|
||||
"version": "1.0.0",
|
||||
"description": "Gitea issue provider plugin",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.25.11",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@super-productivity/plugin-api": "file:../../plugin-api"
|
||||
}
|
||||
}
|
||||
67
packages/plugin-dev/gitea-issue-provider/scripts/build.js
Normal file
67
packages/plugin-dev/gitea-issue-provider/scripts/build.js
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { build } = require('esbuild');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, '..');
|
||||
const SRC_DIR = path.join(ROOT_DIR, 'src');
|
||||
const DIST_DIR = path.join(ROOT_DIR, 'dist');
|
||||
const I18N_SRC = path.join(ROOT_DIR, 'i18n');
|
||||
const I18N_DIST = path.join(DIST_DIR, 'i18n');
|
||||
|
||||
async function buildPlugin() {
|
||||
console.log('Building gitea-issue-provider...');
|
||||
|
||||
if (fs.existsSync(DIST_DIR)) {
|
||||
fs.rmSync(DIST_DIR, { recursive: true });
|
||||
}
|
||||
fs.mkdirSync(DIST_DIR);
|
||||
|
||||
// Build TypeScript to IIFE bundle
|
||||
await build({
|
||||
entryPoints: [path.join(SRC_DIR, 'plugin.ts')],
|
||||
bundle: true,
|
||||
outfile: path.join(DIST_DIR, 'plugin.js'),
|
||||
platform: 'browser',
|
||||
target: 'es2020',
|
||||
format: 'iife',
|
||||
define: {
|
||||
'process.env.NODE_ENV': '"production"',
|
||||
},
|
||||
logLevel: 'info',
|
||||
minify: true,
|
||||
sourcemap: false,
|
||||
});
|
||||
|
||||
// Copy manifest.json
|
||||
fs.copyFileSync(
|
||||
path.join(SRC_DIR, 'manifest.json'),
|
||||
path.join(DIST_DIR, 'manifest.json'),
|
||||
);
|
||||
|
||||
// Copy icon.svg if present
|
||||
const iconSrc = path.join(ROOT_DIR, 'icon.svg');
|
||||
if (fs.existsSync(iconSrc)) {
|
||||
fs.copyFileSync(iconSrc, path.join(DIST_DIR, 'icon.svg'));
|
||||
console.log('Copied icon.svg');
|
||||
}
|
||||
|
||||
// Copy i18n files
|
||||
if (fs.existsSync(I18N_SRC)) {
|
||||
fs.mkdirSync(I18N_DIST, { recursive: true });
|
||||
for (const file of fs.readdirSync(I18N_SRC)) {
|
||||
if (file.endsWith('.json')) {
|
||||
fs.copyFileSync(path.join(I18N_SRC, file), path.join(I18N_DIST, file));
|
||||
}
|
||||
}
|
||||
console.log('Copied i18n files');
|
||||
}
|
||||
|
||||
console.log('Build complete!');
|
||||
}
|
||||
|
||||
buildPlugin().catch((err) => {
|
||||
console.error('Build failed:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
57
packages/plugin-dev/gitea-issue-provider/src/manifest.json
Normal file
57
packages/plugin-dev/gitea-issue-provider/src/manifest.json
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
"id": "gitea-issue-provider",
|
||||
"name": "Gitea Issues",
|
||||
"version": "1.0.0",
|
||||
"manifestVersion": 1,
|
||||
"minSupVersion": "13.0.0",
|
||||
"description": "Gitea issue provider plugin",
|
||||
"author": "Super Productivity",
|
||||
"type": "issueProvider",
|
||||
"icon": "icon.svg",
|
||||
"iFrame": false,
|
||||
"permissions": [],
|
||||
"hooks": [],
|
||||
"i18n": {
|
||||
"languages": [
|
||||
"ar",
|
||||
"cs",
|
||||
"de",
|
||||
"en",
|
||||
"es",
|
||||
"fa",
|
||||
"fi",
|
||||
"fr",
|
||||
"hr",
|
||||
"id",
|
||||
"it",
|
||||
"ja",
|
||||
"ko",
|
||||
"nb",
|
||||
"nl",
|
||||
"pl",
|
||||
"pt",
|
||||
"pt-br",
|
||||
"ro",
|
||||
"ro-md",
|
||||
"ru",
|
||||
"sk",
|
||||
"sv",
|
||||
"tr",
|
||||
"uk",
|
||||
"vi",
|
||||
"zh",
|
||||
"zh-tw"
|
||||
]
|
||||
},
|
||||
"issueProvider": {
|
||||
"pollIntervalMs": 300000,
|
||||
"icon": "gitea",
|
||||
"humanReadableName": "Gitea",
|
||||
"issueProviderKey": "GITEA",
|
||||
"allowPrivateNetwork": true,
|
||||
"issueStrings": {
|
||||
"singular": "Issue",
|
||||
"plural": "Issues"
|
||||
}
|
||||
}
|
||||
}
|
||||
371
packages/plugin-dev/gitea-issue-provider/src/plugin.ts
Normal file
371
packages/plugin-dev/gitea-issue-provider/src/plugin.ts
Normal file
|
|
@ -0,0 +1,371 @@
|
|||
import type {
|
||||
IssueProviderPluginDefinition,
|
||||
PluginFieldMapping,
|
||||
PluginHttp,
|
||||
PluginHttpOptions,
|
||||
PluginIssue,
|
||||
PluginSearchResult,
|
||||
} from '@super-productivity/plugin-api';
|
||||
|
||||
declare const PluginAPI: {
|
||||
registerIssueProvider(definition: IssueProviderPluginDefinition): void;
|
||||
translate(key: string, params?: Record<string, string | number>): string;
|
||||
};
|
||||
|
||||
const API_SUFFIX = 'api';
|
||||
const API_VERSION = 'v1';
|
||||
|
||||
// Scope option values — must stay identical to the built-in provider's stored
|
||||
// config so existing (migrated) providers keep working.
|
||||
const SCOPE_CREATED_BY_ME = 'created-by-me';
|
||||
const SCOPE_ASSIGNED_TO_ME = 'assigned-to-me';
|
||||
|
||||
interface GiteaConfig {
|
||||
host?: string;
|
||||
token?: string;
|
||||
repoFullname?: string;
|
||||
scope?: string;
|
||||
filterLabels?: string;
|
||||
excludeLabels?: string;
|
||||
}
|
||||
|
||||
interface GiteaUser {
|
||||
avatar_url: string;
|
||||
id: number;
|
||||
username: string;
|
||||
login: string;
|
||||
full_name: string;
|
||||
}
|
||||
|
||||
interface GiteaLabel {
|
||||
id: number;
|
||||
name: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
interface GiteaRepositoryReduced {
|
||||
id: number;
|
||||
full_name: string;
|
||||
}
|
||||
|
||||
interface GiteaIssue {
|
||||
id: number;
|
||||
number: number;
|
||||
url: string;
|
||||
html_url: string;
|
||||
title: string;
|
||||
body: string;
|
||||
state: string;
|
||||
labels: GiteaLabel[];
|
||||
user: GiteaUser | null;
|
||||
assignee: GiteaUser | null;
|
||||
assignees: GiteaUser[] | null;
|
||||
comments: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
closed_at: string | null;
|
||||
repository: GiteaRepositoryReduced | null;
|
||||
}
|
||||
|
||||
interface GiteaComment {
|
||||
id: number;
|
||||
body: string;
|
||||
created_at: string;
|
||||
user: GiteaUser | null;
|
||||
}
|
||||
|
||||
const t = (key: string): string => {
|
||||
try {
|
||||
return PluginAPI.translate(key);
|
||||
} catch {
|
||||
return key;
|
||||
}
|
||||
};
|
||||
|
||||
const baseUrl = (cfg: GiteaConfig): string => {
|
||||
const host = (cfg.host || '').replace(/\/+$/, '');
|
||||
if (!host) {
|
||||
throw new Error('Gitea host is not configured.');
|
||||
}
|
||||
return `${host}/${API_SUFFIX}/${API_VERSION}`;
|
||||
};
|
||||
|
||||
// Auth is sent as `Authorization: token <token>` (a Gitea-supported scheme),
|
||||
// which keeps the token out of request URLs / logs.
|
||||
const giteaHeaders = (cfg: GiteaConfig): Record<string, string> => {
|
||||
const headers: Record<string, string> = { accept: 'application/json' };
|
||||
if (cfg.token) {
|
||||
headers['Authorization'] = `token ${cfg.token}`;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
|
||||
const parseLabelList = (raw: string | undefined): string[] =>
|
||||
(raw ?? '')
|
||||
.split(',')
|
||||
.map((l) => l.trim())
|
||||
.filter((l) => l.length > 0);
|
||||
|
||||
// Gitea/Forgejo's two issue endpoints historically disagree on whether a
|
||||
// `labels=a,b` query means AND or OR (see go-gitea/gitea#33509). We always
|
||||
// filter labels client-side so behavior is consistent regardless of server.
|
||||
const hasAllLabels = (issue: GiteaIssue, required: readonly string[]): boolean => {
|
||||
if (required.length === 0) {
|
||||
return true;
|
||||
}
|
||||
const names = new Set((issue.labels ?? []).map((l) => l.name));
|
||||
return required.every((name) => names.has(name));
|
||||
};
|
||||
|
||||
const isIssueIncludedByLabels = (
|
||||
issue: GiteaIssue,
|
||||
excluded: readonly string[],
|
||||
): boolean => {
|
||||
if (excluded.length === 0) {
|
||||
return true;
|
||||
}
|
||||
const names = new Set((issue.labels ?? []).map((l) => l.name));
|
||||
return !excluded.some((name) => names.has(name));
|
||||
};
|
||||
|
||||
const issueAssignees = (issue: GiteaIssue): string[] =>
|
||||
(issue.assignees ?? [])
|
||||
.map((a) => a.login || a.username)
|
||||
.filter((name): name is string => !!name);
|
||||
|
||||
const mapSearchResult = (issue: GiteaIssue): PluginSearchResult => ({
|
||||
// Gitea tracks issues by their per-repo `number`, not the global `id`.
|
||||
id: String(issue.number),
|
||||
title: `#${issue.number} ${issue.title}`,
|
||||
url: issue.html_url,
|
||||
status: issue.state,
|
||||
assignee: issue.assignee?.login || issue.assignee?.username,
|
||||
labels: (issue.labels ?? []).map((l) => l.name),
|
||||
});
|
||||
|
||||
PluginAPI.registerIssueProvider({
|
||||
configFields: [
|
||||
{
|
||||
key: 'host',
|
||||
type: 'input',
|
||||
label: t('CFG.HOST'),
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
key: 'token',
|
||||
type: 'password',
|
||||
label: t('CFG.TOKEN'),
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
key: 'tokenHelp',
|
||||
type: 'link',
|
||||
label: t('CFG.HOW_TO_GET_TOKEN'),
|
||||
url: 'https://docs.gitea.com/development/api-usage#generating-and-listing-api-tokens',
|
||||
},
|
||||
{
|
||||
key: 'repoFullname',
|
||||
type: 'input',
|
||||
label: t('CFG.REPO_FULL_NAME'),
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
key: 'scope',
|
||||
type: 'select',
|
||||
label: t('CFG.SCOPE'),
|
||||
required: true,
|
||||
options: [
|
||||
{ value: 'all', label: t('CFG.SCOPE_ALL') },
|
||||
{ value: SCOPE_CREATED_BY_ME, label: t('CFG.SCOPE_CREATED') },
|
||||
{ value: SCOPE_ASSIGNED_TO_ME, label: t('CFG.SCOPE_ASSIGNED') },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'filterLabels',
|
||||
type: 'input',
|
||||
label: t('CFG.FILTER_LABELS'),
|
||||
advanced: true,
|
||||
},
|
||||
{
|
||||
key: 'excludeLabels',
|
||||
type: 'input',
|
||||
label: t('CFG.EXCLUDE_LABELS'),
|
||||
advanced: true,
|
||||
},
|
||||
],
|
||||
|
||||
getHeaders(config: Record<string, unknown>): Record<string, string> {
|
||||
return giteaHeaders(config as unknown as GiteaConfig);
|
||||
},
|
||||
|
||||
async searchIssues(
|
||||
searchTerm: string,
|
||||
config: Record<string, unknown>,
|
||||
http: PluginHttp,
|
||||
): Promise<PluginSearchResult[]> {
|
||||
const cfg = config as unknown as GiteaConfig;
|
||||
const base = baseUrl(cfg);
|
||||
const includedLabels = parseLabelList(cfg.filterLabels);
|
||||
const excludedLabels = parseLabelList(cfg.excludeLabels);
|
||||
|
||||
// `priority_repo_id` is the only reliable way to scope the global issue
|
||||
// search to the configured repository, so look it up first.
|
||||
const repo = await http.get<GiteaRepositoryReduced>(
|
||||
`${base}/repos/${cfg.repoFullname}`,
|
||||
);
|
||||
|
||||
const params: Record<string, string> = {
|
||||
limit: '100',
|
||||
state: 'open',
|
||||
q: searchTerm,
|
||||
};
|
||||
if (repo?.id) {
|
||||
params['priority_repo_id'] = String(repo.id);
|
||||
}
|
||||
if (cfg.scope === SCOPE_CREATED_BY_ME) {
|
||||
params['created'] = 'true';
|
||||
} else if (cfg.scope === SCOPE_ASSIGNED_TO_ME) {
|
||||
params['assigned'] = 'true';
|
||||
}
|
||||
if (includedLabels.length > 0) {
|
||||
params['labels'] = includedLabels.join(',');
|
||||
}
|
||||
|
||||
const issues =
|
||||
(await http.get<GiteaIssue[]>(`${base}/repos/issues/search`, { params })) || [];
|
||||
return issues
|
||||
.filter((issue) => issue.repository?.full_name === cfg.repoFullname)
|
||||
.filter((issue) => hasAllLabels(issue, includedLabels))
|
||||
.filter((issue) => isIssueIncludedByLabels(issue, excludedLabels))
|
||||
.map(mapSearchResult);
|
||||
},
|
||||
|
||||
async getById(
|
||||
issueId: string,
|
||||
config: Record<string, unknown>,
|
||||
http: PluginHttp,
|
||||
): Promise<PluginIssue> {
|
||||
const cfg = config as unknown as GiteaConfig;
|
||||
const base = baseUrl(cfg);
|
||||
const issueUrl = `${base}/repos/${cfg.repoFullname}/issues/${issueId}`;
|
||||
const issue = await http.get<GiteaIssue>(issueUrl);
|
||||
|
||||
const result: PluginIssue = {
|
||||
id: String(issue.number),
|
||||
title: issue.title,
|
||||
body: issue.body || '',
|
||||
url: issue.html_url,
|
||||
state: issue.state,
|
||||
lastUpdated: new Date(issue.updated_at).getTime(),
|
||||
assignee: issue.assignee?.login || issue.assignee?.username,
|
||||
labels: (issue.labels ?? []).map((l) => l.name),
|
||||
comments: [],
|
||||
|
||||
// Extended fields for richer display
|
||||
number: issue.number,
|
||||
summary: `#${issue.number} ${issue.title}`,
|
||||
assignees: issueAssignees(issue),
|
||||
creator: issue.user?.login || issue.user?.username,
|
||||
creatorAvatarUrl: issue.user?.avatar_url,
|
||||
createdAt: new Date(issue.created_at).getTime(),
|
||||
closedAt: issue.closed_at ? new Date(issue.closed_at).getTime() : undefined,
|
||||
};
|
||||
|
||||
if (issue.comments > 0) {
|
||||
const commentsData = await http.get<GiteaComment[]>(`${issueUrl}/comments`);
|
||||
result.comments = (commentsData || []).map((c) => ({
|
||||
author: c.user?.login || c.user?.username || 'unknown',
|
||||
body: c.body || '',
|
||||
created: new Date(c.created_at).getTime(),
|
||||
avatarUrl: c.user?.avatar_url,
|
||||
}));
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
getIssueLink(issueId: string, config: Record<string, unknown>): string {
|
||||
const cfg = config as unknown as GiteaConfig;
|
||||
const host = (cfg.host || '').replace(/\/+$/, '');
|
||||
return `${host}/${cfg.repoFullname}/issues/${issueId}`;
|
||||
},
|
||||
|
||||
async testConnection(
|
||||
config: Record<string, unknown>,
|
||||
http: PluginHttp,
|
||||
): Promise<boolean> {
|
||||
const cfg = config as unknown as GiteaConfig;
|
||||
try {
|
||||
await http.get(`${baseUrl(cfg)}/repos/${cfg.repoFullname}`);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
async getNewIssuesForBacklog(
|
||||
config: Record<string, unknown>,
|
||||
http: PluginHttp,
|
||||
): Promise<PluginSearchResult[]> {
|
||||
const cfg = config as unknown as GiteaConfig;
|
||||
const base = baseUrl(cfg);
|
||||
const includedLabels = parseLabelList(cfg.filterLabels);
|
||||
const excludedLabels = parseLabelList(cfg.excludeLabels);
|
||||
|
||||
const params: Record<string, string> = { limit: '100', state: 'open' };
|
||||
if (cfg.scope === SCOPE_CREATED_BY_ME || cfg.scope === SCOPE_ASSIGNED_TO_ME) {
|
||||
const user = await http.get<GiteaUser>(`${base}/user`);
|
||||
if (cfg.scope === SCOPE_CREATED_BY_ME) {
|
||||
params['created_by'] = user.username;
|
||||
} else {
|
||||
params['assigned_by'] = user.username;
|
||||
}
|
||||
}
|
||||
if (includedLabels.length > 0) {
|
||||
params['labels'] = includedLabels.join(',');
|
||||
}
|
||||
|
||||
const opts: PluginHttpOptions = { params };
|
||||
const issues =
|
||||
(await http.get<GiteaIssue[]>(`${base}/repos/${cfg.repoFullname}/issues`, opts)) ||
|
||||
[];
|
||||
return issues
|
||||
.filter((issue) => hasAllLabels(issue, includedLabels))
|
||||
.filter((issue) => isIssueIncludedByLabels(issue, excludedLabels))
|
||||
.map(mapSearchResult);
|
||||
},
|
||||
|
||||
issueDisplay: [
|
||||
{ field: 'summary', label: t('DISPLAY.SUMMARY'), type: 'link', linkField: 'url' },
|
||||
{ field: 'state', label: t('DISPLAY.STATE'), type: 'text' },
|
||||
{ field: 'assignees', label: t('DISPLAY.ASSIGNEE'), type: 'list', hideEmpty: true },
|
||||
{ field: 'labels', label: t('DISPLAY.LABELS'), type: 'list', hideEmpty: true },
|
||||
{ field: 'body', label: t('DISPLAY.DESCRIPTION'), type: 'markdown' },
|
||||
],
|
||||
|
||||
commentsConfig: {
|
||||
authorField: 'author',
|
||||
bodyField: 'body',
|
||||
createdField: 'created',
|
||||
avatarField: 'avatarUrl',
|
||||
},
|
||||
|
||||
// Read-only provider: pull-only mappings drive remote-update detection only.
|
||||
fieldMappings: [
|
||||
{
|
||||
taskField: 'isDone',
|
||||
issueField: 'state',
|
||||
defaultDirection: 'pullOnly',
|
||||
toIssueValue: (taskValue: unknown): string => (taskValue ? 'closed' : 'open'),
|
||||
toTaskValue: (issueValue: unknown): boolean => issueValue === 'closed',
|
||||
},
|
||||
] satisfies PluginFieldMapping[],
|
||||
|
||||
extractSyncValues(issue: PluginIssue): Record<string, unknown> {
|
||||
return {
|
||||
state: issue.state,
|
||||
title: issue.title,
|
||||
body: issue.body,
|
||||
};
|
||||
},
|
||||
});
|
||||
16
packages/plugin-dev/gitea-issue-provider/tsconfig.json
Normal file
16
packages/plugin-dev/gitea-issue-provider/tsconfig.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
17
packages/plugin-dev/linear-issue-provider/i18n/en.json
Normal file
17
packages/plugin-dev/linear-issue-provider/i18n/en.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"CFG": {
|
||||
"API_KEY": "API Key",
|
||||
"TEAM_ID": "Team ID (optional, filter to a specific team)",
|
||||
"PROJECT_ID": "Project ID (optional, filter to a specific project)",
|
||||
"HOW_TO_GET_TOKEN": "Get your API key"
|
||||
},
|
||||
"DISPLAY": {
|
||||
"SUMMARY": "Summary",
|
||||
"STATE": "Status",
|
||||
"PRIORITY": "Priority",
|
||||
"ASSIGNEE": "Assignee",
|
||||
"LABELS": "Labels",
|
||||
"DESCRIPTION": "Description"
|
||||
},
|
||||
"FORM_HELP": "<p>Configure Super Productivity to list and import your assigned Linear issues in the task creation panel. They will be listed as suggestions with a link to the issue and more information about it.</p>"
|
||||
}
|
||||
1
packages/plugin-dev/linear-issue-provider/icon.svg
Normal file
1
packages/plugin-dev/linear-issue-provider/icon.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M1.22541 61.5228c-.2225-.9485.90748-1.5459 1.59638-.857L39.3342 97.1782c.6889.6889.0915 1.8189-.857 1.5964C20.0515 94.4522 5.54779 79.9485 1.22541 61.5228ZM.00189135 46.8891c-.01764375.2833.08887215.5599.28957165.7606L52.3503 99.7085c.2007.2007.4773.3075.7606.2896 2.3692-.1476 4.6938-.46 6.9624-.9259.7645-.157 1.0301-1.0963.4782-1.6481L2.57595 39.4485c-.55186-.5519-1.49117-.2863-1.648174.4782-.465915 2.2686-.77832 4.5932-.92588465 6.9624ZM4.21093 29.7054c-.16649.3738-.08169.8106.20765 1.1l64.77602 64.776c.2894.2894.7262.3742 1.1.2077 1.7861-.7956 3.5171-1.6927 5.1855-2.684.5521-.328.6373-1.0867.1832-1.5407L8.43566 24.3367c-.45409-.4541-1.21271-.3689-1.54074.1832-.99132 1.6684-1.88843 3.3994-2.68399 5.1855ZM12.6587 18.074c-.3701-.3701-.393-.9637-.0443-1.3541C21.7795 6.45931 35.1114 0 49.9519 0 77.5927 0 100 22.4073 100 50.0481c0 14.8405-6.4593 28.1724-16.7199 37.3375-.3903.3487-.984.3258-1.3542-.0443L12.6587 18.074Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1,009 B |
532
packages/plugin-dev/linear-issue-provider/package-lock.json
generated
Normal file
532
packages/plugin-dev/linear-issue-provider/package-lock.json
generated
Normal file
|
|
@ -0,0 +1,532 @@
|
|||
{
|
||||
"name": "linear-issue-provider",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "linear-issue-provider",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@super-productivity/plugin-api": "file:../../plugin-api"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.25.11",
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
},
|
||||
"../../plugin-api": {
|
||||
"name": "@super-productivity/plugin-api",
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
|
||||
"integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
|
||||
"integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
|
||||
"integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
|
||||
"integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
|
||||
"integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
|
||||
"integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openharmony"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
|
||||
"integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
|
||||
"integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
|
||||
"integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@super-productivity/plugin-api": {
|
||||
"resolved": "../../plugin-api",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
|
||||
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.25.12",
|
||||
"@esbuild/android-arm": "0.25.12",
|
||||
"@esbuild/android-arm64": "0.25.12",
|
||||
"@esbuild/android-x64": "0.25.12",
|
||||
"@esbuild/darwin-arm64": "0.25.12",
|
||||
"@esbuild/darwin-x64": "0.25.12",
|
||||
"@esbuild/freebsd-arm64": "0.25.12",
|
||||
"@esbuild/freebsd-x64": "0.25.12",
|
||||
"@esbuild/linux-arm": "0.25.12",
|
||||
"@esbuild/linux-arm64": "0.25.12",
|
||||
"@esbuild/linux-ia32": "0.25.12",
|
||||
"@esbuild/linux-loong64": "0.25.12",
|
||||
"@esbuild/linux-mips64el": "0.25.12",
|
||||
"@esbuild/linux-ppc64": "0.25.12",
|
||||
"@esbuild/linux-riscv64": "0.25.12",
|
||||
"@esbuild/linux-s390x": "0.25.12",
|
||||
"@esbuild/linux-x64": "0.25.12",
|
||||
"@esbuild/netbsd-arm64": "0.25.12",
|
||||
"@esbuild/netbsd-x64": "0.25.12",
|
||||
"@esbuild/openbsd-arm64": "0.25.12",
|
||||
"@esbuild/openbsd-x64": "0.25.12",
|
||||
"@esbuild/openharmony-arm64": "0.25.12",
|
||||
"@esbuild/sunos-x64": "0.25.12",
|
||||
"@esbuild/win32-arm64": "0.25.12",
|
||||
"@esbuild/win32-ia32": "0.25.12",
|
||||
"@esbuild/win32-x64": "0.25.12"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
packages/plugin-dev/linear-issue-provider/package.json
Normal file
17
packages/plugin-dev/linear-issue-provider/package.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "linear-issue-provider",
|
||||
"version": "1.0.0",
|
||||
"description": "Linear issue provider plugin",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.25.11",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@super-productivity/plugin-api": "file:../../plugin-api"
|
||||
}
|
||||
}
|
||||
67
packages/plugin-dev/linear-issue-provider/scripts/build.js
Normal file
67
packages/plugin-dev/linear-issue-provider/scripts/build.js
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { build } = require('esbuild');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, '..');
|
||||
const SRC_DIR = path.join(ROOT_DIR, 'src');
|
||||
const DIST_DIR = path.join(ROOT_DIR, 'dist');
|
||||
const I18N_SRC = path.join(ROOT_DIR, 'i18n');
|
||||
const I18N_DIST = path.join(DIST_DIR, 'i18n');
|
||||
|
||||
async function buildPlugin() {
|
||||
console.log('Building linear-issue-provider...');
|
||||
|
||||
if (fs.existsSync(DIST_DIR)) {
|
||||
fs.rmSync(DIST_DIR, { recursive: true });
|
||||
}
|
||||
fs.mkdirSync(DIST_DIR);
|
||||
|
||||
// Build TypeScript to IIFE bundle
|
||||
await build({
|
||||
entryPoints: [path.join(SRC_DIR, 'plugin.ts')],
|
||||
bundle: true,
|
||||
outfile: path.join(DIST_DIR, 'plugin.js'),
|
||||
platform: 'browser',
|
||||
target: 'es2020',
|
||||
format: 'iife',
|
||||
define: {
|
||||
'process.env.NODE_ENV': '"production"',
|
||||
},
|
||||
logLevel: 'info',
|
||||
minify: true,
|
||||
sourcemap: false,
|
||||
});
|
||||
|
||||
// Copy manifest.json
|
||||
fs.copyFileSync(
|
||||
path.join(SRC_DIR, 'manifest.json'),
|
||||
path.join(DIST_DIR, 'manifest.json'),
|
||||
);
|
||||
|
||||
// Copy icon.svg if present
|
||||
const iconSrc = path.join(ROOT_DIR, 'icon.svg');
|
||||
if (fs.existsSync(iconSrc)) {
|
||||
fs.copyFileSync(iconSrc, path.join(DIST_DIR, 'icon.svg'));
|
||||
console.log('Copied icon.svg');
|
||||
}
|
||||
|
||||
// Copy i18n files
|
||||
if (fs.existsSync(I18N_SRC)) {
|
||||
fs.mkdirSync(I18N_DIST, { recursive: true });
|
||||
for (const file of fs.readdirSync(I18N_SRC)) {
|
||||
if (file.endsWith('.json')) {
|
||||
fs.copyFileSync(path.join(I18N_SRC, file), path.join(I18N_DIST, file));
|
||||
}
|
||||
}
|
||||
console.log('Copied i18n files');
|
||||
}
|
||||
|
||||
console.log('Build complete!');
|
||||
}
|
||||
|
||||
buildPlugin().catch((err) => {
|
||||
console.error('Build failed:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
27
packages/plugin-dev/linear-issue-provider/src/manifest.json
Normal file
27
packages/plugin-dev/linear-issue-provider/src/manifest.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"id": "linear-issue-provider",
|
||||
"name": "Linear Issues",
|
||||
"version": "1.0.0",
|
||||
"manifestVersion": 1,
|
||||
"minSupVersion": "13.0.0",
|
||||
"description": "Linear issue provider plugin",
|
||||
"author": "Super Productivity",
|
||||
"type": "issueProvider",
|
||||
"icon": "icon.svg",
|
||||
"iFrame": false,
|
||||
"permissions": [],
|
||||
"hooks": [],
|
||||
"i18n": {
|
||||
"languages": ["en"]
|
||||
},
|
||||
"issueProvider": {
|
||||
"pollIntervalMs": 300000,
|
||||
"icon": "linear",
|
||||
"humanReadableName": "Linear",
|
||||
"issueProviderKey": "LINEAR",
|
||||
"issueStrings": {
|
||||
"singular": "Issue",
|
||||
"plural": "Issues"
|
||||
}
|
||||
}
|
||||
}
|
||||
319
packages/plugin-dev/linear-issue-provider/src/plugin.ts
Normal file
319
packages/plugin-dev/linear-issue-provider/src/plugin.ts
Normal file
|
|
@ -0,0 +1,319 @@
|
|||
import type {
|
||||
IssueProviderPluginDefinition,
|
||||
PluginFieldMapping,
|
||||
PluginHttp,
|
||||
PluginIssue,
|
||||
PluginSearchResult,
|
||||
} from '@super-productivity/plugin-api';
|
||||
|
||||
declare const PluginAPI: {
|
||||
registerIssueProvider(definition: IssueProviderPluginDefinition): void;
|
||||
translate(key: string, params?: Record<string, string | number>): string;
|
||||
};
|
||||
|
||||
const LINEAR_API_URL = 'https://api.linear.app/graphql';
|
||||
|
||||
// Linear workflow state types that mean "done" (matches the built-in provider).
|
||||
const DONE_STATE_TYPES = ['completed', 'canceled'];
|
||||
|
||||
interface LinearConfig {
|
||||
apiKey?: string;
|
||||
teamId?: string;
|
||||
projectId?: string;
|
||||
}
|
||||
|
||||
interface LinearGraphQLResponse<T = unknown> {
|
||||
data?: T;
|
||||
errors?: Array<{ message: string }>;
|
||||
}
|
||||
|
||||
interface LinearRawIssueReduced {
|
||||
id: string;
|
||||
identifier: string;
|
||||
number: number;
|
||||
title: string;
|
||||
updatedAt: string;
|
||||
url: string;
|
||||
state: { name: string; type: string };
|
||||
}
|
||||
|
||||
interface LinearRawIssue extends LinearRawIssueReduced {
|
||||
description?: string;
|
||||
priority: number;
|
||||
createdAt: string;
|
||||
completedAt?: string;
|
||||
canceledAt?: string;
|
||||
dueDate?: string;
|
||||
assignee?: { id: string; name: string; avatarUrl?: string };
|
||||
creator?: { id: string; name: string };
|
||||
labels?: { nodes: Array<{ id: string; name: string; color: string }> };
|
||||
comments?: {
|
||||
nodes: Array<{
|
||||
id: string;
|
||||
body: string;
|
||||
createdAt: string;
|
||||
user?: { id: string; name: string; avatarUrl?: string };
|
||||
}>;
|
||||
};
|
||||
}
|
||||
|
||||
const t = (key: string): string => {
|
||||
try {
|
||||
return PluginAPI.translate(key);
|
||||
} catch {
|
||||
return key;
|
||||
}
|
||||
};
|
||||
|
||||
const SEARCH_ISSUES_QUERY = `
|
||||
query SearchIssues($first: Int!, $team: TeamFilter, $project: NullableProjectFilter) {
|
||||
viewer {
|
||||
assignedIssues(
|
||||
first: $first,
|
||||
filter: {
|
||||
state: { type: { in: ["backlog", "unstarted", "started"] } },
|
||||
team: $team,
|
||||
project: $project
|
||||
}
|
||||
) {
|
||||
nodes {
|
||||
id identifier number title updatedAt url
|
||||
state { id name type }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const GET_ISSUE_QUERY = `
|
||||
query GetIssue($id: String!) {
|
||||
issue(id: $id) {
|
||||
id identifier number title description priority
|
||||
createdAt updatedAt completedAt canceledAt dueDate url
|
||||
state { id name type }
|
||||
team { id name key }
|
||||
assignee { id name avatarUrl }
|
||||
creator { id name }
|
||||
labels(first: 50) { nodes { id name color } }
|
||||
comments(first: 50) {
|
||||
nodes { id body createdAt user { id name avatarUrl } }
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const GET_VIEWER_QUERY = `query GetViewer { viewer { id name } }`;
|
||||
|
||||
const graphql = async <T>(
|
||||
http: PluginHttp,
|
||||
query: string,
|
||||
variables: Record<string, unknown>,
|
||||
): Promise<T> => {
|
||||
const res = await http.post<LinearGraphQLResponse<T>>(LINEAR_API_URL, {
|
||||
query,
|
||||
variables,
|
||||
});
|
||||
if (res?.errors?.length) {
|
||||
throw new Error(res.errors[0].message || 'Linear GraphQL error');
|
||||
}
|
||||
if (!res?.data) {
|
||||
throw new Error('No data returned from Linear');
|
||||
}
|
||||
return res.data;
|
||||
};
|
||||
|
||||
const mapReduced = (issue: LinearRawIssueReduced): PluginSearchResult => ({
|
||||
id: issue.id,
|
||||
title: `${issue.identifier} ${issue.title}`,
|
||||
url: issue.url,
|
||||
status: issue.state?.name,
|
||||
// Provider-specific fields used for display + isDone mapping.
|
||||
identifier: issue.identifier,
|
||||
stateType: issue.state?.type,
|
||||
});
|
||||
|
||||
const searchAssignedIssues = async (
|
||||
searchTerm: string,
|
||||
cfg: LinearConfig,
|
||||
http: PluginHttp,
|
||||
): Promise<PluginSearchResult[]> => {
|
||||
const variables: Record<string, unknown> = { first: 50 };
|
||||
// Deliberate behavior change from the built-in provider: the old
|
||||
// LinearApiService accepted teamId/projectId but its callers never passed
|
||||
// them, so the "filter to specific team/project" config fields were inert.
|
||||
// Here we honor them as the labels promise. Empty fields = no filter (the
|
||||
// common case), so this only narrows results for users who set a value.
|
||||
if (cfg.teamId) {
|
||||
variables.team = { id: { eq: cfg.teamId } };
|
||||
}
|
||||
if (cfg.projectId) {
|
||||
variables.project = { id: { eq: cfg.projectId } };
|
||||
}
|
||||
|
||||
const data = await graphql<{
|
||||
viewer: { assignedIssues: { nodes: LinearRawIssueReduced[] } };
|
||||
}>(http, SEARCH_ISSUES_QUERY, variables);
|
||||
|
||||
let issues = data.viewer?.assignedIssues?.nodes || [];
|
||||
const term = searchTerm.trim().toLowerCase();
|
||||
if (term) {
|
||||
issues = issues.filter(
|
||||
(issue) =>
|
||||
issue.title.toLowerCase().includes(term) ||
|
||||
issue.identifier.toLowerCase().includes(term),
|
||||
);
|
||||
}
|
||||
return issues.map(mapReduced);
|
||||
};
|
||||
|
||||
PluginAPI.registerIssueProvider({
|
||||
configFields: [
|
||||
{
|
||||
key: 'apiKey',
|
||||
type: 'password',
|
||||
label: t('CFG.API_KEY'),
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
key: 'apiKeyHelp',
|
||||
type: 'link',
|
||||
label: t('CFG.HOW_TO_GET_TOKEN'),
|
||||
url: 'https://linear.app/settings/account/security',
|
||||
},
|
||||
{
|
||||
key: 'teamId',
|
||||
type: 'input',
|
||||
label: t('CFG.TEAM_ID'),
|
||||
advanced: true,
|
||||
},
|
||||
{
|
||||
key: 'projectId',
|
||||
type: 'input',
|
||||
label: t('CFG.PROJECT_ID'),
|
||||
advanced: true,
|
||||
},
|
||||
],
|
||||
|
||||
getHeaders(config: Record<string, unknown>): Record<string, string> {
|
||||
const cfg = config as unknown as LinearConfig;
|
||||
return {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: cfg.apiKey || '',
|
||||
};
|
||||
},
|
||||
|
||||
searchIssues(
|
||||
searchTerm: string,
|
||||
config: Record<string, unknown>,
|
||||
http: PluginHttp,
|
||||
): Promise<PluginSearchResult[]> {
|
||||
return searchAssignedIssues(searchTerm, config as unknown as LinearConfig, http);
|
||||
},
|
||||
|
||||
async getById(
|
||||
issueId: string,
|
||||
_config: Record<string, unknown>,
|
||||
http: PluginHttp,
|
||||
): Promise<PluginIssue> {
|
||||
const data = await graphql<{ issue: LinearRawIssue | null }>(http, GET_ISSUE_QUERY, {
|
||||
id: issueId,
|
||||
});
|
||||
const issue = data.issue;
|
||||
if (!issue) {
|
||||
throw new Error('No issue data returned from Linear');
|
||||
}
|
||||
|
||||
return {
|
||||
id: issue.id,
|
||||
title: issue.title,
|
||||
body: issue.description || '',
|
||||
url: issue.url,
|
||||
state: issue.state?.name,
|
||||
lastUpdated: new Date(issue.updatedAt).getTime(),
|
||||
assignee: issue.assignee?.name,
|
||||
labels: (issue.labels?.nodes || []).map((l) => l.name),
|
||||
comments: (issue.comments?.nodes || [])
|
||||
.filter((c) => !!c.user)
|
||||
.map((c) => ({
|
||||
author: c.user!.name,
|
||||
body: c.body || '',
|
||||
created: new Date(c.createdAt).getTime(),
|
||||
avatarUrl: c.user!.avatarUrl,
|
||||
})),
|
||||
|
||||
// Extended fields for display + isDone mapping.
|
||||
identifier: issue.identifier,
|
||||
number: issue.number,
|
||||
summary: `${issue.identifier} ${issue.title}`,
|
||||
stateType: issue.state?.type,
|
||||
priority: issue.priority,
|
||||
creator: issue.creator?.name,
|
||||
createdAt: new Date(issue.createdAt).getTime(),
|
||||
completedAt: issue.completedAt ? new Date(issue.completedAt).getTime() : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
// Linear issue URLs require the workspace slug, which can't be derived from the
|
||||
// id + config alone. Returning '' makes the adapter fall back to getById().url,
|
||||
// matching the built-in provider's behavior.
|
||||
getIssueLink(): string {
|
||||
return '';
|
||||
},
|
||||
|
||||
async testConnection(
|
||||
_config: Record<string, unknown>,
|
||||
http: PluginHttp,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
await graphql(http, GET_VIEWER_QUERY, {});
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
getNewIssuesForBacklog(
|
||||
config: Record<string, unknown>,
|
||||
http: PluginHttp,
|
||||
): Promise<PluginSearchResult[]> {
|
||||
return searchAssignedIssues('', config as unknown as LinearConfig, http);
|
||||
},
|
||||
|
||||
issueDisplay: [
|
||||
{ field: 'summary', label: t('DISPLAY.SUMMARY'), type: 'link', linkField: 'url' },
|
||||
{ field: 'state', label: t('DISPLAY.STATE'), type: 'text', hideEmpty: true },
|
||||
{ field: 'priority', label: t('DISPLAY.PRIORITY'), type: 'text', hideEmpty: true },
|
||||
{ field: 'assignee', label: t('DISPLAY.ASSIGNEE'), type: 'text', hideEmpty: true },
|
||||
{ field: 'labels', label: t('DISPLAY.LABELS'), type: 'list', hideEmpty: true },
|
||||
{ field: 'body', label: t('DISPLAY.DESCRIPTION'), type: 'markdown' },
|
||||
],
|
||||
|
||||
commentsConfig: {
|
||||
authorField: 'author',
|
||||
bodyField: 'body',
|
||||
createdField: 'created',
|
||||
avatarField: 'avatarUrl',
|
||||
},
|
||||
|
||||
// Read-only provider: pull-only mapping drives remote-update detection only.
|
||||
fieldMappings: [
|
||||
{
|
||||
taskField: 'isDone',
|
||||
issueField: 'stateType',
|
||||
defaultDirection: 'pullOnly',
|
||||
toIssueValue: (taskValue: unknown): string =>
|
||||
taskValue ? 'completed' : 'unstarted',
|
||||
toTaskValue: (issueValue: unknown): boolean =>
|
||||
DONE_STATE_TYPES.includes(issueValue as string),
|
||||
},
|
||||
] satisfies PluginFieldMapping[],
|
||||
|
||||
extractSyncValues(issue: PluginIssue): Record<string, unknown> {
|
||||
return {
|
||||
stateType: issue.stateType,
|
||||
title: issue.title,
|
||||
body: issue.body,
|
||||
};
|
||||
},
|
||||
});
|
||||
16
packages/plugin-dev/linear-issue-provider/tsconfig.json
Normal file
16
packages/plugin-dev/linear-issue-provider/tsconfig.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
|
@ -105,22 +105,8 @@
|
|||
<mat-icon svgIcon="open_project"></mat-icon>
|
||||
<span>Open Project</span>
|
||||
</button>
|
||||
<button
|
||||
class="provider-tile focus-ring"
|
||||
type="button"
|
||||
(click)="openSetupDialog('GITEA')"
|
||||
>
|
||||
<mat-icon svgIcon="gitea"></mat-icon>
|
||||
<span>Gitea</span>
|
||||
</button>
|
||||
<button
|
||||
class="provider-tile focus-ring"
|
||||
type="button"
|
||||
(click)="openSetupDialog('LINEAR')"
|
||||
>
|
||||
<mat-icon svgIcon="linear"></mat-icon>
|
||||
<span>Linear</span>
|
||||
</button>
|
||||
<!-- Gitea and Linear are bundled plugins now — rendered via the
|
||||
pluginProviders / disabledPluginProviders loops below (like GitHub). -->
|
||||
<button
|
||||
class="provider-tile focus-ring"
|
||||
type="button"
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ import {
|
|||
import { JIRA_ISSUE_CONTENT_CONFIG } from '../providers/jira/jira-issue-content.const';
|
||||
import { GITLAB_ISSUE_CONTENT_CONFIG } from '../providers/gitlab/gitlab-issue-content.const';
|
||||
import { CALDAV_ISSUE_CONTENT_CONFIG } from '../providers/caldav/caldav-issue-content.const';
|
||||
import { GITEA_ISSUE_CONTENT_CONFIG } from '../providers/gitea/gitea-issue-content.const';
|
||||
// Gitea is now a plugin — content config lives in the plugin's issueDisplay
|
||||
import { REDMINE_ISSUE_CONTENT_CONFIG } from '../providers/redmine/redmine-issue-content.const';
|
||||
import { OPEN_PROJECT_ISSUE_CONTENT_CONFIG } from '../providers/open-project/open-project-issue-content.const';
|
||||
import { TRELLO_ISSUE_CONTENT_CONFIG } from '../providers/trello/trello-issue-content.const';
|
||||
import { LINEAR_ISSUE_CONTENT_CONFIG } from '../providers/linear/linear-issue-content.const';
|
||||
// Linear is now a plugin — content config lives in the plugin's issueDisplay
|
||||
import { AZURE_DEVOPS_ISSUE_CONTENT_CONFIG } from '../providers/azure-devops/azure-devops-issue/azure-devops-issue-content.const';
|
||||
import { NEXTCLOUD_DECK_ISSUE_CONTENT_CONFIG } from '../providers/nextcloud-deck/nextcloud-deck-issue-content.const';
|
||||
|
||||
|
|
@ -26,11 +26,9 @@ export const ISSUE_CONTENT_CONFIGS: Record<
|
|||
GITLAB: GITLAB_ISSUE_CONTENT_CONFIG,
|
||||
JIRA: JIRA_ISSUE_CONTENT_CONFIG,
|
||||
CALDAV: CALDAV_ISSUE_CONTENT_CONFIG,
|
||||
GITEA: GITEA_ISSUE_CONTENT_CONFIG,
|
||||
REDMINE: REDMINE_ISSUE_CONTENT_CONFIG,
|
||||
OPEN_PROJECT: OPEN_PROJECT_ISSUE_CONTENT_CONFIG,
|
||||
TRELLO: TRELLO_ISSUE_CONTENT_CONFIG,
|
||||
LINEAR: LINEAR_ISSUE_CONTENT_CONFIG,
|
||||
AZURE_DEVOPS: AZURE_DEVOPS_ISSUE_CONTENT_CONFIG,
|
||||
NEXTCLOUD_DECK: NEXTCLOUD_DECK_ISSUE_CONTENT_CONFIG,
|
||||
ICAL: {
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@ import {
|
|||
OPEN_PROJECT_CONFIG_FORM_SECTION,
|
||||
} from './providers/open-project/open-project.const';
|
||||
import { T } from '../../t.const';
|
||||
import {
|
||||
DEFAULT_GITEA_CFG,
|
||||
GITEA_CONFIG_FORM_SECTION,
|
||||
} from './providers/gitea/gitea.const';
|
||||
// Gitea is now a plugin — no built-in config needed
|
||||
import {
|
||||
DEFAULT_REDMINE_CFG,
|
||||
REDMINE_CONFIG_FORM_SECTION,
|
||||
|
|
@ -34,10 +31,7 @@ import {
|
|||
DEFAULT_TRELLO_CFG,
|
||||
TRELLO_CONFIG_FORM_SECTION,
|
||||
} from './providers/trello/trello.const';
|
||||
import {
|
||||
DEFAULT_LINEAR_CFG,
|
||||
LINEAR_CONFIG_FORM_SECTION,
|
||||
} from './providers/linear/linear.const';
|
||||
// Linear is now a plugin — no built-in config needed
|
||||
// ClickUp is now a plugin — no built-in config needed
|
||||
import { AZURE_DEVOPS_INITIAL_CFG } from './providers/azure-devops/azure-devops.const';
|
||||
import { DEFAULT_NEXTCLOUD_DECK_CFG } from './providers/nextcloud-deck/nextcloud-deck.const';
|
||||
|
|
@ -51,11 +45,11 @@ export const GITHUB_TYPE: MigratedIssueProviderKey = 'GITHUB';
|
|||
export const JIRA_TYPE: BuiltInIssueProviderKey = 'JIRA';
|
||||
export const CALDAV_TYPE: BuiltInIssueProviderKey = 'CALDAV';
|
||||
export const OPEN_PROJECT_TYPE: BuiltInIssueProviderKey = 'OPEN_PROJECT';
|
||||
export const GITEA_TYPE: BuiltInIssueProviderKey = 'GITEA';
|
||||
export const GITEA_TYPE: MigratedIssueProviderKey = 'GITEA';
|
||||
export const REDMINE_TYPE: BuiltInIssueProviderKey = 'REDMINE';
|
||||
export const ICAL_TYPE: BuiltInIssueProviderKey = 'ICAL';
|
||||
export const TRELLO_TYPE: BuiltInIssueProviderKey = 'TRELLO';
|
||||
export const LINEAR_TYPE: BuiltInIssueProviderKey = 'LINEAR';
|
||||
export const LINEAR_TYPE: MigratedIssueProviderKey = 'LINEAR';
|
||||
export const CLICKUP_TYPE: MigratedIssueProviderKey = 'CLICKUP';
|
||||
export const AZURE_DEVOPS_TYPE: BuiltInIssueProviderKey = 'AZURE_DEVOPS';
|
||||
export const NEXTCLOUD_DECK_TYPE: BuiltInIssueProviderKey = 'NEXTCLOUD_DECK';
|
||||
|
|
@ -66,10 +60,8 @@ export const ISSUE_PROVIDER_TYPES: BuiltInIssueProviderKey[] = [
|
|||
CALDAV_TYPE,
|
||||
ICAL_TYPE,
|
||||
OPEN_PROJECT_TYPE,
|
||||
GITEA_TYPE,
|
||||
TRELLO_TYPE,
|
||||
REDMINE_TYPE,
|
||||
LINEAR_TYPE,
|
||||
AZURE_DEVOPS_TYPE,
|
||||
NEXTCLOUD_DECK_TYPE,
|
||||
] as const;
|
||||
|
|
@ -80,10 +72,8 @@ export const ISSUE_PROVIDER_ICON_MAP = {
|
|||
[CALDAV_TYPE]: 'caldav',
|
||||
[ICAL_TYPE]: 'calendar',
|
||||
[OPEN_PROJECT_TYPE]: 'open_project',
|
||||
[GITEA_TYPE]: 'gitea',
|
||||
[TRELLO_TYPE]: 'trello',
|
||||
[REDMINE_TYPE]: 'redmine',
|
||||
[LINEAR_TYPE]: 'linear',
|
||||
[AZURE_DEVOPS_TYPE]: 'azure_devops',
|
||||
[NEXTCLOUD_DECK_TYPE]: 'nextcloud_deck',
|
||||
} as const;
|
||||
|
|
@ -94,10 +84,8 @@ export const ISSUE_PROVIDER_HUMANIZED = {
|
|||
[CALDAV_TYPE]: 'CalDAV',
|
||||
[ICAL_TYPE]: 'Calendar',
|
||||
[OPEN_PROJECT_TYPE]: 'OpenProject',
|
||||
[GITEA_TYPE]: 'Gitea',
|
||||
[TRELLO_TYPE]: 'Trello',
|
||||
[REDMINE_TYPE]: 'Redmine',
|
||||
[LINEAR_TYPE]: 'Linear',
|
||||
[AZURE_DEVOPS_TYPE]: 'Azure DevOps',
|
||||
[NEXTCLOUD_DECK_TYPE]: 'Nextcloud Deck',
|
||||
} as const;
|
||||
|
|
@ -108,10 +96,8 @@ export const DEFAULT_ISSUE_PROVIDER_CFGS = {
|
|||
[CALDAV_TYPE]: DEFAULT_CALDAV_CFG,
|
||||
[ICAL_TYPE]: DEFAULT_CALENDAR_CFG,
|
||||
[OPEN_PROJECT_TYPE]: DEFAULT_OPEN_PROJECT_CFG,
|
||||
[GITEA_TYPE]: DEFAULT_GITEA_CFG,
|
||||
[TRELLO_TYPE]: DEFAULT_TRELLO_CFG,
|
||||
[REDMINE_TYPE]: DEFAULT_REDMINE_CFG,
|
||||
[LINEAR_TYPE]: DEFAULT_LINEAR_CFG,
|
||||
[AZURE_DEVOPS_TYPE]: AZURE_DEVOPS_INITIAL_CFG,
|
||||
[NEXTCLOUD_DECK_TYPE]: DEFAULT_NEXTCLOUD_DECK_CFG,
|
||||
} as const;
|
||||
|
|
@ -122,10 +108,8 @@ export const ISSUE_PROVIDER_FORM_CFGS_MAP = {
|
|||
[CALDAV_TYPE]: CALDAV_CONFIG_FORM_SECTION,
|
||||
[ICAL_TYPE]: CALENDAR_FORM_CFG_NEW as any,
|
||||
[OPEN_PROJECT_TYPE]: OPEN_PROJECT_CONFIG_FORM_SECTION,
|
||||
[GITEA_TYPE]: GITEA_CONFIG_FORM_SECTION,
|
||||
[TRELLO_TYPE]: TRELLO_CONFIG_FORM_SECTION,
|
||||
[REDMINE_TYPE]: REDMINE_CONFIG_FORM_SECTION,
|
||||
[LINEAR_TYPE]: LINEAR_CONFIG_FORM_SECTION,
|
||||
[AZURE_DEVOPS_TYPE]: AZURE_DEVOPS_CONFIG_FORM_SECTION,
|
||||
[NEXTCLOUD_DECK_TYPE]: NEXTCLOUD_DECK_CONFIG_FORM_SECTION,
|
||||
} as const;
|
||||
|
|
@ -150,10 +134,8 @@ export const ISSUE_STR_MAP: Record<
|
|||
ISSUE_STR: T.F.OPEN_PROJECT.ISSUE_STRINGS.ISSUE_STR,
|
||||
ISSUES_STR: T.F.OPEN_PROJECT.ISSUE_STRINGS.ISSUES_STR,
|
||||
},
|
||||
[GITEA_TYPE]: DEFAULT_ISSUE_STRS,
|
||||
[TRELLO_TYPE]: DEFAULT_ISSUE_STRS,
|
||||
[REDMINE_TYPE]: DEFAULT_ISSUE_STRS,
|
||||
[LINEAR_TYPE]: DEFAULT_ISSUE_STRS,
|
||||
[AZURE_DEVOPS_TYPE]: DEFAULT_ISSUE_STRS,
|
||||
[NEXTCLOUD_DECK_TYPE]: DEFAULT_ISSUE_STRS,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -9,14 +9,10 @@ import {
|
|||
OpenProjectWorkPackage,
|
||||
OpenProjectWorkPackageReduced,
|
||||
} from './providers/open-project/open-project-issue.model';
|
||||
import { GiteaCfg } from './providers/gitea/gitea.model';
|
||||
import { GiteaIssue } from './providers/gitea/gitea-issue.model';
|
||||
import { RedmineCfg } from './providers/redmine/redmine.model';
|
||||
import { RedmineIssue } from './providers/redmine/redmine-issue.model';
|
||||
import { TrelloCfg } from './providers/trello/trello.model';
|
||||
import { TrelloIssue, TrelloIssueReduced } from './providers/trello/trello-issue.model';
|
||||
import { LinearCfg } from './providers/linear/linear.model';
|
||||
import { LinearIssue, LinearIssueReduced } from './providers/linear/linear-issue.model';
|
||||
import { EntityState } from '@ngrx/entity';
|
||||
import {
|
||||
CalendarProviderCfg,
|
||||
|
|
@ -49,15 +45,13 @@ export type BuiltInIssueProviderKey =
|
|||
| 'CALDAV'
|
||||
| 'ICAL'
|
||||
| 'OPEN_PROJECT'
|
||||
| 'GITEA'
|
||||
| 'TRELLO'
|
||||
| 'REDMINE'
|
||||
| 'LINEAR'
|
||||
| 'AZURE_DEVOPS'
|
||||
| 'NEXTCLOUD_DECK';
|
||||
|
||||
// Keys migrated from built-in to plugin — still valid as IssueProviderKey
|
||||
export type MigratedIssueProviderKey = 'GITHUB' | 'CLICKUP';
|
||||
export type MigratedIssueProviderKey = 'GITHUB' | 'CLICKUP' | 'GITEA' | 'LINEAR';
|
||||
|
||||
// Plugin issue provider keys use a 'plugin:' prefix to avoid collision
|
||||
export type PluginIssueProviderKey = `plugin:${string}`;
|
||||
|
|
@ -80,10 +74,8 @@ const BUILT_IN_KEYS: ReadonlySet<string> = new Set<BuiltInIssueProviderKey>([
|
|||
'CALDAV',
|
||||
'ICAL',
|
||||
'OPEN_PROJECT',
|
||||
'GITEA',
|
||||
'TRELLO',
|
||||
'REDMINE',
|
||||
'LINEAR',
|
||||
'AZURE_DEVOPS',
|
||||
'NEXTCLOUD_DECK',
|
||||
]);
|
||||
|
|
@ -91,6 +83,8 @@ const BUILT_IN_KEYS: ReadonlySet<string> = new Set<BuiltInIssueProviderKey>([
|
|||
const MIGRATED_KEYS: ReadonlySet<string> = new Set<MigratedIssueProviderKey>([
|
||||
'GITHUB',
|
||||
'CLICKUP',
|
||||
'GITEA',
|
||||
'LINEAR',
|
||||
]);
|
||||
|
||||
export const isValidIssueProviderKey = (key: string): key is IssueProviderKey => {
|
||||
|
|
@ -103,10 +97,8 @@ export type IssueIntegrationCfg =
|
|||
| CaldavCfg
|
||||
| CalendarProviderCfg
|
||||
| OpenProjectCfg
|
||||
| GiteaCfg
|
||||
| TrelloCfg
|
||||
| RedmineCfg
|
||||
| LinearCfg
|
||||
| AzureDevOpsCfg
|
||||
| NextcloudDeckCfg;
|
||||
|
||||
|
|
@ -124,9 +116,7 @@ export interface IssueIntegrationCfgs {
|
|||
CALENDAR?: CalendarProviderCfg;
|
||||
OPEN_PROJECT?: OpenProjectCfg;
|
||||
TRELLO?: TrelloCfg;
|
||||
GITEA?: GiteaCfg;
|
||||
REDMINE?: RedmineCfg;
|
||||
LINEAR?: LinearCfg;
|
||||
AZURE_DEVOPS?: AzureDevOpsCfg;
|
||||
NEXTCLOUD_DECK?: NextcloudDeckCfg;
|
||||
}
|
||||
|
|
@ -137,10 +127,8 @@ export type IssueData =
|
|||
| CaldavIssue
|
||||
| ICalIssue
|
||||
| OpenProjectWorkPackage
|
||||
| GiteaIssue
|
||||
| RedmineIssue
|
||||
| TrelloIssue
|
||||
| LinearIssue
|
||||
| AzureDevOpsIssue
|
||||
| NextcloudDeckIssue
|
||||
| PluginIssue;
|
||||
|
|
@ -151,10 +139,8 @@ export type IssueDataReduced =
|
|||
| OpenProjectWorkPackageReduced
|
||||
| CaldavIssueReduced
|
||||
| ICalIssueReduced
|
||||
| GiteaIssue
|
||||
| RedmineIssue
|
||||
| TrelloIssueReduced
|
||||
| LinearIssueReduced
|
||||
| AzureDevOpsIssueReduced
|
||||
| NextcloudDeckIssueReduced
|
||||
| PluginSearchResult;
|
||||
|
|
@ -170,23 +156,19 @@ export type IssueDataReducedMap = {
|
|||
? ICalIssueReduced
|
||||
: K extends 'OPEN_PROJECT'
|
||||
? OpenProjectWorkPackageReduced
|
||||
: K extends 'GITEA'
|
||||
? GiteaIssue
|
||||
: K extends 'TRELLO'
|
||||
? TrelloIssueReduced
|
||||
: K extends 'REDMINE'
|
||||
? RedmineIssue
|
||||
: K extends 'LINEAR'
|
||||
? LinearIssueReduced
|
||||
: K extends 'AZURE_DEVOPS'
|
||||
? AzureDevOpsIssueReduced
|
||||
: K extends 'NEXTCLOUD_DECK'
|
||||
? NextcloudDeckIssueReduced
|
||||
: K extends MigratedIssueProviderKey
|
||||
? PluginSearchResult
|
||||
: K extends PluginIssueProviderKey
|
||||
? PluginSearchResult
|
||||
: never;
|
||||
: K extends 'TRELLO'
|
||||
? TrelloIssueReduced
|
||||
: K extends 'REDMINE'
|
||||
? RedmineIssue
|
||||
: K extends 'AZURE_DEVOPS'
|
||||
? AzureDevOpsIssueReduced
|
||||
: K extends 'NEXTCLOUD_DECK'
|
||||
? NextcloudDeckIssueReduced
|
||||
: K extends MigratedIssueProviderKey
|
||||
? PluginSearchResult
|
||||
: K extends PluginIssueProviderKey
|
||||
? PluginSearchResult
|
||||
: never;
|
||||
};
|
||||
|
||||
// TODO: add issue model to the IssueDataReducedMap
|
||||
|
|
@ -254,8 +236,10 @@ export interface IssueProviderOpenProject extends IssueProviderBase, OpenProject
|
|||
issueProviderKey: 'OPEN_PROJECT';
|
||||
}
|
||||
|
||||
export interface IssueProviderGitea extends IssueProviderBase, GiteaCfg {
|
||||
export interface IssueProviderGitea extends IssueProviderBase {
|
||||
issueProviderKey: 'GITEA';
|
||||
pluginId: string;
|
||||
pluginConfig: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface IssueProviderRedmine extends IssueProviderBase, RedmineCfg {
|
||||
|
|
@ -270,8 +254,10 @@ export interface IssueProviderTrello extends IssueProviderBase, TrelloCfg {
|
|||
issueProviderKey: 'TRELLO';
|
||||
}
|
||||
|
||||
export interface IssueProviderLinear extends IssueProviderBase, LinearCfg {
|
||||
export interface IssueProviderLinear extends IssueProviderBase {
|
||||
issueProviderKey: 'LINEAR';
|
||||
pluginId: string;
|
||||
pluginConfig: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface IssueProviderAzureDevOps extends IssueProviderBase, AzureDevOpsCfg {
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@ import { TrelloCommonInterfacesService } from './providers/trello/trello-common-
|
|||
import { GitlabCommonInterfacesService } from './providers/gitlab/gitlab-common-interfaces.service';
|
||||
import { CaldavCommonInterfacesService } from './providers/caldav/caldav-common-interfaces.service';
|
||||
import { OpenProjectCommonInterfacesService } from './providers/open-project/open-project-common-interfaces.service';
|
||||
import { GiteaCommonInterfacesService } from './providers/gitea/gitea-common-interfaces.service';
|
||||
import { RedmineCommonInterfacesService } from './providers/redmine/redmine-common-interfaces.service';
|
||||
import { LinearCommonInterfacesService } from './providers/linear/linear-common-interfaces.service';
|
||||
import { CalendarCommonInterfacesService } from './providers/calendar/calendar-common-interfaces.service';
|
||||
import { PluginIssueProviderAdapterService } from '../../plugins/issue-provider/plugin-issue-provider-adapter.service';
|
||||
import { PluginIssueProviderRegistryService } from '../../plugins/issue-provider/plugin-issue-provider-registry.service';
|
||||
|
|
@ -163,9 +161,7 @@ describe('IssueService', () => {
|
|||
provide: OpenProjectCommonInterfacesService,
|
||||
useValue: mockCommonInterfaceService,
|
||||
},
|
||||
{ provide: GiteaCommonInterfacesService, useValue: mockCommonInterfaceService },
|
||||
{ provide: RedmineCommonInterfacesService, useValue: mockCommonInterfaceService },
|
||||
{ provide: LinearCommonInterfacesService, useValue: mockCommonInterfaceService },
|
||||
{
|
||||
provide: CalendarCommonInterfacesService,
|
||||
useValue: mockCommonInterfaceService,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import { TaskAttachment } from '../tasks/task-attachment/task-attachment.model';
|
|||
import { firstValueFrom, forkJoin, from, merge, Observable, of, Subject } from 'rxjs';
|
||||
import {
|
||||
CALDAV_TYPE,
|
||||
GITEA_TYPE,
|
||||
GITLAB_TYPE,
|
||||
ICAL_TYPE,
|
||||
ISSUE_PROVIDER_HUMANIZED,
|
||||
|
|
@ -26,7 +25,6 @@ import {
|
|||
OPEN_PROJECT_TYPE,
|
||||
TRELLO_TYPE,
|
||||
REDMINE_TYPE,
|
||||
LINEAR_TYPE,
|
||||
AZURE_DEVOPS_TYPE,
|
||||
NEXTCLOUD_DECK_TYPE,
|
||||
} from './issue.const';
|
||||
|
|
@ -40,9 +38,9 @@ import { IssueLog } from '../../core/log';
|
|||
import { GitlabCommonInterfacesService } from './providers/gitlab/gitlab-common-interfaces.service';
|
||||
import { CaldavCommonInterfacesService } from './providers/caldav/caldav-common-interfaces.service';
|
||||
import { OpenProjectCommonInterfacesService } from './providers/open-project/open-project-common-interfaces.service';
|
||||
import { GiteaCommonInterfacesService } from './providers/gitea/gitea-common-interfaces.service';
|
||||
// Gitea is now a plugin — no built-in service needed
|
||||
import { RedmineCommonInterfacesService } from './providers/redmine/redmine-common-interfaces.service';
|
||||
import { LinearCommonInterfacesService } from './providers/linear/linear-common-interfaces.service';
|
||||
// Linear is now a plugin — no built-in service needed
|
||||
// ClickUp is now a plugin — no built-in service needed
|
||||
import { AzureDevOpsCommonInterfacesService } from './providers/azure-devops/azure-devops-common-interfaces.service';
|
||||
import { NextcloudDeckCommonInterfacesService } from './providers/nextcloud-deck/nextcloud-deck-common-interfaces.service';
|
||||
|
|
@ -79,9 +77,7 @@ export class IssueService {
|
|||
private _gitlabCommonInterfacesService = inject(GitlabCommonInterfacesService);
|
||||
private _caldavCommonInterfaceService = inject(CaldavCommonInterfacesService);
|
||||
private _openProjectInterfaceService = inject(OpenProjectCommonInterfacesService);
|
||||
private _giteaInterfaceService = inject(GiteaCommonInterfacesService);
|
||||
private _redmineInterfaceService = inject(RedmineCommonInterfacesService);
|
||||
private _linearCommonInterfaceService = inject(LinearCommonInterfacesService);
|
||||
private _azureDevOpsCommonInterfaceService = inject(AzureDevOpsCommonInterfacesService);
|
||||
private _nextcloudDeckCommonInterfaceService = inject(
|
||||
NextcloudDeckCommonInterfacesService,
|
||||
|
|
@ -104,10 +100,8 @@ export class IssueService {
|
|||
[JIRA_TYPE]: this._jiraCommonInterfacesService,
|
||||
[CALDAV_TYPE]: this._caldavCommonInterfaceService,
|
||||
[OPEN_PROJECT_TYPE]: this._openProjectInterfaceService,
|
||||
[GITEA_TYPE]: this._giteaInterfaceService,
|
||||
[REDMINE_TYPE]: this._redmineInterfaceService,
|
||||
[ICAL_TYPE]: this._calendarCommonInterfaceService,
|
||||
[LINEAR_TYPE]: this._linearCommonInterfaceService,
|
||||
[AZURE_DEVOPS_TYPE]: this._azureDevOpsCommonInterfaceService,
|
||||
[NEXTCLOUD_DECK_TYPE]: this._nextcloudDeckCommonInterfaceService,
|
||||
|
||||
|
|
|
|||
|
|
@ -55,8 +55,6 @@ export const getIssueProviderTooltip = (issueProvider: IssueProvider): string =>
|
|||
return issueProvider.host;
|
||||
case 'GITLAB':
|
||||
return issueProvider.project;
|
||||
case 'GITEA':
|
||||
return issueProvider.repoFullname;
|
||||
case 'CALDAV':
|
||||
return issueProvider.caldavUrl;
|
||||
case 'ICAL':
|
||||
|
|
@ -139,8 +137,6 @@ export const getIssueProviderInitials = (
|
|||
|
||||
case 'GITLAB':
|
||||
return getRepoInitials(issueProvider.project);
|
||||
case 'GITEA':
|
||||
return getRepoInitials(issueProvider.repoFullname);
|
||||
case 'TRELLO':
|
||||
return (issueProvider.boardName || issueProvider.boardId)
|
||||
?.substring(0, 2)
|
||||
|
|
@ -150,5 +146,4 @@ export const getIssueProviderInitials = (
|
|||
case 'AZURE_DEVOPS':
|
||||
return issueProvider.project?.substring(0, 2)?.toUpperCase() || 'AD';
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { SearchResultItem } from '../issue.model';
|
||||
import { isLinearIssueDone } from '../providers/linear/linear-issue-map.util';
|
||||
|
||||
const ISSUE_DONE_STATE_NAME_GUESSES = ['closed', 'done', 'completed', 'resolved'];
|
||||
|
||||
|
|
@ -10,11 +9,6 @@ export const isIssueDone = (searchResultItem: SearchResultItem): boolean => {
|
|||
(searchResultItem as SearchResultItem<'GITLAB'>).issueData.state === 'closed'
|
||||
);
|
||||
|
||||
case 'GITEA':
|
||||
return ISSUE_DONE_STATE_NAME_GUESSES.includes(
|
||||
(searchResultItem as SearchResultItem<'GITEA'>).issueData.state,
|
||||
);
|
||||
|
||||
case 'JIRA':
|
||||
return ISSUE_DONE_STATE_NAME_GUESSES.includes(
|
||||
(searchResultItem as SearchResultItem<'JIRA'>).issueData.status?.name,
|
||||
|
|
@ -31,11 +25,6 @@ export const isIssueDone = (searchResultItem: SearchResultItem): boolean => {
|
|||
case 'CALDAV':
|
||||
return false;
|
||||
|
||||
case 'LINEAR':
|
||||
return isLinearIssueDone(
|
||||
(searchResultItem as SearchResultItem<'LINEAR'>).issueData,
|
||||
);
|
||||
|
||||
default: {
|
||||
// Handle plugin providers and migrated providers (e.g. 'GITHUB')
|
||||
// PluginIssue uses 'state', PluginSearchResult uses 'status'
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
import { GiteaIssue } from './gitea-issue.model';
|
||||
import { truncate } from '../../../../util/truncate';
|
||||
|
||||
export const formatGiteaIssueTitle = ({ number, title }: GiteaIssue): string => {
|
||||
return `#${number} ${title}`;
|
||||
};
|
||||
|
||||
export const formatGiteaIssueTitleForSnack = (issue: GiteaIssue): string => {
|
||||
return `${truncate(formatGiteaIssueTitle(issue))}`;
|
||||
};
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import { GiteaIssueStateOptions } from './gitea-issue.model';
|
||||
|
||||
export type GiteaIssueState =
|
||||
| GiteaIssueStateOptions.open
|
||||
| GiteaIssueStateOptions.closed
|
||||
| GiteaIssueStateOptions.all;
|
||||
|
||||
export interface GiteaUser {
|
||||
avatar_url: string;
|
||||
id: number;
|
||||
username: string;
|
||||
login: string;
|
||||
full_name: string;
|
||||
}
|
||||
|
|
@ -1,296 +0,0 @@
|
|||
import { Injectable, inject } from '@angular/core';
|
||||
import { SnackService } from '../../../../core/snack/snack.service';
|
||||
import { HttpClient, HttpHeaders, HttpParams, HttpRequest } from '@angular/common/http';
|
||||
import { GiteaCfg } from './gitea.model';
|
||||
import { catchError, filter, map, switchMap } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
import { throwHandledError } from '../../../../util/throw-handled-error';
|
||||
import { T } from '../../../../t.const';
|
||||
import { GITEA_TYPE, ISSUE_PROVIDER_HUMANIZED } from '../../issue.const';
|
||||
import {
|
||||
GiteaIssue,
|
||||
GiteaIssueStateOptions,
|
||||
GiteaRepositoryReduced,
|
||||
} from './gitea-issue.model';
|
||||
import {
|
||||
hasAllLabels,
|
||||
isIssueFromProject,
|
||||
isIssueIncludedByLabels,
|
||||
mapGiteaIssueIdToIssueNumber,
|
||||
mapGiteaIssueToSearchResult,
|
||||
parseLabelList,
|
||||
} from './gitea-issue-map.util';
|
||||
import {
|
||||
GITEA_API_SUBPATH_REPO,
|
||||
GITEA_API_SUBPATH_USER,
|
||||
GITEA_API_SUFFIX,
|
||||
GITEA_API_VERSION,
|
||||
ScopeOptions,
|
||||
} from './gitea.const';
|
||||
import { SearchResultItem } from '../../issue.model';
|
||||
import { GiteaUser } from './gitea-api-responses';
|
||||
import { handleIssueProviderHttpError$ } from '../../handle-issue-provider-http-error';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class GiteaApiService {
|
||||
private _snackService = inject(SnackService);
|
||||
private _http = inject(HttpClient);
|
||||
|
||||
searchIssueForRepo$(searchText: string, cfg: GiteaCfg): Observable<SearchResultItem[]> {
|
||||
const includedLabelNames = parseLabelList(cfg.filterLabels);
|
||||
const excludedLabelNames = parseLabelList(cfg.excludeLabels);
|
||||
return this.getCurrentRepositoryFor$(cfg).pipe(
|
||||
switchMap((repository: GiteaRepositoryReduced) => {
|
||||
return this._sendRequest$(
|
||||
{
|
||||
url: this._getIssueSearchUrlFor(cfg),
|
||||
params: ParamsBuilder.create()
|
||||
.withLimit(100)
|
||||
.withState(GiteaIssueStateOptions.open)
|
||||
.withScopeForSearchFrom(cfg, repository)
|
||||
.withFilterLabels(cfg)
|
||||
.withSearchTerm(searchText)
|
||||
.build(),
|
||||
},
|
||||
cfg,
|
||||
).pipe(
|
||||
map((res: GiteaIssue[]) => {
|
||||
return res
|
||||
? res
|
||||
.filter((issue: GiteaIssue) => isIssueFromProject(issue, cfg))
|
||||
.filter((issue: GiteaIssue) => hasAllLabels(issue, includedLabelNames))
|
||||
.filter((issue: GiteaIssue) =>
|
||||
isIssueIncludedByLabels(issue, excludedLabelNames),
|
||||
)
|
||||
.map((issue: GiteaIssue) => mapGiteaIssueIdToIssueNumber(issue))
|
||||
.map((issue: GiteaIssue) => mapGiteaIssueToSearchResult(issue))
|
||||
: [];
|
||||
}),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private _getIssueSearchUrlFor(cfg: GiteaCfg): string {
|
||||
// see https://try.gitea.io/api/swagger#/issue
|
||||
return `${this._getBaseUrlFor(cfg)}/${GITEA_API_SUBPATH_REPO}/issues/search`;
|
||||
}
|
||||
|
||||
getLast100IssuesFor$(cfg: GiteaCfg): Observable<GiteaIssue[]> {
|
||||
const includedLabelNames = parseLabelList(cfg.filterLabels);
|
||||
const excludedLabelNames = parseLabelList(cfg.excludeLabels);
|
||||
return this.getLoggedUserFor$(cfg).pipe(
|
||||
switchMap((user: GiteaUser) => {
|
||||
return this._sendRequest$(
|
||||
{
|
||||
url: this._getIssueUrlFor(cfg),
|
||||
params: ParamsBuilder.create()
|
||||
.withLimit(100)
|
||||
.withState(GiteaIssueStateOptions.open)
|
||||
.withScopeFrom(cfg, user)
|
||||
.withFilterLabels(cfg)
|
||||
.build(),
|
||||
},
|
||||
cfg,
|
||||
).pipe(
|
||||
map((issues: GiteaIssue[]) => {
|
||||
return issues
|
||||
? issues
|
||||
.filter((issue: GiteaIssue) => hasAllLabels(issue, includedLabelNames))
|
||||
.filter((issue: GiteaIssue) =>
|
||||
isIssueIncludedByLabels(issue, excludedLabelNames),
|
||||
)
|
||||
.map((issue: GiteaIssue) => mapGiteaIssueIdToIssueNumber(issue))
|
||||
: [];
|
||||
}),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private _getIssueUrlFor(cfg: GiteaCfg): string {
|
||||
return `${this._getBaseUrlFor(cfg)}/${GITEA_API_SUBPATH_REPO}/${
|
||||
cfg.repoFullname
|
||||
}/issues`;
|
||||
}
|
||||
|
||||
getLoggedUserFor$(cfg: GiteaCfg): Observable<GiteaUser> {
|
||||
return this._sendRequest$(
|
||||
{
|
||||
url: this._getUserUrlFor(cfg),
|
||||
params: {},
|
||||
},
|
||||
cfg,
|
||||
).pipe(
|
||||
map((user: GiteaUser) => {
|
||||
return user;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private _getUserUrlFor(cfg: GiteaCfg): string {
|
||||
return `${this._getBaseUrlFor(cfg)}/${GITEA_API_SUBPATH_USER}`;
|
||||
}
|
||||
|
||||
getCurrentRepositoryFor$(cfg: GiteaCfg): Observable<GiteaRepositoryReduced> {
|
||||
return this._sendRequest$(
|
||||
{
|
||||
url: this._getRepositoryUrlFor(cfg),
|
||||
params: {},
|
||||
},
|
||||
cfg,
|
||||
).pipe(
|
||||
map((repository: GiteaRepositoryReduced) => {
|
||||
return repository;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private _getRepositoryUrlFor(cfg: GiteaCfg): string {
|
||||
return `${this._getBaseUrlFor(cfg)}/${GITEA_API_SUBPATH_REPO}/${cfg.repoFullname}`;
|
||||
}
|
||||
|
||||
private _getBaseUrlFor(cfg: GiteaCfg): string {
|
||||
return `${cfg.host}/${GITEA_API_SUFFIX}/${GITEA_API_VERSION}`;
|
||||
}
|
||||
|
||||
getById$(issueNumber: number, cfg: GiteaCfg): Observable<GiteaIssue> {
|
||||
return this._sendRequest$(
|
||||
{
|
||||
url: `${this._getIssueUrlFor(cfg)}/${issueNumber}`,
|
||||
},
|
||||
cfg,
|
||||
).pipe(map((issue) => issue));
|
||||
}
|
||||
|
||||
private _sendRequest$(
|
||||
params: HttpRequest<string> | any,
|
||||
cfg: GiteaCfg,
|
||||
): Observable<any> {
|
||||
this._checkSettings(cfg);
|
||||
params.params = { ...params.params, access_token: cfg.token };
|
||||
const p: HttpRequest<any> | any = {
|
||||
...params,
|
||||
method: params.method || 'GET',
|
||||
headers: {
|
||||
...(params.headers ? params.headers : { accept: 'application/json' }),
|
||||
},
|
||||
};
|
||||
|
||||
const bodyArg = params.data ? [params.data] : [];
|
||||
|
||||
const allArgs = [
|
||||
...bodyArg,
|
||||
{
|
||||
headers: new HttpHeaders(p.headers),
|
||||
params: new HttpParams({ fromObject: p.params }),
|
||||
reportProgress: false,
|
||||
observe: 'response',
|
||||
responseType: params.responseType,
|
||||
},
|
||||
];
|
||||
const req = new HttpRequest(p.method, p.url, ...allArgs);
|
||||
return this._http.request(req).pipe(
|
||||
// Filter out HttpEventType.Sent (type: 0) events to only process actual responses
|
||||
filter((res) => !(res === Object(res) && res.type === 0)),
|
||||
map((res: any) => (res && res.body ? res.body : res)),
|
||||
catchError((err) =>
|
||||
handleIssueProviderHttpError$(GITEA_TYPE, this._snackService, err),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
private _checkSettings(cfg: GiteaCfg): void {
|
||||
if (!this._isValidSettings(cfg)) {
|
||||
this._snackService.open({
|
||||
type: 'ERROR',
|
||||
msg: T.F.ISSUE.S.ERR_NOT_CONFIGURED,
|
||||
translateParams: {
|
||||
issueProviderName: ISSUE_PROVIDER_HUMANIZED[GITEA_TYPE],
|
||||
},
|
||||
});
|
||||
throwHandledError('Gitea: Not enough settings');
|
||||
}
|
||||
}
|
||||
|
||||
private _isValidSettings(cfg: GiteaCfg): boolean {
|
||||
return (
|
||||
!!cfg &&
|
||||
!!cfg.host &&
|
||||
cfg.host.length > 0 &&
|
||||
!!cfg.repoFullname &&
|
||||
cfg.repoFullname.length > 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ParamsBuilder {
|
||||
params: any = {};
|
||||
|
||||
static create(): ParamsBuilder {
|
||||
return new ParamsBuilder();
|
||||
}
|
||||
|
||||
withLimit(limit: number): ParamsBuilder {
|
||||
this.params['limit'] = limit;
|
||||
return this;
|
||||
}
|
||||
|
||||
withState(state: string): ParamsBuilder {
|
||||
this.params['state'] = state;
|
||||
return this;
|
||||
}
|
||||
|
||||
withScopeFrom(cfg: GiteaCfg, user: GiteaUser): ParamsBuilder {
|
||||
if (!cfg.scope) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (cfg.scope === ScopeOptions.createdByMe) {
|
||||
this.params['created_by'] = user.username;
|
||||
} else if (cfg.scope === ScopeOptions.assignedToMe) {
|
||||
this.params['assigned_by'] = user.username;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
withScopeForSearchFrom(
|
||||
cfg: GiteaCfg,
|
||||
repository: GiteaRepositoryReduced,
|
||||
): ParamsBuilder {
|
||||
if (!cfg.scope) {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Seens to be the only way to "filter" for the current repo
|
||||
if (repository.id) this.params['priority_repo_id'] = repository.id;
|
||||
|
||||
if (cfg.scope === ScopeOptions.createdByMe) {
|
||||
this.params['created'] = true;
|
||||
} else if (cfg.scope === ScopeOptions.assignedToMe) {
|
||||
this.params['assigned'] = true;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
withFilterLabels(cfg: GiteaCfg): ParamsBuilder {
|
||||
const labels = parseLabelList(cfg.filterLabels);
|
||||
if (labels.length > 0) {
|
||||
this.params['labels'] = labels.join(',');
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
withSearchTerm(search: string): ParamsBuilder {
|
||||
this.params['q'] = search;
|
||||
return this;
|
||||
}
|
||||
|
||||
build(): any {
|
||||
return this.params;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
import { T } from '../../../../t.const';
|
||||
import {
|
||||
ConfigFormSection,
|
||||
LimitedFormlyFieldConfig,
|
||||
} from '../../../config/global-config.model';
|
||||
import { IssueProviderGitea } from '../../issue.model';
|
||||
import { ISSUE_PROVIDER_COMMON_FORM_FIELDS } from '../../common-issue-form-stuff.const';
|
||||
import { GiteaCfg } from './gitea.model';
|
||||
|
||||
export enum ScopeOptions {
|
||||
all = 'all',
|
||||
createdByMe = 'created-by-me',
|
||||
assignedToMe = 'assigned-to-me',
|
||||
}
|
||||
|
||||
export const DEFAULT_GITEA_CFG: GiteaCfg = {
|
||||
isEnabled: false,
|
||||
host: null,
|
||||
repoFullname: null,
|
||||
token: null,
|
||||
scope: 'created-by-me',
|
||||
filterLabels: null,
|
||||
excludeLabels: null,
|
||||
};
|
||||
|
||||
export const GITEA_CONFIG_FORM: LimitedFormlyFieldConfig<IssueProviderGitea>[] = [
|
||||
{
|
||||
key: 'host',
|
||||
type: 'input',
|
||||
templateOptions: {
|
||||
label: T.F.GITEA.FORM.HOST,
|
||||
type: 'url',
|
||||
pattern: /^.+\/.+?$/i,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'token',
|
||||
type: 'input',
|
||||
templateOptions: {
|
||||
label: T.F.GITEA.FORM.TOKEN,
|
||||
required: true,
|
||||
type: 'password',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
templateOptions: {
|
||||
url: 'https://www.jetbrains.com/help/youtrack/cloud/integration-with-gitea.html#enable-youtrack-integration-gitea',
|
||||
txt: T.F.ISSUE.HOW_TO_GET_A_TOKEN,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'repoFullname',
|
||||
type: 'input',
|
||||
templateOptions: {
|
||||
label: T.F.GITEA.FORM.REPO_FULL_NAME,
|
||||
type: 'text',
|
||||
required: true,
|
||||
description: T.F.GITEA.FORM.REPO_FULL_NAME_DESCRIPTION,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'scope',
|
||||
type: 'select',
|
||||
defaultValue: 'created-by-me',
|
||||
templateOptions: {
|
||||
required: true,
|
||||
label: T.F.GITEA.FORM.SCOPE,
|
||||
options: [
|
||||
{ value: ScopeOptions.all, label: T.F.GITEA.FORM.SCOPE_ALL },
|
||||
{ value: ScopeOptions.createdByMe, label: T.F.GITEA.FORM.SCOPE_CREATED },
|
||||
{ value: ScopeOptions.assignedToMe, label: T.F.GITEA.FORM.SCOPE_ASSIGNED },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'filterLabels',
|
||||
type: 'input',
|
||||
templateOptions: {
|
||||
label: T.F.GITEA.FORM.FILTER_LABELS,
|
||||
type: 'text',
|
||||
description: T.F.GITEA.FORM.FILTER_LABELS_DESCRIPTION,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'excludeLabels',
|
||||
type: 'input',
|
||||
templateOptions: {
|
||||
label: T.F.GITEA.FORM.EXCLUDE_LABELS,
|
||||
type: 'text',
|
||||
description: T.F.GITEA.FORM.EXCLUDE_LABELS_DESCRIPTION,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'collapsible',
|
||||
// todo translate
|
||||
props: { label: 'Advanced Config' },
|
||||
fieldGroup: [...ISSUE_PROVIDER_COMMON_FORM_FIELDS],
|
||||
},
|
||||
];
|
||||
|
||||
export const GITEA_CONFIG_FORM_SECTION: ConfigFormSection<IssueProviderGitea> = {
|
||||
title: 'Gitea',
|
||||
key: 'GITEA',
|
||||
items: GITEA_CONFIG_FORM,
|
||||
help: T.F.GITEA.FORM_SECTION.HELP,
|
||||
};
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
import { TaskCopy } from '../../../tasks/task.model';
|
||||
import { GiteaCommonInterfacesService } from './gitea-common-interfaces.service';
|
||||
import { GiteaIssue } from './gitea-issue.model';
|
||||
|
||||
type AddTaskData = Partial<Readonly<TaskCopy>> & { title: string };
|
||||
|
||||
describe('GiteaCommonInterfacesService', () => {
|
||||
// getAddTaskData is a pure formatter that doesn't touch any injected
|
||||
// dependency, so call it off the prototype without going through DI.
|
||||
const getAddTaskData = (issue: GiteaIssue): AddTaskData =>
|
||||
GiteaCommonInterfacesService.prototype.getAddTaskData.call(
|
||||
null as unknown as GiteaCommonInterfacesService,
|
||||
issue,
|
||||
);
|
||||
|
||||
describe('getAddTaskData', () => {
|
||||
const baseIssue = {
|
||||
id: 98765,
|
||||
number: 42,
|
||||
title: 'Example issue',
|
||||
state: 'open',
|
||||
updated_at: '2025-01-20T12:00:00Z',
|
||||
} as unknown as GiteaIssue;
|
||||
|
||||
it('should set issueId from issue.number (not issue.id) so polling uses the per-repo number', () => {
|
||||
const result = getAddTaskData(baseIssue);
|
||||
expect(result.issueId).toBe('42');
|
||||
});
|
||||
|
||||
it('should set isDone=true when issue.state is closed', () => {
|
||||
const result = getAddTaskData({ ...baseIssue, state: 'closed' } as GiteaIssue);
|
||||
expect(result.isDone).toBe(true);
|
||||
});
|
||||
|
||||
it('should set isDone=false when issue.state is open', () => {
|
||||
const result = getAddTaskData(baseIssue);
|
||||
expect(result.isDone).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
import { Injectable, inject } from '@angular/core';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { TaskCopy } from '../../../tasks/task.model';
|
||||
import { BaseIssueProviderService } from '../../base/base-issue-provider.service';
|
||||
import { IssueData, IssueDataReduced, SearchResultItem } from '../../issue.model';
|
||||
import { GITEA_POLL_INTERVAL } from './gitea.const';
|
||||
import {
|
||||
formatGiteaIssueTitle,
|
||||
formatGiteaIssueTitleForSnack,
|
||||
} from './format-gitea-issue-title.util';
|
||||
import { GiteaCfg } from './gitea.model';
|
||||
import { GiteaApiService } from '../gitea/gitea-api.service';
|
||||
import { GiteaIssue } from './gitea-issue.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class GiteaCommonInterfacesService extends BaseIssueProviderService<GiteaCfg> {
|
||||
private readonly _giteaApiService = inject(GiteaApiService);
|
||||
|
||||
readonly providerKey = 'GITEA' as const;
|
||||
readonly pollInterval: number = GITEA_POLL_INTERVAL;
|
||||
|
||||
isEnabled(cfg: GiteaCfg): boolean {
|
||||
return !!cfg && cfg.isEnabled && !!cfg.host && !!cfg.token && !!cfg.repoFullname;
|
||||
}
|
||||
|
||||
testConnection(cfg: GiteaCfg): Promise<boolean> {
|
||||
return firstValueFrom(
|
||||
this._giteaApiService
|
||||
.searchIssueForRepo$('', cfg)
|
||||
.pipe(map((res) => Array.isArray(res))),
|
||||
).then((result) => result ?? false);
|
||||
}
|
||||
|
||||
issueLink(issueNumber: string | number, issueProviderId: string): Promise<string> {
|
||||
return firstValueFrom(
|
||||
this._getCfgOnce$(issueProviderId).pipe(
|
||||
map((cfg) => `${cfg.host}/${cfg.repoFullname}/issues/${issueNumber}`),
|
||||
),
|
||||
).then((result) => result ?? '');
|
||||
}
|
||||
|
||||
getAddTaskData(issue: GiteaIssue): Partial<Readonly<TaskCopy>> & { title: string } {
|
||||
return {
|
||||
title: formatGiteaIssueTitle(issue),
|
||||
issueId: String(issue.number),
|
||||
isDone: issue.state === 'closed',
|
||||
issueWasUpdated: false,
|
||||
issueLastUpdated: new Date(issue.updated_at).getTime(),
|
||||
};
|
||||
}
|
||||
|
||||
async getNewIssuesToAddToBacklog(
|
||||
issueProviderId: string,
|
||||
_allExistingIssueIds: number[] | string[],
|
||||
): Promise<IssueDataReduced[]> {
|
||||
const cfg = await firstValueFrom(this._getCfgOnce$(issueProviderId));
|
||||
return await firstValueFrom(this._giteaApiService.getLast100IssuesFor$(cfg));
|
||||
}
|
||||
|
||||
protected _apiGetById$(
|
||||
id: string | number,
|
||||
cfg: GiteaCfg,
|
||||
): Observable<IssueData | null> {
|
||||
return this._giteaApiService.getById$(id as number, cfg);
|
||||
}
|
||||
|
||||
protected _apiSearchIssues$(
|
||||
searchTerm: string,
|
||||
cfg: GiteaCfg,
|
||||
): Observable<SearchResultItem[]> {
|
||||
return this._giteaApiService.searchIssueForRepo$(searchTerm, cfg);
|
||||
}
|
||||
|
||||
protected _formatIssueTitleForSnack(issue: IssueData): string {
|
||||
return formatGiteaIssueTitleForSnack(issue as GiteaIssue);
|
||||
}
|
||||
|
||||
protected _getIssueLastUpdated(issue: IssueData): number {
|
||||
return new Date((issue as GiteaIssue).updated_at).getTime();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
import { T } from '../../../../t.const';
|
||||
import {
|
||||
IssueContentConfig,
|
||||
IssueFieldType,
|
||||
} from '../../issue-content/issue-content.model';
|
||||
import { GiteaIssue } from './gitea-issue.model';
|
||||
|
||||
export const GITEA_ISSUE_CONTENT_CONFIG: IssueContentConfig<GiteaIssue> = {
|
||||
issueType: 'GITEA' as const,
|
||||
fields: [
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.SUMMARY,
|
||||
type: IssueFieldType.LINK,
|
||||
value: (issue: GiteaIssue) => `${issue.title} #${issue.number}`,
|
||||
getLink: (issue: GiteaIssue) => issue.html_url,
|
||||
},
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.STATUS,
|
||||
value: 'state',
|
||||
type: IssueFieldType.TEXT,
|
||||
},
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.ASSIGNEE,
|
||||
type: IssueFieldType.TEXT,
|
||||
value: (issue: GiteaIssue) =>
|
||||
issue.assignees?.map((a) => a.login || a.username).join(', '),
|
||||
isVisible: (issue: GiteaIssue) => (issue.assignees?.length ?? 0) > 0,
|
||||
},
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.LABELS,
|
||||
value: 'labels',
|
||||
type: IssueFieldType.CHIPS,
|
||||
isVisible: (issue: GiteaIssue) => (issue.labels?.length ?? 0) > 0,
|
||||
},
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.DESCRIPTION,
|
||||
value: 'body',
|
||||
type: IssueFieldType.MARKDOWN,
|
||||
isVisible: (issue: GiteaIssue) => !!issue.body,
|
||||
},
|
||||
],
|
||||
comments: {
|
||||
field: 'comments',
|
||||
authorField: 'user.login',
|
||||
bodyField: 'body',
|
||||
createdField: 'created_at',
|
||||
sortField: 'created_at',
|
||||
},
|
||||
getIssueUrl: (issue: GiteaIssue) => issue.url,
|
||||
hasCollapsingComments: true,
|
||||
};
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
import {
|
||||
hasAllLabels,
|
||||
isIssueIncludedByLabels,
|
||||
parseLabelList,
|
||||
} from './gitea-issue-map.util';
|
||||
import { GiteaIssue, GiteaLabel } from './gitea-issue.model';
|
||||
|
||||
const makeLabel = (name: string): GiteaLabel =>
|
||||
({ id: 0, name, color: '', description: '', url: '' }) as GiteaLabel;
|
||||
|
||||
const makeIssue = (labels: GiteaLabel[] | undefined): GiteaIssue =>
|
||||
({ labels }) as unknown as GiteaIssue;
|
||||
|
||||
describe('gitea-issue-map.util', () => {
|
||||
describe('parseLabelList', () => {
|
||||
it('returns [] for null', () => {
|
||||
expect(parseLabelList(null)).toEqual([]);
|
||||
});
|
||||
|
||||
it('returns [] for an empty string', () => {
|
||||
expect(parseLabelList('')).toEqual([]);
|
||||
});
|
||||
|
||||
it('returns [] when only whitespace and commas', () => {
|
||||
expect(parseLabelList(' , ,,')).toEqual([]);
|
||||
});
|
||||
|
||||
it('trims whitespace around each entry', () => {
|
||||
expect(parseLabelList(' bug , enhancement , docs ')).toEqual([
|
||||
'bug',
|
||||
'enhancement',
|
||||
'docs',
|
||||
]);
|
||||
});
|
||||
|
||||
it('preserves scoped labels with slashes', () => {
|
||||
expect(parseLabelList('project/uconsole,bug')).toEqual(['project/uconsole', 'bug']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isIssueIncludedByLabels', () => {
|
||||
it('includes any issue when the exclude list is empty', () => {
|
||||
const issue = makeIssue([makeLabel('bug')]);
|
||||
expect(isIssueIncludedByLabels(issue, [])).toBe(true);
|
||||
});
|
||||
|
||||
it('includes issues that carry none of the excluded labels', () => {
|
||||
const issue = makeIssue([makeLabel('bug'), makeLabel('enhancement')]);
|
||||
expect(isIssueIncludedByLabels(issue, ['wontfix'])).toBe(true);
|
||||
});
|
||||
|
||||
it('excludes an issue that carries an excluded label', () => {
|
||||
const issue = makeIssue([makeLabel('bug'), makeLabel('wontfix')]);
|
||||
expect(isIssueIncludedByLabels(issue, ['wontfix'])).toBe(false);
|
||||
});
|
||||
|
||||
it('excludes when any of multiple excluded labels matches', () => {
|
||||
const issue = makeIssue([makeLabel('docs')]);
|
||||
expect(isIssueIncludedByLabels(issue, ['wontfix', 'docs', 'stale'])).toBe(false);
|
||||
});
|
||||
|
||||
it('treats missing issue.labels as no labels and includes the issue', () => {
|
||||
const issue = makeIssue(undefined);
|
||||
expect(isIssueIncludedByLabels(issue, ['wontfix'])).toBe(true);
|
||||
});
|
||||
|
||||
it('matches scoped label names exactly', () => {
|
||||
const issue = makeIssue([makeLabel('project/ai')]);
|
||||
expect(isIssueIncludedByLabels(issue, ['project/uconsole'])).toBe(true);
|
||||
expect(isIssueIncludedByLabels(issue, ['project/ai'])).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('hasAllLabels', () => {
|
||||
it('includes any issue when the required list is empty', () => {
|
||||
const issue = makeIssue([makeLabel('bug')]);
|
||||
expect(hasAllLabels(issue, [])).toBe(true);
|
||||
});
|
||||
|
||||
it('includes issues that carry every required label', () => {
|
||||
const issue = makeIssue([
|
||||
makeLabel('bug'),
|
||||
makeLabel('enhancement'),
|
||||
makeLabel('docs'),
|
||||
]);
|
||||
expect(hasAllLabels(issue, ['bug', 'enhancement'])).toBe(true);
|
||||
});
|
||||
|
||||
it('excludes issues missing any required label (AND semantics)', () => {
|
||||
const issue = makeIssue([makeLabel('bug')]);
|
||||
expect(hasAllLabels(issue, ['bug', 'wontfix'])).toBe(false);
|
||||
});
|
||||
|
||||
it('treats missing issue.labels as no labels and excludes the issue', () => {
|
||||
const issue = makeIssue(undefined);
|
||||
expect(hasAllLabels(issue, ['bug'])).toBe(false);
|
||||
});
|
||||
|
||||
it('matches scoped label names exactly', () => {
|
||||
const issue = makeIssue([makeLabel('project/ai'), makeLabel('bug')]);
|
||||
expect(hasAllLabels(issue, ['project/ai', 'bug'])).toBe(true);
|
||||
expect(hasAllLabels(issue, ['project/uconsole', 'bug'])).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
import { IssueProviderKey, SearchResultItem } from '../../issue.model';
|
||||
import { GiteaCfg } from './gitea.model';
|
||||
import { GiteaIssue } from './gitea-issue.model';
|
||||
import { formatGiteaIssueTitle } from './format-gitea-issue-title.util';
|
||||
|
||||
export const mapGiteaIssueToSearchResult = (issue: GiteaIssue): SearchResultItem => {
|
||||
return {
|
||||
title: formatGiteaIssueTitle(issue),
|
||||
titleHighlighted: formatGiteaIssueTitle(issue),
|
||||
issueType: 'GITEA' as IssueProviderKey,
|
||||
issueData: issue,
|
||||
};
|
||||
};
|
||||
|
||||
// Gitea uses the issue number instead of issue id to track the issues
|
||||
export const mapGiteaIssueIdToIssueNumber = (issue: GiteaIssue): GiteaIssue => {
|
||||
return { ...issue, id: issue.number };
|
||||
};
|
||||
|
||||
// We need to filter as api does not do it for us
|
||||
export const isIssueFromProject = (issue: GiteaIssue, cfg: GiteaCfg): boolean => {
|
||||
if (!issue.repository) {
|
||||
return false;
|
||||
}
|
||||
return issue.repository.full_name === cfg.repoFullname;
|
||||
};
|
||||
|
||||
export const parseLabelList = (raw: string | null): string[] =>
|
||||
(raw ?? '')
|
||||
.split(',')
|
||||
.map((l) => l.trim())
|
||||
.filter((l) => l.length > 0);
|
||||
|
||||
// Gitea/Forgejo's two issue endpoints (`/repos/{o}/{r}/issues` and
|
||||
// `/repos/issues/search`) historically disagree on whether `labels=a,b` means
|
||||
// AND or OR (see go-gitea/gitea#33509), and Forgejo inherits the same code.
|
||||
// We always filter labels client-side so behavior is consistent and independent
|
||||
// of any server-side fixes.
|
||||
export const isIssueIncludedByLabels = (
|
||||
issue: GiteaIssue,
|
||||
excludedLabelNames: readonly string[],
|
||||
): boolean => {
|
||||
if (excludedLabelNames.length === 0) {
|
||||
return true;
|
||||
}
|
||||
const issueLabelNames = new Set((issue.labels ?? []).map((l) => l.name));
|
||||
return !excludedLabelNames.some((name) => issueLabelNames.has(name));
|
||||
};
|
||||
|
||||
export const hasAllLabels = (
|
||||
issue: GiteaIssue,
|
||||
requiredLabelNames: readonly string[],
|
||||
): boolean => {
|
||||
if (requiredLabelNames.length === 0) {
|
||||
return true;
|
||||
}
|
||||
const issueLabelNames = new Set((issue.labels ?? []).map((l) => l.name));
|
||||
return requiredLabelNames.every((name) => issueLabelNames.has(name));
|
||||
};
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
import { GiteaUser } from './gitea-api-responses';
|
||||
|
||||
export enum GiteaIssueStateOptions {
|
||||
open = 'open',
|
||||
closed = 'closed',
|
||||
all = 'all',
|
||||
}
|
||||
|
||||
export type GiteaLabel = Readonly<{
|
||||
id: number;
|
||||
name: string;
|
||||
color: string;
|
||||
description: string;
|
||||
url: string;
|
||||
}>;
|
||||
|
||||
export type GiteaRepositoryReduced = Readonly<{
|
||||
id: number;
|
||||
name: string;
|
||||
owner: string;
|
||||
full_name: string;
|
||||
}>;
|
||||
|
||||
export type GiteaIssue = Readonly<{
|
||||
id: number;
|
||||
url: string;
|
||||
html_url: string;
|
||||
number: number;
|
||||
user: GiteaUser;
|
||||
original_author: string;
|
||||
original_author_id: number;
|
||||
title: string;
|
||||
body: string;
|
||||
ref: string;
|
||||
labels: GiteaLabel[];
|
||||
milestone: unknown | null;
|
||||
assignee: GiteaUser;
|
||||
assignees: GiteaUser[];
|
||||
state: string;
|
||||
is_locked: boolean;
|
||||
comments: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
closed_at: string | null;
|
||||
due_date: string | null;
|
||||
repository: GiteaRepositoryReduced;
|
||||
}>;
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
export { GITEA_ISSUE_CONTENT_CONFIG } from './gitea-issue-content.const';
|
||||
export {
|
||||
GITEA_CONFIG_FORM_SECTION,
|
||||
GITEA_CONFIG_FORM,
|
||||
ScopeOptions,
|
||||
DEFAULT_GITEA_CFG,
|
||||
} from './gitea-cfg-form.const';
|
||||
|
||||
export const GITEA_POLL_INTERVAL = 5 * 60 * 1000;
|
||||
export const GITEA_INITIAL_POLL_DELAY = 8 * 1000;
|
||||
|
||||
export const GITEA_API_SUFFIX = 'api';
|
||||
export const GITEA_API_VERSION = 'v1';
|
||||
export const GITEA_API_SUBPATH_REPO = 'repos';
|
||||
export const GITEA_API_SUBPATH_USER = 'user';
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import { BaseIssueProviderCfg } from '../../issue.model';
|
||||
|
||||
export interface GiteaCfg extends BaseIssueProviderCfg {
|
||||
repoFullname: string | null;
|
||||
host: string | null;
|
||||
token: string | null;
|
||||
scope: string | null;
|
||||
filterLabels: string | null;
|
||||
excludeLabels: string | null;
|
||||
}
|
||||
|
|
@ -1,264 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
HttpClientTestingModule,
|
||||
HttpTestingController,
|
||||
} from '@angular/common/http/testing';
|
||||
import { LinearApiService } from './linear-api.service';
|
||||
import { SnackService } from '../../../../core/snack/snack.service';
|
||||
import { LinearCfg } from './linear.model';
|
||||
|
||||
describe('LinearApiService', () => {
|
||||
let service: LinearApiService;
|
||||
let httpMock: HttpTestingController;
|
||||
let snackService: jasmine.SpyObj<SnackService>;
|
||||
|
||||
const mockCfg: LinearCfg = {
|
||||
apiKey: 'test-api-key',
|
||||
} as any;
|
||||
|
||||
beforeEach(() => {
|
||||
const snackServiceSpy = jasmine.createSpyObj('SnackService', ['open']);
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [LinearApiService, { provide: SnackService, useValue: snackServiceSpy }],
|
||||
});
|
||||
|
||||
service = TestBed.inject(LinearApiService);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
snackService = TestBed.inject(SnackService) as jasmine.SpyObj<SnackService>;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
httpMock.verify();
|
||||
});
|
||||
|
||||
it('should fetch issue by id', (done) => {
|
||||
const issueId = 'test-issue-id';
|
||||
const mockResponse = {
|
||||
data: {
|
||||
issue: {
|
||||
id: issueId,
|
||||
identifier: 'LIN-1',
|
||||
number: 1,
|
||||
title: 'Test Issue',
|
||||
description: 'Test Description',
|
||||
priority: 1,
|
||||
createdAt: '2025-01-01T00:00:00Z',
|
||||
updatedAt: '2025-01-02T00:00:00Z',
|
||||
completedAt: null,
|
||||
canceledAt: null,
|
||||
dueDate: null,
|
||||
url: 'https://linear.app/issue',
|
||||
state: {
|
||||
id: 'state-id',
|
||||
name: 'In Progress',
|
||||
type: 'started',
|
||||
},
|
||||
team: {
|
||||
id: 'team-id',
|
||||
name: 'Team A',
|
||||
key: 'TEAM',
|
||||
},
|
||||
assignee: {
|
||||
id: 'user-id',
|
||||
name: 'John Doe',
|
||||
email: 'john@example.com',
|
||||
avatarUrl: 'https://example.com/avatar.jpg',
|
||||
},
|
||||
creator: {
|
||||
id: 'creator-id',
|
||||
name: 'Jane Doe',
|
||||
},
|
||||
labels: {
|
||||
nodes: [{ id: 'label-1', name: 'bug', color: '#ff0000' }],
|
||||
},
|
||||
comments: {
|
||||
nodes: [
|
||||
{
|
||||
id: 'comment-1',
|
||||
body: 'Test comment',
|
||||
createdAt: '2025-01-02T00:00:00Z',
|
||||
user: {
|
||||
id: 'user-2',
|
||||
name: 'Jane Smith',
|
||||
avatarUrl: 'https://example.com/avatar2.jpg',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
attachments: {
|
||||
nodes: [
|
||||
{
|
||||
id: 'attachment-1',
|
||||
sourceType: 'github',
|
||||
title: 'GitHub Pull Request',
|
||||
url: 'https://github.com/example/pr/123',
|
||||
},
|
||||
{
|
||||
id: 'attachment-2',
|
||||
sourceType: 'slack',
|
||||
title: 'Slack Discussion',
|
||||
url: 'https://slack.com/archives/C123456/p1234567890',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
service.getById$(issueId, mockCfg).subscribe((issue) => {
|
||||
expect(issue.identifier).toBe('LIN-1');
|
||||
expect(issue.title).toBe('Test Issue');
|
||||
expect(issue.comments.length).toBe(1);
|
||||
expect(issue.attachments).toBeDefined();
|
||||
expect(issue.attachments.length).toBe(2);
|
||||
expect(issue.attachments[0].sourceType).toBe('github');
|
||||
expect(issue.attachments[1].sourceType).toBe('slack');
|
||||
done();
|
||||
});
|
||||
|
||||
const req = httpMock.expectOne('https://api.linear.app/graphql');
|
||||
expect(req.request.method).toBe('POST');
|
||||
expect(req.request.headers.get('Authorization')).toBe('test-api-key');
|
||||
req.flush(mockResponse);
|
||||
});
|
||||
|
||||
it('should search issues', (done) => {
|
||||
const mockResponse = {
|
||||
data: {
|
||||
viewer: {
|
||||
assignedIssues: {
|
||||
nodes: [
|
||||
{
|
||||
id: 'issue-1',
|
||||
identifier: 'LIN-1',
|
||||
number: 1,
|
||||
title: 'Test Issue 1',
|
||||
updatedAt: '2025-01-02T00:00:00Z',
|
||||
url: 'https://linear.app/issue1',
|
||||
state: {
|
||||
id: 'state-id',
|
||||
name: 'Backlog',
|
||||
type: 'backlog',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
service.searchIssues$('Test', mockCfg).subscribe((issues) => {
|
||||
expect(issues.length).toBe(1);
|
||||
expect(issues[0].title).toBe('Test Issue 1');
|
||||
done();
|
||||
});
|
||||
|
||||
const req = httpMock.expectOne('https://api.linear.app/graphql');
|
||||
expect(req.request.method).toBe('POST');
|
||||
req.flush(mockResponse);
|
||||
});
|
||||
|
||||
it('should test connection', (done) => {
|
||||
const mockResponse = {
|
||||
data: {
|
||||
viewer: {
|
||||
id: 'viewer-id',
|
||||
name: 'Test User',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
service.testConnection(mockCfg).subscribe((result) => {
|
||||
expect(result).toBe(true);
|
||||
done();
|
||||
});
|
||||
|
||||
const req = httpMock.expectOne('https://api.linear.app/graphql');
|
||||
req.flush(mockResponse);
|
||||
});
|
||||
|
||||
it('should handle GraphQL errors', (done) => {
|
||||
const mockResponse = {
|
||||
errors: [{ message: 'Invalid query' }],
|
||||
};
|
||||
|
||||
service.getById$('test-id', mockCfg).subscribe(
|
||||
() => {
|
||||
fail('Should have thrown error');
|
||||
},
|
||||
(err) => {
|
||||
// The error is thrown and propagated
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
},
|
||||
);
|
||||
|
||||
const req = httpMock.expectOne('https://api.linear.app/graphql');
|
||||
req.flush(mockResponse);
|
||||
});
|
||||
|
||||
it('should handle HTTP errors', (done) => {
|
||||
service.getById$('test-id', mockCfg).subscribe(
|
||||
() => {
|
||||
fail('Should have thrown error');
|
||||
},
|
||||
() => {
|
||||
expect(snackService.open).toHaveBeenCalled();
|
||||
done();
|
||||
},
|
||||
);
|
||||
|
||||
const req = httpMock.expectOne('https://api.linear.app/graphql');
|
||||
req.error(new ErrorEvent('Network error'));
|
||||
});
|
||||
|
||||
it('should filter search results by search term', (done) => {
|
||||
const mockResponse = {
|
||||
data: {
|
||||
viewer: {
|
||||
assignedIssues: {
|
||||
nodes: [
|
||||
{
|
||||
id: 'issue-1',
|
||||
identifier: 'LIN-1',
|
||||
number: 1,
|
||||
title: 'Feature: Add login',
|
||||
updatedAt: '2025-01-02T00:00:00Z',
|
||||
url: 'https://linear.app/issue1',
|
||||
state: {
|
||||
id: 'state-id',
|
||||
name: 'Backlog',
|
||||
type: 'backlog',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'issue-2',
|
||||
identifier: 'LIN-2',
|
||||
number: 2,
|
||||
title: 'Bug: Fix logout',
|
||||
updatedAt: '2025-01-02T00:00:00Z',
|
||||
url: 'https://linear.app/issue2',
|
||||
state: {
|
||||
id: 'state-id',
|
||||
name: 'Backlog',
|
||||
type: 'backlog',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
service.searchIssues$('login', mockCfg).subscribe((issues) => {
|
||||
expect(issues.length).toBe(1);
|
||||
expect(issues[0].title).toBe('Feature: Add login');
|
||||
done();
|
||||
});
|
||||
|
||||
const req = httpMock.expectOne('https://api.linear.app/graphql');
|
||||
req.flush(mockResponse);
|
||||
});
|
||||
});
|
||||
|
|
@ -1,370 +0,0 @@
|
|||
import { Injectable, inject } from '@angular/core';
|
||||
import {
|
||||
HttpClient,
|
||||
HttpEventType,
|
||||
HttpHeaders,
|
||||
HttpRequest,
|
||||
HttpResponse,
|
||||
} from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { catchError, filter, map } from 'rxjs/operators';
|
||||
import { LinearCfg } from './linear.model';
|
||||
import { LinearAttachment, LinearIssue, LinearIssueReduced } from './linear-issue.model';
|
||||
import { SnackService } from '../../../../core/snack/snack.service';
|
||||
import { handleIssueProviderHttpError$ } from '../../handle-issue-provider-http-error';
|
||||
import { LINEAR_TYPE } from '../../issue.const';
|
||||
import { IssueLog } from '../../../../core/log';
|
||||
|
||||
const LINEAR_API_URL = 'https://api.linear.app/graphql';
|
||||
|
||||
interface LinearGraphQLResponse<T = unknown> {
|
||||
data?: T;
|
||||
errors?: Array<{ message: string }>;
|
||||
}
|
||||
|
||||
interface LinearRawIssueReduced {
|
||||
id: string;
|
||||
identifier: string;
|
||||
number: number;
|
||||
title: string;
|
||||
updatedAt: string;
|
||||
url: string;
|
||||
state: { name: string; type: string };
|
||||
}
|
||||
|
||||
interface LinearRawIssue extends LinearRawIssueReduced {
|
||||
description?: string;
|
||||
priority: number;
|
||||
createdAt: string;
|
||||
completedAt?: string;
|
||||
canceledAt?: string;
|
||||
dueDate?: string;
|
||||
assignee?: { id: string; name: string; email: string; avatarUrl: string };
|
||||
creator: { id: string; name: string };
|
||||
team: { id: string; name: string; key: string };
|
||||
labels?: {
|
||||
nodes: Array<{ id: string; name: string; color: string }>;
|
||||
};
|
||||
comments?: {
|
||||
nodes: Array<{
|
||||
id: string;
|
||||
body: string;
|
||||
createdAt: string;
|
||||
user?: { id: string; name: string; avatarUrl: string };
|
||||
}>;
|
||||
};
|
||||
attachments?: { nodes: LinearAttachment[] };
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class LinearApiService {
|
||||
private _snackService = inject(SnackService);
|
||||
private _http = inject(HttpClient);
|
||||
|
||||
getById$(issueId: string, cfg: LinearCfg): Observable<LinearIssue> {
|
||||
const query = `
|
||||
query GetIssue($id: String!) {
|
||||
issue(id: $id) {
|
||||
id
|
||||
identifier
|
||||
number
|
||||
title
|
||||
description
|
||||
priority
|
||||
createdAt
|
||||
updatedAt
|
||||
completedAt
|
||||
canceledAt
|
||||
dueDate
|
||||
url
|
||||
state {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
team {
|
||||
id
|
||||
name
|
||||
key
|
||||
}
|
||||
assignee {
|
||||
id
|
||||
name
|
||||
email
|
||||
avatarUrl
|
||||
}
|
||||
creator {
|
||||
id
|
||||
name
|
||||
}
|
||||
labels(first: 50) {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
color
|
||||
}
|
||||
}
|
||||
comments(first: 50) {
|
||||
nodes {
|
||||
id
|
||||
body
|
||||
createdAt
|
||||
user {
|
||||
id
|
||||
name
|
||||
avatarUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
attachments {
|
||||
nodes {
|
||||
id
|
||||
sourceType
|
||||
title
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
return this._sendRequest$<LinearIssue>({
|
||||
query: this._normalizeQuery(query),
|
||||
variables: { id: issueId },
|
||||
transform: (res: LinearGraphQLResponse<{ issue: LinearRawIssue }>) => {
|
||||
if (res?.data?.issue) {
|
||||
return this._mapLinearIssueToIssue(res.data.issue);
|
||||
}
|
||||
throw new Error('No issue data returned');
|
||||
},
|
||||
cfg,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Search assigned issues with optional teamId and projectId filters.
|
||||
* @param searchTerm - Search string for title/identifier filtering (client-side)
|
||||
* @param cfg - Linear config
|
||||
* @param opts - Optional filters: teamId, projectId
|
||||
*/
|
||||
searchIssues$(
|
||||
searchTerm: string,
|
||||
cfg: LinearCfg,
|
||||
opts?: { teamId?: string; projectId?: string },
|
||||
): Observable<LinearIssueReduced[]> {
|
||||
const query = `
|
||||
query SearchIssues($first: Int!, $team: TeamFilter, $project: NullableProjectFilter) {
|
||||
viewer {
|
||||
assignedIssues(
|
||||
first: $first,
|
||||
filter: {
|
||||
state: { type: { in: ["backlog", "unstarted", "started"] } },
|
||||
team: $team,
|
||||
project: $project
|
||||
}
|
||||
) {
|
||||
nodes {
|
||||
id
|
||||
identifier
|
||||
number
|
||||
title
|
||||
updatedAt
|
||||
url
|
||||
state {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// Build filter objects for variables, only include if provided
|
||||
const variables: Record<string, unknown> = { first: 50 };
|
||||
if (opts?.teamId) {
|
||||
variables.team = { id: { eq: opts.teamId } };
|
||||
}
|
||||
if (opts?.projectId) {
|
||||
variables.project = { id: { eq: opts.projectId } };
|
||||
}
|
||||
|
||||
return this._sendRequest$<LinearIssueReduced[]>({
|
||||
query: this._normalizeQuery(query),
|
||||
variables,
|
||||
transform: (
|
||||
res: LinearGraphQLResponse<{
|
||||
viewer: { assignedIssues: { nodes: LinearRawIssueReduced[] } };
|
||||
}>,
|
||||
) => {
|
||||
let issues = res?.data?.viewer?.assignedIssues?.nodes || [];
|
||||
|
||||
if (searchTerm.trim()) {
|
||||
const lowerSearchTerm = searchTerm.toLowerCase();
|
||||
issues = issues.filter(
|
||||
(issue) =>
|
||||
issue.title.toLowerCase().includes(lowerSearchTerm) ||
|
||||
issue.identifier.toLowerCase().includes(lowerSearchTerm),
|
||||
);
|
||||
}
|
||||
|
||||
return issues.map((issue) => this._mapLinearIssueToIssueReduced(issue));
|
||||
},
|
||||
cfg,
|
||||
});
|
||||
}
|
||||
|
||||
testConnection(cfg: LinearCfg): Observable<boolean> {
|
||||
const query = `
|
||||
query GetViewer {
|
||||
viewer {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
return this._sendRequest$<boolean>({
|
||||
query: this._normalizeQuery(query),
|
||||
variables: {},
|
||||
transform: () => true,
|
||||
cfg,
|
||||
}).pipe(
|
||||
catchError((error) => {
|
||||
IssueLog.err('LINEAR_CONNECTION_TEST', error);
|
||||
throw error;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private _sendRequest$<T>({
|
||||
query,
|
||||
variables,
|
||||
transform,
|
||||
cfg,
|
||||
}: {
|
||||
query: string;
|
||||
variables: Record<string, unknown>;
|
||||
transform?: (response: any) => T;
|
||||
cfg: LinearCfg;
|
||||
}): Observable<T> {
|
||||
const headers = new HttpHeaders({
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: cfg.apiKey || '',
|
||||
});
|
||||
|
||||
const body = {
|
||||
query,
|
||||
variables,
|
||||
};
|
||||
|
||||
const req = new HttpRequest('POST', LINEAR_API_URL, body, {
|
||||
headers,
|
||||
reportProgress: false,
|
||||
});
|
||||
|
||||
return this._http.request(req).pipe(
|
||||
// Filter out HttpEventType.Sent (type: 0) events to only process actual responses
|
||||
filter(
|
||||
(res): res is HttpResponse<LinearGraphQLResponse> =>
|
||||
res.type === HttpEventType.Response,
|
||||
),
|
||||
map((res) => (res.body ? res.body : ({} as LinearGraphQLResponse))),
|
||||
map((res) => {
|
||||
// Check for GraphQL errors in response
|
||||
if (res?.errors?.length) {
|
||||
IssueLog.err('LINEAR_GRAPHQL_ERROR', res.errors);
|
||||
throw new Error(res.errors[0].message || 'GraphQL error');
|
||||
}
|
||||
return res;
|
||||
}),
|
||||
map((res) => {
|
||||
return transform ? transform(res) : (res as unknown as T);
|
||||
}),
|
||||
catchError((err) =>
|
||||
handleIssueProviderHttpError$(LINEAR_TYPE, this._snackService, err),
|
||||
),
|
||||
) as Observable<T>;
|
||||
}
|
||||
|
||||
private _normalizeQuery(query: string): string {
|
||||
return query.replace(/\s+/g, ' ').trim();
|
||||
}
|
||||
|
||||
private _mapLinearIssueToIssueReduced(
|
||||
issue: LinearRawIssueReduced,
|
||||
): LinearIssueReduced {
|
||||
return {
|
||||
id: issue.id,
|
||||
identifier: issue.identifier,
|
||||
number: issue.number,
|
||||
title: issue.title,
|
||||
state: {
|
||||
name: issue.state.name,
|
||||
type: issue.state.type,
|
||||
},
|
||||
updatedAt: issue.updatedAt,
|
||||
url: issue.url,
|
||||
};
|
||||
}
|
||||
|
||||
private _mapLinearIssueToIssue(issue: LinearRawIssue): LinearIssue {
|
||||
return {
|
||||
id: issue.id,
|
||||
identifier: issue.identifier,
|
||||
number: issue.number,
|
||||
title: issue.title,
|
||||
state: {
|
||||
name: issue.state.name,
|
||||
type: issue.state.type,
|
||||
},
|
||||
updatedAt: issue.updatedAt,
|
||||
url: issue.url,
|
||||
description: issue.description || undefined,
|
||||
priority: issue.priority,
|
||||
createdAt: issue.createdAt,
|
||||
completedAt: issue.completedAt || undefined,
|
||||
canceledAt: issue.canceledAt || undefined,
|
||||
dueDate: issue.dueDate || undefined,
|
||||
assignee: issue.assignee
|
||||
? {
|
||||
id: issue.assignee.id,
|
||||
name: issue.assignee.name,
|
||||
email: issue.assignee.email,
|
||||
avatarUrl: issue.assignee.avatarUrl,
|
||||
}
|
||||
: undefined,
|
||||
creator: {
|
||||
id: issue.creator.id,
|
||||
name: issue.creator.name,
|
||||
},
|
||||
team: {
|
||||
id: issue.team.id,
|
||||
name: issue.team.name,
|
||||
key: issue.team.key,
|
||||
},
|
||||
labels: (issue.labels?.nodes || []).map((label) => ({
|
||||
id: label.id,
|
||||
name: label.name,
|
||||
color: label.color,
|
||||
})),
|
||||
comments: (issue.comments?.nodes || [])
|
||||
.filter((comment) => !!comment.user)
|
||||
.map((comment) => ({
|
||||
id: comment.id,
|
||||
body: comment.body,
|
||||
createdAt: comment.createdAt,
|
||||
user: {
|
||||
id: comment.user!.id,
|
||||
name: comment.user!.name,
|
||||
avatarUrl: comment.user!.avatarUrl,
|
||||
},
|
||||
})),
|
||||
attachments: (issue.attachments?.nodes || []) as LinearAttachment[],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
import {
|
||||
ConfigFormSection,
|
||||
LimitedFormlyFieldConfig,
|
||||
} from '../../../config/global-config.model';
|
||||
import { IssueProviderLinear } from '../../issue.model';
|
||||
import { ISSUE_PROVIDER_COMMON_FORM_FIELDS } from '../../common-issue-form-stuff.const';
|
||||
import { LinearCfg } from './linear.model';
|
||||
|
||||
export const DEFAULT_LINEAR_CFG: LinearCfg = {
|
||||
isEnabled: false,
|
||||
apiKey: null,
|
||||
teamId: undefined,
|
||||
projectId: undefined,
|
||||
};
|
||||
|
||||
export const LINEAR_CONFIG_FORM: LimitedFormlyFieldConfig<IssueProviderLinear>[] = [
|
||||
{
|
||||
key: 'apiKey',
|
||||
type: 'input',
|
||||
props: {
|
||||
label: 'API Key',
|
||||
required: true,
|
||||
type: 'password',
|
||||
placeholder: 'Your Linear personal API key',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'teamId',
|
||||
type: 'input',
|
||||
props: {
|
||||
label: 'Team ID (optional)',
|
||||
placeholder: 'Filter to specific team',
|
||||
type: 'text',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'projectId',
|
||||
type: 'input',
|
||||
props: {
|
||||
label: 'Project ID (optional)',
|
||||
placeholder: 'Your Linear project ID',
|
||||
type: 'text',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'link',
|
||||
props: {
|
||||
url: 'https://linear.app/settings/account/security',
|
||||
txt: 'Get your API key',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'collapsible',
|
||||
props: { label: 'Advanced Config' },
|
||||
fieldGroup: [...ISSUE_PROVIDER_COMMON_FORM_FIELDS],
|
||||
},
|
||||
];
|
||||
|
||||
export const LINEAR_CONFIG_FORM_SECTION: ConfigFormSection<IssueProviderLinear> = {
|
||||
title: 'Linear',
|
||||
key: 'LINEAR',
|
||||
items: LINEAR_CONFIG_FORM,
|
||||
help: 'Configure Linear integration to sync issues and tasks.',
|
||||
};
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
import { Injectable, inject } from '@angular/core';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { concatMap, first, map } from 'rxjs/operators';
|
||||
import { Log } from '../../../../core/log';
|
||||
import { TaskAttachment } from 'src/app/features/tasks/task-attachment/task-attachment.model';
|
||||
import { getTimestamp } from '../../../../util/get-timestamp';
|
||||
import { truncate } from '../../../../util/truncate';
|
||||
import { Task } from '../../../tasks/task.model';
|
||||
import { BaseIssueProviderService } from '../../base/base-issue-provider.service';
|
||||
import { IssueData, SearchResultItem } from '../../issue.model';
|
||||
import { LinearApiService } from './linear-api.service';
|
||||
import {
|
||||
isLinearIssueDone,
|
||||
mapLinearAttachmentToTaskAttachment,
|
||||
} from './linear-issue-map.util';
|
||||
import { LinearIssue, LinearIssueReduced } from './linear-issue.model';
|
||||
import { LINEAR_POLL_INTERVAL } from './linear.const';
|
||||
import { LinearCfg } from './linear.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class LinearCommonInterfacesService extends BaseIssueProviderService<LinearCfg> {
|
||||
private _linearApiService = inject(LinearApiService);
|
||||
|
||||
readonly providerKey = 'LINEAR' as const;
|
||||
readonly pollInterval: number = LINEAR_POLL_INTERVAL;
|
||||
|
||||
isEnabled(cfg: LinearCfg): boolean {
|
||||
return !!cfg && cfg.isEnabled && !!cfg.apiKey;
|
||||
}
|
||||
|
||||
testConnection(cfg: LinearCfg): Promise<boolean> {
|
||||
return firstValueFrom(
|
||||
this._linearApiService.testConnection(cfg).pipe(
|
||||
map(() => true),
|
||||
first(),
|
||||
),
|
||||
)
|
||||
.then((result) => result ?? false)
|
||||
.catch((err) => {
|
||||
Log.warn('Linear connection test failed', err);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
// Fetches the issue to get the URL
|
||||
override issueLink(issueId: string, issueProviderId: string): Promise<string> {
|
||||
return firstValueFrom(
|
||||
this._getCfgOnce$(issueProviderId).pipe(
|
||||
concatMap((cfg) =>
|
||||
this._linearApiService.getById$(issueId, cfg).pipe(map((issue) => issue.url)),
|
||||
),
|
||||
first(),
|
||||
),
|
||||
).then((result) => result ?? '');
|
||||
}
|
||||
|
||||
getAddTaskData(issue: LinearIssueReduced): Partial<Task> & { title: string } {
|
||||
return {
|
||||
title: `${issue.identifier} ${issue.title}`,
|
||||
issueWasUpdated: false,
|
||||
issueLastUpdated: getTimestamp(issue.updatedAt),
|
||||
isDone: isLinearIssueDone(issue),
|
||||
};
|
||||
}
|
||||
|
||||
getMappedAttachments(issue: LinearIssue): TaskAttachment[] {
|
||||
return (issue.attachments || []).map(mapLinearAttachmentToTaskAttachment);
|
||||
}
|
||||
|
||||
async getNewIssuesToAddToBacklog(
|
||||
issueProviderId: string,
|
||||
allExistingIssueIds: (number | string)[],
|
||||
): Promise<LinearIssueReduced[]> {
|
||||
const cfg = await firstValueFrom(this._getCfgOnce$(issueProviderId));
|
||||
const issues = await firstValueFrom(this._linearApiService.searchIssues$('', cfg));
|
||||
|
||||
return issues.filter((issue) => !allExistingIssueIds.includes(issue.id));
|
||||
}
|
||||
|
||||
protected _apiGetById$(
|
||||
id: string | number,
|
||||
cfg: LinearCfg,
|
||||
): Observable<IssueData | null> {
|
||||
return this._linearApiService.getById$(id.toString(), cfg);
|
||||
}
|
||||
|
||||
protected _apiSearchIssues$(
|
||||
searchTerm: string,
|
||||
cfg: LinearCfg,
|
||||
): Observable<SearchResultItem[]> {
|
||||
return this._linearApiService.searchIssues$(searchTerm, cfg).pipe(
|
||||
map((issues) =>
|
||||
issues.map((issue) => ({
|
||||
title: `${issue.identifier} ${issue.title}`,
|
||||
issueType: 'LINEAR' as const,
|
||||
issueData: issue,
|
||||
})),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
protected _formatIssueTitleForSnack(issue: IssueData): string {
|
||||
const linearIssue = issue as LinearIssue;
|
||||
return truncate(`${linearIssue.identifier} ${linearIssue.title}`);
|
||||
}
|
||||
|
||||
protected _getIssueLastUpdated(issue: IssueData): number {
|
||||
return getTimestamp((issue as LinearIssue).updatedAt);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
import { T } from '../../../../t.const';
|
||||
import {
|
||||
IssueContentConfig,
|
||||
IssueFieldType,
|
||||
} from '../../issue-content/issue-content.model';
|
||||
import { LinearIssue } from './linear-issue.model';
|
||||
|
||||
export const LINEAR_ISSUE_CONTENT_CONFIG: IssueContentConfig<LinearIssue> = {
|
||||
issueType: 'LINEAR' as const,
|
||||
fields: [
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.SUMMARY,
|
||||
type: IssueFieldType.LINK,
|
||||
value: (issue: LinearIssue) => issue.identifier + ' ' + issue.title,
|
||||
getLink: (issue: LinearIssue) => issue.url,
|
||||
},
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.STATUS,
|
||||
value: (issue: LinearIssue) => issue.state.name,
|
||||
type: IssueFieldType.TEXT,
|
||||
isVisible: (issue: LinearIssue) => !!issue.state.name,
|
||||
},
|
||||
{
|
||||
label: 'Priority',
|
||||
value: 'priority',
|
||||
type: IssueFieldType.TEXT,
|
||||
isVisible: (issue: LinearIssue) =>
|
||||
issue.priority !== 0 && issue.priority !== undefined,
|
||||
},
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.ASSIGNEE,
|
||||
type: IssueFieldType.TEXT,
|
||||
value: (issue: LinearIssue) => issue.assignee?.name,
|
||||
isVisible: (issue: LinearIssue) => !!issue.assignee,
|
||||
},
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.LABELS,
|
||||
value: 'labels',
|
||||
type: IssueFieldType.CHIPS,
|
||||
isVisible: (issue: LinearIssue) => (issue.labels?.length ?? 0) > 0,
|
||||
},
|
||||
{
|
||||
label: T.F.ISSUE.ISSUE_CONTENT.DESCRIPTION,
|
||||
value: 'description',
|
||||
type: IssueFieldType.MARKDOWN,
|
||||
isVisible: (issue: LinearIssue) => !!issue.description,
|
||||
},
|
||||
],
|
||||
comments: {
|
||||
field: 'comments',
|
||||
authorField: 'user.name',
|
||||
bodyField: 'body',
|
||||
createdField: 'createdAt',
|
||||
avatarField: 'user.avatarUrl',
|
||||
sortField: 'createdAt',
|
||||
},
|
||||
getIssueUrl: (issue) => issue.url,
|
||||
hasCollapsingComments: true,
|
||||
};
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import { TaskAttachment } from 'src/app/features/tasks/task-attachment/task-attachment.model';
|
||||
import { LinearAttachment, LinearIssueReduced } from './linear-issue.model';
|
||||
import { DropPasteIcons } from 'src/app/core/drop-paste-input/drop-paste.model';
|
||||
|
||||
export const mapLinearAttachmentToTaskAttachment = (
|
||||
attachment: LinearAttachment,
|
||||
): TaskAttachment => {
|
||||
return {
|
||||
id: attachment.id,
|
||||
title: attachment.title,
|
||||
path: attachment.url,
|
||||
type: 'LINK',
|
||||
icon: DropPasteIcons['LINK'], // Maybe this could use sourceType (github, slack)
|
||||
};
|
||||
};
|
||||
|
||||
export const mapLinearIssueToSearchResult = (
|
||||
issue: LinearIssueReduced,
|
||||
): { title: string } => ({
|
||||
title: `${issue.identifier} ${issue.title}`,
|
||||
});
|
||||
|
||||
export const isLinearIssueDone = (issue: LinearIssueReduced): boolean =>
|
||||
issue.state.type === 'completed' || issue.state.type === 'canceled';
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
export type LinearIssueReduced = Readonly<{
|
||||
id: string;
|
||||
identifier: string;
|
||||
number: number;
|
||||
title: string;
|
||||
state: {
|
||||
name: string;
|
||||
type: string;
|
||||
};
|
||||
updatedAt: string;
|
||||
url: string;
|
||||
}>;
|
||||
|
||||
export type LinearIssue = LinearIssueReduced &
|
||||
Readonly<{
|
||||
description?: string;
|
||||
priority: number;
|
||||
createdAt: string;
|
||||
completedAt?: string | null;
|
||||
canceledAt?: string | null;
|
||||
dueDate?: string | null;
|
||||
assignee?: {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
avatarUrl?: string;
|
||||
} | null;
|
||||
creator: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
team: {
|
||||
id: string;
|
||||
name: string;
|
||||
key: string;
|
||||
};
|
||||
labels: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
color: string;
|
||||
}>;
|
||||
comments: LinearComment[];
|
||||
attachments: LinearAttachment[];
|
||||
}>;
|
||||
|
||||
export type LinearComment = Readonly<{
|
||||
id: string;
|
||||
body: string;
|
||||
createdAt: string;
|
||||
user: {
|
||||
id: string;
|
||||
name: string;
|
||||
avatarUrl?: string;
|
||||
};
|
||||
}>;
|
||||
|
||||
export type LinearAttachment = Readonly<{
|
||||
id: string;
|
||||
sourceType: string;
|
||||
title: string;
|
||||
url: string;
|
||||
}>;
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
export const LINEAR_POLL_INTERVAL = 5 * 60 * 1000; // 5 minutes
|
||||
export const LINEAR_INITIAL_POLL_DELAY = 8 * 1000;
|
||||
export const LINEAR_API_BASE_URL = 'https://linear.app/';
|
||||
|
||||
// Re-export from cfg form
|
||||
export {
|
||||
LINEAR_CONFIG_FORM_SECTION,
|
||||
LINEAR_CONFIG_FORM,
|
||||
DEFAULT_LINEAR_CFG,
|
||||
} from './linear-cfg-form.const';
|
||||
|
||||
// Re-export issue content config
|
||||
export { LINEAR_ISSUE_CONTENT_CONFIG } from './linear-issue-content.const';
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import { BaseIssueProviderCfg } from '../../issue.model';
|
||||
|
||||
export interface LinearCfg extends BaseIssueProviderCfg {
|
||||
apiKey: string | null;
|
||||
teamId?: string | null;
|
||||
projectId?: string | null;
|
||||
}
|
||||
136
src/app/features/issue/store/issue-provider.reducer.spec.ts
Normal file
136
src/app/features/issue/store/issue-provider.reducer.spec.ts
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
import {
|
||||
issueProviderReducer,
|
||||
issueProviderInitialState,
|
||||
} from './issue-provider.reducer';
|
||||
import { loadAllData } from '../../../root-store/meta/load-all-data.action';
|
||||
import { AppDataComplete } from '../../../op-log/model/model-config';
|
||||
import { IssueProviderState } from '../issue.model';
|
||||
|
||||
const loadWith = (entities: Record<string, unknown>): ReturnType<typeof loadAllData> =>
|
||||
loadAllData({
|
||||
appDataComplete: {
|
||||
issueProvider: {
|
||||
ids: Object.keys(entities),
|
||||
entities,
|
||||
} as unknown as IssueProviderState,
|
||||
} as AppDataComplete,
|
||||
});
|
||||
|
||||
describe('issueProviderReducer loadAllData migration', () => {
|
||||
describe('GITEA → gitea-issue-provider', () => {
|
||||
const legacyGitea = {
|
||||
id: 'gp1',
|
||||
issueProviderKey: 'GITEA',
|
||||
isEnabled: true,
|
||||
host: 'https://gitea.example.com',
|
||||
token: 'tok123',
|
||||
repoFullname: 'me/repo',
|
||||
scope: 'assigned-to-me',
|
||||
filterLabels: 'bug',
|
||||
excludeLabels: 'wontfix',
|
||||
};
|
||||
|
||||
it('moves connection fields into pluginConfig and sets pluginId', () => {
|
||||
const state = issueProviderReducer(
|
||||
issueProviderInitialState,
|
||||
loadWith({ gp1: legacyGitea }),
|
||||
);
|
||||
const migrated = state.entities['gp1'] as unknown as Record<string, unknown>;
|
||||
expect(migrated['pluginId']).toBe('gitea-issue-provider');
|
||||
expect(migrated['pluginConfig']).toEqual({
|
||||
host: 'https://gitea.example.com',
|
||||
token: 'tok123',
|
||||
repoFullname: 'me/repo',
|
||||
scope: 'assigned-to-me',
|
||||
filterLabels: 'bug',
|
||||
excludeLabels: 'wontfix',
|
||||
});
|
||||
});
|
||||
|
||||
it('preserves legacy top-level fields for older clients', () => {
|
||||
const state = issueProviderReducer(
|
||||
issueProviderInitialState,
|
||||
loadWith({ gp1: legacyGitea }),
|
||||
);
|
||||
const migrated = state.entities['gp1'] as unknown as Record<string, unknown>;
|
||||
expect(migrated['host']).toBe('https://gitea.example.com');
|
||||
expect(migrated['repoFullname']).toBe('me/repo');
|
||||
expect(migrated['issueProviderKey']).toBe('GITEA');
|
||||
});
|
||||
|
||||
it('defaults scope when missing', () => {
|
||||
const noScope: Record<string, unknown> = { ...legacyGitea };
|
||||
delete noScope['scope'];
|
||||
const state = issueProviderReducer(
|
||||
issueProviderInitialState,
|
||||
loadWith({ gp1: noScope }),
|
||||
);
|
||||
const migrated = state.entities['gp1'] as unknown as Record<string, unknown>;
|
||||
expect((migrated['pluginConfig'] as Record<string, unknown>)['scope']).toBe(
|
||||
'created-by-me',
|
||||
);
|
||||
});
|
||||
|
||||
it('is idempotent — already-migrated providers are left untouched', () => {
|
||||
const already = {
|
||||
...legacyGitea,
|
||||
pluginId: 'gitea-issue-provider',
|
||||
pluginConfig: { host: 'x', token: 'y', repoFullname: 'a/b' },
|
||||
};
|
||||
const state = issueProviderReducer(
|
||||
issueProviderInitialState,
|
||||
loadWith({ gp1: already }),
|
||||
);
|
||||
expect(state.entities['gp1'] as unknown).toBe(already);
|
||||
});
|
||||
});
|
||||
|
||||
describe('LINEAR → linear-issue-provider', () => {
|
||||
const legacyLinear = {
|
||||
id: 'lp1',
|
||||
issueProviderKey: 'LINEAR',
|
||||
isEnabled: true,
|
||||
apiKey: 'lin_key',
|
||||
teamId: 'team-1',
|
||||
projectId: 'proj-1',
|
||||
};
|
||||
|
||||
it('moves connection fields into pluginConfig and sets pluginId', () => {
|
||||
const state = issueProviderReducer(
|
||||
issueProviderInitialState,
|
||||
loadWith({ lp1: legacyLinear }),
|
||||
);
|
||||
const migrated = state.entities['lp1'] as unknown as Record<string, unknown>;
|
||||
expect(migrated['pluginId']).toBe('linear-issue-provider');
|
||||
expect(migrated['pluginConfig']).toEqual({
|
||||
apiKey: 'lin_key',
|
||||
teamId: 'team-1',
|
||||
projectId: 'proj-1',
|
||||
});
|
||||
});
|
||||
|
||||
it('defaults optional team/project to empty strings', () => {
|
||||
const state = issueProviderReducer(
|
||||
issueProviderInitialState,
|
||||
loadWith({ lp1: { id: 'lp1', issueProviderKey: 'LINEAR', apiKey: 'k' } }),
|
||||
);
|
||||
const cfg = (state.entities['lp1'] as unknown as Record<string, unknown>)[
|
||||
'pluginConfig'
|
||||
] as Record<string, unknown>;
|
||||
expect(cfg).toEqual({ apiKey: 'k', teamId: '', projectId: '' });
|
||||
});
|
||||
});
|
||||
|
||||
it('returns state unchanged when no legacy providers need migration', () => {
|
||||
const action = loadWith({
|
||||
jp1: { id: 'jp1', issueProviderKey: 'JIRA', isEnabled: true },
|
||||
});
|
||||
const state = issueProviderReducer(issueProviderInitialState, action);
|
||||
expect(state.entities['jp1']).toEqual(
|
||||
jasmine.objectContaining({ issueProviderKey: 'JIRA' }),
|
||||
);
|
||||
expect(
|
||||
(state.entities['jp1'] as unknown as Record<string, unknown>)['pluginConfig'],
|
||||
).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
|
@ -75,6 +75,51 @@ export const issueProviderReducer = createReducer(
|
|||
},
|
||||
} as unknown as IssueProvider;
|
||||
}
|
||||
|
||||
// Migrate pre-plugin GITEA providers to plugin shape
|
||||
if (
|
||||
provider &&
|
||||
provider['issueProviderKey'] === 'GITEA' &&
|
||||
!provider['pluginConfig']
|
||||
) {
|
||||
needsMigration = true;
|
||||
// TODO: Remove legacy field preservation after a few releases.
|
||||
// Spread original provider so legacy fields (host, token, etc.) survive
|
||||
// for older clients that haven't upgraded yet.
|
||||
migratedEntities[id] = {
|
||||
...provider,
|
||||
pluginId: 'gitea-issue-provider',
|
||||
pluginConfig: {
|
||||
host: provider['host'] ?? '',
|
||||
token: provider['token'] ?? '',
|
||||
repoFullname: provider['repoFullname'] ?? '',
|
||||
scope: provider['scope'] ?? 'created-by-me',
|
||||
filterLabels: provider['filterLabels'] ?? '',
|
||||
excludeLabels: provider['excludeLabels'] ?? '',
|
||||
},
|
||||
} as unknown as IssueProvider;
|
||||
}
|
||||
|
||||
// Migrate pre-plugin LINEAR providers to plugin shape
|
||||
if (
|
||||
provider &&
|
||||
provider['issueProviderKey'] === 'LINEAR' &&
|
||||
!provider['pluginConfig']
|
||||
) {
|
||||
needsMigration = true;
|
||||
// TODO: Remove legacy field preservation after a few releases.
|
||||
// Spread original provider so legacy fields (apiKey, teamId, etc.) survive
|
||||
// for older clients that haven't upgraded yet.
|
||||
migratedEntities[id] = {
|
||||
...provider,
|
||||
pluginId: 'linear-issue-provider',
|
||||
pluginConfig: {
|
||||
apiKey: provider['apiKey'] ?? '',
|
||||
teamId: provider['teamId'] ?? '',
|
||||
projectId: provider['projectId'] ?? '',
|
||||
},
|
||||
} as unknown as IssueProvider;
|
||||
}
|
||||
}
|
||||
if (!needsMigration) {
|
||||
return state;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import {
|
|||
loadFromSessionStorage,
|
||||
saveToSessionStorage,
|
||||
} from '../../../../core/persistence/local-storage';
|
||||
import { GiteaCfg } from '../../../issue/providers/gitea/gitea.model';
|
||||
import { RedmineCfg } from '../../../issue/providers/redmine/redmine.model';
|
||||
import { T } from '../../../../t.const';
|
||||
import { WORK_CONTEXT_THEME_CONFIG_FORM_CONFIG } from '../../../work-context/work-context.const';
|
||||
|
|
@ -69,7 +68,6 @@ export class DialogCreateProjectComponent implements OnInit, OnDestroy {
|
|||
gitlabCfg?: GitlabCfg;
|
||||
caldavCfg?: CaldavCfg;
|
||||
openProjectCfg?: OpenProjectCfg;
|
||||
giteaCfg?: GiteaCfg;
|
||||
redmineCfg?: RedmineCfg;
|
||||
|
||||
formBasic: UntypedFormGroup = new UntypedFormGroup({});
|
||||
|
|
|
|||
|
|
@ -73,12 +73,27 @@ export class PluginIssueProviderAdapterService implements IssueServiceInterface
|
|||
return '';
|
||||
}
|
||||
try {
|
||||
return await provider.definition.getIssueLink(String(issueId), cfg.pluginConfig);
|
||||
const link = provider.definition.getIssueLink(String(issueId), cfg.pluginConfig);
|
||||
if (link) {
|
||||
return link;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(
|
||||
`[PluginIssueAdapter] getIssueLink failed for ${cfg.issueProviderKey}:`,
|
||||
e,
|
||||
);
|
||||
}
|
||||
// Fallback for providers whose links can't be derived from id + config
|
||||
// (e.g. Linear, whose URL needs the workspace slug): the canonical URL is
|
||||
// carried on the issue itself, so fetch it on demand.
|
||||
try {
|
||||
const issue = (await this.getById(issueId, issueProviderId)) as PluginIssue | null;
|
||||
return issue?.url ?? '';
|
||||
} catch (e) {
|
||||
console.error(
|
||||
`[PluginIssueAdapter] getIssueLink url fallback failed for ${cfg.issueProviderKey}:`,
|
||||
e,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ const BUNDLED_PLUGIN_PATHS = [
|
|||
'assets/bundled-plugins/automations',
|
||||
'assets/bundled-plugins/github-issue-provider',
|
||||
'assets/bundled-plugins/clickup-issue-provider',
|
||||
'assets/bundled-plugins/gitea-issue-provider',
|
||||
'assets/bundled-plugins/linear-issue-provider',
|
||||
'assets/bundled-plugins/brain-dump',
|
||||
'assets/bundled-plugins/voice-reminder',
|
||||
'assets/bundled-plugins/google-calendar-provider',
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
},
|
||||
{
|
||||
"resourceType": "total",
|
||||
"budget": 250
|
||||
"budget": 260
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue