webhookdb 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (364) hide show
  1. checksums.yaml +7 -0
  2. data/data/messages/layouts/blank.email.liquid +10 -0
  3. data/data/messages/layouts/minimal.email.liquid +28 -0
  4. data/data/messages/layouts/standard.email.liquid +28 -0
  5. data/data/messages/partials/button.liquid +15 -0
  6. data/data/messages/partials/environment_banner.liquid +9 -0
  7. data/data/messages/partials/footer.liquid +22 -0
  8. data/data/messages/partials/greeting.liquid +3 -0
  9. data/data/messages/partials/logo_header.liquid +18 -0
  10. data/data/messages/partials/signoff.liquid +1 -0
  11. data/data/messages/styles/v1.liquid +346 -0
  12. data/data/messages/templates/errors/icalendar_fetch.email.liquid +29 -0
  13. data/data/messages/templates/invite.email.liquid +15 -0
  14. data/data/messages/templates/new_customer.email.liquid +24 -0
  15. data/data/messages/templates/org_database_migration_finished.email.liquid +7 -0
  16. data/data/messages/templates/org_database_migration_started.email.liquid +9 -0
  17. data/data/messages/templates/specs/_field_partial.liquid +1 -0
  18. data/data/messages/templates/specs/basic.email.liquid +2 -0
  19. data/data/messages/templates/specs/basic.fake.liquid +1 -0
  20. data/data/messages/templates/specs/with_field.email.liquid +2 -0
  21. data/data/messages/templates/specs/with_field.fake.liquid +1 -0
  22. data/data/messages/templates/specs/with_include.email.liquid +2 -0
  23. data/data/messages/templates/specs/with_partial.email.liquid +1 -0
  24. data/data/messages/templates/verification.email.liquid +14 -0
  25. data/data/messages/templates/verification.sms.liquid +1 -0
  26. data/data/messages/web/install-customer-login.liquid +48 -0
  27. data/data/messages/web/install-error.liquid +17 -0
  28. data/data/messages/web/install-success.liquid +35 -0
  29. data/data/messages/web/install.liquid +20 -0
  30. data/data/messages/web/partials/footer.liquid +4 -0
  31. data/data/messages/web/partials/form_error.liquid +1 -0
  32. data/data/messages/web/partials/header.liquid +3 -0
  33. data/data/messages/web/styles.liquid +134 -0
  34. data/data/windows_tz.txt +461 -0
  35. data/db/migrations/001_testing_pixies.rb +13 -0
  36. data/db/migrations/002_initial.rb +132 -0
  37. data/db/migrations/003_ux_overhaul.rb +20 -0
  38. data/db/migrations/004_incremental_backfill.rb +9 -0
  39. data/db/migrations/005_log_webhooks.rb +24 -0
  40. data/db/migrations/006_generalize_roles.rb +29 -0
  41. data/db/migrations/007_org_dns.rb +12 -0
  42. data/db/migrations/008_webhook_subscriptions.rb +19 -0
  43. data/db/migrations/009_nonunique_stripe_subscription_customer.rb +16 -0
  44. data/db/migrations/010_drop_integration_soft_delete.rb +14 -0
  45. data/db/migrations/011_webhook_subscriptions_created_at.rb +10 -0
  46. data/db/migrations/012_webhook_subscriptions_created_by.rb +9 -0
  47. data/db/migrations/013_default_org_membership.rb +30 -0
  48. data/db/migrations/014_webhook_subscription_deliveries.rb +26 -0
  49. data/db/migrations/015_dependent_integrations.rb +9 -0
  50. data/db/migrations/016_encrypted_columns.rb +9 -0
  51. data/db/migrations/017_skip_verification.rb +9 -0
  52. data/db/migrations/018_sync_targets.rb +25 -0
  53. data/db/migrations/019_org_schema.rb +9 -0
  54. data/db/migrations/020_org_database_migrations.rb +25 -0
  55. data/db/migrations/021_no_default_org_schema.rb +14 -0
  56. data/db/migrations/022_database_document.rb +15 -0
  57. data/db/migrations/023_sync_target_schema.rb +9 -0
  58. data/db/migrations/024_org_semaphore_jobs.rb +9 -0
  59. data/db/migrations/025_integration_backfill_cursor.rb +9 -0
  60. data/db/migrations/026_undo_integration_backfill_cursor.rb +9 -0
  61. data/db/migrations/027_sync_target_http_sync.rb +12 -0
  62. data/db/migrations/028_logged_webhook_path.rb +24 -0
  63. data/db/migrations/029_encrypt_columns.rb +97 -0
  64. data/db/migrations/030_org_sync_target_timeout.rb +9 -0
  65. data/db/migrations/031_org_max_query_rows.rb +9 -0
  66. data/db/migrations/032_remove_db_defaults.rb +12 -0
  67. data/db/migrations/033_backfill_jobs.rb +26 -0
  68. data/db/migrations/034_backfill_job_criteria.rb +9 -0
  69. data/db/migrations/035_synchronous_backfill.rb +9 -0
  70. data/db/migrations/036_oauth.rb +26 -0
  71. data/db/migrations/037_oauth_used.rb +9 -0
  72. data/lib/amigo/durable_job.rb +416 -0
  73. data/lib/pry/clipboard.rb +111 -0
  74. data/lib/sequel/advisory_lock.rb +65 -0
  75. data/lib/webhookdb/admin.rb +4 -0
  76. data/lib/webhookdb/admin_api/auth.rb +36 -0
  77. data/lib/webhookdb/admin_api/customers.rb +63 -0
  78. data/lib/webhookdb/admin_api/database_documents.rb +20 -0
  79. data/lib/webhookdb/admin_api/entities.rb +66 -0
  80. data/lib/webhookdb/admin_api/message_deliveries.rb +61 -0
  81. data/lib/webhookdb/admin_api/roles.rb +15 -0
  82. data/lib/webhookdb/admin_api.rb +34 -0
  83. data/lib/webhookdb/aggregate_result.rb +63 -0
  84. data/lib/webhookdb/api/auth.rb +122 -0
  85. data/lib/webhookdb/api/connstr_auth.rb +36 -0
  86. data/lib/webhookdb/api/db.rb +188 -0
  87. data/lib/webhookdb/api/demo.rb +14 -0
  88. data/lib/webhookdb/api/entities.rb +198 -0
  89. data/lib/webhookdb/api/helpers.rb +253 -0
  90. data/lib/webhookdb/api/install.rb +296 -0
  91. data/lib/webhookdb/api/me.rb +53 -0
  92. data/lib/webhookdb/api/organizations.rb +254 -0
  93. data/lib/webhookdb/api/replay.rb +64 -0
  94. data/lib/webhookdb/api/service_integrations.rb +402 -0
  95. data/lib/webhookdb/api/services.rb +27 -0
  96. data/lib/webhookdb/api/stripe.rb +22 -0
  97. data/lib/webhookdb/api/subscriptions.rb +67 -0
  98. data/lib/webhookdb/api/sync_targets.rb +232 -0
  99. data/lib/webhookdb/api/system.rb +37 -0
  100. data/lib/webhookdb/api/webhook_subscriptions.rb +96 -0
  101. data/lib/webhookdb/api.rb +92 -0
  102. data/lib/webhookdb/apps.rb +93 -0
  103. data/lib/webhookdb/async/audit_logger.rb +38 -0
  104. data/lib/webhookdb/async/autoscaler.rb +84 -0
  105. data/lib/webhookdb/async/job.rb +18 -0
  106. data/lib/webhookdb/async/job_logger.rb +45 -0
  107. data/lib/webhookdb/async/scheduled_job.rb +18 -0
  108. data/lib/webhookdb/async.rb +142 -0
  109. data/lib/webhookdb/aws.rb +98 -0
  110. data/lib/webhookdb/backfill_job.rb +107 -0
  111. data/lib/webhookdb/backfiller.rb +107 -0
  112. data/lib/webhookdb/cloudflare.rb +39 -0
  113. data/lib/webhookdb/connection_cache.rb +177 -0
  114. data/lib/webhookdb/console.rb +71 -0
  115. data/lib/webhookdb/convertkit.rb +14 -0
  116. data/lib/webhookdb/crypto.rb +66 -0
  117. data/lib/webhookdb/customer/reset_code.rb +94 -0
  118. data/lib/webhookdb/customer.rb +347 -0
  119. data/lib/webhookdb/database_document.rb +72 -0
  120. data/lib/webhookdb/db_adapter/column_types.rb +37 -0
  121. data/lib/webhookdb/db_adapter/default_sql.rb +187 -0
  122. data/lib/webhookdb/db_adapter/pg.rb +96 -0
  123. data/lib/webhookdb/db_adapter/snowflake.rb +137 -0
  124. data/lib/webhookdb/db_adapter.rb +208 -0
  125. data/lib/webhookdb/dbutil.rb +92 -0
  126. data/lib/webhookdb/demo_mode.rb +100 -0
  127. data/lib/webhookdb/developer_alert.rb +51 -0
  128. data/lib/webhookdb/email_octopus.rb +21 -0
  129. data/lib/webhookdb/enumerable.rb +18 -0
  130. data/lib/webhookdb/fixtures/backfill_jobs.rb +72 -0
  131. data/lib/webhookdb/fixtures/customers.rb +65 -0
  132. data/lib/webhookdb/fixtures/database_documents.rb +27 -0
  133. data/lib/webhookdb/fixtures/faker.rb +41 -0
  134. data/lib/webhookdb/fixtures/logged_webhooks.rb +56 -0
  135. data/lib/webhookdb/fixtures/message_deliveries.rb +59 -0
  136. data/lib/webhookdb/fixtures/oauth_sessions.rb +24 -0
  137. data/lib/webhookdb/fixtures/organization_database_migrations.rb +37 -0
  138. data/lib/webhookdb/fixtures/organization_memberships.rb +54 -0
  139. data/lib/webhookdb/fixtures/organizations.rb +32 -0
  140. data/lib/webhookdb/fixtures/reset_codes.rb +23 -0
  141. data/lib/webhookdb/fixtures/service_integrations.rb +42 -0
  142. data/lib/webhookdb/fixtures/subscriptions.rb +33 -0
  143. data/lib/webhookdb/fixtures/sync_targets.rb +32 -0
  144. data/lib/webhookdb/fixtures/webhook_subscriptions.rb +35 -0
  145. data/lib/webhookdb/fixtures.rb +15 -0
  146. data/lib/webhookdb/formatting.rb +56 -0
  147. data/lib/webhookdb/front.rb +49 -0
  148. data/lib/webhookdb/github.rb +22 -0
  149. data/lib/webhookdb/google_calendar.rb +29 -0
  150. data/lib/webhookdb/heroku.rb +21 -0
  151. data/lib/webhookdb/http.rb +114 -0
  152. data/lib/webhookdb/icalendar.rb +17 -0
  153. data/lib/webhookdb/id.rb +17 -0
  154. data/lib/webhookdb/idempotency.rb +90 -0
  155. data/lib/webhookdb/increase.rb +42 -0
  156. data/lib/webhookdb/intercom.rb +23 -0
  157. data/lib/webhookdb/jobs/amigo_test_jobs.rb +118 -0
  158. data/lib/webhookdb/jobs/backfill.rb +32 -0
  159. data/lib/webhookdb/jobs/create_mirror_table.rb +18 -0
  160. data/lib/webhookdb/jobs/create_stripe_customer.rb +17 -0
  161. data/lib/webhookdb/jobs/customer_created_notify_internal.rb +22 -0
  162. data/lib/webhookdb/jobs/demo_mode_sync_data.rb +19 -0
  163. data/lib/webhookdb/jobs/deprecated_jobs.rb +19 -0
  164. data/lib/webhookdb/jobs/developer_alert_handle.rb +14 -0
  165. data/lib/webhookdb/jobs/durable_job_recheck_poller.rb +17 -0
  166. data/lib/webhookdb/jobs/emailer.rb +15 -0
  167. data/lib/webhookdb/jobs/icalendar_enqueue_syncs.rb +25 -0
  168. data/lib/webhookdb/jobs/icalendar_sync.rb +23 -0
  169. data/lib/webhookdb/jobs/logged_webhook_replay.rb +17 -0
  170. data/lib/webhookdb/jobs/logged_webhook_resilient_replay.rb +15 -0
  171. data/lib/webhookdb/jobs/message_dispatched.rb +16 -0
  172. data/lib/webhookdb/jobs/organization_database_migration_notify_finished.rb +21 -0
  173. data/lib/webhookdb/jobs/organization_database_migration_notify_started.rb +21 -0
  174. data/lib/webhookdb/jobs/organization_database_migration_run.rb +24 -0
  175. data/lib/webhookdb/jobs/prepare_database_connections.rb +22 -0
  176. data/lib/webhookdb/jobs/process_webhook.rb +47 -0
  177. data/lib/webhookdb/jobs/renew_watch_channel.rb +24 -0
  178. data/lib/webhookdb/jobs/replication_migration.rb +24 -0
  179. data/lib/webhookdb/jobs/reset_code_create_dispatch.rb +23 -0
  180. data/lib/webhookdb/jobs/scheduled_backfills.rb +77 -0
  181. data/lib/webhookdb/jobs/send_invite.rb +15 -0
  182. data/lib/webhookdb/jobs/send_test_webhook.rb +25 -0
  183. data/lib/webhookdb/jobs/send_webhook.rb +20 -0
  184. data/lib/webhookdb/jobs/sync_target_enqueue_scheduled.rb +16 -0
  185. data/lib/webhookdb/jobs/sync_target_run_sync.rb +38 -0
  186. data/lib/webhookdb/jobs/trim_logged_webhooks.rb +15 -0
  187. data/lib/webhookdb/jobs/webhook_resource_notify_integrations.rb +30 -0
  188. data/lib/webhookdb/jobs/webhook_subscription_delivery_attempt.rb +29 -0
  189. data/lib/webhookdb/jobs.rb +4 -0
  190. data/lib/webhookdb/json.rb +113 -0
  191. data/lib/webhookdb/liquid/expose.rb +27 -0
  192. data/lib/webhookdb/liquid/filters.rb +16 -0
  193. data/lib/webhookdb/liquid/liquification.rb +26 -0
  194. data/lib/webhookdb/liquid/partial.rb +12 -0
  195. data/lib/webhookdb/logged_webhook/resilient.rb +95 -0
  196. data/lib/webhookdb/logged_webhook.rb +194 -0
  197. data/lib/webhookdb/message/body.rb +25 -0
  198. data/lib/webhookdb/message/delivery.rb +127 -0
  199. data/lib/webhookdb/message/email_transport.rb +133 -0
  200. data/lib/webhookdb/message/fake_transport.rb +54 -0
  201. data/lib/webhookdb/message/liquid_drops.rb +29 -0
  202. data/lib/webhookdb/message/template.rb +89 -0
  203. data/lib/webhookdb/message/transport.rb +43 -0
  204. data/lib/webhookdb/message.rb +150 -0
  205. data/lib/webhookdb/messages/error_icalendar_fetch.rb +42 -0
  206. data/lib/webhookdb/messages/invite.rb +23 -0
  207. data/lib/webhookdb/messages/new_customer.rb +14 -0
  208. data/lib/webhookdb/messages/org_database_migration_finished.rb +23 -0
  209. data/lib/webhookdb/messages/org_database_migration_started.rb +24 -0
  210. data/lib/webhookdb/messages/specs.rb +57 -0
  211. data/lib/webhookdb/messages/verification.rb +23 -0
  212. data/lib/webhookdb/method_utilities.rb +82 -0
  213. data/lib/webhookdb/microsoft_calendar.rb +36 -0
  214. data/lib/webhookdb/nextpax.rb +14 -0
  215. data/lib/webhookdb/oauth/front.rb +58 -0
  216. data/lib/webhookdb/oauth/intercom.rb +58 -0
  217. data/lib/webhookdb/oauth/session.rb +24 -0
  218. data/lib/webhookdb/oauth.rb +80 -0
  219. data/lib/webhookdb/organization/alerting.rb +35 -0
  220. data/lib/webhookdb/organization/database_migration.rb +151 -0
  221. data/lib/webhookdb/organization/db_builder.rb +429 -0
  222. data/lib/webhookdb/organization.rb +506 -0
  223. data/lib/webhookdb/organization_membership.rb +58 -0
  224. data/lib/webhookdb/phone_number.rb +38 -0
  225. data/lib/webhookdb/plaid.rb +23 -0
  226. data/lib/webhookdb/platform.rb +27 -0
  227. data/lib/webhookdb/plivo.rb +52 -0
  228. data/lib/webhookdb/postgres/maintenance.rb +166 -0
  229. data/lib/webhookdb/postgres/model.rb +82 -0
  230. data/lib/webhookdb/postgres/model_utilities.rb +382 -0
  231. data/lib/webhookdb/postgres/testing_pixie.rb +16 -0
  232. data/lib/webhookdb/postgres/validations.rb +46 -0
  233. data/lib/webhookdb/postgres.rb +176 -0
  234. data/lib/webhookdb/postmark.rb +20 -0
  235. data/lib/webhookdb/redis.rb +35 -0
  236. data/lib/webhookdb/replicator/atom_single_feed_v1.rb +116 -0
  237. data/lib/webhookdb/replicator/aws_pricing_v1.rb +488 -0
  238. data/lib/webhookdb/replicator/base.rb +1185 -0
  239. data/lib/webhookdb/replicator/column.rb +482 -0
  240. data/lib/webhookdb/replicator/convertkit_broadcast_v1.rb +69 -0
  241. data/lib/webhookdb/replicator/convertkit_subscriber_v1.rb +200 -0
  242. data/lib/webhookdb/replicator/convertkit_tag_v1.rb +66 -0
  243. data/lib/webhookdb/replicator/convertkit_v1_mixin.rb +65 -0
  244. data/lib/webhookdb/replicator/docgen.rb +167 -0
  245. data/lib/webhookdb/replicator/email_octopus_campaign_v1.rb +84 -0
  246. data/lib/webhookdb/replicator/email_octopus_contact_v1.rb +159 -0
  247. data/lib/webhookdb/replicator/email_octopus_event_v1.rb +244 -0
  248. data/lib/webhookdb/replicator/email_octopus_list_v1.rb +101 -0
  249. data/lib/webhookdb/replicator/fake.rb +453 -0
  250. data/lib/webhookdb/replicator/front_conversation_v1.rb +45 -0
  251. data/lib/webhookdb/replicator/front_marketplace_root_v1.rb +55 -0
  252. data/lib/webhookdb/replicator/front_message_v1.rb +45 -0
  253. data/lib/webhookdb/replicator/front_v1_mixin.rb +22 -0
  254. data/lib/webhookdb/replicator/github_issue_comment_v1.rb +58 -0
  255. data/lib/webhookdb/replicator/github_issue_v1.rb +83 -0
  256. data/lib/webhookdb/replicator/github_pull_v1.rb +84 -0
  257. data/lib/webhookdb/replicator/github_release_v1.rb +47 -0
  258. data/lib/webhookdb/replicator/github_repo_v1_mixin.rb +250 -0
  259. data/lib/webhookdb/replicator/github_repository_event_v1.rb +45 -0
  260. data/lib/webhookdb/replicator/icalendar_calendar_v1.rb +465 -0
  261. data/lib/webhookdb/replicator/icalendar_event_v1.rb +334 -0
  262. data/lib/webhookdb/replicator/increase_account_number_v1.rb +77 -0
  263. data/lib/webhookdb/replicator/increase_account_transfer_v1.rb +61 -0
  264. data/lib/webhookdb/replicator/increase_account_v1.rb +63 -0
  265. data/lib/webhookdb/replicator/increase_ach_transfer_v1.rb +78 -0
  266. data/lib/webhookdb/replicator/increase_check_transfer_v1.rb +64 -0
  267. data/lib/webhookdb/replicator/increase_limit_v1.rb +78 -0
  268. data/lib/webhookdb/replicator/increase_transaction_v1.rb +74 -0
  269. data/lib/webhookdb/replicator/increase_v1_mixin.rb +121 -0
  270. data/lib/webhookdb/replicator/increase_wire_transfer_v1.rb +61 -0
  271. data/lib/webhookdb/replicator/intercom_contact_v1.rb +36 -0
  272. data/lib/webhookdb/replicator/intercom_conversation_v1.rb +38 -0
  273. data/lib/webhookdb/replicator/intercom_marketplace_root_v1.rb +69 -0
  274. data/lib/webhookdb/replicator/intercom_v1_mixin.rb +105 -0
  275. data/lib/webhookdb/replicator/oauth_refresh_access_token_mixin.rb +65 -0
  276. data/lib/webhookdb/replicator/plivo_sms_inbound_v1.rb +102 -0
  277. data/lib/webhookdb/replicator/postmark_inbound_message_v1.rb +94 -0
  278. data/lib/webhookdb/replicator/postmark_outbound_message_event_v1.rb +107 -0
  279. data/lib/webhookdb/replicator/schema_modification.rb +42 -0
  280. data/lib/webhookdb/replicator/shopify_customer_v1.rb +58 -0
  281. data/lib/webhookdb/replicator/shopify_order_v1.rb +64 -0
  282. data/lib/webhookdb/replicator/shopify_v1_mixin.rb +161 -0
  283. data/lib/webhookdb/replicator/signalwire_message_v1.rb +169 -0
  284. data/lib/webhookdb/replicator/sponsy_customer_v1.rb +54 -0
  285. data/lib/webhookdb/replicator/sponsy_placement_v1.rb +34 -0
  286. data/lib/webhookdb/replicator/sponsy_publication_v1.rb +125 -0
  287. data/lib/webhookdb/replicator/sponsy_slot_v1.rb +41 -0
  288. data/lib/webhookdb/replicator/sponsy_status_v1.rb +35 -0
  289. data/lib/webhookdb/replicator/sponsy_v1_mixin.rb +165 -0
  290. data/lib/webhookdb/replicator/state_machine_step.rb +69 -0
  291. data/lib/webhookdb/replicator/stripe_charge_v1.rb +77 -0
  292. data/lib/webhookdb/replicator/stripe_coupon_v1.rb +62 -0
  293. data/lib/webhookdb/replicator/stripe_customer_v1.rb +60 -0
  294. data/lib/webhookdb/replicator/stripe_dispute_v1.rb +77 -0
  295. data/lib/webhookdb/replicator/stripe_invoice_item_v1.rb +82 -0
  296. data/lib/webhookdb/replicator/stripe_invoice_v1.rb +116 -0
  297. data/lib/webhookdb/replicator/stripe_payout_v1.rb +67 -0
  298. data/lib/webhookdb/replicator/stripe_price_v1.rb +60 -0
  299. data/lib/webhookdb/replicator/stripe_product_v1.rb +60 -0
  300. data/lib/webhookdb/replicator/stripe_refund_v1.rb +101 -0
  301. data/lib/webhookdb/replicator/stripe_subscription_item_v1.rb +56 -0
  302. data/lib/webhookdb/replicator/stripe_subscription_v1.rb +75 -0
  303. data/lib/webhookdb/replicator/stripe_v1_mixin.rb +116 -0
  304. data/lib/webhookdb/replicator/transistor_episode_stats_v1.rb +141 -0
  305. data/lib/webhookdb/replicator/transistor_episode_v1.rb +169 -0
  306. data/lib/webhookdb/replicator/transistor_show_v1.rb +68 -0
  307. data/lib/webhookdb/replicator/transistor_v1_mixin.rb +65 -0
  308. data/lib/webhookdb/replicator/twilio_sms_v1.rb +156 -0
  309. data/lib/webhookdb/replicator/webhook_request.rb +5 -0
  310. data/lib/webhookdb/replicator/webhookdb_customer_v1.rb +74 -0
  311. data/lib/webhookdb/replicator.rb +224 -0
  312. data/lib/webhookdb/role.rb +42 -0
  313. data/lib/webhookdb/sentry.rb +35 -0
  314. data/lib/webhookdb/service/auth.rb +138 -0
  315. data/lib/webhookdb/service/collection.rb +91 -0
  316. data/lib/webhookdb/service/entities.rb +97 -0
  317. data/lib/webhookdb/service/helpers.rb +270 -0
  318. data/lib/webhookdb/service/middleware.rb +124 -0
  319. data/lib/webhookdb/service/types.rb +30 -0
  320. data/lib/webhookdb/service/validators.rb +32 -0
  321. data/lib/webhookdb/service/view_api.rb +63 -0
  322. data/lib/webhookdb/service.rb +219 -0
  323. data/lib/webhookdb/service_integration.rb +332 -0
  324. data/lib/webhookdb/shopify.rb +35 -0
  325. data/lib/webhookdb/signalwire.rb +13 -0
  326. data/lib/webhookdb/slack.rb +68 -0
  327. data/lib/webhookdb/snowflake.rb +90 -0
  328. data/lib/webhookdb/spec_helpers/async.rb +122 -0
  329. data/lib/webhookdb/spec_helpers/citest.rb +88 -0
  330. data/lib/webhookdb/spec_helpers/integration.rb +121 -0
  331. data/lib/webhookdb/spec_helpers/message.rb +41 -0
  332. data/lib/webhookdb/spec_helpers/postgres.rb +220 -0
  333. data/lib/webhookdb/spec_helpers/service.rb +432 -0
  334. data/lib/webhookdb/spec_helpers/shared_examples_for_columns.rb +56 -0
  335. data/lib/webhookdb/spec_helpers/shared_examples_for_replicators.rb +915 -0
  336. data/lib/webhookdb/spec_helpers/whdb.rb +139 -0
  337. data/lib/webhookdb/spec_helpers.rb +63 -0
  338. data/lib/webhookdb/sponsy.rb +14 -0
  339. data/lib/webhookdb/stripe.rb +37 -0
  340. data/lib/webhookdb/subscription.rb +203 -0
  341. data/lib/webhookdb/sync_target.rb +491 -0
  342. data/lib/webhookdb/tasks/admin.rb +49 -0
  343. data/lib/webhookdb/tasks/annotate.rb +36 -0
  344. data/lib/webhookdb/tasks/db.rb +82 -0
  345. data/lib/webhookdb/tasks/docs.rb +42 -0
  346. data/lib/webhookdb/tasks/fixture.rb +35 -0
  347. data/lib/webhookdb/tasks/message.rb +50 -0
  348. data/lib/webhookdb/tasks/regress.rb +87 -0
  349. data/lib/webhookdb/tasks/release.rb +27 -0
  350. data/lib/webhookdb/tasks/sidekiq.rb +23 -0
  351. data/lib/webhookdb/tasks/specs.rb +64 -0
  352. data/lib/webhookdb/theranest.rb +15 -0
  353. data/lib/webhookdb/transistor.rb +13 -0
  354. data/lib/webhookdb/twilio.rb +13 -0
  355. data/lib/webhookdb/typed_struct.rb +44 -0
  356. data/lib/webhookdb/version.rb +5 -0
  357. data/lib/webhookdb/webhook_response.rb +50 -0
  358. data/lib/webhookdb/webhook_subscription/delivery.rb +82 -0
  359. data/lib/webhookdb/webhook_subscription.rb +226 -0
  360. data/lib/webhookdb/windows_tz.rb +32 -0
  361. data/lib/webhookdb/xml.rb +92 -0
  362. data/lib/webhookdb.rb +224 -0
  363. data/lib/webterm/apps.rb +45 -0
  364. metadata +1129 -0
