strongmind-platform-sdk 3.26.15 → 3.26.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e5e38bc3e80eba571779f3f8d33190c3fdc604da602c80298a439a9c412bd07
4
- data.tar.gz: 01b6d20bf6031049326d308ec0594b8ba1226daf9bd58772f719daabc72273aa
3
+ metadata.gz: 52b5af739b96508bab2b37ede64e6e33f1167dbe596b9eba7fa3698d6f6b3672
4
+ data.tar.gz: 6229e166c700be9c4beba917e03c4f90b9ea4d7f10ea376059905cc99b281341
5
5
  SHA512:
6
- metadata.gz: 1504f3d4584defb905cf8e4ec34c7dc50a476b89ac184dc1ede042c31a5f2f29afb402183f31accdc7c71f65fe7995c7e2f1e57f524646d6dabb11781b914ebb
7
- data.tar.gz: 269eae34b9b65f6c5222139967481ebd06e5dd7aeab709cd2f9fff61838ebf3488b78c9fe60c219338b5b53547abd1b6fad0da99745a4d73e9b7b78df8196a79
6
+ metadata.gz: 9efc5c16b3a0baaf060ebf70f6789076d4880da8bded9282ff000802501638e9fbb0862d3b502f93e79d5aea7329b99de812127e87688bcda7e5483ad0e23d64
7
+ data.tar.gz: 381f5e723438486510112bf40c16f87c8f33c6a19edcf4dd7c6e65f5a89594c14ddb89adc99e967be7de91b1455c97f45b8c0140ed757f4fda879497c9703ea2
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.2.6
@@ -13,16 +13,22 @@ module PlatformSdk
13
13
  end
14
14
 
15
15
  def send_pipeline_create
16
+ return if Rails.env.development?
17
+
16
18
  Jobs::SendNounToPipelineJob.perform_later(pipeline_payload('created'),
17
- one_roster_pipeline_payload)
19
+ one_roster_pipeline_payload)
18
20
  end
19
21
 
20
22
  def send_pipeline_update
23
+ return if Rails.env.development?
24
+
21
25
  Jobs::SendNounToPipelineJob.perform_later(pipeline_payload('modified'),
22
26
  one_roster_pipeline_payload)
23
27
  end
24
28
 
25
29
  def send_pipeline_destroy
30
+ return if Rails.env.development?
31
+
26
32
  Jobs::SendNounToPipelineJob.perform_later(pipeline_payload('destroyed'),
27
33
  one_roster_pipeline_payload(deleted: true))
28
34
  end
@@ -39,6 +39,26 @@ module PlatformSdk
39
39
  get_authenticated_payload_with_params('/api/v1/schools/course-image', params)
40
40
  end
41
41
 
42
+ def get_sm_catalog_id_by_external_course(canvas_domain:, canvas_account_id:, external_course_id:)
43
+ params = {
44
+ canvasDomain: canvas_domain,
45
+ canvasAccountId: canvas_account_id,
46
+ externalCourseId: external_course_id
47
+ }
48
+ get_authenticated_payload_with_params('/api/v1/SchoolExternalCourse/sm-catalog-id', params)
49
+ end
50
+
51
+ def get_cartridge_url_for_powerschool(external_course_id:, external_school_id:)
52
+ path = "/api/v1/CourseCartridges/ExternalCourse/#{external_course_id}/ExternalSchool/#{external_school_id}"
53
+ get_payload(path)
54
+ end
55
+
56
+ def get_cartridge_url_for_integration_with_domain(external_course_id:, external_school_id:, canvas_domain:)
57
+ path = "/api/v1/CourseCartridges/ExternalCourse/#{external_course_id}/" \
58
+ "ExternalSchool/#{external_school_id}/CanvasDomain/#{canvas_domain}"
59
+ get_payload(path)
60
+ end
61
+
42
62
  private
43
63
 
44
64
  def build_connection
