o
    wig	                     @   sD  U d dl Z d dlZd dlmZmZmZmZ d dlmZ d dl	Z	d dl
Z
ddlmZmZ ddlmZmZmZ ddlmZ dd	lmZ d
ddZeeZejed< e	dejeje	jdeedde	jdeddddde	jdde dde	jdddddee de!dee" ded df
d!d"Z#d#e"d$ed e"fd%d&Z$dS )'    N)AnyDictTupleOptional)Path   )prismaoptions)
EnumChoicePathlibPathwarning   )PYDANTIC_V2)InterfaceChoicesZpartial_type_generatorZrecursive_type_depth)partialsZ
type_depthloggeneratez--interfacez8Method that the client will use to interface with Prisma)typehelpz
--partialsT)existsreadablezPartial type generator locationz-tz--type-depthzODepth to generate pseudo-recursive types to; -1 signifies fully recursive typesz--generatorziSpecifies which generator to use. Can be specified multiple times. By default, all generators will be ran)Zmultipler   schemawatch	generatorkwargsreturnc           
      K   s   t jdddgk rtd dg}| dur|d|   |r$|d |r3|D ]
}|d	|  q(i }d
}| D ]\}}	|	du rDq;t||	||t||	  < q;t
d| ttj||d dS )z6Generate prisma artifacts with modified config options.18z{Unsupported version of pydantic installed, this command may not work as intended
Please update pydantic to 1.8 or greater.
r   Nz	--schema=z--watchz--generator=ZPRISMA_PY_CONFIG_zRunning generate with env: %s)env)pydanticVERSIONsplitr   appenditems	serializeARG_TO_CONFIG_KEYgetupperr   debugsysexitr   run)
r   r   r   r   argsnamer   prefixkeyvalue r2   S/home/app/Keep/.python/lib/python3.10/site-packages/prisma/cli/commands/generate.pycli   s(   
 r4   r0   objc                 C   s    t s| dkrd| dS t|S )Nr   ")r   str)r0   r5   r2   r2   r3   r%   O   s   r%   )%r*   loggingtypingr   r   r   r   pathlibr   Zclickr     r   r	   utilsr
   r   r   _compatr   Zgenerator.modelsr   r&   	getLogger__name__r   Logger__annotations__commandr   r   optionintboolr7   r4   r%   r2   r2   r2   r3   <module>   sP   
 
4 