jpsclient 2.2.0 → 2.3.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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jpsclient/api/android_jks.rb +7 -70
  3. data/lib/jpsclient/api/app_level.rb +6 -60
  4. data/lib/jpsclient/api/app_resource.rb +7 -70
  5. data/lib/jpsclient/api/apple_account.rb +6 -60
  6. data/lib/jpsclient/api/apple_bundle_id.rb +1 -11
  7. data/lib/jpsclient/api/apple_cert.rb +1 -11
  8. data/lib/jpsclient/api/apple_profile.rb +1 -11
  9. data/lib/jpsclient/api/application.rb +12 -121
  10. data/lib/jpsclient/api/application_income.rb +2 -20
  11. data/lib/jpsclient/api/application_sales.rb +2 -20
  12. data/lib/jpsclient/api/application_version.rb +3 -30
  13. data/lib/jpsclient/api/archived_outdated/app_resource_version.rb +2 -20
  14. data/lib/jpsclient/api/archived_outdated/application_category.rb +5 -50
  15. data/lib/jpsclient/api/archived_outdated/application_design.rb +5 -50
  16. data/lib/jpsclient/api/archived_outdated/assets_category.rb +5 -50
  17. data/lib/jpsclient/api/archived_outdated/experience.rb +6 -60
  18. data/lib/jpsclient/api/archived_outdated/experience_category.rb +4 -40
  19. data/lib/jpsclient/api/archived_outdated/icon_and_snapshot.rb +2 -20
  20. data/lib/jpsclient/api/archived_outdated/publisher_category.rb +6 -60
  21. data/lib/jpsclient/api/archived_outdated/publisher_group_category.rb +5 -50
  22. data/lib/jpsclient/api/archived_outdated/requirements_category.rb +4 -40
  23. data/lib/jpsclient/api/archived_outdated/resource_category.rb +5 -50
  24. data/lib/jpsclient/api/archived_outdated/sketch_category.rb +4 -40
  25. data/lib/jpsclient/api/archived_outdated/survey_category.rb +4 -40
  26. data/lib/jpsclient/api/archived_outdated/tool_category.rb +5 -50
  27. data/lib/jpsclient/api/bug.rb +6 -60
  28. data/lib/jpsclient/api/category.rb +6 -60
  29. data/lib/jpsclient/api/cert.rb +1 -12
  30. data/lib/jpsclient/api/collect.rb +2 -20
  31. data/lib/jpsclient/api/collection.rb +7 -70
  32. data/lib/jpsclient/api/commit_log.rb +5 -52
  33. data/lib/jpsclient/api/creative.rb +2 -20
  34. data/lib/jpsclient/api/custom_application.rb +10 -100
  35. data/lib/jpsclient/api/custom_application_web.rb +2 -20
  36. data/lib/jpsclient/api/design.rb +5 -50
  37. data/lib/jpsclient/api/document_text.rb +1 -10
  38. data/lib/jpsclient/api/fgui_export.rb +2 -20
  39. data/lib/jpsclient/api/file.rb +4 -41
  40. data/lib/jpsclient/api/game_assets.rb +6 -60
  41. data/lib/jpsclient/api/healthy.rb +1 -10
  42. data/lib/jpsclient/api/idea.rb +5 -50
  43. data/lib/jpsclient/api/image_search.rb +2 -20
  44. data/lib/jpsclient/api/js_sdk.rb +1 -10
  45. data/lib/jpsclient/api/lark_bitable.rb +1 -10
  46. data/lib/jpsclient/api/lark_card_message.rb +1 -10
  47. data/lib/jpsclient/api/lark_chat_group.rb +1 -10
  48. data/lib/jpsclient/api/lark_comment.rb +5 -50
  49. data/lib/jpsclient/api/lark_department.rb +1 -10
  50. data/lib/jpsclient/api/lark_file.rb +1 -10
  51. data/lib/jpsclient/api/lark_leave_approval.rb +1 -10
  52. data/lib/jpsclient/api/lark_message.rb +1 -10
  53. data/lib/jpsclient/api/lark_task.rb +6 -60
  54. data/lib/jpsclient/api/lark_task_list.rb +5 -50
  55. data/lib/jpsclient/api/lark_task_section.rb +3 -30
  56. data/lib/jpsclient/api/lark_user.rb +1 -10
  57. data/lib/jpsclient/api/lark_wiki_node.rb +1 -10
  58. data/lib/jpsclient/api/lark_wiki_space.rb +1 -10
  59. data/lib/jpsclient/api/lazy_client.rb +39 -39
  60. data/lib/jpsclient/api/login.rb +4 -40
  61. data/lib/jpsclient/api/m3u8.rb +1 -10
  62. data/lib/jpsclient/api/menu.rb +6 -60
  63. data/lib/jpsclient/api/modular_client.rb +38 -38
  64. data/lib/jpsclient/api/nuget.rb +1 -10
  65. data/lib/jpsclient/api/permission.rb +5 -50
  66. data/lib/jpsclient/api/project.rb +2 -22
  67. data/lib/jpsclient/api/project_package.rb +9 -121
  68. data/lib/jpsclient/api/publisher.rb +7 -70
  69. data/lib/jpsclient/api/publisher_group.rb +5 -50
  70. data/lib/jpsclient/api/requirements.rb +6 -60
  71. data/lib/jpsclient/api/role.rb +7 -70
  72. data/lib/jpsclient/api/simple_search.rb +7 -70
  73. data/lib/jpsclient/api/sketch.rb +3 -30
  74. data/lib/jpsclient/api/sov.rb +1 -10
  75. data/lib/jpsclient/api/statistics.rb +1 -10
  76. data/lib/jpsclient/api/store.rb +1 -10
  77. data/lib/jpsclient/api/survey.rb +6 -60
  78. data/lib/jpsclient/api/tag.rb +6 -60
  79. data/lib/jpsclient/api/template.rb +5 -50
  80. data/lib/jpsclient/api/tool.rb +5 -50
  81. data/lib/jpsclient/api/trending.rb +1 -10
  82. data/lib/jpsclient/api/ud_id.rb +5 -50
  83. data/lib/jpsclient/api/user.rb +4 -40
  84. data/lib/jpsclient/api/util.rb +1 -10
  85. data/lib/jpsclient/api/video_cover.rb +1 -10
  86. data/lib/jpsclient/api/webhook.rb +5 -50
  87. data/lib/jpsclient/api/workflow.rb +5 -50
  88. data/lib/jpsclient/auth/auth.rb +21 -31
  89. data/lib/jpsclient/auth/token.rb +49 -95
  90. data/lib/jpsclient/base/client.rb +43 -38
  91. data/lib/jpsclient/http/http_client.rb +18 -2
  92. data/lib/jpsclient/version.rb +1 -1
  93. metadata +15 -1
@@ -15,16 +15,7 @@ module JPSClient
15
15
  path = config["url"]
16
16
  path = path.gsub("{surveyId}", surveyId.to_s)
17
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
18
+ return request_with_auth(:put, path, body: params)
28
19
  end
29
20
 
30
21
  # Delete Survey
@@ -38,16 +29,7 @@ module JPSClient
38
29
  path = config["url"]
39
30
  path = path.gsub("{surveyId}", surveyId.to_s)
40
31
 
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
32
+ return request_with_auth(:delete, path)
51
33
  end
52
34
 
53
35
  # Update Survey
@@ -61,16 +43,7 @@ module JPSClient
61
43
  path = config["url"]
62
44
  path = path.gsub("{surveyId}", surveyId.to_s)
63
45
 
64
- response = @http_client.put(path, body: params)
65
- result = JPSClient::Response.new(response)
66
-
67
- if result.need_login?
68
- do_login(force_login: true)
69
- response = @http_client.put(path, body: params)
70
- result = JPSClient::Response.new(response)
71
- end
72
-
73
- return result.to_h
46
+ return request_with_auth(:put, path, body: params)
74
47
  end
75
48
 
76
49
  # Get List
@@ -83,16 +56,7 @@ module JPSClient
83
56
 
84
57
  path = config["url"]
85
58
 
