@scalar/api-client 0.1.1

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 (103) hide show
  1. package/dist/components/ApiClient/AddressBar.vue.d.ts +17 -0
  2. package/dist/components/ApiClient/AddressBar.vue.d.ts.map +1 -0
  3. package/dist/components/ApiClient/ApiClient.vue.d.ts +17 -0
  4. package/dist/components/ApiClient/ApiClient.vue.d.ts.map +1 -0
  5. package/dist/components/ApiClient/Request/Request.vue.d.ts +3 -0
  6. package/dist/components/ApiClient/Request/Request.vue.d.ts.map +1 -0
  7. package/dist/components/ApiClient/Request/RequestAuth.vue.d.ts +3 -0
  8. package/dist/components/ApiClient/Request/RequestAuth.vue.d.ts.map +1 -0
  9. package/dist/components/ApiClient/Request/RequestBody.vue.d.ts +23 -0
  10. package/dist/components/ApiClient/Request/RequestBody.vue.d.ts.map +1 -0
  11. package/dist/components/ApiClient/Request/RequestHeaders.vue.d.ts +13 -0
  12. package/dist/components/ApiClient/Request/RequestHeaders.vue.d.ts.map +1 -0
  13. package/dist/components/ApiClient/Request/RequestQuery.vue.d.ts +13 -0
  14. package/dist/components/ApiClient/Request/RequestQuery.vue.d.ts.map +1 -0
  15. package/dist/components/ApiClient/Request/RequestVariables.vue.d.ts +14 -0
  16. package/dist/components/ApiClient/Request/RequestVariables.vue.d.ts.map +1 -0
  17. package/dist/components/ApiClient/Request/index.d.ts +2 -0
  18. package/dist/components/ApiClient/Request/index.d.ts.map +1 -0
  19. package/dist/components/ApiClient/RequestHistory.vue.d.ts +7 -0
  20. package/dist/components/ApiClient/RequestHistory.vue.d.ts.map +1 -0
  21. package/dist/components/ApiClient/RequestHistoryItem.vue.d.ts +13 -0
  22. package/dist/components/ApiClient/RequestHistoryItem.vue.d.ts.map +1 -0
  23. package/dist/components/ApiClient/Response/Response.vue.d.ts +3 -0
  24. package/dist/components/ApiClient/Response/Response.vue.d.ts.map +1 -0
  25. package/dist/components/ApiClient/Response/ResponseBody.vue.d.ts +28 -0
  26. package/dist/components/ApiClient/Response/ResponseBody.vue.d.ts.map +1 -0
  27. package/dist/components/ApiClient/Response/ResponseHeaders.vue.d.ts +13 -0
  28. package/dist/components/ApiClient/Response/ResponseHeaders.vue.d.ts.map +1 -0
  29. package/dist/components/ApiClient/Response/ResponseMetaInformation.vue.d.ts +13 -0
  30. package/dist/components/ApiClient/Response/ResponseMetaInformation.vue.d.ts.map +1 -0
  31. package/dist/components/ApiClient/Response/index.d.ts +2 -0
  32. package/dist/components/ApiClient/Response/index.d.ts.map +1 -0
  33. package/dist/components/ApiClient/index.d.ts +2 -0
  34. package/dist/components/ApiClient/index.d.ts.map +1 -0
  35. package/dist/components/CodeMirror/CodeMirror.vue.d.ts +46 -0
  36. package/dist/components/CodeMirror/CodeMirror.vue.d.ts.map +1 -0
  37. package/dist/components/CodeMirror/extensions/variables.d.ts +6 -0
  38. package/dist/components/CodeMirror/extensions/variables.d.ts.map +1 -0
  39. package/dist/components/CodeMirror/index.d.ts +2 -0
  40. package/dist/components/CodeMirror/index.d.ts.map +1 -0
  41. package/dist/components/CollapsibleSection/CollapsibleSection.vue.d.ts +19 -0
  42. package/dist/components/CollapsibleSection/CollapsibleSection.vue.d.ts.map +1 -0
  43. package/dist/components/CollapsibleSection/index.d.ts +2 -0
  44. package/dist/components/CollapsibleSection/index.d.ts.map +1 -0
  45. package/dist/components/FlowModal.vue.d.ts +62 -0
  46. package/dist/components/FlowModal.vue.d.ts.map +1 -0
  47. package/dist/components/Grid/Grid.vue.d.ts +13 -0
  48. package/dist/components/Grid/Grid.vue.d.ts.map +1 -0
  49. package/dist/components/Grid/SimpleGrid.vue.d.ts +13 -0
  50. package/dist/components/Grid/SimpleGrid.vue.d.ts.map +1 -0
  51. package/dist/components/Grid/index.d.ts +3 -0
  52. package/dist/components/Grid/index.d.ts.map +1 -0
  53. package/dist/components/HelpfulLink.vue.d.ts +20 -0
  54. package/dist/components/HelpfulLink.vue.d.ts.map +1 -0
  55. package/dist/components/SimpleTable/SimpleCell.vue.d.ts +40 -0
  56. package/dist/components/SimpleTable/SimpleCell.vue.d.ts.map +1 -0
  57. package/dist/components/SimpleTable/SimpleHeader.vue.d.ts +10 -0
  58. package/dist/components/SimpleTable/SimpleHeader.vue.d.ts.map +1 -0
  59. package/dist/components/SimpleTable/SimpleRow.vue.d.ts +10 -0
  60. package/dist/components/SimpleTable/SimpleRow.vue.d.ts.map +1 -0
  61. package/dist/components/SimpleTable/SimpleTable.vue.d.ts +10 -0
  62. package/dist/components/SimpleTable/SimpleTable.vue.d.ts.map +1 -0
  63. package/dist/components/SimpleTable/index.d.ts +5 -0
  64. package/dist/components/SimpleTable/index.d.ts.map +1 -0
  65. package/dist/fixtures/httpHeaders.d.ts +7 -0
  66. package/dist/fixtures/httpHeaders.d.ts.map +1 -0
  67. package/dist/fixtures/httpStatusCodes.d.ts +8 -0
  68. package/dist/fixtures/httpStatusCodes.d.ts.map +1 -0
  69. package/dist/fixtures/index.d.ts +3 -0
  70. package/dist/fixtures/index.d.ts.map +1 -0
  71. package/dist/helpers/createPlaceholderRequest.d.ts +6 -0
  72. package/dist/helpers/createPlaceholderRequest.d.ts.map +1 -0
  73. package/dist/helpers/generateParameters.d.ts +6 -0
  74. package/dist/helpers/generateParameters.d.ts.map +1 -0
  75. package/dist/helpers/generateRequest.d.ts +7 -0
  76. package/dist/helpers/generateRequest.d.ts.map +1 -0
  77. package/dist/helpers/index.d.ts +6 -0
  78. package/dist/helpers/index.d.ts.map +1 -0
  79. package/dist/helpers/mapFromArray.d.ts +5 -0
  80. package/dist/helpers/mapFromArray.d.ts.map +1 -0
  81. package/dist/helpers/sendRequest.d.ts +6 -0
  82. package/dist/helpers/sendRequest.d.ts.map +1 -0
  83. package/dist/hooks/index.d.ts +2 -0
  84. package/dist/hooks/index.d.ts.map +1 -0
  85. package/dist/hooks/useCopilot.d.ts +31 -0
  86. package/dist/hooks/useCopilot.d.ts.map +1 -0
  87. package/dist/hooks/useOperation.d.ts +16 -0
  88. package/dist/hooks/useOperation.d.ts.map +1 -0
  89. package/dist/index.d.ts +8 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +31175 -0
  92. package/dist/stores/apiClientRequestStore.d.ts +70 -0
  93. package/dist/stores/apiClientRequestStore.d.ts.map +1 -0
  94. package/dist/stores/apiClientStore.d.ts +21 -0
  95. package/dist/stores/apiClientStore.d.ts.map +1 -0
  96. package/dist/stores/index.d.ts +3 -0
  97. package/dist/stores/index.d.ts.map +1 -0
  98. package/dist/style.css +1622 -0
  99. package/dist/types.d.ts +151 -0
  100. package/dist/types.d.ts.map +1 -0
  101. package/dist/variables.css +53 -0
  102. package/package.json +56 -0
  103. package/src/index.ts +8 -0
@@ -0,0 +1,5 @@
1
+ export { default as SimpleCell } from './SimpleCell.vue';
2
+ export { default as SimpleHeader } from './SimpleHeader.vue';
3
+ export { default as SimpleRow } from './SimpleRow.vue';
4
+ export { default as SimpleTable } from './SimpleTable.vue';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SimpleTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,7 @@
1
+ export type HttpHeader = {
2
+ name: string;
3
+ url: string;
4
+ };
5
+ export declare const httpHeaders: HttpHeader[];
6
+ export default httpHeaders;
7
+ //# sourceMappingURL=httpHeaders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpHeaders.d.ts","sourceRoot":"","sources":["../../src/fixtures/httpHeaders.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,eAAO,MAAM,WAAW,EAAE,UAAU,EA6gBnC,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,8 @@
1
+ export type HttpStatusCode = {
2
+ name: string;
3
+ url: string;
4
+ };
5
+ export type HttpStatusCodes = Record<string, HttpStatusCode>;
6
+ export declare const httpStatusCodes: HttpStatusCodes;
7
+ export default httpStatusCodes;
8
+ //# sourceMappingURL=httpStatusCodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpStatusCodes.d.ts","sourceRoot":"","sources":["../../src/fixtures/httpStatusCodes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAE5D,eAAO,MAAM,eAAe,EAAE,eAyP7B,CAAA;AAED,eAAe,eAAe,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { default as httpHeaders } from './httpHeaders';
2
+ export { default as httpStatusCodes, type HttpStatusCode, type HttpStatusCodes, } from './httpStatusCodes';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { ClientRequestConfig } from '../types';
2
+ /**
3
+ * Generate a new placeholder request
4
+ */
5
+ export declare const createPlaceholderRequest: () => ClientRequestConfig;
6
+ //# sourceMappingURL=createPlaceholderRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPlaceholderRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/createPlaceholderRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAO,mBAW1C,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { BaseParameter, Parameters } from '../types';
2
+ /**
3
+ * Generate parameters for the request from the parameters in the swagger file
4
+ */
5
+ export declare function generateParameters(parameters: Parameters[]): BaseParameter[];
6
+ //# sourceMappingURL=generateParameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateParameters.d.ts","sourceRoot":"","sources":["../../src/helpers/generateParameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAEzD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,mBAa1D"}
@@ -0,0 +1,7 @@
1
+ import { type ParamMap } from '../hooks/useOperation';
2
+ import type { ClientRequestConfig, Operation, Server } from '../types';
3
+ /**
4
+ * Generate parameters for the request
5
+ */
6
+ export declare function generateRequest(operation: Operation, parameterMap: ParamMap, server: Server): ClientRequestConfig;
7
+ //# sourceMappingURL=generateRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/generateRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGtE;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,QAAQ,EACtB,MAAM,EAAE,MAAM,GACb,mBAAmB,CAcrB"}
@@ -0,0 +1,6 @@
1
+ export { createPlaceholderRequest } from './createPlaceholderRequest';
2
+ export { generateRequest } from './generateRequest';
3
+ export { generateParameters } from './generateParameters';
4
+ export { mapFromArray } from './mapFromArray';
5
+ export { sendRequest } from './sendRequest';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A utility function to convert an array of objects to an object of objects.
3
+ */
4
+ export declare function mapFromArray<T extends Record<string, unknown>, K extends keyof T & string, V extends keyof T & string>(arr: T[], key: K, valueKey: V): Record<string, T[V]>;
5
+ //# sourceMappingURL=mapFromArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapFromArray.d.ts","sourceRoot":"","sources":["../../src/helpers/mapFromArray.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,YAAY,CAC1B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAC1B,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAC1B,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,wBAQ9B"}
@@ -0,0 +1,6 @@
1
+ import type { ClientRequestConfig, RequestResult } from '../types';
2
+ /**
3
+ * Send a request via the proxy
4
+ */
5
+ export declare function sendRequest(request: ClientRequestConfig, proxyUrl: string): Promise<RequestResult | null>;
6
+ //# sourceMappingURL=sendRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/sendRequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,mBAAmB,EAGnB,aAAa,EACd,MAAM,UAAU,CAAA;AAUjB;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA6D/B"}
@@ -0,0 +1,2 @@
1
+ export { useOperation } from './useOperation';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,31 @@
1
+ export declare enum CopilotLoadingStates {
2
+ Inactive = "Inactive",
3
+ Fix = "Fix",
4
+ Loading = "Loading",
5
+ Working = "Working",
6
+ Success = "Success"
7
+ }
8
+ export type RequestData = {
9
+ id: string;
10
+ request: string;
11
+ };
12
+ export type RecommendationHandler = (recommendation: string) => void;
13
+ declare function sendCopilot(requestData: RequestData): void;
14
+ declare function setLoadingState(loadingState: CopilotLoadingStates): void;
15
+ /**
16
+ * This hook is used to send requests to the copilot server and receive recommendations.
17
+ */
18
+ export declare const useCopilot: () => {
19
+ sendCopilot: typeof sendCopilot;
20
+ state: {
21
+ readonly loadingState: CopilotLoadingStates;
22
+ };
23
+ onRecommendation: (handler: RecommendationHandler) => void;
24
+ serverHandlerState: {
25
+ uuid: string;
26
+ curlRequest: string;
27
+ };
28
+ setLoadingState: typeof setLoadingState;
29
+ };
30
+ export {};
31
+ //# sourceMappingURL=useCopilot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCopilot.d.ts","sourceRoot":"","sources":["../../src/hooks/useCopilot.ts"],"names":[],"mappings":"AAGA,oBAAY,oBAAoB;IAC9B,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAA;AAepE,iBAAS,WAAW,CAAC,WAAW,EAAE,WAAW,QAI5C;AAcD,iBAAS,eAAe,CAAC,YAAY,EAAE,oBAAoB,QAE1D;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;gCAGO,qBAAqB;;;;;;CAKjD,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { Operation, Parameters } from '../types';
2
+ export type ParamMap = {
3
+ path: Parameters[];
4
+ query: Parameters[];
5
+ header: Parameters[];
6
+ };
7
+ export type OperationProps = {
8
+ operation: Operation;
9
+ };
10
+ /**
11
+ * This hook is used to generate the parameters for the request from the parameters in the swagger file
12
+ */
13
+ export declare function useOperation(props: OperationProps): {
14
+ parameterMap: import("vue").ComputedRef<ParamMap>;
15
+ };
16
+ //# sourceMappingURL=useOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOperation.d.ts","sourceRoot":"","sources":["../../src/hooks/useOperation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErD,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,UAAU,EAAE,CAAA;IAClB,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,MAAM,EAAE,UAAU,EAAE,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc;;EAyBjD"}
@@ -0,0 +1,8 @@
1
+ export { ApiClient } from './components/ApiClient';
2
+ export * from './helpers';
3
+ export * from './hooks';
4
+ export * from './stores/apiClientStore';
5
+ export * from './stores/apiClientRequestStore';
6
+ export * from './types';
7
+ export * from './fixtures';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}