From f839eb6f8d90721548547fc7938b9b98882fe87a Mon Sep 17 00:00:00 2001 From: Kolawole Ezekiel Date: Wed, 17 Jan 2024 20:41:00 +0100 Subject: [PATCH 1/2] add exponential-backoff and uuid dependency to gemspec file --- bin/old-console | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ novu.gemspec | 4 ++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 bin/old-console diff --git a/bin/old-console b/bin/old-console new file mode 100644 index 0000000..5fe28b6 --- /dev/null +++ b/bin/old-console @@ -0,0 +1,65 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" +require "novu" +require "uuid" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start, enable_retry: true, retry_config: {max_retries: 5} +# uuid = UUID.new , idempotency_key: '67475db0-50b1-013c-fae9-38e85644422a' +# puts uuid.generate +client = Novu::Client.new(access_token: '001e88ba1e9deb77878350ff4e3dabdd', enable_retry: false, retry_config: {max_retries: 5}) + +# payload = { +# 'eventsw' => [ +# { +# 'name' => 'Trigger1', +# 'payload' => { # optional +# 'first-name' => 'Adam' # optional +# }, +# 'to' => { +# 'subscriberId' => '7789' +# }, +# 'transactionId' => '89kjfke9893' #optional +# }, +# { +# 'name' => 'Trigger2', +# 'payload' => { # optional +# 'last-name' => 'Eve' # optional +# }, +# 'to' => { +# 'subscriberId' => '7789' +# }, +# 'transactionId' => 'sw900999as' #optional +# } +# ] +# } +# result = client.trigger_bulk_event(payload) +result = client.rename_topic('topic_new@wsedfrtghkk', 'you') +# payload = { +# 'changeIds' => ['64a865672712f97fb0985298'] +# } +# result = client.create_subscriber({ +# 'subscriberId' => 'dempotentcyYou' +# }) + +# result = client.apply_bulk_changes({ +# 'subscribers' => ['you'] +# }) +# result = client.subscriber_topic('topic_new', 'you') +# result = client.provider_oauth_redirect('youhfhfh', 'slack', { +# 'environmentId' => '64a865672712f97fb0985298', +# 'code' => '123', +# 'hmacHash' => '$2y$10$U.lIU/phf4.0sO8XPoHcwehP5n66H87pFQ527xSTOibQ0tAVlwpTm', +# 'integrationIdentifier' => 'integration' +# }) + +puts result + +require "irb" +IRB.start(__FILE__) diff --git a/novu.gemspec b/novu.gemspec index e154ab1..40fdcd9 100644 --- a/novu.gemspec +++ b/novu.gemspec @@ -32,8 +32,10 @@ Gem::Specification.new do |spec| # Uncomment to register a new dependency of your gem # spec.add_dependency "example-gem", "~> 1.0" - spec.add_dependency "httparty", "~> 0.21" spec.add_dependency "activesupport", ">= 6.1.7.2" + spec.add_dependency "exponential-backoff" + spec.add_dependency "httparty", "~> 0.21" + spec.add_dependency "uuid", '~> 2.3', '>= 2.3.9' # For more information and examples about making a new gem, check out our # guide at: https://bundler.io/guides/creating_gem.html From 8a95cad5066bd1a87981e7251f3595abd1e08851 Mon Sep 17 00:00:00 2001 From: Kolawole Ezekiel Date: Wed, 17 Jan 2024 20:42:57 +0100 Subject: [PATCH 2/2] remove old file --- bin/old-console | 65 ------------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 bin/old-console diff --git a/bin/old-console b/bin/old-console deleted file mode 100644 index 5fe28b6..0000000 --- a/bin/old-console +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require "bundler/setup" -require "novu" -require "uuid" - -# You can add fixtures and/or initialization code here to make experimenting -# with your gem easier. You can also use a different console, if you like. - -# (If you use this, don't forget to add pry to your Gemfile!) -# require "pry" -# Pry.start, enable_retry: true, retry_config: {max_retries: 5} -# uuid = UUID.new , idempotency_key: '67475db0-50b1-013c-fae9-38e85644422a' -# puts uuid.generate -client = Novu::Client.new(access_token: '001e88ba1e9deb77878350ff4e3dabdd', enable_retry: false, retry_config: {max_retries: 5}) - -# payload = { -# 'eventsw' => [ -# { -# 'name' => 'Trigger1', -# 'payload' => { # optional -# 'first-name' => 'Adam' # optional -# }, -# 'to' => { -# 'subscriberId' => '7789' -# }, -# 'transactionId' => '89kjfke9893' #optional -# }, -# { -# 'name' => 'Trigger2', -# 'payload' => { # optional -# 'last-name' => 'Eve' # optional -# }, -# 'to' => { -# 'subscriberId' => '7789' -# }, -# 'transactionId' => 'sw900999as' #optional -# } -# ] -# } -# result = client.trigger_bulk_event(payload) -result = client.rename_topic('topic_new@wsedfrtghkk', 'you') -# payload = { -# 'changeIds' => ['64a865672712f97fb0985298'] -# } -# result = client.create_subscriber({ -# 'subscriberId' => 'dempotentcyYou' -# }) - -# result = client.apply_bulk_changes({ -# 'subscribers' => ['you'] -# }) -# result = client.subscriber_topic('topic_new', 'you') -# result = client.provider_oauth_redirect('youhfhfh', 'slack', { -# 'environmentId' => '64a865672712f97fb0985298', -# 'code' => '123', -# 'hmacHash' => '$2y$10$U.lIU/phf4.0sO8XPoHcwehP5n66H87pFQ527xSTOibQ0tAVlwpTm', -# 'integrationIdentifier' => 'integration' -# }) - -puts result - -require "irb" -IRB.start(__FILE__)