86
- response = @http_client.post(path, body: params)
87
- result = JPSClient::Response.new(response)
88
-
89
- if result.need_login?
90
- do_login(force_login: true)
91
- response = @http_client.post(path, body: params)
92
- result = JPSClient::Response.new(response)
93
- end
94
-
95
- return result.to_h
59
+ return request_with_auth(:post, path, body: params)
96
60
  end
97
61
 
98
62
  # Create Create
@@ -105,16 +69,7 @@ module JPSClient
105
69
 
106
70
  path = config["url"]
107
71
 
108
- response = @http_client.post(path, body: params)
109
- result = JPSClient::Response.new(response)
110
-
111
- if result.need_login?
112
- do_login(force_login: true)
113
- response = @http_client.post(path, body: params)
114
- result = JPSClient::Response.new(response)
115
- end
116
-
117
- return result.to_h
72
+ return request_with_auth(:post, path, body: params)
118
73
  end
119
74
 
120
75
  # Get Types
@@ -127,16 +82,7 @@ module JPSClient
127
82
 
128
83
  path = config["url"]
129
84
 
130
- response = @http_client.get(path, params: params)
131
- result = JPSClient::Response.new(response)
132
-
133
- if result.need_login?
134
- do_login(force_login: true)
135
- response = @http_client.get(path, params: params)
136
- result = JPSClient::Response.new(response)
137
- end
138
-
139
- return result.to_h
85
+ return request_with_auth(:get, path, params: params)
140
86
  end
141
87
  end
142
88
  end
@@ -26,16 +26,7 @@ module JPSClient
26
26
 
27
27
  path = config["url"]
28
28
 
29
- response = @http_client.post(path, body: params)
30
- result = JPSClient::Response.new(response)
31
-
32
- if result.need_login?
33
- do_login(force_login: true)
34
- response = @http_client.post(path, body: params)
35
- result = JPSClient::Response.new(response)
36
- end
37
-
38
- return result.to_h
29
+ return request_with_auth(:post, path, body: params)
39
30
  end
40
31
 
41
32
  # 更新标签
@@ -61,16 +52,7 @@ module JPSClient
61
52
 
62
53
  path = config["url"]
63
54
 
64
- response = @http_client.put(path, body: params)
65
- result = JPSClient::Response.new(response)
66
-
67
- if result.need_login?
68
- do_login(force_login: true)
69
- response = @http_client.put(path, body: params)
70
- result = JPSClient::Response.new(response)
71
- end
72
-
73
- return result.to_h
55
+ return request_with_auth(:put, path, body: params)
74
56
  end
75
57
 
76
58
  # 删除标签
@@ -83,16 +65,7 @@ module JPSClient
83
65
 
84
66
  path = config["url"].gsub("{tagId}", tagId.to_s)
85
67
 
86
- response = @http_client.delete(path)
87
- result = JPSClient::Response.new(response)
88
-
89
- if result.need_login?
90
- do_login(force_login: true)
91
- response = @http_client.delete(path)
92
- result = JPSClient::Response.new(response)
93
- end
94
-
95
- return result.to_h
68
+ return request_with_auth(:delete, path)
96
69
  end
97
70
 
98
71
  # 更新标签权重
@@ -117,16 +90,7 @@ module JPSClient
117
90
  path = config["url"]
118
91
  params = { weights: weights }
119
92
 
120
- response = @http_client.post(path, body: params)
121
- result = JPSClient::Response.new(response)
122
-
123
- if result.need_login?
124
- do_login(force_login: true)
125
- response = @http_client.post(path, body: params)
126
- result = JPSClient::Response.new(response)
127
- end
128
-
129
- return result.to_h
93
+ return request_with_auth(:post, path, body: params)
130
94
  end
131
95
 
132
96
  # 获取标签列表
@@ -146,16 +110,7 @@ module JPSClient
146
110
 
147
111
  path = config["url"]
148
112
 
149
- response = @http_client.get(path, params: params)
150
- result = JPSClient::Response.new(response)
151
-
152
- if result.need_login?
153
- do_login(force_login: true)
154
- response = @http_client.get(path, params: params)
155
- result = JPSClient::Response.new(response)
156
- end
157
-
158
- return result.to_h
113
+ return request_with_auth(:get, path, params: params)
159
114
  end
