jpsclient 0.2.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 +7 -0
- data/LICENSE +21 -0
- data/bin/jpsclient +28 -0
- data/lib/jpsclient/api/app_level.rb +138 -0
- data/lib/jpsclient/api/app_resource.rb +164 -0
- data/lib/jpsclient/api/app_resource_version.rb +52 -0
- data/lib/jpsclient/api/apple_account.rb +140 -0
- data/lib/jpsclient/api/application.rb +268 -0
- data/lib/jpsclient/api/application_category.rb +120 -0
- data/lib/jpsclient/api/application_design.rb +118 -0
- data/lib/jpsclient/api/application_income.rb +54 -0
- data/lib/jpsclient/api/application_sales.rb +52 -0
- data/lib/jpsclient/api/application_version.rb +77 -0
- data/lib/jpsclient/api/assets_category.rb +120 -0
- data/lib/jpsclient/api/bug.rb +140 -0
- data/lib/jpsclient/api/cert.rb +27 -0
- data/lib/jpsclient/api/client.rb +268 -0
- data/lib/jpsclient/api/collect.rb +52 -0
- data/lib/jpsclient/api/collection.rb +162 -0
- data/lib/jpsclient/api/commit_log.rb +104 -0
- data/lib/jpsclient/api/creative.rb +52 -0
- data/lib/jpsclient/api/custom_application.rb +230 -0
- data/lib/jpsclient/api/custom_application_web.rb +52 -0
- data/lib/jpsclient/api/document_text.rb +30 -0
- data/lib/jpsclient/api/experience.rb +143 -0
- data/lib/jpsclient/api/experience_category.rb +97 -0
- data/lib/jpsclient/api/fgui_export.rb +52 -0
- data/lib/jpsclient/api/file.rb +84 -0
- data/lib/jpsclient/api/game_assets.rb +140 -0
- data/lib/jpsclient/api/healthy.rb +30 -0
- data/lib/jpsclient/api/icon_and_snapshot.rb +54 -0
- data/lib/jpsclient/api/idea.rb +121 -0
- data/lib/jpsclient/api/jssdk.rb +30 -0
- data/lib/jpsclient/api/lark_bitable.rb +30 -0
- data/lib/jpsclient/api/lark_chat_group.rb +30 -0
- data/lib/jpsclient/api/lark_comment.rb +118 -0
- data/lib/jpsclient/api/lark_task.rb +140 -0
- data/lib/jpsclient/api/lark_task_list.rb +118 -0
- data/lib/jpsclient/api/lark_task_section.rb +74 -0
- data/lib/jpsclient/api/lark_user.rb +30 -0
- data/lib/jpsclient/api/lark_wiki_node.rb +30 -0
- data/lib/jpsclient/api/lark_wiki_space.rb +30 -0
- data/lib/jpsclient/api/lazy_client.rb +290 -0
- data/lib/jpsclient/api/login.rb +96 -0
- data/lib/jpsclient/api/m3u8.rb +30 -0
- data/lib/jpsclient/api/menu.rb +143 -0
- data/lib/jpsclient/api/modular_client.rb +228 -0
- data/lib/jpsclient/api/project.rb +46 -0
- data/lib/jpsclient/api/project_package.rb +249 -0
- data/lib/jpsclient/api/publisher.rb +165 -0
- data/lib/jpsclient/api/publisher_category.rb +142 -0
- data/lib/jpsclient/api/publisher_group.rb +118 -0
- data/lib/jpsclient/api/publisher_group_category.rb +120 -0
- data/lib/jpsclient/api/requirements.rb +143 -0
- data/lib/jpsclient/api/requirements_category.rb +97 -0
- data/lib/jpsclient/api/resource_category.rb +120 -0
- data/lib/jpsclient/api/role.rb +165 -0
- data/lib/jpsclient/api/simple_search.rb +162 -0
- data/lib/jpsclient/api/sketch.rb +74 -0
- data/lib/jpsclient/api/sketch_category.rb +97 -0
- data/lib/jpsclient/api/sov.rb +30 -0
- data/lib/jpsclient/api/statistics.rb +30 -0
- data/lib/jpsclient/api/store.rb +30 -0
- data/lib/jpsclient/api/survey.rb +143 -0
- data/lib/jpsclient/api/survey_category.rb +97 -0
- data/lib/jpsclient/api/tag.rb +142 -0
- data/lib/jpsclient/api/tool.rb +121 -0
- data/lib/jpsclient/api/tool_category.rb +120 -0
- data/lib/jpsclient/api/trending.rb +30 -0
- data/lib/jpsclient/api/ud_id.rb +118 -0
- data/lib/jpsclient/api/user.rb +99 -0
- data/lib/jpsclient/api/util.rb +30 -0
- data/lib/jpsclient/api/video_cover.rb +30 -0
- data/lib/jpsclient/api/webhook.rb +118 -0
- data/lib/jpsclient/api/workflow.rb +118 -0
- data/lib/jpsclient/auth/auth.rb +676 -0
- data/lib/jpsclient/auth/token.rb +209 -0
- data/lib/jpsclient/base/api_config.rb +225 -0
- data/lib/jpsclient/base/exception.rb +5 -0
- data/lib/jpsclient/http/http_client.rb +148 -0
- data/lib/jpsclient/upload/upload_client.rb +334 -0
- data/lib/jpsclient/upload/upload_config.rb +128 -0
- data/lib/jpsclient/upload/upload_progress.rb +73 -0
- data/lib/jpsclient/utils/aes.rb +49 -0
- data/lib/jpsclient/utils/logger.rb +38 -0
- data/lib/jpsclient/version.rb +3 -0
- data/lib/jpsclient.rb +34 -0
- metadata +269 -0
@@ -0,0 +1,162 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Collection 相关 API
|
4
|
+
# 自动生成的模块,处理 collection 相关接口
|
5
|
+
module Collection
|
6
|
+
|
7
|
+
# Create Upload Zip
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_upload_zip(params: {})
|
12
|
+
config = @request_config && @request_config["collection_upload_zip"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for collection_upload_zip" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Create Update
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def create_update(params: {})
|
34
|
+
config = @request_config && @request_config["collection_update"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for collection_update" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.post(path, body: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.post(path, body: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
|
51
|
+
# Get List
|
52
|
+
#
|
53
|
+
# @param params [Hash] 请求参数
|
54
|
+
# @return [Hash] API响应
|
55
|
+
def get_list(params: {})
|
56
|
+
config = @request_config && @request_config["collection_list"]
|
57
|
+
raise JPSClient::ExceptionError, "Missing config for collection_list" unless config && config["url"]
|
58
|
+
|
59
|
+
path = config["url"]
|
60
|
+
|
61
|
+
response = @http_client.post(path, body: params)
|
62
|
+
result = JPSClient::Response.new(response)
|
63
|
+
|
64
|
+
if result.need_login?
|
65
|
+
do_login(force_login: true)
|
66
|
+
response = @http_client.post(path, body: params)
|
67
|
+
result = JPSClient::Response.new(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
return result.to_h
|
71
|
+
end
|
72
|
+
|
73
|
+
# Create Detail
|
74
|
+
#
|
75
|
+
# @param params [Hash] 请求参数
|
76
|
+
# @return [Hash] API响应
|
77
|
+
def create_detail(params: {})
|
78
|
+
config = @request_config && @request_config["collection_detail"]
|
79
|
+
raise JPSClient::ExceptionError, "Missing config for collection_detail" unless config && config["url"]
|
80
|
+
|
81
|
+
path = config["url"]
|
82
|
+
|
83
|
+
response = @http_client.post(path, body: params)
|
84
|
+
result = JPSClient::Response.new(response)
|
85
|
+
|
86
|
+
if result.need_login?
|
87
|
+
do_login(force_login: true)
|
88
|
+
response = @http_client.post(path, body: params)
|
89
|
+
result = JPSClient::Response.new(response)
|
90
|
+
end
|
91
|
+
|
92
|
+
return result.to_h
|
93
|
+
end
|
94
|
+
|
95
|
+
# Create Delete
|
96
|
+
#
|
97
|
+
# @param params [Hash] 请求参数
|
98
|
+
# @return [Hash] API响应
|
99
|
+
def create_delete(params: {})
|
100
|
+
config = @request_config && @request_config["collection_delete"]
|
101
|
+
raise JPSClient::ExceptionError, "Missing config for collection_delete" unless config && config["url"]
|
102
|
+
|
103
|
+
path = config["url"]
|
104
|
+
|
105
|
+
response = @http_client.post(path, body: params)
|
106
|
+
result = JPSClient::Response.new(response)
|
107
|
+
|
108
|
+
if result.need_login?
|
109
|
+
do_login(force_login: true)
|
110
|
+
response = @http_client.post(path, body: params)
|
111
|
+
result = JPSClient::Response.new(response)
|
112
|
+
end
|
113
|
+
|
114
|
+
return result.to_h
|
115
|
+
end
|
116
|
+
|
117
|
+
# Create Create
|
118
|
+
#
|
119
|
+
# @param params [Hash] 请求参数
|
120
|
+
# @return [Hash] API响应
|
121
|
+
def create_create(params: {})
|
122
|
+
config = @request_config && @request_config["collection_create"]
|
123
|
+
raise JPSClient::ExceptionError, "Missing config for collection_create" unless config && config["url"]
|
124
|
+
|
125
|
+
path = config["url"]
|
126
|
+
|
127
|
+
response = @http_client.post(path, body: params)
|
128
|
+
result = JPSClient::Response.new(response)
|
129
|
+
|
130
|
+
if result.need_login?
|
131
|
+
do_login(force_login: true)
|
132
|
+
response = @http_client.post(path, body: params)
|
133
|
+
result = JPSClient::Response.new(response)
|
134
|
+
end
|
135
|
+
|
136
|
+
return result.to_h
|
137
|
+
end
|
138
|
+
|
139
|
+
# Create Bind
|
140
|
+
#
|
141
|
+
# @param params [Hash] 请求参数
|
142
|
+
# @return [Hash] API响应
|
143
|
+
def create_bind(params: {})
|
144
|
+
config = @request_config && @request_config["collection_bind"]
|
145
|
+
raise JPSClient::ExceptionError, "Missing config for collection_bind" unless config && config["url"]
|
146
|
+
|
147
|
+
path = config["url"]
|
148
|
+
|
149
|
+
response = @http_client.post(path, body: params)
|
150
|
+
result = JPSClient::Response.new(response)
|
151
|
+
|
152
|
+
if result.need_login?
|
153
|
+
do_login(force_login: true)
|
154
|
+
response = @http_client.post(path, body: params)
|
155
|
+
result = JPSClient::Response.new(response)
|
156
|
+
end
|
157
|
+
|
158
|
+
return result.to_h
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# 提交记录管理相关 API
|
4
|
+
# 处理 /api/commit_log/* 路径的所有接口
|
5
|
+
module CommitLog
|
6
|
+
|
7
|
+
# 发送提交记录消息通知
|
8
|
+
#
|
9
|
+
# @param projectId [String] 项目ID(必需)
|
10
|
+
# @param commitIds [Array<String>] 提交ID数组(必需)
|
11
|
+
# @param params [Hash] 其他参数
|
12
|
+
# @option params [Boolean] :single 是否单个提交(默认 true)
|
13
|
+
# @option params [String] :branch 分支名称,多个分支用逗号分隔
|
14
|
+
# @option params [Integer] :indexNo 索引号
|
15
|
+
# @option params [Integer] :workflowId 工作流ID
|
16
|
+
# @return [Hash] API响应
|
17
|
+
def send_commit_log_message(projectId:, commitIds:, params: {})
|
18
|
+
config = @request_config && @request_config["commit_log_send_message"]
|
19
|
+
raise JPSClient::ExceptionError, "Missing config for commit_log_send_message" unless config && config["url"]
|
20
|
+
path = config["url"]
|
21
|
+
|
22
|
+
body_params = {
|
23
|
+
projectId: projectId,
|
24
|
+
commitIds: commitIds,
|
25
|
+
single: params[:single] || true
|
26
|
+
}
|
27
|
+
|
28
|
+
# 添加可选参数
|
29
|
+
body_params[:branch] = params[:branch] if params[:branch]
|
30
|
+
body_params[:indexNo] = params[:indexNo] if params[:indexNo]
|
31
|
+
body_params[:workflowId] = params[:workflowId] if params[:workflowId]
|
32
|
+
|
33
|
+
response = @http_client.post(path, body: body_params)
|
34
|
+
result = JPSClient::Response.new(response)
|
35
|
+
|
36
|
+
# 处理 401 错误,自动重新登录
|
37
|
+
if result.need_login?
|
38
|
+
do_login(force_login: true)
|
39
|
+
# 重试请求
|
40
|
+
response = @http_client.post(path, body: body_params)
|
41
|
+
result = JPSClient::Response.new(response)
|
42
|
+
end
|
43
|
+
|
44
|
+
return result.to_h
|
45
|
+
end
|
46
|
+
|
47
|
+
# 获取提交记录列表(如果有这个接口)
|
48
|
+
def get_commit_log_list(projectId:, params: {})
|
49
|
+
config = @request_config && @request_config["commit_log_list"]
|
50
|
+
raise JPSClient::ExceptionError, "Missing config for commit_log_list" unless config && config["url"]
|
51
|
+
path = config["url"]
|
52
|
+
|
53
|
+
get_params = {
|
54
|
+
projectId: projectId,
|
55
|
+
pageNo: params[:pageNo] || 1,
|
56
|
+
pageSize: params[:pageSize] || 20
|
57
|
+
}
|
58
|
+
|
59
|
+
# 添加可选的筛选参数
|
60
|
+
get_params[:branch] = params[:branch] if params[:branch]
|
61
|
+
get_params[:author] = params[:author] if params[:author]
|
62
|
+
get_params[:startTime] = params[:startTime] if params[:startTime]
|
63
|
+
get_params[:endTime] = params[:endTime] if params[:endTime]
|
64
|
+
|
65
|
+
response = @http_client.get(path, params: get_params)
|
66
|
+
result = JPSClient::Response.new(response)
|
67
|
+
|
68
|
+
# 处理 401 错误
|
69
|
+
if result.need_login?
|
70
|
+
do_login(force_login: true)
|
71
|
+
response = @http_client.get(path, params: get_params)
|
72
|
+
result = JPSClient::Response.new(response)
|
73
|
+
end
|
74
|
+
|
75
|
+
return result.to_h
|
76
|
+
end
|
77
|
+
|
78
|
+
# 获取单个提交记录详情
|
79
|
+
def get_commit_log_detail(projectId:, commitId:)
|
80
|
+
config = @request_config && @request_config["commit_log_detail"]
|
81
|
+
raise JPSClient::ExceptionError, "Missing config for commit_log_detail" unless config && config["url"]
|
82
|
+
path = config["url"]
|
83
|
+
|
84
|
+
get_params = {
|
85
|
+
projectId: projectId,
|
86
|
+
commitId: commitId
|
87
|
+
}
|
88
|
+
|
89
|
+
response = @http_client.get(path, params: get_params)
|
90
|
+
result = JPSClient::Response.new(response)
|
91
|
+
|
92
|
+
# 处理 401 错误
|
93
|
+
if result.need_login?
|
94
|
+
do_login(force_login: true)
|
95
|
+
response = @http_client.get(path, params: get_params)
|
96
|
+
result = JPSClient::Response.new(response)
|
97
|
+
end
|
98
|
+
|
99
|
+
return result.to_h
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Creative 相关 API
|
4
|
+
# 自动生成的模块,处理 creative 相关接口
|
5
|
+
module Creative
|
6
|
+
|
7
|
+
# Create Creatives
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_creatives(params: {})
|
12
|
+
config = @request_config && @request_config["creative_creatives"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for creative_creatives" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Get Top Publishers
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def get_top_publishers(params: {})
|
34
|
+
config = @request_config && @request_config["creative_top_publishers"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for creative_top_publishers" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.get(path, params: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.get(path, params: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,230 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# CustomApplication 相关 API
|
4
|
+
# 自动生成的模块,处理 custom_application 相关接口
|
5
|
+
module CustomApplication
|
6
|
+
|
7
|
+
# Update Custom Application
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def update_custom_application(customApplicationId:, params: {})
|
12
|
+
config = @request_config && @request_config["custom_application_custom_application"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_custom_application" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
path = path.gsub("{customApplicationId}", customApplicationId.to_s)
|
17
|
+
|
18
|
+
response = @http_client.put(path, body: params)
|
19
|
+
result = JPSClient::Response.new(response)
|
20
|
+
|
21
|
+
if result.need_login?
|
22
|
+
do_login(force_login: true)
|
23
|
+
response = @http_client.put(path, body: params)
|
24
|
+
result = JPSClient::Response.new(response)
|
25
|
+
end
|
26
|
+
|
27
|
+
return result.to_h
|
28
|
+
end
|
29
|
+
|
30
|
+
# Delete Custom Application
|
31
|
+
#
|
32
|
+
# @param params [Hash] 请求参数
|
33
|
+
# @return [Hash] API响应
|
34
|
+
def delete_custom_application(customApplicationId:, params: {})
|
35
|
+
config = @request_config && @request_config["custom_application_custom_application"]
|
36
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_custom_application" unless config && config["url"]
|
37
|
+
|
38
|
+
path = config["url"]
|
39
|
+
path = path.gsub("{customApplicationId}", customApplicationId.to_s)
|
40
|
+
|
41
|
+
response = @http_client.delete(path)
|
42
|
+
result = JPSClient::Response.new(response)
|
43
|
+
|
44
|
+
if result.need_login?
|
45
|
+
do_login(force_login: true)
|
46
|
+
response = @http_client.delete(path)
|
47
|
+
result = JPSClient::Response.new(response)
|
48
|
+
end
|
49
|
+
|
50
|
+
return result.to_h
|
51
|
+
end
|
52
|
+
|
53
|
+
# Get Custom Application
|
54
|
+
#
|
55
|
+
# @param params [Hash] 请求参数
|
56
|
+
# @return [Hash] API响应
|
57
|
+
def get_custom_application(params: {})
|
58
|
+
config = @request_config && @request_config["custom_application_custom_application"]
|
59
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_custom_application" unless config && config["url"]
|
60
|
+
|
61
|
+
path = config["url"]
|
62
|
+
|
63
|
+
response = @http_client.get(path, params: params)
|
64
|
+
result = JPSClient::Response.new(response)
|
65
|
+
|
66
|
+
if result.need_login?
|
67
|
+
do_login(force_login: true)
|
68
|
+
response = @http_client.get(path, params: params)
|
69
|
+
result = JPSClient::Response.new(response)
|
70
|
+
end
|
71
|
+
|
72
|
+
return result.to_h
|
73
|
+
end
|
74
|
+
|
75
|
+
# Create Custom Application
|
76
|
+
#
|
77
|
+
# @param params [Hash] 请求参数
|
78
|
+
# @return [Hash] API响应
|
79
|
+
def create_custom_application(params: {})
|
80
|
+
config = @request_config && @request_config["custom_application_custom_application"]
|
81
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_custom_application" unless config && config["url"]
|
82
|
+
|
83
|
+
path = config["url"]
|
84
|
+
|
85
|
+
response = @http_client.post(path, body: params)
|
86
|
+
result = JPSClient::Response.new(response)
|
87
|
+
|
88
|
+
if result.need_login?
|
89
|
+
do_login(force_login: true)
|
90
|
+
response = @http_client.post(path, body: params)
|
91
|
+
result = JPSClient::Response.new(response)
|
92
|
+
end
|
93
|
+
|
94
|
+
return result.to_h
|
95
|
+
end
|
96
|
+
|
97
|
+
# Create Websites
|
98
|
+
#
|
99
|
+
# @param params [Hash] 请求参数
|
100
|
+
# @return [Hash] API响应
|
101
|
+
def create_websites(params: {})
|
102
|
+
config = @request_config && @request_config["custom_application_websites"]
|
103
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_websites" unless config && config["url"]
|
104
|
+
|
105
|
+
path = config["url"]
|
106
|
+
|
107
|
+
response = @http_client.post(path, body: params)
|
108
|
+
result = JPSClient::Response.new(response)
|
109
|
+
|
110
|
+
if result.need_login?
|
111
|
+
do_login(force_login: true)
|
112
|
+
response = @http_client.post(path, body: params)
|
113
|
+
result = JPSClient::Response.new(response)
|
114
|
+
end
|
115
|
+
|
116
|
+
return result.to_h
|
117
|
+
end
|
118
|
+
|
119
|
+
# Create Stories
|
120
|
+
#
|
121
|
+
# @param params [Hash] 请求参数
|
122
|
+
# @return [Hash] API响应
|
123
|
+
def create_stories(params: {})
|
124
|
+
config = @request_config && @request_config["custom_application_stories"]
|
125
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_stories" unless config && config["url"]
|
126
|
+
|
127
|
+
path = config["url"]
|
128
|
+
|
129
|
+
response = @http_client.post(path, body: params)
|
130
|
+
result = JPSClient::Response.new(response)
|
131
|
+
|
132
|
+
if result.need_login?
|
133
|
+
do_login(force_login: true)
|
134
|
+
response = @http_client.post(path, body: params)
|
135
|
+
result = JPSClient::Response.new(response)
|
136
|
+
end
|
137
|
+
|
138
|
+
return result.to_h
|
139
|
+
end
|
140
|
+
|
141
|
+
# Get Snapshots List
|
142
|
+
#
|
143
|
+
# @param params [Hash] 请求参数
|
144
|
+
# @return [Hash] API响应
|
145
|
+
def get_snapshots_list(params: {})
|
146
|
+
config = @request_config && @request_config["custom_application_snapshots_list"]
|
147
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_snapshots_list" unless config && config["url"]
|
148
|
+
|
149
|
+
path = config["url"]
|
150
|
+
|
151
|
+
response = @http_client.post(path, body: params)
|
152
|
+
result = JPSClient::Response.new(response)
|
153
|
+
|
154
|
+
if result.need_login?
|
155
|
+
do_login(force_login: true)
|
156
|
+
response = @http_client.post(path, body: params)
|
157
|
+
result = JPSClient::Response.new(response)
|
158
|
+
end
|
159
|
+
|
160
|
+
return result.to_h
|
161
|
+
end
|
162
|
+
|
163
|
+
# Create Icons
|
164
|
+
#
|
165
|
+
# @param params [Hash] 请求参数
|
166
|
+
# @return [Hash] API响应
|
167
|
+
def create_icons(params: {})
|
168
|
+
config = @request_config && @request_config["custom_application_icons"]
|
169
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_icons" unless config && config["url"]
|
170
|
+
|
171
|
+
path = config["url"]
|
172
|
+
|
173
|
+
response = @http_client.post(path, body: params)
|
174
|
+
result = JPSClient::Response.new(response)
|
175
|
+
|
176
|
+
if result.need_login?
|
177
|
+
do_login(force_login: true)
|
178
|
+
response = @http_client.post(path, body: params)
|
179
|
+
result = JPSClient::Response.new(response)
|
180
|
+
end
|
181
|
+
|
182
|
+
return result.to_h
|
183
|
+
end
|
184
|
+
|
185
|
+
# Create Check Website
|
186
|
+
#
|
187
|
+
# @param params [Hash] 请求参数
|
188
|
+
# @return [Hash] API响应
|
189
|
+
def create_check_website(params: {})
|
190
|
+
config = @request_config && @request_config["custom_application_check_website"]
|
191
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_check_website" unless config && config["url"]
|
192
|
+
|
193
|
+
path = config["url"]
|
194
|
+
|
195
|
+
response = @http_client.post(path, body: params)
|
196
|
+
result = JPSClient::Response.new(response)
|
197
|
+
|
198
|
+
if result.need_login?
|
199
|
+
do_login(force_login: true)
|
200
|
+
response = @http_client.post(path, body: params)
|
201
|
+
result = JPSClient::Response.new(response)
|
202
|
+
end
|
203
|
+
|
204
|
+
return result.to_h
|
205
|
+
end
|
206
|
+
|
207
|
+
# Get Story Info
|
208
|
+
#
|
209
|
+
# @param params [Hash] 请求参数
|
210
|
+
# @return [Hash] API响应
|
211
|
+
def get_story_info(params: {})
|
212
|
+
config = @request_config && @request_config["custom_application_story_info"]
|
213
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_story_info" unless config && config["url"]
|
214
|
+
|
215
|
+
path = config["url"]
|
216
|
+
|
217
|
+
response = @http_client.get(path, params: params)
|
218
|
+
result = JPSClient::Response.new(response)
|
219
|
+
|
220
|
+
if result.need_login?
|
221
|
+
do_login(force_login: true)
|
222
|
+
response = @http_client.get(path, params: params)
|
223
|
+
result = JPSClient::Response.new(response)
|
224
|
+
end
|
225
|
+
|
226
|
+
return result.to_h
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# CustomApplicationWeb 相关 API
|
4
|
+
# 自动生成的模块,处理 custom_application_web 相关接口
|
5
|
+
module CustomApplicationWeb
|
6
|
+
|
7
|
+
# Create Html Website
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_html_website(params: {})
|
12
|
+
config = @request_config && @request_config["custom_application_web_html_website"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_web_html_website" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Get All Websites
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def get_all_websites(params: {})
|
34
|
+
config = @request_config && @request_config["custom_application_web_all_websites"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for custom_application_web_all_websites" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.get(path, params: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.get(path, params: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# DocumentText 相关 API
|
4
|
+
# 自动生成的模块,处理 document_text 相关接口
|
5
|
+
module DocumentText
|
6
|
+
|
7
|
+
# Get Text
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def get_text(params: {})
|
12
|
+
config = @request_config && @request_config["document_text_text"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for document_text_text" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.get(path, params: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.get(path, params: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|