@appaflytech/zeyrek-ai-mcp 0.0.71 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/knowledge/componentCatalog.js +23 -1
- package/dist/knowledge/componentEvents.js +6 -0
- package/dist/knowledge/coverage.js +193 -0
- package/dist/knowledge/normalize.js +41 -0
- package/dist/knowledge/rules.js +16 -0
- package/dist/platform/capture/capture.js +5 -0
- package/dist/resources/guides/microservice.md +36 -0
- package/dist/resources/schema-fingerprint.json +2 -2
- package/dist/resources/schemas/CreateMicroserviceCommand.json +3 -0
- package/dist/resources/schemas/MicroserviceDto.json +3 -0
- package/dist/resources/schemas/UpdateMicroserviceCommand.json +3 -0
- package/dist/tools/designSchemaPatch.js +2 -2
- package/dist/tools/flows.js +35 -1
- package/dist/tools/microservices.js +69 -3
- package/dist/tools/pages.js +20 -5
- package/dist/tools/projects.js +46 -3
- package/package.json +1 -1
|
@@ -94,11 +94,13 @@ export const componentKnowledge = {
|
|
|
94
94
|
"YERLEŞİM VE FİLTRE MODLARI (2026-09-18; 2026-09-21'den beri gelişmiş oluşturucu filterMode değil advancedFilter anahtarıdır ve column/bar ile birlikte açılabilir): advancedFilter (koşul oluşturucu: tümü/herhangi biri, VE/VEYA, grup; kurallar tutamaçtan sürüklenip grubun içine/dışına taşınır; Uygula yalnız her kuralın kolonu ve değeri doluyken görünür, Sıfırla yalnız uygulanmış filtre ya da taslakta kural varken; ziyaretçi filtreyi adıyla kaydedebilir — tanıma yazılmaz, tarayıcıda element id'siyle saklanır (localStorage ZY_DataTableFilters_<elementId>), üst çubukta Filtre düğmesinin yanındaki 'Kayıtlı filtreler' açılır menüsünden (filterPosition left'te sağında, right'ta solunda) panel açılmadan seçilip uygulanır, kanvasta yoktur; filtre yokken panel boş bir kuralla açılır; 'Filtre (n)' düğmesiyle açılır, Ctrl+Enter uygular — düğme ARAÇ GRUBUNUN PARÇASI DEĞİLDİR (2026-09-18): araçlar nerede olursa olsun tablonun üstündeki çubukta durur, filterPosition left'te başlığın hemen ardına, right'ta sağ kenara) · column (başlığın altında kolon başına filtre satırı: metinde işleç menüsü, sayı/tarihte min–max (bağlı tablonun birincil anahtarı hariç: tek değer, eşittir; date ve datetime kolonda gün seçilir ve gte 'GÜNT00:00:00' · lte 'GÜNT23:59:59' gider — bitiş günü dahildir, 2026-10-02), boolean Tümü/Evet/Hayır, enum/tag'de çoklu seçim, relation'da lookup) · bar (tablo üstünde kolon başına açılır düğme + panel) · none. ÜÇ MOD DA AYNI filters sözleşmesini yazar ve mount'u tetikler — bağlı tabloda işleçler capability.operators'tan gelir (aralık yalnız gte+lte sunulursa), enabled:false kolon hiçbir modda çıkmaz; column/bar ekranı her zaman filters prop'undan kurulur (sunucu 422 ile reddedince geri yazılan filtre görünür). showFilterSummary aktif filtre + sıralamayı kaldırılabilir chip'ler olarak gösterir; bar modunda çizilmez (aktif filtreler barın haplarında durur ve oradan düzenlenir), sonuç sayısı ne barda ne özette yazılır — footer'daki kayıt özeti taşır. Başlık (title) boşsa üst çubuk yalnız araçlar üstteyse ya da advanced filtre düğmesi varsa çizilir; başlıksız tabloda filterMode bar iken üst köşedeki araçlar ayrı çubuk açmaz, filtre çubuğunun ucuna oturur. Araçlar (showRefresh · showExport: bu sayfanın CSV'si · showColumnManager: 'Column settings' menüsü — kolon gizle/göster ve sürükleyerek (ya da tutamaçta ↑/↓) sırala, tanıma yazılmaz; seçim tarayıcıda element id'siyle saklanır (localStorage ZY_DataTableColumns_<elementId>) ve tablo aynı kolonlarla açılır, Reset kaydı siler, kanvas okumaz; üçü de yalnız ikon + tooltip) toolsPosition ile dört köşeden birine oturur; footer (sol altta kayıt özeti '1–10 / 24 kayıt · 1 seçili' — showRecordSummary ile kapatılır —, sayfa başına, «ilk ‹önceki sayfa numaraları sonraki› son» düğmeleri) footerPosition ile tablonun altında ya da üstündedir; sayfalama paginationPosition ile kayıt sayısının ardında (left) ya da sağ kenardadır, stickyFooter footer'ı sayfa kaydırmasında görünür kenara yapıştırır. stickyHeader başlığı tablonun KENDİ kaydırmasında üstte tutar (sabit yükseklikli tablo); kolonun isPinned'i kolonu başa alıp yatay kaydırmada solda sabitler. size sm|md|lg satır yüksekliğini, hücre boşluğunu ve yazı boyunu değiştirir. YENİ BIRAKILAN TABLO (2026-09-18): başlıksız, filterMode bar, araçlar sağ üstte (filtre çubuğunun ucunda), isPaginated açık, sayfalama sağ altta, kayıt özeti sol altta, stickyHeader açık, size md, Status kolonu solid tag; bu değerler yalnız şema varsayılanıdır — prop'u hiç yazılmamış eski düğüm eski görünüşünü korur (advanced, sağ üst araçlar, sağda sayfalama, yapışkan başlık kapalı). paginationMode pages (numaralı) | infinite (gövde sona kaydırıldıkça sonraki sayfa offset=yüklenen satır sayısıyla istenir ve satırlar birikir; kendi yüksekliğiyle uzayan tabloda footer'da 'Daha fazla' düğmesi). Gövde durumları: yükleniyor (iskelet), kayıt yok, filtre sonucu boş (Filtreleri kaldır), hata (loadError; Tekrar dene mount'u yeniden çalıştırır, satır varken tablo üstünde şerit).",
|
|
95
95
|
"TİPE BAĞLI İLİŞKİ (2026-10-01, ADR 0012): 'Kime' gibi bir hücre satırın türüne göre farklı tabloya bağlanıyorsa (hedef başına ayrı nullable FK: hedef_user_id, hedef_pozisyon_id, hedef_birim_id) kolonu görünen adı tutan METİN alanına bağla ve columns[i].relationTypeField = türü tutan alan (ör. hedef_tipi), relationTargets = [{ value:'kullanici', field:'hedef_user_id' }, …] yaz. Hedef FK kolonları columns'ta isHidden:true durmalı ve tanımın editable listesinde olmalı (tür, ad ve üç FK). Satır düzenlemesinde hücre o satırın (taslaktaki) türünün gizli ilişki kolonunun lookup'ını açar; seçim TEK YAMAYLA seçilen FK'yi, öbür FK'leri null'u ve görünen adı (hedefin görünen alanı) yazar; tür değişince FK'ler ve ad boşalır. Tür boşken hücre salt okunurdur. Toplu düzenleme bu kolonu sunmaz. Birden çok türün paylaştığı hedef tabloda (birimler: departman/firma/grup) relationTargets öğesine filterField + filterValues ('holding, company') ve isteğe bağlı excludeField + excludeValues yazılır; alanlar tanımda o FK'nin lookup.behavior.filterable listesinde olmalı. Tür değişince Kime seçicisi hemen açılır; seçimsiz kapanırsa tür ve Kime eski hâline döner. Kayıt satırın kaydıdır — editMode row önerilir.",
|
|
96
96
|
"SÜRÜKLE-SIRALA (2026-10-01, ADR 0012): canReorderRows:true + orderField:'<sayı alanı>' (editMode none değilken ve sıra kolonu yazılabilirken) satır başına tutamaç kolonu açar; satırlar orderField'a göre çizilir (boşlar sonda). Sürükle ya da tutamaç odaktayken ↑/↓. Bırakılan satır kendi adımı olur, aynı sıradaki satırlar grup kalır (iki eş sıralı satırın arasına bırakılan o gruba katılır), adımlar 1..n yeniden numaralanır; yalnız değeri değişen satırlar yazılır. row/cell kipinde hemen tek save (operation rowReorder), batch'te taslakta bekler. Yeni ve anahtarsız satır taşınmaz; açık düzenleme, toplu seçim ya da süren kayıt varken tutamaç pasiftir. Eş sıra vermek için sıra hücresi elle düzenlenir.",
|
|
97
|
+
"AĞAÇ (2026-11-09): treeParentField doluysa düz satırlar hiyerarşik çizilir — ayrıntı propNotes.treeParentField. Gizlenen (kapalı daldaki) satır listeden çıkmaz: seçim, taslak ve satır hatası dal yeniden açılınca yerindedir.",
|
|
97
98
|
],
|
|
98
99
|
propNotes: {
|
|
99
100
|
searchText: "Gizli, AKIŞIN yazdığı arama metni (2026-10-02, web ve mobil). Tablonun kendi arama kutusu yoktur; ayrı bir textinput'un değeri setter ile <tablo>.searchText'e yazılır. Bağlı tabloda setter bu yazımdan sonra listeyi YENİDEN OKUR (sayfa başa döner) ve istek search taşır: sunucu tanımın behavior.searchable alanlarında içerir (icontains) koşuluyla arar — entity kaynağında ve dinamik filtreli Table kaynaklı microservice'te. Searchable boşsa istek 422 ConnectDataFilterNotAllowed. Aynı yol filters / sortField / sortType / offset / limit için de geçerlidir: setter bunlardan birini yazınca bağlı liste yeniden okunur.",
|
|
100
101
|
texts: "Gizli (2026-10-15, ADR 0023): tablonun KENDİ kelimelerinden (araç çubuğu, sayfalama, boş durum, filtre kurucu, işleç yazıları — 'Rows per page', 'No records yet', 'Equals' …) yalnız BU düğümde değiştirilenler; kelime → düz metin ya da çeviri sarmalı ({ rowsPerPage: { type:'translation', ref:'page.x.satir' } }). Yazılmayan kelime uygulama sözlüğündeki compProp.datatable.<kelime> satırından, o da yoksa bileşenin tohum metninden gelir. Bütün tabloların kelimesini değiştirmek için sayfaya DEĞİL sözlüğe yazılır (translation_update compProp.datatable.<kelime>); Kelimeler (124): filters, refresh, exportPage, columns, previous, next, first, last, goToPage, rowsPerPage, clear, addRule, addGroup, group, removeGroup, remove, valuePlaceholder, selectColumn, and, or, actions, clearFilters, yes, no, filterOperator, filterTextPlaceholder, filterDatePlaceholder, save, discard, changes, newCount, deleteCount, errorCount, revertAll, saveChanges, newBadge, deleteBadge, undoDelete, deleteRow, confirmDelete, saveRow, discardRow, saveCell, discardCell, rowNotSaved, bulkEdit, bulkLimit, confirmBulkDelete, selectRow, selectAllRows, reorderRow, searchPlaceholder, noResults, loadMore, clearSelection, selectedCount, apply, pickValue, openLookup, lookupTitle, lookupHintSingle, lookupHintMultiple, lookupHintBrowse, cleared, pageRange, editRow, doneEditing, bulkEditHint, recordOfTotal, recordCount, loadingMore, pageSize, addNewRow, addRowShortcut, emptyTitle, emptyText, noMatchTitle, noMatchText, errorTitle, retry, advancedFilter, filterPanelTitle, matchPrefix, matchAll, matchAny, matchSuffix, where, reset, all, min, max, from, to, searchValues, columnSettings, resizeColumn, moveColumn, clearColumnFilter, removeFilter, filterColumn, dragRule, dropHere, saveFilter, savedFilters, filterName, filterNamePlaceholder, sameNameOverwrites, cancel, deleteSavedFilter; işleç menüsü yazıları op<İşleç>: opSameday, opEq, opNeq, opLt, opLte, opGt, opGte, opContains, opIcontains, opIn, opNotin; filtre çipindeki kısa yazılar: opShortContains, opShortIcontains, opShortIn, opShortNotin. Studio'da aynı liste tablonun Translations sekmesinde.",
|
|
101
102
|
canReorderRows: 'boolean (varsayılan false) — satırları tutamaçtan sürükleyerek sıralama; orderField olmadan ya da editMode none iken etkisiz.',
|
|
103
|
+
treeParentField: "AĞAÇ GÖRÜNÜMÜ (2026-11-09): satırın ÜSTÜNÜ gösteren alanın adı (ör. kategoride üst kategori ilişkisi; ilişki nesnesi { id } ya da ham anahtar okunur). Boşsa tablo düzdür. Doluysa satırlar keyField'ı bu alanda geçen satırın hemen altına dizilir (derinlik sınırı yok), ilk görünen kolonda seviye başına 20px girinti + aç/kapa (▾/▸) çizilir, üst satır kalındır; açılışta her dal açıktır, aç/kapa ziyaretçinindir (tanıma yazılmaz). Kardeşler gelen sırayı korur (sıralama her seviyede geçerli), üstü listede olmayan (başka sayfada / süzülmüş) satır köktür, döngüdeki satır köke çıkar. Ağaç YÜKLÜ satırlardan kurulur: sayfalı tabloda dal sayfa sınırında bölünebilir — tam ağaç için isPaginated:false ya da yeterli limit. Açıkken sürükle-sırala kapalıdır. Satırlar DÜZ gelir; children dizisi okunmaz.",
|
|
102
104
|
orderField: "Sırayı tutan sayı alanının adı (ör. 'sira'); canReorderRows açıkken satırlar buna göre çizilir ve sürükleme buraya yazar.",
|
|
103
105
|
surfaceStyle: NODE_SURFACE_NOTE + " Datatable'ın kabı VARSAYILAN olarak kendi 1px çerçevesini, 6px köşesini ve yüzey zeminini çizer (filtre çubuğu + ızgara + footer'ı saran çerçeve). Grupta bir kenarlık yazılınca (borderTop/Right/Bottom/Left — 'none' dahil) kap KENDİ çerçevesini bırakır: çerçeveyi kaldırmak için dört yöne 'none' yaz; düz çizgi yazmak ikinci çerçeve eklemez. radius yazılınca kap köşeyi düğüm kutusundan alır, background yazılınca kabın zemini saydamlaşır (2026-09-18).",
|
|
104
106
|
editMode: "none | row | cell | batch (tasarımcı etiketleri Row / Cell / Batch). Bağlı tabloda runtime tanımın behavior.edit.saveMode'undan yazar; elle yazmak bağlı tabloda etkisizdir. Bağlı olmayan tabloda save olayındaki self.changeset'i akış yazar.",
|
|
@@ -514,7 +516,8 @@ export const componentKnowledge = {
|
|
|
514
516
|
"optionType='grouped' iken children alt satırları çizer; çocuğu olan satır VARSAYILAN OLARAK SEÇİLEMEZ: kutusu çizilmez ve satırın kendisi disabled'dır, açıp kapatmak yalnız sağdaki ok düğmesiyle (ya da klavyede Enter/ok tuşlarıyla) olur — başlık da seçilebilsin isteniyorsa o option'a isSelectable ver. optionType='single' iken children/isExpanded/isSelectable okunmaz. Connect Data ile kurulan ağaçta (children rolü) her satır kaynağın kaydıdır: isExpanded / isSelectable rolü bir alana eşlenmediyse satırlar AÇIK ve SEÇİLEBİLİR gelir (2026-10-05).",
|
|
515
517
|
"ÇİPLER SARAR (2026-10-05, datatable'ın Connect Data ilişki alanıyla aynı görünüm): etiketin tamamı görünür, sığmayan çip alt satıra geçer ve alan büyür; '+n' rozeti, çipte X ve alanda X YOKTUR, Backspace bir şey silmez. Seçim panelde kutunun işareti kaldırılarak ya da panelin altındaki 'Seçimi temizle' ile kaldırılır. Arama kutusu panelin üstündedir ve açılınca odaklanır; her tıklama hemen yazar ve panel açık kalır (Uygula yok). Escape ve temizleme paneli kapatıp odağı alana verir. Tab ile alana gelmek focus yayar (bir kez); panelde Tab seçeneklerden geçmez (ok tuşları gezer); dışarı tıklamak paneli kapatır ve blur yayar. Salt okunur, görüntüleme ve devre dışı alan odak almaz.",
|
|
516
518
|
"Doğrulama kuralları: required · minItems · maxItems (2026-09-11; `pattern` bildirimi kaldırıldı — değeri dizi olan alanda uygulanacak metin yok ve panelde hiç çizilemiyordu). Panel bu iki sayı kuralını 'Min length' / 'Max length' adıyla çizer; dizide uzunluk = SEÇİLİ ELEMAN SAYISI. minItems/maxItems yazılırsa gateway min-length/max-length'e çevirir.",
|
|
517
|
-
"LOOKUP (2026-10-05, ADR 0007): kök `lookup`'ı açık bağlı multi-select'te ↗ pencereyi ÇOKLU kipte açar — satıra tıklamak soldaki kutuyu işaretler, pencere açık kalır, Uygula tüm seçimi change { value: [{ value, label, id, text }] } olarak yazar (işaretlenme sırasıyla). Önceden seçilenler işaretli gelir ve ilk açılışta (süzülmeden, sıralanmadan, ilk sayfada) `ids` ile ayrıca okunup EN ÜSTTE durur. Escape değişikliği yazmadan kapatır. Kanvasta, salt okunur/görüntüleme/devre dışı kipte ↗ yoktur."
|
|
519
|
+
"LOOKUP (2026-10-05, ADR 0007): kök `lookup`'ı açık bağlı multi-select'te ↗ pencereyi ÇOKLU kipte açar — satıra tıklamak soldaki kutuyu işaretler, pencere açık kalır, Uygula tüm seçimi change { value: [{ value, label, id, text }] } olarak yazar (işaretlenme sırasıyla). Önceden seçilenler işaretli gelir ve ilk açılışta (süzülmeden, sıralanmadan, ilk sayfada) `ids` ile ayrıca okunup EN ÜSTTE durur. Escape değişikliği yazmadan kapatır. Kanvasta, salt okunur/görüntüleme/devre dışı kipte ↗ yoktur.",
|
|
520
|
+
"AĞAÇ (2026-11-09): Connect Data'ya bağlı listede tanımın mapping.roles.children'ı satırın ÜST kayıt alanına eşlenirse (ör. üst kategori) satırlar sunucudan ağaç olarak gelir (f-32, ilk 1000 satır, 10 seviye) — ama liste yalnız optionType:'grouped' iken ağaç çizer (single'da children silinir). Bağlı ağaçta üst kayıt da seçilebilir ve açık gelir. Aynı rol ↗ bakma penceresini de ağaç yapar: satırlar üst alanına göre girintili, aç/kapalı dizilir (üst alan pencere kolonlarından biri olmalı; ağaç yüklü sayfadan kurulur, üstü sayfada olmayan satır köktür). Üst satırı işaretlemek altlarını seçmez.",
|
|
518
521
|
],
|
|
519
522
|
propNotes: {
|
|
520
523
|
value: "Seçili değerlerin dizisi — ilişki alanlarında etiket değil id yazılır/okunur. Düz değer dizisi de (['a', 'b']) geçerlidir; etiketler options yüklendiğinde tazelenir.",
|
|
@@ -2124,6 +2127,25 @@ export const componentKnowledge = {
|
|
|
2124
2127
|
},
|
|
2125
2128
|
guide: 'translation'
|
|
2126
2129
|
},
|
|
2130
|
+
captcha: {
|
|
2131
|
+
summary: 'Formun gönderilmeden önce güvenlik doğrulamasından (Turnstile / reCAPTCHA / hCaptcha) geçmesini ister; kodu platform sunucuda sağlayıcıya sorar (ADR 0035).',
|
|
2132
|
+
behavior: [
|
|
2133
|
+
'Sağlayıcı ve anahtarlar bileşende DEĞİL proje ayarındadır (Studio › proje ayarları › Captcha; gizli anahtarı insan girer, MCP bu ayarı YAZAMAZ). Ayar var mı ve hangi sağlayıcı: project_get yanıtındaki captcha bloğu ({ configured, provider }). Ayar yoksa kutu yerine "Captcha ayarlı değil" çizilir ve form gönderilemez; ayarsız projede captcha eklemek CAPTCHA-003 uyarısı alır.',
|
|
2134
|
+
'Form içindeki captcha HER ZAMAN zorunludur (kilitli kural, panelde kapatılamaz): çözülmeden submit yayılmaz. Bileşenin validations bildirimi yoktur.',
|
|
2135
|
+
"Gizli captcha da zorunludur: form gizli alanları doğrulamadan çıkarır ama kilitli kuralı olanı çıkarmaz — isHidden: true (ya da koşulla gizlenen) captcha'yı kullanıcı çözemez ve form hiç gönderilmez. Captcha'yı görünür bırak; isHidden yazımı CAPTCHA-004 uyarısı alır.",
|
|
2136
|
+
"Form başına BİR captcha: formdaki her captcha zorunludur, servis ise tek kodu (X-Captcha-Token) doğrular ve akış yalnız bağlı olanı yeniler. İkinci captcha CAPTCHA-005 uyarısı alır.",
|
|
2137
|
+
"Sunucu kapısı servistedir: servisi requiresCaptcha: true yap ve servis adımının 'X-Captcha-Token' parametresini source: 'header' ile YALNIZ bu bileşenin value'suna bağla (value type:'property'; source'suz parametre başlıkta gitmez; ifade bağı kabul edilmez — kutu yenilenmez). Bağın hedefi sayfadaki bir captcha düğümü olmalı; captcha olmayan ya da sayfada olmayan düğüm FLOW-049 alır. Akışların zaten çağırdığı servisi sonradan işaretlemek MS-029 ile kodsuz çağıran akışları listeler. İşaretli servis kodsuz/geçersiz isteği akışa sokmadan reddeder: CaptchaRequiredException / CaptchaInvalidException (422), CaptchaNotConfiguredException (422), CaptchaUnavailableException (503).",
|
|
2138
|
+
'Kod tek kullanımlıktır: servis adımı istek döndükten sonra (başarılı ya da hatalı) bağlı captcha’nın value’sunu boşaltır, kutu kendini yeniler. Akıştan value’yu boşaltmak da kutuyu sıfırlar.',
|
|
2139
|
+
"mode: 'invisible' yalnız Turnstile'da çalışır; sağlayıcı görünmezi yürütemiyorsa ya da projede görünmez anahtarı yoksa kutucuk çizilir.",
|
|
2140
|
+
'Yerel kurulumda (test kipi) sağlayıcının "hep geçer" test anahtarları kullanılır; gerçek captcha gerçek alan adında görünür. Tasarım kanvasında script yüklenmez, yer tutucu çizilir.'
|
|
2141
|
+
],
|
|
2142
|
+
propNotes: {
|
|
2143
|
+
value: "Runtime yazar: '<görünüm>:<kod>' (ör. 'checkbox:...'); panelde çizilmez, elle yazılmaz — page_schema_patch dolu değeri CAPTCHA-001 ile reddeder (boşaltma '' serbest).",
|
|
2144
|
+
rejection: "Runtime yazar: servis isteği captcha yüzünden reddedilince (Captcha*Exception) akış hata kodunu yazar ve kutunun altında dile göre ileti çıkar; sonraki başarılı istek boşaltır. Başlığa bağlı captcha yoksa ret sayfadaki bütün captcha'lara yazılır. Elle yazılmaz.",
|
|
2145
|
+
mode: "'checkbox' (varsayılan) ya da 'invisible' (yalnız Turnstile).",
|
|
2146
|
+
size: "'normal' ya da 'compact'."
|
|
2147
|
+
}
|
|
2148
|
+
},
|
|
2127
2149
|
otpinput: {
|
|
2128
2150
|
summary: 'Tek haneli kutulardan oluşan tek kullanımlık kod girişi (2–12 hane); yapıştırma kutulara dağılır.',
|
|
2129
2151
|
behavior: [
|
|
@@ -546,6 +546,12 @@ export const componentEventContracts = {
|
|
|
546
546
|
reads: "event.data.reason — kapatma düğmesi 'user', zaman aşımı 'timeout'. Bandı yeniden açmak akışın işidir: props.isHidden false yazılmadıkça kapalı kalır. 2026-09-17'den önce bu emit toggled adıyla yayılıyordu ve şemada bildirilmediği için akışa BAĞLANAMIYORDU"
|
|
547
547
|
}
|
|
548
548
|
},
|
|
549
|
+
captcha: {
|
|
550
|
+
mount: NO_DATA,
|
|
551
|
+
change: valueChange("string ('<görünüm>:<kod>'; süre dolunca ve kod gönderilince '')"),
|
|
552
|
+
expire: NO_DATA,
|
|
553
|
+
error: NO_DATA
|
|
554
|
+
},
|
|
549
555
|
otpinput: {
|
|
550
556
|
mount: NO_DATA,
|
|
551
557
|
change: valueChange('string (birleşik kod)'),
|
|
@@ -4,6 +4,199 @@ function asObjects(value) {
|
|
|
4
4
|
const FORM_TYPES = new Set(['form']);
|
|
5
5
|
const WRITE_METHODS = new Set(['post', 'put', 'patch']);
|
|
6
6
|
const SIGN_IN_PATTERN = /giri[sş]|login|sign-?in|oturum/i;
|
|
7
|
+
const CAPTCHA_TYPE = 'captcha';
|
|
8
|
+
const CAPTCHA_TOKEN = 'X-Captcha-Token';
|
|
9
|
+
const VALUE_WRITING_OPS = new Set(['replace_prop', 'set_binding', 'set_prop_type', 'set_connect_data']);
|
|
10
|
+
function nodeTypes(nodes, into = new Map()) {
|
|
11
|
+
for (const node of asObjects(nodes)) {
|
|
12
|
+
if (typeof node.elementId === 'string')
|
|
13
|
+
into.set(node.elementId, String(node.type ?? ''));
|
|
14
|
+
nodeTypes(node.children, into);
|
|
15
|
+
}
|
|
16
|
+
return into;
|
|
17
|
+
}
|
|
18
|
+
function isEmptyValue(value) {
|
|
19
|
+
if (value === undefined || value === '')
|
|
20
|
+
return true;
|
|
21
|
+
const wrapper = value;
|
|
22
|
+
return Boolean(wrapper) && typeof wrapper === 'object' && wrapper.type === 'static' && (wrapper.data === '' || wrapper.data === undefined);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* CAPTCHA-001 (2026-11-06 ajan testi Y-1) — captcha'nın `value`'sunu runtime yazar (`<görünüm>:<kod>`). Elle yazılan değer
|
|
26
|
+
* formun "çözülmeden gönderme" kilidini açar: ajan `checkbox:elle-yazilmis-kod` yazınca form captcha çözülmeden gönderildi;
|
|
27
|
+
* `value: null` ile geri alma da gövdede değersiz bir sarmal bıraktı ve kilit geri gelmedi. Yalnız boşaltma (`''`) serbesttir.
|
|
28
|
+
* Hedefin tipi kayıtlı ağaçtan ya da aynı yamada eklenen gövdeden okunur. Döner: kuralı çiğneyen düğümlerin elementId'leri.
|
|
29
|
+
*/
|
|
30
|
+
export function captchaValueWrites(ops, schema) {
|
|
31
|
+
const operations = asObjects(ops);
|
|
32
|
+
const types = nodeTypes(schema);
|
|
33
|
+
const offending = [];
|
|
34
|
+
for (const op of operations.filter(op => op.op === 'add_component')) {
|
|
35
|
+
const component = (op.component ?? {});
|
|
36
|
+
if (typeof component.elementId === 'string')
|
|
37
|
+
types.set(component.elementId, String(component.type ?? ''));
|
|
38
|
+
if (String(component.type ?? '') !== CAPTCHA_TYPE)
|
|
39
|
+
continue;
|
|
40
|
+
if (!isEmptyValue((component.props ?? {}).value))
|
|
41
|
+
offending.push(String(component.elementId ?? '?'));
|
|
42
|
+
}
|
|
43
|
+
for (const op of operations.filter(op => VALUE_WRITING_OPS.has(String(op.op)))) {
|
|
44
|
+
const target = String(op.target ?? '');
|
|
45
|
+
if (types.get(target) !== CAPTCHA_TYPE || (op.prop ?? op.path) !== 'value')
|
|
46
|
+
continue;
|
|
47
|
+
if (op.op === 'replace_prop' && isEmptyValue(op.value))
|
|
48
|
+
continue;
|
|
49
|
+
offending.push(target);
|
|
50
|
+
}
|
|
51
|
+
return [...new Set(offending)];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* FLOW-049'un bağ denetimi (ADR 0035 K-2, B-14). Kod `X-Captcha-Token` başlığında (`source: 'header'`), sayfadaki captcha
|
|
55
|
+
* düğümünün `value`'sundan (`type: 'property'`) gider. 2026-11-06 2. tur ajan testi: textinput'a ve rehber örneğinin yer
|
|
56
|
+
* tutucusuna (`<captcha düğümü>`) bağlanan token uyarısız geçti, her gönderim 422 aldı, textinput her gönderimden sonra
|
|
57
|
+
* boşaldı (MCP-1); altı farklı yanlış bağ aynı iletiyi aldı (MCP-8). Döner: bağın neden tutmadığı, bağ doğruysa
|
|
58
|
+
* `undefined`. Barındırıcının ağacı boşsa (okunamadı ya da şema kurulmadı) hedefin varlığı ve tipi denetlenmez.
|
|
59
|
+
*/
|
|
60
|
+
export function captchaTokenProblem(parameters, hostNodes) {
|
|
61
|
+
const token = asObjects(parameters).find(parameter => parameter.name === CAPTCHA_TOKEN);
|
|
62
|
+
if (!token)
|
|
63
|
+
return `'${CAPTCHA_TOKEN}' parametresi yok`;
|
|
64
|
+
if (token.source !== 'header')
|
|
65
|
+
return token.source === undefined ? 'parametrede source yok, kod başlıkta gitmez' : `parametre source: '${String(token.source)}', kod başlıkta gitmez`;
|
|
66
|
+
const value = (token.value ?? {});
|
|
67
|
+
if (value.type !== 'property')
|
|
68
|
+
return value.type === undefined ? 'parametrenin bağı yok' : `bağ '${String(value.type)}' tipinde, bileşen bağı (type: 'property') değil: akış kod gönderildikten sonra kutuyu yenileyemez`;
|
|
69
|
+
const ref = (value.ref ?? {});
|
|
70
|
+
const element = typeof ref.element === 'string' ? ref.element : '';
|
|
71
|
+
if (element === '')
|
|
72
|
+
return 'bağda bileşen seçilmemiş (ref.element boş)';
|
|
73
|
+
if (ref.property !== 'value')
|
|
74
|
+
return `bağ '${element}' bileşeninin '${String(ref.property ?? '')}' özelliğine gidiyor, kod value'dadır`;
|
|
75
|
+
const types = nodeTypes(hostNodes);
|
|
76
|
+
if (types.size === 0)
|
|
77
|
+
return undefined;
|
|
78
|
+
const type = types.get(element);
|
|
79
|
+
const captchas = [...types].filter(([, nodeType]) => nodeType === CAPTCHA_TYPE).map(([id]) => id);
|
|
80
|
+
const known = captchas.length > 0 ? `sayfadaki captcha düğümleri: ${captchas.join(', ')}` : 'sayfada captcha düğümü yok';
|
|
81
|
+
if (type === undefined)
|
|
82
|
+
return `'${element}' sayfada yok (${known})`;
|
|
83
|
+
if (type !== CAPTCHA_TYPE)
|
|
84
|
+
return `'${element}' bir captcha değil (${type}); ${known}`;
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* CAPTCHA-003 (2026-11-06 2. tur ajan testi MCP-3) — ayarsız projede captcha ekleme, servis işaretleme ve akış bağlama
|
|
89
|
+
* uyarısız geçiyordu; form hiç gönderilemedi ve son kullanıcı dolduramayacağı bir alan için "zorunlu" iletisi gördü.
|
|
90
|
+
* `cause` neyin captcha istediğini söyler (eklenen captcha, işaretlenen servis, captcha zorunlu servise giden adım).
|
|
91
|
+
*/
|
|
92
|
+
export function captchaNotConfiguredMessage(project, cause) {
|
|
93
|
+
return `CAPTCHA-003: '${project}' projesinde captcha ayarı yok — ${cause}. Sayfada captcha 'Captcha ayarlı değil' diye çizilir, kullanıcı onu çözemez ve form gönderilemez; kodlu çağrı 422 CaptchaNotConfiguredException alır. Ayarı bir insan Studio'da Project › Settings › Captcha'dan kurar (sağlayıcı ve anahtarlar MCP'den yazılmaz); durumu project_get yanıtındaki captcha bloğundan okuyun.`;
|
|
94
|
+
}
|
|
95
|
+
/** Bu yamanın eklediği captcha düğümleri; eklenen gövdenin içindekiler dahil (CAPTCHA-003). */
|
|
96
|
+
export function addedCaptchaIds(ops) {
|
|
97
|
+
return asObjects(ops)
|
|
98
|
+
.filter(op => op.op === 'add_component')
|
|
99
|
+
.flatMap(op => [...nodeTypes([op.component])].filter(([, type]) => type === CAPTCHA_TYPE).map(([elementId]) => elementId));
|
|
100
|
+
}
|
|
101
|
+
export function captchaValueMessage(elementIds) {
|
|
102
|
+
return `CAPTCHA-001 — captcha'nın value'sunu runtime yazar (istek gönderilmedi): ${elementIds.join(' · ')}. Değer sağlayıcının çözülmüş kodudur ('<görünüm>:<kod>'); elle yazılan değer formun "çözülmeden gönderme" kilidini açar ve servis kodu yine reddeder. value'ya yazmayın; daha önce yazılmış bir değeri temizlemek için yalnız replace_prop { prop: 'value', value: '' } kabul edilir.`;
|
|
103
|
+
}
|
|
104
|
+
function captchaForms(nodes, form, into) {
|
|
105
|
+
for (const node of asObjects(nodes)) {
|
|
106
|
+
const type = String(node.type ?? '');
|
|
107
|
+
if (type === CAPTCHA_TYPE && typeof node.elementId === 'string')
|
|
108
|
+
into.set(node.elementId, form);
|
|
109
|
+
captchaForms(node.children, FORM_TYPES.has(type) && typeof node.elementId === 'string' ? node.elementId : form, into);
|
|
110
|
+
}
|
|
111
|
+
return into;
|
|
112
|
+
}
|
|
113
|
+
function touchedElementIds(ops) {
|
|
114
|
+
const touched = new Set();
|
|
115
|
+
for (const op of asObjects(ops)) {
|
|
116
|
+
if (op.op === 'add_component')
|
|
117
|
+
for (const elementId of nodeTypes([op.component]).keys())
|
|
118
|
+
touched.add(elementId);
|
|
119
|
+
if (op.op === 'move_component')
|
|
120
|
+
touched.add(String(op.target ?? ''));
|
|
121
|
+
}
|
|
122
|
+
return touched;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* CAPTCHA-002 (2026-11-06 ajan testi Y-2) — captcha'nın kilidi formdadır: form dışındaki captcha zorunlu değildir, akış onu
|
|
126
|
+
* hiçbir gönderimde beklemez. Yalnız bu yamanın eklediği (eklenen gövdenin içindekiler dahil) ya da taşıdığı captcha'lar, yama
|
|
127
|
+
* uygulanmış ağaçta denetlenir.
|
|
128
|
+
*/
|
|
129
|
+
export function captchaOutsideFormWarnings(simulated, ops) {
|
|
130
|
+
const touched = touchedElementIds(ops);
|
|
131
|
+
return [...captchaForms(simulated, null, new Map()).entries()]
|
|
132
|
+
.filter(([elementId, form]) => touched.has(elementId) && form === null)
|
|
133
|
+
.map(([elementId]) => `CAPTCHA-002: '${elementId}' captcha'sı bir formun içinde değil — kilidi form uygular (çözülmeden submit yayılmaz); form dışındaki captcha hiçbir gönderimi beklemez ve kodu bir servise bağlansa da kullanıcı onu çözmeden gönderebilir. Captcha'yı formun içine taşıyın (move_component { target: '${elementId}', parent: '<form elementId>' }).`);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* CAPTCHA-005 (2026-11-06 2. tur ajan testi MCP-5) — formdaki her captcha zorunludur: iki captcha'lı formu kullanıcı ikisini de
|
|
137
|
+
* çözmeden gönderemez, servis ise tek kod (`X-Captcha-Token`) doğrular ve akış yalnız bağlı olanı yeniler. Yama uygulanmış
|
|
138
|
+
* ağaçta, bu yamanın eklediği ya da taşıdığı bir captcha'yı tutan form denetlenir.
|
|
139
|
+
*/
|
|
140
|
+
export function captchaPerFormWarnings(simulated, ops) {
|
|
141
|
+
const touched = touchedElementIds(ops);
|
|
142
|
+
const byForm = new Map();
|
|
143
|
+
for (const [elementId, form] of captchaForms(simulated, null, new Map())) {
|
|
144
|
+
if (form !== null)
|
|
145
|
+
byForm.set(form, [...(byForm.get(form) ?? []), elementId]);
|
|
146
|
+
}
|
|
147
|
+
return [...byForm.entries()]
|
|
148
|
+
.filter(([, captchas]) => captchas.length > 1 && captchas.some(elementId => touched.has(elementId)))
|
|
149
|
+
.map(([form, captchas]) => `CAPTCHA-005: '${form}' formunda ${captchas.length} captcha var (${captchas.join(', ')}) — formdaki her captcha zorunludur, kullanıcı hepsini çözmeden gönderemez; servis yalnız tek kodu (X-Captcha-Token) doğrular ve akış yalnız bağlı olanı yeniler. Form başına bir captcha bırakın: remove_component { target: '<fazla captcha>' }.`);
|
|
150
|
+
}
|
|
151
|
+
function hiddenState(value) {
|
|
152
|
+
if (value === true)
|
|
153
|
+
return 'hidden';
|
|
154
|
+
if (!value || typeof value !== 'object')
|
|
155
|
+
return undefined;
|
|
156
|
+
const wrapper = value;
|
|
157
|
+
if (wrapper.type === 'static')
|
|
158
|
+
return wrapper.data === true ? 'hidden' : undefined;
|
|
159
|
+
return 'conditional';
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* CAPTCHA-004 (2026-11-06 2. tur ajan testi MCP-4 · UI-1) — gizli captcha da zorunludur (ADR 0035 kilitli kural; frontend
|
|
163
|
+
* `skipsHiddenValidation`): kullanıcı gizli kutuyu çözemez ve form hiç gönderilmez. Eskiden form gizli captcha'yı denetimden
|
|
164
|
+
* çıkarıyordu, gönderim kodsuz gidip 422 alıyordu ve ekranda ileti yoktu. `isHidden`'a yazan op (sabit `true` → gizli; ifade,
|
|
165
|
+
* bağ ya da tip değişimi → koşullu) ve aynı yamada `isHidden`'ı dolu eklenen captcha yakalanır; hedefin tipi kayıtlı ağaçtan
|
|
166
|
+
* ya da eklenen gövdeden okunur.
|
|
167
|
+
*/
|
|
168
|
+
export function captchaHiddenWarnings(ops, schema) {
|
|
169
|
+
const operations = asObjects(ops);
|
|
170
|
+
const types = nodeTypes(schema);
|
|
171
|
+
const found = new Map();
|
|
172
|
+
for (const op of operations.filter(op => op.op === 'add_component')) {
|
|
173
|
+
for (const node of nodesOf([op.component])) {
|
|
174
|
+
if (typeof node.elementId === 'string')
|
|
175
|
+
types.set(node.elementId, String(node.type ?? ''));
|
|
176
|
+
const state = String(node.type ?? '') === CAPTCHA_TYPE ? hiddenState((node.props ?? {}).isHidden) : undefined;
|
|
177
|
+
if (state && typeof node.elementId === 'string')
|
|
178
|
+
found.set(node.elementId, state);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const op of operations.filter(op => VALUE_WRITING_OPS.has(String(op.op)))) {
|
|
182
|
+
const target = String(op.target ?? '');
|
|
183
|
+
if (types.get(target) !== CAPTCHA_TYPE || (op.prop ?? op.path) !== 'isHidden')
|
|
184
|
+
continue;
|
|
185
|
+
const state = op.op === 'replace_prop' ? hiddenState(op.value) : op.op === 'set_prop_type' && op.propType === 'static' ? undefined : 'conditional';
|
|
186
|
+
if (state)
|
|
187
|
+
found.set(target, state);
|
|
188
|
+
}
|
|
189
|
+
return [...found.entries()].map(([elementId, state]) => state === 'hidden'
|
|
190
|
+
? `CAPTCHA-004: '${elementId}' captcha'sı gizli (isHidden) — gizli captcha da zorunludur: kullanıcı kutuyu göremez, çözemez ve form hiç gönderilmez. Captcha'yı görünür bırakın (replace_prop { target: '${elementId}', prop: 'isHidden', value: false }).`
|
|
191
|
+
: `CAPTCHA-004: '${elementId}' captcha'sının görünürlüğü bir koşula bağlandı — koşul captcha'yı gizlediği sürece form gönderilemez (gizli captcha da zorunludur, kullanıcı onu çözemez). Captcha'yı koşulsuz görünür bırakın; formun bir bölümünü gizlemek gerekiyorsa captcha'yı o bölümün dışına koyun.`);
|
|
192
|
+
}
|
|
193
|
+
function nodesOf(nodes, into = []) {
|
|
194
|
+
for (const node of asObjects(nodes)) {
|
|
195
|
+
into.push(node);
|
|
196
|
+
nodesOf(node.children, into);
|
|
197
|
+
}
|
|
198
|
+
return into;
|
|
199
|
+
}
|
|
7
200
|
/**
|
|
8
201
|
* FORM-001 — `form` komponenti eklendi ama `submit` olayı bağlanmadı: kullanıcı formu doldurur,
|
|
9
202
|
* "Kaydet" hiçbir şey yapmaz. Kontrol plan-yereldir (aynı patch çağrısı); bağlamayı sonraki
|
|
@@ -2552,6 +2552,47 @@ export function staleSetterWarnings(flows, ops, schema) {
|
|
|
2552
2552
|
}
|
|
2553
2553
|
return warnings;
|
|
2554
2554
|
}
|
|
2555
|
+
/**
|
|
2556
|
+
* FLOW-048 (2026-11-06 captcha ajan testi, K-2). `staleSetterWarnings` silinen düğüme YAZAN setter'ı söyler; burası
|
|
2557
|
+
* silinen düğümden OKUYAN adım parametresini (`value.type: 'property'`, `ref.element`). Bağ akışta kalır ve istek o
|
|
2558
|
+
* değeri boş gönderir: captcha silinince `X-Captcha-Token` bağı yerinde durdu, her gönderim 422 aldı ve ne yama, ne
|
|
2559
|
+
* doğrulama, ne akış okuma bir şey söyledi. Silinen kapsayıcının altındaki düğümler de sayılır; aynı yamada aynı
|
|
2560
|
+
* elementId ile yeniden eklenen düğüm sayılmaz.
|
|
2561
|
+
*/
|
|
2562
|
+
export function removedParameterSourceWarnings(flows, ops, schema) {
|
|
2563
|
+
const opList = asObjects(ops);
|
|
2564
|
+
const removed = new Set(opList
|
|
2565
|
+
.filter(op => op.op === 'remove_component')
|
|
2566
|
+
.map(op => String(op.target ?? ''))
|
|
2567
|
+
.filter(target => target.length > 0));
|
|
2568
|
+
if (removed.size === 0)
|
|
2569
|
+
return [];
|
|
2570
|
+
for (const target of [...removed]) {
|
|
2571
|
+
const doomed = findNodeByElementId(asObjects(schema), target);
|
|
2572
|
+
if (doomed)
|
|
2573
|
+
collectElementIds(doomed.children, removed);
|
|
2574
|
+
}
|
|
2575
|
+
const readded = new Set();
|
|
2576
|
+
for (const op of opList.filter(op => op.op === 'add_component'))
|
|
2577
|
+
collectElementIds(op.component, readded);
|
|
2578
|
+
const warnings = [];
|
|
2579
|
+
for (const flow of asObjects(flows)) {
|
|
2580
|
+
const flowName = String(flow.name ?? flow.slug ?? flow.id ?? 'adsız akış');
|
|
2581
|
+
for (const step of [...asObjects(flow.steps), ...asObjects(flow.errorSteps)]) {
|
|
2582
|
+
const stepName = String(step.name ?? step.stepId ?? 'adsız adım');
|
|
2583
|
+
for (const parameter of asObjects((step.args ?? {}).parameters)) {
|
|
2584
|
+
const value = (parameter.value ?? {});
|
|
2585
|
+
const ref = (value.ref ?? {});
|
|
2586
|
+
const element = value.type === 'property' && typeof ref.element === 'string' ? ref.element : '';
|
|
2587
|
+
if (!removed.has(element) || readded.has(element))
|
|
2588
|
+
continue;
|
|
2589
|
+
const name = String(parameter.name ?? '?');
|
|
2590
|
+
warnings.push(`FLOW-048 (uyarı): '${element}' siliniyor ama '${flowName}' akışının '${stepName}' adımı '${name}' parametresini ondan okuyor — bağ akışta kalır ve istek bu değeri BOŞ gönderir${name === 'X-Captcha-Token' ? ' (captcha zorunlu serviste her gönderim 422 CaptchaRequiredException alır)' : ''}. Parametreyi flow_update ile başka bir komponente bağlayın ya da adımı kaldırın.`);
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
return warnings;
|
|
2595
|
+
}
|
|
2555
2596
|
/**
|
|
2556
2597
|
* FLOW-018'in yazma SONRASI ayağı (G-04). Uyarı yamadan önce "kopabilir" der ama sonucu bilemez:
|
|
2557
2598
|
* backend aynı yamada silinip aynı elementId ile eklenen düğüme eski kimliğini geri verir; o düzeltme
|
package/dist/knowledge/rules.js
CHANGED
|
@@ -857,6 +857,22 @@ export const policyRules = [
|
|
|
857
857
|
}];
|
|
858
858
|
}
|
|
859
859
|
},
|
|
860
|
+
{
|
|
861
|
+
id: 'MS-030',
|
|
862
|
+
module: 'microservice',
|
|
863
|
+
appliesTo: ['create', 'update'],
|
|
864
|
+
sourceRef: "ADR 0035 (B-17, 2026-11-05): kuyruğa giren yazma ağ dönünce aynı captcha koduyla yeniden gider; kod tek kullanımlık ve birkaç dakika geçerli olduğu için her denemede reddedilir. Backend aynı birleşimi 422 CaptchaOfflineWritableConflictException ile reddeder; kural isteği göndermeden durdurur",
|
|
865
|
+
check: definition => {
|
|
866
|
+
if (definition.requiresCaptcha !== true || definition.offlineWritable !== true)
|
|
867
|
+
return [];
|
|
868
|
+
return [{
|
|
869
|
+
ruleId: 'MS-030',
|
|
870
|
+
severity: 'block',
|
|
871
|
+
message: "requiresCaptcha ile offlineWritable birlikte olamaz: kuyruğa giren yazma ağ dönünce kullanılmış ya da süresi dolmuş captcha koduyla yeniden gider ve her seferinde reddedilir (backend 422 CaptchaOfflineWritableConflictException). Birini kapatın.",
|
|
872
|
+
guide: 'ngapps://guides/microservice'
|
|
873
|
+
}];
|
|
874
|
+
}
|
|
875
|
+
},
|
|
860
876
|
{
|
|
861
877
|
id: 'QRY-006',
|
|
862
878
|
module: 'query',
|
|
@@ -669,6 +669,11 @@ export class StudioScreenshotter {
|
|
|
669
669
|
}
|
|
670
670
|
await context.addInitScript(`try { localStorage.setItem(${JSON.stringify(VIEWER_MODE_STORAGE_KEY)}, ${JSON.stringify(request.colorScheme)}) } catch (error) { /* localStorage kapalıysa proje varsayılanı çizilir */ }`);
|
|
671
671
|
}
|
|
672
|
+
// Eylemin istek sayacı kaynak zamanlama kayıtlarının farkıdır; tarayıcının tamponu varsayılan 250 kayıtta dolar ve
|
|
673
|
+
// sonrası kaydedilmez. Vite geliştirme sunucusu modül istekleriyle tamponu açılışta doldurur: ölçüldü 2026-11-06,
|
|
674
|
+
// yerel runtime'da istekten önce ve sonra 250 — gönderim servisi çağırdığı hâlde her eylem "0 ağ isteği" diyordu.
|
|
675
|
+
// Tampon sayfanın script'lerinden önce büyütülür; yeteneği olmayan bağlamda sayaç eskisi gibi kalır.
|
|
676
|
+
await context.addInitScript?.('try { performance.setResourceTimingBufferSize(100000) } catch (error) { /* eski tarayıcı: sayaç tamponla sınırlı kalır */ }');
|
|
672
677
|
const page = await context.newPage();
|
|
673
678
|
openPage = page;
|
|
674
679
|
// Konsol ve istisna dinleyicileri navigasyondan ÖNCE takılır: modül yüklenirken patlayan
|
|
@@ -419,6 +419,42 @@ onay gibi işlerde ikinci yol tercih edilir çünkü yetkisi yetmeyen satır öt
|
|
|
419
419
|
akış "0 onaylandı · 2 reddedildi" döndürdü). Döngüdeki uç, çağıranın kimliğiyle denetlenir —
|
|
420
420
|
akış içinden yazmak yetki YÜKSELTMEZ.
|
|
421
421
|
|
|
422
|
+
### Captcha zorunlu servis (MS-029, MS-030, FLOW-049, CAPTCHA-003…005)
|
|
423
|
+
|
|
424
|
+
Herkese açık bir formun arkasındaki servisi botlardan korumak için servisi `requiresCaptcha: true` yap. Platform kodu
|
|
425
|
+
sunucuda sağlayıcıya (Turnstile / reCAPTCHA / hCaptcha) sorar; geçmeyen istek akışa ve veritabanı işlemine girmeden
|
|
426
|
+
reddedilir. Kapı servisi çalıştıran her dış yoldadır: `m/`, CSV dışa aktarma, debug, veri bağla (kök ADR 0035).
|
|
427
|
+
|
|
428
|
+
1. **Proje ayarı insanın işidir:** sağlayıcı ve anahtarlar Studio › proje ayarları › Captcha'ya girilir. Ajan gizli
|
|
429
|
+
anahtar yazmaz; MCP ayarı yazamaz, yalnız okur: `project_get` yanıtındaki `captcha` bloğu `{ configured: false }`
|
|
430
|
+
ise ayar yoktur, `{ configured: true, provider }` kurulu sağlayıcıyı söyler. Ayarsız projede captcha eklemek, servisi
|
|
431
|
+
işaretlemek ve captcha zorunlu servise adım bağlamak CAPTCHA-003 uyarısı alır: kutu yerine "Captcha ayarlı değil"
|
|
432
|
+
çizilir ve form gönderilemez. Ayar yoksa kodlu istek `CaptchaNotConfiguredException` (422) döner; kodsuz istek ayara
|
|
433
|
+
bakılmadan `CaptchaRequiredException` alır (sıra aşağıdaki tabloda).
|
|
434
|
+
2. Sayfaya `captcha` bileşenini forma koy (form onu her zaman zorunlu sayar). **Form başına bir captcha** (ikincisi
|
|
435
|
+
CAPTCHA-005) ve **görünür** bırak: gizli captcha da zorunludur, kullanıcı onu çözemez ve form gönderilmez (CAPTCHA-004).
|
|
436
|
+
3. Servis adımında `X-Captcha-Token` başlık parametresini **yalnız** bileşenin `value`'suna bağla:
|
|
437
|
+
`{ name: 'X-Captcha-Token', type: 'text', source: 'header', value: { type: 'property', ref: { element: '<captcha elementId>', property: 'value' } } }`.
|
|
438
|
+
`element` sayfadaki captcha düğümünün elementId'sidir. `source: 'header'` şarttır: kaynağı olmayan ya da başka
|
|
439
|
+
kaynaklı parametre başlıkta gitmez ve her gönderim 422 alır. Bağsız, başlıkta olmayan, ifade bağlı ya da captcha
|
|
440
|
+
olmayan / sayfada olmayan düğüme bağlı adım FLOW-049 uyarısı alır; uyarı hangi koşulun tutmadığını söyler.
|
|
441
|
+
4. **Akışların zaten çağırdığı servisi sonradan işaretlemek** o akışları kodsuz bırakır: `microservice_patch` /
|
|
442
|
+
`microservice_update` bayrağı açarken bağımlı akışları okur ve kodu göndermeyenleri MS-029 ile adıyla listeler.
|
|
443
|
+
Her birine 3. adımdaki bağı kurun.
|
|
444
|
+
|
|
445
|
+
Sunucu sırayla bakar; ilk tutan satır döner:
|
|
446
|
+
|
|
447
|
+
| Durum | Sonuç |
|
|
448
|
+
|---|---|
|
|
449
|
+
| Başlık yok / biçim `<görünüm>:<kod>` değil (projenin ayarı olsa da olmasa da) | 422 `CaptchaRequiredException` |
|
|
450
|
+
| Başlık var ama projede captcha ayarı ya da o görünümün anahtarı yok | 422 `CaptchaNotConfiguredException` |
|
|
451
|
+
| Sağlayıcı kodu geçirmedi (kullanılmış, süresi dolmuş, sahte) — yerel test kipinde her kod geçer, bu satır görülmez | 422 `CaptchaInvalidException` |
|
|
452
|
+
| Sağlayıcıya ulaşılamadı (5 sn) ya da reCAPTCHA kotası doldu | 503 `CaptchaUnavailableException` |
|
|
453
|
+
| `requiresCaptcha` + `offlineWritable` | MS-030 engeller; platform 422 `CaptchaOfflineWritableConflictException` |
|
|
454
|
+
|
|
455
|
+
Kod tek kullanımlıktır: adım istek döndükten sonra captcha'nın değerini boşaltır ve kutu yenilenir. Yerel kurulumda
|
|
456
|
+
test anahtarları çalışır (Turnstile kutusu `XXXX.DUMMY.TOKEN.XXXX` üretir).
|
|
457
|
+
|
|
422
458
|
### Toplu yazmada sahiplik (MS-027)
|
|
423
459
|
|
|
424
460
|
`bulk-update` ve `bulk-delete` ucunun `filters`'ı **kapsamdır**: gövdedeki her kimlik yalnız bu kapsamın içindeyse
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
3
|
-
"generatedAt": "2026-11-
|
|
2
|
+
"hash": "42642695f6c7589a4ead065f77b85001798d182af85afff73bbc9ae5a8e4f921",
|
|
3
|
+
"generatedAt": "2026-11-09T07:32:35.030Z",
|
|
4
4
|
"types": 377,
|
|
5
5
|
"files": 196,
|
|
6
6
|
"note": "Şemaları üreten backend kaynaklarının parmak izi. Elle düzenlemeyin: 'npm run generate-schemas' yazar, 'npm run schema:check' denetler.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, flowIdEventOps, stripGatewayEventFields, staleSetterWarnings, normalizeSchemaOps, assertAddComponentIds, assertNoRetiredTypes, validationNote, componentNameNote, componentDefaultsNote, replacePropNote, flexSizeWarnings, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, verticalGapWarnings, withNormalization, FLEX_LAYOUT_PROP_NAMES } from '../knowledge/normalize.js';
|
|
1
|
+
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, flowIdEventOps, stripGatewayEventFields, staleSetterWarnings, removedParameterSourceWarnings, normalizeSchemaOps, assertAddComponentIds, assertNoRetiredTypes, validationNote, componentNameNote, componentDefaultsNote, replacePropNote, flexSizeWarnings, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, verticalGapWarnings, withNormalization, FLEX_LAYOUT_PROP_NAMES } from '../knowledge/normalize.js';
|
|
2
2
|
import { opsParam, writeViewParam, outlineWriteResponse, unknownEventOps, collectTypes, simulateLayoutOps, removeNodeFromTree, planEventRemovals, callerSlots, planEmulatedOps, recordsWithEventRemovals, serverOpsInOrder, assertOpBodies, applySkeletonOps, reshapesSkeleton } from './schemaOps.js';
|
|
3
3
|
import { guid, projectParam, environmentParam, updates, microOps } from './common.js';
|
|
4
4
|
import { fetchHost, hostPath } from './screens.js';
|
|
@@ -133,7 +133,7 @@ export function registerDesignSchemaPatchTool(server, platform, host) {
|
|
|
133
133
|
assertScreenWriteGuards(spec.kind, { schema: added }, resolved.profile.platform);
|
|
134
134
|
const catalogNotes = await screenCatalogNotes(platform, project, environment, applicationId, added);
|
|
135
135
|
const flowWarnings = opRecords.some(entry => entry.op === 'remove_component')
|
|
136
|
-
? [...orphanedFlowWarnings(nodes, events, opRecords), ...staleSetterWarnings(Array.isArray(record.flows) ? record.flows : [], opRecords, nodes)]
|
|
136
|
+
? [...orphanedFlowWarnings(nodes, events, opRecords), ...staleSetterWarnings(Array.isArray(record.flows) ? record.flows : [], opRecords, nodes), ...removedParameterSourceWarnings(Array.isArray(record.flows) ? record.flows : [], opRecords, nodes)]
|
|
137
137
|
: [];
|
|
138
138
|
const simulated = structuredClone(nodes);
|
|
139
139
|
for (const entry of opRecords.filter(entry => entry.op === 'remove_component'))
|
package/dist/tools/flows.js
CHANGED
|
@@ -3,7 +3,8 @@ import { guid, projectParam, environmentParam, readOnly, writes, updates, destru
|
|
|
3
3
|
import { applyPolicyMode, evaluatePolicy, enforcePolicy, attachFindings } from '../knowledge/policy.js';
|
|
4
4
|
import { connectedSetterFindings } from '../knowledge/connectDataDefinition.js';
|
|
5
5
|
import { flowBindings, normalizeFlowSteps, targetlessSetterWarnings, unknownSetterTargetWarnings, withNormalization } from '../knowledge/normalize.js';
|
|
6
|
-
import { flowBodyWarnings } from '../knowledge/coverage.js';
|
|
6
|
+
import { captchaNotConfiguredMessage, captchaTokenProblem, flowBodyWarnings } from '../knowledge/coverage.js';
|
|
7
|
+
import { projectCaptchaProvider } from './projects.js';
|
|
7
8
|
import { PlatformApiError } from '../platform/errors.js';
|
|
8
9
|
import { handle } from '../platform/responses.js';
|
|
9
10
|
import { emptyWriteDiff, writeDiff, withWriteDiff } from '../platform/writeDiff.js';
|
|
@@ -385,6 +386,36 @@ async function queuedBranchWarnings(platform, applicationId, steps, errorSteps,
|
|
|
385
386
|
}
|
|
386
387
|
return warnings;
|
|
387
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* FLOW-049 (ADR 0035, K-2 · B-14). "Captcha zorunlu" servise giden `microservice` adımı `X-Captcha-Token` başlık
|
|
391
|
+
* parametresini (`source: 'header'`) sayfadaki captcha bileşeninin `value`'suna (`property`) bağlamalı: bağsız ya da başlıkta
|
|
392
|
+
* olmayan istek 422 CaptchaRequiredException alır, ifade (`code`) bağında akış hangi kutuyu yenileyeceğini bilemez ve sonraki gönderim kullanılmış kodla reddedilir.
|
|
393
|
+
* Bağın hedefi barındırıcının ağacında bir captcha olmalıdır (`captchaTokenProblem`, 2026-11-06 2. tur MCP-1). Captcha
|
|
394
|
+
* zorunlu servise giden adım varsa projenin captcha ayarı da okunur: ayarsız projede doğru bağ da çalışmaz (CAPTCHA-003,
|
|
395
|
+
* MCP-3). Bildirim servis tanımından okunur; okunamayan servis ya da ayar uyarı üretmez.
|
|
396
|
+
*/
|
|
397
|
+
async function captchaBindingWarnings(steps, errorSteps, readService, nodes, platform, project) {
|
|
398
|
+
const serviceSteps = [...(Array.isArray(steps) ? steps : []), ...(Array.isArray(errorSteps) ? errorSteps : [])].filter(isRecord)
|
|
399
|
+
.filter(step => String(step.type ?? '') === 'microservice');
|
|
400
|
+
const warnings = [];
|
|
401
|
+
const gatedSteps = [];
|
|
402
|
+
for (const step of serviceSteps) {
|
|
403
|
+
const args = step.args;
|
|
404
|
+
const microserviceId = args?.microserviceId;
|
|
405
|
+
const definition = typeof microserviceId === 'string' ? await readService(microserviceId) : undefined;
|
|
406
|
+
if (definition?.requiresCaptcha !== true)
|
|
407
|
+
continue;
|
|
408
|
+
gatedSteps.push(String(step.stepId ?? step.name ?? '?'));
|
|
409
|
+
const problem = captchaTokenProblem(args?.parameters, nodes);
|
|
410
|
+
if (problem === undefined)
|
|
411
|
+
continue;
|
|
412
|
+
warnings.push(`FLOW-049: '${String(step.stepId ?? step.name ?? '?')}' adımı '${String(definition.slug ?? microserviceId)}' servisine gidiyor ve servis requiresCaptcha, ama ${problem}. 'X-Captcha-Token' başlık parametresini sayfadaki captcha bileşeninin value'suna bağlayın — { name: 'X-Captcha-Token', type: 'text', source: 'header', value: { type: 'property', ref: { element: '<captcha elementId>', property: 'value' } } }. source: 'header' şarttır: source'suz ya da başka kaynaklı parametre başlıkta gitmez. Bağsız istek 422 CaptchaRequiredException alır; ifade (code) bağında kutu kod gönderildikten sonra yenilenmez.`);
|
|
413
|
+
}
|
|
414
|
+
if (gatedSteps.length > 0 && await projectCaptchaProvider(platform, project) === null) {
|
|
415
|
+
warnings.push(captchaNotConfiguredMessage(platform.resolveProject(project), `${gatedSteps.map(step => `'${step}'`).join(', ')} adımı captcha zorunlu servise gidiyor`));
|
|
416
|
+
}
|
|
417
|
+
return warnings;
|
|
418
|
+
}
|
|
388
419
|
/**
|
|
389
420
|
* FLOW-044 (plans/mobil-cevrimdisi-calisma g-03, telefon turu 2026-10-22). Veri önbelleği yalnız GET okumayı saklar
|
|
390
421
|
* (frontend `isCacheableMethod`): okuyan uca (görünüm kaynağı ya da tablo `get`/`count` — MS-025 ile aynı tanım) GET dışı
|
|
@@ -647,6 +678,7 @@ export function registerFlowTools(server, platform) {
|
|
|
647
678
|
...unknownSetterTargetWarnings(steps, errorSteps ?? [], hostNodes(hostRecord)),
|
|
648
679
|
...microserviceAlwaysDataWarnings(steps, errorSteps ?? []),
|
|
649
680
|
...await queuedBranchWarnings(platform, applicationId, steps, errorSteps ?? [], readService),
|
|
681
|
+
...await captchaBindingWarnings(steps, errorSteps ?? [], readService, hostNodes(hostRecord), platform, project),
|
|
650
682
|
...await uncachedReadWarnings(platform, applicationId, steps, errorSteps ?? [], readService),
|
|
651
683
|
...purchase.warnings
|
|
652
684
|
];
|
|
@@ -741,6 +773,7 @@ export function registerFlowTools(server, platform) {
|
|
|
741
773
|
...unknownSetterTargetWarnings(flow.steps, flow.errorSteps, hostNodes(hostRecord)),
|
|
742
774
|
...microserviceAlwaysDataWarnings(flow.steps, flow.errorSteps),
|
|
743
775
|
...await queuedBranchWarnings(platform, applicationId, flow.steps, flow.errorSteps, readService),
|
|
776
|
+
...await captchaBindingWarnings(flow.steps, flow.errorSteps, readService, hostNodes(hostRecord), platform, project),
|
|
744
777
|
...await uncachedReadWarnings(platform, applicationId, flow.steps, flow.errorSteps, readService),
|
|
745
778
|
...purchase.warnings
|
|
746
779
|
];
|
|
@@ -810,6 +843,7 @@ export function registerFlowTools(server, platform) {
|
|
|
810
843
|
...unknownSetterTargetWarnings(flow.steps, flow.errorSteps, hostNodes(hostRecord)),
|
|
811
844
|
...microserviceAlwaysDataWarnings(flow.steps, flow.errorSteps),
|
|
812
845
|
...await queuedBranchWarnings(platform, applicationId, flow.steps, flow.errorSteps, readService),
|
|
846
|
+
...await captchaBindingWarnings(flow.steps, flow.errorSteps, readService, hostNodes(hostRecord), platform, project),
|
|
813
847
|
...await uncachedReadWarnings(platform, applicationId, flow.steps, flow.errorSteps, readService),
|
|
814
848
|
...purchase.warnings
|
|
815
849
|
];
|
|
@@ -18,6 +18,9 @@ import { outlineWrite, recordWriteViewParam } from '../platform/writeView.js';
|
|
|
18
18
|
import { handle } from '../platform/responses.js';
|
|
19
19
|
import { assertNoPushInProduction } from './workflows.js';
|
|
20
20
|
import { headersForMode } from '../platform/http.js';
|
|
21
|
+
import { fetchHost, flowPath, unwrap } from './screens.js';
|
|
22
|
+
import { captchaNotConfiguredMessage, captchaTokenProblem } from '../knowledge/coverage.js';
|
|
23
|
+
import { projectCaptchaProvider } from './projects.js';
|
|
21
24
|
import fastJsonPatch from 'fast-json-patch';
|
|
22
25
|
import { jsonArray } from '../platform/jsonArray.js';
|
|
23
26
|
import { z } from 'zod';
|
|
@@ -109,6 +112,58 @@ function runIdentity(anonymous, asUser, cookies, headers) {
|
|
|
109
112
|
function hasAuthorization(headers) {
|
|
110
113
|
return Object.keys(headers ?? {}).some(name => name.toLowerCase() === 'authorization');
|
|
111
114
|
}
|
|
115
|
+
const SCREEN_HOSTS = new Set(['page', 'layout', 'component']);
|
|
116
|
+
/**
|
|
117
|
+
* Servis `requiresCaptcha: true` olurken (2026-11-06 captcha 2. tur ajan testi MCP-2, MCP-3). CAPTCHA-003: projede captcha
|
|
118
|
+
* ayarı yoksa işaretli servis hiçbir çağrıyı geçirmez. MS-029: servisi ZATEN çağıran akışlar kodsuz kalır — Studio adımı
|
|
119
|
+
* satırı gösterir ama bağ kurulmadıkça her çağrı 422 alır. Bağımlı akışlar `GET /dependencies/microservice/{id}`'den, her
|
|
120
|
+
* akışın barındırıcısı `GET /dependencies/flow/{id}`'den, gövdesi ve düğümleri barındırıcıdan okunur; bağ FLOW-049'un
|
|
121
|
+
* denetimiyle (`captchaTokenProblem`) değerlendirilir. Okunamayan akış adıyla "doğrulanamadı" der, okunamayan ayar susar.
|
|
122
|
+
*/
|
|
123
|
+
async function captchaGateFindings(platform, project, environment, applicationId, microserviceId, slug) {
|
|
124
|
+
const findings = [];
|
|
125
|
+
const guide = 'ngapps://guides/microservice';
|
|
126
|
+
if (await projectCaptchaProvider(platform, project) === null) {
|
|
127
|
+
findings.push({ ruleId: 'CAPTCHA-003', severity: 'warn', message: captchaNotConfiguredMessage(platform.resolveProject(project), `'${slug}' servisi requiresCaptcha oluyor`), guide });
|
|
128
|
+
}
|
|
129
|
+
const dependents = await platform.tenant('GET', project, `/dependencies/microservice/${microserviceId}`, { environment })
|
|
130
|
+
.then(payload => unwrap(payload).depended)
|
|
131
|
+
.catch(() => undefined);
|
|
132
|
+
const flows = (Array.isArray(dependents) ? dependents : []).filter((node) => Boolean(node) && typeof node === 'object' && node.module === 'flow');
|
|
133
|
+
const unbound = [];
|
|
134
|
+
const unread = [];
|
|
135
|
+
for (const flow of flows) {
|
|
136
|
+
const label = `'${String(flow.name ?? flow.id)}'${flow.componentName ? ` (${String(flow.componentName)} · ${String(flow.eventName ?? '?')})` : ''}`;
|
|
137
|
+
try {
|
|
138
|
+
const owners = unwrap(await platform.tenant('GET', project, `/dependencies/flow/${String(flow.id)}`, { environment })).depended;
|
|
139
|
+
const owner = (Array.isArray(owners) ? owners : []).find(node => SCREEN_HOSTS.has(String(node?.module)));
|
|
140
|
+
if (!owner) {
|
|
141
|
+
unread.push(label);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const host = String(owner.module);
|
|
145
|
+
const record = await fetchHost(platform, host, project, environment, applicationId, String(owner.id));
|
|
146
|
+
const body = unwrap(await platform.tenant('GET', project, flowPath(host, applicationId, String(owner.id), String(flow.id)), { environment }));
|
|
147
|
+
const problem = [...(Array.isArray(body.steps) ? body.steps : []), ...(Array.isArray(body.errorSteps) ? body.errorSteps : [])]
|
|
148
|
+
.map(step => step)
|
|
149
|
+
.filter(step => step.type === 'microservice' && step.args?.microserviceId === microserviceId)
|
|
150
|
+
.map(step => captchaTokenProblem(step.args.parameters, record.schema ?? record.views ?? []))
|
|
151
|
+
.find(entry => entry !== undefined);
|
|
152
|
+
if (problem !== undefined)
|
|
153
|
+
unbound.push(`${label}: ${problem}`);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
unread.push(label);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (unbound.length > 0) {
|
|
160
|
+
findings.push({ ruleId: 'MS-029', severity: 'warn', message: `requiresCaptcha açıldı ama bu servisi çağıran ${unbound.length} akış captcha kodunu göndermiyor — bundan sonra o akışların her çağrısı 422 CaptchaRequiredException alır: ${unbound.join(' | ')}. Her akışın servis adımına 'X-Captcha-Token' başlık parametresini sayfadaki captcha'nın value'suna bağlayın (flow_get → flow_update; bağın şeklini FLOW-049 söyler).`, guide });
|
|
161
|
+
}
|
|
162
|
+
if (unread.length > 0) {
|
|
163
|
+
findings.push({ ruleId: 'MS-029', severity: 'warn', message: `requiresCaptcha açıldı; şu akışların captcha bağı okunamadı: ${unread.join(', ')} — flow_get ile bakın, kodsuz çağıran akış 422 CaptchaRequiredException alır.`, guide });
|
|
164
|
+
}
|
|
165
|
+
return findings;
|
|
166
|
+
}
|
|
112
167
|
/**
|
|
113
168
|
* Debug çıktısındaki `executionItems` ucun kendi adımlarıdır; middleware AYRI bir workflow olarak
|
|
114
169
|
* ucun ÖNÜNDE koşar ve ağaçta hiç görünmez — 09-04 koşusunda sessizce açık kalan şirket kapısı
|
|
@@ -396,7 +451,11 @@ export function registerMicroserviceTools(server, platform) {
|
|
|
396
451
|
: await platform.tenant('PUT', project, `/microservices/${resolvedApplicationId}/${String(existing.id)}`, { environment, body: definition });
|
|
397
452
|
const saved = payload?.data;
|
|
398
453
|
const rename = ifExists === 'duplicate' ? platformRename(definition, saved, 'dash') : { sent: definition };
|
|
399
|
-
|
|
454
|
+
// CAPTCHA-003: yeni servisi çağıran akış henüz yoktur (MS-029 yalnız update/patch'te); ayarsız proje burada da söylenir.
|
|
455
|
+
const captchaFindings = definition.requiresCaptcha === true && await projectCaptchaProvider(platform, project) === null
|
|
456
|
+
? [{ ruleId: 'CAPTCHA-003', severity: 'warn', message: captchaNotConfiguredMessage(platform.resolveProject(project), `'${String(definition.slug ?? definition.name ?? '?')}' servisi requiresCaptcha`), guide: 'ngapps://guides/microservice' }]
|
|
457
|
+
: [];
|
|
458
|
+
return attachFindings(withUnmappedMembers(withWriteDiff(withResolved(withRename(withNormalization(withOutcome(outlineWrite(payload, view, MICROSERVICE_OUTLINE_KEYS), existing), normalized), rename.renamed), [...resolver.resolved, ...hydrated]), writeDiff(rename.sent, payload)), drift), [...findings, ...captchaFindings]);
|
|
400
459
|
}));
|
|
401
460
|
server.registerTool('microservice_update', {
|
|
402
461
|
title: 'Microservice güncelle',
|
|
@@ -414,8 +473,12 @@ export function registerMicroserviceTools(server, platform) {
|
|
|
414
473
|
...await legacyRoleListFindings(platform, project, environment, definition, 'microservice', policyOverride)
|
|
415
474
|
];
|
|
416
475
|
const drift = unmappedMembers('UpdateMicroserviceCommand', definition);
|
|
476
|
+
// MS-029 / CAPTCHA-003: kayıtlı tanım yalnız bayrağı açan gövdede okunur — bayrak bu yazımla mı açılıyor?
|
|
477
|
+
const flagging = definition.requiresCaptcha === true
|
|
478
|
+
&& unwrap(await platform.tenant('GET', project, `/microservices/${resolvedApplicationId}/${id}`, { environment }).catch(() => undefined)).requiresCaptcha !== true;
|
|
417
479
|
const payload = await platform.tenant('PUT', project, `/microservices/${resolvedApplicationId}/${id}`, { environment, body: definition });
|
|
418
|
-
|
|
480
|
+
const captchaFindings = flagging ? await captchaGateFindings(platform, project, environment, resolvedApplicationId, id, String(definition.slug ?? id)) : [];
|
|
481
|
+
return attachFindings(withUnmappedMembers(withWriteDiff(withResolved(withNormalization(outlineWrite(payload, view, MICROSERVICE_OUTLINE_KEYS), normalized), [...resolver.resolved, ...hydrated]), writeDiff(definition, payload)), drift), [...findings, ...captchaFindings]);
|
|
419
482
|
}));
|
|
420
483
|
server.registerTool('microservice_patch', {
|
|
421
484
|
title: 'Microservice\'e patch uygula',
|
|
@@ -456,7 +519,10 @@ export function registerMicroserviceTools(server, platform) {
|
|
|
456
519
|
body: { baseVersion: baseVersionOf(definition, 'microservice_get'), ops: netOps }
|
|
457
520
|
});
|
|
458
521
|
const written = patchResult(saved, patched);
|
|
459
|
-
|
|
522
|
+
const captchaFindings = definition.requiresCaptcha !== true && patched.requiresCaptcha === true
|
|
523
|
+
? await captchaGateFindings(platform, project, environment, resolvedApplicationId, id, String(patched.slug ?? id))
|
|
524
|
+
: [];
|
|
525
|
+
return attachFindings(withUnmappedMembers(withWriteDiff(withResolved(withNormalization({ applied: operations.length, newVersion: written.newVersion, outline: microserviceOutline(written.data) }, [...roleNotes, ...normalized, ...resolved.notes.map(note => `patch yolu seçiciden indekse çözüldü: ${note}`)]), resolver.resolved), writeDiff(patched, written.data)), drift), [...findings, ...captchaFindings]);
|
|
460
526
|
}));
|
|
461
527
|
server.registerTool('microservice_delete', {
|
|
462
528
|
title: 'Microservice sil',
|
package/dist/tools/pages.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { guid, projectParam, environmentParam, pagingParams, asUserIdParam, readOnly, writes, updates, destructive, microOps, isBranchName, branchSlug } from './common.js';
|
|
2
|
-
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, flowIdEventOps, stripGatewayEventFields, staleSetterWarnings, lostSetterTargets, fillComponentNames, componentNameNote, normalizeComponentDefaults, normalizeSchemaOps, schemaOpValidationErrors, codePropTemplateErrors, addComponentIdErrors, missingBlocksNodes, retiredTypeNodes, assertNoRetiredNodes, validationNote, componentDefaultsNote, replacePropNote, ensurePageContainer, retargetRootAdds, rootAddsNote, flexSizeWarnings, spacingLayerWarnings, reorderSchemaBlocks, reorderNote, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, FLEX_LAYOUT_PROP_NAMES, resetPageContainerPosition, pageContainerPositionWarning, verticalGapWarnings, flexIndexOrder, flexIndexOrderNote, withNormalization, parseVariableEntries, PAGE_CONTAINER_ELEMENT_ID, screenEventsNeedPlatform } from '../knowledge/normalize.js';
|
|
2
|
+
import { orphanedFlowWarnings, orphanedFlowPlan, orphanedFlowMessage, boundEventOps, flowIdEventOps, stripGatewayEventFields, staleSetterWarnings, removedParameterSourceWarnings, lostSetterTargets, fillComponentNames, componentNameNote, normalizeComponentDefaults, normalizeSchemaOps, schemaOpValidationErrors, codePropTemplateErrors, addComponentIdErrors, missingBlocksNodes, retiredTypeNodes, assertNoRetiredNodes, validationNote, componentDefaultsNote, replacePropNote, ensurePageContainer, retargetRootAdds, rootAddsNote, flexSizeWarnings, spacingLayerWarnings, reorderSchemaBlocks, reorderNote, nestedRepeaterNodes, nestedRepeaterMessage, stringStyleNodes, stringStyleWarning, inertFlexPropNodes, inertFlexPropWarning, FLEX_LAYOUT_PROP_NAMES, resetPageContainerPosition, pageContainerPositionWarning, verticalGapWarnings, flexIndexOrder, flexIndexOrderNote, withNormalization, parseVariableEntries, PAGE_CONTAINER_ELEMENT_ID, screenEventsNeedPlatform } from '../knowledge/normalize.js';
|
|
3
3
|
import { functionSignature } from '../knowledge/functionGuards.js';
|
|
4
4
|
import { attachFindings } from '../knowledge/policy.js';
|
|
5
5
|
import { fetchHost, pageUpdateBody, schemaParam, eventsParam, unwrap, modeParam, summarize, findNode, flowPath, countSchemaNodes, missingElementIds, readFullSchema } from './screens.js';
|
|
6
6
|
import { fetchComponentEventNames } from './components.js';
|
|
7
7
|
import { assertScreenWriteGuards, screenCatalogNotes, assertScreenCatalog, unknownPropOps } from './screenWrite.js';
|
|
8
8
|
import { opsParam, writeViewParam, outlineWriteResponse, unknownEventOps, collectTypes, simulateLayoutOps, applySkeletonOps, reshapesSkeleton, planEventRemovals, callerSlots, planEmulatedOps, recordsWithEventRemovals, serverOpsInOrder, rejectedOpsMessage } from './schemaOps.js';
|
|
9
|
-
import { formBindingWarnings, formSubmitButtonWarnings } from '../knowledge/coverage.js';
|
|
9
|
+
import { addedCaptchaIds, captchaHiddenWarnings, captchaNotConfiguredMessage, captchaOutsideFormWarnings, captchaPerFormWarnings, captchaValueMessage, captchaValueWrites, formBindingWarnings, formSubmitButtonWarnings } from '../knowledge/coverage.js';
|
|
10
|
+
import { projectCaptchaProvider } from './projects.js';
|
|
10
11
|
import { emptyWriteDiff, pageWriteDrops, schemaOpDrops, unwrapProps, withWriteDiff, writeDiff } from '../platform/writeDiff.js';
|
|
11
12
|
import { PlatformApiError } from '../platform/errors.js';
|
|
12
13
|
import { existingMatch, ifExistsParam, listAll, withOutcome } from '../platform/ifExists.js';
|
|
@@ -960,8 +961,20 @@ export function registerPageTools(server, platform, injectedScreenshotter, injec
|
|
|
960
961
|
.filter(entry => entry.op === 'add_component')
|
|
961
962
|
.map(entry => entry.component);
|
|
962
963
|
assertScreenWriteGuards('page', { schema: added }, resolved.profile.platform);
|
|
964
|
+
// CAPTCHA-001: hedefin tipi kayıtlı ağaçtan okunur; ağaç yalnız bir op `value` yazıyorsa okunur.
|
|
965
|
+
const valueOps = [...opRecords, ...propTypeOps];
|
|
966
|
+
const captchaWrites = captchaValueWrites(valueOps, valueOps.some(entry => (entry.prop ?? entry.path) === 'value') ? (await readPage()).schema : []);
|
|
967
|
+
if (captchaWrites.length > 0)
|
|
968
|
+
throw new PlatformApiError(captchaValueMessage(captchaWrites), 400);
|
|
969
|
+
// CAPTCHA-004: ağaç yalnız bir op `isHidden` yazıyorsa okunur; okunamazsa yalnız eklenen gövdeler denetlenir, yama durmaz.
|
|
970
|
+
// CAPTCHA-003: proje ayarı yalnız captcha eklenirse okunur.
|
|
971
|
+
const hiddenCaptchas = captchaHiddenWarnings(valueOps, valueOps.some(entry => (entry.prop ?? entry.path) === 'isHidden') ? await readPage().then(page => page.schema).catch(() => []) : []);
|
|
972
|
+
const addedCaptchas = addedCaptchaIds(sentOps);
|
|
973
|
+
const unconfiguredCaptcha = addedCaptchas.length > 0 && await projectCaptchaProvider(platform, project) === null
|
|
974
|
+
? [captchaNotConfiguredMessage(platform.resolveProject(project), `bu yama captcha ekliyor (${addedCaptchas.join(', ')})`)]
|
|
975
|
+
: [];
|
|
963
976
|
const catalogNotes = await screenCatalogNotes(platform, project, environment, applicationId, added);
|
|
964
|
-
const formWarnings = [...formBindingWarnings(opRecords), ...formSubmitButtonWarnings(opRecords)];
|
|
977
|
+
const formWarnings = [...formBindingWarnings(opRecords), ...formSubmitButtonWarnings(opRecords), ...hiddenCaptchas, ...unconfiguredCaptcha];
|
|
965
978
|
let flowWarnings = [];
|
|
966
979
|
let layoutWarnings = [];
|
|
967
980
|
let flowsBeforePatch;
|
|
@@ -979,7 +992,7 @@ export function registerPageTools(server, platform, injectedScreenshotter, injec
|
|
|
979
992
|
const hosted = await platform.tenant('GET', project, flowPath('page', applicationId, pageId), { environment });
|
|
980
993
|
const page = await readPage();
|
|
981
994
|
flowsBeforePatch = hosted?.data ?? [];
|
|
982
|
-
flowWarnings = [...flowWarnings, ...staleSetterWarnings(flowsBeforePatch, opRecords, page.schema)];
|
|
995
|
+
flowWarnings = [...flowWarnings, ...staleSetterWarnings(flowsBeforePatch, opRecords, page.schema), ...removedParameterSourceWarnings(flowsBeforePatch, opRecords, page.schema)];
|
|
983
996
|
}
|
|
984
997
|
catch {
|
|
985
998
|
// akış listesi okunamadı
|
|
@@ -1002,7 +1015,9 @@ export function registerPageTools(server, platform, injectedScreenshotter, injec
|
|
|
1002
1015
|
...stringStyleWarning(stringStyleNodes(simulated)),
|
|
1003
1016
|
...(resolved.profile.layout.modes.has('grid') ? inertFlexPropWarning(inertFlexPropNodes(simulated)) : []),
|
|
1004
1017
|
...flexSizeWarnings(simulated, 'PAGE-017 (uyarı)', 'PAGE-018 (uyarı)'),
|
|
1005
|
-
...spacingLayerWarnings(simulated, 'PAGE-029 (uyarı)', 'PAGE-030 (uyarı)')
|
|
1018
|
+
...spacingLayerWarnings(simulated, 'PAGE-029 (uyarı)', 'PAGE-030 (uyarı)'),
|
|
1019
|
+
...captchaOutsideFormWarnings(simulated, sentOps),
|
|
1020
|
+
...captchaPerFormWarnings(simulated, sentOps)
|
|
1006
1021
|
];
|
|
1007
1022
|
}
|
|
1008
1023
|
catch {
|
package/dist/tools/projects.js
CHANGED
|
@@ -96,6 +96,49 @@ async function withPublishedSchemaVersion(platform, payload) {
|
|
|
96
96
|
return withNormalization(payload, ["organizationSchema.latestVersion doğrulanamadı (slug ucu GET /p/{slug} sürüm taşımaz, GET /projects/{id} okunamadı): yokluğu 'yayınlı şema yok' demek DEĞİLDİR — organization_schema_get ile doğrulayın (TB-67)."]);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
+
async function captchaProviderOf(platform, projectId) {
|
|
100
|
+
try {
|
|
101
|
+
const setting = await platform.org('GET', `/projects/${projectId}/captcha-settings`);
|
|
102
|
+
if (!setting?.data || typeof setting.data !== 'object')
|
|
103
|
+
return undefined;
|
|
104
|
+
return typeof setting.data.provider === 'string' && setting.data.provider !== '' ? setting.data.provider : null;
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Projenin captcha sağlayıcısı (kök ADR 0035; 2026-11-06 2. tur ajan testi MCP-3): ayar Organization.API'dedir
|
|
112
|
+
* (`GET /projects/{id}/captcha-settings`, gizli anahtarlar dönmez). Ayar yoksa `null`; proje ya da ayar okunamazsa
|
|
113
|
+
* `undefined` — bilmediğimizi uyarı diye söylemeyiz (CAPTCHA-003).
|
|
114
|
+
*/
|
|
115
|
+
export async function projectCaptchaProvider(platform, project) {
|
|
116
|
+
try {
|
|
117
|
+
const payload = await platform.org('GET', `/p/${platform.resolveProject(project)}`);
|
|
118
|
+
return typeof payload?.data?.id === 'string' ? await captchaProviderOf(platform, payload.data.id) : undefined;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Ayarı okuyan araç yoktu: ajan ayarsız projede captcha kurdu, uyarı almadı ve form hiç gönderilemedi (2026-11-06 2. tur
|
|
126
|
+
* MCP-3). Platformun `data`'sı değiştirilmez, blok kardeş alandır; okuma düşerse blok yazılmaz.
|
|
127
|
+
*/
|
|
128
|
+
async function withCaptcha(platform, payload) {
|
|
129
|
+
const id = payload?.data?.id;
|
|
130
|
+
if (typeof id !== 'string' || !payload || typeof payload !== 'object' || Array.isArray(payload))
|
|
131
|
+
return payload;
|
|
132
|
+
const provider = await captchaProviderOf(platform, id);
|
|
133
|
+
if (provider === undefined)
|
|
134
|
+
return payload;
|
|
135
|
+
return {
|
|
136
|
+
...payload,
|
|
137
|
+
captcha: provider === null
|
|
138
|
+
? { configured: false, note: "Projede captcha ayarı yok: captcha 'Captcha ayarlı değil' diye çizilir ve form gönderilemez. Ayarı bir insan Studio'da Project › Settings › Captcha'dan kurar; sağlayıcı ve anahtarlar MCP'den yazılmaz." }
|
|
139
|
+
: { configured: true, provider }
|
|
140
|
+
};
|
|
141
|
+
}
|
|
99
142
|
const applicationInput = z.object({
|
|
100
143
|
slug: z.string().min(1),
|
|
101
144
|
name: z.string().min(1),
|
|
@@ -156,7 +199,7 @@ export function registerProjectTools(server, platform) {
|
|
|
156
199
|
}, handle(config, args => platform.org('GET', '/projects', { query: args })));
|
|
157
200
|
server.registerTool('project_get', {
|
|
158
201
|
title: 'Proje getir',
|
|
159
|
-
description: "Tek projeyi id ya da slug ile getirir; environment listesi de yanıttadır (her ortamda enforcementMode: off | shadow | enforce). Yanıttaki 'localization' bloğu gateway'in eklediği türetilmiş alandır: platform dil alanlarını null olduklarında serileştirmede düşürüyor, blok bunu görünür kılar ve runtime'ın çevirileri çözüp çözemeyeceğini söyler. accessModel projenin türüdür; organizationSchema { receiveUpdates, appliedVersion, latestVersion, customizedAt } kompleks projenin şema aboneliğidir — gateway null alanları düşürür: customizedAt YOKSA proje özelleştirilmemiştir, appliedVersion yoksa şema hiç uygulanmamıştır, latestVersion yoksa organizasyonda yayınlı şema yoktur (platform_guide('getting-started') §'Basit mi kompleks mi'). slug ile çağrıda platformun slug ucu latestVersion'ı taşımaz; gateway organizationSchema bloğunu GET /projects/{id}'den alır, o okuma düşerse yanıtta gatewayNormalized notu olur ve latestVersion'ın yokluğu bir şey söylemez (TB-67).",
|
|
202
|
+
description: "Tek projeyi id ya da slug ile getirir; environment listesi de yanıttadır (her ortamda enforcementMode: off | shadow | enforce). Yanıttaki 'localization' bloğu gateway'in eklediği türetilmiş alandır: platform dil alanlarını null olduklarında serileştirmede düşürüyor, blok bunu görünür kılar ve runtime'ın çevirileri çözüp çözemeyeceğini söyler. accessModel projenin türüdür; organizationSchema { receiveUpdates, appliedVersion, latestVersion, customizedAt } kompleks projenin şema aboneliğidir — gateway null alanları düşürür: customizedAt YOKSA proje özelleştirilmemiştir, appliedVersion yoksa şema hiç uygulanmamıştır, latestVersion yoksa organizasyonda yayınlı şema yoktur (platform_guide('getting-started') §'Basit mi kompleks mi'). slug ile çağrıda platformun slug ucu latestVersion'ı taşımaz; gateway organizationSchema bloğunu GET /projects/{id}'den alır, o okuma düşerse yanıtta gatewayNormalized notu olur ve latestVersion'ın yokluğu bir şey söylemez (TB-67). 'captcha' bloğu da gateway'in eklediği alandır: { configured: false, note } projede captcha ayarı yok demektir (captcha bileşeni çalışmaz, ayarı bir insan Studio'da Project › Settings › Captcha'dan kurar), { configured: true, provider } kurulu sağlayıcıyı söyler (turnstile | recaptcha | hcaptcha); ayar okunamazsa blok yoktur.",
|
|
160
203
|
inputSchema: { id: guid.optional(), slug: z.string().optional().describe('id verilmediyse zorunlu') },
|
|
161
204
|
annotations: readOnly
|
|
162
205
|
}, handle(config, async (args) => {
|
|
@@ -164,8 +207,8 @@ export function registerProjectTools(server, platform) {
|
|
|
164
207
|
throw new Error("'id' ya da 'slug' parametrelerinden biri zorunlu.");
|
|
165
208
|
}
|
|
166
209
|
if (args.id)
|
|
167
|
-
return withLocalization(await platform.org('GET', `/projects/${args.id}`));
|
|
168
|
-
return withLocalization(await withPublishedSchemaVersion(platform, await platform.org('GET', `/p/${args.slug}`)));
|
|
210
|
+
return withCaptcha(platform, withLocalization(await platform.org('GET', `/projects/${args.id}`)));
|
|
211
|
+
return withCaptcha(platform, withLocalization(await withPublishedSchemaVersion(platform, await platform.org('GET', `/p/${args.slug}`))));
|
|
169
212
|
}));
|
|
170
213
|
server.registerTool('project_create', {
|
|
171
214
|
title: 'Proje oluştur',
|
package/package.json
CHANGED