sk_api_schema 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  A more detailed view of the changes can be found in the {commit messages}[https://github.com/salesking/sk_api_schema/commits/]
4
4
 
5
+ 2011-10
6
+ * added created_at search filter to clients and documents
7
+ * added creator(user) search filter to clients and documents
8
+
5
9
  2011-9
6
10
  * search documents by number
7
11
  * maxLength information for client and address properties
data/README.rdoc CHANGED
@@ -1,11 +1,20 @@
1
1
  = SalesKing API Schema
2
2
 
3
- Our API definition is using JSON Schema(http://json-schema.org/). A schema
4
- describes a resource in terms of available fields, CRUD actions and
5
- relationships with other resources.
3
+ Our API is described with JSON Schema's (http://json-schema.org). A schema
4
+ describes a resource(object) in a readable JSON format:
5
+
6
+ {
7
+ "title": "client",
8
+ "properties": { ...},
9
+ "links": [ .. ]
10
+ }
11
+ The properties-section defines the fields. CRUD actions and
12
+ relationships with other resources are found in the link-section.
13
+
14
+ Look into the /json/ folder for the resources schema-files - https://github.com/salesking/sk_api_schema/tree/master/json/v1.0
6
15
 
7
16
  For ruby pirates this project is available as gem. It provides some utility
8
- functions to read the schema files and convert objects to their schema notation.
17
+ methods to read the schema files and convert objects to their schema notation.
9
18
  See {/lib/sk_api_schema.rb}[https://github.com/salesking/sk_api_schema/blob/master/lib/sk_api_schema.rb]
10
19
 
11
20
  Other languages should take advantage of the raw json files.
@@ -48,14 +57,14 @@ parameter:
48
57
 
49
58
  Please try to only request the fields you really need, to save computing power!
50
59
 
51
- == Object Structure
60
+ == Object Structure Basic's
52
61
 
53
- The primary object types in SK are:
62
+ Primary object types in SK are:
54
63
  * Documents
55
64
  * Contacts
56
65
  * Products
57
66
 
58
- Secondary objects cannot exist without a primary(related) object
67
+ Secondary objects are always tied to a primary(related) object
59
68
  * Attachments
60
69
  * Comments
61
70
  * Messages
@@ -67,6 +76,8 @@ The third kind are supportive objects
67
76
  * Exports
68
77
  * Templates
69
78
 
79
+ == Enpoints & Links
80
+
70
81
  Following list gives you a quick overview of relations with nested urls an how
71
82
  parameters work. You can find those in detail when looking at the link section
72
83
  of each schema.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
@@ -199,14 +199,29 @@
199
199
  },
200
200
  "filter[created_at_from]":{
201
201
  "title" : "From date",
202
- "description": "All objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
202
+ "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
203
203
  "type" : "date-time"
204
204
  },
205
205
  "filter[created_at_to]":{
206
206
  "title" : "To date",
207
- "description": "All objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
207
+ "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
208
208
  "type" : "date-time"
209
209
  },
210
+ "filter[birthday_from]":{
211
+ "title" : "From birthday date",
212
+ "description": "Contacts with a birthday after and on the date. Leave the birthday-to date blank to only search on this day.",
213
+ "type" : "date"
214
+ },
215
+ "filter[birthday_to]":{
216
+ "title" : "To birthday date",
217
+ "description": "Contacts with a birthday date before and on the date.",
218
+ "type" : "date"
219
+ },
220
+ "filter[creator_ids]":{
221
+ "title" : "Creator",
222
+ "description": "Objects created by the given users uuids, comma separated",
223
+ "type" : "string"
224
+ },
210
225
  "filter[number]":{
211
226
  "title" : "By number",
212
227
  "description": "Search by number where the number is matched from the start: %number",
@@ -183,14 +183,24 @@
183
183
  },
184
184
  "filter[from]":{
185
185
  "title" : "From date",
186
- "description": "All objects with a date after the date",
186
+ "description": "Objects with a date on and after the date",
187
187
  "type" :"date"
188
188
  },
189
189
  "filter[to]":{
190
190
  "title" : "To date",
191
- "description": "All objects with date before the date",
191
+ "description": "Objects with date before and on the date",
192
192
  "type" :"date"
193
193
  },
194
+ "filter[created_at_from]":{
195
+ "title" : "From date",
196
+ "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
197
+ "type" : "date-time"
198
+ },
199
+ "filter[created_at_to]":{
200
+ "title" : "To date",
201
+ "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
202
+ "type" : "date-time"
203
+ },
194
204
  "filter[languages]":{
195
205
  "title" : "Languages",
196
206
  "description": "A list of language codes, comma separated",
@@ -206,6 +216,11 @@
206
216
  "description": "A single or a list of document uuids, comma separated",
207
217
  "type" : "string"
208
218
  },
219
+ "filter[creator_ids]":{
220
+ "title" : "Creator",
221
+ "description": "Objects created by the given users uuids, comma separated",
222
+ "type" : "string"
223
+ },
209
224
  "sort_by":{
210
225
  "title" : "Sort by",
211
226
  "description": "Sort the results by the given field => number",
@@ -137,14 +137,24 @@
137
137
  },
138
138
  "filter[from]":{
139
139
  "title" : "From date",
140
- "description": "All objects with a date after the date",
140
+ "description": "Objects with a date after the date",
141
141
  "type" : "date"
142
142
  },
143
143
  "filter[to]":{
144
144
  "title" : "To date",
145
- "description": "All objects with date before the date",
145
+ "description": "Objects with date before the date",
146
146
  "type" : "date"
147
147
  },
148
+ "filter[created_at_from]":{
149
+ "title" : "From date",
150
+ "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
151
+ "type" : "date-time"
152
+ },
153
+ "filter[created_at_to]":{
154
+ "title" : "To date",
155
+ "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
156
+ "type" : "date-time"
157
+ },
148
158
  "filter[languages]":{
149
159
  "title" : "Languages",
150
160
  "description": "A list of language codes, comma separated",
@@ -160,6 +170,11 @@
160
170
  "description": "A single or a list of document uuids, comma separated",
161
171
  "type" : "string"
162
172
  },
173
+ "filter[creator_ids]":{
174
+ "title" : "Creator",
175
+ "description": "Objects created by the given users uuids, comma separated",
176
+ "type" : "string"
177
+ },
163
178
  "sort_by":{
164
179
  "title" : "Sort by",
165
180
  "description": "Sort the results by the given field => number",
@@ -168,14 +168,24 @@
168
168
  },
169
169
  "filter[from]":{
170
170
  "title" : "From date",
171
- "description": "All objects with a date after the date",
171
+ "description": "Objects with a date after the date",
172
172
  "type" : "date"
173
173
  },
174
174
  "filter[to]":{
175
175
  "title" : "To date",
176
- "description": "All objects with date before the date",
176
+ "description": "Objects with date before the date",
177
177
  "type" : "date"
178
178
  },
179
+ "filter[created_at_from]":{
180
+ "title" : "From date",
181
+ "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
182
+ "type" : "date-time"
183
+ },
184
+ "filter[created_at_to]":{
185
+ "title" : "To date",
186
+ "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
187
+ "type" : "date-time"
188
+ },
179
189
  "filter[languages]":{
180
190
  "title" : "Languages",
181
191
  "description": "A list of language codes, comma separated",
@@ -191,6 +201,11 @@
191
201
  "description": "A single or a list of document uuids, comma separated",
192
202
  "type" : "string"
193
203
  },
204
+ "filter[creator_ids]":{
205
+ "title" : "Creator",
206
+ "description": "Objects created by the given users uuids, comma separated",
207
+ "type" : "string"
208
+ },
194
209
  "sort_by":{
195
210
  "title" : "Sort by",
196
211
  "description": "Sort the results by the given field => number",
@@ -183,12 +183,12 @@
183
183
  },
184
184
  "filter[from]":{
185
185
  "title" : "From date",
186
- "description": "All objects with a date after the date",
186
+ "description": "Objects with a date after the date",
187
187
  "type" : "date"
188
188
  },
189
189
  "filter[to]":{
190
190
  "title" : "To date",
191
- "description": "All objects with date before the date",
191
+ "description": "Objects with date before the date",
192
192
  "type" : "date"
193
193
  },
194
194
  "filter[languages]":{
@@ -206,6 +206,11 @@
206
206
  "description": "A single or a list of document uuids, comma separated",
207
207
  "type" : "string"
208
208
  },
209
+ "filter[creator_ids]":{
210
+ "title" : "Creator",
211
+ "description": "Objects created by the given users uuids, comma separated",
212
+ "type" : "string"
213
+ },
209
214
  "sort_by":{
210
215
  "title" : "Sort by",
211
216
  "description": "Sort the results by the given field => number",
data/json/v1.0/order.json CHANGED
@@ -159,14 +159,24 @@
159
159
  },
160
160
  "filter[from]":{
161
161
  "title" : "From date",
162
- "description": "All objects with a date after the date",
162
+ "description": "Objects with a date after the date",
163
163
  "type" : "date"
164
164
  },
165
165
  "filter[to]":{
166
166
  "title" : "To date",
167
- "description": "All objects with date before the date",
167
+ "description": "Objects with date before the date",
168
168
  "type" : "date"
169
169
  },
170
+ "filter[created_at_from]":{
171
+ "title" : "From date",
172
+ "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
173
+ "type" : "date-time"
174
+ },
175
+ "filter[created_at_to]":{
176
+ "title" : "To date",
177
+ "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
178
+ "type" : "date-time"
179
+ },
170
180
  "filter[languages]":{
171
181
  "title" : "Languages",
172
182
  "description": "A list of language codes, comma separated",
@@ -182,6 +192,11 @@
182
192
  "description": "A single or a list of document uuids, comma separated",
183
193
  "type" : "string"
184
194
  },
195
+ "filter[creator_ids]":{
196
+ "title" : "Creator",
197
+ "description": "Objects created by the given users uuids, comma separated",
198
+ "type" : "string"
199
+ },
185
200
  "sort_by":{
186
201
  "title" : "Sort by",
187
202
  "description": "Sort the results by the given field => number",
@@ -165,14 +165,24 @@
165
165
  },
166
166
  "filter[from]":{
167
167
  "title" : "From date",
168
- "description": "All objects with a date after the date",
168
+ "description": "Objects with a date after the date",
169
169
  "type" : "date"
170
170
  },
171
171
  "filter[to]":{
172
172
  "title" : "To date",
173
- "description": "All objects with date before the date",
173
+ "description": "Objects with date before the date",
174
174
  "type" : "date"
175
175
  },
176
+ "filter[created_at_from]":{
177
+ "title" : "From date",
178
+ "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
179
+ "type" : "date-time"
180
+ },
181
+ "filter[created_at_to]":{
182
+ "title" : "To date",
183
+ "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
184
+ "type" : "date-time"
185
+ },
176
186
  "filter[languages]":{
177
187
  "title" : "Languages",
178
188
  "description": "A list of language codes, comma separated",
@@ -188,6 +198,11 @@
188
198
  "description": "A single or a list of document uuids, comma separated",
189
199
  "type" : "string"
190
200
  },
201
+ "filter[creator_ids]":{
202
+ "title" : "Creator",
203
+ "description": "Objects created by the given users uuids, comma separated",
204
+ "type" : "string"
205
+ },
191
206
  "sort_by":{
192
207
  "title" : "Sort by",
193
208
  "description": "Sort the results by the given field => number",
data/lib/sk_api_schema.rb CHANGED
@@ -124,7 +124,7 @@ module SK
124
124
  data[field] = to_hash_from_schema(rel_obj, version)
125
125
  end
126
126
  else # a simple field is only added if the object knows it
127
- data[field] = obj.send(field) if obj.respond_to?(field.to_sym)
127
+ data[field] = obj.send(field) if obj.respond_to?(field)
128
128
  end
129
129
  end
130
130
  hsh = { "#{class_name}" => data }
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sk_api_schema}
8
- s.version = "0.2.4"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Georg Leciejewski"]
12
- s.date = %q{2011-10-03}
12
+ s.date = %q{2011-10-29}
13
13
  s.description = %q{The SalesKing JSON Schema describes our business API in terms of available objects, their fields and links to url endpoints with related objects. Besides ruby users can use a smal lib with utility methods to load and test the schema files.}
14
14
  s.email = %q{gl@salesking.eu}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sk_api_schema
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Georg Leciejewski
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-03 00:00:00 +02:00
18
+ date: 2011-10-29 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency