reach_commons 0.18.6__py3-none-any.whl → 0.18.7__py3-none-any.whl
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.
- reach_commons/clients/outscraper.py +3 -2
- reach_commons/reach_aws/sqs.py +23 -0
- {reach_commons-0.18.6.dist-info → reach_commons-0.18.7.dist-info}/METADATA +1 -1
- {reach_commons-0.18.6.dist-info → reach_commons-0.18.7.dist-info}/RECORD +5 -5
- {reach_commons-0.18.6.dist-info → reach_commons-0.18.7.dist-info}/WHEEL +0 -0
|
@@ -4,9 +4,10 @@ import requests
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class OutscraperClient:
|
|
7
|
-
def __init__(self):
|
|
7
|
+
def __init__(self, token=None):
|
|
8
8
|
self.environment = os.environ.get("ENV", "Staging")
|
|
9
9
|
self.base_url = "https://api.app.outscraper.com"
|
|
10
|
+
self.token = token
|
|
10
11
|
|
|
11
12
|
@property
|
|
12
13
|
def headers(self):
|
|
@@ -20,7 +21,7 @@ class OutscraperClient:
|
|
|
20
21
|
"Prod": "MjZjYWUyMzg4MzUxNDk2Zjk0OGRlOTFlMzkyMDhhYWF8ZDhlNzM5OGVmOQ",
|
|
21
22
|
}.get(self.environment)
|
|
22
23
|
|
|
23
|
-
return {**common_headers, "X-API-KEY": auth_token}
|
|
24
|
+
return {**common_headers, "X-API-KEY": self.token or auth_token}
|
|
24
25
|
|
|
25
26
|
@property
|
|
26
27
|
def webhook_url(self):
|
reach_commons/reach_aws/sqs.py
CHANGED
|
@@ -504,6 +504,15 @@ class POSApiPullerSQSNotifier(SQSClient):
|
|
|
504
504
|
logger=logger,
|
|
505
505
|
topic_name=f"{env}-{self.TOPIC_NAME}",
|
|
506
506
|
)
|
|
507
|
+
self.env = env
|
|
508
|
+
|
|
509
|
+
@cached_property
|
|
510
|
+
def lambda_client(self):
|
|
511
|
+
session = boto3.Session(
|
|
512
|
+
region_name=self.region_name,
|
|
513
|
+
profile_name=self.profile_name,
|
|
514
|
+
)
|
|
515
|
+
return session.client("lambda")
|
|
507
516
|
|
|
508
517
|
def notify_for_send_message(
|
|
509
518
|
self,
|
|
@@ -512,6 +521,20 @@ class POSApiPullerSQSNotifier(SQSClient):
|
|
|
512
521
|
):
|
|
513
522
|
message_attributes = {"service_name": self.SERVICE_NAME}
|
|
514
523
|
|
|
524
|
+
try:
|
|
525
|
+
self.lambda_client.invoke(
|
|
526
|
+
FunctionName=f"{self.env}-nightly-lambda",
|
|
527
|
+
InvocationType="Event",
|
|
528
|
+
Payload=json.dumps(
|
|
529
|
+
{
|
|
530
|
+
"event": "hourly_15",
|
|
531
|
+
"override_status": True,
|
|
532
|
+
}
|
|
533
|
+
).encode("utf-8"),
|
|
534
|
+
)
|
|
535
|
+
except Exception:
|
|
536
|
+
pass
|
|
537
|
+
|
|
515
538
|
return self.publish(
|
|
516
539
|
message_data=message_data,
|
|
517
540
|
message_attributes=message_attributes,
|
|
@@ -7,7 +7,7 @@ reach_commons/app_logging/logging_config.py,sha256=Y1JaZOoQBWgQjkOqYmeDRIm0p2eCO
|
|
|
7
7
|
reach_commons/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
reach_commons/clients/event_processor.py,sha256=KmYF0kuZxLmHQjJASXMr5jz2D_D3WNHB0c4QOlZo1_E,2024
|
|
9
9
|
reach_commons/clients/hubspot.py,sha256=ntAzvwoaq78MkKaVoZ7geND-AafAzccNnJogfJDahVA,5497
|
|
10
|
-
reach_commons/clients/outscraper.py,sha256=
|
|
10
|
+
reach_commons/clients/outscraper.py,sha256=ONeSJGFKYkaq2mvBE5bVedjpW6euzYDvRASojkI16Eo,2094
|
|
11
11
|
reach_commons/clients/reach_data_bridge.py,sha256=TnKqn43qMAT7gexYsZNdTR43gh6mKEIG4jrlwJxp-SY,5630
|
|
12
12
|
reach_commons/clients/reach_ops_api.py,sha256=1kTY4cF2eBCl_kqs1r5lbzxt4_7EFRmltbYSTa5aQA4,2440
|
|
13
13
|
reach_commons/mongo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -21,12 +21,12 @@ reach_commons/reach_aws/exceptions.py,sha256=x0RL5ktNtzxg0KykhEVWReBq_dEtciK6B2v
|
|
|
21
21
|
reach_commons/reach_aws/firehose.py,sha256=1xFKLWMv3bNo3PPW5gtaL6NqzUDyVil6B768slj2wbY,5674
|
|
22
22
|
reach_commons/reach_aws/kms.py,sha256=-X4EJOh9IoncNn9C46X55mpSHPO5mR0B36lYLA2hhic,4670
|
|
23
23
|
reach_commons/reach_aws/s3.py,sha256=2MLlDNFx0SROJBpE_KjJefyrB7lMqTlrYuRhSZx4iKs,3945
|
|
24
|
-
reach_commons/reach_aws/sqs.py,sha256
|
|
24
|
+
reach_commons/reach_aws/sqs.py,sha256=-qEAIkr8k43bmA5cuADk7k3hnoiFqIDOnVsCgi4Yqok,16549
|
|
25
25
|
reach_commons/reach_base_model.py,sha256=vgdGDcZr3iXMmyRhmBhOf_LKWB_6QzT3r_Yiyo6OmEk,3009
|
|
26
26
|
reach_commons/redis_manager.py,sha256=SgUtdtt0eV4bUwsWDankIa9Bjfgcm2DKcmVMQT6ptF0,2946
|
|
27
27
|
reach_commons/sms_smart_encoding.py,sha256=92y0RmZ0l4ONHpC9qeO5KfViSNq64yE2rc7lhNDSZqE,1241
|
|
28
28
|
reach_commons/utils.py,sha256=dMgKIGqTgoSItuBI8oz81gKtW3qi21Jkljv9leS_V88,8475
|
|
29
29
|
reach_commons/validations.py,sha256=CJdWg8qc9ILe3rYHYTLdr2upRspsM_8ghhm4IXX4Pg8,1028
|
|
30
|
-
reach_commons-0.18.
|
|
31
|
-
reach_commons-0.18.
|
|
32
|
-
reach_commons-0.18.
|
|
30
|
+
reach_commons-0.18.7.dist-info/METADATA,sha256=RyXrrpovJyg5IP6ljL_IWiQAL0AtgI1r1uKGegSV6U0,1860
|
|
31
|
+
reach_commons-0.18.7.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
32
|
+
reach_commons-0.18.7.dist-info/RECORD,,
|
|
File without changes
|