@arcane-utils/types
Version:
A collection of typescript types.
1 lines • 6.39 kB
Source Map (JSON)
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["// Ingestion Interface\nexport type ServiceEnum = 'product_flow' | 'datalab' | 'audience_flow'\ntype ColumnType = 'string' | 'numeric' | 'boolean'\n\nexport interface Ingestion {\n id: number\n client_id: string\n name: string\n enabled: boolean\n type: IngestionType\n service: ServiceEnum\n parameters: IngestionParameterDATALAB | IngestionParameterSnowflake | IngestionParameterGCS\n execution_info?: ExecutionInfo\n latest_exec?: Date\n latest_load?: Date\n headers?: IngestionHeader[]\n types_override?: { [key: string]: ColumnType }\n meta?: IngestionMeta\n alert_ids: string[]\n protection_id?: string\n is_short_lived_archived?: boolean,\n data_pre_preparation_enabled?: boolean\n product_evolution_info?: ProductEvolutionInformation | null\n}\n\nexport interface ProductEvolutionInformationLastCalculation {\n date: Date\n monitoring_id: string\n}\n\nexport interface ProductEvolutionInformation{\n identifier_key: string[]\n last_calculation?: ProductEvolutionInformationLastCalculation\n}\n\nexport interface IngestionTaskBody {\n ingestion_id?: number\n monitoring_id: string\n file_name: string\n}\n\nexport interface FileHandlerTaskBody extends IngestionTaskBody {\n no_get_headers: boolean\n}\n\nexport interface IngestionHeader {\n key: string\n type: string\n}\n\nexport interface IngestionMeta {\n quote: string\n fieldDelimiter: string\n}\n\n// TODO: Ingestion Parameter are incomplete. We need to add all the parameters for every ingestion type\nexport interface BaseIngestionParameter {\n file_name: string\n}\n\nexport interface AdvancedIngestionParameter extends BaseIngestionParameter {\n is_xml?: boolean\n is_json?: boolean\n compression?: 'zip' | 'gzip' | undefined\n max_bad_records?: number\n escape_character?: string\n enclosing_quotes?: string | null\n preserve_ascii_control_characters?: boolean\n}\n\nexport interface IngestionParameterDATALAB extends AdvancedIngestionParameter {\n source_type: 'smart-feeds-data-ingestions' | 'smart-feeds-data-processings'\n entity_id: number\n}\n\nexport interface IngestionParameterSnowflake extends BaseIngestionParameter {\n account: string\n user_name: string\n pwd: string\n query: string\n sleep_time?: number\n execution_time?: ExecutionTime\n}\n\nexport interface IngestionParameterGCS extends AdvancedIngestionParameter {\n sub_type: 'GCS' | 'ARCANE_SFTP' | 'ARCANE_FTP'\n input_filename: string\n directory?: string\n service_account?: string\n sleep_time?: number\n execution_time?: ExecutionTime\n}\n\ninterface ExecutionTime {\n time: string\n day?: number\n}\n\nexport type MonitoringStatus = 'start' | 'done' | 'error'\n\n\nexport type IngestionType = 'GCS' |\n 'FTP/SFTP' |\n 'HTTP' |\n 'GA_CONVERSIONS' |\n 'BING_CAMPAIGN' |\n 'ADWORDS_CAMPAIGN' |\n 'ADWORDS_PRODUCT' |\n 'CRITEO' |\n 'ADWORDS_CRITERION' |\n 'FACEBOOK_ADSET' |\n 'INSTAGRAM' |\n 'BING_CRITERION' |\n 'GA_ECOMMERCE' |\n 'SPREADSHEET' |\n 'BIG_QUERY' |\n 'DATALAB' |\n 'SNOWFLAKE'\n\nexport interface Protection {\n id: number\n ingestion_id: number\n client_id: string\n enabled: boolean\n service: ServiceEnum\n size_variation_threshold: number\n triggered: boolean\n last_modified?: Date\n current_size?: string\n previous_size?: string\n notif_name: string\n}\n\n// Export Interface\n\nexport interface Export {\n id: number\n client_id: string\n name: string\n enabled: boolean\n type: string\n service: ServiceEnum\n parameters: ExportBaseParameters\n extension_name: string\n alert_ids: string[]\n execution_info?: ExecutionInfo\n latest_exec?: Date\n export_format?: string\n dataflow_job_status?: string\n dataflow_job_id?: string\n feed_setup?: boolean\n should_gzip?: boolean\n protection_id?: string\n}\n\nexport type ChannelType = 'mct_push' | 'local_inventory_push' | 'new_pass_culture' | 'pass_culture_offers' | 'google_automotive_push'\nexport interface ExportBaseParameters extends Record<string, any> {\n file_name: string\n channel_type?: ChannelType\n account_id?: string\n request_rate?: number\n channel?: string\n language?: string\n country?: string\n api_key?: string\n xml_sub_type?: string\n root_tag?: string\n product_tag?: string\n}\n\n// Common Interface\n\nexport type ExecutionStatus = 'done' | 'error' | 'running'\n\nexport interface BaseExecutionInfo {\n status: ExecutionStatus\n errors: ExecutionInfoError[]\n timestamp?: Date\n message_id?: string\n}\n\nexport interface ExecutionInfo extends BaseExecutionInfo {\n hash?: string\n}\n\nexport interface ExecutionInfoError {\n step: string\n reason: string\n severity: 'warning' | 'error'\n}\n\nexport interface ProcessingExecutionInfo extends ExecutionInfo {\n hashes?: { [fileName: string]: string }\n total_output_rows?: number\n}\n\n// Processing Interface\nexport type ProcessingType = 'big_query' | 'dataprepApi' | 'facebook_adset' | 'fileEncoding' | 'gunzip' | 'unzip' | 'FileChangeDetection'\n\nexport interface Processing {\n id: number\n client_id: string\n name: string\n enabled: boolean\n type: ProcessingType\n service: ServiceEnum\n parameters: BQProcessingParameters\n execution_info?: ProcessingExecutionInfo\n latestExec?: Date\n is_periodic?: boolean\n execution_frequency?: string\n execution_time?: ExecutionTime\n sleepTime?: number\n trigger: string[]\n}\n\n// Bigquery parameters\n\nexport type ExportFormat = 'CSV' | 'NEWLINE_DELIMITED_JSON'\n\nexport interface BQProcessingExtractParameters {\n export_format: ExportFormat\n export_delimiter?: string\n}\n\nexport interface QueryOptions {\n query: string\n}\n\nexport interface BQProcessingQueryParameters {\n options: QueryOptions\n destination_table: string\n}\n\nexport interface SchemaFields {\n name: string\n type: string\n}\n\nexport interface BQSchemaDetection {\n auto: boolean\n source_ingestion_id?: number\n schema?: {\n fields: SchemaFields[]\n delimiter: string\n }\n}\n\nexport interface BQProcessingInputParameters {\n input_table_name: string\n schema_detection: BQSchemaDetection\n}\n\nexport interface BQProcessingParameters {\n query: BQProcessingQueryParameters\n extract: BQProcessingExtractParameters\n input_files: string[]\n file_name: string\n}\n"],"mappings":"kWAAA,IAAAA,EAAA,kBAAAC,EAAAD","names":["types_exports","__toCommonJS"]}