160
115
 
161
116
  # 获取标签关联的资源
@@ -168,16 +123,7 @@ module JPSClient
168
123
 
169
124
  path = config["url"].gsub("{tagId}", tagId.to_s)
170
125
 
171
- response = @http_client.get(path)
172
- result = JPSClient::Response.new(response)
173
-
174
- if result.need_login?
175
- do_login(force_login: true)
176
- response = @http_client.get(path)
177
- result = JPSClient::Response.new(response)
178
- end
179
-
180
- return result.to_h
126
+ return request_with_auth(:get, path)
181
127
  end
182
128
 
183
129
  # 便捷方法:按类型获取标签
@@ -25,16 +25,7 @@ module JPSClient
25
25
  }
26
26
  params = default_params.merge(params)
27
27
 
28
- response = @http_client.post(path, body: params)
29
- result = JPSClient::Response.new(response)
30
-
31
- if result.need_login?
32
- do_login(force_login: true)
33
- response = @http_client.post(path, body: params)
34
- result = JPSClient::Response.new(response)
35
- end
36
-
37
- return result.to_h
28
+ return request_with_auth(:post, path, body: params)
38
29
  end
39
30
 
40
31
  # 获取模板详情
@@ -50,16 +41,7 @@ module JPSClient
50
41
  # GET请求,ID作为查询参数
51
42
  params = { id: id }
52
43
 
53
- response = @http_client.get(path, params: params)
54
- result = JPSClient::Response.new(response)
55
-
56
- if result.need_login?
57
- do_login(force_login: true)
58
- response = @http_client.get(path, params: params)
59
- result = JPSClient::Response.new(response)
60
- end
61
-
62
- return result.to_h
44
+ return request_with_auth(:get, path, params: params)
63
45
  end
64
46
 
65
47
  # 创建模板
@@ -84,16 +66,7 @@ module JPSClient
84
66
 
85
67
  path = config["url"]
86
68
 
87
- response = @http_client.post(path, body: params)
88
- result = JPSClient::Response.new(response)
89
-
90
- if result.need_login?
91
- do_login(force_login: true)
92
- response = @http_client.post(path, body: params)
93
- result = JPSClient::Response.new(response)
94
- end
95
-
96
- return result.to_h
69
+ return request_with_auth(:post, path, body: params)
97
70
  end
98
71
 
99
72
  # 更新模板
@@ -114,16 +87,7 @@ module JPSClient
114
87
 
115
88
  path = config["url"]
116
89
 
117
- response = @http_client.post(path, body: params)
118
- result = JPSClient::Response.new(response)
119
-
120
- if result.need_login?
121
- do_login(force_login: true)
122
- response = @http_client.post(path, body: params)
123
- result = JPSClient::Response.new(response)
124
- end
125
-
126
- return result.to_h
90
+ return request_with_auth(:post, path, body: params)
127
91
  end
128
92
 
129
93
  # 删除模板
@@ -139,16 +103,7 @@ module JPSClient
139
103
  # POST请求,ID作为body参数
140
104
  params = { id: id }
141
105
 
142
- response = @http_client.post(path, body: params)
143
- result = JPSClient::Response.new(response)
144
-
145
- if result.need_login?
146
- do_login(force_login: true)
147
- response = @http_client.post(path, body: params)
148
- result = JPSClient::Response.new(response)
149
- end
150
-
151
- return result.to_h
106
+ return request_with_auth(:post, path, body: params)
152
107
  end
153
108
 
154
109
  # 批量获取模板(扩展方法)
@@ -15,16 +15,7 @@ module JPSClient
15
15
  path = config["url"]
16
16
  path = path.gsub("{toolId}", toolId.to_s)
17
17
 
18
- response = @http_client.get(path, params: params)
19
- result = JPSClient::Response.new(response)
20
-
21
- if result.need_login?
22
- do_login(force_login: true)
23
- response = @http_client.get(path, params: params)
24
- result = JPSClient::Response.new(response)
25
- end
26
-
27
- return result.to_h
18
+ return request_with_auth(:get, path, params: params)
28
19
  end
29
20
 
30
21
  # Update Tool
