groupdocs 0.3.11 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/CHANGELOG.md +150 -0
  2. data/README.md +6 -58
  3. data/Rakefile +1 -1
  4. data/examples/README.md +13 -0
  5. data/examples/annotations/Gemfile +5 -0
  6. data/examples/annotations/app.rb +67 -0
  7. data/groupdocs.gemspec +3 -3
  8. data/lib/groupdocs.rb +11 -2
  9. data/lib/groupdocs/api/entity.rb +17 -1
  10. data/lib/groupdocs/api/helpers/path_helper.rb +10 -10
  11. data/lib/groupdocs/api/helpers/rest_helper.rb +7 -2
  12. data/lib/groupdocs/api/helpers/url_helper.rb +2 -4
  13. data/lib/groupdocs/api/request.rb +2 -4
  14. data/lib/groupdocs/datasource.rb +2 -2
  15. data/lib/groupdocs/datasource/field.rb +1 -1
  16. data/lib/groupdocs/document.rb +6 -18
  17. data/lib/groupdocs/document/annotation.rb +25 -2
  18. data/lib/groupdocs/document/annotation/reply.rb +6 -10
  19. data/lib/groupdocs/document/change.rb +1 -1
  20. data/lib/groupdocs/document/field.rb +1 -1
  21. data/lib/groupdocs/document/metadata.rb +1 -1
  22. data/lib/groupdocs/document/rectangle.rb +1 -1
  23. data/lib/groupdocs/document/view.rb +1 -1
  24. data/lib/groupdocs/job.rb +51 -8
  25. data/lib/groupdocs/questionnaire.rb +2 -2
  26. data/lib/groupdocs/questionnaire/execution.rb +1 -1
  27. data/lib/groupdocs/questionnaire/page.rb +1 -1
  28. data/lib/groupdocs/questionnaire/question.rb +1 -1
  29. data/lib/groupdocs/questionnaire/question/answer.rb +1 -1
  30. data/lib/groupdocs/signature.rb +134 -0
  31. data/lib/groupdocs/signature/contact.rb +141 -0
  32. data/lib/groupdocs/signature/envelope.rb +376 -0
  33. data/lib/groupdocs/signature/envelope/log.rb +22 -0
  34. data/lib/groupdocs/signature/field.rb +253 -0
  35. data/lib/groupdocs/signature/field/location.rb +72 -0
  36. data/lib/groupdocs/signature/form.rb +202 -0
  37. data/lib/groupdocs/signature/list.rb +93 -0
  38. data/lib/groupdocs/signature/recipient.rb +47 -0
  39. data/lib/groupdocs/signature/role.rb +84 -0
  40. data/lib/groupdocs/signature/shared.rb +6 -0
  41. data/lib/groupdocs/signature/shared/document_methods.rb +98 -0
  42. data/lib/groupdocs/signature/shared/entity_fields.rb +94 -0
  43. data/lib/groupdocs/signature/shared/entity_methods.rb +145 -0
  44. data/lib/groupdocs/signature/shared/field_methods.rb +282 -0
  45. data/lib/groupdocs/signature/shared/recipient_methods.rb +63 -0
  46. data/lib/groupdocs/signature/shared/resource_methods.rb +65 -0
  47. data/lib/groupdocs/signature/template.rb +104 -0
  48. data/lib/groupdocs/storage/file.rb +69 -62
  49. data/lib/groupdocs/storage/folder.rb +54 -88
  50. data/lib/groupdocs/storage/package.rb +1 -1
  51. data/lib/groupdocs/subscription.rb +113 -0
  52. data/lib/groupdocs/subscription/limit.rb +24 -0
  53. data/lib/groupdocs/user.rb +22 -2
  54. data/lib/groupdocs/version.rb +1 -1
  55. data/spec/groupdocs/api/entity_spec.rb +14 -0
  56. data/spec/groupdocs/api/helpers/path_helper_spec.rb +6 -19
  57. data/spec/groupdocs/api/helpers/rest_helper_spec.rb +9 -0
  58. data/spec/groupdocs/api/request_spec.rb +2 -7
  59. data/spec/groupdocs/datasource_spec.rb +3 -7
  60. data/spec/groupdocs/document/annotation/reply_spec.rb +11 -20
  61. data/spec/groupdocs/document/annotation_spec.rb +35 -31
  62. data/spec/groupdocs/document/field_spec.rb +1 -4
  63. data/spec/groupdocs/document/rectangle_spec.rb +10 -22
  64. data/spec/groupdocs/document_spec.rb +7 -27
  65. data/spec/groupdocs/job_spec.rb +43 -0
  66. data/spec/groupdocs/questionnaire/question_spec.rb +2 -6
  67. data/spec/groupdocs/questionnaire_spec.rb +3 -7
  68. data/spec/groupdocs/signature/contact_spec.rb +129 -0
  69. data/spec/groupdocs/signature/envelope/log_spec.rb +23 -0
  70. data/spec/groupdocs/signature/envelope_spec.rb +296 -0
  71. data/spec/groupdocs/signature/field/location_spec.rb +73 -0
  72. data/spec/groupdocs/signature/field_spec.rb +264 -0
  73. data/spec/groupdocs/signature/form_spec.rb +174 -0
  74. data/spec/groupdocs/signature/list_spec.rb +92 -0
  75. data/spec/groupdocs/signature/recipient_spec.rb +37 -0
  76. data/spec/groupdocs/signature/role_spec.rb +100 -0
  77. data/spec/groupdocs/signature/template_spec.rb +82 -0
  78. data/spec/groupdocs/signature_spec.rb +117 -0
  79. data/spec/groupdocs/storage/file_spec.rb +76 -61
  80. data/spec/groupdocs/storage/folder_spec.rb +43 -90
  81. data/spec/groupdocs/storage/package_spec.rb +1 -2
  82. data/spec/groupdocs/subscription/limit_spec.rb +24 -0
  83. data/spec/groupdocs/subscription_spec.rb +85 -0
  84. data/spec/groupdocs/user_spec.rb +27 -18
  85. data/spec/groupdocs_spec.rb +11 -0
  86. data/spec/spec_helper.rb +10 -1
  87. data/spec/support/files/envelope.zip +0 -0
  88. data/spec/support/json/annotation_access_set.json +11 -0
  89. data/spec/support/json/contact_add.json +12 -0
  90. data/spec/support/json/contacts_get.json +19 -0
  91. data/spec/support/json/contacts_import.json +8 -0
  92. data/spec/support/json/envelope_get.json +46 -0
  93. data/spec/support/json/envelope_logs.json +16 -0
  94. data/spec/support/json/envelopes_all.json +48 -0
  95. data/spec/support/json/envelopes_resources.json +31 -0
  96. data/spec/support/json/form_get.json +21 -0
  97. data/spec/support/json/forms_all.json +23 -0
  98. data/spec/support/json/job_get.json +30 -0
  99. data/spec/support/json/list_add.json +12 -0
  100. data/spec/support/json/lists_get.json +19 -0
  101. data/spec/support/json/signature_create.json +12 -0
  102. data/spec/support/json/signature_field_add.json +25 -0
  103. data/spec/support/json/signature_fields_get.json +27 -0
  104. data/spec/support/json/signature_roles_get.json +17 -0
  105. data/spec/support/json/signatures_get.json +19 -0
  106. data/spec/support/json/subscription_plan_get.json +9 -0
  107. data/spec/support/json/subscription_plans_get.json +17 -0
  108. data/spec/support/json/template_get.json +35 -0
  109. data/spec/support/json/template_get_documents.json +15 -0
  110. data/spec/support/json/template_get_recipients.json +20 -0
  111. data/spec/support/json/templates_all.json +37 -0
  112. data/spec/support/json/user_users_get.json +27 -0
  113. data/spec/support/shared_examples/signature/shared/document_methods.rb +68 -0
  114. data/spec/support/shared_examples/signature/shared/entity_fields.rb +89 -0
  115. data/spec/support/shared_examples/signature/shared/entity_methods.rb +116 -0
  116. data/spec/support/shared_examples/signature/shared/field_methods.rb +188 -0
  117. data/spec/support/shared_examples/signature/shared/recipient_methods.rb +42 -0
  118. data/spec/support/shared_examples/signature/shared/resource_methods.rb +46 -0
  119. metadata +139 -29
  120. data/lib/groupdocs/extensions.rb +0 -1
  121. data/lib/groupdocs/extensions/lookup.rb +0 -52
  122. data/spec/support/shared_examples/extensions/lookup.rb +0 -57
