vue-api-request-builder 0.2.5 → 0.2.7

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.
Files changed (97) hide show
  1. package/README.md +216 -168
  2. package/dist/index.css +1 -1
  3. package/dist/index.d.ts +3 -3
  4. package/dist/index.es.js +9048 -10
  5. package/dist/index.umd.js +159 -1922
  6. package/package.json +8 -2
  7. package/dist/abap-D0Neqhq6.js +0 -1404
  8. package/dist/apex-B5LhxkeG.js +0 -332
  9. package/dist/assets/css.worker-DNgQEC96.js +0 -84
  10. package/dist/assets/editor.worker-BKD3YLiN.js +0 -12
  11. package/dist/assets/html.worker-B7xpmB-M.js +0 -461
  12. package/dist/assets/json.worker-td2JV8fN.js +0 -49
  13. package/dist/assets/ts.worker-CqZGdM85.js +0 -51334
  14. package/dist/azcli-BrBH0QTU.js +0 -74
  15. package/dist/bat-BfzAov64.js +0 -106
  16. package/dist/bicep-C3bCSWel.js +0 -108
  17. package/dist/cameligo-sFL5plcd.js +0 -180
  18. package/dist/clojure-CfeExRz0.js +0 -767
  19. package/dist/coffee-Xws5K0WL.js +0 -238
  20. package/dist/cpp-CqOUEpxN.js +0 -395
  21. package/dist/csharp-DVLiBOZb.js +0 -332
  22. package/dist/csp-DVFp9bw5.js +0 -59
  23. package/dist/css-DwARn2R6.js +0 -193
  24. package/dist/cssMode-CLL8L5NS.js +0 -1577
  25. package/dist/cypher-uY0Mffat.js +0 -269
  26. package/dist/dart-D27H-mX_.js +0 -287
  27. package/dist/dockerfile-CmV85WZK.js +0 -136
  28. package/dist/ecl--fKn7yzB.js +0 -462
  29. package/dist/elixir-DUhH17ON.js +0 -575
  30. package/dist/flow9-B3Dx2LLe.js +0 -148
  31. package/dist/freemarker2-DTcNz0NY.js +0 -995
  32. package/dist/fsharp-SyqBfUAR.js +0 -223
  33. package/dist/go-BbMR2tdT.js +0 -224
  34. package/dist/graphql-DDJE6tIl.js +0 -157
  35. package/dist/handlebars-Cx0-w-7E.js +0 -425
  36. package/dist/hcl-YBvpaUqf.js +0 -189
  37. package/dist/html-C5tr3pzc.js +0 -314
  38. package/dist/htmlMode-CoxRCpNW.js +0 -1587
  39. package/dist/index-BQj88CBp.js +0 -113063
  40. package/dist/ini-Ct73dBtM.js +0 -77
  41. package/dist/java-C_jlkwoG.js +0 -238
  42. package/dist/javascript-DreDpYLL.js +0 -76
  43. package/dist/jsonMode-J_5EpjnI.js +0 -2002
  44. package/dist/julia-D8WE5U1e.js +0 -517
  45. package/dist/kotlin-Zy9aq5yB.js +0 -259
  46. package/dist/less-sZ0iHtE8.js +0 -168
  47. package/dist/lexon-CsdNL29A.js +0 -163
  48. package/dist/liquid-D4BjZHpf.js +0 -246
  49. package/dist/lua-C2YJo0zw.js +0 -168
  50. package/dist/m3-CPLP40SG.js +0 -216
  51. package/dist/markdown-B1mf5e0R.js +0 -235
  52. package/dist/mdx-XOAIeZ0T.js +0 -171
  53. package/dist/mips-DA33BZX1.js +0 -204
  54. package/dist/msdax-CCYFIQsP.js +0 -381
  55. package/dist/mysql-hjmIjL-D.js +0 -884
  56. package/dist/objective-c-RRCpEmqC.js +0 -189
  57. package/dist/pascal-CeV8XfxB.js +0 -257
  58. package/dist/pascaligo-IEEGVJAJ.js +0 -170
  59. package/dist/perl-B5-QbHq_.js +0 -632
  60. package/dist/pgsql-s6kqEJmi.js +0 -857
  61. package/dist/php-CWWqzOo8.js +0 -506
  62. package/dist/pla-FSvb_YP_.js +0 -143
  63. package/dist/postiats-DQdscQXO.js +0 -913
  64. package/dist/powerquery-CtA5JA1I.js +0 -896
  65. package/dist/powershell-DglEq96N.js +0 -245
  66. package/dist/protobuf-BSepub3e.js +0 -426
  67. package/dist/pug-B1847F4G.js +0 -408
  68. package/dist/python-HUeBjc1V.js +0 -307
  69. package/dist/qsharp-D4i0Nqg9.js +0 -307
  70. package/dist/r-cdRigKxa.js +0 -249
  71. package/dist/razor-DIq2UlHM.js +0 -556
  72. package/dist/redis-D9MFxvE8.js +0 -308
  73. package/dist/redshift-CmCnsvL-.js +0 -815
  74. package/dist/restructuredtext-CWy8J51t.js +0 -180
  75. package/dist/ruby-WP-c36m5.js +0 -517
  76. package/dist/rust-Q9FLdYpu.js +0 -349
  77. package/dist/sb-C54-JBGT.js +0 -121
  78. package/dist/scala-CzbFImc5.js +0 -376
  79. package/dist/scheme-BhfDmYN3.js +0 -114
  80. package/dist/scss-CEmiBXpS.js +0 -268
  81. package/dist/shell-Bmc1VhG0.js +0 -227
  82. package/dist/solidity-C9Q2I8Hh.js +0 -1373
  83. package/dist/sophia-jWa1UyKz.js +0 -205
  84. package/dist/sparql-CM7jctbc.js +0 -207
  85. package/dist/sql-WzihTkbg.js +0 -859
  86. package/dist/st-6y7_3aup.js +0 -422
  87. package/dist/swift-k-0zxG_D.js +0 -318
  88. package/dist/systemverilog-Pnr5_rIP.js +0 -582
  89. package/dist/tcl-fNPXval8.js +0 -238
  90. package/dist/tsMode-CYG-_Z0W.js +0 -895
  91. package/dist/twig-L2MkztkV.js +0 -398
  92. package/dist/typescript-_CZvF4eO.js +0 -349
  93. package/dist/typespec-Cqqo-3Pt.js +0 -123
  94. package/dist/vb-B5YC2xN9.js +0 -378
  95. package/dist/wgsl-B-_uRex7.js +0 -445
  96. package/dist/xml-Bh4P_Mbb.js +0 -101
  97. package/dist/yaml-CMs-twPQ.js +0 -212
package/README.md CHANGED
@@ -1,168 +1,216 @@
1
- # API Request Builder
2
-
3
- A Vue 3 component for building and testing API requests with a beautiful UI.
4
-
5
- # Start of Selection
6
- [中文文档](README_zh.md)
7
-
8
- ## Installation
9
-
10
- ```bash
11
- npm install vue-api-request-builder
12
- # or
13
- yarn add vue-api-request-builder
14
- # or
15
- pnpm add vue-api-request-builder
16
- ```
17
-
18
- ## Usage
19
-
20
- ### Basic Usage
21
-
22
- ```vue
23
- <template>
24
- <div class="app-container">
25
- <RequestForm v-model="requestSchema" @update:modelValue="handleSchemaChange" />
26
- <ResponseSection v-model="requestSchema" />
27
- </div>
28
- </template>
29
-
30
- <script setup lang="ts">
31
- import { ref } from 'vue';
32
- import { RequestForm, ResponseSection, type RequestSchema, defaultRequestSchema } from 'vue-api-request-builder';
33
-
34
- const requestSchema = ref<RequestSchema>(defaultRequestSchema);
35
-
36
- const handleSchemaChange = (newSchema: RequestSchema) => {
37
- console.log("Schema changed:", newSchema);
38
- };
39
- </script>
40
- ```
41
-
42
- ## Components
43
-
44
- ### RequestForm
45
-
46
- The main component for building API requests. It provides a form interface for configuring:
47
-
48
- #### Props
49
- - `modelValue` (RequestSchema): The request schema object (v-model)
50
-
51
- #### Events
52
- - `update:modelValue`: Emitted when the schema changes
53
-
54
- #### Features
55
- - HTTP method selection (GET, POST, PUT, DELETE, OPTIONS)
56
- - URL configuration with base URL and path
57
- - URL parameters management
58
- - Authentication options:
59
- - None
60
- - Basic Auth
61
- - Bearer Token
62
- - Custom headers
63
- - Request body support for:
64
- - JSON
65
- - Form Data
66
- - Raw text
67
- - Live preview of request URL and body
68
-
69
- ### ResponseSection
70
-
71
- Displays the response from the API request.
72
-
73
- #### Props
74
- - `modelValue` (RequestSchema): The request schema object (v-model)
75
-
76
- #### Features
77
- - Request method selection (XMLHttpRequest/Fetch)
78
- - Response display:
79
- - Status code with color coding
80
- - Response time
81
- - Response headers
82
- - Response body with formatting
83
- - Error handling and display
84
-
85
- ### KeyValueInput
86
-
87
- A reusable component for managing key-value pairs.
88
-
89
- #### Props
90
- - `modelValue` (KeyValuePair[]): Array of key-value pairs (v-model)
91
- - `addButtonText` (string): Text for the add button
92
- - `showPreview` (boolean): Whether to show the preview
93
- - `previewText` (string): Text to show in preview
94
-
95
- #### Events
96
- - `update:modelValue`: Emitted when the key-value pairs change
97
-
98
- ## Types
99
-
100
- ### RequestSchema
101
-
102
- ```typescript
103
- interface RequestSchema {
104
- method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS';
105
- url: string;
106
- path: string;
107
- auth: AuthConfig;
108
- params: KeyValuePair[];
109
- headers: KeyValuePair[];
110
- body: RequestBody;
111
- }
112
- ```
113
-
114
- ### AuthConfig
115
-
116
- ```typescript
117
- interface AuthConfig {
118
- type: 'none' | 'Basic' | 'Bearer';
119
- username?: string;
120
- password?: string;
121
- token?: string;
122
- }
123
- ```
124
-
125
- ### RequestBody
126
-
127
- ```typescript
128
- interface RequestBody {
129
- type: 'application/json' | 'multipart/form-data' | 'text/plain';
130
- json?: string;
131
- formData?: KeyValuePair[];
132
- raw?: string;
133
- }
134
- ```
135
-
136
- ### ResponseData
137
-
138
- ```typescript
139
- interface ResponseData {
140
- status: string;
141
- headers: Record<string, string>;
142
- body: string;
143
- timing?: number;
144
- }
145
- ```
146
-
147
- ## Utilities
148
-
149
- ### executeRequest
150
-
151
- ```typescript
152
- function executeRequest(
153
- schema: RequestSchema,
154
- method: 'fetch' | 'xhr' = 'xhr'
155
- ): Promise<ResponseData>
156
- ```
157
-
158
- Executes the API request using either Fetch API or XMLHttpRequest.
159
-
160
- ## Dependencies
161
-
162
- This package requires:
163
- - Vue 3.x
164
- - Ant Design Vue 4.x
165
-
166
- ## License
167
-
168
- MIT
1
+ # API Request Builder
2
+
3
+ A Vue 3 component for building and testing API requests with a beautiful UI.
4
+
5
+ # Start of Selection
6
+ [中文文档](README_zh.md)
7
+
8
+ ## Workflow
9
+
10
+ ```mermaid
11
+ graph TD
12
+ A[Start] --> B[Configure Request]
13
+ B --> C[RequestForm Component]
14
+ C --> D[Set Request Parameters]
15
+ D --> E[URL/Path]
16
+ D --> F[Authentication]
17
+ D --> G[Headers]
18
+ D --> H[Request Body]
19
+ E & F & G & H --> I[Execute Request]
20
+ I --> J[ResponseSection Component]
21
+ J --> K[Display Response]
22
+ K --> L[Status Code]
23
+ K --> M[Response Headers]
24
+ K --> N[Response Body]
25
+ L & M & N --> O[Data Transformation]
26
+ O --> P[DataTransform Component]
27
+ P --> Q[Transform Function]
28
+ Q --> R[Transformed Result]
29
+ R --> S[End]
30
+ ```
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ npm install vue-api-request-builder
36
+ # or
37
+ yarn add vue-api-request-builder
38
+ # or
39
+ pnpm add vue-api-request-builder
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ ### Basic Usage
45
+
46
+ ```vue
47
+ <template>
48
+ <div class="app-container">
49
+ <RequestForm v-model="requestSchema" @update:modelValue="handleSchemaChange" />
50
+ <ResponseSection v-model="requestSchema" />
51
+ </div>
52
+ </template>
53
+
54
+ <script setup lang="ts">
55
+ import { ref } from 'vue';
56
+ import { RequestForm, ResponseSection, type RequestSchema, defaultRequestSchema } from 'vue-api-request-builder';
57
+
58
+ const requestSchema = ref<RequestSchema>(defaultRequestSchema);
59
+
60
+ const handleSchemaChange = (newSchema: RequestSchema) => {
61
+ console.log("Schema changed:", newSchema);
62
+ };
63
+ </script>
64
+ ```
65
+
66
+ ## Components
67
+
68
+ ### RequestForm
69
+
70
+ The main component for building API requests. It provides a form interface for configuring:
71
+
72
+ #### Props
73
+ - `modelValue` (RequestSchema): The request schema object (v-model)
74
+
75
+ #### Events
76
+ - `update:modelValue`: Emitted when the schema changes
77
+
78
+ #### Features
79
+ - HTTP method selection (GET, POST, PUT, DELETE, OPTIONS)
80
+ - URL configuration with base URL and path
81
+ - URL parameters management
82
+ - Authentication options:
83
+ - None
84
+ - Basic Auth
85
+ - Bearer Token
86
+ - Custom headers
87
+ - Request body support for:
88
+ - JSON
89
+ - Form Data
90
+ - Raw text
91
+ - Live preview of request URL and body
92
+
93
+ ### ResponseSection
94
+
95
+ Displays the response from the API request.
96
+
97
+ #### Props
98
+ - `modelValue` (RequestSchema): The request schema object (v-model)
99
+
100
+ #### Features
101
+ - Request method selection (XMLHttpRequest/Fetch)
102
+ - Response display:
103
+ - Status code with color coding
104
+ - Response time
105
+ - Response headers
106
+ - Response body with formatting
107
+ - Error handling and display
108
+
109
+ ### DataTransform
110
+
111
+ Component for configuring and executing data transformation functions.
112
+
113
+ #### Props
114
+ - `modelValue` (string): The transformation function string (v-model)
115
+
116
+ #### Features
117
+ - Code editor interface
118
+ - JavaScript function support
119
+ - Real-time syntax checking
120
+ - Function execution preview
121
+
122
+ ### KeyValueInput
123
+
124
+ A reusable component for managing key-value pairs.
125
+
126
+ #### Props
127
+ - `modelValue` (KeyValuePair[]): Array of key-value pairs (v-model)
128
+ - `addButtonText` (string): Text for the add button
129
+ - `showPreview` (boolean): Whether to show the preview
130
+ - `previewText` (string): Text to show in preview
131
+
132
+ #### Events
133
+ - `update:modelValue`: Emitted when the key-value pairs change
134
+
135
+ ## Types
136
+
137
+ ### RequestSchema
138
+
139
+ ```typescript
140
+ interface RequestSchema {
141
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS';
142
+ url: string;
143
+ path: string;
144
+ auth: AuthConfig;
145
+ params: KeyValuePair[];
146
+ headers: KeyValuePair[];
147
+ body: RequestBody;
148
+ }
149
+ ```
150
+
151
+ ### AuthConfig
152
+
153
+ ```typescript
154
+ interface AuthConfig {
155
+ type: 'none' | 'Basic' | 'Bearer';
156
+ username?: string;
157
+ password?: string;
158
+ token?: string;
159
+ }
160
+ ```
161
+
162
+ ### RequestBody
163
+
164
+ ```typescript
165
+ interface RequestBody {
166
+ type: 'application/json' | 'multipart/form-data' | 'text/plain';
167
+ json?: string;
168
+ formData?: KeyValuePair[];
169
+ raw?: string;
170
+ }
171
+ ```
172
+
173
+ ### ResponseData
174
+
175
+ ```typescript
176
+ interface ResponseData {
177
+ status: string;
178
+ headers: Record<string, string>;
179
+ body: string;
180
+ timing?: number;
181
+ }
182
+ ```
183
+
184
+ ## Utilities
185
+
186
+ ### executeRequest
187
+
188
+ ```typescript
189
+ function executeRequest(
190
+ schema: RequestSchema,
191
+ method: 'fetch' | 'xhr' = 'xhr'
192
+ ): Promise<ResponseData>
193
+ ```
194
+
195
+ Executes the API request using either Fetch API or XMLHttpRequest.
196
+
197
+ ### executeTransformFunction
198
+
199
+ ```typescript
200
+ function executeTransformFunction(
201
+ transformFunctionString: string,
202
+ data: any
203
+ ): any
204
+ ```
205
+
206
+ Executes a data transformation function to convert input data into the desired format.
207
+
208
+ ## Dependencies
209
+
210
+ This package requires:
211
+ - Vue 3.x
212
+ - Ant Design Vue 4.x
213
+
214
+ ## License
215
+
216
+ MIT