@@ -38,16 +29,7 @@ module JPSClient
38
29
  path = config["url"]
39
30
  path = path.gsub("{toolId}", toolId.to_s)
40
31
 
41
- response = @http_client.put(path, body: params)
42
- result = JPSClient::Response.new(response)
43
-
44
- if result.need_login?
45
- do_login(force_login: true)
46
- response = @http_client.put(path, body: params)
47
- result = JPSClient::Response.new(response)
48
- end
49
-
50
- return result.to_h
32
+ return request_with_auth(:put, path, body: params)
51
33
  end
52
34
 
53
35
  # Delete Tool
@@ -61,16 +43,7 @@ module JPSClient
61
43
  path = config["url"]
62
44
  path = path.gsub("{toolId}", toolId.to_s)
63
45
 
64
- response = @http_client.delete(path)
65
- result = JPSClient::Response.new(response)
66
-
67
- if result.need_login?
68
- do_login(force_login: true)
69
- response = @http_client.delete(path)
70
- result = JPSClient::Response.new(response)
71
- end
72
-
73
- return result.to_h
46
+ return request_with_auth(:delete, path)
74
47
  end
75
48
 
76
49
  # Create Tools
@@ -83,16 +56,7 @@ module JPSClient
83
56
 
84
57
  path = config["url"]
85
58
 
86
- response = @http_client.post(path, body: params)
87
- result = JPSClient::Response.new(response)
88
-
89
- if result.need_login?
90
- do_login(force_login: true)
91
- response = @http_client.post(path, body: params)
92
- result = JPSClient::Response.new(response)
93
- end
94
-
95
- return result.to_h
59
+ return request_with_auth(:post, path, body: params)
96
60
  end
97
61
 
98
62
  # Create Tool
@@ -105,16 +69,7 @@ module JPSClient
105
69
 
106
70
  path = config["url"]
107
71
 
108
- response = @http_client.post(path, body: params)
109
- result = JPSClient::Response.new(response)
110
-
111
- if result.need_login?
112
- do_login(force_login: true)
113
- response = @http_client.post(path, body: params)
114
- result = JPSClient::Response.new(response)
115
- end
116
-
117
- return result.to_h
72
+ return request_with_auth(:post, path, body: params)
118
73
  end
119
74
  end
120
75
  end
@@ -14,16 +14,7 @@ module JPSClient
14
14
 
15
15
  path = config["url"]
16
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
17
+ return request_with_auth(:post, path, body: params)
27
18
  end
28
19
  end
29
20
  end
@@ -14,16 +14,7 @@ module JPSClient
14
14
 
15
15
  path = config["url"]
16
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
17
+ return request_with_auth(:post, path, body: params)
27
18
  end
28
19
 
29
20
  # Create Delete
@@ -36,16 +27,7 @@ module JPSClient
36
27
 
37
28
  path = config["url"]
38
29
 
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
30
+ return request_with_auth(:post, path, body: params)
49
31
  end
50
32
 
51
33
  # Create Create
@@ -58,16 +40,7 @@ module JPSClient
58
40
 
59
41
  path = config["url"]
60
42
 
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
43
+ return request_with_auth(:post, path, body: params)
71
44
  end
72
45
 
73
46
  # Get List
@@ -80,16 +53,7 @@ module JPSClient
80
53
 
81
54
  path = config["url"]
82
55
 
83
- response = @http_client.get(path, params: params)
84
- result = JPSClient::Response.new(response)
85
-
86
- if result.need_login?
87
- do_login(force_login: true)
88
- response = @http_client.get(path, params: params)
89
- result = JPSClient::Response.new(response)
90
- end
91
-
92
- return result.to_h
56
+ return request_with_auth(:get, path, params: params)
93
57
  end
94
58
 
95
59
  # Get Detail
@@ -102,16 +66,7 @@ module JPSClient
102
66
 
103
67
  path = config["url"]
104
68
 
105
- response = @http_client.get(path, params: params)
106
- result = JPSClient::Response.new(response)
107
-
108
- if result.need_login?
109
- do_login(force_login: true)
110
- response = @http_client.get(path, params: params)
111
- result = JPSClient::Response.new(response)
112
- end
113
-
114
- return result.to_h
69
+ return request_with_auth(:get, path, params: params)
115
70
  end
