1c-connect-api-ruby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -0
- data/connect.gemspec +15 -0
- data/lib/connect/http_service/bot_api.rb +0 -8
- data/lib/connect/web_service/connect_parameters/params_factory.rb +6 -7
- data/lib/connect/web_service/rest.rb +11 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc8271eac9600d804e57837626d670876fefbadb33a06a4fb6a0b260220f97a1
|
4
|
+
data.tar.gz: a891d0e92ece41a2f3b3cec6dd89a7bb532eff1f3a459143b8bba5ee23909c7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a6153572e171910f2cf8fc7aef4aa22961a74e5c8229f4172208970a5c8100985902f6db94304a01ef697e745a7bba560ae0a97e65f1a5d7740d2ce4e04704
|
7
|
+
data.tar.gz: 69d9a8b9bc1c0c9e272c06fdf34fb2171613bc9c9d2922b2136fe0151e6bdc1861a6fee21ccbb477bab3afa9d8d6f2120c0bf2b5f81e137c58a74183b18e5264
|
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# [1C-Connect API client](https://1c-connect.atlassian.net/wiki/spaces/PUBLIC/pages/979042378)
|
2
|
+
|
3
|
+
## Usage
|
4
|
+
|
5
|
+
* Get your login and password from https://cus.buhphone.com/
|
6
|
+
|
7
|
+
## Quickstart
|
8
|
+
|
9
|
+
Library implements web-service api and http-service api.
|
10
|
+
|
11
|
+
### Web-service
|
12
|
+
|
13
|
+
```rb
|
14
|
+
require 'connect'
|
15
|
+
|
16
|
+
api = Connect::WebService::Client.new(login: 'login', password: 'password')
|
17
|
+
```
|
18
|
+
|
19
|
+
### HTTP-service
|
20
|
+
|
21
|
+
```rb
|
22
|
+
require 'connect'
|
23
|
+
|
24
|
+
api = Connect::HTTPService::Client.new(login: 'login', password: 'password')
|
25
|
+
```
|
data/connect.gemspec
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = '1c-connect-api-ruby'
|
5
|
+
s.version = '0.0.2'
|
6
|
+
s.summary = '1C-Connect API client'
|
7
|
+
s.authors = ['Anatoly Busygin']
|
8
|
+
s.email = 'anatolyb94@gmail.com'
|
9
|
+
s.files = Dir.chdir(File.expand_path(__dir__)) do
|
10
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
11
|
+
end
|
12
|
+
s.homepage =
|
13
|
+
'https://github.com/Suban05/1c-connect-api-ruby'
|
14
|
+
s.license = 'MIT'
|
15
|
+
end
|
@@ -11,22 +11,21 @@ module Connect
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def create_changed_from(options)
|
14
|
-
date = options[:changed_from]
|
15
|
-
content = nil
|
16
|
-
if date
|
17
|
-
content = date.strftime('%Y-%m-%dT%H:%M:%S')
|
18
|
-
end
|
19
14
|
create_date_time(
|
20
15
|
name: 'ChangedFrom',
|
21
|
-
content: content
|
16
|
+
content: options[:content]
|
22
17
|
)
|
23
18
|
end
|
24
19
|
|
25
20
|
def create_date_time(options)
|
21
|
+
content = nil
|
22
|
+
if options[:content]
|
23
|
+
content = options[:content].strftime('%Y-%m-%dT%H:%M:%S')
|
24
|
+
end
|
26
25
|
create_parameter(
|
27
26
|
name: options[:name],
|
28
27
|
type: 'xs:dateTime',
|
29
|
-
content:
|
28
|
+
content: content
|
30
29
|
)
|
31
30
|
end
|
32
31
|
|
@@ -63,6 +63,17 @@ module Connect
|
|
63
63
|
call(self, method: :client_user_read, params: params)
|
64
64
|
end
|
65
65
|
|
66
|
+
def get_opened_service_treatments(options = {})
|
67
|
+
params = []
|
68
|
+
add_param(params, create_date(name: 'OpenedFrom', content: options[:opened_from], required: true))
|
69
|
+
add_param(params, create_date_time(name: 'OpenedTo', content: options[:opened_to]))
|
70
|
+
add_param(params, create_string(name: 'ClientID', content: options[:client_id]))
|
71
|
+
add_param(params, create_string(name: 'ServiceUserID', content: options[:service_user_id]))
|
72
|
+
add_param(params, create_string(name: 'ServiceID', content: options[:service_id]))
|
73
|
+
add_param(params, create_string(name: 'SpecialistID', content: options[:specialist_id]))
|
74
|
+
call(self, method: :get_opened_service_treatments, params: params)
|
75
|
+
end
|
76
|
+
|
66
77
|
def add_param(params, param)
|
67
78
|
params << param if param.required || param.value.content
|
68
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 1c-connect-api-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoly Busygin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: anatolyb94@gmail.com
|
@@ -22,6 +22,8 @@ files:
|
|
22
22
|
- ".rubocop.yaml"
|
23
23
|
- Gemfile
|
24
24
|
- Gemfile.lock
|
25
|
+
- README.md
|
26
|
+
- connect.gemspec
|
25
27
|
- lib/connect.rb
|
26
28
|
- lib/connect/http_service.rb
|
27
29
|
- lib/connect/http_service/bot_api.rb
|
@@ -41,7 +43,7 @@ files:
|
|
41
43
|
- lib/connect/web_service/connection.rb
|
42
44
|
- lib/connect/web_service/request.rb
|
43
45
|
- lib/connect/web_service/rest.rb
|
44
|
-
homepage:
|
46
|
+
homepage: https://github.com/Suban05/1c-connect-api-ruby
|
45
47
|
licenses:
|
46
48
|
- MIT
|
47
49
|
metadata: {}
|