@@ -21,8 +21,8 @@ module PlatformSdk
21
21
  }
22
22
  client = PlatformSdk::DataPipeline::Client.new(credentials)
23
23
 
24
- client.post(message) unless Rails.env.development?
25
- return unless one_roster_message.present? && !Rails.env.development?
24
+ client.post(message)
25
+ return unless one_roster_message.present?
26
26
 
27
27
  client.post(one_roster_message)
28
28
  end
@@ -49,6 +49,14 @@ module PlatformSdk
49
49
  identifiers: { id: record.id }
50
50
  ))
51
51
  end
52
+
53
+ it 'does not post to the data pipeline if in development environment' do
54
+ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
55
+ perform_enqueued_jobs do
56
+ record.save!
57
+ end
58
+ expect(data_pipeline_client).not_to have_received(:post)
59
+ end
52
60
  end
53
61
 
54
62
  context 'update' do
@@ -73,6 +81,15 @@ module PlatformSdk
73
81
  ))
74
82
  end
75
83
  end
84
+
85
+ it 'does not post to the data pipeline if in development environment' do
86
+ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
87
+ column = column_to_update(record)
88
+ perform_enqueued_jobs do
89
+ update_record(record, column)
90
+ end
91
+ expect(data_pipeline_client).not_to have_received(:post)
92
+ end
76
93
  end
77
94
 
78
95
  context 'after an update that does not change data' do
@@ -59,6 +59,14 @@ module PlatformSdk
59
59
  end
60
60
  expect(data_pipeline_client).to have_received(:post).with(pipeline_payload)
61
61
  end
62
+
63
+ it 'does not post to the data pipeline if in development environment' do
64
+ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
65
+ perform_enqueued_jobs do
66
+ record.save!
67
+ end
68
+ expect(data_pipeline_client).not_to have_received(:post)
69
+ end
62
70
  end
63
71
 
64
72
  context 'destroy' do
@@ -81,6 +89,15 @@ module PlatformSdk
81
89
  expect(data_pipeline_client).to have_received(:post).with(pipeline_payload)
82
90
  expect(data_pipeline_client).to have_received(:post).with(pipeline_payload_deleted)
83
91
  end
92
+
93
+ it 'does not post to the data pipeline if in development environment' do
94
+ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
95
+ perform_enqueued_jobs do
96
+ record.save!
97
+ record.destroy
98
+ end
99
+ expect(data_pipeline_client).not_to have_received(:post)
100
+ end
84
101
  end
85
102
 
86
103
  context 'update' do
@@ -91,7 +108,6 @@ module PlatformSdk
91
108
  end
92
109
 
93
110
  context 'after an update' do
94
-
95
111
  it 'posts a copy of our data to the data pipeline' do
96
112
  column = column_to_update(record)
97
113
  perform_enqueued_jobs do
@@ -100,6 +116,14 @@ module PlatformSdk
100
116
  expect(data_pipeline_client).to have_received(:post).with(pipeline_payload)
101
117
  end
102
118
 
119
+ it 'does not post to the data pipeline if in development environment' do
120
+ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
121
+ column = column_to_update(record)
122
+ perform_enqueued_jobs do
123
+ update_record(record, column)
124
+ end
125
+ expect(data_pipeline_client).not_to have_received(:post)
126
+ end
103
127
  end
104
128
 
105
129
  context 'after an update that does not change data' do
@@ -3,7 +3,7 @@
3
3
  module PlatformSdk
4
4
  MAJOR = 3
5
5
  MINOR = 26
6
- PATCH = 15
6
+ PATCH = 17
7
7
 
8
8
  VERSION = "#{PlatformSdk::MAJOR}.#{PlatformSdk::MINOR}.#{PlatformSdk::PATCH}"
9
9
  end
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.26.15
4
+ version: 3.26.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-09-23 00:00:00.000000000 Z
11
+ date: 2025-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday