[{"data":1,"prerenderedAt":5445},["ShallowReactive",2],{"navigation_docs_en":3,"-en-reference-extensions-extension-kit-data-connector":445,"-en-reference-extensions-extension-kit-data-connector-surround":5440},[4,30,72,132,260,436],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fen\u002Fgetting-started","en\u002F1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fen\u002Fgetting-started\u002Fintroduction","en\u002F1.getting-started\u002F2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Quickstart","\u002Fen\u002Fgetting-started\u002Finstallation","en\u002F1.getting-started\u002F3.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Use Cases","\u002Fen\u002Fgetting-started\u002Fuse-cases","en\u002F1.getting-started\u002F4.use-cases","i-lucide-layers",{"title":26,"path":27,"stem":28,"icon":29},"Concepts","\u002Fen\u002Fgetting-started\u002Fconcepts","en\u002F1.getting-started\u002F5.concepts","i-lucide-book",{"title":26,"path":31,"stem":32,"children":33,"page":6},"\u002Fen\u002Fconcepts","en\u002F2.concepts",[34,38,43,48,53,58,63,68],{"title":35,"path":36,"stem":37,"icon":14},"Organization","\u002Fen\u002Fconcepts\u002Forganization","en\u002F2.concepts\u002F1.organization",{"title":39,"path":40,"stem":41,"icon":42},"Data Model","\u002Fen\u002Fconcepts\u002Fdata-model","en\u002F2.concepts\u002F2.data-model","i-lucide-database",{"title":44,"path":45,"stem":46,"icon":47},"Access Control","\u002Fen\u002Fconcepts\u002Faccess-permissions","en\u002F2.concepts\u002F3.access-permissions","i-lucide-user-key",{"title":49,"path":50,"stem":51,"icon":52},"Audit Logs","\u002Fen\u002Fconcepts\u002Faudit-logs","en\u002F2.concepts\u002F4.audit-logs","i-lucide-scroll-text",{"title":54,"path":55,"stem":56,"icon":57},"Introspection","\u002Fen\u002Fconcepts\u002Fintrospection","en\u002F2.concepts\u002F6.introspection","i-lucide-database-search",{"title":59,"path":60,"stem":61,"icon":62},"Query Engine","\u002Fen\u002Fconcepts\u002Fquery-engine","en\u002F2.concepts\u002F7.query-engine","i-lucide-workflow",{"title":64,"path":65,"stem":66,"icon":67},"AI","\u002Fen\u002Fconcepts\u002Fai","en\u002F2.concepts\u002F8.ai","i-lucide-sparkles",{"title":69,"path":70,"stem":71,"icon":42},"Caching","\u002Fen\u002Fconcepts\u002Fcaching","en\u002F2.concepts\u002F9.caching",{"title":73,"path":74,"stem":75,"children":76,"page":6},"Guides","\u002Fen\u002Fguides","en\u002F4.guides",[77,82,87,92,97,102,107,112],{"title":78,"path":79,"stem":80,"icon":81},"REST API Quickstart","\u002Fen\u002Fguides\u002Frest-api","en\u002F4.guides\u002F1.rest-api","i-lucide-plug",{"title":83,"path":84,"stem":85,"icon":86},"SDK Quickstart","\u002Fen\u002Fguides\u002Fsdk","en\u002F4.guides\u002F2.sdk","i-lucide-terminal",{"title":88,"path":89,"stem":90,"icon":91},"Configure SSO","\u002Fen\u002Fguides\u002Fconfigure-sso","en\u002F4.guides\u002F3.configure-sso","i-lucide-key-round",{"title":93,"path":94,"stem":95,"icon":96},"Configure MCP","\u002Fen\u002Fguides\u002Fmcp","en\u002F4.guides\u002F4.mcp","i-lucide-brain-cog",{"title":98,"path":99,"stem":100,"icon":101},"Customize Content Space","\u002Fen\u002Fguides\u002Fcustomize-content-space","en\u002F4.guides\u002F5.customize-content-space","i-lucide-columns-3-cog",{"title":103,"path":104,"stem":105,"icon":106},"Build an Application with AI Assistance","\u002Fen\u002Fguides\u002Fbuild-an-application","en\u002F4.guides\u002F6.build-an-application","i-lucide-route",{"title":108,"path":109,"stem":110,"icon":111},"Horizontal Scaling","\u002Fen\u002Fguides\u002Fhorizontal-scaling","en\u002F4.guides\u002F7.horizontal-scaling","i-lucide-network",{"title":113,"icon":114,"path":115,"stem":116,"children":117,"page":6},"Data Connectors","i-lucide-cable","\u002Fen\u002Fguides\u002Fdata-connectors","en\u002F4.guides\u002F8.data-connectors",[118,122,127],{"title":16,"path":119,"stem":120,"icon":121},"\u002Fen\u002Fguides\u002Fdata-connectors\u002Fquickstart","en\u002F4.guides\u002F8.data-connectors\u002F1.quickstart","i-lucide-rocket",{"title":123,"path":124,"stem":125,"icon":126},"Build a Stripe Connector","\u002Fen\u002Fguides\u002Fdata-connectors\u002Fstripe","en\u002F4.guides\u002F8.data-connectors\u002F2.stripe","i-lucide-hammer",{"title":128,"path":129,"stem":130,"icon":131},"Build with AI Agents","\u002Fen\u002Fguides\u002Fdata-connectors\u002Fai-agents","en\u002F4.guides\u002F8.data-connectors\u002F3.ai-agents","i-lucide-bot",{"title":133,"path":134,"stem":135,"children":136,"page":6},"Developer","\u002Fen\u002Fdeveloper","en\u002F5.developer",[137,191,215,220],{"title":138,"path":139,"stem":140,"children":141,"page":6},"Data Access","\u002Fen\u002Fdeveloper\u002Fapi","en\u002F5.developer\u002F1.api",[142,147,152,157,162,167,172,177,182,186],{"title":143,"path":144,"stem":145,"icon":146},"Overview","\u002Fen\u002Fdeveloper\u002Fapi\u002Foverview","en\u002F5.developer\u002F1.api\u002F1.overview","i-lucide-globe",{"title":148,"path":149,"stem":150,"icon":151},"Errors","\u002Fen\u002Fdeveloper\u002Fapi\u002Ferrors","en\u002F5.developer\u002F1.api\u002F10.errors","i-lucide-alert-triangle",{"title":153,"path":154,"stem":155,"icon":156},"Authentication","\u002Fen\u002Fdeveloper\u002Fapi\u002Fauthentication","en\u002F5.developer\u002F1.api\u002F2.authentication","i-lucide-lock",{"title":158,"path":159,"stem":160,"icon":161},"Reading Data","\u002Fen\u002Fdeveloper\u002Fapi\u002Freading-data","en\u002F5.developer\u002F1.api\u002F3.reading-data","i-lucide-book-open",{"title":163,"path":164,"stem":165,"icon":166},"Writing Data","\u002Fen\u002Fdeveloper\u002Fapi\u002Fwriting-data","en\u002F5.developer\u002F1.api\u002F4.writing-data","i-lucide-pencil",{"title":168,"path":169,"stem":170,"icon":171},"Filtering","\u002Fen\u002Fdeveloper\u002Fapi\u002Ffiltering","en\u002F5.developer\u002F1.api\u002F5.filtering","i-lucide-filter",{"title":173,"path":174,"stem":175,"icon":176},"Field Selection","\u002Fen\u002Fdeveloper\u002Fapi\u002Ffield-selection","en\u002F5.developer\u002F1.api\u002F6.field-selection","i-lucide-list-checks",{"title":178,"path":179,"stem":180,"icon":181},"Sorting & Pagination","\u002Fen\u002Fdeveloper\u002Fapi\u002Fsorting-pagination","en\u002F5.developer\u002F1.api\u002F7.sorting-pagination","i-lucide-arrow-up-down",{"title":183,"path":184,"stem":185,"icon":111},"Relational Data","\u002Fen\u002Fdeveloper\u002Fapi\u002Frelational-data","en\u002F5.developer\u002F1.api\u002F8.relational-data",{"title":187,"path":188,"stem":189,"icon":190},"Files & Assets","\u002Fen\u002Fdeveloper\u002Fapi\u002Ffiles","en\u002F5.developer\u002F1.api\u002F9.files","i-lucide-file-up",{"title":192,"path":193,"stem":194,"children":195,"page":6},"Client SDK","\u002Fen\u002Fdeveloper\u002Fsdk","en\u002F5.developer\u002F2.sdk",[196,200,205,210],{"title":197,"path":198,"stem":199,"icon":19},"Installation","\u002Fen\u002Fdeveloper\u002Fsdk\u002Finstallation","en\u002F5.developer\u002F2.sdk\u002F1.installation",{"title":201,"path":202,"stem":203,"icon":204},"Client Setup","\u002Fen\u002Fdeveloper\u002Fsdk\u002Fclient-setup","en\u002F5.developer\u002F2.sdk\u002F2.client-setup","i-lucide-settings",{"title":206,"path":207,"stem":208,"icon":209},"Type System","\u002Fen\u002Fdeveloper\u002Fsdk\u002Ftype-system","en\u002F5.developer\u002F2.sdk\u002F3.type-system","i-lucide-braces",{"title":211,"path":212,"stem":213,"icon":214},"Advanced","\u002Fen\u002Fdeveloper\u002Fsdk\u002Fadvanced","en\u002F5.developer\u002F2.sdk\u002F5.advanced","i-lucide-puzzle",{"title":216,"path":217,"stem":218,"icon":219},"Application Users","\u002Fen\u002Fdeveloper\u002Fapplication-users","en\u002F5.developer\u002F3.application-users","i-lucide-users",{"title":221,"path":222,"stem":223,"children":224,"icon":214},"Extensions","\u002Fen\u002Fdeveloper\u002Fextensions","en\u002F5.developer\u002F3.extensions\u002Findex",[225,226,231],{"title":143,"path":222,"stem":223,"icon":214},{"title":227,"path":228,"stem":229,"icon":230},"Install and Manage Extensions","\u002Fen\u002Fdeveloper\u002Fextensions\u002Finstall","en\u002F5.developer\u002F3.extensions\u002F1.install","i-lucide-package-plus",{"title":113,"path":232,"stem":233,"children":234,"icon":114},"\u002Fen\u002Fdeveloper\u002Fextensions\u002Fdata-connectors","en\u002F5.developer\u002F3.extensions\u002F2.data-connectors\u002Findex",[235,236,241,245,250,255],{"title":143,"path":232,"stem":233,"icon":114},{"title":237,"path":238,"stem":239,"icon":240},"How Data Connectors Run","\u002Fen\u002Fdeveloper\u002Fextensions\u002Fdata-connectors\u002Fruntime","en\u002F5.developer\u002F3.extensions\u002F2.data-connectors\u002F2.runtime","i-lucide-cpu",{"title":242,"path":243,"stem":244,"icon":42},"Data Sources","\u002Fen\u002Fdeveloper\u002Fextensions\u002Fdata-connectors\u002Fdata-sources","en\u002F5.developer\u002F3.extensions\u002F2.data-connectors\u002F3.data-sources",{"title":246,"path":247,"stem":248,"icon":249},"Map an External Data Source","\u002Fen\u002Fdeveloper\u002Fextensions\u002Fdata-connectors\u002Fdata-source-mapping","en\u002F5.developer\u002F3.extensions\u002F2.data-connectors\u002F4.data-source-mapping","i-lucide-map",{"title":251,"path":252,"stem":253,"icon":254},"Handle Errors","\u002Fen\u002Fdeveloper\u002Fextensions\u002Fdata-connectors\u002Ferrors","en\u002F5.developer\u002F3.extensions\u002F2.data-connectors\u002F5.errors","i-lucide-shield-alert",{"title":256,"path":257,"stem":258,"icon":259},"Test a Data Connector","\u002Fen\u002Fdeveloper\u002Fextensions\u002Fdata-connectors\u002Ftesting","en\u002F5.developer\u002F3.extensions\u002F2.data-connectors\u002F6.testing","i-lucide-flask-conical",{"title":261,"path":262,"stem":263,"children":264,"page":6},"Reference","\u002Fen\u002Freference","en\u002F6.reference",[265,269,274,279,295,299,304,340,369,374],{"title":266,"path":267,"stem":268,"icon":204},"Configuration","\u002Fen\u002Freference\u002Fenvironment-variables","en\u002F6.reference\u002F1.environment-variables",{"title":270,"path":271,"stem":272,"icon":273},"System Requirements","\u002Fen\u002Freference\u002Fsystem-requirements","en\u002F6.reference\u002F2.system-requirements","i-lucide-server",{"title":275,"path":276,"stem":277,"icon":278},"Licensing","\u002Fen\u002Freference\u002Flicensing","en\u002F6.reference\u002F3.licensing","i-lucide-gem",{"title":280,"path":281,"stem":282,"children":283,"icon":81},"Connectors","\u002Fen\u002Freference\u002Fconnectors","en\u002F6.reference\u002F4.connectors\u002Findex",[284,285,290],{"title":280,"path":281,"stem":282,"icon":81},{"title":286,"path":287,"stem":288,"icon":289},"PostgreSQL and Supabase","\u002Fen\u002Freference\u002Fconnectors\u002Fpostgresql-supabase","en\u002F6.reference\u002F4.connectors\u002F1.postgresql-supabase","i-simple-icons-postgresql",{"title":291,"path":292,"stem":293,"icon":294},"MySQL and MariaDB","\u002Fen\u002Freference\u002Fconnectors\u002Fmysql-mariadb","en\u002F6.reference\u002F4.connectors\u002F2.mysql-mariadb","i-simple-icons-mysql",{"title":296,"path":297,"stem":298,"icon":209},"Data Types Representation","\u002Fen\u002Freference\u002Fdata-types","en\u002F6.reference\u002F5.data-types",{"title":300,"path":301,"stem":302,"icon":303},"Permissions Reference","\u002Fen\u002Freference\u002Fpermissions","en\u002F6.reference\u002F6.permissions","i-lucide-shield",{"title":305,"path":306,"stem":307,"children":308,"page":6},"API Reference","\u002Fen\u002Freference\u002Fapi-reference","en\u002F6.reference\u002F7.api-reference",[309,313,318],{"title":310,"path":311,"stem":312,"icon":273},"System Endpoints","\u002Fen\u002Freference\u002Fapi-reference\u002Fsystem-endpoints","en\u002F6.reference\u002F7.api-reference\u002F1.system-endpoints",{"title":314,"path":315,"stem":316,"icon":317},"OpenAPI Spec","\u002Fen\u002Freference\u002Fapi-reference\u002Fopenapi-spec","en\u002F6.reference\u002F7.api-reference\u002F2.openapi-spec","i-lucide-file-code",{"title":319,"path":320,"stem":321,"children":322,"icon":324},"Schema Migration","\u002Fen\u002Freference\u002Fapi-reference\u002Fschema-migration","en\u002F6.reference\u002F7.api-reference\u002F3.schema-migration\u002Findex",[323,325,330,335],{"title":319,"path":320,"stem":321,"icon":324},"i-lucide-database-zap",{"title":326,"path":327,"stem":328,"icon":329},"Apply Migrations","\u002Fen\u002Freference\u002Fapi-reference\u002Fschema-migration\u002Fapply-migrations","en\u002F6.reference\u002F7.api-reference\u002F3.schema-migration\u002F1.apply-migrations","i-lucide-upload",{"title":331,"path":332,"stem":333,"icon":334},"Import Changes","\u002Fen\u002Freference\u002Fapi-reference\u002Fschema-migration\u002Fimport-changes","en\u002F6.reference\u002F7.api-reference\u002F3.schema-migration\u002F2.import-changes","i-lucide-refresh-cw",{"title":336,"path":337,"stem":338,"icon":339},"Operation Reference","\u002Fen\u002Freference\u002Fapi-reference\u002Fschema-migration\u002Foperation-reference","en\u002F6.reference\u002F7.api-reference\u002F3.schema-migration\u002F3.operation-reference","i-lucide-list-tree",{"title":341,"path":342,"stem":343,"children":344,"page":6},"Design Considerations","\u002Fen\u002Freference\u002Fdesign-considerations","en\u002F6.reference\u002F8.design-considerations",[345,349,354,359,364],{"title":143,"path":346,"stem":347,"icon":348},"\u002Fen\u002Freference\u002Fdesign-considerations\u002Foverview","en\u002F6.reference\u002F8.design-considerations\u002F1.overview","i-lucide-compass",{"title":350,"path":351,"stem":352,"icon":353},"Instance Configuration","\u002Fen\u002Freference\u002Fdesign-considerations\u002Finstance-configuration-related-problems","en\u002F6.reference\u002F8.design-considerations\u002F3.instance-configuration-related-problems","i-lucide-wrench",{"title":355,"path":356,"stem":357,"icon":358},"Overly Permissive Public Access","\u002Fen\u002Freference\u002Fdesign-considerations\u002Foverly-permissive","en\u002F6.reference\u002F8.design-considerations\u002F4.overly-permissive","i-lucide-shield-off",{"title":360,"path":361,"stem":362,"icon":363},"No Aggregates","\u002Fen\u002Freference\u002Fdesign-considerations\u002Fno-aggregates","en\u002F6.reference\u002F8.design-considerations\u002F5.no-aggregates","i-lucide-sigma",{"title":365,"path":366,"stem":367,"icon":368},"Cross-Data-Source Referential Integrity","\u002Fen\u002Freference\u002Fdesign-considerations\u002Fcross-data-source-referential-integrity","en\u002F6.reference\u002F8.design-considerations\u002F6.cross-data-source-referential-integrity","i-lucide-unlink",{"title":370,"path":371,"stem":372,"icon":373},"CLI","\u002Fen\u002Freference\u002Fcli","en\u002F6.reference\u002F9.cli","i-lucide-square-terminal",{"title":221,"path":375,"stem":376,"children":377,"page":6},"\u002Fen\u002Freference\u002Fextensions","en\u002F6.reference\u002F9.extensions",[378,383,386,405],{"title":379,"path":380,"stem":381,"icon":382},"Extension Config and Manifest","\u002Fen\u002Freference\u002Fextensions\u002Fmanifest","en\u002F6.reference\u002F9.extensions\u002F1.manifest","i-lucide-file-json",{"title":370,"path":384,"stem":385,"icon":86},"\u002Fen\u002Freference\u002Fextensions\u002Fcli","en\u002F6.reference\u002F9.extensions\u002F2.cli",{"title":387,"path":388,"stem":389,"children":390,"page":6},"Extension Kit","\u002Fen\u002Freference\u002Fextensions\u002Fextension-kit","en\u002F6.reference\u002F9.extensions\u002F3.extension-kit",[391,395,400],{"title":392,"path":393,"stem":394,"icon":81},"Data Connector","\u002Fen\u002Freference\u002Fextensions\u002Fextension-kit\u002Fdata-connector","en\u002F6.reference\u002F9.extensions\u002F3.extension-kit\u002F1.data-connector",{"title":396,"path":397,"stem":398,"icon":399},"Protocol","\u002Fen\u002Freference\u002Fextensions\u002Fextension-kit\u002Fprotocol","en\u002F6.reference\u002F9.extensions\u002F3.extension-kit\u002F2.protocol","i-lucide-arrow-left-right",{"title":401,"path":402,"stem":403,"icon":404},"Schema Helpers","\u002Fen\u002Freference\u002Fextensions\u002Fextension-kit\u002Fexperimental","en\u002F6.reference\u002F9.extensions\u002F3.extension-kit\u002F3.experimental","i-lucide-blocks",{"title":113,"path":406,"stem":407,"children":408,"page":6},"\u002Fen\u002Freference\u002Fextensions\u002Fdata-connectors","en\u002F6.reference\u002F9.extensions\u002F4.data-connectors",[409,413,417,421,426,431],{"title":410,"path":411,"stem":412,"icon":81},"Data Connector API","\u002Fen\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi","en\u002F6.reference\u002F9.extensions\u002F4.data-connectors\u002F1.api",{"title":414,"path":415,"stem":416,"icon":176},"Operations and Operators","\u002Fen\u002Freference\u002Fextensions\u002Fdata-connectors\u002Foperations","en\u002F6.reference\u002F9.extensions\u002F4.data-connectors\u002F2.operations",{"title":148,"path":418,"stem":419,"icon":420},"\u002Fen\u002Freference\u002Fextensions\u002Fdata-connectors\u002Ferrors","en\u002F6.reference\u002F9.extensions\u002F4.data-connectors\u002F3.errors","i-lucide-triangle-alert",{"title":422,"path":423,"stem":424,"icon":425},"Runtime Limits","\u002Fen\u002Freference\u002Fextensions\u002Fdata-connectors\u002Flimits","en\u002F6.reference\u002F9.extensions\u002F4.data-connectors\u002F4.limits","i-lucide-gauge",{"title":427,"path":428,"stem":429,"icon":430},"Limitations","\u002Fen\u002Freference\u002Fextensions\u002Fdata-connectors\u002Flimitations","en\u002F6.reference\u002F9.extensions\u002F4.data-connectors\u002F5.limitations","i-lucide-ban",{"title":432,"path":433,"stem":434,"icon":435},"Network Permissions","\u002Fen\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fpermissions","en\u002F6.reference\u002F9.extensions\u002F4.data-connectors\u002F6.permissions","i-lucide-shield-check",{"title":437,"icon":121,"path":438,"stem":439,"children":440,"page":6},"Release Notes","\u002Fen\u002Frelease-notes","en\u002F7.release-notes",[441],{"title":442,"path":443,"stem":444,"icon":121},"Changelog","\u002Fen\u002Frelease-notes\u002Fchangelog","en\u002F7.release-notes\u002F1.changelog",{"id":446,"title":447,"body":448,"description":5433,"extension":5434,"links":5435,"meta":5436,"navigation":5437,"path":393,"seo":5438,"stem":394,"__hash__":5439},"docs_en\u002Fen\u002F6.reference\u002F9.extensions\u002F3.extension-kit\u002F1.data-connector.md","Data Connector Module",{"type":449,"value":450,"toc":5390},"minimark",[451,454,458,499,502,580,587,594,615,619,625,628,705,774,791,794,1349,1360,1366,1371,1461,1519,1537,1543,1553,1596,1605,1610,1618,1649,1684,1698,1788,1794,1799,1805,1907,2019,2030,2035,2041,2114,2143,2162,2224,2227,2261,2290,2601,2627,2632,2638,2665,2683,2726,2730,2739,2745,2749,2776,2786,2792,2795,2814,2820,2823,2860,2909,2914,2921,2944,2962,2966,2977,3154,3161,3167,3170,3242,3271,3285,3291,3294,3320,3336,3341,3344,3386,3389,3548,3568,3573,3576,3616,3621,3624,3664,3669,3672,3712,3718,3733,3899,3904,3907,3947,3961,4148,4154,4159,4162,4202,4205,4264,4269,4272,4312,4318,4323,4326,4366,4375,4610,4615,4618,4657,4673,4677,4682,4688,4844,4854,4857,4990,4998,5064,5073,5079,5084,5108,5114,5117,5141,5155,5161,5164,5191,5197,5200,5227,5231,5238,5244,5252,5289,5298,5304,5309,5335,5352,5356,5386],[452,453],"preview",{},[455,456,143],"h2",{"id":457},"overview",[459,460,461,465,466,470,471,474,475,480,481,484,485,489,490,494,495,498],"p",{},[462,463,464],"code",{},"@monospace\u002Fextension-kit\u002Fdata-connector"," is the module a ",[467,468,469],"strong",{},"data connector extension"," builds on. A data connector reads and writes an ",[467,472,473],{},"external data source",": an API, a service, or a database. It exposes that source as ",[476,477,479],"a",{"href":478},"\u002Fconcepts\u002Fdata-model#collections","collections"," of ",[467,482,483],{},"items"," in a Monospace ",[476,486,488],{"href":487},"\u002Fconcepts\u002Forganization#glossary","workspace",". Each item carries named values called ",[476,491,493],{"href":492},"\u002Fconcepts\u002Fdata-model#fields","fields",". The module exports ",[462,496,497],{},"defineDataConnector",", the types around it, and the error classes a connector throws.",[459,500,501],{},"The kit has three import paths:",[503,504,505,520],"table",{},[506,507,508],"thead",{},[509,510,511,515,518],"tr",{},[512,513,514],"th",{},"Import path",[512,516,517],{},"Exports",[512,519,261],{},[521,522,523,549,565],"tbody",{},[509,524,525,530,546],{},[526,527,528],"td",{},[462,529,464],{},[526,531,532,534,535,538,539,542,543],{},[462,533,497],{}," and its types, ",[462,536,537],{},"QueryHandler",", the permission types, the error classes, ",[462,540,541],{},"ErrorCode"," and its types, and every type from ",[462,544,545],{},"\u002Fdata-connector\u002Fprotocol",[526,547,548],{},"This page",[509,550,551,556,559],{},[526,552,553],{},[462,554,555],{},"@monospace\u002Fextension-kit\u002Fdata-connector\u002Fprotocol",[526,557,558],{},"Types only: the schema document and the query wire format",[526,560,561],{},[476,562,564],{"href":563},"\u002Freference\u002Fextensions\u002Fextension-kit\u002Fprotocol","Protocol Types",[509,566,567,572,575],{},[526,568,569],{},[462,570,571],{},"@monospace\u002Fextension-kit\u002Fdata-connector\u002Fexperimental",[526,573,574],{},"The schema helpers, which build a schema document from typed definitions",[526,576,577],{},[476,578,401],{"href":579},"\u002Freference\u002Fextensions\u002Fextension-kit\u002Fexperimental",[459,581,582,583,586],{},"The package has no runtime dependencies. The built entrypoint is a single file with no imports, so everything you use from the kit is bundled into it. See ",[476,584,237],{"href":585},"\u002Fdeveloper\u002Fextensions\u002Fdata-connectors\u002Fruntime",".",[459,588,589,590,593],{},"Each entry below shows the declaration from the kit's type definitions. The ",[476,591,410],{"href":592},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi"," describes what Engine expects from the objects these types describe.",[459,595,596,597,601,602,605,606,609,610,614],{},"The examples are excerpts from three connectors. The ",[476,598,600],{"href":599},"\u002Fguides\u002Fdata-connectors\u002Fquickstart","Data Connector Quickstart"," shows the complete files of a trimmed Art Institute of Chicago connector, ",[476,603,246],{"href":604},"\u002Fdeveloper\u002Fextensions\u002Fdata-connectors\u002Fdata-source-mapping"," the full one (",[462,607,608],{},"search.ts","), and ",[476,611,613],{"href":612},"\u002Fguides\u002Fdata-connectors\u002Fstripe","Build a Stripe Data Connector"," walks through the Stripe connector.",[455,616,618],{"id":617},"define-a-data-connector","Define a Data Connector",[620,621,623],"h3",{"id":622},"definedataconnector",[462,624,497],{},[459,626,627],{},"Builds the descriptor that a data connector entrypoint exports as its default export.",[629,630,636],"pre",{"className":631,"code":632,"filename":633,"language":634,"meta":635,"style":635},"language-ts shiki shiki-themes monospace-light monospace-light monospace-dark","function defineDataConnector\u003CConfig = Record\u003Cstring, unknown>>(definition: DataConnectorDefinition\u003CConfig>): DataConnectorDescriptor\u003CConfig>;\n","signature","ts","",[462,637,638],{"__ignoreMap":635},[639,640,643,647,651,655,658,661,664,666,670,673,676,679,682,685,687,689,692,695,698,700,702],"span",{"class":641,"line":642},"line",1,[639,644,646],{"class":645},"sLVBU","function",[639,648,650],{"class":649},"ssBNi"," defineDataConnector",[639,652,654],{"class":653},"sTMul","\u003C",[639,656,657],{"class":649},"Config",[639,659,660],{"class":645}," =",[639,662,663],{"class":649}," Record",[639,665,654],{"class":653},[639,667,669],{"class":668},"snHjA","string",[639,671,672],{"class":653},", ",[639,674,675],{"class":668},"unknown",[639,677,678],{"class":653},">>(",[639,680,681],{"class":645},"definition:",[639,683,684],{"class":649}," DataConnectorDefinition",[639,686,654],{"class":653},[639,688,657],{"class":649},[639,690,691],{"class":653},">)",[639,693,694],{"class":645},":",[639,696,697],{"class":649}," DataConnectorDescriptor",[639,699,654],{"class":653},[639,701,657],{"class":649},[639,703,704],{"class":653},">;\n",[503,706,707,720],{},[506,708,709],{},[509,710,711,714,717],{},[512,712,713],{},"Parameter",[512,715,716],{},"Type",[512,718,719],{},"Description",[521,721,722,747],{},[509,723,724,729,737],{},[526,725,726],{},[462,727,728],{},"definition",[526,730,731],{},[476,732,734],{"href":733},"#dataconnectordefinition",[462,735,736],{},"DataConnectorDefinition\u003CConfig>",[526,738,739,740,743,744],{},"A required ",[462,741,742],{},"setup"," and an optional ",[462,745,746],{},"preflight",[509,748,749,754,757],{},[526,750,751,753],{},[462,752,657],{}," (type parameter)",[526,755,756],{},"any type",[526,758,759,760,763,764,766,767,769,770,773],{},"The type of ",[462,761,762],{},"config"," in ",[462,765,742],{}," and ",[462,768,746],{},". Defaults to ",[462,771,772],{},"Record\u003Cstring, unknown>",". A compile-time assertion only: nothing checks the configuration against it",[459,775,776,777,783,784,787,788,790],{},"Returns a ",[476,778,780],{"href":779},"#dataconnectordescriptor",[462,781,782],{},"DataConnectorDescriptor\u003CConfig>",": a new object with the definition's properties plus ",[462,785,786],{},"monospace: { kind: 'dataConnector', apiVersion: 1 }",". It performs no I\u002FO and starts nothing, so a test can call ",[462,789,742],{}," and the handlers directly.",[459,792,793],{},"The Quickstart connector's entrypoint declares no configuration and returns three handlers:",[795,796,797],"accordion",{},[798,799,801],"accordion-item",{"label":800},"src\u002Fdata-connectors\u002Fartic\u002Findex.ts",[629,802,804],{"className":631,"code":803,"filename":800,"language":634,"meta":635,"style":635},"import { defineDataConnector } from '@monospace\u002Fextension-kit\u002Fdata-connector';\nimport { search } from '.\u002Fapi';\nimport { readMany, readOne } from '.\u002Fread';\nimport { schema } from '.\u002Fschema';\n\nconst COLLECTIONS = new Set\u003Cstring>(schema.collections.map((collection) => collection.name));\n\nexport default defineDataConnector({\n    setup() {\n        return {\n            introspect() {\n                return schema.toSchemaDocument();\n            },\n\n            async query({ query }) {\n                \u002F\u002F Monospace sends only declared collections, and this connector declares no namespaces.\n                \u002F\u002F For any other collection, throw a plain `Error`.\n                if (query.namespace !== undefined || !COLLECTIONS.has(query.collection)) {\n                    throw new Error(`Unknown collection \\`${query.collection}\\`.`);\n                }\n\n                switch (query.op) {\n                    case 'readMany':\n                        return await readMany(query);\n                    case 'readOne':\n                        return await readOne(query);\n                    default:\n                        \u002F\u002F The schema declares no writes, so Monospace offers callers none.\n                        throw new Error('The Art Institute of Chicago API is read-only.');\n                }\n            },\n\n            async testConnection() {\n                await search('artworks', { size: 0 });\n                return { ok: true };\n            },\n        };\n    },\n});\n",[462,805,806,830,849,873,892,899,957,962,976,985,994,1002,1019,1025,1030,1048,1055,1061,1109,1148,1154,1159,1177,1189,1207,1217,1233,1241,1247,1264,1269,1274,1279,1289,1312,1326,1331,1337,1343],{"__ignoreMap":635},[639,807,808,811,814,817,820,823,827],{"class":641,"line":642},[639,809,810],{"class":645},"import",[639,812,813],{"class":653}," { ",[639,815,497],{"class":816},"sNJ9c",[639,818,819],{"class":653}," } ",[639,821,822],{"class":645},"from",[639,824,826],{"class":825},"suKVh"," '@monospace\u002Fextension-kit\u002Fdata-connector'",[639,828,829],{"class":653},";\n",[639,831,833,835,837,840,842,844,847],{"class":641,"line":832},2,[639,834,810],{"class":645},[639,836,813],{"class":653},[639,838,839],{"class":816},"search",[639,841,819],{"class":653},[639,843,822],{"class":645},[639,845,846],{"class":825}," '.\u002Fapi'",[639,848,829],{"class":653},[639,850,852,854,856,859,861,864,866,868,871],{"class":641,"line":851},3,[639,853,810],{"class":645},[639,855,813],{"class":653},[639,857,858],{"class":816},"readMany",[639,860,672],{"class":653},[639,862,863],{"class":816},"readOne",[639,865,819],{"class":653},[639,867,822],{"class":645},[639,869,870],{"class":825}," '.\u002Fread'",[639,872,829],{"class":653},[639,874,876,878,880,883,885,887,890],{"class":641,"line":875},4,[639,877,810],{"class":645},[639,879,813],{"class":653},[639,881,882],{"class":816},"schema",[639,884,819],{"class":653},[639,886,822],{"class":645},[639,888,889],{"class":825}," '.\u002Fschema'",[639,891,829],{"class":653},[639,893,895],{"class":641,"line":894},5,[639,896,898],{"emptyLinePlaceholder":897},true,"\n",[639,900,902,905,908,910,913,916,918,920,923,925,927,929,931,934,937,940,943,946,949,951,954],{"class":641,"line":901},6,[639,903,904],{"class":645},"const",[639,906,907],{"class":649}," COLLECTIONS",[639,909,660],{"class":645},[639,911,912],{"class":645}," new",[639,914,915],{"class":649}," Set",[639,917,654],{"class":653},[639,919,669],{"class":668},[639,921,922],{"class":653},">(",[639,924,882],{"class":816},[639,926,586],{"class":653},[639,928,479],{"class":816},[639,930,586],{"class":653},[639,932,933],{"class":649},"map",[639,935,936],{"class":653},"((",[639,938,939],{"class":645},"collection",[639,941,942],{"class":653},") ",[639,944,945],{"class":645},"=>",[639,947,948],{"class":816}," collection",[639,950,586],{"class":653},[639,952,953],{"class":816},"name",[639,955,956],{"class":653},"));\n",[639,958,960],{"class":641,"line":959},7,[639,961,898],{"emptyLinePlaceholder":897},[639,963,965,968,971,973],{"class":641,"line":964},8,[639,966,967],{"class":645},"export",[639,969,970],{"class":645}," default",[639,972,650],{"class":649},[639,974,975],{"class":653},"({\n",[639,977,979,982],{"class":641,"line":978},9,[639,980,981],{"class":649},"    setup",[639,983,984],{"class":653},"() {\n",[639,986,988,991],{"class":641,"line":987},10,[639,989,990],{"class":645},"        return",[639,992,993],{"class":653}," {\n",[639,995,997,1000],{"class":641,"line":996},11,[639,998,999],{"class":649},"            introspect",[639,1001,984],{"class":653},[639,1003,1005,1008,1011,1013,1016],{"class":641,"line":1004},12,[639,1006,1007],{"class":645},"                return",[639,1009,1010],{"class":816}," schema",[639,1012,586],{"class":653},[639,1014,1015],{"class":649},"toSchemaDocument",[639,1017,1018],{"class":653},"();\n",[639,1020,1022],{"class":641,"line":1021},13,[639,1023,1024],{"class":653},"            },\n",[639,1026,1028],{"class":641,"line":1027},14,[639,1029,898],{"emptyLinePlaceholder":897},[639,1031,1033,1036,1039,1042,1045],{"class":641,"line":1032},15,[639,1034,1035],{"class":645},"            async",[639,1037,1038],{"class":649}," query",[639,1040,1041],{"class":653},"({ ",[639,1043,1044],{"class":645},"query",[639,1046,1047],{"class":653}," }) {\n",[639,1049,1051],{"class":641,"line":1050},16,[639,1052,1054],{"class":1053},"seNfP","                \u002F\u002F Monospace sends only declared collections, and this connector declares no namespaces.\n",[639,1056,1058],{"class":641,"line":1057},17,[639,1059,1060],{"class":1053},"                \u002F\u002F For any other collection, throw a plain `Error`.\n",[639,1062,1064,1067,1070,1072,1074,1077,1080,1083,1086,1089,1092,1094,1097,1100,1102,1104,1106],{"class":641,"line":1063},18,[639,1065,1066],{"class":645},"                if",[639,1068,1069],{"class":653}," (",[639,1071,1044],{"class":816},[639,1073,586],{"class":653},[639,1075,1076],{"class":816},"namespace",[639,1078,1079],{"class":645}," !==",[639,1081,1082],{"class":649}," undefined",[639,1084,1085],{"class":645}," ||",[639,1087,1088],{"class":645}," !",[639,1090,1091],{"class":649},"COLLECTIONS",[639,1093,586],{"class":653},[639,1095,1096],{"class":649},"has",[639,1098,1099],{"class":653},"(",[639,1101,1044],{"class":816},[639,1103,586],{"class":653},[639,1105,939],{"class":816},[639,1107,1108],{"class":653},")) {\n",[639,1110,1112,1115,1117,1120,1122,1125,1128,1131,1133,1135,1137,1140,1142,1145],{"class":641,"line":1111},19,[639,1113,1114],{"class":645},"                    throw",[639,1116,912],{"class":645},[639,1118,1119],{"class":649}," Error",[639,1121,1099],{"class":653},[639,1123,1124],{"class":825},"`Unknown collection ",[639,1126,1127],{"class":649},"\\`",[639,1129,1130],{"class":825},"${",[639,1132,1044],{"class":816},[639,1134,586],{"class":825},[639,1136,939],{"class":816},[639,1138,1139],{"class":825},"}",[639,1141,1127],{"class":649},[639,1143,1144],{"class":825},".`",[639,1146,1147],{"class":653},");\n",[639,1149,1151],{"class":641,"line":1150},20,[639,1152,1153],{"class":653},"                }\n",[639,1155,1157],{"class":641,"line":1156},21,[639,1158,898],{"emptyLinePlaceholder":897},[639,1160,1162,1165,1167,1169,1171,1174],{"class":641,"line":1161},22,[639,1163,1164],{"class":645},"                switch",[639,1166,1069],{"class":653},[639,1168,1044],{"class":816},[639,1170,586],{"class":653},[639,1172,1173],{"class":816},"op",[639,1175,1176],{"class":653},") {\n",[639,1178,1180,1183,1186],{"class":641,"line":1179},23,[639,1181,1182],{"class":645},"                    case",[639,1184,1185],{"class":825}," 'readMany'",[639,1187,1188],{"class":653},":\n",[639,1190,1192,1195,1198,1201,1203,1205],{"class":641,"line":1191},24,[639,1193,1194],{"class":645},"                        return",[639,1196,1197],{"class":645}," await",[639,1199,1200],{"class":649}," readMany",[639,1202,1099],{"class":653},[639,1204,1044],{"class":816},[639,1206,1147],{"class":653},[639,1208,1210,1212,1215],{"class":641,"line":1209},25,[639,1211,1182],{"class":645},[639,1213,1214],{"class":825}," 'readOne'",[639,1216,1188],{"class":653},[639,1218,1220,1222,1224,1227,1229,1231],{"class":641,"line":1219},26,[639,1221,1194],{"class":645},[639,1223,1197],{"class":645},[639,1225,1226],{"class":649}," readOne",[639,1228,1099],{"class":653},[639,1230,1044],{"class":816},[639,1232,1147],{"class":653},[639,1234,1236,1239],{"class":641,"line":1235},27,[639,1237,1238],{"class":645},"                    default",[639,1240,1188],{"class":653},[639,1242,1244],{"class":641,"line":1243},28,[639,1245,1246],{"class":1053},"                        \u002F\u002F The schema declares no writes, so Monospace offers callers none.\n",[639,1248,1250,1253,1255,1257,1259,1262],{"class":641,"line":1249},29,[639,1251,1252],{"class":645},"                        throw",[639,1254,912],{"class":645},[639,1256,1119],{"class":649},[639,1258,1099],{"class":653},[639,1260,1261],{"class":825},"'The Art Institute of Chicago API is read-only.'",[639,1263,1147],{"class":653},[639,1265,1267],{"class":641,"line":1266},30,[639,1268,1153],{"class":653},[639,1270,1272],{"class":641,"line":1271},31,[639,1273,1024],{"class":653},[639,1275,1277],{"class":641,"line":1276},32,[639,1278,898],{"emptyLinePlaceholder":897},[639,1280,1282,1284,1287],{"class":641,"line":1281},33,[639,1283,1035],{"class":645},[639,1285,1286],{"class":649}," testConnection",[639,1288,984],{"class":653},[639,1290,1292,1295,1298,1300,1303,1306,1309],{"class":641,"line":1291},34,[639,1293,1294],{"class":645},"                await",[639,1296,1297],{"class":649}," search",[639,1299,1099],{"class":653},[639,1301,1302],{"class":825},"'artworks'",[639,1304,1305],{"class":653},", { size: ",[639,1307,1308],{"class":649},"0",[639,1310,1311],{"class":653}," });\n",[639,1313,1315,1317,1320,1323],{"class":641,"line":1314},35,[639,1316,1007],{"class":645},[639,1318,1319],{"class":653}," { ok: ",[639,1321,1322],{"class":649},"true",[639,1324,1325],{"class":653}," };\n",[639,1327,1329],{"class":641,"line":1328},36,[639,1330,1024],{"class":653},[639,1332,1334],{"class":641,"line":1333},37,[639,1335,1336],{"class":653},"        };\n",[639,1338,1340],{"class":641,"line":1339},38,[639,1341,1342],{"class":653},"    },\n",[639,1344,1346],{"class":641,"line":1345},39,[639,1347,1348],{"class":653},"});\n",[459,1350,1351,1352,1355,1356,1359],{},"See ",[476,1353,618],{"href":1354},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi#define-a-data-connector"," for what Engine does with the descriptor, and the ",[476,1357,600],{"href":1358},"\u002Fguides\u002Fdata-connectors\u002Fquickstart#step-look-around"," for a walkthrough.",[620,1361,1363],{"id":1362},"dataconnectordefinition",[462,1364,1365],{},"DataConnectorDefinition",[459,1367,1368,1369,586],{},"The object you pass to ",[462,1370,497],{},[629,1372,1374],{"className":631,"code":1373,"filename":633,"language":634,"meta":635,"style":635},"interface DataConnectorDefinition\u003CConfig> {\n    preflight?: (options: DataConnectorSetupOptions\u003CConfig>) => DataConnectorPreflight;\n    setup: (options: DataConnectorSetupOptions\u003CConfig>) => DataConnectorHandlers | Promise\u003CDataConnectorHandlers>;\n}\n",[462,1375,1376,1390,1420,1456],{"__ignoreMap":635},[639,1377,1378,1381,1383,1385,1387],{"class":641,"line":642},[639,1379,1380],{"class":645},"interface",[639,1382,684],{"class":649},[639,1384,654],{"class":653},[639,1386,657],{"class":649},[639,1388,1389],{"class":653},"> {\n",[639,1391,1392,1395,1398,1400,1403,1406,1408,1410,1413,1415,1418],{"class":641,"line":832},[639,1393,1394],{"class":649},"    preflight",[639,1396,1397],{"class":645},"?:",[639,1399,1069],{"class":653},[639,1401,1402],{"class":645},"options:",[639,1404,1405],{"class":649}," DataConnectorSetupOptions",[639,1407,654],{"class":653},[639,1409,657],{"class":649},[639,1411,1412],{"class":653},">) ",[639,1414,945],{"class":645},[639,1416,1417],{"class":649}," DataConnectorPreflight",[639,1419,829],{"class":653},[639,1421,1422,1424,1426,1428,1430,1432,1434,1436,1438,1440,1443,1446,1449,1451,1454],{"class":641,"line":851},[639,1423,981],{"class":649},[639,1425,694],{"class":645},[639,1427,1069],{"class":653},[639,1429,1402],{"class":645},[639,1431,1405],{"class":649},[639,1433,654],{"class":653},[639,1435,657],{"class":649},[639,1437,1412],{"class":653},[639,1439,945],{"class":645},[639,1441,1442],{"class":649}," DataConnectorHandlers",[639,1444,1445],{"class":645}," |",[639,1447,1448],{"class":649}," Promise",[639,1450,654],{"class":653},[639,1452,1453],{"class":649},"DataConnectorHandlers",[639,1455,704],{"class":653},[639,1457,1458],{"class":641,"line":875},[639,1459,1460],{"class":653},"}\n",[503,1462,1463,1475],{},[506,1464,1465],{},[509,1466,1467,1470,1473],{},[512,1468,1469],{},"Property",[512,1471,1472],{},"Required",[512,1474,719],{},[521,1476,1477,1504],{},[509,1478,1479,1483,1486],{},[526,1480,1481],{},[462,1482,742],{},[526,1484,1485],{},"Yes",[526,1487,1488,1489,1495,1496,1500,1501],{},"Runs once each time Engine starts the connector for a data source. Receives ",[476,1490,1492],{"href":1491},"#dataconnectorsetupoptions",[462,1493,1494],{},"DataConnectorSetupOptions"," and returns the ",[476,1497,1499],{"href":1498},"#dataconnectorhandlers","handlers",", or a promise of them. See ",[476,1502,742],{"href":1503},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi#setup",[509,1505,1506,1510,1513],{},[526,1507,1508],{},[462,1509,746],{},[526,1511,1512],{},"No",[526,1514,1515,1516],{},"Returns the network permissions a data source needs beyond the manifest's, derived from its configuration. Synchronous only. See ",[476,1517,746],{"href":1518},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi#preflight",[459,1520,1521,1522,1524,1525,1527,1528,1534,1535,586],{},"Validate the configuration in ",[462,1523,742],{},". ",[462,1526,746],{}," can also throw ",[476,1529,1531],{"href":1530},"#invalidconfiguration",[462,1532,1533],{},"InvalidConfiguration"," when a value it reads is invalid, which deactivates the data source as it does from ",[462,1536,742],{},[620,1538,1540],{"id":1539},"dataconnectordescriptor",[462,1541,1542],{},"DataConnectorDescriptor",[459,1544,1545,1546,1548,1549,586],{},"The value ",[462,1547,497],{}," returns: the definition plus the ",[476,1550,1552],{"href":1551},"#descriptormarker","descriptor marker",[629,1554,1556],{"className":631,"code":1555,"filename":633,"language":634,"meta":635,"style":635},"interface DataConnectorDescriptor\u003CConfig> extends DataConnectorDefinition\u003CConfig> {\n    monospace: DescriptorMarker;\n}\n",[462,1557,1558,1582,1592],{"__ignoreMap":635},[639,1559,1560,1562,1564,1566,1568,1571,1574,1576,1578,1580],{"class":641,"line":642},[639,1561,1380],{"class":645},[639,1563,697],{"class":649},[639,1565,654],{"class":653},[639,1567,657],{"class":649},[639,1569,1570],{"class":653},"> ",[639,1572,1573],{"class":645},"extends",[639,1575,684],{"class":649},[639,1577,654],{"class":653},[639,1579,657],{"class":649},[639,1581,1389],{"class":653},[639,1583,1584,1587,1590],{"class":641,"line":832},[639,1585,1586],{"class":645},"    monospace:",[639,1588,1589],{"class":649}," DescriptorMarker",[639,1591,829],{"class":653},[639,1593,1594],{"class":641,"line":851},[639,1595,1460],{"class":653},[459,1597,1598,1599,1601,1602,1604],{},"Export it as the entrypoint's default export. Engine recognizes a descriptor by its ",[462,1600,742],{}," function, so a hand-written object with a ",[462,1603,742],{}," function works without the kit.",[620,1606,1608],{"id":1607},"dataconnectorsetupoptions",[462,1609,1494],{},[459,1611,1612,1613,766,1615,1617],{},"The one argument ",[462,1614,742],{},[462,1616,746],{}," receive.",[629,1619,1621],{"className":631,"code":1620,"filename":633,"language":634,"meta":635,"style":635},"interface DataConnectorSetupOptions\u003CConfig> {\n    config: Config;\n}\n",[462,1622,1623,1635,1645],{"__ignoreMap":635},[639,1624,1625,1627,1629,1631,1633],{"class":641,"line":642},[639,1626,1380],{"class":645},[639,1628,1405],{"class":649},[639,1630,654],{"class":653},[639,1632,657],{"class":649},[639,1634,1389],{"class":653},[639,1636,1637,1640,1643],{"class":641,"line":832},[639,1638,1639],{"class":645},"    config:",[639,1641,1642],{"class":649}," Config",[639,1644,829],{"class":653},[639,1646,1647],{"class":641,"line":851},[639,1648,1460],{"class":653},[503,1650,1651,1661],{},[506,1652,1653],{},[509,1654,1655,1657,1659],{},[512,1656,1469],{},[512,1658,716],{},[512,1660,719],{},[521,1662,1663],{},[509,1664,1665,1669,1673],{},[526,1666,1667],{},[462,1668,762],{},[526,1670,1671],{},[462,1672,657],{},[526,1674,1675,1676,1678,1679,1683],{},"The data source's stored configuration, passed through unchanged. Nothing validates it before your code runs: check every value you depend on in ",[462,1677,742],{},", and throw ",[476,1680,1681],{"href":1530},[462,1682,1533],{}," when one is missing or wrong",[459,1685,1686,1687,1689,1690,1692,1693,1695,1696,694],{},"The argument is an object so that new keys can be added beside ",[462,1688,762],{}," without breaking your connector. The Stripe connector types ",[462,1691,762],{}," as ",[462,1694,675],{}," and parses it in ",[462,1697,742],{},[629,1699,1702],{"className":631,"code":1700,"filename":1701,"language":634,"meta":635,"style":635},"export default defineDataConnector\u003Cunknown>({\n    setup({ config: rawConfig }) {\n        const config = parseConfig(rawConfig);\n        const context = { client: new StripeClient(config.apiKey), config };\n","src\u002Fdata-connectors\u002Fstripe\u002Findex.ts",[462,1703,1704,1719,1735,1754],{"__ignoreMap":635},[639,1705,1706,1708,1710,1712,1714,1716],{"class":641,"line":642},[639,1707,967],{"class":645},[639,1709,970],{"class":645},[639,1711,650],{"class":649},[639,1713,654],{"class":653},[639,1715,675],{"class":668},[639,1717,1718],{"class":653},">({\n",[639,1720,1721,1723,1725,1727,1730,1733],{"class":641,"line":832},[639,1722,981],{"class":649},[639,1724,1041],{"class":653},[639,1726,762],{"class":645},[639,1728,1729],{"class":653},": ",[639,1731,1732],{"class":645},"rawConfig",[639,1734,1047],{"class":653},[639,1736,1737,1740,1743,1745,1748,1750,1752],{"class":641,"line":851},[639,1738,1739],{"class":645},"        const",[639,1741,1742],{"class":649}," config",[639,1744,660],{"class":645},[639,1746,1747],{"class":649}," parseConfig",[639,1749,1099],{"class":653},[639,1751,1732],{"class":816},[639,1753,1147],{"class":653},[639,1755,1756,1758,1761,1763,1766,1769,1772,1774,1776,1778,1781,1784,1786],{"class":641,"line":875},[639,1757,1739],{"class":645},[639,1759,1760],{"class":649}," context",[639,1762,660],{"class":645},[639,1764,1765],{"class":653}," { client: ",[639,1767,1768],{"class":645},"new",[639,1770,1771],{"class":649}," StripeClient",[639,1773,1099],{"class":653},[639,1775,762],{"class":816},[639,1777,586],{"class":653},[639,1779,1780],{"class":816},"apiKey",[639,1782,1783],{"class":653},"), ",[639,1785,762],{"class":816},[639,1787,1325],{"class":653},[459,1789,1351,1790,586],{},[476,1791,1793],{"href":1792},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi#receive-the-configuration","Receive the Configuration",[620,1795,1797],{"id":1796},"dataconnectorhandlers",[462,1798,1453],{},[459,1800,1801,1802,1804],{},"The object ",[462,1803,742],{}," returns: the functions Engine calls for a data source.",[629,1806,1808],{"className":631,"code":1807,"filename":633,"language":634,"meta":635,"style":635},"interface DataConnectorHandlers {\n    introspect: () => SchemaDocument | Promise\u003CSchemaDocument>;\n    query: QueryHandler;\n    testConnection?: () => TestConnectionResult | Promise\u003CTestConnectionResult>;\n    explainQuery?: (request: QuerySerialized) => unknown;\n}\n",[462,1809,1810,1818,1844,1854,1879,1903],{"__ignoreMap":635},[639,1811,1812,1814,1816],{"class":641,"line":642},[639,1813,1380],{"class":645},[639,1815,1442],{"class":649},[639,1817,993],{"class":653},[639,1819,1820,1823,1825,1828,1830,1833,1835,1837,1839,1842],{"class":641,"line":832},[639,1821,1822],{"class":649},"    introspect",[639,1824,694],{"class":645},[639,1826,1827],{"class":653}," () ",[639,1829,945],{"class":645},[639,1831,1832],{"class":649}," SchemaDocument",[639,1834,1445],{"class":645},[639,1836,1448],{"class":649},[639,1838,654],{"class":653},[639,1840,1841],{"class":649},"SchemaDocument",[639,1843,704],{"class":653},[639,1845,1846,1849,1852],{"class":641,"line":851},[639,1847,1848],{"class":645},"    query:",[639,1850,1851],{"class":649}," QueryHandler",[639,1853,829],{"class":653},[639,1855,1856,1859,1861,1863,1865,1868,1870,1872,1874,1877],{"class":641,"line":875},[639,1857,1858],{"class":649},"    testConnection",[639,1860,1397],{"class":645},[639,1862,1827],{"class":653},[639,1864,945],{"class":645},[639,1866,1867],{"class":649}," TestConnectionResult",[639,1869,1445],{"class":645},[639,1871,1448],{"class":649},[639,1873,654],{"class":653},[639,1875,1876],{"class":649},"TestConnectionResult",[639,1878,704],{"class":653},[639,1880,1881,1884,1886,1888,1891,1894,1896,1898,1901],{"class":641,"line":894},[639,1882,1883],{"class":649},"    explainQuery",[639,1885,1397],{"class":645},[639,1887,1069],{"class":653},[639,1889,1890],{"class":645},"request:",[639,1892,1893],{"class":649}," QuerySerialized",[639,1895,942],{"class":653},[639,1897,945],{"class":645},[639,1899,1900],{"class":668}," unknown",[639,1902,829],{"class":653},[639,1904,1905],{"class":641,"line":901},[639,1906,1460],{"class":653},[503,1908,1909,1920],{},[506,1910,1911],{},[509,1912,1913,1916,1918],{},[512,1914,1915],{},"Handler",[512,1917,1472],{},[512,1919,719],{},[521,1921,1922,1945,1989,2007],{},[509,1923,1924,1929,1931],{},[526,1925,1926],{},[462,1927,1928],{},"introspect",[526,1930,1485],{},[526,1932,1933,1934,1939,1940,1944],{},"Answers with the ",[476,1935,1937],{"href":1936},"\u002Freference\u002Fextensions\u002Fextension-kit\u002Fprotocol#schemadocument",[462,1938,1841],{},": the collections, fields and ",[476,1941,1943],{"href":1942},"\u002Fconcepts\u002Fdata-model#relations","relations"," the data source exposes",[509,1946,1947,1951,1953],{},[526,1948,1949],{},[462,1950,1044],{},[526,1952,1485],{},[526,1954,1955,1956,1961,1962,1968,1969,1972,1973,672,1975,766,1978,1981,1982,1988],{},"A ",[476,1957,1959],{"href":1958},"#queryhandler",[462,1960,537],{},". Receives one operation in a ",[476,1963,1965],{"href":1964},"\u002Freference\u002Fextensions\u002Fextension-kit\u002Fprotocol#queryrequest",[462,1966,1967],{},"QueryRequest"," envelope and answers with the shape that operation owes: ",[462,1970,1971],{},"{ record }"," for ",[462,1974,863],{},[462,1976,1977],{},"updateOne",[462,1979,1980],{},"deleteOne",", a ",[476,1983,1985],{"href":1984},"\u002Freference\u002Fextensions\u002Fextension-kit\u002Fprotocol#queryresultserialized",[462,1986,1987],{},"QueryResultSerialized"," for the others",[509,1990,1991,1996,1998],{},[526,1992,1993],{},[462,1994,1995],{},"testConnection",[526,1997,1512],{},[526,1999,2000,2001,2006],{},"Checks that the external data source is reachable with this configuration. Answers a ",[476,2002,2004],{"href":2003},"#testconnectionresult",[462,2005,1876],{},", or throws",[509,2008,2009,2014,2016],{},[526,2010,2011],{},[462,2012,2013],{},"explainQuery",[526,2015,1512],{},[526,2017,2018],{},"Reserved. Engine doesn't call it",[459,2020,2021,2022,2024,2025,2029],{},"Handlers run concurrently: Engine sends the next request without waiting for the last one to finish. Don't keep per-request state in the ",[462,2023,742],{}," closure. See ",[476,2026,2028],{"href":2027},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi#handlers","Handlers"," for what Engine does with each, including what happens when a required handler is missing.",[620,2031,2033],{"id":2032},"queryhandler",[462,2034,537],{},[459,2036,2037,2038,2040],{},"The type of the ",[462,2039,1044],{}," handler: a function from an operation's request to the answer that operation owes.",[629,2042,2044],{"className":631,"code":2043,"filename":633,"language":634,"meta":635,"style":635},"type QueryHandler\u003COp extends OperationName = OperationName> = (request: QueryRequest\u003COp>) => QueryResultFor\u003COp> | Promise\u003CQueryResultFor\u003COp>>;\n",[462,2045,2046],{"__ignoreMap":635},[639,2047,2048,2051,2053,2055,2058,2061,2064,2066,2068,2070,2073,2075,2077,2080,2082,2084,2086,2088,2091,2093,2095,2097,2100,2102,2104,2107,2109,2111],{"class":641,"line":642},[639,2049,2050],{"class":645},"type",[639,2052,1851],{"class":649},[639,2054,654],{"class":653},[639,2056,2057],{"class":649},"Op",[639,2059,2060],{"class":645}," extends",[639,2062,2063],{"class":649}," OperationName",[639,2065,660],{"class":645},[639,2067,2063],{"class":649},[639,2069,1570],{"class":653},[639,2071,2072],{"class":645},"=",[639,2074,1069],{"class":653},[639,2076,1890],{"class":645},[639,2078,2079],{"class":649}," QueryRequest",[639,2081,654],{"class":653},[639,2083,2057],{"class":649},[639,2085,1412],{"class":653},[639,2087,945],{"class":645},[639,2089,2090],{"class":649}," QueryResultFor",[639,2092,654],{"class":653},[639,2094,2057],{"class":649},[639,2096,1570],{"class":653},[639,2098,2099],{"class":645},"|",[639,2101,1448],{"class":649},[639,2103,654],{"class":653},[639,2105,2106],{"class":649},"QueryResultFor",[639,2108,654],{"class":653},[639,2110,2057],{"class":649},[639,2112,2113],{"class":653},">>;\n",[503,2115,2116,2125],{},[506,2117,2118],{},[509,2119,2120,2123],{},[512,2121,2122],{},"Type parameter",[512,2124,719],{},[521,2126,2127],{},[509,2128,2129,2133],{},[526,2130,2131],{},[462,2132,2057],{},[526,2134,2135,2136,2142],{},"The operations the function serves: an ",[476,2137,2139],{"href":2138},"\u002Freference\u002Fextensions\u002Fextension-kit\u002Fprotocol#operationname",[462,2140,2141],{},"OperationName",", or a union of them. Defaults to every operation",[459,2144,2145,2146,2148,2149,2154,2155,2161],{},"For each operation in ",[462,2147,2057],{},", the function receives a ",[476,2150,2151],{"href":1964},[462,2152,2153],{},"QueryRequest\u003COp>"," and answers a ",[476,2156,2158],{"href":2157},"\u002Freference\u002Fextensions\u002Fextension-kit\u002Fprotocol#queryresultfor",[462,2159,2160],{},"QueryResultFor\u003COp>",", or a promise of it:",[503,2163,2164,2174],{},[506,2165,2166],{},[509,2167,2168,2171],{},[512,2169,2170],{},"Operations",[512,2172,2173],{},"Answer",[521,2175,2176,2195],{},[509,2177,2178,2186],{},[526,2179,2180,672,2182,672,2184],{},[462,2181,863],{},[462,2183,1977],{},[462,2185,1980],{},[526,2187,2188,2190,2191,2194],{},[462,2189,1971],{},": the item, or ",[462,2192,2193],{},"null"," when the key or the guard misses",[509,2196,2197,2210],{},[526,2198,2199,672,2201,672,2204,672,2207],{},[462,2200,858],{},[462,2202,2203],{},"create",[462,2205,2206],{},"updateMany",[462,2208,2209],{},"deleteMany",[526,2211,2212,1729,2216,2219,2220,2223],{},[476,2213,2214],{"href":1984},[462,2215,1987],{},[462,2217,2218],{},"records",", or ",[462,2221,2222],{},"totalCount"," on a count read",[459,2225,2226],{},"The two answer shapes exclude each other, so each of these is a type error:",[2228,2229,2230,2244,2252],"ul",{},[2231,2232,2233,2236,2237,2240,2241],"li",{},[462,2234,2235],{},"{ records: [] }"," or ",[462,2238,2239],{},"{}"," from a ",[462,2242,2243],{},"QueryHandler\u003C'readOne'>",[2231,2245,2246,2240,2249],{},[462,2247,2248],{},"{ record: null }",[462,2250,2251],{},"QueryHandler\u003C'readMany'>",[2231,2253,2254,2257,2258,2260],{},[462,2255,2256],{},"{ record: null, records: [] }"," from the ",[462,2259,1044],{}," handler",[459,2262,2263,2266,2267,2269,2270,2272,2273,2275,2276,2278,2279,2281,2282,2285,2286,2289],{},[462,2264,2265],{},"DataConnectorHandlers.query"," is a ",[462,2268,537],{}," for every operation, so it can hand each operation to a function typed for that one. With several operations in ",[462,2271,2057],{},", the type doesn't pair a request with its answer: a ",[462,2274,1044],{}," handler that answers ",[462,2277,2235],{}," to every operation type-checks. Type each operation's function for that operation to catch a wrong answer shape. The Quickstart connector's ",[462,2280,863],{}," declares its answer as ",[462,2283,2284],{},"QueryResultFor\u003C'readOne'>",", and answers ",[462,2287,2288],{},"record: null"," on a miss instead of throwing:",[629,2291,2294],{"className":631,"code":2292,"filename":2293,"language":634,"meta":635,"style":635},"\u002F**\n * Handles `readOne` with `readMany`: the key as a filter, any filter the caller adds, and a limit of\n * one item. Returns `record: null` when no item matches, and the caller gets `404`.\n *\u002F\nexport async function readOne(query: ReadOneOperationSerialized): Promise\u003CQueryResultFor\u003C'readOne'>> {\n    \u002F\u002F Monospace sends the key as `{ id }`. An ID that isn't a safe integer matches no item.\n    const { id } = query.key;\n    if (typeof id !== 'number' || !Number.isSafeInteger(id)) return { record: null };\n\n    const key = { cmp: 'equals', left: { field: 'id' }, right: { value: id } } as const;\n    const filter = query.filter === undefined ? key : { and: [key, query.filter] };\n    const { records = [] } = await readMany({ op: 'readMany', collection: query.collection, select: query.select, filter, limit: 1 });\n    return { record: records[0] ?? null };\n}\n","src\u002Fdata-connectors\u002Fartic\u002Fread.ts",[462,2295,2296,2301,2306,2311,2316,2355,2360,2383,2430,2434,2471,2516,2572,2597],{"__ignoreMap":635},[639,2297,2298],{"class":641,"line":642},[639,2299,2300],{"class":1053},"\u002F**\n",[639,2302,2303],{"class":641,"line":832},[639,2304,2305],{"class":1053}," * Handles `readOne` with `readMany`: the key as a filter, any filter the caller adds, and a limit of\n",[639,2307,2308],{"class":641,"line":851},[639,2309,2310],{"class":1053}," * one item. Returns `record: null` when no item matches, and the caller gets `404`.\n",[639,2312,2313],{"class":641,"line":875},[639,2314,2315],{"class":1053}," *\u002F\n",[639,2317,2318,2320,2323,2326,2328,2330,2333,2336,2339,2341,2343,2345,2347,2349,2352],{"class":641,"line":894},[639,2319,967],{"class":645},[639,2321,2322],{"class":645}," async",[639,2324,2325],{"class":645}," function",[639,2327,1226],{"class":649},[639,2329,1099],{"class":653},[639,2331,2332],{"class":645},"query:",[639,2334,2335],{"class":649}," ReadOneOperationSerialized",[639,2337,2338],{"class":653},")",[639,2340,694],{"class":645},[639,2342,1448],{"class":649},[639,2344,654],{"class":653},[639,2346,2106],{"class":649},[639,2348,654],{"class":653},[639,2350,2351],{"class":825},"'readOne'",[639,2353,2354],{"class":653},">> {\n",[639,2356,2357],{"class":641,"line":901},[639,2358,2359],{"class":1053},"    \u002F\u002F Monospace sends the key as `{ id }`. An ID that isn't a safe integer matches no item.\n",[639,2361,2362,2365,2367,2370,2372,2374,2376,2378,2381],{"class":641,"line":959},[639,2363,2364],{"class":645},"    const",[639,2366,813],{"class":653},[639,2368,2369],{"class":649},"id",[639,2371,819],{"class":653},[639,2373,2072],{"class":645},[639,2375,1038],{"class":816},[639,2377,586],{"class":653},[639,2379,2380],{"class":816},"key",[639,2382,829],{"class":653},[639,2384,2385,2388,2390,2393,2396,2398,2401,2403,2405,2408,2410,2413,2415,2417,2420,2423,2426,2428],{"class":641,"line":964},[639,2386,2387],{"class":645},"    if",[639,2389,1069],{"class":653},[639,2391,2392],{"class":645},"typeof",[639,2394,2395],{"class":816}," id",[639,2397,1079],{"class":645},[639,2399,2400],{"class":825}," 'number'",[639,2402,1085],{"class":645},[639,2404,1088],{"class":645},[639,2406,2407],{"class":816},"Number",[639,2409,586],{"class":653},[639,2411,2412],{"class":649},"isSafeInteger",[639,2414,1099],{"class":653},[639,2416,2369],{"class":816},[639,2418,2419],{"class":653},")) ",[639,2421,2422],{"class":645},"return",[639,2424,2425],{"class":653}," { record: ",[639,2427,2193],{"class":649},[639,2429,1325],{"class":653},[639,2431,2432],{"class":641,"line":978},[639,2433,898],{"emptyLinePlaceholder":897},[639,2435,2436,2438,2441,2443,2446,2449,2452,2455,2458,2460,2463,2466,2469],{"class":641,"line":987},[639,2437,2364],{"class":645},[639,2439,2440],{"class":649}," key",[639,2442,660],{"class":645},[639,2444,2445],{"class":653}," { cmp: ",[639,2447,2448],{"class":825},"'equals'",[639,2450,2451],{"class":653},", left: { field: ",[639,2453,2454],{"class":825},"'id'",[639,2456,2457],{"class":653}," }, right: { value: ",[639,2459,2369],{"class":816},[639,2461,2462],{"class":653}," } } ",[639,2464,2465],{"class":645},"as",[639,2467,2468],{"class":645}," const",[639,2470,829],{"class":653},[639,2472,2473,2475,2478,2480,2482,2484,2487,2490,2492,2495,2497,2500,2503,2505,2507,2509,2511,2513],{"class":641,"line":996},[639,2474,2364],{"class":645},[639,2476,2477],{"class":649}," filter",[639,2479,660],{"class":645},[639,2481,1038],{"class":816},[639,2483,586],{"class":653},[639,2485,2486],{"class":816},"filter",[639,2488,2489],{"class":645}," ===",[639,2491,1082],{"class":649},[639,2493,2494],{"class":645}," ?",[639,2496,2440],{"class":816},[639,2498,2499],{"class":645}," :",[639,2501,2502],{"class":653}," { and: [",[639,2504,2380],{"class":816},[639,2506,672],{"class":653},[639,2508,1044],{"class":816},[639,2510,586],{"class":653},[639,2512,2486],{"class":816},[639,2514,2515],{"class":653},"] };\n",[639,2517,2518,2520,2522,2524,2526,2529,2531,2533,2535,2538,2541,2544,2546,2548,2550,2553,2555,2557,2560,2562,2564,2567,2570],{"class":641,"line":1004},[639,2519,2364],{"class":645},[639,2521,813],{"class":653},[639,2523,2218],{"class":649},[639,2525,660],{"class":645},[639,2527,2528],{"class":653}," [] } ",[639,2530,2072],{"class":645},[639,2532,1197],{"class":645},[639,2534,1200],{"class":649},[639,2536,2537],{"class":653},"({ op: ",[639,2539,2540],{"class":825},"'readMany'",[639,2542,2543],{"class":653},", collection: ",[639,2545,1044],{"class":816},[639,2547,586],{"class":653},[639,2549,939],{"class":816},[639,2551,2552],{"class":653},", select: ",[639,2554,1044],{"class":816},[639,2556,586],{"class":653},[639,2558,2559],{"class":816},"select",[639,2561,672],{"class":653},[639,2563,2486],{"class":816},[639,2565,2566],{"class":653},", limit: ",[639,2568,2569],{"class":649},"1",[639,2571,1311],{"class":653},[639,2573,2574,2577,2579,2581,2584,2586,2589,2592,2595],{"class":641,"line":1021},[639,2575,2576],{"class":645},"    return",[639,2578,2425],{"class":653},[639,2580,2218],{"class":816},[639,2582,2583],{"class":653},"[",[639,2585,1308],{"class":649},[639,2587,2588],{"class":653},"] ",[639,2590,2591],{"class":645},"??",[639,2593,2594],{"class":649}," null",[639,2596,1325],{"class":653},[639,2598,2599],{"class":641,"line":1027},[639,2600,1460],{"class":653},[459,2602,2603,2604,2607,2608,2611,2612,2236,2615,2618,2619,766,2623,586],{},"The ",[462,2605,2606],{},"typeof id !== 'number'"," check fits this connector's ",[462,2609,2610],{},"int32"," ids. An ",[462,2613,2614],{},"int64",[462,2616,2617],{},"uint64"," key arrives as a decimal string, so the same check misses every item in such a connector. See ",[476,2620,2622],{"href":2621},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi#values","Values",[476,2624,2626],{"href":2625},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fapi#keyed-operations","Keyed Operations",[620,2628,2630],{"id":2629},"testconnectionresult",[462,2631,1876],{},[459,2633,2634,2635,2637],{},"What ",[462,2636,1995],{}," answers with.",[629,2639,2641],{"className":631,"code":2640,"filename":633,"language":634,"meta":635,"style":635},"interface TestConnectionResult {\n    ok: boolean;\n}\n",[462,2642,2643,2651,2661],{"__ignoreMap":635},[639,2644,2645,2647,2649],{"class":641,"line":642},[639,2646,1380],{"class":645},[639,2648,1867],{"class":649},[639,2650,993],{"class":653},[639,2652,2653,2656,2659],{"class":641,"line":832},[639,2654,2655],{"class":645},"    ok:",[639,2657,2658],{"class":668}," boolean",[639,2660,829],{"class":653},[639,2662,2663],{"class":641,"line":851},[639,2664,1460],{"class":653},[459,2666,2667,2668,2671,2672,2676,2677,2680,2681,694],{},"Answer ",[462,2669,2670],{},"{ ok: true }"," when the connection works, and throw a ",[476,2673,2675],{"href":2674},"#throw-errors","kit error"," to report a failure. ",[462,2678,2679],{},"{ ok: false }"," is also reported as a failed connection. The Quickstart connector sends one real request and answers ",[462,2682,2670],{},[629,2684,2686],{"className":631,"code":2685,"filename":800,"language":634,"meta":635,"style":635},"            async testConnection() {\n                await search('artworks', { size: 0 });\n                return { ok: true };\n            },\n",[462,2687,2688,2696,2712,2722],{"__ignoreMap":635},[639,2689,2690,2692,2694],{"class":641,"line":642},[639,2691,1035],{"class":816},[639,2693,1286],{"class":649},[639,2695,984],{"class":653},[639,2697,2698,2700,2702,2704,2706,2708,2710],{"class":641,"line":832},[639,2699,1294],{"class":645},[639,2701,1297],{"class":649},[639,2703,1099],{"class":653},[639,2705,1302],{"class":825},[639,2707,1305],{"class":653},[639,2709,1308],{"class":649},[639,2711,1311],{"class":653},[639,2713,2714,2716,2718,2720],{"class":641,"line":851},[639,2715,1007],{"class":645},[639,2717,1319],{"class":653},[639,2719,1322],{"class":649},[639,2721,1325],{"class":653},[639,2723,2724],{"class":641,"line":875},[639,2725,1024],{"class":653},[455,2727,2729],{"id":2728},"declare-permissions","Declare Permissions",[459,2731,2732,2733,2735,2736,586],{},"A data connector reaches only the hosts a data source's network permissions grant. Fixed hosts go in the manifest; ",[462,2734,746],{}," adds hosts derived from configuration. See ",[476,2737,432],{"href":2738},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fpermissions",[620,2740,2742],{"id":2741},"dataconnectorpreflight",[462,2743,2744],{},"DataConnectorPreflight",[459,2746,2634,2747,2637],{},[462,2748,746],{},[629,2750,2752],{"className":631,"code":2751,"filename":633,"language":634,"meta":635,"style":635},"interface DataConnectorPreflight {\n    permissions: DataConnectorPermissions;\n}\n",[462,2753,2754,2762,2772],{"__ignoreMap":635},[639,2755,2756,2758,2760],{"class":641,"line":642},[639,2757,1380],{"class":645},[639,2759,1417],{"class":649},[639,2761,993],{"class":653},[639,2763,2764,2767,2770],{"class":641,"line":832},[639,2765,2766],{"class":645},"    permissions:",[639,2768,2769],{"class":649}," DataConnectorPermissions",[639,2771,829],{"class":653},[639,2773,2774],{"class":641,"line":851},[639,2775,1460],{"class":653},[459,2777,2778,2781,2782,586],{},[462,2779,2780],{},"permissions"," lists the permissions this data source needs in addition to the manifest's. See ",[476,2783,2785],{"href":2784},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fpermissions#derive-permissions-in-preflight","Derive Permissions in preflight",[620,2787,2789],{"id":2788},"dataconnectorpermissions",[462,2790,2791],{},"DataConnectorPermissions",[459,2793,2794],{},"A list of permissions, each with its reason.",[629,2796,2798],{"className":631,"code":2797,"filename":633,"language":634,"meta":635,"style":635},"type DataConnectorPermissions = DataConnectorPermission[];\n",[462,2799,2800],{"__ignoreMap":635},[639,2801,2802,2804,2806,2808,2811],{"class":641,"line":642},[639,2803,2050],{"class":645},[639,2805,2769],{"class":649},[639,2807,660],{"class":645},[639,2809,2810],{"class":649}," DataConnectorPermission",[639,2812,2813],{"class":653},"[];\n",[620,2815,2817],{"id":2816},"dataconnectorpermission",[462,2818,2819],{},"DataConnectorPermission",[459,2821,2822],{},"One permission and the reason the connector needs it.",[629,2824,2826],{"className":631,"code":2825,"filename":633,"language":634,"meta":635,"style":635},"interface DataConnectorPermission {\n    permission: DataConnectorNetTarget;\n    reason: string;\n}\n",[462,2827,2828,2836,2846,2856],{"__ignoreMap":635},[639,2829,2830,2832,2834],{"class":641,"line":642},[639,2831,1380],{"class":645},[639,2833,2810],{"class":649},[639,2835,993],{"class":653},[639,2837,2838,2841,2844],{"class":641,"line":832},[639,2839,2840],{"class":645},"    permission:",[639,2842,2843],{"class":649}," DataConnectorNetTarget",[639,2845,829],{"class":653},[639,2847,2848,2851,2854],{"class":641,"line":851},[639,2849,2850],{"class":645},"    reason:",[639,2852,2853],{"class":668}," string",[639,2855,829],{"class":653},[639,2857,2858],{"class":641,"line":875},[639,2859,1460],{"class":653},[503,2861,2862,2872],{},[506,2863,2864],{},[509,2865,2866,2868,2870],{},[512,2867,1469],{},[512,2869,716],{},[512,2871,719],{},[521,2873,2874,2892],{},[509,2875,2876,2881,2889],{},[526,2877,2878],{},[462,2879,2880],{},"permission",[526,2882,2883],{},[476,2884,2886],{"href":2885},"#dataconnectornettarget",[462,2887,2888],{},"DataConnectorNetTarget",[526,2890,2891],{},"The host the connector needs",[509,2893,2894,2899,2903],{},[526,2895,2896],{},[462,2897,2898],{},"reason",[526,2900,2901],{},[462,2902,669],{},[526,2904,2905,2906,2908],{},"Shown to whoever approves the grant. Must contain a non-whitespace character: a blank reason from ",[462,2907,746],{}," deactivates the data source",[620,2910,2912],{"id":2911},"dataconnectornettarget",[462,2913,2888],{},[459,2915,2916,2917,2920],{},"A network permission target: ",[462,2918,2919],{},"net:"," followed by a host.",[629,2922,2924],{"className":631,"code":2923,"filename":633,"language":634,"meta":635,"style":635},"type DataConnectorNetTarget = `net:${string}`;\n",[462,2925,2926],{"__ignoreMap":635},[639,2927,2928,2930,2932,2934,2937,2939,2942],{"class":641,"line":642},[639,2929,2050],{"class":645},[639,2931,2843],{"class":649},[639,2933,660],{"class":645},[639,2935,2936],{"class":825}," `net:${",[639,2938,669],{"class":668},[639,2940,2941],{"class":825},"}`",[639,2943,829],{"class":653},[459,2945,2946,2947,2949,2950,2219,2953,2956,2957,2961],{},"The type accepts any string after ",[462,2948,2919],{},". The target is a host, ",[462,2951,2952],{},"host:port",[462,2954,2955],{},"*.host",", never a URL. See ",[476,2958,2960],{"href":2959},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fpermissions#target-syntax","Target Syntax"," for the rules Engine applies.",[455,2963,2965],{"id":2964},"throw-errors","Throw Errors",[459,2967,2968,2969,2971,2972,2976],{},"A data connector reports a failure by throwing one of these classes from ",[462,2970,742],{}," or a handler. Each class carries its code, and Engine passes only the code and the message on. ",[476,2973,2975],{"href":2974},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Ferrors","Data Connector Errors"," covers when to throw each class, the HTTP status callers see, and which failures deactivate a data source.",[503,2978,2979,2992],{},[506,2980,2981],{},[509,2982,2983,2986,2989],{},[512,2984,2985],{},"Class",[512,2987,2988],{},"Code",[512,2990,2991],{},"Throw when",[521,2993,2994,3012,3030,3048,3066,3082,3100,3118,3136],{},[509,2995,2996,3004,3009],{},[526,2997,2998],{},[476,2999,3001],{"href":3000},"#queryrejected",[462,3002,3003],{},"QueryRejected",[526,3005,3006],{},[462,3007,3008],{},"100",[526,3010,3011],{},"A valid query or write can't be served as asked",[509,3013,3014,3022,3027],{},[526,3015,3016],{},[476,3017,3019],{"href":3018},"#uniqueconstraintviolation",[462,3020,3021],{},"UniqueConstraintViolation",[526,3023,3024],{},[462,3025,3026],{},"1002",[526,3028,3029],{},"The external data source refuses a write because a value must be unique",[509,3031,3032,3040,3045],{},[526,3033,3034],{},[476,3035,3037],{"href":3036},"#nullconstraintviolation",[462,3038,3039],{},"NullConstraintViolation",[526,3041,3042],{},[462,3043,3044],{},"1003",[526,3046,3047],{},"The external data source refuses a write because a required value is missing",[509,3049,3050,3058,3063],{},[526,3051,3052],{},[476,3053,3055],{"href":3054},"#foreignkeyconstraintviolation",[462,3056,3057],{},"ForeignKeyConstraintViolation",[526,3059,3060],{},[462,3061,3062],{},"1004",[526,3064,3065],{},"The external data source refuses a write because of a reference",[509,3067,3068,3074,3079],{},[526,3069,3070],{},[476,3071,3072],{"href":1530},[462,3073,1533],{},[526,3075,3076],{},[462,3077,3078],{},"2001",[526,3080,3081],{},"The configuration is missing a value or has a wrong one",[509,3083,3084,3092,3097],{},[526,3085,3086],{},[476,3087,3089],{"href":3088},"#accessdenied",[462,3090,3091],{},"AccessDenied",[526,3093,3094],{},[462,3095,3096],{},"2002",[526,3098,3099],{},"The external data source refuses this account",[509,3101,3102,3110,3115],{},[526,3103,3104],{},[476,3105,3107],{"href":3106},"#collectionnotfound",[462,3108,3109],{},"CollectionNotFound",[526,3111,3112],{},[462,3113,3114],{},"2004",[526,3116,3117],{},"A declared collection no longer exists in the external data source",[509,3119,3120,3128,3133],{},[526,3121,3122],{},[476,3123,3125],{"href":3124},"#connectionfailed",[462,3126,3127],{},"ConnectionFailed",[526,3129,3130],{},[462,3131,3132],{},"5001",[526,3134,3135],{},"The external data source can't be reached or won't answer for now",[509,3137,3138,3146,3151],{},[526,3139,3140],{},[476,3141,3143],{"href":3142},"#ratelimited",[462,3144,3145],{},"RateLimited",[526,3147,3148],{},[462,3149,3150],{},"5002",[526,3152,3153],{},"The external data source is throttling the connector",[459,3155,3156,3157,3160],{},"For anything no class describes, throw a plain ",[462,3158,3159],{},"Error",". Engine reports it as a failed query.",[620,3162,3164],{"id":3163},"connectorerror",[462,3165,3166],{},"ConnectorError",[459,3168,3169],{},"The abstract base class of every kit error class.",[629,3171,3173],{"className":631,"code":3172,"filename":633,"language":634,"meta":635,"style":635},"abstract class ConnectorError extends Error {\n    readonly monospace: ConnectorErrorBrand;\n    protected constructor(code: ThrownErrorCode, message: string, options?: ConnectorErrorOptions);\n}\n",[462,3174,3175,3192,3205,3238],{"__ignoreMap":635},[639,3176,3177,3180,3183,3186,3188,3190],{"class":641,"line":642},[639,3178,3179],{"class":645},"abstract",[639,3181,3182],{"class":645}," class",[639,3184,3185],{"class":649}," ConnectorError",[639,3187,2060],{"class":645},[639,3189,1119],{"class":649},[639,3191,993],{"class":653},[639,3193,3194,3197,3200,3203],{"class":641,"line":832},[639,3195,3196],{"class":645},"    readonly",[639,3198,3199],{"class":645}," monospace:",[639,3201,3202],{"class":649}," ConnectorErrorBrand",[639,3204,829],{"class":653},[639,3206,3207,3210,3213,3215,3218,3221,3223,3226,3228,3230,3233,3236],{"class":641,"line":851},[639,3208,3209],{"class":645},"    protected",[639,3211,3212],{"class":645}," constructor",[639,3214,1099],{"class":653},[639,3216,3217],{"class":645},"code:",[639,3219,3220],{"class":649}," ThrownErrorCode",[639,3222,672],{"class":653},[639,3224,3225],{"class":645},"message:",[639,3227,2853],{"class":668},[639,3229,672],{"class":653},[639,3231,3232],{"class":645},"options?:",[639,3234,3235],{"class":649}," ConnectorErrorOptions",[639,3237,1147],{"class":653},[639,3239,3240],{"class":641,"line":875},[639,3241,1460],{"class":653},[459,3243,3244,3245,3247,3248,3250,3251,3254,3255,3258,3259,3263,3264,3267,3268,3270],{},"Its constructor is protected: throw one of the classes below, never ",[462,3246,3166],{}," itself. Every subclass sets ",[462,3249,953],{}," to the class's name and ",[462,3252,3253],{},"monospace"," to ",[462,3256,3257],{},"{ code }",", the ",[476,3260,3262],{"href":3261},"#connectorerrorbrand","brand"," Engine reads. ",[462,3265,3266],{},"cause"," from the options is set on the error as the standard ",[462,3269,3159],{}," cause.",[459,3272,3273,3274,3276,3277,3280,3281,586],{},"Engine recognizes an error by its ",[462,3275,3253],{}," property, not by ",[462,3278,3279],{},"instanceof ConnectorError",". See ",[476,3282,3284],{"href":3283},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Ferrors#throw-a-connector-error","Throw a Connector Error",[620,3286,3288],{"id":3287},"connectorerroroptions",[462,3289,3290],{},"ConnectorErrorOptions",[459,3292,3293],{},"The optional second argument of every error class.",[629,3295,3297],{"className":631,"code":3296,"filename":633,"language":634,"meta":635,"style":635},"interface ConnectorErrorOptions {\n    cause?: unknown;\n}\n",[462,3298,3299,3307,3316],{"__ignoreMap":635},[639,3300,3301,3303,3305],{"class":641,"line":642},[639,3302,1380],{"class":645},[639,3304,3235],{"class":649},[639,3306,993],{"class":653},[639,3308,3309,3312,3314],{"class":641,"line":832},[639,3310,3311],{"class":645},"    cause?:",[639,3313,1900],{"class":668},[639,3315,829],{"class":653},[639,3317,3318],{"class":641,"line":851},[639,3319,1460],{"class":653},[459,3321,3322,3324,3325,3328,3329,3331,3332,586],{},[462,3323,3266],{}," stays on the JavaScript error and never reaches the caller. Keep a ",[462,3326,3327],{},"fetch"," rejection as ",[462,3330,3266],{},": when the data source's permissions refused the request, Engine finds the denial there and reports a permission error instead. See ",[476,3333,3335],{"href":3334},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Fpermissions#handle-a-denied-request","Handle a Denied Request",[620,3337,3339],{"id":3338},"queryrejected",[462,3340,3003],{},[459,3342,3343],{},"Refuses a valid query or write the connector can't serve as asked, with a message for the caller.",[629,3345,3347],{"className":631,"code":3346,"filename":633,"language":634,"meta":635,"style":635},"class QueryRejected extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,3348,3349,3363,3382],{"__ignoreMap":635},[639,3350,3351,3354,3357,3359,3361],{"class":641,"line":642},[639,3352,3353],{"class":645},"class",[639,3355,3356],{"class":649}," QueryRejected",[639,3358,2060],{"class":645},[639,3360,3185],{"class":649},[639,3362,993],{"class":653},[639,3364,3365,3368,3370,3372,3374,3376,3378,3380],{"class":641,"line":832},[639,3366,3367],{"class":645},"    constructor",[639,3369,1099],{"class":653},[639,3371,3225],{"class":645},[639,3373,2853],{"class":668},[639,3375,672],{"class":653},[639,3377,3232],{"class":645},[639,3379,3235],{"class":649},[639,3381,1147],{"class":653},[639,3383,3384],{"class":641,"line":851},[639,3385,1460],{"class":653},[459,3387,3388],{},"Throw it for a request that fits your declaration but that the external data source can't serve. Examples are a missing filter it requires, a page beyond its window, or a value outside a field's rule. The caller can change the request, so write the message for them. The Quickstart connector refuses a read past the search API's window:",[629,3390,3392],{"className":631,"code":3391,"filename":2293,"language":634,"meta":635,"style":635},"    \u002F\u002F A read past the window still succeeds when fewer items match, so count the matches first and\n    \u002F\u002F end the read at the last match.\n    if (end > SEARCH_WINDOW) {\n        const { pagination } = await search(query.collection, { ...base, size: 0 });\n        end = Math.min(end, pagination.total);\n\n        if (end > SEARCH_WINDOW) {\n            \u002F\u002F The caller can narrow this read, so the message says how.\n            throw new QueryRejected(`The Art Institute search API returns only the first ${SEARCH_WINDOW} results. Narrow the filter or read an earlier page.`);\n        }\n    }\n",[462,3393,3394,3399,3404,3421,3462,3492,3496,3511,3516,3538,3543],{"__ignoreMap":635},[639,3395,3396],{"class":641,"line":642},[639,3397,3398],{"class":1053},"    \u002F\u002F A read past the window still succeeds when fewer items match, so count the matches first and\n",[639,3400,3401],{"class":641,"line":832},[639,3402,3403],{"class":1053},"    \u002F\u002F end the read at the last match.\n",[639,3405,3406,3408,3410,3413,3416,3419],{"class":641,"line":851},[639,3407,2387],{"class":645},[639,3409,1069],{"class":653},[639,3411,3412],{"class":816},"end",[639,3414,3415],{"class":645}," >",[639,3417,3418],{"class":649}," SEARCH_WINDOW",[639,3420,1176],{"class":653},[639,3422,3423,3425,3427,3430,3432,3434,3436,3438,3440,3442,3444,3446,3449,3452,3455,3458,3460],{"class":641,"line":875},[639,3424,1739],{"class":645},[639,3426,813],{"class":653},[639,3428,3429],{"class":649},"pagination",[639,3431,819],{"class":653},[639,3433,2072],{"class":645},[639,3435,1197],{"class":645},[639,3437,1297],{"class":649},[639,3439,1099],{"class":653},[639,3441,1044],{"class":816},[639,3443,586],{"class":653},[639,3445,939],{"class":816},[639,3447,3448],{"class":653},", { ",[639,3450,3451],{"class":645},"...",[639,3453,3454],{"class":816},"base",[639,3456,3457],{"class":653},", size: ",[639,3459,1308],{"class":649},[639,3461,1311],{"class":653},[639,3463,3464,3467,3469,3472,3474,3477,3479,3481,3483,3485,3487,3490],{"class":641,"line":894},[639,3465,3466],{"class":816},"        end",[639,3468,660],{"class":645},[639,3470,3471],{"class":816}," Math",[639,3473,586],{"class":653},[639,3475,3476],{"class":649},"min",[639,3478,1099],{"class":653},[639,3480,3412],{"class":816},[639,3482,672],{"class":653},[639,3484,3429],{"class":816},[639,3486,586],{"class":653},[639,3488,3489],{"class":816},"total",[639,3491,1147],{"class":653},[639,3493,3494],{"class":641,"line":901},[639,3495,898],{"emptyLinePlaceholder":897},[639,3497,3498,3501,3503,3505,3507,3509],{"class":641,"line":959},[639,3499,3500],{"class":645},"        if",[639,3502,1069],{"class":653},[639,3504,3412],{"class":816},[639,3506,3415],{"class":645},[639,3508,3418],{"class":649},[639,3510,1176],{"class":653},[639,3512,3513],{"class":641,"line":964},[639,3514,3515],{"class":1053},"            \u002F\u002F The caller can narrow this read, so the message says how.\n",[639,3517,3518,3521,3523,3525,3527,3530,3533,3536],{"class":641,"line":978},[639,3519,3520],{"class":645},"            throw",[639,3522,912],{"class":645},[639,3524,3356],{"class":649},[639,3526,1099],{"class":653},[639,3528,3529],{"class":825},"`The Art Institute search API returns only the first ${",[639,3531,3532],{"class":649},"SEARCH_WINDOW",[639,3534,3535],{"class":825},"} results. Narrow the filter or read an earlier page.`",[639,3537,1147],{"class":653},[639,3539,3540],{"class":641,"line":987},[639,3541,3542],{"class":653},"        }\n",[639,3544,3545],{"class":641,"line":996},[639,3546,3547],{"class":653},"    }\n",[459,3549,3550,3551,3554,3555,3558,3559,3561,3562,3280,3564,586],{},"Some shapes arrive although your declaration doesn't list them, because Engine composes them: ",[462,3552,3553],{},"not"," around an update's field rules, and ",[462,3556,3557],{},"or"," across permission rules. Throw ",[462,3560,3003],{}," for those you can't serve. For a request that names something you never declared, such as an unknown collection or operation, throw a plain ",[462,3563,3159],{},[476,3565,3567],{"href":3566},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Ferrors#tell-queryrejected-from-a-plain-error","Tell QueryRejected from a Plain Error",[620,3569,3571],{"id":3570},"uniqueconstraintviolation",[462,3572,3021],{},[459,3574,3575],{},"Reports a write the external data source refuses because a value that must be unique already exists.",[629,3577,3579],{"className":631,"code":3578,"filename":633,"language":634,"meta":635,"style":635},"class UniqueConstraintViolation extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,3580,3581,3594,3612],{"__ignoreMap":635},[639,3582,3583,3585,3588,3590,3592],{"class":641,"line":642},[639,3584,3353],{"class":645},[639,3586,3587],{"class":649}," UniqueConstraintViolation",[639,3589,2060],{"class":645},[639,3591,3185],{"class":649},[639,3593,993],{"class":653},[639,3595,3596,3598,3600,3602,3604,3606,3608,3610],{"class":641,"line":832},[639,3597,3367],{"class":645},[639,3599,1099],{"class":653},[639,3601,3225],{"class":645},[639,3603,2853],{"class":668},[639,3605,672],{"class":653},[639,3607,3232],{"class":645},[639,3609,3235],{"class":649},[639,3611,1147],{"class":653},[639,3613,3614],{"class":641,"line":851},[639,3615,1460],{"class":653},[620,3617,3619],{"id":3618},"nullconstraintviolation",[462,3620,3039],{},[459,3622,3623],{},"Reports a write the external data source refuses because it requires a value the request left empty.",[629,3625,3627],{"className":631,"code":3626,"filename":633,"language":634,"meta":635,"style":635},"class NullConstraintViolation extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,3628,3629,3642,3660],{"__ignoreMap":635},[639,3630,3631,3633,3636,3638,3640],{"class":641,"line":642},[639,3632,3353],{"class":645},[639,3634,3635],{"class":649}," NullConstraintViolation",[639,3637,2060],{"class":645},[639,3639,3185],{"class":649},[639,3641,993],{"class":653},[639,3643,3644,3646,3648,3650,3652,3654,3656,3658],{"class":641,"line":832},[639,3645,3367],{"class":645},[639,3647,1099],{"class":653},[639,3649,3225],{"class":645},[639,3651,2853],{"class":668},[639,3653,672],{"class":653},[639,3655,3232],{"class":645},[639,3657,3235],{"class":649},[639,3659,1147],{"class":653},[639,3661,3662],{"class":641,"line":851},[639,3663,1460],{"class":653},[620,3665,3667],{"id":3666},"foreignkeyconstraintviolation",[462,3668,3057],{},[459,3670,3671],{},"Reports a write the external data source refuses because of a reference: the item it points to doesn't exist, or other items still point to the one being deleted.",[629,3673,3675],{"className":631,"code":3674,"filename":633,"language":634,"meta":635,"style":635},"class ForeignKeyConstraintViolation extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,3676,3677,3690,3708],{"__ignoreMap":635},[639,3678,3679,3681,3684,3686,3688],{"class":641,"line":642},[639,3680,3353],{"class":645},[639,3682,3683],{"class":649}," ForeignKeyConstraintViolation",[639,3685,2060],{"class":645},[639,3687,3185],{"class":649},[639,3689,993],{"class":653},[639,3691,3692,3694,3696,3698,3700,3702,3704,3706],{"class":641,"line":832},[639,3693,3367],{"class":645},[639,3695,1099],{"class":653},[639,3697,3225],{"class":645},[639,3699,2853],{"class":668},[639,3701,672],{"class":653},[639,3703,3232],{"class":645},[639,3705,3235],{"class":649},[639,3707,1147],{"class":653},[639,3709,3710],{"class":641,"line":851},[639,3711,1460],{"class":653},[459,3713,3714,3715,3717],{},"The Stripe connector maps Stripe's error codes to the three constraint classes. Not every missing object is an error. A retrieve answers a missing object as no item, and a keyed read then answers ",[462,3716,2288],{},". A list filtered by a missing referenced object answers no items.",[459,3719,3720,3721,3724,3725,3727,3728,3730,3731,694],{},"A missing-object error that reaches the classifier becomes ",[462,3722,3723],{},"StripeObjectMissing",", the connector's own subclass of ",[462,3726,3159],{},". Its keyed writes answer it as ",[462,3729,2288],{},". Anywhere else, such as a bulk write or a later page of a list, it reaches Engine as a plain ",[462,3732,3159],{},[629,3734,3737],{"className":631,"code":3735,"filename":3736,"language":634,"meta":635,"style":635},"    switch (detail.code) {\n        case 'resource_missing':\n            \u002F\u002F `param` names what is missing: `id` for the object in the path. On a write, any other\n            \u002F\u002F field is an object the written values refer to, such as a new price's `product`.\n            if (method === 'POST' && detail.param !== undefined && detail.param !== 'id') return new ForeignKeyConstraintViolation(message);\n            return new StripeObjectMissing(message);\n        case 'resource_already_exists':\n            return new UniqueConstraintViolation(message);\n        case 'parameter_missing':\n            return new NullConstraintViolation(message);\n    }\n","src\u002Fdata-connectors\u002Fstripe\u002Fclient.ts",[462,3738,3739,3755,3765,3770,3775,3833,3849,3858,3872,3881,3895],{"__ignoreMap":635},[639,3740,3741,3744,3746,3749,3751,3753],{"class":641,"line":642},[639,3742,3743],{"class":645},"    switch",[639,3745,1069],{"class":653},[639,3747,3748],{"class":816},"detail",[639,3750,586],{"class":653},[639,3752,462],{"class":816},[639,3754,1176],{"class":653},[639,3756,3757,3760,3763],{"class":641,"line":832},[639,3758,3759],{"class":645},"        case",[639,3761,3762],{"class":825}," 'resource_missing'",[639,3764,1188],{"class":653},[639,3766,3767],{"class":641,"line":851},[639,3768,3769],{"class":1053},"            \u002F\u002F `param` names what is missing: `id` for the object in the path. On a write, any other\n",[639,3771,3772],{"class":641,"line":875},[639,3773,3774],{"class":1053},"            \u002F\u002F field is an object the written values refer to, such as a new price's `product`.\n",[639,3776,3777,3780,3782,3785,3787,3790,3793,3796,3798,3801,3803,3805,3807,3809,3811,3813,3815,3818,3820,3822,3824,3826,3828,3831],{"class":641,"line":894},[639,3778,3779],{"class":645},"            if",[639,3781,1069],{"class":653},[639,3783,3784],{"class":816},"method",[639,3786,2489],{"class":645},[639,3788,3789],{"class":825}," 'POST'",[639,3791,3792],{"class":645}," &&",[639,3794,3795],{"class":816}," detail",[639,3797,586],{"class":653},[639,3799,3800],{"class":816},"param",[639,3802,1079],{"class":645},[639,3804,1082],{"class":649},[639,3806,3792],{"class":645},[639,3808,3795],{"class":816},[639,3810,586],{"class":653},[639,3812,3800],{"class":816},[639,3814,1079],{"class":645},[639,3816,3817],{"class":825}," 'id'",[639,3819,942],{"class":653},[639,3821,2422],{"class":645},[639,3823,912],{"class":645},[639,3825,3683],{"class":649},[639,3827,1099],{"class":653},[639,3829,3830],{"class":816},"message",[639,3832,1147],{"class":653},[639,3834,3835,3838,3840,3843,3845,3847],{"class":641,"line":901},[639,3836,3837],{"class":645},"            return",[639,3839,912],{"class":645},[639,3841,3842],{"class":649}," StripeObjectMissing",[639,3844,1099],{"class":653},[639,3846,3830],{"class":816},[639,3848,1147],{"class":653},[639,3850,3851,3853,3856],{"class":641,"line":959},[639,3852,3759],{"class":645},[639,3854,3855],{"class":825}," 'resource_already_exists'",[639,3857,1188],{"class":653},[639,3859,3860,3862,3864,3866,3868,3870],{"class":641,"line":964},[639,3861,3837],{"class":645},[639,3863,912],{"class":645},[639,3865,3587],{"class":649},[639,3867,1099],{"class":653},[639,3869,3830],{"class":816},[639,3871,1147],{"class":653},[639,3873,3874,3876,3879],{"class":641,"line":978},[639,3875,3759],{"class":645},[639,3877,3878],{"class":825}," 'parameter_missing'",[639,3880,1188],{"class":653},[639,3882,3883,3885,3887,3889,3891,3893],{"class":641,"line":987},[639,3884,3837],{"class":645},[639,3886,912],{"class":645},[639,3888,3635],{"class":649},[639,3890,1099],{"class":653},[639,3892,3830],{"class":816},[639,3894,1147],{"class":653},[639,3896,3897],{"class":641,"line":996},[639,3898,3547],{"class":653},[620,3900,3902],{"id":3901},"invalidconfiguration",[462,3903,1533],{},[459,3905,3906],{},"Reports a data source configuration that is missing a value or has a wrong one, found without asking the external data source.",[629,3908,3910],{"className":631,"code":3909,"filename":633,"language":634,"meta":635,"style":635},"class InvalidConfiguration extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,3911,3912,3925,3943],{"__ignoreMap":635},[639,3913,3914,3916,3919,3921,3923],{"class":641,"line":642},[639,3915,3353],{"class":645},[639,3917,3918],{"class":649}," InvalidConfiguration",[639,3920,2060],{"class":645},[639,3922,3185],{"class":649},[639,3924,993],{"class":653},[639,3926,3927,3929,3931,3933,3935,3937,3939,3941],{"class":641,"line":832},[639,3928,3367],{"class":645},[639,3930,1099],{"class":653},[639,3932,3225],{"class":645},[639,3934,2853],{"class":668},[639,3936,672],{"class":653},[639,3938,3232],{"class":645},[639,3940,3235],{"class":649},[639,3942,1147],{"class":653},[639,3944,3945],{"class":641,"line":851},[639,3946,1460],{"class":653},[459,3948,3949,3950,3952,3953,3955,3956,3960],{},"Nothing validates a connector's configuration before ",[462,3951,742],{}," receives it, so raising this is the connector's job. Thrown from ",[462,3954,742],{},", it deactivates the data source until the extension is reloaded. For credentials the external data source refuses, throw ",[476,3957,3958],{"href":3088},[462,3959,3091],{},". The Stripe connector checks each value it reads:",[629,3962,3965],{"className":631,"code":3963,"filename":3964,"language":634,"meta":635,"style":635},"\u002F**\n * Nothing validates a connector's configuration before `setup` receives it, so this does. An\n * `InvalidConfiguration` from `setup` fails a connection test or a data source create with a 422.\n *\u002F\nexport function parseConfig(value: unknown): StripeConfig {\n    if (!isObject(value)) throw new InvalidConfiguration('Stripe configuration must be an object.');\n\n    const apiKey = value.apiKey;\n\n    if (typeof apiKey !== 'string' || !\u002F^(?:sk|rk)_(?:test|live)_\\w+$\u002Fu.test(apiKey)) {\n        throw new InvalidConfiguration('Stripe configuration `apiKey` must be a secret (`sk_`) or restricted (`rk_`) key.');\n    }\n","src\u002Fdata-connectors\u002Fstripe\u002Fconfig.ts",[462,3966,3967,3971,3976,3981,3985,4009,4042,4046,4064,4068,4128,4144],{"__ignoreMap":635},[639,3968,3969],{"class":641,"line":642},[639,3970,2300],{"class":1053},[639,3972,3973],{"class":641,"line":832},[639,3974,3975],{"class":1053}," * Nothing validates a connector's configuration before `setup` receives it, so this does. An\n",[639,3977,3978],{"class":641,"line":851},[639,3979,3980],{"class":1053}," * `InvalidConfiguration` from `setup` fails a connection test or a data source create with a 422.\n",[639,3982,3983],{"class":641,"line":875},[639,3984,2315],{"class":1053},[639,3986,3987,3989,3991,3993,3995,3998,4000,4002,4004,4007],{"class":641,"line":894},[639,3988,967],{"class":645},[639,3990,2325],{"class":645},[639,3992,1747],{"class":649},[639,3994,1099],{"class":653},[639,3996,3997],{"class":645},"value:",[639,3999,1900],{"class":668},[639,4001,2338],{"class":653},[639,4003,694],{"class":645},[639,4005,4006],{"class":649}," StripeConfig",[639,4008,993],{"class":653},[639,4010,4011,4013,4015,4018,4021,4023,4026,4028,4031,4033,4035,4037,4040],{"class":641,"line":901},[639,4012,2387],{"class":645},[639,4014,1069],{"class":653},[639,4016,4017],{"class":645},"!",[639,4019,4020],{"class":649},"isObject",[639,4022,1099],{"class":653},[639,4024,4025],{"class":816},"value",[639,4027,2419],{"class":653},[639,4029,4030],{"class":645},"throw",[639,4032,912],{"class":645},[639,4034,3918],{"class":649},[639,4036,1099],{"class":653},[639,4038,4039],{"class":825},"'Stripe configuration must be an object.'",[639,4041,1147],{"class":653},[639,4043,4044],{"class":641,"line":959},[639,4045,898],{"emptyLinePlaceholder":897},[639,4047,4048,4050,4053,4055,4058,4060,4062],{"class":641,"line":964},[639,4049,2364],{"class":645},[639,4051,4052],{"class":649}," apiKey",[639,4054,660],{"class":645},[639,4056,4057],{"class":816}," value",[639,4059,586],{"class":653},[639,4061,1780],{"class":816},[639,4063,829],{"class":653},[639,4065,4066],{"class":641,"line":978},[639,4067,898],{"emptyLinePlaceholder":897},[639,4069,4070,4072,4074,4076,4078,4080,4083,4085,4087,4090,4093,4096,4098,4101,4103,4106,4109,4112,4114,4117,4119,4122,4124,4126],{"class":641,"line":987},[639,4071,2387],{"class":645},[639,4073,1069],{"class":653},[639,4075,2392],{"class":645},[639,4077,4052],{"class":816},[639,4079,1079],{"class":645},[639,4081,4082],{"class":825}," 'string'",[639,4084,1085],{"class":645},[639,4086,1088],{"class":645},[639,4088,4089],{"class":825},"\u002F",[639,4091,4092],{"class":645},"^",[639,4094,4095],{"class":825},"(?:sk",[639,4097,2099],{"class":645},[639,4099,4100],{"class":825},"rk)_(?:test",[639,4102,2099],{"class":645},[639,4104,4105],{"class":825},"live)_",[639,4107,4108],{"class":649},"\\w",[639,4110,4111],{"class":645},"+$",[639,4113,4089],{"class":825},[639,4115,4116],{"class":645},"u",[639,4118,586],{"class":653},[639,4120,4121],{"class":649},"test",[639,4123,1099],{"class":653},[639,4125,1780],{"class":816},[639,4127,1108],{"class":653},[639,4129,4130,4133,4135,4137,4139,4142],{"class":641,"line":996},[639,4131,4132],{"class":645},"        throw",[639,4134,912],{"class":645},[639,4136,3918],{"class":649},[639,4138,1099],{"class":653},[639,4140,4141],{"class":825},"'Stripe configuration `apiKey` must be a secret (`sk_`) or restricted (`rk_`) key.'",[639,4143,1147],{"class":653},[639,4145,4146],{"class":641,"line":1004},[639,4147,3547],{"class":653},[459,4149,1351,4150,586],{},[476,4151,4153],{"href":4152},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Ferrors#use-invalidconfiguration-and-accessdenied-for-configuration","Use InvalidConfiguration and AccessDenied for Configuration",[620,4155,4157],{"id":4156},"accessdenied",[462,4158,3091],{},[459,4160,4161],{},"Reports that the external data source refuses this account. Its credentials are rejected, expired or revoked. Or they lack a scope, can't reach the resource, or exceed the plan.",[629,4163,4165],{"className":631,"code":4164,"filename":633,"language":634,"meta":635,"style":635},"class AccessDenied extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,4166,4167,4180,4198],{"__ignoreMap":635},[639,4168,4169,4171,4174,4176,4178],{"class":641,"line":642},[639,4170,3353],{"class":645},[639,4172,4173],{"class":649}," AccessDenied",[639,4175,2060],{"class":645},[639,4177,3185],{"class":649},[639,4179,993],{"class":653},[639,4181,4182,4184,4186,4188,4190,4192,4194,4196],{"class":641,"line":832},[639,4183,3367],{"class":645},[639,4185,1099],{"class":653},[639,4187,3225],{"class":645},[639,4189,2853],{"class":668},[639,4191,672],{"class":653},[639,4193,3232],{"class":645},[639,4195,3235],{"class":649},[639,4197,1147],{"class":653},[639,4199,4200],{"class":641,"line":851},[639,4201,1460],{"class":653},[459,4203,4204],{},"Only someone with access to the external data source's account can fix it. Keep credentials out of the message: the Stripe connector uses a fixed one, because Stripe's own message echoes part of the key.",[629,4206,4208],{"className":631,"code":4207,"filename":3736,"language":634,"meta":635,"style":635},"    \u002F\u002F Only someone with access to the Stripe account can fix the key. Stripe's message for a rejected\n    \u002F\u002F key echoes part of the key, so it stays out.\n    if (status === 401 || status === 403) return new AccessDenied(`Stripe rejected the API key (HTTP ${status}).`);\n",[462,4209,4210,4215,4220],{"__ignoreMap":635},[639,4211,4212],{"class":641,"line":642},[639,4213,4214],{"class":1053},"    \u002F\u002F Only someone with access to the Stripe account can fix the key. Stripe's message for a rejected\n",[639,4216,4217],{"class":641,"line":832},[639,4218,4219],{"class":1053},"    \u002F\u002F key echoes part of the key, so it stays out.\n",[639,4221,4222,4224,4226,4229,4231,4234,4236,4239,4241,4244,4246,4248,4250,4252,4254,4257,4259,4262],{"class":641,"line":851},[639,4223,2387],{"class":645},[639,4225,1069],{"class":653},[639,4227,4228],{"class":816},"status",[639,4230,2489],{"class":645},[639,4232,4233],{"class":649}," 401",[639,4235,1085],{"class":645},[639,4237,4238],{"class":816}," status",[639,4240,2489],{"class":645},[639,4242,4243],{"class":649}," 403",[639,4245,942],{"class":653},[639,4247,2422],{"class":645},[639,4249,912],{"class":645},[639,4251,4173],{"class":649},[639,4253,1099],{"class":653},[639,4255,4256],{"class":825},"`Stripe rejected the API key (HTTP ${",[639,4258,4228],{"class":816},[639,4260,4261],{"class":825},"}).`",[639,4263,1147],{"class":653},[620,4265,4267],{"id":4266},"collectionnotfound",[462,4268,3109],{},[459,4270,4271],{},"Reports that a collection the connector declared no longer exists in the external data source, for example an object type deleted after the data source was introspected.",[629,4273,4275],{"className":631,"code":4274,"filename":633,"language":634,"meta":635,"style":635},"class CollectionNotFound extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,4276,4277,4290,4308],{"__ignoreMap":635},[639,4278,4279,4281,4284,4286,4288],{"class":641,"line":642},[639,4280,3353],{"class":645},[639,4282,4283],{"class":649}," CollectionNotFound",[639,4285,2060],{"class":645},[639,4287,3185],{"class":649},[639,4289,993],{"class":653},[639,4291,4292,4294,4296,4298,4300,4302,4304,4306],{"class":641,"line":832},[639,4293,3367],{"class":645},[639,4295,1099],{"class":653},[639,4297,3225],{"class":645},[639,4299,2853],{"class":668},[639,4301,672],{"class":653},[639,4303,3232],{"class":645},[639,4305,3235],{"class":649},[639,4307,1147],{"class":653},[639,4309,4310],{"class":641,"line":851},[639,4311,1460],{"class":653},[459,4313,4314,4315,4317],{},"Engine sends only declared collections. For any other name, throw a plain ",[462,4316,3159],{},", as the example connectors do.",[620,4319,4321],{"id":4320},"connectionfailed",[462,4322,3127],{},[459,4324,4325],{},"Reports that the external data source can't be reached or won't answer for now: a network failure, a timeout, maintenance, or a server error it reports as temporary.",[629,4327,4329],{"className":631,"code":4328,"filename":633,"language":634,"meta":635,"style":635},"class ConnectionFailed extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,4330,4331,4344,4362],{"__ignoreMap":635},[639,4332,4333,4335,4338,4340,4342],{"class":641,"line":642},[639,4334,3353],{"class":645},[639,4336,4337],{"class":649}," ConnectionFailed",[639,4339,2060],{"class":645},[639,4341,3185],{"class":649},[639,4343,993],{"class":653},[639,4345,4346,4348,4350,4352,4354,4356,4358,4360],{"class":641,"line":832},[639,4347,3367],{"class":645},[639,4349,1099],{"class":653},[639,4351,3225],{"class":645},[639,4353,2853],{"class":668},[639,4355,672],{"class":653},[639,4357,3232],{"class":645},[639,4359,3235],{"class":649},[639,4361,1147],{"class":653},[639,4363,4364],{"class":641,"line":851},[639,4365,1460],{"class":653},[459,4367,4368,4369,4371,4372,4374],{},"The failure is temporary, so a caller can retry the request later. Wrapping a ",[462,4370,3327],{}," rejection in it is safe when you keep the rejection as ",[462,4373,3266],{},". The full Art Institute connector's search client:",[629,4376,4379],{"className":631,"code":4377,"filename":4378,"language":634,"meta":635,"style":635},"    catch (error) {\n        const isTimeout = error instanceof Error && error.name === 'TimeoutError';\n        const reason = isTimeout ? `did not answer within ${TIMEOUT_MS \u002F 1000} seconds` : 'could not be reached';\n        \u002F\u002F Keep the rejection as the `cause`: when the data source's permissions refused the request,\n        \u002F\u002F Engine finds that there and reports a permission error instead of a failed connection.\n        throw new ConnectionFailed(`The Art Institute API ${reason}.`, { cause: error });\n    }\n\n    if (response.status === 429) {\n        throw new RateLimited(`The Art Institute API rate limited the connector.${retryAfter(response)}`);\n    }\n\n    \u002F\u002F Treat a server error as an outage: a later request may work.\n    if (response.status >= 500) {\n        throw new ConnectionFailed(`The Art Institute API answered HTTP ${response.status}.`);\n    }\n","src\u002Fdata-connectors\u002Fartic\u002Fsearch.ts",[462,4380,4381,4393,4425,4460,4465,4470,4495,4499,4503,4523,4550,4554,4558,4563,4583,4606],{"__ignoreMap":635},[639,4382,4383,4386,4388,4391],{"class":641,"line":642},[639,4384,4385],{"class":645},"    catch",[639,4387,1069],{"class":653},[639,4389,4390],{"class":816},"error",[639,4392,1176],{"class":653},[639,4394,4395,4397,4400,4402,4405,4408,4410,4412,4414,4416,4418,4420,4423],{"class":641,"line":832},[639,4396,1739],{"class":645},[639,4398,4399],{"class":649}," isTimeout",[639,4401,660],{"class":645},[639,4403,4404],{"class":816}," error",[639,4406,4407],{"class":645}," instanceof",[639,4409,1119],{"class":649},[639,4411,3792],{"class":645},[639,4413,4404],{"class":816},[639,4415,586],{"class":653},[639,4417,953],{"class":816},[639,4419,2489],{"class":645},[639,4421,4422],{"class":825}," 'TimeoutError'",[639,4424,829],{"class":653},[639,4426,4427,4429,4432,4434,4436,4438,4441,4444,4447,4450,4453,4455,4458],{"class":641,"line":851},[639,4428,1739],{"class":645},[639,4430,4431],{"class":649}," reason",[639,4433,660],{"class":645},[639,4435,4399],{"class":816},[639,4437,2494],{"class":645},[639,4439,4440],{"class":825}," `did not answer within ${",[639,4442,4443],{"class":649},"TIMEOUT_MS",[639,4445,4446],{"class":645}," \u002F",[639,4448,4449],{"class":649}," 1000",[639,4451,4452],{"class":825},"} seconds`",[639,4454,2499],{"class":645},[639,4456,4457],{"class":825}," 'could not be reached'",[639,4459,829],{"class":653},[639,4461,4462],{"class":641,"line":875},[639,4463,4464],{"class":1053},"        \u002F\u002F Keep the rejection as the `cause`: when the data source's permissions refused the request,\n",[639,4466,4467],{"class":641,"line":894},[639,4468,4469],{"class":1053},"        \u002F\u002F Engine finds that there and reports a permission error instead of a failed connection.\n",[639,4471,4472,4474,4476,4478,4480,4483,4485,4488,4491,4493],{"class":641,"line":901},[639,4473,4132],{"class":645},[639,4475,912],{"class":645},[639,4477,4337],{"class":649},[639,4479,1099],{"class":653},[639,4481,4482],{"class":825},"`The Art Institute API ${",[639,4484,2898],{"class":816},[639,4486,4487],{"class":825},"}.`",[639,4489,4490],{"class":653},", { cause: ",[639,4492,4390],{"class":816},[639,4494,1311],{"class":653},[639,4496,4497],{"class":641,"line":959},[639,4498,3547],{"class":653},[639,4500,4501],{"class":641,"line":964},[639,4502,898],{"emptyLinePlaceholder":897},[639,4504,4505,4507,4509,4512,4514,4516,4518,4521],{"class":641,"line":978},[639,4506,2387],{"class":645},[639,4508,1069],{"class":653},[639,4510,4511],{"class":816},"response",[639,4513,586],{"class":653},[639,4515,4228],{"class":816},[639,4517,2489],{"class":645},[639,4519,4520],{"class":649}," 429",[639,4522,1176],{"class":653},[639,4524,4525,4527,4529,4532,4534,4537,4540,4542,4544,4546,4548],{"class":641,"line":987},[639,4526,4132],{"class":645},[639,4528,912],{"class":645},[639,4530,4531],{"class":649}," RateLimited",[639,4533,1099],{"class":653},[639,4535,4536],{"class":825},"`The Art Institute API rate limited the connector.${",[639,4538,4539],{"class":649},"retryAfter",[639,4541,1099],{"class":825},[639,4543,4511],{"class":816},[639,4545,2338],{"class":825},[639,4547,2941],{"class":825},[639,4549,1147],{"class":653},[639,4551,4552],{"class":641,"line":996},[639,4553,3547],{"class":653},[639,4555,4556],{"class":641,"line":1004},[639,4557,898],{"emptyLinePlaceholder":897},[639,4559,4560],{"class":641,"line":1021},[639,4561,4562],{"class":1053},"    \u002F\u002F Treat a server error as an outage: a later request may work.\n",[639,4564,4565,4567,4569,4571,4573,4575,4578,4581],{"class":641,"line":1027},[639,4566,2387],{"class":645},[639,4568,1069],{"class":653},[639,4570,4511],{"class":816},[639,4572,586],{"class":653},[639,4574,4228],{"class":816},[639,4576,4577],{"class":645}," >=",[639,4579,4580],{"class":649}," 500",[639,4582,1176],{"class":653},[639,4584,4585,4587,4589,4591,4593,4596,4598,4600,4602,4604],{"class":641,"line":1032},[639,4586,4132],{"class":645},[639,4588,912],{"class":645},[639,4590,4337],{"class":649},[639,4592,1099],{"class":653},[639,4594,4595],{"class":825},"`The Art Institute API answered HTTP ${",[639,4597,4511],{"class":816},[639,4599,586],{"class":825},[639,4601,4228],{"class":816},[639,4603,4487],{"class":825},[639,4605,1147],{"class":653},[639,4607,4608],{"class":641,"line":1050},[639,4609,3547],{"class":653},[620,4611,4613],{"id":4612},"ratelimited",[462,4614,3145],{},[459,4616,4617],{},"Reports that the external data source is throttling the connector: a rate limit, or a quota that resets.",[629,4619,4621],{"className":631,"code":4620,"filename":633,"language":634,"meta":635,"style":635},"class RateLimited extends ConnectorError {\n    constructor(message: string, options?: ConnectorErrorOptions);\n}\n",[462,4622,4623,4635,4653],{"__ignoreMap":635},[639,4624,4625,4627,4629,4631,4633],{"class":641,"line":642},[639,4626,3353],{"class":645},[639,4628,4531],{"class":649},[639,4630,2060],{"class":645},[639,4632,3185],{"class":649},[639,4634,993],{"class":653},[639,4636,4637,4639,4641,4643,4645,4647,4649,4651],{"class":641,"line":832},[639,4638,3367],{"class":645},[639,4640,1099],{"class":653},[639,4642,3225],{"class":645},[639,4644,2853],{"class":668},[639,4646,672],{"class":653},[639,4648,3232],{"class":645},[639,4650,3235],{"class":649},[639,4652,1147],{"class":653},[639,4654,4655],{"class":641,"line":851},[639,4656,1460],{"class":653},[459,4658,4659,4660,4664,4665,4669,4670,586],{},"A caller can retry once the limit resets. For a limit that only a plan change lifts, throw ",[476,4661,4662],{"href":3088},[462,4663,3091],{},". The ",[476,4666,4667],{"href":3124},[462,4668,3127],{}," example above throws it for an HTTP ",[462,4671,4672],{},"429",[455,4674,4676],{"id":4675},"read-error-codes","Read Error Codes",[620,4678,4680],{"id":4679},"errorcode",[462,4681,541],{},[459,4683,4684,4685,586],{},"Maps each error name to its protocol code, for code that recognizes an error without ",[462,4686,4687],{},"instanceof",[629,4689,4691],{"className":631,"code":4690,"filename":633,"language":634,"meta":635,"style":635},"const ErrorCode: {\n    readonly QueryRejected: 100;\n    readonly UniqueConstraintViolation: 1002;\n    readonly NullConstraintViolation: 1003;\n    readonly ForeignKeyConstraintViolation: 1004;\n    readonly InvalidConfiguration: 2001;\n    readonly AccessDenied: 2002;\n    readonly InvalidPermissions: 2003;\n    readonly CollectionNotFound: 2004;\n    readonly ConnectionFailed: 5001;\n    readonly RateLimited: 5002;\n    readonly MethodNotFound: -32601;\n};\n",[462,4692,4693,4704,4716,4728,4740,4752,4764,4776,4788,4800,4812,4824,4839],{"__ignoreMap":635},[639,4694,4695,4697,4700,4702],{"class":641,"line":642},[639,4696,904],{"class":645},[639,4698,4699],{"class":649}," ErrorCode",[639,4701,694],{"class":645},[639,4703,993],{"class":653},[639,4705,4706,4708,4711,4714],{"class":641,"line":832},[639,4707,3196],{"class":645},[639,4709,4710],{"class":645}," QueryRejected:",[639,4712,4713],{"class":649}," 100",[639,4715,829],{"class":653},[639,4717,4718,4720,4723,4726],{"class":641,"line":851},[639,4719,3196],{"class":645},[639,4721,4722],{"class":645}," UniqueConstraintViolation:",[639,4724,4725],{"class":649}," 1002",[639,4727,829],{"class":653},[639,4729,4730,4732,4735,4738],{"class":641,"line":875},[639,4731,3196],{"class":645},[639,4733,4734],{"class":645}," NullConstraintViolation:",[639,4736,4737],{"class":649}," 1003",[639,4739,829],{"class":653},[639,4741,4742,4744,4747,4750],{"class":641,"line":894},[639,4743,3196],{"class":645},[639,4745,4746],{"class":645}," ForeignKeyConstraintViolation:",[639,4748,4749],{"class":649}," 1004",[639,4751,829],{"class":653},[639,4753,4754,4756,4759,4762],{"class":641,"line":901},[639,4755,3196],{"class":645},[639,4757,4758],{"class":645}," InvalidConfiguration:",[639,4760,4761],{"class":649}," 2001",[639,4763,829],{"class":653},[639,4765,4766,4768,4771,4774],{"class":641,"line":959},[639,4767,3196],{"class":645},[639,4769,4770],{"class":645}," AccessDenied:",[639,4772,4773],{"class":649}," 2002",[639,4775,829],{"class":653},[639,4777,4778,4780,4783,4786],{"class":641,"line":964},[639,4779,3196],{"class":645},[639,4781,4782],{"class":645}," InvalidPermissions:",[639,4784,4785],{"class":649}," 2003",[639,4787,829],{"class":653},[639,4789,4790,4792,4795,4798],{"class":641,"line":978},[639,4791,3196],{"class":645},[639,4793,4794],{"class":645}," CollectionNotFound:",[639,4796,4797],{"class":649}," 2004",[639,4799,829],{"class":653},[639,4801,4802,4804,4807,4810],{"class":641,"line":987},[639,4803,3196],{"class":645},[639,4805,4806],{"class":645}," ConnectionFailed:",[639,4808,4809],{"class":649}," 5001",[639,4811,829],{"class":653},[639,4813,4814,4816,4819,4822],{"class":641,"line":996},[639,4815,3196],{"class":645},[639,4817,4818],{"class":645}," RateLimited:",[639,4820,4821],{"class":649}," 5002",[639,4823,829],{"class":653},[639,4825,4826,4828,4831,4834,4837],{"class":641,"line":1004},[639,4827,3196],{"class":645},[639,4829,4830],{"class":645}," MethodNotFound:",[639,4832,4833],{"class":653}," -",[639,4835,4836],{"class":649},"32601",[639,4838,829],{"class":653},[639,4840,4841],{"class":641,"line":1021},[639,4842,4843],{"class":653},"};\n",[459,4845,4846,4847,766,4850,4853],{},"Compare with its entries, never with hard-coded numbers. The kit generates it from Engine's own list of codes. ",[462,4848,4849],{},"InvalidPermissions",[462,4851,4852],{},"MethodNotFound"," are raised only by Engine's side of the protocol, and no class throws them.",[459,4855,4856],{},"The full Art Institute connector's artifact smoke drives the built file and reads each refusal's code:",[629,4858,4863],{"className":4859,"code":4860,"filename":4861,"language":4862,"meta":635,"style":635},"language-js shiki shiki-themes monospace-light monospace-light monospace-dark","async function codeOf(promise) {\n    try {\n        await promise;\n    }\n    catch (error) {\n        assert.ok(error instanceof Error, 'the connector throws an Error');\n        return error.monospace?.code ?? PLAIN_ERROR;\n    }\n\n    assert.fail('expected the connector to throw');\n}\n","scripts\u002Fsmoke.mjs","js",[462,4864,4865,4882,4889,4899,4903,4913,4938,4961,4965,4969,4986],{"__ignoreMap":635},[639,4866,4867,4870,4872,4875,4877,4880],{"class":641,"line":642},[639,4868,4869],{"class":645},"async",[639,4871,2325],{"class":645},[639,4873,4874],{"class":649}," codeOf",[639,4876,1099],{"class":653},[639,4878,4879],{"class":645},"promise",[639,4881,1176],{"class":653},[639,4883,4884,4887],{"class":641,"line":832},[639,4885,4886],{"class":645},"    try",[639,4888,993],{"class":653},[639,4890,4891,4894,4897],{"class":641,"line":851},[639,4892,4893],{"class":645},"        await",[639,4895,4896],{"class":816}," promise",[639,4898,829],{"class":653},[639,4900,4901],{"class":641,"line":875},[639,4902,3547],{"class":653},[639,4904,4905,4907,4909,4911],{"class":641,"line":894},[639,4906,4385],{"class":645},[639,4908,1069],{"class":653},[639,4910,4390],{"class":816},[639,4912,1176],{"class":653},[639,4914,4915,4918,4920,4923,4925,4927,4929,4931,4933,4936],{"class":641,"line":901},[639,4916,4917],{"class":816},"        assert",[639,4919,586],{"class":653},[639,4921,4922],{"class":649},"ok",[639,4924,1099],{"class":653},[639,4926,4390],{"class":816},[639,4928,4407],{"class":645},[639,4930,1119],{"class":649},[639,4932,672],{"class":653},[639,4934,4935],{"class":825},"'the connector throws an Error'",[639,4937,1147],{"class":653},[639,4939,4940,4942,4944,4946,4948,4951,4953,4956,4959],{"class":641,"line":959},[639,4941,990],{"class":645},[639,4943,4404],{"class":816},[639,4945,586],{"class":653},[639,4947,3253],{"class":816},[639,4949,4950],{"class":653},"?.",[639,4952,462],{"class":816},[639,4954,4955],{"class":645}," ??",[639,4957,4958],{"class":649}," PLAIN_ERROR",[639,4960,829],{"class":653},[639,4962,4963],{"class":641,"line":964},[639,4964,3547],{"class":653},[639,4966,4967],{"class":641,"line":978},[639,4968,898],{"emptyLinePlaceholder":897},[639,4970,4971,4974,4976,4979,4981,4984],{"class":641,"line":987},[639,4972,4973],{"class":816},"    assert",[639,4975,586],{"class":653},[639,4977,4978],{"class":649},"fail",[639,4980,1099],{"class":653},[639,4982,4983],{"class":825},"'expected the connector to throw'",[639,4985,1147],{"class":653},[639,4987,4988],{"class":641,"line":996},[639,4989,1460],{"class":653},[459,4991,4992,4993,4995,4996,694],{},"One of its assertions checks that a ",[462,4994,3553],{},", which the connector can't translate, is refused with ",[462,4997,3003],{},[629,4999,5001],{"className":4859,"code":5000,"filename":4861,"language":4862,"meta":635,"style":635},"    assert.equal(await codeOf(read('artworks', { filter: { not: compare('equals', 'artistId', null) }, limit: 3 })), ErrorCode.QueryRejected);\n",[462,5002,5003],{"__ignoreMap":635},[639,5004,5005,5007,5009,5012,5014,5017,5019,5021,5024,5026,5028,5031,5034,5036,5038,5040,5043,5045,5047,5050,5053,5056,5058,5060,5062],{"class":641,"line":642},[639,5006,4973],{"class":816},[639,5008,586],{"class":653},[639,5010,5011],{"class":649},"equal",[639,5013,1099],{"class":653},[639,5015,5016],{"class":645},"await",[639,5018,4874],{"class":649},[639,5020,1099],{"class":653},[639,5022,5023],{"class":649},"read",[639,5025,1099],{"class":653},[639,5027,1302],{"class":825},[639,5029,5030],{"class":653},", { filter: { not: ",[639,5032,5033],{"class":649},"compare",[639,5035,1099],{"class":653},[639,5037,2448],{"class":825},[639,5039,672],{"class":653},[639,5041,5042],{"class":825},"'artistId'",[639,5044,672],{"class":653},[639,5046,2193],{"class":649},[639,5048,5049],{"class":653},") }, limit: ",[639,5051,5052],{"class":649},"3",[639,5054,5055],{"class":653}," })), ",[639,5057,541],{"class":816},[639,5059,586],{"class":653},[639,5061,3003],{"class":816},[639,5063,1147],{"class":653},[459,5065,1351,5066,766,5070,586],{},[476,5067,5069],{"href":5068},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Ferrors#read-codes-from-errorcode","Read Codes from ErrorCode",[476,5071,256],{"href":5072},"\u002Fdeveloper\u002Fextensions\u002Fdata-connectors\u002Ftesting#_3-run-an-artifact-smoke",[620,5074,5076],{"id":5075},"errorcodename",[462,5077,5078],{},"ErrorCodeName",[459,5080,5081,5082,586],{},"The name of any code in ",[462,5083,541],{},[629,5085,5087],{"className":631,"code":5086,"filename":633,"language":634,"meta":635,"style":635},"type ErrorCodeName = keyof typeof ErrorCode;\n",[462,5088,5089],{"__ignoreMap":635},[639,5090,5091,5093,5096,5098,5101,5104,5106],{"class":641,"line":642},[639,5092,2050],{"class":645},[639,5094,5095],{"class":649}," ErrorCodeName",[639,5097,660],{"class":645},[639,5099,5100],{"class":645}," keyof",[639,5102,5103],{"class":645}," typeof",[639,5105,4699],{"class":816},[639,5107,829],{"class":653},[620,5109,5111],{"id":5110},"shellerrorcodename",[462,5112,5113],{},"ShellErrorCodeName",[459,5115,5116],{},"The names of the codes only Engine's side of the protocol raises.",[629,5118,5120],{"className":631,"code":5119,"filename":633,"language":634,"meta":635,"style":635},"type ShellErrorCodeName = 'InvalidPermissions' | 'MethodNotFound';\n",[462,5121,5122],{"__ignoreMap":635},[639,5123,5124,5126,5129,5131,5134,5136,5139],{"class":641,"line":642},[639,5125,2050],{"class":645},[639,5127,5128],{"class":649}," ShellErrorCodeName",[639,5130,660],{"class":645},[639,5132,5133],{"class":825}," 'InvalidPermissions'",[639,5135,1445],{"class":645},[639,5137,5138],{"class":825}," 'MethodNotFound'",[639,5140,829],{"class":653},[459,5142,5143,1069,5145,5148,5149,1069,5151,5154],{},[462,5144,4849],{},[462,5146,5147],{},"2003",") reports a permission denial and ",[462,5150,4852],{},[462,5152,5153],{},"-32601",") a missing handler. The kit has no class for either.",[620,5156,5158],{"id":5157},"thrownerrorcodename",[462,5159,5160],{},"ThrownErrorCodeName",[459,5162,5163],{},"The names of the codes connector code throws, each through its own error class.",[629,5165,5167],{"className":631,"code":5166,"filename":633,"language":634,"meta":635,"style":635},"type ThrownErrorCodeName = Exclude\u003CErrorCodeName, ShellErrorCodeName>;\n",[462,5168,5169],{"__ignoreMap":635},[639,5170,5171,5173,5176,5178,5181,5183,5185,5187,5189],{"class":641,"line":642},[639,5172,2050],{"class":645},[639,5174,5175],{"class":649}," ThrownErrorCodeName",[639,5177,660],{"class":645},[639,5179,5180],{"class":649}," Exclude",[639,5182,654],{"class":653},[639,5184,5078],{"class":649},[639,5186,672],{"class":653},[639,5188,5113],{"class":649},[639,5190,704],{"class":653},[620,5192,5194],{"id":5193},"thrownerrorcode",[462,5195,5196],{},"ThrownErrorCode",[459,5198,5199],{},"The numeric codes connector code throws: the nine codes of the kit's error classes.",[629,5201,5203],{"className":631,"code":5202,"filename":633,"language":634,"meta":635,"style":635},"type ThrownErrorCode = (typeof ErrorCode)[ThrownErrorCodeName];\n",[462,5204,5205],{"__ignoreMap":635},[639,5206,5207,5209,5211,5213,5215,5217,5219,5222,5224],{"class":641,"line":642},[639,5208,2050],{"class":645},[639,5210,3220],{"class":649},[639,5212,660],{"class":645},[639,5214,1069],{"class":653},[639,5216,2392],{"class":645},[639,5218,4699],{"class":816},[639,5220,5221],{"class":653},")[",[639,5223,5160],{"class":649},[639,5225,5226],{"class":653},"];\n",[455,5228,5230],{"id":5229},"identify-descriptors-and-errors","Identify Descriptors and Errors",[459,5232,5233,5234,5237],{},"Engine identifies kit values by plain properties, not by class or ",[462,5235,5236],{},"Symbol",". Two bundled copies of the kit, or a connector written without it, work the same way.",[620,5239,5241],{"id":5240},"descriptormarker",[462,5242,5243],{},"DescriptorMarker",[459,5245,2603,5246,5248,5249,5251],{},[462,5247,3253],{}," property ",[462,5250,497],{}," adds to a descriptor.",[629,5253,5255],{"className":631,"code":5254,"filename":633,"language":634,"meta":635,"style":635},"interface DescriptorMarker {\n    kind: 'dataConnector';\n    apiVersion: 1;\n}\n",[462,5256,5257,5265,5275,5285],{"__ignoreMap":635},[639,5258,5259,5261,5263],{"class":641,"line":642},[639,5260,1380],{"class":645},[639,5262,1589],{"class":649},[639,5264,993],{"class":653},[639,5266,5267,5270,5273],{"class":641,"line":832},[639,5268,5269],{"class":645},"    kind:",[639,5271,5272],{"class":825}," 'dataConnector'",[639,5274,829],{"class":653},[639,5276,5277,5280,5283],{"class":641,"line":851},[639,5278,5279],{"class":645},"    apiVersion:",[639,5281,5282],{"class":649}," 1",[639,5284,829],{"class":653},[639,5286,5287],{"class":641,"line":875},[639,5288,1460],{"class":653},[459,5290,5291,5294,5295,5297],{},[462,5292,5293],{},"apiVersion"," describes the descriptor's shape, not the kit's package version. Engine recognizes a descriptor by its ",[462,5296,742],{}," function, so the marker is optional in a hand-written descriptor.",[620,5299,5301],{"id":5300},"connectorerrorbrand",[462,5302,5303],{},"ConnectorErrorBrand",[459,5305,2603,5306,5308],{},[462,5307,3253],{}," property every kit error carries: the error's code.",[629,5310,5312],{"className":631,"code":5311,"filename":633,"language":634,"meta":635,"style":635},"interface ConnectorErrorBrand {\n    code: ThrownErrorCode;\n}\n",[462,5313,5314,5322,5331],{"__ignoreMap":635},[639,5315,5316,5318,5320],{"class":641,"line":642},[639,5317,1380],{"class":645},[639,5319,3202],{"class":649},[639,5321,993],{"class":653},[639,5323,5324,5327,5329],{"class":641,"line":832},[639,5325,5326],{"class":645},"    code:",[639,5328,3220],{"class":649},[639,5330,829],{"class":653},[639,5332,5333],{"class":641,"line":851},[639,5334,1460],{"class":653},[459,5336,5337,5338,5340,5341,5343,5344,5347,5348,586],{},"Only ",[462,5339,462],{}," crosses to Engine, together with the error's ",[462,5342,3830],{},". Engine passes the message on to API callers in the HTTP error response. Keep secrets and personal data out of the message. A thrown object whose ",[462,5345,5346],{},"monospace.code"," is a safe integer is read the same way as a kit class. See ",[476,5349,5351],{"href":5350},"\u002Freference\u002Fextensions\u002Fdata-connectors\u002Ferrors#keep-secrets-out-of-messages","Keep Secrets out of Messages",[455,5353,5355],{"id":5354},"see-also","See Also",[2228,5357,5358,5366,5371,5376,5381],{},[2231,5359,5360,5362,5363,5365],{},[476,5361,410],{"href":592},": the entry, ",[462,5364,742],{},", the handlers, and the requests Engine sends",[2231,5367,5368,5370],{},[476,5369,2975],{"href":2974},": when to throw each class, and what callers see",[2231,5372,5373,5375],{},[476,5374,564],{"href":563},": the schema document and query types this module re-exports",[2231,5377,5378,5380],{},[476,5379,401],{"href":579},": build the schema document from typed definitions",[2231,5382,5383,5385],{},[476,5384,600],{"href":599},": build a read-only connector step by step",[5387,5388,5389],"style",{},"html pre.shiki code .sLVBU, html code.shiki .sLVBU{--shiki-light:#0891B2;--shiki-default:#0891B2;--shiki-dark:#22D3EE}html pre.shiki code .ssBNi, html code.shiki .ssBNi{--shiki-light:#1659E9;--shiki-default:#1659E9;--shiki-dark:#94B3F5}html pre.shiki code .sTMul, html code.shiki .sTMul{--shiki-light:#1F2937;--shiki-default:#1F2937;--shiki-dark:#94A3B8}html pre.shiki code .snHjA, html code.shiki .snHjA{--shiki-light:#124BC4;--shiki-default:#124BC4;--shiki-dark:#5B8EF4}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sNJ9c, html code.shiki .sNJ9c{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E2E8F0}html pre.shiki code .suKVh, html code.shiki .suKVh{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#F8FAFC}html pre.shiki code .seNfP, html code.shiki .seNfP{--shiki-light:#64748B;--shiki-default:#64748B;--shiki-dark:#94A3B8}",{"title":635,"searchDepth":832,"depth":832,"links":5391},[5392,5393,5402,5408,5421,5428,5432],{"id":457,"depth":832,"text":143},{"id":617,"depth":832,"text":618,"children":5394},[5395,5396,5397,5398,5399,5400,5401],{"id":622,"depth":851,"text":497},{"id":1362,"depth":851,"text":1365},{"id":1539,"depth":851,"text":1542},{"id":1607,"depth":851,"text":1494},{"id":1796,"depth":851,"text":1453},{"id":2032,"depth":851,"text":537},{"id":2629,"depth":851,"text":1876},{"id":2728,"depth":832,"text":2729,"children":5403},[5404,5405,5406,5407],{"id":2741,"depth":851,"text":2744},{"id":2788,"depth":851,"text":2791},{"id":2816,"depth":851,"text":2819},{"id":2911,"depth":851,"text":2888},{"id":2964,"depth":832,"text":2965,"children":5409},[5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420],{"id":3163,"depth":851,"text":3166},{"id":3287,"depth":851,"text":3290},{"id":3338,"depth":851,"text":3003},{"id":3570,"depth":851,"text":3021},{"id":3618,"depth":851,"text":3039},{"id":3666,"depth":851,"text":3057},{"id":3901,"depth":851,"text":1533},{"id":4156,"depth":851,"text":3091},{"id":4266,"depth":851,"text":3109},{"id":4320,"depth":851,"text":3127},{"id":4612,"depth":851,"text":3145},{"id":4675,"depth":832,"text":4676,"children":5422},[5423,5424,5425,5426,5427],{"id":4679,"depth":851,"text":541},{"id":5075,"depth":851,"text":5078},{"id":5110,"depth":851,"text":5113},{"id":5157,"depth":851,"text":5160},{"id":5193,"depth":851,"text":5196},{"id":5229,"depth":832,"text":5230,"children":5429},[5430,5431],{"id":5240,"depth":851,"text":5243},{"id":5300,"depth":851,"text":5303},{"id":5354,"depth":832,"text":5355},"Reference for every export of @monospace\u002Fextension-kit\u002Fdata-connector, the module a data connector extension's entrypoint imports.","md",null,{},{"title":392,"icon":81},{"title":447,"description":5433},"uguYKh-Kur8S6m64clLcpTsKh3yAtjr5M7-Uh28StY4",[5441,5443],{"title":370,"path":384,"stem":385,"description":5442,"icon":86,"children":-1},"Reference for the monospace extension create and monospace extension build commands, their flags, output and exit codes.",{"title":396,"path":397,"stem":398,"description":5444,"icon":399,"children":-1},"Reference for every type in @monospace\u002Fextension-kit\u002Fdata-connector\u002Fprotocol, the schema document and query wire format a data connector extension answers with and receives.",1790840130348]