@cardstack/boxel-cli 0.9.0 → 0.10.0-unstable.0
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/README.md +12 -0
- package/bundled-test-harness/assets/account-switch-failed-GCSVbJML.js +23 -0
- package/bundled-test-harness/assets/account-switch-failed-GsWni_Gk.css +18 -0
- package/bundled-test-harness/assets/account-switch-failed-test-CdZWNths.js +45 -0
- package/bundled-test-harness/assets/add-workspace-c7L50Gx8.js +141 -0
- package/bundled-test-harness/assets/add-workspace-test-BZxHa6Pe.js +72 -0
- package/bundled-test-harness/assets/advanced-color-picker-0pGF-3WG.js +504 -0
- package/bundled-test-harness/assets/advanced-color-picker-pbO4HWc_.js +2 -0
- package/bundled-test-harness/assets/ai-assistant-test-Dnm4o9vK.js +2211 -0
- package/bundled-test-harness/assets/ai-module-creation-test-C6253CMt.js +151 -0
- package/bundled-test-harness/assets/aibot-message-miKyGeKk.js +278 -0
- package/bundled-test-harness/assets/app-i8pGdQkw.js +22855 -0
- package/bundled-test-harness/assets/app-zC7o6PyQ.css +2718 -0
- package/bundled-test-harness/assets/audio-file-def-DHnydP0t.js +133 -0
- package/bundled-test-harness/assets/auth-container-BP2gSoo4.css +51 -0
- package/bundled-test-harness/assets/auth-container-DN94iVfX.js +24 -0
- package/bundled-test-harness/assets/avif-meta-extractor-Bo5zRX1V.js +162 -0
- package/bundled-test-harness/assets/base64-image-B0RYxzHT.js +2 -0
- package/bundled-test-harness/assets/base64-image-Bxjqdwew.js +262 -0
- package/bundled-test-harness/assets/big-integer-7RLj5_7H.js +89 -0
- package/bundled-test-harness/assets/big-integer-C9sJxKVy.js +2 -0
- package/bundled-test-harness/assets/binary-upload-dedupe-test-DZo3EaV0.js +308 -0
- package/bundled-test-harness/assets/boolean-CcKPYUph.js +94 -0
- package/bundled-test-harness/assets/boolean-DvsSmtM7.js +2 -0
- package/bundled-test-harness/assets/brand-functional-palette-KpVSY2Sa.js +137 -0
- package/bundled-test-harness/assets/brand-logo-DDiOec0t.js +295 -0
- package/bundled-test-harness/assets/broken-link-template-test-DAngUbFJ.js +192 -0
- package/bundled-test-harness/assets/bundled-base-C_lumba6.js +254 -0
- package/bundled-test-harness/assets/bundled-base-modules-test-CSF7Rl4Z.js +54 -0
- package/bundled-test-harness/assets/buried-stack-item-scroll-test-B0J_EP88.js +236 -0
- package/bundled-test-harness/assets/bxl-expression-test-Dej7WgI6.js +250 -0
- package/bundled-test-harness/assets/can-invoke-test-elyUcOKT.js +401 -0
- package/bundled-test-harness/assets/card-api-CjWXCkqh.js +8 -0
- package/bundled-test-harness/assets/card-api-Dzje0smT.js +4393 -0
- package/bundled-test-harness/assets/card-api-test-DA8d4Ooc.js +198 -0
- package/bundled-test-harness/assets/card-basics-test-mp1Odo-l.js +5364 -0
- package/bundled-test-harness/assets/card-chooser-paging-test-y8OfboYd.js +235 -0
- package/bundled-test-harness/assets/card-chooser-test-nmg2zkDj.js +393 -0
- package/bundled-test-harness/assets/card-collection-BXiO3i7R.js +118 -0
- package/bundled-test-harness/assets/card-context-search-results-Dbhn7lvW.js +30 -0
- package/bundled-test-harness/assets/card-context-search-results-test-DVXT-YC5.js +184 -0
- package/bundled-test-harness/assets/card-def-field-def-relationships-test-mX4rxrtO.js +562 -0
- package/bundled-test-harness/assets/card-delete-test-BxFsqFnX.js +466 -0
- package/bundled-test-harness/assets/card-error-C-7hjxu9.js +72 -0
- package/bundled-test-harness/assets/card-error-awaiting-index-test-BvfY2eaW.js +53 -0
- package/bundled-test-harness/assets/card-error-detail-nMwopDir.js +271 -0
- package/bundled-test-harness/assets/card-info-CTFxdohf.js +2 -0
- package/bundled-test-harness/assets/card-list-B9QrkJ97.js +2 -0
- package/bundled-test-harness/assets/card-list-XbwLCXZS.js +202 -0
- package/bundled-test-harness/assets/card-resource-JGLjQUy6.js +86 -0
- package/bundled-test-harness/assets/cards-grid-CWG41hZE.js +344 -0
- package/bundled-test-harness/assets/cards-grid-DSpX99p6.js +2 -0
- package/bundled-test-harness/assets/cards-grid-layout-Bht0LwZy.js +2 -0
- package/bundled-test-harness/assets/cards-grid-layout-CdpKlHUb.js +111 -0
- package/bundled-test-harness/assets/check-correctness-test-C4BrUeKA.js +554 -0
- package/bundled-test-harness/assets/clip-BEVvLrXx.js +2 -0
- package/bundled-test-harness/assets/clip-CoB714qX.js +92 -0
- package/bundled-test-harness/assets/code-ref-C2uguisI.js +2 -0
- package/bundled-test-harness/assets/code-ref-Cy7sV5a4.js +138 -0
- package/bundled-test-harness/assets/code-submode-availability-test-BsA_Ul01.js +198 -0
- package/bundled-test-harness/assets/code-submode-test-DkBhpEPB.js +1839 -0
- package/bundled-test-harness/assets/codeblocks-test-B1eZ2_JF.js +418 -0
- package/bundled-test-harness/assets/codemirror-editor-C6pxSm5y.js +2 -0
- package/bundled-test-harness/assets/codemirror-editor-DzM46Cd8.js +701 -0
- package/bundled-test-harness/assets/codemirror-embed-toolbar-test-BemP-ZdG.js +366 -0
- package/bundled-test-harness/assets/color-C-jGNFWZ.js +2 -0
- package/bundled-test-harness/assets/color-field-test-DPIRaBec.js +212 -0
- package/bundled-test-harness/assets/color-picker-field-Bv4IjS-d.js +139 -0
- package/bundled-test-harness/assets/color-picker-field-D1bYCQIg.js +2 -0
- package/bundled-test-harness/assets/color-wheel-picker-IIaCQplL.js +283 -0
- package/bundled-test-harness/assets/color-wheel-picker-Kw-UN3kV.js +2 -0
- package/bundled-test-harness/assets/color-zzCBneih.js +65 -0
- package/bundled-test-harness/assets/command-data-BMBtjT1E.js +95 -0
- package/bundled-test-harness/assets/command-data-BXC5Z0oA.js +2 -0
- package/bundled-test-harness/assets/compaction-test-CxUKnxlQ.js +150 -0
- package/bundled-test-harness/assets/components-Ct_agx0G.js +14294 -0
- package/bundled-test-harness/assets/computed-test-C-lpGQQ3.js +1320 -0
- package/bundled-test-harness/assets/container-BdPu8rvc.css +5565 -0
- package/bundled-test-harness/assets/container-Dj-5prh9.js +11288 -0
- package/bundled-test-harness/assets/contains-many-component-CAWqzX8W.js +2 -0
- package/bundled-test-harness/assets/contrast-checker-addon-BTLD7oMx.js +2 -0
- package/bundled-test-harness/assets/contrast-checker-addon-DBzizR04.js +71 -0
- package/bundled-test-harness/assets/convert-to-class-name-test-zZuKxYvF.js +17 -0
- package/bundled-test-harness/assets/coordinate-Bw8va6tO.js +48 -0
- package/bundled-test-harness/assets/copy-file-to-realm-test-DtCKPzqj.js +148 -0
- package/bundled-test-harness/assets/country-B_tWpLlO.js +199 -0
- package/bundled-test-harness/assets/create-file-modal-D-VPyEYp.js +570 -0
- package/bundled-test-harness/assets/create-listing-modal-test-hyLkQY0u.js +273 -0
- package/bundled-test-harness/assets/create-listing-pr-request-test-rjWFA_5S.js +117 -0
- package/bundled-test-harness/assets/create-spec-test-HKIxZGxK.js +256 -0
- package/bundled-test-harness/assets/create-specs-9-ELVyJP.js +215 -0
- package/bundled-test-harness/assets/create-submission-workflow-test-DNZrbRX8.js +132 -0
- package/bundled-test-harness/assets/credential-fields-test-xPEdA911.js +157 -0
- package/bundled-test-harness/assets/css-value-Du3HL39X.js +48 -0
- package/bundled-test-harness/assets/csv-file-def-EHRmilrp.js +277 -0
- package/bundled-test-harness/assets/currency-y6ZCHIqG.js +134 -0
- package/bundled-test-harness/assets/date-B27PrSFT.js +183 -0
- package/bundled-test-harness/assets/date-CiP5Eb9i.js +2 -0
- package/bundled-test-harness/assets/date-time-fields-test-Clf5vxRW.js +359 -0
- package/bundled-test-harness/assets/datetime-BEbR9YgU.js +201 -0
- package/bundled-test-harness/assets/datetime-DPnrt1wl.js +2 -0
- package/bundled-test-harness/assets/datetime-stamp-AuT7F7qn.js +2 -0
- package/bundled-test-harness/assets/datetime-stamp-CGwP2P3f.js +81 -0
- package/bundled-test-harness/assets/day-BFLxZ9bQ.js +2 -0
- package/bundled-test-harness/assets/day-CQoEkqgE.js +113 -0
- package/bundled-test-harness/assets/debug-message-test-CzgOpfcI.js +117 -0
- package/bundled-test-harness/assets/dist-B-fYvxfL.js +389 -0
- package/bundled-test-harness/assets/dist-C2IXvIKX.js +323 -0
- package/bundled-test-harness/assets/dist-CdNZu43l.js +1710 -0
- package/bundled-test-harness/assets/docx-file-def-BQMw460_.js +60 -0
- package/bundled-test-harness/assets/docx-meta-extractor-DBlmH_kV.js +60 -0
- package/bundled-test-harness/assets/docx-meta-extractor-Dw4gZ0ae.js +2 -0
- package/bundled-test-harness/assets/duration-B0SnEiw1.js +184 -0
- package/bundled-test-harness/assets/duration-DbjJTFeA.js +2 -0
- package/bundled-test-harness/assets/email-C-8cyWiQ.js +80 -0
- package/bundled-test-harness/assets/email-field-test-BOBmvQqx.js +75 -0
- package/bundled-test-harness/assets/email-xUgCst-p.js +2 -0
- package/bundled-test-harness/assets/enum-BWiCyJlu.js +167 -0
- package/bundled-test-harness/assets/enum-CzYjivhO.js +2 -0
- package/bundled-test-harness/assets/enum-field-test-Bea9EsQR.js +953 -0
- package/bundled-test-harness/assets/error-display-test-Cbl2D_0c.js +343 -0
- package/bundled-test-harness/assets/ethereum-address-Bw_J05bD.js +78 -0
- package/bundled-test-harness/assets/ethereum-address-C9wHMBt3.js +2 -0
- package/bundled-test-harness/assets/expiration-warning-BHcJEjZt.js +90 -0
- package/bundled-test-harness/assets/expiration-warning-_G8SKZd0.js +2 -0
- package/bundled-test-harness/assets/externals-CKblKBo1.js +4393 -0
- package/bundled-test-harness/assets/fallback-banner-BqCrvTDt.js +24 -0
- package/bundled-test-harness/assets/fallback-banner-live-delete-test-D_AYMvf6.js +207 -0
- package/bundled-test-harness/assets/fallback-banner-test-B8Ne9a5g.js +225 -0
- package/bundled-test-harness/assets/fallback-banner-test-C7oaSxd1.js +53 -0
- package/bundled-test-harness/assets/fallback-models-test-DY-PvU9k.js +161 -0
- package/bundled-test-harness/assets/field-component-Bj8YthPE.js +2 -0
- package/bundled-test-harness/assets/field-configuration-test-B5LztQ47.js +548 -0
- package/bundled-test-harness/assets/field-edit-Cx_haspD.js +36 -0
- package/bundled-test-harness/assets/field-edit-DQZWUz3F.js +2 -0
- package/bundled-test-harness/assets/field-markdown-domain-test-DnqK3CrE.js +616 -0
- package/bundled-test-harness/assets/field-markdown-oversize-test-BEpbXIvl.js +88 -0
- package/bundled-test-harness/assets/field-markdown-primitives-test-BDORWoOk.js +365 -0
- package/bundled-test-harness/assets/field-markdown-specialized-test-BmIzadYq.js +534 -0
- package/bundled-test-harness/assets/field-test-helpers-CRF9-jFw.js +45 -0
- package/bundled-test-harness/assets/file-api-DPMJghBY.js +7 -0
- package/bundled-test-harness/assets/file-attachment-test-DFLXg3xV.js +796 -0
- package/bundled-test-harness/assets/file-chooser-panel-test-B4DzCWkt.js +153 -0
- package/bundled-test-harness/assets/file-chooser-test-DpjOWgpB.js +504 -0
- package/bundled-test-harness/assets/file-def-edit-Bstl7Kkl.js +2 -0
- package/bundled-test-harness/assets/file-def-edit-C1dzJxmQ.js +26 -0
- package/bundled-test-harness/assets/file-def-embedded-CUy4G7Vc.js +2 -0
- package/bundled-test-harness/assets/file-def-embedded-DJs6P5t0.js +38 -0
- package/bundled-test-harness/assets/file-def-fitted-BlrBFfLh.js +38 -0
- package/bundled-test-harness/assets/file-def-fitted-Bo5Qfkyf.js +2 -0
- package/bundled-test-harness/assets/file-def-isolated-BsHydanv.js +38 -0
- package/bundled-test-harness/assets/file-def-isolated-Dp-Lc99-.js +2 -0
- package/bundled-test-harness/assets/file-def-serialization-test-CISKpt_o.js +89 -0
- package/bundled-test-harness/assets/file-menu-items-7_ltrFZq.js +117 -0
- package/bundled-test-harness/assets/file-menu-items-BnRG9ydE.js +2 -0
- package/bundled-test-harness/assets/file-preview-stage-CV3qZpiK.js +72 -0
- package/bundled-test-harness/assets/file-preview-stage-DTA5X8rX.js +2 -0
- package/bundled-test-harness/assets/file-shell-embedded-BpmiVzIG.js +2 -0
- package/bundled-test-harness/assets/file-shell-embedded-CEv0-6OE.js +68 -0
- package/bundled-test-harness/assets/file-shell-fitted-C6k3GnMc.js +2 -0
- package/bundled-test-harness/assets/file-shell-fitted-iSTg3PJa.js +98 -0
- package/bundled-test-harness/assets/file-shell-isolated-C-pEod2J.js +195 -0
- package/bundled-test-harness/assets/file-shell-isolated-DI9oU7ix.js +2 -0
- package/bundled-test-harness/assets/file-tree-from-index-BtOOMqnb.js +151 -0
- package/bundled-test-harness/assets/file-tree-from-index-test-T8w3hPw_.js +96 -0
- package/bundled-test-harness/assets/film-5n9_gRqZ.js +4074 -0
- package/bundled-test-harness/assets/film-Ca2Vzlfu.js +13 -0
- package/bundled-test-harness/assets/film-DEvhBbBu.js +2 -0
- package/bundled-test-harness/assets/fitted-6OGuHgoU.js +2 -0
- package/bundled-test-harness/assets/fitted-B2l1jlSp.js +34 -0
- package/bundled-test-harness/assets/flac-meta-extractor-BoJqvmDC.js +99 -0
- package/bundled-test-harness/assets/font-file-def-Czzt5paT.js +64 -0
- package/bundled-test-harness/assets/font-meta-extractor-DQYT_e5b.js +2 -0
- package/bundled-test-harness/assets/font-meta-extractor-IHD-pG8V.js +303 -0
- package/bundled-test-harness/assets/formatted-aibot-message-test-Djsl8RzE.js +109 -0
- package/bundled-test-harness/assets/from-elsewhere-BXcLYxxu.js +131 -0
- package/bundled-test-harness/assets/frontmatter-field-CciolgL3.js +41 -0
- package/bundled-test-harness/assets/garbage-collection-test-BTOLAfB6.js +403 -0
- package/bundled-test-harness/assets/gauge-C1loqGq3.js +2 -0
- package/bundled-test-harness/assets/gauge-u8dxl90d.js +106 -0
- package/bundled-test-harness/assets/general-test-Cd5WtVvd.js +926 -0
- package/bundled-test-harness/assets/get-relationship-membership-state-test-DJAuhOVM.js +1308 -0
- package/bundled-test-harness/assets/gif-meta-extractor-tSaPtuYW.js +114 -0
- package/bundled-test-harness/assets/glimmer-motion-and-choreo-in-cards-test-DNSy5l59.js +160 -0
- package/bundled-test-harness/assets/glimmer-motion-and-choreo-test-B6BbQxYq.js +74 -0
- package/bundled-test-harness/assets/helper-m6jA5HmU.js +478 -0
- package/bundled-test-harness/assets/host-submode-test-CsgdksBi.js +1243 -0
- package/bundled-test-harness/assets/html-file-def-yKtdMSa-.js +82 -0
- package/bundled-test-harness/assets/hydratable-card-CxNfbqly.js +147 -0
- package/bundled-test-harness/assets/hydratable-card-test-NJ4CI4ey.js +426 -0
- package/bundled-test-harness/assets/icons-B3SAtRoj.js +894 -0
- package/bundled-test-harness/assets/image-file-def-B0rpS3Yy.js +3 -0
- package/bundled-test-harness/assets/image-file-def-DUFmjNL8.js +65 -0
- package/bundled-test-harness/assets/image-olOUqgMQ.js +47 -0
- package/bundled-test-harness/assets/index-changes-test-D7OE-99k.js +367 -0
- package/bundled-test-harness/assets/index-query-engine-test-BBKqgSmg.js +2593 -0
- package/bundled-test-harness/assets/inspector-test-DV6Ms2uz.js +1930 -0
- package/bundled-test-harness/assets/instance-filter-matcher-test-Bs4kf7E8.js +788 -0
- package/bundled-test-harness/assets/interact-submode-creation-and-permissions-test-DIfgRhIN.js +475 -0
- package/bundled-test-harness/assets/interact-submode-setup-D4M_e580.js +566 -0
- package/bundled-test-harness/assets/is-component-declaration-test-jPGRTVh1.js +50 -0
- package/bundled-test-harness/assets/iso-bmff-DHtkSbQM.js +205 -0
- package/bundled-test-harness/assets/iso-bmff-zmOHoSVg.js +2 -0
- package/bundled-test-harness/assets/isolated-and-edit-BAnwcK1T.js +2 -0
- package/bundled-test-harness/assets/job-priority-header-test-7j2f3Dtl.js +81 -0
- package/bundled-test-harness/assets/job-scoped-instance-residency-test-DPzVQUL3.js +103 -0
- package/bundled-test-harness/assets/join-the-community-Ft5fjeIA.js +86 -0
- package/bundled-test-harness/assets/jpg-meta-extractor-Dsq6rZ8F.js +88 -0
- package/bundled-test-harness/assets/json-field-CxOZvp3k.js +19 -0
- package/bundled-test-harness/assets/json-field-ojdwGD6T.js +2 -0
- package/bundled-test-harness/assets/json-file-def-Da_5-zSM.js +298 -0
- package/bundled-test-harness/assets/last-modified-date-BnyJsc04.js +43 -0
- package/bundled-test-harness/assets/last-modified-date-test-DFl2mo1B.js +28 -0
- package/bundled-test-harness/assets/links-to-editor-DO24-71w.js +2 -0
- package/bundled-test-harness/assets/links-to-many-component-C7DabwAY.js +2 -0
- package/bundled-test-harness/assets/linksto-broken-link-placeholder-test-D4lDhvnQ.js +398 -0
- package/bundled-test-harness/assets/linksto-error-sentinel-test-oWgDz00K.js +238 -0
- package/bundled-test-harness/assets/linksto-many-broken-link-placeholder-test-CpSl7zJ7.js +354 -0
- package/bundled-test-harness/assets/linksto-many-per-slot-access-test-DJY3J8Xl.js +303 -0
- package/bundled-test-harness/assets/linksto-sentinel-reload-test-BxzfoONe.js +197 -0
- package/bundled-test-harness/assets/linksto-sentinel-roundtrip-test-DyE99km_.js +260 -0
- package/bundled-test-harness/assets/linksto-singular-js-access-contract-test-dcWAAgxt.js +196 -0
- package/bundled-test-harness/assets/llm-model-DrswiczZ.js +64 -0
- package/bundled-test-harness/assets/login-C-EIG0-Q.css +543 -0
- package/bundled-test-harness/assets/login-CNeL-9IC.js +408 -0
- package/bundled-test-harness/assets/login-error-text-test-CEH2tjNP.js +51 -0
- package/bundled-test-harness/assets/login-test-BpMx7qwV.js +246 -0
- package/bundled-test-harness/assets/m4a-meta-extractor-BJkMHUIK.js +204 -0
- package/bundled-test-harness/assets/main-BaUgfpPE.js +5 -0
- package/bundled-test-harness/assets/markdown-ByEGbwov.js +7 -0
- package/bundled-test-harness/assets/markdown-KJzgTg-A.js +2 -0
- package/bundled-test-harness/assets/markdown-editor-mode-select-BUGPXaSE.js +2 -0
- package/bundled-test-harness/assets/markdown-editor-mode-select-DBk8dG0O.js +54 -0
- package/bundled-test-harness/assets/markdown-embed-chooser-modal-test-BIlEmna9.js +470 -0
- package/bundled-test-harness/assets/markdown-embed-preview-pane-test-B6rscKpk.js +447 -0
- package/bundled-test-harness/assets/markdown-embed-preview-test-CTQw1wq-.js +368 -0
- package/bundled-test-harness/assets/markdown-fallback-BVsco6gJ.js +2 -0
- package/bundled-test-harness/assets/markdown-fallback-test-C_CIFEzH.js +316 -0
- package/bundled-test-harness/assets/markdown-highlighting-test-D6YvywF5.js +244 -0
- package/bundled-test-harness/assets/markdown-preview-1TSMSUv0.js +64 -0
- package/bundled-test-harness/assets/markdown-preview-jbuUjLoD.js +72 -0
- package/bundled-test-harness/assets/markdown-preview-test-zuU5uoA_.js +238 -0
- package/bundled-test-harness/assets/markdown-skill-frontmatter-test-CoicGRkb.js +146 -0
- package/bundled-test-harness/assets/menu-items-DZ_uOoYu.js +2 -0
- package/bundled-test-harness/assets/message-tool-test-K6LgTq5d.js +33 -0
- package/bundled-test-harness/assets/metadata-fields-WiOuUCDl.js +1415 -0
- package/bundled-test-harness/assets/metadata-fields-iu5AfQp3.js +2 -0
- package/bundled-test-harness/assets/midi-audio-def-CD2-4Wjx.js +52 -0
- package/bundled-test-harness/assets/midi-meta-extractor-CE3sLiEV.js +284 -0
- package/bundled-test-harness/assets/midi-meta-extractor-O7c8LHYV.js +2 -0
- package/bundled-test-harness/assets/migrate-skill-test-Beh-AeSN.js +161 -0
- package/bundled-test-harness/assets/mini-BNXINKKF.js +85 -0
- package/bundled-test-harness/assets/mini-C43Q4BWp.js +1519 -0
- package/bundled-test-harness/assets/mini-card-chooser-test-B1GMp-31.js +272 -0
- package/bundled-test-harness/assets/mini-file-chooser-test-CbI1vrQn.js +201 -0
- package/bundled-test-harness/assets/missing-template-BPhJRbDs.js +48 -0
- package/bundled-test-harness/assets/missing-template-DP-Pi-HQ.js +2 -0
- package/bundled-test-harness/assets/modal-KpPz2f8x.js +322 -0
- package/bundled-test-harness/assets/modal-container-0Efz_h2z.js +40 -0
- package/bundled-test-harness/assets/model-cost-tier-test-D-5VSjh6.js +173 -0
- package/bundled-test-harness/assets/module-contents-service-BRkTETb6.js +256 -0
- package/bundled-test-harness/assets/moment-Cln59YUK.js +3474 -0
- package/bundled-test-harness/assets/monaco-AbHCoDJY.js +143 -0
- package/bundled-test-harness/assets/monaco-test-DCPi18sy.js +100 -0
- package/bundled-test-harness/assets/monaco-test-waiter-lvFEYpFj.js +190 -0
- package/bundled-test-harness/assets/month-1eUIsvWN.js +2 -0
- package/bundled-test-harness/assets/month-BeUdWMWQ.js +123 -0
- package/bundled-test-harness/assets/month-day-Bbsd8YbR.js +192 -0
- package/bundled-test-harness/assets/month-day-Dks5STJu.js +2 -0
- package/bundled-test-harness/assets/month-year-pL_rpUhX.js +2 -0
- package/bundled-test-harness/assets/month-year-wH_YnYgL.js +93 -0
- package/bundled-test-harness/assets/mp3-meta-extractor-C3u34UHM.js +476 -0
- package/bundled-test-harness/assets/mp4-meta-extractor-Bj3F7dxs.js +188 -0
- package/bundled-test-harness/assets/multiple-stacks-test-mkNdTUMI.js +208 -0
- package/bundled-test-harness/assets/nested-query-field-render-test-BQLn3wg9.js +249 -0
- package/bundled-test-harness/assets/no-stacks-test-DpwZQAJ-.js +48 -0
- package/bundled-test-harness/assets/number-DZa-fHpu.js +151 -0
- package/bundled-test-harness/assets/number-Dvua76YP.js +3 -0
- package/bundled-test-harness/assets/number-field-test-BiaH2eaB.js +184 -0
- package/bundled-test-harness/assets/number-input-D5nDYDkK.js +82 -0
- package/bundled-test-harness/assets/office-extract-JzYva33g.js +27 -0
- package/bundled-test-harness/assets/office-extract-XMpsyYRh.js +2 -0
- package/bundled-test-harness/assets/ogg-meta-extractor-DJosZ9LA.js +225 -0
- package/bundled-test-harness/assets/on-key-BBVkS8Bi.js +472 -0
- package/bundled-test-harness/assets/ooxml-BlAE2w4d.js +172 -0
- package/bundled-test-harness/assets/ooxml-D-p8OmuM.js +2 -0
- package/bundled-test-harness/assets/open-image-in-new-tab-test-DWBU5pw9.js +52 -0
- package/bundled-test-harness/assets/operation-lowering-test-nzqprueU.js +2812 -0
- package/bundled-test-harness/assets/operations-CPvfTuY3.js +766 -0
- package/bundled-test-harness/assets/operations-invocation-test-C75T6zn3.js +523 -0
- package/bundled-test-harness/assets/operations-query-test-BoCszQEW.js +459 -0
- package/bundled-test-harness/assets/operations-test-79ipSnpM.js +2518 -0
- package/bundled-test-harness/assets/operations-x3Aw2Nky.js +3 -0
- package/bundled-test-harness/assets/operator-mode-acceptance-test-jjsYtt96.js +1188 -0
- package/bundled-test-harness/assets/operator-mode-card-chooser-test-hZP9gEQK.js +1036 -0
- package/bundled-test-harness/assets/operator-mode-links-test-DN16SuIx.js +793 -0
- package/bundled-test-harness/assets/operator-mode-state-service-gwiTSiWX.js +1275 -0
- package/bundled-test-harness/assets/operator-mode-state-service-test-Dt2qnKKP.js +206 -0
- package/bundled-test-harness/assets/operator-mode-test-BZnnxO9q.js +683 -0
- package/bundled-test-harness/assets/operator-mode-ui-test-O--qEo-y.js +1027 -0
- package/bundled-test-harness/assets/overlay-menu-items-test-Bl2k0aAa.js +317 -0
- package/bundled-test-harness/assets/overlays-CdN_JokA.js +270 -0
- package/bundled-test-harness/assets/overlays-clip-test-DpbR1ZTz.js +91 -0
- package/bundled-test-harness/assets/overlays-detached-element-test-cLgEGvMs.js +56 -0
- package/bundled-test-harness/assets/pane-PYdezM7g.js +330 -0
- package/bundled-test-harness/assets/panel-7FDqkxrr.js +474 -0
- package/bundled-test-harness/assets/panel-C3E0s49q.js +3540 -0
- package/bundled-test-harness/assets/past-sessions-test-BsjEeoze.js +321 -0
- package/bundled-test-harness/assets/patch-fields-test-CsixJmSr.js +1014 -0
- package/bundled-test-harness/assets/patch-instance-test-CBDgTi0L.js +348 -0
- package/bundled-test-harness/assets/pdf-file-def-9VNjnqDa.js +76 -0
- package/bundled-test-harness/assets/pdf-meta-extractor-BF4e5kMR.js +156 -0
- package/bundled-test-harness/assets/pdf-meta-extractor-D8Bxh2cc.js +2 -0
- package/bundled-test-harness/assets/pdf-viewer-Bu413sN8.js +112 -0
- package/bundled-test-harness/assets/pdf-viewer-GKDi_xmf.js +2 -0
- package/bundled-test-harness/assets/percentage-TOr6qK2T.js +84 -0
- package/bundled-test-harness/assets/permission-checking-realm-test-BRNVYszm.js +306 -0
- package/bundled-test-harness/assets/phone-number-D5SR8nWu.js +236 -0
- package/bundled-test-harness/assets/phone-number-field-test-DffwtqGd.js +73 -0
- package/bundled-test-harness/assets/phone-number-hf_xIVGQ.js +2 -0
- package/bundled-test-harness/assets/plate-Vojc88hM.js +41 -0
- package/bundled-test-harness/assets/plate-dTUzEMj5.js +2 -0
- package/bundled-test-harness/assets/player-CmRw0uM5.js +82 -0
- package/bundled-test-harness/assets/player-Dt85lPZl.js +2 -0
- package/bundled-test-harness/assets/plural-field-components-test-DNpGuH1D.js +198 -0
- package/bundled-test-harness/assets/png-image-def-GY7gjqya.js +48 -0
- package/bundled-test-harness/assets/png-meta-extractor-4pI611re.js +2 -0
- package/bundled-test-harness/assets/png-meta-extractor-CHp_rpAi.js +111 -0
- package/bundled-test-harness/assets/policy-scoped-search-test-CipPu7tY.js +339 -0
- package/bundled-test-harness/assets/pptx-file-def-lBBiebvn.js +60 -0
- package/bundled-test-harness/assets/pptx-meta-extractor-BjJYWiOJ.js +77 -0
- package/bundled-test-harness/assets/pptx-meta-extractor-DbT-dPRg.js +2 -0
- package/bundled-test-harness/assets/prerender-persistence-block-test-ClHMVvJt.js +124 -0
- package/bundled-test-harness/assets/prerender-serialize-cycle-test-LdqaMTK8.js +134 -0
- package/bundled-test-harness/assets/preview-CYlam_aW.js +74 -0
- package/bundled-test-harness/assets/preview-format-CiSo4kEa.js +41 -0
- package/bundled-test-harness/assets/preview-format-test-MsB1TOLB.js +103 -0
- package/bundled-test-harness/assets/process-card-B3xBGkv1.js +2 -0
- package/bundled-test-harness/assets/process-card-DumVcx9E.js +114 -0
- package/bundled-test-harness/assets/process-card-test-C44H8yVy.js +94 -0
- package/bundled-test-harness/assets/profile-settings-modal-ipYzrVTz.js +708 -0
- package/bundled-test-harness/assets/progress-circle-DJ6WSO2E.js +95 -0
- package/bundled-test-harness/assets/progress-circle-q358_9Sn.js +2 -0
- package/bundled-test-harness/assets/quarter-BjO5DlU2.js +2 -0
- package/bundled-test-harness/assets/quarter-_D72FwfS.js +168 -0
- package/bundled-test-harness/assets/query-field-membership-status-test-CzDyfK49.js +323 -0
- package/bundled-test-harness/assets/query-field-page-optin-test-B-x3vsmC.js +126 -0
- package/bundled-test-harness/assets/query-field-schema-test-DFw6KuYv.js +231 -0
- package/bundled-test-harness/assets/query-field-stale-prerender-test-DSQ-cv_O.js +152 -0
- package/bundled-test-harness/assets/query-fields-test-DQiMFRCe.js +535 -0
- package/bundled-test-harness/assets/rail-CNspDFyn.js +44 -0
- package/bundled-test-harness/assets/rail-D2YcQ0VP.js +2 -0
- package/bundled-test-harness/assets/realm-82Z5RUM_.js +95 -0
- package/bundled-test-harness/assets/realm-config-SgrwqjRu.js +844 -0
- package/bundled-test-harness/assets/realm-config-policy-standing-test-C6sQNk2u.js +290 -0
- package/bundled-test-harness/assets/realm-config-routing-rule-edit-test-DcYXBlvi.js +274 -0
- package/bundled-test-harness/assets/realm-config-settings-test-DblJv06X.js +187 -0
- package/bundled-test-harness/assets/realm-dropdown-CDvL8k3B.js +560 -0
- package/bundled-test-harness/assets/realm-et890flh.js +2 -0
- package/bundled-test-harness/assets/realm-field-test-pBK_x-Xw.js +100 -0
- package/bundled-test-harness/assets/realm-indexing-test-DSFn2F8F.js +4380 -0
- package/bundled-test-harness/assets/realm-policy-test-DYnLqzTS.js +1141 -0
- package/bundled-test-harness/assets/realm-test-DOZT2EG5.js +2363 -0
- package/bundled-test-harness/assets/realm-url-tooltip-qaXTjRb-.js +56 -0
- package/bundled-test-harness/assets/realm-url-tooltip-test-DGTEeLH9.js +78 -0
- package/bundled-test-harness/assets/reasoning-test-BRkhvYjr.js +234 -0
- package/bundled-test-harness/assets/recent-colors-addon-BreXcpg8.js +2 -0
- package/bundled-test-harness/assets/recent-colors-addon-CmCkbJ2_.js +61 -0
- package/bundled-test-harness/assets/relationship-loading-state-test-B6UGYKzG.js +290 -0
- package/bundled-test-harness/assets/relative-time-BjHvL023.js +2 -0
- package/bundled-test-harness/assets/relative-time-ChYKOMIM.js +129 -0
- package/bundled-test-harness/assets/remix-card-test-CpV0kKfq.js +58 -0
- package/bundled-test-harness/assets/rendered-markdown-CJa7IzCC.js +263 -0
- package/bundled-test-harness/assets/rendered-markdown-test-CVKsHS4P.js +587 -0
- package/bundled-test-harness/assets/resident-instance-reuse-test-jQfW1NMn.js +82 -0
- package/bundled-test-harness/assets/response-field-B2-daCl2.js +38 -0
- package/bundled-test-harness/assets/result-tile-BSg4mzbc.js +140 -0
- package/bundled-test-harness/assets/rich-markdown-BtP1yamM.js +2 -0
- package/bundled-test-harness/assets/rich-markdown-C6rQUngb.js +218 -0
- package/bundled-test-harness/assets/rich-markdown-field-test-9yB6ykCe.js +1647 -0
- package/bundled-test-harness/assets/room-C7tKd02X.js +1008 -0
- package/bundled-test-harness/assets/room-message-test-DsMmRYpV.js +445 -0
- package/bundled-test-harness/assets/room-test-golI1H61.js +95 -0
- package/bundled-test-harness/assets/run-realm-code-CbXk6bnK.js +1600 -0
- package/bundled-test-harness/assets/run-realm-code-test-B9JeesaW.js +2468 -0
- package/bundled-test-harness/assets/schema-generation-test-uLLGm5Vh.js +28 -0
- package/bundled-test-harness/assets/score-BQhCQdUP.js +2 -0
- package/bundled-test-harness/assets/score-CoWEzENH.js +100 -0
- package/bundled-test-harness/assets/scrolling-test-WHWEkKeZ.js +384 -0
- package/bundled-test-harness/assets/search-BkQYpQDY.js +605 -0
- package/bundled-test-harness/assets/search-adorn-test-CW92JPOk.js +136 -0
- package/bundled-test-harness/assets/search-entries-BU4w6Ymc.js +472 -0
- package/bundled-test-harness/assets/search-entries-result-test-9eydsDtD.js +234 -0
- package/bundled-test-harness/assets/search-entries-test-ByUREx0G.js +1486 -0
- package/bundled-test-harness/assets/search-result-header-UFkdo0Bx.js +128 -0
- package/bundled-test-harness/assets/search-results-DrHTuVRZ.js +266 -0
- package/bundled-test-harness/assets/search-results-test-krtQQM57.js +578 -0
- package/bundled-test-harness/assets/search-selection-menu-test-DoqSbez7.js +108 -0
- package/bundled-test-harness/assets/search-sheet-persistence-test-4ZPaEY-y.js +131 -0
- package/bundled-test-harness/assets/search-test-BYpq32RM.js +2241 -0
- package/bundled-test-harness/assets/searchable-BXw4T11q.js +192 -0
- package/bundled-test-harness/assets/searchable-CVvPDA3Q.js +2 -0
- package/bundled-test-harness/assets/searchable-option-test-BhLFI4ei.js +322 -0
- package/bundled-test-harness/assets/searchable-search-doc-test-DrNLCF73.js +1271 -0
- package/bundled-test-harness/assets/secure-sign-in-VNQhe0ae.js +130 -0
- package/bundled-test-harness/assets/secure-sign-in-Za8PX9cD.css +24 -0
- package/bundled-test-harness/assets/secure-sign-in-aunWHCrB.js +73 -0
- package/bundled-test-harness/assets/secure-sign-in-test-BcY1TcNd.js +32 -0
- package/bundled-test-harness/assets/secure-sign-in-test-DRdz89BT.js +245 -0
- package/bundled-test-harness/assets/sending-test-mbHpGZUu.js +576 -0
- package/bundled-test-harness/assets/serialization-rri-form-audit-test-nypV9J82.js +136 -0
- package/bundled-test-harness/assets/serialization-test-aLwrFv4d.js +8758 -0
- package/bundled-test-harness/assets/setup-Dgn0s6Zk.js +772 -0
- package/bundled-test-harness/assets/shared-link-target-reuse-test-D9MR2UNc.js +207 -0
- package/bundled-test-harness/assets/show-card-Dwfk332M.js +67 -0
- package/bundled-test-harness/assets/show-card-test-CRPwwJvc.js +365 -0
- package/bundled-test-harness/assets/show-file-DLdFPHMR.js +34 -0
- package/bundled-test-harness/assets/signed-capture-DUR9PohQ.js +204 -0
- package/bundled-test-harness/assets/signed-capture-link-test-DfTAB6OT.js +132 -0
- package/bundled-test-harness/assets/single-stack-test-Crr_8nti.js +652 -0
- package/bundled-test-harness/assets/skill-DQ00VonZ.js +3 -0
- package/bundled-test-harness/assets/skill-reference-LEitQV9i.js +112 -0
- package/bundled-test-harness/assets/skill-yZXS1VHQ.js +76 -0
- package/bundled-test-harness/assets/skills-test-D3-C-Dbm.js +648 -0
- package/bundled-test-harness/assets/slider-picker-B6AxKL2j.js +245 -0
- package/bundled-test-harness/assets/slider-picker-C4Tc5o-s.js +2 -0
- package/bundled-test-harness/assets/spec-Cl_LB6nC.js +602 -0
- package/bundled-test-harness/assets/spinner-BHFM7zcR.js +39 -0
- package/bundled-test-harness/assets/spinner-DvAvsyDT.css +21 -0
- package/bundled-test-harness/assets/store-BV6WX8oV.js +2205 -0
- package/bundled-test-harness/assets/store-module-rebuild-test-HyphFJiF.js +454 -0
- package/bundled-test-harness/assets/store-search-test-nUeJ5opb.js +175 -0
- package/bundled-test-harness/assets/store-test-BebUIJAg.js +3460 -0
- package/bundled-test-harness/assets/string-BHZZwNlZ.js +9 -0
- package/bundled-test-harness/assets/submode-switcher-D-U9cXo0.js +169 -0
- package/bundled-test-harness/assets/svg-meta-extractor-BsG4w2nX.js +42 -0
- package/bundled-test-harness/assets/swatches-picker-4vFztxHo.js +33 -0
- package/bundled-test-harness/assets/swatches-picker-C7RE7uJ8.js +2 -0
- package/bundled-test-harness/assets/switch-submode-CuA0Zfjn.js +79 -0
- package/bundled-test-harness/assets/switch-submode-test-i1Qic_Cp.js +168 -0
- package/bundled-test-harness/assets/tag-CZNs3DPN.js +105 -0
- package/bundled-test-harness/assets/tests-BneuP252.js +3523 -0
- package/bundled-test-harness/assets/text-area-DAShQQBe.js +9 -0
- package/bundled-test-harness/assets/text-file-def-D2Rs6nS1.js +151 -0
- package/bundled-test-harness/assets/text-input-validator-test-C9IG-1GZ.js +156 -0
- package/bundled-test-harness/assets/theme-Dm8LWaRK.js +9 -0
- package/bundled-test-harness/assets/theme-card-test-Cbb6tAap.js +621 -0
- package/bundled-test-harness/assets/theme-scheme-island-test-DOVLakx3.js +264 -0
- package/bundled-test-harness/assets/three-d-model-def-DWSPQGgD.js +70 -0
- package/bundled-test-harness/assets/time--_Txqya1.js +126 -0
- package/bundled-test-harness/assets/time-DKD7Bdjd.js +2 -0
- package/bundled-test-harness/assets/time-slots-BZaugjq_.js +2 -0
- package/bundled-test-harness/assets/time-slots-C85M0rWl.js +85 -0
- package/bundled-test-harness/assets/timeline-B3KGDm3M.js +2 -0
- package/bundled-test-harness/assets/timeline-BMwgaZZu.js +59 -0
- package/bundled-test-harness/assets/to-device-streaming-test-CMp5bFiz.js +163 -0
- package/bundled-test-harness/assets/token-usage-test-CXA0b8Ep.js +166 -0
- package/bundled-test-harness/assets/tool-field-BGLelnsr.js +94 -0
- package/bundled-test-harness/assets/tool-field-BOFuDDt3.js +2 -0
- package/bundled-test-harness/assets/tools-CTjy7Aub.js +725 -0
- package/bundled-test-harness/assets/tools-calling-test--JR-7AK7.js +200 -0
- package/bundled-test-harness/assets/tools-test-6yAW3W5I.js +2820 -0
- package/bundled-test-harness/assets/tools-test-DhpMUQkz.js +1624 -0
- package/bundled-test-harness/assets/ts-file-def-CDbf8aw2.js +159 -0
- package/bundled-test-harness/assets/update-room-skills-test-DoKsS_1C.js +240 -0
- package/bundled-test-harness/assets/url-D0ooeJxC.js +2 -0
- package/bundled-test-harness/assets/url-mFskVPSX.js +96 -0
- package/bundled-test-harness/assets/video-file-def-AcmWqzev.js +76 -0
- package/bundled-test-harness/assets/wav-meta-extractor-CbTLruQf.js +368 -0
- package/bundled-test-harness/assets/webm-meta-extractor-C9JH-CMX.js +178 -0
- package/bundled-test-harness/assets/webp-meta-extractor-C6sHm4J7.js +98 -0
- package/bundled-test-harness/assets/website-Bxuk_OmR.js +92 -0
- package/bundled-test-harness/assets/week-Bxssxce7.js +2 -0
- package/bundled-test-harness/assets/week-DQLj9974.js +111 -0
- package/bundled-test-harness/assets/welcome-to-boxel-BH82RsW5.js +172 -0
- package/bundled-test-harness/assets/workspace-DJ_s2x4g.js +614 -0
- package/bundled-test-harness/assets/workspace-a11y-test-BJbZNgoP.js +197 -0
- package/bundled-test-harness/assets/workspace-behavior-test-BLBARTfb.js +200 -0
- package/bundled-test-harness/assets/workspace-chooser-BpmlVrVn.js +2219 -0
- package/bundled-test-harness/assets/workspace-chooser-CqLR2Dzh.css +1296 -0
- package/bundled-test-harness/assets/workspace-chooser-catalog-order-test-CmAVNAWC.js +36 -0
- package/bundled-test-harness/assets/workspace-chooser-unreachable-notice-test-DEfG7Uh9.js +60 -0
- package/bundled-test-harness/assets/workspace-delete-multiple-test-DE7Z8ooj.js +212 -0
- package/bundled-test-harness/assets/workspace-delete-summary-test-CwtG_zLH.js +63 -0
- package/bundled-test-harness/assets/workspace-timestamp-labels-test-DFAaRmJW.js +58 -0
- package/bundled-test-harness/assets/xlsx-file-def-DcvaRYnZ.js +60 -0
- package/bundled-test-harness/assets/xlsx-meta-extractor-0RlViVaf.js +101 -0
- package/bundled-test-harness/assets/xlsx-meta-extractor-BH30Vuem.js +2 -0
- package/bundled-test-harness/assets/year-B_MBk_hE.js +78 -0
- package/bundled-test-harness/assets/year-hSpccI9L.js +2 -0
- package/bundled-test-harness/assets/zip-file-def-c84iddi9.js +288 -0
- package/bundled-test-harness/index.html +78 -68
- package/bundled-test-harness/tests/index.html +78 -68
- package/bundled-types/host-app/components/matrix/account-switch-failed.gts +2 -2
- package/bundled-types/host-app/components/matrix/auth.gts +2 -2
- package/bundled-types/host-app/components/matrix/cli-auth.gts +7 -6
- package/bundled-types/host-app/components/matrix/forgot-password.gts +43 -129
- package/bundled-types/host-app/components/matrix/login.gts +15 -118
- package/bundled-types/host-app/components/matrix/register-user.gts +45 -226
- package/bundled-types/host-app/components/matrix/secure-sign-in.gts +235 -0
- package/bundled-types/host-app/components/operator-mode/container.gts +13 -1
- package/bundled-types/host-app/components/operator-mode/profile-info-popover.gts +1 -1
- package/bundled-types/host-app/config/environment.ts +1 -1
- package/bundled-types/host-app/lib/secure-sign-in.ts +130 -0
- package/bundled-types/host-app/services/matrix-service.ts +46 -0
- package/bundled-types/host-app/services/monaco-service.ts +0 -5
- package/bundled-types/host-app/utils/login-token.ts +23 -10
- package/dist/api.js +1 -1
- package/dist/index.js +289 -285
- package/package.json +1 -1
- package/src/build-program.ts +6 -2
- package/src/commands/profile.ts +72 -3
- package/src/lib/profile-manager.ts +5 -1
- package/src/lib/secure-session.ts +29 -0
- package/src/lib/sso-login.ts +94 -15
- package/bundled-test-harness/assets/account-switch-failed-B3pr_iC3.js +0 -32
- package/bundled-test-harness/assets/account-switch-failed-DTGZZo-G.css +0 -61
- package/bundled-test-harness/assets/account-switch-failed-test-9ENVgvlx.js +0 -45
- package/bundled-test-harness/assets/add-workspace-BAbk0250.js +0 -141
- package/bundled-test-harness/assets/add-workspace-test-ChAja_t-.js +0 -72
- package/bundled-test-harness/assets/advanced-color-picker-C-xBFJ2S.js +0 -504
- package/bundled-test-harness/assets/advanced-color-picker-bWAmCT-8.js +0 -2
- package/bundled-test-harness/assets/ai-assistant-test-BJ9yetuC.js +0 -2211
- package/bundled-test-harness/assets/ai-module-creation-test-Bw3TKS9d.js +0 -151
- package/bundled-test-harness/assets/aibot-message-DkgHT6eJ.js +0 -465
- package/bundled-test-harness/assets/app-DW5QjtRp.js +0 -22816
- package/bundled-test-harness/assets/app-yCDjO4mk.css +0 -2718
- package/bundled-test-harness/assets/audio-file-def-bJ3cXVmC.js +0 -133
- package/bundled-test-harness/assets/avif-meta-extractor-CrSDfYEt.js +0 -162
- package/bundled-test-harness/assets/base64-image-C7UBjK5W.js +0 -262
- package/bundled-test-harness/assets/base64-image-CjWpxROT.js +0 -2
- package/bundled-test-harness/assets/big-integer-BBql7oGZ.js +0 -89
- package/bundled-test-harness/assets/big-integer-B_TrzRy_.js +0 -2
- package/bundled-test-harness/assets/binary-upload-dedupe-test-BiX8kS7D.js +0 -308
- package/bundled-test-harness/assets/boolean-9LNUUTfw.js +0 -2
- package/bundled-test-harness/assets/boolean-BAmK01TF.js +0 -94
- package/bundled-test-harness/assets/brand-functional-palette-CFuoS-LS.js +0 -137
- package/bundled-test-harness/assets/brand-logo-By89eknI.js +0 -295
- package/bundled-test-harness/assets/broken-link-template-test-odBriDSP.js +0 -192
- package/bundled-test-harness/assets/bundled-base-CLQkkmN4.js +0 -254
- package/bundled-test-harness/assets/bundled-base-modules-test-BYrTaTwa.js +0 -54
- package/bundled-test-harness/assets/buried-stack-item-scroll-test-DU4bM5nd.js +0 -236
- package/bundled-test-harness/assets/bxl-expression-test-Cs9JaZbC.js +0 -250
- package/bundled-test-harness/assets/can-invoke-test-ccMc06BU.js +0 -401
- package/bundled-test-harness/assets/card-api-Bn65NUT0.js +0 -8
- package/bundled-test-harness/assets/card-api-test-COrFXu2i.js +0 -198
- package/bundled-test-harness/assets/card-api-u1pOrwS6.js +0 -4393
- package/bundled-test-harness/assets/card-basics-test-D4rn3iN-.js +0 -5364
- package/bundled-test-harness/assets/card-chooser-paging-test-bZhdrUXt.js +0 -235
- package/bundled-test-harness/assets/card-chooser-test-D9w1duob.js +0 -393
- package/bundled-test-harness/assets/card-collection-ClCV-__1.js +0 -118
- package/bundled-test-harness/assets/card-context-search-results-H_rN3Upz.js +0 -30
- package/bundled-test-harness/assets/card-context-search-results-test-jciyaouV.js +0 -184
- package/bundled-test-harness/assets/card-def-field-def-relationships-test-BVZoQzM8.js +0 -562
- package/bundled-test-harness/assets/card-delete-test-CuLcZFnY.js +0 -466
- package/bundled-test-harness/assets/card-error-DIOivSkD.js +0 -72
- package/bundled-test-harness/assets/card-error-awaiting-index-test-JMwcRONq.js +0 -53
- package/bundled-test-harness/assets/card-error-detail-96jWBx6B.js +0 -271
- package/bundled-test-harness/assets/card-info-BxPtwG1h.js +0 -2
- package/bundled-test-harness/assets/card-list-B34qY3io.js +0 -2
- package/bundled-test-harness/assets/card-list-BpCaKkZJ.js +0 -202
- package/bundled-test-harness/assets/card-resource-DcPbIwH9.js +0 -86
- package/bundled-test-harness/assets/cards-grid-CTN8nBT_.js +0 -344
- package/bundled-test-harness/assets/cards-grid-Cx44vL-M.js +0 -2
- package/bundled-test-harness/assets/cards-grid-layout-BdL0Uzxl.js +0 -111
- package/bundled-test-harness/assets/cards-grid-layout-Dn8Yb4ma.js +0 -2
- package/bundled-test-harness/assets/check-correctness-test-BfMV-MC0.js +0 -554
- package/bundled-test-harness/assets/clip-CK6mVuyN.js +0 -92
- package/bundled-test-harness/assets/clip-CfXD1JTr.js +0 -2
- package/bundled-test-harness/assets/code-ref-85Bih6Zl.js +0 -138
- package/bundled-test-harness/assets/code-ref-DATHaoyt.js +0 -2
- package/bundled-test-harness/assets/code-submode-availability-test-DLYlx0wo.js +0 -198
- package/bundled-test-harness/assets/code-submode-test-CDIi7MjD.js +0 -1824
- package/bundled-test-harness/assets/codeblocks-test-CNPyTvuv.js +0 -418
- package/bundled-test-harness/assets/codemirror-editor-BPOPTR-f.js +0 -2
- package/bundled-test-harness/assets/codemirror-editor-DPhG0pec.js +0 -701
- package/bundled-test-harness/assets/codemirror-embed-toolbar-test-Dk5lFOUq.js +0 -366
- package/bundled-test-harness/assets/color-BxN5gRSg.js +0 -65
- package/bundled-test-harness/assets/color-CrunRcis.js +0 -2
- package/bundled-test-harness/assets/color-field-test-COjFIpXV.js +0 -212
- package/bundled-test-harness/assets/color-picker-field-C-GS1CIw.js +0 -139
- package/bundled-test-harness/assets/color-picker-field-D3RXhbCK.js +0 -2
- package/bundled-test-harness/assets/color-wheel-picker-Bz8cBmf4.js +0 -283
- package/bundled-test-harness/assets/color-wheel-picker-DrwPrB8B.js +0 -2
- package/bundled-test-harness/assets/command-data-BxXgtNBf.js +0 -2
- package/bundled-test-harness/assets/command-data-ZdkcpEgG.js +0 -95
- package/bundled-test-harness/assets/compaction-test-DS7DTGT_.js +0 -150
- package/bundled-test-harness/assets/components-CbCTWAON.js +0 -17777
- package/bundled-test-harness/assets/computed-test-D_OrXDtR.js +0 -1320
- package/bundled-test-harness/assets/container-DDolu1gk.js +0 -11109
- package/bundled-test-harness/assets/container-DndcCIMv.css +0 -5169
- package/bundled-test-harness/assets/contains-many-component-BtgnAXih.js +0 -2
- package/bundled-test-harness/assets/contrast-checker-addon-kwtLKWdL.js +0 -2
- package/bundled-test-harness/assets/contrast-checker-addon-zFY5cen1.js +0 -71
- package/bundled-test-harness/assets/convert-to-class-name-test-BcGWl2K1.js +0 -17
- package/bundled-test-harness/assets/coordinate-D72EF1Pl.js +0 -48
- package/bundled-test-harness/assets/copy-file-to-realm-test-CYoDX4YV.js +0 -148
- package/bundled-test-harness/assets/country-B-iIe5v8.js +0 -199
- package/bundled-test-harness/assets/create-file-modal-PpvMksjR.js +0 -570
- package/bundled-test-harness/assets/create-listing-modal-test-CQtEf_UD.js +0 -273
- package/bundled-test-harness/assets/create-listing-pr-request-test-CDtKWyfk.js +0 -117
- package/bundled-test-harness/assets/create-spec-test-Cbqk8I9T.js +0 -256
- package/bundled-test-harness/assets/create-specs-CZg2cpnh.js +0 -215
- package/bundled-test-harness/assets/create-submission-workflow-test-CYrxF7bg.js +0 -132
- package/bundled-test-harness/assets/credential-fields-test-Di4jCJgU.js +0 -157
- package/bundled-test-harness/assets/css-value-CceJyI5o.js +0 -48
- package/bundled-test-harness/assets/csv-file-def-DJL2aZI9.js +0 -277
- package/bundled-test-harness/assets/currency-Bn5WIqzF.js +0 -134
- package/bundled-test-harness/assets/date-XI2CVYA2.js +0 -2
- package/bundled-test-harness/assets/date-h83UJcFR.js +0 -183
- package/bundled-test-harness/assets/date-time-fields-test-Cterr2mj.js +0 -359
- package/bundled-test-harness/assets/datetime-DadI80tC.js +0 -201
- package/bundled-test-harness/assets/datetime-Dpb_Sejj.js +0 -2
- package/bundled-test-harness/assets/datetime-stamp-C4vv397u.js +0 -81
- package/bundled-test-harness/assets/datetime-stamp-DIsJdQux.js +0 -2
- package/bundled-test-harness/assets/day-C4pZoGNM.js +0 -113
- package/bundled-test-harness/assets/day-D0goBhKb.js +0 -2
- package/bundled-test-harness/assets/debug-message-test-CV0sj-fl.js +0 -117
- package/bundled-test-harness/assets/dist-CAIttNZm.js +0 -1710
- package/bundled-test-harness/assets/dist-CLbqnmnm.js +0 -389
- package/bundled-test-harness/assets/dist-qkBOmIQy.js +0 -323
- package/bundled-test-harness/assets/docx-file-def-hz2tVQKf.js +0 -60
- package/bundled-test-harness/assets/docx-meta-extractor-CeRshlxL.js +0 -60
- package/bundled-test-harness/assets/docx-meta-extractor-muK5CKF3.js +0 -2
- package/bundled-test-harness/assets/duration-BYx1dLfm.js +0 -2
- package/bundled-test-harness/assets/duration-FAmTFeUa.js +0 -184
- package/bundled-test-harness/assets/email-D-bFy_C1.js +0 -80
- package/bundled-test-harness/assets/email-field-test-CY9K2zur.js +0 -75
- package/bundled-test-harness/assets/email-j4DZNH2-.js +0 -2
- package/bundled-test-harness/assets/enum-B7_baAn_.js +0 -167
- package/bundled-test-harness/assets/enum-BQqNzVQS.js +0 -2
- package/bundled-test-harness/assets/enum-field-test-BJ9Epz15.js +0 -953
- package/bundled-test-harness/assets/error-display-test-CbDWjJ2F.js +0 -343
- package/bundled-test-harness/assets/ethereum-address-BOLEnKsm.js +0 -78
- package/bundled-test-harness/assets/ethereum-address-s3Kvb2wG.js +0 -2
- package/bundled-test-harness/assets/expiration-warning-BaIP1MOZ.js +0 -2
- package/bundled-test-harness/assets/expiration-warning-gjEtxPk0.js +0 -90
- package/bundled-test-harness/assets/externals-Bih8ejPS.js +0 -4393
- package/bundled-test-harness/assets/fallback-banner-MlImHjSD.js +0 -24
- package/bundled-test-harness/assets/fallback-banner-live-delete-test-Bm7IKXPf.js +0 -207
- package/bundled-test-harness/assets/fallback-banner-test-C7TGA0Ob.js +0 -53
- package/bundled-test-harness/assets/fallback-banner-test-lvuaVRXu.js +0 -225
- package/bundled-test-harness/assets/fallback-models-test-Dy7iIKUS.js +0 -161
- package/bundled-test-harness/assets/field-component-DBoOxTke.js +0 -2
- package/bundled-test-harness/assets/field-configuration-test-DnAnzyC-.js +0 -548
- package/bundled-test-harness/assets/field-edit-DdJ8Akso.js +0 -2
- package/bundled-test-harness/assets/field-edit-XAop92l8.js +0 -36
- package/bundled-test-harness/assets/field-markdown-domain-test-cZCqbcjj.js +0 -616
- package/bundled-test-harness/assets/field-markdown-oversize-test-BuATetVz.js +0 -88
- package/bundled-test-harness/assets/field-markdown-primitives-test-BsubQfhv.js +0 -365
- package/bundled-test-harness/assets/field-markdown-specialized-test-4eNLiYpF.js +0 -534
- package/bundled-test-harness/assets/field-test-helpers-9I7cHnaU.js +0 -45
- package/bundled-test-harness/assets/file-api-CC86I7Er.js +0 -7
- package/bundled-test-harness/assets/file-attachment-test-o9191GMb.js +0 -796
- package/bundled-test-harness/assets/file-chooser-panel-test-C8aZuJlk.js +0 -153
- package/bundled-test-harness/assets/file-chooser-test-B0Tn8CCR.js +0 -504
- package/bundled-test-harness/assets/file-def-edit-BSiF2Lje.js +0 -2
- package/bundled-test-harness/assets/file-def-edit-C5TYBp_q.js +0 -26
- package/bundled-test-harness/assets/file-def-embedded-BLVTCiVB.js +0 -2
- package/bundled-test-harness/assets/file-def-embedded-Bep4iD6s.js +0 -38
- package/bundled-test-harness/assets/file-def-fitted-BTs-AS78.js +0 -2
- package/bundled-test-harness/assets/file-def-fitted-DcPitdYu.js +0 -38
- package/bundled-test-harness/assets/file-def-isolated-Kg1YVhm-.js +0 -38
- package/bundled-test-harness/assets/file-def-isolated-tK5JWCam.js +0 -2
- package/bundled-test-harness/assets/file-def-serialization-test-D4wnd5XK.js +0 -89
- package/bundled-test-harness/assets/file-menu-items-CH4-naSK.js +0 -117
- package/bundled-test-harness/assets/file-menu-items-emUxx3ZI.js +0 -2
- package/bundled-test-harness/assets/file-preview-stage-B1McIWwu.js +0 -2
- package/bundled-test-harness/assets/file-preview-stage-BgZLNMN4.js +0 -72
- package/bundled-test-harness/assets/file-shell-embedded-BmfuwWfU.js +0 -2
- package/bundled-test-harness/assets/file-shell-embedded-zh8CJanA.js +0 -68
- package/bundled-test-harness/assets/file-shell-fitted-DSFUNRGJ.js +0 -2
- package/bundled-test-harness/assets/file-shell-fitted-DXKDH0fn.js +0 -98
- package/bundled-test-harness/assets/file-shell-isolated-0F1MFv4q.js +0 -2
- package/bundled-test-harness/assets/file-shell-isolated-DduZZzmi.js +0 -195
- package/bundled-test-harness/assets/file-tree-from-index-BzDvvUHy.js +0 -151
- package/bundled-test-harness/assets/file-tree-from-index-test-D0hfI4a1.js +0 -96
- package/bundled-test-harness/assets/film-BN_HVXBU.js +0 -13
- package/bundled-test-harness/assets/film-CKkbUi0L.js +0 -2
- package/bundled-test-harness/assets/film-CMNJITZ-.js +0 -4074
- package/bundled-test-harness/assets/fitted-CAvdcKpu.js +0 -34
- package/bundled-test-harness/assets/fitted-CbKOwd1u.js +0 -2
- package/bundled-test-harness/assets/flac-meta-extractor-e8qajPSl.js +0 -99
- package/bundled-test-harness/assets/font-file-def-9atde5W8.js +0 -64
- package/bundled-test-harness/assets/font-meta-extractor-IralDC8M.js +0 -303
- package/bundled-test-harness/assets/font-meta-extractor-zPBVOfoR.js +0 -2
- package/bundled-test-harness/assets/formatted-aibot-message-test-CWOiZUng.js +0 -109
- package/bundled-test-harness/assets/from-elsewhere-ChxbtsBa.js +0 -131
- package/bundled-test-harness/assets/frontmatter-field-cdig7KR9.js +0 -41
- package/bundled-test-harness/assets/garbage-collection-test-Dg-ww_Sb.js +0 -403
- package/bundled-test-harness/assets/gauge-B45nLOGe.js +0 -106
- package/bundled-test-harness/assets/gauge-BK-768BM.js +0 -2
- package/bundled-test-harness/assets/general-test-D7cn7PUr.js +0 -926
- package/bundled-test-harness/assets/get-relationship-membership-state-test-Skmj9V6y.js +0 -1308
- package/bundled-test-harness/assets/gif-meta-extractor-BychhK9q.js +0 -114
- package/bundled-test-harness/assets/glimmer-motion-and-choreo-in-cards-test-C09YUmk4.js +0 -160
- package/bundled-test-harness/assets/glimmer-motion-and-choreo-test-DYskx_Kk.js +0 -74
- package/bundled-test-harness/assets/helper-BHX0HLF2.js +0 -478
- package/bundled-test-harness/assets/host-submode-test-Clw_QnvF.js +0 -1243
- package/bundled-test-harness/assets/html-file-def-C0P9giwU.js +0 -82
- package/bundled-test-harness/assets/hydratable-card-DnjrxKsT.js +0 -147
- package/bundled-test-harness/assets/hydratable-card-test-BAmWHfv1.js +0 -426
- package/bundled-test-harness/assets/icons-DBXBZgLe.js +0 -894
- package/bundled-test-harness/assets/image-Cip6ojDd.js +0 -47
- package/bundled-test-harness/assets/image-file-def-BdQxjZcN.js +0 -65
- package/bundled-test-harness/assets/image-file-def-DP4aqWcS.js +0 -3
- package/bundled-test-harness/assets/index-changes-test-D8b_56Ke.js +0 -367
- package/bundled-test-harness/assets/index-query-engine-test-CCyaUwMX.js +0 -2593
- package/bundled-test-harness/assets/inspector-test-BJTVGdOO.js +0 -1930
- package/bundled-test-harness/assets/instance-filter-matcher-test-DjsPrXL7.js +0 -788
- package/bundled-test-harness/assets/interact-submode-creation-and-permissions-test-DSqM0vxh.js +0 -475
- package/bundled-test-harness/assets/interact-submode-setup-DF31UMX-.js +0 -566
- package/bundled-test-harness/assets/is-component-declaration-test-Did47eG9.js +0 -50
- package/bundled-test-harness/assets/iso-bmff-LuWkGL__.js +0 -205
- package/bundled-test-harness/assets/iso-bmff-_flO6c20.js +0 -2
- package/bundled-test-harness/assets/isolated-and-edit-frocLHin.js +0 -2
- package/bundled-test-harness/assets/job-priority-header-test-DHLAXfp7.js +0 -81
- package/bundled-test-harness/assets/job-scoped-instance-residency-test-C1Bt5j98.js +0 -103
- package/bundled-test-harness/assets/join-the-community-BBUSO2cs.js +0 -86
- package/bundled-test-harness/assets/jpg-meta-extractor-CoybO4Hq.js +0 -88
- package/bundled-test-harness/assets/json-field-8sdH5RQb.js +0 -2
- package/bundled-test-harness/assets/json-field-BDD3iTUh.js +0 -19
- package/bundled-test-harness/assets/json-file-def-BKibsfc6.js +0 -298
- package/bundled-test-harness/assets/last-modified-date-CR5jru2m.js +0 -43
- package/bundled-test-harness/assets/last-modified-date-test-jJ00YdTm.js +0 -28
- package/bundled-test-harness/assets/links-to-editor-rDoCYaN-.js +0 -2
- package/bundled-test-harness/assets/links-to-many-component-BqZT88Fb.js +0 -2
- package/bundled-test-harness/assets/linksto-broken-link-placeholder-test-Cp1Eb_4U.js +0 -398
- package/bundled-test-harness/assets/linksto-error-sentinel-test-Bddavnh_.js +0 -238
- package/bundled-test-harness/assets/linksto-many-broken-link-placeholder-test-c5WegXnR.js +0 -354
- package/bundled-test-harness/assets/linksto-many-per-slot-access-test-CWskzfGW.js +0 -303
- package/bundled-test-harness/assets/linksto-sentinel-reload-test-ByeVNhr8.js +0 -197
- package/bundled-test-harness/assets/linksto-sentinel-roundtrip-test-DP26i6Gb.js +0 -260
- package/bundled-test-harness/assets/linksto-singular-js-access-contract-test-fDUXx8tO.js +0 -196
- package/bundled-test-harness/assets/llm-model-BcLEkTV7.js +0 -64
- package/bundled-test-harness/assets/login-CeuuNVvU.css +0 -139
- package/bundled-test-harness/assets/login-DV0WlJv-.js +0 -348
- package/bundled-test-harness/assets/login-error-text-test-BMGY_9gW.js +0 -51
- package/bundled-test-harness/assets/login-test-CL9YpMH5.js +0 -246
- package/bundled-test-harness/assets/m4a-meta-extractor-CHO1JQtb.js +0 -204
- package/bundled-test-harness/assets/main-CPLT8JNu.js +0 -5
- package/bundled-test-harness/assets/markdown-BvBALLGh.js +0 -7
- package/bundled-test-harness/assets/markdown-DFezmrFD.js +0 -2
- package/bundled-test-harness/assets/markdown-editor-mode-select-Au64bcIO.js +0 -2
- package/bundled-test-harness/assets/markdown-editor-mode-select-rK9PP8rv.js +0 -54
- package/bundled-test-harness/assets/markdown-embed-chooser-modal-test-CIxizf5k.js +0 -470
- package/bundled-test-harness/assets/markdown-embed-preview-pane-test-C7GoNN7l.js +0 -447
- package/bundled-test-harness/assets/markdown-embed-preview-test-CDnj4uhd.js +0 -368
- package/bundled-test-harness/assets/markdown-fallback-n7PsLNmO.js +0 -2
- package/bundled-test-harness/assets/markdown-fallback-test-DTHT6OwQ.js +0 -316
- package/bundled-test-harness/assets/markdown-highlighting-test-DJ-4WSE_.js +0 -244
- package/bundled-test-harness/assets/markdown-preview-Ccelx5W-.js +0 -64
- package/bundled-test-harness/assets/markdown-preview-JXuMC_ve.js +0 -72
- package/bundled-test-harness/assets/markdown-preview-test-ByZqrpPk.js +0 -238
- package/bundled-test-harness/assets/markdown-skill-frontmatter-test-DAHGeL4K.js +0 -146
- package/bundled-test-harness/assets/menu-items-DzJm9H_H.js +0 -2
- package/bundled-test-harness/assets/message-tool-test-lmdrIEdY.js +0 -33
- package/bundled-test-harness/assets/metadata-fields-BZZr4Qe5.js +0 -2
- package/bundled-test-harness/assets/metadata-fields-BtdjGsKE.js +0 -1415
- package/bundled-test-harness/assets/midi-audio-def-uYbYFmFi.js +0 -52
- package/bundled-test-harness/assets/midi-meta-extractor-DNI5gc1q.js +0 -284
- package/bundled-test-harness/assets/midi-meta-extractor-DbKZ4fMG.js +0 -2
- package/bundled-test-harness/assets/migrate-skill-test-DI1xceiL.js +0 -161
- package/bundled-test-harness/assets/mini-CNoDyHqG.js +0 -1519
- package/bundled-test-harness/assets/mini-DexlIeKK.js +0 -85
- package/bundled-test-harness/assets/mini-card-chooser-test-DT5eIf1_.js +0 -272
- package/bundled-test-harness/assets/mini-file-chooser-test-DTQnKTZJ.js +0 -201
- package/bundled-test-harness/assets/missing-template-DL2mwddM.js +0 -2
- package/bundled-test-harness/assets/missing-template-ltqlJ4JC.js +0 -48
- package/bundled-test-harness/assets/modal-container-DRnt95-S.js +0 -40
- package/bundled-test-harness/assets/modal-zE95eEFp.js +0 -322
- package/bundled-test-harness/assets/model-cost-tier-test-CcFz7hcv.js +0 -173
- package/bundled-test-harness/assets/module-contents-service-Dk_zWt-V.js +0 -256
- package/bundled-test-harness/assets/month-BqReBYWo.js +0 -2
- package/bundled-test-harness/assets/month-RhvmIp40.js +0 -123
- package/bundled-test-harness/assets/month-day-XFAQA72z.js +0 -2
- package/bundled-test-harness/assets/month-day-XzKpk6nz.js +0 -192
- package/bundled-test-harness/assets/month-year-BeuNr2Cl.js +0 -2
- package/bundled-test-harness/assets/month-year-DhU7hATV.js +0 -93
- package/bundled-test-harness/assets/mp3-meta-extractor-Dx2RnJc5.js +0 -476
- package/bundled-test-harness/assets/mp4-meta-extractor--k0m8KsT.js +0 -188
- package/bundled-test-harness/assets/multiple-stacks-test-bC24IWcJ.js +0 -208
- package/bundled-test-harness/assets/nested-query-field-render-test-qxElXx1e.js +0 -249
- package/bundled-test-harness/assets/no-stacks-test-Br7IGAgV.js +0 -48
- package/bundled-test-harness/assets/number-73SsCMEF.js +0 -3
- package/bundled-test-harness/assets/number-CicTBWQd.js +0 -151
- package/bundled-test-harness/assets/number-field-test-kV5zXo1J.js +0 -184
- package/bundled-test-harness/assets/number-input-CQy4xUeA.js +0 -82
- package/bundled-test-harness/assets/office-extract-Bo8sbNkK.js +0 -27
- package/bundled-test-harness/assets/office-extract-CfBaoRMD.js +0 -2
- package/bundled-test-harness/assets/ogg-meta-extractor-aIf5q_Rq.js +0 -225
- package/bundled-test-harness/assets/on-key-C8acaldQ.js +0 -472
- package/bundled-test-harness/assets/ooxml-Bu3iZezv.js +0 -172
- package/bundled-test-harness/assets/ooxml-jQPBQK25.js +0 -2
- package/bundled-test-harness/assets/open-image-in-new-tab-test-CP7q3kMm.js +0 -52
- package/bundled-test-harness/assets/operation-lowering-test-9Mdr0hRT.js +0 -2812
- package/bundled-test-harness/assets/operations-R9b661Qn.js +0 -3
- package/bundled-test-harness/assets/operations-Zv_V3Api.js +0 -766
- package/bundled-test-harness/assets/operations-invocation-test-BJPpWb2H.js +0 -523
- package/bundled-test-harness/assets/operations-query-test-DufdmPQF.js +0 -459
- package/bundled-test-harness/assets/operations-test-CzT051YH.js +0 -2518
- package/bundled-test-harness/assets/operator-mode-acceptance-test-ByOIOcD0.js +0 -1188
- package/bundled-test-harness/assets/operator-mode-card-chooser-test-CNhR9mvv.js +0 -1036
- package/bundled-test-harness/assets/operator-mode-links-test-CuxSVTPR.js +0 -793
- package/bundled-test-harness/assets/operator-mode-state-service-CCeHt5SH.js +0 -1275
- package/bundled-test-harness/assets/operator-mode-state-service-test-C8TI9WWg.js +0 -206
- package/bundled-test-harness/assets/operator-mode-test-DG-mG8Tn.js +0 -683
- package/bundled-test-harness/assets/operator-mode-ui-test-DB7xhjS0.js +0 -1027
- package/bundled-test-harness/assets/overlay-menu-items-test-C6rcdF_S.js +0 -317
- package/bundled-test-harness/assets/overlays-D2zmPxzK.js +0 -270
- package/bundled-test-harness/assets/overlays-clip-test-Clpq3JzQ.js +0 -91
- package/bundled-test-harness/assets/overlays-detached-element-test-BtsTeJch.js +0 -56
- package/bundled-test-harness/assets/pane-f-IYhcWT.js +0 -330
- package/bundled-test-harness/assets/panel-B3PCSBbf.js +0 -3540
- package/bundled-test-harness/assets/panel-Ban7zCBP.js +0 -474
- package/bundled-test-harness/assets/past-sessions-test-uM2m-oKV.js +0 -321
- package/bundled-test-harness/assets/patch-fields-test-COPjDhnt.js +0 -1014
- package/bundled-test-harness/assets/patch-instance-test-CRb3dfby.js +0 -348
- package/bundled-test-harness/assets/pdf-file-def-J_yOUU8_.js +0 -76
- package/bundled-test-harness/assets/pdf-meta-extractor-83T5Bdo7.js +0 -156
- package/bundled-test-harness/assets/pdf-meta-extractor-INFIklMy.js +0 -2
- package/bundled-test-harness/assets/pdf-viewer-B4rRluWA.js +0 -2
- package/bundled-test-harness/assets/pdf-viewer-vYem8ozk.js +0 -112
- package/bundled-test-harness/assets/percentage-ChagfNRG.js +0 -84
- package/bundled-test-harness/assets/permission-checking-realm-test-Dmb2a428.js +0 -306
- package/bundled-test-harness/assets/phone-number-BiD2eaSd.js +0 -236
- package/bundled-test-harness/assets/phone-number-C-wt4_UK.js +0 -2
- package/bundled-test-harness/assets/phone-number-field-test-BHzAmuBP.js +0 -73
- package/bundled-test-harness/assets/plate-CqN2nM6P.js +0 -41
- package/bundled-test-harness/assets/plate-DaIfpORN.js +0 -2
- package/bundled-test-harness/assets/player-CGt5fTd5.js +0 -2
- package/bundled-test-harness/assets/player-CN0l44LK.js +0 -82
- package/bundled-test-harness/assets/plural-field-components-test-CO2g2opW.js +0 -198
- package/bundled-test-harness/assets/png-image-def-B_oou2wS.js +0 -48
- package/bundled-test-harness/assets/png-meta-extractor-BfPz1qP_.js +0 -2
- package/bundled-test-harness/assets/png-meta-extractor-C8ai8sPw.js +0 -111
- package/bundled-test-harness/assets/policy-scoped-search-test-BRRp2a1A.js +0 -339
- package/bundled-test-harness/assets/pptx-file-def-C3qYEHDM.js +0 -60
- package/bundled-test-harness/assets/pptx-meta-extractor-8IuoBq4I.js +0 -77
- package/bundled-test-harness/assets/pptx-meta-extractor-BPhy9RMM.js +0 -2
- package/bundled-test-harness/assets/prerender-persistence-block-test-Cteb_Rs_.js +0 -124
- package/bundled-test-harness/assets/prerender-serialize-cycle-test-CH7b6Ra9.js +0 -134
- package/bundled-test-harness/assets/preview-CmERZpI6.js +0 -74
- package/bundled-test-harness/assets/preview-format-BPMlCSbb.js +0 -41
- package/bundled-test-harness/assets/preview-format-test-B7sA8fbZ.js +0 -103
- package/bundled-test-harness/assets/process-card-CtDzDB-_.js +0 -2
- package/bundled-test-harness/assets/process-card-erbWKY5h.js +0 -114
- package/bundled-test-harness/assets/process-card-test-DXOt1jDW.js +0 -94
- package/bundled-test-harness/assets/profile-settings-modal-11BrR058.js +0 -708
- package/bundled-test-harness/assets/progress-circle-Cd79Zqh2.js +0 -2
- package/bundled-test-harness/assets/progress-circle-sc-W5aUl.js +0 -95
- package/bundled-test-harness/assets/quarter-B61kCpcD.js +0 -168
- package/bundled-test-harness/assets/quarter-d5jkTzcz.js +0 -2
- package/bundled-test-harness/assets/query-field-membership-status-test-BmpVfohw.js +0 -323
- package/bundled-test-harness/assets/query-field-page-optin-test-9_Cce-OJ.js +0 -126
- package/bundled-test-harness/assets/query-field-schema-test-CwV7xanX.js +0 -231
- package/bundled-test-harness/assets/query-field-stale-prerender-test-RkdnZ-VV.js +0 -152
- package/bundled-test-harness/assets/query-fields-test-BLxYkTAM.js +0 -535
- package/bundled-test-harness/assets/rail-CFPU0tFe.js +0 -2
- package/bundled-test-harness/assets/rail-CQ53Dakr.js +0 -44
- package/bundled-test-harness/assets/realm-DdVH9lSZ.js +0 -95
- package/bundled-test-harness/assets/realm-DdsFw3b-.js +0 -2
- package/bundled-test-harness/assets/realm-config-DIslxoB7.js +0 -844
- package/bundled-test-harness/assets/realm-config-policy-standing-test-b4WxNDor.js +0 -290
- package/bundled-test-harness/assets/realm-config-routing-rule-edit-test-C-rcvkkD.js +0 -274
- package/bundled-test-harness/assets/realm-config-settings-test-DDUkM3zw.js +0 -187
- package/bundled-test-harness/assets/realm-dropdown-1j55Dy-1.js +0 -560
- package/bundled-test-harness/assets/realm-field-test-D-uEtFKO.js +0 -100
- package/bundled-test-harness/assets/realm-indexing-test-U9m0epR-.js +0 -4380
- package/bundled-test-harness/assets/realm-policy-test-DhKabhlk.js +0 -1141
- package/bundled-test-harness/assets/realm-test-BX6C9SS5.js +0 -2363
- package/bundled-test-harness/assets/realm-url-tooltip-BjjcKqBx.js +0 -56
- package/bundled-test-harness/assets/realm-url-tooltip-test-DW0ZwEEE.js +0 -78
- package/bundled-test-harness/assets/reasoning-test-BWT94KXG.js +0 -234
- package/bundled-test-harness/assets/recent-colors-addon-CfgmgilF.js +0 -61
- package/bundled-test-harness/assets/recent-colors-addon-D--Ry3Pf.js +0 -2
- package/bundled-test-harness/assets/relationship-loading-state-test-C5R6jao_.js +0 -290
- package/bundled-test-harness/assets/relative-time-Bq7pqums.js +0 -2
- package/bundled-test-harness/assets/relative-time-D0QyW4ig.js +0 -129
- package/bundled-test-harness/assets/remix-card-test-Cy0h3Xdf.js +0 -58
- package/bundled-test-harness/assets/rendered-markdown-Hw_EF8SO.js +0 -263
- package/bundled-test-harness/assets/rendered-markdown-test-CqeF-UZd.js +0 -587
- package/bundled-test-harness/assets/resident-instance-reuse-test-BiI6L40n.js +0 -82
- package/bundled-test-harness/assets/response-field-BCxG5phG.js +0 -38
- package/bundled-test-harness/assets/result-tile-DMzRnTP8.js +0 -140
- package/bundled-test-harness/assets/rich-markdown-C4RUl7L0.js +0 -2
- package/bundled-test-harness/assets/rich-markdown-DxQSCg-o.js +0 -218
- package/bundled-test-harness/assets/rich-markdown-field-test-B7wpedKs.js +0 -1647
- package/bundled-test-harness/assets/room-D0M0Zwrs.js +0 -1008
- package/bundled-test-harness/assets/room-message-test-BWWd4xC8.js +0 -445
- package/bundled-test-harness/assets/room-test-DFH-nOwi.js +0 -95
- package/bundled-test-harness/assets/run-realm-code-DyVyEDBl.js +0 -1600
- package/bundled-test-harness/assets/run-realm-code-test-BpxF-tOz.js +0 -2468
- package/bundled-test-harness/assets/schema-generation-test-DjaJqpYP.js +0 -28
- package/bundled-test-harness/assets/score-Cfp34BE7.js +0 -2
- package/bundled-test-harness/assets/score-DIWWpeyf.js +0 -100
- package/bundled-test-harness/assets/scrolling-test-hA_uBwBg.js +0 -384
- package/bundled-test-harness/assets/search-C0-b7dJI.js +0 -605
- package/bundled-test-harness/assets/search-adorn-test-C6KP3AwA.js +0 -136
- package/bundled-test-harness/assets/search-entries-BfPq5sPS.js +0 -472
- package/bundled-test-harness/assets/search-entries-result-test-Bl9u_BOD.js +0 -234
- package/bundled-test-harness/assets/search-entries-test-BDC_lS43.js +0 -1486
- package/bundled-test-harness/assets/search-result-header-DCAze_cg.js +0 -128
- package/bundled-test-harness/assets/search-results-Dd0enVun.js +0 -266
- package/bundled-test-harness/assets/search-results-test-T5KEEII4.js +0 -578
- package/bundled-test-harness/assets/search-selection-menu-test-CCssnBq1.js +0 -108
- package/bundled-test-harness/assets/search-sheet-persistence-test-BzQiO-FK.js +0 -131
- package/bundled-test-harness/assets/search-test-fyCWb24m.js +0 -2241
- package/bundled-test-harness/assets/searchable-BkgeKQMl.js +0 -2
- package/bundled-test-harness/assets/searchable-D_6p6fyb.js +0 -192
- package/bundled-test-harness/assets/searchable-option-test-CnCUYGaq.js +0 -322
- package/bundled-test-harness/assets/searchable-search-doc-test-B8Q0D98v.js +0 -1271
- package/bundled-test-harness/assets/sending-test-D5PGBDys.js +0 -576
- package/bundled-test-harness/assets/serialization-rri-form-audit-test-BRJ1cJ31.js +0 -136
- package/bundled-test-harness/assets/serialization-test-DM6hK258.js +0 -8758
- package/bundled-test-harness/assets/setup-C_GgVgzM.js +0 -772
- package/bundled-test-harness/assets/shared-link-target-reuse-test-Be-lSKib.js +0 -207
- package/bundled-test-harness/assets/show-card-BFG6KR1m.js +0 -67
- package/bundled-test-harness/assets/show-card-test-l0wMrfZq.js +0 -365
- package/bundled-test-harness/assets/show-file-B8-FRVHj.js +0 -34
- package/bundled-test-harness/assets/signed-capture-D_Q44TQ7.js +0 -204
- package/bundled-test-harness/assets/signed-capture-link-test-DOS5xpYv.js +0 -132
- package/bundled-test-harness/assets/single-stack-test-BIEtzHVS.js +0 -652
- package/bundled-test-harness/assets/skill-BUTGmSsm.js +0 -76
- package/bundled-test-harness/assets/skill-Bo7R_2Ud.js +0 -3
- package/bundled-test-harness/assets/skill-reference-Cs64py3k.js +0 -112
- package/bundled-test-harness/assets/skills-test-CXxSIkYa.js +0 -648
- package/bundled-test-harness/assets/slider-picker-C81errGI.js +0 -245
- package/bundled-test-harness/assets/slider-picker-mvKsy6cR.js +0 -2
- package/bundled-test-harness/assets/spec-B55lJurX.js +0 -602
- package/bundled-test-harness/assets/store-DyQ0KiyI.js +0 -2205
- package/bundled-test-harness/assets/store-module-rebuild-test-C7532_bS.js +0 -454
- package/bundled-test-harness/assets/store-search-test-80NMJuoW.js +0 -175
- package/bundled-test-harness/assets/store-test-dHiWXXMs.js +0 -3460
- package/bundled-test-harness/assets/string-DHlQEHYm.js +0 -9
- package/bundled-test-harness/assets/submode-switcher-DQv-CD6G.js +0 -169
- package/bundled-test-harness/assets/svg-meta-extractor-Uw_EJytF.js +0 -42
- package/bundled-test-harness/assets/swatches-picker-CaEoibN1.js +0 -33
- package/bundled-test-harness/assets/swatches-picker-gPl50JbP.js +0 -2
- package/bundled-test-harness/assets/switch-submode-BKDnJd4m.js +0 -79
- package/bundled-test-harness/assets/switch-submode-test-_E2mVk4z.js +0 -168
- package/bundled-test-harness/assets/tag-B60lDr-j.js +0 -105
- package/bundled-test-harness/assets/tests-BBBgPBB6.js +0 -3520
- package/bundled-test-harness/assets/text-area-CJjWmwpi.js +0 -9
- package/bundled-test-harness/assets/text-file-def-u_dl0i2z.js +0 -151
- package/bundled-test-harness/assets/text-input-validator-test-BTwnkSS2.js +0 -156
- package/bundled-test-harness/assets/theme-BK-fAHVn.js +0 -9
- package/bundled-test-harness/assets/theme-card-test-BQmT7rqr.js +0 -621
- package/bundled-test-harness/assets/theme-scheme-island-test-Oi3aeyp1.js +0 -264
- package/bundled-test-harness/assets/three-d-model-def-B4KckPVC.js +0 -70
- package/bundled-test-harness/assets/time-BcuaSkHg.js +0 -126
- package/bundled-test-harness/assets/time-f7Irg7Z7.js +0 -2
- package/bundled-test-harness/assets/time-slots-ClYIZN53.js +0 -2
- package/bundled-test-harness/assets/time-slots-TI1aaqRN.js +0 -85
- package/bundled-test-harness/assets/timeline-Cof9eyq0.js +0 -59
- package/bundled-test-harness/assets/timeline-DFWQtCWE.js +0 -2
- package/bundled-test-harness/assets/to-device-streaming-test-BDrUUlOt.js +0 -163
- package/bundled-test-harness/assets/token-usage-test-CiZo03fY.js +0 -166
- package/bundled-test-harness/assets/tool-field-BXHr9r0w.js +0 -94
- package/bundled-test-harness/assets/tool-field-CoRO5C4R.js +0 -2
- package/bundled-test-harness/assets/tools-CmVaYDIS.js +0 -725
- package/bundled-test-harness/assets/tools-calling-test-B454__XF.js +0 -200
- package/bundled-test-harness/assets/tools-test-CLu51dJO.js +0 -1624
- package/bundled-test-harness/assets/tools-test-XGRAvVug.js +0 -2820
- package/bundled-test-harness/assets/ts-file-def-C05BDwdg.js +0 -159
- package/bundled-test-harness/assets/update-room-skills-test-jOvP14JX.js +0 -240
- package/bundled-test-harness/assets/url-BFf2CNo-.js +0 -2
- package/bundled-test-harness/assets/url-CYm-CeXp.js +0 -96
- package/bundled-test-harness/assets/video-file-def-B2UIrOFS.js +0 -76
- package/bundled-test-harness/assets/wav-meta-extractor-BNkv7e2f.js +0 -368
- package/bundled-test-harness/assets/webm-meta-extractor-C933kYyc.js +0 -178
- package/bundled-test-harness/assets/webp-meta-extractor-BLz0z1pZ.js +0 -98
- package/bundled-test-harness/assets/website-BuOMUW1v.js +0 -92
- package/bundled-test-harness/assets/week-Bo0666ji.js +0 -111
- package/bundled-test-harness/assets/week-CaVFA8Vc.js +0 -2
- package/bundled-test-harness/assets/welcome-to-boxel-PWard7GF.js +0 -172
- package/bundled-test-harness/assets/workspace-KXfFTQNV.js +0 -614
- package/bundled-test-harness/assets/workspace-a11y-test-Buwb-rfO.js +0 -197
- package/bundled-test-harness/assets/workspace-behavior-test-CbgFUOOo.js +0 -200
- package/bundled-test-harness/assets/workspace-chooser-BmQvhhrl.js +0 -2248
- package/bundled-test-harness/assets/workspace-chooser-Cu84Gd_E.css +0 -1317
- package/bundled-test-harness/assets/workspace-chooser-catalog-order-test-rcRw6sni.js +0 -36
- package/bundled-test-harness/assets/workspace-chooser-unreachable-notice-test-DUXnBIdY.js +0 -60
- package/bundled-test-harness/assets/workspace-delete-multiple-test-DjRKhZ2g.js +0 -212
- package/bundled-test-harness/assets/workspace-delete-summary-test-CvkLVYyN.js +0 -63
- package/bundled-test-harness/assets/workspace-timestamp-labels-test-AYJT4inv.js +0 -58
- package/bundled-test-harness/assets/xlsx-file-def-DuKdbGrJ.js +0 -60
- package/bundled-test-harness/assets/xlsx-meta-extractor-Bz-C2JWP.js +0 -101
- package/bundled-test-harness/assets/xlsx-meta-extractor-ClwwgABg.js +0 -2
- package/bundled-test-harness/assets/year-B6ctHikl.js +0 -2
- package/bundled-test-harness/assets/year-C11uAQE6.js +0 -78
- package/bundled-test-harness/assets/zip-file-def-B8XN-OS_.js +0 -288
- package/bundled-types/host-app/components/matrix/auth-button.gts +0 -39
- package/bundled-types/host-app/components/matrix/auth-container.gts +0 -69
- package/bundled-types/host-app/components/matrix/auth-form-field.gts +0 -43
|
@@ -0,0 +1,4380 @@
|
|
|
1
|
+
import { s as __toESM } from "./chunk-Rp0pCe6z.js";
|
|
2
|
+
import { r as initializeDeferredDecorator, t as decorateFieldV2 } from "./runtime--fcdnjmJ-BoCBNIsz.js";
|
|
3
|
+
import { Ar as testRealmURL, Dr as testRRI, di as DEFAULT_ANONYMOUS_RATE_LIMIT, it as diffDoc, nc as init_md5_esm_bundler, rc as md5, u as internalKeyFor, uo as SupportedMimeType } from "./runtime-common-ClpqhbwG.js";
|
|
4
|
+
import { v as ri, y as rri } from "./paths-BYHDgqsT.js";
|
|
5
|
+
import { C as baseCardRef, J as skillCardRef, O as baseRealmRRI } from "./constants-CqKWhRfY.js";
|
|
6
|
+
import { wt as setComponentTemplate } from "./cache-DtDz7X5V-Wn8jRDfL.js";
|
|
7
|
+
import { H as templateFactory } from "./index-DaCZcoCY-CgzbilMy.js";
|
|
8
|
+
import "./component-BJO47HTh.js";
|
|
9
|
+
import { t as Component } from "./dist-CkA1rgqO.js";
|
|
10
|
+
import "./template-factory-ds9s0u8l.js";
|
|
11
|
+
import { s as REALM_INDEX_BOILERPLATE_HTML } from "./card-prerender-Dke537bN.js";
|
|
12
|
+
import { t as require_qunit } from "./qunit-C-Foo4Nd.js";
|
|
13
|
+
import { F as setupLocalIndexing, H as testModuleRealm, M as setupCardLogs, P as setupIntegrationTestRealm, V as testModuleRRI, d as cardInfo, lt as setupRenderingTest, p as cleanWhiteSpace, t as setupMockMatrix, x as getFileCreatedAt } from "./mock-matrix-DPQ0j2MD.js";
|
|
14
|
+
import { r as getService } from "./dist-CPfIHBla.js";
|
|
15
|
+
import { A as field, H as linksTo, T as containsMany, U as linksToMany, a as CardDef, l as FieldDef, s as Component$1, w as contains } from "./card-api-Dzje0smT.js";
|
|
16
|
+
import { t as DateTimeField } from "./datetime-BEbR9YgU.js";
|
|
17
|
+
import { t as string_default } from "./string-BHZZwNlZ.js";
|
|
18
|
+
import { t as NumberField } from "./number-DZa-fHpu.js";
|
|
19
|
+
import { t as searchCardsForTest } from "./search-cards-O_RNz8_i.js";
|
|
20
|
+
//#region ../runtime-common/helpers/strip-scoped-css-attributes.ts
|
|
21
|
+
init_md5_esm_bundler();
|
|
22
|
+
var import_qunit = /* @__PURE__ */ __toESM(require_qunit());
|
|
23
|
+
function stripScopedCSSAttributes(htmlString) {
|
|
24
|
+
return htmlString.replace(/ data-scopedcss-[0-9a-f]{10}-[0-9a-f]{10}/g, "");
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region tests/integration/realm-indexing-test.gts
|
|
28
|
+
var loader;
|
|
29
|
+
function unwrap(html) {
|
|
30
|
+
return html.trim().replace(/^<div ([^>]*>)/, "").trim().replace(/^<!---->/, "").replace(/<\/div>$/, "").trim();
|
|
31
|
+
}
|
|
32
|
+
function assertInnerHtmlMatches(assert, actual, expected, message) {
|
|
33
|
+
let cleanedActual = cleanWhiteSpace(stripScopedCSSAttributes(unwrap(actual)));
|
|
34
|
+
let cleanedExpected = cleanWhiteSpace(expected);
|
|
35
|
+
assert.strictEqual(cleanedActual, cleanedExpected, message);
|
|
36
|
+
}
|
|
37
|
+
function expectSearchDoc(assert, actual, expected, message) {
|
|
38
|
+
assert.deepEqual(diffDoc(expected, actual ?? {}, false), [], message ?? "indexed search doc matches the searchable-driven generator");
|
|
39
|
+
}
|
|
40
|
+
(0, import_qunit.module)(`Integration | realm indexing`, function(hooks) {
|
|
41
|
+
setupRenderingTest(hooks);
|
|
42
|
+
hooks.beforeEach(function() {
|
|
43
|
+
loader = getService("loader-service").loader;
|
|
44
|
+
});
|
|
45
|
+
setupLocalIndexing(hooks);
|
|
46
|
+
let mockMatrixUtils = setupMockMatrix(hooks);
|
|
47
|
+
setupCardLogs(hooks, async () => await loader.import("@cardstack/base/card-api"));
|
|
48
|
+
async function getInstance(realm, url) {
|
|
49
|
+
let maybeInstance = await realm.realmIndexQueryEngine.instance(url);
|
|
50
|
+
if (maybeInstance?.type === "instance-error") return;
|
|
51
|
+
return maybeInstance;
|
|
52
|
+
}
|
|
53
|
+
(0, import_qunit.test)("full indexing discovers card instances", async function(assert) {
|
|
54
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
55
|
+
mockMatrixUtils,
|
|
56
|
+
contents: { "empty.json": { data: { meta: { adoptsFrom: {
|
|
57
|
+
module: "@cardstack/base/card-api",
|
|
58
|
+
name: "CardDef"
|
|
59
|
+
} } } } }
|
|
60
|
+
});
|
|
61
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
62
|
+
let { data: cards } = await searchCardsForTest(queryEngine, { filter: { type: baseCardRef } });
|
|
63
|
+
assert.deepEqual(cards, [{
|
|
64
|
+
id: testRRI("empty"),
|
|
65
|
+
type: "card",
|
|
66
|
+
attributes: {
|
|
67
|
+
cardInfo,
|
|
68
|
+
cardTitle: "Untitled Card",
|
|
69
|
+
cardDescription: null,
|
|
70
|
+
cardThumbnailURL: null
|
|
71
|
+
},
|
|
72
|
+
meta: {
|
|
73
|
+
adoptsFrom: {
|
|
74
|
+
module: rri("@cardstack/base/card-api"),
|
|
75
|
+
name: "CardDef"
|
|
76
|
+
},
|
|
77
|
+
realmURL: ri("http://test-realm/test/"),
|
|
78
|
+
realmInfo: {
|
|
79
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
80
|
+
backgroundURL: null,
|
|
81
|
+
iconURL: null,
|
|
82
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
83
|
+
lastPublishedAt: null,
|
|
84
|
+
name: "Unnamed Workspace",
|
|
85
|
+
publishable: null,
|
|
86
|
+
realmUserId: "@realm_server:localhost",
|
|
87
|
+
showAsCatalog: null,
|
|
88
|
+
visibility: "public"
|
|
89
|
+
},
|
|
90
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}empty.json`),
|
|
91
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "empty.json")
|
|
92
|
+
},
|
|
93
|
+
links: { self: `${testRealmURL}empty` }
|
|
94
|
+
}]);
|
|
95
|
+
});
|
|
96
|
+
(0, import_qunit.test)("indexing captures file meta content hash", async function(assert) {
|
|
97
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
98
|
+
mockMatrixUtils,
|
|
99
|
+
contents: { "notes.txt": "Hello from the test realm." }
|
|
100
|
+
});
|
|
101
|
+
await realm.fullIndex();
|
|
102
|
+
let { virtualNetwork } = getService("network");
|
|
103
|
+
let response = await virtualNetwork.fetch(new URL("notes.txt", testRealmURL), { headers: { Accept: SupportedMimeType.FileMeta } });
|
|
104
|
+
assert.true(response.ok, "file meta request succeeds");
|
|
105
|
+
let body = await response.json();
|
|
106
|
+
assert.strictEqual(body?.data?.type, "file-meta");
|
|
107
|
+
let contentHash = body?.data?.attributes?.contentHash;
|
|
108
|
+
let expectedHash = md5(new TextEncoder().encode("Hello from the test realm."));
|
|
109
|
+
assert.strictEqual(contentHash, expectedHash, "content hash is returned");
|
|
110
|
+
});
|
|
111
|
+
(0, import_qunit.test)("full indexing stores file entries with search doc and deps", async function(assert) {
|
|
112
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
113
|
+
mockMatrixUtils,
|
|
114
|
+
contents: { "notes.txt": "Hello from the test realm." }
|
|
115
|
+
});
|
|
116
|
+
await realm.fullIndex();
|
|
117
|
+
let fileURL = new URL("notes.txt", testRealmURL);
|
|
118
|
+
let fileEntry = await realm.realmIndexQueryEngine.file(fileURL);
|
|
119
|
+
assert.ok(fileEntry, "file entry exists");
|
|
120
|
+
assert.strictEqual(fileEntry?.type, "file");
|
|
121
|
+
assert.strictEqual(fileEntry?.searchDoc?.name, "notes.txt", "search doc includes name");
|
|
122
|
+
assert.strictEqual(fileEntry?.searchDoc?.contentType, "text/plain", "search doc includes contentType");
|
|
123
|
+
assert.strictEqual(fileEntry?.searchDoc?.contentHash, md5(new TextEncoder().encode("Hello from the test realm.")), "search doc includes contentHash");
|
|
124
|
+
assert.ok(fileEntry?.deps?.includes(`${baseRealmRRI}file-api`), "deps include base file-api module");
|
|
125
|
+
let includesSelfFileDependency = fileEntry?.deps?.includes(fileURL.href);
|
|
126
|
+
assert.false(includesSelfFileDependency, "deps exclude self file URL");
|
|
127
|
+
});
|
|
128
|
+
(0, import_qunit.test)("full indexing skips over unchanged items in index", async function(assert) {
|
|
129
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
130
|
+
mockMatrixUtils,
|
|
131
|
+
contents: {
|
|
132
|
+
"test1.json": { data: { meta: { adoptsFrom: {
|
|
133
|
+
module: "@cardstack/base/card-api",
|
|
134
|
+
name: "CardDef"
|
|
135
|
+
} } } },
|
|
136
|
+
"test2.json": { data: { meta: { adoptsFrom: {
|
|
137
|
+
module: "@cardstack/base/card-api",
|
|
138
|
+
name: "CardDef"
|
|
139
|
+
} } } },
|
|
140
|
+
"pet.gts": `
|
|
141
|
+
import { contains, field, CardDef } from "@cardstack/base/card-api";
|
|
142
|
+
import StringField from "@cardstack/base/string";
|
|
143
|
+
|
|
144
|
+
export class Pet extends CardDef {
|
|
145
|
+
@field firstName = contains(StringField);
|
|
146
|
+
}
|
|
147
|
+
`
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
assert.deepEqual(realm.realmIndexUpdater.stats, {
|
|
151
|
+
filesIndexed: 3,
|
|
152
|
+
fileErrors: 0,
|
|
153
|
+
instanceErrors: 0,
|
|
154
|
+
instancesIndexed: 2,
|
|
155
|
+
totalIndexEntries: 5
|
|
156
|
+
}, "indexer stats are correct");
|
|
157
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
158
|
+
await adapter.write("test2.json", JSON.stringify({ data: {
|
|
159
|
+
attributes: { cardTitle: "test" },
|
|
160
|
+
meta: { adoptsFrom: {
|
|
161
|
+
module: rri("@cardstack/base/card-api"),
|
|
162
|
+
name: "CardDef"
|
|
163
|
+
} }
|
|
164
|
+
} }));
|
|
165
|
+
await realm.fullIndex();
|
|
166
|
+
assert.deepEqual(realm.realmIndexUpdater.stats, {
|
|
167
|
+
filesIndexed: 1,
|
|
168
|
+
fileErrors: 0,
|
|
169
|
+
instanceErrors: 0,
|
|
170
|
+
instancesIndexed: 1,
|
|
171
|
+
totalIndexEntries: 5
|
|
172
|
+
}, "indexer stats are correct");
|
|
173
|
+
});
|
|
174
|
+
(0, import_qunit.test)("a card with a broken linksTo target indexes cleanly, and invalidation fan-out re-indexes it when the target is later created", async function(assert) {
|
|
175
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
176
|
+
mockMatrixUtils,
|
|
177
|
+
contents: { "Pet/mango.json": { data: {
|
|
178
|
+
id: `${testRealmURL}Pet/mango`,
|
|
179
|
+
attributes: { firstName: "Mango" },
|
|
180
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
181
|
+
meta: { adoptsFrom: {
|
|
182
|
+
module: `${testModuleRealm}pet`,
|
|
183
|
+
name: "Pet"
|
|
184
|
+
} }
|
|
185
|
+
} } }
|
|
186
|
+
});
|
|
187
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
188
|
+
{
|
|
189
|
+
let mango = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
190
|
+
if (mango?.type === "doc") {
|
|
191
|
+
let owner = mango.doc.data.relationships?.owner;
|
|
192
|
+
assert.strictEqual((Array.isArray(owner) ? owner[0] : owner)?.links?.self, `../Person/owner`, "broken owner reference is preserved on the wire so the consumer can render the placeholder");
|
|
193
|
+
} else assert.ok(false, `mango with a missing linksTo target indexes as a clean instance, got: ${mango?.error?.errorDetail.message}`);
|
|
194
|
+
let mangoInstance = await queryEngine.instance(new URL(`${testRealmURL}Pet/mango`));
|
|
195
|
+
assert.ok((mangoInstance?.deps ?? []).some((dep) => dep === `${testRealmURL}Person/owner.json` || dep === `${testRealmURL}Person/owner`), "deps include the unresolved owner link so invalidation can reach mango when the target is created");
|
|
196
|
+
}
|
|
197
|
+
await realm.write("Person/owner.json", JSON.stringify({ data: {
|
|
198
|
+
id: testRRI("Person/owner"),
|
|
199
|
+
attributes: { firstName: "Hassan" },
|
|
200
|
+
meta: { adoptsFrom: {
|
|
201
|
+
module: rri(`${testModuleRealm}person`),
|
|
202
|
+
name: "Person"
|
|
203
|
+
} }
|
|
204
|
+
} }));
|
|
205
|
+
{
|
|
206
|
+
let mango = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
207
|
+
if (mango?.type === "doc") assert.deepEqual(mango.doc.data, {
|
|
208
|
+
id: testRRI("Pet/mango"),
|
|
209
|
+
type: "card",
|
|
210
|
+
links: { self: "./mango" },
|
|
211
|
+
attributes: {
|
|
212
|
+
cardDescription: null,
|
|
213
|
+
firstName: "Mango",
|
|
214
|
+
cardTitle: "Mango",
|
|
215
|
+
cardThumbnailURL: null,
|
|
216
|
+
cardInfo
|
|
217
|
+
},
|
|
218
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
219
|
+
meta: {
|
|
220
|
+
adoptsFrom: {
|
|
221
|
+
module: rri(`${testModuleRealm}pet`),
|
|
222
|
+
name: "Pet"
|
|
223
|
+
},
|
|
224
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/mango.json`),
|
|
225
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/mango.json"),
|
|
226
|
+
realmURL: ri("http://test-realm/test/"),
|
|
227
|
+
realmInfo: {
|
|
228
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
229
|
+
backgroundURL: null,
|
|
230
|
+
iconURL: null,
|
|
231
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
232
|
+
lastPublishedAt: null,
|
|
233
|
+
name: "Unnamed Workspace",
|
|
234
|
+
publishable: null,
|
|
235
|
+
realmUserId: "@realm_server:localhost",
|
|
236
|
+
showAsCatalog: null,
|
|
237
|
+
visibility: "public"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
(0, import_qunit.test)("can query the \"production\" index while performing indexing operations", async function(assert) {
|
|
245
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
246
|
+
mockMatrixUtils,
|
|
247
|
+
contents: { "Pet/mango.json": { data: {
|
|
248
|
+
id: `${testRealmURL}Pet/mango`,
|
|
249
|
+
attributes: { firstName: "Mango" },
|
|
250
|
+
meta: { adoptsFrom: {
|
|
251
|
+
module: `${testModuleRealm}pet`,
|
|
252
|
+
name: "Pet"
|
|
253
|
+
} }
|
|
254
|
+
} } }
|
|
255
|
+
});
|
|
256
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
257
|
+
let updateCard = realm.write("Pet/mango.json", JSON.stringify({ data: {
|
|
258
|
+
id: testRRI("Pet/mango"),
|
|
259
|
+
attributes: { firstName: "Van Gogh" },
|
|
260
|
+
meta: { adoptsFrom: {
|
|
261
|
+
module: rri(`${testModuleRealm}pet`),
|
|
262
|
+
name: "Pet"
|
|
263
|
+
} }
|
|
264
|
+
} }));
|
|
265
|
+
let getCard = queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
266
|
+
let [_, entry] = await Promise.all([updateCard, getCard]);
|
|
267
|
+
if (entry?.type === "doc") {
|
|
268
|
+
delete entry.doc.data.meta.lastModified;
|
|
269
|
+
delete entry.doc.data.meta.resourceCreatedAt;
|
|
270
|
+
assert.deepEqual(entry.doc.data, {
|
|
271
|
+
id: testRRI("Pet/mango"),
|
|
272
|
+
type: "card",
|
|
273
|
+
links: { self: "./mango" },
|
|
274
|
+
attributes: {
|
|
275
|
+
cardDescription: null,
|
|
276
|
+
firstName: "Mango",
|
|
277
|
+
cardTitle: "Mango",
|
|
278
|
+
cardThumbnailURL: null,
|
|
279
|
+
cardInfo
|
|
280
|
+
},
|
|
281
|
+
meta: {
|
|
282
|
+
adoptsFrom: {
|
|
283
|
+
module: rri(`${testModuleRealm}pet`),
|
|
284
|
+
name: "Pet"
|
|
285
|
+
},
|
|
286
|
+
realmURL: ri("http://test-realm/test/"),
|
|
287
|
+
realmInfo: {
|
|
288
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
289
|
+
backgroundURL: null,
|
|
290
|
+
iconURL: null,
|
|
291
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
292
|
+
lastPublishedAt: null,
|
|
293
|
+
name: "Unnamed Workspace",
|
|
294
|
+
publishable: null,
|
|
295
|
+
realmUserId: "@realm_server:localhost",
|
|
296
|
+
showAsCatalog: null,
|
|
297
|
+
visibility: "public"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
302
|
+
{
|
|
303
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
304
|
+
if (entry?.type === "doc") {
|
|
305
|
+
delete entry.doc.data.meta.lastModified;
|
|
306
|
+
delete entry.doc.data.meta.resourceCreatedAt;
|
|
307
|
+
assert.deepEqual(entry.doc.data, {
|
|
308
|
+
id: testRRI("Pet/mango"),
|
|
309
|
+
type: "card",
|
|
310
|
+
links: { self: "./mango" },
|
|
311
|
+
attributes: {
|
|
312
|
+
cardDescription: null,
|
|
313
|
+
firstName: "Van Gogh",
|
|
314
|
+
cardTitle: "Van Gogh",
|
|
315
|
+
cardThumbnailURL: null,
|
|
316
|
+
cardInfo
|
|
317
|
+
},
|
|
318
|
+
meta: {
|
|
319
|
+
adoptsFrom: {
|
|
320
|
+
module: rri(`${testModuleRealm}pet`),
|
|
321
|
+
name: "Pet"
|
|
322
|
+
},
|
|
323
|
+
realmURL: ri("http://test-realm/test/"),
|
|
324
|
+
realmInfo: {
|
|
325
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
326
|
+
backgroundURL: null,
|
|
327
|
+
iconURL: null,
|
|
328
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
329
|
+
lastPublishedAt: null,
|
|
330
|
+
name: "Unnamed Workspace",
|
|
331
|
+
publishable: null,
|
|
332
|
+
realmUserId: "@realm_server:localhost",
|
|
333
|
+
showAsCatalog: null,
|
|
334
|
+
visibility: "public"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
(0, import_qunit.test)("write with waitForIndex:false returns before indexing settles and incrementalIndexing() drains it", async function(assert) {
|
|
342
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
343
|
+
mockMatrixUtils,
|
|
344
|
+
contents: { "Pet/mango.json": { data: {
|
|
345
|
+
id: `${testRealmURL}Pet/mango`,
|
|
346
|
+
attributes: { firstName: "Mango" },
|
|
347
|
+
meta: { adoptsFrom: {
|
|
348
|
+
module: `${testModuleRealm}pet`,
|
|
349
|
+
name: "Pet"
|
|
350
|
+
} }
|
|
351
|
+
} } }
|
|
352
|
+
});
|
|
353
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
354
|
+
await realm.write("Pet/mango.json", JSON.stringify({ data: {
|
|
355
|
+
id: testRRI("Pet/mango"),
|
|
356
|
+
attributes: { firstName: "Van Gogh" },
|
|
357
|
+
meta: { adoptsFrom: {
|
|
358
|
+
module: rri(`${testModuleRealm}pet`),
|
|
359
|
+
name: "Pet"
|
|
360
|
+
} }
|
|
361
|
+
} }), { waitForIndex: false });
|
|
362
|
+
let pendingIndex = realm.incrementalIndexing();
|
|
363
|
+
assert.notStrictEqual(pendingIndex, void 0, "indexing is still pending immediately after waitForIndex:false write");
|
|
364
|
+
await pendingIndex;
|
|
365
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "incrementalIndexing() resolves to undefined once the deferred indexing settles");
|
|
366
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
367
|
+
if (entry?.type === "doc") assert.strictEqual(entry.doc.data.attributes?.firstName, "Van Gogh", "index reflects the deferred-indexed write after the drain");
|
|
368
|
+
else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
369
|
+
});
|
|
370
|
+
(0, import_qunit.test)("HTTP DELETE +source returns before incremental indexing settles", async function(assert) {
|
|
371
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
372
|
+
mockMatrixUtils,
|
|
373
|
+
contents: { "Pet/mango.json": { data: {
|
|
374
|
+
id: `${testRealmURL}Pet/mango`,
|
|
375
|
+
attributes: { firstName: "Mango" },
|
|
376
|
+
meta: { adoptsFrom: {
|
|
377
|
+
module: `${testModuleRealm}pet`,
|
|
378
|
+
name: "Pet"
|
|
379
|
+
} }
|
|
380
|
+
} } }
|
|
381
|
+
});
|
|
382
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
383
|
+
await realm.incrementalIndexing();
|
|
384
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "baseline: no pending indexing before DELETE");
|
|
385
|
+
let response = await realm.handle(new Request(`${testRealmURL}Pet/mango`, {
|
|
386
|
+
method: "DELETE",
|
|
387
|
+
headers: { Accept: "application/vnd.card+source" }
|
|
388
|
+
}));
|
|
389
|
+
if (!response) throw new Error("realm did not handle the DELETE");
|
|
390
|
+
assert.strictEqual(response.status, 204, "DELETE returns 204");
|
|
391
|
+
assert.strictEqual(await adapter.openFile("Pet/mango.json"), void 0, "file is gone from disk before indexing settles");
|
|
392
|
+
let pendingIndex = realm.incrementalIndexing();
|
|
393
|
+
assert.notStrictEqual(pendingIndex, void 0, "DELETE returned before deferred indexing settled");
|
|
394
|
+
await pendingIndex;
|
|
395
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "incrementalIndexing() drains the deferred delete work");
|
|
396
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
397
|
+
assert.strictEqual(entry, void 0, "index reflects the deletion after the drain");
|
|
398
|
+
});
|
|
399
|
+
(0, import_qunit.test)("realm.delete() with default options (waitForIndex:true) awaits indexing inline", async function(assert) {
|
|
400
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
401
|
+
mockMatrixUtils,
|
|
402
|
+
contents: { "Pet/mango.json": { data: {
|
|
403
|
+
id: `${testRealmURL}Pet/mango`,
|
|
404
|
+
attributes: { firstName: "Mango" },
|
|
405
|
+
meta: { adoptsFrom: {
|
|
406
|
+
module: `${testModuleRealm}pet`,
|
|
407
|
+
name: "Pet"
|
|
408
|
+
} }
|
|
409
|
+
} } }
|
|
410
|
+
});
|
|
411
|
+
await realm.incrementalIndexing();
|
|
412
|
+
await realm.delete("Pet/mango.json");
|
|
413
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "no pending indexing remains after a default delete — the await happened inline");
|
|
414
|
+
});
|
|
415
|
+
(0, import_qunit.test)("write with default options (waitForIndex:true) awaits indexing inline", async function(assert) {
|
|
416
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
417
|
+
mockMatrixUtils,
|
|
418
|
+
contents: { "Pet/mango.json": { data: {
|
|
419
|
+
id: `${testRealmURL}Pet/mango`,
|
|
420
|
+
attributes: { firstName: "Mango" },
|
|
421
|
+
meta: { adoptsFrom: {
|
|
422
|
+
module: `${testModuleRealm}pet`,
|
|
423
|
+
name: "Pet"
|
|
424
|
+
} }
|
|
425
|
+
} } }
|
|
426
|
+
});
|
|
427
|
+
await realm.write("Pet/mango.json", JSON.stringify({ data: {
|
|
428
|
+
id: testRRI("Pet/mango"),
|
|
429
|
+
attributes: { firstName: "Van Gogh" },
|
|
430
|
+
meta: { adoptsFrom: {
|
|
431
|
+
module: rri(`${testModuleRealm}pet`),
|
|
432
|
+
name: "Pet"
|
|
433
|
+
} }
|
|
434
|
+
} }));
|
|
435
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "no pending indexing remains after a default write — the await happened inline");
|
|
436
|
+
});
|
|
437
|
+
(0, import_qunit.test)("can index card with linkTo field", async function(assert) {
|
|
438
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
439
|
+
mockMatrixUtils,
|
|
440
|
+
contents: {
|
|
441
|
+
"Person/owner.json": { data: {
|
|
442
|
+
id: `${testRealmURL}Person/owner`,
|
|
443
|
+
attributes: { firstName: "Hassan" },
|
|
444
|
+
meta: { adoptsFrom: {
|
|
445
|
+
module: `${testModuleRealm}person`,
|
|
446
|
+
name: "Person"
|
|
447
|
+
} }
|
|
448
|
+
} },
|
|
449
|
+
"Pet/mango.json": { data: {
|
|
450
|
+
id: `${testRealmURL}Pet/mango`,
|
|
451
|
+
attributes: { firstName: "Mango" },
|
|
452
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
453
|
+
meta: { adoptsFrom: {
|
|
454
|
+
module: `${testModuleRealm}pet`,
|
|
455
|
+
name: "Pet"
|
|
456
|
+
} }
|
|
457
|
+
} }
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
let mango = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
461
|
+
if (mango?.type === "doc") assert.deepEqual(mango.doc.data, {
|
|
462
|
+
id: testRRI("Pet/mango"),
|
|
463
|
+
type: "card",
|
|
464
|
+
links: { self: "./mango" },
|
|
465
|
+
attributes: {
|
|
466
|
+
cardDescription: null,
|
|
467
|
+
firstName: "Mango",
|
|
468
|
+
cardTitle: "Mango",
|
|
469
|
+
cardThumbnailURL: null,
|
|
470
|
+
cardInfo
|
|
471
|
+
},
|
|
472
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
473
|
+
meta: {
|
|
474
|
+
adoptsFrom: {
|
|
475
|
+
module: rri(`${testModuleRealm}pet`),
|
|
476
|
+
name: "Pet"
|
|
477
|
+
},
|
|
478
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/mango.json`),
|
|
479
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/mango.json"),
|
|
480
|
+
realmURL: ri("http://test-realm/test/"),
|
|
481
|
+
realmInfo: {
|
|
482
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
483
|
+
backgroundURL: null,
|
|
484
|
+
iconURL: null,
|
|
485
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
486
|
+
lastPublishedAt: null,
|
|
487
|
+
name: "Unnamed Workspace",
|
|
488
|
+
publishable: null,
|
|
489
|
+
realmUserId: "@realm_server:localhost",
|
|
490
|
+
showAsCatalog: null,
|
|
491
|
+
visibility: "public"
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
496
|
+
});
|
|
497
|
+
(0, import_qunit.test)("can index card with a relative linkTo field", async function(assert) {
|
|
498
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
499
|
+
mockMatrixUtils,
|
|
500
|
+
contents: {
|
|
501
|
+
"Person/owner.json": { data: {
|
|
502
|
+
id: `${testRealmURL}Person/owner`,
|
|
503
|
+
attributes: { firstName: "Hassan" },
|
|
504
|
+
meta: { adoptsFrom: {
|
|
505
|
+
module: `${testModuleRealm}person`,
|
|
506
|
+
name: "Person"
|
|
507
|
+
} }
|
|
508
|
+
} },
|
|
509
|
+
"Pet/mango.json": { data: {
|
|
510
|
+
id: `${testRealmURL}Pet/mango`,
|
|
511
|
+
attributes: { firstName: "Mango" },
|
|
512
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
513
|
+
meta: { adoptsFrom: {
|
|
514
|
+
module: `${testModuleRealm}pet`,
|
|
515
|
+
name: "Pet"
|
|
516
|
+
} }
|
|
517
|
+
} }
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
let mango = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
521
|
+
if (mango?.type === "doc") assert.deepEqual(mango.doc.data, {
|
|
522
|
+
id: testRRI("Pet/mango"),
|
|
523
|
+
type: "card",
|
|
524
|
+
links: { self: "./mango" },
|
|
525
|
+
attributes: {
|
|
526
|
+
cardDescription: null,
|
|
527
|
+
firstName: "Mango",
|
|
528
|
+
cardTitle: "Mango",
|
|
529
|
+
cardThumbnailURL: null,
|
|
530
|
+
cardInfo
|
|
531
|
+
},
|
|
532
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
533
|
+
meta: {
|
|
534
|
+
adoptsFrom: {
|
|
535
|
+
module: rri(`${testModuleRealm}pet`),
|
|
536
|
+
name: "Pet"
|
|
537
|
+
},
|
|
538
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/mango.json`),
|
|
539
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/mango.json"),
|
|
540
|
+
realmURL: ri("http://test-realm/test/"),
|
|
541
|
+
realmInfo: {
|
|
542
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
543
|
+
backgroundURL: null,
|
|
544
|
+
iconURL: null,
|
|
545
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
546
|
+
lastPublishedAt: null,
|
|
547
|
+
name: "Unnamed Workspace",
|
|
548
|
+
publishable: null,
|
|
549
|
+
realmUserId: "@realm_server:localhost",
|
|
550
|
+
showAsCatalog: null,
|
|
551
|
+
visibility: "public"
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
556
|
+
});
|
|
557
|
+
(0, import_qunit.test)("relative code-ref fields are serialized as absolute URLs", async function(assert) {
|
|
558
|
+
class Person extends CardDef {
|
|
559
|
+
static {
|
|
560
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
561
|
+
return contains(string_default);
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
565
|
+
}
|
|
566
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
567
|
+
mockMatrixUtils,
|
|
568
|
+
contents: {
|
|
569
|
+
"person.gts": { Person },
|
|
570
|
+
"person-spec.json": { data: {
|
|
571
|
+
attributes: {
|
|
572
|
+
cardTitle: "Person Card",
|
|
573
|
+
cardDescription: "Spec for Person card",
|
|
574
|
+
specType: "card",
|
|
575
|
+
ref: {
|
|
576
|
+
module: `./person`,
|
|
577
|
+
name: "Person"
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
meta: { adoptsFrom: {
|
|
581
|
+
module: "@cardstack/base/spec",
|
|
582
|
+
name: "Spec"
|
|
583
|
+
} }
|
|
584
|
+
} }
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
588
|
+
let entry = await indexer.cardDocument(new URL(`${testRealmURL}person-spec`));
|
|
589
|
+
if (entry?.type === "doc") {
|
|
590
|
+
assert.deepEqual(entry.doc.data, {
|
|
591
|
+
id: testRRI("person-spec"),
|
|
592
|
+
type: "card",
|
|
593
|
+
links: { self: "./person-spec" },
|
|
594
|
+
attributes: {
|
|
595
|
+
cardTitle: "Person Card",
|
|
596
|
+
cardDescription: "Spec for Person card",
|
|
597
|
+
moduleHref: `${testRealmURL}person`,
|
|
598
|
+
readMe: null,
|
|
599
|
+
specType: "card",
|
|
600
|
+
isCard: true,
|
|
601
|
+
isComponent: false,
|
|
602
|
+
isField: false,
|
|
603
|
+
isFile: false,
|
|
604
|
+
cardThumbnailURL: null,
|
|
605
|
+
ref: {
|
|
606
|
+
module: `${testRealmURL}person`,
|
|
607
|
+
name: "Person"
|
|
608
|
+
},
|
|
609
|
+
containedExamples: [],
|
|
610
|
+
cardInfo
|
|
611
|
+
},
|
|
612
|
+
meta: {
|
|
613
|
+
adoptsFrom: {
|
|
614
|
+
module: rri("@cardstack/base/spec"),
|
|
615
|
+
name: "Spec"
|
|
616
|
+
},
|
|
617
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}person-spec.json`),
|
|
618
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "person-spec.json"),
|
|
619
|
+
realmURL: testRealmURL,
|
|
620
|
+
realmInfo: {
|
|
621
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
622
|
+
backgroundURL: null,
|
|
623
|
+
iconURL: null,
|
|
624
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
625
|
+
lastPublishedAt: null,
|
|
626
|
+
name: "Unnamed Workspace",
|
|
627
|
+
publishable: null,
|
|
628
|
+
realmUserId: "@realm_server:localhost",
|
|
629
|
+
showAsCatalog: null,
|
|
630
|
+
visibility: "public"
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
expectSearchDoc(assert, (await indexer.instance(new URL(`${testRealmURL}person-spec`)))?.searchDoc, {
|
|
635
|
+
_cardType: "Spec",
|
|
636
|
+
cardDescription: "Spec for Person card",
|
|
637
|
+
id: `${testRealmURL}person-spec`,
|
|
638
|
+
specType: "card",
|
|
639
|
+
moduleHref: `${testRealmURL}person`,
|
|
640
|
+
ref: `${testRealmURL}person/Person`,
|
|
641
|
+
cardTitle: "Person Card",
|
|
642
|
+
containedExamples: null,
|
|
643
|
+
linkedExamples: null,
|
|
644
|
+
fileExamples: null,
|
|
645
|
+
isCard: true,
|
|
646
|
+
isComponent: false,
|
|
647
|
+
isField: false,
|
|
648
|
+
isFile: false,
|
|
649
|
+
cardTheme: null,
|
|
650
|
+
cardInfo: {
|
|
651
|
+
cardThumbnail: null,
|
|
652
|
+
theme: null
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
656
|
+
});
|
|
657
|
+
(0, import_qunit.test)("absolute code-ref fields are preserved as absolute", async function(assert) {
|
|
658
|
+
class Person extends CardDef {
|
|
659
|
+
static {
|
|
660
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
661
|
+
return contains(string_default);
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
665
|
+
}
|
|
666
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
667
|
+
mockMatrixUtils,
|
|
668
|
+
contents: {
|
|
669
|
+
"person.gts": { Person },
|
|
670
|
+
"person-spec.json": { data: {
|
|
671
|
+
attributes: {
|
|
672
|
+
cardTitle: "Person Card",
|
|
673
|
+
cardDescription: "Spec for Person card",
|
|
674
|
+
specType: "card",
|
|
675
|
+
ref: {
|
|
676
|
+
module: `${testRealmURL}person`,
|
|
677
|
+
name: "Person"
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
meta: { adoptsFrom: {
|
|
681
|
+
module: "@cardstack/base/spec",
|
|
682
|
+
name: "Spec"
|
|
683
|
+
} }
|
|
684
|
+
} },
|
|
685
|
+
"people-skill.json": { data: {
|
|
686
|
+
attributes: {
|
|
687
|
+
instructions: "How to win friends and influence people",
|
|
688
|
+
commands: [{ codeRef: {
|
|
689
|
+
module: `@cardstack/boxel-host/commands/switch-submode`,
|
|
690
|
+
name: "default"
|
|
691
|
+
} }]
|
|
692
|
+
},
|
|
693
|
+
meta: { adoptsFrom: skillCardRef }
|
|
694
|
+
} }
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
698
|
+
let entry = await indexer.cardDocument(new URL(`${testRealmURL}person-spec`));
|
|
699
|
+
if (entry?.type === "doc") {
|
|
700
|
+
assert.deepEqual(entry.doc.data, {
|
|
701
|
+
id: testRRI("person-spec"),
|
|
702
|
+
type: "card",
|
|
703
|
+
links: { self: "./person-spec" },
|
|
704
|
+
attributes: {
|
|
705
|
+
cardTitle: "Person Card",
|
|
706
|
+
cardDescription: "Spec for Person card",
|
|
707
|
+
moduleHref: `${testRealmURL}person`,
|
|
708
|
+
readMe: null,
|
|
709
|
+
specType: "card",
|
|
710
|
+
isCard: true,
|
|
711
|
+
isComponent: false,
|
|
712
|
+
isField: false,
|
|
713
|
+
isFile: false,
|
|
714
|
+
cardThumbnailURL: null,
|
|
715
|
+
ref: {
|
|
716
|
+
module: `${testRealmURL}person`,
|
|
717
|
+
name: "Person"
|
|
718
|
+
},
|
|
719
|
+
containedExamples: [],
|
|
720
|
+
cardInfo
|
|
721
|
+
},
|
|
722
|
+
meta: {
|
|
723
|
+
adoptsFrom: {
|
|
724
|
+
module: rri("@cardstack/base/spec"),
|
|
725
|
+
name: "Spec"
|
|
726
|
+
},
|
|
727
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}person-spec.json`),
|
|
728
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "person-spec.json"),
|
|
729
|
+
realmURL: testRealmURL,
|
|
730
|
+
realmInfo: {
|
|
731
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
732
|
+
backgroundURL: null,
|
|
733
|
+
iconURL: null,
|
|
734
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
735
|
+
lastPublishedAt: null,
|
|
736
|
+
name: "Unnamed Workspace",
|
|
737
|
+
publishable: null,
|
|
738
|
+
realmUserId: "@realm_server:localhost",
|
|
739
|
+
showAsCatalog: null,
|
|
740
|
+
visibility: "public"
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
expectSearchDoc(assert, (await indexer.instance(new URL(`${testRealmURL}person-spec`)))?.searchDoc, {
|
|
745
|
+
_cardType: "Spec",
|
|
746
|
+
cardDescription: "Spec for Person card",
|
|
747
|
+
id: `${testRealmURL}person-spec`,
|
|
748
|
+
specType: "card",
|
|
749
|
+
moduleHref: `${testRealmURL}person`,
|
|
750
|
+
ref: `${testRealmURL}person/Person`,
|
|
751
|
+
cardTitle: "Person Card",
|
|
752
|
+
containedExamples: null,
|
|
753
|
+
linkedExamples: null,
|
|
754
|
+
fileExamples: null,
|
|
755
|
+
isCard: true,
|
|
756
|
+
isComponent: false,
|
|
757
|
+
isField: false,
|
|
758
|
+
isFile: false,
|
|
759
|
+
cardTheme: null,
|
|
760
|
+
cardInfo: {
|
|
761
|
+
cardThumbnail: null,
|
|
762
|
+
theme: null
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
766
|
+
entry = await indexer.cardDocument(new URL(`${testRealmURL}people-skill`));
|
|
767
|
+
if (entry?.type === "doc") {
|
|
768
|
+
assert.deepEqual(entry.doc.data, {
|
|
769
|
+
id: testRRI("people-skill"),
|
|
770
|
+
type: "card",
|
|
771
|
+
links: { self: "./people-skill" },
|
|
772
|
+
attributes: {
|
|
773
|
+
commands: [{
|
|
774
|
+
codeRef: {
|
|
775
|
+
module: "@cardstack/boxel-host/commands/switch-submode",
|
|
776
|
+
name: "default"
|
|
777
|
+
},
|
|
778
|
+
functionName: "switch-submode_dd88",
|
|
779
|
+
requiresApproval: false,
|
|
780
|
+
cardTitle: "Switch Submode",
|
|
781
|
+
definition: null
|
|
782
|
+
}],
|
|
783
|
+
cardDescription: null,
|
|
784
|
+
instructions: "How to win friends and influence people",
|
|
785
|
+
cardThumbnailURL: null,
|
|
786
|
+
cardTitle: null,
|
|
787
|
+
cardInfo
|
|
788
|
+
},
|
|
789
|
+
meta: {
|
|
790
|
+
adoptsFrom: skillCardRef,
|
|
791
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}people-skill.json`),
|
|
792
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "people-skill.json"),
|
|
793
|
+
realmURL: testRealmURL,
|
|
794
|
+
realmInfo: {
|
|
795
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
796
|
+
backgroundURL: null,
|
|
797
|
+
iconURL: null,
|
|
798
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
799
|
+
lastPublishedAt: null,
|
|
800
|
+
name: "Unnamed Workspace",
|
|
801
|
+
publishable: null,
|
|
802
|
+
realmUserId: "@realm_server:localhost",
|
|
803
|
+
showAsCatalog: null,
|
|
804
|
+
visibility: "public"
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
expectSearchDoc(assert, (await indexer.instance(new URL(`${testRealmURL}people-skill`)))?.searchDoc, {
|
|
809
|
+
_cardType: "Skill",
|
|
810
|
+
id: `${testRealmURL}people-skill`,
|
|
811
|
+
instructions: "How to win friends and influence people",
|
|
812
|
+
commands: [{
|
|
813
|
+
codeRef: `@cardstack/boxel-host/commands/switch-submode/default`,
|
|
814
|
+
functionName: "switch-submode_dd88",
|
|
815
|
+
requiresApproval: false,
|
|
816
|
+
cardTitle: "Switch Submode",
|
|
817
|
+
definition: null
|
|
818
|
+
}],
|
|
819
|
+
cardTheme: null,
|
|
820
|
+
cardInfo: {
|
|
821
|
+
cardThumbnail: null,
|
|
822
|
+
theme: null
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
826
|
+
});
|
|
827
|
+
(0, import_qunit.test)("can recover from rendering a card that has a template error", async function(assert) {
|
|
828
|
+
{
|
|
829
|
+
class Person extends CardDef {
|
|
830
|
+
static {
|
|
831
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
832
|
+
return contains(string_default);
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
836
|
+
static isolated = class Isolated extends Component$1 {
|
|
837
|
+
static {
|
|
838
|
+
setComponentTemplate(templateFactory({
|
|
839
|
+
"id": "pbAMu5rb",
|
|
840
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
841
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
842
|
+
"isStrictMode": true
|
|
843
|
+
}), this);
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
static embedded = class Embedded extends Component$1 {
|
|
847
|
+
static {
|
|
848
|
+
setComponentTemplate(templateFactory({
|
|
849
|
+
"id": "455R5/G0",
|
|
850
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Embedded Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
851
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
852
|
+
"isStrictMode": true
|
|
853
|
+
}), this);
|
|
854
|
+
}
|
|
855
|
+
};
|
|
856
|
+
static fitted = class Fitted extends Component$1 {
|
|
857
|
+
static {
|
|
858
|
+
setComponentTemplate(templateFactory({
|
|
859
|
+
"id": "O3XcZBYx",
|
|
860
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Fitted Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
861
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
862
|
+
"isStrictMode": true
|
|
863
|
+
}), this);
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
class Boom extends CardDef {
|
|
868
|
+
static {
|
|
869
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
870
|
+
return contains(string_default);
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
874
|
+
static isolated = class Isolated extends Component$1 {
|
|
875
|
+
static {
|
|
876
|
+
setComponentTemplate(templateFactory({
|
|
877
|
+
"id": "KxUueTZn",
|
|
878
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[1,[30,0,[\"boom\"]]],[13]],[\"@fields\"],[]]",
|
|
879
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
880
|
+
"isStrictMode": true
|
|
881
|
+
}), this);
|
|
882
|
+
}
|
|
883
|
+
get boom() {
|
|
884
|
+
throw new Error("intentional error");
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
889
|
+
mockMatrixUtils,
|
|
890
|
+
contents: {
|
|
891
|
+
"person.gts": { Person },
|
|
892
|
+
"boom.gts": { Boom },
|
|
893
|
+
"vangogh.json": { data: {
|
|
894
|
+
attributes: { firstName: "Van Gogh" },
|
|
895
|
+
meta: { adoptsFrom: {
|
|
896
|
+
module: `${testRealmURL}person`,
|
|
897
|
+
name: "Person"
|
|
898
|
+
} }
|
|
899
|
+
} },
|
|
900
|
+
"boom.json": { data: {
|
|
901
|
+
attributes: { firstName: "Boom!" },
|
|
902
|
+
meta: { adoptsFrom: {
|
|
903
|
+
module: "./boom",
|
|
904
|
+
name: "Boom"
|
|
905
|
+
} }
|
|
906
|
+
} }
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
910
|
+
let realmIndexUpdater = realm.realmIndexUpdater;
|
|
911
|
+
{
|
|
912
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}boom`));
|
|
913
|
+
if (entry?.type === "error") {
|
|
914
|
+
assert.strictEqual(entry.error.errorDetail.message, "Encountered error rendering HTML for card: intentional error");
|
|
915
|
+
let errorDeps = entry.error.errorDetail.deps ?? [];
|
|
916
|
+
assert.ok(errorDeps.includes(`${testRealmURL}boom`), "error deps include the card's own module");
|
|
917
|
+
assert.ok(errorDeps.some((dep) => /@cardstack\/base\/default-templates\/embedded\.gts.*\.glimmer-scoped\.css$/.test(dep)), "error deps include transitive render dependencies (the full closure)");
|
|
918
|
+
} else assert.ok("false", "expected search entry to be an error document");
|
|
919
|
+
}
|
|
920
|
+
{
|
|
921
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}vangogh`));
|
|
922
|
+
if (entry?.type === "doc") {
|
|
923
|
+
assert.deepEqual(entry.doc.data.attributes?.firstName, "Van Gogh");
|
|
924
|
+
let { isolatedHtml, embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`${testRealmURL}vangogh`)) ?? {};
|
|
925
|
+
assertInnerHtmlMatches(assert, isolatedHtml, `<h1> Van Gogh </h1>`);
|
|
926
|
+
assertInnerHtmlMatches(assert, embeddedHtml[`${testRealmURL}person/Person`], `<h1> Person Embedded Card: Van Gogh </h1>`);
|
|
927
|
+
assertInnerHtmlMatches(assert, fittedHtml[`${testRealmURL}person/Person`], `<h1> Person Fitted Card: Van Gogh </h1>`);
|
|
928
|
+
} else assert.ok(false, `expected search entry to be a document but was: ${entry?.error.errorDetail.message}`);
|
|
929
|
+
}
|
|
930
|
+
await realmIndexUpdater.fullIndex();
|
|
931
|
+
{
|
|
932
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}vangogh`));
|
|
933
|
+
if (entry?.type === "doc") {
|
|
934
|
+
assert.deepEqual(entry.doc.data.attributes?.firstName, "Van Gogh");
|
|
935
|
+
let { isolatedHtml, embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`${testRealmURL}vangogh`)) ?? {};
|
|
936
|
+
assertInnerHtmlMatches(assert, isolatedHtml, `<h1> Van Gogh </h1>`);
|
|
937
|
+
assertInnerHtmlMatches(assert, embeddedHtml[`${testRealmURL}person/Person`], `<h1> Person Embedded Card: Van Gogh </h1>`);
|
|
938
|
+
assertInnerHtmlMatches(assert, fittedHtml[`${testRealmURL}person/Person`], `<h1> Person Fitted Card: Van Gogh </h1>`);
|
|
939
|
+
} else assert.ok(false, `expected search entry to be a document but was: ${entry?.error.errorDetail.message}`);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
});
|
|
943
|
+
(0, import_qunit.test)("can recover from rendering a card that has a nested card with a template error", async function(assert) {
|
|
944
|
+
class Boom extends FieldDef {
|
|
945
|
+
static {
|
|
946
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
947
|
+
return contains(string_default);
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
951
|
+
static embedded = class Embedded extends Component$1 {
|
|
952
|
+
static {
|
|
953
|
+
setComponentTemplate(templateFactory({
|
|
954
|
+
"id": "KxUueTZn",
|
|
955
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[1,[30,0,[\"boom\"]]],[13]],[\"@fields\"],[]]",
|
|
956
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
957
|
+
"isStrictMode": true
|
|
958
|
+
}), this);
|
|
959
|
+
}
|
|
960
|
+
get boom() {
|
|
961
|
+
throw new Error("intentional error");
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
class BoomPerson extends CardDef {
|
|
966
|
+
static {
|
|
967
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
968
|
+
return contains(string_default);
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
972
|
+
static {
|
|
973
|
+
decorateFieldV2(this.prototype, "boom", [field], function() {
|
|
974
|
+
return contains(Boom);
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
#boom = (initializeDeferredDecorator(this, "boom"), void 0);
|
|
978
|
+
static isolated = class Isolated extends Component$1 {
|
|
979
|
+
static {
|
|
980
|
+
setComponentTemplate(templateFactory({
|
|
981
|
+
"id": "boUjskQF",
|
|
982
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13],[1,\"\\n\"],[10,\"h2\"],[12],[8,[30,1,[\"boom\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
983
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
984
|
+
"isStrictMode": true
|
|
985
|
+
}), this);
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
class Person extends CardDef {
|
|
990
|
+
static {
|
|
991
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
992
|
+
return contains(string_default);
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
996
|
+
static isolated = class Isolated extends Component$1 {
|
|
997
|
+
static {
|
|
998
|
+
setComponentTemplate(templateFactory({
|
|
999
|
+
"id": "pbAMu5rb",
|
|
1000
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1001
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1002
|
+
"isStrictMode": true
|
|
1003
|
+
}), this);
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
static embedded = class Embedded extends Component$1 {
|
|
1007
|
+
static {
|
|
1008
|
+
setComponentTemplate(templateFactory({
|
|
1009
|
+
"id": "455R5/G0",
|
|
1010
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Embedded Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1011
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1012
|
+
"isStrictMode": true
|
|
1013
|
+
}), this);
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
static fitted = class Fitted extends Component$1 {
|
|
1017
|
+
static {
|
|
1018
|
+
setComponentTemplate(templateFactory({
|
|
1019
|
+
"id": "O3XcZBYx",
|
|
1020
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Fitted Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1021
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1022
|
+
"isStrictMode": true
|
|
1023
|
+
}), this);
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1028
|
+
mockMatrixUtils,
|
|
1029
|
+
contents: {
|
|
1030
|
+
"boom-person.gts": { BoomPerson },
|
|
1031
|
+
"boom.gts": { Boom },
|
|
1032
|
+
"person.gts": { Person },
|
|
1033
|
+
"vangogh.json": { data: {
|
|
1034
|
+
attributes: {
|
|
1035
|
+
firstName: "Van Gogh",
|
|
1036
|
+
boom: { firstName: "Mango" }
|
|
1037
|
+
},
|
|
1038
|
+
meta: { adoptsFrom: {
|
|
1039
|
+
module: "./boom-person",
|
|
1040
|
+
name: "BoomPerson"
|
|
1041
|
+
} }
|
|
1042
|
+
} },
|
|
1043
|
+
"working-van-gogh.json": { data: {
|
|
1044
|
+
attributes: { firstName: "Van Gogh" },
|
|
1045
|
+
meta: { adoptsFrom: {
|
|
1046
|
+
module: `${testRealmURL}person`,
|
|
1047
|
+
name: "Person"
|
|
1048
|
+
} }
|
|
1049
|
+
} }
|
|
1050
|
+
}
|
|
1051
|
+
});
|
|
1052
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
1053
|
+
let entry = await indexer.cardDocument(new URL(`${testRealmURL}vangogh`));
|
|
1054
|
+
if (entry?.type === "error") assert.strictEqual(entry.error.errorDetail.message, "Encountered error rendering HTML for card: intentional error");
|
|
1055
|
+
else assert.ok("false", "expected search entry to be an error document");
|
|
1056
|
+
await realm.reindex();
|
|
1057
|
+
entry = await indexer.cardDocument(new URL(`${testRealmURL}working-van-gogh`));
|
|
1058
|
+
if (entry?.type === "doc") {
|
|
1059
|
+
assert.deepEqual(entry.doc.data.attributes?.firstName, "Van Gogh");
|
|
1060
|
+
let { isolatedHtml, embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`${testRealmURL}working-van-gogh`)) ?? {};
|
|
1061
|
+
assertInnerHtmlMatches(assert, isolatedHtml, `<h1> Van Gogh </h1>`);
|
|
1062
|
+
assertInnerHtmlMatches(assert, embeddedHtml[`${testRealmURL}person/Person`], `<h1> Person Embedded Card: Van Gogh </h1>`);
|
|
1063
|
+
assertInnerHtmlMatches(assert, fittedHtml[`${testRealmURL}person/Person`], `<h1> Person Fitted Card: Van Gogh </h1>`);
|
|
1064
|
+
} else assert.ok(false, `expected search entry to be a document but was: ${entry?.error.errorDetail.message}`);
|
|
1065
|
+
});
|
|
1066
|
+
(0, import_qunit.test)("can recover from rendering a card that encounters a template error in its own custom component", async function(assert) {
|
|
1067
|
+
class Custom extends Component {
|
|
1068
|
+
static {
|
|
1069
|
+
setComponentTemplate(templateFactory({
|
|
1070
|
+
"id": "L1UHS+ps",
|
|
1071
|
+
"block": "[[[1,[30,0,[\"boom\"]]]],[],[]]",
|
|
1072
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1073
|
+
"isStrictMode": true
|
|
1074
|
+
}), this);
|
|
1075
|
+
}
|
|
1076
|
+
get boom() {
|
|
1077
|
+
throw new Error("intentional error");
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
class CustomBoom extends FieldDef {
|
|
1081
|
+
static {
|
|
1082
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1083
|
+
return contains(string_default);
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1087
|
+
static embedded = class Embedded extends Component$1 {
|
|
1088
|
+
static {
|
|
1089
|
+
setComponentTemplate(templateFactory({
|
|
1090
|
+
"id": "GCbWRRAT",
|
|
1091
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[8,[32,0],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1092
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1093
|
+
"scope": () => [Custom],
|
|
1094
|
+
"isStrictMode": true
|
|
1095
|
+
}), this);
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
class BoomPerson2 extends CardDef {
|
|
1100
|
+
static {
|
|
1101
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1102
|
+
return contains(string_default);
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1106
|
+
static {
|
|
1107
|
+
decorateFieldV2(this.prototype, "boom", [field], function() {
|
|
1108
|
+
return contains(CustomBoom);
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
#boom = (initializeDeferredDecorator(this, "boom"), void 0);
|
|
1112
|
+
static isolated = class Isolated extends Component$1 {
|
|
1113
|
+
static {
|
|
1114
|
+
setComponentTemplate(templateFactory({
|
|
1115
|
+
"id": "boUjskQF",
|
|
1116
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13],[1,\"\\n\"],[10,\"h2\"],[12],[8,[30,1,[\"boom\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1117
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1118
|
+
"isStrictMode": true
|
|
1119
|
+
}), this);
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
class Person extends CardDef {
|
|
1124
|
+
static {
|
|
1125
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1126
|
+
return contains(string_default);
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1130
|
+
static isolated = class Isolated extends Component$1 {
|
|
1131
|
+
static {
|
|
1132
|
+
setComponentTemplate(templateFactory({
|
|
1133
|
+
"id": "pbAMu5rb",
|
|
1134
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1135
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1136
|
+
"isStrictMode": true
|
|
1137
|
+
}), this);
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
static embedded = class Embedded extends Component$1 {
|
|
1141
|
+
static {
|
|
1142
|
+
setComponentTemplate(templateFactory({
|
|
1143
|
+
"id": "455R5/G0",
|
|
1144
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Embedded Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1145
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1146
|
+
"isStrictMode": true
|
|
1147
|
+
}), this);
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
static fitted = class Fitted extends Component$1 {
|
|
1151
|
+
static {
|
|
1152
|
+
setComponentTemplate(templateFactory({
|
|
1153
|
+
"id": "O3XcZBYx",
|
|
1154
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Fitted Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1155
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1156
|
+
"isStrictMode": true
|
|
1157
|
+
}), this);
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1162
|
+
mockMatrixUtils,
|
|
1163
|
+
contents: {
|
|
1164
|
+
"boom-person2.gts": { BoomPerson2 },
|
|
1165
|
+
"custom-boom.gts": { CustomBoom },
|
|
1166
|
+
"person.gts": { Person },
|
|
1167
|
+
"vangogh.json": { data: {
|
|
1168
|
+
attributes: {
|
|
1169
|
+
firstName: "Van Gogh",
|
|
1170
|
+
boom: { firstName: "Mango" }
|
|
1171
|
+
},
|
|
1172
|
+
meta: { adoptsFrom: {
|
|
1173
|
+
module: "./boom-person2",
|
|
1174
|
+
name: "BoomPerson2"
|
|
1175
|
+
} }
|
|
1176
|
+
} },
|
|
1177
|
+
"working-vangogh.json": { data: {
|
|
1178
|
+
attributes: { firstName: "Van Gogh" },
|
|
1179
|
+
meta: { adoptsFrom: {
|
|
1180
|
+
module: `${testRealmURL}person`,
|
|
1181
|
+
name: "Person"
|
|
1182
|
+
} }
|
|
1183
|
+
} }
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
1187
|
+
let entry = await indexer.cardDocument(new URL(`${testRealmURL}vangogh`));
|
|
1188
|
+
if (entry?.type === "error") assert.strictEqual(entry.error.errorDetail.message, "Encountered error rendering HTML for card: intentional error");
|
|
1189
|
+
else assert.ok("false", "expected search entry to be an error document");
|
|
1190
|
+
await realm.reindex();
|
|
1191
|
+
entry = await indexer.cardDocument(new URL(`${testRealmURL}working-vangogh`));
|
|
1192
|
+
if (entry?.type === "doc") {
|
|
1193
|
+
assert.deepEqual(entry.doc.data.attributes?.firstName, "Van Gogh");
|
|
1194
|
+
let { isolatedHtml, embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`${testRealmURL}working-vangogh`)) ?? {};
|
|
1195
|
+
assertInnerHtmlMatches(assert, isolatedHtml, `<h1> Van Gogh </h1>`);
|
|
1196
|
+
assert.false(isolatedHtml.includes("id=\"ember"), `isolated HTML does not include ember ID's`);
|
|
1197
|
+
assertInnerHtmlMatches(assert, embeddedHtml[`${testRealmURL}person/Person`], `<h1> Person Embedded Card: Van Gogh </h1>`);
|
|
1198
|
+
assertInnerHtmlMatches(assert, fittedHtml[`${testRealmURL}person/Person`], `<h1> Person Fitted Card: Van Gogh </h1>`);
|
|
1199
|
+
assert.false(Object.values(embeddedHtml).join("").includes("id=\"ember"), `embeddedHtml HTML does not include ember ID's`);
|
|
1200
|
+
assert.false(Object.values(fittedHtml).join("").includes("id=\"ember"), `fittedHtml HTML does not include ember ID's`);
|
|
1201
|
+
} else assert.ok(false, `expected search entry to be a document but was: ${entry?.error.errorDetail.message}`);
|
|
1202
|
+
});
|
|
1203
|
+
(0, import_qunit.test)("can incrementally index a card", async function(assert) {
|
|
1204
|
+
class Person extends CardDef {
|
|
1205
|
+
static {
|
|
1206
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1207
|
+
return contains(string_default);
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1211
|
+
static isolated = class Isolated extends Component$1 {
|
|
1212
|
+
static {
|
|
1213
|
+
setComponentTemplate(templateFactory({
|
|
1214
|
+
"id": "pbAMu5rb",
|
|
1215
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1216
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1217
|
+
"isStrictMode": true
|
|
1218
|
+
}), this);
|
|
1219
|
+
}
|
|
1220
|
+
};
|
|
1221
|
+
static atom = class Atom extends Component$1 {
|
|
1222
|
+
static {
|
|
1223
|
+
setComponentTemplate(templateFactory({
|
|
1224
|
+
"id": "MvjivV0J",
|
|
1225
|
+
"block": "[[[10,0],[14,0,\"atom\"],[12],[1,[30,1,[\"firstName\"]]],[13]],[\"@model\"],[]]",
|
|
1226
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1227
|
+
"isStrictMode": true
|
|
1228
|
+
}), this);
|
|
1229
|
+
}
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
1233
|
+
mockMatrixUtils,
|
|
1234
|
+
contents: {
|
|
1235
|
+
"person.gts": { Person },
|
|
1236
|
+
"vangogh.json": { data: {
|
|
1237
|
+
attributes: { firstName: "Van Gogh" },
|
|
1238
|
+
meta: { adoptsFrom: {
|
|
1239
|
+
module: `./person`,
|
|
1240
|
+
name: "Person"
|
|
1241
|
+
} }
|
|
1242
|
+
} }
|
|
1243
|
+
}
|
|
1244
|
+
});
|
|
1245
|
+
await realm.write("vangogh.json", JSON.stringify({ data: {
|
|
1246
|
+
id: testRRI("vangogh"),
|
|
1247
|
+
attributes: { firstName: "Van Van" },
|
|
1248
|
+
meta: { adoptsFrom: {
|
|
1249
|
+
module: testRRI("person"),
|
|
1250
|
+
name: "Person"
|
|
1251
|
+
} }
|
|
1252
|
+
} }));
|
|
1253
|
+
let { instance } = await getInstance(realm, new URL(`${testRealmURL}vangogh`)) ?? {};
|
|
1254
|
+
assert.deepEqual(instance, {
|
|
1255
|
+
id: testRRI("vangogh"),
|
|
1256
|
+
type: "card",
|
|
1257
|
+
attributes: {
|
|
1258
|
+
cardInfo: {
|
|
1259
|
+
summary: null,
|
|
1260
|
+
notes: null,
|
|
1261
|
+
cardThumbnailURL: null,
|
|
1262
|
+
name: null
|
|
1263
|
+
},
|
|
1264
|
+
cardDescription: null,
|
|
1265
|
+
firstName: "Van Van",
|
|
1266
|
+
cardThumbnailURL: null,
|
|
1267
|
+
cardTitle: "Untitled Card"
|
|
1268
|
+
},
|
|
1269
|
+
meta: {
|
|
1270
|
+
adoptsFrom: {
|
|
1271
|
+
module: rri(`./person`),
|
|
1272
|
+
name: "Person"
|
|
1273
|
+
},
|
|
1274
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}vangogh.json`),
|
|
1275
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "vangogh.json"),
|
|
1276
|
+
realmURL: testRealmURL
|
|
1277
|
+
}
|
|
1278
|
+
}, "serialized instance is correct");
|
|
1279
|
+
});
|
|
1280
|
+
(0, import_qunit.test)("can capture search doc when indexing a card", async function(assert) {
|
|
1281
|
+
class Person extends CardDef {
|
|
1282
|
+
static {
|
|
1283
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1284
|
+
return contains(string_default);
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1288
|
+
static isolated = class Isolated extends Component$1 {
|
|
1289
|
+
static {
|
|
1290
|
+
setComponentTemplate(templateFactory({
|
|
1291
|
+
"id": "pbAMu5rb",
|
|
1292
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1293
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1294
|
+
"isStrictMode": true
|
|
1295
|
+
}), this);
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
static atom = class Atom extends Component$1 {
|
|
1299
|
+
static {
|
|
1300
|
+
setComponentTemplate(templateFactory({
|
|
1301
|
+
"id": "MvjivV0J",
|
|
1302
|
+
"block": "[[[10,0],[14,0,\"atom\"],[12],[1,[30,1,[\"firstName\"]]],[13]],[\"@model\"],[]]",
|
|
1303
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1304
|
+
"isStrictMode": true
|
|
1305
|
+
}), this);
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1310
|
+
mockMatrixUtils,
|
|
1311
|
+
contents: {
|
|
1312
|
+
"person.gts": { Person },
|
|
1313
|
+
"vangogh.json": { data: {
|
|
1314
|
+
attributes: { firstName: "Van Gogh" },
|
|
1315
|
+
meta: { adoptsFrom: {
|
|
1316
|
+
module: `${testRealmURL}person`,
|
|
1317
|
+
name: "Person"
|
|
1318
|
+
} }
|
|
1319
|
+
} }
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
let { searchDoc } = await getInstance(realm, new URL(`${testRealmURL}vangogh`)) ?? {};
|
|
1323
|
+
expectSearchDoc(assert, searchDoc, {
|
|
1324
|
+
_cardType: "Person",
|
|
1325
|
+
cardTheme: null,
|
|
1326
|
+
cardInfo: {
|
|
1327
|
+
cardThumbnail: null,
|
|
1328
|
+
theme: null
|
|
1329
|
+
},
|
|
1330
|
+
firstName: "Van Gogh",
|
|
1331
|
+
id: `${testRealmURL}vangogh`,
|
|
1332
|
+
cardTitle: "Untitled Card"
|
|
1333
|
+
}, "search doc is correct");
|
|
1334
|
+
});
|
|
1335
|
+
(0, import_qunit.test)("can capture atom html when indexing a card", async function(assert) {
|
|
1336
|
+
class Person extends CardDef {
|
|
1337
|
+
static {
|
|
1338
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1339
|
+
return contains(string_default);
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1343
|
+
static isolated = class Isolated extends Component$1 {
|
|
1344
|
+
static {
|
|
1345
|
+
setComponentTemplate(templateFactory({
|
|
1346
|
+
"id": "pbAMu5rb",
|
|
1347
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1348
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1349
|
+
"isStrictMode": true
|
|
1350
|
+
}), this);
|
|
1351
|
+
}
|
|
1352
|
+
};
|
|
1353
|
+
static atom = class Atom extends Component$1 {
|
|
1354
|
+
static {
|
|
1355
|
+
setComponentTemplate(templateFactory({
|
|
1356
|
+
"id": "MvjivV0J",
|
|
1357
|
+
"block": "[[[10,0],[14,0,\"atom\"],[12],[1,[30,1,[\"firstName\"]]],[13]],[\"@model\"],[]]",
|
|
1358
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1359
|
+
"isStrictMode": true
|
|
1360
|
+
}), this);
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1365
|
+
mockMatrixUtils,
|
|
1366
|
+
contents: {
|
|
1367
|
+
"person.gts": { Person },
|
|
1368
|
+
"vangogh.json": { data: {
|
|
1369
|
+
attributes: { firstName: "Van Gogh" },
|
|
1370
|
+
meta: { adoptsFrom: {
|
|
1371
|
+
module: `${testRealmURL}person`,
|
|
1372
|
+
name: "Person"
|
|
1373
|
+
} }
|
|
1374
|
+
} }
|
|
1375
|
+
}
|
|
1376
|
+
});
|
|
1377
|
+
let { atomHtml } = await getInstance(realm, new URL(`${testRealmURL}vangogh`)) ?? {};
|
|
1378
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(atomHtml)), cleanWhiteSpace(`<div class="atom">Van Gogh</div>`), "atom html is correct");
|
|
1379
|
+
assert.false(atomHtml.includes("id=\"ember"), `atom HTML does not include ember ID's`);
|
|
1380
|
+
});
|
|
1381
|
+
(0, import_qunit.test)("can capture head html when indexing a card", async function(assert) {
|
|
1382
|
+
class Person extends CardDef {
|
|
1383
|
+
static {
|
|
1384
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1385
|
+
return contains(string_default);
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1389
|
+
static head = class Head extends Component$1 {
|
|
1390
|
+
static {
|
|
1391
|
+
setComponentTemplate(templateFactory({
|
|
1392
|
+
"id": "JVgzQi6M",
|
|
1393
|
+
"block": "[[[10,\"title\"],[12],[1,[30,1,[\"firstName\"]]],[1,\"!\"],[13]],[\"@model\"],[]]",
|
|
1394
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1395
|
+
"isStrictMode": true
|
|
1396
|
+
}), this);
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1401
|
+
mockMatrixUtils,
|
|
1402
|
+
contents: {
|
|
1403
|
+
"person.gts": { Person },
|
|
1404
|
+
"vangogh.json": { data: {
|
|
1405
|
+
attributes: { firstName: "Van Gogh" },
|
|
1406
|
+
meta: { adoptsFrom: {
|
|
1407
|
+
module: `${testRealmURL}person`,
|
|
1408
|
+
name: "Person"
|
|
1409
|
+
} }
|
|
1410
|
+
} }
|
|
1411
|
+
}
|
|
1412
|
+
});
|
|
1413
|
+
let { headHtml } = await getInstance(realm, new URL(`${testRealmURL}vangogh`)) ?? {};
|
|
1414
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(headHtml)), cleanWhiteSpace(`<title>Van Gogh!</title>`), "head html is correct");
|
|
1415
|
+
});
|
|
1416
|
+
(0, import_qunit.test)(`can generate embedded HTML for instance's card class hierarchy`, async function(assert) {
|
|
1417
|
+
class Person extends CardDef {
|
|
1418
|
+
static displayName = "Person";
|
|
1419
|
+
static {
|
|
1420
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
1421
|
+
return contains(string_default);
|
|
1422
|
+
});
|
|
1423
|
+
}
|
|
1424
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
1425
|
+
static {
|
|
1426
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1427
|
+
return contains(string_default);
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1431
|
+
static embedded = class Embedded extends Component$1 {
|
|
1432
|
+
static {
|
|
1433
|
+
setComponentTemplate(templateFactory({
|
|
1434
|
+
"id": "455R5/G0",
|
|
1435
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Embedded Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1436
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1437
|
+
"isStrictMode": true
|
|
1438
|
+
}), this);
|
|
1439
|
+
}
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
class FancyPerson extends Person {
|
|
1443
|
+
static displayName = "Fancy Person";
|
|
1444
|
+
static {
|
|
1445
|
+
decorateFieldV2(this.prototype, "favoriteColor", [field], function() {
|
|
1446
|
+
return contains(string_default);
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
#favoriteColor = (initializeDeferredDecorator(this, "favoriteColor"), void 0);
|
|
1450
|
+
static embedded = class Embedded extends Component$1 {
|
|
1451
|
+
static {
|
|
1452
|
+
setComponentTemplate(templateFactory({
|
|
1453
|
+
"id": "5nAE9D7f",
|
|
1454
|
+
"block": "[[[10,\"h1\"],[12],[1,\"\\n Fancy Person Embedded Card:\\n \"],[8,[30,1,[\"firstName\"]],null,null,null],[1,\"\\n -\\n \"],[8,[30,1,[\"favoriteColor\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1455
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1456
|
+
"isStrictMode": true
|
|
1457
|
+
}), this);
|
|
1458
|
+
}
|
|
1459
|
+
};
|
|
1460
|
+
}
|
|
1461
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1462
|
+
mockMatrixUtils,
|
|
1463
|
+
contents: {
|
|
1464
|
+
"person.gts": { Person },
|
|
1465
|
+
"fancy-person.gts": { FancyPerson },
|
|
1466
|
+
"germaine.json": { data: {
|
|
1467
|
+
attributes: {
|
|
1468
|
+
firstName: "Germaine",
|
|
1469
|
+
favoriteColor: "hot pink",
|
|
1470
|
+
cardDescription: "Fancy Germaine"
|
|
1471
|
+
},
|
|
1472
|
+
meta: { adoptsFrom: {
|
|
1473
|
+
module: "./fancy-person",
|
|
1474
|
+
name: "FancyPerson"
|
|
1475
|
+
} }
|
|
1476
|
+
} }
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1479
|
+
let { embeddedHtml } = await getInstance(realm, new URL(`${testRealmURL}germaine`)) ?? {};
|
|
1480
|
+
assert.false(Object.values(embeddedHtml).join("").includes("id=\"ember"), `Embedded HTML does not include ember ID's`);
|
|
1481
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(embeddedHtml[`${testRealmURL}fancy-person/FancyPerson`])), cleanWhiteSpace(`<div
|
|
1482
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card embedded-format display-container-true"
|
|
1483
|
+
data-boxel-card-container
|
|
1484
|
+
data-test-boxel-card-container
|
|
1485
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1486
|
+
data-boxel-card-format="embedded"
|
|
1487
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1488
|
+
data-test-card-format="embedded"
|
|
1489
|
+
data-test-field-component-card> <h1> Fancy Person Embedded Card: Germaine - hot pink </h1> </div>`), "default embedded HTML is correct");
|
|
1490
|
+
let cardDefRefURL = internalKeyFor(baseCardRef, void 0, getService("network").virtualNetwork);
|
|
1491
|
+
assert.deepEqual([...Object.keys(embeddedHtml)].sort(), [
|
|
1492
|
+
`${testRealmURL}fancy-person/FancyPerson`,
|
|
1493
|
+
`${testRealmURL}person/Person`,
|
|
1494
|
+
cardDefRefURL
|
|
1495
|
+
].sort(), "embedded class hierarchy is correct");
|
|
1496
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(embeddedHtml[`${testRealmURL}person/Person`])), cleanWhiteSpace(`<div
|
|
1497
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card embedded-format display-container-true"
|
|
1498
|
+
data-boxel-card-container
|
|
1499
|
+
data-test-boxel-card-container
|
|
1500
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1501
|
+
data-boxel-card-format="embedded"
|
|
1502
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1503
|
+
data-test-card-format="embedded"
|
|
1504
|
+
data-test-field-component-card> <h1> Person Embedded Card: Germaine </h1> </div>`), `${testRealmURL}person/Person embedded HTML is correct`);
|
|
1505
|
+
assert.false(embeddedHtml[`${testRealmURL}person/Person`].includes("id=\"ember"), `${testRealmURL}person/Person embedded HTML does not include ember ID's`);
|
|
1506
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(embeddedHtml[cardDefRefURL])), cleanWhiteSpace(`<div
|
|
1507
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card embedded-format display-container-true"
|
|
1508
|
+
data-boxel-card-container
|
|
1509
|
+
data-test-boxel-card-container
|
|
1510
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1511
|
+
data-boxel-card-format="embedded"
|
|
1512
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1513
|
+
data-test-card-format="embedded"
|
|
1514
|
+
data-test-field-component-card>
|
|
1515
|
+
<div class="embedded-template">
|
|
1516
|
+
<div class="thumbnail-section">
|
|
1517
|
+
<div class="card-thumbnail">
|
|
1518
|
+
<div class="card-thumbnail-placeholder" data-test-card-thumbnail-placeholder></div>
|
|
1519
|
+
</div>
|
|
1520
|
+
</div>
|
|
1521
|
+
<div class="info-section">
|
|
1522
|
+
<h3 class="card-title" data-test-card-title>Untitled Fancy Person</h3>
|
|
1523
|
+
<h4 class="card-display-name" data-test-card-display-name>
|
|
1524
|
+
Fancy Person
|
|
1525
|
+
</h4>
|
|
1526
|
+
</div>
|
|
1527
|
+
<div class="card-description" data-test-card-description>Fancy Germaine</div>
|
|
1528
|
+
</div>
|
|
1529
|
+
</div>
|
|
1530
|
+
`), `${cardDefRefURL} embedded HTML is correct`);
|
|
1531
|
+
assert.false(embeddedHtml[cardDefRefURL].includes("id=\"ember"), `${cardDefRefURL} fitted HTML does not include ember ID's`);
|
|
1532
|
+
});
|
|
1533
|
+
(0, import_qunit.test)(`can generate fitted HTML for instance's card class hierarchy`, async function(assert) {
|
|
1534
|
+
class Person extends CardDef {
|
|
1535
|
+
static displayName = "Person";
|
|
1536
|
+
static {
|
|
1537
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1538
|
+
return contains(string_default);
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1541
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1542
|
+
static {
|
|
1543
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
1544
|
+
return contains(string_default);
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
1548
|
+
static fitted = class Fitted extends Component$1 {
|
|
1549
|
+
static {
|
|
1550
|
+
setComponentTemplate(templateFactory({
|
|
1551
|
+
"id": "O3XcZBYx",
|
|
1552
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Fitted Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1553
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1554
|
+
"isStrictMode": true
|
|
1555
|
+
}), this);
|
|
1556
|
+
}
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
class FancyPerson extends Person {
|
|
1560
|
+
static displayName = "Fancy Person";
|
|
1561
|
+
static {
|
|
1562
|
+
decorateFieldV2(this.prototype, "favoriteColor", [field], function() {
|
|
1563
|
+
return contains(string_default);
|
|
1564
|
+
});
|
|
1565
|
+
}
|
|
1566
|
+
#favoriteColor = (initializeDeferredDecorator(this, "favoriteColor"), void 0);
|
|
1567
|
+
static fitted = class Fitted extends Component$1 {
|
|
1568
|
+
static {
|
|
1569
|
+
setComponentTemplate(templateFactory({
|
|
1570
|
+
"id": "Ea3TSKvz",
|
|
1571
|
+
"block": "[[[10,\"h1\"],[12],[1,\"\\n Fancy Person Fitted Card:\\n \"],[8,[30,1,[\"firstName\"]],null,null,null],[1,\"\\n -\\n \"],[8,[30,1,[\"favoriteColor\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1572
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1573
|
+
"isStrictMode": true
|
|
1574
|
+
}), this);
|
|
1575
|
+
}
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1578
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1579
|
+
mockMatrixUtils,
|
|
1580
|
+
contents: {
|
|
1581
|
+
"person.gts": { Person },
|
|
1582
|
+
"fancy-person.gts": { FancyPerson },
|
|
1583
|
+
"germaine.json": { data: {
|
|
1584
|
+
attributes: {
|
|
1585
|
+
firstName: "Germaine",
|
|
1586
|
+
favoriteColor: "hot pink",
|
|
1587
|
+
cardDescription: "Fancy Germaine"
|
|
1588
|
+
},
|
|
1589
|
+
meta: { adoptsFrom: {
|
|
1590
|
+
module: "./fancy-person",
|
|
1591
|
+
name: "FancyPerson"
|
|
1592
|
+
} }
|
|
1593
|
+
} }
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
let { embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`${testRealmURL}germaine`)) ?? {};
|
|
1597
|
+
assert.false(Object.values(fittedHtml).join("").includes("id=\"ember"), `Fitted HTML does not include ember ID's`);
|
|
1598
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(fittedHtml[`${testRealmURL}fancy-person/FancyPerson`])), cleanWhiteSpace(`<div
|
|
1599
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card fitted-format display-container-true"
|
|
1600
|
+
data-boxel-card-container
|
|
1601
|
+
data-test-boxel-card-container
|
|
1602
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1603
|
+
data-boxel-card-format="fitted"
|
|
1604
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1605
|
+
data-test-card-format="fitted"
|
|
1606
|
+
data-test-field-component-card> <h1> Fancy Person Fitted Card: Germaine - hot pink </h1> </div>`), "default fitted HTML is correct");
|
|
1607
|
+
let cardDefRefURL = internalKeyFor(baseCardRef, void 0, getService("network").virtualNetwork);
|
|
1608
|
+
assert.deepEqual([...Object.keys(fittedHtml)].sort(), [
|
|
1609
|
+
`${testRealmURL}fancy-person/FancyPerson`,
|
|
1610
|
+
`${testRealmURL}person/Person`,
|
|
1611
|
+
cardDefRefURL
|
|
1612
|
+
].sort(), "fitted class hierarchy is correct");
|
|
1613
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(fittedHtml[`${testRealmURL}person/Person`])), cleanWhiteSpace(`<div
|
|
1614
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card fitted-format display-container-true"
|
|
1615
|
+
data-boxel-card-container
|
|
1616
|
+
data-test-boxel-card-container
|
|
1617
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1618
|
+
data-boxel-card-format="fitted"
|
|
1619
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1620
|
+
data-test-card-format="fitted"
|
|
1621
|
+
data-test-field-component-card> <h1> Person Fitted Card: Germaine </h1> </div>`), `${testRealmURL}person/Person fitted HTML is correct`);
|
|
1622
|
+
assert.false(fittedHtml[`${testRealmURL}person/Person`].includes("id=\"ember"), `${testRealmURL}person/Person fitted HTML does not include ember ID's`);
|
|
1623
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(embeddedHtml[cardDefRefURL])), cleanWhiteSpace(`<div
|
|
1624
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card embedded-format display-container-true"
|
|
1625
|
+
data-boxel-card-container
|
|
1626
|
+
data-test-boxel-card-container
|
|
1627
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1628
|
+
data-boxel-card-format="embedded"
|
|
1629
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1630
|
+
data-test-card-format="embedded"
|
|
1631
|
+
data-test-field-component-card>
|
|
1632
|
+
<div class="embedded-template">
|
|
1633
|
+
<div class="thumbnail-section">
|
|
1634
|
+
<div class="card-thumbnail">
|
|
1635
|
+
<div class="card-thumbnail-placeholder" data-test-card-thumbnail-placeholder></div>
|
|
1636
|
+
</div>
|
|
1637
|
+
</div>
|
|
1638
|
+
<div class="info-section">
|
|
1639
|
+
<h3 class="card-title" data-test-card-title>Untitled Fancy Person</h3>
|
|
1640
|
+
<h4 class="card-display-name" data-test-card-display-name> Fancy Person </h4>
|
|
1641
|
+
</div>
|
|
1642
|
+
<div class="card-description" data-test-card-description>Fancy Germaine</div>
|
|
1643
|
+
</div>
|
|
1644
|
+
</div>`), `${cardDefRefURL} embedded HTML is correct`);
|
|
1645
|
+
assert.false(embeddedHtml[cardDefRefURL].includes("id=\"ember"), `${cardDefRefURL} embedded HTML does not include ember ID's`);
|
|
1646
|
+
});
|
|
1647
|
+
(0, import_qunit.test)("can index a card that has a cyclic relationship with the field of a card in its fields", async function(assert) {
|
|
1648
|
+
class Person extends FieldDef {
|
|
1649
|
+
static {
|
|
1650
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1651
|
+
return contains(string_default);
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1654
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1655
|
+
static {
|
|
1656
|
+
decorateFieldV2(this.prototype, "pet", [field], function() {
|
|
1657
|
+
return linksTo(() => PetCard);
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
#pet = (initializeDeferredDecorator(this, "pet"), void 0);
|
|
1661
|
+
static {
|
|
1662
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
1663
|
+
return contains(string_default, { computeVia: function() {
|
|
1664
|
+
return this.firstName;
|
|
1665
|
+
} });
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
1669
|
+
}
|
|
1670
|
+
class Appointment extends FieldDef {
|
|
1671
|
+
static {
|
|
1672
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
1673
|
+
return contains(string_default);
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
1677
|
+
static {
|
|
1678
|
+
decorateFieldV2(this.prototype, "contact", [field], function() {
|
|
1679
|
+
return contains(Person);
|
|
1680
|
+
});
|
|
1681
|
+
}
|
|
1682
|
+
#contact = (initializeDeferredDecorator(this, "contact"), void 0);
|
|
1683
|
+
}
|
|
1684
|
+
class PetCard extends CardDef {
|
|
1685
|
+
static {
|
|
1686
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1687
|
+
return contains(string_default);
|
|
1688
|
+
});
|
|
1689
|
+
}
|
|
1690
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1691
|
+
static {
|
|
1692
|
+
decorateFieldV2(this.prototype, "appointment", [field], function() {
|
|
1693
|
+
return contains(Appointment);
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
#appointment = (initializeDeferredDecorator(this, "appointment"), void 0);
|
|
1697
|
+
static {
|
|
1698
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
1699
|
+
return contains(string_default, { computeVia: function() {
|
|
1700
|
+
return this.firstName;
|
|
1701
|
+
} });
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
1705
|
+
static {
|
|
1706
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
1707
|
+
return contains(string_default);
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
1711
|
+
static {
|
|
1712
|
+
decorateFieldV2(this.prototype, "cardThumbnailURL", [field], function() {
|
|
1713
|
+
return contains(string_default);
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
#cardThumbnailURL = (initializeDeferredDecorator(this, "cardThumbnailURL"), void 0);
|
|
1717
|
+
}
|
|
1718
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1719
|
+
mockMatrixUtils,
|
|
1720
|
+
contents: {
|
|
1721
|
+
"person-card.gts": { Person },
|
|
1722
|
+
"appointment.gts": { Appointment },
|
|
1723
|
+
"pet-card.gts": { PetCard },
|
|
1724
|
+
"jackie.json": { data: {
|
|
1725
|
+
attributes: {
|
|
1726
|
+
firstName: "Jackie",
|
|
1727
|
+
appointment: {
|
|
1728
|
+
cardTitle: "Vet visit",
|
|
1729
|
+
contact: { firstName: "Burcu" }
|
|
1730
|
+
},
|
|
1731
|
+
cardDescription: "Dog",
|
|
1732
|
+
cardThumbnailURL: "./jackie.jpg"
|
|
1733
|
+
},
|
|
1734
|
+
meta: { adoptsFrom: {
|
|
1735
|
+
module: `./pet-card`,
|
|
1736
|
+
name: "PetCard"
|
|
1737
|
+
} },
|
|
1738
|
+
relationships: { "appointment.contact.pet": { links: { self: `./mango` } } }
|
|
1739
|
+
} },
|
|
1740
|
+
"mango.json": { data: {
|
|
1741
|
+
attributes: { firstName: "Mango" },
|
|
1742
|
+
meta: { adoptsFrom: {
|
|
1743
|
+
module: `./pet-card`,
|
|
1744
|
+
name: "PetCard"
|
|
1745
|
+
} }
|
|
1746
|
+
} }
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
let card = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}jackie`));
|
|
1750
|
+
if (card?.type === "doc") {
|
|
1751
|
+
assert.deepEqual(card.doc.data.attributes, {
|
|
1752
|
+
firstName: "Jackie",
|
|
1753
|
+
cardTitle: "Jackie",
|
|
1754
|
+
appointment: {
|
|
1755
|
+
cardTitle: "Vet visit",
|
|
1756
|
+
contact: {
|
|
1757
|
+
firstName: "Burcu",
|
|
1758
|
+
cardTitle: "Burcu"
|
|
1759
|
+
}
|
|
1760
|
+
},
|
|
1761
|
+
cardDescription: "Dog",
|
|
1762
|
+
cardThumbnailURL: `./jackie.jpg`,
|
|
1763
|
+
cardInfo
|
|
1764
|
+
});
|
|
1765
|
+
assert.deepEqual(card.doc.data.relationships, { "appointment.contact.pet": { links: { self: `./mango` } } });
|
|
1766
|
+
} else assert.ok(false, `search entry was an error: ${card?.error.errorDetail.message}`);
|
|
1767
|
+
});
|
|
1768
|
+
(0, import_qunit.test)("can index a card with a containsMany composite containing a linkTo field", async function(assert) {
|
|
1769
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
1770
|
+
mockMatrixUtils,
|
|
1771
|
+
contents: {
|
|
1772
|
+
"Vendor/vendor1.json": { data: {
|
|
1773
|
+
id: `${testRealmURL}Vendor/vendor1`,
|
|
1774
|
+
attributes: {
|
|
1775
|
+
name: "Acme Industries",
|
|
1776
|
+
paymentMethods: [{
|
|
1777
|
+
type: "crypto",
|
|
1778
|
+
payment: { address: "0x1111" }
|
|
1779
|
+
}, {
|
|
1780
|
+
type: "crypto",
|
|
1781
|
+
payment: { address: "0x2222" }
|
|
1782
|
+
}]
|
|
1783
|
+
},
|
|
1784
|
+
relationships: {
|
|
1785
|
+
"paymentMethods.0.payment.chain": { links: { self: `../Chain/1` } },
|
|
1786
|
+
"paymentMethods.1.payment.chain": { links: { self: `../Chain/2` } }
|
|
1787
|
+
},
|
|
1788
|
+
meta: { adoptsFrom: {
|
|
1789
|
+
module: `${testModuleRealm}vendor`,
|
|
1790
|
+
name: "Vendor"
|
|
1791
|
+
} }
|
|
1792
|
+
} },
|
|
1793
|
+
"Chain/1.json": { data: {
|
|
1794
|
+
id: `${testRealmURL}Chain/1`,
|
|
1795
|
+
attributes: { name: "Ethereum Mainnet" },
|
|
1796
|
+
meta: { adoptsFrom: {
|
|
1797
|
+
module: `${testModuleRealm}chain`,
|
|
1798
|
+
name: "Chain"
|
|
1799
|
+
} }
|
|
1800
|
+
} },
|
|
1801
|
+
"Chain/2.json": { data: {
|
|
1802
|
+
id: `${testRealmURL}Chain/2`,
|
|
1803
|
+
attributes: { name: "Polygon" },
|
|
1804
|
+
meta: { adoptsFrom: {
|
|
1805
|
+
module: `${testModuleRealm}chain`,
|
|
1806
|
+
name: "Chain"
|
|
1807
|
+
} }
|
|
1808
|
+
} }
|
|
1809
|
+
}
|
|
1810
|
+
});
|
|
1811
|
+
let vendor = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Vendor/vendor1`), { loadLinks: true });
|
|
1812
|
+
if (vendor?.type === "doc") assert.deepEqual(vendor.doc, {
|
|
1813
|
+
data: {
|
|
1814
|
+
id: testRRI("Vendor/vendor1"),
|
|
1815
|
+
type: "card",
|
|
1816
|
+
links: { self: "./vendor1" },
|
|
1817
|
+
attributes: {
|
|
1818
|
+
name: "Acme Industries",
|
|
1819
|
+
cardTitle: "Acme Industries",
|
|
1820
|
+
cardDescription: "Vendor",
|
|
1821
|
+
cardThumbnailURL: null,
|
|
1822
|
+
paymentMethods: [{
|
|
1823
|
+
type: "crypto",
|
|
1824
|
+
payment: { address: "0x1111" }
|
|
1825
|
+
}, {
|
|
1826
|
+
type: "crypto",
|
|
1827
|
+
payment: { address: "0x2222" }
|
|
1828
|
+
}],
|
|
1829
|
+
cardInfo
|
|
1830
|
+
},
|
|
1831
|
+
relationships: {
|
|
1832
|
+
"paymentMethods.0.payment.chain": {
|
|
1833
|
+
data: {
|
|
1834
|
+
id: `${testRealmURL}Chain/1`,
|
|
1835
|
+
type: "card"
|
|
1836
|
+
},
|
|
1837
|
+
links: { self: `../Chain/1` }
|
|
1838
|
+
},
|
|
1839
|
+
"paymentMethods.1.payment.chain": {
|
|
1840
|
+
data: {
|
|
1841
|
+
id: `${testRealmURL}Chain/2`,
|
|
1842
|
+
type: "card"
|
|
1843
|
+
},
|
|
1844
|
+
links: { self: `../Chain/2` }
|
|
1845
|
+
}
|
|
1846
|
+
},
|
|
1847
|
+
meta: {
|
|
1848
|
+
adoptsFrom: {
|
|
1849
|
+
module: rri(`${testModuleRealm}vendor`),
|
|
1850
|
+
name: "Vendor"
|
|
1851
|
+
},
|
|
1852
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Vendor/vendor1.json`),
|
|
1853
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Vendor/vendor1.json"),
|
|
1854
|
+
realmURL: ri("http://test-realm/test/"),
|
|
1855
|
+
realmInfo: {
|
|
1856
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
1857
|
+
backgroundURL: null,
|
|
1858
|
+
iconURL: null,
|
|
1859
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
1860
|
+
lastPublishedAt: null,
|
|
1861
|
+
name: "Unnamed Workspace",
|
|
1862
|
+
publishable: null,
|
|
1863
|
+
realmUserId: "@realm_server:localhost",
|
|
1864
|
+
showAsCatalog: null,
|
|
1865
|
+
visibility: "public"
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
included: [{
|
|
1870
|
+
id: testRRI("Chain/1"),
|
|
1871
|
+
type: "card",
|
|
1872
|
+
links: { self: `./1` },
|
|
1873
|
+
attributes: {
|
|
1874
|
+
name: "Ethereum Mainnet",
|
|
1875
|
+
cardTitle: "Ethereum Mainnet",
|
|
1876
|
+
chainId: 1,
|
|
1877
|
+
cardDescription: `Chain 1`,
|
|
1878
|
+
cardThumbnailURL: `Ethereum Mainnet-icon.png`,
|
|
1879
|
+
cardInfo
|
|
1880
|
+
},
|
|
1881
|
+
meta: {
|
|
1882
|
+
adoptsFrom: {
|
|
1883
|
+
module: rri(`${testModuleRealm}chain`),
|
|
1884
|
+
name: "Chain"
|
|
1885
|
+
},
|
|
1886
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Chain/1.json`),
|
|
1887
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Chain/1.json"),
|
|
1888
|
+
realmURL: ri("http://test-realm/test/"),
|
|
1889
|
+
realmInfo: {
|
|
1890
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
1891
|
+
backgroundURL: null,
|
|
1892
|
+
iconURL: null,
|
|
1893
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
1894
|
+
lastPublishedAt: null,
|
|
1895
|
+
name: "Unnamed Workspace",
|
|
1896
|
+
publishable: null,
|
|
1897
|
+
realmUserId: "@realm_server:localhost",
|
|
1898
|
+
showAsCatalog: null,
|
|
1899
|
+
visibility: "public"
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
}, {
|
|
1903
|
+
id: testRRI("Chain/2"),
|
|
1904
|
+
type: "card",
|
|
1905
|
+
links: { self: `./2` },
|
|
1906
|
+
attributes: {
|
|
1907
|
+
name: "Polygon",
|
|
1908
|
+
cardTitle: "Polygon",
|
|
1909
|
+
chainId: 137,
|
|
1910
|
+
cardDescription: `Chain 137`,
|
|
1911
|
+
cardThumbnailURL: `Polygon-icon.png`,
|
|
1912
|
+
cardInfo
|
|
1913
|
+
},
|
|
1914
|
+
meta: {
|
|
1915
|
+
adoptsFrom: {
|
|
1916
|
+
module: rri(`${testModuleRealm}chain`),
|
|
1917
|
+
name: "Chain"
|
|
1918
|
+
},
|
|
1919
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Chain/2.json`),
|
|
1920
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Chain/2.json"),
|
|
1921
|
+
realmURL: ri("http://test-realm/test/"),
|
|
1922
|
+
realmInfo: {
|
|
1923
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
1924
|
+
backgroundURL: null,
|
|
1925
|
+
iconURL: null,
|
|
1926
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
1927
|
+
lastPublishedAt: null,
|
|
1928
|
+
name: "Unnamed Workspace",
|
|
1929
|
+
publishable: null,
|
|
1930
|
+
realmUserId: "@realm_server:localhost",
|
|
1931
|
+
showAsCatalog: null,
|
|
1932
|
+
visibility: "public"
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
}]
|
|
1936
|
+
});
|
|
1937
|
+
else assert.ok(false, `search entry was an error: ${vendor?.error.errorDetail.message}`);
|
|
1938
|
+
});
|
|
1939
|
+
(0, import_qunit.test)("can tolerate a card whose computed throws an exception", async function(assert) {
|
|
1940
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1941
|
+
mockMatrixUtils,
|
|
1942
|
+
contents: {
|
|
1943
|
+
"Boom/boom.json": { data: {
|
|
1944
|
+
id: `${testRealmURL}Boom/boom`,
|
|
1945
|
+
meta: { adoptsFrom: {
|
|
1946
|
+
module: `${testModuleRealm}card-with-error`,
|
|
1947
|
+
name: "Boom"
|
|
1948
|
+
} }
|
|
1949
|
+
} },
|
|
1950
|
+
"Person/owner.json": { data: {
|
|
1951
|
+
id: `${testRealmURL}Person/owner`,
|
|
1952
|
+
attributes: { firstName: "Hassan" },
|
|
1953
|
+
meta: { adoptsFrom: {
|
|
1954
|
+
module: `${testModuleRealm}person`,
|
|
1955
|
+
name: "Person"
|
|
1956
|
+
} }
|
|
1957
|
+
} }
|
|
1958
|
+
}
|
|
1959
|
+
});
|
|
1960
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
1961
|
+
{
|
|
1962
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}Boom/boom`));
|
|
1963
|
+
if (card?.type === "error") assert.ok(card.error.errorDetail.message.includes("intentional error thrown"), "error doc includes raised error message");
|
|
1964
|
+
else assert.ok(false, `expected search entry to be an error doc`);
|
|
1965
|
+
}
|
|
1966
|
+
{
|
|
1967
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}Person/owner`));
|
|
1968
|
+
if (card?.type === "doc") assert.strictEqual(card.doc.data.attributes?.firstName, "Hassan");
|
|
1969
|
+
else assert.ok(false, `search entry was an error: ${card?.error.errorDetail.message}`);
|
|
1970
|
+
}
|
|
1971
|
+
});
|
|
1972
|
+
(0, import_qunit.test)(`search doc includes 'contains' and used 'linksTo' fields, including contained computed fields`, async function(assert) {
|
|
1973
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1974
|
+
mockMatrixUtils,
|
|
1975
|
+
contents: {
|
|
1976
|
+
"Pet/mango.json": { data: {
|
|
1977
|
+
attributes: { firstName: "Mango" },
|
|
1978
|
+
relationships: { owner: { links: { self: `../Person/hassan` } } },
|
|
1979
|
+
meta: { adoptsFrom: {
|
|
1980
|
+
module: `${testModuleRealm}pet`,
|
|
1981
|
+
name: "Pet"
|
|
1982
|
+
} }
|
|
1983
|
+
} },
|
|
1984
|
+
"Person/hassan.json": { data: {
|
|
1985
|
+
id: `${testRealmURL}Person/hassan`,
|
|
1986
|
+
attributes: {
|
|
1987
|
+
firstName: "Hassan",
|
|
1988
|
+
lastName: "Abdel-Rahman",
|
|
1989
|
+
email: "hassan@cardstack.com",
|
|
1990
|
+
posts: 100
|
|
1991
|
+
},
|
|
1992
|
+
meta: { adoptsFrom: {
|
|
1993
|
+
module: `${testModuleRealm}person`,
|
|
1994
|
+
name: "Person"
|
|
1995
|
+
} }
|
|
1996
|
+
} }
|
|
1997
|
+
}
|
|
1998
|
+
});
|
|
1999
|
+
expectSearchDoc(assert, (await getInstance(realm, new URL(`${testRealmURL}Person/hassan`)))?.searchDoc, {
|
|
2000
|
+
id: `${testRealmURL}Person/hassan`,
|
|
2001
|
+
firstName: "Hassan",
|
|
2002
|
+
lastName: "Abdel-Rahman",
|
|
2003
|
+
email: "hassan@cardstack.com",
|
|
2004
|
+
posts: 100,
|
|
2005
|
+
cardTitle: "Hassan Abdel-Rahman",
|
|
2006
|
+
cardDescription: "Person",
|
|
2007
|
+
fullName: "Hassan Abdel-Rahman",
|
|
2008
|
+
_cardType: "Person",
|
|
2009
|
+
cardTheme: null,
|
|
2010
|
+
cardInfo: {
|
|
2011
|
+
cardThumbnail: null,
|
|
2012
|
+
theme: null
|
|
2013
|
+
}
|
|
2014
|
+
}, `search doc includes fullName field`);
|
|
2015
|
+
});
|
|
2016
|
+
(0, import_qunit.test)(`search doc includes a 'linksTo' field the render never loaded when it is searchable`, async function(assert) {
|
|
2017
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
2018
|
+
mockMatrixUtils,
|
|
2019
|
+
contents: {
|
|
2020
|
+
"Publication/pacific.json": { data: {
|
|
2021
|
+
id: `${testRealmURL}Publication/pacific`,
|
|
2022
|
+
attributes: { cardTitle: "Pacific Weekly" },
|
|
2023
|
+
relationships: {
|
|
2024
|
+
"featuredPosts.0": { links: { self: `../Post/1` } },
|
|
2025
|
+
"featuredPosts.1": { links: { self: `../Post/2` } }
|
|
2026
|
+
},
|
|
2027
|
+
meta: { adoptsFrom: {
|
|
2028
|
+
module: `${testModuleRealm}publication`,
|
|
2029
|
+
name: "Publication"
|
|
2030
|
+
} }
|
|
2031
|
+
} },
|
|
2032
|
+
"Post/1.json": { data: {
|
|
2033
|
+
id: `${testRealmURL}Post/1`,
|
|
2034
|
+
attributes: {
|
|
2035
|
+
cardTitle: "50 Ways to Leave Your Laptop",
|
|
2036
|
+
views: 5
|
|
2037
|
+
},
|
|
2038
|
+
relationships: { publication: { links: { self: `../Publication/pacific` } } },
|
|
2039
|
+
meta: { adoptsFrom: {
|
|
2040
|
+
module: `${testModuleRealm}post`,
|
|
2041
|
+
name: "Post"
|
|
2042
|
+
} }
|
|
2043
|
+
} },
|
|
2044
|
+
"Post/2.json": { data: {
|
|
2045
|
+
id: `${testRealmURL}Post/2`,
|
|
2046
|
+
attributes: {
|
|
2047
|
+
cardTitle: "49 Shades of Mauve",
|
|
2048
|
+
views: 24
|
|
2049
|
+
},
|
|
2050
|
+
relationships: { publication: { links: { self: `../Publication/pacific` } } },
|
|
2051
|
+
meta: { adoptsFrom: {
|
|
2052
|
+
module: `${testModuleRealm}post`,
|
|
2053
|
+
name: "Post"
|
|
2054
|
+
} }
|
|
2055
|
+
} }
|
|
2056
|
+
}
|
|
2057
|
+
});
|
|
2058
|
+
expectSearchDoc(assert, (await getInstance(realm, new URL(`${testRealmURL}Post/1`)))?.searchDoc, {
|
|
2059
|
+
_cardType: "Post",
|
|
2060
|
+
author: {
|
|
2061
|
+
cardDescription: "Person",
|
|
2062
|
+
fullName: " ",
|
|
2063
|
+
cardTitle: " "
|
|
2064
|
+
},
|
|
2065
|
+
id: `${testRealmURL}Post/1`,
|
|
2066
|
+
cardTitle: "50 Ways to Leave Your Laptop",
|
|
2067
|
+
publication: { id: `${testRealmURL}Publication/pacific` },
|
|
2068
|
+
views: 5,
|
|
2069
|
+
cardTheme: null,
|
|
2070
|
+
cardInfo: {
|
|
2071
|
+
cardThumbnail: null,
|
|
2072
|
+
theme: null
|
|
2073
|
+
}
|
|
2074
|
+
}, `post 1 search doc includes publication relationship`);
|
|
2075
|
+
expectSearchDoc(assert, (await getInstance(realm, new URL(`${testRealmURL}Publication/pacific`)))?.searchDoc, {
|
|
2076
|
+
_cardType: "Publication",
|
|
2077
|
+
id: `${testRealmURL}Publication/pacific`,
|
|
2078
|
+
cardTitle: "Pacific Weekly",
|
|
2079
|
+
featuredPosts: [{
|
|
2080
|
+
author: {
|
|
2081
|
+
cardDescription: "Person",
|
|
2082
|
+
fullName: " ",
|
|
2083
|
+
cardTitle: " "
|
|
2084
|
+
},
|
|
2085
|
+
cardTheme: null,
|
|
2086
|
+
cardInfo: {
|
|
2087
|
+
cardThumbnail: null,
|
|
2088
|
+
theme: null
|
|
2089
|
+
},
|
|
2090
|
+
id: `${testRealmURL}Post/1`,
|
|
2091
|
+
publication: { id: `${testRealmURL}Publication/pacific` },
|
|
2092
|
+
cardTitle: "50 Ways to Leave Your Laptop",
|
|
2093
|
+
views: 5
|
|
2094
|
+
}, {
|
|
2095
|
+
author: {
|
|
2096
|
+
cardDescription: "Person",
|
|
2097
|
+
fullName: " ",
|
|
2098
|
+
cardTitle: " "
|
|
2099
|
+
},
|
|
2100
|
+
cardTheme: null,
|
|
2101
|
+
cardInfo: {
|
|
2102
|
+
cardThumbnail: null,
|
|
2103
|
+
theme: null
|
|
2104
|
+
},
|
|
2105
|
+
id: `${testRealmURL}Post/2`,
|
|
2106
|
+
publication: { id: `${testRealmURL}Publication/pacific` },
|
|
2107
|
+
cardTitle: "49 Shades of Mauve",
|
|
2108
|
+
views: 24
|
|
2109
|
+
}],
|
|
2110
|
+
cardTheme: null,
|
|
2111
|
+
cardInfo: {
|
|
2112
|
+
cardThumbnail: null,
|
|
2113
|
+
theme: null
|
|
2114
|
+
}
|
|
2115
|
+
}, `publication search doc includes featuredPosts relationship via its searchable annotation`);
|
|
2116
|
+
});
|
|
2117
|
+
(0, import_qunit.test)("search doc normalizes containsMany composite fields", async function(assert) {
|
|
2118
|
+
class Person extends FieldDef {
|
|
2119
|
+
static {
|
|
2120
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
2121
|
+
return contains(string_default);
|
|
2122
|
+
});
|
|
2123
|
+
}
|
|
2124
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
2125
|
+
static {
|
|
2126
|
+
decorateFieldV2(this.prototype, "lastName", [field], function() {
|
|
2127
|
+
return contains(string_default);
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
#lastName = (initializeDeferredDecorator(this, "lastName"), void 0);
|
|
2131
|
+
static {
|
|
2132
|
+
decorateFieldV2(this.prototype, "email", [field], function() {
|
|
2133
|
+
return contains(string_default);
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
#email = (initializeDeferredDecorator(this, "email"), void 0);
|
|
2137
|
+
static {
|
|
2138
|
+
decorateFieldV2(this.prototype, "posts", [field], function() {
|
|
2139
|
+
return contains(NumberField);
|
|
2140
|
+
});
|
|
2141
|
+
}
|
|
2142
|
+
#posts = (initializeDeferredDecorator(this, "posts"), void 0);
|
|
2143
|
+
static {
|
|
2144
|
+
decorateFieldV2(this.prototype, "fullName", [field], function() {
|
|
2145
|
+
return contains(string_default, { computeVia: function() {
|
|
2146
|
+
return `${this.firstName ?? ""} ${this.lastName ?? ""}`;
|
|
2147
|
+
} });
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
#fullName = (initializeDeferredDecorator(this, "fullName"), void 0);
|
|
2151
|
+
static {
|
|
2152
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
2153
|
+
return contains(string_default, { computeVia: function() {
|
|
2154
|
+
return `${this.firstName ?? ""} ${this.lastName ?? ""}`;
|
|
2155
|
+
} });
|
|
2156
|
+
});
|
|
2157
|
+
}
|
|
2158
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
2159
|
+
static {
|
|
2160
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
2161
|
+
return contains(string_default, { computeVia: () => "Person" });
|
|
2162
|
+
});
|
|
2163
|
+
}
|
|
2164
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
2165
|
+
}
|
|
2166
|
+
class Post extends FieldDef {
|
|
2167
|
+
static {
|
|
2168
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
2169
|
+
return contains(string_default);
|
|
2170
|
+
});
|
|
2171
|
+
}
|
|
2172
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
2173
|
+
static {
|
|
2174
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
2175
|
+
return contains(string_default);
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
2179
|
+
static {
|
|
2180
|
+
decorateFieldV2(this.prototype, "author", [field], function() {
|
|
2181
|
+
return contains(Person);
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
#author = (initializeDeferredDecorator(this, "author"), void 0);
|
|
2185
|
+
static {
|
|
2186
|
+
decorateFieldV2(this.prototype, "views", [field], function() {
|
|
2187
|
+
return contains(NumberField);
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
#views = (initializeDeferredDecorator(this, "views"), void 0);
|
|
2191
|
+
static {
|
|
2192
|
+
decorateFieldV2(this.prototype, "createdAt", [field], function() {
|
|
2193
|
+
return contains(DateTimeField);
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2196
|
+
#createdAt = (initializeDeferredDecorator(this, "createdAt"), void 0);
|
|
2197
|
+
}
|
|
2198
|
+
class Booking extends FieldDef {
|
|
2199
|
+
static {
|
|
2200
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
2201
|
+
return contains(string_default);
|
|
2202
|
+
});
|
|
2203
|
+
}
|
|
2204
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
2205
|
+
static {
|
|
2206
|
+
decorateFieldV2(this.prototype, "venue", [field], function() {
|
|
2207
|
+
return contains(string_default);
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
#venue = (initializeDeferredDecorator(this, "venue"), void 0);
|
|
2211
|
+
static {
|
|
2212
|
+
decorateFieldV2(this.prototype, "startTime", [field], function() {
|
|
2213
|
+
return contains(DateTimeField);
|
|
2214
|
+
});
|
|
2215
|
+
}
|
|
2216
|
+
#startTime = (initializeDeferredDecorator(this, "startTime"), void 0);
|
|
2217
|
+
static {
|
|
2218
|
+
decorateFieldV2(this.prototype, "endTime", [field], function() {
|
|
2219
|
+
return contains(DateTimeField);
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
#endTime = (initializeDeferredDecorator(this, "endTime"), void 0);
|
|
2223
|
+
static {
|
|
2224
|
+
decorateFieldV2(this.prototype, "hosts", [field], function() {
|
|
2225
|
+
return containsMany(Person);
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
#hosts = (initializeDeferredDecorator(this, "hosts"), void 0);
|
|
2229
|
+
static {
|
|
2230
|
+
decorateFieldV2(this.prototype, "sponsors", [field], function() {
|
|
2231
|
+
return containsMany(string_default);
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
#sponsors = (initializeDeferredDecorator(this, "sponsors"), void 0);
|
|
2235
|
+
static {
|
|
2236
|
+
decorateFieldV2(this.prototype, "posts", [field], function() {
|
|
2237
|
+
return containsMany(Post);
|
|
2238
|
+
});
|
|
2239
|
+
}
|
|
2240
|
+
#posts = (initializeDeferredDecorator(this, "posts"), void 0);
|
|
2241
|
+
static {
|
|
2242
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
2243
|
+
return contains(string_default, { computeVia: function() {
|
|
2244
|
+
return this.venue;
|
|
2245
|
+
} });
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2248
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
2249
|
+
static {
|
|
2250
|
+
decorateFieldV2(this.prototype, "cardThumbnailURL", [field], function() {
|
|
2251
|
+
return contains(string_default, { computeVia: () => null });
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
#cardThumbnailURL = (initializeDeferredDecorator(this, "cardThumbnailURL"), void 0);
|
|
2255
|
+
}
|
|
2256
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
2257
|
+
mockMatrixUtils,
|
|
2258
|
+
contents: {
|
|
2259
|
+
"booking.gts": { Booking },
|
|
2260
|
+
"person.gts": { Person },
|
|
2261
|
+
"post.gts": { Post },
|
|
2262
|
+
"Spec/booking.json": { data: {
|
|
2263
|
+
attributes: {
|
|
2264
|
+
cardTitle: "Booking",
|
|
2265
|
+
cardDescription: "Spec for Booking",
|
|
2266
|
+
specType: "card",
|
|
2267
|
+
ref: {
|
|
2268
|
+
module: `${testModuleRealm}booking`,
|
|
2269
|
+
name: "Booking"
|
|
2270
|
+
}
|
|
2271
|
+
},
|
|
2272
|
+
meta: { adoptsFrom: {
|
|
2273
|
+
module: "@cardstack/base/spec",
|
|
2274
|
+
name: "Spec"
|
|
2275
|
+
} }
|
|
2276
|
+
} }
|
|
2277
|
+
}
|
|
2278
|
+
});
|
|
2279
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}Spec/booking`));
|
|
2280
|
+
expectSearchDoc(assert, entry?.searchDoc, {
|
|
2281
|
+
_cardType: "Spec",
|
|
2282
|
+
id: `${testRealmURL}Spec/booking`,
|
|
2283
|
+
cardDescription: "Spec for Booking",
|
|
2284
|
+
specType: "card",
|
|
2285
|
+
moduleHref: `${testModuleRealm}booking`,
|
|
2286
|
+
containedExamples: null,
|
|
2287
|
+
linkedExamples: null,
|
|
2288
|
+
fileExamples: null,
|
|
2289
|
+
ref: `${testModuleRealm}booking/Booking`,
|
|
2290
|
+
cardTitle: "Booking",
|
|
2291
|
+
isCard: true,
|
|
2292
|
+
isComponent: false,
|
|
2293
|
+
isField: false,
|
|
2294
|
+
isFile: false,
|
|
2295
|
+
cardTheme: null,
|
|
2296
|
+
cardInfo: {
|
|
2297
|
+
cardThumbnail: null,
|
|
2298
|
+
theme: null
|
|
2299
|
+
}
|
|
2300
|
+
});
|
|
2301
|
+
structuredClone(entry?.searchDoc);
|
|
2302
|
+
});
|
|
2303
|
+
(0, import_qunit.test)("can index a card with linksToMany field", async function(assert) {
|
|
2304
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2305
|
+
mockMatrixUtils,
|
|
2306
|
+
contents: {
|
|
2307
|
+
"Pet/vanGogh.json": { data: {
|
|
2308
|
+
attributes: { firstName: "Van Gogh" },
|
|
2309
|
+
meta: { adoptsFrom: {
|
|
2310
|
+
module: `${testModuleRealm}pet`,
|
|
2311
|
+
name: "Pet"
|
|
2312
|
+
} }
|
|
2313
|
+
} },
|
|
2314
|
+
"PetPerson/hassan.json": { data: {
|
|
2315
|
+
attributes: { firstName: "Hassan" },
|
|
2316
|
+
relationships: {
|
|
2317
|
+
"pets.0": { links: { self: `../Pet/mango` } },
|
|
2318
|
+
"pets.1": { links: { self: `../Pet/vanGogh` } }
|
|
2319
|
+
},
|
|
2320
|
+
meta: { adoptsFrom: {
|
|
2321
|
+
module: `${testModuleRealm}pet-person`,
|
|
2322
|
+
name: "PetPerson"
|
|
2323
|
+
} }
|
|
2324
|
+
} },
|
|
2325
|
+
"Pet/mango.json": { data: {
|
|
2326
|
+
attributes: { firstName: "Mango" },
|
|
2327
|
+
meta: { adoptsFrom: {
|
|
2328
|
+
module: `${testModuleRealm}pet`,
|
|
2329
|
+
name: "Pet"
|
|
2330
|
+
} }
|
|
2331
|
+
} }
|
|
2332
|
+
}
|
|
2333
|
+
});
|
|
2334
|
+
let hassan = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}PetPerson/hassan`), { loadLinks: true });
|
|
2335
|
+
if (hassan?.type === "doc") {
|
|
2336
|
+
assert.deepEqual(hassan.doc.data, {
|
|
2337
|
+
id: testRRI("PetPerson/hassan"),
|
|
2338
|
+
type: "card",
|
|
2339
|
+
links: { self: "./hassan" },
|
|
2340
|
+
attributes: {
|
|
2341
|
+
firstName: "Hassan",
|
|
2342
|
+
cardTitle: "Hassan Pet Person",
|
|
2343
|
+
cardDescription: "A person with pets",
|
|
2344
|
+
cardThumbnailURL: null,
|
|
2345
|
+
cardInfo
|
|
2346
|
+
},
|
|
2347
|
+
relationships: {
|
|
2348
|
+
"pets.0": {
|
|
2349
|
+
links: { self: `../Pet/mango` },
|
|
2350
|
+
data: {
|
|
2351
|
+
id: `${testRealmURL}Pet/mango`,
|
|
2352
|
+
type: "card"
|
|
2353
|
+
}
|
|
2354
|
+
},
|
|
2355
|
+
"pets.1": {
|
|
2356
|
+
links: { self: `../Pet/vanGogh` },
|
|
2357
|
+
data: {
|
|
2358
|
+
id: `${testRealmURL}Pet/vanGogh`,
|
|
2359
|
+
type: "card"
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
},
|
|
2363
|
+
meta: {
|
|
2364
|
+
adoptsFrom: {
|
|
2365
|
+
module: testModuleRRI("pet-person"),
|
|
2366
|
+
name: "PetPerson"
|
|
2367
|
+
},
|
|
2368
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}PetPerson/hassan.json`),
|
|
2369
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "PetPerson/hassan.json"),
|
|
2370
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2371
|
+
realmInfo: {
|
|
2372
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
2373
|
+
backgroundURL: null,
|
|
2374
|
+
iconURL: null,
|
|
2375
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2376
|
+
lastPublishedAt: null,
|
|
2377
|
+
name: "Unnamed Workspace",
|
|
2378
|
+
publishable: null,
|
|
2379
|
+
realmUserId: "@realm_server:localhost",
|
|
2380
|
+
showAsCatalog: null,
|
|
2381
|
+
visibility: "public"
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2385
|
+
assert.deepEqual(hassan.doc.included, [{
|
|
2386
|
+
id: testRRI("Pet/mango"),
|
|
2387
|
+
type: "card",
|
|
2388
|
+
links: { self: `./mango` },
|
|
2389
|
+
attributes: {
|
|
2390
|
+
cardDescription: null,
|
|
2391
|
+
firstName: "Mango",
|
|
2392
|
+
cardTitle: "Mango",
|
|
2393
|
+
cardThumbnailURL: null,
|
|
2394
|
+
cardInfo
|
|
2395
|
+
},
|
|
2396
|
+
meta: {
|
|
2397
|
+
adoptsFrom: {
|
|
2398
|
+
module: testModuleRRI("pet"),
|
|
2399
|
+
name: "Pet"
|
|
2400
|
+
},
|
|
2401
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/mango.json`),
|
|
2402
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/mango.json"),
|
|
2403
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2404
|
+
realmInfo: {
|
|
2405
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
2406
|
+
backgroundURL: null,
|
|
2407
|
+
iconURL: null,
|
|
2408
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2409
|
+
lastPublishedAt: null,
|
|
2410
|
+
name: "Unnamed Workspace",
|
|
2411
|
+
publishable: null,
|
|
2412
|
+
realmUserId: "@realm_server:localhost",
|
|
2413
|
+
showAsCatalog: null,
|
|
2414
|
+
visibility: "public"
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
}, {
|
|
2418
|
+
id: testRRI("Pet/vanGogh"),
|
|
2419
|
+
type: "card",
|
|
2420
|
+
links: { self: `./vanGogh` },
|
|
2421
|
+
attributes: {
|
|
2422
|
+
cardDescription: null,
|
|
2423
|
+
firstName: "Van Gogh",
|
|
2424
|
+
cardTitle: "Van Gogh",
|
|
2425
|
+
cardThumbnailURL: null,
|
|
2426
|
+
cardInfo
|
|
2427
|
+
},
|
|
2428
|
+
meta: {
|
|
2429
|
+
adoptsFrom: {
|
|
2430
|
+
module: testModuleRRI("pet"),
|
|
2431
|
+
name: "Pet"
|
|
2432
|
+
},
|
|
2433
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/vanGogh.json`),
|
|
2434
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/vanGogh.json"),
|
|
2435
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2436
|
+
realmInfo: {
|
|
2437
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
2438
|
+
backgroundURL: null,
|
|
2439
|
+
iconURL: null,
|
|
2440
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2441
|
+
lastPublishedAt: null,
|
|
2442
|
+
name: "Unnamed Workspace",
|
|
2443
|
+
publishable: null,
|
|
2444
|
+
realmUserId: "@realm_server:localhost",
|
|
2445
|
+
showAsCatalog: null,
|
|
2446
|
+
visibility: "public"
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
}]);
|
|
2450
|
+
} else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
2451
|
+
let hassanEntry = await getInstance(realm, new URL(`${testRealmURL}PetPerson/hassan`));
|
|
2452
|
+
if (hassanEntry) expectSearchDoc(assert, hassanEntry.searchDoc, {
|
|
2453
|
+
_cardType: "Pet Person",
|
|
2454
|
+
id: `${testRealmURL}PetPerson/hassan`,
|
|
2455
|
+
firstName: "Hassan",
|
|
2456
|
+
pets: [{
|
|
2457
|
+
id: `${testRealmURL}Pet/mango`,
|
|
2458
|
+
firstName: "Mango",
|
|
2459
|
+
owner: null,
|
|
2460
|
+
cardTitle: "Mango",
|
|
2461
|
+
cardTheme: null,
|
|
2462
|
+
cardInfo: {
|
|
2463
|
+
cardThumbnail: null,
|
|
2464
|
+
theme: null
|
|
2465
|
+
}
|
|
2466
|
+
}, {
|
|
2467
|
+
id: `${testRealmURL}Pet/vanGogh`,
|
|
2468
|
+
firstName: "Van Gogh",
|
|
2469
|
+
owner: null,
|
|
2470
|
+
cardTitle: "Van Gogh",
|
|
2471
|
+
cardTheme: null,
|
|
2472
|
+
cardInfo: {
|
|
2473
|
+
cardThumbnail: null,
|
|
2474
|
+
theme: null
|
|
2475
|
+
}
|
|
2476
|
+
}],
|
|
2477
|
+
friend: null,
|
|
2478
|
+
cardTitle: "Hassan Pet Person",
|
|
2479
|
+
cardDescription: "A person with pets",
|
|
2480
|
+
cardThumbnailURL: null,
|
|
2481
|
+
cardTheme: null,
|
|
2482
|
+
cardInfo: {
|
|
2483
|
+
cardThumbnail: null,
|
|
2484
|
+
theme: null
|
|
2485
|
+
}
|
|
2486
|
+
});
|
|
2487
|
+
else assert.ok(false, `could not find ${testRealmURL}PetPerson/hassan in the index`);
|
|
2488
|
+
});
|
|
2489
|
+
(0, import_qunit.test)("can index a card with empty linksToMany field value", async function(assert) {
|
|
2490
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2491
|
+
mockMatrixUtils,
|
|
2492
|
+
contents: { "PetPerson/burcu.json": { data: {
|
|
2493
|
+
attributes: { firstName: "Burcu" },
|
|
2494
|
+
meta: { adoptsFrom: {
|
|
2495
|
+
module: `${testModuleRealm}pet-person`,
|
|
2496
|
+
name: "PetPerson"
|
|
2497
|
+
} }
|
|
2498
|
+
} } }
|
|
2499
|
+
});
|
|
2500
|
+
let card = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}PetPerson/burcu`), { loadLinks: true });
|
|
2501
|
+
if (card?.type === "doc") assert.deepEqual(card.doc, { data: {
|
|
2502
|
+
id: testRRI("PetPerson/burcu"),
|
|
2503
|
+
type: "card",
|
|
2504
|
+
links: { self: "./burcu" },
|
|
2505
|
+
attributes: {
|
|
2506
|
+
firstName: "Burcu",
|
|
2507
|
+
cardTitle: "Burcu Pet Person",
|
|
2508
|
+
cardDescription: "A person with pets",
|
|
2509
|
+
cardThumbnailURL: null,
|
|
2510
|
+
cardInfo
|
|
2511
|
+
},
|
|
2512
|
+
meta: {
|
|
2513
|
+
adoptsFrom: {
|
|
2514
|
+
module: testModuleRRI("pet-person"),
|
|
2515
|
+
name: "PetPerson"
|
|
2516
|
+
},
|
|
2517
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}PetPerson/burcu.json`),
|
|
2518
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "PetPerson/burcu.json"),
|
|
2519
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2520
|
+
realmInfo: {
|
|
2521
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
2522
|
+
backgroundURL: null,
|
|
2523
|
+
iconURL: null,
|
|
2524
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2525
|
+
lastPublishedAt: null,
|
|
2526
|
+
name: "Unnamed Workspace",
|
|
2527
|
+
publishable: null,
|
|
2528
|
+
realmUserId: "@realm_server:localhost",
|
|
2529
|
+
showAsCatalog: null,
|
|
2530
|
+
visibility: "public"
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
} });
|
|
2534
|
+
else assert.ok(false, `search entry was an error: ${card?.error.errorDetail.message}`);
|
|
2535
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}PetPerson/burcu`));
|
|
2536
|
+
if (entry) expectSearchDoc(assert, entry.searchDoc, {
|
|
2537
|
+
_cardType: "Pet Person",
|
|
2538
|
+
id: `${testRealmURL}PetPerson/burcu`,
|
|
2539
|
+
firstName: "Burcu",
|
|
2540
|
+
pets: null,
|
|
2541
|
+
friend: null,
|
|
2542
|
+
cardTitle: "Burcu Pet Person",
|
|
2543
|
+
cardDescription: "A person with pets",
|
|
2544
|
+
cardThumbnailURL: null,
|
|
2545
|
+
cardTheme: null,
|
|
2546
|
+
cardInfo: {
|
|
2547
|
+
cardThumbnail: null,
|
|
2548
|
+
theme: null
|
|
2549
|
+
}
|
|
2550
|
+
});
|
|
2551
|
+
else assert.ok(false, `could not find ${testRealmURL}PetPerson/burcu in the index`);
|
|
2552
|
+
});
|
|
2553
|
+
(0, import_qunit.test)("can index a card that contains a field with a linksToMany field", async function(assert) {
|
|
2554
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2555
|
+
mockMatrixUtils,
|
|
2556
|
+
contents: {
|
|
2557
|
+
"Pet/vanGogh.json": { data: {
|
|
2558
|
+
attributes: { firstName: "Van Gogh" },
|
|
2559
|
+
meta: { adoptsFrom: {
|
|
2560
|
+
module: `${testModuleRealm}pet`,
|
|
2561
|
+
name: "Pet"
|
|
2562
|
+
} }
|
|
2563
|
+
} },
|
|
2564
|
+
"pet-person-spec.json": { data: {
|
|
2565
|
+
attributes: {
|
|
2566
|
+
cardTitle: "PetPerson",
|
|
2567
|
+
cardDescription: "Spec for PetPerson",
|
|
2568
|
+
specType: "card",
|
|
2569
|
+
ref: {
|
|
2570
|
+
module: `${testModuleRealm}pet-person`,
|
|
2571
|
+
name: "PetPerson"
|
|
2572
|
+
}
|
|
2573
|
+
},
|
|
2574
|
+
relationships: {},
|
|
2575
|
+
meta: { adoptsFrom: {
|
|
2576
|
+
module: "@cardstack/base/spec",
|
|
2577
|
+
name: "Spec"
|
|
2578
|
+
} }
|
|
2579
|
+
} },
|
|
2580
|
+
"Pet/mango.json": { data: {
|
|
2581
|
+
attributes: { firstName: "Mango" },
|
|
2582
|
+
meta: { adoptsFrom: {
|
|
2583
|
+
module: `${testModuleRealm}pet`,
|
|
2584
|
+
name: "Pet"
|
|
2585
|
+
} }
|
|
2586
|
+
} }
|
|
2587
|
+
}
|
|
2588
|
+
});
|
|
2589
|
+
let spec = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}pet-person-spec`), { loadLinks: true });
|
|
2590
|
+
if (spec?.type === "doc") assert.deepEqual(spec.doc.data, {
|
|
2591
|
+
id: testRRI("pet-person-spec"),
|
|
2592
|
+
type: "card",
|
|
2593
|
+
links: { self: "./pet-person-spec" },
|
|
2594
|
+
attributes: {
|
|
2595
|
+
cardTitle: "PetPerson",
|
|
2596
|
+
cardDescription: "Spec for PetPerson",
|
|
2597
|
+
readMe: null,
|
|
2598
|
+
cardThumbnailURL: null,
|
|
2599
|
+
ref: {
|
|
2600
|
+
module: `${testModuleRealm}pet-person`,
|
|
2601
|
+
name: "PetPerson"
|
|
2602
|
+
},
|
|
2603
|
+
specType: "card",
|
|
2604
|
+
moduleHref: `${testModuleRealm}pet-person`,
|
|
2605
|
+
containedExamples: [],
|
|
2606
|
+
isCard: true,
|
|
2607
|
+
isComponent: false,
|
|
2608
|
+
isField: false,
|
|
2609
|
+
isFile: false,
|
|
2610
|
+
cardInfo
|
|
2611
|
+
},
|
|
2612
|
+
meta: {
|
|
2613
|
+
adoptsFrom: {
|
|
2614
|
+
module: rri("@cardstack/base/spec"),
|
|
2615
|
+
name: "Spec"
|
|
2616
|
+
},
|
|
2617
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}pet-person-spec.json`),
|
|
2618
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2619
|
+
realmInfo: {
|
|
2620
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
2621
|
+
backgroundURL: null,
|
|
2622
|
+
iconURL: null,
|
|
2623
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2624
|
+
lastPublishedAt: null,
|
|
2625
|
+
name: "Unnamed Workspace",
|
|
2626
|
+
publishable: null,
|
|
2627
|
+
realmUserId: "@realm_server:localhost",
|
|
2628
|
+
showAsCatalog: null,
|
|
2629
|
+
visibility: "public"
|
|
2630
|
+
},
|
|
2631
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "pet-person-spec.json")
|
|
2632
|
+
}
|
|
2633
|
+
});
|
|
2634
|
+
else assert.ok(false, `search entry was an error: ${spec?.error.errorDetail.message}`);
|
|
2635
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}pet-person-spec`));
|
|
2636
|
+
if (entry) expectSearchDoc(assert, entry.searchDoc, {
|
|
2637
|
+
_cardType: "Spec",
|
|
2638
|
+
id: `${testRealmURL}pet-person-spec`,
|
|
2639
|
+
cardTitle: "PetPerson",
|
|
2640
|
+
cardDescription: "Spec for PetPerson",
|
|
2641
|
+
containedExamples: null,
|
|
2642
|
+
linkedExamples: null,
|
|
2643
|
+
fileExamples: null,
|
|
2644
|
+
moduleHref: `${testModuleRealm}pet-person`,
|
|
2645
|
+
ref: `${testModuleRealm}pet-person/PetPerson`,
|
|
2646
|
+
specType: "card",
|
|
2647
|
+
isCard: true,
|
|
2648
|
+
isComponent: false,
|
|
2649
|
+
isField: false,
|
|
2650
|
+
isFile: false,
|
|
2651
|
+
cardTheme: null,
|
|
2652
|
+
cardInfo: {
|
|
2653
|
+
cardThumbnail: null,
|
|
2654
|
+
theme: null
|
|
2655
|
+
}
|
|
2656
|
+
});
|
|
2657
|
+
else assert.ok(false, `could not find ${testRealmURL}pet-person-spec in the index`);
|
|
2658
|
+
});
|
|
2659
|
+
(0, import_qunit.test)("can index a card whose contained field has a query-backed link driven by a computed in that same field", async function(assert) {
|
|
2660
|
+
class Pet extends CardDef {
|
|
2661
|
+
static displayName = "Pet";
|
|
2662
|
+
static {
|
|
2663
|
+
decorateFieldV2(this.prototype, "name", [field], function() {
|
|
2664
|
+
return contains(string_default);
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
#name = (initializeDeferredDecorator(this, "name"), void 0);
|
|
2668
|
+
}
|
|
2669
|
+
class Note extends FieldDef {
|
|
2670
|
+
static {
|
|
2671
|
+
decorateFieldV2(this.prototype, "body", [field], function() {
|
|
2672
|
+
return contains(string_default);
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
#body = (initializeDeferredDecorator(this, "body"), void 0);
|
|
2676
|
+
static {
|
|
2677
|
+
decorateFieldV2(this.prototype, "mentionedIds", [field], function() {
|
|
2678
|
+
return containsMany(string_default, { computeVia: function() {
|
|
2679
|
+
return (this.body ?? "").split(/\s+/).filter((word) => word.startsWith("@")).map((word) => `${testRealmURL}Pet/${word.slice(1)}`);
|
|
2680
|
+
} });
|
|
2681
|
+
});
|
|
2682
|
+
}
|
|
2683
|
+
#mentionedIds = (initializeDeferredDecorator(this, "mentionedIds"), void 0);
|
|
2684
|
+
static {
|
|
2685
|
+
decorateFieldV2(this.prototype, "mentioned", [field], function() {
|
|
2686
|
+
return linksToMany(() => Pet, { query: { filter: { in: { id: "$this.mentionedIds" } } } });
|
|
2687
|
+
});
|
|
2688
|
+
}
|
|
2689
|
+
#mentioned = (initializeDeferredDecorator(this, "mentioned"), void 0);
|
|
2690
|
+
}
|
|
2691
|
+
class Post extends CardDef {
|
|
2692
|
+
static {
|
|
2693
|
+
decorateFieldV2(this.prototype, "note", [field], function() {
|
|
2694
|
+
return contains(Note);
|
|
2695
|
+
});
|
|
2696
|
+
}
|
|
2697
|
+
#note = (initializeDeferredDecorator(this, "note"), void 0);
|
|
2698
|
+
}
|
|
2699
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
2700
|
+
mockMatrixUtils,
|
|
2701
|
+
contents: {
|
|
2702
|
+
"test-cards.gts": {
|
|
2703
|
+
Pet,
|
|
2704
|
+
Note,
|
|
2705
|
+
Post
|
|
2706
|
+
},
|
|
2707
|
+
"Pet/mango.json": { data: {
|
|
2708
|
+
attributes: { name: "Mango" },
|
|
2709
|
+
meta: { adoptsFrom: {
|
|
2710
|
+
module: "../test-cards",
|
|
2711
|
+
name: "Pet"
|
|
2712
|
+
} }
|
|
2713
|
+
} },
|
|
2714
|
+
"post-1.json": { data: {
|
|
2715
|
+
attributes: { note: { body: "hello @mango" } },
|
|
2716
|
+
meta: { adoptsFrom: {
|
|
2717
|
+
module: "./test-cards",
|
|
2718
|
+
name: "Post"
|
|
2719
|
+
} }
|
|
2720
|
+
} }
|
|
2721
|
+
}
|
|
2722
|
+
});
|
|
2723
|
+
let post = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}post-1`), { loadLinks: true });
|
|
2724
|
+
if (post?.type === "doc") {
|
|
2725
|
+
assert.deepEqual(post.doc.data.attributes?.note?.mentionedIds, [`${testRealmURL}Pet/mango`], "the computed declared inside the contained field is in the indexed document");
|
|
2726
|
+
let mentioned = post.doc.data.relationships?.["note.mentioned"];
|
|
2727
|
+
assert.ok(mentioned?.links?.search?.startsWith(`${testRealmURL}_search?`), `the query-backed link carries links.search (got ${JSON.stringify(mentioned?.links)})`);
|
|
2728
|
+
assert.deepEqual(mentioned?.data, [{
|
|
2729
|
+
type: "card",
|
|
2730
|
+
id: `${testRealmURL}Pet/mango`
|
|
2731
|
+
}], "the query resolved the mentioned card");
|
|
2732
|
+
} else assert.ok(false, `search entry was an error: ${post?.error.errorDetail.message}`);
|
|
2733
|
+
});
|
|
2734
|
+
(0, import_qunit.test)("a computed linksToMany serializes into the indexed document", async function(assert) {
|
|
2735
|
+
class Issue extends CardDef {
|
|
2736
|
+
static displayName = "Issue";
|
|
2737
|
+
static {
|
|
2738
|
+
decorateFieldV2(this.prototype, "title", [field], function() {
|
|
2739
|
+
return contains(string_default);
|
|
2740
|
+
});
|
|
2741
|
+
}
|
|
2742
|
+
#title = (initializeDeferredDecorator(this, "title"), void 0);
|
|
2743
|
+
}
|
|
2744
|
+
class IssueTracker extends CardDef {
|
|
2745
|
+
static displayName = "IssueTracker";
|
|
2746
|
+
static {
|
|
2747
|
+
decorateFieldV2(this.prototype, "directIssues", [field], function() {
|
|
2748
|
+
return linksToMany(() => Issue);
|
|
2749
|
+
});
|
|
2750
|
+
}
|
|
2751
|
+
#directIssues = (initializeDeferredDecorator(this, "directIssues"), void 0);
|
|
2752
|
+
static {
|
|
2753
|
+
decorateFieldV2(this.prototype, "localCards", [field], function() {
|
|
2754
|
+
return linksToMany(() => Issue, { computeVia: function() {
|
|
2755
|
+
return this.directIssues;
|
|
2756
|
+
} });
|
|
2757
|
+
});
|
|
2758
|
+
}
|
|
2759
|
+
#localCards = (initializeDeferredDecorator(this, "localCards"), void 0);
|
|
2760
|
+
}
|
|
2761
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
2762
|
+
mockMatrixUtils,
|
|
2763
|
+
contents: {
|
|
2764
|
+
"test-cards.gts": {
|
|
2765
|
+
Issue,
|
|
2766
|
+
IssueTracker
|
|
2767
|
+
},
|
|
2768
|
+
"Issue/issue-1.json": { data: {
|
|
2769
|
+
attributes: { title: "First" },
|
|
2770
|
+
meta: { adoptsFrom: {
|
|
2771
|
+
module: "../test-cards",
|
|
2772
|
+
name: "Issue"
|
|
2773
|
+
} }
|
|
2774
|
+
} },
|
|
2775
|
+
"Issue/issue-2.json": { data: {
|
|
2776
|
+
attributes: { title: "Second" },
|
|
2777
|
+
meta: { adoptsFrom: {
|
|
2778
|
+
module: "../test-cards",
|
|
2779
|
+
name: "Issue"
|
|
2780
|
+
} }
|
|
2781
|
+
} },
|
|
2782
|
+
"Issue/issue-3.json": { data: {
|
|
2783
|
+
attributes: { title: "Third" },
|
|
2784
|
+
meta: { adoptsFrom: {
|
|
2785
|
+
module: "../test-cards",
|
|
2786
|
+
name: "Issue"
|
|
2787
|
+
} }
|
|
2788
|
+
} }
|
|
2789
|
+
}
|
|
2790
|
+
});
|
|
2791
|
+
let issueIds = [
|
|
2792
|
+
`${testRealmURL}Issue/issue-1`,
|
|
2793
|
+
`${testRealmURL}Issue/issue-2`,
|
|
2794
|
+
`${testRealmURL}Issue/issue-3`
|
|
2795
|
+
];
|
|
2796
|
+
await realm.write("board-1.json", JSON.stringify({ data: {
|
|
2797
|
+
relationships: {
|
|
2798
|
+
"directIssues.0": { links: { self: "./Issue/issue-1" } },
|
|
2799
|
+
"directIssues.1": { links: { self: "./Issue/issue-2" } },
|
|
2800
|
+
"directIssues.2": { links: { self: "./Issue/issue-3" } }
|
|
2801
|
+
},
|
|
2802
|
+
meta: { adoptsFrom: {
|
|
2803
|
+
module: "./test-cards",
|
|
2804
|
+
name: "IssueTracker"
|
|
2805
|
+
} }
|
|
2806
|
+
} }));
|
|
2807
|
+
let board = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}board-1`), { loadLinks: true });
|
|
2808
|
+
if (board?.type === "doc") {
|
|
2809
|
+
let relationships = board.doc.data.relationships ?? {};
|
|
2810
|
+
let linksFor = (prefix) => Object.keys(relationships).filter((key) => new RegExp(`^${prefix}\\.\\d+$`).test(key)).map((key) => relationships[key].links?.self).filter(Boolean).map((self) => new URL(self, `${testRealmURL}board-1`).href).sort();
|
|
2811
|
+
assert.deepEqual(linksFor("directIssues"), issueIds, "the authored directIssues relationship serializes");
|
|
2812
|
+
assert.deepEqual(linksFor("localCards"), issueIds, "the computed localCards relationship serializes");
|
|
2813
|
+
} else assert.ok(false, `board search entry was an error: ${board?.error.errorDetail.message}`);
|
|
2814
|
+
});
|
|
2815
|
+
(0, import_qunit.test)("a computed link that resolves to nothing is omitted from the indexed document", async function(assert) {
|
|
2816
|
+
class Tag extends CardDef {
|
|
2817
|
+
static displayName = "Tag";
|
|
2818
|
+
static {
|
|
2819
|
+
decorateFieldV2(this.prototype, "label", [field], function() {
|
|
2820
|
+
return contains(string_default);
|
|
2821
|
+
});
|
|
2822
|
+
}
|
|
2823
|
+
#label = (initializeDeferredDecorator(this, "label"), void 0);
|
|
2824
|
+
}
|
|
2825
|
+
class Board extends CardDef {
|
|
2826
|
+
static displayName = "Board";
|
|
2827
|
+
static {
|
|
2828
|
+
decorateFieldV2(this.prototype, "tags", [field], function() {
|
|
2829
|
+
return linksToMany(() => Tag);
|
|
2830
|
+
});
|
|
2831
|
+
}
|
|
2832
|
+
#tags = (initializeDeferredDecorator(this, "tags"), void 0);
|
|
2833
|
+
static {
|
|
2834
|
+
decorateFieldV2(this.prototype, "activeTags", [field], function() {
|
|
2835
|
+
return linksToMany(() => Tag, { computeVia: function() {
|
|
2836
|
+
return this.tags;
|
|
2837
|
+
} });
|
|
2838
|
+
});
|
|
2839
|
+
}
|
|
2840
|
+
#activeTags = (initializeDeferredDecorator(this, "activeTags"), void 0);
|
|
2841
|
+
static {
|
|
2842
|
+
decorateFieldV2(this.prototype, "primaryTag", [field], function() {
|
|
2843
|
+
return linksTo(() => Tag, { computeVia: function() {
|
|
2844
|
+
return this.tags[0];
|
|
2845
|
+
} });
|
|
2846
|
+
});
|
|
2847
|
+
}
|
|
2848
|
+
#primaryTag = (initializeDeferredDecorator(this, "primaryTag"), void 0);
|
|
2849
|
+
}
|
|
2850
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
2851
|
+
mockMatrixUtils,
|
|
2852
|
+
contents: { "test-cards.gts": {
|
|
2853
|
+
Tag,
|
|
2854
|
+
Board
|
|
2855
|
+
} }
|
|
2856
|
+
});
|
|
2857
|
+
await realm.write("board-empty.json", JSON.stringify({ data: { meta: { adoptsFrom: {
|
|
2858
|
+
module: "./test-cards",
|
|
2859
|
+
name: "Board"
|
|
2860
|
+
} } } }));
|
|
2861
|
+
let board = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}board-empty`), { loadLinks: true });
|
|
2862
|
+
if (board?.type === "doc") assert.strictEqual(board.doc.data.relationships, void 0, "a card whose only links are empty computeds carries no relationships key (empty computeds omitted, the leftover `{}` stripped)");
|
|
2863
|
+
else assert.ok(false, `board search entry was an error: ${board?.error.errorDetail.message}`);
|
|
2864
|
+
});
|
|
2865
|
+
(0, import_qunit.test)("a computed that reduces over a query-backed relationship is omitted from the indexed document", async function(assert) {
|
|
2866
|
+
const issueRef = {
|
|
2867
|
+
module: rri(`${testRealmURL}test-cards`),
|
|
2868
|
+
name: "Issue"
|
|
2869
|
+
};
|
|
2870
|
+
class Issue extends CardDef {
|
|
2871
|
+
static displayName = "Issue";
|
|
2872
|
+
static {
|
|
2873
|
+
decorateFieldV2(this.prototype, "title", [field], function() {
|
|
2874
|
+
return contains(string_default);
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
#title = (initializeDeferredDecorator(this, "title"), void 0);
|
|
2878
|
+
static {
|
|
2879
|
+
decorateFieldV2(this.prototype, "project", [field], function() {
|
|
2880
|
+
return linksTo(() => Project);
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
#project = (initializeDeferredDecorator(this, "project"), void 0);
|
|
2884
|
+
}
|
|
2885
|
+
class Project extends CardDef {
|
|
2886
|
+
static displayName = "Project";
|
|
2887
|
+
static {
|
|
2888
|
+
decorateFieldV2(this.prototype, "name", [field], function() {
|
|
2889
|
+
return contains(string_default);
|
|
2890
|
+
});
|
|
2891
|
+
}
|
|
2892
|
+
#name = (initializeDeferredDecorator(this, "name"), void 0);
|
|
2893
|
+
static {
|
|
2894
|
+
decorateFieldV2(this.prototype, "issues", [field], function() {
|
|
2895
|
+
return linksToMany(() => Issue, { query: { filter: {
|
|
2896
|
+
on: issueRef,
|
|
2897
|
+
eq: { "project.id": "$this.id" }
|
|
2898
|
+
} } });
|
|
2899
|
+
});
|
|
2900
|
+
}
|
|
2901
|
+
#issues = (initializeDeferredDecorator(this, "issues"), void 0);
|
|
2902
|
+
}
|
|
2903
|
+
class IssueTracker extends CardDef {
|
|
2904
|
+
static displayName = "IssueTracker";
|
|
2905
|
+
static {
|
|
2906
|
+
decorateFieldV2(this.prototype, "project", [field], function() {
|
|
2907
|
+
return linksTo(() => Project);
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
#project = (initializeDeferredDecorator(this, "project"), void 0);
|
|
2911
|
+
static {
|
|
2912
|
+
decorateFieldV2(this.prototype, "directIssues", [field], function() {
|
|
2913
|
+
return linksToMany(() => Issue);
|
|
2914
|
+
});
|
|
2915
|
+
}
|
|
2916
|
+
#directIssues = (initializeDeferredDecorator(this, "directIssues"), void 0);
|
|
2917
|
+
static {
|
|
2918
|
+
decorateFieldV2(this.prototype, "localCards", [field], function() {
|
|
2919
|
+
return linksToMany(() => Issue, { computeVia: function() {
|
|
2920
|
+
return this.directIssues;
|
|
2921
|
+
} });
|
|
2922
|
+
});
|
|
2923
|
+
}
|
|
2924
|
+
#localCards = (initializeDeferredDecorator(this, "localCards"), void 0);
|
|
2925
|
+
static {
|
|
2926
|
+
decorateFieldV2(this.prototype, "cards", [field], function() {
|
|
2927
|
+
return linksToMany(() => Issue, { computeVia: function() {
|
|
2928
|
+
return this.project?.issues;
|
|
2929
|
+
} });
|
|
2930
|
+
});
|
|
2931
|
+
}
|
|
2932
|
+
#cards = (initializeDeferredDecorator(this, "cards"), void 0);
|
|
2933
|
+
static {
|
|
2934
|
+
decorateFieldV2(this.prototype, "cardCount", [field], function() {
|
|
2935
|
+
return contains(NumberField, { computeVia: function() {
|
|
2936
|
+
return this.cards.length;
|
|
2937
|
+
} });
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2940
|
+
#cardCount = (initializeDeferredDecorator(this, "cardCount"), void 0);
|
|
2941
|
+
}
|
|
2942
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
2943
|
+
mockMatrixUtils,
|
|
2944
|
+
contents: {
|
|
2945
|
+
"test-cards.gts": {
|
|
2946
|
+
Issue,
|
|
2947
|
+
Project,
|
|
2948
|
+
IssueTracker
|
|
2949
|
+
},
|
|
2950
|
+
"Project/proj-1.json": { data: {
|
|
2951
|
+
attributes: { name: "Nexus" },
|
|
2952
|
+
meta: { adoptsFrom: {
|
|
2953
|
+
module: "../test-cards",
|
|
2954
|
+
name: "Project"
|
|
2955
|
+
} }
|
|
2956
|
+
} },
|
|
2957
|
+
"Issue/issue-1.json": { data: {
|
|
2958
|
+
attributes: { title: "First" },
|
|
2959
|
+
relationships: { project: { links: { self: "../Project/proj-1" } } },
|
|
2960
|
+
meta: { adoptsFrom: {
|
|
2961
|
+
module: "../test-cards",
|
|
2962
|
+
name: "Issue"
|
|
2963
|
+
} }
|
|
2964
|
+
} },
|
|
2965
|
+
"Issue/issue-2.json": { data: {
|
|
2966
|
+
attributes: { title: "Second" },
|
|
2967
|
+
relationships: { project: { links: { self: "../Project/proj-1" } } },
|
|
2968
|
+
meta: { adoptsFrom: {
|
|
2969
|
+
module: "../test-cards",
|
|
2970
|
+
name: "Issue"
|
|
2971
|
+
} }
|
|
2972
|
+
} }
|
|
2973
|
+
}
|
|
2974
|
+
});
|
|
2975
|
+
let issueIds = [`${testRealmURL}Issue/issue-1`, `${testRealmURL}Issue/issue-2`];
|
|
2976
|
+
let project = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Project/proj-1`), { loadLinks: true });
|
|
2977
|
+
assert.deepEqual(project?.type === "doc" ? project.doc.data.relationships?.issues?.data?.map((d) => d.id).sort() : void 0, issueIds, "the query-backed Project.issues resolves both issues");
|
|
2978
|
+
await realm.write("board-1.json", JSON.stringify({ data: {
|
|
2979
|
+
relationships: {
|
|
2980
|
+
project: { links: { self: "./Project/proj-1" } },
|
|
2981
|
+
"directIssues.0": { links: { self: "./Issue/issue-1" } },
|
|
2982
|
+
"directIssues.1": { links: { self: "./Issue/issue-2" } }
|
|
2983
|
+
},
|
|
2984
|
+
meta: { adoptsFrom: {
|
|
2985
|
+
module: "./test-cards",
|
|
2986
|
+
name: "IssueTracker"
|
|
2987
|
+
} }
|
|
2988
|
+
} }));
|
|
2989
|
+
let board = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}board-1`), { loadLinks: true });
|
|
2990
|
+
if (board?.type === "doc") {
|
|
2991
|
+
let relationships = board.doc.data.relationships ?? {};
|
|
2992
|
+
let linksFor = (prefix) => Object.keys(relationships).filter((key) => new RegExp(`^${prefix}\\.\\d+$`).test(key)).map((key) => relationships[key].links?.self).filter(Boolean).map((self) => new URL(self, `${testRealmURL}board-1`).href).sort();
|
|
2993
|
+
assert.deepEqual(linksFor("localCards"), issueIds, "a computed over an authored link still serializes");
|
|
2994
|
+
assert.deepEqual(linksFor("cards"), [], "a computed over a query-backed relationship is omitted");
|
|
2995
|
+
assert.strictEqual(board.doc.data.attributes?.cardCount, void 0, "a contained computed reaching the query field through another computed is omitted");
|
|
2996
|
+
} else assert.ok(false, `board search entry was an error: ${board?.error.errorDetail.message}`);
|
|
2997
|
+
});
|
|
2998
|
+
(0, import_qunit.test)("a query-backed field resolves references that live in another realm", async function(assert) {
|
|
2999
|
+
class Pet extends CardDef {
|
|
3000
|
+
static displayName = "Pet";
|
|
3001
|
+
static {
|
|
3002
|
+
decorateFieldV2(this.prototype, "name", [field], function() {
|
|
3003
|
+
return contains(string_default);
|
|
3004
|
+
});
|
|
3005
|
+
}
|
|
3006
|
+
#name = (initializeDeferredDecorator(this, "name"), void 0);
|
|
3007
|
+
}
|
|
3008
|
+
class Note extends FieldDef {
|
|
3009
|
+
static {
|
|
3010
|
+
decorateFieldV2(this.prototype, "rawIds", [field], function() {
|
|
3011
|
+
return containsMany(string_default);
|
|
3012
|
+
});
|
|
3013
|
+
}
|
|
3014
|
+
#rawIds = (initializeDeferredDecorator(this, "rawIds"), void 0);
|
|
3015
|
+
static {
|
|
3016
|
+
decorateFieldV2(this.prototype, "mentionedIds", [field], function() {
|
|
3017
|
+
return containsMany(string_default, { computeVia: function() {
|
|
3018
|
+
return this.rawIds ?? [];
|
|
3019
|
+
} });
|
|
3020
|
+
});
|
|
3021
|
+
}
|
|
3022
|
+
#mentionedIds = (initializeDeferredDecorator(this, "mentionedIds"), void 0);
|
|
3023
|
+
static {
|
|
3024
|
+
decorateFieldV2(this.prototype, "mentioned", [field], function() {
|
|
3025
|
+
return linksToMany(() => CardDef, { query: {
|
|
3026
|
+
filter: { in: { id: "$this.mentionedIds" } },
|
|
3027
|
+
realms: "$this.mentionedIds"
|
|
3028
|
+
} });
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
#mentioned = (initializeDeferredDecorator(this, "mentioned"), void 0);
|
|
3032
|
+
}
|
|
3033
|
+
class Post extends CardDef {
|
|
3034
|
+
static {
|
|
3035
|
+
decorateFieldV2(this.prototype, "note", [field], function() {
|
|
3036
|
+
return contains(Note);
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3039
|
+
#note = (initializeDeferredDecorator(this, "note"), void 0);
|
|
3040
|
+
}
|
|
3041
|
+
let otherRealmURL = "http://test-realm/other/";
|
|
3042
|
+
await setupIntegrationTestRealm({
|
|
3043
|
+
mockMatrixUtils,
|
|
3044
|
+
realmURL: otherRealmURL,
|
|
3045
|
+
contents: {
|
|
3046
|
+
"pet.gts": { Pet },
|
|
3047
|
+
"Pet/mango.json": { data: {
|
|
3048
|
+
attributes: { name: "Mango" },
|
|
3049
|
+
meta: { adoptsFrom: {
|
|
3050
|
+
module: "../pet",
|
|
3051
|
+
name: "Pet"
|
|
3052
|
+
} }
|
|
3053
|
+
} }
|
|
3054
|
+
}
|
|
3055
|
+
});
|
|
3056
|
+
let virtualNetwork = getService("network").virtualNetwork;
|
|
3057
|
+
virtualNetwork.addRealmMapping("@other/cards/", otherRealmURL);
|
|
3058
|
+
try {
|
|
3059
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
3060
|
+
mockMatrixUtils,
|
|
3061
|
+
contents: {
|
|
3062
|
+
"test-cards.gts": {
|
|
3063
|
+
Post,
|
|
3064
|
+
Note
|
|
3065
|
+
},
|
|
3066
|
+
"post-1.json": { data: {
|
|
3067
|
+
attributes: { note: { rawIds: ["@other/cards/Pet/mango"] } },
|
|
3068
|
+
meta: { adoptsFrom: {
|
|
3069
|
+
module: "./test-cards",
|
|
3070
|
+
name: "Post"
|
|
3071
|
+
} }
|
|
3072
|
+
} }
|
|
3073
|
+
}
|
|
3074
|
+
});
|
|
3075
|
+
let post = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}post-1`), { loadLinks: true });
|
|
3076
|
+
if (post?.type === "doc") {
|
|
3077
|
+
let mentioned = post.doc.data.relationships?.["note.mentioned"];
|
|
3078
|
+
let searchURL = mentioned?.links?.search ?? "";
|
|
3079
|
+
let namesOtherRealm = searchURL.includes(encodeURIComponent(otherRealmURL)) || searchURL.includes(otherRealmURL);
|
|
3080
|
+
assert.ok(namesOtherRealm, `links.search names the other realm (got ${searchURL})`);
|
|
3081
|
+
assert.deepEqual(mentioned?.data, [{
|
|
3082
|
+
type: "card",
|
|
3083
|
+
id: `${otherRealmURL}Pet/mango`
|
|
3084
|
+
}], "the cross-realm reference resolved");
|
|
3085
|
+
} else assert.ok(false, `search entry was an error: ${post?.error.errorDetail.message}`);
|
|
3086
|
+
} finally {
|
|
3087
|
+
virtualNetwork.removeRealmMapping("@other/cards/");
|
|
3088
|
+
}
|
|
3089
|
+
});
|
|
3090
|
+
(0, import_qunit.test)("can index a card that has nested linksTo fields", async function(assert) {
|
|
3091
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
3092
|
+
mockMatrixUtils,
|
|
3093
|
+
contents: {
|
|
3094
|
+
"Friend/hassan.json": { data: {
|
|
3095
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3096
|
+
attributes: {
|
|
3097
|
+
firstName: "Hassan",
|
|
3098
|
+
cardDescription: "Friend of dogs"
|
|
3099
|
+
},
|
|
3100
|
+
relationships: { friend: {
|
|
3101
|
+
links: { self: `./mango` },
|
|
3102
|
+
data: {
|
|
3103
|
+
type: "card",
|
|
3104
|
+
id: `${testRealmURL}Friend/mango`
|
|
3105
|
+
}
|
|
3106
|
+
} },
|
|
3107
|
+
meta: { adoptsFrom: {
|
|
3108
|
+
module: `${testModuleRealm}friend`,
|
|
3109
|
+
name: "Friend"
|
|
3110
|
+
} }
|
|
3111
|
+
} },
|
|
3112
|
+
"Friend/mango.json": { data: {
|
|
3113
|
+
id: `${testRealmURL}Friend/mango`,
|
|
3114
|
+
attributes: {
|
|
3115
|
+
firstName: "Mango",
|
|
3116
|
+
cardDescription: "Dog friend"
|
|
3117
|
+
},
|
|
3118
|
+
relationships: { friend: { links: { self: `./vanGogh` } } },
|
|
3119
|
+
meta: { adoptsFrom: {
|
|
3120
|
+
module: `${testModuleRealm}friend`,
|
|
3121
|
+
name: "Friend"
|
|
3122
|
+
} }
|
|
3123
|
+
} },
|
|
3124
|
+
"Friend/vanGogh.json": { data: {
|
|
3125
|
+
id: `${testRealmURL}Friend/vanGogh`,
|
|
3126
|
+
attributes: {
|
|
3127
|
+
firstName: "Van Gogh",
|
|
3128
|
+
cardDescription: "Dog friend",
|
|
3129
|
+
cardThumbnailURL: "van-gogh.jpg"
|
|
3130
|
+
},
|
|
3131
|
+
meta: { adoptsFrom: {
|
|
3132
|
+
module: `${testModuleRealm}friend`,
|
|
3133
|
+
name: "Friend"
|
|
3134
|
+
} }
|
|
3135
|
+
} }
|
|
3136
|
+
}
|
|
3137
|
+
});
|
|
3138
|
+
let hassan = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Friend/hassan`));
|
|
3139
|
+
if (hassan?.type === "doc") assert.deepEqual(hassan.doc.data, {
|
|
3140
|
+
id: testRRI("Friend/hassan"),
|
|
3141
|
+
type: "card",
|
|
3142
|
+
links: { self: "./hassan" },
|
|
3143
|
+
attributes: {
|
|
3144
|
+
firstName: "Hassan",
|
|
3145
|
+
cardTitle: "Hassan",
|
|
3146
|
+
cardDescription: "Friend of dogs",
|
|
3147
|
+
cardThumbnailURL: null,
|
|
3148
|
+
cardInfo
|
|
3149
|
+
},
|
|
3150
|
+
relationships: { friend: { links: { self: `./mango` } } },
|
|
3151
|
+
meta: {
|
|
3152
|
+
adoptsFrom: {
|
|
3153
|
+
module: rri(`${testModuleRealm}friend`),
|
|
3154
|
+
name: "Friend"
|
|
3155
|
+
},
|
|
3156
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/hassan.json`),
|
|
3157
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3158
|
+
realmInfo: {
|
|
3159
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3160
|
+
backgroundURL: null,
|
|
3161
|
+
iconURL: null,
|
|
3162
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3163
|
+
lastPublishedAt: null,
|
|
3164
|
+
name: "Unnamed Workspace",
|
|
3165
|
+
publishable: null,
|
|
3166
|
+
realmUserId: "@realm_server:localhost",
|
|
3167
|
+
showAsCatalog: null,
|
|
3168
|
+
visibility: "public"
|
|
3169
|
+
},
|
|
3170
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/hassan.json")
|
|
3171
|
+
}
|
|
3172
|
+
});
|
|
3173
|
+
else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
3174
|
+
let hassanEntry = await getInstance(realm, new URL(`${testRealmURL}Friend/hassan`));
|
|
3175
|
+
if (hassanEntry) expectSearchDoc(assert, hassanEntry.searchDoc, {
|
|
3176
|
+
_cardType: "Friend",
|
|
3177
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3178
|
+
firstName: "Hassan",
|
|
3179
|
+
cardTitle: "Hassan",
|
|
3180
|
+
cardDescription: "Friend of dogs",
|
|
3181
|
+
friend: {
|
|
3182
|
+
id: `${testRealmURL}Friend/mango`,
|
|
3183
|
+
firstName: "Mango",
|
|
3184
|
+
cardTitle: "Mango",
|
|
3185
|
+
cardDescription: "Dog friend",
|
|
3186
|
+
friend: { id: `${testRealmURL}Friend/vanGogh` },
|
|
3187
|
+
cardTheme: null,
|
|
3188
|
+
cardInfo: {
|
|
3189
|
+
cardThumbnail: null,
|
|
3190
|
+
theme: null
|
|
3191
|
+
}
|
|
3192
|
+
},
|
|
3193
|
+
cardTheme: null,
|
|
3194
|
+
cardInfo: {
|
|
3195
|
+
cardThumbnail: null,
|
|
3196
|
+
theme: null
|
|
3197
|
+
}
|
|
3198
|
+
});
|
|
3199
|
+
else assert.ok(false, `could not find ${testRealmURL}Friend/hassan in the index`);
|
|
3200
|
+
});
|
|
3201
|
+
(0, import_qunit.test)("can index a field with a cycle in the linksTo field", async function(assert) {
|
|
3202
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
3203
|
+
mockMatrixUtils,
|
|
3204
|
+
contents: {
|
|
3205
|
+
"Friend/hassan.json": { data: {
|
|
3206
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3207
|
+
attributes: {
|
|
3208
|
+
firstName: "Hassan",
|
|
3209
|
+
cardDescription: "Dog owner"
|
|
3210
|
+
},
|
|
3211
|
+
relationships: { friend: { links: { self: `./mango` } } },
|
|
3212
|
+
meta: { adoptsFrom: {
|
|
3213
|
+
module: `${testModuleRealm}friend`,
|
|
3214
|
+
name: "Friend"
|
|
3215
|
+
} }
|
|
3216
|
+
} },
|
|
3217
|
+
"Friend/mango.json": { data: {
|
|
3218
|
+
id: `${testRealmURL}Friend/mango`,
|
|
3219
|
+
attributes: {
|
|
3220
|
+
firstName: "Mango",
|
|
3221
|
+
cardDescription: "Dog friend"
|
|
3222
|
+
},
|
|
3223
|
+
relationships: { friend: {
|
|
3224
|
+
links: { self: `./hassan` },
|
|
3225
|
+
data: {
|
|
3226
|
+
type: "card",
|
|
3227
|
+
id: `${testRealmURL}Friend/hassan`
|
|
3228
|
+
}
|
|
3229
|
+
} },
|
|
3230
|
+
meta: { adoptsFrom: {
|
|
3231
|
+
module: `${testModuleRealm}friend`,
|
|
3232
|
+
name: "Friend"
|
|
3233
|
+
} }
|
|
3234
|
+
} }
|
|
3235
|
+
}
|
|
3236
|
+
});
|
|
3237
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
3238
|
+
let hassan = await indexer.cardDocument(new URL(`${testRealmURL}Friend/hassan`), { loadLinks: true });
|
|
3239
|
+
if (hassan?.type === "doc") assert.deepEqual(hassan.doc, {
|
|
3240
|
+
data: {
|
|
3241
|
+
id: testRRI("Friend/hassan"),
|
|
3242
|
+
type: "card",
|
|
3243
|
+
links: { self: "./hassan" },
|
|
3244
|
+
attributes: {
|
|
3245
|
+
firstName: "Hassan",
|
|
3246
|
+
cardTitle: "Hassan",
|
|
3247
|
+
cardDescription: "Dog owner",
|
|
3248
|
+
cardThumbnailURL: null,
|
|
3249
|
+
cardInfo
|
|
3250
|
+
},
|
|
3251
|
+
relationships: { friend: {
|
|
3252
|
+
links: { self: `./mango` },
|
|
3253
|
+
data: {
|
|
3254
|
+
type: "card",
|
|
3255
|
+
id: `${testRealmURL}Friend/mango`
|
|
3256
|
+
}
|
|
3257
|
+
} },
|
|
3258
|
+
meta: {
|
|
3259
|
+
adoptsFrom: {
|
|
3260
|
+
module: rri(`${testModuleRealm}friend`),
|
|
3261
|
+
name: "Friend"
|
|
3262
|
+
},
|
|
3263
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/hassan.json`),
|
|
3264
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3265
|
+
realmInfo: {
|
|
3266
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3267
|
+
backgroundURL: null,
|
|
3268
|
+
iconURL: null,
|
|
3269
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3270
|
+
lastPublishedAt: null,
|
|
3271
|
+
name: "Unnamed Workspace",
|
|
3272
|
+
publishable: null,
|
|
3273
|
+
realmUserId: "@realm_server:localhost",
|
|
3274
|
+
showAsCatalog: null,
|
|
3275
|
+
visibility: "public"
|
|
3276
|
+
},
|
|
3277
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/hassan.json")
|
|
3278
|
+
}
|
|
3279
|
+
},
|
|
3280
|
+
included: [{
|
|
3281
|
+
id: testRRI("Friend/mango"),
|
|
3282
|
+
type: "card",
|
|
3283
|
+
links: { self: `./mango` },
|
|
3284
|
+
attributes: {
|
|
3285
|
+
firstName: "Mango",
|
|
3286
|
+
cardTitle: "Mango",
|
|
3287
|
+
cardDescription: "Dog friend",
|
|
3288
|
+
cardThumbnailURL: null,
|
|
3289
|
+
cardInfo
|
|
3290
|
+
},
|
|
3291
|
+
relationships: { friend: {
|
|
3292
|
+
links: { self: `./hassan` },
|
|
3293
|
+
data: {
|
|
3294
|
+
type: "card",
|
|
3295
|
+
id: `${testRealmURL}Friend/hassan`
|
|
3296
|
+
}
|
|
3297
|
+
} },
|
|
3298
|
+
meta: {
|
|
3299
|
+
adoptsFrom: {
|
|
3300
|
+
module: rri(`${testModuleRealm}friend`),
|
|
3301
|
+
name: "Friend"
|
|
3302
|
+
},
|
|
3303
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/mango.json`),
|
|
3304
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3305
|
+
realmInfo: {
|
|
3306
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3307
|
+
backgroundURL: null,
|
|
3308
|
+
iconURL: null,
|
|
3309
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3310
|
+
lastPublishedAt: null,
|
|
3311
|
+
name: "Unnamed Workspace",
|
|
3312
|
+
publishable: null,
|
|
3313
|
+
realmUserId: "@realm_server:localhost",
|
|
3314
|
+
showAsCatalog: null,
|
|
3315
|
+
visibility: "public"
|
|
3316
|
+
},
|
|
3317
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/mango.json")
|
|
3318
|
+
}
|
|
3319
|
+
}]
|
|
3320
|
+
});
|
|
3321
|
+
else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
3322
|
+
let hassanEntry = await getInstance(realm, new URL(`${testRealmURL}Friend/hassan`));
|
|
3323
|
+
if (hassanEntry) expectSearchDoc(assert, hassanEntry.searchDoc, {
|
|
3324
|
+
_cardType: "Friend",
|
|
3325
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3326
|
+
firstName: "Hassan",
|
|
3327
|
+
cardDescription: "Dog owner",
|
|
3328
|
+
friend: {
|
|
3329
|
+
id: `${testRealmURL}Friend/mango`,
|
|
3330
|
+
firstName: "Mango",
|
|
3331
|
+
cardTitle: "Mango",
|
|
3332
|
+
friend: { id: `${testRealmURL}Friend/hassan` },
|
|
3333
|
+
cardDescription: "Dog friend",
|
|
3334
|
+
cardTheme: null,
|
|
3335
|
+
cardInfo: {
|
|
3336
|
+
cardThumbnail: null,
|
|
3337
|
+
theme: null
|
|
3338
|
+
}
|
|
3339
|
+
},
|
|
3340
|
+
cardTitle: "Hassan",
|
|
3341
|
+
cardTheme: null,
|
|
3342
|
+
cardInfo: {
|
|
3343
|
+
cardThumbnail: null,
|
|
3344
|
+
theme: null
|
|
3345
|
+
}
|
|
3346
|
+
});
|
|
3347
|
+
else assert.ok(false, `could not find ${testRealmURL}Friend/hassan in the index`);
|
|
3348
|
+
let mango = await indexer.cardDocument(new URL(`${testRealmURL}Friend/mango`), { loadLinks: true });
|
|
3349
|
+
if (mango?.type === "doc") assert.deepEqual(mango.doc, {
|
|
3350
|
+
data: {
|
|
3351
|
+
id: testRRI("Friend/mango"),
|
|
3352
|
+
type: "card",
|
|
3353
|
+
links: { self: "./mango" },
|
|
3354
|
+
attributes: {
|
|
3355
|
+
firstName: "Mango",
|
|
3356
|
+
cardTitle: "Mango",
|
|
3357
|
+
cardDescription: "Dog friend",
|
|
3358
|
+
cardThumbnailURL: null,
|
|
3359
|
+
cardInfo
|
|
3360
|
+
},
|
|
3361
|
+
relationships: { friend: {
|
|
3362
|
+
links: { self: `./hassan` },
|
|
3363
|
+
data: {
|
|
3364
|
+
type: "card",
|
|
3365
|
+
id: `${testRealmURL}Friend/hassan`
|
|
3366
|
+
}
|
|
3367
|
+
} },
|
|
3368
|
+
meta: {
|
|
3369
|
+
adoptsFrom: {
|
|
3370
|
+
module: rri(`${testModuleRealm}friend`),
|
|
3371
|
+
name: "Friend"
|
|
3372
|
+
},
|
|
3373
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/mango.json`),
|
|
3374
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3375
|
+
realmInfo: {
|
|
3376
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3377
|
+
backgroundURL: null,
|
|
3378
|
+
iconURL: null,
|
|
3379
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3380
|
+
lastPublishedAt: null,
|
|
3381
|
+
name: "Unnamed Workspace",
|
|
3382
|
+
publishable: null,
|
|
3383
|
+
realmUserId: "@realm_server:localhost",
|
|
3384
|
+
showAsCatalog: null,
|
|
3385
|
+
visibility: "public"
|
|
3386
|
+
},
|
|
3387
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/mango.json")
|
|
3388
|
+
}
|
|
3389
|
+
},
|
|
3390
|
+
included: [{
|
|
3391
|
+
id: testRRI("Friend/hassan"),
|
|
3392
|
+
type: "card",
|
|
3393
|
+
links: { self: `./hassan` },
|
|
3394
|
+
attributes: {
|
|
3395
|
+
firstName: "Hassan",
|
|
3396
|
+
cardTitle: "Hassan",
|
|
3397
|
+
cardDescription: "Dog owner",
|
|
3398
|
+
cardThumbnailURL: null,
|
|
3399
|
+
cardInfo
|
|
3400
|
+
},
|
|
3401
|
+
relationships: { friend: {
|
|
3402
|
+
links: { self: `./mango` },
|
|
3403
|
+
data: {
|
|
3404
|
+
type: "card",
|
|
3405
|
+
id: `${testRealmURL}Friend/mango`
|
|
3406
|
+
}
|
|
3407
|
+
} },
|
|
3408
|
+
meta: {
|
|
3409
|
+
adoptsFrom: {
|
|
3410
|
+
module: rri(`${testModuleRealm}friend`),
|
|
3411
|
+
name: "Friend"
|
|
3412
|
+
},
|
|
3413
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/hassan.json`),
|
|
3414
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3415
|
+
realmInfo: {
|
|
3416
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3417
|
+
backgroundURL: null,
|
|
3418
|
+
iconURL: null,
|
|
3419
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3420
|
+
lastPublishedAt: null,
|
|
3421
|
+
name: "Unnamed Workspace",
|
|
3422
|
+
publishable: null,
|
|
3423
|
+
realmUserId: "@realm_server:localhost",
|
|
3424
|
+
showAsCatalog: null,
|
|
3425
|
+
visibility: "public"
|
|
3426
|
+
},
|
|
3427
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/hassan.json")
|
|
3428
|
+
}
|
|
3429
|
+
}]
|
|
3430
|
+
});
|
|
3431
|
+
else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
3432
|
+
let mangoEntry = await getInstance(realm, new URL(`${testRealmURL}Friend/mango`));
|
|
3433
|
+
if (mangoEntry) expectSearchDoc(assert, mangoEntry.searchDoc, {
|
|
3434
|
+
_cardType: "Friend",
|
|
3435
|
+
id: `${testRealmURL}Friend/mango`,
|
|
3436
|
+
firstName: "Mango",
|
|
3437
|
+
cardTitle: "Mango",
|
|
3438
|
+
cardDescription: "Dog friend",
|
|
3439
|
+
friend: {
|
|
3440
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3441
|
+
cardTitle: "Hassan",
|
|
3442
|
+
firstName: "Hassan",
|
|
3443
|
+
friend: { id: `${testRealmURL}Friend/mango` },
|
|
3444
|
+
cardDescription: "Dog owner",
|
|
3445
|
+
cardTheme: null,
|
|
3446
|
+
cardInfo: {
|
|
3447
|
+
cardThumbnail: null,
|
|
3448
|
+
theme: null
|
|
3449
|
+
}
|
|
3450
|
+
},
|
|
3451
|
+
cardTheme: null,
|
|
3452
|
+
cardInfo: {
|
|
3453
|
+
cardThumbnail: null,
|
|
3454
|
+
theme: null
|
|
3455
|
+
}
|
|
3456
|
+
});
|
|
3457
|
+
else assert.ok(false, `could not find ${testRealmURL}Friend/mango in the index`);
|
|
3458
|
+
});
|
|
3459
|
+
(0, import_qunit.test)("can index a card that has a linksTo relationship to itself", async function(assert) {
|
|
3460
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
3461
|
+
mockMatrixUtils,
|
|
3462
|
+
contents: { "Friend/hassan.json": { data: {
|
|
3463
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3464
|
+
attributes: {
|
|
3465
|
+
firstName: "Hassan",
|
|
3466
|
+
cardDescription: "Dog owner"
|
|
3467
|
+
},
|
|
3468
|
+
relationships: { friend: { links: { self: `./hassan` } } },
|
|
3469
|
+
meta: { adoptsFrom: {
|
|
3470
|
+
module: `${testModuleRealm}friend`,
|
|
3471
|
+
name: "Friend"
|
|
3472
|
+
} }
|
|
3473
|
+
} } }
|
|
3474
|
+
});
|
|
3475
|
+
let hassan = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Friend/hassan`), { loadLinks: true });
|
|
3476
|
+
if (hassan?.type === "doc") assert.deepEqual(hassan.doc, { data: {
|
|
3477
|
+
id: testRRI("Friend/hassan"),
|
|
3478
|
+
type: "card",
|
|
3479
|
+
links: { self: "./hassan" },
|
|
3480
|
+
attributes: {
|
|
3481
|
+
firstName: "Hassan",
|
|
3482
|
+
cardTitle: "Hassan",
|
|
3483
|
+
cardDescription: "Dog owner",
|
|
3484
|
+
cardThumbnailURL: null,
|
|
3485
|
+
cardInfo
|
|
3486
|
+
},
|
|
3487
|
+
relationships: { friend: {
|
|
3488
|
+
links: { self: `./hassan` },
|
|
3489
|
+
data: {
|
|
3490
|
+
type: "card",
|
|
3491
|
+
id: `${testRealmURL}Friend/hassan`
|
|
3492
|
+
}
|
|
3493
|
+
} },
|
|
3494
|
+
meta: {
|
|
3495
|
+
adoptsFrom: {
|
|
3496
|
+
module: rri(`${testModuleRealm}friend`),
|
|
3497
|
+
name: "Friend"
|
|
3498
|
+
},
|
|
3499
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/hassan.json`),
|
|
3500
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3501
|
+
realmInfo: {
|
|
3502
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3503
|
+
backgroundURL: null,
|
|
3504
|
+
iconURL: null,
|
|
3505
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3506
|
+
lastPublishedAt: null,
|
|
3507
|
+
name: "Unnamed Workspace",
|
|
3508
|
+
publishable: null,
|
|
3509
|
+
realmUserId: "@realm_server:localhost",
|
|
3510
|
+
showAsCatalog: null,
|
|
3511
|
+
visibility: "public"
|
|
3512
|
+
},
|
|
3513
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/hassan.json")
|
|
3514
|
+
}
|
|
3515
|
+
} });
|
|
3516
|
+
else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
3517
|
+
let hassanEntry = await getInstance(realm, new URL(`${testRealmURL}Friend/hassan`));
|
|
3518
|
+
if (hassanEntry) expectSearchDoc(assert, hassanEntry.searchDoc, {
|
|
3519
|
+
_cardType: "Friend",
|
|
3520
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3521
|
+
firstName: "Hassan",
|
|
3522
|
+
cardDescription: "Dog owner",
|
|
3523
|
+
friend: { id: `${testRealmURL}Friend/hassan` },
|
|
3524
|
+
cardTitle: "Hassan",
|
|
3525
|
+
cardTheme: null,
|
|
3526
|
+
cardInfo: {
|
|
3527
|
+
cardThumbnail: null,
|
|
3528
|
+
theme: null
|
|
3529
|
+
}
|
|
3530
|
+
});
|
|
3531
|
+
else assert.ok(false, `could not find ${testRealmURL}Friend/hassan in the index`);
|
|
3532
|
+
});
|
|
3533
|
+
(0, import_qunit.test)("can index a field with a cycle in the linksToMany field", async function(assert) {
|
|
3534
|
+
let hassanID = `${testRealmURL}Friends/hassan`;
|
|
3535
|
+
let mangoID = `${testRealmURL}Friends/mango`;
|
|
3536
|
+
let vanGoghID = `${testRealmURL}Friends/vanGogh`;
|
|
3537
|
+
let friendsRef = {
|
|
3538
|
+
module: testModuleRRI("friends"),
|
|
3539
|
+
name: "Friends"
|
|
3540
|
+
};
|
|
3541
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
3542
|
+
mockMatrixUtils,
|
|
3543
|
+
contents: {
|
|
3544
|
+
"Friends/vanGogh.json": { data: {
|
|
3545
|
+
attributes: { firstName: "Van Gogh" },
|
|
3546
|
+
relationships: { "friends.0": {
|
|
3547
|
+
links: { self: hassanID },
|
|
3548
|
+
data: {
|
|
3549
|
+
type: "card",
|
|
3550
|
+
id: hassanID
|
|
3551
|
+
}
|
|
3552
|
+
} },
|
|
3553
|
+
meta: { adoptsFrom: friendsRef }
|
|
3554
|
+
} },
|
|
3555
|
+
"Friends/hassan.json": { data: {
|
|
3556
|
+
attributes: { firstName: "Hassan" },
|
|
3557
|
+
relationships: {
|
|
3558
|
+
"friends.0": {
|
|
3559
|
+
links: { self: mangoID },
|
|
3560
|
+
data: {
|
|
3561
|
+
type: "card",
|
|
3562
|
+
id: mangoID
|
|
3563
|
+
}
|
|
3564
|
+
},
|
|
3565
|
+
"friends.1": {
|
|
3566
|
+
links: { self: vanGoghID },
|
|
3567
|
+
data: {
|
|
3568
|
+
type: "card",
|
|
3569
|
+
id: vanGoghID
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
},
|
|
3573
|
+
meta: { adoptsFrom: friendsRef }
|
|
3574
|
+
} },
|
|
3575
|
+
"Friends/mango.json": { data: {
|
|
3576
|
+
attributes: { firstName: "Mango" },
|
|
3577
|
+
relationships: { "friends.0": {
|
|
3578
|
+
links: { self: hassanID },
|
|
3579
|
+
data: {
|
|
3580
|
+
type: "card",
|
|
3581
|
+
id: hassanID
|
|
3582
|
+
}
|
|
3583
|
+
} },
|
|
3584
|
+
meta: { adoptsFrom: friendsRef }
|
|
3585
|
+
} }
|
|
3586
|
+
}
|
|
3587
|
+
});
|
|
3588
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
3589
|
+
let realmIndexUpdater = realm.realmIndexUpdater;
|
|
3590
|
+
assert.deepEqual(realmIndexUpdater.stats, {
|
|
3591
|
+
filesIndexed: 3,
|
|
3592
|
+
fileErrors: 0,
|
|
3593
|
+
instanceErrors: 0,
|
|
3594
|
+
instancesIndexed: 3,
|
|
3595
|
+
totalIndexEntries: 6
|
|
3596
|
+
}, "instances are indexed without error");
|
|
3597
|
+
let hassan = await queryEngine.cardDocument(new URL(hassanID), { loadLinks: true });
|
|
3598
|
+
if (hassan?.type === "doc") {
|
|
3599
|
+
assert.deepEqual(hassan.doc.data, {
|
|
3600
|
+
id: rri(hassanID),
|
|
3601
|
+
type: "card",
|
|
3602
|
+
links: { self: "./hassan" },
|
|
3603
|
+
attributes: {
|
|
3604
|
+
firstName: "Hassan",
|
|
3605
|
+
cardTitle: "Hassan",
|
|
3606
|
+
cardDescription: null,
|
|
3607
|
+
cardThumbnailURL: null,
|
|
3608
|
+
cardInfo
|
|
3609
|
+
},
|
|
3610
|
+
relationships: {
|
|
3611
|
+
"friends.0": {
|
|
3612
|
+
links: { self: "./mango" },
|
|
3613
|
+
data: {
|
|
3614
|
+
type: "card",
|
|
3615
|
+
id: mangoID
|
|
3616
|
+
}
|
|
3617
|
+
},
|
|
3618
|
+
"friends.1": {
|
|
3619
|
+
links: { self: "./vanGogh" },
|
|
3620
|
+
data: {
|
|
3621
|
+
type: "card",
|
|
3622
|
+
id: vanGoghID
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
},
|
|
3626
|
+
meta: {
|
|
3627
|
+
adoptsFrom: friendsRef,
|
|
3628
|
+
lastModified: adapter.lastModifiedMap.get(`${hassanID}.json`),
|
|
3629
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3630
|
+
realmInfo: {
|
|
3631
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3632
|
+
backgroundURL: null,
|
|
3633
|
+
iconURL: null,
|
|
3634
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3635
|
+
lastPublishedAt: null,
|
|
3636
|
+
name: "Unnamed Workspace",
|
|
3637
|
+
publishable: null,
|
|
3638
|
+
realmUserId: "@realm_server:localhost",
|
|
3639
|
+
showAsCatalog: null,
|
|
3640
|
+
visibility: "public"
|
|
3641
|
+
},
|
|
3642
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/hassan.json")
|
|
3643
|
+
}
|
|
3644
|
+
}, "hassan doc.data is correct");
|
|
3645
|
+
assert.deepEqual(hassan.doc.included, [{
|
|
3646
|
+
id: rri(mangoID),
|
|
3647
|
+
type: "card",
|
|
3648
|
+
links: { self: "./mango" },
|
|
3649
|
+
attributes: {
|
|
3650
|
+
firstName: "Mango",
|
|
3651
|
+
cardTitle: "Mango",
|
|
3652
|
+
cardDescription: null,
|
|
3653
|
+
cardThumbnailURL: null,
|
|
3654
|
+
cardInfo
|
|
3655
|
+
},
|
|
3656
|
+
relationships: { "friends.0": {
|
|
3657
|
+
links: { self: "./hassan" },
|
|
3658
|
+
data: {
|
|
3659
|
+
type: "card",
|
|
3660
|
+
id: hassanID
|
|
3661
|
+
}
|
|
3662
|
+
} },
|
|
3663
|
+
meta: {
|
|
3664
|
+
adoptsFrom: friendsRef,
|
|
3665
|
+
lastModified: adapter.lastModifiedMap.get(`${mangoID}.json`),
|
|
3666
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3667
|
+
realmInfo: {
|
|
3668
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3669
|
+
backgroundURL: null,
|
|
3670
|
+
iconURL: null,
|
|
3671
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3672
|
+
lastPublishedAt: null,
|
|
3673
|
+
name: "Unnamed Workspace",
|
|
3674
|
+
publishable: null,
|
|
3675
|
+
realmUserId: "@realm_server:localhost",
|
|
3676
|
+
showAsCatalog: null,
|
|
3677
|
+
visibility: "public"
|
|
3678
|
+
},
|
|
3679
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/mango.json")
|
|
3680
|
+
}
|
|
3681
|
+
}, {
|
|
3682
|
+
id: rri(vanGoghID),
|
|
3683
|
+
type: "card",
|
|
3684
|
+
links: { self: "./vanGogh" },
|
|
3685
|
+
attributes: {
|
|
3686
|
+
firstName: "Van Gogh",
|
|
3687
|
+
cardTitle: "Van Gogh",
|
|
3688
|
+
cardDescription: null,
|
|
3689
|
+
cardThumbnailURL: null,
|
|
3690
|
+
cardInfo
|
|
3691
|
+
},
|
|
3692
|
+
relationships: { "friends.0": {
|
|
3693
|
+
links: { self: "./hassan" },
|
|
3694
|
+
data: {
|
|
3695
|
+
type: "card",
|
|
3696
|
+
id: hassanID
|
|
3697
|
+
}
|
|
3698
|
+
} },
|
|
3699
|
+
meta: {
|
|
3700
|
+
adoptsFrom: friendsRef,
|
|
3701
|
+
lastModified: adapter.lastModifiedMap.get(`${vanGoghID}.json`),
|
|
3702
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3703
|
+
realmInfo: {
|
|
3704
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3705
|
+
backgroundURL: null,
|
|
3706
|
+
iconURL: null,
|
|
3707
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3708
|
+
lastPublishedAt: null,
|
|
3709
|
+
name: "Unnamed Workspace",
|
|
3710
|
+
publishable: null,
|
|
3711
|
+
realmUserId: "@realm_server:localhost",
|
|
3712
|
+
showAsCatalog: null,
|
|
3713
|
+
visibility: "public"
|
|
3714
|
+
},
|
|
3715
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/vanGogh.json")
|
|
3716
|
+
}
|
|
3717
|
+
}], "hassan doc.included is correct");
|
|
3718
|
+
} else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
3719
|
+
let hassanEntry = await getInstance(realm, new URL(hassanID));
|
|
3720
|
+
if (hassanEntry) expectSearchDoc(assert, hassanEntry.searchDoc, {
|
|
3721
|
+
_cardType: "Friends",
|
|
3722
|
+
id: hassanID,
|
|
3723
|
+
firstName: "Hassan",
|
|
3724
|
+
cardTitle: "Hassan",
|
|
3725
|
+
friends: [{
|
|
3726
|
+
id: mangoID,
|
|
3727
|
+
firstName: "Mango",
|
|
3728
|
+
cardTitle: "Mango",
|
|
3729
|
+
friends: [{ id: hassanID }],
|
|
3730
|
+
cardTheme: null,
|
|
3731
|
+
cardInfo: {
|
|
3732
|
+
cardThumbnail: null,
|
|
3733
|
+
theme: null
|
|
3734
|
+
}
|
|
3735
|
+
}, {
|
|
3736
|
+
id: vanGoghID,
|
|
3737
|
+
firstName: "Van Gogh",
|
|
3738
|
+
friends: [{ id: hassanID }],
|
|
3739
|
+
cardTitle: "Van Gogh",
|
|
3740
|
+
cardTheme: null,
|
|
3741
|
+
cardInfo: {
|
|
3742
|
+
cardThumbnail: null,
|
|
3743
|
+
theme: null
|
|
3744
|
+
}
|
|
3745
|
+
}],
|
|
3746
|
+
cardTheme: null,
|
|
3747
|
+
cardInfo: {
|
|
3748
|
+
cardThumbnail: null,
|
|
3749
|
+
theme: null
|
|
3750
|
+
}
|
|
3751
|
+
}, "hassan searchData is correct");
|
|
3752
|
+
else assert.ok(false, `could not find ${hassanID} in the index`);
|
|
3753
|
+
let mango = await queryEngine.cardDocument(new URL(mangoID), { loadLinks: true });
|
|
3754
|
+
if (mango?.type === "doc") {
|
|
3755
|
+
assert.deepEqual(mango.doc.data, {
|
|
3756
|
+
id: rri(mangoID),
|
|
3757
|
+
type: "card",
|
|
3758
|
+
links: { self: "./mango" },
|
|
3759
|
+
attributes: {
|
|
3760
|
+
firstName: "Mango",
|
|
3761
|
+
cardTitle: "Mango",
|
|
3762
|
+
cardDescription: null,
|
|
3763
|
+
cardThumbnailURL: null,
|
|
3764
|
+
cardInfo
|
|
3765
|
+
},
|
|
3766
|
+
relationships: { "friends.0": {
|
|
3767
|
+
links: { self: "./hassan" },
|
|
3768
|
+
data: {
|
|
3769
|
+
type: "card",
|
|
3770
|
+
id: hassanID
|
|
3771
|
+
}
|
|
3772
|
+
} },
|
|
3773
|
+
meta: {
|
|
3774
|
+
adoptsFrom: friendsRef,
|
|
3775
|
+
lastModified: adapter.lastModifiedMap.get(`${mangoID}.json`),
|
|
3776
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3777
|
+
realmInfo: {
|
|
3778
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3779
|
+
backgroundURL: null,
|
|
3780
|
+
iconURL: null,
|
|
3781
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3782
|
+
lastPublishedAt: null,
|
|
3783
|
+
name: "Unnamed Workspace",
|
|
3784
|
+
publishable: null,
|
|
3785
|
+
realmUserId: "@realm_server:localhost",
|
|
3786
|
+
showAsCatalog: null,
|
|
3787
|
+
visibility: "public"
|
|
3788
|
+
},
|
|
3789
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/mango.json")
|
|
3790
|
+
}
|
|
3791
|
+
}, "mango doc.data is correct");
|
|
3792
|
+
assert.deepEqual(mango.doc.included, [{
|
|
3793
|
+
id: rri(hassanID),
|
|
3794
|
+
type: "card",
|
|
3795
|
+
links: { self: "./hassan" },
|
|
3796
|
+
attributes: {
|
|
3797
|
+
firstName: "Hassan",
|
|
3798
|
+
cardTitle: "Hassan",
|
|
3799
|
+
cardDescription: null,
|
|
3800
|
+
cardThumbnailURL: null,
|
|
3801
|
+
cardInfo
|
|
3802
|
+
},
|
|
3803
|
+
relationships: {
|
|
3804
|
+
"friends.0": {
|
|
3805
|
+
links: { self: "./mango" },
|
|
3806
|
+
data: {
|
|
3807
|
+
type: "card",
|
|
3808
|
+
id: mangoID
|
|
3809
|
+
}
|
|
3810
|
+
},
|
|
3811
|
+
"friends.1": {
|
|
3812
|
+
links: { self: "./vanGogh" },
|
|
3813
|
+
data: {
|
|
3814
|
+
type: "card",
|
|
3815
|
+
id: vanGoghID
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3818
|
+
},
|
|
3819
|
+
meta: {
|
|
3820
|
+
adoptsFrom: friendsRef,
|
|
3821
|
+
lastModified: adapter.lastModifiedMap.get(`${hassanID}.json`),
|
|
3822
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3823
|
+
realmInfo: {
|
|
3824
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3825
|
+
backgroundURL: null,
|
|
3826
|
+
iconURL: null,
|
|
3827
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3828
|
+
lastPublishedAt: null,
|
|
3829
|
+
name: "Unnamed Workspace",
|
|
3830
|
+
publishable: null,
|
|
3831
|
+
realmUserId: "@realm_server:localhost",
|
|
3832
|
+
showAsCatalog: null,
|
|
3833
|
+
visibility: "public"
|
|
3834
|
+
},
|
|
3835
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/hassan.json")
|
|
3836
|
+
}
|
|
3837
|
+
}, {
|
|
3838
|
+
id: rri(vanGoghID),
|
|
3839
|
+
type: "card",
|
|
3840
|
+
links: { self: "./vanGogh" },
|
|
3841
|
+
attributes: {
|
|
3842
|
+
firstName: "Van Gogh",
|
|
3843
|
+
cardTitle: "Van Gogh",
|
|
3844
|
+
cardDescription: null,
|
|
3845
|
+
cardThumbnailURL: null,
|
|
3846
|
+
cardInfo
|
|
3847
|
+
},
|
|
3848
|
+
relationships: { "friends.0": {
|
|
3849
|
+
links: { self: "./hassan" },
|
|
3850
|
+
data: {
|
|
3851
|
+
type: "card",
|
|
3852
|
+
id: hassanID
|
|
3853
|
+
}
|
|
3854
|
+
} },
|
|
3855
|
+
meta: {
|
|
3856
|
+
adoptsFrom: friendsRef,
|
|
3857
|
+
lastModified: adapter.lastModifiedMap.get(`${vanGoghID}.json`),
|
|
3858
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3859
|
+
realmInfo: {
|
|
3860
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3861
|
+
backgroundURL: null,
|
|
3862
|
+
iconURL: null,
|
|
3863
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3864
|
+
lastPublishedAt: null,
|
|
3865
|
+
name: "Unnamed Workspace",
|
|
3866
|
+
publishable: null,
|
|
3867
|
+
realmUserId: "@realm_server:localhost",
|
|
3868
|
+
showAsCatalog: null,
|
|
3869
|
+
visibility: "public"
|
|
3870
|
+
},
|
|
3871
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/vanGogh.json")
|
|
3872
|
+
}
|
|
3873
|
+
}], "mango doc.included is correct");
|
|
3874
|
+
} else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
3875
|
+
let mangoEntry = await getInstance(realm, new URL(mangoID));
|
|
3876
|
+
if (mangoEntry) expectSearchDoc(assert, mangoEntry.searchDoc, {
|
|
3877
|
+
_cardType: "Friends",
|
|
3878
|
+
id: mangoID,
|
|
3879
|
+
firstName: "Mango",
|
|
3880
|
+
cardTitle: "Mango",
|
|
3881
|
+
friends: [{
|
|
3882
|
+
id: hassanID,
|
|
3883
|
+
firstName: "Hassan",
|
|
3884
|
+
cardTitle: "Hassan",
|
|
3885
|
+
friends: [{ id: mangoID }, {
|
|
3886
|
+
id: vanGoghID,
|
|
3887
|
+
firstName: "Van Gogh",
|
|
3888
|
+
cardTitle: "Van Gogh",
|
|
3889
|
+
friends: [{ id: hassanID }],
|
|
3890
|
+
cardTheme: null,
|
|
3891
|
+
cardInfo: {
|
|
3892
|
+
cardThumbnail: null,
|
|
3893
|
+
theme: null
|
|
3894
|
+
}
|
|
3895
|
+
}],
|
|
3896
|
+
cardTheme: null,
|
|
3897
|
+
cardInfo: {
|
|
3898
|
+
cardThumbnail: null,
|
|
3899
|
+
theme: null
|
|
3900
|
+
}
|
|
3901
|
+
}],
|
|
3902
|
+
cardTheme: null,
|
|
3903
|
+
cardInfo: {
|
|
3904
|
+
cardThumbnail: null,
|
|
3905
|
+
theme: null
|
|
3906
|
+
}
|
|
3907
|
+
}, "mango searchData is correct");
|
|
3908
|
+
else assert.ok(false, `could not find ${mangoID} in the index`);
|
|
3909
|
+
let vanGogh = await queryEngine.cardDocument(new URL(vanGoghID), { loadLinks: true });
|
|
3910
|
+
if (vanGogh?.type === "doc") {
|
|
3911
|
+
assert.deepEqual(vanGogh.doc.data, {
|
|
3912
|
+
id: rri(vanGoghID),
|
|
3913
|
+
type: "card",
|
|
3914
|
+
links: { self: "./vanGogh" },
|
|
3915
|
+
attributes: {
|
|
3916
|
+
firstName: "Van Gogh",
|
|
3917
|
+
cardTitle: "Van Gogh",
|
|
3918
|
+
cardDescription: null,
|
|
3919
|
+
cardThumbnailURL: null,
|
|
3920
|
+
cardInfo
|
|
3921
|
+
},
|
|
3922
|
+
relationships: { "friends.0": {
|
|
3923
|
+
links: { self: "./hassan" },
|
|
3924
|
+
data: {
|
|
3925
|
+
type: "card",
|
|
3926
|
+
id: hassanID
|
|
3927
|
+
}
|
|
3928
|
+
} },
|
|
3929
|
+
meta: {
|
|
3930
|
+
adoptsFrom: friendsRef,
|
|
3931
|
+
lastModified: adapter.lastModifiedMap.get(`${vanGoghID}.json`),
|
|
3932
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3933
|
+
realmInfo: {
|
|
3934
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3935
|
+
backgroundURL: null,
|
|
3936
|
+
iconURL: null,
|
|
3937
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3938
|
+
lastPublishedAt: null,
|
|
3939
|
+
name: "Unnamed Workspace",
|
|
3940
|
+
publishable: null,
|
|
3941
|
+
realmUserId: "@realm_server:localhost",
|
|
3942
|
+
showAsCatalog: null,
|
|
3943
|
+
visibility: "public"
|
|
3944
|
+
},
|
|
3945
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/vanGogh.json")
|
|
3946
|
+
}
|
|
3947
|
+
}, "vanGogh doc.data is correct");
|
|
3948
|
+
assert.deepEqual(vanGogh.doc.included, [{
|
|
3949
|
+
id: rri(hassanID),
|
|
3950
|
+
type: "card",
|
|
3951
|
+
links: { self: "./hassan" },
|
|
3952
|
+
attributes: {
|
|
3953
|
+
firstName: "Hassan",
|
|
3954
|
+
cardTitle: "Hassan",
|
|
3955
|
+
cardDescription: null,
|
|
3956
|
+
cardThumbnailURL: null,
|
|
3957
|
+
cardInfo
|
|
3958
|
+
},
|
|
3959
|
+
relationships: {
|
|
3960
|
+
"friends.0": {
|
|
3961
|
+
links: { self: "./mango" },
|
|
3962
|
+
data: {
|
|
3963
|
+
type: "card",
|
|
3964
|
+
id: mangoID
|
|
3965
|
+
}
|
|
3966
|
+
},
|
|
3967
|
+
"friends.1": {
|
|
3968
|
+
links: { self: "./vanGogh" },
|
|
3969
|
+
data: {
|
|
3970
|
+
type: "card",
|
|
3971
|
+
id: vanGoghID
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
},
|
|
3975
|
+
meta: {
|
|
3976
|
+
adoptsFrom: friendsRef,
|
|
3977
|
+
lastModified: adapter.lastModifiedMap.get(`${hassanID}.json`),
|
|
3978
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3979
|
+
realmInfo: {
|
|
3980
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
3981
|
+
backgroundURL: null,
|
|
3982
|
+
iconURL: null,
|
|
3983
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3984
|
+
lastPublishedAt: null,
|
|
3985
|
+
name: "Unnamed Workspace",
|
|
3986
|
+
publishable: null,
|
|
3987
|
+
realmUserId: "@realm_server:localhost",
|
|
3988
|
+
showAsCatalog: null,
|
|
3989
|
+
visibility: "public"
|
|
3990
|
+
},
|
|
3991
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/hassan.json")
|
|
3992
|
+
}
|
|
3993
|
+
}, {
|
|
3994
|
+
id: rri(mangoID),
|
|
3995
|
+
type: "card",
|
|
3996
|
+
links: { self: "./mango" },
|
|
3997
|
+
attributes: {
|
|
3998
|
+
firstName: "Mango",
|
|
3999
|
+
cardTitle: "Mango",
|
|
4000
|
+
cardDescription: null,
|
|
4001
|
+
cardThumbnailURL: null,
|
|
4002
|
+
cardInfo
|
|
4003
|
+
},
|
|
4004
|
+
relationships: { "friends.0": {
|
|
4005
|
+
links: { self: "./hassan" },
|
|
4006
|
+
data: {
|
|
4007
|
+
type: "card",
|
|
4008
|
+
id: hassanID
|
|
4009
|
+
}
|
|
4010
|
+
} },
|
|
4011
|
+
meta: {
|
|
4012
|
+
adoptsFrom: friendsRef,
|
|
4013
|
+
lastModified: adapter.lastModifiedMap.get(`${mangoID}.json`),
|
|
4014
|
+
realmURL: ri("http://test-realm/test/"),
|
|
4015
|
+
realmInfo: {
|
|
4016
|
+
anonymousRateLimitDefault: DEFAULT_ANONYMOUS_RATE_LIMIT,
|
|
4017
|
+
backgroundURL: null,
|
|
4018
|
+
iconURL: null,
|
|
4019
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
4020
|
+
lastPublishedAt: null,
|
|
4021
|
+
name: "Unnamed Workspace",
|
|
4022
|
+
publishable: null,
|
|
4023
|
+
realmUserId: "@realm_server:localhost",
|
|
4024
|
+
showAsCatalog: null,
|
|
4025
|
+
visibility: "public"
|
|
4026
|
+
},
|
|
4027
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/mango.json")
|
|
4028
|
+
}
|
|
4029
|
+
}], "vanGogh doc.included is correct");
|
|
4030
|
+
} else assert.ok(false, `search entry was an error: ${vanGogh?.error.errorDetail.message}`);
|
|
4031
|
+
let vanGoghEntry = await getInstance(realm, new URL(vanGoghID));
|
|
4032
|
+
if (vanGoghEntry) expectSearchDoc(assert, vanGoghEntry.searchDoc, {
|
|
4033
|
+
_cardType: "Friends",
|
|
4034
|
+
id: vanGoghID,
|
|
4035
|
+
firstName: "Van Gogh",
|
|
4036
|
+
cardTitle: "Van Gogh",
|
|
4037
|
+
friends: [{
|
|
4038
|
+
id: hassanID,
|
|
4039
|
+
firstName: "Hassan",
|
|
4040
|
+
cardTitle: "Hassan",
|
|
4041
|
+
friends: [{
|
|
4042
|
+
cardTheme: null,
|
|
4043
|
+
cardInfo: {
|
|
4044
|
+
cardThumbnail: null,
|
|
4045
|
+
theme: null
|
|
4046
|
+
},
|
|
4047
|
+
firstName: "Mango",
|
|
4048
|
+
friends: [{ id: hassanID }],
|
|
4049
|
+
id: mangoID,
|
|
4050
|
+
cardTitle: "Mango"
|
|
4051
|
+
}, { id: vanGoghID }],
|
|
4052
|
+
cardTheme: null,
|
|
4053
|
+
cardInfo: {
|
|
4054
|
+
cardThumbnail: null,
|
|
4055
|
+
theme: null
|
|
4056
|
+
}
|
|
4057
|
+
}],
|
|
4058
|
+
cardTheme: null,
|
|
4059
|
+
cardInfo: {
|
|
4060
|
+
cardThumbnail: null,
|
|
4061
|
+
theme: null
|
|
4062
|
+
}
|
|
4063
|
+
}, "vanGogh searchData is correct");
|
|
4064
|
+
else assert.ok(false, `could not find ${vanGoghID} in the index`);
|
|
4065
|
+
});
|
|
4066
|
+
(0, import_qunit.test)("indexing identifies an instance's card references", async function(assert) {
|
|
4067
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4068
|
+
mockMatrixUtils,
|
|
4069
|
+
contents: { "person-1.json": { data: {
|
|
4070
|
+
attributes: { firstName: "Mango" },
|
|
4071
|
+
meta: { adoptsFrom: {
|
|
4072
|
+
module: `${testModuleRealm}person`,
|
|
4073
|
+
name: "Person"
|
|
4074
|
+
} }
|
|
4075
|
+
} } }
|
|
4076
|
+
});
|
|
4077
|
+
let refs = (await getInstance(realm, new URL(`${testRealmURL}person-1`)))?.deps;
|
|
4078
|
+
assert.deepEqual(refs.sort().filter((ref) => !ref.includes("glimmer-scoped.css")), [
|
|
4079
|
+
"@cardstack/base/card-api",
|
|
4080
|
+
"@cardstack/base/number",
|
|
4081
|
+
"@cardstack/base/searchable",
|
|
4082
|
+
"@cardstack/base/string",
|
|
4083
|
+
"https://localhost:4202/test/person",
|
|
4084
|
+
"https://packages/@cardstack/boxel-host/commands/create-ai-assistant-room",
|
|
4085
|
+
"https://packages/@cardstack/boxel-host/commands/send-ai-assistant-message",
|
|
4086
|
+
"https://packages/@ember/component",
|
|
4087
|
+
"https://packages/@ember/modifier",
|
|
4088
|
+
"https://packages/@ember/template-factory"
|
|
4089
|
+
].sort(), "the card references for the instance are correct");
|
|
4090
|
+
});
|
|
4091
|
+
(0, import_qunit.test)("indexing identifies an instance's polymorphic contained references", async function(assert) {
|
|
4092
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4093
|
+
mockMatrixUtils,
|
|
4094
|
+
contents: { "spec-1.json": { data: {
|
|
4095
|
+
attributes: {
|
|
4096
|
+
cardTitle: "My Spec",
|
|
4097
|
+
containedExamples: [{
|
|
4098
|
+
firstName: "A",
|
|
4099
|
+
lastName: "B"
|
|
4100
|
+
}]
|
|
4101
|
+
},
|
|
4102
|
+
meta: {
|
|
4103
|
+
adoptsFrom: {
|
|
4104
|
+
module: `${baseRealmRRI}spec`,
|
|
4105
|
+
name: "Spec"
|
|
4106
|
+
},
|
|
4107
|
+
fields: { containedExamples: [{ adoptsFrom: {
|
|
4108
|
+
module: `${testModuleRealm}person`,
|
|
4109
|
+
name: "PersonField"
|
|
4110
|
+
} }] }
|
|
4111
|
+
}
|
|
4112
|
+
} } }
|
|
4113
|
+
});
|
|
4114
|
+
let refs = (await getInstance(realm, new URL(`${realm.url}spec-1`)))?.deps;
|
|
4115
|
+
assert.deepEqual(refs.sort().filter((ref) => !ref.includes("glimmer-scoped.css")), [
|
|
4116
|
+
"@cardstack/base/card-api",
|
|
4117
|
+
"@cardstack/base/number",
|
|
4118
|
+
"@cardstack/base/searchable",
|
|
4119
|
+
"@cardstack/base/spec",
|
|
4120
|
+
"@cardstack/base/string",
|
|
4121
|
+
"https://localhost:4202/test/person",
|
|
4122
|
+
"https://packages/@cardstack/boxel-host/commands/create-ai-assistant-room",
|
|
4123
|
+
"https://packages/@cardstack/boxel-host/commands/send-ai-assistant-message",
|
|
4124
|
+
"https://packages/@ember/component",
|
|
4125
|
+
"https://packages/@ember/modifier",
|
|
4126
|
+
"https://packages/@ember/template-factory"
|
|
4127
|
+
].sort(), "the card references for the instance are correct");
|
|
4128
|
+
});
|
|
4129
|
+
(0, import_qunit.test)("search index does not contain entries that match patterns in ignore files", async function(assert) {
|
|
4130
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4131
|
+
mockMatrixUtils,
|
|
4132
|
+
contents: {
|
|
4133
|
+
"ignore-me-1.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4134
|
+
"posts/nested.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4135
|
+
"posts/please-ignore-me.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4136
|
+
"posts/ignore-me-2.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4137
|
+
".git/should-not-index.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4138
|
+
"post.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4139
|
+
"dir/card.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4140
|
+
".gitignore": `
|
|
4141
|
+
ignore-me*.json
|
|
4142
|
+
dir/
|
|
4143
|
+
posts/please-ignore-me.json
|
|
4144
|
+
`
|
|
4145
|
+
}
|
|
4146
|
+
});
|
|
4147
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
4148
|
+
{
|
|
4149
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}posts/please-ignore-me`));
|
|
4150
|
+
assert.deepEqual(card, void 0, "instance does not exist because file is ignored");
|
|
4151
|
+
}
|
|
4152
|
+
{
|
|
4153
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}dir/card`));
|
|
4154
|
+
assert.deepEqual(card, void 0, "instance does not exist because file is ignored");
|
|
4155
|
+
}
|
|
4156
|
+
{
|
|
4157
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}ignore-me-1`));
|
|
4158
|
+
assert.deepEqual(card, void 0, "instance does not exist because file is ignored");
|
|
4159
|
+
}
|
|
4160
|
+
{
|
|
4161
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}posts/ignore-me-2`));
|
|
4162
|
+
assert.deepEqual(card, void 0, "instance does not exist because file is ignored");
|
|
4163
|
+
}
|
|
4164
|
+
{
|
|
4165
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}.git/should-not-index`));
|
|
4166
|
+
assert.strictEqual(card, void 0, ".git directory entries are ignored");
|
|
4167
|
+
}
|
|
4168
|
+
{
|
|
4169
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}post`));
|
|
4170
|
+
assert.ok(card, "instance exists");
|
|
4171
|
+
}
|
|
4172
|
+
{
|
|
4173
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}posts/nested`));
|
|
4174
|
+
assert.ok(card, "instance exists");
|
|
4175
|
+
}
|
|
4176
|
+
});
|
|
4177
|
+
(0, import_qunit.test)("can ignore files listed in .boxelignore alongside .gitignore", async function(assert) {
|
|
4178
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4179
|
+
mockMatrixUtils,
|
|
4180
|
+
contents: {
|
|
4181
|
+
"post.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4182
|
+
"post.draft.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4183
|
+
"scripts/tool.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4184
|
+
"git-ignored.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4185
|
+
".gitignore": `
|
|
4186
|
+
git-ignored.json
|
|
4187
|
+
`,
|
|
4188
|
+
".boxelignore": `
|
|
4189
|
+
*.draft.json
|
|
4190
|
+
scripts/
|
|
4191
|
+
`
|
|
4192
|
+
}
|
|
4193
|
+
});
|
|
4194
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
4195
|
+
for (let path of [
|
|
4196
|
+
"post.draft",
|
|
4197
|
+
"scripts/tool",
|
|
4198
|
+
"git-ignored"
|
|
4199
|
+
]) assert.strictEqual(await indexer.cardDocument(new URL(`${testRealmURL}${path}`)), void 0, `${path} is not indexed because it is ignored`);
|
|
4200
|
+
assert.ok(await indexer.cardDocument(new URL(`${testRealmURL}post`)), "instance exists");
|
|
4201
|
+
});
|
|
4202
|
+
(0, import_qunit.test)("a from-scratch index removes the rows of a file that has since been ignored", async function(assert) {
|
|
4203
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
4204
|
+
mockMatrixUtils,
|
|
4205
|
+
contents: {
|
|
4206
|
+
"post.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4207
|
+
"draft.json": { data: { meta: { adoptsFrom: baseCardRef } } }
|
|
4208
|
+
}
|
|
4209
|
+
});
|
|
4210
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
4211
|
+
assert.ok(await indexer.cardDocument(new URL(`${testRealmURL}draft`)), "draft is indexed before it is ignored");
|
|
4212
|
+
await adapter.write(".boxelignore", "draft.json\n");
|
|
4213
|
+
await realm.fullIndex();
|
|
4214
|
+
assert.strictEqual(await indexer.cardDocument(new URL(`${testRealmURL}draft`)), void 0, "draft is no longer indexed");
|
|
4215
|
+
assert.ok(await indexer.cardDocument(new URL(`${testRealmURL}post`)), "post is still indexed");
|
|
4216
|
+
});
|
|
4217
|
+
(0, import_qunit.test)("a .boxelignore that lists itself keeps applying on every from-scratch index", async function(assert) {
|
|
4218
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
4219
|
+
mockMatrixUtils,
|
|
4220
|
+
contents: {
|
|
4221
|
+
"post.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4222
|
+
"draft.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4223
|
+
".boxelignore": `
|
|
4224
|
+
.boxelignore
|
|
4225
|
+
draft.json
|
|
4226
|
+
`
|
|
4227
|
+
}
|
|
4228
|
+
});
|
|
4229
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
4230
|
+
for (let pass of [1, 2]) {
|
|
4231
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
4232
|
+
await adapter.write("post.json", JSON.stringify({ data: { meta: { adoptsFrom: baseCardRef } } }));
|
|
4233
|
+
await realm.fullIndex();
|
|
4234
|
+
assert.strictEqual(await indexer.cardDocument(new URL(`${testRealmURL}draft`)), void 0, `draft is still ignored after from-scratch pass ${pass}`);
|
|
4235
|
+
}
|
|
4236
|
+
});
|
|
4237
|
+
(0, import_qunit.test)("incremental indexing doesn't process ignored files", async function(assert) {
|
|
4238
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4239
|
+
mockMatrixUtils,
|
|
4240
|
+
contents: {
|
|
4241
|
+
"posts/ignore-me.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
4242
|
+
".gitignore": `
|
|
4243
|
+
posts/ignore-me.json
|
|
4244
|
+
`
|
|
4245
|
+
}
|
|
4246
|
+
});
|
|
4247
|
+
let realmIndexUpdater = realm.realmIndexUpdater;
|
|
4248
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
4249
|
+
await realmIndexUpdater.update([new URL(`${testRealmURL}posts/ignore-me.json`)]);
|
|
4250
|
+
let instance = await queryEngine.cardDocument(new URL(`${testRealmURL}posts/ignore-me`));
|
|
4251
|
+
assert.strictEqual(instance, void 0, "instance does not exist because file is ignored");
|
|
4252
|
+
assert.strictEqual(realmIndexUpdater.stats.instancesIndexed, 0, "no instances were processed");
|
|
4253
|
+
});
|
|
4254
|
+
(0, import_qunit.test)("isolated HTML for the default CardsGrid realm-index card is replaced with the boilerplate when realm has not opted in", async function(assert) {
|
|
4255
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4256
|
+
mockMatrixUtils,
|
|
4257
|
+
contents: {
|
|
4258
|
+
"index.json": { data: {
|
|
4259
|
+
type: "card",
|
|
4260
|
+
attributes: {},
|
|
4261
|
+
meta: { adoptsFrom: {
|
|
4262
|
+
module: "@cardstack/base/cards-grid",
|
|
4263
|
+
name: "CardsGrid"
|
|
4264
|
+
} }
|
|
4265
|
+
} },
|
|
4266
|
+
"realm.json": { data: {
|
|
4267
|
+
type: "card",
|
|
4268
|
+
attributes: {},
|
|
4269
|
+
meta: { adoptsFrom: {
|
|
4270
|
+
module: "@cardstack/base/realm-config",
|
|
4271
|
+
name: "RealmConfig"
|
|
4272
|
+
} }
|
|
4273
|
+
} }
|
|
4274
|
+
}
|
|
4275
|
+
});
|
|
4276
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}index`));
|
|
4277
|
+
assert.ok(entry, "realm index card is indexed");
|
|
4278
|
+
assert.strictEqual(entry?.isolatedHtml, REALM_INDEX_BOILERPLATE_HTML, "isolated_html is the boilerplate constant when the realm has not opted in");
|
|
4279
|
+
let embeddedHtml = entry?.embeddedHtml ?? {};
|
|
4280
|
+
assert.ok(Object.keys(embeddedHtml).length > 0, "embedded HTML map is populated");
|
|
4281
|
+
assert.ok(Object.values(embeddedHtml).every((html) => html.length > 0), "every embedded HTML entry has real content");
|
|
4282
|
+
let fittedHtml = entry?.fittedHtml ?? {};
|
|
4283
|
+
assert.ok(Object.keys(fittedHtml).length > 0, "fitted HTML map is populated");
|
|
4284
|
+
assert.ok(Object.values(fittedHtml).every((html) => html.length > 0), "every fitted HTML entry has real content");
|
|
4285
|
+
});
|
|
4286
|
+
(0, import_qunit.test)("isolated HTML for the default CardsGrid realm-index card is rendered normally when realm has opted in", async function(assert) {
|
|
4287
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4288
|
+
mockMatrixUtils,
|
|
4289
|
+
contents: {
|
|
4290
|
+
"index.json": { data: {
|
|
4291
|
+
type: "card",
|
|
4292
|
+
attributes: {},
|
|
4293
|
+
meta: { adoptsFrom: {
|
|
4294
|
+
module: "@cardstack/base/cards-grid",
|
|
4295
|
+
name: "CardsGrid"
|
|
4296
|
+
} }
|
|
4297
|
+
} },
|
|
4298
|
+
"realm.json": { data: {
|
|
4299
|
+
type: "card",
|
|
4300
|
+
attributes: { includePrerenderedDefaultRealmIndex: true },
|
|
4301
|
+
meta: { adoptsFrom: {
|
|
4302
|
+
module: "@cardstack/base/realm-config",
|
|
4303
|
+
name: "RealmConfig"
|
|
4304
|
+
} }
|
|
4305
|
+
} }
|
|
4306
|
+
}
|
|
4307
|
+
});
|
|
4308
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}index`));
|
|
4309
|
+
assert.ok(entry, "realm index card is indexed");
|
|
4310
|
+
assert.notStrictEqual(entry?.isolatedHtml, REALM_INDEX_BOILERPLATE_HTML, "isolated_html is not the boilerplate when the realm has opted in");
|
|
4311
|
+
assert.ok(entry?.isolatedHtml, "isolated_html is set");
|
|
4312
|
+
assert.ok((entry?.isolatedHtml ?? "").length > 0, "isolated_html has real content");
|
|
4313
|
+
});
|
|
4314
|
+
(0, import_qunit.test)("isolated HTML for a default Workspace realm-index card is replaced with the boilerplate when realm has not opted in", async function(assert) {
|
|
4315
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4316
|
+
mockMatrixUtils,
|
|
4317
|
+
contents: {
|
|
4318
|
+
"index.json": { data: {
|
|
4319
|
+
type: "card",
|
|
4320
|
+
attributes: {},
|
|
4321
|
+
meta: { adoptsFrom: {
|
|
4322
|
+
module: "@cardstack/base/workspace",
|
|
4323
|
+
name: "Workspace"
|
|
4324
|
+
} }
|
|
4325
|
+
} },
|
|
4326
|
+
"realm.json": { data: {
|
|
4327
|
+
type: "card",
|
|
4328
|
+
attributes: {},
|
|
4329
|
+
meta: { adoptsFrom: {
|
|
4330
|
+
module: "@cardstack/base/realm-config",
|
|
4331
|
+
name: "RealmConfig"
|
|
4332
|
+
} }
|
|
4333
|
+
} }
|
|
4334
|
+
}
|
|
4335
|
+
});
|
|
4336
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}index`));
|
|
4337
|
+
assert.ok(entry, "realm index card is indexed");
|
|
4338
|
+
assert.strictEqual(entry?.isolatedHtml, REALM_INDEX_BOILERPLATE_HTML, "isolated_html is the boilerplate constant when a Workspace-indexed realm has not opted in");
|
|
4339
|
+
});
|
|
4340
|
+
(0, import_qunit.test)("isolated HTML for a non-CardsGrid index card is rendered normally regardless of opt-in", async function(assert) {
|
|
4341
|
+
class PlainHomePage extends CardDef {
|
|
4342
|
+
static displayName = "Plain Home Page";
|
|
4343
|
+
static {
|
|
4344
|
+
decorateFieldV2(this.prototype, "title", [field], function() {
|
|
4345
|
+
return contains(string_default);
|
|
4346
|
+
});
|
|
4347
|
+
}
|
|
4348
|
+
#title = (initializeDeferredDecorator(this, "title"), void 0);
|
|
4349
|
+
static isolated = class Isolated extends Component$1 {
|
|
4350
|
+
static {
|
|
4351
|
+
setComponentTemplate(templateFactory({
|
|
4352
|
+
"id": "WwNp1MCh",
|
|
4353
|
+
"block": "[[[10,\"h1\"],[14,\"data-test-plain-home\",\"\"],[12],[8,[30,1,[\"title\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
4354
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
4355
|
+
"isStrictMode": true
|
|
4356
|
+
}), this);
|
|
4357
|
+
}
|
|
4358
|
+
};
|
|
4359
|
+
}
|
|
4360
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
4361
|
+
mockMatrixUtils,
|
|
4362
|
+
contents: {
|
|
4363
|
+
"home.gts": { PlainHomePage },
|
|
4364
|
+
"index.json": { data: {
|
|
4365
|
+
type: "card",
|
|
4366
|
+
attributes: { title: "Welcome" },
|
|
4367
|
+
meta: { adoptsFrom: {
|
|
4368
|
+
module: `${testRealmURL}home`,
|
|
4369
|
+
name: "PlainHomePage"
|
|
4370
|
+
} }
|
|
4371
|
+
} }
|
|
4372
|
+
}
|
|
4373
|
+
});
|
|
4374
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}index`));
|
|
4375
|
+
assert.ok(entry, "realm index card is indexed");
|
|
4376
|
+
assert.notStrictEqual(entry?.isolatedHtml, REALM_INDEX_BOILERPLATE_HTML, "isolated_html is not the boilerplate when the index is a non-CardsGrid card");
|
|
4377
|
+
assertInnerHtmlMatches(assert, entry?.isolatedHtml, `<h1 data-test-plain-home> Welcome </h1>`);
|
|
4378
|
+
});
|
|
4379
|
+
});
|
|
4380
|
+
//#endregion
|