strongmind-platform-sdk 3.14.1 → 3.14.3
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/Gemfile.lock +7 -7
- data/lib/platform_sdk/bynder/client.rb +23 -0
- data/lib/platform_sdk/power_school/client.rb +9 -0
- data/lib/platform_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4863450100f7294639bc50f9dd86af345e96b11b5e49e5e721bde6ea32913dc4
|
4
|
+
data.tar.gz: 80115971de889e31af9b193a7ffdf829f9819a0815d03bdd9909ba087c80af52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07ae6d3b9a435c807af00b8024672d04cc4719fc1c350349003997ee109f5a79c2493c13eb5ec1ac72e8646a60db359081b56ddad67e37505af325a706e6ed88
|
7
|
+
data.tar.gz: 710c0665dd26ea1bf547da176c0ba01b7451a2c7d90a7455b8136bc64ba7688ec5e4759d04bea4006ec7bf0ec84da2f860d41ee4e4e82f30aa5ec0e03e027637
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strongmind-platform-sdk (3.14.
|
4
|
+
strongmind-platform-sdk (3.14.3)
|
5
5
|
aws-sdk-secretsmanager (~> 1.66)
|
6
6
|
faraday (~> 2.5, >= 2.5.2)
|
7
7
|
faraday-retry
|
@@ -26,17 +26,17 @@ GEM
|
|
26
26
|
public_suffix (>= 2.0.2, < 6.0)
|
27
27
|
ast (2.4.2)
|
28
28
|
aws-eventstream (1.3.0)
|
29
|
-
aws-partitions (1.
|
30
|
-
aws-sdk-cloudwatch (1.
|
31
|
-
aws-sdk-core (~> 3, >= 3.
|
29
|
+
aws-partitions (1.925.0)
|
30
|
+
aws-sdk-cloudwatch (1.90.0)
|
31
|
+
aws-sdk-core (~> 3, >= 3.193.0)
|
32
32
|
aws-sigv4 (~> 1.1)
|
33
|
-
aws-sdk-core (3.
|
33
|
+
aws-sdk-core (3.194.2)
|
34
34
|
aws-eventstream (~> 1, >= 1.3.0)
|
35
35
|
aws-partitions (~> 1, >= 1.651.0)
|
36
36
|
aws-sigv4 (~> 1.8)
|
37
37
|
jmespath (~> 1, >= 1.6.1)
|
38
|
-
aws-sdk-secretsmanager (1.
|
39
|
-
aws-sdk-core (~> 3, >= 3.
|
38
|
+
aws-sdk-secretsmanager (1.92.0)
|
39
|
+
aws-sdk-core (~> 3, >= 3.193.0)
|
40
40
|
aws-sigv4 (~> 1.1)
|
41
41
|
aws-sigv4 (1.8.0)
|
42
42
|
aws-eventstream (~> 1, >= 1.0.2)
|
@@ -5,6 +5,8 @@ module PlatformSdk
|
|
5
5
|
class Client
|
6
6
|
attr_reader :access_token, :base_url, :conn
|
7
7
|
|
8
|
+
INTEGRATION_ID = "b242c16d-70f4-4101-8df5-87b35bbe56f0" # Wordpress integration id
|
9
|
+
|
8
10
|
def initialize(base_url, access_token, conn: nil)
|
9
11
|
@access_token = access_token
|
10
12
|
@base_url = base_url
|
@@ -23,6 +25,19 @@ module PlatformSdk
|
|
23
25
|
response.body
|
24
26
|
end
|
25
27
|
|
28
|
+
def create_asset_usage(asset_id, uri, integration_id: INTEGRATION_ID)
|
29
|
+
resource_path = "/api/media/usage"
|
30
|
+
body = { integration_id:, asset_id:, uri: }
|
31
|
+
response = post(resource_path, body.to_json)
|
32
|
+
response.body
|
33
|
+
end
|
34
|
+
|
35
|
+
def remove_asset_usage(asset_id, uri, integration_id: INTEGRATION_ID)
|
36
|
+
resource_path = "/api/media/usage"
|
37
|
+
response = delete(resource_path, { integration_id:, asset_id:, uri: })
|
38
|
+
response.body
|
39
|
+
end
|
40
|
+
|
26
41
|
private
|
27
42
|
|
28
43
|
def build_connection
|
@@ -45,6 +60,14 @@ module PlatformSdk
|
|
45
60
|
@conn.get(path, params)
|
46
61
|
end
|
47
62
|
|
63
|
+
def post(path, body)
|
64
|
+
@conn.post(path, body)
|
65
|
+
end
|
66
|
+
|
67
|
+
def delete(path, params = {})
|
68
|
+
@conn.delete(path, params)
|
69
|
+
end
|
70
|
+
|
48
71
|
end
|
49
72
|
end
|
50
73
|
end
|
@@ -37,6 +37,14 @@ module PlatformSdk
|
|
37
37
|
@conn.get(path, params).body
|
38
38
|
end
|
39
39
|
|
40
|
+
def post(path, params = nil)
|
41
|
+
@conn.post(path, params).body
|
42
|
+
end
|
43
|
+
|
44
|
+
def put(path, params = nil)
|
45
|
+
@conn.put(path, params).body
|
46
|
+
end
|
47
|
+
|
40
48
|
def special_programs
|
41
49
|
records_as_json = power_query("specialprograms")
|
42
50
|
records_as_json.map { |record| SpecialProgram.new(record) }
|
@@ -58,6 +66,7 @@ module PlatformSdk
|
|
58
66
|
def scrub_query(query_name)
|
59
67
|
raise PowerQueryNotValid unless valid_power_query_names.include?(query_name)
|
60
68
|
end
|
69
|
+
|
61
70
|
end
|
62
71
|
end
|
63
72
|
end
|
data/lib/platform_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-platform-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.14.
|
4
|
+
version: 3.14.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|