sk_api_schema 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,21 @@
1
- = Changelog for SalesKing API Schema
1
+ # Changelog for SalesKing API Schema
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
- 2012-11
5
+ 2013-01
6
+ * add new item types: devider_item, sub_total_item
7
+ * add items for documents containing all items by type
8
+ * add filter\[tags] to products, mark price as required
9
+ * add name-key to all objects containing the lowercased_underscored-name, PLEASE start using it instead of the title-field, which will be changed to its CamelCasedObjectName
10
+
11
+ 2012-12
12
+ * add search filter to pdf_template, email_template
13
+ * filter clients by ids - search for a list of comma separated uuids
6
14
 
7
- * add currency fields for documents, client, company and payment
8
- * add PDF template resource
9
- * drop 'method' from payment in favour of payment_method
15
+ 2012-11
16
+ * add currency fields for documents, client, company and payment
17
+ * add PDF template resource
18
+ * drop 'method' from payment in favour of payment_method
10
19
 
11
20
  2012-07
12
21
  * maxLength for all string properties with limits
@@ -51,9 +60,9 @@ A more detailed view of the changes can be found in the {commit messages}[https:
51
60
 
52
61
  2011-6
53
62
  * added language field to document, client, email-template
54
- * added filter[languages] for documents and clients, to search by one or more languages
55
- * added filter[client_ids] to documents, to search by one or multiple clients
56
- * added filter[ids] for documents, to find multiple specific documents
63
+ * added filter\[languages] for documents and clients, to search by one or more languages
64
+ * added filter\[client_ids] to documents, to search by one or multiple clients
65
+ * added filter\[ids] for documents, to find multiple specific documents
57
66
  * changed _delete property to _destroy for address, line_item
58
67
  * removed client_id requirement for documents
59
68
 
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "address",
3
+ "name": "address",
3
4
  "description":"An address in SK is maintained within it's parent object(client, company). The first address(default_address) is used inside the address field of new documents. With multiple addresses sorting(first) is done by date, newest first. So if you add a new adddress it will be the new default one. See order and type property for details about ordering and accessing parcel work or home addresses.",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "attachment",
3
+ "name": "attachment",
3
4
  "description":"An file attachment",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  {"type":"object",
2
2
  "title": "auth_permission",
3
+ "name": "auth_permission",
3
4
  "description": "A Permission authorises someone to execute actions(grants privileges) in the scope of a context. The context is a resource f.ex: clients, and the privileges a group of actions like: index, show, edit, update. A permission to read invoices has the context: invoices and as privileges: index,show.",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  {"type":"object",
2
2
  "title": "client",
3
+ "name": "client",
3
4
  "description": "A client as seen by SalesKing",
4
5
  "properties":{
5
6
  "id":{
@@ -213,6 +214,11 @@
213
214
  "description": "Filter by a space delimited list of tags",
214
215
  "type":"string"
215
216
  },
217
+ "filter[ids]":{
218
+ "title" : "Clients",
219
+ "description": "A single or a list of client uuids, comma separated",
220
+ "type" : "string"
221
+ },
216
222
  "filter[created_at_from]":{
217
223
  "title" : "From date",
218
224
  "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "comment",
3
+ "name": "comment",
3
4
  "description":"An comment in SK must always be related to an object.",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "company",
3
+ "name": "company",
3
4
  "description": "A company is the main entity, so any data belongs to a company. It is identified by the current subdomain and cannot be edited via API atm",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "credit_note",
3
+ "name": "credit_note",
3
4
  "description": "A credit note",
4
5
  "properties":{
5
6
  "id":{
@@ -0,0 +1,42 @@
1
+ { "type":"object",
2
+ "title": "divider_item",
3
+ "name": "divider_item",
4
+ "description": "A divider item serves as a separator or headline between line items, e.g. to distinguish hardware and service products on a document. Access and creation is done via documents.items(instead of line_items) where each item has a 'type' field set to its CamelCased class name.",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "position":{
15
+ "description": "Required since items are sorted by position.",
16
+ "type":"integer",
17
+ "required":true
18
+ },
19
+ "name":{
20
+ "description": "The divider text",
21
+ "type":"string",
22
+ "maxLength": 50
23
+ },
24
+ "created_at":{
25
+ "description": "Date the object was created in SK. Never changes afterwards",
26
+ "format":"date-time",
27
+ "readonly":true,
28
+ "type":"string"
29
+ },
30
+ "updated_at":{
31
+ "description": "Date the object was edited in SK.",
32
+ "format":"date-time",
33
+ "readonly":true,
34
+ "type":"string"
35
+ },
36
+ "_destroy":{
37
+ "description": "When set an existing item will be deleted. This switch is used for items submitted nested within their parent object(a document), which is default as long as there is no line item endpoint available.",
38
+ "type":"boolean"
39
+ }
40
+ },
41
+ "links":[]
42
+ }
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "document",
3
+ "name": "document",
3
4
  "description": "This resource is readonly and serves as a convenient way to query documents independent of their type(invoice, order,..). The specific document type is set in each object in the result-set. Internally Document is the base class for all types and special fields are defined in each child-class. Due to this some fields might be missing if you are using this meta-class in queries.",
4
5
  "properties":{
5
6
  "id":{
@@ -66,7 +67,16 @@
66
67
  "line_items":{
67
68
  "description": "Line items for the document",
68
69
  "type":"array",
69
- "properties":{"$ref":"./line_items.json#properties"}
70
+ "items":{"$ref":"./line_items.json#properties"}
71
+ },
72
+ "items":{
73
+ "description": "Items for the document. Access items of all types including divider and sub_total items.",
74
+ "type":"array",
75
+ "default": "any",
76
+ "minItems": 0,
77
+ "items": [{ "$ref": "./line_item.json#properties"},
78
+ { "$ref": "./divider_item.json#properties"},
79
+ { "$ref": "./sub_total_item.json#properties"}]
70
80
  },
71
81
  "created_at":{
72
82
  "description": "Date the object was created in SK. Never changes afterwards.",
data/json/v1.0/email.json CHANGED
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "email",
3
+ "name": "email",
3
4
  "description":"An email in SK must always be related to an object. Receivers are limited to 5 per address field.",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "email_template",
3
+ "name": "email_template",
3
4
  "description":"An email_template in SK",
4
5
  "properties":{
5
6
  "id":{
@@ -85,6 +86,16 @@
85
86
  "title" : "Sort",
86
87
  "enum":["ASC","DESC"],
87
88
  "description": "Sort the results in ASC or DESC"
89
+ },
90
+ "filter[q]":{
91
+ "title" : "Search wildcard",
92
+ "description": "Searches in name, subject, body",
93
+ "type":"string"
94
+ },
95
+ "filter[kind]":{
96
+ "title" : "Search by kind",
97
+ "description": "Kind of object this template can be used for: invoice, credit_note (singular lowercase classname)",
98
+ "type":"string"
88
99
  }
89
100
  }
90
101
  },
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "estimate",
3
+ "name": "estimate",
3
4
  "description": "An estimate",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "export",
3
+ "name": "export",
3
4
  "description":"An export in SK",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "export_template",
3
+ "name": "export_template",
3
4
  "description":"An export_template in SK",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "invoice",
3
+ "name": "invoice",
3
4
  "description": "An invoice",
4
5
  "properties":{
5
6
  "id":{
@@ -118,6 +119,15 @@
118
119
  "type":"array",
119
120
  "properties":{"$ref":"./line_item.json#properties"}
120
121
  },
122
+ "items":{
123
+ "description": "Items for the document. Access items of all types including divider and sub_total items.",
124
+ "type":"array",
125
+ "default": "any",
126
+ "minItems": 0,
127
+ "items": [{ "$ref": "./line_item.json#properties"},
128
+ { "$ref": "./divider_item.json#properties"},
129
+ { "$ref": "./sub_total_item.json#properties"}]
130
+ },
121
131
  "created_at":{
122
132
  "description": "Date the object was created in SK. Never changes afterwards.",
123
133
  "format":"date-time",
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "language",
3
+ "name": "language",
3
4
  "description": "A language in SK can be assigned to documents, contacts and templates. When creating new documents, emails or PDF the language is used to select a specific template or language agnostic defaults. A language has many translations.",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "line_item",
3
+ "name": "line_item",
3
4
  "description": "A line item for a document",
4
5
  "properties":{
5
6
  "id":{
data/json/v1.0/order.json CHANGED
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "order",
3
+ "name": "order",
3
4
  "description": "An order",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "payment",
3
+ "name": "payment",
3
4
  "description":"An payment in SK must always be related to an object.",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "payment_reminder",
3
+ "name": "payment_reminder",
3
4
  "description": "A payment reminder",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "pdf_template",
3
+ "name": "pdf_template",
3
4
  "description":"An PDF template. For now this is a read-only resource ONLY returning your own templates. It fits the most important use-case: A user can select a print template.",
4
5
  "properties":{
5
6
  "id":{
@@ -87,7 +88,7 @@
87
88
  },
88
89
  "filter[kind]":{
89
90
  "title" : "Search by kind",
90
- "description": "Kind of object this template can be used for: invoice, order",
91
+ "description": "Kind of object this template can be used for: invoice, credit_note (singular lowercase classname)",
91
92
  "type":"string"
92
93
  }
93
94
  }
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "product",
3
+ "name": "product",
3
4
  "description": "A product in SK",
4
5
  "properties":{
5
6
  "id":{
@@ -26,9 +27,14 @@
26
27
  "type":"string",
27
28
  "format":"text"
28
29
  },
30
+ "tag_list":{
31
+ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
32
+ "type":"string"
33
+ },
29
34
  "price":{
30
35
  "description": "Net price of a single product",
31
- "type":"number"
36
+ "type":"number",
37
+ "required":true
32
38
  },
33
39
  "tax":{
34
40
  "description": "Tax percentage for this product.",
@@ -89,6 +95,11 @@
89
95
  "description": "Search by exact number",
90
96
  "type":"string"
91
97
  },
98
+ "filter[tags]":{
99
+ "title" : "Tags",
100
+ "description": "Filter by a space delimited list of tags",
101
+ "type":"string"
102
+ },
92
103
  "sort_by":{
93
104
  "title" : "Sort by",
94
105
  "description": "Sort the results by the given field => number",
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "recurring",
3
+ "name": "recurring",
3
4
  "description": "An recurring is used as an template for new invoices.",
4
5
  "properties":{
5
6
  "id":{
data/json/v1.0/sub.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {"type":"object",
2
2
  "title": "sub",
3
+ "name": "sub",
3
4
  "description": "Subscribe to push notifications(webhooks) about object livecycle events like new, update or delete. Only returns subscription for the current app, so you MUST be using oAuth. When a user removes your app its subs are also deleted. <br/>To register you must supply <br/>- callback_url: receives a base64 encode string containing a JSON object with the object in it's latest state, the user_id & subdomain, company_id, hmac-signed with your app secret.<br/>- channel: defining the event, made up of the SINGULAR object name and the action: invoice.delete, payment.new<br/> - register auth_permissions: An app MUST request non-api permissions f.ex.: clients:create. Perms(on company,app,user,team) are checked before any publishing, so if a user cannot create clients in the interface, his apps will not receive any callbacks.",
4
5
  "properties":{
5
6
  "id":{
@@ -0,0 +1,52 @@
1
+ { "type":"object",
2
+ "title": "sub_total_item",
3
+ "name": "sub_total_item",
4
+ "description": "A sub-total item shows a sum of the previous line items, e.g. to distinguish hardware and service costs on a document.",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "position":{
15
+ "description": "Required since items are sorted by position.",
16
+ "type":"integer",
17
+ "required":true
18
+ },
19
+ "name":{
20
+ "description": "Title of the sub-total e.g. Hardware total",
21
+ "type":"string",
22
+ "maxLength": 50
23
+ },
24
+ "net_total":{
25
+ "description": "Net sub-total",
26
+ "type":"number",
27
+ "readonly":true
28
+ },
29
+ "gross_total":{
30
+ "description": "Gross sub-total",
31
+ "type":"number",
32
+ "readonly":true
33
+ },
34
+ "created_at":{
35
+ "description": "Date the object was created in SK. Never changes afterwards",
36
+ "format":"date-time",
37
+ "readonly":true,
38
+ "type":"string"
39
+ },
40
+ "updated_at":{
41
+ "description": "Date the object was edited in SK.",
42
+ "format":"date-time",
43
+ "readonly":true,
44
+ "type":"string"
45
+ },
46
+ "_destroy":{
47
+ "description": "When set an existing item will be deleted. This switch is used for items passed-in nested inside their parent object(a document), which is default as long as there is no line item endpoint available.",
48
+ "type":"boolean"
49
+ }
50
+ },
51
+ "links":[]
52
+ }
data/json/v1.0/tag.json CHANGED
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "tag",
3
+ "name": "tag",
3
4
  "description":"A tag",
4
5
  "properties":{
5
6
  "id":{
@@ -1,5 +1,6 @@
1
1
  { "type":"object",
2
2
  "title": "text_template",
3
+ "name": "text_template",
3
4
  "description":"An text_template in SK",
4
5
  "properties":{
5
6
  "id":{
data/json/v1.0/user.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {"type":"object",
2
2
  "title": "user",
3
+ "name": "user",
3
4
  "description": "A user as seen by SalesKing",
4
5
  "properties":{
5
6
  "id":{
@@ -1,7 +1,7 @@
1
1
  module SK
2
2
  module Api
3
3
  class Schema
4
- VERSION='0.5.0'
4
+ VERSION='0.6.0'
5
5
  end
6
6
  end
7
7
  end
@@ -144,7 +144,7 @@ end
144
144
  ################################################################################
145
145
  # virtual classes used in test
146
146
  class Invoice
147
- attr_accessor :id, :title, :description, :number, :date, :due_date, :line_items, :client, :archived_pdf
147
+ attr_accessor :id, :title, :description, :number, :date, :due_date, :line_items, :client, :archived_pdf, :items
148
148
  end
149
149
 
150
150
  class LineItem
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sk_api_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -104,7 +104,7 @@ extra_rdoc_files:
104
104
  files:
105
105
  - .gitignore
106
106
  - .travis.yml
107
- - CHANGELOG.rdoc
107
+ - CHANGELOG.md
108
108
  - Gemfile
109
109
  - README.rdoc
110
110
  - Rakefile
@@ -115,6 +115,7 @@ files:
115
115
  - json/v1.0/comment.json
116
116
  - json/v1.0/company.json
117
117
  - json/v1.0/credit_note.json
118
+ - json/v1.0/divider_item.json
118
119
  - json/v1.0/document.json
119
120
  - json/v1.0/email.json
120
121
  - json/v1.0/email_template.json
@@ -131,6 +132,7 @@ files:
131
132
  - json/v1.0/product.json
132
133
  - json/v1.0/recurring.json
133
134
  - json/v1.0/sub.json
135
+ - json/v1.0/sub_total_item.json
134
136
  - json/v1.0/tag.json
135
137
  - json/v1.0/text_template.json
136
138
  - json/v1.0/user.json
@@ -153,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
155
  version: '0'
154
156
  segments:
155
157
  - 0
156
- hash: 4021308870819249197
158
+ hash: -3277987017950227307
157
159
  required_rubygems_version: !ruby/object:Gem::Requirement
158
160
  none: false
159
161
  requirements: