@scalar/api-client 0.4.0 → 0.5.0

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/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # Scalar API Client
2
+
3
+ ![Version](https://img.shields.io/npm/v/%40scalar/api-client)
4
+ ![Downloads](https://img.shields.io/npm/dm/%40scalar/api-client)
5
+ ![License](https://img.shields.io/npm/l/%40scalar%2Fapi-client)
6
+ [![Discord](https://img.shields.io/discord/1135330207960678410?style=flat&color=5865F2)](https://discord.gg/mw6FQRPh)
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @scalar/api-client
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```vue
17
+ <script setup>
18
+ import { ApiClient } from '@scalar/api-client'
19
+ </script>
20
+
21
+ <template>
22
+ <ApiClient />
23
+ </template>
24
+ ```
25
+
26
+ ## Props
27
+
28
+ ### proxyUrl?: string
29
+
30
+ Pass an URL of [a request proxy](https://github.com/scalar/scalar/tree/main/packages/api-client-proxy) to avoid CORS issues.
31
+
32
+ ## Composable
33
+
34
+ You can use `useApiClientRequestStore()` to interact with the API client.
35
+
36
+ ### readOnly
37
+
38
+ ```js
39
+ const { readOnly } = useApiClientRequestStore()
40
+
41
+ readOnly.value = false
42
+ ```
43
+
44
+ ### activeRequest
45
+
46
+ ```js
47
+ const { activeRequest } = useApiClientRequestStore()
48
+
49
+ console.log(activeRequest)
50
+ ```
51
+
52
+ ### setActiveRequest
53
+
54
+ ```js
55
+ const { setActiveRequest } = useApiClientRequestStore()
56
+
57
+ setActiveRequest({
58
+ url: 'https://echo.scalar.com'
59
+ type: 'GET,
60
+ path: '/foobar'
61
+ })
62
+ ```
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestBody.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiIA,wBAAkD"}
1
+ {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Request/RequestBody.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkIA,wBAAkD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Response/ResponseBody.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,wBAAkD"}
1
+ {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Response/ResponseBody.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,wBAAkD"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export { ApiClient } from './components/ApiClient';
2
- export { CodeMirror } from './components/CodeMirror';
3
2
  export * from './helpers';
4
3
  export * from './hooks';
5
4
  export * from './stores/apiClientStore';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,yBAAyB,CAAA;AACvC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,yBAAyB,CAAA;AACvC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA"}