@scalar/api-reference 0.8.7 → 0.8.9

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 (41) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/browser/standalone.js +2954 -2670
  3. package/dist/components/Content/Authentication/Authentication.vue.d.ts.map +1 -1
  4. package/dist/components/Content/Authentication/SecurityScheme.vue.d.ts.map +1 -1
  5. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  6. package/dist/components/Content/Introduction/ServerItem.vue.d.ts +18 -0
  7. package/dist/components/Content/Introduction/ServerItem.vue.d.ts.map +1 -0
  8. package/dist/components/Content/Introduction/{BaseUrl.vue.d.ts → ServerList.vue.d.ts} +7 -5
  9. package/dist/components/Content/Introduction/ServerList.vue.d.ts.map +1 -0
  10. package/dist/components/Content/MarkdownRenderer.vue.d.ts.map +1 -1
  11. package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts +3 -19
  12. package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts.map +1 -1
  13. package/dist/components/Content/SchemaProperty.vue.d.ts +8 -8
  14. package/dist/components/Sidebar.vue.d.ts.map +1 -1
  15. package/dist/helpers/getApiClientRequest.d.ts +11 -0
  16. package/dist/helpers/getApiClientRequest.d.ts.map +1 -0
  17. package/dist/helpers/getHarRequest.d.ts +4 -0
  18. package/dist/helpers/getHarRequest.d.ts.map +1 -0
  19. package/dist/helpers/getRequestFromAuthentication.d.ts +4 -0
  20. package/dist/helpers/getRequestFromAuthentication.d.ts.map +1 -0
  21. package/dist/helpers/getRequestFromOperation.d.ts +5 -0
  22. package/dist/helpers/getRequestFromOperation.d.ts.map +1 -0
  23. package/dist/helpers/getUrlFromServerState.d.ts +3 -0
  24. package/dist/helpers/getUrlFromServerState.d.ts.map +1 -0
  25. package/dist/helpers/getVariableNames.d.ts +5 -0
  26. package/dist/helpers/getVariableNames.d.ts.map +1 -0
  27. package/dist/helpers/index.d.ts +7 -1
  28. package/dist/helpers/index.d.ts.map +1 -1
  29. package/dist/helpers/mapFromObject.d.ts +2 -2
  30. package/dist/helpers/mapFromObject.d.ts.map +1 -1
  31. package/dist/helpers/replaceVariables.d.ts +6 -0
  32. package/dist/helpers/replaceVariables.d.ts.map +1 -0
  33. package/dist/index.js +8529 -8216
  34. package/dist/stores/globalStore.d.ts +17 -1
  35. package/dist/stores/globalStore.d.ts.map +1 -1
  36. package/dist/types.d.ts +30 -0
  37. package/dist/types.d.ts.map +1 -1
  38. package/package.json +4 -3
  39. package/dist/components/Content/Introduction/BaseUrl.vue.d.ts.map +0 -1
  40. package/dist/helpers/generateRequest.d.ts +0 -8
  41. package/dist/helpers/generateRequest.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Authentication/Authentication.vue.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAA;;;;;;;;;;AA+K1C,wBAAkD"}
1
+ {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Authentication/Authentication.vue.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAA;;;;;;;;;;AA2L1C,wBAAkD"}
@@ -1 +1 @@
1
- {"version":3,"file":"SecurityScheme.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Authentication/SecurityScheme.vue.ts"],"names":[],"mappings":";;;;;;;;;AA8XA,wBAAkD"}
1
+ {"version":3,"file":"SecurityScheme.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Authentication/SecurityScheme.vue.ts"],"names":[],"mappings":";;;;;;;;;AA4XA,wBAAkD"}
@@ -1 +1 @@
1
- {"version":3,"file":"Introduction.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Introduction/Introduction.vue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2WxD,wBAAkD"}
1
+ {"version":3,"file":"Introduction.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Introduction/Introduction.vue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsUxD,wBAAkD"}
@@ -0,0 +1,18 @@
1
+ import type { Server, Variable } from '../../../types';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ value: {
4
+ type: import("vue").PropType<Server>;
5
+ };
6
+ variables: {
7
+ type: import("vue").PropType<Variable[]>;
8
+ };
9
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
10
+ value: {
11
+ type: import("vue").PropType<Server>;
12
+ };
13
+ variables: {
14
+ type: import("vue").PropType<Variable[]>;
15
+ };
16
+ }>>, {}, {}>;
17
+ export default _default;
18
+ //# sourceMappingURL=ServerItem.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Introduction/ServerItem.vue.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;;;;;;;;;;;;;;;;AA8FtD,wBAAkD"}
@@ -1,12 +1,14 @@
1
1
  import { type Server } from '../../../types';
