arctic-ui 0.1.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/.circleci/config.yml +36 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +98 -0
- data/LICENSE.txt +21 -0
- data/README.md +28 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/core-api.gemspec +41 -0
- data/documentation/.editorconfig +15 -0
- data/documentation/.gitignore +24 -0
- data/documentation/.travis.yml +10 -0
- data/documentation/CHANGELOG.md +137 -0
- data/documentation/CODE_OF_CONDUCT.md +46 -0
- data/documentation/Gemfile +11 -0
- data/documentation/Gemfile.lock +129 -0
- data/documentation/LICENSE +13 -0
- data/documentation/Procfile +1 -0
- data/documentation/README.md +118 -0
- data/documentation/config.rb +57 -0
- data/documentation/deploy.sh +215 -0
- data/documentation/font-selection.json +148 -0
- data/documentation/lib/multilang.rb +16 -0
- data/documentation/lib/nesting_unique_head.rb +22 -0
- data/documentation/lib/toc_data.rb +30 -0
- data/documentation/lib/unique_head.rb +24 -0
- data/documentation/source/fonts/slate.eot +0 -0
- data/documentation/source/fonts/slate.svg +14 -0
- data/documentation/source/fonts/slate.ttf +0 -0
- data/documentation/source/fonts/slate.woff +0 -0
- data/documentation/source/fonts/slate.woff2 +0 -0
- data/documentation/source/images/logo.png +0 -0
- data/documentation/source/images/navbar.png +0 -0
- data/documentation/source/includes/_errors.md +17 -0
- data/documentation/source/index.html.md +179 -0
- data/documentation/source/javascripts/all.js +2 -0
- data/documentation/source/javascripts/all_nosearch.js +16 -0
- data/documentation/source/javascripts/app/_lang.js +164 -0
- data/documentation/source/javascripts/app/_search.js +98 -0
- data/documentation/source/javascripts/app/_toc.js +114 -0
- data/documentation/source/javascripts/lib/_energize.js +169 -0
- data/documentation/source/javascripts/lib/_imagesloaded.min.js +7 -0
- data/documentation/source/javascripts/lib/_jquery.highlight.js +108 -0
- data/documentation/source/javascripts/lib/_jquery.js +9831 -0
- data/documentation/source/javascripts/lib/_lunr.js +1910 -0
- data/documentation/source/layouts/layout.erb +116 -0
- data/documentation/source/stylesheets/_icon-font.scss +38 -0
- data/documentation/source/stylesheets/_normalize.scss +427 -0
- data/documentation/source/stylesheets/_rtl.scss +140 -0
- data/documentation/source/stylesheets/_variables.scss +103 -0
- data/documentation/source/stylesheets/_variables2.scss +147 -0
- data/documentation/source/stylesheets/print.css.scss +148 -0
- data/documentation/source/stylesheets/screen.css.scss +707 -0
- data/lib/arctic/ui.rb +21 -0
- data/lib/arctic/ui/api.rb +69 -0
- data/lib/arctic/ui/configuration.rb +26 -0
- data/lib/arctic/ui/version.rb +5 -0
- metadata +288 -0
@@ -0,0 +1,148 @@
|
|
1
|
+
{
|
2
|
+
"IcoMoonType": "selection",
|
3
|
+
"icons": [
|
4
|
+
{
|
5
|
+
"icon": {
|
6
|
+
"paths": [
|
7
|
+
"M438.857 73.143q119.429 0 220.286 58.857t159.714 159.714 58.857 220.286-58.857 220.286-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857zM512 785.714v-108.571q0-8-5.143-13.429t-12.571-5.429h-109.714q-7.429 0-13.143 5.714t-5.714 13.143v108.571q0 7.429 5.714 13.143t13.143 5.714h109.714q7.429 0 12.571-5.429t5.143-13.429zM510.857 589.143l10.286-354.857q0-6.857-5.714-10.286-5.714-4.571-13.714-4.571h-125.714q-8 0-13.714 4.571-5.714 3.429-5.714 10.286l9.714 354.857q0 5.714 5.714 10t13.714 4.286h105.714q8 0 13.429-4.286t6-10z"
|
8
|
+
],
|
9
|
+
"attrs": [],
|
10
|
+
"isMulticolor": false,
|
11
|
+
"tags": [
|
12
|
+
"exclamation-circle"
|
13
|
+
],
|
14
|
+
"defaultCode": 61546,
|
15
|
+
"grid": 14
|
16
|
+
},
|
17
|
+
"attrs": [],
|
18
|
+
"properties": {
|
19
|
+
"id": 100,
|
20
|
+
"order": 4,
|
21
|
+
"prevSize": 28,
|
22
|
+
"code": 58880,
|
23
|
+
"name": "exclamation-sign",
|
24
|
+
"ligatures": ""
|
25
|
+
},
|
26
|
+
"setIdx": 0,
|
27
|
+
"iconIdx": 0
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"icon": {
|
31
|
+
"paths": [
|
32
|
+
"M585.143 786.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-54.857v-292.571q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h54.857v182.857h-54.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h256q8 0 13.143-5.143t5.143-13.143zM512 274.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-109.714q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h109.714q8 0 13.143-5.143t5.143-13.143zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z"
|
33
|
+
],
|
34
|
+
"attrs": [],
|
35
|
+
"isMulticolor": false,
|
36
|
+
"tags": [
|
37
|
+
"info-circle"
|
38
|
+
],
|
39
|
+
"defaultCode": 61530,
|
40
|
+
"grid": 14
|
41
|
+
},
|
42
|
+
"attrs": [],
|
43
|
+
"properties": {
|
44
|
+
"id": 85,
|
45
|
+
"order": 3,
|
46
|
+
"name": "info-sign",
|
47
|
+
"prevSize": 28,
|
48
|
+
"code": 58882
|
49
|
+
},
|
50
|
+
"setIdx": 0,
|
51
|
+
"iconIdx": 2
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"icon": {
|
55
|
+
"paths": [
|
56
|
+
"M733.714 419.429q0-16-10.286-26.286l-52-51.429q-10.857-10.857-25.714-10.857t-25.714 10.857l-233.143 232.571-129.143-129.143q-10.857-10.857-25.714-10.857t-25.714 10.857l-52 51.429q-10.286 10.286-10.286 26.286 0 15.429 10.286 25.714l206.857 206.857q10.857 10.857 25.714 10.857 15.429 0 26.286-10.857l310.286-310.286q10.286-10.286 10.286-25.714zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z"
|
57
|
+
],
|
58
|
+
"attrs": [],
|
59
|
+
"isMulticolor": false,
|
60
|
+
"tags": [
|
61
|
+
"check-circle"
|
62
|
+
],
|
63
|
+
"defaultCode": 61528,
|
64
|
+
"grid": 14
|
65
|
+
},
|
66
|
+
"attrs": [],
|
67
|
+
"properties": {
|
68
|
+
"id": 83,
|
69
|
+
"order": 9,
|
70
|
+
"prevSize": 28,
|
71
|
+
"code": 58886,
|
72
|
+
"name": "ok-sign"
|
73
|
+
},
|
74
|
+
"setIdx": 0,
|
75
|
+
"iconIdx": 6
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"icon": {
|
79
|
+
"paths": [
|
80
|
+
"M658.286 475.429q0-105.714-75.143-180.857t-180.857-75.143-180.857 75.143-75.143 180.857 75.143 180.857 180.857 75.143 180.857-75.143 75.143-180.857zM950.857 950.857q0 29.714-21.714 51.429t-51.429 21.714q-30.857 0-51.429-21.714l-196-195.429q-102.286 70.857-228 70.857-81.714 0-156.286-31.714t-128.571-85.714-85.714-128.571-31.714-156.286 31.714-156.286 85.714-128.571 128.571-85.714 156.286-31.714 156.286 31.714 128.571 85.714 85.714 128.571 31.714 156.286q0 125.714-70.857 228l196 196q21.143 21.143 21.143 51.429z"
|
81
|
+
],
|
82
|
+
"width": 951,
|
83
|
+
"attrs": [],
|
84
|
+
"isMulticolor": false,
|
85
|
+
"tags": [
|
86
|
+
"search"
|
87
|
+
],
|
88
|
+
"defaultCode": 61442,
|
89
|
+
"grid": 14
|
90
|
+
},
|
91
|
+
"attrs": [],
|
92
|
+
"properties": {
|
93
|
+
"id": 2,
|
94
|
+
"order": 1,
|
95
|
+
"prevSize": 28,
|
96
|
+
"code": 58887,
|
97
|
+
"name": "icon-search"
|
98
|
+
},
|
99
|
+
"setIdx": 0,
|
100
|
+
"iconIdx": 7
|
101
|
+
}
|
102
|
+
],
|
103
|
+
"height": 1024,
|
104
|
+
"metadata": {
|
105
|
+
"name": "slate",
|
106
|
+
"license": "SIL OFL 1.1"
|
107
|
+
},
|
108
|
+
"preferences": {
|
109
|
+
"showGlyphs": true,
|
110
|
+
"showQuickUse": true,
|
111
|
+
"showQuickUse2": true,
|
112
|
+
"showSVGs": true,
|
113
|
+
"fontPref": {
|
114
|
+
"prefix": "icon-",
|
115
|
+
"metadata": {
|
116
|
+
"fontFamily": "slate",
|
117
|
+
"majorVersion": 1,
|
118
|
+
"minorVersion": 0,
|
119
|
+
"description": "Based on FontAwesome",
|
120
|
+
"license": "SIL OFL 1.1"
|
121
|
+
},
|
122
|
+
"metrics": {
|
123
|
+
"emSize": 1024,
|
124
|
+
"baseline": 6.25,
|
125
|
+
"whitespace": 50
|
126
|
+
},
|
127
|
+
"resetPoint": 58880,
|
128
|
+
"showSelector": false,
|
129
|
+
"selector": "class",
|
130
|
+
"classSelector": ".icon",
|
131
|
+
"showMetrics": false,
|
132
|
+
"showMetadata": true,
|
133
|
+
"showVersion": true,
|
134
|
+
"ie7": false
|
135
|
+
},
|
136
|
+
"imagePref": {
|
137
|
+
"prefix": "icon-",
|
138
|
+
"png": true,
|
139
|
+
"useClassSelector": true,
|
140
|
+
"color": 4473924,
|
141
|
+
"bgColor": 16777215
|
142
|
+
},
|
143
|
+
"historySize": 100,
|
144
|
+
"showCodes": true,
|
145
|
+
"gridSize": 16,
|
146
|
+
"showLiga": false
|
147
|
+
}
|
148
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Multilang
|
2
|
+
def block_code(code, full_lang_name)
|
3
|
+
if full_lang_name
|
4
|
+
parts = full_lang_name.split('--')
|
5
|
+
rouge_lang_name = (parts) ? parts[0] : "" # just parts[0] here causes null ref exception when no language specified
|
6
|
+
super(code, rouge_lang_name).sub("highlight #{rouge_lang_name}") do |match|
|
7
|
+
match + " tab-" + full_lang_name
|
8
|
+
end
|
9
|
+
else
|
10
|
+
super(code, full_lang_name)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'middleman-core/renderers/redcarpet'
|
16
|
+
Middleman::Renderers::MiddlemanRedcarpetHTML.send :include, Multilang
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Nested unique header generation
|
2
|
+
require 'middleman-core/renderers/redcarpet'
|
3
|
+
|
4
|
+
class NestingUniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@@headers_history = {} if !defined?(@@headers_history)
|
8
|
+
end
|
9
|
+
|
10
|
+
def header(text, header_level)
|
11
|
+
friendly_text = text.parameterize
|
12
|
+
@@headers_history[header_level] = text.parameterize
|
13
|
+
|
14
|
+
if header_level > 1
|
15
|
+
for i in (header_level - 1).downto(1)
|
16
|
+
friendly_text.prepend("#{@@headers_history[i]}-") if @@headers_history.key?(i)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
return "<h#{header_level} id='#{friendly_text}'>#{text}</h#{header_level}>"
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
def toc_data(page_content)
|
4
|
+
html_doc = Nokogiri::HTML::DocumentFragment.parse(page_content)
|
5
|
+
|
6
|
+
# get a flat list of headers
|
7
|
+
headers = []
|
8
|
+
html_doc.css('h1, h2, h3').each do |header|
|
9
|
+
headers.push({
|
10
|
+
id: header.attribute('id').to_s,
|
11
|
+
content: header.children,
|
12
|
+
level: header.name[1].to_i,
|
13
|
+
children: []
|
14
|
+
})
|
15
|
+
end
|
16
|
+
|
17
|
+
[3,2].each do |header_level|
|
18
|
+
header_to_nest = nil
|
19
|
+
headers = headers.reject do |header|
|
20
|
+
if header[:level] == header_level
|
21
|
+
header_to_nest[:children].push header if header_to_nest
|
22
|
+
true
|
23
|
+
else
|
24
|
+
header_to_nest = header if header[:level] < header_level
|
25
|
+
false
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
headers
|
30
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Unique header generation
|
2
|
+
require 'middleman-core/renderers/redcarpet'
|
3
|
+
require 'digest'
|
4
|
+
class UniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@head_count = {}
|
8
|
+
end
|
9
|
+
def header(text, header_level)
|
10
|
+
friendly_text = text.gsub(/<[^<]+>/,"").parameterize
|
11
|
+
if friendly_text.strip.length == 0
|
12
|
+
# Looks like parameterize removed the whole thing! It removes many unicode
|
13
|
+
# characters like Chinese and Russian. To get a unique URL, let's just
|
14
|
+
# URI escape the whole header
|
15
|
+
friendly_text = Digest::SHA1.hexdigest(text)[0,10]
|
16
|
+
end
|
17
|
+
@head_count[friendly_text] ||= 0
|
18
|
+
@head_count[friendly_text] += 1
|
19
|
+
if @head_count[friendly_text] > 1
|
20
|
+
friendly_text += "-#{@head_count[friendly_text]}"
|
21
|
+
end
|
22
|
+
return "<h#{header_level} id='#{friendly_text}'>#{text}</h#{header_level}>"
|
23
|
+
end
|
24
|
+
end
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4
|
+
<metadata>Generated by IcoMoon</metadata>
|
5
|
+
<defs>
|
6
|
+
<font id="slate" horiz-adv-x="1024">
|
7
|
+
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
8
|
+
<missing-glyph horiz-adv-x="1024" />
|
9
|
+
<glyph unicode=" " d="" horiz-adv-x="512" />
|
10
|
+
<glyph unicode="" d="M438.857 877.714q119.429 0 220.286-58.857t159.714-159.714 58.857-220.286-58.857-220.286-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857zM512 165.143v108.571q0 8-5.143 13.429t-12.571 5.429h-109.714q-7.429 0-13.143-5.714t-5.714-13.143v-108.571q0-7.429 5.714-13.143t13.143-5.714h109.714q7.429 0 12.571 5.429t5.143 13.429zM510.857 361.714l10.286 354.857q0 6.857-5.714 10.286-5.714 4.571-13.714 4.571h-125.714q-8 0-13.714-4.571-5.714-3.429-5.714-10.286l9.714-354.857q0-5.714 5.714-10t13.714-4.286h105.714q8 0 13.429 4.286t6 10z" />
|
11
|
+
<glyph unicode="" d="M585.143 164.571v91.429q0 8-5.143 13.143t-13.143 5.143h-54.857v292.571q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h54.857v-182.857h-54.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h256q8 0 13.143 5.143t5.143 13.143zM512 676.571v91.429q0 8-5.143 13.143t-13.143 5.143h-109.714q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
|
12
|
+
<glyph unicode="" d="M733.714 531.428q0 16-10.286 26.286l-52 51.429q-10.857 10.857-25.714 10.857t-25.714-10.857l-233.143-232.571-129.143 129.143q-10.857 10.857-25.714 10.857t-25.714-10.857l-52-51.429q-10.286-10.286-10.286-26.286 0-15.429 10.286-25.714l206.857-206.857q10.857-10.857 25.714-10.857 15.429 0 26.286 10.857l310.286 310.286q10.286 10.286 10.286 25.714zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
|
13
|
+
<glyph unicode="" d="M658.286 475.428q0 105.714-75.143 180.857t-180.857 75.143-180.857-75.143-75.143-180.857 75.143-180.857 180.857-75.143 180.857 75.143 75.143 180.857zM950.857 0q0-29.714-21.714-51.429t-51.429-21.714q-30.857 0-51.429 21.714l-196 195.429q-102.286-70.857-228-70.857-81.714 0-156.286 31.714t-128.571 85.714-85.714 128.571-31.714 156.286 31.714 156.286 85.714 128.571 128.571 85.714 156.286 31.714 156.286-31.714 128.571-85.714 85.714-128.571 31.714-156.286q0-125.714-70.857-228l196-196q21.143-21.143 21.143-51.429z" horiz-adv-x="951" />
|
14
|
+
</font></defs></svg>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Errors
|
2
|
+
|
3
|
+
> Example error response
|
4
|
+
|
5
|
+
```json
|
6
|
+
{
|
7
|
+
"error": "Unauthorized",
|
8
|
+
"description": "Invalid or missing Bearer token Authentication header"
|
9
|
+
}
|
10
|
+
```
|
11
|
+
|
12
|
+
The Arctic Core API uses the [HTTP status codes](httpstatuses.com) list. Here is some additional explenations for some of the HTTP status codes.
|
13
|
+
|
14
|
+
Error Code | Meaning
|
15
|
+
---------- | -------
|
16
|
+
401 | Unauthorized -- Your Bearer token is incorrect or missing.
|
17
|
+
403 | Forbidden -- Your Bearer token doesn't have the proper scopes for this action.
|
@@ -0,0 +1,179 @@
|
|
1
|
+
---
|
2
|
+
title: Arctic UI API SDK Reference
|
3
|
+
|
4
|
+
language_tabs: # must be one of https://git.io/vQNgJ
|
5
|
+
- ruby
|
6
|
+
|
7
|
+
toc_footers:
|
8
|
+
- <a href='mailto:info@youwe.dk'>Contact us for an account</a>
|
9
|
+
|
10
|
+
includes:
|
11
|
+
- errors
|
12
|
+
|
13
|
+
search: true
|
14
|
+
---
|
15
|
+
|
16
|
+
# Introduction
|
17
|
+
|
18
|
+
The Arctic UI API are the available endpoints for building UI applications to view and interact with the Arctic project core.
|
19
|
+
|
20
|
+
This SDK gives you a programmable way to interact with the UI API. You can also explore the API in a more interactive and direct way via our [Swagger documentation](https://arctic-core.herokuapp.com).
|
21
|
+
|
22
|
+
# Installation
|
23
|
+
|
24
|
+
To install the gem: `gem 'arctic-ui'`
|
25
|
+
|
26
|
+
# Configuration
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'arctic/ui'
|
30
|
+
|
31
|
+
Arctic::UI.configure do |config|
|
32
|
+
config.client_id = "CLIENT_ID"
|
33
|
+
config.client_secret = "CLIENT_SECRET"
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
> Make sure to replace `YOUR_CLIENT_ID` and `YOUR_CLIENT_SECRET` with the information from the account given to you.
|
38
|
+
|
39
|
+
After we have setup an account for you, you will get a `CLIENT_ID` and `CLIENT_SECRET`.
|
40
|
+
|
41
|
+
The `CLIENT_ID` and the `CLIENT_SECRET` should be stored inside your application in a secure way.
|
42
|
+
|
43
|
+
To get a set of credentials, please <a href="mailto:info@youwe.dk">get in touch</a> with us.
|
44
|
+
|
45
|
+
# Authentication
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
require 'arctic/ui'
|
49
|
+
|
50
|
+
api = Arctic::UI::API.new email, password
|
51
|
+
```
|
52
|
+
|
53
|
+
The `email` and `password` should be supplied by the user. The user should be associated with your account.
|
54
|
+
|
55
|
+
You can setup, create and manage users for your account in your [Arctic Backoffice](https://arctic.com/backoffice).
|
56
|
+
|
57
|
+
<aside class="notice">For the rest of the documentation it's assumes that you have sucessfully completed the Configuration and Authentication steps.</aside>
|
58
|
+
|
59
|
+
# Account
|
60
|
+
|
61
|
+
## Get account information
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
api.get_account
|
65
|
+
```
|
66
|
+
|
67
|
+
> Example response
|
68
|
+
|
69
|
+
```json
|
70
|
+
{
|
71
|
+
"id": "735108ed-55ef-4314-8295-b57fb0d1e05c",
|
72
|
+
"name": "Bob's webshop",
|
73
|
+
"throttling": {
|
74
|
+
"interval": 1,
|
75
|
+
"amount": 100,
|
76
|
+
"current": 99
|
77
|
+
}
|
78
|
+
}
|
79
|
+
```
|
80
|
+
|
81
|
+
The user's account represents the account object. This is the central object that all users and shops are related to. This also holds your rate limit information (see the Rate Limiting section).
|
82
|
+
|
83
|
+
## Update account information
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
api.update_account name: 'New Account Name'
|
87
|
+
```
|
88
|
+
|
89
|
+
> Example response
|
90
|
+
|
91
|
+
```json
|
92
|
+
{
|
93
|
+
"id": "735108ed-55ef-4314-8295-b57fb0d1e05c",
|
94
|
+
"name": "New Account Name",
|
95
|
+
"throttling": {
|
96
|
+
"interval": 1,
|
97
|
+
"amount": 100,
|
98
|
+
"current": 74
|
99
|
+
}
|
100
|
+
}
|
101
|
+
```
|
102
|
+
|
103
|
+
Possible account attributes you can update
|
104
|
+
|
105
|
+
Attribute | Description
|
106
|
+
--------- | -----------
|
107
|
+
name | The human readable name of your account
|
108
|
+
|
109
|
+
# Shops
|
110
|
+
|
111
|
+
## List shops
|
112
|
+
|
113
|
+
```ruby
|
114
|
+
api.get_shops
|
115
|
+
```
|
116
|
+
|
117
|
+
> Example response
|
118
|
+
|
119
|
+
```json
|
120
|
+
[
|
121
|
+
{
|
122
|
+
"id": "2270b57a-80ee-4a44-9cd3-014c0469b39d",
|
123
|
+
"name": "Danish shop"
|
124
|
+
},
|
125
|
+
{
|
126
|
+
"id": "a30c348a-0396-4c86-8aee-3af3c782862c",
|
127
|
+
"name": "Swedish shop"
|
128
|
+
}
|
129
|
+
]
|
130
|
+
```
|
131
|
+
|
132
|
+
This will return a list of the shops available on your account.
|
133
|
+
|
134
|
+
## Update an existing shop's information
|
135
|
+
|
136
|
+
```ruby
|
137
|
+
api.update_shops id: 'a30c348a-0396-4c86-8aee-3af3c782862c', name: 'Norwegian shop'
|
138
|
+
```
|
139
|
+
|
140
|
+
> Example response
|
141
|
+
|
142
|
+
```json
|
143
|
+
{
|
144
|
+
"id": "a30c348a-0396-4c86-8aee-3af3c782862c",
|
145
|
+
"name": "Norwegian shop"
|
146
|
+
}
|
147
|
+
```
|
148
|
+
|
149
|
+
Possible shop attributes to update
|
150
|
+
|
151
|
+
Attribute | Type | Description
|
152
|
+
--------- | ---- | -----------
|
153
|
+
name | String | The human readable identifier of the shop on the Arctic platform
|
154
|
+
preprocessors | Array | A list of preprocessor IDs to use for your shop
|
155
|
+
|
156
|
+
# Preprocessors
|
157
|
+
|
158
|
+
## List available preprocessors
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
api.get_preprocessors
|
162
|
+
```
|
163
|
+
|
164
|
+
> Example response
|
165
|
+
|
166
|
+
```json
|
167
|
+
[
|
168
|
+
{
|
169
|
+
"id": "8680cc9b-12d5-4bbd-a4ff-f176ef90d676",
|
170
|
+
"name": "Dandomain"
|
171
|
+
},
|
172
|
+
{
|
173
|
+
"id": "062da138-c0c1-46b2-b0fd-b43f9a2ad888",
|
174
|
+
"name": "Amazon UK"
|
175
|
+
},
|
176
|
+
]
|
177
|
+
```
|
178
|
+
|
179
|
+
A preprocessor represents a connection between where you're hosting your webshop (e.g. Dandomain) and our system. A preprocessor will pull the items from your system into the Arctic system, from where they will be distributed throug Postprocessors.
|