webhookdb 1.2.1 → 1.3.0
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.
- checksums.yaml +4 -4
- data/admin-dist/assets/index-6aebf805.js +264 -0
- data/admin-dist/favicon.ico +0 -0
- data/admin-dist/index.html +130 -0
- data/admin-dist/manifest.json +15 -0
- data/data/messages/replicators/url-recorder.liquid +20 -0
- data/data/messages/templates/errors/signalwire_send_sms.email.liquid +31 -0
- data/data/messages/web/install-customer-login.liquid +6 -5
- data/data/messages/web/install-error.liquid +1 -1
- data/data/messages/web/install-forbidden.liquid +25 -0
- data/data/messages/web/install-org-chooser.liquid +40 -0
- data/data/messages/web/install-success.liquid +2 -1
- data/data/messages/web/install.liquid +2 -1
- data/data/messages/web/partials/head.liquid +2 -0
- data/data/messages/web/styles.liquid +24 -0
- data/db/migrations/040_saved_query_fix_unique.rb +17 -0
- data/db/migrations/041_views.rb +20 -0
- data/db/migrations/042_sint_lock.rb +10 -0
- data/db/migrations/043_text_search.rb +28 -0
- data/db/migrations/044_oauth_session_token_cache.rb +21 -0
- data/integration/auth_spec.rb +2 -2
- data/lib/sequel/plugins/text_searchable.rb +165 -0
- data/lib/sequel/text_searchable.rb +42 -0
- data/lib/webhookdb/admin_api/auth.rb +24 -3
- data/lib/webhookdb/admin_api/data_provider.rb +196 -0
- data/lib/webhookdb/admin_api/entities.rb +143 -28
- data/lib/webhookdb/admin_api.rb +0 -2
- data/lib/webhookdb/api/auth.rb +5 -6
- data/lib/webhookdb/api/db.rb +31 -6
- data/lib/webhookdb/api/entities.rb +7 -1
- data/lib/webhookdb/api/helpers.rb +6 -25
- data/lib/webhookdb/api/install.rb +204 -79
- data/lib/webhookdb/api/organizations.rb +14 -12
- data/lib/webhookdb/api/saved_queries.rb +10 -3
- data/lib/webhookdb/api/saved_views.rb +99 -0
- data/lib/webhookdb/api/service_integrations.rb +15 -9
- data/lib/webhookdb/api/subscriptions.rb +3 -1
- data/lib/webhookdb/api/sync_targets.rb +9 -7
- data/lib/webhookdb/api/system.rb +1 -0
- data/lib/webhookdb/api/webhook_subscriptions.rb +3 -1
- data/lib/webhookdb/apps.rb +30 -7
- data/lib/webhookdb/async/audit_logger.rb +2 -0
- data/lib/webhookdb/async.rb +5 -0
- data/lib/webhookdb/backfill_job/service_integration_lock.rb +22 -0
- data/lib/webhookdb/backfill_job.rb +9 -0
- data/lib/webhookdb/customer.rb +5 -0
- data/lib/webhookdb/database_document.rb +1 -1
- data/lib/webhookdb/db_adapter/default_sql.rb +1 -1
- data/lib/webhookdb/db_adapter.rb +20 -4
- data/lib/webhookdb/fixtures/message_bodies.rb +34 -0
- data/lib/webhookdb/fixtures/organizations.rb +5 -0
- data/lib/webhookdb/fixtures/roles.rb +14 -0
- data/lib/webhookdb/fixtures/saved_views.rb +25 -0
- data/lib/webhookdb/fixtures/webhook_subscription_deliveries.rb +18 -0
- data/lib/webhookdb/http.rb +8 -2
- data/lib/webhookdb/icalendar.rb +3 -0
- data/lib/webhookdb/idempotency.rb +69 -22
- data/lib/webhookdb/increase.rb +69 -21
- data/lib/webhookdb/intercom.rb +10 -3
- data/lib/webhookdb/jobs/backfill.rb +3 -1
- data/lib/webhookdb/jobs/emailer.rb +0 -1
- data/lib/webhookdb/jobs/icalendar_delete_stale_cancelled_events.rb +19 -0
- data/lib/webhookdb/jobs/icalendar_enqueue_syncs.rb +1 -1
- data/lib/webhookdb/jobs/icalendar_sync.rb +1 -1
- data/lib/webhookdb/jobs/increase_event_handler.rb +20 -0
- data/lib/webhookdb/jobs/scheduled_backfills.rb +2 -1
- data/lib/webhookdb/jobs/sync_target_run_sync.rb +3 -1
- data/lib/webhookdb/message/body.rb +6 -4
- data/lib/webhookdb/message/delivery.rb +2 -0
- data/lib/webhookdb/messages/error_icalendar_fetch.rb +1 -2
- data/lib/webhookdb/messages/error_signalwire_send_sms.rb +48 -0
- data/lib/webhookdb/oauth/fake_provider.rb +44 -0
- data/lib/webhookdb/oauth/front_provider.rb +1 -2
- data/lib/webhookdb/oauth/increase_provider.rb +80 -0
- data/lib/webhookdb/oauth/intercom_provider.rb +3 -11
- data/lib/webhookdb/oauth/session.rb +20 -0
- data/lib/webhookdb/oauth.rb +7 -21
- data/lib/webhookdb/organization/alerting.rb +2 -0
- data/lib/webhookdb/organization/database_migration.rb +3 -0
- data/lib/webhookdb/organization.rb +37 -6
- data/lib/webhookdb/organization_membership.rb +14 -7
- data/lib/webhookdb/postgres.rb +2 -0
- data/lib/webhookdb/replicator/base.rb +1 -0
- data/lib/webhookdb/replicator/docgen.rb +9 -1
- data/lib/webhookdb/replicator/fake.rb +2 -3
- data/lib/webhookdb/replicator/front_signalwire_message_channel_app_v1.rb +49 -14
- data/lib/webhookdb/replicator/icalendar_calendar_v1.rb +97 -17
- data/lib/webhookdb/replicator/icalendar_event_v1.rb +104 -2
- data/lib/webhookdb/replicator/increase_account_number_v1.rb +6 -43
- data/lib/webhookdb/replicator/increase_account_transfer_v1.rb +7 -24
- data/lib/webhookdb/replicator/increase_account_v1.rb +7 -31
- data/lib/webhookdb/replicator/increase_ach_transfer_v1.rb +5 -43
- data/lib/webhookdb/replicator/increase_app_v1.rb +78 -0
- data/lib/webhookdb/replicator/increase_check_transfer_v1.rb +23 -29
- data/lib/webhookdb/replicator/increase_event_v1.rb +41 -0
- data/lib/webhookdb/replicator/increase_limit_v1.rb +9 -34
- data/lib/webhookdb/replicator/increase_transaction_v1.rb +5 -30
- data/lib/webhookdb/replicator/increase_v1_mixin.rb +58 -78
- data/lib/webhookdb/replicator/increase_wire_transfer_v1.rb +5 -24
- data/lib/webhookdb/replicator/intercom_contact_v1.rb +51 -4
- data/lib/webhookdb/replicator/intercom_conversation_v1.rb +42 -6
- data/lib/webhookdb/replicator/intercom_marketplace_root_v1.rb +2 -13
- data/lib/webhookdb/replicator/intercom_v1_mixin.rb +20 -16
- data/lib/webhookdb/replicator/oauth_refresh_access_token_mixin.rb +1 -1
- data/lib/webhookdb/replicator/sponsy_v1_mixin.rb +1 -1
- data/lib/webhookdb/replicator/transistor_episode_v1.rb +17 -0
- data/lib/webhookdb/replicator/url_recorder_v1.rb +137 -0
- data/lib/webhookdb/replicator/webhook_request.rb +4 -0
- data/lib/webhookdb/replicator.rb +8 -0
- data/lib/webhookdb/role.rb +5 -2
- data/lib/webhookdb/saved_query.rb +23 -0
- data/lib/webhookdb/saved_view.rb +73 -0
- data/lib/webhookdb/sentry.rb +2 -0
- data/lib/webhookdb/service/entities.rb +0 -4
- data/lib/webhookdb/service/helpers.rb +5 -0
- data/lib/webhookdb/service/middleware.rb +17 -0
- data/lib/webhookdb/service/types.rb +10 -8
- data/lib/webhookdb/service/validators.rb +1 -2
- data/lib/webhookdb/service/view_api.rb +1 -1
- data/lib/webhookdb/service_integration.rb +17 -15
- data/lib/webhookdb/spec_helpers/shared_examples_for_replicators.rb +8 -8
- data/lib/webhookdb/spec_helpers/whdb.rb +3 -2
- data/lib/webhookdb/subscription.rb +2 -0
- data/lib/webhookdb/sync_target.rb +10 -2
- data/lib/webhookdb/tasks/message.rb +3 -1
- data/lib/webhookdb/version.rb +1 -1
- data/lib/webhookdb/webhook_subscription/delivery.rb +2 -0
- data/lib/webhookdb/webhook_subscription.rb +2 -0
- metadata +58 -9
- data/lib/webhookdb/admin_api/customers.rb +0 -63
- data/lib/webhookdb/admin_api/message_deliveries.rb +0 -61
- data/lib/webhookdb/admin_api/roles.rb +0 -15
|
@@ -8,6 +8,7 @@ require "webhookdb/webhook_subscription"
|
|
|
8
8
|
# See WebhookSubscription for more details.
|
|
9
9
|
class Webhookdb::WebhookSubscription::Delivery < Webhookdb::Postgres::Model(:webhook_subscription_deliveries)
|
|
10
10
|
plugin :timestamps
|
|
11
|
+
plugin :text_searchable, terms: [:webhook_subscription]
|
|
11
12
|
|
|
12
13
|
many_to_one :webhook_subscription, class: "Webhookdb::WebhookSubscription"
|
|
13
14
|
|
|
@@ -72,6 +73,7 @@ end
|
|
|
72
73
|
# attempt_http_response_statuses | smallint[] | NOT NULL DEFAULT ARRAY[]::smallint[]
|
|
73
74
|
# payload | jsonb | NOT NULL
|
|
74
75
|
# webhook_subscription_id | integer | NOT NULL
|
|
76
|
+
# text_search | tsvector |
|
|
75
77
|
# Indexes:
|
|
76
78
|
# webhook_subscription_deliveries_pkey | PRIMARY KEY btree (id)
|
|
77
79
|
# webhook_subscription_deliveries_webhook_subscription_id_index | btree (webhook_subscription_id)
|
|
@@ -23,6 +23,7 @@ require "webhookdb/jobs/webhook_subscription_delivery_attempt"
|
|
|
23
23
|
#
|
|
24
24
|
class Webhookdb::WebhookSubscription < Webhookdb::Postgres::Model(:webhook_subscriptions)
|
|
25
25
|
plugin :timestamps
|
|
26
|
+
plugin :text_searchable, terms: [:organization, :service_integration, :deliver_to_url, :created_by]
|
|
26
27
|
plugin :column_encryption do |enc|
|
|
27
28
|
enc.column :webhook_secret
|
|
28
29
|
end
|
|
@@ -212,6 +213,7 @@ end
|
|
|
212
213
|
# updated_at | timestamp with time zone |
|
|
213
214
|
# created_by_id | integer |
|
|
214
215
|
# deactivated_at | timestamp with time zone |
|
|
216
|
+
# text_search | tsvector |
|
|
215
217
|
# Indexes:
|
|
216
218
|
# webhook_subscriptions_pkey | PRIMARY KEY btree (id)
|
|
217
219
|
# webhook_subscriptions_opaque_id_key | UNIQUE btree (opaque_id)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: webhookdb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- WebhookDB
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-04-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -472,6 +472,20 @@ dependencies:
|
|
|
472
472
|
- - "~>"
|
|
473
473
|
- !ruby/object:Gem::Version
|
|
474
474
|
version: '3.2'
|
|
475
|
+
- !ruby/object:Gem::Dependency
|
|
476
|
+
name: rack-spa
|
|
477
|
+
requirement: !ruby/object:Gem::Requirement
|
|
478
|
+
requirements:
|
|
479
|
+
- - "~>"
|
|
480
|
+
- !ruby/object:Gem::Version
|
|
481
|
+
version: '0.11'
|
|
482
|
+
type: :runtime
|
|
483
|
+
prerelease: false
|
|
484
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
485
|
+
requirements:
|
|
486
|
+
- - "~>"
|
|
487
|
+
- !ruby/object:Gem::Version
|
|
488
|
+
version: '0.11'
|
|
475
489
|
- !ruby/object:Gem::Dependency
|
|
476
490
|
name: rack-ssl-enforcer
|
|
477
491
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -548,28 +562,28 @@ dependencies:
|
|
|
548
562
|
requirements:
|
|
549
563
|
- - "~>"
|
|
550
564
|
- !ruby/object:Gem::Version
|
|
551
|
-
version: '5.
|
|
565
|
+
version: '5.17'
|
|
552
566
|
type: :runtime
|
|
553
567
|
prerelease: false
|
|
554
568
|
version_requirements: !ruby/object:Gem::Requirement
|
|
555
569
|
requirements:
|
|
556
570
|
- - "~>"
|
|
557
571
|
- !ruby/object:Gem::Version
|
|
558
|
-
version: '5.
|
|
572
|
+
version: '5.17'
|
|
559
573
|
- !ruby/object:Gem::Dependency
|
|
560
574
|
name: sentry-sidekiq
|
|
561
575
|
requirement: !ruby/object:Gem::Requirement
|
|
562
576
|
requirements:
|
|
563
577
|
- - "~>"
|
|
564
578
|
- !ruby/object:Gem::Version
|
|
565
|
-
version: '5.
|
|
579
|
+
version: '5.17'
|
|
566
580
|
type: :runtime
|
|
567
581
|
prerelease: false
|
|
568
582
|
version_requirements: !ruby/object:Gem::Requirement
|
|
569
583
|
requirements:
|
|
570
584
|
- - "~>"
|
|
571
585
|
- !ruby/object:Gem::Version
|
|
572
|
-
version: '5.
|
|
586
|
+
version: '5.17'
|
|
573
587
|
- !ruby/object:Gem::Dependency
|
|
574
588
|
name: sequel
|
|
575
589
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -689,6 +703,9 @@ dependencies:
|
|
|
689
703
|
- - "~>"
|
|
690
704
|
- !ruby/object:Gem::Version
|
|
691
705
|
version: '1.6'
|
|
706
|
+
- - ">="
|
|
707
|
+
- !ruby/object:Gem::Version
|
|
708
|
+
version: 1.6.2
|
|
692
709
|
type: :runtime
|
|
693
710
|
prerelease: false
|
|
694
711
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -696,6 +713,9 @@ dependencies:
|
|
|
696
713
|
- - "~>"
|
|
697
714
|
- !ruby/object:Gem::Version
|
|
698
715
|
version: '1.6'
|
|
716
|
+
- - ">="
|
|
717
|
+
- !ruby/object:Gem::Version
|
|
718
|
+
version: 1.6.2
|
|
699
719
|
- !ruby/object:Gem::Dependency
|
|
700
720
|
name: sidekiq-cron
|
|
701
721
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -782,6 +802,10 @@ executables: []
|
|
|
782
802
|
extensions: []
|
|
783
803
|
extra_rdoc_files: []
|
|
784
804
|
files:
|
|
805
|
+
- admin-dist/assets/index-6aebf805.js
|
|
806
|
+
- admin-dist/favicon.ico
|
|
807
|
+
- admin-dist/index.html
|
|
808
|
+
- admin-dist/manifest.json
|
|
785
809
|
- data/messages/layouts/blank.email.liquid
|
|
786
810
|
- data/messages/layouts/minimal.email.liquid
|
|
787
811
|
- data/messages/layouts/standard.email.liquid
|
|
@@ -791,8 +815,10 @@ files:
|
|
|
791
815
|
- data/messages/partials/greeting.liquid
|
|
792
816
|
- data/messages/partials/logo_header.liquid
|
|
793
817
|
- data/messages/partials/signoff.liquid
|
|
818
|
+
- data/messages/replicators/url-recorder.liquid
|
|
794
819
|
- data/messages/styles/v1.liquid
|
|
795
820
|
- data/messages/templates/errors/icalendar_fetch.email.liquid
|
|
821
|
+
- data/messages/templates/errors/signalwire_send_sms.email.liquid
|
|
796
822
|
- data/messages/templates/invite.email.liquid
|
|
797
823
|
- data/messages/templates/new_customer.email.liquid
|
|
798
824
|
- data/messages/templates/org_database_migration_finished.email.liquid
|
|
@@ -808,10 +834,13 @@ files:
|
|
|
808
834
|
- data/messages/templates/verification.sms.liquid
|
|
809
835
|
- data/messages/web/install-customer-login.liquid
|
|
810
836
|
- data/messages/web/install-error.liquid
|
|
837
|
+
- data/messages/web/install-forbidden.liquid
|
|
838
|
+
- data/messages/web/install-org-chooser.liquid
|
|
811
839
|
- data/messages/web/install-success.liquid
|
|
812
840
|
- data/messages/web/install.liquid
|
|
813
841
|
- data/messages/web/partials/footer.liquid
|
|
814
842
|
- data/messages/web/partials/form_error.liquid
|
|
843
|
+
- data/messages/web/partials/head.liquid
|
|
815
844
|
- data/messages/web/partials/header.liquid
|
|
816
845
|
- data/messages/web/styles.liquid
|
|
817
846
|
- data/windows_tz.txt
|
|
@@ -854,6 +883,11 @@ files:
|
|
|
854
883
|
- db/migrations/037_oauth_used.rb
|
|
855
884
|
- db/migrations/038_webhookdb_api_key.rb
|
|
856
885
|
- db/migrations/039_saved_query.rb
|
|
886
|
+
- db/migrations/040_saved_query_fix_unique.rb
|
|
887
|
+
- db/migrations/041_views.rb
|
|
888
|
+
- db/migrations/042_sint_lock.rb
|
|
889
|
+
- db/migrations/043_text_search.rb
|
|
890
|
+
- db/migrations/044_oauth_session_token_cache.rb
|
|
857
891
|
- integration/async_spec.rb
|
|
858
892
|
- integration/auth_spec.rb
|
|
859
893
|
- integration/database_spec.rb
|
|
@@ -863,15 +897,15 @@ files:
|
|
|
863
897
|
- lib/amigo/durable_job.rb
|
|
864
898
|
- lib/pry/clipboard.rb
|
|
865
899
|
- lib/sequel/advisory_lock.rb
|
|
900
|
+
- lib/sequel/plugins/text_searchable.rb
|
|
901
|
+
- lib/sequel/text_searchable.rb
|
|
866
902
|
- lib/webhookdb.rb
|
|
867
903
|
- lib/webhookdb/admin.rb
|
|
868
904
|
- lib/webhookdb/admin_api.rb
|
|
869
905
|
- lib/webhookdb/admin_api/auth.rb
|
|
870
|
-
- lib/webhookdb/admin_api/
|
|
906
|
+
- lib/webhookdb/admin_api/data_provider.rb
|
|
871
907
|
- lib/webhookdb/admin_api/database_documents.rb
|
|
872
908
|
- lib/webhookdb/admin_api/entities.rb
|
|
873
|
-
- lib/webhookdb/admin_api/message_deliveries.rb
|
|
874
|
-
- lib/webhookdb/admin_api/roles.rb
|
|
875
909
|
- lib/webhookdb/aggregate_result.rb
|
|
876
910
|
- lib/webhookdb/api.rb
|
|
877
911
|
- lib/webhookdb/api/auth.rb
|
|
@@ -885,6 +919,7 @@ files:
|
|
|
885
919
|
- lib/webhookdb/api/organizations.rb
|
|
886
920
|
- lib/webhookdb/api/replay.rb
|
|
887
921
|
- lib/webhookdb/api/saved_queries.rb
|
|
922
|
+
- lib/webhookdb/api/saved_views.rb
|
|
888
923
|
- lib/webhookdb/api/service_integrations.rb
|
|
889
924
|
- lib/webhookdb/api/services.rb
|
|
890
925
|
- lib/webhookdb/api/stripe.rb
|
|
@@ -901,6 +936,7 @@ files:
|
|
|
901
936
|
- lib/webhookdb/async/scheduled_job.rb
|
|
902
937
|
- lib/webhookdb/aws.rb
|
|
903
938
|
- lib/webhookdb/backfill_job.rb
|
|
939
|
+
- lib/webhookdb/backfill_job/service_integration_lock.rb
|
|
904
940
|
- lib/webhookdb/backfiller.rb
|
|
905
941
|
- lib/webhookdb/cloudflare.rb
|
|
906
942
|
- lib/webhookdb/connection_cache.rb
|
|
@@ -927,16 +963,20 @@ files:
|
|
|
927
963
|
- lib/webhookdb/fixtures/database_documents.rb
|
|
928
964
|
- lib/webhookdb/fixtures/faker.rb
|
|
929
965
|
- lib/webhookdb/fixtures/logged_webhooks.rb
|
|
966
|
+
- lib/webhookdb/fixtures/message_bodies.rb
|
|
930
967
|
- lib/webhookdb/fixtures/message_deliveries.rb
|
|
931
968
|
- lib/webhookdb/fixtures/oauth_sessions.rb
|
|
932
969
|
- lib/webhookdb/fixtures/organization_database_migrations.rb
|
|
933
970
|
- lib/webhookdb/fixtures/organization_memberships.rb
|
|
934
971
|
- lib/webhookdb/fixtures/organizations.rb
|
|
935
972
|
- lib/webhookdb/fixtures/reset_codes.rb
|
|
973
|
+
- lib/webhookdb/fixtures/roles.rb
|
|
936
974
|
- lib/webhookdb/fixtures/saved_queries.rb
|
|
975
|
+
- lib/webhookdb/fixtures/saved_views.rb
|
|
937
976
|
- lib/webhookdb/fixtures/service_integrations.rb
|
|
938
977
|
- lib/webhookdb/fixtures/subscriptions.rb
|
|
939
978
|
- lib/webhookdb/fixtures/sync_targets.rb
|
|
979
|
+
- lib/webhookdb/fixtures/webhook_subscription_deliveries.rb
|
|
940
980
|
- lib/webhookdb/fixtures/webhook_subscriptions.rb
|
|
941
981
|
- lib/webhookdb/formatting.rb
|
|
942
982
|
- lib/webhookdb/front.rb
|
|
@@ -960,8 +1000,10 @@ files:
|
|
|
960
1000
|
- lib/webhookdb/jobs/developer_alert_handle.rb
|
|
961
1001
|
- lib/webhookdb/jobs/durable_job_recheck_poller.rb
|
|
962
1002
|
- lib/webhookdb/jobs/emailer.rb
|
|
1003
|
+
- lib/webhookdb/jobs/icalendar_delete_stale_cancelled_events.rb
|
|
963
1004
|
- lib/webhookdb/jobs/icalendar_enqueue_syncs.rb
|
|
964
1005
|
- lib/webhookdb/jobs/icalendar_sync.rb
|
|
1006
|
+
- lib/webhookdb/jobs/increase_event_handler.rb
|
|
965
1007
|
- lib/webhookdb/jobs/logged_webhook_replay.rb
|
|
966
1008
|
- lib/webhookdb/jobs/logged_webhook_resilient_replay.rb
|
|
967
1009
|
- lib/webhookdb/jobs/message_dispatched.rb
|
|
@@ -998,6 +1040,7 @@ files:
|
|
|
998
1040
|
- lib/webhookdb/message/template.rb
|
|
999
1041
|
- lib/webhookdb/message/transport.rb
|
|
1000
1042
|
- lib/webhookdb/messages/error_icalendar_fetch.rb
|
|
1043
|
+
- lib/webhookdb/messages/error_signalwire_send_sms.rb
|
|
1001
1044
|
- lib/webhookdb/messages/invite.rb
|
|
1002
1045
|
- lib/webhookdb/messages/new_customer.rb
|
|
1003
1046
|
- lib/webhookdb/messages/org_database_migration_finished.rb
|
|
@@ -1008,7 +1051,9 @@ files:
|
|
|
1008
1051
|
- lib/webhookdb/microsoft_calendar.rb
|
|
1009
1052
|
- lib/webhookdb/nextpax.rb
|
|
1010
1053
|
- lib/webhookdb/oauth.rb
|
|
1054
|
+
- lib/webhookdb/oauth/fake_provider.rb
|
|
1011
1055
|
- lib/webhookdb/oauth/front_provider.rb
|
|
1056
|
+
- lib/webhookdb/oauth/increase_provider.rb
|
|
1012
1057
|
- lib/webhookdb/oauth/intercom_provider.rb
|
|
1013
1058
|
- lib/webhookdb/oauth/session.rb
|
|
1014
1059
|
- lib/webhookdb/organization.rb
|
|
@@ -1061,7 +1106,9 @@ files:
|
|
|
1061
1106
|
- lib/webhookdb/replicator/increase_account_transfer_v1.rb
|
|
1062
1107
|
- lib/webhookdb/replicator/increase_account_v1.rb
|
|
1063
1108
|
- lib/webhookdb/replicator/increase_ach_transfer_v1.rb
|
|
1109
|
+
- lib/webhookdb/replicator/increase_app_v1.rb
|
|
1064
1110
|
- lib/webhookdb/replicator/increase_check_transfer_v1.rb
|
|
1111
|
+
- lib/webhookdb/replicator/increase_event_v1.rb
|
|
1065
1112
|
- lib/webhookdb/replicator/increase_limit_v1.rb
|
|
1066
1113
|
- lib/webhookdb/replicator/increase_transaction_v1.rb
|
|
1067
1114
|
- lib/webhookdb/replicator/increase_v1_mixin.rb
|
|
@@ -1104,10 +1151,12 @@ files:
|
|
|
1104
1151
|
- lib/webhookdb/replicator/transistor_show_v1.rb
|
|
1105
1152
|
- lib/webhookdb/replicator/transistor_v1_mixin.rb
|
|
1106
1153
|
- lib/webhookdb/replicator/twilio_sms_v1.rb
|
|
1154
|
+
- lib/webhookdb/replicator/url_recorder_v1.rb
|
|
1107
1155
|
- lib/webhookdb/replicator/webhook_request.rb
|
|
1108
1156
|
- lib/webhookdb/replicator/webhookdb_customer_v1.rb
|
|
1109
1157
|
- lib/webhookdb/role.rb
|
|
1110
1158
|
- lib/webhookdb/saved_query.rb
|
|
1159
|
+
- lib/webhookdb/saved_view.rb
|
|
1111
1160
|
- lib/webhookdb/sentry.rb
|
|
1112
1161
|
- lib/webhookdb/service.rb
|
|
1113
1162
|
- lib/webhookdb/service/auth.rb
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "grape"
|
|
4
|
-
|
|
5
|
-
require "webhookdb/admin_api"
|
|
6
|
-
|
|
7
|
-
class Webhookdb::AdminAPI::Customers < Webhookdb::AdminAPI::V1
|
|
8
|
-
resource :customers do
|
|
9
|
-
desc "Return all customers, newest first"
|
|
10
|
-
params do
|
|
11
|
-
use :pagination
|
|
12
|
-
use :ordering, model: Webhookdb::Customer
|
|
13
|
-
use :searchable
|
|
14
|
-
end
|
|
15
|
-
get do
|
|
16
|
-
ds = Webhookdb::Customer.dataset
|
|
17
|
-
if (email_like = search_param_to_sql(params, :email))
|
|
18
|
-
name_like = search_param_to_sql(params, :name)
|
|
19
|
-
ds = ds.where(email_like | name_like)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
ds = order(ds, params)
|
|
23
|
-
ds = paginate(ds, params)
|
|
24
|
-
present_collection ds, with: Webhookdb::AdminAPI::CustomerEntity
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
route_param :id, type: Integer do
|
|
28
|
-
desc "Return the customer"
|
|
29
|
-
get do
|
|
30
|
-
(customer = Webhookdb::Customer[params[:id]]) or not_found!
|
|
31
|
-
present customer, with: Webhookdb::AdminAPI::DetailedCustomerEntity
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
desc "Update the customer"
|
|
35
|
-
params do
|
|
36
|
-
optional :name, type: String
|
|
37
|
-
optional :note, type: String
|
|
38
|
-
optional :email, type: String
|
|
39
|
-
optional :roles, type: [String]
|
|
40
|
-
end
|
|
41
|
-
post do
|
|
42
|
-
fields = params
|
|
43
|
-
(customer = Webhookdb::Customer[fields[:id]]) or not_found!
|
|
44
|
-
customer.db.transaction do
|
|
45
|
-
if (roles = fields.delete(:roles))
|
|
46
|
-
customer.remove_all_roles
|
|
47
|
-
roles.uniq.each { |r| customer.add_role(Webhookdb::Role[name: r]) }
|
|
48
|
-
end
|
|
49
|
-
if fields.key?(:email_verified)
|
|
50
|
-
customer.email_verified_at = fields.delete(:email_verified) ? Time.now : nil
|
|
51
|
-
end
|
|
52
|
-
if fields.key?(:phone_verified)
|
|
53
|
-
customer.phone_verified_at = fields.delete(:phone_verified) ? Time.now : nil
|
|
54
|
-
end
|
|
55
|
-
set_declared(customer, params)
|
|
56
|
-
customer.save_changes
|
|
57
|
-
end
|
|
58
|
-
status 200
|
|
59
|
-
present customer, with: Webhookdb::AdminAPI::DetailedCustomerEntity
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "grape"
|
|
4
|
-
|
|
5
|
-
require "webhookdb/admin_api"
|
|
6
|
-
|
|
7
|
-
class Webhookdb::AdminAPI::MessageDeliveries < Webhookdb::AdminAPI::V1
|
|
8
|
-
helpers do
|
|
9
|
-
def lookup_delivery(params)
|
|
10
|
-
(batch = Webhookdb::Message::Delivery[params[:id]]) or not_found!
|
|
11
|
-
return batch
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
resource :message_deliveries do
|
|
16
|
-
desc "Return all message deliveries, newest first"
|
|
17
|
-
params do
|
|
18
|
-
use :pagination
|
|
19
|
-
use :ordering, model: Webhookdb::Message::Delivery
|
|
20
|
-
use :searchable
|
|
21
|
-
end
|
|
22
|
-
get do
|
|
23
|
-
ds = Webhookdb::Message::Delivery.dataset
|
|
24
|
-
if (to_like = search_param_to_sql(params, :to))
|
|
25
|
-
criteria = to_like | search_param_to_sql(params, :template)
|
|
26
|
-
ds = ds.where(criteria)
|
|
27
|
-
end
|
|
28
|
-
ds = order(ds, params)
|
|
29
|
-
ds = paginate(ds, params)
|
|
30
|
-
present_collection ds, with: Webhookdb::AdminAPI::MessageDeliveryEntity
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
desc "Return the delivery with the last ID"
|
|
34
|
-
get :last do
|
|
35
|
-
delivery = Webhookdb::Message::Delivery.last
|
|
36
|
-
present delivery, with: Webhookdb::AdminAPI::MessageDeliveryWithBodiesEntity
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
route_param :id, type: Integer do
|
|
40
|
-
desc "Return the delivery"
|
|
41
|
-
get do
|
|
42
|
-
delivery = lookup_delivery(params)
|
|
43
|
-
present delivery, with: Webhookdb::AdminAPI::MessageDeliveryWithBodiesEntity
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
resource :customers do
|
|
49
|
-
route_param :id, type: Integer do
|
|
50
|
-
resource :message_deliveries do
|
|
51
|
-
desc "Return all message deliveries for customer the given customers, as recipients or to their emails"
|
|
52
|
-
get do
|
|
53
|
-
# rubocop:disable Layout/LineLength
|
|
54
|
-
ds = Webhookdb::Message::Delivery.to_customers(Webhookdb::Customer.where(id: params[:id])).order(Sequel.desc(:id))
|
|
55
|
-
# rubocop:enable Layout/LineLength
|
|
56
|
-
present_collection ds, with: Webhookdb::AdminAPI::MessageDeliveryEntity
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "grape"
|
|
4
|
-
|
|
5
|
-
require "webhookdb/admin_api"
|
|
6
|
-
|
|
7
|
-
class Webhookdb::AdminAPI::Roles < Webhookdb::AdminAPI::V1
|
|
8
|
-
resource :roles do
|
|
9
|
-
desc "Return all roles, ordered by name"
|
|
10
|
-
get do
|
|
11
|
-
ds = Webhookdb::Role.dataset.order(:name)
|
|
12
|
-
present_collection ds, with: Webhookdb::AdminAPI::RoleEntity
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|