116
71
  end
117
72
  end
@@ -15,16 +15,7 @@ module JPSClient
15
15
  path = config["url"]
16
16
  path = path.gsub("{userId}", userId.to_s)
17
17
 
18
- response = @http_client.get(path, params: params)
19
- result = JPSClient::Response.new(response)
20
-
21
- if result.need_login?
22
- do_login(force_login: true)
23
- response = @http_client.get(path, params: params)
24
- result = JPSClient::Response.new(response)
25
- end
26
-
27
- return result.to_h
18
+ return request_with_auth(:get, path, params: params)
28
19
  end
29
20
 
30
21
  # Update User
@@ -38,16 +29,7 @@ module JPSClient
38
29
  path = config["url"]
39
30
  path = path.gsub("{userId}", userId.to_s)
40
31
 
41
- response = @http_client.put(path, body: params)
42
- result = JPSClient::Response.new(response)
43
-
44
- if result.need_login?
45
- do_login(force_login: true)
46
- response = @http_client.put(path, body: params)
47
- result = JPSClient::Response.new(response)
48
- end
49
-
50
- return result.to_h
32
+ return request_with_auth(:put, path, body: params)
51
33
  end
52
34
 
53
35
  # Delete User
@@ -61,16 +43,7 @@ module JPSClient
61
43
  path = config["url"]
62
44
  path = path.gsub("{userId}", userId.to_s)
63
45
 
64
- response = @http_client.delete(path)
65
- result = JPSClient::Response.new(response)
66
-
67
- if result.need_login?
68
- do_login(force_login: true)
69
- response = @http_client.delete(path)
70
- result = JPSClient::Response.new(response)
71
- end
72
-
73
- return result.to_h
46
+ return request_with_auth(:delete, path)
74
47
  end
75
48
 
76
49
  # Get Users
@@ -83,16 +56,7 @@ module JPSClient
83
56
 
84
57
  path = config["url"]
85
58
 
86
- response = @http_client.get(path, params: params)
87
- result = JPSClient::Response.new(response)
88
-
89
- if result.need_login?
90
- do_login(force_login: true)
91
- response = @http_client.get(path, params: params)
92
- result = JPSClient::Response.new(response)
93
- end
94
-
95
- return result.to_h
59
+ return request_with_auth(:get, path, params: params)
96
60
  end
97
61
  end
98
62
  end
@@ -14,16 +14,7 @@ module JPSClient
14
14
 
15
15
  path = config["url"]
16
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
17
+ return request_with_auth(:post, path, body: params)
27
18
  end
28
19
  end
29
20
  end
@@ -14,16 +14,7 @@ module JPSClient
14
14
 
15
15
  path = config["url"]
16
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
17
+ return request_with_auth(:post, path, body: params)
27
18
  end
28
19
  end
29
20
  end
@@ -14,16 +14,7 @@ module JPSClient
14
14
 
15
15
  path = config["url"]
16
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
17
+ return request_with_auth(:post, path, body: params)
27
18
  end
28
19
 
29
20
  # Create Event
@@ -36,16 +27,7 @@ module JPSClient
36
27
 
37
28
  path = config["url"]
38
29
 
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
30
+ return request_with_auth(:post, path, body: params)
49
31
  end
50
32
 
51
33
  # Create Callback
@@ -58,16 +40,7 @@ module JPSClient
58
40
 
59
41
  path = config["url"]
60
42
 
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
43
+ return request_with_auth(:post, path, body: params)
71
44
  end
72
45
 
73
46
  # Create Callback
@@ -80,16 +53,7 @@ module JPSClient
80
53
 
81
54
  path = config["url"]
82
55
 
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
56
+ return request_with_auth(:post, path, body: params)
93
57
  end
94
58
 
95
59
  # Create Callback
@@ -102,16 +66,7 @@ module JPSClient
102
66
 
103
67
  path = config["url"]
104
68
 
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
69
+ return request_with_auth(:post, path, body: params)
115
70
  end
116
71
  end
117
72
  end