@lowdefy/connection-axios-http 0.0.0-experimental-20251010122007 → 0.0.0-experimental-20251015143743

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.
package/LICENSE CHANGED
@@ -2,180 +2,180 @@
2
2
  Version 2.0, January 2004
3
3
  http://www.apache.org/licenses/
4
4
 
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
179
 
180
180
  To apply the Apache License to your work, attach the following
181
181
  boilerplate notice, with the fields enclosed by brackets "[]"
@@ -186,16 +186,16 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [yyyy] [name of copyright owner]
189
+ Copyright [yyyy] [name of copyright owner]
190
190
 
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
194
 
195
195
  http://www.apache.org/licenses/LICENSE-2.0
196
196
 
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/connection-axios-http",
3
- "version": "0.0.0-experimental-20251010122007",
3
+ "version": "0.0.0-experimental-20251015143743",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -35,11 +35,11 @@
35
35
  "dist/*"
36
36
  ],
37
37
  "dependencies": {
38
- "@lowdefy/helpers": "0.0.0-experimental-20251010122007",
38
+ "@lowdefy/helpers": "0.0.0-experimental-20251015143743",
39
39
  "axios": "1.8.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@lowdefy/ajv": "0.0.0-experimental-20251010122007",
42
+ "@lowdefy/ajv": "0.0.0-experimental-20251015143743",
43
43
  "@swc/cli": "0.1.63",
44
44
  "@swc/core": "1.3.99",
45
45
  "@swc/jest": "0.2.29",
@@ -1,305 +0,0 @@
1
- <TITLE>
2
- AxiosHttp
3
- </TITLE>
4
-
5
- <DESCRIPTION>
6
-
7
- ### Properties
8
-
9
- - `url: string`: The server URL that will be used for the request.
10
- - `method: enum`: Default: `'get'` - The request method to be used when making the request. Options are:
11
- - `'get'`
12
- - `'delete'`
13
- - `'head'`
14
- - `'options'`
15
- - `'post'`
16
- - `'put'`
17
- - `'patch'`
18
- - `baseURL: string`: `baseURL` will be prepended to `url` unless `url` is absolute. It can be convenient to set `baseURL` for an axios connection to pass relative URLs to requests or mutations using that connection.
19
- - `headers: object`: An object with custom headers to be sent sent with the request. The object keys should be header names, and the values should be the string header values.
20
- - `params: object`: An object with URL parameters to be sent with the request.
21
- - `data: string | object | array`: The data to be sent as the request body. Only applicable for request methods `'put'`, `'post'`, and `'patch'`. Can be an object, array or a string in the format `'Country=Brasil&City=Belo Horizonte'`.
22
- - `auth: object`: Indicates that HTTP Basic authorization should be used, and supplies credentials. This will set an `Authorization` header, overwriting any existing `Authorization` custom headers you have set using `headers`. Only HTTP Basic auth is configurable through this parameter, for Bearer tokens and such, use `Authorization` custom headers instead. The `auth` object should have the following fields:
23
- - `username: string`
24
- - `password: string`
25
- - `httpAgentOptions: object`: Options to pass to the Node.js [`http.Agent`](https://nodejs.org/api/http.html#http_class_http_agent) class.
26
- - `httpsAgentOptions: object`: Options to pass to the Node.js [`https.Agent`](https://nodejs.org/api/http.html#http_class_http_agent) class.
27
- - `maxContentLength: number`: Defines the max size of the http response content allowed in bytes.
28
- - `maxRedirects: number`: Defines the maximum number of redirects to follow. If set to 0, no redirects will be followed.
29
- - `proxy: object`: Defines the hostname and port of the proxy server. The `proxy` object should have the following fields:
30
- - `host: string`: Host IP address (eg. `'127.0.0.1'`).
31
- - `port: number`: Port number.
32
- - `auth: object`: Object with username and password.
33
- - `responseType: enum`: Default: `'json'` - The type of data that the server will respond with. Options are:
34
- - `'document'`
35
- - `'json'`
36
- - `'text'`
37
- - `responseEncoding: string`: Default: `'utf8'` - Indicates encoding to use for decoding responses.
38
- - `timeout: number`: Default: `0` (no timeout) - The number of milliseconds before the request times out. If the request takes longer than `timeout`, the request will be aborted. Set to `0` for no timeout.
39
- - `transformRequest: function`: A function to transform the request data before it is sent. Receives `data` and `headers` as arguments and should return the data to be sent.
40
- - `transformResponse: function`: A function to transform the received data. Receives `data` as an argument and should return the transformed data.
41
- - `validateStatus: function`: A function to validate whether the response should complete successfully given a status code. Receives `status` as an argument and should `true` if the status code is valid.
42
-
43
- </DESCRIPTION>
44
-
45
- <CONNECTION>
46
- AxiosHttp
47
- </CONNECTION>
48
-
49
- <SCHEMA>
50
-
51
- ```js
52
- export default {
53
- $schema: 'http://json-schema.org/draft-07/schema#',
54
- title: 'Lowdefy Connection Schema - AxiosHttp',
55
- type: 'object',
56
- properties: {
57
- url: {
58
- type: 'string',
59
- description: 'The server URL that will be used for the request.',
60
- errorMessage: {
61
- type: 'AxiosHttp property "url" should be a string.',
62
- },
63
- },
64
- method: {
65
- type: 'string',
66
- enum: ['get', 'delete', 'head', 'options', 'post', 'put', 'patch'],
67
- description: 'The request method to be used when making the request',
68
- errorMessage: {
69
- type: 'AxiosHttp property "method" should be a string.',
70
- enum: 'AxiosHttp property "method" is not a valid value.',
71
- },
72
- },
73
- baseURL: {
74
- type: 'string',
75
- description:
76
- 'baseURL will be prepended to url unless url is absolute. It can be convenient to set baseURL for an axios connection so that requests can use relative urls.',
77
- errorMessage: {
78
- type: 'AxiosHttp property "baseURL" should be a string.',
79
- },
80
- },
81
- headers: {
82
- type: 'object',
83
- description:
84
- 'An object with custom headers to be sent with the request. The object keys should be header names, and the values should be the string header values.',
85
- errorMessage: {
86
- type: 'AxiosHttp property "headers" should be an object.',
87
- },
88
- },
89
- params: {
90
- type: 'object',
91
- description: 'An object with URL parameters to be sent with the request.',
92
- errorMessage: {
93
- type: 'AxiosHttp property "params" should be an object.',
94
- },
95
- },
96
- data: {
97
- description:
98
- "The data to be sent as the request body. Only applicable for request methods 'put', 'post', and 'patch'. Can be an object, array or a string in the format 'Country=USA&City=New York'.",
99
- },
100
- timeout: {
101
- type: 'number',
102
- description:
103
- 'The number of milliseconds before the request times out. If the request takes longer than timeout, the request will be aborted. Set to 0 for no timeout.',
104
- default: 0,
105
- errorMessage: {
106
- type: 'AxiosHttp property "timeout" should be a number.',
107
- },
108
- },
109
- auth: {
110
- type: 'object',
111
- description:
112
- 'Indicates that HTTP Basic authorization should be used, and supplies credentials. This will set an Authorization header, overwriting any existing Authorization custom headers you have set using headers. Only HTTP Basic auth is configurable through this parameter, for Bearer tokens and such, use Authorization custom headers instead.',
113
- properties: {
114
- username: {
115
- type: 'string',
116
- description: 'HTTP Basic authorization username.',
117
- errorMessage: {
118
- type: 'AxiosHttp property "auth.username" should be a string.',
119
- },
120
- },
121
- password: {
122
- type: 'string',
123
- description: 'HTTP Basic authorization password.',
124
- errorMessage: {
125
- type: 'AxiosHttp property "auth.password" should be a string.',
126
- },
127
- },
128
- },
129
- errorMessage: {
130
- type: 'AxiosHttp property "auth" should be an object.',
131
- },
132
- },
133
- responseType: {
134
- type: 'string',
135
- enum: ['json', 'document', 'text'],
136
- description: 'The type of data that the server should respond with.',
137
- default: 'json',
138
- errorMessage: {
139
- type: 'AxiosHttp property "responseType" should be a string.',
140
- enum: 'AxiosHttp property "responseType" is not a valid value.',
141
- },
142
- },
143
- responseEncoding: {
144
- type: 'string',
145
- description: 'Indicates encoding to use for decoding responses.',
146
- default: 'utf8',
147
- errorMessage: {
148
- type: 'AxiosHttp property "responseEncoding" should be a string.',
149
- },
150
- },
151
- maxContentLength: {
152
- type: 'number',
153
- description: 'Defines the max size of the http response content allowed in bytes.',
154
- errorMessage: {
155
- type: 'AxiosHttp property "maxContentLength" should be a number.',
156
- },
157
- },
158
- maxRedirects: {
159
- type: 'number',
160
- description:
161
- 'Defines the maximum number of redirects to follow. If set to 0, no redirects will be followed.',
162
- default: 5,
163
- errorMessage: {
164
- type: 'AxiosHttp property "maxRedirects" should be a number.',
165
- },
166
- },
167
- proxy: {
168
- type: 'object',
169
- description: 'Defines the hostname and port of the proxy server.',
170
- errorMessage: {
171
- type: 'AxiosHttp property "proxy" should be an object.',
172
- },
173
- },
174
- },
175
- };
176
- ```
177
-
178
- </SCHEMA>
179
-
180
- <EXAMPLES>
181
-
182
- Properties for a AxiosHttp can be set on either the connection, the request, or both. However, both a connection and request need to be defined.
183
-
184
- ### A basic full example requesting data from https://jsonplaceholder.typicode.com
185
-
186
- ```yaml
187
- lowdefy: {{ version }}
188
- name: Lowdefy starter
189
- connections:
190
- - id: my_api
191
- type: AxiosHttp
192
- properties:
193
- baseURL: https://jsonplaceholder.typicode.com
194
- pages:
195
- - id: welcome
196
- type: PageHeaderMenu
197
- requests:
198
- - id: get_posts
199
- type: AxiosHttp
200
- connectionId: my_api
201
- properties:
202
- url: /posts
203
- events:
204
- onInit:
205
- - id: fetch_get_posts
206
- type: Request
207
- params: get_posts
208
- blocks:
209
- - id: rest_data
210
- type: Markdown
211
- properties:
212
- content:
213
- _string.concat:
214
- - |
215
- ```yaml
216
- - _yaml.stringify:
217
- - _request: get_posts
218
- - |
219
- ```
220
- ```
221
-
222
- ### Using the connection to set baseURL and authorization, and handle specific requests as requests
223
-
224
- ```yaml
225
- connections:
226
- - id: app_api
227
- type: AxiosHttp
228
- properties:
229
- baseURL: app.com/api
230
- auth:
231
- username: api_user
232
- password:
233
- _secret: API_PASSWORD
234
- # ...
235
- requests:
236
- - id: get_orders
237
- type: AxiosHttp
238
- connectionId: app_api
239
- properties:
240
- url: /orders
241
- - id: update_order
242
- type: AxiosHttp
243
- connectionId: app_api
244
- payload:
245
- order_id:
246
- _state: order_id
247
- data:
248
- _state: true
249
- properties:
250
- url:
251
- _nunjucks:
252
- template: /orders/{{ order_id }}
253
- on:
254
- order_id:
255
- _payload: order_id
256
- method: post
257
- data:
258
- _payload: data
259
- ```
260
-
261
- ### Setting properties on only the connection
262
-
263
- ```yaml
264
- connections:
265
- - id: get_count
266
- type: AxiosHttp
267
- properties:
268
- url: myapp.com/api/count
269
- headers:
270
- X-Api-Key:
271
- _secret: API_KEY
272
- # ...
273
- requests:
274
- - id: get_count
275
- type: AxiosHttp
276
- connectionId: get_count
277
- ```
278
-
279
- ### Setting properties on only the request, and using a generic connection
280
-
281
- ```yaml
282
- connections:
283
- - id: axios
284
- type: AxiosHttp
285
- # ...
286
- requests:
287
- - id: get_api_1
288
- type: AxiosHttp
289
- connectionId: axios
290
- properties:
291
- url: app1.com/api/things
292
- - id: post_to_api_2
293
- type: AxiosHttp
294
- connectionId: axios
295
- payload:
296
- data:
297
- _state: true
298
- properties:
299
- url: api.otherapp.org/other/thing
300
- method: post
301
- data:
302
- _payload: data
303
- ```
304
-
305
- </EXAMPLES>
@@ -1,279 +0,0 @@
1
- <TITLE>
2
- AxiosHttp
3
- </TITLE>
4
-
5
- <DESCRIPTION>
6
-
7
- The `AxiosHttp` connection is used to connect to APIs and web servers using HTTP or HTTPS.
8
-
9
- It uses the [axios](https://github.com/axios/axios) library.
10
-
11
- The same properties can be set on both connections and requests. The properties will be merged, with the request properties overwriting connection properties. This allows properties like authentication headers and the baseURL to be set on the connection, with request specific properties like the request.
12
-
13
- >Secrets like authentication headers and API keys should be stored using the [`_secret`](_secret) operator.
14
-
15
- </DESCRIPTION>
16
-
17
- <REQUESTS>
18
-
19
- - AxiosHttp
20
-
21
- </REQUESTS>
22
-
23
- <SCHEMA>
24
-
25
- ```js
26
- export default {
27
- $schema: 'http://json-schema.org/draft-07/schema#',
28
- title: 'Lowdefy Connection Schema - AxiosHttp',
29
- type: 'object',
30
- properties: {
31
- url: {
32
- type: 'string',
33
- description: 'The server URL that will be used for the request.',
34
- errorMessage: {
35
- type: 'AxiosHttp property "url" should be a string.',
36
- },
37
- },
38
- method: {
39
- type: 'string',
40
- enum: ['get', 'delete', 'head', 'options', 'post', 'put', 'patch'],
41
- description: 'The request method to be used when making the request',
42
- errorMessage: {
43
- type: 'AxiosHttp property "method" should be a string.',
44
- enum: 'AxiosHttp property "method" is not a valid value.',
45
- },
46
- },
47
- baseURL: {
48
- type: 'string',
49
- description:
50
- 'baseURL will be prepended to url unless url is absolute. It can be convenient to set baseURL for an axios connection so that requests can use relative urls.',
51
- errorMessage: {
52
- type: 'AxiosHttp property "baseURL" should be a string.',
53
- },
54
- },
55
- headers: {
56
- type: 'object',
57
- description:
58
- 'An object with custom headers to be sent with the request. The object keys should be header names, and the values should be the string header values.',
59
- errorMessage: {
60
- type: 'AxiosHttp property "headers" should be an object.',
61
- },
62
- },
63
- params: {
64
- type: 'object',
65
- description: 'An object with URL parameters to be sent with the request.',
66
- errorMessage: {
67
- type: 'AxiosHttp property "params" should be an object.',
68
- },
69
- },
70
- data: {
71
- description:
72
- "The data to be sent as the request body. Only applicable for request methods 'put', 'post', and 'patch'. Can be an object, array or a string in the format 'Country=USA&City=New York'.",
73
- },
74
- timeout: {
75
- type: 'number',
76
- description:
77
- 'The number of milliseconds before the request times out. If the request takes longer than timeout, the request will be aborted. Set to 0 for no timeout.',
78
- default: 0,
79
- errorMessage: {
80
- type: 'AxiosHttp property "timeout" should be a number.',
81
- },
82
- },
83
- auth: {
84
- type: 'object',
85
- description:
86
- 'Indicates that HTTP Basic authorization should be used, and supplies credentials. This will set an Authorization header, overwriting any existing Authorization custom headers you have set using headers. Only HTTP Basic auth is configurable through this parameter, for Bearer tokens and such, use Authorization custom headers instead.',
87
- properties: {
88
- username: {
89
- type: 'string',
90
- description: 'HTTP Basic authorization username.',
91
- errorMessage: {
92
- type: 'AxiosHttp property "auth.username" should be a string.',
93
- },
94
- },
95
- password: {
96
- type: 'string',
97
- description: 'HTTP Basic authorization password.',
98
- errorMessage: {
99
- type: 'AxiosHttp property "auth.password" should be a string.',
100
- },
101
- },
102
- },
103
- errorMessage: {
104
- type: 'AxiosHttp property "auth" should be an object.',
105
- },
106
- },
107
- responseType: {
108
- type: 'string',
109
- enum: ['json', 'document', 'text'],
110
- description: 'The type of data that the server should respond with.',
111
- default: 'json',
112
- errorMessage: {
113
- type: 'AxiosHttp property "responseType" should be a string.',
114
- enum: 'AxiosHttp property "responseType" is not a valid value.',
115
- },
116
- },
117
- responseEncoding: {
118
- type: 'string',
119
- description: 'Indicates encoding to use for decoding responses.',
120
- default: 'utf8',
121
- errorMessage: {
122
- type: 'AxiosHttp property "responseEncoding" should be a string.',
123
- },
124
- },
125
- maxContentLength: {
126
- type: 'number',
127
- description: 'Defines the max size of the http response content allowed in bytes.',
128
- errorMessage: {
129
- type: 'AxiosHttp property "maxContentLength" should be a number.',
130
- },
131
- },
132
- maxRedirects: {
133
- type: 'number',
134
- description:
135
- 'Defines the maximum number of redirects to follow. If set to 0, no redirects will be followed.',
136
- default: 5,
137
- errorMessage: {
138
- type: 'AxiosHttp property "maxRedirects" should be a number.',
139
- },
140
- },
141
- proxy: {
142
- type: 'object',
143
- description: 'Defines the hostname and port of the proxy server.',
144
- errorMessage: {
145
- type: 'AxiosHttp property "proxy" should be an object.',
146
- },
147
- },
148
- },
149
- };
150
- ```
151
-
152
- </SCHEMA>
153
-
154
- <EXAMPLES>
155
-
156
- Properties for a AxiosHttp can be set on either the connection, the request, or both. However, both a connection and request need to be defined.
157
-
158
- ### A basic full example requesting data from https://jsonplaceholder.typicode.com
159
-
160
- ```yaml
161
- lowdefy: {{ version }}
162
- name: Lowdefy starter
163
- connections:
164
- - id: my_api
165
- type: AxiosHttp
166
- properties:
167
- baseURL: https://jsonplaceholder.typicode.com
168
- pages:
169
- - id: welcome
170
- type: PageHeaderMenu
171
- requests:
172
- - id: get_posts
173
- type: AxiosHttp
174
- connectionId: my_api
175
- properties:
176
- url: /posts
177
- events:
178
- onInit:
179
- - id: fetch_get_posts
180
- type: Request
181
- params: get_posts
182
- blocks:
183
- - id: rest_data
184
- type: Markdown
185
- properties:
186
- content:
187
- _string.concat:
188
- - |
189
- ```yaml
190
- - _yaml.stringify:
191
- - _request: get_posts
192
- - |
193
- ```
194
- ```
195
-
196
- ### Using the connection to set baseURL and authorization, and handle specific requests as requests
197
-
198
- ```yaml
199
- connections:
200
- - id: app_api
201
- type: AxiosHttp
202
- properties:
203
- baseURL: app.com/api
204
- auth:
205
- username: api_user
206
- password:
207
- _secret: API_PASSWORD
208
- # ...
209
- requests:
210
- - id: get_orders
211
- type: AxiosHttp
212
- connectionId: app_api
213
- properties:
214
- url: /orders
215
- - id: update_order
216
- type: AxiosHttp
217
- connectionId: app_api
218
- payload:
219
- order_id:
220
- _state: order_id
221
- data:
222
- _state: true
223
- properties:
224
- url:
225
- _nunjucks:
226
- template: /orders/{{ order_id }}
227
- on:
228
- order_id:
229
- _payload: order_id
230
- method: post
231
- data:
232
- _payload: data
233
- ```
234
-
235
- ### Setting properties on only the connection
236
-
237
- ```yaml
238
- connections:
239
- - id: get_count
240
- type: AxiosHttp
241
- properties:
242
- url: myapp.com/api/count
243
- headers:
244
- X-Api-Key:
245
- _secret: API_KEY
246
- # ...
247
- requests:
248
- - id: get_count
249
- type: AxiosHttp
250
- connectionId: get_count
251
- ```
252
-
253
- ### Setting properties on only the request, and using a generic connection
254
-
255
- ```yaml
256
- connections:
257
- - id: axios
258
- type: AxiosHttp
259
- # ...
260
- requests:
261
- - id: get_api_1
262
- type: AxiosHttp
263
- connectionId: axios
264
- properties:
265
- url: app1.com/api/things
266
- - id: post_to_api_2
267
- type: AxiosHttp
268
- connectionId: axios
269
- payload:
270
- data:
271
- _state: true
272
- properties:
273
- url: api.otherapp.org/other/thing
274
- method: post
275
- data:
276
- _payload: data
277
- ```
278
-
279
- </EXAMPLES>