@@ -0,0 +1,12 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "contact":
6
+ {
7
+ "id": "osdns9fuyw",
8
+ "firstName": "Test1",
9
+ "lastName": "Test1"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "contacts":
6
+ [
7
+ {
8
+ "id": "osdns9fuyw",
9
+ "firstName": "Test1",
10
+ "lastName": "Test1"
11
+ },
12
+ {
13
+ "id": "asdifjh9fdgd9",
14
+ "firstName": "Test2",
15
+ "lastName": "Test2"
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "imported": 2,
6
+ "ignored": 0
7
+ }
8
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "envelope":
6
+ {
7
+ "id": "f0dc546a8f3705e3e8d861dee5efa363",
8
+ "name": "New envelope",
9
+ "creationDateTime": "2012-06-02T08:16:28.1470000Z",
10
+ "ownerId": 115,
11
+ "ownerGuid": "67e9cf57a2b9da4d",
12
+ "status": -1,
13
+ "statusDateTime": "1970-01-01T00:00:00.0000000Z",
14
+ "reminderTime": 1,
15
+ "stepExpireTime": 3,
16
+ "envelopeExpireTime": 6,
17
+ "ownerShouldSign": true,
18
+ "orderedSignature": false,
19
+ "emailSubject": "",
20
+ "emailBody": "",
21
+ "documentsCount": 0,
22
+ "documentsPages": 0,
23
+ "recipients":
24
+ [
25
+ {
26
+ "id": "1252fbc7c4704d6ff8535a9daeaaff0e",
27
+ "firstName": "John",
28
+ "lastName": "Smith",
29
+ "email": "test@test.com",
30
+ "userId": 115,
31
+ "userGuid": "67e9cf57a2b9da4d",
32
+ "order": 32767,
33
+ "roleId": 2,
34
+ "status": 0,
35
+ "statusMessage": null,
36
+ "statusDateTime": "1970-01-01T00:00:00",
37
+ "delegatedRecipientId": null,
38
+ "signatureFingerprint": null,
39
+ "signatureHost": null,
40
+ "signatureLocation": null,
41
+ "signatureBrowser": null
42
+ }
43
+ ]
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "logs":
6
+ [
7
+ {
8
+ "id": "f0dc546a8f3705e3e8d861dee5efa363",
9
+ "date": "2012-09-25T07:48:23.0730000Z",
10
+ "userName": "New template",
11
+ "action": "Recipient added",
12
+ "remoteAddress": "8.8.8.8"
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "envelopes":
6
+ [
7
+ {
8
+ "id": "f0dc546a8f3705e3e8d861dee5efa363",
9
+ "name": "New envelope",
10
+ "creationDateTime": "2012-06-02T08:16:28.1470000Z",
11
+ "ownerId": 115,
12
+ "ownerGuid": "67e9cf57a2b9da4d",
13
+ "status": -1,
14
+ "statusDateTime": "1970-01-01T00:00:00.0000000Z",
15
+ "reminderTime": 1,
16
+ "stepExpireTime": 3,
17
+ "envelopeExpireTime": 6,
18
+ "ownerShouldSign": true,
19
+ "orderedSignature": false,
20
+ "emailSubject": "",
21
+ "emailBody": "",
22
+ "documentsCount": 0,
23
+ "documentsPages": 0,
24
+ "recipients":
25
+ [
26
+ {
27
+ "id": "1252fbc7c4704d6ff8535a9daeaaff0e",
28
+ "firstName": "John",
29
+ "lastName": "Smith",
30
+ "email": "test@test.com",
31
+ "userId": 115,
32
+ "userGuid": "67e9cf57a2b9da4d",
33
+ "order": 32767,
34
+ "roleId": 2,
35
+ "status": 0,
36
+ "statusMessage": null,
37
+ "statusDateTime": "1970-01-01T00:00:00",
38
+ "delegatedRecipientId": null,
39
+ "signatureFingerprint": null,
40
+ "signatureHost": null,
41
+ "signatureLocation": null,
42
+ "signatureBrowser": null
43
+ }
44
+ ]
45
+ }
46
+ ]
47
+ }
48
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "documents":
6
+ [
7
+ {
8
+ "documentId": "1252fbc7c4704d6ff8535a9daeaaff0e",
9
+ "templateId": "f0dc546a8f3705e3e8d861dee5efa363",
10
+ "order": 1
11
+ }
12
+ ],
13
+ "recipients":
14
+ [
15
+ {
16
+ "id": "1252fbc7c4704d6ff8535a9daeaaff0e",
17
+ "firstName": "John",
18
+ "lastName": "Smith",
19
+ "email": "test@test.com",
20
+ "userId": 115,
21
+ "userGuid": "67e9cf57a2b9da4d",
22
+ "order": 32767,
23
+ "roleId": 2
24
+ }
25
+ ],
26
+ "dates":
27
+ [
28
+ "2012-09-25T00:00:00.0000000"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "form":
6
+ {
7
+ "id": "09662aab7187f31444476288ebaf7da4",
8
+ "name": "form-name",
9
+ "ownerGuid": "67e9cf57a2b9da4d",
10
+ "templateGuid": "9758770d03b92c886133fbd7bbb60391",
11
+ "createdTimeStamp": "2012-09-26T14:03:51.9670000Z",
12
+ "status": -1,
13
+ "statusDateTime": "1970-01-01T00:00:00.0000000Z",
14
+ "documentsCount": 0,
15
+ "documentsPages": 0,
16
+ "participantsCount": 0,
17
+ "fieldsInFinalFileName": [],
18
+ "canParticipantDownloadForm": false
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "forms":
6
+ [
7
+ {
8
+ "id": "09662aab7187f31444476288ebaf7da4",
9
+ "name": "form-name",
10
+ "ownerGuid": "67e9cf57a2b9da4d",
11
+ "templateGuid": "9758770d03b92c886133fbd7bbb60391",
12
+ "createdTimeStamp": "2012-09-26T14:03:51.9670000Z",
13
+ "status": -1,
14
+ "statusDateTime": "1970-01-01T00:00:00.0000000Z",
15
+ "documentsCount": 0,
16
+ "documentsPages": 0,
17
+ "participantsCount": 0,
18
+ "fieldsInFinalFileName": [],
19
+ "canParticipantDownloadForm": false
20
+ }
21
+ ]
22
+ }
23
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "result":
3
+ {
4
+ "id": 1,
5
+ "guid": "9dfhs9vhfivjdf0vj0difmvp",
6
+ "status": "Archived",
7
+ "documents":
8
+ {
9
+ "inputs":
10
+ [
11
+ {
12
+ "status": "InProgress",
13
+ "output_formats": "pdf",
14
+ "outputs":
15
+ [
16
+ {
17
+ "ftype": 19,
18
+ "error": null,
19
+ "url": "http://groupdocs.com",
20
+ "name": "Test.pdf"
21
+ }
22
+ ],
23
+ "id": 123
24
+ }
25
+ ]
26
+ }
27
+ },
28
+ "status": "Ok",
29
+ "error_message": null
30
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "list":
6
+ {
7
+ "id": "osdns9fuyw",
8
+ "name": "Test1",
9
+ "values": "Test1;Test2"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "lists":
6
+ [
7
+ {
8
+ "id": "osdns9fuyw",
9
+ "name": "Test1",
10
+ "values": "Test1;Test2"
11
+ },
12
+ {
13
+ "id": "asdifjh9fdgd9",
14
+ "name": "Test2",
15
+ "values": "Test2;Test3"
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "signature":
6
+ {
7
+ "id": "osdns9fuyw",
8
+ "firstName": "Test1",
9
+ "lastName": "Test1"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "field":
6
+ {
7
+ "id": "0545e589fb3e27c9bb7a1f59d0e3fcb9",
8
+ "name": "Signature",
9
+ "graphSizeW": 0,
10
+ "graphSizeH": 0,
11
+ "getDataFrom": null,
12
+ "regularExpression": null,
13
+ "fontName": null,
14
+ "fontColor": null,
15
+ "fontSize": 0,
16
+ "fontBold": false,
17
+ "fontItalic": false,
18
+ "fontUnderline": false,
19
+ "isSystem": true,
20
+ "fieldType": 1,
21
+ "acceptableValues": null,
22
+ "defaultValue": null
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "fields":
6
+ [
7
+ {
8
+ "id": "0545e589fb3e27c9bb7a1f59d0e3fcb9",
9
+ "name": "Signature",
10
+ "graphSizeW": 0,
11
+ "graphSizeH": 0,
12
+ "getDataFrom": null,
13
+ "regularExpression": null,
14
+ "fontName": null,
15
+ "fontColor": null,
16
+ "fontSize": 0,
17
+ "fontBold": false,
18
+ "fontItalic": false,
19
+ "fontUnderline": false,
20
+ "isSystem": true,
21
+ "fieldType": 1,
22
+ "acceptableValues": null,
23
+ "defaultValue": null
24
+ }
25
+ ]
26
+ }
27
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "roles":
6
+ [
7
+ {
8
+ "id": "osdns9fuyw",
9
+ "name": "Owner",
10
+ "canEdit": 1,
11
+ "canSign": 1,
12
+ "canAnnotate": 1,
13
+ "canDelegate": 1
14
+ }
15
+ ]
16
+ }
17
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "signatures":
6
+ [
7
+ {
8
+ "id": "osdns9fuyw",
9
+ "firstName": "Test1",
10
+ "lastName": "Test1"
11
+ },
12
+ {
13
+ "id": "asdifjh9fdgd9",
14
+ "firstName": "Test2",
15
+ "lastName": "Test2"
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "result":
3
+ {
4
+ "ref_id": "1",
5
+ "name": "Free"
6
+ },
7
+ "status": "Ok",
8
+ "error_message": null
9
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "result": {
3
+ "metrics":
4
+ [
5
+ {
6
+ "id": "1",
7
+ "name": "Free"
8
+ },
9
+ {
10
+ "id": "2",
11
+ "name": "Individual"
12
+ }
13
+ ]
14
+ },
15
+ "status": "Ok",
16
+ "error_message": null
17
+ }