happypdf_json_schema 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  rvm:
2
- - 1.8.7
3
- - 1.9.2
2
+ - 1.9.3
4
3
  gemfile:
5
4
  - Gemfile
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
  gemspec
@@ -4,7 +4,7 @@ require 'happypdf/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.version = HappyPdf::Schema::VERSION
7
- s.date = %q{2012-12-23}
7
+ s.date = %q{2013-10-27}
8
8
  s.name = %q{happypdf_json_schema}
9
9
  s.summary = 'happyPDF API - JSON Schema'
10
10
  s.description = %q{happyPDF JSON Schema describes our PDF API in terms of available objects, their fields and links to url endpoints with related objects.
@@ -1,5 +1,5 @@
1
1
  module HappyPdf
2
2
  class Schema
3
- VERSION='0.0.3'
3
+ VERSION='0.1.0'
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@
5
5
  "type":"object",
6
6
  "properties":{
7
7
  "name": {
8
- "description": "Name of the block. Must unique within each page. [ ] / are not allowed.",
8
+ "description": "Name of the block. Must unique within each page. [ ] / are not allowed. To render content twice append #[1-9] to the blockname e.g. firstname#12",
9
9
  "type": "string",
10
10
  "maxLength": 125,
11
11
  "required": true
@@ -2,7 +2,7 @@
2
2
  "type": "object",
3
3
  "title": "Page",
4
4
  "name": "page",
5
- "description": "A page of a PDF which can either belong to a PDF template or archived PDF.",
5
+ "description": "A page of a PDF which can either belong to a PDF template or archived PDF. ",
6
6
  "properties": {
7
7
  "id": {
8
8
  "description": "The object identifier.",
@@ -15,59 +15,26 @@
15
15
  "readonly": true,
16
16
  "type": "integer"
17
17
  },
18
- "related_object_id": {
19
- "description": "ID of the PDF object the page belongs to.",
20
- "readonly": true,
21
- "type": "integer"
22
- },
23
- "related_object_type": {
24
- "description": "Type of the related object Pdf or Pdt (camelCased class name)",
25
- "readonly": true,
26
- "type": "string",
27
- "maxlength": 20
28
- },
29
18
  "width": {
30
19
  "description": "Page width",
31
20
  "type": "number"
32
21
  },
33
- "created_at": {
34
- "description": "Creation date.",
35
- "readonly": true,
36
- "type": "string",
37
- "format": "date-time"
38
- },
39
- "updated_at": {
40
- "description": "Update date.",
41
- "readonly": true,
42
- "type": "string",
43
- "format": "date-time"
44
- },
45
- "user_id": {
46
- "description": "User who created the object.",
47
- "readonly": true,
48
- "type": "integer"
49
- },
50
- "screenshot": {
51
- "description": "Screenshot file url png",
52
- "type": "string",
53
- "maxlength": 128
54
- },
55
- "account_id": {
56
- "description": "Account this objects belongs to.",
57
- "type": "integer"
58
- },
59
22
  "blocks": {
60
- "description": "Placeholder blocks on this page,, if it belongs to a PDF Template",
23
+ "description": "Placeholder blocks on this page, if it belongs to a PDF Template",
61
24
  "type": "array",
62
25
  "properties": {"$ref":"./block.json#properties"}
26
+ },
27
+ "public_id": {
28
+ "description": "Unique ID to be used in public URL e.g to get the screenshot image of a page.",
29
+ "readonly": true,
30
+ "type": "string"
63
31
  }
64
-
65
32
  },
66
33
  "links": [
67
34
  {
68
- "rel": "self",
35
+ "rel": "public screenshot",
69
36
  "method": "GET",
70
- "href": "/pages/{id}"
37
+ "href": "/public/pages/{public_id}/screenshot"
71
38
  }
72
39
  ]
73
40
  }
@@ -0,0 +1,75 @@
1
+ {
2
+ "type": "object",
3
+ "title": "PDF",
4
+ "name": "pdf",
5
+ "description": "A PDF created from a template.",
6
+ "properties": {
7
+ "id": {
8
+ "description": "The object identifier.",
9
+ "identity": true,
10
+ "readonly": true,
11
+ "type": "integer"
12
+ },
13
+ "filename": {
14
+ "description": "Filename",
15
+ "type": "string",
16
+ "maxlength": 128
17
+ },
18
+ "pdt_id": {
19
+ "description": "PDF Template id, used to create this PDF.",
20
+ "type": "integer"
21
+ },
22
+ "user_id": {
23
+ "description": "User who created the object",
24
+ "type": "integer"
25
+ },
26
+ "created_at": {
27
+ "description": "Creation date",
28
+ "readonly": true,
29
+ "type": "string",
30
+ "format": "date-time"
31
+ },
32
+ "md5": {
33
+ "description": "MD5 hash created from pdf string.",
34
+ "type": "string",
35
+ "maxlength": 40
36
+ },
37
+ "account_id": {
38
+ "description": "Account this objects belongs to.",
39
+ "type": "integer"
40
+ },
41
+ "pages": {
42
+ "description": "Pages of the pdf, sorted by page number.",
43
+ "type": "array",
44
+ "properties":{"$ref":"./page.json#properties"}
45
+ }
46
+ },
47
+ "links": [
48
+ {
49
+ "rel": "self",
50
+ "href": "/pdfs/{id}"
51
+ },
52
+ {
53
+ "rel": "instances",
54
+ "method": "GET",
55
+ "href": "/pdfs"
56
+ },
57
+ {
58
+ "rel": "create",
59
+ "method": "POST",
60
+ "href": "/pdfs",
61
+ "properties": {
62
+ "pdt_id":{
63
+ "title" : "Template",
64
+ "description": "ID of an PDF template to use.",
65
+ "required": true
66
+ }
67
+ }
68
+ },
69
+ {
70
+ "rel": "destroy",
71
+ "method": "DELETE",
72
+ "href": "/pdfs/{id}"
73
+ }
74
+ ]
75
+ }
@@ -17,6 +17,4 @@ describe HappyPdf::Schema do
17
17
  end
18
18
 
19
19
  end
20
-
21
-
22
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: happypdf_json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-23 00:00:00.000000000 Z
12
+ date: 2013-10-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
@@ -99,6 +99,7 @@ files:
99
99
  - schema/v1.0/block.json
100
100
  - schema/v1.0/image_block.json
101
101
  - schema/v1.0/page.json
102
+ - schema/v1.0/pdf.json
102
103
  - schema/v1.0/pdt.json
103
104
  - schema/v1.0/table.json
104
105
  - schema/v1.0/table_cell.json
@@ -120,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
121
  version: '0'
121
122
  segments:
122
123
  - 0
123
- hash: 4509264459645895034
124
+ hash: -1329503588929183214
124
125
  required_rubygems_version: !ruby/object:Gem::Requirement
125
126
  none: false
126
127
  requirements:
@@ -129,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
130
  version: '0'
130
131
  requirements: []
131
132
  rubyforge_project:
132
- rubygems_version: 1.8.24
133
+ rubygems_version: 1.8.25
133
134
  signing_key:
134
135
  specification_version: 3
135
136
  summary: happyPDF API - JSON Schema