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
1 line
1.9 KiB
Plaintext
1 line
1.9 KiB
Plaintext
{"version":3,"file":"operations.js","names":[],"sources":["../../../../src/rest/commands/read/operations.ts"],"sourcesContent":["import type { DirectusOperation } from '../../../schema/operation.js';\nimport type { ApplyQueryFields, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadOperationOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusOperation<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * List all operations that exist in Directus.\n * @param query The query parameters\n * @returns An array of up to limit operation objects. If no items are available, data will be an empty array.\n */\nexport const readOperations =\n\t<Schema, const TQuery extends Query<Schema, DirectusOperation<Schema>>>(\n\t\tquery?: TQuery,\n\t): RestCommand<ReadOperationOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/operations`,\n\t\tparams: query ?? {},\n\t\tmethod: 'GET',\n\t});\n\n/**\n * List all Operations that exist in Directus.\n * @param key The primary key of the dashboard\n * @param query The query parameters\n * @returns Returns a Operation object if a valid primary key was provided.\n * @throws Will throw if key is empty\n */\nexport const readOperation =\n\t<Schema, const TQuery extends Query<Schema, DirectusOperation<Schema>>>(\n\t\tkey: DirectusOperation<Schema>['id'],\n\t\tquery?: TQuery,\n\t): RestCommand<ReadOperationOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/operations/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"6DAgBA,MAAa,EAEX,QAEM,CACN,KAAM,cACN,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR,EASW,GAEX,EACA,SAGA,EAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,eAAe,IACrB,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR"} |