2
2
  declare const _default: import("vue").DefineComponent<{
3
- server: {
4
- type: import("vue").PropType<Server>;
3
+ value: {
4
+ type: import("vue").PropType<Server[]>;
5
+ required: true;
5
6
  };
6
7
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
- server: {
8
- type: import("vue").PropType<Server>;
8
+ value: {
9
+ type: import("vue").PropType<Server[]>;
10
+ required: true;
9
11
  };
10
12
  }>>, {}, {}>;
11
13
  export default _default;
12
- //# sourceMappingURL=BaseUrl.vue.d.ts.map
14
+ //# sourceMappingURL=ServerList.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Introduction/ServerList.vue.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;;;;;;;;;;;;AA+c5C,wBAAkD"}
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownRenderer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Content/MarkdownRenderer.vue.ts"],"names":[],"mappings":";;;;;;;;;AA4IA,wBAAkD"}
1
+ {"version":3,"file":"MarkdownRenderer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Content/MarkdownRenderer.vue.ts"],"names":[],"mappings":";;;;;;;;;AAkJA,wBAAkD"}
@@ -1,28 +1,12 @@
1
- import type { Operation, Server, Spec } from '../../../types';
1
+ import type { TransformedOperation } from '../../../types';
2
2
  declare const _default: import("vue").DefineComponent<{
3
3
  operation: {
4
- type: import("vue").PropType<Operation>;
5
- required: true;
6
- };
7
- server: {
8
- type: import("vue").PropType<Server>;
9
- required: true;
10
- };
11
- spec: {
12
- type: import("vue").PropType<Spec>;
4
+ type: import("vue").PropType<TransformedOperation>;
13
5
  required: true;
14
6
  };
15
7
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
8
  operation: {
17
- type: import("vue").PropType<Operation>;
18
- required: true;
19
- };
20
- server: {
21
- type: import("vue").PropType<Server>;
22
- required: true;
23
- };
24
- spec: {
25
- type: import("vue").PropType<Spec>;
9
+ type: import("vue").PropType<TransformedOperation>;
26
10
  required: true;
27
11
  };
28
12
  }>>, {}, {}>;
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/ReferenceEndpoint/ExampleRequest.vue.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwe7D,wBAAkD"}
1
+ {"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/ReferenceEndpoint/ExampleRequest.vue.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;;;;;;;;;;;;AA2b1D,wBAAkD"}
@@ -1,29 +1,29 @@
1
1
  declare const _default_1: import("vue").DefineComponent<{
2
- required: {
3
- type: import("vue").PropType<boolean>;
4
- default: boolean;
5
- };
6
2
  value: {
7
3
  type: import("vue").PropType<Record<string, any>>;
8
4
  };
9
5
  name: {
10
6
  type: import("vue").PropType<string>;
11
7
  };
8
+ required: {
9
+ type: import("vue").PropType<boolean>;
10
+ default: boolean;
11
+ };
12
12
  level: {
13
13
  type: import("vue").PropType<number>;
14
14
  default: number;
15
15
  };
16
16
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
17
- required: {
18
- type: import("vue").PropType<boolean>;
19
- default: boolean;
20
- };
21
17
  value: {
22
18
  type: import("vue").PropType<Record<string, any>>;
23
19
  };
24
20
  name: {
25
21
  type: import("vue").PropType<string>;
26
22
  };
23
+ required: {
24
+ type: import("vue").PropType<boolean>;
25
+ default: boolean;
26
+ };
27
27
  level: {
28
28
  type: import("vue").PropType<number>;
29
29
  default: number;
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../src/components/Sidebar.vue.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAa,IAAI,EAAO,MAAM,UAAU,CAAA;;;;;;;;;;;;AA0apD,wBAAkD"}
1
+ {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../src/components/Sidebar.vue.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,IAAI,EAA6B,MAAM,UAAU,CAAA;;;;;;;;;;;;AA0a/D,wBAAkD"}
@@ -0,0 +1,11 @@
1
+ import type { ClientRequestConfig } from '@scalar/api-client';
2
+ import type { AuthenticationState, ServerState, TransformedOperation } from '../types';
3
+ /**
4
+ * Generate parameters for the request
5
+ */
6
+ export declare function getApiClientRequest({ serverState, authenticationState, operation, }: {
7
+ serverState: ServerState;
8
+ authenticationState: AuthenticationState;
9
+ operation: TransformedOperation;
10
+ }): ClientRequestConfig;
11
+ //# sourceMappingURL=getApiClientRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getApiClientRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/getApiClientRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACrB,MAAM,UAAU,CAAA;AAQjB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,mBAAmB,EACnB,SAAS,GACV,EAAE;IACD,WAAW,EAAE,WAAW,CAAA;IACxB,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,SAAS,EAAE,oBAAoB,CAAA;CAChC,GAAG,mBAAmB,CA4BtB"}
@@ -0,0 +1,4 @@
1
+ import type { HarRequest } from 'httpsnippet-lite';
2
+ import type { HarRequestWithPath } from '../types';
3
+ export declare const getHarRequest: (...requests: Partial<HarRequestWithPath>[]) => HarRequest;
4
+ //# sourceMappingURL=getHarRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHarRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/getHarRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,KAAK,EAAU,kBAAkB,EAAiB,MAAM,UAAU,CAAA;AAEzE,eAAO,MAAM,aAAa,gBACX,QAAQ,kBAAkB,CAAC,EAAE,KACzC,UAiDF,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { HarRequest } from 'httpsnippet-lite';
2
+ import type { AuthenticationState } from '../types';
3
+ export declare function getRequestFromAuthentication(authentication: AuthenticationState): Partial<HarRequest>;
4
+ //# sourceMappingURL=getRequestFromAuthentication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRequestFromAuthentication.d.ts","sourceRoot":"","sources":["../../src/helpers/getRequestFromAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,mBAAmB,GAClC,OAAO,CAAC,UAAU,CAAC,CAoErB"}
@@ -0,0 +1,5 @@
1
+ import type { HarRequestWithPath, TransformedOperation } from '../types';
2
+ export declare const getRequestFromOperation: (operation: TransformedOperation, options?: {
3
+ replaceVariables?: boolean;
4
+ }) => Partial<HarRequestWithPath>;
5
+ //# sourceMappingURL=getRequestFromOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRequestFromOperation.d.ts","sourceRoot":"","sources":["../../src/helpers/getRequestFromOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAGxE,eAAO,MAAM,uBAAuB,cACvB,oBAAoB,YACrB;IACR,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,KACA,QAAQ,kBAAkB,CA6C5B,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { ServerState } from '../types';
2
+ export declare function getUrlFromServerState(state: ServerState): string;
3
+ //# sourceMappingURL=getUrlFromServerState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUrlFromServerState.d.ts","sourceRoot":"","sources":["../../src/helpers/getUrlFromServerState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG3C,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,UAOvD"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns all variables used in a string
3
+ */
4
+ export declare function getVariableNames(value?: string): string[];
5
+ //# sourceMappingURL=getVariableNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVariableNames.d.ts","sourceRoot":"","sources":["../../src/helpers/getVariableNames.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,YAO9C"}
@@ -1,17 +1,23 @@
1
1
  export * from './deepMerge';
2
- export * from './generateRequest';
2
+ export * from './getApiClientRequest';
3
3
  export * from './getExampleFromSchema';
4
+ export * from './getHarRequest';
4
5
  export * from './getHeadingId';
5
6
  export * from './getHeadingsFromMarkdown';
6
7
  export * from './getModelSectionId';
7
8
  export * from './getOperationSectionId';
9
+ export * from './getRequestFromAuthentication';
10
+ export * from './getRequestFromOperation';
8
11
  export * from './getTagSectionId';
12
+ export * from './getUrlFromServerState';
13
+ export * from './getVariableNames';
9
14
  export * from './hasModels';
10
15
  export * from './hasSecuritySchemes';
11
16
  export * from './isJsonString';
12
17
  export * from './mapFromObject';
13
18
  export * from './objectMerge';
14
19
  export * from './prettyPrintJson';
20
+ export * from './replaceVariables';
15
21
  export * from './scrollToId';
16
22
  export * from './transformToJson';
17
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,2BAA2B,CAAA;AACzC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,2BAA2B,CAAA;AACzC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Map an object to an array of key-value pairs.
3
3
  */
4
- export declare const mapFromObject: (object: Record<string, any>) => {
5
- key: string;
4
+ export declare const mapFromObject: (object: Record<string, any>, keyName?: string) => {
5
+ [keyName: string]: any;
6
6
  value: any;
7
7
  }[];
8
8
  //# sourceMappingURL=mapFromObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapFromObject.d.ts","sourceRoot":"","sources":["../../src/helpers/mapFromObject.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa,WAAY,OAAO,MAAM,EAAE,GAAG,CAAC;;;GAOxD,CAAA"}
1
+ {"version":3,"file":"mapFromObject.d.ts","sourceRoot":"","sources":["../../src/helpers/mapFromObject.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa,WAChB,OAAO,MAAM,EAAE,GAAG,CAAC,YACjB,MAAM;;WAGT,GAAG;GAQX,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { Variable } from '../types';
2
+ /**
3
+ * This function takes a string and replace {variables} with given values.
4
+ */
5
+ export declare function replaceVariables(value: string, variablesOrCallback: Variable[] | ((match: string) => string)): string;
6
+ //# sourceMappingURL=replaceVariables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replaceVariables.d.ts","sourceRoot":"","sources":["../../src/helpers/replaceVariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,UAsB9D"}