Files
klz-cables.com/.pnpm-store/v10/files/19/6a9fed88665d818a7aeb8a3f8f6a1d94030feb72c36cb9805f25b4b0908d217536c53a58f7285c9b223452871725865e55a2f6b52ec004d90006051605331c
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
1.4 KiB
Plaintext

{"version":3,"file":"collections.cjs","names":[],"sources":["../../../../src/rest/commands/read/collections.ts"],"sourcesContent":["import type { DirectusCollection } from '../../../schema/collection.js';\nimport type { ApplyQueryFields } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadCollectionOutput<Schema, Item extends object = DirectusCollection<Schema>> = ApplyQueryFields<\n\tSchema,\n\tItem,\n\t'*'\n>;\n\n/**\n * List the available collections.\n * @returns An array of collection objects.\n */\nexport const readCollections =\n\t<Schema>(): RestCommand<ReadCollectionOutput<Schema>[], Schema> =>\n\t() => ({\n\t\tpath: `/collections`,\n\t\tmethod: 'GET',\n\t});\n\n/**\n * Retrieve a single collection by table name.\n * @param collection The collection name\n * @returns A collection object.\n * @throws Will throw if collection is empty\n */\nexport const readCollection =\n\t<Schema>(collection: DirectusCollection<Schema>['collection']): RestCommand<ReadCollectionOutput<Schema>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/collections/${collection}`,\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"kDAea,WAEL,CACN,KAAM,eACN,OAAQ,MACR,EAQW,EACH,QAER,EAAA,aAAa,EAAY,6BAA6B,CAE/C,CACN,KAAM,gBAAgB,IACtB,OAAQ,MACR"}