jr-common-micro 0.6.1-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/common/dto/by_id_request_dto.d.ts +11 -0
- package/dist/common/dto/by_id_request_dto.js +10 -0
- package/dist/common/dto/index.d.ts +3 -0
- package/dist/common/dto/index.js +7 -0
- package/dist/common/dto/paginate_from_request_dto.d.ts +58 -0
- package/dist/common/dto/paginate_from_request_dto.js +22 -0
- package/dist/common/dto/paginate_request_dto.d.ts +23 -0
- package/dist/common/dto/paginate_request_dto.js +14 -0
- package/dist/common/exception/base_exception.d.ts +4 -0
- package/dist/common/exception/base_exception.js +14 -0
- package/dist/common/exception/index.d.ts +1 -0
- package/dist/common/exception/index.js +5 -0
- package/dist/common/factory/grpc_options_factory.d.ts +15 -0
- package/dist/common/factory/grpc_options_factory.js +63 -0
- package/dist/common/factory/index.d.ts +5 -0
- package/dist/common/factory/index.js +9 -0
- package/dist/common/factory/logger/index.d.ts +2 -0
- package/dist/common/factory/logger/index.js +6 -0
- package/dist/common/factory/logger/kafka_transport.d.ts +16 -0
- package/dist/common/factory/logger/kafka_transport.js +54 -0
- package/dist/common/factory/logger/winston_config.d.ts +22 -0
- package/dist/common/factory/logger/winston_config.js +141 -0
- package/dist/common/factory/module_metadata_factory.d.ts +24 -0
- package/dist/common/factory/module_metadata_factory.js +186 -0
- package/dist/common/factory/redis_client_factory.d.ts +5 -0
- package/dist/common/factory/redis_client_factory.js +22 -0
- package/dist/common/factory/redis_cluster_factory.d.ts +5 -0
- package/dist/common/factory/redis_cluster_factory.js +25 -0
- package/dist/common/filters/grpc_exceptions_filter.d.ts +6 -0
- package/dist/common/filters/grpc_exceptions_filter.js +26 -0
- package/dist/common/filters/index.d.ts +1 -0
- package/dist/common/filters/index.js +5 -0
- package/dist/common/guards/app_auth_guard.d.ts +5 -0
- package/dist/common/guards/app_auth_guard.js +38 -0
- package/dist/common/guards/app_internal_guard.d.ts +5 -0
- package/dist/common/guards/app_internal_guard.js +38 -0
- package/dist/common/guards/app_role_guard.d.ts +5 -0
- package/dist/common/guards/app_role_guard.js +43 -0
- package/dist/common/guards/index.d.ts +4 -0
- package/dist/common/guards/index.js +8 -0
- package/dist/common/guards/jwt_auth_user_decorator.d.ts +1 -0
- package/dist/common/guards/jwt_auth_user_decorator.js +31 -0
- package/dist/common/index.d.ts +8 -0
- package/dist/common/index.js +12 -0
- package/dist/common/interceptors/grpc/grpc_error_interceptors.d.ts +7 -0
- package/dist/common/interceptors/grpc/grpc_error_interceptors.js +35 -0
- package/dist/common/interceptors/grpc/index.d.ts +1 -0
- package/dist/common/interceptors/grpc/index.js +5 -0
- package/dist/common/interceptors/http/http_error_interceptors.d.ts +7 -0
- package/dist/common/interceptors/http/http_error_interceptors.js +30 -0
- package/dist/common/interceptors/http/http_response_interceptors.d.ts +7 -0
- package/dist/common/interceptors/http/http_response_interceptors.js +20 -0
- package/dist/common/interceptors/http/index.d.ts +2 -0
- package/dist/common/interceptors/http/index.js +6 -0
- package/dist/common/interceptors/index.d.ts +2 -0
- package/dist/common/interceptors/index.js +6 -0
- package/dist/common/kafka/index.d.ts +3 -0
- package/dist/common/kafka/index.js +7 -0
- package/dist/common/kafka/kafka_admin_service.d.ts +13 -0
- package/dist/common/kafka/kafka_admin_service.js +64 -0
- package/dist/common/kafka/kafka_consumer_service.d.ts +19 -0
- package/dist/common/kafka/kafka_consumer_service.js +80 -0
- package/dist/common/kafka/kafka_producer_service.d.ts +14 -0
- package/dist/common/kafka/kafka_producer_service.js +49 -0
- package/dist/common/service/crud/crud_service_interface.d.ts +20 -0
- package/dist/common/service/crud/crud_service_interface.js +2 -0
- package/dist/common/service/crud/index.d.ts +1 -0
- package/dist/common/service/crud/index.js +5 -0
- package/dist/common/service/index.d.ts +1 -0
- package/dist/common/service/index.js +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/proto/index.d.ts +1 -0
- package/dist/proto/index.js +5 -0
- package/dist/proto/micro/index.d.ts +1 -0
- package/dist/proto/micro/index.js +5 -0
- package/dist/proto/micro/v1/coin/analytics_messages_nest.d.ts +335 -0
- package/dist/proto/micro/v1/coin/analytics_messages_nest.js +18 -0
- package/dist/proto/micro/v1/coin/analytics_messages_pb.d.ts +670 -0
- package/dist/proto/micro/v1/coin/analytics_messages_pb.js +1456 -0
- package/dist/proto/micro/v1/coin/coin_messages_nest.d.ts +110 -0
- package/dist/proto/micro/v1/coin/coin_messages_nest.js +5 -0
- package/dist/proto/micro/v1/coin/coin_messages_pb.d.ts +258 -0
- package/dist/proto/micro/v1/coin/coin_messages_pb.js +568 -0
- package/dist/proto/micro/v1/coin/coin_websocket_messages_nest.d.ts +72 -0
- package/dist/proto/micro/v1/coin/coin_websocket_messages_nest.js +5 -0
- package/dist/proto/micro/v1/coin/coin_websocket_messages_pb.d.ts +128 -0
- package/dist/proto/micro/v1/coin/coin_websocket_messages_pb.js +276 -0
- package/dist/proto/micro/v1/coin/data_general_messages_nest.d.ts +54 -0
- package/dist/proto/micro/v1/coin/data_general_messages_nest.js +5 -0
- package/dist/proto/micro/v1/coin/data_general_messages_pb.d.ts +118 -0
- package/dist/proto/micro/v1/coin/data_general_messages_pb.js +259 -0
- package/dist/proto/micro/v1/coin/data_microservice_messages_nest.d.ts +43 -0
- package/dist/proto/micro/v1/coin/data_microservice_messages_nest.js +5 -0
- package/dist/proto/micro/v1/coin/data_microservice_messages_pb.d.ts +91 -0
- package/dist/proto/micro/v1/coin/data_microservice_messages_pb.js +199 -0
- package/dist/proto/micro/v1/coin/etf_messages_nest.d.ts +98 -0
- package/dist/proto/micro/v1/coin/etf_messages_nest.js +5 -0
- package/dist/proto/micro/v1/coin/etf_messages_pb.d.ts +226 -0
- package/dist/proto/micro/v1/coin/etf_messages_pb.js +499 -0
- package/dist/proto/micro/v1/coin/index.d.ts +11 -0
- package/dist/proto/micro/v1/coin/index.js +15 -0
- package/dist/proto/micro/v1/coin/long_short_ratio_messages_nest.d.ts +55 -0
- package/dist/proto/micro/v1/coin/long_short_ratio_messages_nest.js +5 -0
- package/dist/proto/micro/v1/coin/long_short_ratio_messages_pb.d.ts +115 -0
- package/dist/proto/micro/v1/coin/long_short_ratio_messages_pb.js +249 -0
- package/dist/proto/micro/v1/coin/rsi_messages_nest.d.ts +42 -0
- package/dist/proto/micro/v1/coin/rsi_messages_nest.js +5 -0
- package/dist/proto/micro/v1/coin/rsi_messages_pb.d.ts +98 -0
- package/dist/proto/micro/v1/coin/rsi_messages_pb.js +216 -0
- package/dist/proto/micro/v1/coin/services_connect.d.ts +413 -0
- package/dist/proto/micro/v1/coin/services_connect.js +416 -0
- package/dist/proto/micro/v1/coin/services_nest.d.ts +200 -0
- package/dist/proto/micro/v1/coin/services_nest.js +244 -0
- package/dist/proto/micro/v1/coin/token_unlocks_messages_nest.d.ts +53 -0
- package/dist/proto/micro/v1/coin/token_unlocks_messages_nest.js +5 -0
- package/dist/proto/micro/v1/coin/token_unlocks_messages_pb.d.ts +101 -0
- package/dist/proto/micro/v1/coin/token_unlocks_messages_pb.js +214 -0
- package/dist/proto/micro/v1/data/daily_market_data_messages_nest.d.ts +18 -0
- package/dist/proto/micro/v1/data/daily_market_data_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/daily_market_data_messages_pb.d.ts +42 -0
- package/dist/proto/micro/v1/data/daily_market_data_messages_pb.js +92 -0
- package/dist/proto/micro/v1/data/dominance_messages_nest.d.ts +35 -0
- package/dist/proto/micro/v1/data/dominance_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/dominance_messages_pb.d.ts +75 -0
- package/dist/proto/micro/v1/data/dominance_messages_pb.js +164 -0
- package/dist/proto/micro/v1/data/exchanges_messages_nest.d.ts +153 -0
- package/dist/proto/micro/v1/data/exchanges_messages_nest.js +11 -0
- package/dist/proto/micro/v1/data/exchanges_messages_pb.d.ts +256 -0
- package/dist/proto/micro/v1/data/exchanges_messages_pb.js +546 -0
- package/dist/proto/micro/v1/data/funding_rate_messages_nest.d.ts +52 -0
- package/dist/proto/micro/v1/data/funding_rate_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/funding_rate_messages_pb.d.ts +68 -0
- package/dist/proto/micro/v1/data/funding_rate_messages_pb.js +131 -0
- package/dist/proto/micro/v1/data/global_stats_messages_nest.d.ts +17 -0
- package/dist/proto/micro/v1/data/global_stats_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/global_stats_messages_pb.d.ts +25 -0
- package/dist/proto/micro/v1/data/global_stats_messages_pb.js +53 -0
- package/dist/proto/micro/v1/data/homepage_messages_nest.d.ts +35 -0
- package/dist/proto/micro/v1/data/homepage_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/homepage_messages_pb.d.ts +83 -0
- package/dist/proto/micro/v1/data/homepage_messages_pb.js +183 -0
- package/dist/proto/micro/v1/data/index.d.ts +22 -0
- package/dist/proto/micro/v1/data/index.js +26 -0
- package/dist/proto/micro/v1/data/inflow_outflow_messages_nest.d.ts +72 -0
- package/dist/proto/micro/v1/data/inflow_outflow_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/inflow_outflow_messages_pb.d.ts +136 -0
- package/dist/proto/micro/v1/data/inflow_outflow_messages_pb.js +295 -0
- package/dist/proto/micro/v1/data/liquidation_heat_map_m2_messages_nest.d.ts +44 -0
- package/dist/proto/micro/v1/data/liquidation_heat_map_m2_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/liquidation_heat_map_m2_messages_pb.d.ts +100 -0
- package/dist/proto/micro/v1/data/liquidation_heat_map_m2_messages_pb.js +221 -0
- package/dist/proto/micro/v1/data/liquidation_v1_messages_nest.d.ts +34 -0
- package/dist/proto/micro/v1/data/liquidation_v1_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/liquidation_v1_messages_pb.d.ts +82 -0
- package/dist/proto/micro/v1/data/liquidation_v1_messages_pb.js +181 -0
- package/dist/proto/micro/v1/data/mvrvz_score_messages_nest.d.ts +10 -0
- package/dist/proto/micro/v1/data/mvrvz_score_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/mvrvz_score_messages_pb.d.ts +26 -0
- package/dist/proto/micro/v1/data/mvrvz_score_messages_pb.js +58 -0
- package/dist/proto/micro/v1/data/puell_multiple_messages_nest.d.ts +14 -0
- package/dist/proto/micro/v1/data/puell_multiple_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/puell_multiple_messages_pb.d.ts +30 -0
- package/dist/proto/micro/v1/data/puell_multiple_messages_pb.js +65 -0
- package/dist/proto/micro/v1/data/puppeteer_messages_nest.d.ts +24 -0
- package/dist/proto/micro/v1/data/puppeteer_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/puppeteer_messages_pb.d.ts +40 -0
- package/dist/proto/micro/v1/data/puppeteer_messages_pb.js +84 -0
- package/dist/proto/micro/v1/data/rainbow_messages_nest.d.ts +10 -0
- package/dist/proto/micro/v1/data/rainbow_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/rainbow_messages_pb.d.ts +26 -0
- package/dist/proto/micro/v1/data/rainbow_messages_pb.js +57 -0
- package/dist/proto/micro/v1/data/rsi_list_messages_nest.d.ts +23 -0
- package/dist/proto/micro/v1/data/rsi_list_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/rsi_list_messages_pb.d.ts +39 -0
- package/dist/proto/micro/v1/data/rsi_list_messages_pb.js +83 -0
- package/dist/proto/micro/v1/data/scrape_assets_messages_nest.d.ts +20 -0
- package/dist/proto/micro/v1/data/scrape_assets_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/scrape_assets_messages_pb.d.ts +36 -0
- package/dist/proto/micro/v1/data/scrape_assets_messages_pb.js +77 -0
- package/dist/proto/micro/v1/data/scrape_treasuries_messages_nest.d.ts +37 -0
- package/dist/proto/micro/v1/data/scrape_treasuries_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/scrape_treasuries_messages_pb.d.ts +69 -0
- package/dist/proto/micro/v1/data/scrape_treasuries_messages_pb.js +149 -0
- package/dist/proto/micro/v1/data/services_connect.d.ts +325 -0
- package/dist/proto/micro/v1/data/services_connect.js +328 -0
- package/dist/proto/micro/v1/data/services_nest.d.ts +207 -0
- package/dist/proto/micro/v1/data/services_nest.js +326 -0
- package/dist/proto/micro/v1/data/token_unlocks_connect.d.ts +19 -0
- package/dist/proto/micro/v1/data/token_unlocks_connect.js +22 -0
- package/dist/proto/micro/v1/data/token_unlocks_nest.d.ts +69 -0
- package/dist/proto/micro/v1/data/token_unlocks_nest.js +22 -0
- package/dist/proto/micro/v1/data/token_unlocks_pb.d.ts +109 -0
- package/dist/proto/micro/v1/data/token_unlocks_pb.js +234 -0
- package/dist/proto/micro/v1/data/two_hundred_week_moving_average_messages_nest.d.ts +15 -0
- package/dist/proto/micro/v1/data/two_hundred_week_moving_average_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/two_hundred_week_moving_average_messages_pb.d.ts +31 -0
- package/dist/proto/micro/v1/data/two_hundred_week_moving_average_messages_pb.js +68 -0
- package/dist/proto/micro/v1/data/two_year_ma_multipler_messages_nest.d.ts +15 -0
- package/dist/proto/micro/v1/data/two_year_ma_multipler_messages_nest.js +5 -0
- package/dist/proto/micro/v1/data/two_year_ma_multipler_messages_pb.d.ts +31 -0
- package/dist/proto/micro/v1/data/two_year_ma_multipler_messages_pb.js +67 -0
- package/dist/proto/micro/v1/education/education_messages_nest.d.ts +370 -0
- package/dist/proto/micro/v1/education/education_messages_nest.js +5 -0
- package/dist/proto/micro/v1/education/education_messages_pb.d.ts +610 -0
- package/dist/proto/micro/v1/education/education_messages_pb.js +1264 -0
- package/dist/proto/micro/v1/education/index.d.ts +3 -0
- package/dist/proto/micro/v1/education/index.js +7 -0
- package/dist/proto/micro/v1/education/services_connect.d.ts +375 -0
- package/dist/proto/micro/v1/education/services_connect.js +378 -0
- package/dist/proto/micro/v1/education/services_nest.d.ts +182 -0
- package/dist/proto/micro/v1/education/services_nest.js +198 -0
- package/dist/proto/micro/v1/general_nest.d.ts +115 -0
- package/dist/proto/micro/v1/general_nest.js +51 -0
- package/dist/proto/micro/v1/general_pb.d.ts +211 -0
- package/dist/proto/micro/v1/general_pb.js +460 -0
- package/dist/proto/micro/v1/index.d.ts +10 -0
- package/dist/proto/micro/v1/index.js +14 -0
- package/dist/proto/micro/v1/media/index.d.ts +3 -0
- package/dist/proto/micro/v1/media/index.js +7 -0
- package/dist/proto/micro/v1/media/media_messages_nest.d.ts +92 -0
- package/dist/proto/micro/v1/media/media_messages_nest.js +21 -0
- package/dist/proto/micro/v1/media/media_messages_pb.d.ts +202 -0
- package/dist/proto/micro/v1/media/media_messages_pb.js +447 -0
- package/dist/proto/micro/v1/media/services_connect.d.ts +55 -0
- package/dist/proto/micro/v1/media/services_connect.js +58 -0
- package/dist/proto/micro/v1/media/services_nest.d.ts +32 -0
- package/dist/proto/micro/v1/media/services_nest.js +45 -0
- package/dist/proto/micro/v1/news/app_version_message_nest.d.ts +40 -0
- package/dist/proto/micro/v1/news/app_version_message_nest.js +5 -0
- package/dist/proto/micro/v1/news/app_version_message_pb.d.ts +72 -0
- package/dist/proto/micro/v1/news/app_version_message_pb.js +150 -0
- package/dist/proto/micro/v1/news/blog_messages_nest.d.ts +162 -0
- package/dist/proto/micro/v1/news/blog_messages_nest.js +5 -0
- package/dist/proto/micro/v1/news/blog_messages_pb.d.ts +246 -0
- package/dist/proto/micro/v1/news/blog_messages_pb.js +495 -0
- package/dist/proto/micro/v1/news/calendar_messages_nest.d.ts +70 -0
- package/dist/proto/micro/v1/news/calendar_messages_nest.js +5 -0
- package/dist/proto/micro/v1/news/calendar_messages_pb.d.ts +98 -0
- package/dist/proto/micro/v1/news/calendar_messages_pb.js +193 -0
- package/dist/proto/micro/v1/news/economic_calendar_messages_nest.d.ts +28 -0
- package/dist/proto/micro/v1/news/economic_calendar_messages_nest.js +5 -0
- package/dist/proto/micro/v1/news/economic_calendar_messages_pb.d.ts +48 -0
- package/dist/proto/micro/v1/news/economic_calendar_messages_pb.js +100 -0
- package/dist/proto/micro/v1/news/index.d.ts +9 -0
- package/dist/proto/micro/v1/news/index.js +13 -0
- package/dist/proto/micro/v1/news/jr_blog_messages_nest.d.ts +321 -0
- package/dist/proto/micro/v1/news/jr_blog_messages_nest.js +5 -0
- package/dist/proto/micro/v1/news/jr_blog_messages_pb.d.ts +477 -0
- package/dist/proto/micro/v1/news/jr_blog_messages_pb.js +954 -0
- package/dist/proto/micro/v1/news/news_messages_nest.d.ts +270 -0
- package/dist/proto/micro/v1/news/news_messages_nest.js +5 -0
- package/dist/proto/micro/v1/news/news_messages_pb.d.ts +418 -0
- package/dist/proto/micro/v1/news/news_messages_pb.js +848 -0
- package/dist/proto/micro/v1/news/services_connect.d.ts +549 -0
- package/dist/proto/micro/v1/news/services_connect.js +552 -0
- package/dist/proto/micro/v1/news/services_nest.d.ts +244 -0
- package/dist/proto/micro/v1/news/services_nest.js +261 -0
- package/dist/proto/micro/v1/news/sundown_messages_nest.d.ts +99 -0
- package/dist/proto/micro/v1/news/sundown_messages_nest.js +5 -0
- package/dist/proto/micro/v1/news/sundown_messages_pb.d.ts +131 -0
- package/dist/proto/micro/v1/news/sundown_messages_pb.js +253 -0
- package/dist/proto/micro/v1/notification/index.d.ts +4 -0
- package/dist/proto/micro/v1/notification/index.js +8 -0
- package/dist/proto/micro/v1/notification/mail_messages_nest.d.ts +31 -0
- package/dist/proto/micro/v1/notification/mail_messages_nest.js +5 -0
- package/dist/proto/micro/v1/notification/mail_messages_pb.d.ts +63 -0
- package/dist/proto/micro/v1/notification/mail_messages_pb.js +138 -0
- package/dist/proto/micro/v1/notification/notification_messages_nest.d.ts +164 -0
- package/dist/proto/micro/v1/notification/notification_messages_nest.js +5 -0
- package/dist/proto/micro/v1/notification/notification_messages_pb.d.ts +356 -0
- package/dist/proto/micro/v1/notification/notification_messages_pb.js +783 -0
- package/dist/proto/micro/v1/notification/services_connect.d.ts +139 -0
- package/dist/proto/micro/v1/notification/services_connect.js +142 -0
- package/dist/proto/micro/v1/notification/services_nest.d.ts +65 -0
- package/dist/proto/micro/v1/notification/services_nest.js +70 -0
- package/dist/proto/micro/v1/portfolio/index.d.ts +5 -0
- package/dist/proto/micro/v1/portfolio/index.js +9 -0
- package/dist/proto/micro/v1/portfolio/portfolio_coin_messages_nest.d.ts +17 -0
- package/dist/proto/micro/v1/portfolio/portfolio_coin_messages_nest.js +5 -0
- package/dist/proto/micro/v1/portfolio/portfolio_coin_messages_pb.d.ts +41 -0
- package/dist/proto/micro/v1/portfolio/portfolio_coin_messages_pb.js +89 -0
- package/dist/proto/micro/v1/portfolio/portfolio_coin_trasaction_messages_nest.d.ts +34 -0
- package/dist/proto/micro/v1/portfolio/portfolio_coin_trasaction_messages_nest.js +5 -0
- package/dist/proto/micro/v1/portfolio/portfolio_coin_trasaction_messages_pb.d.ts +82 -0
- package/dist/proto/micro/v1/portfolio/portfolio_coin_trasaction_messages_pb.js +180 -0
- package/dist/proto/micro/v1/portfolio/portfolio_messages_nest.d.ts +154 -0
- package/dist/proto/micro/v1/portfolio/portfolio_messages_nest.js +5 -0
- package/dist/proto/micro/v1/portfolio/portfolio_messages_pb.d.ts +370 -0
- package/dist/proto/micro/v1/portfolio/portfolio_messages_pb.js +820 -0
- package/dist/proto/micro/v1/portfolio/services_connect.d.ts +140 -0
- package/dist/proto/micro/v1/portfolio/services_connect.js +143 -0
- package/dist/proto/micro/v1/portfolio/services_nest.d.ts +66 -0
- package/dist/proto/micro/v1/portfolio/services_nest.js +74 -0
- package/dist/proto/micro/v1/puppeteer/index.d.ts +3 -0
- package/dist/proto/micro/v1/puppeteer/index.js +7 -0
- package/dist/proto/micro/v1/puppeteer/puppeteer_messages_nest.d.ts +2 -0
- package/dist/proto/micro/v1/puppeteer/puppeteer_messages_nest.js +5 -0
- package/dist/proto/micro/v1/puppeteer/services_connect.d.ts +89 -0
- package/dist/proto/micro/v1/puppeteer/services_connect.js +92 -0
- package/dist/proto/micro/v1/puppeteer/services_nest.d.ts +47 -0
- package/dist/proto/micro/v1/puppeteer/services_nest.js +63 -0
- package/dist/proto/micro/v1/user/auth_messages_nest.d.ts +87 -0
- package/dist/proto/micro/v1/user/auth_messages_nest.js +5 -0
- package/dist/proto/micro/v1/user/auth_messages_pb.d.ts +263 -0
- package/dist/proto/micro/v1/user/auth_messages_pb.js +590 -0
- package/dist/proto/micro/v1/user/authorization_messages_nest.d.ts +47 -0
- package/dist/proto/micro/v1/user/authorization_messages_nest.js +5 -0
- package/dist/proto/micro/v1/user/authorization_messages_pb.d.ts +111 -0
- package/dist/proto/micro/v1/user/authorization_messages_pb.js +245 -0
- package/dist/proto/micro/v1/user/index.d.ts +6 -0
- package/dist/proto/micro/v1/user/index.js +10 -0
- package/dist/proto/micro/v1/user/services_connect.d.ts +315 -0
- package/dist/proto/micro/v1/user/services_connect.js +318 -0
- package/dist/proto/micro/v1/user/services_nest.d.ts +151 -0
- package/dist/proto/micro/v1/user/services_nest.js +172 -0
- package/dist/proto/micro/v1/user/site_settings_messages_nest.d.ts +19 -0
- package/dist/proto/micro/v1/user/site_settings_messages_nest.js +12 -0
- package/dist/proto/micro/v1/user/site_settings_messages_pb.d.ts +42 -0
- package/dist/proto/micro/v1/user/site_settings_messages_pb.js +93 -0
- package/dist/proto/micro/v1/user/user_messages_nest.d.ts +175 -0
- package/dist/proto/micro/v1/user/user_messages_nest.js +12 -0
- package/dist/proto/micro/v1/user/user_messages_pb.d.ts +358 -0
- package/dist/proto/micro/v1/user/user_messages_pb.js +784 -0
- package/dist/utils/constants.d.ts +45 -0
- package/dist/utils/constants.js +48 -0
- package/dist/utils/functions.d.ts +70 -0
- package/dist/utils/functions.js +425 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/logger_names.d.ts +8 -0
- package/dist/utils/logger_names.js +41 -0
- package/dist/utils/minimatch/assert_valid_pattern.d.ts +1 -0
- package/dist/utils/minimatch/assert_valid_pattern.js +13 -0
- package/dist/utils/minimatch/ast.d.ts +19 -0
- package/dist/utils/minimatch/ast.js +446 -0
- package/dist/utils/minimatch/balanced_match.d.ts +2 -0
- package/dist/utils/minimatch/balanced_match.js +57 -0
- package/dist/utils/minimatch/brace_expansion.d.ts +1 -0
- package/dist/utils/minimatch/brace_expansion.js +181 -0
- package/dist/utils/minimatch/brace_expressions.d.ts +7 -0
- package/dist/utils/minimatch/brace_expressions.js +119 -0
- package/dist/utils/minimatch/escape.d.ts +2 -0
- package/dist/utils/minimatch/escape.js +9 -0
- package/dist/utils/minimatch/index.d.ts +93 -0
- package/dist/utils/minimatch/index.js +788 -0
- package/dist/utils/minimatch/matcher_collection.d.ts +9 -0
- package/dist/utils/minimatch/matcher_collection.js +30 -0
- package/dist/utils/minimatch/unescape.d.ts +2 -0
- package/dist/utils/minimatch/unescape.js +11 -0
- package/dist/utils/types.d.ts +70 -0
- package/dist/utils/types.js +22 -0
- package/dist/utils/walk_sync.d.ts +25 -0
- package/dist/utils/walk_sync.js +184 -0
- package/package.json +87 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MinimatchOptions, MMRegExp } from './index';
|
|
2
|
+
export type ExtglobType = '!' | '?' | '+' | '*' | '@';
|
|
3
|
+
export declare class AST {
|
|
4
|
+
#private;
|
|
5
|
+
type: ExtglobType | null;
|
|
6
|
+
constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
|
|
7
|
+
get hasMagic(): boolean | undefined;
|
|
8
|
+
toString(): string;
|
|
9
|
+
push(...parts: (string | AST)[]): void;
|
|
10
|
+
toJSON(): any[];
|
|
11
|
+
isStart(): boolean;
|
|
12
|
+
isEnd(): boolean;
|
|
13
|
+
copyIn(part: AST | string): void;
|
|
14
|
+
clone(parent: AST): AST;
|
|
15
|
+
static fromGlob(pattern: string, options?: MinimatchOptions): AST;
|
|
16
|
+
toMMPattern(): MMRegExp | string;
|
|
17
|
+
get options(): MinimatchOptions;
|
|
18
|
+
toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
|
|
19
|
+
}
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AST = void 0;
|
|
4
|
+
const brace_expressions_1 = require("./brace_expressions");
|
|
5
|
+
const unescape_1 = require("./unescape");
|
|
6
|
+
const types = new Set(['!', '?', '+', '*', '@']);
|
|
7
|
+
const isExtglobType = (c) => types.has(c);
|
|
8
|
+
const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
|
|
9
|
+
const startNoDot = '(?!\\.)';
|
|
10
|
+
const addPatternStart = new Set(['[', '.']);
|
|
11
|
+
const justDots = new Set(['..', '.']);
|
|
12
|
+
const reSpecials = new Set('().*{}+?[]^$\\!');
|
|
13
|
+
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
14
|
+
const qmark = '[^/]';
|
|
15
|
+
const star = qmark + '*?';
|
|
16
|
+
const starNoEmpty = qmark + '+?';
|
|
17
|
+
class AST {
|
|
18
|
+
type;
|
|
19
|
+
#root;
|
|
20
|
+
#hasMagic;
|
|
21
|
+
#uflag = false;
|
|
22
|
+
#parts = [];
|
|
23
|
+
#parent;
|
|
24
|
+
#parentIndex;
|
|
25
|
+
#negs;
|
|
26
|
+
#filledNegs = false;
|
|
27
|
+
#options;
|
|
28
|
+
#toString;
|
|
29
|
+
#emptyExt = false;
|
|
30
|
+
constructor(type, parent, options = {}) {
|
|
31
|
+
this.type = type;
|
|
32
|
+
if (type)
|
|
33
|
+
this.#hasMagic = true;
|
|
34
|
+
this.#parent = parent;
|
|
35
|
+
this.#root = this.#parent ? this.#parent.#root : this;
|
|
36
|
+
this.#options = this.#root === this ? options : this.#root.#options;
|
|
37
|
+
this.#negs = this.#root === this ? [] : this.#root.#negs;
|
|
38
|
+
if (type === '!' && !this.#root.#filledNegs)
|
|
39
|
+
this.#negs.push(this);
|
|
40
|
+
this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
|
|
41
|
+
}
|
|
42
|
+
get hasMagic() {
|
|
43
|
+
if (this.#hasMagic !== undefined)
|
|
44
|
+
return this.#hasMagic;
|
|
45
|
+
for (const p of this.#parts) {
|
|
46
|
+
if (typeof p === 'string')
|
|
47
|
+
continue;
|
|
48
|
+
if (p.type || p.hasMagic)
|
|
49
|
+
return (this.#hasMagic = true);
|
|
50
|
+
}
|
|
51
|
+
return this.#hasMagic;
|
|
52
|
+
}
|
|
53
|
+
toString() {
|
|
54
|
+
if (this.#toString !== undefined)
|
|
55
|
+
return this.#toString;
|
|
56
|
+
if (!this.type) {
|
|
57
|
+
return (this.#toString = this.#parts.map((p) => String(p)).join(''));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return (this.#toString =
|
|
61
|
+
this.type + '(' + this.#parts.map((p) => String(p)).join('|') + ')');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
#fillNegs() {
|
|
65
|
+
if (this !== this.#root)
|
|
66
|
+
throw new Error('should only call on root');
|
|
67
|
+
if (this.#filledNegs)
|
|
68
|
+
return this;
|
|
69
|
+
this.toString();
|
|
70
|
+
this.#filledNegs = true;
|
|
71
|
+
let n;
|
|
72
|
+
while ((n = this.#negs.pop())) {
|
|
73
|
+
if (n.type !== '!')
|
|
74
|
+
continue;
|
|
75
|
+
let p = n;
|
|
76
|
+
let pp = p.#parent;
|
|
77
|
+
while (pp) {
|
|
78
|
+
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
|
|
79
|
+
for (const part of n.#parts) {
|
|
80
|
+
if (typeof part === 'string') {
|
|
81
|
+
throw new Error('string part in extglob AST??');
|
|
82
|
+
}
|
|
83
|
+
part.copyIn(pp.#parts[i]);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
p = pp;
|
|
87
|
+
pp = p.#parent;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
push(...parts) {
|
|
93
|
+
for (const p of parts) {
|
|
94
|
+
if (p === '')
|
|
95
|
+
continue;
|
|
96
|
+
if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
|
|
97
|
+
throw new Error('invalid part: ' + p);
|
|
98
|
+
}
|
|
99
|
+
this.#parts.push(p);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
toJSON() {
|
|
103
|
+
const ret = this.type === null
|
|
104
|
+
? this.#parts
|
|
105
|
+
.slice()
|
|
106
|
+
.map((p) => (typeof p === 'string' ? p : p.toJSON()))
|
|
107
|
+
: [this.type, ...this.#parts.map((p) => p.toJSON())];
|
|
108
|
+
if (this.isStart() && !this.type)
|
|
109
|
+
ret.unshift([]);
|
|
110
|
+
if (this.isEnd() &&
|
|
111
|
+
(this === this.#root ||
|
|
112
|
+
(this.#root.#filledNegs && this.#parent?.type === '!'))) {
|
|
113
|
+
ret.push({});
|
|
114
|
+
}
|
|
115
|
+
return ret;
|
|
116
|
+
}
|
|
117
|
+
isStart() {
|
|
118
|
+
if (this.#root === this)
|
|
119
|
+
return true;
|
|
120
|
+
if (!this.#parent?.isStart())
|
|
121
|
+
return false;
|
|
122
|
+
if (this.#parentIndex === 0)
|
|
123
|
+
return true;
|
|
124
|
+
const p = this.#parent;
|
|
125
|
+
for (let i = 0; i < this.#parentIndex; i++) {
|
|
126
|
+
const pp = p.#parts[i];
|
|
127
|
+
if (!(pp instanceof AST && pp.type === '!')) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
isEnd() {
|
|
134
|
+
if (this.#root === this)
|
|
135
|
+
return true;
|
|
136
|
+
if (this.#parent?.type === '!')
|
|
137
|
+
return true;
|
|
138
|
+
if (!this.#parent?.isEnd())
|
|
139
|
+
return false;
|
|
140
|
+
if (!this.type)
|
|
141
|
+
return this.#parent?.isEnd();
|
|
142
|
+
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
143
|
+
return this.#parentIndex === pl - 1;
|
|
144
|
+
}
|
|
145
|
+
copyIn(part) {
|
|
146
|
+
if (typeof part === 'string')
|
|
147
|
+
this.push(part);
|
|
148
|
+
else
|
|
149
|
+
this.push(part.clone(this));
|
|
150
|
+
}
|
|
151
|
+
clone(parent) {
|
|
152
|
+
const c = new AST(this.type, parent);
|
|
153
|
+
for (const p of this.#parts) {
|
|
154
|
+
c.copyIn(p);
|
|
155
|
+
}
|
|
156
|
+
return c;
|
|
157
|
+
}
|
|
158
|
+
static #parseAST(str, ast, pos, opt) {
|
|
159
|
+
let escaping = false;
|
|
160
|
+
let inBrace = false;
|
|
161
|
+
let braceStart = -1;
|
|
162
|
+
let braceNeg = false;
|
|
163
|
+
if (ast.type === null) {
|
|
164
|
+
let i = pos;
|
|
165
|
+
let acc = '';
|
|
166
|
+
while (i < str.length) {
|
|
167
|
+
const c = str.charAt(i++);
|
|
168
|
+
if (escaping || c === '\\') {
|
|
169
|
+
escaping = !escaping;
|
|
170
|
+
acc += c;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (inBrace) {
|
|
174
|
+
if (i === braceStart + 1) {
|
|
175
|
+
if (c === '^' || c === '!') {
|
|
176
|
+
braceNeg = true;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
|
|
180
|
+
inBrace = false;
|
|
181
|
+
}
|
|
182
|
+
acc += c;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
else if (c === '[') {
|
|
186
|
+
inBrace = true;
|
|
187
|
+
braceStart = i;
|
|
188
|
+
braceNeg = false;
|
|
189
|
+
acc += c;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
|
|
193
|
+
ast.push(acc);
|
|
194
|
+
acc = '';
|
|
195
|
+
const ext = new AST(c, ast);
|
|
196
|
+
i = AST.#parseAST(str, ext, i, opt);
|
|
197
|
+
ast.push(ext);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
acc += c;
|
|
201
|
+
}
|
|
202
|
+
ast.push(acc);
|
|
203
|
+
return i;
|
|
204
|
+
}
|
|
205
|
+
let i = pos + 1;
|
|
206
|
+
let part = new AST(null, ast);
|
|
207
|
+
const parts = [];
|
|
208
|
+
let acc = '';
|
|
209
|
+
while (i < str.length) {
|
|
210
|
+
const c = str.charAt(i++);
|
|
211
|
+
if (escaping || c === '\\') {
|
|
212
|
+
escaping = !escaping;
|
|
213
|
+
acc += c;
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (inBrace) {
|
|
217
|
+
if (i === braceStart + 1) {
|
|
218
|
+
if (c === '^' || c === '!') {
|
|
219
|
+
braceNeg = true;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
|
|
223
|
+
inBrace = false;
|
|
224
|
+
}
|
|
225
|
+
acc += c;
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
else if (c === '[') {
|
|
229
|
+
inBrace = true;
|
|
230
|
+
braceStart = i;
|
|
231
|
+
braceNeg = false;
|
|
232
|
+
acc += c;
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
if (isExtglobType(c) && str.charAt(i) === '(') {
|
|
236
|
+
part.push(acc);
|
|
237
|
+
acc = '';
|
|
238
|
+
const ext = new AST(c, part);
|
|
239
|
+
part.push(ext);
|
|
240
|
+
i = AST.#parseAST(str, ext, i, opt);
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (c === '|') {
|
|
244
|
+
part.push(acc);
|
|
245
|
+
acc = '';
|
|
246
|
+
parts.push(part);
|
|
247
|
+
part = new AST(null, ast);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (c === ')') {
|
|
251
|
+
if (acc === '' && ast.#parts.length === 0) {
|
|
252
|
+
ast.#emptyExt = true;
|
|
253
|
+
}
|
|
254
|
+
part.push(acc);
|
|
255
|
+
acc = '';
|
|
256
|
+
ast.push(...parts, part);
|
|
257
|
+
return i;
|
|
258
|
+
}
|
|
259
|
+
acc += c;
|
|
260
|
+
}
|
|
261
|
+
ast.type = null;
|
|
262
|
+
ast.#hasMagic = undefined;
|
|
263
|
+
ast.#parts = [str.substring(pos - 1)];
|
|
264
|
+
return i;
|
|
265
|
+
}
|
|
266
|
+
static fromGlob(pattern, options = {}) {
|
|
267
|
+
const ast = new AST(null, undefined, options);
|
|
268
|
+
AST.#parseAST(pattern, ast, 0, options);
|
|
269
|
+
return ast;
|
|
270
|
+
}
|
|
271
|
+
toMMPattern() {
|
|
272
|
+
if (this !== this.#root)
|
|
273
|
+
return this.#root.toMMPattern();
|
|
274
|
+
const glob = this.toString();
|
|
275
|
+
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
276
|
+
const anyMagic = hasMagic ||
|
|
277
|
+
this.#hasMagic ||
|
|
278
|
+
(this.#options.nocase &&
|
|
279
|
+
!this.#options.nocaseMagicOnly &&
|
|
280
|
+
glob.toUpperCase() !== glob.toLowerCase());
|
|
281
|
+
if (!anyMagic) {
|
|
282
|
+
return body;
|
|
283
|
+
}
|
|
284
|
+
const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
|
|
285
|
+
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
286
|
+
_src: re,
|
|
287
|
+
_glob: glob,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
get options() {
|
|
291
|
+
return this.#options;
|
|
292
|
+
}
|
|
293
|
+
toRegExpSource(allowDot) {
|
|
294
|
+
const dot = allowDot ?? !!this.#options.dot;
|
|
295
|
+
if (this.#root === this)
|
|
296
|
+
this.#fillNegs();
|
|
297
|
+
if (!this.type) {
|
|
298
|
+
const noEmpty = this.isStart() && this.isEnd();
|
|
299
|
+
const src = this.#parts
|
|
300
|
+
.map((p) => {
|
|
301
|
+
const [re, _, hasMagic, uflag] = typeof p === 'string'
|
|
302
|
+
? AST.#parseGlob(p, this.#hasMagic, noEmpty)
|
|
303
|
+
: p.toRegExpSource(allowDot);
|
|
304
|
+
this.#hasMagic = this.#hasMagic || hasMagic;
|
|
305
|
+
this.#uflag = this.#uflag || uflag;
|
|
306
|
+
return re;
|
|
307
|
+
})
|
|
308
|
+
.join('');
|
|
309
|
+
let start = '';
|
|
310
|
+
if (this.isStart()) {
|
|
311
|
+
if (typeof this.#parts[0] === 'string') {
|
|
312
|
+
const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
|
|
313
|
+
if (!dotTravAllowed) {
|
|
314
|
+
const aps = addPatternStart;
|
|
315
|
+
const needNoTrav = (dot && aps.has(src.charAt(0))) ||
|
|
316
|
+
(src.startsWith('\\.') && aps.has(src.charAt(2))) ||
|
|
317
|
+
(src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
|
|
318
|
+
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
319
|
+
start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : '';
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
let end = '';
|
|
324
|
+
if (this.isEnd() &&
|
|
325
|
+
this.#root.#filledNegs &&
|
|
326
|
+
this.#parent?.type === '!') {
|
|
327
|
+
end = '(?:$|\\/)';
|
|
328
|
+
}
|
|
329
|
+
const final = start + src + end;
|
|
330
|
+
return [
|
|
331
|
+
final,
|
|
332
|
+
(0, unescape_1.unescape)(src),
|
|
333
|
+
(this.#hasMagic = !!this.#hasMagic),
|
|
334
|
+
this.#uflag,
|
|
335
|
+
];
|
|
336
|
+
}
|
|
337
|
+
const repeated = this.type === '*' || this.type === '+';
|
|
338
|
+
const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
|
|
339
|
+
let body = this.#partsToRegExp(dot);
|
|
340
|
+
if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
|
|
341
|
+
const s = this.toString();
|
|
342
|
+
this.#parts = [s];
|
|
343
|
+
this.type = null;
|
|
344
|
+
this.#hasMagic = undefined;
|
|
345
|
+
return [s, (0, unescape_1.unescape)(this.toString()), false, false];
|
|
346
|
+
}
|
|
347
|
+
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
|
|
348
|
+
? ''
|
|
349
|
+
: this.#partsToRegExp(true);
|
|
350
|
+
if (bodyDotAllowed === body) {
|
|
351
|
+
bodyDotAllowed = '';
|
|
352
|
+
}
|
|
353
|
+
if (bodyDotAllowed) {
|
|
354
|
+
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
355
|
+
}
|
|
356
|
+
let final = '';
|
|
357
|
+
if (this.type === '!' && this.#emptyExt) {
|
|
358
|
+
final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
const close = this.type === '!'
|
|
362
|
+
?
|
|
363
|
+
'))' +
|
|
364
|
+
(this.isStart() && !dot && !allowDot ? startNoDot : '') +
|
|
365
|
+
star +
|
|
366
|
+
')'
|
|
367
|
+
: this.type === '@'
|
|
368
|
+
? ')'
|
|
369
|
+
: this.type === '?'
|
|
370
|
+
? ')?'
|
|
371
|
+
: this.type === '+' && bodyDotAllowed
|
|
372
|
+
? ')'
|
|
373
|
+
: this.type === '*' && bodyDotAllowed
|
|
374
|
+
? `)?`
|
|
375
|
+
: `)${this.type}`;
|
|
376
|
+
final = start + body + close;
|
|
377
|
+
}
|
|
378
|
+
return [
|
|
379
|
+
final,
|
|
380
|
+
(0, unescape_1.unescape)(body),
|
|
381
|
+
(this.#hasMagic = !!this.#hasMagic),
|
|
382
|
+
this.#uflag,
|
|
383
|
+
];
|
|
384
|
+
}
|
|
385
|
+
#partsToRegExp(dot) {
|
|
386
|
+
return this.#parts
|
|
387
|
+
.map((p) => {
|
|
388
|
+
if (typeof p === 'string') {
|
|
389
|
+
throw new Error('string type in extglob ast??');
|
|
390
|
+
}
|
|
391
|
+
const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
|
|
392
|
+
this.#uflag = this.#uflag || uflag;
|
|
393
|
+
return re;
|
|
394
|
+
})
|
|
395
|
+
.filter((p) => !(this.isStart() && this.isEnd()) || !!p)
|
|
396
|
+
.join('|');
|
|
397
|
+
}
|
|
398
|
+
static #parseGlob(glob, hasMagic, noEmpty = false) {
|
|
399
|
+
let escaping = false;
|
|
400
|
+
let re = '';
|
|
401
|
+
let uflag = false;
|
|
402
|
+
for (let i = 0; i < glob.length; i++) {
|
|
403
|
+
const c = glob.charAt(i);
|
|
404
|
+
if (escaping) {
|
|
405
|
+
escaping = false;
|
|
406
|
+
re += (reSpecials.has(c) ? '\\' : '') + c;
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
if (c === '\\') {
|
|
410
|
+
if (i === glob.length - 1) {
|
|
411
|
+
re += '\\\\';
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
escaping = true;
|
|
415
|
+
}
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
if (c === '[') {
|
|
419
|
+
const [src, needUflag, consumed, magic] = (0, brace_expressions_1.parseClass)(glob, i);
|
|
420
|
+
if (consumed) {
|
|
421
|
+
re += src;
|
|
422
|
+
uflag = uflag || needUflag;
|
|
423
|
+
i += consumed - 1;
|
|
424
|
+
hasMagic = hasMagic || magic;
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (c === '*') {
|
|
429
|
+
if (noEmpty && glob === '*')
|
|
430
|
+
re += starNoEmpty;
|
|
431
|
+
else
|
|
432
|
+
re += star;
|
|
433
|
+
hasMagic = true;
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
if (c === '?') {
|
|
437
|
+
re += qmark;
|
|
438
|
+
hasMagic = true;
|
|
439
|
+
continue;
|
|
440
|
+
}
|
|
441
|
+
re += regExpEscape(c);
|
|
442
|
+
}
|
|
443
|
+
return [re, (0, unescape_1.unescape)(glob), !!hasMagic, uflag];
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
exports.AST = AST;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = balanced;
|
|
4
|
+
exports.range = range;
|
|
5
|
+
function balanced(a, b, str) {
|
|
6
|
+
if (a instanceof RegExp)
|
|
7
|
+
a = maybeMatch(a, str);
|
|
8
|
+
if (b instanceof RegExp)
|
|
9
|
+
b = maybeMatch(b, str);
|
|
10
|
+
const r = range(a, b, str);
|
|
11
|
+
return (r && {
|
|
12
|
+
start: r[0],
|
|
13
|
+
end: r[1],
|
|
14
|
+
pre: str.slice(0, r[0]),
|
|
15
|
+
body: str.slice(r[0] + a.length, r[1]),
|
|
16
|
+
post: str.slice(r[1] + b.length)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function maybeMatch(reg, str) {
|
|
20
|
+
const m = str.match(reg);
|
|
21
|
+
return m ? m[0] : null;
|
|
22
|
+
}
|
|
23
|
+
function range(a, b, str) {
|
|
24
|
+
let begs, beg, left, right, result;
|
|
25
|
+
let ai = str.indexOf(a);
|
|
26
|
+
let bi = str.indexOf(b, ai + 1);
|
|
27
|
+
let i = ai;
|
|
28
|
+
if (ai >= 0 && bi > 0) {
|
|
29
|
+
if (a === b) {
|
|
30
|
+
return [ai, bi];
|
|
31
|
+
}
|
|
32
|
+
begs = [];
|
|
33
|
+
left = str.length;
|
|
34
|
+
while (i >= 0 && !result) {
|
|
35
|
+
if (i === ai) {
|
|
36
|
+
begs.push(i);
|
|
37
|
+
ai = str.indexOf(a, i + 1);
|
|
38
|
+
}
|
|
39
|
+
else if (begs.length === 1) {
|
|
40
|
+
result = [begs.pop(), bi];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
beg = begs.pop();
|
|
44
|
+
if (beg < left) {
|
|
45
|
+
left = beg;
|
|
46
|
+
right = bi;
|
|
47
|
+
}
|
|
48
|
+
bi = str.indexOf(b, i + 1);
|
|
49
|
+
}
|
|
50
|
+
i = ai < bi && ai >= 0 ? ai : bi;
|
|
51
|
+
}
|
|
52
|
+
if (begs.length) {
|
|
53
|
+
result = [left, right];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function expandTop(str: any): any;
|