@cardstack/boxel-cli 0.3.2-unstable.58 → 0.3.2-unstable.60
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/api.ts +3 -3
- package/bundled-realms/base/command.gts +73 -0
- package/bundled-test-harness/assets/adapter-TgpmkD23.js +2 -0
- package/bundled-test-harness/assets/add-field-to-card-definition-command-test-BVVD6_Wq.js +111 -0
- package/bundled-test-harness/assets/add-workspace-test-BvvYJ2Fk.js +71 -0
- package/bundled-test-harness/assets/ai-assistant-Ba_RBqf6.js +129 -0
- package/bundled-test-harness/assets/ai-assistant-panel-service-test-DK87n1hh.js +95 -0
- package/bundled-test-harness/assets/ai-assistant-test-CZATBlJS.js +2137 -0
- package/bundled-test-harness/assets/ai-function-generation-test-e58MHziu.js +996 -0
- package/bundled-test-harness/assets/ai-module-creation-test-CEieL3Fa.js +150 -0
- package/bundled-test-harness/assets/aibot-message-DhTbAqNk.js +1185 -0
- package/bundled-test-harness/assets/amd-transpile-test-CSk5COu7.js +425 -0
- package/bundled-test-harness/assets/app-Btfy4HWI.js +21464 -0
- package/bundled-test-harness/assets/apply-boxel-formatting-test-BHTP9NBp.js +134 -0
- package/bundled-test-harness/assets/apply-markdown-edit-test-BETCndeK.js +230 -0
- package/bundled-test-harness/assets/apply-search-replace-block-test-KNolar0-.js +630 -0
- package/bundled-test-harness/assets/arc-CA8yZ0zo.js +199 -0
- package/bundled-test-harness/assets/architecture-7EHR7CIX-C5JFMGdb.js +3 -0
- package/bundled-test-harness/assets/architectureDiagram-3BPJPVTR-CmVPjKgm.js +7400 -0
- package/bundled-test-harness/assets/auth-error-guard-test-D0rKESg_.js +30 -0
- package/bundled-test-harness/assets/auth-service-worker-test-DGg_vbKo.js +538 -0
- package/bundled-test-harness/assets/authed-fetch-test-CHF3eh_H.js +75 -0
- package/bundled-test-harness/assets/avif-image-def-test-p9tiyh4_.js +186 -0
- package/bundled-test-harness/assets/base-realm-Chjzrp6m.js +2 -0
- package/bundled-test-harness/assets/base-realm-DpSTsZxD.js +140 -0
- package/bundled-test-harness/assets/basic-test-D7qEz4hw.js +128 -0
- package/bundled-test-harness/assets/bfm-card-references-test-D-m1YnL8.js +577 -0
- package/bundled-test-harness/assets/binary-upload-dedupe-test-8RKK73EG.js +308 -0
- package/bundled-test-harness/assets/blockDiagram-GPEHLZMM-BdVFTa2C.js +4355 -0
- package/bundled-test-harness/assets/bot-registration-test-9zYny2wR.js +99 -0
- package/bundled-test-harness/assets/box-test-0T92xi3A.js +51 -0
- package/bundled-test-harness/assets/brand-guide-attachments-test-5ZtPn4cC.js +87 -0
- package/bundled-test-harness/assets/brand-guide-custom-css-test-CKKSgKyp.js +135 -0
- package/bundled-test-harness/assets/brand-logo-mark-field-test-nlNNQ3rw.js +87 -0
- package/bundled-test-harness/assets/broken-link-template-test-BGIExVof.js +345 -0
- package/bundled-test-harness/assets/browser-index-BaR-gTqG.js +3 -0
- package/bundled-test-harness/assets/browser-index-G4NKYBAj.js +8802 -0
- package/bundled-test-harness/assets/c4Diagram-AAUBKEIU-DyugX7zz.js +3764 -0
- package/bundled-test-harness/assets/cached-fetch-test-MtqvDphJ.js +93 -0
- package/bundled-test-harness/assets/can-read-realm-test-BZmwIOqS.js +58 -0
- package/bundled-test-harness/assets/cancel-indexing-job-test-BsQtQbDu.js +71 -0
- package/bundled-test-harness/assets/card-api-test-BxQ8f0-c.js +196 -0
- package/bundled-test-harness/assets/card-basics-test-B-uBZ8o4.js +4895 -0
- package/bundled-test-harness/assets/card-catalog-test-YmwmyIKf.js +377 -0
- package/bundled-test-harness/assets/card-copy-test-LoqdH1CQ.js +777 -0
- package/bundled-test-harness/assets/card-def-field-def-relationships-test-DvtBA1jv.js +560 -0
- package/bundled-test-harness/assets/card-def-menu-items-test-DHnd0LuM.js +182 -0
- package/bundled-test-harness/assets/card-delete-test-vKF0Jf1X.js +412 -0
- package/bundled-test-harness/assets/card-directory-name-test-CbCuPwSz.js +71 -0
- package/bundled-test-harness/assets/card-playground-test-CRIP3b5-.js +1497 -0
- package/bundled-test-harness/assets/card-prerender-ClYlSOBU.js +12661 -0
- package/bundled-test-harness/assets/card-search-adorn-test-Mggk5ZgY.js +128 -0
- package/bundled-test-harness/assets/card-search-query-builder-test-Cdl12s50.js +88 -0
- package/bundled-test-harness/assets/card-search-selection-menu-test-CtuCCLoB.js +108 -0
- package/bundled-test-harness/assets/channel-BKUMepxs.js +8 -0
- package/bundled-test-harness/assets/check-correctness-test-DBh8DT_f.js +252 -0
- package/bundled-test-harness/assets/chunk-2J33WTMH-ClrRoNQU.js +31 -0
- package/bundled-test-harness/assets/chunk-3OPIFGDE-g_0Oh8jN.js +5548 -0
- package/bundled-test-harness/assets/chunk-4BX2VUAB-D2LCc7Y9.js +11 -0
- package/bundled-test-harness/assets/chunk-4EGX6M5U-D8vRS5IG.js +44 -0
- package/bundled-test-harness/assets/chunk-55IACEB6-C5j4VAmb.js +10 -0
- package/bundled-test-harness/assets/chunk-5DO6E6H7-CPb3jsP0.js +27 -0
- package/bundled-test-harness/assets/chunk-5ZQYHXKU-BlVb7vgG.js +1767 -0
- package/bundled-test-harness/assets/chunk-727SXJPM-C_NVCDMC.js +3877 -0
- package/bundled-test-harness/assets/chunk-AQP2D5EJ-CpwrMix_.js +2622 -0
- package/bundled-test-harness/assets/chunk-BR22UD5L-AF0NWdjT.js +85 -0
- package/bundled-test-harness/assets/chunk-BSJP7CBP-Dgun5vYb.js +114 -0
- package/bundled-test-harness/assets/chunk-CSCIHK7Q-D7nFiAZ-.js +6144 -0
- package/bundled-test-harness/assets/chunk-FHYWG6QK-2nuXS9PL.js +27 -0
- package/bundled-test-harness/assets/chunk-FMBD7UC4-O-Y8VK1S.js +20 -0
- package/bundled-test-harness/assets/chunk-KSCS5N6A-Du5-DprU.js +871 -0
- package/bundled-test-harness/assets/chunk-L5ZTLDWV-C2lDtkix.js +43 -0
- package/bundled-test-harness/assets/chunk-LZXEDZCA-qAMsMZkF.js +65 -0
- package/bundled-test-harness/assets/chunk-MPE355IW-DcT_60Oq.js +27 -0
- package/bundled-test-harness/assets/chunk-MZUSXYTE-BsH_YmnC.js +36 -0
- package/bundled-test-harness/assets/chunk-N66VUXT2-DMyMHgoS.js +70 -0
- package/bundled-test-harness/assets/chunk-ND2GUHAM-DO1Znn8O.js +93 -0
- package/bundled-test-harness/assets/chunk-NZK2D7GU-B1YWBxHm.js +89 -0
- package/bundled-test-harness/assets/chunk-O5CBEL6O-CZVSBsRq.js +2395 -0
- package/bundled-test-harness/assets/chunk-PUPMXCY4-DzOK-Vbt.js +27 -0
- package/bundled-test-harness/assets/chunk-QZHKN3VN-DJFnRn99.js +20 -0
- package/bundled-test-harness/assets/chunk-UIBZB4QT-5KIxBxjk.js +27 -0
- package/bundled-test-harness/assets/chunk-WCWK7LTN-BsQwhliq.js +36 -0
- package/bundled-test-harness/assets/chunk-WU5MYG2G-DUVb5MAo.js +12 -0
- package/bundled-test-harness/assets/chunk-XPW4576I-DLaJYAOU.js +2341 -0
- package/bundled-test-harness/assets/classDiagram-4FO5ZUOK-DjP2uozG.js +31 -0
- package/bundled-test-harness/assets/classDiagram-v2-Q7XG4LA2-Dt6ps5uz.js +31 -0
- package/bundled-test-harness/assets/code-equality-assertion-BBezFT13.js +474 -0
- package/bundled-test-harness/assets/code-patches-test-DzoQGARM.js +1128 -0
- package/bundled-test-harness/assets/code-patching-test-D8r-pJ5w.js +114 -0
- package/bundled-test-harness/assets/code-ref-test-DU3HChNz.js +138 -0
- package/bundled-test-harness/assets/code-semantics-service-test-DArUotKy.js +65 -0
- package/bundled-test-harness/assets/code-submode-test-h5wWKsz2.js +1762 -0
- package/bundled-test-harness/assets/codeblocks-test-FbuwTy5v.js +492 -0
- package/bundled-test-harness/assets/codemirror-context-DVlC9C78.js +2 -0
- package/bundled-test-harness/assets/codemirror-editor-test-JDT9uwqM.js +1176 -0
- package/bundled-test-harness/assets/color-field-test-BssRlQAX.js +213 -0
- package/bundled-test-harness/assets/command-definitions-test-J21kOxBs.js +72 -0
- package/bundled-test-harness/assets/commands-DAo0DgCX.js +1379 -0
- package/bundled-test-harness/assets/commands-calling-test-C3deVvv_.js +200 -0
- package/bundled-test-harness/assets/commands-test--0zViqs2.js +1041 -0
- package/bundled-test-harness/assets/commands-test-BwNn2npL.js +1145 -0
- package/bundled-test-harness/assets/computed-test-BD_KrZmc.js +882 -0
- package/bundled-test-harness/assets/container-C8gu0I0Q.js +14605 -0
- package/bundled-test-harness/assets/convert-to-class-name-test-CX21VRzM.js +17 -0
- package/bundled-test-harness/assets/copy-and-edit-test-BUy_o8XJ.js +291 -0
- package/bundled-test-harness/assets/copy-card-test-LWbugEPe.js +156 -0
- package/bundled-test-harness/assets/copy-file-to-realm-test-BS25EUGV.js +99 -0
- package/bundled-test-harness/assets/copy-source-test-Dh33cqM8.js +56 -0
- package/bundled-test-harness/assets/cose-bilkent-S5V4N54A-CjAFDdpS.js +4275 -0
- package/bundled-test-harness/assets/create-file-test-DOc3YYij.js +963 -0
- package/bundled-test-harness/assets/create-file-test-DgUya7-i.js +397 -0
- package/bundled-test-harness/assets/create-listing-modal-test-DZxZBYS7.js +194 -0
- package/bundled-test-harness/assets/create-listing-pr-request-Aw0ms76l.js +64 -0
- package/bundled-test-harness/assets/create-listing-pr-request-test-CFvqkgky.js +117 -0
- package/bundled-test-harness/assets/create-spec-test-BTRt8oe8.js +239 -0
- package/bundled-test-harness/assets/csv-file-def-test-BVffg8wL.js +101 -0
- package/bundled-test-harness/assets/dagre-BM42HDAG-GoRrN65x.js +606 -0
- package/bundled-test-harness/assets/dagre-ByxOOmYM.js +4195 -0
- package/bundled-test-harness/assets/date-time-fields-test-BEcfCqgB.js +322 -0
- package/bundled-test-harness/assets/debug-message-test-CAxbe6x2.js +119 -0
- package/bundled-test-harness/assets/diagram-2AECGRRQ-B6-pvp9H.js +279 -0
- package/bundled-test-harness/assets/diagram-5GNKFQAL-C9M7hXIc.js +142 -0
- package/bundled-test-harness/assets/diagram-KO2AKTUF-BNJvCLGK.js +551 -0
- package/bundled-test-harness/assets/diagram-LMA3HP47-hlJyTtqP.js +184 -0
- package/bundled-test-harness/assets/diagram-OG6HWLK6-BvPoB3IH.js +857 -0
- package/bundled-test-harness/assets/diffing-test-De9Ev_Fr.js +210 -0
- package/bundled-test-harness/assets/dist-BsEojs3T.js +232 -0
- package/bundled-test-harness/assets/dist-CY3T64Hs.js +105 -0
- package/bundled-test-harness/assets/dist-q2xz8RMj.js +2 -0
- package/bundled-test-harness/assets/editor-test-DOI_TvWQ.js +551 -0
- package/bundled-test-harness/assets/editor.main-CpuM6HrX.js +43566 -0
- package/bundled-test-harness/assets/editor.main-DkMgS1qm.js +3 -0
- package/bundled-test-harness/assets/email-field-test-t-80Z94b.js +74 -0
- package/bundled-test-harness/assets/enum-field-test-DVp-2pip.js +909 -0
- package/bundled-test-harness/assets/erDiagram-TEJ5UH35-CYniRkua.js +2041 -0
- package/bundled-test-harness/assets/error-display-test-IuRxKyLz.js +343 -0
- package/bundled-test-harness/assets/evaluate-module-test-DdnfbFp-.js +66 -0
- package/bundled-test-harness/assets/eventmodeling-FCH6USID-BO089-Cs.js +3 -0
- package/bundled-test-harness/assets/execute-atomic-operations-test-CgbvrBlu.js +75 -0
- package/bundled-test-harness/assets/externals-5atxeNU4.js +5533 -0
- package/bundled-test-harness/assets/extract-css-variables-test-Cii-CYfc.js +169 -0
- package/bundled-test-harness/assets/fallback-banner-test-CUUd-Wuu.js +227 -0
- package/bundled-test-harness/assets/fallback-banner-test-D4NWyahM.js +53 -0
- package/bundled-test-harness/assets/fallback-models-test-2MJ1jAs8.js +163 -0
- package/bundled-test-harness/assets/fetch-card-json-test-Cruqsq6S.js +63 -0
- package/bundled-test-harness/assets/fetcher-test-CkHlbTzz.js +85 -0
- package/bundled-test-harness/assets/field-configuration-test-CqwsGNib.js +535 -0
- package/bundled-test-harness/assets/field-markdown-domain-test-DPjz8i4Y.js +615 -0
- package/bundled-test-harness/assets/field-markdown-primitives-test-Dw07UtT7.js +362 -0
- package/bundled-test-harness/assets/field-markdown-specialized-test-C-t34PAw.js +527 -0
- package/bundled-test-harness/assets/field-path-parser-test-BeNjacPu.js +387 -0
- package/bundled-test-harness/assets/field-playground-test-BILTGxqr.js +902 -0
- package/bundled-test-harness/assets/field-support-predicates-test-Df24w0Wa.js +170 -0
- package/bundled-test-harness/assets/field-test-helpers-P22hxBNz.js +45 -0
- package/bundled-test-harness/assets/file-attachment-test-Cjg4NBeM.js +635 -0
- package/bundled-test-harness/assets/file-chooser-test-Cl0XujPT.js +439 -0
- package/bundled-test-harness/assets/file-def-live-reload-test-D4Obzi12.js +50 -0
- package/bundled-test-harness/assets/file-def-manager-DUgR-gjs.js +470 -0
- package/bundled-test-harness/assets/file-def-manager-canonicalize-test-D_LWVsvz.js +451 -0
- package/bundled-test-harness/assets/file-def-menu-items-test-xvsUTOK4.js +114 -0
- package/bundled-test-harness/assets/file-def-navigation-test-DxPceB7E.js +109 -0
- package/bundled-test-harness/assets/file-def-serialization-test-CpwbDb8p.js +87 -0
- package/bundled-test-harness/assets/file-def-test-CEnKcvW9.js +219 -0
- package/bundled-test-harness/assets/file-tree-test-DE2aH6iq.js +773 -0
- package/bundled-test-harness/assets/flac-audio-def-test-BCg7LnR6.js +138 -0
- package/bundled-test-harness/assets/flowDiagram-I6XJVG4X-Xv8-LIxQ.js +4883 -0
- package/bundled-test-harness/assets/formatted-aibot-message-test-CsxFn62P.js +366 -0
- package/bundled-test-harness/assets/formatted-user-message-test-DjZc8qnA.js +43 -0
- package/bundled-test-harness/assets/freestyle-test-QEZaZCNJ.js +17 -0
- package/bundled-test-harness/assets/full-reindex-realm-test-C_c2OTTD.js +103 -0
- package/bundled-test-harness/assets/ganttDiagram-6RSMTGT7-DmvkzS5w.js +4060 -0
- package/bundled-test-harness/assets/garbage-collection-test-BVuvfidI.js +373 -0
- package/bundled-test-harness/assets/general-test-Ydis4jEq.js +926 -0
- package/bundled-test-harness/assets/generate-css-variables-test-CZCmgTAO.js +88 -0
- package/bundled-test-harness/assets/generate-example-cards-one-shot-test-x_szhkSN.js +67 -0
- package/bundled-test-harness/assets/get-available-realm-identifiers-test-DvRnwCHR.js +49 -0
- package/bundled-test-harness/assets/get-catalog-realm-identifiers-test-46TE-XA0.js +49 -0
- package/bundled-test-harness/assets/get-default-writable-realm-test-DaAkxTNh.js +56 -0
- package/bundled-test-harness/assets/get-realm-of-resource-identifier-test-9XEGHVOV.js +55 -0
- package/bundled-test-harness/assets/get-relationship-membership-state-test-BY4gk5JZ.js +1306 -0
- package/bundled-test-harness/assets/get-type-refs-from-filter-test-BynlX0JE.js +136 -0
- package/bundled-test-harness/assets/get-user-system-card-test-D98Xxn1k.js +52 -0
- package/bundled-test-harness/assets/gif-image-def-test-FwKGFGWw.js +161 -0
- package/bundled-test-harness/assets/gitGraph-WXDBUCRP-Bmn0Z_Xi.js +3 -0
- package/bundled-test-harness/assets/gitGraphDiagram-PVQCEYII-BAo0G82W.js +1150 -0
- package/bundled-test-harness/assets/gts-file-def-test-ivEk8Muv.js +99 -0
- package/bundled-test-harness/assets/head-format-preview-test-CNhvk724.js +156 -0
- package/bundled-test-harness/assets/helpers-BH4Yfo_2.js +5 -0
- package/bundled-test-harness/assets/host-mode-test-BRNndb2h.js +391 -0
- package/bundled-test-harness/assets/host-submode-test-DHd0x-6x.js +904 -0
- package/bundled-test-harness/assets/index-query-engine-test-7Fzc09fG.js +2548 -0
- package/bundled-test-harness/assets/index-writer-test-D3cL2q2N.js +1842 -0
- package/bundled-test-harness/assets/indexeddb-crypto-store-C09Shau-.js +49434 -0
- package/bundled-test-harness/assets/info-J43DQDTF-Dz5b1Xgc.js +3 -0
- package/bundled-test-harness/assets/infoDiagram-5YYISTIA-Dl8XvIfi.js +23 -0
- package/bundled-test-harness/assets/inspector-test-CVZVQdIJ.js +1776 -0
- package/bundled-test-harness/assets/instance-filter-matcher-test-C-4z6qUt.js +564 -0
- package/bundled-test-harness/assets/instantiate-card-test-eQ22Vt_m.js +104 -0
- package/bundled-test-harness/assets/interact-submode-creation-and-permissions-test-hXPsRPMU.js +497 -0
- package/bundled-test-harness/assets/interact-submode-setup-D55IIVc5.js +558 -0
- package/bundled-test-harness/assets/interact-submode-test-BwrtFe2m.js +725 -0
- package/bundled-test-harness/assets/invalidate-realm-identifiers-test-BMk7yd-D.js +101 -0
- package/bundled-test-harness/assets/invite-user-to-room-test-B5B0umJQ.js +67 -0
- package/bundled-test-harness/assets/ishikawaDiagram-YF4QCWOH-BrO7NAng.js +1009 -0
- package/bundled-test-harness/assets/isolated-render-test-DX1wdHoS.js +51 -0
- package/bundled-test-harness/assets/item-button-QkVr-FW0.js +203 -0
- package/bundled-test-harness/assets/javascript-BWNQhcCY.js +75 -0
- package/bundled-test-harness/assets/job-priority-header-test-CuBZloLK.js +81 -0
- package/bundled-test-harness/assets/journeyDiagram-JHISSGLW-B7BT66v0.js +1256 -0
- package/bundled-test-harness/assets/jpg-image-def-test-DEx462nY.js +430 -0
- package/bundled-test-harness/assets/json-file-def-test-Cray6ly6.js +92 -0
- package/bundled-test-harness/assets/kanban-definition-UN3LZRKU-C0E5Vmr_.js +1284 -0
- package/bundled-test-harness/assets/last-modified-date-test-BzE25NOB.js +18 -0
- package/bundled-test-harness/assets/limited-set-test-NwGNoXKc.js +123 -0
- package/bundled-test-harness/assets/line-BbGOk93s.js +55 -0
- package/bundled-test-harness/assets/linear-CHTo-YQl.js +417 -0
- package/bundled-test-harness/assets/linksto-broken-link-placeholder-test-CZdgRM1b.js +315 -0
- package/bundled-test-harness/assets/linksto-error-sentinel-test-DhsHO7Xs.js +236 -0
- package/bundled-test-harness/assets/linksto-many-broken-link-placeholder-test-mt-RrRta.js +303 -0
- package/bundled-test-harness/assets/linksto-many-per-slot-access-test-CdGUXZsi.js +301 -0
- package/bundled-test-harness/assets/linksto-sentinel-roundtrip-test-DOJ_6Gwf.js +258 -0
- package/bundled-test-harness/assets/linksto-singular-js-access-contract-test-BZC-gslF.js +194 -0
- package/bundled-test-harness/assets/live-prerendered-search-BSkwf5AH.js +639 -0
- package/bundled-test-harness/assets/live-test-DTfxZnsy.js +100 -0
- package/bundled-test-harness/assets/live-test-WOMYpc1I.js +2 -0
- package/bundled-test-harness/assets/loader-icon-error-test-F_ukQytn.js +62 -0
- package/bundled-test-harness/assets/loader-parallel-prefetch-test-DpNaFnhc.js +257 -0
- package/bundled-test-harness/assets/loader-retry-test-EQ2X0bFS.js +173 -0
- package/bundled-test-harness/assets/loader-test-BYkWAwc4.js +245 -0
- package/bundled-test-harness/assets/loading-test-jfWH_OpH.js +63 -0
- package/bundled-test-harness/assets/login-error-text-test-Cldr1X6h.js +51 -0
- package/bundled-test-harness/assets/m4a-audio-def-test-BQ1WKApD.js +185 -0
- package/bundled-test-harness/assets/main-ByAsLO_g.js +5 -0
- package/bundled-test-harness/assets/markdown-fallback-test-dtTaGP1s.js +316 -0
- package/bundled-test-harness/assets/markdown-file-def-test-shW9Xxd1.js +286 -0
- package/bundled-test-harness/assets/markdown-helpers-test-B6H7p4ay.js +183 -0
- package/bundled-test-harness/assets/markdown-highlighting-test-ZIrFNHRe.js +244 -0
- package/bundled-test-harness/assets/markdown-preview-KII3nJ2M.js +69 -0
- package/bundled-test-harness/assets/markdown-preview-test-De-IaUbK.js +237 -0
- package/bundled-test-harness/assets/marked-sync-CGSehq4u.js +2 -0
- package/bundled-test-harness/assets/marked-sync-DenC7QgC.js +2561 -0
- package/bundled-test-harness/assets/marked-sync-test-jZBr20Hq.js +146 -0
- package/bundled-test-harness/assets/matrix-service-sliding-sync-test-Ax4kyAMt.js +33 -0
- package/bundled-test-harness/assets/mermaid-parser.core-B_3tzKUl.js +114 -0
- package/bundled-test-harness/assets/mermaid.core-D2hqA7Hq.js +1700 -0
- package/bundled-test-harness/assets/message-service-subscription-test-B42KnJ91.js +113 -0
- package/bundled-test-harness/assets/mindmap-definition-RKZ34NQL-IZz7Qpd0.js +1347 -0
- package/bundled-test-harness/assets/mock-matrix-BhFWlMMr.js +14292 -0
- package/bundled-test-harness/assets/mock-matrix-CrtMntcN.js +2 -0
- package/bundled-test-harness/assets/module-transpile-cache-test-BtWN4OiM.js +66 -0
- package/bundled-test-harness/assets/monaco.contribution-B1hOUP3w.js +2 -0
- package/bundled-test-harness/assets/monaco.contribution-DhNsYtZe.js +2 -0
- package/bundled-test-harness/assets/monaco.contribution-DvJDImx2.js +103 -0
- package/bundled-test-harness/assets/monaco.contribution-yXcOyzue.js +243 -0
- package/bundled-test-harness/assets/mp3-audio-def-test-D365TuA7.js +129 -0
- package/bundled-test-harness/assets/mutex-test-DY09HLvv.js +71 -0
- package/bundled-test-harness/assets/number-field-test-wYaQjnzA.js +153 -0
- package/bundled-test-harness/assets/ogg-audio-def-test-Dl01PP31.js +191 -0
- package/bundled-test-harness/assets/open-create-listing-modal-test-D8C2PUFv.js +117 -0
- package/bundled-test-harness/assets/open-workspace-test-DN2n8IkC.js +48 -0
- package/bundled-test-harness/assets/operator-mode-acceptance-test-B_hzJZo4.js +1044 -0
- package/bundled-test-harness/assets/operator-mode-card-catalog-test-Hrrnkdt9.js +989 -0
- package/bundled-test-harness/assets/operator-mode-links-test-DC6sc9TZ.js +797 -0
- package/bundled-test-harness/assets/operator-mode-state-service-test-Aqz9_v0U.js +122 -0
- package/bundled-test-harness/assets/operator-mode-test-CLgpZGEM.js +617 -0
- package/bundled-test-harness/assets/operator-mode-ui-test-CDRrORfC.js +985 -0
- package/bundled-test-harness/assets/ordinal-BIRuJQBH.js +85 -0
- package/bundled-test-harness/assets/overlay-menu-items-test-of24KuXp.js +316 -0
- package/bundled-test-harness/assets/packet-YPE3B663-hs92geQG.js +3 -0
- package/bundled-test-harness/assets/panel-rIdTMDfK.js +3371 -0
- package/bundled-test-harness/assets/past-sessions-test-ZKr4ACF0.js +321 -0
- package/bundled-test-harness/assets/patch-code-test-BZa-Itrt.js +203 -0
- package/bundled-test-harness/assets/patch-fields-test-BkaHs-zo.js +992 -0
- package/bundled-test-harness/assets/patch-instance-test-CRMgg52p.js +287 -0
- package/bundled-test-harness/assets/persist-module-inspector-view-test-CqNy2RXR.js +62 -0
- package/bundled-test-harness/assets/phone-number-field-test-CV6gntON.js +72 -0
- package/bundled-test-harness/assets/pie-LRSECV5Y-DcM5pWE3.js +3 -0
- package/bundled-test-harness/assets/pieDiagram-4H26LBE5-CtO8RHpU.js +253 -0
- package/bundled-test-harness/assets/plan-install-test-lfBTuWXU.js +417 -0
- package/bundled-test-harness/assets/playground-VscW9KdT.js +57 -0
- package/bundled-test-harness/assets/png-image-def-test-CRspcIHP.js +222 -0
- package/bundled-test-harness/assets/prerender-file-extract-test-D3SpxfMI.js +176 -0
- package/bundled-test-harness/assets/prerender-html-test-WWptGXJ0.js +615 -0
- package/bundled-test-harness/assets/prerender-meta-test-DwQEGN6j.js +388 -0
- package/bundled-test-harness/assets/prerender-module-test-BM1AOwRF.js +195 -0
- package/bundled-test-harness/assets/prerendered-card-search-test-BVJ8IHLe.js +708 -0
- package/bundled-test-harness/assets/preview-format-test-DDpiXDN_.js +103 -0
- package/bundled-test-harness/assets/preview-test-D2UV1C5D.js +455 -0
- package/bundled-test-harness/assets/published-realm-url-DUIZzAJ5.js +52 -0
- package/bundled-test-harness/assets/published-realm-url-test-CIgSf4Ub.js +137 -0
- package/bundled-test-harness/assets/qs-test-Bi679H5w.js +36 -0
- package/bundled-test-harness/assets/quadrantDiagram-W4KKPZXB-GOTAKsCo.js +2324 -0
- package/bundled-test-harness/assets/query-field-barrier-test-BlOuVxdS.js +118 -0
- package/bundled-test-harness/assets/query-field-error-sentinel-test-BsB76iUQ.js +202 -0
- package/bundled-test-harness/assets/query-field-normalization-test-B2YodJCr.js +271 -0
- package/bundled-test-harness/assets/query-field-schema-test-CQhJASFx.js +231 -0
- package/bundled-test-harness/assets/query-fields-test-CaZ19leM.js +535 -0
- package/bundled-test-harness/assets/queue-test-DrSip6mJ.js +216 -0
- package/bundled-test-harness/assets/radar-GUYGQ44K-BkAe1nkp.js +3 -0
- package/bundled-test-harness/assets/read-card-for-ai-assistant-test-D8yB-OL9.js +91 -0
- package/bundled-test-harness/assets/read-file-for-ai-assistant-test-K3M0-lBD.js +45 -0
- package/bundled-test-harness/assets/read-source-test-CKlb0ORb.js +67 -0
- package/bundled-test-harness/assets/read-text-file-test-CJdasDDU.js +124 -0
- package/bundled-test-harness/assets/realm-DhUCLR5r.js +884 -0
- package/bundled-test-harness/assets/realm-field-test-kFgxphDI.js +101 -0
- package/bundled-test-harness/assets/realm-index-card-id-test-DAnMAqw4.js +18 -0
- package/bundled-test-harness/assets/realm-indexing-test-BQkX-Dat.js +4018 -0
- package/bundled-test-harness/assets/realm-paths-test-CmEi9rzu.js +33 -0
- package/bundled-test-harness/assets/realm-querying-test-eq3qSXLu.js +1062 -0
- package/bundled-test-harness/assets/realm-test-DLQAtdMt.js +2409 -0
- package/bundled-test-harness/assets/reasoning-test-CwTfyDlj.js +234 -0
- package/bundled-test-harness/assets/recent-files-test-MVIGLp8S.js +449 -0
- package/bundled-test-harness/assets/reindex-realm-test-BwLgJeB3.js +119 -0
- package/bundled-test-harness/assets/relationship-loading-state-test-B4Ca43yD.js +289 -0
- package/bundled-test-harness/assets/render-component-BKEihV4U.js +2 -0
- package/bundled-test-harness/assets/render-error-test-DWD6tfNe.js +22 -0
- package/bundled-test-harness/assets/render-service-test-BjuoVrUK.js +87 -0
- package/bundled-test-harness/assets/render-timer-stub-test-BgUY5u3X.js +84 -0
- package/bundled-test-harness/assets/rendered-markdown-DOP-s6fW.js +211 -0
- package/bundled-test-harness/assets/rendered-markdown-test-CD02UYwA.js +360 -0
- package/bundled-test-harness/assets/requirementDiagram-4Y6WPE33-DJIy7eR9.js +2550 -0
- package/bundled-test-harness/assets/rich-markdown-field-test-BJeQx1tL.js +806 -0
- package/bundled-test-harness/assets/room-message-test-CjD7FlPD.js +171 -0
- package/bundled-test-harness/assets/rust-crypto-GS0FFZ7H.js +16141 -0
- package/bundled-test-harness/assets/sanitize-module-list-test-gi0pcqSy.js +68 -0
- package/bundled-test-harness/assets/sankeyDiagram-5OEKKPKP-wBsbt1Mr.js +1357 -0
- package/bundled-test-harness/assets/schema-editor-test-BSqu8W3e.js +784 -0
- package/bundled-test-harness/assets/schema-generation-test-DVFuSsLl.js +28 -0
- package/bundled-test-harness/assets/scrolling-test-CpzkRiBS.js +292 -0
- package/bundled-test-harness/assets/search-and-choose-test-DVWX4XRb.js +156 -0
- package/bundled-test-harness/assets/search-cache-key-test-BMnYM4a5.js +79 -0
- package/bundled-test-harness/assets/search-command-test-kEfT0AO7.js +135 -0
- package/bundled-test-harness/assets/search-correlation-id-test-D08FtVUZ.js +101 -0
- package/bundled-test-harness/assets/search-data-test-CTrBEc1m.js +243 -0
- package/bundled-test-harness/assets/search-google-images-test-UnKG8qCp.js +168 -0
- package/bundled-test-harness/assets/search-in-flight-key-test-9Va-JXFz.js +79 -0
- package/bundled-test-harness/assets/search-test-COlO2lZi.js +847 -0
- package/bundled-test-harness/assets/send-ai-assistant-message-test-BPjOjt2R.js +52 -0
- package/bundled-test-harness/assets/send-bot-trigger-event-test-BB4lHbB_.js +56 -0
- package/bundled-test-harness/assets/send-request-via-proxy-test-U8frmHZA.js +333 -0
- package/bundled-test-harness/assets/sending-test-DjEzksEX.js +317 -0
- package/bundled-test-harness/assets/sequenceDiagram-3UESZ5HK-QAEjhoay.js +5551 -0
- package/bundled-test-harness/assets/serialization-test-DHdLriC8.js +8283 -0
- package/bundled-test-harness/assets/set-user-system-card-test-C8I1lDBh.js +59 -0
- package/bundled-test-harness/assets/setup-BkuybBki.js +769 -0
- package/bundled-test-harness/assets/setup-gxkWJKID.js +2 -0
- package/bundled-test-harness/assets/show-card-test-DHKQ6AI4.js +362 -0
- package/bundled-test-harness/assets/skills-test-DlMgZrPV.js +568 -0
- package/bundled-test-harness/assets/spec-test-s9Zj7x2E.js +1012 -0
- package/bundled-test-harness/assets/stateDiagram-AJRCARHV-nEhf3efZ.js +363 -0
- package/bundled-test-harness/assets/stateDiagram-v2-BHNVJYJU-tZz_3w-7.js +29 -0
- package/bundled-test-harness/assets/store-add-test-D44FWRl3.js +52 -0
- package/bundled-test-harness/assets/store-test-TTmNBs5v.js +1562 -0
- package/bundled-test-harness/assets/summarize-session-test-DHAuNb5K.js +169 -0
- package/bundled-test-harness/assets/svg-image-def-test-C2_GGzR6.js +164 -0
- package/bundled-test-harness/assets/switch-submode-test-CfGaoxVe.js +168 -0
- package/bundled-test-harness/assets/test-realm-service-worker-C21o7yvW.js +73 -0
- package/bundled-test-harness/assets/tests-BSt6h9iC.js +2771 -0
- package/bundled-test-harness/assets/text-file-def-test-CR4QO7e_.js +93 -0
- package/bundled-test-harness/assets/text-input-validator-test-DYS3mFj9.js +155 -0
- package/bundled-test-harness/assets/text-suggestion-test-GUxJ7WtF.js +339 -0
- package/bundled-test-harness/assets/theme-card-test-Ba2KqFB8.js +573 -0
- package/bundled-test-harness/assets/timeline-definition-PNZ67QCA-BQYyTIei.js +1545 -0
- package/bundled-test-harness/assets/transform-cards-test-DyA8eCom.js +341 -0
- package/bundled-test-harness/assets/treeView-BLDUP644-Z4ezSvef.js +3 -0
- package/bundled-test-harness/assets/treemap-LRROVOQU-Bf5rk_He.js +3 -0
- package/bundled-test-harness/assets/ts-file-def-test-Cxnc6H74.js +90 -0
- package/bundled-test-harness/assets/tsMode-oJEHe-CR.js +968 -0
- package/bundled-test-harness/assets/typescript-DLbb7q56.js +2 -0
- package/bundled-test-harness/assets/update-room-skills-test-B7VLHU3-.js +197 -0
- package/bundled-test-harness/assets/url-test-w-69Zycf.js +103 -0
- package/bundled-test-harness/assets/use-ai-assistant-test-DJkFz7_b.js +330 -0
- package/bundled-test-harness/assets/validate-realm-test-BioLutB8.js +53 -0
- package/bundled-test-harness/assets/vennDiagram-CIIHVFJN-9eLwsQET.js +2833 -0
- package/bundled-test-harness/assets/wardley-L42UT6IY-qNP5_917.js +3 -0
- package/bundled-test-harness/assets/wardleyDiagram-YWT4CUSO-DZhEm4N4.js +872 -0
- package/bundled-test-harness/assets/wav-audio-def-test-DqsTEBw8.js +155 -0
- package/bundled-test-harness/assets/webp-image-def-test-23wOLPMu.js +225 -0
- package/bundled-test-harness/assets/workspace-chooser-delete-test-Q6S_nGDT.js +189 -0
- package/bundled-test-harness/assets/workspace-chooser-test-CzsvY1v_.js +235 -0
- package/bundled-test-harness/assets/workspace-delete-multiple-test-BNFHkJpQ.js +213 -0
- package/bundled-test-harness/assets/workspace-delete-summary-test-DLzNdjvC.js +63 -0
- package/bundled-test-harness/assets/write-binary-file-test-PHHt9fVI.js +100 -0
- package/bundled-test-harness/assets/write-text-file-test-DuHe6tR5.js +172 -0
- package/bundled-test-harness/assets/xychartDiagram-2RQKCTM6-bflHQbEv.js +2551 -0
- package/bundled-test-harness/index.html +24 -23
- package/bundled-test-harness/tests/index.html +31 -30
- package/bundled-types/base/command.d.ts +48 -0
- package/bundled-types/host-app/components/operator-mode/publish-realm-modal.gts +17 -26
- package/bundled-types/host-app/lib/published-realm-url.ts +135 -0
- package/package.json +3 -3
- package/src/build-program.ts +12 -12
- package/src/commands/consolidate-workspaces.ts +1 -1
- package/src/commands/file/delete.ts +4 -4
- package/src/commands/file/index.ts +6 -6
- package/src/commands/file/lint.ts +4 -4
- package/src/commands/file/list.ts +3 -3
- package/src/commands/file/read.ts +3 -3
- package/src/commands/file/touch.ts +6 -6
- package/src/commands/file/write.ts +3 -3
- package/src/commands/lint.ts +6 -6
- package/src/commands/parse.ts +6 -6
- package/src/commands/profile.ts +4 -4
- package/src/commands/read-transpiled.ts +6 -3
- package/src/commands/realm/cancel-indexing.ts +3 -3
- package/src/commands/realm/create.ts +2 -2
- package/src/commands/realm/history.ts +4 -4
- package/src/commands/realm/index.ts +15 -15
- package/src/commands/realm/indexing-errors.ts +3 -3
- package/src/commands/realm/list.ts +2 -2
- package/src/commands/realm/milestone.ts +4 -4
- package/src/commands/realm/publish.ts +4 -4
- package/src/commands/realm/pull.ts +6 -6
- package/src/commands/realm/push.ts +7 -7
- package/src/commands/realm/remove.ts +3 -3
- package/src/commands/realm/status.ts +8 -8
- package/src/commands/realm/sync.ts +9 -9
- package/src/commands/realm/unpublish.ts +3 -3
- package/src/commands/realm/wait-for-ready.ts +2 -2
- package/src/commands/realm/watch/index.ts +2 -2
- package/src/commands/realm/watch/start.ts +13 -10
- package/src/commands/realm/watch/stop.ts +2 -2
- package/src/commands/run-command.ts +6 -3
- package/src/commands/search.ts +3 -3
- package/src/commands/test.ts +5 -5
- package/src/index.ts +2 -2
- package/src/lib/auth-resolver.ts +3 -3
- package/src/lib/boxel-cli-client.ts +18 -15
- package/src/lib/checkpoint-manager.ts +1 -1
- package/src/lib/find-checkpoint.ts +1 -1
- package/src/lib/profile-manager.ts +4 -4
- package/src/lib/realm-local-paths.ts +1 -1
- package/src/lib/realm-sync-base.ts +1 -1
- package/src/lib/seed-auth.ts +1 -1
- package/src/lib/sync-logic.ts +1 -1
- package/src/lib/watch-process-registry.ts +1 -1
- package/bundled-test-harness/assets/adapter-C8oDflNN.js +0 -2
- package/bundled-test-harness/assets/add-field-to-card-definition-command-test-Cs670972.js +0 -111
- package/bundled-test-harness/assets/add-workspace-test-BviDAUBK.js +0 -71
- package/bundled-test-harness/assets/ai-assistant-B5fp2iOz.js +0 -129
- package/bundled-test-harness/assets/ai-assistant-panel-service-test-NpHZzZAz.js +0 -95
- package/bundled-test-harness/assets/ai-assistant-test-jPV29jEw.js +0 -2137
- package/bundled-test-harness/assets/ai-function-generation-test-QRPcE9tQ.js +0 -996
- package/bundled-test-harness/assets/ai-module-creation-test-DyuyfnkY.js +0 -150
- package/bundled-test-harness/assets/aibot-message-Dwxp5hTW.js +0 -1185
- package/bundled-test-harness/assets/amd-transpile-test-CF7Lkbif.js +0 -425
- package/bundled-test-harness/assets/app-CgP2IpNG.js +0 -21464
- package/bundled-test-harness/assets/apply-boxel-formatting-test-BXyZ3z0I.js +0 -134
- package/bundled-test-harness/assets/apply-markdown-edit-test-C6bcaj3a.js +0 -230
- package/bundled-test-harness/assets/apply-search-replace-block-test-BSwC4J9g.js +0 -630
- package/bundled-test-harness/assets/arc-DNRb_8LA.js +0 -199
- package/bundled-test-harness/assets/architecture-7EHR7CIX-BtVh_LBJ.js +0 -3
- package/bundled-test-harness/assets/architectureDiagram-3BPJPVTR-D9UYbaKj.js +0 -7400
- package/bundled-test-harness/assets/auth-error-guard-test-Bvu8E7Wy.js +0 -30
- package/bundled-test-harness/assets/auth-service-worker-test-CC6DzdfK.js +0 -538
- package/bundled-test-harness/assets/authed-fetch-test-CfF-IBHI.js +0 -75
- package/bundled-test-harness/assets/avif-image-def-test-B9L2z0nR.js +0 -186
- package/bundled-test-harness/assets/base-realm-43wjttN2.js +0 -140
- package/bundled-test-harness/assets/base-realm-CJ5x9iyX.js +0 -2
- package/bundled-test-harness/assets/basic-test-B64a5zCK.js +0 -128
- package/bundled-test-harness/assets/bfm-card-references-test-cLQVLpth.js +0 -577
- package/bundled-test-harness/assets/binary-upload-dedupe-test-By7Y1iQ3.js +0 -308
- package/bundled-test-harness/assets/blockDiagram-GPEHLZMM-LgOorG2O.js +0 -4355
- package/bundled-test-harness/assets/bot-registration-test-DOjf0P1R.js +0 -99
- package/bundled-test-harness/assets/box-test-Cd1-RcXg.js +0 -51
- package/bundled-test-harness/assets/brand-guide-attachments-test-DxRqP8fo.js +0 -87
- package/bundled-test-harness/assets/brand-guide-custom-css-test-DBpZiHzJ.js +0 -135
- package/bundled-test-harness/assets/brand-logo-mark-field-test-61k4e5Om.js +0 -87
- package/bundled-test-harness/assets/broken-link-template-test-A1P4flQ5.js +0 -345
- package/bundled-test-harness/assets/browser-index-Bzhpucwe.js +0 -3
- package/bundled-test-harness/assets/browser-index-D0mzSWYV.js +0 -8802
- package/bundled-test-harness/assets/c4Diagram-AAUBKEIU-1iq94vGa.js +0 -3764
- package/bundled-test-harness/assets/cached-fetch-test-ByQ-5OQI.js +0 -93
- package/bundled-test-harness/assets/can-read-realm-test-VFLHJdEv.js +0 -58
- package/bundled-test-harness/assets/cancel-indexing-job-test-n3Os4ZaX.js +0 -71
- package/bundled-test-harness/assets/card-api-test-DvNfLv3V.js +0 -196
- package/bundled-test-harness/assets/card-basics-test-CKzZuFdw.js +0 -4895
- package/bundled-test-harness/assets/card-catalog-test-JFvkVHED.js +0 -377
- package/bundled-test-harness/assets/card-copy-test-iwrFA72s.js +0 -777
- package/bundled-test-harness/assets/card-def-field-def-relationships-test-D5s2RH5t.js +0 -560
- package/bundled-test-harness/assets/card-def-menu-items-test-XcmkT4NF.js +0 -182
- package/bundled-test-harness/assets/card-delete-test-jtAOHk1Y.js +0 -412
- package/bundled-test-harness/assets/card-directory-name-test-veQEp5FJ.js +0 -71
- package/bundled-test-harness/assets/card-playground-test-P7Ed0tO4.js +0 -1497
- package/bundled-test-harness/assets/card-prerender-DXG8cQEv.js +0 -12661
- package/bundled-test-harness/assets/card-search-adorn-test-BX0-IJHB.js +0 -128
- package/bundled-test-harness/assets/card-search-query-builder-test-D01uixke.js +0 -88
- package/bundled-test-harness/assets/card-search-selection-menu-test-DMTeZFmW.js +0 -108
- package/bundled-test-harness/assets/channel-BvoW_rbI.js +0 -8
- package/bundled-test-harness/assets/check-correctness-test-D7QB1GTo.js +0 -252
- package/bundled-test-harness/assets/chunk-2J33WTMH-BbxCvOlt.js +0 -31
- package/bundled-test-harness/assets/chunk-3OPIFGDE-DHY3s0oT.js +0 -5548
- package/bundled-test-harness/assets/chunk-4BX2VUAB-CRivrLQ6.js +0 -11
- package/bundled-test-harness/assets/chunk-4EGX6M5U-qWzlMeqd.js +0 -44
- package/bundled-test-harness/assets/chunk-55IACEB6-DOl6NECJ.js +0 -10
- package/bundled-test-harness/assets/chunk-5DO6E6H7-scwNnzDb.js +0 -27
- package/bundled-test-harness/assets/chunk-5ZQYHXKU-BeETnugr.js +0 -1767
- package/bundled-test-harness/assets/chunk-727SXJPM-BlycTxFE.js +0 -3877
- package/bundled-test-harness/assets/chunk-AQP2D5EJ-BE3Clw-g.js +0 -2622
- package/bundled-test-harness/assets/chunk-BR22UD5L-BTPKlhWA.js +0 -85
- package/bundled-test-harness/assets/chunk-BSJP7CBP-BIhtUfvc.js +0 -114
- package/bundled-test-harness/assets/chunk-CSCIHK7Q-DnRAp6Bv.js +0 -6144
- package/bundled-test-harness/assets/chunk-FHYWG6QK-DpIXIGDC.js +0 -27
- package/bundled-test-harness/assets/chunk-FMBD7UC4-B36w3LIg.js +0 -20
- package/bundled-test-harness/assets/chunk-KSCS5N6A-gbz9p9BU.js +0 -871
- package/bundled-test-harness/assets/chunk-L5ZTLDWV-HNfH9U8K.js +0 -43
- package/bundled-test-harness/assets/chunk-LZXEDZCA-CbKHJfzx.js +0 -65
- package/bundled-test-harness/assets/chunk-MPE355IW-BGVbCTZH.js +0 -27
- package/bundled-test-harness/assets/chunk-MZUSXYTE-DoCjuxcJ.js +0 -36
- package/bundled-test-harness/assets/chunk-N66VUXT2-BX17MI-i.js +0 -70
- package/bundled-test-harness/assets/chunk-ND2GUHAM-IpeiJZYz.js +0 -93
- package/bundled-test-harness/assets/chunk-NZK2D7GU-CH-Gg7qc.js +0 -89
- package/bundled-test-harness/assets/chunk-O5CBEL6O-D2JbLgI8.js +0 -2395
- package/bundled-test-harness/assets/chunk-PUPMXCY4-DS4ZxM2V.js +0 -27
- package/bundled-test-harness/assets/chunk-QZHKN3VN-WLHeRUJ3.js +0 -20
- package/bundled-test-harness/assets/chunk-UIBZB4QT-DNIJBpkq.js +0 -27
- package/bundled-test-harness/assets/chunk-WCWK7LTN-CqRJ3WOy.js +0 -36
- package/bundled-test-harness/assets/chunk-WU5MYG2G-CtItCLbE.js +0 -12
- package/bundled-test-harness/assets/chunk-XPW4576I-D2Q7Qo8n.js +0 -2341
- package/bundled-test-harness/assets/classDiagram-4FO5ZUOK-CnNFReKQ.js +0 -31
- package/bundled-test-harness/assets/classDiagram-v2-Q7XG4LA2-BlhpbohY.js +0 -31
- package/bundled-test-harness/assets/code-equality-assertion-C-2g5YGf.js +0 -474
- package/bundled-test-harness/assets/code-patches-test-DaV4Mon_.js +0 -1128
- package/bundled-test-harness/assets/code-patching-test-CcbWlImN.js +0 -114
- package/bundled-test-harness/assets/code-ref-test-8Yj8gbww.js +0 -138
- package/bundled-test-harness/assets/code-semantics-service-test-C3srTfDz.js +0 -65
- package/bundled-test-harness/assets/code-submode-test-BUhjvWtB.js +0 -1762
- package/bundled-test-harness/assets/codeblocks-test-3zAp0_GA.js +0 -492
- package/bundled-test-harness/assets/codemirror-context-C7KmSAyy.js +0 -2
- package/bundled-test-harness/assets/codemirror-editor-test-WojU4k2h.js +0 -1176
- package/bundled-test-harness/assets/color-field-test-yESUakoE.js +0 -213
- package/bundled-test-harness/assets/command-definitions-test-UsXsAhn7.js +0 -72
- package/bundled-test-harness/assets/commands-CBDBujm_.js +0 -1379
- package/bundled-test-harness/assets/commands-calling-test-DJTl0EbL.js +0 -200
- package/bundled-test-harness/assets/commands-test-DW2gupNS.js +0 -1041
- package/bundled-test-harness/assets/commands-test-DjLnuojW.js +0 -1145
- package/bundled-test-harness/assets/computed-test-0n5g8Ez5.js +0 -882
- package/bundled-test-harness/assets/container-D8y7fmir.js +0 -14602
- package/bundled-test-harness/assets/convert-to-class-name-test-DSIflIV2.js +0 -17
- package/bundled-test-harness/assets/copy-and-edit-test-BuK1ZHr-.js +0 -291
- package/bundled-test-harness/assets/copy-card-test-DnDC4_7J.js +0 -156
- package/bundled-test-harness/assets/copy-file-to-realm-test-CFd_3Iff.js +0 -99
- package/bundled-test-harness/assets/copy-source-test-38yUGJor.js +0 -56
- package/bundled-test-harness/assets/cose-bilkent-S5V4N54A-DXA1S87S.js +0 -4275
- package/bundled-test-harness/assets/create-file-test-B2oem0-V.js +0 -963
- package/bundled-test-harness/assets/create-file-test-BHk00RtD.js +0 -397
- package/bundled-test-harness/assets/create-listing-modal-test-L-71-Uo2.js +0 -194
- package/bundled-test-harness/assets/create-listing-pr-request-CZaLsHhE.js +0 -64
- package/bundled-test-harness/assets/create-listing-pr-request-test-OGzk4Q2E.js +0 -117
- package/bundled-test-harness/assets/create-spec-test-BsM7VKuH.js +0 -239
- package/bundled-test-harness/assets/csv-file-def-test-BhJalhE-.js +0 -101
- package/bundled-test-harness/assets/dagre-BIk_r1iU.js +0 -4195
- package/bundled-test-harness/assets/dagre-BM42HDAG-FaUWeGOj.js +0 -606
- package/bundled-test-harness/assets/date-time-fields-test-Cs5T6Xk1.js +0 -322
- package/bundled-test-harness/assets/debug-message-test-WlHe7pJF.js +0 -119
- package/bundled-test-harness/assets/diagram-2AECGRRQ-DLve-IVM.js +0 -279
- package/bundled-test-harness/assets/diagram-5GNKFQAL-CJG1RTLk.js +0 -142
- package/bundled-test-harness/assets/diagram-KO2AKTUF-DYGDq3dD.js +0 -551
- package/bundled-test-harness/assets/diagram-LMA3HP47-BNRYdpMl.js +0 -184
- package/bundled-test-harness/assets/diagram-OG6HWLK6-BlJH5g83.js +0 -857
- package/bundled-test-harness/assets/diffing-test-DO54USSm.js +0 -210
- package/bundled-test-harness/assets/dist-BDRmXkWl.js +0 -232
- package/bundled-test-harness/assets/dist-BfNSLd0O.js +0 -105
- package/bundled-test-harness/assets/dist-BoireClP.js +0 -2
- package/bundled-test-harness/assets/editor-test-DChC9LuR.js +0 -551
- package/bundled-test-harness/assets/editor.main-BiohyrHK.js +0 -3
- package/bundled-test-harness/assets/editor.main-CMU_0pR1.js +0 -43566
- package/bundled-test-harness/assets/email-field-test-DWIFSfZ-.js +0 -74
- package/bundled-test-harness/assets/enum-field-test-BUc6l4us.js +0 -909
- package/bundled-test-harness/assets/erDiagram-TEJ5UH35-pOJ2novh.js +0 -2041
- package/bundled-test-harness/assets/error-display-test-CHSE6h6Z.js +0 -343
- package/bundled-test-harness/assets/evaluate-module-test-Caa5n0B9.js +0 -66
- package/bundled-test-harness/assets/eventmodeling-FCH6USID-B6XXU7R3.js +0 -3
- package/bundled-test-harness/assets/execute-atomic-operations-test-CT060oDk.js +0 -75
- package/bundled-test-harness/assets/externals-Do1fVZ4j.js +0 -5533
- package/bundled-test-harness/assets/extract-css-variables-test-DzjAsMgg.js +0 -169
- package/bundled-test-harness/assets/fallback-banner-test-CmxysrDn.js +0 -227
- package/bundled-test-harness/assets/fallback-banner-test-DJ4cO8PB.js +0 -53
- package/bundled-test-harness/assets/fallback-models-test-r5upJFeA.js +0 -163
- package/bundled-test-harness/assets/fetch-card-json-test-Di1wmvy5.js +0 -63
- package/bundled-test-harness/assets/fetcher-test-DjzNl_7F.js +0 -85
- package/bundled-test-harness/assets/field-configuration-test-C3vr-HhG.js +0 -535
- package/bundled-test-harness/assets/field-markdown-domain-test-DG2U4qIm.js +0 -615
- package/bundled-test-harness/assets/field-markdown-primitives-test-Bay2v8nT.js +0 -362
- package/bundled-test-harness/assets/field-markdown-specialized-test-Bl0Sl4sc.js +0 -527
- package/bundled-test-harness/assets/field-path-parser-test-bxxwUjcm.js +0 -387
- package/bundled-test-harness/assets/field-playground-test-Bcjfws4m.js +0 -902
- package/bundled-test-harness/assets/field-support-predicates-test-DYTqOGvv.js +0 -170
- package/bundled-test-harness/assets/field-test-helpers-DYSfSGdh.js +0 -45
- package/bundled-test-harness/assets/file-attachment-test-6ypDRDS7.js +0 -635
- package/bundled-test-harness/assets/file-chooser-test-mtmcHTFP.js +0 -439
- package/bundled-test-harness/assets/file-def-live-reload-test-CX1-lOv6.js +0 -50
- package/bundled-test-harness/assets/file-def-manager-DNHII2oj.js +0 -470
- package/bundled-test-harness/assets/file-def-manager-canonicalize-test-i_7UVakF.js +0 -451
- package/bundled-test-harness/assets/file-def-menu-items-test-Dw458iku.js +0 -114
- package/bundled-test-harness/assets/file-def-navigation-test-B3Ztr1Rd.js +0 -109
- package/bundled-test-harness/assets/file-def-serialization-test-C_gV8AkU.js +0 -87
- package/bundled-test-harness/assets/file-def-test-vXXJmtxX.js +0 -219
- package/bundled-test-harness/assets/file-tree-test-BJCiw9jm.js +0 -773
- package/bundled-test-harness/assets/flac-audio-def-test-BX3SE1vW.js +0 -138
- package/bundled-test-harness/assets/flowDiagram-I6XJVG4X-7Q5ROn4X.js +0 -4883
- package/bundled-test-harness/assets/formatted-aibot-message-test-DyqUz2nt.js +0 -366
- package/bundled-test-harness/assets/formatted-user-message-test-aqAzqvBP.js +0 -43
- package/bundled-test-harness/assets/freestyle-test-CLRrZkAE.js +0 -17
- package/bundled-test-harness/assets/full-reindex-realm-test-ClqPVQ0c.js +0 -103
- package/bundled-test-harness/assets/ganttDiagram-6RSMTGT7-BkDoIAAE.js +0 -4060
- package/bundled-test-harness/assets/garbage-collection-test-Ba2dD3qS.js +0 -373
- package/bundled-test-harness/assets/general-test-D0zhs14K.js +0 -926
- package/bundled-test-harness/assets/generate-css-variables-test-CKrXSlHs.js +0 -88
- package/bundled-test-harness/assets/generate-example-cards-one-shot-test-fSAdGJeT.js +0 -67
- package/bundled-test-harness/assets/get-available-realm-identifiers-test-BXMUW65I.js +0 -49
- package/bundled-test-harness/assets/get-catalog-realm-identifiers-test-DKEq6Zcq.js +0 -49
- package/bundled-test-harness/assets/get-default-writable-realm-test-Dp4nBIRP.js +0 -56
- package/bundled-test-harness/assets/get-realm-of-resource-identifier-test-DYNnMgD-.js +0 -55
- package/bundled-test-harness/assets/get-relationship-membership-state-test-k9EUNWeq.js +0 -1306
- package/bundled-test-harness/assets/get-type-refs-from-filter-test-BPuivF-v.js +0 -136
- package/bundled-test-harness/assets/get-user-system-card-test-DSHv00O7.js +0 -52
- package/bundled-test-harness/assets/gif-image-def-test-LuDSr5Kz.js +0 -161
- package/bundled-test-harness/assets/gitGraph-WXDBUCRP-BrG_LYEh.js +0 -3
- package/bundled-test-harness/assets/gitGraphDiagram-PVQCEYII-QJjQcX4J.js +0 -1150
- package/bundled-test-harness/assets/gts-file-def-test-bS3ML062.js +0 -99
- package/bundled-test-harness/assets/head-format-preview-test-B8IPh71E.js +0 -156
- package/bundled-test-harness/assets/helpers-wSIq-bau.js +0 -5
- package/bundled-test-harness/assets/host-mode-test-D44nXoQZ.js +0 -391
- package/bundled-test-harness/assets/host-submode-test-CefkXg9F.js +0 -904
- package/bundled-test-harness/assets/index-query-engine-test-DJnDqmfK.js +0 -2548
- package/bundled-test-harness/assets/index-writer-test-BcrCMj37.js +0 -1842
- package/bundled-test-harness/assets/indexeddb-crypto-store-RTTNdynf.js +0 -49434
- package/bundled-test-harness/assets/info-J43DQDTF-DhDzvz9k.js +0 -3
- package/bundled-test-harness/assets/infoDiagram-5YYISTIA-8TmRFIRz.js +0 -23
- package/bundled-test-harness/assets/inspector-test-D4iMBlbL.js +0 -1776
- package/bundled-test-harness/assets/instance-filter-matcher-test-CYT6N3hN.js +0 -564
- package/bundled-test-harness/assets/instantiate-card-test-j1JS5lDe.js +0 -104
- package/bundled-test-harness/assets/interact-submode-creation-and-permissions-test-B-aXzOh6.js +0 -497
- package/bundled-test-harness/assets/interact-submode-setup-VMwOUl3u.js +0 -558
- package/bundled-test-harness/assets/interact-submode-test-D5lNNXdq.js +0 -725
- package/bundled-test-harness/assets/invalidate-realm-identifiers-test-71Ze8eGV.js +0 -101
- package/bundled-test-harness/assets/invite-user-to-room-test-UfjsvwVp.js +0 -67
- package/bundled-test-harness/assets/ishikawaDiagram-YF4QCWOH-7UALIGwM.js +0 -1009
- package/bundled-test-harness/assets/isolated-render-test-C2IL-Fz3.js +0 -51
- package/bundled-test-harness/assets/item-button-6g7XYj56.js +0 -203
- package/bundled-test-harness/assets/javascript-BwLQ7_Nc.js +0 -75
- package/bundled-test-harness/assets/job-priority-header-test-C3FfKLPP.js +0 -81
- package/bundled-test-harness/assets/journeyDiagram-JHISSGLW-t4gEZYup.js +0 -1256
- package/bundled-test-harness/assets/jpg-image-def-test-BTBk9lk5.js +0 -430
- package/bundled-test-harness/assets/json-file-def-test-BpU_Eidn.js +0 -92
- package/bundled-test-harness/assets/kanban-definition-UN3LZRKU-C_KHB3_r.js +0 -1284
- package/bundled-test-harness/assets/last-modified-date-test-fE7IP0q0.js +0 -18
- package/bundled-test-harness/assets/limited-set-test-uu2vX1Sv.js +0 -123
- package/bundled-test-harness/assets/line-BiZHXOjs.js +0 -55
- package/bundled-test-harness/assets/linear-DUaMMmmA.js +0 -417
- package/bundled-test-harness/assets/linksto-broken-link-placeholder-test-qZeqQ1gt.js +0 -315
- package/bundled-test-harness/assets/linksto-error-sentinel-test-BaV3I8Xx.js +0 -236
- package/bundled-test-harness/assets/linksto-many-broken-link-placeholder-test-BvJi1vCb.js +0 -303
- package/bundled-test-harness/assets/linksto-many-per-slot-access-test-CK60Cugk.js +0 -301
- package/bundled-test-harness/assets/linksto-sentinel-roundtrip-test-BWxdEO9D.js +0 -258
- package/bundled-test-harness/assets/linksto-singular-js-access-contract-test-CIsLhqR2.js +0 -194
- package/bundled-test-harness/assets/live-prerendered-search-jZe3I16p.js +0 -639
- package/bundled-test-harness/assets/live-test-CF_R5WGr.js +0 -2
- package/bundled-test-harness/assets/live-test-jO7lXuyB.js +0 -100
- package/bundled-test-harness/assets/loader-icon-error-test-N4JYZuTx.js +0 -62
- package/bundled-test-harness/assets/loader-parallel-prefetch-test-DteeG7mU.js +0 -257
- package/bundled-test-harness/assets/loader-retry-test-DYVgpS_I.js +0 -173
- package/bundled-test-harness/assets/loader-test-DLI8JIx-.js +0 -245
- package/bundled-test-harness/assets/loading-test-D4ZBtRYf.js +0 -63
- package/bundled-test-harness/assets/login-error-text-test-Dcq7q3EY.js +0 -51
- package/bundled-test-harness/assets/m4a-audio-def-test-BKqGO-CW.js +0 -185
- package/bundled-test-harness/assets/main-BjBdsiQT.js +0 -5
- package/bundled-test-harness/assets/markdown-fallback-test-BBj80dZZ.js +0 -316
- package/bundled-test-harness/assets/markdown-file-def-test-BnMF5rQF.js +0 -286
- package/bundled-test-harness/assets/markdown-helpers-test-DnuuSLfS.js +0 -183
- package/bundled-test-harness/assets/markdown-highlighting-test-CWRp2Rce.js +0 -244
- package/bundled-test-harness/assets/markdown-preview-test-Bf5OqKGf.js +0 -237
- package/bundled-test-harness/assets/markdown-preview-yYHtwNeI.js +0 -69
- package/bundled-test-harness/assets/marked-sync-2EfimW4i.js +0 -2
- package/bundled-test-harness/assets/marked-sync-DZOVFLjK.js +0 -2561
- package/bundled-test-harness/assets/marked-sync-test-BaaYbZNF.js +0 -146
- package/bundled-test-harness/assets/matrix-service-sliding-sync-test-CdEy3ASW.js +0 -33
- package/bundled-test-harness/assets/mermaid-parser.core-CKNAdXJW.js +0 -114
- package/bundled-test-harness/assets/mermaid.core-C0mfwy8A.js +0 -1700
- package/bundled-test-harness/assets/message-service-subscription-test-pGz_7rz3.js +0 -113
- package/bundled-test-harness/assets/mindmap-definition-RKZ34NQL-ClcHxkdY.js +0 -1347
- package/bundled-test-harness/assets/mock-matrix-D7JHfFtT.js +0 -2
- package/bundled-test-harness/assets/mock-matrix-DqDbNhEj.js +0 -14292
- package/bundled-test-harness/assets/module-transpile-cache-test-D0M-fPxs.js +0 -66
- package/bundled-test-harness/assets/monaco.contribution-BEs3qwfd.js +0 -103
- package/bundled-test-harness/assets/monaco.contribution-Dpx8UiPl.js +0 -2
- package/bundled-test-harness/assets/monaco.contribution-RF_qxJYG.js +0 -2
- package/bundled-test-harness/assets/monaco.contribution-jPVrF29f.js +0 -243
- package/bundled-test-harness/assets/mp3-audio-def-test-CxeRk1bl.js +0 -129
- package/bundled-test-harness/assets/mutex-test-D1xyxTj2.js +0 -71
- package/bundled-test-harness/assets/number-field-test-gjAGDy6P.js +0 -153
- package/bundled-test-harness/assets/ogg-audio-def-test-B6Ww3Ixr.js +0 -191
- package/bundled-test-harness/assets/open-create-listing-modal-test-uN58T3rI.js +0 -117
- package/bundled-test-harness/assets/open-workspace-test-DXVsvBFJ.js +0 -48
- package/bundled-test-harness/assets/operator-mode-acceptance-test-BxIq2xSS.js +0 -1044
- package/bundled-test-harness/assets/operator-mode-card-catalog-test-xFYx9_ng.js +0 -989
- package/bundled-test-harness/assets/operator-mode-links-test-qhXWmz-S.js +0 -797
- package/bundled-test-harness/assets/operator-mode-state-service-test-BdA_uvaY.js +0 -122
- package/bundled-test-harness/assets/operator-mode-test-D3EyTwq3.js +0 -617
- package/bundled-test-harness/assets/operator-mode-ui-test-CSrk6Q0A.js +0 -985
- package/bundled-test-harness/assets/ordinal-DO1mUmjg.js +0 -85
- package/bundled-test-harness/assets/overlay-menu-items-test-CuqqLsQT.js +0 -316
- package/bundled-test-harness/assets/packet-YPE3B663--JkMNy78.js +0 -3
- package/bundled-test-harness/assets/panel-C2rtbx32.js +0 -3371
- package/bundled-test-harness/assets/past-sessions-test-B9SCbbXz.js +0 -316
- package/bundled-test-harness/assets/patch-code-test-CcFr9pDb.js +0 -203
- package/bundled-test-harness/assets/patch-fields-test-BW1gzcJM.js +0 -992
- package/bundled-test-harness/assets/patch-instance-test-DKqA9gQ6.js +0 -287
- package/bundled-test-harness/assets/persist-module-inspector-view-test-D1eKBUkt.js +0 -62
- package/bundled-test-harness/assets/phone-number-field-test-D1is5RWv.js +0 -72
- package/bundled-test-harness/assets/pie-LRSECV5Y-BDVv8Wdy.js +0 -3
- package/bundled-test-harness/assets/pieDiagram-4H26LBE5-CSYI-nMz.js +0 -253
- package/bundled-test-harness/assets/plan-install-test-DB-PrjPR.js +0 -417
- package/bundled-test-harness/assets/playground-B0iQV7dU.js +0 -57
- package/bundled-test-harness/assets/png-image-def-test-DnOsJGs6.js +0 -222
- package/bundled-test-harness/assets/prerender-file-extract-test-DhOLozj2.js +0 -176
- package/bundled-test-harness/assets/prerender-html-test-DKVhQZA9.js +0 -615
- package/bundled-test-harness/assets/prerender-meta-test-CnRNyqSz.js +0 -388
- package/bundled-test-harness/assets/prerender-module-test-D163QcrZ.js +0 -195
- package/bundled-test-harness/assets/prerendered-card-search-test-DX-8yabJ.js +0 -708
- package/bundled-test-harness/assets/preview-format-test-H7bnpdlC.js +0 -103
- package/bundled-test-harness/assets/preview-test-B7u6uWJR.js +0 -455
- package/bundled-test-harness/assets/qs-test-COb0mre6.js +0 -36
- package/bundled-test-harness/assets/quadrantDiagram-W4KKPZXB-2Y2ben29.js +0 -2324
- package/bundled-test-harness/assets/query-field-barrier-test-Cypj-MhK.js +0 -118
- package/bundled-test-harness/assets/query-field-error-sentinel-test-Dnqn8TdN.js +0 -202
- package/bundled-test-harness/assets/query-field-normalization-test-B7D8SHBP.js +0 -271
- package/bundled-test-harness/assets/query-field-schema-test-DIYY3-c8.js +0 -231
- package/bundled-test-harness/assets/query-fields-test-k-VBF9PE.js +0 -535
- package/bundled-test-harness/assets/queue-test-B_74vXZE.js +0 -216
- package/bundled-test-harness/assets/radar-GUYGQ44K-Cn2A0VBR.js +0 -3
- package/bundled-test-harness/assets/read-card-for-ai-assistant-test-SyL9F_La.js +0 -91
- package/bundled-test-harness/assets/read-file-for-ai-assistant-test-nLPp49U2.js +0 -45
- package/bundled-test-harness/assets/read-source-test-DBELJkhN.js +0 -67
- package/bundled-test-harness/assets/read-text-file-test-CP1JuWlX.js +0 -124
- package/bundled-test-harness/assets/realm-Dr4iygv_.js +0 -884
- package/bundled-test-harness/assets/realm-field-test-Cice2mYk.js +0 -101
- package/bundled-test-harness/assets/realm-index-card-id-test-BzpozdWc.js +0 -18
- package/bundled-test-harness/assets/realm-indexing-test-C0YSXziR.js +0 -4018
- package/bundled-test-harness/assets/realm-paths-test-DV_g07rF.js +0 -33
- package/bundled-test-harness/assets/realm-querying-test-B526abM0.js +0 -1062
- package/bundled-test-harness/assets/realm-test-D8UN5X-w.js +0 -2409
- package/bundled-test-harness/assets/reasoning-test-ClIOvdkX.js +0 -234
- package/bundled-test-harness/assets/recent-files-test-C2J_dJUD.js +0 -449
- package/bundled-test-harness/assets/reindex-realm-test-DMphy1g6.js +0 -119
- package/bundled-test-harness/assets/relationship-loading-state-test-BWrZdLlZ.js +0 -289
- package/bundled-test-harness/assets/render-component-BII_KnyK.js +0 -2
- package/bundled-test-harness/assets/render-error-test-BUAJJlUi.js +0 -22
- package/bundled-test-harness/assets/render-service-test-BKkCjErY.js +0 -87
- package/bundled-test-harness/assets/render-timer-stub-test-TUDMWJ8v.js +0 -84
- package/bundled-test-harness/assets/rendered-markdown-ColekGTF.js +0 -211
- package/bundled-test-harness/assets/rendered-markdown-test-B4CWIo02.js +0 -360
- package/bundled-test-harness/assets/requirementDiagram-4Y6WPE33-CTICatxk.js +0 -2550
- package/bundled-test-harness/assets/rich-markdown-field-test-B5u6D3Nk.js +0 -806
- package/bundled-test-harness/assets/room-message-test-0eJSqQfu.js +0 -171
- package/bundled-test-harness/assets/rust-crypto-B0m3j_yZ.js +0 -16141
- package/bundled-test-harness/assets/sanitize-module-list-test-rH6OqjKh.js +0 -68
- package/bundled-test-harness/assets/sankeyDiagram-5OEKKPKP-hBIg6-LP.js +0 -1357
- package/bundled-test-harness/assets/schema-editor-test-DH4MLFCD.js +0 -784
- package/bundled-test-harness/assets/schema-generation-test-BZMkX7VA.js +0 -28
- package/bundled-test-harness/assets/scrolling-test-CFTyLG8X.js +0 -292
- package/bundled-test-harness/assets/search-and-choose-test-CcbVyp4c.js +0 -156
- package/bundled-test-harness/assets/search-cache-key-test-BYt46iNT.js +0 -79
- package/bundled-test-harness/assets/search-command-test-BRIJPr54.js +0 -135
- package/bundled-test-harness/assets/search-correlation-id-test-B298Tfux.js +0 -101
- package/bundled-test-harness/assets/search-data-test-DHV2Fd4S.js +0 -243
- package/bundled-test-harness/assets/search-google-images-test-CNrazllP.js +0 -168
- package/bundled-test-harness/assets/search-in-flight-key-test-Dy3bU2c1.js +0 -79
- package/bundled-test-harness/assets/search-test-DL1-gD-G.js +0 -847
- package/bundled-test-harness/assets/send-ai-assistant-message-test-CyEkQ5pD.js +0 -52
- package/bundled-test-harness/assets/send-bot-trigger-event-test-CAsK28m-.js +0 -56
- package/bundled-test-harness/assets/send-request-via-proxy-test-DpMlRvPv.js +0 -333
- package/bundled-test-harness/assets/sending-test-BOeGYcTU.js +0 -317
- package/bundled-test-harness/assets/sequenceDiagram-3UESZ5HK-DQMiI040.js +0 -5551
- package/bundled-test-harness/assets/serialization-test-gY2QQVxS.js +0 -8283
- package/bundled-test-harness/assets/set-user-system-card-test-BE3y5GNK.js +0 -59
- package/bundled-test-harness/assets/setup-B8O9JQKq.js +0 -769
- package/bundled-test-harness/assets/setup-BMqGUBDK.js +0 -2
- package/bundled-test-harness/assets/show-card-test-BfJNnWMy.js +0 -362
- package/bundled-test-harness/assets/skills-test-CqhnZxBi.js +0 -568
- package/bundled-test-harness/assets/spec-test-BUKNn_1q.js +0 -1012
- package/bundled-test-harness/assets/stateDiagram-AJRCARHV-BoOij2yt.js +0 -363
- package/bundled-test-harness/assets/stateDiagram-v2-BHNVJYJU-Dosil5p2.js +0 -29
- package/bundled-test-harness/assets/store-add-test-BR1M-IDR.js +0 -52
- package/bundled-test-harness/assets/store-test-DaqI-HRh.js +0 -1562
- package/bundled-test-harness/assets/summarize-session-test-BMg54JGF.js +0 -169
- package/bundled-test-harness/assets/svg-image-def-test-xNyIKRPV.js +0 -164
- package/bundled-test-harness/assets/switch-submode-test-BKvpODUD.js +0 -168
- package/bundled-test-harness/assets/test-realm-service-worker-DK4SmTM5.js +0 -73
- package/bundled-test-harness/assets/tests-x4_eRjiT.js +0 -2770
- package/bundled-test-harness/assets/text-file-def-test-CsXiyVfI.js +0 -93
- package/bundled-test-harness/assets/text-input-validator-test-D4s_laO7.js +0 -155
- package/bundled-test-harness/assets/text-suggestion-test-CkLf1xuS.js +0 -339
- package/bundled-test-harness/assets/theme-card-test-D-6L6OfD.js +0 -573
- package/bundled-test-harness/assets/timeline-definition-PNZ67QCA-DD2d81uJ.js +0 -1545
- package/bundled-test-harness/assets/transform-cards-test-CRZF2gqZ.js +0 -341
- package/bundled-test-harness/assets/treeView-BLDUP644-CUm8wuM-.js +0 -3
- package/bundled-test-harness/assets/treemap-LRROVOQU-lbLrY2PE.js +0 -3
- package/bundled-test-harness/assets/ts-file-def-test-CDo6ojCf.js +0 -90
- package/bundled-test-harness/assets/tsMode-BPQoRibc.js +0 -968
- package/bundled-test-harness/assets/typescript-BaU6yDhK.js +0 -2
- package/bundled-test-harness/assets/update-room-skills-test-BnSgVFwT.js +0 -197
- package/bundled-test-harness/assets/url-test-CK-HB0qu.js +0 -103
- package/bundled-test-harness/assets/use-ai-assistant-test-BuJXEP8H.js +0 -330
- package/bundled-test-harness/assets/validate-realm-test-Cx7MOtS8.js +0 -53
- package/bundled-test-harness/assets/vennDiagram-CIIHVFJN-DtXtzGwZ.js +0 -2833
- package/bundled-test-harness/assets/wardley-L42UT6IY-D8aCp_Ox.js +0 -3
- package/bundled-test-harness/assets/wardleyDiagram-YWT4CUSO-D-73g3bB.js +0 -872
- package/bundled-test-harness/assets/wav-audio-def-test-DIo2GzQL.js +0 -155
- package/bundled-test-harness/assets/webp-image-def-test-BQsV0_De.js +0 -225
- package/bundled-test-harness/assets/workspace-chooser-delete-test-peDXmnQf.js +0 -189
- package/bundled-test-harness/assets/workspace-chooser-test-DS2RtTEF.js +0 -235
- package/bundled-test-harness/assets/workspace-delete-multiple-test-DTbjRSzN.js +0 -213
- package/bundled-test-harness/assets/workspace-delete-summary-test-B--ink4m.js +0 -63
- package/bundled-test-harness/assets/write-binary-file-test-A3TQ5lFn.js +0 -100
- package/bundled-test-harness/assets/write-text-file-test-D_rjNDsT.js +0 -172
- package/bundled-test-harness/assets/xychartDiagram-2RQKCTM6-D1aoqDp-.js +0 -2551
- /package/bundled-test-harness/assets/{abap-CLdVBGqB.js → abap-FZAuBTMl.js} +0 -0
- /package/bundled-test-harness/assets/{apex-DV8eHjgQ.js → apex-CAO3qFTc.js} +0 -0
- /package/bundled-test-harness/assets/{array-DsDWWqmW.js → array-CRfHnEm4.js} +0 -0
- /package/bundled-test-harness/assets/{azcli-C4pZYsiJ.js → azcli-Bnu7jG0Y.js} +0 -0
- /package/bundled-test-harness/assets/{bat-DBoaeFpB.js → bat-DdE54Pqq.js} +0 -0
- /package/bundled-test-harness/assets/{bicep-VlrJhbeK.js → bicep-Dp4vFp3K.js} +0 -0
- /package/bundled-test-harness/assets/{cameligo-jyzrvLUm.js → cameligo-Cym4x98m.js} +0 -0
- /package/bundled-test-harness/assets/{chunk-NNHCCRGN-Be15HUz2.js → chunk-NNHCCRGN-PWOfDYpb.js} +0 -0
- /package/bundled-test-harness/assets/{clojure-bzahmEtz.js → clojure-B47IJ25u.js} +0 -0
- /package/bundled-test-harness/assets/{codemirror-context-BauLYUNt.js → codemirror-context-oJy03XqC.js} +0 -0
- /package/bundled-test-harness/assets/{coffee-CMADdzOH.js → coffee-CZlkBXT8.js} +0 -0
- /package/bundled-test-harness/assets/{cpp-CEJwzcLE.js → cpp-mX4KaA7p.js} +0 -0
- /package/bundled-test-harness/assets/{csharp-XYqm0UE0.js → csharp-C-OeDGwk.js} +0 -0
- /package/bundled-test-harness/assets/{csp-82fNWQc2.js → csp-AS2OEE8R.js} +0 -0
- /package/bundled-test-harness/assets/{css-B5b0ooFS.js → css-C-TQxhWe.js} +0 -0
- /package/bundled-test-harness/assets/{cssMode-DTKuqAkO.js → cssMode-C87GnEsk.js} +0 -0
- /package/bundled-test-harness/assets/{cypher-Df9GkdDY.js → cypher-T6F_0eIM.js} +0 -0
- /package/bundled-test-harness/assets/{cytoscape.esm-D0iwZ9Jj.js → cytoscape.esm-Bc2V-MhP.js} +0 -0
- /package/bundled-test-harness/assets/{dart-C4JY9dMc.js → dart-DzVesk0n.js} +0 -0
- /package/bundled-test-harness/assets/{defaultLocale-BtLxQtxy.js → defaultLocale-CAoL4lzt.js} +0 -0
- /package/bundled-test-harness/assets/{dist-D-PuK2H3.js → dist-BZ5MfZEJ.js} +0 -0
- /package/bundled-test-harness/assets/{dockerfile-Ck0tNttO.js → dockerfile-BH0_bQxC.js} +0 -0
- /package/bundled-test-harness/assets/{ecl-BpeXqJR_.js → ecl-KIxjxrJo.js} +0 -0
- /package/bundled-test-harness/assets/{elixir-HmBzrXaX.js → elixir-CPPdtCW1.js} +0 -0
- /package/bundled-test-harness/assets/{flow9-DhsfsDhH.js → flow9-Dxho7Ldf.js} +0 -0
- /package/bundled-test-harness/assets/{freemarker2-D3Yd6nGl.js → freemarker2-DP1aOr3_.js} +0 -0
- /package/bundled-test-harness/assets/{fsharp-D56OprHc.js → fsharp-ozN53Joe.js} +0 -0
- /package/bundled-test-harness/assets/{go-BITsFLfX.js → go-DPj6Rbqe.js} +0 -0
- /package/bundled-test-harness/assets/{graphlib-qkaQhadO.js → graphlib-DOITgaas.js} +0 -0
- /package/bundled-test-harness/assets/{graphql-CJJVsEX1.js → graphql-C8_-AnBG.js} +0 -0
- /package/bundled-test-harness/assets/{handlebars-Dvw6QbL7.js → handlebars-B2gYBZpU.js} +0 -0
- /package/bundled-test-harness/assets/{hcl-DSTZcJuq.js → hcl-r3d7BhXB.js} +0 -0
- /package/bundled-test-harness/assets/{helpers-D_JZYUOQ.js → helpers-CItTycq2.js} +0 -0
- /package/bundled-test-harness/assets/{html-Bik3qLmc.js → html-DhN1Nxr0.js} +0 -0
- /package/bundled-test-harness/assets/{htmlMode-DPCaR3Ab.js → htmlMode-BnBg5hCh.js} +0 -0
- /package/bundled-test-harness/assets/{ini-li-kC8ZU.js → ini-CzzRigmS.js} +0 -0
- /package/bundled-test-harness/assets/{init-Bq7IGMcH.js → init-Bd2YUhsG.js} +0 -0
- /package/bundled-test-harness/assets/{java-CETpuNN7.js → java-BgeDsIoV.js} +0 -0
- /package/bundled-test-harness/assets/{jsonMode-CZ3hOG-W.js → jsonMode-sRb0gsB8.js} +0 -0
- /package/bundled-test-harness/assets/{julia-hgihs1aN.js → julia-u3K1H5Ts.js} +0 -0
- /package/bundled-test-harness/assets/{katex-DqhsSYO4.js → katex-CHY7BUZt.js} +0 -0
- /package/bundled-test-harness/assets/{kotlin-CKfyb82K.js → kotlin-DfqmlJ10.js} +0 -0
- /package/bundled-test-harness/assets/{less-xB5yXbw8.js → less-CSzH7DPY.js} +0 -0
- /package/bundled-test-harness/assets/{lexon-BLwrXVrI.js → lexon-DwPTpxXt.js} +0 -0
- /package/bundled-test-harness/assets/{liquid-Bf2lpknJ.js → liquid-95J9g5Vk.js} +0 -0
- /package/bundled-test-harness/assets/{lua-Ch5i3IrF.js → lua-CGw6zbeh.js} +0 -0
- /package/bundled-test-harness/assets/{m3-D5tNlhaF.js → m3-BfgwloGF.js} +0 -0
- /package/bundled-test-harness/assets/{markdown-Dzc9uMky.js → markdown-RZRK7Mc9.js} +0 -0
- /package/bundled-test-harness/assets/{mdx-xsI4TJrf.js → mdx-BYD-W2sn.js} +0 -0
- /package/bundled-test-harness/assets/{mips-CmdzHkQm.js → mips-DAySN5Lp.js} +0 -0
- /package/bundled-test-harness/assets/{msdax-CAZvxB9E.js → msdax-Cy0COjTJ.js} +0 -0
- /package/bundled-test-harness/assets/{mysql-CyVS-z5H.js → mysql-CfGw9jyw.js} +0 -0
- /package/bundled-test-harness/assets/{objective-c-CCG8cTc_.js → objective-c-B4uU-8T-.js} +0 -0
- /package/bundled-test-harness/assets/{pascal-c8B45FOC.js → pascal-CGDuZzXi.js} +0 -0
- /package/bundled-test-harness/assets/{pascaligo-CCqwSqBv.js → pascaligo-eg02k4VJ.js} +0 -0
- /package/bundled-test-harness/assets/{path-CsS38UoK.js → path-Dxiz9G2t.js} +0 -0
- /package/bundled-test-harness/assets/{perl-JUICYbO2.js → perl-BiT-JJJw.js} +0 -0
- /package/bundled-test-harness/assets/{pgsql-aNRiL0Cg.js → pgsql-DAMjrVBF.js} +0 -0
- /package/bundled-test-harness/assets/{php-B0YZj_Vw.js → php-kOSUYQyc.js} +0 -0
- /package/bundled-test-harness/assets/{pla-D3Zb3KCn.js → pla-BShYV-HC.js} +0 -0
- /package/bundled-test-harness/assets/{postiats-ks1KABlA.js → postiats-9Xamd4W2.js} +0 -0
- /package/bundled-test-harness/assets/{powerquery-D35K_osc.js → powerquery-l2Nw525Q.js} +0 -0
- /package/bundled-test-harness/assets/{powershell-DXQo6KTk.js → powershell-B5rdEn86.js} +0 -0
- /package/bundled-test-harness/assets/{protobuf-CFDvn49_.js → protobuf-DjFcruCV.js} +0 -0
- /package/bundled-test-harness/assets/{pug-CGdWzJm1.js → pug-d79Nz4-Z.js} +0 -0
- /package/bundled-test-harness/assets/{python-BHLYjYlP.js → python-d8oxFZIM.js} +0 -0
- /package/bundled-test-harness/assets/{qsharp-BIq3i63T.js → qsharp-CeTlfxZW.js} +0 -0
- /package/bundled-test-harness/assets/{qunit-2hoQyeAZ.js → qunit-Cqwmt9Vl.js} +0 -0
- /package/bundled-test-harness/assets/{r-CBvzvDSA.js → r-BOu7JTro.js} +0 -0
- /package/bundled-test-harness/assets/{razor-JQ0RiIvo.js → razor-ZatoG_Is.js} +0 -0
- /package/bundled-test-harness/assets/{recent-files-cards-BQMviQb1.js → recent-files-cards-C3vIjaKb.js} +0 -0
- /package/bundled-test-harness/assets/{redis-BmSHTqTU.js → redis-DdXYPyQE.js} +0 -0
- /package/bundled-test-harness/assets/{redshift-B1NmQEH7.js → redshift-DswnW-YX.js} +0 -0
- /package/bundled-test-harness/assets/{render-component-g_fhz2dX.js → render-component-Bs21y6iv.js} +0 -0
- /package/bundled-test-harness/assets/{restructuredtext-Br9BtTbk.js → restructuredtext-C75vUmvX.js} +0 -0
- /package/bundled-test-harness/assets/{rough.esm-D8VnzNsL.js → rough.esm-B83ARgx6.js} +0 -0
- /package/bundled-test-harness/assets/{ruby-D9_-y1I3.js → ruby-D77950a-.js} +0 -0
- /package/bundled-test-harness/assets/{rust-1Jjr1EOs.js → rust-C_G4PKsG.js} +0 -0
- /package/bundled-test-harness/assets/{sb-X2JE4zEr.js → sb-Cz3P8_Gp.js} +0 -0
- /package/bundled-test-harness/assets/{scala-qFJERKkR.js → scala-DYqUg04P.js} +0 -0
- /package/bundled-test-harness/assets/{scheme-D-WJPStO.js → scheme-B31XEGu5.js} +0 -0
- /package/bundled-test-harness/assets/{scss-DysfZiXA.js → scss-CtvB8On5.js} +0 -0
- /package/bundled-test-harness/assets/{shell-C0Iu3NNJ.js → shell-C2QqpcPN.js} +0 -0
- /package/bundled-test-harness/assets/{solidity-Bato3Qrk.js → solidity-FHrhZFd-.js} +0 -0
- /package/bundled-test-harness/assets/{sophia-DI0cKdK8.js → sophia-Cxv5FOXb.js} +0 -0
- /package/bundled-test-harness/assets/{sparql-BTJMtwoD.js → sparql-CgGkGeQB.js} +0 -0
- /package/bundled-test-harness/assets/{sql-R6uHqFYU.js → sql-S6Dos2P0.js} +0 -0
- /package/bundled-test-harness/assets/{src-CdPyB7gY.js → src-CvuaVSsl.js} +0 -0
- /package/bundled-test-harness/assets/{st-CoyBvq37.js → st-Bfa7LAWp.js} +0 -0
- /package/bundled-test-harness/assets/{swift-Bj-haAlF.js → swift-BQD5Ef-A.js} +0 -0
- /package/bundled-test-harness/assets/{systemverilog-B-x1NEFI.js → systemverilog-DaNkPux4.js} +0 -0
- /package/bundled-test-harness/assets/{tcl-DAUdSQgz.js → tcl-gOPgCDyb.js} +0 -0
- /package/bundled-test-harness/assets/{test-support-BHjxBpDK.js → test-support-BEQX5x9U.js} +0 -0
- /package/bundled-test-harness/assets/{test-support-yKvYEh-u.js → test-support-BL4XKobD.js} +0 -0
- /package/bundled-test-harness/assets/{twig-B0sJ-GzS.js → twig-Bk4gPn5b.js} +0 -0
- /package/bundled-test-harness/assets/{typescript-DTMIM5Gl.js → typescript-pPYlxWzr.js} +0 -0
- /package/bundled-test-harness/assets/{typespec-6yo9VQxY.js → typespec-D9Zz743B.js} +0 -0
- /package/bundled-test-harness/assets/{vb-Bh2IfdtJ.js → vb-ziqHIsJV.js} +0 -0
- /package/bundled-test-harness/assets/{view-card-demo-U_AOj-RK.js → view-card-demo-CSIVYD3T.js} +0 -0
- /package/bundled-test-harness/assets/{wgsl-DsvJnCCt.js → wgsl-BXiwkiJL.js} +0 -0
- /package/bundled-test-harness/assets/{xml-CisPXcjD.js → xml-a_tUOik-.js} +0 -0
- /package/bundled-test-harness/assets/{yaml-DkHUoYI5.js → yaml-B3H8LDzK.js} +0 -0
|
@@ -0,0 +1,4018 @@
|
|
|
1
|
+
import { s as __toESM } from "./chunk-CGdGNDIi.js";
|
|
2
|
+
import { r as initializeDeferredDecorator, t as decorateFieldV2 } from "./runtime-CYyqkz5q-z3Y1hsJm.js";
|
|
3
|
+
import { It as SupportedMimeType, Mi as skillCardRef, Yn as testRRI, Zn as testRealmURL, la as ri, mi as baseCardRef, o as internalKeyFor, on as init_md5_esm_bundler, sn as md5, ua as rri, vi as baseRealm } from "./runtime-common-C7uLt5dN.js";
|
|
4
|
+
import { $n as setComponentTemplate } from "./service-DJ87xpDt.js";
|
|
5
|
+
import { V as templateFactory } from "./index-DaCZcoCY-D2gI_aMw.js";
|
|
6
|
+
import { a as REALM_INDEX_BOILERPLATE_HTML } from "./card-prerender-ClYlSOBU.js";
|
|
7
|
+
import { o as Component } from "./dist-CXaz7pMY.js";
|
|
8
|
+
import "./template-D3TMIrc1.js";
|
|
9
|
+
import "./template-factory-DMEv2kVd.js";
|
|
10
|
+
import { t as require_qunit } from "./qunit-Cqwmt9Vl.js";
|
|
11
|
+
import { r as getService } from "./dist-CY3T64Hs.js";
|
|
12
|
+
import { A as setupIntegrationTestRealm, L as testModuleRRI, O as setupCardLogs, R as testModuleRealm, d as cardInfo, f as cleanWhiteSpace, j as setupLocalIndexing, rt as setupRenderingTest, t as setupMockMatrix, y as getFileCreatedAt } from "./mock-matrix-BhFWlMMr.js";
|
|
13
|
+
import { G as contains, I as StringField, K as containsMany, O as NumberField, Q as field, a as CardDef, b as FieldDef, d as Component$1, lt as linksTo, m as DateTimeField, mt as setupBaseRealm } from "./base-realm-DpSTsZxD.js";
|
|
14
|
+
//#region ../runtime-common/helpers/strip-scoped-css-attributes.ts
|
|
15
|
+
init_md5_esm_bundler();
|
|
16
|
+
var import_qunit = /* @__PURE__ */ __toESM(require_qunit());
|
|
17
|
+
function stripScopedCSSAttributes(htmlString) {
|
|
18
|
+
return htmlString.replace(/ data-scopedcss-[0-9a-f]{10}-[0-9a-f]{10}/g, "");
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region tests/integration/realm-indexing-test.gts
|
|
22
|
+
var loader;
|
|
23
|
+
function unwrap(html) {
|
|
24
|
+
return html.trim().replace(/^<div ([^>]*>)/, "").trim().replace(/^<!---->/, "").replace(/<\/div>$/, "").trim();
|
|
25
|
+
}
|
|
26
|
+
function assertInnerHtmlMatches(assert, actual, expected, message) {
|
|
27
|
+
let cleanedActual = cleanWhiteSpace(stripScopedCSSAttributes(unwrap(actual)));
|
|
28
|
+
let cleanedExpected = cleanWhiteSpace(expected);
|
|
29
|
+
assert.strictEqual(cleanedActual, cleanedExpected, message);
|
|
30
|
+
}
|
|
31
|
+
(0, import_qunit.module)(`Integration | realm indexing`, function(hooks) {
|
|
32
|
+
setupRenderingTest(hooks);
|
|
33
|
+
setupBaseRealm(hooks);
|
|
34
|
+
hooks.beforeEach(function() {
|
|
35
|
+
loader = getService("loader-service").loader;
|
|
36
|
+
});
|
|
37
|
+
setupLocalIndexing(hooks);
|
|
38
|
+
let mockMatrixUtils = setupMockMatrix(hooks);
|
|
39
|
+
setupCardLogs(hooks, async () => await loader.import(`${baseRealm.url}card-api`));
|
|
40
|
+
async function getInstance(realm, url) {
|
|
41
|
+
let maybeInstance = await realm.realmIndexQueryEngine.instance(url);
|
|
42
|
+
if (maybeInstance?.type === "instance-error") return;
|
|
43
|
+
return maybeInstance;
|
|
44
|
+
}
|
|
45
|
+
(0, import_qunit.test)("full indexing discovers card instances", async function(assert) {
|
|
46
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
47
|
+
mockMatrixUtils,
|
|
48
|
+
contents: { "empty.json": { data: { meta: { adoptsFrom: {
|
|
49
|
+
module: "https://cardstack.com/base/card-api",
|
|
50
|
+
name: "CardDef"
|
|
51
|
+
} } } } }
|
|
52
|
+
});
|
|
53
|
+
let { data: cards } = await realm.realmIndexQueryEngine.searchCards({});
|
|
54
|
+
assert.deepEqual(cards, [{
|
|
55
|
+
id: testRRI("empty"),
|
|
56
|
+
type: "card",
|
|
57
|
+
attributes: {
|
|
58
|
+
cardInfo,
|
|
59
|
+
cardTitle: "Untitled Card",
|
|
60
|
+
cardDescription: null,
|
|
61
|
+
cardThumbnailURL: null
|
|
62
|
+
},
|
|
63
|
+
relationships: { "cardInfo.theme": { links: { self: null } } },
|
|
64
|
+
meta: {
|
|
65
|
+
adoptsFrom: {
|
|
66
|
+
module: rri("https://cardstack.com/base/card-api"),
|
|
67
|
+
name: "CardDef"
|
|
68
|
+
},
|
|
69
|
+
realmURL: ri("http://test-realm/test/"),
|
|
70
|
+
realmInfo: {
|
|
71
|
+
backgroundURL: null,
|
|
72
|
+
iconURL: null,
|
|
73
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
74
|
+
lastPublishedAt: null,
|
|
75
|
+
name: "Unnamed Workspace",
|
|
76
|
+
publishable: null,
|
|
77
|
+
realmUserId: "@realm_server:localhost",
|
|
78
|
+
showAsCatalog: null,
|
|
79
|
+
visibility: "public"
|
|
80
|
+
},
|
|
81
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}empty.json`),
|
|
82
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "empty.json")
|
|
83
|
+
},
|
|
84
|
+
links: { self: `${testRealmURL}empty` }
|
|
85
|
+
}]);
|
|
86
|
+
});
|
|
87
|
+
(0, import_qunit.test)("indexing captures file meta content hash", async function(assert) {
|
|
88
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
89
|
+
mockMatrixUtils,
|
|
90
|
+
contents: { "notes.txt": "Hello from the test realm." }
|
|
91
|
+
});
|
|
92
|
+
await realm.fullIndex();
|
|
93
|
+
let { virtualNetwork } = getService("network");
|
|
94
|
+
let response = await virtualNetwork.fetch(new URL("notes.txt", testRealmURL), { headers: { Accept: SupportedMimeType.FileMeta } });
|
|
95
|
+
assert.true(response.ok, "file meta request succeeds");
|
|
96
|
+
let body = await response.json();
|
|
97
|
+
assert.strictEqual(body?.data?.type, "file-meta");
|
|
98
|
+
let contentHash = body?.data?.attributes?.contentHash;
|
|
99
|
+
let expectedHash = md5(new TextEncoder().encode("Hello from the test realm."));
|
|
100
|
+
assert.strictEqual(contentHash, expectedHash, "content hash is returned");
|
|
101
|
+
});
|
|
102
|
+
(0, import_qunit.test)("full indexing stores file entries with search doc and deps", async function(assert) {
|
|
103
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
104
|
+
mockMatrixUtils,
|
|
105
|
+
contents: { "notes.txt": "Hello from the test realm." }
|
|
106
|
+
});
|
|
107
|
+
await realm.fullIndex();
|
|
108
|
+
let fileURL = new URL("notes.txt", testRealmURL);
|
|
109
|
+
let fileEntry = await realm.realmIndexQueryEngine.file(fileURL);
|
|
110
|
+
assert.ok(fileEntry, "file entry exists");
|
|
111
|
+
assert.strictEqual(fileEntry?.type, "file");
|
|
112
|
+
assert.strictEqual(fileEntry?.searchDoc?.name, "notes.txt", "search doc includes name");
|
|
113
|
+
assert.strictEqual(fileEntry?.searchDoc?.contentType, "text/plain", "search doc includes contentType");
|
|
114
|
+
assert.strictEqual(fileEntry?.searchDoc?.contentHash, md5(new TextEncoder().encode("Hello from the test realm.")), "search doc includes contentHash");
|
|
115
|
+
assert.ok(fileEntry?.deps?.includes(`${baseRealm.url}file-api`), "deps include base file-api module");
|
|
116
|
+
let includesSelfFileDependency = fileEntry?.deps?.includes(fileURL.href);
|
|
117
|
+
assert.false(includesSelfFileDependency, "deps exclude self file URL");
|
|
118
|
+
});
|
|
119
|
+
(0, import_qunit.test)("full indexing skips over unchanged items in index", async function(assert) {
|
|
120
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
121
|
+
mockMatrixUtils,
|
|
122
|
+
contents: {
|
|
123
|
+
"test1.json": { data: { meta: { adoptsFrom: {
|
|
124
|
+
module: "https://cardstack.com/base/card-api",
|
|
125
|
+
name: "CardDef"
|
|
126
|
+
} } } },
|
|
127
|
+
"test2.json": { data: { meta: { adoptsFrom: {
|
|
128
|
+
module: "https://cardstack.com/base/card-api",
|
|
129
|
+
name: "CardDef"
|
|
130
|
+
} } } },
|
|
131
|
+
"pet.gts": `
|
|
132
|
+
import { contains, field, CardDef } from "https://cardstack.com/base/card-api";
|
|
133
|
+
import StringField from "https://cardstack.com/base/string";
|
|
134
|
+
|
|
135
|
+
export class Pet extends CardDef {
|
|
136
|
+
@field firstName = contains(StringField);
|
|
137
|
+
}
|
|
138
|
+
`
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
assert.deepEqual(realm.realmIndexUpdater.stats, {
|
|
142
|
+
filesIndexed: 3,
|
|
143
|
+
fileErrors: 0,
|
|
144
|
+
instanceErrors: 0,
|
|
145
|
+
instancesIndexed: 2,
|
|
146
|
+
totalIndexEntries: 5
|
|
147
|
+
}, "indexer stats are correct");
|
|
148
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
149
|
+
await adapter.write("test2.json", JSON.stringify({ data: {
|
|
150
|
+
attributes: { cardTitle: "test" },
|
|
151
|
+
meta: { adoptsFrom: {
|
|
152
|
+
module: rri("https://cardstack.com/base/card-api"),
|
|
153
|
+
name: "CardDef"
|
|
154
|
+
} }
|
|
155
|
+
} }));
|
|
156
|
+
await realm.fullIndex();
|
|
157
|
+
assert.deepEqual(realm.realmIndexUpdater.stats, {
|
|
158
|
+
filesIndexed: 1,
|
|
159
|
+
fileErrors: 0,
|
|
160
|
+
instanceErrors: 0,
|
|
161
|
+
instancesIndexed: 1,
|
|
162
|
+
totalIndexEntries: 5
|
|
163
|
+
}, "indexer stats are correct");
|
|
164
|
+
});
|
|
165
|
+
(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) {
|
|
166
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
167
|
+
mockMatrixUtils,
|
|
168
|
+
contents: { "Pet/mango.json": { data: {
|
|
169
|
+
id: `${testRealmURL}Pet/mango`,
|
|
170
|
+
attributes: { firstName: "Mango" },
|
|
171
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
172
|
+
meta: { adoptsFrom: {
|
|
173
|
+
module: "https://localhost:4202/test/pet",
|
|
174
|
+
name: "Pet"
|
|
175
|
+
} }
|
|
176
|
+
} } }
|
|
177
|
+
});
|
|
178
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
179
|
+
{
|
|
180
|
+
let mango = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
181
|
+
if (mango?.type === "doc") {
|
|
182
|
+
let owner = mango.doc.data.relationships?.owner;
|
|
183
|
+
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");
|
|
184
|
+
} else assert.ok(false, `mango with a missing linksTo target indexes as a clean instance, got: ${mango?.error?.errorDetail.message}`);
|
|
185
|
+
let mangoInstance = await queryEngine.instance(new URL(`${testRealmURL}Pet/mango`));
|
|
186
|
+
assert.ok((mangoInstance?.deps ?? []).some((dep) => dep === `http://test-realm/test/Person/owner.json` || dep === `http://test-realm/test/Person/owner`), "deps include the unresolved owner link so invalidation can reach mango when the target is created");
|
|
187
|
+
}
|
|
188
|
+
await realm.write("Person/owner.json", JSON.stringify({ data: {
|
|
189
|
+
id: testRRI("Person/owner"),
|
|
190
|
+
attributes: { firstName: "Hassan" },
|
|
191
|
+
meta: { adoptsFrom: {
|
|
192
|
+
module: rri("https://localhost:4202/test/person"),
|
|
193
|
+
name: "Person"
|
|
194
|
+
} }
|
|
195
|
+
} }));
|
|
196
|
+
{
|
|
197
|
+
let mango = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
198
|
+
if (mango?.type === "doc") assert.deepEqual(mango.doc.data, {
|
|
199
|
+
id: testRRI("Pet/mango"),
|
|
200
|
+
type: "card",
|
|
201
|
+
links: { self: "./mango" },
|
|
202
|
+
attributes: {
|
|
203
|
+
cardDescription: null,
|
|
204
|
+
firstName: "Mango",
|
|
205
|
+
cardTitle: "Mango",
|
|
206
|
+
cardThumbnailURL: null,
|
|
207
|
+
cardInfo
|
|
208
|
+
},
|
|
209
|
+
relationships: {
|
|
210
|
+
owner: { links: { self: `../Person/owner` } },
|
|
211
|
+
"cardInfo.theme": { links: { self: null } }
|
|
212
|
+
},
|
|
213
|
+
meta: {
|
|
214
|
+
adoptsFrom: {
|
|
215
|
+
module: rri("https://localhost:4202/test/pet"),
|
|
216
|
+
name: "Pet"
|
|
217
|
+
},
|
|
218
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/mango.json`),
|
|
219
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/mango.json"),
|
|
220
|
+
realmURL: ri("http://test-realm/test/"),
|
|
221
|
+
realmInfo: {
|
|
222
|
+
backgroundURL: null,
|
|
223
|
+
iconURL: null,
|
|
224
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
225
|
+
lastPublishedAt: null,
|
|
226
|
+
name: "Unnamed Workspace",
|
|
227
|
+
publishable: null,
|
|
228
|
+
realmUserId: "@realm_server:localhost",
|
|
229
|
+
showAsCatalog: null,
|
|
230
|
+
visibility: "public"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
(0, import_qunit.test)("can query the \"production\" index while performing indexing operations", async function(assert) {
|
|
238
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
239
|
+
mockMatrixUtils,
|
|
240
|
+
contents: { "Pet/mango.json": { data: {
|
|
241
|
+
id: `${testRealmURL}Pet/mango`,
|
|
242
|
+
attributes: { firstName: "Mango" },
|
|
243
|
+
meta: { adoptsFrom: {
|
|
244
|
+
module: "https://localhost:4202/test/pet",
|
|
245
|
+
name: "Pet"
|
|
246
|
+
} }
|
|
247
|
+
} } }
|
|
248
|
+
});
|
|
249
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
250
|
+
let updateCard = realm.write("Pet/mango.json", JSON.stringify({ data: {
|
|
251
|
+
id: testRRI("Pet/mango"),
|
|
252
|
+
attributes: { firstName: "Van Gogh" },
|
|
253
|
+
meta: { adoptsFrom: {
|
|
254
|
+
module: rri("https://localhost:4202/test/pet"),
|
|
255
|
+
name: "Pet"
|
|
256
|
+
} }
|
|
257
|
+
} }));
|
|
258
|
+
let getCard = queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
259
|
+
let [_, entry] = await Promise.all([updateCard, getCard]);
|
|
260
|
+
if (entry?.type === "doc") {
|
|
261
|
+
delete entry.doc.data.meta.lastModified;
|
|
262
|
+
delete entry.doc.data.meta.resourceCreatedAt;
|
|
263
|
+
assert.deepEqual(entry.doc.data, {
|
|
264
|
+
id: testRRI("Pet/mango"),
|
|
265
|
+
type: "card",
|
|
266
|
+
links: { self: "./mango" },
|
|
267
|
+
attributes: {
|
|
268
|
+
cardDescription: null,
|
|
269
|
+
firstName: "Mango",
|
|
270
|
+
cardTitle: "Mango",
|
|
271
|
+
cardThumbnailURL: null,
|
|
272
|
+
cardInfo
|
|
273
|
+
},
|
|
274
|
+
relationships: {
|
|
275
|
+
owner: { links: { self: null } },
|
|
276
|
+
"cardInfo.theme": { links: { self: null } }
|
|
277
|
+
},
|
|
278
|
+
meta: {
|
|
279
|
+
adoptsFrom: {
|
|
280
|
+
module: rri("https://localhost:4202/test/pet"),
|
|
281
|
+
name: "Pet"
|
|
282
|
+
},
|
|
283
|
+
realmURL: ri("http://test-realm/test/"),
|
|
284
|
+
realmInfo: {
|
|
285
|
+
backgroundURL: null,
|
|
286
|
+
iconURL: null,
|
|
287
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
288
|
+
lastPublishedAt: null,
|
|
289
|
+
name: "Unnamed Workspace",
|
|
290
|
+
publishable: null,
|
|
291
|
+
realmUserId: "@realm_server:localhost",
|
|
292
|
+
showAsCatalog: null,
|
|
293
|
+
visibility: "public"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
298
|
+
{
|
|
299
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
300
|
+
if (entry?.type === "doc") {
|
|
301
|
+
delete entry.doc.data.meta.lastModified;
|
|
302
|
+
delete entry.doc.data.meta.resourceCreatedAt;
|
|
303
|
+
assert.deepEqual(entry.doc.data, {
|
|
304
|
+
id: testRRI("Pet/mango"),
|
|
305
|
+
type: "card",
|
|
306
|
+
links: { self: "./mango" },
|
|
307
|
+
attributes: {
|
|
308
|
+
cardDescription: null,
|
|
309
|
+
firstName: "Van Gogh",
|
|
310
|
+
cardTitle: "Van Gogh",
|
|
311
|
+
cardThumbnailURL: null,
|
|
312
|
+
cardInfo
|
|
313
|
+
},
|
|
314
|
+
relationships: {
|
|
315
|
+
owner: { links: { self: null } },
|
|
316
|
+
"cardInfo.theme": { links: { self: null } }
|
|
317
|
+
},
|
|
318
|
+
meta: {
|
|
319
|
+
adoptsFrom: {
|
|
320
|
+
module: rri("https://localhost:4202/test/pet"),
|
|
321
|
+
name: "Pet"
|
|
322
|
+
},
|
|
323
|
+
realmURL: ri("http://test-realm/test/"),
|
|
324
|
+
realmInfo: {
|
|
325
|
+
backgroundURL: null,
|
|
326
|
+
iconURL: null,
|
|
327
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
328
|
+
lastPublishedAt: null,
|
|
329
|
+
name: "Unnamed Workspace",
|
|
330
|
+
publishable: null,
|
|
331
|
+
realmUserId: "@realm_server:localhost",
|
|
332
|
+
showAsCatalog: null,
|
|
333
|
+
visibility: "public"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
(0, import_qunit.test)("write with waitForIndex:false returns before indexing settles and incrementalIndexing() drains it", async function(assert) {
|
|
341
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
342
|
+
mockMatrixUtils,
|
|
343
|
+
contents: { "Pet/mango.json": { data: {
|
|
344
|
+
id: `${testRealmURL}Pet/mango`,
|
|
345
|
+
attributes: { firstName: "Mango" },
|
|
346
|
+
meta: { adoptsFrom: {
|
|
347
|
+
module: "https://localhost:4202/test/pet",
|
|
348
|
+
name: "Pet"
|
|
349
|
+
} }
|
|
350
|
+
} } }
|
|
351
|
+
});
|
|
352
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
353
|
+
await realm.write("Pet/mango.json", JSON.stringify({ data: {
|
|
354
|
+
id: testRRI("Pet/mango"),
|
|
355
|
+
attributes: { firstName: "Van Gogh" },
|
|
356
|
+
meta: { adoptsFrom: {
|
|
357
|
+
module: rri("https://localhost:4202/test/pet"),
|
|
358
|
+
name: "Pet"
|
|
359
|
+
} }
|
|
360
|
+
} }), { waitForIndex: false });
|
|
361
|
+
let pendingIndex = realm.incrementalIndexing();
|
|
362
|
+
assert.notStrictEqual(pendingIndex, void 0, "indexing is still pending immediately after waitForIndex:false write");
|
|
363
|
+
await pendingIndex;
|
|
364
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "incrementalIndexing() resolves to undefined once the deferred indexing settles");
|
|
365
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
366
|
+
if (entry?.type === "doc") assert.strictEqual(entry.doc.data.attributes?.firstName, "Van Gogh", "index reflects the deferred-indexed write after the drain");
|
|
367
|
+
else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
368
|
+
});
|
|
369
|
+
(0, import_qunit.test)("HTTP DELETE +source returns before incremental indexing settles", async function(assert) {
|
|
370
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
371
|
+
mockMatrixUtils,
|
|
372
|
+
contents: { "Pet/mango.json": { data: {
|
|
373
|
+
id: `${testRealmURL}Pet/mango`,
|
|
374
|
+
attributes: { firstName: "Mango" },
|
|
375
|
+
meta: { adoptsFrom: {
|
|
376
|
+
module: "http://localhost:4202/test/pet",
|
|
377
|
+
name: "Pet"
|
|
378
|
+
} }
|
|
379
|
+
} } }
|
|
380
|
+
});
|
|
381
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
382
|
+
await realm.incrementalIndexing();
|
|
383
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "baseline: no pending indexing before DELETE");
|
|
384
|
+
let response = await realm.handle(new Request(`${testRealmURL}Pet/mango`, {
|
|
385
|
+
method: "DELETE",
|
|
386
|
+
headers: { Accept: "application/vnd.card+source" }
|
|
387
|
+
}));
|
|
388
|
+
if (!response) throw new Error("realm did not handle the DELETE");
|
|
389
|
+
assert.strictEqual(response.status, 204, "DELETE returns 204");
|
|
390
|
+
assert.strictEqual(await adapter.openFile("Pet/mango.json"), void 0, "file is gone from disk before indexing settles");
|
|
391
|
+
let pendingIndex = realm.incrementalIndexing();
|
|
392
|
+
assert.notStrictEqual(pendingIndex, void 0, "DELETE returned before deferred indexing settled");
|
|
393
|
+
await pendingIndex;
|
|
394
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "incrementalIndexing() drains the deferred delete work");
|
|
395
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
396
|
+
assert.strictEqual(entry, void 0, "index reflects the deletion after the drain");
|
|
397
|
+
});
|
|
398
|
+
(0, import_qunit.test)("realm.delete() with default options (waitForIndex:true) awaits indexing inline", async function(assert) {
|
|
399
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
400
|
+
mockMatrixUtils,
|
|
401
|
+
contents: { "Pet/mango.json": { data: {
|
|
402
|
+
id: `${testRealmURL}Pet/mango`,
|
|
403
|
+
attributes: { firstName: "Mango" },
|
|
404
|
+
meta: { adoptsFrom: {
|
|
405
|
+
module: "http://localhost:4202/test/pet",
|
|
406
|
+
name: "Pet"
|
|
407
|
+
} }
|
|
408
|
+
} } }
|
|
409
|
+
});
|
|
410
|
+
await realm.incrementalIndexing();
|
|
411
|
+
await realm.delete("Pet/mango.json");
|
|
412
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "no pending indexing remains after a default delete — the await happened inline");
|
|
413
|
+
});
|
|
414
|
+
(0, import_qunit.test)("write with default options (waitForIndex:true) awaits indexing inline", async function(assert) {
|
|
415
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
416
|
+
mockMatrixUtils,
|
|
417
|
+
contents: { "Pet/mango.json": { data: {
|
|
418
|
+
id: `${testRealmURL}Pet/mango`,
|
|
419
|
+
attributes: { firstName: "Mango" },
|
|
420
|
+
meta: { adoptsFrom: {
|
|
421
|
+
module: "https://localhost:4202/test/pet",
|
|
422
|
+
name: "Pet"
|
|
423
|
+
} }
|
|
424
|
+
} } }
|
|
425
|
+
});
|
|
426
|
+
await realm.write("Pet/mango.json", JSON.stringify({ data: {
|
|
427
|
+
id: testRRI("Pet/mango"),
|
|
428
|
+
attributes: { firstName: "Van Gogh" },
|
|
429
|
+
meta: { adoptsFrom: {
|
|
430
|
+
module: rri("https://localhost:4202/test/pet"),
|
|
431
|
+
name: "Pet"
|
|
432
|
+
} }
|
|
433
|
+
} }));
|
|
434
|
+
assert.strictEqual(realm.incrementalIndexing(), void 0, "no pending indexing remains after a default write — the await happened inline");
|
|
435
|
+
});
|
|
436
|
+
(0, import_qunit.test)("can index card with linkTo field", async function(assert) {
|
|
437
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
438
|
+
mockMatrixUtils,
|
|
439
|
+
contents: {
|
|
440
|
+
"Person/owner.json": { data: {
|
|
441
|
+
id: `${testRealmURL}Person/owner`,
|
|
442
|
+
attributes: { firstName: "Hassan" },
|
|
443
|
+
meta: { adoptsFrom: {
|
|
444
|
+
module: "https://localhost:4202/test/person",
|
|
445
|
+
name: "Person"
|
|
446
|
+
} }
|
|
447
|
+
} },
|
|
448
|
+
"Pet/mango.json": { data: {
|
|
449
|
+
id: `${testRealmURL}Pet/mango`,
|
|
450
|
+
attributes: { firstName: "Mango" },
|
|
451
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
452
|
+
meta: { adoptsFrom: {
|
|
453
|
+
module: "https://localhost:4202/test/pet",
|
|
454
|
+
name: "Pet"
|
|
455
|
+
} }
|
|
456
|
+
} }
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
let mango = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
460
|
+
if (mango?.type === "doc") assert.deepEqual(mango.doc.data, {
|
|
461
|
+
id: testRRI("Pet/mango"),
|
|
462
|
+
type: "card",
|
|
463
|
+
links: { self: "./mango" },
|
|
464
|
+
attributes: {
|
|
465
|
+
cardDescription: null,
|
|
466
|
+
firstName: "Mango",
|
|
467
|
+
cardTitle: "Mango",
|
|
468
|
+
cardThumbnailURL: null,
|
|
469
|
+
cardInfo
|
|
470
|
+
},
|
|
471
|
+
relationships: {
|
|
472
|
+
owner: { links: { self: `../Person/owner` } },
|
|
473
|
+
"cardInfo.theme": { links: { self: null } }
|
|
474
|
+
},
|
|
475
|
+
meta: {
|
|
476
|
+
adoptsFrom: {
|
|
477
|
+
module: rri("https://localhost:4202/test/pet"),
|
|
478
|
+
name: "Pet"
|
|
479
|
+
},
|
|
480
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/mango.json`),
|
|
481
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/mango.json"),
|
|
482
|
+
realmURL: ri("http://test-realm/test/"),
|
|
483
|
+
realmInfo: {
|
|
484
|
+
backgroundURL: null,
|
|
485
|
+
iconURL: null,
|
|
486
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
487
|
+
lastPublishedAt: null,
|
|
488
|
+
name: "Unnamed Workspace",
|
|
489
|
+
publishable: null,
|
|
490
|
+
realmUserId: "@realm_server:localhost",
|
|
491
|
+
showAsCatalog: null,
|
|
492
|
+
visibility: "public"
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
497
|
+
});
|
|
498
|
+
(0, import_qunit.test)("can index card with a relative linkTo field", async function(assert) {
|
|
499
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
500
|
+
mockMatrixUtils,
|
|
501
|
+
contents: {
|
|
502
|
+
"Person/owner.json": { data: {
|
|
503
|
+
id: `${testRealmURL}Person/owner`,
|
|
504
|
+
attributes: { firstName: "Hassan" },
|
|
505
|
+
meta: { adoptsFrom: {
|
|
506
|
+
module: "https://localhost:4202/test/person",
|
|
507
|
+
name: "Person"
|
|
508
|
+
} }
|
|
509
|
+
} },
|
|
510
|
+
"Pet/mango.json": { data: {
|
|
511
|
+
id: `${testRealmURL}Pet/mango`,
|
|
512
|
+
attributes: { firstName: "Mango" },
|
|
513
|
+
relationships: { owner: { links: { self: `../Person/owner` } } },
|
|
514
|
+
meta: { adoptsFrom: {
|
|
515
|
+
module: "https://localhost:4202/test/pet",
|
|
516
|
+
name: "Pet"
|
|
517
|
+
} }
|
|
518
|
+
} }
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
let mango = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Pet/mango`));
|
|
522
|
+
if (mango?.type === "doc") assert.deepEqual(mango.doc.data, {
|
|
523
|
+
id: testRRI("Pet/mango"),
|
|
524
|
+
type: "card",
|
|
525
|
+
links: { self: "./mango" },
|
|
526
|
+
attributes: {
|
|
527
|
+
cardDescription: null,
|
|
528
|
+
firstName: "Mango",
|
|
529
|
+
cardTitle: "Mango",
|
|
530
|
+
cardThumbnailURL: null,
|
|
531
|
+
cardInfo
|
|
532
|
+
},
|
|
533
|
+
relationships: {
|
|
534
|
+
owner: { links: { self: `../Person/owner` } },
|
|
535
|
+
"cardInfo.theme": { links: { self: null } }
|
|
536
|
+
},
|
|
537
|
+
meta: {
|
|
538
|
+
adoptsFrom: {
|
|
539
|
+
module: rri("https://localhost:4202/test/pet"),
|
|
540
|
+
name: "Pet"
|
|
541
|
+
},
|
|
542
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/mango.json`),
|
|
543
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/mango.json"),
|
|
544
|
+
realmURL: ri("http://test-realm/test/"),
|
|
545
|
+
realmInfo: {
|
|
546
|
+
backgroundURL: null,
|
|
547
|
+
iconURL: null,
|
|
548
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
549
|
+
lastPublishedAt: null,
|
|
550
|
+
name: "Unnamed Workspace",
|
|
551
|
+
publishable: null,
|
|
552
|
+
realmUserId: "@realm_server:localhost",
|
|
553
|
+
showAsCatalog: null,
|
|
554
|
+
visibility: "public"
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
559
|
+
});
|
|
560
|
+
(0, import_qunit.test)("relative code-ref fields are serialized as absolute URLs", async function(assert) {
|
|
561
|
+
class Person extends CardDef {
|
|
562
|
+
static {
|
|
563
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
564
|
+
return contains(StringField);
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
568
|
+
}
|
|
569
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
570
|
+
mockMatrixUtils,
|
|
571
|
+
contents: {
|
|
572
|
+
"person.gts": { Person },
|
|
573
|
+
"person-spec.json": { data: {
|
|
574
|
+
attributes: {
|
|
575
|
+
cardTitle: "Person Card",
|
|
576
|
+
cardDescription: "Spec for Person card",
|
|
577
|
+
specType: "card",
|
|
578
|
+
ref: {
|
|
579
|
+
module: `./person`,
|
|
580
|
+
name: "Person"
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
meta: { adoptsFrom: {
|
|
584
|
+
module: "https://cardstack.com/base/spec",
|
|
585
|
+
name: "Spec"
|
|
586
|
+
} }
|
|
587
|
+
} }
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
591
|
+
let entry = await indexer.cardDocument(new URL(`${testRealmURL}person-spec`));
|
|
592
|
+
if (entry?.type === "doc") {
|
|
593
|
+
assert.deepEqual(entry.doc.data, {
|
|
594
|
+
id: testRRI("person-spec"),
|
|
595
|
+
type: "card",
|
|
596
|
+
links: { self: "./person-spec" },
|
|
597
|
+
attributes: {
|
|
598
|
+
cardTitle: "Person Card",
|
|
599
|
+
cardDescription: "Spec for Person card",
|
|
600
|
+
moduleHref: `${testRealmURL}person`,
|
|
601
|
+
readMe: null,
|
|
602
|
+
specType: "card",
|
|
603
|
+
isCard: true,
|
|
604
|
+
isComponent: false,
|
|
605
|
+
isField: false,
|
|
606
|
+
cardThumbnailURL: null,
|
|
607
|
+
ref: {
|
|
608
|
+
module: `${testRealmURL}person`,
|
|
609
|
+
name: "Person"
|
|
610
|
+
},
|
|
611
|
+
containedExamples: [],
|
|
612
|
+
cardInfo
|
|
613
|
+
},
|
|
614
|
+
relationships: {
|
|
615
|
+
"cardInfo.theme": { links: { self: null } },
|
|
616
|
+
linkedExamples: { links: { self: null } }
|
|
617
|
+
},
|
|
618
|
+
meta: {
|
|
619
|
+
adoptsFrom: {
|
|
620
|
+
module: rri("https://cardstack.com/base/spec"),
|
|
621
|
+
name: "Spec"
|
|
622
|
+
},
|
|
623
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}person-spec.json`),
|
|
624
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "person-spec.json"),
|
|
625
|
+
realmURL: testRealmURL,
|
|
626
|
+
realmInfo: {
|
|
627
|
+
backgroundURL: null,
|
|
628
|
+
iconURL: null,
|
|
629
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
630
|
+
lastPublishedAt: null,
|
|
631
|
+
name: "Unnamed Workspace",
|
|
632
|
+
publishable: null,
|
|
633
|
+
realmUserId: "@realm_server:localhost",
|
|
634
|
+
showAsCatalog: null,
|
|
635
|
+
visibility: "public"
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
let instance = await indexer.instance(new URL(`${testRealmURL}person-spec`));
|
|
640
|
+
assert.deepEqual(instance?.searchDoc, {
|
|
641
|
+
_cardType: "Spec",
|
|
642
|
+
cardDescription: "Spec for Person card",
|
|
643
|
+
id: `${testRealmURL}person-spec`,
|
|
644
|
+
specType: "card",
|
|
645
|
+
moduleHref: `${testRealmURL}person`,
|
|
646
|
+
ref: `${testRealmURL}person/Person`,
|
|
647
|
+
cardTitle: "Person Card",
|
|
648
|
+
containedExamples: null,
|
|
649
|
+
linkedExamples: null,
|
|
650
|
+
isCard: true,
|
|
651
|
+
isComponent: false,
|
|
652
|
+
isField: false,
|
|
653
|
+
cardInfo: { theme: null }
|
|
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(StringField);
|
|
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: "https://cardstack.com/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
|
+
cardThumbnailURL: null,
|
|
714
|
+
ref: {
|
|
715
|
+
module: `${testRealmURL}person`,
|
|
716
|
+
name: "Person"
|
|
717
|
+
},
|
|
718
|
+
containedExamples: [],
|
|
719
|
+
cardInfo
|
|
720
|
+
},
|
|
721
|
+
relationships: {
|
|
722
|
+
"cardInfo.theme": { links: { self: null } },
|
|
723
|
+
linkedExamples: { links: { self: null } }
|
|
724
|
+
},
|
|
725
|
+
meta: {
|
|
726
|
+
adoptsFrom: {
|
|
727
|
+
module: rri("https://cardstack.com/base/spec"),
|
|
728
|
+
name: "Spec"
|
|
729
|
+
},
|
|
730
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}person-spec.json`),
|
|
731
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "person-spec.json"),
|
|
732
|
+
realmURL: testRealmURL,
|
|
733
|
+
realmInfo: {
|
|
734
|
+
backgroundURL: null,
|
|
735
|
+
iconURL: null,
|
|
736
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
737
|
+
lastPublishedAt: null,
|
|
738
|
+
name: "Unnamed Workspace",
|
|
739
|
+
publishable: null,
|
|
740
|
+
realmUserId: "@realm_server:localhost",
|
|
741
|
+
showAsCatalog: null,
|
|
742
|
+
visibility: "public"
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
let instance = await indexer.instance(new URL(`${testRealmURL}person-spec`));
|
|
747
|
+
assert.deepEqual(instance?.searchDoc, {
|
|
748
|
+
_cardType: "Spec",
|
|
749
|
+
cardDescription: "Spec for Person card",
|
|
750
|
+
id: `${testRealmURL}person-spec`,
|
|
751
|
+
specType: "card",
|
|
752
|
+
moduleHref: `${testRealmURL}person`,
|
|
753
|
+
ref: `${testRealmURL}person/Person`,
|
|
754
|
+
cardTitle: "Person Card",
|
|
755
|
+
containedExamples: null,
|
|
756
|
+
linkedExamples: null,
|
|
757
|
+
isCard: true,
|
|
758
|
+
isComponent: false,
|
|
759
|
+
isField: false,
|
|
760
|
+
cardInfo: { theme: null }
|
|
761
|
+
});
|
|
762
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
763
|
+
entry = await indexer.cardDocument(new URL(`${testRealmURL}people-skill`));
|
|
764
|
+
if (entry?.type === "doc") {
|
|
765
|
+
assert.deepEqual(entry.doc.data, {
|
|
766
|
+
id: testRRI("people-skill"),
|
|
767
|
+
type: "card",
|
|
768
|
+
links: { self: "./people-skill" },
|
|
769
|
+
attributes: {
|
|
770
|
+
commands: [{
|
|
771
|
+
codeRef: {
|
|
772
|
+
module: "@cardstack/boxel-host/commands/switch-submode",
|
|
773
|
+
name: "default"
|
|
774
|
+
},
|
|
775
|
+
functionName: "switch-submode_dd88",
|
|
776
|
+
requiresApproval: false,
|
|
777
|
+
cardTitle: "Switch Submode"
|
|
778
|
+
}],
|
|
779
|
+
cardDescription: null,
|
|
780
|
+
instructions: "How to win friends and influence people",
|
|
781
|
+
cardThumbnailURL: null,
|
|
782
|
+
cardTitle: null,
|
|
783
|
+
cardInfo
|
|
784
|
+
},
|
|
785
|
+
relationships: { "cardInfo.theme": { links: { self: null } } },
|
|
786
|
+
meta: {
|
|
787
|
+
adoptsFrom: skillCardRef,
|
|
788
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}people-skill.json`),
|
|
789
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "people-skill.json"),
|
|
790
|
+
realmURL: testRealmURL,
|
|
791
|
+
realmInfo: {
|
|
792
|
+
backgroundURL: null,
|
|
793
|
+
iconURL: null,
|
|
794
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
795
|
+
lastPublishedAt: null,
|
|
796
|
+
name: "Unnamed Workspace",
|
|
797
|
+
publishable: null,
|
|
798
|
+
realmUserId: "@realm_server:localhost",
|
|
799
|
+
showAsCatalog: null,
|
|
800
|
+
visibility: "public"
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
});
|
|
804
|
+
let instance = await indexer.instance(new URL(`${testRealmURL}people-skill`));
|
|
805
|
+
assert.deepEqual(instance?.searchDoc, {
|
|
806
|
+
_cardType: "Skill",
|
|
807
|
+
id: `${testRealmURL}people-skill`,
|
|
808
|
+
instructions: "How to win friends and influence people",
|
|
809
|
+
commands: [{
|
|
810
|
+
codeRef: `@cardstack/boxel-host/commands/switch-submode/default`,
|
|
811
|
+
functionName: "switch-submode_dd88",
|
|
812
|
+
requiresApproval: false,
|
|
813
|
+
cardTitle: "Switch Submode"
|
|
814
|
+
}],
|
|
815
|
+
cardInfo: { theme: null }
|
|
816
|
+
});
|
|
817
|
+
} else assert.ok(false, `search entry was an error: ${entry?.error.errorDetail.message}`);
|
|
818
|
+
});
|
|
819
|
+
(0, import_qunit.test)("can recover from rendering a card that has a template error", async function(assert) {
|
|
820
|
+
{
|
|
821
|
+
class Person extends CardDef {
|
|
822
|
+
static {
|
|
823
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
824
|
+
return contains(StringField);
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
828
|
+
static isolated = class Isolated extends Component$1 {
|
|
829
|
+
static {
|
|
830
|
+
setComponentTemplate(templateFactory({
|
|
831
|
+
"id": "pbAMu5rb",
|
|
832
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
833
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
834
|
+
"isStrictMode": true
|
|
835
|
+
}), this);
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
static embedded = class Embedded extends Component$1 {
|
|
839
|
+
static {
|
|
840
|
+
setComponentTemplate(templateFactory({
|
|
841
|
+
"id": "455R5/G0",
|
|
842
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Embedded Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
843
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
844
|
+
"isStrictMode": true
|
|
845
|
+
}), this);
|
|
846
|
+
}
|
|
847
|
+
};
|
|
848
|
+
static fitted = class Fitted extends Component$1 {
|
|
849
|
+
static {
|
|
850
|
+
setComponentTemplate(templateFactory({
|
|
851
|
+
"id": "O3XcZBYx",
|
|
852
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Fitted Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
853
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
854
|
+
"isStrictMode": true
|
|
855
|
+
}), this);
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
class Boom extends CardDef {
|
|
860
|
+
static {
|
|
861
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
862
|
+
return contains(StringField);
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
866
|
+
static isolated = class Isolated extends Component$1 {
|
|
867
|
+
static {
|
|
868
|
+
setComponentTemplate(templateFactory({
|
|
869
|
+
"id": "KxUueTZn",
|
|
870
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[1,[30,0,[\"boom\"]]],[13]],[\"@fields\"],[]]",
|
|
871
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
872
|
+
"isStrictMode": true
|
|
873
|
+
}), this);
|
|
874
|
+
}
|
|
875
|
+
get boom() {
|
|
876
|
+
throw new Error("intentional error");
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
881
|
+
mockMatrixUtils,
|
|
882
|
+
contents: {
|
|
883
|
+
"person.gts": { Person },
|
|
884
|
+
"boom.gts": { Boom },
|
|
885
|
+
"vangogh.json": { data: {
|
|
886
|
+
attributes: { firstName: "Van Gogh" },
|
|
887
|
+
meta: { adoptsFrom: {
|
|
888
|
+
module: `${testRealmURL}person`,
|
|
889
|
+
name: "Person"
|
|
890
|
+
} }
|
|
891
|
+
} },
|
|
892
|
+
"boom.json": { data: {
|
|
893
|
+
attributes: { firstName: "Boom!" },
|
|
894
|
+
meta: { adoptsFrom: {
|
|
895
|
+
module: "./boom",
|
|
896
|
+
name: "Boom"
|
|
897
|
+
} }
|
|
898
|
+
} }
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
902
|
+
let realmIndexUpdater = realm.realmIndexUpdater;
|
|
903
|
+
{
|
|
904
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}boom`));
|
|
905
|
+
if (entry?.type === "error") {
|
|
906
|
+
assert.strictEqual(entry.error.errorDetail.message, "Encountered error rendering HTML for card: intentional error");
|
|
907
|
+
assert.deepEqual(entry.error.errorDetail.deps, [`${testRealmURL}boom`]);
|
|
908
|
+
} else assert.ok("false", "expected search entry to be an error document");
|
|
909
|
+
}
|
|
910
|
+
{
|
|
911
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}vangogh`));
|
|
912
|
+
if (entry?.type === "doc") {
|
|
913
|
+
assert.deepEqual(entry.doc.data.attributes?.firstName, "Van Gogh");
|
|
914
|
+
let { isolatedHtml, embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`http://test-realm/test/vangogh`)) ?? {};
|
|
915
|
+
assertInnerHtmlMatches(assert, isolatedHtml, `<h1> Van Gogh </h1>`);
|
|
916
|
+
assertInnerHtmlMatches(assert, embeddedHtml[`${testRealmURL}person/Person`], `<h1> Person Embedded Card: Van Gogh </h1>`);
|
|
917
|
+
assertInnerHtmlMatches(assert, fittedHtml[`${testRealmURL}person/Person`], `<h1> Person Fitted Card: Van Gogh </h1>`);
|
|
918
|
+
} else assert.ok(false, `expected search entry to be a document but was: ${entry?.error.errorDetail.message}`);
|
|
919
|
+
}
|
|
920
|
+
await realmIndexUpdater.fullIndex();
|
|
921
|
+
{
|
|
922
|
+
let entry = await queryEngine.cardDocument(new URL(`${testRealmURL}vangogh`));
|
|
923
|
+
if (entry?.type === "doc") {
|
|
924
|
+
assert.deepEqual(entry.doc.data.attributes?.firstName, "Van Gogh");
|
|
925
|
+
let { isolatedHtml, embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`http://test-realm/test/vangogh`)) ?? {};
|
|
926
|
+
assertInnerHtmlMatches(assert, isolatedHtml, `<h1> Van Gogh </h1>`);
|
|
927
|
+
assertInnerHtmlMatches(assert, embeddedHtml[`${testRealmURL}person/Person`], `<h1> Person Embedded Card: Van Gogh </h1>`);
|
|
928
|
+
assertInnerHtmlMatches(assert, fittedHtml[`${testRealmURL}person/Person`], `<h1> Person Fitted Card: Van Gogh </h1>`);
|
|
929
|
+
} else assert.ok(false, `expected search entry to be a document but was: ${entry?.error.errorDetail.message}`);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
(0, import_qunit.test)("can recover from rendering a card that has a nested card with a template error", async function(assert) {
|
|
934
|
+
class Boom extends FieldDef {
|
|
935
|
+
static {
|
|
936
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
937
|
+
return contains(StringField);
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
941
|
+
static embedded = class Embedded extends Component$1 {
|
|
942
|
+
static {
|
|
943
|
+
setComponentTemplate(templateFactory({
|
|
944
|
+
"id": "KxUueTZn",
|
|
945
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[1,[30,0,[\"boom\"]]],[13]],[\"@fields\"],[]]",
|
|
946
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
947
|
+
"isStrictMode": true
|
|
948
|
+
}), this);
|
|
949
|
+
}
|
|
950
|
+
get boom() {
|
|
951
|
+
throw new Error("intentional error");
|
|
952
|
+
}
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
class BoomPerson extends CardDef {
|
|
956
|
+
static {
|
|
957
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
958
|
+
return contains(StringField);
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
962
|
+
static {
|
|
963
|
+
decorateFieldV2(this.prototype, "boom", [field], function() {
|
|
964
|
+
return contains(Boom);
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
#boom = (initializeDeferredDecorator(this, "boom"), void 0);
|
|
968
|
+
static isolated = class Isolated extends Component$1 {
|
|
969
|
+
static {
|
|
970
|
+
setComponentTemplate(templateFactory({
|
|
971
|
+
"id": "boUjskQF",
|
|
972
|
+
"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\"],[]]",
|
|
973
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
974
|
+
"isStrictMode": true
|
|
975
|
+
}), this);
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
class Person extends CardDef {
|
|
980
|
+
static {
|
|
981
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
982
|
+
return contains(StringField);
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
986
|
+
static isolated = class Isolated extends Component$1 {
|
|
987
|
+
static {
|
|
988
|
+
setComponentTemplate(templateFactory({
|
|
989
|
+
"id": "pbAMu5rb",
|
|
990
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
991
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
992
|
+
"isStrictMode": true
|
|
993
|
+
}), this);
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
static embedded = class Embedded extends Component$1 {
|
|
997
|
+
static {
|
|
998
|
+
setComponentTemplate(templateFactory({
|
|
999
|
+
"id": "455R5/G0",
|
|
1000
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Embedded Card: \"],[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 fitted = class Fitted extends Component$1 {
|
|
1007
|
+
static {
|
|
1008
|
+
setComponentTemplate(templateFactory({
|
|
1009
|
+
"id": "O3XcZBYx",
|
|
1010
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Fitted 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
|
+
}
|
|
1017
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1018
|
+
mockMatrixUtils,
|
|
1019
|
+
contents: {
|
|
1020
|
+
"boom-person.gts": { BoomPerson },
|
|
1021
|
+
"boom.gts": { Boom },
|
|
1022
|
+
"person.gts": { Person },
|
|
1023
|
+
"vangogh.json": { data: {
|
|
1024
|
+
attributes: {
|
|
1025
|
+
firstName: "Van Gogh",
|
|
1026
|
+
boom: { firstName: "Mango" }
|
|
1027
|
+
},
|
|
1028
|
+
meta: { adoptsFrom: {
|
|
1029
|
+
module: "./boom-person",
|
|
1030
|
+
name: "BoomPerson"
|
|
1031
|
+
} }
|
|
1032
|
+
} },
|
|
1033
|
+
"working-van-gogh.json": { data: {
|
|
1034
|
+
attributes: { firstName: "Van Gogh" },
|
|
1035
|
+
meta: { adoptsFrom: {
|
|
1036
|
+
module: `${testRealmURL}person`,
|
|
1037
|
+
name: "Person"
|
|
1038
|
+
} }
|
|
1039
|
+
} }
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
1043
|
+
let entry = await indexer.cardDocument(new URL(`${testRealmURL}vangogh`));
|
|
1044
|
+
if (entry?.type === "error") assert.strictEqual(entry.error.errorDetail.message, "Encountered error rendering HTML for card: intentional error");
|
|
1045
|
+
else assert.ok("false", "expected search entry to be an error document");
|
|
1046
|
+
await realm.reindex();
|
|
1047
|
+
entry = await indexer.cardDocument(new URL(`${testRealmURL}working-van-gogh`));
|
|
1048
|
+
if (entry?.type === "doc") {
|
|
1049
|
+
assert.deepEqual(entry.doc.data.attributes?.firstName, "Van Gogh");
|
|
1050
|
+
let { isolatedHtml, embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`http://test-realm/test/working-van-gogh`)) ?? {};
|
|
1051
|
+
assertInnerHtmlMatches(assert, isolatedHtml, `<h1> Van Gogh </h1>`);
|
|
1052
|
+
assertInnerHtmlMatches(assert, embeddedHtml[`${testRealmURL}person/Person`], `<h1> Person Embedded Card: Van Gogh </h1>`);
|
|
1053
|
+
assertInnerHtmlMatches(assert, fittedHtml[`${testRealmURL}person/Person`], `<h1> Person Fitted Card: Van Gogh </h1>`);
|
|
1054
|
+
} else assert.ok(false, `expected search entry to be a document but was: ${entry?.error.errorDetail.message}`);
|
|
1055
|
+
});
|
|
1056
|
+
(0, import_qunit.test)("can recover from rendering a card that encounters a template error in its own custom component", async function(assert) {
|
|
1057
|
+
class Custom extends Component {
|
|
1058
|
+
static {
|
|
1059
|
+
setComponentTemplate(templateFactory({
|
|
1060
|
+
"id": "L1UHS+ps",
|
|
1061
|
+
"block": "[[[1,[30,0,[\"boom\"]]]],[],[]]",
|
|
1062
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1063
|
+
"isStrictMode": true
|
|
1064
|
+
}), this);
|
|
1065
|
+
}
|
|
1066
|
+
get boom() {
|
|
1067
|
+
throw new Error("intentional error");
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
class CustomBoom extends FieldDef {
|
|
1071
|
+
static {
|
|
1072
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1073
|
+
return contains(StringField);
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1077
|
+
static embedded = class Embedded extends Component$1 {
|
|
1078
|
+
static {
|
|
1079
|
+
setComponentTemplate(templateFactory({
|
|
1080
|
+
"id": "GCbWRRAT",
|
|
1081
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[8,[32,0],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1082
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1083
|
+
"scope": () => [Custom],
|
|
1084
|
+
"isStrictMode": true
|
|
1085
|
+
}), this);
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
class BoomPerson2 extends CardDef {
|
|
1090
|
+
static {
|
|
1091
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1092
|
+
return contains(StringField);
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1096
|
+
static {
|
|
1097
|
+
decorateFieldV2(this.prototype, "boom", [field], function() {
|
|
1098
|
+
return contains(CustomBoom);
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
#boom = (initializeDeferredDecorator(this, "boom"), void 0);
|
|
1102
|
+
static isolated = class Isolated extends Component$1 {
|
|
1103
|
+
static {
|
|
1104
|
+
setComponentTemplate(templateFactory({
|
|
1105
|
+
"id": "boUjskQF",
|
|
1106
|
+
"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\"],[]]",
|
|
1107
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1108
|
+
"isStrictMode": true
|
|
1109
|
+
}), this);
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
class Person extends CardDef {
|
|
1114
|
+
static {
|
|
1115
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1116
|
+
return contains(StringField);
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1120
|
+
static isolated = class Isolated extends Component$1 {
|
|
1121
|
+
static {
|
|
1122
|
+
setComponentTemplate(templateFactory({
|
|
1123
|
+
"id": "pbAMu5rb",
|
|
1124
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1125
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1126
|
+
"isStrictMode": true
|
|
1127
|
+
}), this);
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
static embedded = class Embedded extends Component$1 {
|
|
1131
|
+
static {
|
|
1132
|
+
setComponentTemplate(templateFactory({
|
|
1133
|
+
"id": "455R5/G0",
|
|
1134
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Embedded Card: \"],[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 fitted = class Fitted extends Component$1 {
|
|
1141
|
+
static {
|
|
1142
|
+
setComponentTemplate(templateFactory({
|
|
1143
|
+
"id": "O3XcZBYx",
|
|
1144
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Fitted 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
|
+
}
|
|
1151
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1152
|
+
mockMatrixUtils,
|
|
1153
|
+
contents: {
|
|
1154
|
+
"boom-person2.gts": { BoomPerson2 },
|
|
1155
|
+
"custom-boom.gts": { CustomBoom },
|
|
1156
|
+
"person.gts": { Person },
|
|
1157
|
+
"vangogh.json": { data: {
|
|
1158
|
+
attributes: {
|
|
1159
|
+
firstName: "Van Gogh",
|
|
1160
|
+
boom: { firstName: "Mango" }
|
|
1161
|
+
},
|
|
1162
|
+
meta: { adoptsFrom: {
|
|
1163
|
+
module: "./boom-person2",
|
|
1164
|
+
name: "BoomPerson2"
|
|
1165
|
+
} }
|
|
1166
|
+
} },
|
|
1167
|
+
"working-vangogh.json": { data: {
|
|
1168
|
+
attributes: { firstName: "Van Gogh" },
|
|
1169
|
+
meta: { adoptsFrom: {
|
|
1170
|
+
module: `${testRealmURL}person`,
|
|
1171
|
+
name: "Person"
|
|
1172
|
+
} }
|
|
1173
|
+
} }
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
1177
|
+
let entry = await indexer.cardDocument(new URL(`${testRealmURL}vangogh`));
|
|
1178
|
+
if (entry?.type === "error") assert.strictEqual(entry.error.errorDetail.message, "Encountered error rendering HTML for card: intentional error");
|
|
1179
|
+
else assert.ok("false", "expected search entry to be an error document");
|
|
1180
|
+
await realm.reindex();
|
|
1181
|
+
entry = await indexer.cardDocument(new URL(`${testRealmURL}working-vangogh`));
|
|
1182
|
+
if (entry?.type === "doc") {
|
|
1183
|
+
assert.deepEqual(entry.doc.data.attributes?.firstName, "Van Gogh");
|
|
1184
|
+
let { isolatedHtml, embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`http://test-realm/test/working-vangogh`)) ?? {};
|
|
1185
|
+
assertInnerHtmlMatches(assert, isolatedHtml, `<h1> Van Gogh </h1>`);
|
|
1186
|
+
assert.false(isolatedHtml.includes("id=\"ember"), `isolated HTML does not include ember ID's`);
|
|
1187
|
+
assertInnerHtmlMatches(assert, embeddedHtml[`${testRealmURL}person/Person`], `<h1> Person Embedded Card: Van Gogh </h1>`);
|
|
1188
|
+
assertInnerHtmlMatches(assert, fittedHtml[`${testRealmURL}person/Person`], `<h1> Person Fitted Card: Van Gogh </h1>`);
|
|
1189
|
+
assert.false(Object.values(embeddedHtml).join("").includes("id=\"ember"), `embeddedHtml HTML does not include ember ID's`);
|
|
1190
|
+
assert.false(Object.values(fittedHtml).join("").includes("id=\"ember"), `fittedHtml HTML does not include ember ID's`);
|
|
1191
|
+
} else assert.ok(false, `expected search entry to be a document but was: ${entry?.error.errorDetail.message}`);
|
|
1192
|
+
});
|
|
1193
|
+
(0, import_qunit.test)("can incrementally index a card", async function(assert) {
|
|
1194
|
+
class Person extends CardDef {
|
|
1195
|
+
static {
|
|
1196
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1197
|
+
return contains(StringField);
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1201
|
+
static isolated = class Isolated extends Component$1 {
|
|
1202
|
+
static {
|
|
1203
|
+
setComponentTemplate(templateFactory({
|
|
1204
|
+
"id": "pbAMu5rb",
|
|
1205
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1206
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1207
|
+
"isStrictMode": true
|
|
1208
|
+
}), this);
|
|
1209
|
+
}
|
|
1210
|
+
};
|
|
1211
|
+
static atom = class Atom extends Component$1 {
|
|
1212
|
+
static {
|
|
1213
|
+
setComponentTemplate(templateFactory({
|
|
1214
|
+
"id": "MvjivV0J",
|
|
1215
|
+
"block": "[[[10,0],[14,0,\"atom\"],[12],[1,[30,1,[\"firstName\"]]],[13]],[\"@model\"],[]]",
|
|
1216
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1217
|
+
"isStrictMode": true
|
|
1218
|
+
}), this);
|
|
1219
|
+
}
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
1223
|
+
mockMatrixUtils,
|
|
1224
|
+
contents: {
|
|
1225
|
+
"person.gts": { Person },
|
|
1226
|
+
"vangogh.json": { data: {
|
|
1227
|
+
attributes: { firstName: "Van Gogh" },
|
|
1228
|
+
meta: { adoptsFrom: {
|
|
1229
|
+
module: `./person`,
|
|
1230
|
+
name: "Person"
|
|
1231
|
+
} }
|
|
1232
|
+
} }
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
await realm.write("vangogh.json", JSON.stringify({ data: {
|
|
1236
|
+
id: testRRI("vangogh"),
|
|
1237
|
+
attributes: { firstName: "Van Van" },
|
|
1238
|
+
meta: { adoptsFrom: {
|
|
1239
|
+
module: testRRI("person"),
|
|
1240
|
+
name: "Person"
|
|
1241
|
+
} }
|
|
1242
|
+
} }));
|
|
1243
|
+
let { instance } = await getInstance(realm, new URL(`http://test-realm/test/vangogh`)) ?? {};
|
|
1244
|
+
assert.deepEqual(instance, {
|
|
1245
|
+
id: testRRI("vangogh"),
|
|
1246
|
+
type: "card",
|
|
1247
|
+
attributes: {
|
|
1248
|
+
cardInfo: {
|
|
1249
|
+
summary: null,
|
|
1250
|
+
notes: null,
|
|
1251
|
+
cardThumbnailURL: null,
|
|
1252
|
+
name: null
|
|
1253
|
+
},
|
|
1254
|
+
cardDescription: null,
|
|
1255
|
+
firstName: "Van Van",
|
|
1256
|
+
cardThumbnailURL: null,
|
|
1257
|
+
cardTitle: "Untitled Card"
|
|
1258
|
+
},
|
|
1259
|
+
relationships: { "cardInfo.theme": { links: { self: null } } },
|
|
1260
|
+
meta: {
|
|
1261
|
+
adoptsFrom: {
|
|
1262
|
+
module: rri(`./person`),
|
|
1263
|
+
name: "Person"
|
|
1264
|
+
},
|
|
1265
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}vangogh.json`),
|
|
1266
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "vangogh.json"),
|
|
1267
|
+
realmURL: testRealmURL
|
|
1268
|
+
}
|
|
1269
|
+
}, "serialized instance is correct");
|
|
1270
|
+
});
|
|
1271
|
+
(0, import_qunit.test)("can capture search doc when indexing a card", async function(assert) {
|
|
1272
|
+
class Person extends CardDef {
|
|
1273
|
+
static {
|
|
1274
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1275
|
+
return contains(StringField);
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1279
|
+
static isolated = class Isolated extends Component$1 {
|
|
1280
|
+
static {
|
|
1281
|
+
setComponentTemplate(templateFactory({
|
|
1282
|
+
"id": "pbAMu5rb",
|
|
1283
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1284
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1285
|
+
"isStrictMode": true
|
|
1286
|
+
}), this);
|
|
1287
|
+
}
|
|
1288
|
+
};
|
|
1289
|
+
static atom = class Atom extends Component$1 {
|
|
1290
|
+
static {
|
|
1291
|
+
setComponentTemplate(templateFactory({
|
|
1292
|
+
"id": "MvjivV0J",
|
|
1293
|
+
"block": "[[[10,0],[14,0,\"atom\"],[12],[1,[30,1,[\"firstName\"]]],[13]],[\"@model\"],[]]",
|
|
1294
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1295
|
+
"isStrictMode": true
|
|
1296
|
+
}), this);
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1301
|
+
mockMatrixUtils,
|
|
1302
|
+
contents: {
|
|
1303
|
+
"person.gts": { Person },
|
|
1304
|
+
"vangogh.json": { data: {
|
|
1305
|
+
attributes: { firstName: "Van Gogh" },
|
|
1306
|
+
meta: { adoptsFrom: {
|
|
1307
|
+
module: `${testRealmURL}person`,
|
|
1308
|
+
name: "Person"
|
|
1309
|
+
} }
|
|
1310
|
+
} }
|
|
1311
|
+
}
|
|
1312
|
+
});
|
|
1313
|
+
let { searchDoc } = await getInstance(realm, new URL(`http://test-realm/test/vangogh`)) ?? {};
|
|
1314
|
+
assert.deepEqual(searchDoc, {
|
|
1315
|
+
_cardType: "Person",
|
|
1316
|
+
cardInfo: { theme: null },
|
|
1317
|
+
firstName: "Van Gogh",
|
|
1318
|
+
id: `${testRealmURL}vangogh`,
|
|
1319
|
+
cardTitle: "Untitled Card"
|
|
1320
|
+
}, "search doc is correct");
|
|
1321
|
+
});
|
|
1322
|
+
(0, import_qunit.test)("can capture atom html when indexing a card", async function(assert) {
|
|
1323
|
+
class Person extends CardDef {
|
|
1324
|
+
static {
|
|
1325
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1326
|
+
return contains(StringField);
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1330
|
+
static isolated = class Isolated extends Component$1 {
|
|
1331
|
+
static {
|
|
1332
|
+
setComponentTemplate(templateFactory({
|
|
1333
|
+
"id": "pbAMu5rb",
|
|
1334
|
+
"block": "[[[10,\"h1\"],[12],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1335
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1336
|
+
"isStrictMode": true
|
|
1337
|
+
}), this);
|
|
1338
|
+
}
|
|
1339
|
+
};
|
|
1340
|
+
static atom = class Atom extends Component$1 {
|
|
1341
|
+
static {
|
|
1342
|
+
setComponentTemplate(templateFactory({
|
|
1343
|
+
"id": "MvjivV0J",
|
|
1344
|
+
"block": "[[[10,0],[14,0,\"atom\"],[12],[1,[30,1,[\"firstName\"]]],[13]],[\"@model\"],[]]",
|
|
1345
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1346
|
+
"isStrictMode": true
|
|
1347
|
+
}), this);
|
|
1348
|
+
}
|
|
1349
|
+
};
|
|
1350
|
+
}
|
|
1351
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1352
|
+
mockMatrixUtils,
|
|
1353
|
+
contents: {
|
|
1354
|
+
"person.gts": { Person },
|
|
1355
|
+
"vangogh.json": { data: {
|
|
1356
|
+
attributes: { firstName: "Van Gogh" },
|
|
1357
|
+
meta: { adoptsFrom: {
|
|
1358
|
+
module: `${testRealmURL}person`,
|
|
1359
|
+
name: "Person"
|
|
1360
|
+
} }
|
|
1361
|
+
} }
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
let { atomHtml } = await getInstance(realm, new URL(`http://test-realm/test/vangogh`)) ?? {};
|
|
1365
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(atomHtml)), cleanWhiteSpace(`<div class="atom">Van Gogh</div>`), "atom html is correct");
|
|
1366
|
+
assert.false(atomHtml.includes("id=\"ember"), `atom HTML does not include ember ID's`);
|
|
1367
|
+
});
|
|
1368
|
+
(0, import_qunit.test)("can capture head html when indexing a card", async function(assert) {
|
|
1369
|
+
class Person extends CardDef {
|
|
1370
|
+
static {
|
|
1371
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1372
|
+
return contains(StringField);
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1376
|
+
static head = class Head extends Component$1 {
|
|
1377
|
+
static {
|
|
1378
|
+
setComponentTemplate(templateFactory({
|
|
1379
|
+
"id": "JVgzQi6M",
|
|
1380
|
+
"block": "[[[10,\"title\"],[12],[1,[30,1,[\"firstName\"]]],[1,\"!\"],[13]],[\"@model\"],[]]",
|
|
1381
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1382
|
+
"isStrictMode": true
|
|
1383
|
+
}), this);
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1388
|
+
mockMatrixUtils,
|
|
1389
|
+
contents: {
|
|
1390
|
+
"person.gts": { Person },
|
|
1391
|
+
"vangogh.json": { data: {
|
|
1392
|
+
attributes: { firstName: "Van Gogh" },
|
|
1393
|
+
meta: { adoptsFrom: {
|
|
1394
|
+
module: `${testRealmURL}person`,
|
|
1395
|
+
name: "Person"
|
|
1396
|
+
} }
|
|
1397
|
+
} }
|
|
1398
|
+
}
|
|
1399
|
+
});
|
|
1400
|
+
let { headHtml } = await getInstance(realm, new URL(`http://test-realm/test/vangogh`)) ?? {};
|
|
1401
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(headHtml)), cleanWhiteSpace(`<title>Van Gogh!</title>`), "head html is correct");
|
|
1402
|
+
});
|
|
1403
|
+
(0, import_qunit.test)(`can generate embedded HTML for instance's card class hierarchy`, async function(assert) {
|
|
1404
|
+
class Person extends CardDef {
|
|
1405
|
+
static displayName = "Person";
|
|
1406
|
+
static {
|
|
1407
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
1408
|
+
return contains(StringField);
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
1412
|
+
static {
|
|
1413
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1414
|
+
return contains(StringField);
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1418
|
+
static embedded = class Embedded extends Component$1 {
|
|
1419
|
+
static {
|
|
1420
|
+
setComponentTemplate(templateFactory({
|
|
1421
|
+
"id": "455R5/G0",
|
|
1422
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Embedded Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1423
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1424
|
+
"isStrictMode": true
|
|
1425
|
+
}), this);
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
class FancyPerson extends Person {
|
|
1430
|
+
static displayName = "Fancy Person";
|
|
1431
|
+
static {
|
|
1432
|
+
decorateFieldV2(this.prototype, "favoriteColor", [field], function() {
|
|
1433
|
+
return contains(StringField);
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
#favoriteColor = (initializeDeferredDecorator(this, "favoriteColor"), void 0);
|
|
1437
|
+
static embedded = class Embedded extends Component$1 {
|
|
1438
|
+
static {
|
|
1439
|
+
setComponentTemplate(templateFactory({
|
|
1440
|
+
"id": "5nAE9D7f",
|
|
1441
|
+
"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\"],[]]",
|
|
1442
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1443
|
+
"isStrictMode": true
|
|
1444
|
+
}), this);
|
|
1445
|
+
}
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1449
|
+
mockMatrixUtils,
|
|
1450
|
+
contents: {
|
|
1451
|
+
"person.gts": { Person },
|
|
1452
|
+
"fancy-person.gts": { FancyPerson },
|
|
1453
|
+
"germaine.json": { data: {
|
|
1454
|
+
attributes: {
|
|
1455
|
+
firstName: "Germaine",
|
|
1456
|
+
favoriteColor: "hot pink",
|
|
1457
|
+
cardDescription: "Fancy Germaine"
|
|
1458
|
+
},
|
|
1459
|
+
meta: { adoptsFrom: {
|
|
1460
|
+
module: "./fancy-person",
|
|
1461
|
+
name: "FancyPerson"
|
|
1462
|
+
} }
|
|
1463
|
+
} }
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
let { embeddedHtml } = await getInstance(realm, new URL(`http://test-realm/test/germaine`)) ?? {};
|
|
1467
|
+
assert.false(Object.values(embeddedHtml).join("").includes("id=\"ember"), `Embedded HTML does not include ember ID's`);
|
|
1468
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(embeddedHtml[`${testRealmURL}fancy-person/FancyPerson`])), cleanWhiteSpace(`<div
|
|
1469
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card embedded-format display-container-true"
|
|
1470
|
+
data-boxel-card-container
|
|
1471
|
+
data-test-boxel-card-container
|
|
1472
|
+
style
|
|
1473
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1474
|
+
data-boxel-card-format="embedded"
|
|
1475
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1476
|
+
data-test-card-format="embedded"
|
|
1477
|
+
data-test-field-component-card> <h1> Fancy Person Embedded Card: Germaine - hot pink </h1> </div>`), "default embedded HTML is correct");
|
|
1478
|
+
let cardDefRefURL = internalKeyFor(baseCardRef, void 0, getService("network").virtualNetwork);
|
|
1479
|
+
assert.deepEqual(Object.keys(embeddedHtml), [
|
|
1480
|
+
`${testRealmURL}fancy-person/FancyPerson`,
|
|
1481
|
+
`${testRealmURL}person/Person`,
|
|
1482
|
+
cardDefRefURL
|
|
1483
|
+
], "embedded class hierarchy is correct");
|
|
1484
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(embeddedHtml[`${testRealmURL}person/Person`])), cleanWhiteSpace(`<div
|
|
1485
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card embedded-format display-container-true"
|
|
1486
|
+
data-boxel-card-container
|
|
1487
|
+
data-test-boxel-card-container
|
|
1488
|
+
style
|
|
1489
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1490
|
+
data-boxel-card-format="embedded"
|
|
1491
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1492
|
+
data-test-card-format="embedded"
|
|
1493
|
+
data-test-field-component-card> <h1> Person Embedded Card: Germaine </h1> </div>`), `${testRealmURL}person/Person embedded HTML is correct`);
|
|
1494
|
+
assert.false(embeddedHtml[`${testRealmURL}person/Person`].includes("id=\"ember"), `${testRealmURL}person/Person embedded HTML does not include ember ID's`);
|
|
1495
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(embeddedHtml[cardDefRefURL])), cleanWhiteSpace(`<div
|
|
1496
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card embedded-format display-container-true"
|
|
1497
|
+
data-boxel-card-container
|
|
1498
|
+
data-test-boxel-card-container
|
|
1499
|
+
style
|
|
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>
|
|
1505
|
+
<div class="embedded-template">
|
|
1506
|
+
<div class="thumbnail-section">
|
|
1507
|
+
<div class="card-thumbnail">
|
|
1508
|
+
<div class="card-thumbnail-placeholder" data-test-card-thumbnail-placeholder></div>
|
|
1509
|
+
</div>
|
|
1510
|
+
</div>
|
|
1511
|
+
<div class="info-section">
|
|
1512
|
+
<h3 class="card-title" data-test-card-title>Untitled Fancy Person</h3>
|
|
1513
|
+
<h4 class="card-display-name" data-test-card-display-name>
|
|
1514
|
+
Fancy Person
|
|
1515
|
+
</h4>
|
|
1516
|
+
</div>
|
|
1517
|
+
<div class="card-description" data-test-card-description>Fancy Germaine</div>
|
|
1518
|
+
</div>
|
|
1519
|
+
</div>
|
|
1520
|
+
`), `${cardDefRefURL} embedded HTML is correct`);
|
|
1521
|
+
assert.false(embeddedHtml[cardDefRefURL].includes("id=\"ember"), `${cardDefRefURL} fitted HTML does not include ember ID's`);
|
|
1522
|
+
});
|
|
1523
|
+
(0, import_qunit.test)(`can generate fitted HTML for instance's card class hierarchy`, async function(assert) {
|
|
1524
|
+
class Person extends CardDef {
|
|
1525
|
+
static displayName = "Person";
|
|
1526
|
+
static {
|
|
1527
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1528
|
+
return contains(StringField);
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1532
|
+
static {
|
|
1533
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
1534
|
+
return contains(StringField);
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
1538
|
+
static fitted = class Fitted extends Component$1 {
|
|
1539
|
+
static {
|
|
1540
|
+
setComponentTemplate(templateFactory({
|
|
1541
|
+
"id": "O3XcZBYx",
|
|
1542
|
+
"block": "[[[10,\"h1\"],[12],[1,\" Person Fitted Card: \"],[8,[30,1,[\"firstName\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
1543
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1544
|
+
"isStrictMode": true
|
|
1545
|
+
}), this);
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
class FancyPerson extends Person {
|
|
1550
|
+
static displayName = "Fancy Person";
|
|
1551
|
+
static {
|
|
1552
|
+
decorateFieldV2(this.prototype, "favoriteColor", [field], function() {
|
|
1553
|
+
return contains(StringField);
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
#favoriteColor = (initializeDeferredDecorator(this, "favoriteColor"), void 0);
|
|
1557
|
+
static fitted = class Fitted extends Component$1 {
|
|
1558
|
+
static {
|
|
1559
|
+
setComponentTemplate(templateFactory({
|
|
1560
|
+
"id": "Ea3TSKvz",
|
|
1561
|
+
"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\"],[]]",
|
|
1562
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
1563
|
+
"isStrictMode": true
|
|
1564
|
+
}), this);
|
|
1565
|
+
}
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1568
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1569
|
+
mockMatrixUtils,
|
|
1570
|
+
contents: {
|
|
1571
|
+
"person.gts": { Person },
|
|
1572
|
+
"fancy-person.gts": { FancyPerson },
|
|
1573
|
+
"germaine.json": { data: {
|
|
1574
|
+
attributes: {
|
|
1575
|
+
firstName: "Germaine",
|
|
1576
|
+
favoriteColor: "hot pink",
|
|
1577
|
+
cardDescription: "Fancy Germaine"
|
|
1578
|
+
},
|
|
1579
|
+
meta: { adoptsFrom: {
|
|
1580
|
+
module: "./fancy-person",
|
|
1581
|
+
name: "FancyPerson"
|
|
1582
|
+
} }
|
|
1583
|
+
} }
|
|
1584
|
+
}
|
|
1585
|
+
});
|
|
1586
|
+
let { embeddedHtml, fittedHtml } = await getInstance(realm, new URL(`http://test-realm/test/germaine`)) ?? {};
|
|
1587
|
+
assert.false(Object.values(fittedHtml).join("").includes("id=\"ember"), `Fitted HTML does not include ember ID's`);
|
|
1588
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(fittedHtml[`${testRealmURL}fancy-person/FancyPerson`])), cleanWhiteSpace(`<div
|
|
1589
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card fitted-format display-container-true"
|
|
1590
|
+
data-boxel-card-container
|
|
1591
|
+
data-test-boxel-card-container
|
|
1592
|
+
style
|
|
1593
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1594
|
+
data-boxel-card-format="fitted"
|
|
1595
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1596
|
+
data-test-card-format="fitted"
|
|
1597
|
+
data-test-field-component-card> <h1> Fancy Person Fitted Card: Germaine - hot pink </h1> </div>`), "default fitted HTML is correct");
|
|
1598
|
+
let cardDefRefURL = internalKeyFor(baseCardRef, void 0, getService("network").virtualNetwork);
|
|
1599
|
+
assert.deepEqual(Object.keys(fittedHtml), [
|
|
1600
|
+
`${testRealmURL}fancy-person/FancyPerson`,
|
|
1601
|
+
`${testRealmURL}person/Person`,
|
|
1602
|
+
cardDefRefURL
|
|
1603
|
+
], "fitted class hierarchy is correct");
|
|
1604
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(fittedHtml[`${testRealmURL}person/Person`])), cleanWhiteSpace(`<div
|
|
1605
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card fitted-format display-container-true"
|
|
1606
|
+
data-boxel-card-container
|
|
1607
|
+
data-test-boxel-card-container
|
|
1608
|
+
style
|
|
1609
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1610
|
+
data-boxel-card-format="fitted"
|
|
1611
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1612
|
+
data-test-card-format="fitted"
|
|
1613
|
+
data-test-field-component-card> <h1> Person Fitted Card: Germaine </h1> </div>`), `${testRealmURL}person/Person fitted HTML is correct`);
|
|
1614
|
+
assert.false(fittedHtml[`${testRealmURL}person/Person`].includes("id=\"ember"), `${testRealmURL}person/Person fitted HTML does not include ember ID's`);
|
|
1615
|
+
assert.strictEqual(cleanWhiteSpace(stripScopedCSSAttributes(embeddedHtml[cardDefRefURL])), cleanWhiteSpace(`<div
|
|
1616
|
+
class="ember-view boxel-card-container boxel-card-container--boundaries field-component-card embedded-format display-container-true"
|
|
1617
|
+
data-boxel-card-container
|
|
1618
|
+
data-test-boxel-card-container
|
|
1619
|
+
style
|
|
1620
|
+
data-boxel-card-id="http://test-realm/test/germaine"
|
|
1621
|
+
data-boxel-card-format="embedded"
|
|
1622
|
+
data-test-card="http://test-realm/test/germaine"
|
|
1623
|
+
data-test-card-format="embedded"
|
|
1624
|
+
data-test-field-component-card>
|
|
1625
|
+
<div class="embedded-template">
|
|
1626
|
+
<div class="thumbnail-section">
|
|
1627
|
+
<div class="card-thumbnail">
|
|
1628
|
+
<div class="card-thumbnail-placeholder" data-test-card-thumbnail-placeholder></div>
|
|
1629
|
+
</div>
|
|
1630
|
+
</div>
|
|
1631
|
+
<div class="info-section">
|
|
1632
|
+
<h3 class="card-title" data-test-card-title>Untitled Fancy Person</h3>
|
|
1633
|
+
<h4 class="card-display-name" data-test-card-display-name> Fancy Person </h4>
|
|
1634
|
+
</div>
|
|
1635
|
+
<div class="card-description" data-test-card-description>Fancy Germaine</div>
|
|
1636
|
+
</div>
|
|
1637
|
+
</div>`), `${cardDefRefURL} embedded HTML is correct`);
|
|
1638
|
+
assert.false(embeddedHtml[cardDefRefURL].includes("id=\"ember"), `${cardDefRefURL} embedded HTML does not include ember ID's`);
|
|
1639
|
+
});
|
|
1640
|
+
(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) {
|
|
1641
|
+
class Person extends FieldDef {
|
|
1642
|
+
static {
|
|
1643
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1644
|
+
return contains(StringField);
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1648
|
+
static {
|
|
1649
|
+
decorateFieldV2(this.prototype, "pet", [field], function() {
|
|
1650
|
+
return linksTo(() => PetCard);
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1653
|
+
#pet = (initializeDeferredDecorator(this, "pet"), void 0);
|
|
1654
|
+
static {
|
|
1655
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
1656
|
+
return contains(StringField, { computeVia: function() {
|
|
1657
|
+
return this.firstName;
|
|
1658
|
+
} });
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
1662
|
+
}
|
|
1663
|
+
class Appointment extends FieldDef {
|
|
1664
|
+
static {
|
|
1665
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
1666
|
+
return contains(StringField);
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
1670
|
+
static {
|
|
1671
|
+
decorateFieldV2(this.prototype, "contact", [field], function() {
|
|
1672
|
+
return contains(Person);
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
#contact = (initializeDeferredDecorator(this, "contact"), void 0);
|
|
1676
|
+
}
|
|
1677
|
+
class PetCard extends CardDef {
|
|
1678
|
+
static {
|
|
1679
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
1680
|
+
return contains(StringField);
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1683
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
1684
|
+
static {
|
|
1685
|
+
decorateFieldV2(this.prototype, "appointment", [field], function() {
|
|
1686
|
+
return contains(Appointment);
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
#appointment = (initializeDeferredDecorator(this, "appointment"), void 0);
|
|
1690
|
+
static {
|
|
1691
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
1692
|
+
return contains(StringField, { computeVia: function() {
|
|
1693
|
+
return this.firstName;
|
|
1694
|
+
} });
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
1698
|
+
static {
|
|
1699
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
1700
|
+
return contains(StringField);
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
1704
|
+
static {
|
|
1705
|
+
decorateFieldV2(this.prototype, "cardThumbnailURL", [field], function() {
|
|
1706
|
+
return contains(StringField);
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
#cardThumbnailURL = (initializeDeferredDecorator(this, "cardThumbnailURL"), void 0);
|
|
1710
|
+
}
|
|
1711
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1712
|
+
mockMatrixUtils,
|
|
1713
|
+
contents: {
|
|
1714
|
+
"person-card.gts": { Person },
|
|
1715
|
+
"appointment.gts": { Appointment },
|
|
1716
|
+
"pet-card.gts": { PetCard },
|
|
1717
|
+
"jackie.json": { data: {
|
|
1718
|
+
attributes: {
|
|
1719
|
+
firstName: "Jackie",
|
|
1720
|
+
appointment: {
|
|
1721
|
+
cardTitle: "Vet visit",
|
|
1722
|
+
contact: { firstName: "Burcu" }
|
|
1723
|
+
},
|
|
1724
|
+
cardDescription: "Dog",
|
|
1725
|
+
cardThumbnailURL: "./jackie.jpg"
|
|
1726
|
+
},
|
|
1727
|
+
meta: { adoptsFrom: {
|
|
1728
|
+
module: `./pet-card`,
|
|
1729
|
+
name: "PetCard"
|
|
1730
|
+
} },
|
|
1731
|
+
relationships: { "appointment.contact.pet": { links: { self: `./mango` } } }
|
|
1732
|
+
} },
|
|
1733
|
+
"mango.json": { data: {
|
|
1734
|
+
attributes: { firstName: "Mango" },
|
|
1735
|
+
meta: { adoptsFrom: {
|
|
1736
|
+
module: `./pet-card`,
|
|
1737
|
+
name: "PetCard"
|
|
1738
|
+
} }
|
|
1739
|
+
} }
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
let card = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}jackie`));
|
|
1743
|
+
if (card?.type === "doc") {
|
|
1744
|
+
assert.deepEqual(card.doc.data.attributes, {
|
|
1745
|
+
firstName: "Jackie",
|
|
1746
|
+
cardTitle: "Jackie",
|
|
1747
|
+
appointment: {
|
|
1748
|
+
cardTitle: "Vet visit",
|
|
1749
|
+
contact: { firstName: "Burcu" }
|
|
1750
|
+
},
|
|
1751
|
+
cardDescription: "Dog",
|
|
1752
|
+
cardThumbnailURL: `./jackie.jpg`,
|
|
1753
|
+
cardInfo
|
|
1754
|
+
});
|
|
1755
|
+
assert.deepEqual(card.doc.data.relationships, {
|
|
1756
|
+
"appointment.contact.pet": { links: { self: `./mango` } },
|
|
1757
|
+
"cardInfo.theme": { links: { self: null } }
|
|
1758
|
+
});
|
|
1759
|
+
} else assert.ok(false, `search entry was an error: ${card?.error.errorDetail.message}`);
|
|
1760
|
+
});
|
|
1761
|
+
(0, import_qunit.test)("can index a card with a containsMany composite containing a linkTo field", async function(assert) {
|
|
1762
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
1763
|
+
mockMatrixUtils,
|
|
1764
|
+
contents: {
|
|
1765
|
+
"Vendor/vendor1.json": { data: {
|
|
1766
|
+
id: `${testRealmURL}Vendor/vendor1`,
|
|
1767
|
+
attributes: {
|
|
1768
|
+
name: "Acme Industries",
|
|
1769
|
+
paymentMethods: [{
|
|
1770
|
+
type: "crypto",
|
|
1771
|
+
payment: { address: "0x1111" }
|
|
1772
|
+
}, {
|
|
1773
|
+
type: "crypto",
|
|
1774
|
+
payment: { address: "0x2222" }
|
|
1775
|
+
}]
|
|
1776
|
+
},
|
|
1777
|
+
relationships: {
|
|
1778
|
+
"paymentMethods.0.payment.chain": { links: { self: `../Chain/1` } },
|
|
1779
|
+
"paymentMethods.1.payment.chain": { links: { self: `../Chain/2` } }
|
|
1780
|
+
},
|
|
1781
|
+
meta: { adoptsFrom: {
|
|
1782
|
+
module: `https://localhost:4202/test/vendor`,
|
|
1783
|
+
name: "Vendor"
|
|
1784
|
+
} }
|
|
1785
|
+
} },
|
|
1786
|
+
"Chain/1.json": { data: {
|
|
1787
|
+
id: `${testRealmURL}Chain/1`,
|
|
1788
|
+
attributes: { name: "Ethereum Mainnet" },
|
|
1789
|
+
meta: { adoptsFrom: {
|
|
1790
|
+
module: `https://localhost:4202/test/chain`,
|
|
1791
|
+
name: "Chain"
|
|
1792
|
+
} }
|
|
1793
|
+
} },
|
|
1794
|
+
"Chain/2.json": { data: {
|
|
1795
|
+
id: `${testRealmURL}Chain/2`,
|
|
1796
|
+
attributes: { name: "Polygon" },
|
|
1797
|
+
meta: { adoptsFrom: {
|
|
1798
|
+
module: `https://localhost:4202/test/chain`,
|
|
1799
|
+
name: "Chain"
|
|
1800
|
+
} }
|
|
1801
|
+
} }
|
|
1802
|
+
}
|
|
1803
|
+
});
|
|
1804
|
+
let vendor = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Vendor/vendor1`), { loadLinks: true });
|
|
1805
|
+
if (vendor?.type === "doc") assert.deepEqual(vendor.doc, {
|
|
1806
|
+
data: {
|
|
1807
|
+
id: testRRI("Vendor/vendor1"),
|
|
1808
|
+
type: "card",
|
|
1809
|
+
links: { self: "./vendor1" },
|
|
1810
|
+
attributes: {
|
|
1811
|
+
name: "Acme Industries",
|
|
1812
|
+
cardTitle: "Acme Industries",
|
|
1813
|
+
cardDescription: "Vendor",
|
|
1814
|
+
cardThumbnailURL: null,
|
|
1815
|
+
paymentMethods: [{
|
|
1816
|
+
type: "crypto",
|
|
1817
|
+
payment: { address: "0x1111" }
|
|
1818
|
+
}, {
|
|
1819
|
+
type: "crypto",
|
|
1820
|
+
payment: { address: "0x2222" }
|
|
1821
|
+
}],
|
|
1822
|
+
cardInfo
|
|
1823
|
+
},
|
|
1824
|
+
relationships: {
|
|
1825
|
+
"paymentMethods.0.payment.chain": {
|
|
1826
|
+
data: {
|
|
1827
|
+
id: `${testRealmURL}Chain/1`,
|
|
1828
|
+
type: "card"
|
|
1829
|
+
},
|
|
1830
|
+
links: { self: `../Chain/1` }
|
|
1831
|
+
},
|
|
1832
|
+
"paymentMethods.1.payment.chain": {
|
|
1833
|
+
data: {
|
|
1834
|
+
id: `${testRealmURL}Chain/2`,
|
|
1835
|
+
type: "card"
|
|
1836
|
+
},
|
|
1837
|
+
links: { self: `../Chain/2` }
|
|
1838
|
+
},
|
|
1839
|
+
"cardInfo.theme": { links: { self: null } }
|
|
1840
|
+
},
|
|
1841
|
+
meta: {
|
|
1842
|
+
adoptsFrom: {
|
|
1843
|
+
module: rri(`https://localhost:4202/test/vendor`),
|
|
1844
|
+
name: "Vendor"
|
|
1845
|
+
},
|
|
1846
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Vendor/vendor1.json`),
|
|
1847
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Vendor/vendor1.json"),
|
|
1848
|
+
realmURL: ri("http://test-realm/test/"),
|
|
1849
|
+
realmInfo: {
|
|
1850
|
+
backgroundURL: null,
|
|
1851
|
+
iconURL: null,
|
|
1852
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
1853
|
+
lastPublishedAt: null,
|
|
1854
|
+
name: "Unnamed Workspace",
|
|
1855
|
+
publishable: null,
|
|
1856
|
+
realmUserId: "@realm_server:localhost",
|
|
1857
|
+
showAsCatalog: null,
|
|
1858
|
+
visibility: "public"
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1862
|
+
included: [{
|
|
1863
|
+
id: testRRI("Chain/1"),
|
|
1864
|
+
type: "card",
|
|
1865
|
+
links: { self: `../Chain/1` },
|
|
1866
|
+
attributes: {
|
|
1867
|
+
name: "Ethereum Mainnet",
|
|
1868
|
+
cardTitle: "Ethereum Mainnet",
|
|
1869
|
+
chainId: 1,
|
|
1870
|
+
cardDescription: `Chain 1`,
|
|
1871
|
+
cardThumbnailURL: `Ethereum Mainnet-icon.png`,
|
|
1872
|
+
cardInfo
|
|
1873
|
+
},
|
|
1874
|
+
relationships: { "cardInfo.theme": { links: { self: null } } },
|
|
1875
|
+
meta: {
|
|
1876
|
+
adoptsFrom: {
|
|
1877
|
+
module: rri(`https://localhost:4202/test/chain`),
|
|
1878
|
+
name: "Chain"
|
|
1879
|
+
},
|
|
1880
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Chain/1.json`),
|
|
1881
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Chain/1.json"),
|
|
1882
|
+
realmURL: ri("http://test-realm/test/"),
|
|
1883
|
+
realmInfo: {
|
|
1884
|
+
backgroundURL: null,
|
|
1885
|
+
iconURL: null,
|
|
1886
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
1887
|
+
lastPublishedAt: null,
|
|
1888
|
+
name: "Unnamed Workspace",
|
|
1889
|
+
publishable: null,
|
|
1890
|
+
realmUserId: "@realm_server:localhost",
|
|
1891
|
+
showAsCatalog: null,
|
|
1892
|
+
visibility: "public"
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
}, {
|
|
1896
|
+
id: testRRI("Chain/2"),
|
|
1897
|
+
type: "card",
|
|
1898
|
+
links: { self: `../Chain/2` },
|
|
1899
|
+
attributes: {
|
|
1900
|
+
name: "Polygon",
|
|
1901
|
+
cardTitle: "Polygon",
|
|
1902
|
+
chainId: 137,
|
|
1903
|
+
cardDescription: `Chain 137`,
|
|
1904
|
+
cardThumbnailURL: `Polygon-icon.png`,
|
|
1905
|
+
cardInfo
|
|
1906
|
+
},
|
|
1907
|
+
relationships: { "cardInfo.theme": { links: { self: null } } },
|
|
1908
|
+
meta: {
|
|
1909
|
+
adoptsFrom: {
|
|
1910
|
+
module: rri(`https://localhost:4202/test/chain`),
|
|
1911
|
+
name: "Chain"
|
|
1912
|
+
},
|
|
1913
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Chain/2.json`),
|
|
1914
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Chain/2.json"),
|
|
1915
|
+
realmURL: ri("http://test-realm/test/"),
|
|
1916
|
+
realmInfo: {
|
|
1917
|
+
backgroundURL: null,
|
|
1918
|
+
iconURL: null,
|
|
1919
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
1920
|
+
lastPublishedAt: null,
|
|
1921
|
+
name: "Unnamed Workspace",
|
|
1922
|
+
publishable: null,
|
|
1923
|
+
realmUserId: "@realm_server:localhost",
|
|
1924
|
+
showAsCatalog: null,
|
|
1925
|
+
visibility: "public"
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
}]
|
|
1929
|
+
});
|
|
1930
|
+
else assert.ok(false, `search entry was an error: ${vendor?.error.errorDetail.message}`);
|
|
1931
|
+
});
|
|
1932
|
+
(0, import_qunit.test)("can tolerate a card whose computed throws an exception", async function(assert) {
|
|
1933
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1934
|
+
mockMatrixUtils,
|
|
1935
|
+
contents: {
|
|
1936
|
+
"Boom/boom.json": { data: {
|
|
1937
|
+
id: `${testRealmURL}Boom/boom`,
|
|
1938
|
+
meta: { adoptsFrom: {
|
|
1939
|
+
module: "https://localhost:4202/test/card-with-error",
|
|
1940
|
+
name: "Boom"
|
|
1941
|
+
} }
|
|
1942
|
+
} },
|
|
1943
|
+
"Person/owner.json": { data: {
|
|
1944
|
+
id: `${testRealmURL}Person/owner`,
|
|
1945
|
+
attributes: { firstName: "Hassan" },
|
|
1946
|
+
meta: { adoptsFrom: {
|
|
1947
|
+
module: "https://localhost:4202/test/person",
|
|
1948
|
+
name: "Person"
|
|
1949
|
+
} }
|
|
1950
|
+
} }
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1953
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
1954
|
+
{
|
|
1955
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}Boom/boom`));
|
|
1956
|
+
if (card?.type === "error") assert.ok(card.error.errorDetail.message.includes("intentional error thrown"), "error doc includes raised error message");
|
|
1957
|
+
else assert.ok(false, `expected search entry to be an error doc`);
|
|
1958
|
+
}
|
|
1959
|
+
{
|
|
1960
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}Person/owner`));
|
|
1961
|
+
if (card?.type === "doc") assert.strictEqual(card.doc.data.attributes?.firstName, "Hassan");
|
|
1962
|
+
else assert.ok(false, `search entry was an error: ${card?.error.errorDetail.message}`);
|
|
1963
|
+
}
|
|
1964
|
+
});
|
|
1965
|
+
(0, import_qunit.test)(`search doc includes 'contains' and used 'linksTo' fields, including contained computed fields`, async function(assert) {
|
|
1966
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
1967
|
+
mockMatrixUtils,
|
|
1968
|
+
contents: {
|
|
1969
|
+
"Pet/mango.json": { data: {
|
|
1970
|
+
attributes: { firstName: "Mango" },
|
|
1971
|
+
relationships: { owner: { links: { self: `../Person/hassan` } } },
|
|
1972
|
+
meta: { adoptsFrom: {
|
|
1973
|
+
module: `${testModuleRealm}pet`,
|
|
1974
|
+
name: "Pet"
|
|
1975
|
+
} }
|
|
1976
|
+
} },
|
|
1977
|
+
"Person/hassan.json": { data: {
|
|
1978
|
+
id: `${testRealmURL}Person/hassan`,
|
|
1979
|
+
attributes: {
|
|
1980
|
+
firstName: "Hassan",
|
|
1981
|
+
lastName: "Abdel-Rahman",
|
|
1982
|
+
email: "hassan@cardstack.com",
|
|
1983
|
+
posts: 100
|
|
1984
|
+
},
|
|
1985
|
+
meta: { adoptsFrom: {
|
|
1986
|
+
module: "https://localhost:4202/test/person",
|
|
1987
|
+
name: "Person"
|
|
1988
|
+
} }
|
|
1989
|
+
} }
|
|
1990
|
+
}
|
|
1991
|
+
});
|
|
1992
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}Person/hassan`));
|
|
1993
|
+
assert.deepEqual(entry?.searchDoc, {
|
|
1994
|
+
id: `${testRealmURL}Person/hassan`,
|
|
1995
|
+
firstName: "Hassan",
|
|
1996
|
+
lastName: "Abdel-Rahman",
|
|
1997
|
+
email: "hassan@cardstack.com",
|
|
1998
|
+
posts: 100,
|
|
1999
|
+
cardTitle: "Hassan Abdel-Rahman",
|
|
2000
|
+
cardDescription: "Person",
|
|
2001
|
+
fullName: "Hassan Abdel-Rahman",
|
|
2002
|
+
_cardType: "Person",
|
|
2003
|
+
cardInfo: { theme: null }
|
|
2004
|
+
}, `search doc includes fullName field`);
|
|
2005
|
+
});
|
|
2006
|
+
(0, import_qunit.test)(`search doc includes unused 'linksTo' field if isUsed option is set to true`, async function(assert) {
|
|
2007
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
2008
|
+
mockMatrixUtils,
|
|
2009
|
+
contents: {
|
|
2010
|
+
"Publication/pacific.json": { data: {
|
|
2011
|
+
id: `${testRealmURL}Publication/pacific`,
|
|
2012
|
+
attributes: { cardTitle: "Pacific Weekly" },
|
|
2013
|
+
relationships: {
|
|
2014
|
+
"featuredPosts.0": { links: { self: `../Post/1` } },
|
|
2015
|
+
"featuredPosts.1": { links: { self: `../Post/2` } }
|
|
2016
|
+
},
|
|
2017
|
+
meta: { adoptsFrom: {
|
|
2018
|
+
module: `${testModuleRealm}publication`,
|
|
2019
|
+
name: "Publication"
|
|
2020
|
+
} }
|
|
2021
|
+
} },
|
|
2022
|
+
"Post/1.json": { data: {
|
|
2023
|
+
id: `${testRealmURL}Post/1`,
|
|
2024
|
+
attributes: {
|
|
2025
|
+
cardTitle: "50 Ways to Leave Your Laptop",
|
|
2026
|
+
views: 5
|
|
2027
|
+
},
|
|
2028
|
+
relationships: { publication: { links: { self: `../Publication/pacific` } } },
|
|
2029
|
+
meta: { adoptsFrom: {
|
|
2030
|
+
module: "https://localhost:4202/test/post",
|
|
2031
|
+
name: "Post"
|
|
2032
|
+
} }
|
|
2033
|
+
} },
|
|
2034
|
+
"Post/2.json": { data: {
|
|
2035
|
+
id: `${testRealmURL}Post/2`,
|
|
2036
|
+
attributes: {
|
|
2037
|
+
cardTitle: "49 Shades of Mauve",
|
|
2038
|
+
views: 24
|
|
2039
|
+
},
|
|
2040
|
+
relationships: { publication: { links: { self: `../Publication/pacific` } } },
|
|
2041
|
+
meta: { adoptsFrom: {
|
|
2042
|
+
module: "https://localhost:4202/test/post",
|
|
2043
|
+
name: "Post"
|
|
2044
|
+
} }
|
|
2045
|
+
} }
|
|
2046
|
+
}
|
|
2047
|
+
});
|
|
2048
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}Post/1`));
|
|
2049
|
+
assert.deepEqual(entry?.searchDoc, {
|
|
2050
|
+
_cardType: "Post",
|
|
2051
|
+
author: {
|
|
2052
|
+
cardDescription: "Person",
|
|
2053
|
+
fullName: " ",
|
|
2054
|
+
cardTitle: " "
|
|
2055
|
+
},
|
|
2056
|
+
id: `${testRealmURL}Post/1`,
|
|
2057
|
+
cardTitle: "50 Ways to Leave Your Laptop",
|
|
2058
|
+
publication: { id: `${testRealmURL}Publication/pacific` },
|
|
2059
|
+
views: 5,
|
|
2060
|
+
cardInfo: { theme: null }
|
|
2061
|
+
}, `post 1 search doc includes publication relationship`);
|
|
2062
|
+
let entry2 = await getInstance(realm, new URL(`${testRealmURL}Publication/pacific`));
|
|
2063
|
+
assert.deepEqual(entry2?.searchDoc, {
|
|
2064
|
+
_cardType: "Publication",
|
|
2065
|
+
id: `${testRealmURL}Publication/pacific`,
|
|
2066
|
+
cardTitle: "Pacific Weekly",
|
|
2067
|
+
featuredPosts: [{
|
|
2068
|
+
author: {
|
|
2069
|
+
cardDescription: "Person",
|
|
2070
|
+
fullName: " ",
|
|
2071
|
+
cardTitle: " "
|
|
2072
|
+
},
|
|
2073
|
+
cardInfo: {
|
|
2074
|
+
cardThumbnail: null,
|
|
2075
|
+
theme: null
|
|
2076
|
+
},
|
|
2077
|
+
id: `${testRealmURL}Post/1`,
|
|
2078
|
+
publication: { id: `${testRealmURL}Publication/pacific` },
|
|
2079
|
+
cardTitle: "50 Ways to Leave Your Laptop",
|
|
2080
|
+
views: 5
|
|
2081
|
+
}, {
|
|
2082
|
+
author: {
|
|
2083
|
+
cardDescription: "Person",
|
|
2084
|
+
fullName: " ",
|
|
2085
|
+
cardTitle: " "
|
|
2086
|
+
},
|
|
2087
|
+
cardInfo: {
|
|
2088
|
+
cardThumbnail: null,
|
|
2089
|
+
theme: null
|
|
2090
|
+
},
|
|
2091
|
+
id: `${testRealmURL}Post/2`,
|
|
2092
|
+
publication: { id: `${testRealmURL}Publication/pacific` },
|
|
2093
|
+
cardTitle: "49 Shades of Mauve",
|
|
2094
|
+
views: 24
|
|
2095
|
+
}],
|
|
2096
|
+
cardInfo: { theme: null }
|
|
2097
|
+
}, `publication search doc includes featuredPosts relationship via isUsed=true`);
|
|
2098
|
+
});
|
|
2099
|
+
(0, import_qunit.test)("search doc normalizes containsMany composite fields", async function(assert) {
|
|
2100
|
+
class Person extends FieldDef {
|
|
2101
|
+
static {
|
|
2102
|
+
decorateFieldV2(this.prototype, "firstName", [field], function() {
|
|
2103
|
+
return contains(StringField);
|
|
2104
|
+
});
|
|
2105
|
+
}
|
|
2106
|
+
#firstName = (initializeDeferredDecorator(this, "firstName"), void 0);
|
|
2107
|
+
static {
|
|
2108
|
+
decorateFieldV2(this.prototype, "lastName", [field], function() {
|
|
2109
|
+
return contains(StringField);
|
|
2110
|
+
});
|
|
2111
|
+
}
|
|
2112
|
+
#lastName = (initializeDeferredDecorator(this, "lastName"), void 0);
|
|
2113
|
+
static {
|
|
2114
|
+
decorateFieldV2(this.prototype, "email", [field], function() {
|
|
2115
|
+
return contains(StringField);
|
|
2116
|
+
});
|
|
2117
|
+
}
|
|
2118
|
+
#email = (initializeDeferredDecorator(this, "email"), void 0);
|
|
2119
|
+
static {
|
|
2120
|
+
decorateFieldV2(this.prototype, "posts", [field], function() {
|
|
2121
|
+
return contains(NumberField);
|
|
2122
|
+
});
|
|
2123
|
+
}
|
|
2124
|
+
#posts = (initializeDeferredDecorator(this, "posts"), void 0);
|
|
2125
|
+
static {
|
|
2126
|
+
decorateFieldV2(this.prototype, "fullName", [field], function() {
|
|
2127
|
+
return contains(StringField, { computeVia: function() {
|
|
2128
|
+
return `${this.firstName ?? ""} ${this.lastName ?? ""}`;
|
|
2129
|
+
} });
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
#fullName = (initializeDeferredDecorator(this, "fullName"), void 0);
|
|
2133
|
+
static {
|
|
2134
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
2135
|
+
return contains(StringField, { computeVia: function() {
|
|
2136
|
+
return `${this.firstName ?? ""} ${this.lastName ?? ""}`;
|
|
2137
|
+
} });
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
2141
|
+
static {
|
|
2142
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
2143
|
+
return contains(StringField, { computeVia: () => "Person" });
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
2147
|
+
}
|
|
2148
|
+
class Post extends FieldDef {
|
|
2149
|
+
static {
|
|
2150
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
2151
|
+
return contains(StringField);
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
2155
|
+
static {
|
|
2156
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
2157
|
+
return contains(StringField);
|
|
2158
|
+
});
|
|
2159
|
+
}
|
|
2160
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
2161
|
+
static {
|
|
2162
|
+
decorateFieldV2(this.prototype, "author", [field], function() {
|
|
2163
|
+
return contains(Person);
|
|
2164
|
+
});
|
|
2165
|
+
}
|
|
2166
|
+
#author = (initializeDeferredDecorator(this, "author"), void 0);
|
|
2167
|
+
static {
|
|
2168
|
+
decorateFieldV2(this.prototype, "views", [field], function() {
|
|
2169
|
+
return contains(NumberField);
|
|
2170
|
+
});
|
|
2171
|
+
}
|
|
2172
|
+
#views = (initializeDeferredDecorator(this, "views"), void 0);
|
|
2173
|
+
static {
|
|
2174
|
+
decorateFieldV2(this.prototype, "createdAt", [field], function() {
|
|
2175
|
+
return contains(DateTimeField);
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
#createdAt = (initializeDeferredDecorator(this, "createdAt"), void 0);
|
|
2179
|
+
}
|
|
2180
|
+
class Booking extends FieldDef {
|
|
2181
|
+
static {
|
|
2182
|
+
decorateFieldV2(this.prototype, "cardTitle", [field], function() {
|
|
2183
|
+
return contains(StringField);
|
|
2184
|
+
});
|
|
2185
|
+
}
|
|
2186
|
+
#cardTitle = (initializeDeferredDecorator(this, "cardTitle"), void 0);
|
|
2187
|
+
static {
|
|
2188
|
+
decorateFieldV2(this.prototype, "venue", [field], function() {
|
|
2189
|
+
return contains(StringField);
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
#venue = (initializeDeferredDecorator(this, "venue"), void 0);
|
|
2193
|
+
static {
|
|
2194
|
+
decorateFieldV2(this.prototype, "startTime", [field], function() {
|
|
2195
|
+
return contains(DateTimeField);
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
2198
|
+
#startTime = (initializeDeferredDecorator(this, "startTime"), void 0);
|
|
2199
|
+
static {
|
|
2200
|
+
decorateFieldV2(this.prototype, "endTime", [field], function() {
|
|
2201
|
+
return contains(DateTimeField);
|
|
2202
|
+
});
|
|
2203
|
+
}
|
|
2204
|
+
#endTime = (initializeDeferredDecorator(this, "endTime"), void 0);
|
|
2205
|
+
static {
|
|
2206
|
+
decorateFieldV2(this.prototype, "hosts", [field], function() {
|
|
2207
|
+
return containsMany(Person);
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
#hosts = (initializeDeferredDecorator(this, "hosts"), void 0);
|
|
2211
|
+
static {
|
|
2212
|
+
decorateFieldV2(this.prototype, "sponsors", [field], function() {
|
|
2213
|
+
return containsMany(StringField);
|
|
2214
|
+
});
|
|
2215
|
+
}
|
|
2216
|
+
#sponsors = (initializeDeferredDecorator(this, "sponsors"), void 0);
|
|
2217
|
+
static {
|
|
2218
|
+
decorateFieldV2(this.prototype, "posts", [field], function() {
|
|
2219
|
+
return containsMany(Post);
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
#posts = (initializeDeferredDecorator(this, "posts"), void 0);
|
|
2223
|
+
static {
|
|
2224
|
+
decorateFieldV2(this.prototype, "cardDescription", [field], function() {
|
|
2225
|
+
return contains(StringField, { computeVia: function() {
|
|
2226
|
+
return this.venue;
|
|
2227
|
+
} });
|
|
2228
|
+
});
|
|
2229
|
+
}
|
|
2230
|
+
#cardDescription = (initializeDeferredDecorator(this, "cardDescription"), void 0);
|
|
2231
|
+
static {
|
|
2232
|
+
decorateFieldV2(this.prototype, "cardThumbnailURL", [field], function() {
|
|
2233
|
+
return contains(StringField, { computeVia: () => null });
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
#cardThumbnailURL = (initializeDeferredDecorator(this, "cardThumbnailURL"), void 0);
|
|
2237
|
+
}
|
|
2238
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
2239
|
+
mockMatrixUtils,
|
|
2240
|
+
contents: {
|
|
2241
|
+
"booking.gts": { Booking },
|
|
2242
|
+
"person.gts": { Person },
|
|
2243
|
+
"post.gts": { Post },
|
|
2244
|
+
"Spec/booking.json": { data: {
|
|
2245
|
+
attributes: {
|
|
2246
|
+
cardTitle: "Booking",
|
|
2247
|
+
cardDescription: "Spec for Booking",
|
|
2248
|
+
specType: "card",
|
|
2249
|
+
ref: {
|
|
2250
|
+
module: "https://localhost:4202/test/booking",
|
|
2251
|
+
name: "Booking"
|
|
2252
|
+
}
|
|
2253
|
+
},
|
|
2254
|
+
meta: { adoptsFrom: {
|
|
2255
|
+
module: "https://cardstack.com/base/spec",
|
|
2256
|
+
name: "Spec"
|
|
2257
|
+
} }
|
|
2258
|
+
} }
|
|
2259
|
+
}
|
|
2260
|
+
});
|
|
2261
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}Spec/booking`));
|
|
2262
|
+
assert.deepEqual(entry?.searchDoc, {
|
|
2263
|
+
_cardType: "Spec",
|
|
2264
|
+
id: `${testRealmURL}Spec/booking`,
|
|
2265
|
+
cardDescription: "Spec for Booking",
|
|
2266
|
+
specType: "card",
|
|
2267
|
+
moduleHref: "https://localhost:4202/test/booking",
|
|
2268
|
+
containedExamples: null,
|
|
2269
|
+
linkedExamples: null,
|
|
2270
|
+
ref: "https://localhost:4202/test/booking/Booking",
|
|
2271
|
+
cardTitle: "Booking",
|
|
2272
|
+
isCard: true,
|
|
2273
|
+
isComponent: false,
|
|
2274
|
+
isField: false,
|
|
2275
|
+
cardInfo: { theme: null }
|
|
2276
|
+
});
|
|
2277
|
+
structuredClone(entry?.searchDoc);
|
|
2278
|
+
});
|
|
2279
|
+
(0, import_qunit.test)("can index a card with linksToMany field", async function(assert) {
|
|
2280
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2281
|
+
mockMatrixUtils,
|
|
2282
|
+
contents: {
|
|
2283
|
+
"Pet/vanGogh.json": { data: {
|
|
2284
|
+
attributes: { firstName: "Van Gogh" },
|
|
2285
|
+
meta: { adoptsFrom: {
|
|
2286
|
+
module: `${testModuleRealm}pet`,
|
|
2287
|
+
name: "Pet"
|
|
2288
|
+
} }
|
|
2289
|
+
} },
|
|
2290
|
+
"PetPerson/hassan.json": { data: {
|
|
2291
|
+
attributes: { firstName: "Hassan" },
|
|
2292
|
+
relationships: {
|
|
2293
|
+
"pets.0": { links: { self: `../Pet/mango` } },
|
|
2294
|
+
"pets.1": { links: { self: `../Pet/vanGogh` } }
|
|
2295
|
+
},
|
|
2296
|
+
meta: { adoptsFrom: {
|
|
2297
|
+
module: `${testModuleRealm}pet-person`,
|
|
2298
|
+
name: "PetPerson"
|
|
2299
|
+
} }
|
|
2300
|
+
} },
|
|
2301
|
+
"Pet/mango.json": { data: {
|
|
2302
|
+
attributes: { firstName: "Mango" },
|
|
2303
|
+
meta: { adoptsFrom: {
|
|
2304
|
+
module: `${testModuleRealm}pet`,
|
|
2305
|
+
name: "Pet"
|
|
2306
|
+
} }
|
|
2307
|
+
} }
|
|
2308
|
+
}
|
|
2309
|
+
});
|
|
2310
|
+
let hassan = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}PetPerson/hassan`), { loadLinks: true });
|
|
2311
|
+
if (hassan?.type === "doc") {
|
|
2312
|
+
assert.deepEqual(hassan.doc.data, {
|
|
2313
|
+
id: testRRI("PetPerson/hassan"),
|
|
2314
|
+
type: "card",
|
|
2315
|
+
links: { self: "./hassan" },
|
|
2316
|
+
attributes: {
|
|
2317
|
+
firstName: "Hassan",
|
|
2318
|
+
cardTitle: "Hassan Pet Person",
|
|
2319
|
+
cardDescription: "A person with pets",
|
|
2320
|
+
cardThumbnailURL: null,
|
|
2321
|
+
cardInfo
|
|
2322
|
+
},
|
|
2323
|
+
relationships: {
|
|
2324
|
+
friend: { links: { self: null } },
|
|
2325
|
+
"pets.0": {
|
|
2326
|
+
links: { self: `../Pet/mango` },
|
|
2327
|
+
data: {
|
|
2328
|
+
id: `${testRealmURL}Pet/mango`,
|
|
2329
|
+
type: "card"
|
|
2330
|
+
}
|
|
2331
|
+
},
|
|
2332
|
+
"pets.1": {
|
|
2333
|
+
links: { self: `../Pet/vanGogh` },
|
|
2334
|
+
data: {
|
|
2335
|
+
id: `${testRealmURL}Pet/vanGogh`,
|
|
2336
|
+
type: "card"
|
|
2337
|
+
}
|
|
2338
|
+
},
|
|
2339
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2340
|
+
},
|
|
2341
|
+
meta: {
|
|
2342
|
+
adoptsFrom: {
|
|
2343
|
+
module: testModuleRRI("pet-person"),
|
|
2344
|
+
name: "PetPerson"
|
|
2345
|
+
},
|
|
2346
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}PetPerson/hassan.json`),
|
|
2347
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "PetPerson/hassan.json"),
|
|
2348
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2349
|
+
realmInfo: {
|
|
2350
|
+
backgroundURL: null,
|
|
2351
|
+
iconURL: null,
|
|
2352
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2353
|
+
lastPublishedAt: null,
|
|
2354
|
+
name: "Unnamed Workspace",
|
|
2355
|
+
publishable: null,
|
|
2356
|
+
realmUserId: "@realm_server:localhost",
|
|
2357
|
+
showAsCatalog: null,
|
|
2358
|
+
visibility: "public"
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
});
|
|
2362
|
+
assert.deepEqual(hassan.doc.included, [{
|
|
2363
|
+
id: testRRI("Pet/mango"),
|
|
2364
|
+
type: "card",
|
|
2365
|
+
links: { self: `../Pet/mango` },
|
|
2366
|
+
attributes: {
|
|
2367
|
+
cardDescription: null,
|
|
2368
|
+
firstName: "Mango",
|
|
2369
|
+
cardTitle: "Mango",
|
|
2370
|
+
cardThumbnailURL: null,
|
|
2371
|
+
cardInfo
|
|
2372
|
+
},
|
|
2373
|
+
relationships: {
|
|
2374
|
+
owner: { links: { self: null } },
|
|
2375
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2376
|
+
},
|
|
2377
|
+
meta: {
|
|
2378
|
+
adoptsFrom: {
|
|
2379
|
+
module: testModuleRRI("pet"),
|
|
2380
|
+
name: "Pet"
|
|
2381
|
+
},
|
|
2382
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/mango.json`),
|
|
2383
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/mango.json"),
|
|
2384
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2385
|
+
realmInfo: {
|
|
2386
|
+
backgroundURL: null,
|
|
2387
|
+
iconURL: null,
|
|
2388
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2389
|
+
lastPublishedAt: null,
|
|
2390
|
+
name: "Unnamed Workspace",
|
|
2391
|
+
publishable: null,
|
|
2392
|
+
realmUserId: "@realm_server:localhost",
|
|
2393
|
+
showAsCatalog: null,
|
|
2394
|
+
visibility: "public"
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
}, {
|
|
2398
|
+
id: testRRI("Pet/vanGogh"),
|
|
2399
|
+
type: "card",
|
|
2400
|
+
links: { self: `../Pet/vanGogh` },
|
|
2401
|
+
attributes: {
|
|
2402
|
+
cardDescription: null,
|
|
2403
|
+
firstName: "Van Gogh",
|
|
2404
|
+
cardTitle: "Van Gogh",
|
|
2405
|
+
cardThumbnailURL: null,
|
|
2406
|
+
cardInfo
|
|
2407
|
+
},
|
|
2408
|
+
relationships: {
|
|
2409
|
+
owner: { links: { self: null } },
|
|
2410
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2411
|
+
},
|
|
2412
|
+
meta: {
|
|
2413
|
+
adoptsFrom: {
|
|
2414
|
+
module: testModuleRRI("pet"),
|
|
2415
|
+
name: "Pet"
|
|
2416
|
+
},
|
|
2417
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Pet/vanGogh.json`),
|
|
2418
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Pet/vanGogh.json"),
|
|
2419
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2420
|
+
realmInfo: {
|
|
2421
|
+
backgroundURL: null,
|
|
2422
|
+
iconURL: null,
|
|
2423
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2424
|
+
lastPublishedAt: null,
|
|
2425
|
+
name: "Unnamed Workspace",
|
|
2426
|
+
publishable: null,
|
|
2427
|
+
realmUserId: "@realm_server:localhost",
|
|
2428
|
+
showAsCatalog: null,
|
|
2429
|
+
visibility: "public"
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
}]);
|
|
2433
|
+
} else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
2434
|
+
let hassanEntry = await getInstance(realm, new URL(`${testRealmURL}PetPerson/hassan`));
|
|
2435
|
+
if (hassanEntry) assert.deepEqual(hassanEntry.searchDoc, {
|
|
2436
|
+
_cardType: "Pet Person",
|
|
2437
|
+
id: `${testRealmURL}PetPerson/hassan`,
|
|
2438
|
+
firstName: "Hassan",
|
|
2439
|
+
pets: [{
|
|
2440
|
+
id: `${testRealmURL}Pet/mango`,
|
|
2441
|
+
firstName: "Mango",
|
|
2442
|
+
owner: null,
|
|
2443
|
+
cardTitle: "Mango",
|
|
2444
|
+
cardInfo: {
|
|
2445
|
+
cardThumbnail: null,
|
|
2446
|
+
theme: null
|
|
2447
|
+
}
|
|
2448
|
+
}, {
|
|
2449
|
+
id: `${testRealmURL}Pet/vanGogh`,
|
|
2450
|
+
firstName: "Van Gogh",
|
|
2451
|
+
owner: null,
|
|
2452
|
+
cardTitle: "Van Gogh",
|
|
2453
|
+
cardInfo: {
|
|
2454
|
+
cardThumbnail: null,
|
|
2455
|
+
theme: null
|
|
2456
|
+
}
|
|
2457
|
+
}],
|
|
2458
|
+
friend: null,
|
|
2459
|
+
cardTitle: "Hassan Pet Person",
|
|
2460
|
+
cardDescription: "A person with pets",
|
|
2461
|
+
cardThumbnailURL: null,
|
|
2462
|
+
cardInfo: { theme: null }
|
|
2463
|
+
});
|
|
2464
|
+
else assert.ok(false, `could not find ${testRealmURL}PetPerson/hassan in the index`);
|
|
2465
|
+
});
|
|
2466
|
+
(0, import_qunit.test)("can index a card with empty linksToMany field value", async function(assert) {
|
|
2467
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2468
|
+
mockMatrixUtils,
|
|
2469
|
+
contents: { "PetPerson/burcu.json": { data: {
|
|
2470
|
+
attributes: { firstName: "Burcu" },
|
|
2471
|
+
relationships: {
|
|
2472
|
+
pets: { links: { self: null } },
|
|
2473
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2474
|
+
},
|
|
2475
|
+
meta: { adoptsFrom: {
|
|
2476
|
+
module: `${testModuleRealm}pet-person`,
|
|
2477
|
+
name: "PetPerson"
|
|
2478
|
+
} }
|
|
2479
|
+
} } }
|
|
2480
|
+
});
|
|
2481
|
+
let card = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}PetPerson/burcu`), { loadLinks: true });
|
|
2482
|
+
if (card?.type === "doc") assert.deepEqual(card.doc, { data: {
|
|
2483
|
+
id: testRRI("PetPerson/burcu"),
|
|
2484
|
+
type: "card",
|
|
2485
|
+
links: { self: "./burcu" },
|
|
2486
|
+
attributes: {
|
|
2487
|
+
firstName: "Burcu",
|
|
2488
|
+
cardTitle: "Burcu Pet Person",
|
|
2489
|
+
cardDescription: "A person with pets",
|
|
2490
|
+
cardThumbnailURL: null,
|
|
2491
|
+
cardInfo
|
|
2492
|
+
},
|
|
2493
|
+
relationships: {
|
|
2494
|
+
pets: { links: { self: null } },
|
|
2495
|
+
friend: { links: { self: null } },
|
|
2496
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2497
|
+
},
|
|
2498
|
+
meta: {
|
|
2499
|
+
adoptsFrom: {
|
|
2500
|
+
module: testModuleRRI("pet-person"),
|
|
2501
|
+
name: "PetPerson"
|
|
2502
|
+
},
|
|
2503
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}PetPerson/burcu.json`),
|
|
2504
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "PetPerson/burcu.json"),
|
|
2505
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2506
|
+
realmInfo: {
|
|
2507
|
+
backgroundURL: null,
|
|
2508
|
+
iconURL: null,
|
|
2509
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2510
|
+
lastPublishedAt: null,
|
|
2511
|
+
name: "Unnamed Workspace",
|
|
2512
|
+
publishable: null,
|
|
2513
|
+
realmUserId: "@realm_server:localhost",
|
|
2514
|
+
showAsCatalog: null,
|
|
2515
|
+
visibility: "public"
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
} });
|
|
2519
|
+
else assert.ok(false, `search entry was an error: ${card?.error.errorDetail.message}`);
|
|
2520
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}PetPerson/burcu`));
|
|
2521
|
+
if (entry) assert.deepEqual(entry.searchDoc, {
|
|
2522
|
+
_cardType: "Pet Person",
|
|
2523
|
+
id: `${testRealmURL}PetPerson/burcu`,
|
|
2524
|
+
firstName: "Burcu",
|
|
2525
|
+
pets: null,
|
|
2526
|
+
friend: null,
|
|
2527
|
+
cardTitle: "Burcu Pet Person",
|
|
2528
|
+
cardDescription: "A person with pets",
|
|
2529
|
+
cardThumbnailURL: null,
|
|
2530
|
+
cardInfo: { theme: null }
|
|
2531
|
+
});
|
|
2532
|
+
else assert.ok(false, `could not find ${testRealmURL}PetPerson/burcu in the index`);
|
|
2533
|
+
});
|
|
2534
|
+
(0, import_qunit.test)("can index a card that contains a field with a linksToMany field", async function(assert) {
|
|
2535
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2536
|
+
mockMatrixUtils,
|
|
2537
|
+
contents: {
|
|
2538
|
+
"Pet/vanGogh.json": { data: {
|
|
2539
|
+
attributes: { firstName: "Van Gogh" },
|
|
2540
|
+
meta: { adoptsFrom: {
|
|
2541
|
+
module: `${testModuleRealm}pet`,
|
|
2542
|
+
name: "Pet"
|
|
2543
|
+
} }
|
|
2544
|
+
} },
|
|
2545
|
+
"pet-person-spec.json": { data: {
|
|
2546
|
+
attributes: {
|
|
2547
|
+
cardTitle: "PetPerson",
|
|
2548
|
+
cardDescription: "Spec for PetPerson",
|
|
2549
|
+
specType: "card",
|
|
2550
|
+
ref: {
|
|
2551
|
+
module: `${testModuleRealm}pet-person`,
|
|
2552
|
+
name: "PetPerson"
|
|
2553
|
+
}
|
|
2554
|
+
},
|
|
2555
|
+
relationships: {},
|
|
2556
|
+
meta: { adoptsFrom: {
|
|
2557
|
+
module: "https://cardstack.com/base/spec",
|
|
2558
|
+
name: "Spec"
|
|
2559
|
+
} }
|
|
2560
|
+
} },
|
|
2561
|
+
"Pet/mango.json": { data: {
|
|
2562
|
+
attributes: { firstName: "Mango" },
|
|
2563
|
+
meta: { adoptsFrom: {
|
|
2564
|
+
module: `${testModuleRealm}pet`,
|
|
2565
|
+
name: "Pet"
|
|
2566
|
+
} }
|
|
2567
|
+
} }
|
|
2568
|
+
}
|
|
2569
|
+
});
|
|
2570
|
+
let spec = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}pet-person-spec`), { loadLinks: true });
|
|
2571
|
+
if (spec?.type === "doc") assert.deepEqual(spec.doc.data, {
|
|
2572
|
+
id: testRRI("pet-person-spec"),
|
|
2573
|
+
type: "card",
|
|
2574
|
+
links: { self: "./pet-person-spec" },
|
|
2575
|
+
attributes: {
|
|
2576
|
+
cardTitle: "PetPerson",
|
|
2577
|
+
cardDescription: "Spec for PetPerson",
|
|
2578
|
+
readMe: null,
|
|
2579
|
+
cardThumbnailURL: null,
|
|
2580
|
+
ref: {
|
|
2581
|
+
module: `${testModuleRealm}pet-person`,
|
|
2582
|
+
name: "PetPerson"
|
|
2583
|
+
},
|
|
2584
|
+
specType: "card",
|
|
2585
|
+
moduleHref: `${testModuleRealm}pet-person`,
|
|
2586
|
+
containedExamples: [],
|
|
2587
|
+
isCard: true,
|
|
2588
|
+
isComponent: false,
|
|
2589
|
+
isField: false,
|
|
2590
|
+
cardInfo
|
|
2591
|
+
},
|
|
2592
|
+
relationships: {
|
|
2593
|
+
"cardInfo.theme": { links: { self: null } },
|
|
2594
|
+
linkedExamples: { links: { self: null } }
|
|
2595
|
+
},
|
|
2596
|
+
meta: {
|
|
2597
|
+
adoptsFrom: {
|
|
2598
|
+
module: rri("https://cardstack.com/base/spec"),
|
|
2599
|
+
name: "Spec"
|
|
2600
|
+
},
|
|
2601
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}pet-person-spec.json`),
|
|
2602
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2603
|
+
realmInfo: {
|
|
2604
|
+
backgroundURL: null,
|
|
2605
|
+
iconURL: null,
|
|
2606
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2607
|
+
lastPublishedAt: null,
|
|
2608
|
+
name: "Unnamed Workspace",
|
|
2609
|
+
publishable: null,
|
|
2610
|
+
realmUserId: "@realm_server:localhost",
|
|
2611
|
+
showAsCatalog: null,
|
|
2612
|
+
visibility: "public"
|
|
2613
|
+
},
|
|
2614
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "pet-person-spec.json")
|
|
2615
|
+
}
|
|
2616
|
+
});
|
|
2617
|
+
else assert.ok(false, `search entry was an error: ${spec?.error.errorDetail.message}`);
|
|
2618
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}pet-person-spec`));
|
|
2619
|
+
if (entry) assert.deepEqual(entry.searchDoc, {
|
|
2620
|
+
_cardType: "Spec",
|
|
2621
|
+
id: `${testRealmURL}pet-person-spec`,
|
|
2622
|
+
cardTitle: "PetPerson",
|
|
2623
|
+
cardDescription: "Spec for PetPerson",
|
|
2624
|
+
containedExamples: null,
|
|
2625
|
+
linkedExamples: null,
|
|
2626
|
+
moduleHref: `${testModuleRealm}pet-person`,
|
|
2627
|
+
ref: `${testModuleRealm}pet-person/PetPerson`,
|
|
2628
|
+
specType: "card",
|
|
2629
|
+
isCard: true,
|
|
2630
|
+
isComponent: false,
|
|
2631
|
+
isField: false,
|
|
2632
|
+
cardInfo: { theme: null }
|
|
2633
|
+
});
|
|
2634
|
+
else assert.ok(false, `could not find ${testRealmURL}pet-person-spec in the index`);
|
|
2635
|
+
});
|
|
2636
|
+
(0, import_qunit.test)("can index a card that has nested linksTo fields", async function(assert) {
|
|
2637
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2638
|
+
mockMatrixUtils,
|
|
2639
|
+
contents: {
|
|
2640
|
+
"Friend/hassan.json": { data: {
|
|
2641
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
2642
|
+
attributes: {
|
|
2643
|
+
firstName: "Hassan",
|
|
2644
|
+
cardDescription: "Friend of dogs"
|
|
2645
|
+
},
|
|
2646
|
+
relationships: { friend: {
|
|
2647
|
+
links: { self: `./mango` },
|
|
2648
|
+
data: {
|
|
2649
|
+
type: "card",
|
|
2650
|
+
id: `${testRealmURL}Friend/mango`
|
|
2651
|
+
}
|
|
2652
|
+
} },
|
|
2653
|
+
meta: { adoptsFrom: {
|
|
2654
|
+
module: "https://localhost:4202/test/friend",
|
|
2655
|
+
name: "Friend"
|
|
2656
|
+
} }
|
|
2657
|
+
} },
|
|
2658
|
+
"Friend/mango.json": { data: {
|
|
2659
|
+
id: `${testRealmURL}Friend/mango`,
|
|
2660
|
+
attributes: {
|
|
2661
|
+
firstName: "Mango",
|
|
2662
|
+
cardDescription: "Dog friend"
|
|
2663
|
+
},
|
|
2664
|
+
relationships: { friend: { links: { self: `./vanGogh` } } },
|
|
2665
|
+
meta: { adoptsFrom: {
|
|
2666
|
+
module: "https://localhost:4202/test/friend",
|
|
2667
|
+
name: "Friend"
|
|
2668
|
+
} }
|
|
2669
|
+
} },
|
|
2670
|
+
"Friend/vanGogh.json": { data: {
|
|
2671
|
+
id: `${testRealmURL}Friend/vanGogh`,
|
|
2672
|
+
attributes: {
|
|
2673
|
+
firstName: "Van Gogh",
|
|
2674
|
+
cardDescription: "Dog friend",
|
|
2675
|
+
cardThumbnailURL: "van-gogh.jpg"
|
|
2676
|
+
},
|
|
2677
|
+
relationships: { friend: { links: { self: null } } },
|
|
2678
|
+
meta: { adoptsFrom: {
|
|
2679
|
+
module: "https://localhost:4202/test/friend",
|
|
2680
|
+
name: "Friend"
|
|
2681
|
+
} }
|
|
2682
|
+
} }
|
|
2683
|
+
}
|
|
2684
|
+
});
|
|
2685
|
+
let hassan = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Friend/hassan`));
|
|
2686
|
+
if (hassan?.type === "doc") assert.deepEqual(hassan.doc.data, {
|
|
2687
|
+
id: testRRI("Friend/hassan"),
|
|
2688
|
+
type: "card",
|
|
2689
|
+
links: { self: "./hassan" },
|
|
2690
|
+
attributes: {
|
|
2691
|
+
firstName: "Hassan",
|
|
2692
|
+
cardTitle: "Hassan",
|
|
2693
|
+
cardDescription: "Friend of dogs",
|
|
2694
|
+
cardThumbnailURL: null,
|
|
2695
|
+
cardInfo
|
|
2696
|
+
},
|
|
2697
|
+
relationships: {
|
|
2698
|
+
friend: { links: { self: `./mango` } },
|
|
2699
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2700
|
+
},
|
|
2701
|
+
meta: {
|
|
2702
|
+
adoptsFrom: {
|
|
2703
|
+
module: rri("https://localhost:4202/test/friend"),
|
|
2704
|
+
name: "Friend"
|
|
2705
|
+
},
|
|
2706
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/hassan.json`),
|
|
2707
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2708
|
+
realmInfo: {
|
|
2709
|
+
backgroundURL: null,
|
|
2710
|
+
iconURL: null,
|
|
2711
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2712
|
+
lastPublishedAt: null,
|
|
2713
|
+
name: "Unnamed Workspace",
|
|
2714
|
+
publishable: null,
|
|
2715
|
+
realmUserId: "@realm_server:localhost",
|
|
2716
|
+
showAsCatalog: null,
|
|
2717
|
+
visibility: "public"
|
|
2718
|
+
},
|
|
2719
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/hassan.json")
|
|
2720
|
+
}
|
|
2721
|
+
});
|
|
2722
|
+
else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
2723
|
+
let hassanEntry = await getInstance(realm, new URL(`${testRealmURL}Friend/hassan`));
|
|
2724
|
+
if (hassanEntry) assert.deepEqual(hassanEntry.searchDoc, {
|
|
2725
|
+
_cardType: "Friend",
|
|
2726
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
2727
|
+
firstName: "Hassan",
|
|
2728
|
+
cardTitle: "Hassan",
|
|
2729
|
+
cardDescription: "Friend of dogs",
|
|
2730
|
+
friend: {
|
|
2731
|
+
id: `${testRealmURL}Friend/mango`,
|
|
2732
|
+
firstName: "Mango",
|
|
2733
|
+
cardTitle: "Mango",
|
|
2734
|
+
cardDescription: "Dog friend",
|
|
2735
|
+
friend: { id: `${testRealmURL}Friend/vanGogh` },
|
|
2736
|
+
cardInfo: { theme: null }
|
|
2737
|
+
},
|
|
2738
|
+
cardInfo: { theme: null }
|
|
2739
|
+
});
|
|
2740
|
+
else assert.ok(false, `could not find ${testRealmURL}Friend/hassan in the index`);
|
|
2741
|
+
});
|
|
2742
|
+
(0, import_qunit.test)("can index a field with a cycle in the linksTo field", async function(assert) {
|
|
2743
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2744
|
+
mockMatrixUtils,
|
|
2745
|
+
contents: {
|
|
2746
|
+
"Friend/hassan.json": { data: {
|
|
2747
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
2748
|
+
attributes: {
|
|
2749
|
+
firstName: "Hassan",
|
|
2750
|
+
cardDescription: "Dog owner"
|
|
2751
|
+
},
|
|
2752
|
+
relationships: { friend: { links: { self: `./mango` } } },
|
|
2753
|
+
meta: { adoptsFrom: {
|
|
2754
|
+
module: "https://localhost:4202/test/friend",
|
|
2755
|
+
name: "Friend"
|
|
2756
|
+
} }
|
|
2757
|
+
} },
|
|
2758
|
+
"Friend/mango.json": { data: {
|
|
2759
|
+
id: `${testRealmURL}Friend/mango`,
|
|
2760
|
+
attributes: {
|
|
2761
|
+
firstName: "Mango",
|
|
2762
|
+
cardDescription: "Dog friend"
|
|
2763
|
+
},
|
|
2764
|
+
relationships: { friend: {
|
|
2765
|
+
links: { self: `./hassan` },
|
|
2766
|
+
data: {
|
|
2767
|
+
type: "card",
|
|
2768
|
+
id: `${testRealmURL}Friend/hassan`
|
|
2769
|
+
}
|
|
2770
|
+
} },
|
|
2771
|
+
meta: { adoptsFrom: {
|
|
2772
|
+
module: "https://localhost:4202/test/friend",
|
|
2773
|
+
name: "Friend"
|
|
2774
|
+
} }
|
|
2775
|
+
} }
|
|
2776
|
+
}
|
|
2777
|
+
});
|
|
2778
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
2779
|
+
let hassan = await indexer.cardDocument(new URL(`${testRealmURL}Friend/hassan`), { loadLinks: true });
|
|
2780
|
+
if (hassan?.type === "doc") assert.deepEqual(hassan.doc, {
|
|
2781
|
+
data: {
|
|
2782
|
+
id: testRRI("Friend/hassan"),
|
|
2783
|
+
type: "card",
|
|
2784
|
+
links: { self: "./hassan" },
|
|
2785
|
+
attributes: {
|
|
2786
|
+
firstName: "Hassan",
|
|
2787
|
+
cardTitle: "Hassan",
|
|
2788
|
+
cardDescription: "Dog owner",
|
|
2789
|
+
cardThumbnailURL: null,
|
|
2790
|
+
cardInfo
|
|
2791
|
+
},
|
|
2792
|
+
relationships: {
|
|
2793
|
+
friend: {
|
|
2794
|
+
links: { self: `./mango` },
|
|
2795
|
+
data: {
|
|
2796
|
+
type: "card",
|
|
2797
|
+
id: `${testRealmURL}Friend/mango`
|
|
2798
|
+
}
|
|
2799
|
+
},
|
|
2800
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2801
|
+
},
|
|
2802
|
+
meta: {
|
|
2803
|
+
adoptsFrom: {
|
|
2804
|
+
module: rri("https://localhost:4202/test/friend"),
|
|
2805
|
+
name: "Friend"
|
|
2806
|
+
},
|
|
2807
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/hassan.json`),
|
|
2808
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2809
|
+
realmInfo: {
|
|
2810
|
+
backgroundURL: null,
|
|
2811
|
+
iconURL: null,
|
|
2812
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2813
|
+
lastPublishedAt: null,
|
|
2814
|
+
name: "Unnamed Workspace",
|
|
2815
|
+
publishable: null,
|
|
2816
|
+
realmUserId: "@realm_server:localhost",
|
|
2817
|
+
showAsCatalog: null,
|
|
2818
|
+
visibility: "public"
|
|
2819
|
+
},
|
|
2820
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/hassan.json")
|
|
2821
|
+
}
|
|
2822
|
+
},
|
|
2823
|
+
included: [{
|
|
2824
|
+
id: testRRI("Friend/mango"),
|
|
2825
|
+
type: "card",
|
|
2826
|
+
links: { self: `./mango` },
|
|
2827
|
+
attributes: {
|
|
2828
|
+
firstName: "Mango",
|
|
2829
|
+
cardTitle: "Mango",
|
|
2830
|
+
cardDescription: "Dog friend",
|
|
2831
|
+
cardThumbnailURL: null,
|
|
2832
|
+
cardInfo
|
|
2833
|
+
},
|
|
2834
|
+
relationships: {
|
|
2835
|
+
friend: {
|
|
2836
|
+
links: { self: `./hassan` },
|
|
2837
|
+
data: {
|
|
2838
|
+
type: "card",
|
|
2839
|
+
id: `${testRealmURL}Friend/hassan`
|
|
2840
|
+
}
|
|
2841
|
+
},
|
|
2842
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2843
|
+
},
|
|
2844
|
+
meta: {
|
|
2845
|
+
adoptsFrom: {
|
|
2846
|
+
module: rri("https://localhost:4202/test/friend"),
|
|
2847
|
+
name: "Friend"
|
|
2848
|
+
},
|
|
2849
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/mango.json`),
|
|
2850
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2851
|
+
realmInfo: {
|
|
2852
|
+
backgroundURL: null,
|
|
2853
|
+
iconURL: null,
|
|
2854
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2855
|
+
lastPublishedAt: null,
|
|
2856
|
+
name: "Unnamed Workspace",
|
|
2857
|
+
publishable: null,
|
|
2858
|
+
realmUserId: "@realm_server:localhost",
|
|
2859
|
+
showAsCatalog: null,
|
|
2860
|
+
visibility: "public"
|
|
2861
|
+
},
|
|
2862
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/mango.json")
|
|
2863
|
+
}
|
|
2864
|
+
}]
|
|
2865
|
+
});
|
|
2866
|
+
else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
2867
|
+
let hassanEntry = await getInstance(realm, new URL(`${testRealmURL}Friend/hassan`));
|
|
2868
|
+
if (hassanEntry) assert.deepEqual(hassanEntry.searchDoc, {
|
|
2869
|
+
_cardType: "Friend",
|
|
2870
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
2871
|
+
firstName: "Hassan",
|
|
2872
|
+
cardDescription: "Dog owner",
|
|
2873
|
+
friend: {
|
|
2874
|
+
id: `${testRealmURL}Friend/mango`,
|
|
2875
|
+
firstName: "Mango",
|
|
2876
|
+
cardTitle: "Mango",
|
|
2877
|
+
friend: { id: `${testRealmURL}Friend/hassan` },
|
|
2878
|
+
cardDescription: "Dog friend",
|
|
2879
|
+
cardInfo: { theme: null }
|
|
2880
|
+
},
|
|
2881
|
+
cardTitle: "Hassan",
|
|
2882
|
+
cardInfo: { theme: null }
|
|
2883
|
+
});
|
|
2884
|
+
else assert.ok(false, `could not find ${testRealmURL}Friend/hassan in the index`);
|
|
2885
|
+
let mango = await indexer.cardDocument(new URL(`${testRealmURL}Friend/mango`), { loadLinks: true });
|
|
2886
|
+
if (mango?.type === "doc") assert.deepEqual(mango.doc, {
|
|
2887
|
+
data: {
|
|
2888
|
+
id: testRRI("Friend/mango"),
|
|
2889
|
+
type: "card",
|
|
2890
|
+
links: { self: "./mango" },
|
|
2891
|
+
attributes: {
|
|
2892
|
+
firstName: "Mango",
|
|
2893
|
+
cardTitle: "Mango",
|
|
2894
|
+
cardDescription: "Dog friend",
|
|
2895
|
+
cardThumbnailURL: null,
|
|
2896
|
+
cardInfo
|
|
2897
|
+
},
|
|
2898
|
+
relationships: {
|
|
2899
|
+
friend: {
|
|
2900
|
+
links: { self: `./hassan` },
|
|
2901
|
+
data: {
|
|
2902
|
+
type: "card",
|
|
2903
|
+
id: `${testRealmURL}Friend/hassan`
|
|
2904
|
+
}
|
|
2905
|
+
},
|
|
2906
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2907
|
+
},
|
|
2908
|
+
meta: {
|
|
2909
|
+
adoptsFrom: {
|
|
2910
|
+
module: rri("https://localhost:4202/test/friend"),
|
|
2911
|
+
name: "Friend"
|
|
2912
|
+
},
|
|
2913
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/mango.json`),
|
|
2914
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2915
|
+
realmInfo: {
|
|
2916
|
+
backgroundURL: null,
|
|
2917
|
+
iconURL: null,
|
|
2918
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2919
|
+
lastPublishedAt: null,
|
|
2920
|
+
name: "Unnamed Workspace",
|
|
2921
|
+
publishable: null,
|
|
2922
|
+
realmUserId: "@realm_server:localhost",
|
|
2923
|
+
showAsCatalog: null,
|
|
2924
|
+
visibility: "public"
|
|
2925
|
+
},
|
|
2926
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/mango.json")
|
|
2927
|
+
}
|
|
2928
|
+
},
|
|
2929
|
+
included: [{
|
|
2930
|
+
id: testRRI("Friend/hassan"),
|
|
2931
|
+
type: "card",
|
|
2932
|
+
links: { self: `./hassan` },
|
|
2933
|
+
attributes: {
|
|
2934
|
+
firstName: "Hassan",
|
|
2935
|
+
cardTitle: "Hassan",
|
|
2936
|
+
cardDescription: "Dog owner",
|
|
2937
|
+
cardThumbnailURL: null,
|
|
2938
|
+
cardInfo
|
|
2939
|
+
},
|
|
2940
|
+
relationships: {
|
|
2941
|
+
friend: {
|
|
2942
|
+
links: { self: `./mango` },
|
|
2943
|
+
data: {
|
|
2944
|
+
type: "card",
|
|
2945
|
+
id: `${testRealmURL}Friend/mango`
|
|
2946
|
+
}
|
|
2947
|
+
},
|
|
2948
|
+
"cardInfo.theme": { links: { self: null } }
|
|
2949
|
+
},
|
|
2950
|
+
meta: {
|
|
2951
|
+
adoptsFrom: {
|
|
2952
|
+
module: rri("https://localhost:4202/test/friend"),
|
|
2953
|
+
name: "Friend"
|
|
2954
|
+
},
|
|
2955
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/hassan.json`),
|
|
2956
|
+
realmURL: ri("http://test-realm/test/"),
|
|
2957
|
+
realmInfo: {
|
|
2958
|
+
backgroundURL: null,
|
|
2959
|
+
iconURL: null,
|
|
2960
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
2961
|
+
lastPublishedAt: null,
|
|
2962
|
+
name: "Unnamed Workspace",
|
|
2963
|
+
publishable: null,
|
|
2964
|
+
realmUserId: "@realm_server:localhost",
|
|
2965
|
+
showAsCatalog: null,
|
|
2966
|
+
visibility: "public"
|
|
2967
|
+
},
|
|
2968
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/hassan.json")
|
|
2969
|
+
}
|
|
2970
|
+
}]
|
|
2971
|
+
});
|
|
2972
|
+
else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
2973
|
+
let mangoEntry = await getInstance(realm, new URL(`${testRealmURL}Friend/mango`));
|
|
2974
|
+
if (mangoEntry) assert.deepEqual(mangoEntry.searchDoc, {
|
|
2975
|
+
_cardType: "Friend",
|
|
2976
|
+
id: `${testRealmURL}Friend/mango`,
|
|
2977
|
+
firstName: "Mango",
|
|
2978
|
+
cardTitle: "Mango",
|
|
2979
|
+
cardDescription: "Dog friend",
|
|
2980
|
+
friend: {
|
|
2981
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
2982
|
+
cardTitle: "Hassan",
|
|
2983
|
+
firstName: "Hassan",
|
|
2984
|
+
friend: { id: `${testRealmURL}Friend/mango` },
|
|
2985
|
+
cardDescription: "Dog owner",
|
|
2986
|
+
cardInfo: {
|
|
2987
|
+
cardThumbnail: null,
|
|
2988
|
+
theme: null
|
|
2989
|
+
}
|
|
2990
|
+
},
|
|
2991
|
+
cardInfo: { theme: null }
|
|
2992
|
+
});
|
|
2993
|
+
else assert.ok(false, `could not find ${testRealmURL}Friend/mango in the index`);
|
|
2994
|
+
});
|
|
2995
|
+
(0, import_qunit.test)("can index a card that has a linksTo relationship to itself", async function(assert) {
|
|
2996
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
2997
|
+
mockMatrixUtils,
|
|
2998
|
+
contents: { "Friend/hassan.json": { data: {
|
|
2999
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3000
|
+
attributes: {
|
|
3001
|
+
firstName: "Hassan",
|
|
3002
|
+
cardDescription: "Dog owner"
|
|
3003
|
+
},
|
|
3004
|
+
relationships: { friend: { links: { self: `./hassan` } } },
|
|
3005
|
+
meta: { adoptsFrom: {
|
|
3006
|
+
module: "https://localhost:4202/test/friend",
|
|
3007
|
+
name: "Friend"
|
|
3008
|
+
} }
|
|
3009
|
+
} } }
|
|
3010
|
+
});
|
|
3011
|
+
let hassan = await realm.realmIndexQueryEngine.cardDocument(new URL(`${testRealmURL}Friend/hassan`), { loadLinks: true });
|
|
3012
|
+
if (hassan?.type === "doc") assert.deepEqual(hassan.doc, { data: {
|
|
3013
|
+
id: testRRI("Friend/hassan"),
|
|
3014
|
+
type: "card",
|
|
3015
|
+
links: { self: "./hassan" },
|
|
3016
|
+
attributes: {
|
|
3017
|
+
firstName: "Hassan",
|
|
3018
|
+
cardTitle: "Hassan",
|
|
3019
|
+
cardDescription: "Dog owner",
|
|
3020
|
+
cardThumbnailURL: null,
|
|
3021
|
+
cardInfo
|
|
3022
|
+
},
|
|
3023
|
+
relationships: {
|
|
3024
|
+
friend: {
|
|
3025
|
+
links: { self: `./hassan` },
|
|
3026
|
+
data: {
|
|
3027
|
+
type: "card",
|
|
3028
|
+
id: `${testRealmURL}Friend/hassan`
|
|
3029
|
+
}
|
|
3030
|
+
},
|
|
3031
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3032
|
+
},
|
|
3033
|
+
meta: {
|
|
3034
|
+
adoptsFrom: {
|
|
3035
|
+
module: rri("https://localhost:4202/test/friend"),
|
|
3036
|
+
name: "Friend"
|
|
3037
|
+
},
|
|
3038
|
+
lastModified: adapter.lastModifiedMap.get(`${testRealmURL}Friend/hassan.json`),
|
|
3039
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3040
|
+
realmInfo: {
|
|
3041
|
+
backgroundURL: null,
|
|
3042
|
+
iconURL: null,
|
|
3043
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3044
|
+
lastPublishedAt: null,
|
|
3045
|
+
name: "Unnamed Workspace",
|
|
3046
|
+
publishable: null,
|
|
3047
|
+
realmUserId: "@realm_server:localhost",
|
|
3048
|
+
showAsCatalog: null,
|
|
3049
|
+
visibility: "public"
|
|
3050
|
+
},
|
|
3051
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friend/hassan.json")
|
|
3052
|
+
}
|
|
3053
|
+
} });
|
|
3054
|
+
else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
3055
|
+
let hassanEntry = await getInstance(realm, new URL(`${testRealmURL}Friend/hassan`));
|
|
3056
|
+
if (hassanEntry) assert.deepEqual(hassanEntry.searchDoc, {
|
|
3057
|
+
_cardType: "Friend",
|
|
3058
|
+
id: `${testRealmURL}Friend/hassan`,
|
|
3059
|
+
firstName: "Hassan",
|
|
3060
|
+
cardDescription: "Dog owner",
|
|
3061
|
+
friend: { id: `${testRealmURL}Friend/hassan` },
|
|
3062
|
+
cardTitle: "Hassan",
|
|
3063
|
+
cardInfo: { theme: null }
|
|
3064
|
+
});
|
|
3065
|
+
else assert.ok(false, `could not find ${testRealmURL}Friend/hassan in the index`);
|
|
3066
|
+
});
|
|
3067
|
+
(0, import_qunit.test)("can index a field with a cycle in the linksToMany field", async function(assert) {
|
|
3068
|
+
let hassanID = `${testRealmURL}Friends/hassan`;
|
|
3069
|
+
let mangoID = `${testRealmURL}Friends/mango`;
|
|
3070
|
+
let vanGoghID = `${testRealmURL}Friends/vanGogh`;
|
|
3071
|
+
let friendsRef = {
|
|
3072
|
+
module: testModuleRRI("friends"),
|
|
3073
|
+
name: "Friends"
|
|
3074
|
+
};
|
|
3075
|
+
let { realm, adapter } = await setupIntegrationTestRealm({
|
|
3076
|
+
mockMatrixUtils,
|
|
3077
|
+
contents: {
|
|
3078
|
+
"Friends/vanGogh.json": { data: {
|
|
3079
|
+
attributes: { firstName: "Van Gogh" },
|
|
3080
|
+
relationships: { "friends.0": {
|
|
3081
|
+
links: { self: hassanID },
|
|
3082
|
+
data: {
|
|
3083
|
+
type: "card",
|
|
3084
|
+
id: hassanID
|
|
3085
|
+
}
|
|
3086
|
+
} },
|
|
3087
|
+
meta: { adoptsFrom: friendsRef }
|
|
3088
|
+
} },
|
|
3089
|
+
"Friends/hassan.json": { data: {
|
|
3090
|
+
attributes: { firstName: "Hassan" },
|
|
3091
|
+
relationships: {
|
|
3092
|
+
"friends.0": {
|
|
3093
|
+
links: { self: mangoID },
|
|
3094
|
+
data: {
|
|
3095
|
+
type: "card",
|
|
3096
|
+
id: mangoID
|
|
3097
|
+
}
|
|
3098
|
+
},
|
|
3099
|
+
"friends.1": {
|
|
3100
|
+
links: { self: vanGoghID },
|
|
3101
|
+
data: {
|
|
3102
|
+
type: "card",
|
|
3103
|
+
id: vanGoghID
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
},
|
|
3107
|
+
meta: { adoptsFrom: friendsRef }
|
|
3108
|
+
} },
|
|
3109
|
+
"Friends/mango.json": { data: {
|
|
3110
|
+
attributes: { firstName: "Mango" },
|
|
3111
|
+
relationships: { "friends.0": {
|
|
3112
|
+
links: { self: hassanID },
|
|
3113
|
+
data: {
|
|
3114
|
+
type: "card",
|
|
3115
|
+
id: hassanID
|
|
3116
|
+
}
|
|
3117
|
+
} },
|
|
3118
|
+
meta: { adoptsFrom: friendsRef }
|
|
3119
|
+
} }
|
|
3120
|
+
}
|
|
3121
|
+
});
|
|
3122
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
3123
|
+
let realmIndexUpdater = realm.realmIndexUpdater;
|
|
3124
|
+
assert.deepEqual(realmIndexUpdater.stats, {
|
|
3125
|
+
filesIndexed: 3,
|
|
3126
|
+
fileErrors: 0,
|
|
3127
|
+
instanceErrors: 0,
|
|
3128
|
+
instancesIndexed: 3,
|
|
3129
|
+
totalIndexEntries: 6
|
|
3130
|
+
}, "instances are indexed without error");
|
|
3131
|
+
let hassan = await queryEngine.cardDocument(new URL(hassanID), { loadLinks: true });
|
|
3132
|
+
if (hassan?.type === "doc") {
|
|
3133
|
+
assert.deepEqual(hassan.doc.data, {
|
|
3134
|
+
id: rri(hassanID),
|
|
3135
|
+
type: "card",
|
|
3136
|
+
links: { self: "./hassan" },
|
|
3137
|
+
attributes: {
|
|
3138
|
+
firstName: "Hassan",
|
|
3139
|
+
cardTitle: "Hassan",
|
|
3140
|
+
cardDescription: null,
|
|
3141
|
+
cardThumbnailURL: null,
|
|
3142
|
+
cardInfo
|
|
3143
|
+
},
|
|
3144
|
+
relationships: {
|
|
3145
|
+
"friends.0": {
|
|
3146
|
+
links: { self: "./mango" },
|
|
3147
|
+
data: {
|
|
3148
|
+
type: "card",
|
|
3149
|
+
id: mangoID
|
|
3150
|
+
}
|
|
3151
|
+
},
|
|
3152
|
+
"friends.1": {
|
|
3153
|
+
links: { self: "./vanGogh" },
|
|
3154
|
+
data: {
|
|
3155
|
+
type: "card",
|
|
3156
|
+
id: vanGoghID
|
|
3157
|
+
}
|
|
3158
|
+
},
|
|
3159
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3160
|
+
},
|
|
3161
|
+
meta: {
|
|
3162
|
+
adoptsFrom: friendsRef,
|
|
3163
|
+
lastModified: adapter.lastModifiedMap.get(`${hassanID}.json`),
|
|
3164
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3165
|
+
realmInfo: {
|
|
3166
|
+
backgroundURL: null,
|
|
3167
|
+
iconURL: null,
|
|
3168
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3169
|
+
lastPublishedAt: null,
|
|
3170
|
+
name: "Unnamed Workspace",
|
|
3171
|
+
publishable: null,
|
|
3172
|
+
realmUserId: "@realm_server:localhost",
|
|
3173
|
+
showAsCatalog: null,
|
|
3174
|
+
visibility: "public"
|
|
3175
|
+
},
|
|
3176
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/hassan.json")
|
|
3177
|
+
}
|
|
3178
|
+
}, "hassan doc.data is correct");
|
|
3179
|
+
assert.deepEqual(hassan.doc.included, [{
|
|
3180
|
+
id: rri(mangoID),
|
|
3181
|
+
type: "card",
|
|
3182
|
+
links: { self: "./mango" },
|
|
3183
|
+
attributes: {
|
|
3184
|
+
firstName: "Mango",
|
|
3185
|
+
cardTitle: "Mango",
|
|
3186
|
+
cardDescription: null,
|
|
3187
|
+
cardThumbnailURL: null,
|
|
3188
|
+
cardInfo
|
|
3189
|
+
},
|
|
3190
|
+
relationships: {
|
|
3191
|
+
"friends.0": {
|
|
3192
|
+
links: { self: "./hassan" },
|
|
3193
|
+
data: {
|
|
3194
|
+
type: "card",
|
|
3195
|
+
id: hassanID
|
|
3196
|
+
}
|
|
3197
|
+
},
|
|
3198
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3199
|
+
},
|
|
3200
|
+
meta: {
|
|
3201
|
+
adoptsFrom: friendsRef,
|
|
3202
|
+
lastModified: adapter.lastModifiedMap.get(`${mangoID}.json`),
|
|
3203
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3204
|
+
realmInfo: {
|
|
3205
|
+
backgroundURL: null,
|
|
3206
|
+
iconURL: null,
|
|
3207
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3208
|
+
lastPublishedAt: null,
|
|
3209
|
+
name: "Unnamed Workspace",
|
|
3210
|
+
publishable: null,
|
|
3211
|
+
realmUserId: "@realm_server:localhost",
|
|
3212
|
+
showAsCatalog: null,
|
|
3213
|
+
visibility: "public"
|
|
3214
|
+
},
|
|
3215
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/mango.json")
|
|
3216
|
+
}
|
|
3217
|
+
}, {
|
|
3218
|
+
id: rri(vanGoghID),
|
|
3219
|
+
type: "card",
|
|
3220
|
+
links: { self: "./vanGogh" },
|
|
3221
|
+
attributes: {
|
|
3222
|
+
firstName: "Van Gogh",
|
|
3223
|
+
cardTitle: "Van Gogh",
|
|
3224
|
+
cardDescription: null,
|
|
3225
|
+
cardThumbnailURL: null,
|
|
3226
|
+
cardInfo
|
|
3227
|
+
},
|
|
3228
|
+
relationships: {
|
|
3229
|
+
"friends.0": {
|
|
3230
|
+
links: { self: "./hassan" },
|
|
3231
|
+
data: {
|
|
3232
|
+
type: "card",
|
|
3233
|
+
id: hassanID
|
|
3234
|
+
}
|
|
3235
|
+
},
|
|
3236
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3237
|
+
},
|
|
3238
|
+
meta: {
|
|
3239
|
+
adoptsFrom: friendsRef,
|
|
3240
|
+
lastModified: adapter.lastModifiedMap.get(`${vanGoghID}.json`),
|
|
3241
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3242
|
+
realmInfo: {
|
|
3243
|
+
backgroundURL: null,
|
|
3244
|
+
iconURL: null,
|
|
3245
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3246
|
+
lastPublishedAt: null,
|
|
3247
|
+
name: "Unnamed Workspace",
|
|
3248
|
+
publishable: null,
|
|
3249
|
+
realmUserId: "@realm_server:localhost",
|
|
3250
|
+
showAsCatalog: null,
|
|
3251
|
+
visibility: "public"
|
|
3252
|
+
},
|
|
3253
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/vanGogh.json")
|
|
3254
|
+
}
|
|
3255
|
+
}], "hassan doc.included is correct");
|
|
3256
|
+
} else assert.ok(false, `search entry was an error: ${hassan?.error.errorDetail.message}`);
|
|
3257
|
+
let hassanEntry = await getInstance(realm, new URL(hassanID));
|
|
3258
|
+
if (hassanEntry) assert.deepEqual(hassanEntry.searchDoc, {
|
|
3259
|
+
_cardType: "Friends",
|
|
3260
|
+
id: hassanID,
|
|
3261
|
+
firstName: "Hassan",
|
|
3262
|
+
cardTitle: "Hassan",
|
|
3263
|
+
friends: [{
|
|
3264
|
+
id: mangoID,
|
|
3265
|
+
firstName: "Mango",
|
|
3266
|
+
cardTitle: "Mango",
|
|
3267
|
+
friends: [{ id: hassanID }],
|
|
3268
|
+
cardInfo: { theme: null }
|
|
3269
|
+
}, {
|
|
3270
|
+
id: vanGoghID,
|
|
3271
|
+
firstName: "Van Gogh",
|
|
3272
|
+
friends: [{ id: hassanID }],
|
|
3273
|
+
cardTitle: "Van Gogh",
|
|
3274
|
+
cardInfo: { theme: null }
|
|
3275
|
+
}],
|
|
3276
|
+
cardInfo: { theme: null }
|
|
3277
|
+
}, "hassan searchData is correct");
|
|
3278
|
+
else assert.ok(false, `could not find ${hassanID} in the index`);
|
|
3279
|
+
let mango = await queryEngine.cardDocument(new URL(mangoID), { loadLinks: true });
|
|
3280
|
+
if (mango?.type === "doc") {
|
|
3281
|
+
assert.deepEqual(mango.doc.data, {
|
|
3282
|
+
id: rri(mangoID),
|
|
3283
|
+
type: "card",
|
|
3284
|
+
links: { self: "./mango" },
|
|
3285
|
+
attributes: {
|
|
3286
|
+
firstName: "Mango",
|
|
3287
|
+
cardTitle: "Mango",
|
|
3288
|
+
cardDescription: null,
|
|
3289
|
+
cardThumbnailURL: null,
|
|
3290
|
+
cardInfo
|
|
3291
|
+
},
|
|
3292
|
+
relationships: {
|
|
3293
|
+
"friends.0": {
|
|
3294
|
+
links: { self: "./hassan" },
|
|
3295
|
+
data: {
|
|
3296
|
+
type: "card",
|
|
3297
|
+
id: hassanID
|
|
3298
|
+
}
|
|
3299
|
+
},
|
|
3300
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3301
|
+
},
|
|
3302
|
+
meta: {
|
|
3303
|
+
adoptsFrom: friendsRef,
|
|
3304
|
+
lastModified: adapter.lastModifiedMap.get(`${mangoID}.json`),
|
|
3305
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3306
|
+
realmInfo: {
|
|
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, "Friends/mango.json")
|
|
3318
|
+
}
|
|
3319
|
+
}, "mango doc.data is correct");
|
|
3320
|
+
assert.deepEqual(mango.doc.included, [{
|
|
3321
|
+
id: rri(hassanID),
|
|
3322
|
+
type: "card",
|
|
3323
|
+
links: { self: "./hassan" },
|
|
3324
|
+
attributes: {
|
|
3325
|
+
firstName: "Hassan",
|
|
3326
|
+
cardTitle: "Hassan",
|
|
3327
|
+
cardDescription: null,
|
|
3328
|
+
cardThumbnailURL: null,
|
|
3329
|
+
cardInfo
|
|
3330
|
+
},
|
|
3331
|
+
relationships: {
|
|
3332
|
+
"friends.0": {
|
|
3333
|
+
links: { self: "./mango" },
|
|
3334
|
+
data: {
|
|
3335
|
+
type: "card",
|
|
3336
|
+
id: mangoID
|
|
3337
|
+
}
|
|
3338
|
+
},
|
|
3339
|
+
"friends.1": {
|
|
3340
|
+
links: { self: "./vanGogh" },
|
|
3341
|
+
data: {
|
|
3342
|
+
type: "card",
|
|
3343
|
+
id: vanGoghID
|
|
3344
|
+
}
|
|
3345
|
+
},
|
|
3346
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3347
|
+
},
|
|
3348
|
+
meta: {
|
|
3349
|
+
adoptsFrom: friendsRef,
|
|
3350
|
+
lastModified: adapter.lastModifiedMap.get(`${hassanID}.json`),
|
|
3351
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3352
|
+
realmInfo: {
|
|
3353
|
+
backgroundURL: null,
|
|
3354
|
+
iconURL: null,
|
|
3355
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3356
|
+
lastPublishedAt: null,
|
|
3357
|
+
name: "Unnamed Workspace",
|
|
3358
|
+
publishable: null,
|
|
3359
|
+
realmUserId: "@realm_server:localhost",
|
|
3360
|
+
showAsCatalog: null,
|
|
3361
|
+
visibility: "public"
|
|
3362
|
+
},
|
|
3363
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/hassan.json")
|
|
3364
|
+
}
|
|
3365
|
+
}, {
|
|
3366
|
+
id: rri(vanGoghID),
|
|
3367
|
+
type: "card",
|
|
3368
|
+
links: { self: "./vanGogh" },
|
|
3369
|
+
attributes: {
|
|
3370
|
+
firstName: "Van Gogh",
|
|
3371
|
+
cardTitle: "Van Gogh",
|
|
3372
|
+
cardDescription: null,
|
|
3373
|
+
cardThumbnailURL: null,
|
|
3374
|
+
cardInfo
|
|
3375
|
+
},
|
|
3376
|
+
relationships: {
|
|
3377
|
+
"friends.0": {
|
|
3378
|
+
links: { self: "./hassan" },
|
|
3379
|
+
data: {
|
|
3380
|
+
type: "card",
|
|
3381
|
+
id: hassanID
|
|
3382
|
+
}
|
|
3383
|
+
},
|
|
3384
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3385
|
+
},
|
|
3386
|
+
meta: {
|
|
3387
|
+
adoptsFrom: friendsRef,
|
|
3388
|
+
lastModified: adapter.lastModifiedMap.get(`${vanGoghID}.json`),
|
|
3389
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3390
|
+
realmInfo: {
|
|
3391
|
+
backgroundURL: null,
|
|
3392
|
+
iconURL: null,
|
|
3393
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3394
|
+
lastPublishedAt: null,
|
|
3395
|
+
name: "Unnamed Workspace",
|
|
3396
|
+
publishable: null,
|
|
3397
|
+
realmUserId: "@realm_server:localhost",
|
|
3398
|
+
showAsCatalog: null,
|
|
3399
|
+
visibility: "public"
|
|
3400
|
+
},
|
|
3401
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/vanGogh.json")
|
|
3402
|
+
}
|
|
3403
|
+
}], "mango doc.included is correct");
|
|
3404
|
+
} else assert.ok(false, `search entry was an error: ${mango?.error.errorDetail.message}`);
|
|
3405
|
+
let mangoEntry = await getInstance(realm, new URL(mangoID));
|
|
3406
|
+
if (mangoEntry) assert.deepEqual(mangoEntry.searchDoc, {
|
|
3407
|
+
_cardType: "Friends",
|
|
3408
|
+
id: mangoID,
|
|
3409
|
+
firstName: "Mango",
|
|
3410
|
+
cardTitle: "Mango",
|
|
3411
|
+
friends: [{
|
|
3412
|
+
id: hassanID,
|
|
3413
|
+
firstName: "Hassan",
|
|
3414
|
+
cardTitle: "Hassan",
|
|
3415
|
+
friends: [{ id: mangoID }, {
|
|
3416
|
+
id: vanGoghID,
|
|
3417
|
+
firstName: "Van Gogh",
|
|
3418
|
+
cardTitle: "Van Gogh",
|
|
3419
|
+
friends: [{ id: hassanID }],
|
|
3420
|
+
cardInfo: { theme: null }
|
|
3421
|
+
}],
|
|
3422
|
+
cardInfo: {
|
|
3423
|
+
cardThumbnail: null,
|
|
3424
|
+
theme: null
|
|
3425
|
+
}
|
|
3426
|
+
}],
|
|
3427
|
+
cardInfo: { theme: null }
|
|
3428
|
+
}, "mango searchData is correct");
|
|
3429
|
+
else assert.ok(false, `could not find ${mangoID} in the index`);
|
|
3430
|
+
let vanGogh = await queryEngine.cardDocument(new URL(vanGoghID), { loadLinks: true });
|
|
3431
|
+
if (vanGogh?.type === "doc") {
|
|
3432
|
+
assert.deepEqual(vanGogh.doc.data, {
|
|
3433
|
+
id: rri(vanGoghID),
|
|
3434
|
+
type: "card",
|
|
3435
|
+
links: { self: "./vanGogh" },
|
|
3436
|
+
attributes: {
|
|
3437
|
+
firstName: "Van Gogh",
|
|
3438
|
+
cardTitle: "Van Gogh",
|
|
3439
|
+
cardDescription: null,
|
|
3440
|
+
cardThumbnailURL: null,
|
|
3441
|
+
cardInfo
|
|
3442
|
+
},
|
|
3443
|
+
relationships: {
|
|
3444
|
+
"friends.0": {
|
|
3445
|
+
links: { self: "./hassan" },
|
|
3446
|
+
data: {
|
|
3447
|
+
type: "card",
|
|
3448
|
+
id: hassanID
|
|
3449
|
+
}
|
|
3450
|
+
},
|
|
3451
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3452
|
+
},
|
|
3453
|
+
meta: {
|
|
3454
|
+
adoptsFrom: friendsRef,
|
|
3455
|
+
lastModified: adapter.lastModifiedMap.get(`${vanGoghID}.json`),
|
|
3456
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3457
|
+
realmInfo: {
|
|
3458
|
+
backgroundURL: null,
|
|
3459
|
+
iconURL: null,
|
|
3460
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3461
|
+
lastPublishedAt: null,
|
|
3462
|
+
name: "Unnamed Workspace",
|
|
3463
|
+
publishable: null,
|
|
3464
|
+
realmUserId: "@realm_server:localhost",
|
|
3465
|
+
showAsCatalog: null,
|
|
3466
|
+
visibility: "public"
|
|
3467
|
+
},
|
|
3468
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/vanGogh.json")
|
|
3469
|
+
}
|
|
3470
|
+
}, "vanGogh doc.data is correct");
|
|
3471
|
+
assert.deepEqual(vanGogh.doc.included, [{
|
|
3472
|
+
id: rri(hassanID),
|
|
3473
|
+
type: "card",
|
|
3474
|
+
links: { self: "./hassan" },
|
|
3475
|
+
attributes: {
|
|
3476
|
+
firstName: "Hassan",
|
|
3477
|
+
cardTitle: "Hassan",
|
|
3478
|
+
cardDescription: null,
|
|
3479
|
+
cardThumbnailURL: null,
|
|
3480
|
+
cardInfo
|
|
3481
|
+
},
|
|
3482
|
+
relationships: {
|
|
3483
|
+
"friends.0": {
|
|
3484
|
+
links: { self: "./mango" },
|
|
3485
|
+
data: {
|
|
3486
|
+
type: "card",
|
|
3487
|
+
id: mangoID
|
|
3488
|
+
}
|
|
3489
|
+
},
|
|
3490
|
+
"friends.1": {
|
|
3491
|
+
links: { self: "./vanGogh" },
|
|
3492
|
+
data: {
|
|
3493
|
+
type: "card",
|
|
3494
|
+
id: vanGoghID
|
|
3495
|
+
}
|
|
3496
|
+
},
|
|
3497
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3498
|
+
},
|
|
3499
|
+
meta: {
|
|
3500
|
+
adoptsFrom: friendsRef,
|
|
3501
|
+
lastModified: adapter.lastModifiedMap.get(`${hassanID}.json`),
|
|
3502
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3503
|
+
realmInfo: {
|
|
3504
|
+
backgroundURL: null,
|
|
3505
|
+
iconURL: null,
|
|
3506
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3507
|
+
lastPublishedAt: null,
|
|
3508
|
+
name: "Unnamed Workspace",
|
|
3509
|
+
publishable: null,
|
|
3510
|
+
realmUserId: "@realm_server:localhost",
|
|
3511
|
+
showAsCatalog: null,
|
|
3512
|
+
visibility: "public"
|
|
3513
|
+
},
|
|
3514
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/hassan.json")
|
|
3515
|
+
}
|
|
3516
|
+
}, {
|
|
3517
|
+
id: rri(mangoID),
|
|
3518
|
+
type: "card",
|
|
3519
|
+
links: { self: "./mango" },
|
|
3520
|
+
attributes: {
|
|
3521
|
+
firstName: "Mango",
|
|
3522
|
+
cardTitle: "Mango",
|
|
3523
|
+
cardDescription: null,
|
|
3524
|
+
cardThumbnailURL: null,
|
|
3525
|
+
cardInfo
|
|
3526
|
+
},
|
|
3527
|
+
relationships: {
|
|
3528
|
+
"friends.0": {
|
|
3529
|
+
links: { self: "./hassan" },
|
|
3530
|
+
data: {
|
|
3531
|
+
type: "card",
|
|
3532
|
+
id: hassanID
|
|
3533
|
+
}
|
|
3534
|
+
},
|
|
3535
|
+
"cardInfo.theme": { links: { self: null } }
|
|
3536
|
+
},
|
|
3537
|
+
meta: {
|
|
3538
|
+
adoptsFrom: friendsRef,
|
|
3539
|
+
lastModified: adapter.lastModifiedMap.get(`${mangoID}.json`),
|
|
3540
|
+
realmURL: ri("http://test-realm/test/"),
|
|
3541
|
+
realmInfo: {
|
|
3542
|
+
backgroundURL: null,
|
|
3543
|
+
iconURL: null,
|
|
3544
|
+
includePrerenderedDefaultRealmIndex: null,
|
|
3545
|
+
lastPublishedAt: null,
|
|
3546
|
+
name: "Unnamed Workspace",
|
|
3547
|
+
publishable: null,
|
|
3548
|
+
realmUserId: "@realm_server:localhost",
|
|
3549
|
+
showAsCatalog: null,
|
|
3550
|
+
visibility: "public"
|
|
3551
|
+
},
|
|
3552
|
+
resourceCreatedAt: await getFileCreatedAt(realm, "Friends/mango.json")
|
|
3553
|
+
}
|
|
3554
|
+
}], "vanGogh doc.included is correct");
|
|
3555
|
+
} else assert.ok(false, `search entry was an error: ${vanGogh?.error.errorDetail.message}`);
|
|
3556
|
+
let vanGoghEntry = await getInstance(realm, new URL(vanGoghID));
|
|
3557
|
+
if (vanGoghEntry) assert.deepEqual(vanGoghEntry.searchDoc, {
|
|
3558
|
+
_cardType: "Friends",
|
|
3559
|
+
id: vanGoghID,
|
|
3560
|
+
firstName: "Van Gogh",
|
|
3561
|
+
cardTitle: "Van Gogh",
|
|
3562
|
+
friends: [{
|
|
3563
|
+
id: hassanID,
|
|
3564
|
+
firstName: "Hassan",
|
|
3565
|
+
cardTitle: "Hassan",
|
|
3566
|
+
friends: [{
|
|
3567
|
+
cardInfo: {
|
|
3568
|
+
cardThumbnail: null,
|
|
3569
|
+
theme: null
|
|
3570
|
+
},
|
|
3571
|
+
firstName: "Mango",
|
|
3572
|
+
friends: [{ id: hassanID }],
|
|
3573
|
+
id: mangoID,
|
|
3574
|
+
cardTitle: "Mango"
|
|
3575
|
+
}, { id: vanGoghID }],
|
|
3576
|
+
cardInfo: {
|
|
3577
|
+
cardThumbnail: null,
|
|
3578
|
+
theme: null
|
|
3579
|
+
}
|
|
3580
|
+
}],
|
|
3581
|
+
cardInfo: { theme: null }
|
|
3582
|
+
}, "vanGogh searchData is correct");
|
|
3583
|
+
else assert.ok(false, `could not find ${vanGoghID} in the index`);
|
|
3584
|
+
});
|
|
3585
|
+
(0, import_qunit.test)("indexing identifies an instance's card references", async function(assert) {
|
|
3586
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
3587
|
+
mockMatrixUtils,
|
|
3588
|
+
contents: { "person-1.json": { data: {
|
|
3589
|
+
attributes: { firstName: "Mango" },
|
|
3590
|
+
meta: { adoptsFrom: {
|
|
3591
|
+
module: `${testModuleRealm}person`,
|
|
3592
|
+
name: "Person"
|
|
3593
|
+
} }
|
|
3594
|
+
} } }
|
|
3595
|
+
});
|
|
3596
|
+
let refs = (await getInstance(realm, new URL(`${testRealmURL}person-1`)))?.deps;
|
|
3597
|
+
assert.deepEqual(refs.sort().filter((ref) => !ref.includes("glimmer-scoped.css")), [
|
|
3598
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/align-box-left-middle",
|
|
3599
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/align-left",
|
|
3600
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/arrow-left",
|
|
3601
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/bell",
|
|
3602
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/captions",
|
|
3603
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/clipboard-copy",
|
|
3604
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/code",
|
|
3605
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/eye",
|
|
3606
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/file",
|
|
3607
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/file-pencil",
|
|
3608
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/folder-pen",
|
|
3609
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/hash",
|
|
3610
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/image",
|
|
3611
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/import",
|
|
3612
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/letter-case",
|
|
3613
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/link",
|
|
3614
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/link-off",
|
|
3615
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/notepad-text",
|
|
3616
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/palette",
|
|
3617
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/rectangle-ellipsis",
|
|
3618
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/trash-2",
|
|
3619
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/wand",
|
|
3620
|
+
"https://cardstack.com/base/-private",
|
|
3621
|
+
"https://cardstack.com/base/card-api",
|
|
3622
|
+
"https://cardstack.com/base/card-serialization",
|
|
3623
|
+
"https://cardstack.com/base/contains-many-component",
|
|
3624
|
+
"https://cardstack.com/base/default-templates/atom",
|
|
3625
|
+
"https://cardstack.com/base/default-templates/broken-link-template",
|
|
3626
|
+
"https://cardstack.com/base/default-templates/card-info",
|
|
3627
|
+
"https://cardstack.com/base/default-templates/embedded",
|
|
3628
|
+
"https://cardstack.com/base/default-templates/field-edit",
|
|
3629
|
+
"https://cardstack.com/base/default-templates/file-def-edit",
|
|
3630
|
+
"https://cardstack.com/base/default-templates/fitted",
|
|
3631
|
+
"https://cardstack.com/base/default-templates/head",
|
|
3632
|
+
"https://cardstack.com/base/default-templates/image-def-atom",
|
|
3633
|
+
"https://cardstack.com/base/default-templates/image-def-embedded",
|
|
3634
|
+
"https://cardstack.com/base/default-templates/image-def-fitted",
|
|
3635
|
+
"https://cardstack.com/base/default-templates/image-def-isolated",
|
|
3636
|
+
"https://cardstack.com/base/default-templates/isolated-and-edit",
|
|
3637
|
+
"https://cardstack.com/base/default-templates/markdown",
|
|
3638
|
+
"https://cardstack.com/base/default-templates/markdown-fallback",
|
|
3639
|
+
"https://cardstack.com/base/default-templates/missing-template",
|
|
3640
|
+
"https://cardstack.com/base/field-component",
|
|
3641
|
+
"https://cardstack.com/base/field-support",
|
|
3642
|
+
"https://cardstack.com/base/file-menu-items",
|
|
3643
|
+
"https://cardstack.com/base/helpers/sanitized-html",
|
|
3644
|
+
"https://cardstack.com/base/helpers/set-background-image",
|
|
3645
|
+
"https://cardstack.com/base/links-to-editor",
|
|
3646
|
+
"https://cardstack.com/base/links-to-many-component",
|
|
3647
|
+
"https://cardstack.com/base/markdown-helpers",
|
|
3648
|
+
"https://cardstack.com/base/menu-items",
|
|
3649
|
+
"https://cardstack.com/base/number",
|
|
3650
|
+
"https://cardstack.com/base/number/components/badge-counter",
|
|
3651
|
+
"https://cardstack.com/base/number/components/badge-metric",
|
|
3652
|
+
"https://cardstack.com/base/number/components/badge-notification",
|
|
3653
|
+
"https://cardstack.com/base/number/components/gauge",
|
|
3654
|
+
"https://cardstack.com/base/number/components/progress-bar",
|
|
3655
|
+
"https://cardstack.com/base/number/components/progress-circle",
|
|
3656
|
+
"https://cardstack.com/base/number/components/score",
|
|
3657
|
+
"https://cardstack.com/base/number/components/stat",
|
|
3658
|
+
"https://cardstack.com/base/number/util/index",
|
|
3659
|
+
"https://cardstack.com/base/query-field-support",
|
|
3660
|
+
"https://cardstack.com/base/shared-state",
|
|
3661
|
+
"https://cardstack.com/base/string",
|
|
3662
|
+
"https://cardstack.com/base/text-input-validator",
|
|
3663
|
+
"https://cardstack.com/base/watched-array",
|
|
3664
|
+
"https://localhost:4202/test/person",
|
|
3665
|
+
"https://packages/@cardstack/boxel-host/commands/copy-and-edit",
|
|
3666
|
+
"https://packages/@cardstack/boxel-host/commands/copy-card",
|
|
3667
|
+
"https://packages/@cardstack/boxel-host/commands/copy-card-as-markdown",
|
|
3668
|
+
"https://packages/@cardstack/boxel-host/commands/copy-file-to-realm",
|
|
3669
|
+
"https://packages/@cardstack/boxel-host/commands/create-ai-assistant-room",
|
|
3670
|
+
"https://packages/@cardstack/boxel-host/commands/generate-example-cards",
|
|
3671
|
+
"https://packages/@cardstack/boxel-host/commands/open-create-listing-modal",
|
|
3672
|
+
"https://packages/@cardstack/boxel-host/commands/open-in-interact-mode",
|
|
3673
|
+
"https://packages/@cardstack/boxel-host/commands/patch-theme",
|
|
3674
|
+
"https://packages/@cardstack/boxel-host/commands/populate-with-sample-data",
|
|
3675
|
+
"https://packages/@cardstack/boxel-host/commands/send-ai-assistant-message",
|
|
3676
|
+
"https://packages/@cardstack/boxel-host/commands/show-card",
|
|
3677
|
+
"https://packages/@cardstack/boxel-host/commands/show-file",
|
|
3678
|
+
"https://packages/@cardstack/boxel-host/commands/switch-submode",
|
|
3679
|
+
"https://packages/@cardstack/boxel-ui/components",
|
|
3680
|
+
"https://packages/@cardstack/boxel-ui/helpers",
|
|
3681
|
+
"https://packages/@cardstack/boxel-ui/icons",
|
|
3682
|
+
"https://packages/@cardstack/boxel-ui/modifiers",
|
|
3683
|
+
"https://packages/@cardstack/runtime-common",
|
|
3684
|
+
"https://packages/@cardstack/runtime-common/marked-sync",
|
|
3685
|
+
"https://packages/@ember/component",
|
|
3686
|
+
"https://packages/@ember/component/template-only",
|
|
3687
|
+
"https://packages/@ember/helper",
|
|
3688
|
+
"https://packages/@ember/modifier",
|
|
3689
|
+
"https://packages/@ember/object",
|
|
3690
|
+
"https://packages/@ember/object/internals",
|
|
3691
|
+
"https://packages/@ember/runloop",
|
|
3692
|
+
"https://packages/@ember/template",
|
|
3693
|
+
"https://packages/@ember/template-factory",
|
|
3694
|
+
"https://packages/@glimmer/component",
|
|
3695
|
+
"https://packages/@glimmer/tracking",
|
|
3696
|
+
"https://packages/ember-concurrency",
|
|
3697
|
+
"https://packages/ember-concurrency/-private/async-arrow-runtime",
|
|
3698
|
+
"https://packages/ember-css-url",
|
|
3699
|
+
"https://packages/ember-modifier",
|
|
3700
|
+
"https://packages/ember-provide-consume-context",
|
|
3701
|
+
"https://packages/lodash",
|
|
3702
|
+
"https://packages/super-fast-md5",
|
|
3703
|
+
"https://packages/tracked-built-ins"
|
|
3704
|
+
], "the card references for the instance are correct");
|
|
3705
|
+
});
|
|
3706
|
+
(0, import_qunit.test)("indexing identifies an instance's polymorphic contained references", async function(assert) {
|
|
3707
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
3708
|
+
mockMatrixUtils,
|
|
3709
|
+
contents: { "spec-1.json": { data: {
|
|
3710
|
+
attributes: {
|
|
3711
|
+
cardTitle: "My Spec",
|
|
3712
|
+
containedExamples: [{
|
|
3713
|
+
firstName: "A",
|
|
3714
|
+
lastName: "B"
|
|
3715
|
+
}]
|
|
3716
|
+
},
|
|
3717
|
+
meta: {
|
|
3718
|
+
adoptsFrom: {
|
|
3719
|
+
module: `${baseRealm.url}spec`,
|
|
3720
|
+
name: "Spec"
|
|
3721
|
+
},
|
|
3722
|
+
fields: { containedExamples: [{ adoptsFrom: {
|
|
3723
|
+
module: `${testModuleRealm}person`,
|
|
3724
|
+
name: "PersonField"
|
|
3725
|
+
} }] }
|
|
3726
|
+
}
|
|
3727
|
+
} } }
|
|
3728
|
+
});
|
|
3729
|
+
let refs = (await getInstance(realm, new URL(`${realm.url}spec-1`)))?.deps;
|
|
3730
|
+
assert.deepEqual(refs.sort().filter((ref) => !ref.includes("glimmer-scoped.css")), [
|
|
3731
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/align-box-left-middle",
|
|
3732
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/align-left",
|
|
3733
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/apps",
|
|
3734
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/arrow-left",
|
|
3735
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/bell",
|
|
3736
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/book-open-text",
|
|
3737
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/box-model",
|
|
3738
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/captions",
|
|
3739
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/clipboard-copy",
|
|
3740
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/code",
|
|
3741
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/eye",
|
|
3742
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/file",
|
|
3743
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/file-pencil",
|
|
3744
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/folder-pen",
|
|
3745
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/git-branch",
|
|
3746
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/hash",
|
|
3747
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/image",
|
|
3748
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/import",
|
|
3749
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/layers-subtract",
|
|
3750
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/layout-list",
|
|
3751
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/letter-case",
|
|
3752
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/link",
|
|
3753
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/link-off",
|
|
3754
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/notepad-text",
|
|
3755
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/palette",
|
|
3756
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/rectangle-ellipsis",
|
|
3757
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/stack",
|
|
3758
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/toggle-left",
|
|
3759
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/trash-2",
|
|
3760
|
+
"http://localhost:4206/@cardstack/boxel-icons/v1/icons/wand",
|
|
3761
|
+
"https://cardstack.com/base/-private",
|
|
3762
|
+
"https://cardstack.com/base/boolean",
|
|
3763
|
+
"https://cardstack.com/base/card-api",
|
|
3764
|
+
"https://cardstack.com/base/card-serialization",
|
|
3765
|
+
"https://cardstack.com/base/code-ref",
|
|
3766
|
+
"https://cardstack.com/base/contains-many-component",
|
|
3767
|
+
"https://cardstack.com/base/default-templates/atom",
|
|
3768
|
+
"https://cardstack.com/base/default-templates/broken-link-template",
|
|
3769
|
+
"https://cardstack.com/base/default-templates/card-info",
|
|
3770
|
+
"https://cardstack.com/base/default-templates/embedded",
|
|
3771
|
+
"https://cardstack.com/base/default-templates/field-edit",
|
|
3772
|
+
"https://cardstack.com/base/default-templates/file-def-edit",
|
|
3773
|
+
"https://cardstack.com/base/default-templates/fitted",
|
|
3774
|
+
"https://cardstack.com/base/default-templates/head",
|
|
3775
|
+
"https://cardstack.com/base/default-templates/image-def-atom",
|
|
3776
|
+
"https://cardstack.com/base/default-templates/image-def-embedded",
|
|
3777
|
+
"https://cardstack.com/base/default-templates/image-def-fitted",
|
|
3778
|
+
"https://cardstack.com/base/default-templates/image-def-isolated",
|
|
3779
|
+
"https://cardstack.com/base/default-templates/isolated-and-edit",
|
|
3780
|
+
"https://cardstack.com/base/default-templates/markdown",
|
|
3781
|
+
"https://cardstack.com/base/default-templates/markdown-fallback",
|
|
3782
|
+
"https://cardstack.com/base/default-templates/missing-template",
|
|
3783
|
+
"https://cardstack.com/base/field-component",
|
|
3784
|
+
"https://cardstack.com/base/field-support",
|
|
3785
|
+
"https://cardstack.com/base/file-menu-items",
|
|
3786
|
+
"https://cardstack.com/base/helpers/sanitized-html",
|
|
3787
|
+
"https://cardstack.com/base/helpers/set-background-image",
|
|
3788
|
+
"https://cardstack.com/base/links-to-editor",
|
|
3789
|
+
"https://cardstack.com/base/links-to-many-component",
|
|
3790
|
+
"https://cardstack.com/base/markdown",
|
|
3791
|
+
"https://cardstack.com/base/markdown-helpers",
|
|
3792
|
+
"https://cardstack.com/base/menu-items",
|
|
3793
|
+
"https://cardstack.com/base/number",
|
|
3794
|
+
"https://cardstack.com/base/number/components/badge-counter",
|
|
3795
|
+
"https://cardstack.com/base/number/components/badge-metric",
|
|
3796
|
+
"https://cardstack.com/base/number/components/badge-notification",
|
|
3797
|
+
"https://cardstack.com/base/number/components/gauge",
|
|
3798
|
+
"https://cardstack.com/base/number/components/progress-bar",
|
|
3799
|
+
"https://cardstack.com/base/number/components/progress-circle",
|
|
3800
|
+
"https://cardstack.com/base/number/components/score",
|
|
3801
|
+
"https://cardstack.com/base/number/components/stat",
|
|
3802
|
+
"https://cardstack.com/base/number/util/index",
|
|
3803
|
+
"https://cardstack.com/base/query-field-support",
|
|
3804
|
+
"https://cardstack.com/base/shared-state",
|
|
3805
|
+
"https://cardstack.com/base/spec",
|
|
3806
|
+
"https://cardstack.com/base/string",
|
|
3807
|
+
"https://cardstack.com/base/text-input-validator",
|
|
3808
|
+
"https://cardstack.com/base/watched-array",
|
|
3809
|
+
"https://localhost:4202/test/person",
|
|
3810
|
+
"https://packages/@cardstack/boxel-host/commands/copy-and-edit",
|
|
3811
|
+
"https://packages/@cardstack/boxel-host/commands/copy-card",
|
|
3812
|
+
"https://packages/@cardstack/boxel-host/commands/copy-card-as-markdown",
|
|
3813
|
+
"https://packages/@cardstack/boxel-host/commands/copy-file-to-realm",
|
|
3814
|
+
"https://packages/@cardstack/boxel-host/commands/create-ai-assistant-room",
|
|
3815
|
+
"https://packages/@cardstack/boxel-host/commands/generate-example-cards",
|
|
3816
|
+
"https://packages/@cardstack/boxel-host/commands/generate-readme-spec",
|
|
3817
|
+
"https://packages/@cardstack/boxel-host/commands/open-create-listing-modal",
|
|
3818
|
+
"https://packages/@cardstack/boxel-host/commands/open-in-interact-mode",
|
|
3819
|
+
"https://packages/@cardstack/boxel-host/commands/patch-theme",
|
|
3820
|
+
"https://packages/@cardstack/boxel-host/commands/populate-with-sample-data",
|
|
3821
|
+
"https://packages/@cardstack/boxel-host/commands/send-ai-assistant-message",
|
|
3822
|
+
"https://packages/@cardstack/boxel-host/commands/show-card",
|
|
3823
|
+
"https://packages/@cardstack/boxel-host/commands/show-file",
|
|
3824
|
+
"https://packages/@cardstack/boxel-host/commands/switch-submode",
|
|
3825
|
+
"https://packages/@cardstack/boxel-ui/components",
|
|
3826
|
+
"https://packages/@cardstack/boxel-ui/helpers",
|
|
3827
|
+
"https://packages/@cardstack/boxel-ui/icons",
|
|
3828
|
+
"https://packages/@cardstack/boxel-ui/modifiers",
|
|
3829
|
+
"https://packages/@cardstack/runtime-common",
|
|
3830
|
+
"https://packages/@cardstack/runtime-common/marked-sync",
|
|
3831
|
+
"https://packages/@ember/component",
|
|
3832
|
+
"https://packages/@ember/component/template-only",
|
|
3833
|
+
"https://packages/@ember/helper",
|
|
3834
|
+
"https://packages/@ember/modifier",
|
|
3835
|
+
"https://packages/@ember/object",
|
|
3836
|
+
"https://packages/@ember/object/internals",
|
|
3837
|
+
"https://packages/@ember/runloop",
|
|
3838
|
+
"https://packages/@ember/template",
|
|
3839
|
+
"https://packages/@ember/template-factory",
|
|
3840
|
+
"https://packages/@glimmer/component",
|
|
3841
|
+
"https://packages/@glimmer/tracking",
|
|
3842
|
+
"https://packages/ember-concurrency",
|
|
3843
|
+
"https://packages/ember-concurrency/-private/async-arrow-runtime",
|
|
3844
|
+
"https://packages/ember-css-url",
|
|
3845
|
+
"https://packages/ember-modifier",
|
|
3846
|
+
"https://packages/ember-provide-consume-context",
|
|
3847
|
+
"https://packages/ember-resources",
|
|
3848
|
+
"https://packages/lodash",
|
|
3849
|
+
"https://packages/super-fast-md5",
|
|
3850
|
+
"https://packages/tracked-built-ins"
|
|
3851
|
+
], "the card references for the instance are correct");
|
|
3852
|
+
});
|
|
3853
|
+
(0, import_qunit.test)("search index does not contain entries that match patterns in ignore files", async function(assert) {
|
|
3854
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
3855
|
+
mockMatrixUtils,
|
|
3856
|
+
contents: {
|
|
3857
|
+
"ignore-me-1.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
3858
|
+
"posts/nested.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
3859
|
+
"posts/please-ignore-me.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
3860
|
+
"posts/ignore-me-2.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
3861
|
+
".git/should-not-index.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
3862
|
+
"post.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
3863
|
+
"dir/card.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
3864
|
+
".gitignore": `
|
|
3865
|
+
ignore-me*.json
|
|
3866
|
+
dir/
|
|
3867
|
+
posts/please-ignore-me.json
|
|
3868
|
+
`
|
|
3869
|
+
}
|
|
3870
|
+
});
|
|
3871
|
+
let indexer = realm.realmIndexQueryEngine;
|
|
3872
|
+
{
|
|
3873
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}posts/please-ignore-me`));
|
|
3874
|
+
assert.deepEqual(card, void 0, "instance does not exist because file is ignored");
|
|
3875
|
+
}
|
|
3876
|
+
{
|
|
3877
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}dir/card`));
|
|
3878
|
+
assert.deepEqual(card, void 0, "instance does not exist because file is ignored");
|
|
3879
|
+
}
|
|
3880
|
+
{
|
|
3881
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}ignore-me-1`));
|
|
3882
|
+
assert.deepEqual(card, void 0, "instance does not exist because file is ignored");
|
|
3883
|
+
}
|
|
3884
|
+
{
|
|
3885
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}posts/ignore-me-2`));
|
|
3886
|
+
assert.deepEqual(card, void 0, "instance does not exist because file is ignored");
|
|
3887
|
+
}
|
|
3888
|
+
{
|
|
3889
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}.git/should-not-index`));
|
|
3890
|
+
assert.strictEqual(card, void 0, ".git directory entries are ignored");
|
|
3891
|
+
}
|
|
3892
|
+
{
|
|
3893
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}post`));
|
|
3894
|
+
assert.ok(card, "instance exists");
|
|
3895
|
+
}
|
|
3896
|
+
{
|
|
3897
|
+
let card = await indexer.cardDocument(new URL(`${testRealmURL}posts/nested`));
|
|
3898
|
+
assert.ok(card, "instance exists");
|
|
3899
|
+
}
|
|
3900
|
+
});
|
|
3901
|
+
(0, import_qunit.test)("incremental indexing doesn't process ignored files", async function(assert) {
|
|
3902
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
3903
|
+
mockMatrixUtils,
|
|
3904
|
+
contents: {
|
|
3905
|
+
"posts/ignore-me.json": { data: { meta: { adoptsFrom: baseCardRef } } },
|
|
3906
|
+
".gitignore": `
|
|
3907
|
+
posts/ignore-me.json
|
|
3908
|
+
`
|
|
3909
|
+
}
|
|
3910
|
+
});
|
|
3911
|
+
let realmIndexUpdater = realm.realmIndexUpdater;
|
|
3912
|
+
let queryEngine = realm.realmIndexQueryEngine;
|
|
3913
|
+
await realmIndexUpdater.update([new URL(`${testRealmURL}posts/ignore-me.json`)]);
|
|
3914
|
+
let instance = await queryEngine.cardDocument(new URL(`${testRealmURL}posts/ignore-me`));
|
|
3915
|
+
assert.strictEqual(instance, void 0, "instance does not exist because file is ignored");
|
|
3916
|
+
assert.strictEqual(realmIndexUpdater.stats.instancesIndexed, 0, "no instances were processed");
|
|
3917
|
+
});
|
|
3918
|
+
(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) {
|
|
3919
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
3920
|
+
mockMatrixUtils,
|
|
3921
|
+
contents: {
|
|
3922
|
+
"index.json": { data: {
|
|
3923
|
+
type: "card",
|
|
3924
|
+
attributes: {},
|
|
3925
|
+
meta: { adoptsFrom: {
|
|
3926
|
+
module: "https://cardstack.com/base/cards-grid",
|
|
3927
|
+
name: "CardsGrid"
|
|
3928
|
+
} }
|
|
3929
|
+
} },
|
|
3930
|
+
"realm.json": { data: {
|
|
3931
|
+
type: "card",
|
|
3932
|
+
attributes: {},
|
|
3933
|
+
meta: { adoptsFrom: {
|
|
3934
|
+
module: "https://cardstack.com/base/realm-config",
|
|
3935
|
+
name: "RealmConfig"
|
|
3936
|
+
} }
|
|
3937
|
+
} }
|
|
3938
|
+
}
|
|
3939
|
+
});
|
|
3940
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}index`));
|
|
3941
|
+
assert.ok(entry, "realm index card is indexed");
|
|
3942
|
+
assert.strictEqual(entry?.isolatedHtml, REALM_INDEX_BOILERPLATE_HTML, "isolated_html is the boilerplate constant when the realm has not opted in");
|
|
3943
|
+
let embeddedHtml = entry?.embeddedHtml ?? {};
|
|
3944
|
+
assert.ok(Object.keys(embeddedHtml).length > 0, "embedded HTML map is populated");
|
|
3945
|
+
assert.ok(Object.values(embeddedHtml).every((html) => html.length > 0), "every embedded HTML entry has real content");
|
|
3946
|
+
let fittedHtml = entry?.fittedHtml ?? {};
|
|
3947
|
+
assert.ok(Object.keys(fittedHtml).length > 0, "fitted HTML map is populated");
|
|
3948
|
+
assert.ok(Object.values(fittedHtml).every((html) => html.length > 0), "every fitted HTML entry has real content");
|
|
3949
|
+
});
|
|
3950
|
+
(0, import_qunit.test)("isolated HTML for the default CardsGrid realm-index card is rendered normally when realm has opted in", async function(assert) {
|
|
3951
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
3952
|
+
mockMatrixUtils,
|
|
3953
|
+
contents: {
|
|
3954
|
+
"index.json": { data: {
|
|
3955
|
+
type: "card",
|
|
3956
|
+
attributes: {},
|
|
3957
|
+
meta: { adoptsFrom: {
|
|
3958
|
+
module: "https://cardstack.com/base/cards-grid",
|
|
3959
|
+
name: "CardsGrid"
|
|
3960
|
+
} }
|
|
3961
|
+
} },
|
|
3962
|
+
"realm.json": { data: {
|
|
3963
|
+
type: "card",
|
|
3964
|
+
attributes: { includePrerenderedDefaultRealmIndex: true },
|
|
3965
|
+
meta: { adoptsFrom: {
|
|
3966
|
+
module: "https://cardstack.com/base/realm-config",
|
|
3967
|
+
name: "RealmConfig"
|
|
3968
|
+
} }
|
|
3969
|
+
} }
|
|
3970
|
+
}
|
|
3971
|
+
});
|
|
3972
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}index`));
|
|
3973
|
+
assert.ok(entry, "realm index card is indexed");
|
|
3974
|
+
assert.notStrictEqual(entry?.isolatedHtml, REALM_INDEX_BOILERPLATE_HTML, "isolated_html is not the boilerplate when the realm has opted in");
|
|
3975
|
+
assert.ok(entry?.isolatedHtml, "isolated_html is set");
|
|
3976
|
+
assert.ok((entry?.isolatedHtml ?? "").length > 0, "isolated_html has real content");
|
|
3977
|
+
});
|
|
3978
|
+
(0, import_qunit.test)("isolated HTML for a non-CardsGrid index card is rendered normally regardless of opt-in", async function(assert) {
|
|
3979
|
+
class PlainHomePage extends CardDef {
|
|
3980
|
+
static displayName = "Plain Home Page";
|
|
3981
|
+
static {
|
|
3982
|
+
decorateFieldV2(this.prototype, "title", [field], function() {
|
|
3983
|
+
return contains(StringField);
|
|
3984
|
+
});
|
|
3985
|
+
}
|
|
3986
|
+
#title = (initializeDeferredDecorator(this, "title"), void 0);
|
|
3987
|
+
static isolated = class Isolated extends Component$1 {
|
|
3988
|
+
static {
|
|
3989
|
+
setComponentTemplate(templateFactory({
|
|
3990
|
+
"id": "WwNp1MCh",
|
|
3991
|
+
"block": "[[[10,\"h1\"],[14,\"data-test-plain-home\",\"\"],[12],[8,[30,1,[\"title\"]],null,null,null],[13]],[\"@fields\"],[]]",
|
|
3992
|
+
"moduleName": "/home/runner/work/boxel/boxel/packages/host/tests/integration/realm-indexing-test.gts",
|
|
3993
|
+
"isStrictMode": true
|
|
3994
|
+
}), this);
|
|
3995
|
+
}
|
|
3996
|
+
};
|
|
3997
|
+
}
|
|
3998
|
+
let { realm } = await setupIntegrationTestRealm({
|
|
3999
|
+
mockMatrixUtils,
|
|
4000
|
+
contents: {
|
|
4001
|
+
"home.gts": { PlainHomePage },
|
|
4002
|
+
"index.json": { data: {
|
|
4003
|
+
type: "card",
|
|
4004
|
+
attributes: { title: "Welcome" },
|
|
4005
|
+
meta: { adoptsFrom: {
|
|
4006
|
+
module: `${testRealmURL}home`,
|
|
4007
|
+
name: "PlainHomePage"
|
|
4008
|
+
} }
|
|
4009
|
+
} }
|
|
4010
|
+
}
|
|
4011
|
+
});
|
|
4012
|
+
let entry = await getInstance(realm, new URL(`${testRealmURL}index`));
|
|
4013
|
+
assert.ok(entry, "realm index card is indexed");
|
|
4014
|
+
assert.notStrictEqual(entry?.isolatedHtml, REALM_INDEX_BOILERPLATE_HTML, "isolated_html is not the boilerplate when the index is a non-CardsGrid card");
|
|
4015
|
+
assertInnerHtmlMatches(assert, entry?.isolatedHtml, `<h1 data-test-plain-home> Welcome </h1>`);
|
|
4016
|
+
});
|
|
4017
|
+
});
|
|
4018
|
+
//#endregion
|