docstron 1.0.2 → 1.0.3

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.
@@ -15,7 +15,7 @@ class Applications {
15
15
  async create(params) {
16
16
  this._validateCreateParams(params);
17
17
 
18
- const response = await this.http.post('/v1/applications', params);
18
+ const response = await this.http.post('/applications', params);
19
19
  return response.data;
20
20
  }
21
21
 
@@ -30,7 +30,7 @@ class Applications {
30
30
  throw new Error('Applicaiton ID is required.');
31
31
  }
32
32
 
33
- const response = await this.http.get(`/v1/applications/${appId}`);
33
+ const response = await this.http.get(`/applications/${appId}`);
34
34
  return response.data;
35
35
  }
36
36
 
@@ -52,7 +52,7 @@ class Applications {
52
52
  throw new Error('At least one parameter is required to update');
53
53
  }
54
54
 
55
- const response = await this.http.put(`/v1/applications/${appId}`, params);
55
+ const response = await this.http.put(`/applications/${appId}`, params);
56
56
  return response.data;
57
57
  }
58
58
 
@@ -67,7 +67,7 @@ class Applications {
67
67
  throw new Error('Application ID is required');
68
68
  }
69
69
 
70
- const response = await this.http.delete(`/v1/applications/${appId}`);
70
+ const response = await this.http.delete(`/applications/${appId}`);
71
71
  return response.data;
72
72
  }
73
73
 
@@ -76,7 +76,7 @@ class Applications {
76
76
  * @returns {Promise<Array>} List of all applications
77
77
  */
78
78
  async list() {
79
- const response = await this.http.get('/v1/applications');
79
+ const response = await this.http.get('/applications');
80
80
  return response.data;
81
81
  }
82
82
 
@@ -31,13 +31,13 @@ class Documents {
31
31
 
32
32
  // For PDF response_type,
33
33
  if (payload.response_type === 'pdf') {
34
- const response = await this.http.post('/v1/documents/generate', payload, {
34
+ const response = await this.http.post('/documents/generate', payload, {
35
35
  responseType: 'arraybuffer',
36
36
  });
37
37
  return response;
38
38
  }
39
39
 
40
- const response = await this.http.post('/v1/documents/generate', payload);
40
+ const response = await this.http.post('/documents/generate', payload);
41
41
  return response.data;
42
42
  }
43
43
 
@@ -77,13 +77,13 @@ class Documents {
77
77
  }
78
78
 
79
79
  if (payload.response_type === 'pdf') {
80
- const response = await this.http.post('/v1/documents/quick/generate', payload, {
80
+ const response = await this.http.post('/documents/quick/generate', payload, {
81
81
  responseType: 'arraybuffer'
82
82
  });
83
83
  return response;
84
84
  }
85
85
 
86
- const response = await this.http.post('/v1/documents/quick/generate', payload);
86
+ const response = await this.http.post('/documents/quick/generate', payload);
87
87
  return response.data;
88
88
  }
89
89
 
@@ -98,7 +98,7 @@ class Documents {
98
98
  throw new Error('Document ID is required');
99
99
  }
100
100
 
101
- const response = await this.http.get(`/v1/documents/${documentId}`);
101
+ const response = await this.http.get(`/documents/${documentId}`);
102
102
  return response.data;
103
103
  }
104
104
 
@@ -108,7 +108,7 @@ class Documents {
108
108
  */
109
109
 
110
110
  async list() {
111
- const response = await this.http.get('/v1/documents');
111
+ const response = await this.http.get('/documents');
112
112
  return response.data;
113
113
  }
114
114
 
@@ -127,7 +127,7 @@ class Documents {
127
127
  throw new Error('Data is required to update the document');
128
128
  }
129
129
 
130
- const response = await this.http.put(`/v1/documents/${documentId}`, { data });
130
+ const response = await this.http.put(`/documents/${documentId}`, { data });
131
131
  return response.data;
132
132
  }
133
133
 
@@ -141,7 +141,7 @@ class Documents {
141
141
  if (!documentId) {
142
142
  throw new Error('Document ID is required');
143
143
  }
144
- const response = await this.http.delete(`/v1/documents/${documentId}`);
144
+ const response = await this.http.delete(`/documents/${documentId}`);
145
145
  return response.data;
146
146
  }
147
147
 
@@ -155,7 +155,7 @@ class Documents {
155
155
  if (!documentId) {
156
156
  throw new Error('Document ID is required');
157
157
  }
158
- const response = await this.http.get(`/v1/documents/download/${documentId}`, {
158
+ const response = await this.http.get(`/documents/download/${documentId}`, {
159
159
  responseType: 'arraybuffer'
160
160
  });
161
161
 
@@ -17,7 +17,7 @@ class Templates {
17
17
 
18
18
  async create(params) {
19
19
  this._validateCreateParams(params);
20
- const response = await this.http.post('/v1/templates', params);
20
+ const response = await this.http.post('/templates', params);
21
21
  return response.data;
22
22
  }
23
23
 
@@ -31,7 +31,7 @@ class Templates {
31
31
  throw new Error('Template ID is required');
32
32
  }
33
33
 
34
- const response = await this.http.get(`/v1/templates/${templateId}`);
34
+ const response = await this.http.get(`/templates/${templateId}`);
35
35
  return response.data;
36
36
  }
37
37
 
@@ -46,7 +46,7 @@ class Templates {
46
46
  throw new Error('Template ID is required');
47
47
  }
48
48
 
49
- const response = await this.http.put(`/v1/templates/${templateId}`, params);
49
+ const response = await this.http.put(`/templates/${templateId}`, params);
50
50
  return response.data;
51
51
  }
52
52
 
@@ -61,7 +61,7 @@ class Templates {
61
61
  throw new Error('Template ID is required');
62
62
  }
63
63
 
64
- const response = await this.http.delete(`/v1/templates/${templateId}`);
64
+ const response = await this.http.delete(`/templates/${templateId}`);
65
65
  return response.data;
66
66
  }
67
67
 
@@ -75,7 +75,7 @@ class Templates {
75
75
  throw new Error('Application ID is required');
76
76
  }
77
77
 
78
- const response = await this.http.get('/v1/templates', {
78
+ const response = await this.http.get('/templates', {
79
79
  params: { application_id: applicationId }
80
80
  });
81
81
  return response.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docstron",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Node.js SDK for Docstron PDF Generation API - Complete Features",
5
5
  "main": "index.js",
6
6
  "scripts": {