flexops 1.0.1 → 1.0.2
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/README.md +8 -8
- data/lib/flexops/errors.rb +35 -35
- data/lib/flexops/resources/analytics.rb +85 -85
- data/lib/flexops/resources/api_keys.rb +40 -40
- data/lib/flexops/resources/auth.rb +57 -57
- data/lib/flexops/resources/carriers.rb +129 -129
- data/lib/flexops/resources/insurance.rb +48 -48
- data/lib/flexops/resources/inventory.rb +39 -39
- data/lib/flexops/resources/orders.rb +67 -67
- data/lib/flexops/resources/pickups.rb +40 -40
- data/lib/flexops/resources/returns.rb +61 -61
- data/lib/flexops/resources/rules.rb +48 -48
- data/lib/flexops/resources/scan_forms.rb +36 -36
- data/lib/flexops/resources/shipping.rb +84 -84
- data/lib/flexops/resources/wallet.rb +41 -41
- data/lib/flexops/resources/webhooks.rb +59 -59
- data/lib/flexops/resources/workspaces.rb +53 -53
- data/lib/flexops/version.rb +11 -11
- data/lib/flexops.rb +35 -35
- metadata +6 -3
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
# ***********************************************************************
|
|
2
|
-
# Package : flexops
|
|
3
|
-
# Author : FlexOps, LLC
|
|
4
|
-
# Created : 2026-03-08
|
|
5
|
-
#
|
|
6
|
-
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
-
# ***********************************************************************
|
|
8
|
-
|
|
9
|
-
require "openssl"
|
|
10
|
-
|
|
11
|
-
module FlexOps
|
|
12
|
-
module Resources
|
|
13
|
-
class Webhooks
|
|
14
|
-
def initialize(http, ws_id_proc)
|
|
15
|
-
@http = http
|
|
16
|
-
@ws_id = ws_id_proc
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def list
|
|
20
|
-
@http.get("#{ws_path}/webhooks")
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def get(webhook_id)
|
|
24
|
-
@http.get("#{ws_path}/webhooks/#{webhook_id}")
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def create(request)
|
|
28
|
-
@http.post("#{ws_path}/webhooks", body: request)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def update(webhook_id, data)
|
|
32
|
-
@http.put("#{ws_path}/webhooks/#{webhook_id}", body: data)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def delete(webhook_id)
|
|
36
|
-
@http.delete("#{ws_path}/webhooks/#{webhook_id}")
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def rotate_secret(webhook_id)
|
|
40
|
-
@http.post("#{ws_path}/webhooks/#{webhook_id}/rotate-secret")
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def list_delivery_logs(webhook_id)
|
|
44
|
-
@http.get("#{ws_path}/webhooks/#{webhook_id}/deliveries")
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def self.verify_signature(payload, signature, secret)
|
|
48
|
-
expected = OpenSSL::HMAC.hexdigest("SHA256", secret, payload)
|
|
49
|
-
OpenSSL.secure_compare(expected, signature)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
private
|
|
53
|
-
|
|
54
|
-
def ws_path
|
|
55
|
-
"/api/workspaces/#{@ws_id.call}"
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
1
|
+
# ***********************************************************************
|
|
2
|
+
# Package : flexops
|
|
3
|
+
# Author : FlexOps, LLC
|
|
4
|
+
# Created : 2026-03-08
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
+
# ***********************************************************************
|
|
8
|
+
|
|
9
|
+
require "openssl"
|
|
10
|
+
|
|
11
|
+
module FlexOps
|
|
12
|
+
module Resources
|
|
13
|
+
class Webhooks
|
|
14
|
+
def initialize(http, ws_id_proc)
|
|
15
|
+
@http = http
|
|
16
|
+
@ws_id = ws_id_proc
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def list
|
|
20
|
+
@http.get("#{ws_path}/webhooks")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def get(webhook_id)
|
|
24
|
+
@http.get("#{ws_path}/webhooks/#{webhook_id}")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def create(request)
|
|
28
|
+
@http.post("#{ws_path}/webhooks", body: request)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def update(webhook_id, data)
|
|
32
|
+
@http.put("#{ws_path}/webhooks/#{webhook_id}", body: data)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def delete(webhook_id)
|
|
36
|
+
@http.delete("#{ws_path}/webhooks/#{webhook_id}")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def rotate_secret(webhook_id)
|
|
40
|
+
@http.post("#{ws_path}/webhooks/#{webhook_id}/rotate-secret")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def list_delivery_logs(webhook_id)
|
|
44
|
+
@http.get("#{ws_path}/webhooks/#{webhook_id}/deliveries")
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def self.verify_signature(payload, signature, secret)
|
|
48
|
+
expected = OpenSSL::HMAC.hexdigest("SHA256", secret, payload)
|
|
49
|
+
OpenSSL.secure_compare(expected, signature)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
private
|
|
53
|
+
|
|
54
|
+
def ws_path
|
|
55
|
+
"/api/workspaces/#{@ws_id.call}"
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
# ***********************************************************************
|
|
2
|
-
# Package : flexops
|
|
3
|
-
# Author : FlexOps, LLC
|
|
4
|
-
# Created : 2026-03-08
|
|
5
|
-
#
|
|
6
|
-
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
-
# ***********************************************************************
|
|
8
|
-
|
|
9
|
-
module FlexOps
|
|
10
|
-
module Resources
|
|
11
|
-
class Workspaces
|
|
12
|
-
def initialize(http, ws_id_proc)
|
|
13
|
-
@http = http
|
|
14
|
-
@ws_id = ws_id_proc
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def list
|
|
18
|
-
@http.get("/api/workspaces")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def get(workspace_id = nil)
|
|
22
|
-
id = workspace_id || @ws_id.call
|
|
23
|
-
@http.get("/api/workspaces/#{id}")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def create(request)
|
|
27
|
-
@http.post("/api/workspaces", body: request)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def update(data)
|
|
31
|
-
@http.put("/api/workspaces/#{@ws_id.call}", body: data)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def list_members
|
|
35
|
-
@http.get("/api/workspaces/#{@ws_id.call}/members")
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def invite_member(email:, role: nil)
|
|
39
|
-
body = { email: email }
|
|
40
|
-
body[:role] = role if role
|
|
41
|
-
@http.post("/api/workspaces/#{@ws_id.call}/members/invite", body: body)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def remove_member(user_id)
|
|
45
|
-
@http.delete("/api/workspaces/#{@ws_id.call}/members/#{user_id}")
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def update_member_role(user_id, role)
|
|
49
|
-
@http.put("/api/workspaces/#{@ws_id.call}/members/#{user_id}/role", body: { role: role })
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
1
|
+
# ***********************************************************************
|
|
2
|
+
# Package : flexops
|
|
3
|
+
# Author : FlexOps, LLC
|
|
4
|
+
# Created : 2026-03-08
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
+
# ***********************************************************************
|
|
8
|
+
|
|
9
|
+
module FlexOps
|
|
10
|
+
module Resources
|
|
11
|
+
class Workspaces
|
|
12
|
+
def initialize(http, ws_id_proc)
|
|
13
|
+
@http = http
|
|
14
|
+
@ws_id = ws_id_proc
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def list
|
|
18
|
+
@http.get("/api/workspaces")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def get(workspace_id = nil)
|
|
22
|
+
id = workspace_id || @ws_id.call
|
|
23
|
+
@http.get("/api/workspaces/#{id}")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def create(request)
|
|
27
|
+
@http.post("/api/workspaces", body: request)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def update(data)
|
|
31
|
+
@http.put("/api/workspaces/#{@ws_id.call}", body: data)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def list_members
|
|
35
|
+
@http.get("/api/workspaces/#{@ws_id.call}/members")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def invite_member(email:, role: nil)
|
|
39
|
+
body = { email: email }
|
|
40
|
+
body[:role] = role if role
|
|
41
|
+
@http.post("/api/workspaces/#{@ws_id.call}/members/invite", body: body)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def remove_member(user_id)
|
|
45
|
+
@http.delete("/api/workspaces/#{@ws_id.call}/members/#{user_id}")
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def update_member_role(user_id, role)
|
|
49
|
+
@http.put("/api/workspaces/#{@ws_id.call}/members/#{user_id}/role", body: { role: role })
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
data/lib/flexops/version.rb
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# ***********************************************************************
|
|
2
|
-
# Package : flexops
|
|
3
|
-
# Author : FlexOps, LLC
|
|
4
|
-
# Created : 2026-03-08
|
|
5
|
-
#
|
|
6
|
-
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
-
# ***********************************************************************
|
|
8
|
-
|
|
9
|
-
module FlexOps
|
|
10
|
-
VERSION = "1.0.
|
|
11
|
-
end
|
|
1
|
+
# ***********************************************************************
|
|
2
|
+
# Package : flexops
|
|
3
|
+
# Author : FlexOps, LLC
|
|
4
|
+
# Created : 2026-03-08
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
+
# ***********************************************************************
|
|
8
|
+
|
|
9
|
+
module FlexOps
|
|
10
|
+
VERSION = "1.0.2"
|
|
11
|
+
end
|
data/lib/flexops.rb
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
# ***********************************************************************
|
|
2
|
-
# Package : flexops
|
|
3
|
-
# Author : FlexOps, LLC
|
|
4
|
-
# Created : 2026-03-08
|
|
5
|
-
#
|
|
6
|
-
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
-
# ***********************************************************************
|
|
8
|
-
|
|
9
|
-
require_relative "flexops/version"
|
|
10
|
-
require_relative "flexops/errors"
|
|
11
|
-
require_relative "flexops/http"
|
|
12
|
-
require_relative "flexops/client"
|
|
13
|
-
require_relative "flexops/resources/auth"
|
|
14
|
-
require_relative "flexops/resources/workspaces"
|
|
15
|
-
require_relative "flexops/resources/shipping"
|
|
16
|
-
require_relative "flexops/resources/carriers"
|
|
17
|
-
require_relative "flexops/resources/webhooks"
|
|
18
|
-
require_relative "flexops/resources/wallet"
|
|
19
|
-
require_relative "flexops/resources/insurance"
|
|
20
|
-
require_relative "flexops/resources/returns"
|
|
21
|
-
require_relative "flexops/resources/api_keys"
|
|
22
|
-
require_relative "flexops/resources/analytics"
|
|
23
|
-
require_relative "flexops/resources/orders"
|
|
24
|
-
require_relative "flexops/resources/inventory"
|
|
25
|
-
require_relative "flexops/resources/pickups"
|
|
26
|
-
require_relative "flexops/resources/scan_forms"
|
|
27
|
-
require_relative "flexops/resources/rules"
|
|
28
|
-
require_relative "flexops/resources/offsets"
|
|
29
|
-
require_relative "flexops/resources/hs_codes"
|
|
30
|
-
require_relative "flexops/resources/recurring_shipments"
|
|
31
|
-
require_relative "flexops/resources/email_templates"
|
|
32
|
-
require_relative "flexops/resources/reports"
|
|
33
|
-
|
|
34
|
-
module FlexOps
|
|
35
|
-
end
|
|
1
|
+
# ***********************************************************************
|
|
2
|
+
# Package : flexops
|
|
3
|
+
# Author : FlexOps, LLC
|
|
4
|
+
# Created : 2026-03-08
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
|
|
7
|
+
# ***********************************************************************
|
|
8
|
+
|
|
9
|
+
require_relative "flexops/version"
|
|
10
|
+
require_relative "flexops/errors"
|
|
11
|
+
require_relative "flexops/http"
|
|
12
|
+
require_relative "flexops/client"
|
|
13
|
+
require_relative "flexops/resources/auth"
|
|
14
|
+
require_relative "flexops/resources/workspaces"
|
|
15
|
+
require_relative "flexops/resources/shipping"
|
|
16
|
+
require_relative "flexops/resources/carriers"
|
|
17
|
+
require_relative "flexops/resources/webhooks"
|
|
18
|
+
require_relative "flexops/resources/wallet"
|
|
19
|
+
require_relative "flexops/resources/insurance"
|
|
20
|
+
require_relative "flexops/resources/returns"
|
|
21
|
+
require_relative "flexops/resources/api_keys"
|
|
22
|
+
require_relative "flexops/resources/analytics"
|
|
23
|
+
require_relative "flexops/resources/orders"
|
|
24
|
+
require_relative "flexops/resources/inventory"
|
|
25
|
+
require_relative "flexops/resources/pickups"
|
|
26
|
+
require_relative "flexops/resources/scan_forms"
|
|
27
|
+
require_relative "flexops/resources/rules"
|
|
28
|
+
require_relative "flexops/resources/offsets"
|
|
29
|
+
require_relative "flexops/resources/hs_codes"
|
|
30
|
+
require_relative "flexops/resources/recurring_shipments"
|
|
31
|
+
require_relative "flexops/resources/email_templates"
|
|
32
|
+
require_relative "flexops/resources/reports"
|
|
33
|
+
|
|
34
|
+
module FlexOps
|
|
35
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flexops
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- FlexOps, LLC
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-09-01 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: json
|
|
@@ -91,6 +92,7 @@ homepage: https://github.com/BillEisenman/flexops-sdk-ruby
|
|
|
91
92
|
licenses:
|
|
92
93
|
- MIT
|
|
93
94
|
metadata: {}
|
|
95
|
+
post_install_message:
|
|
94
96
|
rdoc_options: []
|
|
95
97
|
require_paths:
|
|
96
98
|
- lib
|
|
@@ -105,7 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
105
107
|
- !ruby/object:Gem::Version
|
|
106
108
|
version: '0'
|
|
107
109
|
requirements: []
|
|
108
|
-
rubygems_version: 3.
|
|
110
|
+
rubygems_version: 3.5.22
|
|
111
|
+
signing_key:
|
|
109
112
|
specification_version: 4
|
|
110
113
|
summary: Official FlexOps multi-carrier shipping platform SDK
|
|
111
114
|
test_files: []
|