wolf_core 1.0.49 → 1.0.51

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55d1ead7877f7a80633d69eecc7c69bf98a07a79bd951e55367607d7a94ded96
4
- data.tar.gz: 152422df5d7f3db133589656eb560e392a1f86e3ab27a55530efd89a8b0f375f
3
+ metadata.gz: 37020ba24d3ca8b8e13d037e8db9dc989337d64b50e621d43610fc1f70dc15e6
4
+ data.tar.gz: a7b52dd9118488af8b28924e6bb443a5891ab2adbec588e6c26fccbe8a37212c
5
5
  SHA512:
6
- metadata.gz: 3cbde605261c06a4a07f9cd6c45c943da4e27e195fbcda2a244d18e8cd9edb6532ec6d72f0eb1cc02d623b3f0f706a6d3b4d7c03888a9b3799d0a32998f3e69d
7
- data.tar.gz: 53a244cc000fdc598c63f77ca481b54c87992c1380e1907a275ce633c213cac4cd2b372840ed4bbb208b1bf676e5eda295cc0f8435c10dcf8c63de501d930203
6
+ metadata.gz: f75446e2b98cb703a622c4002c1258427bdc292bb9c0f645b3902bb41c4882d55850a699bef39501fb33ee04aef4c7b3292b1a08bb7229259cc7258ab1df909d
7
+ data.tar.gz: 11f65c8704286eccc44628859515427ae8aca5da0a7b4f6776eb68d9a13c8019ebbd4016d9d76779632042e45ab9fc72c3784fa813f20ae7e6a6ef5d09a18ec3
@@ -11,7 +11,6 @@ module WolfCore
11
11
  'burnett/orders/export' => 'BurnettExportOrder',
12
12
  'burnett/order_applications/export' => 'BurnettExportOrderApplication',
13
13
  'burnett/clients/import' => 'BurnettImportClient',
14
- 'burnett/clients/bulk_import' => 'BurnettBulkImportClients',
15
14
  'burnett/clients/export' => 'BurnettExportClient',
16
15
  }
17
16
 
@@ -83,5 +83,30 @@ module WolfCore
83
83
  File.basename(uri.path)
84
84
  end
85
85
  end
86
+
87
+ def generate_url_from_file(file:, api_key:)
88
+ url = URI.parse("https://cdn.filestackcontent.com/#{api_key}/upload")
89
+ form_data = [
90
+ ['file', file.tempfile, file.original_filename]
91
+ ]
92
+
93
+ request = Net::HTTP::Post.new(url)
94
+ request.set_form(form_data, 'multipart/form-data')
95
+
96
+ response = Net::HTTP.start(url.hostname, url.port, use_ssl: true) do |http|
97
+ http.request(request)
98
+ end
99
+
100
+ return response['url'] if response.success?
101
+
102
+ raise_service_error({
103
+ message: "Failed to generate url from file",
104
+ url: url,
105
+ file: file,
106
+ form_data: form_data,
107
+ request: request,
108
+ response: response
109
+ })
110
+ end
86
111
  end
87
112
  end
@@ -31,5 +31,13 @@ module WolfCore
31
31
 
32
32
  input || {}
33
33
  end
34
+
35
+ def valid_url?(url)
36
+ return false unless url.instance_of?(String)
37
+ uri = URI.parse(url)
38
+ uri.is_a?(URI::HTTP) || uri.is_a?(URI::HTTPS) && !uri.host.nil?
39
+ rescue URI::InvalidURIError
40
+ false
41
+ end
34
42
  end
35
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.49"
4
+ VERSION = "1.0.51"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.49
4
+ version: 1.0.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-11 00:00:00.000000000 Z
11
+ date: 2024-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty