jpsclient 1.3.0 → 1.5.0
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/lib/jpsclient/api/category.rb +331 -0
- data/lib/jpsclient/api/cert.rb +4 -1
- data/lib/jpsclient/api/client.rb +68 -37
- data/lib/jpsclient/api/design.rb +123 -0
- data/lib/jpsclient/api/image_search.rb +74 -0
- data/lib/jpsclient/api/lark_card_message.rb +45 -0
- data/lib/jpsclient/api/lark_department.rb +44 -0
- data/lib/jpsclient/api/lark_file.rb +32 -0
- data/lib/jpsclient/api/lark_leave_approval.rb +47 -0
- data/lib/jpsclient/api/lark_message.rb +32 -0
- data/lib/jpsclient/api/nuget.rb +30 -0
- data/lib/jpsclient/api/permission.rb +137 -0
- data/lib/jpsclient/api/project_package.rb +53 -0
- data/lib/jpsclient/api/tag.rb +267 -45
- data/lib/jpsclient/api/template.rb +216 -0
- data/lib/jpsclient/auth/auth.rb +31 -2
- data/lib/jpsclient/http/http_client.rb +24 -4
- data/lib/jpsclient/upload/upload_client.rb +1 -1
- data/lib/jpsclient/version.rb +1 -1
- metadata +57 -18
- /data/lib/jpsclient/api/{app_resource_version.rb → archived_outdated/app_resource_version.rb} +0 -0
- /data/lib/jpsclient/api/{application_category.rb → archived_outdated/application_category.rb} +0 -0
- /data/lib/jpsclient/api/{application_design.rb → archived_outdated/application_design.rb} +0 -0
- /data/lib/jpsclient/api/{assets_category.rb → archived_outdated/assets_category.rb} +0 -0
- /data/lib/jpsclient/api/{experience.rb → archived_outdated/experience.rb} +0 -0
- /data/lib/jpsclient/api/{experience_category.rb → archived_outdated/experience_category.rb} +0 -0
- /data/lib/jpsclient/api/{icon_and_snapshot.rb → archived_outdated/icon_and_snapshot.rb} +0 -0
- /data/lib/jpsclient/api/{publisher_category.rb → archived_outdated/publisher_category.rb} +0 -0
- /data/lib/jpsclient/api/{publisher_group_category.rb → archived_outdated/publisher_group_category.rb} +0 -0
- /data/lib/jpsclient/api/{requirements_category.rb → archived_outdated/requirements_category.rb} +0 -0
- /data/lib/jpsclient/api/{resource_category.rb → archived_outdated/resource_category.rb} +0 -0
- /data/lib/jpsclient/api/{sketch_category.rb → archived_outdated/sketch_category.rb} +0 -0
- /data/lib/jpsclient/api/{survey_category.rb → archived_outdated/survey_category.rb} +0 -0
- /data/lib/jpsclient/api/{tool_category.rb → archived_outdated/tool_category.rb} +0 -0
- /data/lib/jpsclient/api/{jssdk.rb → js_sdk.rb} +0 -0
|
@@ -120,9 +120,17 @@ module JPSClient
|
|
|
120
120
|
@need_login = http_response[:need_login]
|
|
121
121
|
|
|
122
122
|
if http_response[:body].is_a?(Hash)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
# 处理 Meta 格式响应: {meta: {code: 0, message: "..."}, data: {...}}
|
|
124
|
+
if http_response[:body]['meta']
|
|
125
|
+
@code = http_response[:body]['meta']['code']
|
|
126
|
+
@msg = http_response[:body]['meta']['message']
|
|
127
|
+
@data = http_response[:body]['data']
|
|
128
|
+
# 处理直接格式响应: {code: 0, data: {...}, msg: "..."}
|
|
129
|
+
else
|
|
130
|
+
@code = http_response[:body]['code'] || http_response[:code]
|
|
131
|
+
@data = http_response[:body]['data']
|
|
132
|
+
@msg = http_response[:body]['msg'] || http_response[:body]['message']
|
|
133
|
+
end
|
|
126
134
|
else
|
|
127
135
|
@code = http_response[:code]
|
|
128
136
|
@data = http_response[:body]
|
|
@@ -130,7 +138,8 @@ module JPSClient
|
|
|
130
138
|
end
|
|
131
139
|
|
|
132
140
|
def success?
|
|
133
|
-
|
|
141
|
+
# 成功码从 200 改为 0,同时向后兼容 200
|
|
142
|
+
@success && (@code.to_s == '0' || @code.to_s == '200')
|
|
134
143
|
end
|
|
135
144
|
|
|
136
145
|
def need_login?
|
|
@@ -144,5 +153,16 @@ module JPSClient
|
|
|
144
153
|
'msg' => @msg
|
|
145
154
|
}
|
|
146
155
|
end
|
|
156
|
+
|
|
157
|
+
# 添加新方法返回 meta 格式响应
|
|
158
|
+
def to_h_with_meta
|
|
159
|
+
{
|
|
160
|
+
'meta' => {
|
|
161
|
+
'code' => @code,
|
|
162
|
+
'message' => @msg
|
|
163
|
+
},
|
|
164
|
+
'data' => @data
|
|
165
|
+
}
|
|
166
|
+
end
|
|
147
167
|
end
|
|
148
168
|
end
|
|
@@ -139,7 +139,7 @@ module JPSClient
|
|
|
139
139
|
upload_config: @upload_config
|
|
140
140
|
)
|
|
141
141
|
|
|
142
|
-
if complete_result && complete_result["code"] == 200
|
|
142
|
+
if complete_result && (complete_result["code"] == 0 || complete_result["code"] == 200)
|
|
143
143
|
# 返回 URL 字符串以保持向后兼容
|
|
144
144
|
upload_result = complete_result.dig("data", "url") || s3_key
|
|
145
145
|
Logger.instance.fancyinfo_success("文件#{@upload_binary_file} 上传成功! 😎😎😎")
|
data/lib/jpsclient/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jpsclient
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Your Name
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: faraday
|
|
@@ -91,6 +91,20 @@ dependencies:
|
|
|
91
91
|
- - "~>"
|
|
92
92
|
- !ruby/object:Gem::Version
|
|
93
93
|
version: '1.9'
|
|
94
|
+
- !ruby/object:Gem::Dependency
|
|
95
|
+
name: base64
|
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
|
97
|
+
requirements:
|
|
98
|
+
- - "~>"
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: '0.2'
|
|
101
|
+
type: :runtime
|
|
102
|
+
prerelease: false
|
|
103
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
104
|
+
requirements:
|
|
105
|
+
- - "~>"
|
|
106
|
+
- !ruby/object:Gem::Version
|
|
107
|
+
version: '0.2'
|
|
94
108
|
- !ruby/object:Gem::Dependency
|
|
95
109
|
name: bundler
|
|
96
110
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -133,6 +147,20 @@ dependencies:
|
|
|
133
147
|
- - "~>"
|
|
134
148
|
- !ruby/object:Gem::Version
|
|
135
149
|
version: '3.0'
|
|
150
|
+
- !ruby/object:Gem::Dependency
|
|
151
|
+
name: webmock
|
|
152
|
+
requirement: !ruby/object:Gem::Requirement
|
|
153
|
+
requirements:
|
|
154
|
+
- - "~>"
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: '3.0'
|
|
157
|
+
type: :development
|
|
158
|
+
prerelease: false
|
|
159
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
160
|
+
requirements:
|
|
161
|
+
- - "~>"
|
|
162
|
+
- !ruby/object:Gem::Version
|
|
163
|
+
version: '3.0'
|
|
136
164
|
- !ruby/object:Gem::Dependency
|
|
137
165
|
name: pry
|
|
138
166
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -161,16 +189,27 @@ files:
|
|
|
161
189
|
- lib/jpsclient.rb
|
|
162
190
|
- lib/jpsclient/api/app_level.rb
|
|
163
191
|
- lib/jpsclient/api/app_resource.rb
|
|
164
|
-
- lib/jpsclient/api/app_resource_version.rb
|
|
165
192
|
- lib/jpsclient/api/apple_account.rb
|
|
166
193
|
- lib/jpsclient/api/application.rb
|
|
167
|
-
- lib/jpsclient/api/application_category.rb
|
|
168
|
-
- lib/jpsclient/api/application_design.rb
|
|
169
194
|
- lib/jpsclient/api/application_income.rb
|
|
170
195
|
- lib/jpsclient/api/application_sales.rb
|
|
171
196
|
- lib/jpsclient/api/application_version.rb
|
|
172
|
-
- lib/jpsclient/api/
|
|
197
|
+
- lib/jpsclient/api/archived_outdated/app_resource_version.rb
|
|
198
|
+
- lib/jpsclient/api/archived_outdated/application_category.rb
|
|
199
|
+
- lib/jpsclient/api/archived_outdated/application_design.rb
|
|
200
|
+
- lib/jpsclient/api/archived_outdated/assets_category.rb
|
|
201
|
+
- lib/jpsclient/api/archived_outdated/experience.rb
|
|
202
|
+
- lib/jpsclient/api/archived_outdated/experience_category.rb
|
|
203
|
+
- lib/jpsclient/api/archived_outdated/icon_and_snapshot.rb
|
|
204
|
+
- lib/jpsclient/api/archived_outdated/publisher_category.rb
|
|
205
|
+
- lib/jpsclient/api/archived_outdated/publisher_group_category.rb
|
|
206
|
+
- lib/jpsclient/api/archived_outdated/requirements_category.rb
|
|
207
|
+
- lib/jpsclient/api/archived_outdated/resource_category.rb
|
|
208
|
+
- lib/jpsclient/api/archived_outdated/sketch_category.rb
|
|
209
|
+
- lib/jpsclient/api/archived_outdated/survey_category.rb
|
|
210
|
+
- lib/jpsclient/api/archived_outdated/tool_category.rb
|
|
173
211
|
- lib/jpsclient/api/bug.rb
|
|
212
|
+
- lib/jpsclient/api/category.rb
|
|
174
213
|
- lib/jpsclient/api/cert.rb
|
|
175
214
|
- lib/jpsclient/api/client.rb
|
|
176
215
|
- lib/jpsclient/api/collect.rb
|
|
@@ -179,19 +218,23 @@ files:
|
|
|
179
218
|
- lib/jpsclient/api/creative.rb
|
|
180
219
|
- lib/jpsclient/api/custom_application.rb
|
|
181
220
|
- lib/jpsclient/api/custom_application_web.rb
|
|
221
|
+
- lib/jpsclient/api/design.rb
|
|
182
222
|
- lib/jpsclient/api/document_text.rb
|
|
183
|
-
- lib/jpsclient/api/experience.rb
|
|
184
|
-
- lib/jpsclient/api/experience_category.rb
|
|
185
223
|
- lib/jpsclient/api/fgui_export.rb
|
|
186
224
|
- lib/jpsclient/api/file.rb
|
|
187
225
|
- lib/jpsclient/api/game_assets.rb
|
|
188
226
|
- lib/jpsclient/api/healthy.rb
|
|
189
|
-
- lib/jpsclient/api/icon_and_snapshot.rb
|
|
190
227
|
- lib/jpsclient/api/idea.rb
|
|
191
|
-
- lib/jpsclient/api/
|
|
228
|
+
- lib/jpsclient/api/image_search.rb
|
|
229
|
+
- lib/jpsclient/api/js_sdk.rb
|
|
192
230
|
- lib/jpsclient/api/lark_bitable.rb
|
|
231
|
+
- lib/jpsclient/api/lark_card_message.rb
|
|
193
232
|
- lib/jpsclient/api/lark_chat_group.rb
|
|
194
233
|
- lib/jpsclient/api/lark_comment.rb
|
|
234
|
+
- lib/jpsclient/api/lark_department.rb
|
|
235
|
+
- lib/jpsclient/api/lark_file.rb
|
|
236
|
+
- lib/jpsclient/api/lark_leave_approval.rb
|
|
237
|
+
- lib/jpsclient/api/lark_message.rb
|
|
195
238
|
- lib/jpsclient/api/lark_task.rb
|
|
196
239
|
- lib/jpsclient/api/lark_task_list.rb
|
|
197
240
|
- lib/jpsclient/api/lark_task_section.rb
|
|
@@ -203,27 +246,23 @@ files:
|
|
|
203
246
|
- lib/jpsclient/api/m3u8.rb
|
|
204
247
|
- lib/jpsclient/api/menu.rb
|
|
205
248
|
- lib/jpsclient/api/modular_client.rb
|
|
249
|
+
- lib/jpsclient/api/nuget.rb
|
|
250
|
+
- lib/jpsclient/api/permission.rb
|
|
206
251
|
- lib/jpsclient/api/project.rb
|
|
207
252
|
- lib/jpsclient/api/project_package.rb
|
|
208
253
|
- lib/jpsclient/api/publisher.rb
|
|
209
|
-
- lib/jpsclient/api/publisher_category.rb
|
|
210
254
|
- lib/jpsclient/api/publisher_group.rb
|
|
211
|
-
- lib/jpsclient/api/publisher_group_category.rb
|
|
212
255
|
- lib/jpsclient/api/requirements.rb
|
|
213
|
-
- lib/jpsclient/api/requirements_category.rb
|
|
214
|
-
- lib/jpsclient/api/resource_category.rb
|
|
215
256
|
- lib/jpsclient/api/role.rb
|
|
216
257
|
- lib/jpsclient/api/simple_search.rb
|
|
217
258
|
- lib/jpsclient/api/sketch.rb
|
|
218
|
-
- lib/jpsclient/api/sketch_category.rb
|
|
219
259
|
- lib/jpsclient/api/sov.rb
|
|
220
260
|
- lib/jpsclient/api/statistics.rb
|
|
221
261
|
- lib/jpsclient/api/store.rb
|
|
222
262
|
- lib/jpsclient/api/survey.rb
|
|
223
|
-
- lib/jpsclient/api/survey_category.rb
|
|
224
263
|
- lib/jpsclient/api/tag.rb
|
|
264
|
+
- lib/jpsclient/api/template.rb
|
|
225
265
|
- lib/jpsclient/api/tool.rb
|
|
226
|
-
- lib/jpsclient/api/tool_category.rb
|
|
227
266
|
- lib/jpsclient/api/trending.rb
|
|
228
267
|
- lib/jpsclient/api/ud_id.rb
|
|
229
268
|
- lib/jpsclient/api/user.rb
|
|
@@ -263,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
263
302
|
- !ruby/object:Gem::Version
|
|
264
303
|
version: '0'
|
|
265
304
|
requirements: []
|
|
266
|
-
rubygems_version: 3.6.
|
|
305
|
+
rubygems_version: 3.6.9
|
|
267
306
|
specification_version: 4
|
|
268
307
|
summary: JPS Platform API Client with Full API Support
|
|
269
308
|
test_files: []
|
/data/lib/jpsclient/api/{app_resource_version.rb → archived_outdated/app_resource_version.rb}
RENAMED
|
File without changes
|
/data/lib/jpsclient/api/{application_category.rb → archived_outdated/application_category.rb}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/data/lib/jpsclient/api/{requirements_category.rb → archived_outdated/requirements_category.rb}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|