@@ -0,0 +1,461 @@
1
+ # Taken from
2
+ # https://secure.jadeworld.com/JADETech/JADE2020/OnlineDocumentation/content/resources/encyclosys2/jadetimezone_class/ianawindowstimezonemapping.htm
3
+ Etc/GMT+12 Dateline Standard Time
4
+ Etc/GMT+11 UTC-11
5
+ Pacific/Pago_Pago UTC-11
6
+ Pacific/Niue UTC-11
7
+ Pacific/Midway UTC-11
8
+ America/Adak Aleutian Standard Time
9
+ Pacific/Honolulu Hawaiian Standard Time
10
+ Pacific/Rarotonga Hawaiian Standard Time
11
+ Pacific/Tahiti Hawaiian Standard Time
12
+ Pacific/Johnston Hawaiian Standard Time
13
+ Etc/GMT+10 Hawaiian Standard Time
14
+ Pacific/Marquesas Marquesas Standard Time
15
+ America/Anchorage Alaskan Standard Time
16
+ America/Juneau Alaskan Standard Time
17
+ America/Metlakatla Alaskan Standard Time
18
+ America/Nome Alaskan Standard Time
19
+ America/Sitka Alaskan Standard Time
20
+ America/Yakutat Alaskan Standard Time
21
+ Etc/GMT+9 UTC-09
22
+ Pacific/Gambier UTC-09
23
+ America/Tijuana Pacific Standard Time (Mexico)
24
+ America/Santa_Isabel Pacific Standard Time (Mexico)
25
+ Etc/GMT+8 UTC-08
26
+ Pacific/Pitcairn UTC-08
27
+ America/Los_Angeles Pacific Standard Time
28
+ America/Vancouver Pacific Standard Time
29
+ America/Dawson Pacific Standard Time
30
+ America/Whitehorse Pacific Standard Time
31
+ PST8PDT Pacific Standard Time
32
+ America/Phoenix US Mountain Standard Time
33
+ America/Dawson_Creek US Mountain Standard Time
34
+ America/Creston US Mountain Standard Time
35
+ America/Fort_Nelson US Mountain Standard Time
36
+ America/Hermosillo US Mountain Standard Time
37
+ Etc/GMT+7 US Mountain Standard Time
38
+ America/Chihuahua Mountain Standard Time (Mexico)
39
+ America/Mazatlan Mountain Standard Time (Mexico)
40
+ America/Denver Mountain Standard Time
41
+ America/Edmonton Mountain Standard Time
42
+ America/Cambridge_Bay Mountain Standard Time
43
+ America/Inuvik Mountain Standard Time
44
+ America/Yellowknife Mountain Standard Time
45
+ America/Ojinaga Mountain Standard Time
46
+ America/Boise Mountain Standard Time
47
+ MST7MDT Mountain Standard Time
48
+ America/Guatemala Central America Standard Time
49
+ America/Belize Central America Standard Time
50
+ America/Costa_Rica Central America Standard Time
51
+ Pacific/Galapagos Central America Standard Time
52
+ America/Tegucigalpa Central America Standard Time
53
+ America/Managua Central America Standard Time
54
+ America/El_Salvador Central America Standard Time
55
+ Etc/GMT+6 Central America Standard Time
56
+ America/Chicago Central Standard Time
57
+ America/Winnipeg Central Standard Time
58
+ America/Rainy_River Central Standard Time
59
+ America/Rankin_Inlet Central Standard Time
60
+ America/Resolute Central Standard Time
61
+ America/Matamoros Central Standard Time
62
+ America/Indiana/Knox Central Standard Time
63
+ America/Indiana/Tell_City Central Standard Time
64
+ America/Menominee Central Standard Time
65
+ America/North_Dakota/Beulah Central Standard Time
66
+ America/North_Dakota/Center Central Standard Time
67
+ America/North_Dakota/New_Salem Central Standard Time
68
+ CST6CDT Central Standard Time
69
+ Pacific/Easter Easter Island Standard Time
70
+ America/Mexico_City Central Standard Time (Mexico)
71
+ America/Bahia_Banderas Central Standard Time (Mexico)
72
+ America/Merida Central Standard Time (Mexico)
73
+ America/Monterrey Central Standard Time (Mexico)
74
+ America/Regina Canada Central Standard Time
75
+ America/Swift_Current Canada Central Standard Time
76
+ America/Bogota SA Pacific Standard Time
77
+ America/Rio_Branco SA Pacific Standard Time
78
+ America/Eirunepe SA Pacific Standard Time
79
+ America/Coral_Harbour SA Pacific Standard Time
80
+ America/Guayaquil SA Pacific Standard Time
81
+ America/Jamaica SA Pacific Standard Time
82
+ America/Cayman SA Pacific Standard Time
83
+ America/Panama SA Pacific Standard Time
84
+ America/Lima SA Pacific Standard Time
85
+ Etc/GMT+5 SA Pacific Standard Time
86
+ America/Cancun Eastern Standard Time (Mexico)
87
+ America/New_York Eastern Standard Time
88
+ America/Nassau Eastern Standard Time
89
+ America/Toronto Eastern Standard Time
90
+ America/Iqaluit Eastern Standard Time
91
+ America/Montreal Eastern Standard Time
92
+ America/Nipigon Eastern Standard Time
93
+ America/Pangnirtung Eastern Standard Time
94
+ America/Thunder_Bay Eastern Standard Time
95
+ America/Detroit Eastern Standard Time
96
+ America/Indiana/Petersburg Eastern Standard Time
97
+ America/Indiana/Vincennes Eastern Standard Time
98
+ America/Indiana/Winamac Eastern Standard Time
99
+ America/Kentucky/Monticello Eastern Standard Time
100
+ America/Louisville Eastern Standard Time
101
+ EST5EDT Eastern Standard Time
102
+ America/Port-au-Prince Haiti Standard Time
103
+ America/Havana Cuba Standard Time
104
+ America/Indianapolis US Eastern Standard Time
105
+ America/Indiana/Marengo US Eastern Standard Time
106
+ America/Indiana/Vevay US Eastern Standard Time
107
+ America/Grand_Turk Turks And Caicos Standard Time
108
+ America/Asuncion Paraguay Standard Time
109
+ America/Halifax Atlantic Standard Time
110
+ Atlantic/Bermuda Atlantic Standard Time
111
+ America/Glace_Bay Atlantic Standard Time
112
+ America/Goose_Bay Atlantic Standard Time
113
+ America/Moncton Atlantic Standard Time
114
+ America/Thule Atlantic Standard Time
115
+ America/Caracas Venezuela Standard Time
116
+ America/Cuiaba Central Brazilian Standard Time
117
+ America/Campo_Grande Central Brazilian Standard Time
118
+ America/La_Paz SA Western Standard Time
119
+ America/Antigua SA Western Standard Time
120
+ America/Anguilla SA Western Standard Time
121
+ America/Aruba SA Western Standard Time
122
+ America/Barbados SA Western Standard Time
123
+ America/St_Barthelemy SA Western Standard Time
124
+ America/Kralendijk SA Western Standard Time
125
+ America/Manaus SA Western Standard Time
126
+ America/Boa_Vista SA Western Standard Time
127
+ America/Porto_Velho SA Western Standard Time
128
+ America/Blanc-Sablon SA Western Standard Time
129
+ America/Curacao SA Western Standard Time
130
+ America/Dominica SA Western Standard Time
131
+ America/Santo_Domingo SA Western Standard Time
132
+ America/Grenada SA Western Standard Time
133
+ America/Guadeloupe SA Western Standard Time
134
+ America/Guyana SA Western Standard Time
135
+ America/St_Kitts SA Western Standard Time
136
+ America/St_Lucia SA Western Standard Time
137
+ America/Marigot SA Western Standard Time
138
+ America/Martinique SA Western Standard Time
139
+ America/Montserrat SA Western Standard Time
140
+ America/Puerto_Rico SA Western Standard Time
141
+ America/Lower_Princes SA Western Standard Time
142
+ America/Port_of_Spain SA Western Standard Time
143
+ America/St_Vincent SA Western Standard Time
144
+ America/Tortola SA Western Standard Time
145
+ America/St_Thomas SA Western Standard Time
146
+ Etc/GMT+4 SA Western Standard Time
147
+ America/Santiago Pacific SA Standard Time
148
+ America/St_Johns Newfoundland Standard Time
149
+ America/Araguaina Tocantins Standard Time
150
+ America/Sao_Paulo E. South America Standard Time
151
+ America/Cayenne SA Eastern Standard Time
152
+ Antarctica/Rothera SA Eastern Standard Time
153
+ Antarctica/Palmer SA Eastern Standard Time
154
+ America/Fortaleza SA Eastern Standard Time
155
+ America/Belem SA Eastern Standard Time
156
+ America/Maceio SA Eastern Standard Time
157
+ America/Recife SA Eastern Standard Time
158
+ America/Santarem SA Eastern Standard Time
159
+ Atlantic/Stanley SA Eastern Standard Time
160
+ America/Paramaribo SA Eastern Standard Time
161
+ Etc/GMT+3 SA Eastern Standard Time
162
+ America/Buenos_Aires Argentina Standard Time
163
+ America/Argentina/La_Rioja Argentina Standard Time
164
+ America/Argentina/Rio_Gallegos Argentina Standard Time
165
+ America/Argentina/Salta Argentina Standard Time
166
+ America/Argentina/San_Juan Argentina Standard Time
167
+ America/Argentina/San_Luis Argentina Standard Time
168
+ America/Argentina/Tucuman Argentina Standard Time
169
+ America/Argentina/Ushuaia Argentina Standard Time
170
+ America/Catamarca Argentina Standard Time
171
+ America/Cordoba Argentina Standard Time
172
+ America/Jujuy Argentina Standard Time
173
+ America/Mendoza Argentina Standard Time
174
+ America/Godthab Greenland Standard Time
175
+ America/Montevideo Montevideo Standard Time
176
+ America/Punta_Arenas Magallanes Standard Time
177
+ America/Miquelon Saint Pierre Standard Time
178
+ America/Bahia Bahia Standard Time
179
+ Etc/GMT+2 UTC-02
180
+ America/Noronha UTC-02
181
+ Atlantic/South_Georgia UTC-02
182
+ Atlantic/Azores Azores Standard Time
183
+ America/Scoresbysund Azores Standard Time
184
+ Atlantic/Cape_Verde Cape Verde Standard Time
185
+ Etc/GMT+1 Cape Verde Standard Time
186
+ Etc/GMT UTC
187
+ America/Danmarkshavn UTC
188
+ Etc/UTC UTC
189
+ Europe/London GMT Standard Time
190
+ Atlantic/Canary GMT Standard Time
191
+ Atlantic/Faeroe GMT Standard Time
192
+ Europe/Guernsey GMT Standard Time
193
+ Europe/Dublin GMT Standard Time
194
+ Europe/Isle_of_Man GMT Standard Time
195
+ Europe/Jersey GMT Standard Time
196
+ Europe/Lisbon GMT Standard Time
197
+ Atlantic/Madeira GMT Standard Time
198
+ Atlantic/Reykjavik Greenwich Standard Time
199
+ Africa/Ouagadougou Greenwich Standard Time
200
+ Africa/Abidjan Greenwich Standard Time
201
+ Africa/Accra Greenwich Standard Time
202
+ Africa/Banjul Greenwich Standard Time
203
+ Africa/Conakry Greenwich Standard Time
204
+ Africa/Bissau Greenwich Standard Time
205
+ Africa/Monrovia Greenwich Standard Time
206
+ Africa/Bamako Greenwich Standard Time
207
+ Africa/Nouakchott Greenwich Standard Time
208
+ Atlantic/St_Helena Greenwich Standard Time
209
+ Africa/Freetown Greenwich Standard Time
210
+ Africa/Dakar Greenwich Standard Time
211
+ Africa/Lome Greenwich Standard Time
212
+ Africa/Sao_Tome Sao Tome Standard Time
213
+ Africa/Casablanca Morocco Standard Time
214
+ Africa/El_Aaiun Morocco Standard Time
215
+ Europe/Berlin W. Europe Standard Time
216
+ Europe/Andorra W. Europe Standard Time
217
+ Europe/Vienna W. Europe Standard Time
218
+ Europe/Zurich W. Europe Standard Time
219
+ Europe/Busingen W. Europe Standard Time
220
+ Europe/Gibraltar W. Europe Standard Time
221
+ Europe/Rome W. Europe Standard Time
222
+ Europe/Vaduz W. Europe Standard Time
223
+ Europe/Luxembourg W. Europe Standard Time
224
+ Europe/Monaco W. Europe Standard Time
225
+ Europe/Malta W. Europe Standard Time
226
+ Europe/Amsterdam W. Europe Standard Time
227
+ Europe/Oslo W. Europe Standard Time
228
+ Europe/Stockholm W. Europe Standard Time
229
+ Arctic/Longyearbyen W. Europe Standard Time
230
+ Europe/San_Marino W. Europe Standard Time
231
+ Europe/Vatican W. Europe Standard Time
232
+ Europe/Budapest Central Europe Standard Time
233
+ Europe/Tirane Central Europe Standard Time
234
+ Europe/Prague Central Europe Standard Time
235
+ Europe/Podgorica Central Europe Standard Time
236
+ Europe/Belgrade Central Europe Standard Time
237
+ Europe/Ljubljana Central Europe Standard Time
238
+ Europe/Bratislava Central Europe Standard Time
239
+ Europe/Paris Romance Standard Time
240
+ Europe/Brussels Romance Standard Time
241
+ Europe/Copenhagen Romance Standard Time
242
+ Europe/Madrid Romance Standard Time
243
+ Africa/Ceuta Romance Standard Time
244
+ Europe/Warsaw Central European Standard Time
245
+ Europe/Sarajevo Central European Standard Time
246
+ Europe/Zagreb Central European Standard Time
247
+ Europe/Skopje Central European Standard Time
248
+ Africa/Lagos W. Central Africa Standard Time
249
+ Africa/Luanda W. Central Africa Standard Time
250
+ Africa/Porto-Novo W. Central Africa Standard Time
251
+ Africa/Kinshasa W. Central Africa Standard Time
252
+ Africa/Bangui W. Central Africa Standard Time
253
+ Africa/Brazzaville W. Central Africa Standard Time
254
+ Africa/Douala W. Central Africa Standard Time
255
+ Africa/Algiers W. Central Africa Standard Time
256
+ Africa/Libreville W. Central Africa Standard Time
257
+ Africa/Malabo W. Central Africa Standard Time
258
+ Africa/Niamey W. Central Africa Standard Time
259
+ Africa/Ndjamena W. Central Africa Standard Time
260
+ Africa/Tunis W. Central Africa Standard Time
261
+ Etc/GMT-1 W. Central Africa Standard Time
262
+ Asia/Amman Jordan Standard Time
263
+ Europe/Bucharest GTB Standard Time
264
+ Asia/Nicosia GTB Standard Time
265
+ Asia/Famagusta GTB Standard Time
266
+ Europe/Athens GTB Standard Time
267
+ Asia/Beirut Middle East Standard Time
268
+ Africa/Cairo Egypt Standard Time
269
+ Europe/Chisinau E. Europe Standard Time
270
+ Asia/Damascus Syria Standard Time
271
+ Asia/Hebron West Bank Standard Time
272
+ Asia/Gaza West Bank Standard Time
273
+ Africa/Johannesburg South Africa Standard Time
274
+ Africa/Bujumbura South Africa Standard Time
275
+ Africa/Gaborone South Africa Standard Time
276
+ Africa/Lubumbashi South Africa Standard Time
277
+ Africa/Maseru South Africa Standard Time
278
+ Africa/Blantyre South Africa Standard Time
279
+ Africa/Maputo South Africa Standard Time
280
+ Africa/Kigali South Africa Standard Time
281
+ Africa/Mbabane South Africa Standard Time
282
+ Africa/Lusaka South Africa Standard Time
283
+ Africa/Harare South Africa Standard Time
284
+ Etc/GMT-2 South Africa Standard Time
285
+ Europe/Kiev FLE Standard Time
286
+ Europe/Mariehamn FLE Standard Time
287
+ Europe/Sofia FLE Standard Time
288
+ Europe/Tallinn FLE Standard Time
289
+ Europe/Helsinki FLE Standard Time
290
+ Europe/Vilnius FLE Standard Time
291
+ Europe/Riga FLE Standard Time
292
+ Europe/Uzhgorod FLE Standard Time
293
+ Europe/Zaporozhye FLE Standard Time
294
+ Asia/Jerusalem Israel Standard Time
295
+ Europe/Kaliningrad Kaliningrad Standard Time
296
+ Africa/Khartoum Sudan Standard Time
297
+ Africa/Tripoli Libya Standard Time
298
+ Africa/Windhoek Namibia Standard Time
299
+ Asia/Baghdad Arabic Standard Time
300
+ Europe/Istanbul Turkey Standard Time
301
+ Asia/Riyadh Arab Standard Time
302
+ Asia/Bahrain Arab Standard Time
303
+ Asia/Kuwait Arab Standard Time
304
+ Asia/Qatar Arab Standard Time
305
+ Asia/Aden Arab Standard Time
306
+ Europe/Minsk Belarus Standard Time
307
+ Europe/Moscow Russian Standard Time
308
+ Europe/Kirov Russian Standard Time
309
+ Europe/Simferopol Russian Standard Time
310
+ Africa/Nairobi E. Africa Standard Time
311
+ Antarctica/Syowa E. Africa Standard Time
312
+ Africa/Djibouti E. Africa Standard Time
313
+ Africa/Asmera E. Africa Standard Time
314
+ Africa/Addis_Ababa E. Africa Standard Time
315
+ Indian/Comoro E. Africa Standard Time
316
+ Indian/Antananarivo E. Africa Standard Time
317
+ Africa/Mogadishu E. Africa Standard Time
318
+ Africa/Juba E. Africa Standard Time
319
+ Africa/Dar_es_Salaam E. Africa Standard Time
320
+ Africa/Kampala E. Africa Standard Time
321
+ Indian/Mayotte E. Africa Standard Time
322
+ Etc/GMT-3 E. Africa Standard Time
323
+ Asia/Tehran Iran Standard Time
324
+ Asia/Dubai Arabian Standard Time
325
+ Asia/Muscat Arabian Standard Time
326
+ Etc/GMT-4 Arabian Standard Time
327
+ Europe/Astrakhan Astrakhan Standard Time
328
+ Europe/Ulyanovsk Astrakhan Standard Time
329
+ Asia/Baku Azerbaijan Standard Time
330
+ Europe/Samara Russia Time Zone 3
331
+ Indian/Mauritius Mauritius Standard Time
332
+ Indian/Reunion Mauritius Standard Time
333
+ Indian/Mahe Mauritius Standard Time
334
+ Europe/Saratov Saratov Standard Time
335
+ Asia/Tbilisi Georgian Standard Time
336
+ Europe/Volgograd Volgograd Standard Time
337
+ Asia/Yerevan Caucasus Standard Time
338
+ Asia/Kabul Afghanistan Standard Time
339
+ Asia/Tashkent West Asia Standard Time
340
+ Antarctica/Mawson West Asia Standard Time
341
+ Asia/Oral West Asia Standard Time
342
+ Asia/Aqtau West Asia Standard Time
343
+ Asia/Aqtobe West Asia Standard Time
344
+ Asia/Atyrau West Asia Standard Time
345
+ Indian/Maldives West Asia Standard Time
346
+ Indian/Kerguelen West Asia Standard Time
347
+ Asia/Dushanbe West Asia Standard Time
348
+ Asia/Ashgabat West Asia Standard Time
349
+ Asia/Samarkand West Asia Standard Time
350
+ Etc/GMT-5 West Asia Standard Time
351
+ Asia/Yekaterinburg Ekaterinburg Standard Time
352
+ Asia/Karachi Pakistan Standard Time
353
+ Asia/Qyzylorda Qyzylorda Standard Time
354
+ Asia/Calcutta India Standard Time
355
+ Asia/Colombo Sri Lanka Standard Time
356
+ Asia/Katmandu Nepal Standard Time
357
+ Asia/Almaty Central Asia Standard Time
358
+ Antarctica/Vostok Central Asia Standard Time
359
+ Asia/Urumqi Central Asia Standard Time
360
+ Indian/Chagos Central Asia Standard Time
361
+ Asia/Bishkek Central Asia Standard Time
362
+ Asia/Qostanay Central Asia Standard Time
363
+ Etc/GMT-6 Central Asia Standard Time
364
+ Asia/Dhaka Bangladesh Standard Time
365
+ Asia/Thimphu Bangladesh Standard Time
366
+ Asia/Omsk Omsk Standard Time
367
+ Asia/Rangoon Myanmar Standard Time
368
+ Indian/Cocos Myanmar Standard Time
369
+ Asia/Bangkok SE Asia Standard Time
370
+ Antarctica/Davis SE Asia Standard Time
371
+ Indian/Christmas SE Asia Standard Time
372
+ Asia/Jakarta SE Asia Standard Time
373
+ Asia/Pontianak SE Asia Standard Time
374
+ Asia/Phnom_Penh SE Asia Standard Time
375
+ Asia/Vientiane SE Asia Standard Time
376
+ Asia/Saigon SE Asia Standard Time
377
+ Etc/GMT-7 SE Asia Standard Time
378
+ Asia/Barnaul Altai Standard Time
379
+ Asia/Hovd W. Mongolia Standard Time
380
+ Asia/Krasnoyarsk North Asia Standard Time
381
+ Asia/Novokuznetsk North Asia Standard Time
382
+ Asia/Novosibirsk N. Central Asia Standard Time
383
+ Asia/Tomsk Tomsk Standard Time
384
+ Asia/Shanghai China Standard Time
385
+ Asia/Hong_Kong China Standard Time
386
+ Asia/Macau China Standard Time
387
+ Asia/Irkutsk North Asia East Standard Time
388
+ Asia/Singapore Singapore Standard Time
389
+ Antarctica/Casey Singapore Standard Time
390
+ Asia/Brunei Singapore Standard Time
391
+ Asia/Makassar Singapore Standard Time
392
+ Asia/Kuala_Lumpur Singapore Standard Time
393
+ Asia/Kuching Singapore Standard Time
394
+ Asia/Manila Singapore Standard Time
395
+ Etc/GMT-8 Singapore Standard Time
396
+ Australia/Perth W. Australia Standard Time
397
+ Asia/Taipei Taipei Standard Time
398
+ Asia/Ulaanbaatar Ulaanbaatar Standard Time
399
+ Asia/Choibalsan Ulaanbaatar Standard Time
400
+ Australia/Eucla Aus Central W. Standard Time
401
+ Asia/Chita Transbaikal Standard Time
402
+ Asia/Tokyo Tokyo Standard Time
403
+ Asia/Jayapura Tokyo Standard Time
404
+ Pacific/Palau Tokyo Standard Time
405
+ Asia/Dili Tokyo Standard Time
406
+ Etc/GMT-9 Tokyo Standard Time
407
+ Asia/Pyongyang North Korea Standard Time
408
+ Asia/Seoul Korea Standard Time
409
+ Asia/Yakutsk Yakutsk Standard Time
410
+ Asia/Khandyga Yakutsk Standard Time
411
+ Australia/Adelaide Cen. Australia Standard Time
412
+ Australia/Broken_Hill Cen. Australia Standard Time
413
+ Australia/Darwin AUS Central Standard Time
414
+ Australia/Brisbane E. Australia Standard Time
415
+ Australia/Lindeman E. Australia Standard Time
416
+ Australia/Sydney AUS Eastern Standard Time
417
+ Australia/Melbourne AUS Eastern Standard Time
418
+ Pacific/Port_Moresby West Pacific Standard Time
419
+ Antarctica/DumontDUrville West Pacific Standard Time
420
+ Pacific/Truk West Pacific Standard Time
421
+ Pacific/Guam West Pacific Standard Time
422
+ Pacific/Saipan West Pacific Standard Time
423
+ Etc/GMT-10 West Pacific Standard Time
424
+ Australia/Hobart Tasmania Standard Time
425
+ Australia/Currie Tasmania Standard Time
426
+ Asia/Vladivostok Vladivostok Standard Time
427
+ Asia/Ust-Nera Vladivostok Standard Time
428
+ Australia/Lord_Howe Lord Howe Standard Time
429
+ Pacific/Bougainville Bougainville Standard Time
430
+ Asia/Srednekolymsk Russia Time Zone 10
431
+ Asia/Magadan Magadan Standard Time
432
+ Pacific/Norfolk Norfolk Standard Time
433
+ Asia/Sakhalin Sakhalin Standard Time
434
+ Pacific/Guadalcanal Central Pacific Standard Time
435
+ Antarctica/Macquarie Central Pacific Standard Time
436
+ Pacific/Ponape Central Pacific Standard Time
437
+ Pacific/Kosrae Central Pacific Standard Time
438
+ Pacific/Noumea Central Pacific Standard Time
439
+ Pacific/Efate Central Pacific Standard Time
440
+ Etc/GMT-11 Central Pacific Standard Time
441
+ Asia/Kamchatka Russia Time Zone 11
442
+ Asia/Anadyr Russia Time Zone 11
443
+ Pacific/Auckland New Zealand Standard Time
444
+ Antarctica/McMurdo New Zealand Standard Time
445
+ Etc/GMT-12 UTC+12
446
+ Pacific/Tarawa UTC+12
447
+ Pacific/Majuro UTC+12
448
+ Pacific/Kwajalein UTC+12
449
+ Pacific/Nauru UTC+12
450
+ Pacific/Funafuti UTC+12
451
+ Pacific/Wake UTC+12
452
+ Pacific/Wallis UTC+12
453
+ Pacific/Fiji Fiji Standard Time
454
+ Pacific/Chatham Chatham Islands Standard Time
455
+ Etc/GMT-13 UTC+13
456
+ Pacific/Enderbury UTC+13
457
+ Pacific/Fakaofo UTC+13
458
+ Pacific/Tongatapu Tonga Standard Time
459
+ Pacific/Apia Samoa Standard Time
460
+ Pacific/Kiritimati Line Islands Standard Time
461
+ Etc/GMT-14 Line Islands Standard Time
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ change do
5
+ create_table(:testing_pixies) do
6
+ primary_key :id
7
+ text :name
8
+ tstzrange :active_during, null: false, default: "empty"
9
+ integer :price_per_unit_cents, null: false, default: 0
10
+ text :price_per_unit_currency, null: false, default: "USD"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ change do
5
+ create_table(:customers) do
6
+ primary_key :id
7
+ timestamptz :created_at, null: false, default: Sequel.function(:now)
8
+ timestamptz :updated_at
9
+ timestamptz :soft_deleted_at
10
+
11
+ text :password_digest, null: false
12
+
13
+ citext :email, null: false, unique: true
14
+ constraint(:lowercase_nospace_email, Sequel[:email] => Sequel.function(:btrim, Sequel.function(:lower, :email)))
15
+
16
+ text :name, null: false, default: ""
17
+ text :note, null: false, default: ""
18
+ end
19
+
20
+ create_table(:organizations) do
21
+ primary_key :id
22
+ timestamptz :created_at, null: false, default: Sequel.function(:now)
23
+ timestamptz :updated_at
24
+ timestamptz :soft_deleted_at
25
+
26
+ text :name, null: false, unique: true
27
+ text :key, unique: true
28
+ text :billing_email, null: false, default: ""
29
+ text :stripe_customer_id, null: false, default: ""
30
+
31
+ text :readonly_connection_url
32
+ text :admin_connection_url
33
+ end
34
+
35
+ create_table(:organization_roles) do
36
+ primary_key :id
37
+ text :name, null: false, unique: true
38
+ end
39
+
40
+ create_table(:organization_memberships) do
41
+ primary_key :id
42
+ foreign_key :customer_id, :customers, null: false
43
+ foreign_key :organization_id, :organizations, null: false
44
+ foreign_key :role_id, :organization_roles
45
+ boolean :verified, null: false, default: true
46
+ text :invitation_code
47
+ text :status
48
+ end
49
+
50
+ create_table(:subscriptions) do
51
+ primary_key :id
52
+ timestamptz :created_at, null: false, default: Sequel.function(:now)
53
+ timestamptz :updated_at
54
+ timestamptz :soft_deleted_at
55
+ text :stripe_id, unique: true, null: false
56
+ text :stripe_customer_id, unique: true, null: false, default: ""
57
+
58
+ jsonb :stripe_json, default: "{}"
59
+ end
60
+
61
+ create_table(:customer_reset_codes) do
62
+ primary_key :id
63
+ timestamptz :created_at, null: false, default: Sequel.function(:now)
64
+ timestamptz :updated_at
65
+
66
+ text :transport, null: false
67
+ text :token, null: false
68
+ boolean :used, null: false, default: false
69
+ timestamptz :expire_at, null: false
70
+
71
+ foreign_key :customer_id, :customers, null: false, on_delete: :cascade
72
+ index :customer_id
73
+ end
74
+
75
+ create_table(:idempotencies) do
76
+ primary_key :id
77
+ timestamptz :created_at, null: false, default: Sequel.function(:now)
78
+ timestamptz :updated_at
79
+ timestamptz :last_run
80
+ text :key, unique: true
81
+ end
82
+
83
+ create_table(:message_deliveries) do
84
+ primary_key :id
85
+ timestamptz :created_at, null: false, default: Sequel.function(:now)
86
+ timestamptz :updated_at
87
+ text :template, null: false
88
+ text :transport_type, null: false
89
+ text :transport_service, null: false
90
+ text :transport_message_id, unique: true
91
+ timestamptz :sent_at
92
+ text :to, null: false
93
+ foreign_key :recipient_id, :customers, on_delete: :set_null
94
+ jsonb :extra_fields, null: false, default: "{}"
95
+ timestamptz :soft_deleted_at
96
+ index :recipient_id
97
+ index :sent_at
98
+ end
99
+
100
+ create_table(:message_bodies) do
101
+ primary_key :id
102
+ text :content, null: false
103
+ text :mediatype, null: false
104
+ foreign_key :delivery_id, :message_deliveries, null: false, on_delete: :cascade
105
+ index :delivery_id
106
+ end
107
+
108
+ create_table(:roles) do
109
+ primary_key :id
110
+ text :name, null: false, unique: true
111
+ end
112
+
113
+ create_join_table({role_id: :roles, customer_id: :customers}, name: :roles_customers)
114
+
115
+ create_table(:service_integrations) do
116
+ primary_key :id
117
+ timestamptz :created_at, null: false, default: Sequel.function(:now)
118
+ timestamptz :updated_at
119
+ timestamptz :soft_deleted_at
120
+
121
+ foreign_key :organization_id, :organizations, null: false
122
+ text :api_url, null: false, unique: false, default: ""
123
+ text :opaque_id, null: false, unique: true
124
+ text :service_name, null: false
125
+ text :webhook_secret, default: ""
126
+ text :table_name, null: false
127
+ text :backfill_key, null: false, default: ""
128
+ text :backfill_secret, null: false, default: ""
129
+ index [:organization_id, :table_name], name: :unique_tablename_in_org, unique: true
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ up do
5
+ alter_table(:customers) do
6
+ add_column :opaque_id, :text, unique: true, null: true
7
+ end
8
+ from(:customers).each do |row|
9
+ from(:customers).where(id: row[:id]).update(opaque_id: "cus_#{SecureRandom.hex(6)}")
10
+ end
11
+ alter_table(:customers) do
12
+ set_column_not_null :opaque_id
13
+ end
14
+ end
15
+ down do
16
+ alter_table(:customers) do
17
+ drop_column :opaque_id
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ change do
5
+ alter_table(:service_integrations) do
6
+ add_column :last_backfilled_at, :timestamptz
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ change do
5
+ create_table(:logged_webhooks) do
6
+ primary_key :id, type: :bigserial
7
+ timestamptz :inserted_at, null: false, default: Sequel.function(:now)
8
+ index :inserted_at
9
+ timestamptz :truncated_at
10
+
11
+ text :request_body, null: false
12
+ jsonb :request_headers, null: false
13
+ smallint :response_status, null: false
14
+
15
+ # This could be invalid so is not an FK
16
+ text :service_integration_opaque_id, null: false
17
+ index :service_integration_opaque_id
18
+
19
+ # Org is null if opaque id is invalid
20
+ foreign_key :organization_id, :organizations, on_delete: :cascade
21
+ index :organization_id
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ up do
5
+ create_join_table({role_id: :roles, organization_id: :organizations},
6
+ name: :feature_roles_organizations,)
7
+
8
+ # Move away from using OrganizationRole, use Generalized Role table instead
9
+ alter_table(:organization_memberships) do
10
+ add_foreign_key :membership_role_id, :roles
11
+ end
12
+
13
+ from(:organization_roles).each do |row|
14
+ # first create the new role--if the new role name violates the uniqueness constraint on names,
15
+ # we can use the existing role and have the meaning change depending on context
16
+ from(:roles).insert_conflict.insert(name: row[:name])
17
+
18
+ # now update :organization_memberships with the new foreign key value
19
+ new_role = from(:roles).where(name: row[:name]).first
20
+ from(:organization_memberships).where(role_id: row[:id]).update(membership_role_id: new_role[:id])
21
+ end
22
+
23
+ alter_table(:organization_memberships) do
24
+ drop_foreign_key :role_id
25
+ end
26
+
27
+ drop_table(:organization_roles)
28
+ end
29
+ end