@n0safe/indirectus
Version:
Directus Tools CLI.
4 lines • 4.44 kB
TypeScript
export declare const imports = "\nimport * as SafeSystemBinding from './bindings/safe-system-binding/index'\n{% if registry.collections | has_non_system_collections %}\nimport * as SafeItemBinding from './bindings/safe-item-binding/index'\n{% endif %}";
export declare const TypedClient = "\nSafe: {\n {%- for collection in registry.collections | filter_untype_system_collections %}\n\n {% set collectionName = collection.name | to_collection_name %}\n {% set collectionType = [\"Collections.\", collection.name | to_collection_name] | join %}\n {% set genericQuery = [\"const Query extends Directus.Query<Schema, \", collectionType, \">\"] | join %}\n {% set applyType = [\"ApplyQueryFields<Schema, \", collectionType, \", Query['fields']>\"] | join %}\n\n {% if collection.is_system %}\n\n {% if not collection.is_singleton %}\n /**\n * Manages safely multiple items from the {{ collection.name.raw | to_collection_name }} collection.\n */\n {{ collection.name | to_collection_name | pluralize | to_collection_string }}: SafeSystemBinding.{{ collectionName }}Items;\n\n /**\n * Manages safely individual items from the {{ collection.name.raw | to_collection_name }} collection.\n */\n {{ collection.name | to_collection_name | singularize | to_collection_string }}: SafeSystemBinding.{{ collectionName }}Item;\n {% else %}\n\n /**\n * Manage the only {{ collection.name.raw | to_collection_name }} instance available\n */\n {{ collection.name | to_collection_name | to_collection_string }}: SafeSystemBinding.{{ collectionName }}Singleton;\n \n {% endif %}\n\n {% else %}\n\n {% if not collection.is_singleton %}\n /**\n * Manages safely multiple items from the {{ collection.name.raw | to_collection_name }} collection.\n */\n {{ collection.name | to_collection_name | pluralize | to_collection_string }}: SafeItemBinding.{{ collectionName }}Items;\n\n /**\n * Manages safely individual items from the {{ collection.name.raw | to_collection_name }} collection.\n */\n {{ collection.name | to_collection_name | singularize | to_collection_string }}: SafeItemBinding.{{ collectionName }}Item;\n {% else %}\n\n /**\n * Manage the only {{ collection.name.raw | to_collection_name }} instance available.\n */\n {{ collection.name | to_collection_name | to_collection_string }}: SafeItemBinding.{{ collectionName }}Singleton;\n \n {% endif %}\n\n {% endif %}\n\n {%- endfor %}\n} & {[K in keyof SafeSystemBinding.Requests]: SafeSystemBinding.Requests[K]}";
export declare const schema = "\n[\n 'Safe',\n Object.fromEntries([\n ...(() => {\n const requests = new SafeSystemBinding.Requests(client)\n return Object.getOwnPropertyNames(Object.getPrototypeOf(requests)).map(\n (n) => [n, typeof requests[(n as keyof SafeSystemBinding.Requests)] === \"function\" ? (requests[(n as keyof SafeSystemBinding.Requests)] as Function).bind(requests) : requests[(n as keyof SafeSystemBinding.Requests)]],\n );\n })(),\n {% for collection in registry.collections | filter_untype_system_collections %}\n {% if collection.is_system %}\n\n {% if not collection.is_singleton %}\n [{{ collection.name | to_collection_name | pluralize | to_collection_string }}, new SafeSystemBinding.{{ collection.name | to_collection_name }}Items(client)],\n [{{ collection.name | to_collection_name | singularize | to_collection_string }}, new SafeSystemBinding.{{ collection.name | to_collection_name }}Item(client)],\n {% else %}\n [{{ collection.name | to_collection_name | to_collection_string }}, new SafeSystemBinding.{{ collection.name | to_collection_name }}Singleton(client)],\n {% endif %}\n\n {% else %}\n\n {% if not collection.is_singleton %}\n [{{ collection.name | to_collection_name | pluralize | to_collection_string }}, new SafeItemBinding.{{ collection.name | to_collection_name }}Items(client)],\n [{{ collection.name | to_collection_name | singularize | to_collection_string }}, new SafeItemBinding.{{ collection.name | to_collection_name }}Item(client)],\n {% else %}\n [{{ collection.name | to_collection_name | to_collection_string }}, new SafeItemBinding.{{ collection.name | to_collection_name }}Singleton(client)],\n {% endif %}\n {% endif %}\n {% endfor %}\n ])\n]";
//# sourceMappingURL=client.addons.d.ts.map