@scalar/workspace-store 0.28.1 → 0.28.3

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 (102) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/client.d.ts +10 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +42 -2
  5. package/dist/client.js.map +2 -2
  6. package/dist/entities/auth/index.d.ts +75 -0
  7. package/dist/entities/auth/index.d.ts.map +1 -0
  8. package/dist/entities/auth/index.js +89 -0
  9. package/dist/entities/auth/index.js.map +7 -0
  10. package/dist/entities/auth/schema.d.ts +7318 -0
  11. package/dist/entities/auth/schema.d.ts.map +1 -0
  12. package/dist/entities/auth/schema.js +74 -0
  13. package/dist/entities/auth/schema.js.map +7 -0
  14. package/dist/entities/history/index.d.ts +93 -0
  15. package/dist/entities/history/index.d.ts.map +1 -0
  16. package/dist/entities/history/index.js +62 -0
  17. package/dist/entities/history/index.js.map +7 -0
  18. package/dist/entities/history/schema.d.ts +234 -0
  19. package/dist/entities/history/schema.d.ts.map +1 -0
  20. package/dist/{schemas/extensions/operation/x-scalar-history.js → entities/history/schema.js} +5 -6
  21. package/dist/{schemas/extensions/operation/x-scalar-history.js.map → entities/history/schema.js.map} +3 -3
  22. package/dist/events/definitions/auth.d.ts +14 -0
  23. package/dist/events/definitions/auth.d.ts.map +1 -1
  24. package/dist/mutators/auth.d.ts +10 -17
  25. package/dist/mutators/auth.d.ts.map +1 -1
  26. package/dist/mutators/auth.js +87 -57
  27. package/dist/mutators/auth.js.map +2 -2
  28. package/dist/mutators/index.d.ts +4 -12
  29. package/dist/mutators/index.d.ts.map +1 -1
  30. package/dist/mutators/index.js +1 -1
  31. package/dist/mutators/index.js.map +2 -2
  32. package/dist/mutators/operation.d.ts +2 -2
  33. package/dist/mutators/operation.d.ts.map +1 -1
  34. package/dist/mutators/operation.js +9 -16
  35. package/dist/mutators/operation.js.map +2 -2
  36. package/dist/mutators/server.d.ts.map +1 -1
  37. package/dist/mutators/server.js +0 -3
  38. package/dist/mutators/server.js.map +2 -2
  39. package/dist/persistence/index.d.ts +16 -3
  40. package/dist/persistence/index.d.ts.map +1 -1
  41. package/dist/persistence/index.js +47 -3
  42. package/dist/persistence/index.js.map +2 -2
  43. package/dist/plugins/bundler/index.d.ts +7 -0
  44. package/dist/plugins/bundler/index.d.ts.map +1 -1
  45. package/dist/plugins/bundler/index.js +17 -0
  46. package/dist/plugins/bundler/index.js.map +2 -2
  47. package/dist/plugins/client/persistence.d.ts.map +1 -1
  48. package/dist/plugins/client/persistence.js +12 -0
  49. package/dist/plugins/client/persistence.js.map +2 -2
  50. package/dist/resolve.d.ts +9 -0
  51. package/dist/resolve.d.ts.map +1 -0
  52. package/dist/resolve.js +28 -0
  53. package/dist/resolve.js.map +7 -0
  54. package/dist/schemas/extensions/security/index.d.ts +2 -0
  55. package/dist/schemas/extensions/security/index.d.ts.map +1 -0
  56. package/dist/schemas/extensions/security/index.js +1 -0
  57. package/dist/schemas/extensions/security/index.js.map +7 -0
  58. package/dist/schemas/inmemory-workspace.d.ts +2952 -149
  59. package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
  60. package/dist/schemas/inmemory-workspace.js +5 -1
  61. package/dist/schemas/inmemory-workspace.js.map +2 -2
  62. package/dist/schemas/reference-config/index.d.ts +35 -149
  63. package/dist/schemas/reference-config/index.d.ts.map +1 -1
  64. package/dist/schemas/reference-config/settings.d.ts +35 -149
  65. package/dist/schemas/reference-config/settings.d.ts.map +1 -1
  66. package/dist/schemas/v3.1/strict/oauth-flow.d.ts +5 -35
  67. package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
  68. package/dist/schemas/v3.1/strict/oauth-flow.js +1 -16
  69. package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
  70. package/dist/schemas/v3.1/strict/oauthflows.d.ts +0 -29
  71. package/dist/schemas/v3.1/strict/oauthflows.d.ts.map +1 -1
  72. package/dist/schemas/v3.1/strict/openapi-document.d.ts +1245 -6744
  73. package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
  74. package/dist/schemas/v3.1/strict/openapi-document.js +2 -10
  75. package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
  76. package/dist/schemas/v3.1/strict/operation.d.ts +1 -70
  77. package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
  78. package/dist/schemas/v3.1/strict/operation.js +1 -7
  79. package/dist/schemas/v3.1/strict/operation.js.map +2 -2
  80. package/dist/schemas/v3.1/strict/ref-definitions.d.ts +0 -1
  81. package/dist/schemas/v3.1/strict/ref-definitions.d.ts.map +1 -1
  82. package/dist/schemas/v3.1/strict/ref-definitions.js +1 -3
  83. package/dist/schemas/v3.1/strict/ref-definitions.js.map +2 -2
  84. package/dist/schemas/v3.1/strict/schema.d.ts +50 -46
  85. package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
  86. package/dist/schemas/v3.1/strict/schema.js +5 -2
  87. package/dist/schemas/v3.1/strict/schema.js.map +2 -2
  88. package/dist/schemas/v3.1/strict/security-scheme.d.ts +3 -11
  89. package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
  90. package/dist/schemas/v3.1/strict/security-scheme.js +0 -7
  91. package/dist/schemas/v3.1/strict/security-scheme.js.map +2 -2
  92. package/dist/schemas/workspace.d.ts +245 -1043
  93. package/dist/schemas/workspace.d.ts.map +1 -1
  94. package/dist/workspace-plugin.d.ts +8 -0
  95. package/dist/workspace-plugin.d.ts.map +1 -1
  96. package/package.json +26 -6
  97. package/dist/schemas/extensions/operation/x-scalar-history.d.ts +0 -217
  98. package/dist/schemas/extensions/operation/x-scalar-history.d.ts.map +0 -1
  99. package/dist/schemas/extensions/security/x-scalar-selected-security.d.ts +0 -17
  100. package/dist/schemas/extensions/security/x-scalar-selected-security.d.ts.map +0 -1
  101. package/dist/schemas/extensions/security/x-scalar-selected-security.js +0 -14
  102. package/dist/schemas/extensions/security/x-scalar-selected-security.js.map +0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Y,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA"}
@@ -0,0 +1,74 @@
1
+ import { Type } from "@scalar/typebox";
2
+ import { compose } from "../../schemas/compose.js";
3
+ import { XScalarCredentialsLocationSchema } from "../../schemas/extensions/security/x-scalar-credentials-location.js";
4
+ import {
5
+ XScalarSecretClientIdSchema,
6
+ XScalarSecretClientSecretSchema,
7
+ XScalarSecretHTTPSchema,
8
+ XScalarSecretRedirectUriSchema,
9
+ XScalarSecretTokenSchema
10
+ } from "../../schemas/extensions/security/x-scalar-security-secrets.js";
11
+ import { SecurityRequirementObjectSchema } from "../../schemas/v3.1/strict/openapi-document.js";
12
+ const SecretsApiKeySchema = compose(
13
+ Type.Object({
14
+ type: Type.Literal("apiKey")
15
+ }),
16
+ XScalarSecretTokenSchema
17
+ );
18
+ const SecretsHttpSchema = compose(
19
+ Type.Object({
20
+ type: Type.Literal("http")
21
+ }),
22
+ XScalarSecretTokenSchema,
23
+ XScalarSecretHTTPSchema
24
+ );
25
+ const SecretsOAuthFlowCommonSchema = compose(XScalarSecretClientIdSchema, XScalarSecretTokenSchema);
26
+ const SecretsOAuthFlowsSchema = Type.Object({
27
+ implicit: Type.Optional(compose(SecretsOAuthFlowCommonSchema, XScalarSecretRedirectUriSchema)),
28
+ password: Type.Optional(
29
+ compose(
30
+ SecretsOAuthFlowCommonSchema,
31
+ XScalarSecretHTTPSchema,
32
+ XScalarSecretClientSecretSchema,
33
+ XScalarCredentialsLocationSchema
34
+ )
35
+ ),
36
+ clientCredentials: Type.Optional(
37
+ compose(SecretsOAuthFlowCommonSchema, XScalarSecretClientSecretSchema, XScalarCredentialsLocationSchema)
38
+ ),
39
+ authorizationCode: Type.Optional(
40
+ compose(
41
+ SecretsOAuthFlowCommonSchema,
42
+ XScalarSecretClientSecretSchema,
43
+ XScalarSecretRedirectUriSchema,
44
+ XScalarCredentialsLocationSchema
45
+ )
46
+ )
47
+ });
48
+ const OAuthSchema = compose(
49
+ Type.Object({
50
+ type: Type.Literal("oauth2")
51
+ }),
52
+ SecretsOAuthFlowsSchema
53
+ );
54
+ const SecretsAuthUnionSchema = Type.Union([SecretsApiKeySchema, SecretsHttpSchema, OAuthSchema]);
55
+ const SecretsAuthSchema = Type.Record(Type.String(), SecretsAuthUnionSchema);
56
+ const SelectedSecuritySchema = Type.Object({
57
+ selectedIndex: Type.Number(),
58
+ selectedSchemes: Type.Array(SecurityRequirementObjectSchema)
59
+ });
60
+ const AuthSchema = Type.Object({
61
+ secrets: SecretsAuthSchema,
62
+ selected: Type.Object({
63
+ document: Type.Optional(SelectedSecuritySchema),
64
+ path: Type.Optional(Type.Record(Type.String(), Type.Record(Type.String(), SelectedSecuritySchema)))
65
+ })
66
+ });
67
+ const DocumentAuthSchema = Type.Record(Type.String(), AuthSchema);
68
+ export {
69
+ AuthSchema,
70
+ DocumentAuthSchema,
71
+ SecretsAuthSchema,
72
+ SecretsAuthUnionSchema
73
+ };
74
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/auth/schema.ts"],
4
+ "sourcesContent": ["import { type Static, Type } from '@scalar/typebox'\n\nimport { compose } from '@/schemas/compose'\nimport { XScalarCredentialsLocationSchema } from '@/schemas/extensions/security/x-scalar-credentials-location'\nimport {\n XScalarSecretClientIdSchema,\n XScalarSecretClientSecretSchema,\n XScalarSecretHTTPSchema,\n XScalarSecretRedirectUriSchema,\n XScalarSecretTokenSchema,\n} from '@/schemas/extensions/security/x-scalar-security-secrets'\nimport { SecurityRequirementObjectSchema } from '@/schemas/v3.1/strict/openapi-document'\n\nconst SecretsApiKeySchema = compose(\n Type.Object({\n type: Type.Literal('apiKey'),\n }),\n XScalarSecretTokenSchema,\n)\n\nexport type SecretsApiKey = Static<typeof SecretsApiKeySchema>\n\nconst SecretsHttpSchema = compose(\n Type.Object({\n type: Type.Literal('http'),\n }),\n XScalarSecretTokenSchema,\n XScalarSecretHTTPSchema,\n)\n\nexport type SecretsHttp = Static<typeof SecretsHttpSchema>\n\nconst SecretsOAuthFlowCommonSchema = compose(XScalarSecretClientIdSchema, XScalarSecretTokenSchema)\n\nconst SecretsOAuthFlowsSchema = Type.Object({\n implicit: Type.Optional(compose(SecretsOAuthFlowCommonSchema, XScalarSecretRedirectUriSchema)),\n password: Type.Optional(\n compose(\n SecretsOAuthFlowCommonSchema,\n XScalarSecretHTTPSchema,\n XScalarSecretClientSecretSchema,\n XScalarCredentialsLocationSchema,\n ),\n ),\n clientCredentials: Type.Optional(\n compose(SecretsOAuthFlowCommonSchema, XScalarSecretClientSecretSchema, XScalarCredentialsLocationSchema),\n ),\n authorizationCode: Type.Optional(\n compose(\n SecretsOAuthFlowCommonSchema,\n XScalarSecretClientSecretSchema,\n XScalarSecretRedirectUriSchema,\n XScalarCredentialsLocationSchema,\n ),\n ),\n})\n\nexport type SecretsOAuthFlows = Static<typeof SecretsOAuthFlowsSchema>\n\nconst OAuthSchema = compose(\n Type.Object({\n type: Type.Literal('oauth2'),\n }),\n SecretsOAuthFlowsSchema,\n)\n\nexport type SecretsOAuth = Static<typeof OAuthSchema>\n\nexport const SecretsAuthUnionSchema = Type.Union([SecretsApiKeySchema, SecretsHttpSchema, OAuthSchema])\nexport type SecretsAuthUnion = Static<typeof SecretsAuthUnionSchema>\n\nexport const SecretsAuthSchema = Type.Record(Type.String(), SecretsAuthUnionSchema)\nexport type SecretsAuth = Static<typeof SecretsAuthSchema>\n\nconst SelectedSecuritySchema = Type.Object({\n selectedIndex: Type.Number(),\n selectedSchemes: Type.Array(SecurityRequirementObjectSchema),\n})\n\nexport type SelectedSecurity = Static<typeof SelectedSecuritySchema>\n\nexport const AuthSchema = Type.Object({\n secrets: SecretsAuthSchema,\n selected: Type.Object({\n document: Type.Optional(SelectedSecuritySchema),\n path: Type.Optional(Type.Record(Type.String(), Type.Record(Type.String(), SelectedSecuritySchema))),\n }),\n})\n\nexport type Auth = Static<typeof AuthSchema>\n\nexport const DocumentAuth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MAAM,+BAA+B;AAC7D,CAAC;AAIM,MAAM,aAAa,KAAK,OAAO;AAAA,EACpC,SAAS;AAAA,EACT,UAAU,KAAK,OAAO;AAAA,IACpB,UAAU,KAAK,SAAS,sBAAsB;AAAA,IAC9C,MAAM,KAAK,SAAS,KAAK,OAAO,KAAK,OAAO,GAAG,KAAK,OAAO,KAAK,OAAO,GAAG,sBAAsB,CAAC,CAAC;AAAA,EACpG,CAAC;AACH,CAAC;AAIM,MAAM,qBAAqB,KAAK,OAAO,KAAK,OAAO,GAAG,UAAU;",
6
+ "names": []
7
+ }
@@ -0,0 +1,93 @@
1
+ import { type DocumentHistory, type HistoryEntry } from '../../entities/history/schema.js';
2
+ /**
3
+ * Interface for the HistoryStore.
4
+ * Provides methods to manage and retrieve request/response history for API operations within a document.
5
+ */
6
+ export type HistoryStore = {
7
+ /**
8
+ * Retrieve the history entries for a specific operation (by document, path, and method).
9
+ *
10
+ * @param documentName - The name of the document (e.g., OpenAPI file name)
11
+ * @param path - The path of the operation (e.g., "/pets")
12
+ * @param method - The HTTP method (e.g., "get", "post")
13
+ * @returns An array of HistoryEntry objects or undefined if none exist
14
+ */
15
+ getHistory: (documentName: string, path: string, method: string) => HistoryEntry[] | undefined;
16
+ /**
17
+ * Add a new entry to the history for a specific operation.
18
+ *
19
+ * @param documentName - The name of the document
20
+ * @param path - The path of the operation
21
+ * @param method - The HTTP method
22
+ * @param entry - The HistoryEntry object to add
23
+ */
24
+ addHistory: (documentName: string, path: string, method: string, entry: HistoryEntry) => void;
25
+ /**
26
+ * Clear the history for a specific operation (removes all entries for the given document, path, and method).
27
+ *
28
+ * @param documentName - The name of the document
29
+ * @param path - The path of the operation
30
+ * @param method - The HTTP method
31
+ */
32
+ clearOperationHistory: (documentName: string, path: string, method: string) => void;
33
+ /**
34
+ * Clear all history for a specific path in a document (removes all entries for any method on the given path).
35
+ *
36
+ * @param documentName - The name of the document
37
+ * @param path - The path for which to remove all history
38
+ */
39
+ clearPathHistory: (documentName: string, path: string) => void;
40
+ /**
41
+ * Clear all history for an entire document (removes all entries in the document).
42
+ *
43
+ * @param documentName - The name of the document
44
+ */
45
+ clearDocumentHistory: (documentName: string) => void;
46
+ /**
47
+ * Load a complete DocumentHistory object into the store (replaces existing history).
48
+ *
49
+ * @param data - The DocumentHistory object to load
50
+ */
51
+ load: (data: DocumentHistory) => void;
52
+ /**
53
+ * Export the current DocumentHistory from the store.
54
+ *
55
+ * @returns The DocumentHistory object
56
+ */
57
+ export: () => DocumentHistory;
58
+ };
59
+ /**
60
+ * Creates a reactive history store for tracking request and response entries for documents and operations.
61
+ *
62
+ * @param hooks (Optional) - Lifecycle hooks for store events, such as onHistoryChange.
63
+ * @returns HistoryStore - Methods for interacting with the operation history.
64
+ *
65
+ * ## Example
66
+ * ```ts
67
+ * const historyStore = createHistoryStore({
68
+ * hooks: {
69
+ * onHistoryChange: (documentName, operationName, history) => {
70
+ * console.log(`History changed for ${documentName}/${operationName}`, history)
71
+ * }
72
+ * }
73
+ * })
74
+ *
75
+ * // Add a history entry
76
+ * historyStore.addHistory('petstore.yaml', 'getPets', { ...entry })
77
+ *
78
+ * // Get history entries for an operation
79
+ * const entries = historyStore.getHistory('petstore.yaml', 'getPets')
80
+ * ```
81
+ */
82
+ export declare const createHistoryStore: ({ hooks, }: {
83
+ hooks?: {
84
+ /**
85
+ * Called whenever operation history changes for a document.
86
+ * @param documentName - Name of the document (e.g., "petstore.yaml")
87
+ * @param operationName - Name of the operation (e.g., "getPets")
88
+ * @param history - Record of operation histories for this document
89
+ */
90
+ onHistoryChange?: (documentName: string) => void;
91
+ };
92
+ }) => HistoryStore;
93
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/history/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAyB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAK1G;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,YAAY,EAAE,GAAG,SAAS,CAAA;IAE9F;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;IAE7F;;;;;;OAMG;IACH,qBAAqB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAEnF;;;;;OAKG;IACH,gBAAgB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAE9D;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAEpD;;;;OAIG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAA;IAErC;;;;OAIG;IACH,MAAM,EAAE,MAAM,eAAe,CAAA;CAC9B,CAAA;AAID;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAEhC;IACD,KAAK,CAAC,EAAE;QACN;;;;;WAKG;QACH,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;KACjD,CAAA;CACF,KAAG,YAmEH,CAAA"}
@@ -0,0 +1,62 @@
1
+ import { reactive } from "vue";
2
+ import { DocumentHistorySchema } from "../../entities/history/schema.js";
3
+ import { safeAssign } from "../../helpers/general.js";
4
+ import { unpackProxyObject } from "../../helpers/unpack-proxy.js";
5
+ import { coerceValue } from "../../schemas/typebox-coerce.js";
6
+ const HISTORY_LIMIT = 5;
7
+ const createHistoryStore = ({
8
+ hooks
9
+ }) => {
10
+ const history = reactive({});
11
+ const getHistory = (documentName, path, method) => {
12
+ return history[documentName]?.[path]?.[method];
13
+ };
14
+ const addHistory = (documentName, path, method, entry) => {
15
+ history[documentName] ||= {};
16
+ history[documentName][path] ||= {};
17
+ history[documentName][path][method] ||= [];
18
+ if (history[documentName][path][method].length >= HISTORY_LIMIT) {
19
+ history[documentName][path][method] = unpackProxyObject(
20
+ history[documentName][path][method].filter((_, i) => i !== 0),
21
+ { depth: 1 }
22
+ );
23
+ }
24
+ history[documentName][path][method].push(entry);
25
+ hooks?.onHistoryChange?.(documentName);
26
+ };
27
+ const clearOperationHistory = (documentName, path, method) => {
28
+ delete history[documentName]?.[path]?.[method];
29
+ hooks?.onHistoryChange?.(documentName);
30
+ };
31
+ const clearPathHistory = (documentName, path) => {
32
+ delete history[documentName]?.[path];
33
+ hooks?.onHistoryChange?.(documentName);
34
+ };
35
+ const clearDocumentHistory = (documentName) => {
36
+ delete history[documentName];
37
+ hooks?.onHistoryChange?.(documentName);
38
+ };
39
+ const load = (data) => {
40
+ const coercedData = coerceValue(DocumentHistorySchema, data);
41
+ safeAssign(history, coercedData);
42
+ Object.keys(coercedData).forEach((documentName) => {
43
+ hooks?.onHistoryChange?.(documentName);
44
+ });
45
+ };
46
+ const exportHistory = () => {
47
+ return unpackProxyObject(history);
48
+ };
49
+ return {
50
+ getHistory,
51
+ addHistory,
52
+ clearOperationHistory,
53
+ clearPathHistory,
54
+ clearDocumentHistory,
55
+ load,
56
+ export: exportHistory
57
+ };
58
+ };
59
+ export {
60
+ createHistoryStore
61
+ };
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/history/index.ts"],
4
+ "sourcesContent": ["import { reactive } from 'vue'\n\nimport { type DocumentHistory, DocumentHistorySchema, type HistoryEntry } from '@/entities/history/schema'\nimport { safeAssign } from '@/helpers/general'\nimport { unpackProxyObject } from '@/helpers/unpack-proxy'\nimport { coerceValue } from '@/schemas/typebox-coerce'\n\n/**\n * Interface for the HistoryStore.\n * Provides methods to manage and retrieve request/response history for API operations within a document.\n */\nexport type HistoryStore = {\n /**\n * Retrieve the history entries for a specific operation (by document, path, and method).\n *\n * @param documentName - The name of the document (e.g., OpenAPI file name)\n * @param path - The path of the operation (e.g., \"/pets\")\n * @param method - The HTTP method (e.g., \"get\", \"post\")\n * @returns An array of HistoryEntry objects or undefined if none exist\n */\n getHistory: (documentName: string, path: string, method: string) => HistoryEntry[] | undefined\n\n /**\n * Add a new entry to the history for a specific operation.\n *\n * @param documentName - The name of the document\n * @param path - The path of the operation\n * @param method - The HTTP method\n * @param entry - The HistoryEntry object to add\n */\n addHistory: (documentName: string, path: string, method: string, entry: HistoryEntry) => void\n\n /**\n * Clear the history for a specific operation (removes all entries for the given document, path, and method).\n *\n * @param documentName - The name of the document\n * @param path - The path of the operation\n * @param method - The HTTP method\n */\n clearOperationHistory: (documentName: string, path: string, method: string) => void\n\n /**\n * Clear all history for a specific path in a document (removes all entries for any method on the given path).\n *\n * @param documentName - The name of the document\n * @param path - The path for which to remove all history\n */\n clearPathHistory: (documentName: string, path: string) => void\n\n /**\n * Clear all history for an entire document (removes all entries in the document).\n *\n * @param documentName - The name of the document\n */\n clearDocumentHistory: (documentName: string) => void\n\n /**\n * Load a complete DocumentHistory object into the store (replaces existing history).\n *\n * @param data - The DocumentHistory object to load\n */\n load: (data: DocumentHistory) => void\n\n /**\n * Export the current DocumentHistory from the store.\n *\n * @returns The DocumentHistory object\n */\n export: () => DocumentHistory\n}\n\nconst HISTORY_LIMIT = 5\n\n/**\n * Creates a reactive history store for tracking request and response entries for documents and operations.\n *\n * @param hooks (Optional) - Lifecycle hooks for store events, such as onHistoryChange.\n * @returns HistoryStore - Methods for interacting with the operation history.\n *\n * ## Example\n * ```ts\n * const historyStore = createHistoryStore({\n * hooks: {\n * onHistoryChange: (documentName, operationName, history) => {\n * console.log(`History changed for ${documentName}/${operationName}`, history)\n * }\n * }\n * })\n *\n * // Add a history entry\n * historyStore.addHistory('petstore.yaml', 'getPets', { ...entry })\n *\n * // Get history entries for an operation\n * const entries = historyStore.getHistory('petstore.yaml', 'getPets')\n * ```\n */\nexport const createHistoryStore = ({\n hooks,\n}: {\n hooks?: {\n /**\n * Called whenever operation history changes for a document.\n * @param documentName - Name of the document (e.g., \"petstore.yaml\")\n * @param operationName - Name of the operation (e.g., \"getPets\")\n * @param history - Record of operation histories for this document\n */\n onHistoryChange?: (documentName: string) => void\n }\n}): HistoryStore => {\n const history = reactive<DocumentHistory>({})\n\n const getHistory: HistoryStore['getHistory'] = (documentName, path, method) => {\n return history[documentName]?.[path]?.[method]\n }\n\n const addHistory: HistoryStore['addHistory'] = (documentName, path, method, entry) => {\n history[documentName] ||= {}\n history[documentName][path] ||= {}\n history[documentName][path][method] ||= []\n\n // We want to make sure that the history is not full\n if (history[documentName][path][method].length >= HISTORY_LIMIT) {\n // Delete the oldest entry\n // We need to unpack the history array to avoid proxy object issues\n history[documentName][path][method] = unpackProxyObject(\n history[documentName][path][method].filter((_, i) => i !== 0),\n { depth: 1 },\n )\n }\n\n // Add the new entry to the history\n history[documentName][path][method].push(entry)\n\n // Explicitly trigger the change event once after all modifications\n hooks?.onHistoryChange?.(documentName)\n }\n\n const clearOperationHistory: HistoryStore['clearOperationHistory'] = (documentName, path, method) => {\n delete history[documentName]?.[path]?.[method]\n hooks?.onHistoryChange?.(documentName)\n }\n\n const clearPathHistory: HistoryStore['clearPathHistory'] = (documentName, path) => {\n delete history[documentName]?.[path]\n hooks?.onHistoryChange?.(documentName)\n }\n\n const clearDocumentHistory: HistoryStore['clearDocumentHistory'] = (documentName) => {\n delete history[documentName]\n hooks?.onHistoryChange?.(documentName)\n }\n\n const load: HistoryStore['load'] = (data) => {\n const coercedData = coerceValue(DocumentHistorySchema, data)\n safeAssign(history, coercedData)\n\n // Trigger change events for all loaded documents\n Object.keys(coercedData).forEach((documentName) => {\n hooks?.onHistoryChange?.(documentName)\n })\n }\n\n const exportHistory: HistoryStore['export'] = () => {\n return unpackProxyObject(history)\n }\n\n return {\n getHistory,\n addHistory,\n clearOperationHistory,\n clearPathHistory,\n clearDocumentHistory,\n load,\n export: exportHistory,\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,gBAAgB;AAEzB,SAA+B,6BAAgD;AAC/E,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAkE5B,MAAM,gBAAgB;AAyBf,MAAM,qBAAqB,CAAC;AAAA,EACjC;AACF,MAUoB;AAClB,QAAM,UAAU,SAA0B,CAAC,CAAC;AAE5C,QAAM,aAAyC,CAAC,cAAc,MAAM,WAAW;AAC7E,WAAO,QAAQ,YAAY,IAAI,IAAI,IAAI,MAAM;AAAA,EAC/C;AAEA,QAAM,aAAyC,CAAC,cAAc,MAAM,QAAQ,UAAU;AACpF,YAAQ,YAAY,MAAM,CAAC;AAC3B,YAAQ,YAAY,EAAE,IAAI,MAAM,CAAC;AACjC,YAAQ,YAAY,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGzC,QAAI,QAAQ,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,eAAe;AAG/D,cAAQ,YAAY,EAAE,IAAI,EAAE,MAAM,IAAI;AAAA,QACpC,QAAQ,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,MAAM,CAAC;AAAA,QAC5D,EAAE,OAAO,EAAE;AAAA,MACb;AAAA,IACF;AAGA,YAAQ,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,KAAK;AAG9C,WAAO,kBAAkB,YAAY;AAAA,EACvC;AAEA,QAAM,wBAA+D,CAAC,cAAc,MAAM,WAAW;AACnG,WAAO,QAAQ,YAAY,IAAI,IAAI,IAAI,MAAM;AAC7C,WAAO,kBAAkB,YAAY;AAAA,EACvC;AAEA,QAAM,mBAAqD,CAAC,cAAc,SAAS;AACjF,WAAO,QAAQ,YAAY,IAAI,IAAI;AACnC,WAAO,kBAAkB,YAAY;AAAA,EACvC;AAEA,QAAM,uBAA6D,CAAC,iBAAiB;AACnF,WAAO,QAAQ,YAAY;AAC3B,WAAO,kBAAkB,YAAY;AAAA,EACvC;AAEA,QAAM,OAA6B,CAAC,SAAS;AAC3C,UAAM,cAAc,YAAY,uBAAuB,IAAI;AAC3D,eAAW,SAAS,WAAW;AAG/B,WAAO,KAAK,WAAW,EAAE,QAAQ,CAAC,iBAAiB;AACjD,aAAO,kBAAkB,YAAY;AAAA,IACvC,CAAC;AAAA,EACH;AAEA,QAAM,gBAAwC,MAAM;AAClD,WAAO,kBAAkB,OAAO;AAAA,EAClC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,234 @@
1
+ type Header = {
2
+ name: string;
3
+ value: string;
4
+ };
5
+ /**
6
+ * This object contains detailed info about performed request.
7
+ */
8
+ type Request = {
9
+ /** Absolute URL of the request (fragments are not included). */
10
+ url: string;
11
+ /** Request method (`GET`, `POST`, ...). */
12
+ method: string;
13
+ /** Request HTTP Version. */
14
+ httpVersion: string;
15
+ /** List of header objects. */
16
+ headers: Header[];
17
+ /** List of cookie objects. */
18
+ cookies: Header[];
19
+ /**
20
+ * Total number of bytes from the start of the HTTP request message until
21
+ * (and including) the double CRLF before the body.
22
+ *
23
+ * Set to `-1` if the info is not available.
24
+ */
25
+ headersSize: number;
26
+ /** List of query string objects. */
27
+ queryString: Header[];
28
+ /**
29
+ * Size of the request body (POST data payload) in bytes.
30
+ *
31
+ * Set to `-1` if the info is not available.
32
+ */
33
+ bodySize: number;
34
+ /** Posted data info. */
35
+ postData?: {
36
+ /** Mime type of posted data. */
37
+ mimeType: string;
38
+ text: string;
39
+ } | {
40
+ /** Mime type of posted data. */
41
+ mimeType: string;
42
+ params: {
43
+ name: string;
44
+ value?: string;
45
+ }[];
46
+ };
47
+ };
48
+ type Response = {
49
+ /** Response status. */
50
+ status: number;
51
+ /** Response status description. */
52
+ statusText: string;
53
+ /** Response HTTP Version. */
54
+ httpVersion: string;
55
+ /** List of cookie objects. */
56
+ cookies: Header[];
57
+ /** List of header objects. */
58
+ headers: Header[];
59
+ /** Details about the response body. */
60
+ content: {
61
+ size: number;
62
+ mimeType: string;
63
+ encoding?: string;
64
+ text?: string;
65
+ };
66
+ /** Redirection target URL from the Location response header. */
67
+ redirectURL: string;
68
+ /**
69
+ * Total number of bytes from the start of the HTTP response message until
70
+ * (and including) the double CRLF before the body.
71
+ *
72
+ * Set to `-1` if the info is not available.
73
+ *
74
+ * _The size of received response-headers is computed only from headers
75
+ * that are really received from the server. Additional headers appended by
76
+ * the browser are not included in this number, but they appear in the list
77
+ * of header objects._
78
+ */
79
+ headersSize: number;
80
+ /**
81
+ * Size of the received response body in bytes.
82
+ *
83
+ * - Set to zero in case of responses coming from the cache (`304`).
84
+ * - Set to `-1` if the info is not available.
85
+ */
86
+ bodySize: number;
87
+ };
88
+ export type HistoryEntry = {
89
+ /**
90
+ * Total elapsed time of the request in milliseconds.
91
+ *
92
+ * This is the sum of all timings available in the timings object
93
+ * (i.e. not including `-1` values).
94
+ */
95
+ time: number;
96
+ /** Timestamp of the request. */
97
+ timestamp: number;
98
+ /** Detailed info about the request. */
99
+ request: Request;
100
+ /** Detailed info about the response. */
101
+ response: Response;
102
+ /** Meta data about the request. */
103
+ meta: {
104
+ /** The example key for the request. */
105
+ example: string;
106
+ };
107
+ /** Metadata about the request. */
108
+ requestMetadata: {
109
+ /** Variables used in the request. */
110
+ variables: Record<string, string>;
111
+ };
112
+ };
113
+ /**
114
+ * Type for the path method history.
115
+ *
116
+ * {
117
+ * "path": {
118
+ * "method": [Entry]
119
+ * }
120
+ * }
121
+ */
122
+ export type PathMethodHistory = Record<string, Record<string, HistoryEntry[]>>;
123
+ export declare const DocumentHistorySchema: import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
124
+ /**
125
+ * Total elapsed time of the request in milliseconds.
126
+ *
127
+ * This is the sum of all timings available in the timings object
128
+ * (i.e. not including `-1` values).
129
+ */
130
+ time: import("@scalar/typebox").TNumber;
131
+ /** Timestamp of the request. */
132
+ timestamp: import("@scalar/typebox").TNumber;
133
+ /** Detailed info about the request. */
134
+ request: import("@scalar/typebox").TObject<{
135
+ /** Absolute URL of the request (fragments are not included). */
136
+ url: import("@scalar/typebox").TString;
137
+ /** Request method (`GET`, `POST`, ...). */
138
+ method: import("@scalar/typebox").TString;
139
+ /** Request HTTP Version. */
140
+ httpVersion: import("@scalar/typebox").TString;
141
+ /** List of header objects. */
142
+ headers: import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
143
+ name: import("@scalar/typebox").TString;
144
+ value: import("@scalar/typebox").TString;
145
+ }>>;
146
+ /** List of cookie objects. */
147
+ cookies: import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
148
+ name: import("@scalar/typebox").TString;
149
+ value: import("@scalar/typebox").TString;
150
+ }>>;
151
+ /**
152
+ * Total number of bytes from the start of the HTTP request message until
153
+ * (and including) the double CRLF before the body.
154
+ *
155
+ * Set to `-1` if the info is not available.
156
+ */
157
+ headersSize: import("@scalar/typebox").TNumber;
158
+ /** List of query string objects. */
159
+ queryString: import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
160
+ name: import("@scalar/typebox").TString;
161
+ value: import("@scalar/typebox").TString;
162
+ }>>;
163
+ /**
164
+ * Size of the request body (POST data payload) in bytes.
165
+ *
166
+ * Set to `-1` if the info is not available.
167
+ */
168
+ bodySize: import("@scalar/typebox").TNumber;
169
+ /** Posted data info. */
170
+ postData: import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TObject<{
171
+ /** Mime type of posted data. */
172
+ mimeType: import("@scalar/typebox").TString;
173
+ text: import("@scalar/typebox").TString;
174
+ }>, import("@scalar/typebox").TObject<{
175
+ /** Mime type of posted data. */
176
+ mimeType: import("@scalar/typebox").TString;
177
+ params: import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
178
+ name: import("@scalar/typebox").TString;
179
+ value: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
180
+ }>>;
181
+ }>]>>;
182
+ }>;
183
+ /** Detailed info about the response. */
184
+ response: import("@scalar/typebox").TObject<{
185
+ status: import("@scalar/typebox").TNumber;
186
+ statusText: import("@scalar/typebox").TString;
187
+ headers: import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
188
+ name: import("@scalar/typebox").TString;
189
+ value: import("@scalar/typebox").TString;
190
+ }>>;
191
+ cookies: import("@scalar/typebox").TArray<import("@scalar/typebox").TObject<{
192
+ name: import("@scalar/typebox").TString;
193
+ value: import("@scalar/typebox").TString;
194
+ }>>;
195
+ httpVersion: import("@scalar/typebox").TString;
196
+ redirectURL: import("@scalar/typebox").TString;
197
+ headersSize: import("@scalar/typebox").TNumber;
198
+ bodySize: import("@scalar/typebox").TNumber;
199
+ content: import("@scalar/typebox").TObject<{
200
+ size: import("@scalar/typebox").TNumber;
201
+ mimeType: import("@scalar/typebox").TString;
202
+ encoding: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
203
+ text: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
204
+ }>;
205
+ }>;
206
+ /** Meta data about the request. */
207
+ meta: import("@scalar/typebox").TObject<{
208
+ /** The example key for the request. */
209
+ example: import("@scalar/typebox").TString;
210
+ }>;
211
+ requestMetadata: import("@scalar/typebox").TObject<{
212
+ /** Variables used in the request.
213
+ *
214
+ * Since HAR format does not support variables, we need to store them here.
215
+ * This way we can easily re-use the request with the same variables.
216
+ * We don't need to do any server + variables matching and replacement.
217
+ */
218
+ variables: import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TString>;
219
+ }>;
220
+ }>>>>>;
221
+ /**
222
+ * Type for the document history.
223
+ *
224
+ * {
225
+ * "documentName": {
226
+ * "path": {
227
+ * "method": [Entry]
228
+ * }
229
+ * }
230
+ * }
231
+ */
232
+ export type DocumentHistory = Record<string, PathMethodHistory>;
233
+ export {};
234
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/entities/history/schema.ts"],"names":[],"mappings":"AAOA,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAgDD;;GAEG;AACH,KAAK,OAAO,GAAG;IACb,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAA;IACX,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,QAAQ,CAAC,EACL;QACE,gCAAgC;QAChC,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,MAAM,CAAA;KACb,GACD;QACE,gCAAgC;QAChC,QAAQ,EAAE,MAAM,CAAA;QAChB,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAC3C,CAAA;CACN,CAAA;AAmBD,KAAK,QAAQ,GAAG;IACd,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAA;IACl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H,oCAAoC;;;;;QAEpC;;;;WAIG;;QAEH,wBAAwB;;YAIlB,gCAAgC;;;;YAKhC,gCAAgC;;;;;;;;IAyHtC,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;IAExC,mCAAmC;;QAEjC,uCAAuC;;;;QAIvC;;;;;WAKG;;;MAsDiF,CAAA;AAExF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA"}
@@ -61,7 +61,7 @@ const ResponseSchema = Type.Object({
61
61
  text: Type.Optional(Type.String())
62
62
  })
63
63
  });
64
- const EntrySchema = Type.Object({
64
+ const HistoryEntrySchema = Type.Object({
65
65
  /**
66
66
  * Total elapsed time of the request in milliseconds.
67
67
  *
@@ -91,10 +91,9 @@ const EntrySchema = Type.Object({
91
91
  // Other meta fields (e.g., server) can be added here in the future.
92
92
  })
93
93
  });
94
- const XScalarHistorySchema = Type.Object({
95
- "x-scalar-history": Type.Optional(Type.Array(EntrySchema))
96
- });
94
+ const PathMethodHistorySchema = Type.Record(Type.String(), Type.Record(Type.String(), Type.Array(HistoryEntrySchema)));
95
+ const DocumentHistorySchema = Type.Record(Type.String(), PathMethodHistorySchema);
97
96
  export {
98
- XScalarHistorySchema
97
+ DocumentHistorySchema
99
98
  };
100
- //# sourceMappingURL=x-scalar-history.js.map
99
+ //# sourceMappingURL=schema.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/schemas/extensions/operation/x-scalar-history.ts"],
4
- "sourcesContent": ["import { Type } from '@scalar/typebox'\n\nconst HeaderSchema = Type.Object({\n name: Type.String(),\n value: Type.String(),\n})\n\ntype Header = {\n name: string\n value: string\n}\n\n/**\n * This object contains detailed info about performed request.\n */\nconst RequestSchema = Type.Object({\n /** Absolute URL of the request (fragments are not included). */\n url: Type.String(),\n /** Request method (`GET`, `POST`, ...). */\n method: Type.String(),\n /** Request HTTP Version. */\n httpVersion: Type.String(),\n /** List of header objects. */\n headers: Type.Array(HeaderSchema),\n /** List of cookie objects. */\n cookies: Type.Array(HeaderSchema),\n /**\n * Total number of bytes from the start of the HTTP request message until\n * (and including) the double CRLF before the body.\n *\n * Set to `-1` if the info is not available.\n */\n headersSize: Type.Number(),\n /** List of query string objects. */\n queryString: Type.Array(HeaderSchema),\n /**\n * Size of the request body (POST data payload) in bytes.\n *\n * Set to `-1` if the info is not available.\n */\n bodySize: Type.Number(),\n /** Posted data info. */\n postData: Type.Optional(\n Type.Union([\n Type.Object({\n /** Mime type of posted data. */\n mimeType: Type.String(),\n text: Type.String(),\n }),\n Type.Object({\n /** Mime type of posted data. */\n mimeType: Type.String(),\n params: Type.Array(Type.Object({ name: Type.String(), value: Type.Optional(Type.String()) })),\n }),\n ]),\n ),\n})\n\n/**\n * This object contains detailed info about performed request.\n */\ntype Request = {\n /** Absolute URL of the request (fragments are not included). */\n url: string\n /** Request method (`GET`, `POST`, ...). */\n method: string\n /** Request HTTP Version. */\n httpVersion: string\n /** List of header objects. */\n headers: Header[]\n /** List of cookie objects. */\n cookies: Header[]\n /**\n * Total number of bytes from the start of the HTTP request message until\n * (and including) the double CRLF before the body.\n *\n * Set to `-1` if the info is not available.\n */\n headersSize: number\n /** List of query string objects. */\n queryString: Header[]\n /**\n * Size of the request body (POST data payload) in bytes.\n *\n * Set to `-1` if the info is not available.\n */\n bodySize: number\n /** Posted data info. */\n postData?:\n | {\n /** Mime type of posted data. */\n mimeType: string\n text: string\n }\n | {\n /** Mime type of posted data. */\n mimeType: string\n params: { name: string; value?: string }[]\n }\n}\n\nconst ResponseSchema = Type.Object({\n status: Type.Number(),\n statusText: Type.String(),\n headers: Type.Array(HeaderSchema),\n cookies: Type.Array(HeaderSchema),\n httpVersion: Type.String(),\n redirectURL: Type.String(),\n headersSize: Type.Number(),\n bodySize: Type.Number(),\n content: Type.Object({\n size: Type.Number(),\n mimeType: Type.String(),\n encoding: Type.Optional(Type.String()),\n text: Type.Optional(Type.String()),\n }),\n})\n\ntype Response = {\n /** Response status. */\n status: number\n /** Response status description. */\n statusText: string\n /** Response HTTP Version. */\n httpVersion: string\n /** List of cookie objects. */\n cookies: Header[]\n /** List of header objects. */\n headers: Header[]\n /** Details about the response body. */\n content: {\n size: number\n mimeType: string\n encoding?: string\n text?: string\n }\n /** Redirection target URL from the Location response header. */\n redirectURL: string\n /**\n * Total number of bytes from the start of the HTTP response message until\n * (and including) the double CRLF before the body.\n *\n * Set to `-1` if the info is not available.\n *\n * _The size of received response-headers is computed only from headers\n * that are really received from the server. Additional headers appended by\n * the browser are not included in this number, but they appear in the list\n * of header objects._\n */\n headersSize: number\n /**\n * Size of the received response body in bytes.\n *\n * - Set to zero in case of responses coming from the cache (`304`).\n * - Set to `-1` if the info is not available.\n */\n bodySize: number\n}\n\nconst EntrySchema = Type.Object({\n /**\n * Total elapsed time of the request in milliseconds.\n *\n * This is the sum of all timings available in the timings object\n * (i.e. not including `-1` values).\n */\n time: Type.Number(),\n /** Timestamp of the request. */\n timestamp: Type.Number(),\n /** Detailed info about the request. */\n request: RequestSchema,\n /** Detailed info about the response. */\n response: ResponseSchema,\n /** Meta data about the request. */\n meta: Type.Object({\n /** The example key for the request. */\n example: Type.String(),\n }),\n requestMetadata: Type.Object({\n /** Variables used in the request.\n *\n * Since HAR format does not support variables, we need to store them here.\n * This way we can easily re-use the request with the same variables.\n * We don't need to do any server + variables matching and replacement.\n */\n variables: Type.Record(Type.String(), Type.String()),\n // Other meta fields (e.g., server) can be added here in the future.\n }),\n})\n\ntype Entry = {\n /**\n * Total elapsed time of the request in milliseconds.\n *\n * This is the sum of all timings available in the timings object\n * (i.e. not including `-1` values).\n */\n time: number\n /** Timestamp of the request. */\n timestamp: number\n /** Detailed info about the request. */\n request: Request\n /** Detailed info about the response. */\n response: Response\n /** Meta data about the request. */\n meta: {\n /** The example key for the request. */\n example: string\n }\n /** Metadata about the request. */\n requestMetadata: {\n /** Variables used in the request. */\n variables: Record<string, string>\n // Other meta fields (e.g., server) can be added here in the future.\n }\n}\n\nexport const XScalarHistorySchema = Type.Object({\n 'x-scalar-history': Type.Optional(Type.Array(EntrySchema)),\n})\n\nexport type XScalarHistory = {\n 'x-scalar-history'?: Entry[]\n}\n"],
5
- "mappings": "AAAA,SAAS,YAAY;AAErB,MAAM,eAAe,KAAK,OAAO;AAAA,EAC/B,MAAM,KAAK,OAAO;AAAA,EAClB,OAAO,KAAK,OAAO;AACrB,CAAC;AAUD,MAAM,gBAAgB,KAAK,OAAO;AAAA;AAAA,EAEhC,KAAK,KAAK,OAAO;AAAA;AAAA,EAEjB,QAAQ,KAAK,OAAO;AAAA;AAAA,EAEpB,aAAa,KAAK,OAAO;AAAA;AAAA,EAEzB,SAAS,KAAK,MAAM,YAAY;AAAA;AAAA,EAEhC,SAAS,KAAK,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,aAAa,KAAK,OAAO;AAAA;AAAA,EAEzB,aAAa,KAAK,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpC,UAAU,KAAK,OAAO;AAAA;AAAA,EAEtB,UAAU,KAAK;AAAA,IACb,KAAK,MAAM;AAAA,MACT,KAAK,OAAO;AAAA;AAAA,QAEV,UAAU,KAAK,OAAO;AAAA,QACtB,MAAM,KAAK,OAAO;AAAA,MACpB,CAAC;AAAA,MACD,KAAK,OAAO;AAAA;AAAA,QAEV,UAAU,KAAK,OAAO;AAAA,QACtB,QAAQ,KAAK,MAAM,KAAK,OAAO,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,KAAK,SAAS,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC;AAAA,MAC9F,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF,CAAC;AA6CD,MAAM,iBAAiB,KAAK,OAAO;AAAA,EACjC,QAAQ,KAAK,OAAO;AAAA,EACpB,YAAY,KAAK,OAAO;AAAA,EACxB,SAAS,KAAK,MAAM,YAAY;AAAA,EAChC,SAAS,KAAK,MAAM,YAAY;AAAA,EAChC,aAAa,KAAK,OAAO;AAAA,EACzB,aAAa,KAAK,OAAO;AAAA,EACzB,aAAa,KAAK,OAAO;AAAA,EACzB,UAAU,KAAK,OAAO;AAAA,EACtB,SAAS,KAAK,OAAO;AAAA,IACnB,MAAM,KAAK,OAAO;AAAA,IAClB,UAAU,KAAK,OAAO;AAAA,IACtB,UAAU,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,IACrC,MAAM,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,EACnC,CAAC;AACH,CAAC;AA2CD,MAAM,cAAc,KAAK,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO9B,MAAM,KAAK,OAAO;AAAA;AAAA,EAElB,WAAW,KAAK,OAAO;AAAA;AAAA,EAEvB,SAAS;AAAA;AAAA,EAET,UAAU;AAAA;AAAA,EAEV,MAAM,KAAK,OAAO;AAAA;AAAA,IAEhB,SAAS,KAAK,OAAO;AAAA,EACvB,CAAC;AAAA,EACD,iBAAiB,KAAK,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAO3B,WAAW,KAAK,OAAO,KAAK,OAAO,GAAG,KAAK,OAAO,CAAC;AAAA;AAAA,EAErD,CAAC;AACH,CAAC;AA6BM,MAAM,uBAAuB,KAAK,OAAO;AAAA,EAC9C,oBAAoB,KAAK,SAAS,KAAK,MAAM,WAAW,CAAC;AAC3D,CAAC;",
3
+ "sources": ["../../../src/entities/history/schema.ts"],
4
+ "sourcesContent": ["import { Type } from '@scalar/typebox'\n\nconst HeaderSchema = Type.Object({\n name: Type.String(),\n value: Type.String(),\n})\n\ntype Header = {\n name: string\n value: string\n}\n\n/**\n * This object contains detailed info about performed request.\n */\nconst RequestSchema = Type.Object({\n /** Absolute URL of the request (fragments are not included). */\n url: Type.String(),\n /** Request method (`GET`, `POST`, ...). */\n method: Type.String(),\n /** Request HTTP Version. */\n httpVersion: Type.String(),\n /** List of header objects. */\n headers: Type.Array(HeaderSchema),\n /** List of cookie objects. */\n cookies: Type.Array(HeaderSchema),\n /**\n * Total number of bytes from the start of the HTTP request message until\n * (and including) the double CRLF before the body.\n *\n * Set to `-1` if the info is not available.\n */\n headersSize: Type.Number(),\n /** List of query string objects. */\n queryString: Type.Array(HeaderSchema),\n /**\n * Size of the request body (POST data payload) in bytes.\n *\n * Set to `-1` if the info is not available.\n */\n bodySize: Type.Number(),\n /** Posted data info. */\n postData: Type.Optional(\n Type.Union([\n Type.Object({\n /** Mime type of posted data. */\n mimeType: Type.String(),\n text: Type.String(),\n }),\n Type.Object({\n /** Mime type of posted data. */\n mimeType: Type.String(),\n params: Type.Array(Type.Object({ name: Type.String(), value: Type.Optional(Type.String()) })),\n }),\n ]),\n ),\n})\n\n/**\n * This object contains detailed info about performed request.\n */\ntype Request = {\n /** Absolute URL of the request (fragments are not included). */\n url: string\n /** Request method (`GET`, `POST`, ...). */\n method: string\n /** Request HTTP Version. */\n httpVersion: string\n /** List of header objects. */\n headers: Header[]\n /** List of cookie objects. */\n cookies: Header[]\n /**\n * Total number of bytes from the start of the HTTP request message until\n * (and including) the double CRLF before the body.\n *\n * Set to `-1` if the info is not available.\n */\n headersSize: number\n /** List of query string objects. */\n queryString: Header[]\n /**\n * Size of the request body (POST data payload) in bytes.\n *\n * Set to `-1` if the info is not available.\n */\n bodySize: number\n /** Posted data info. */\n postData?:\n | {\n /** Mime type of posted data. */\n mimeType: string\n text: string\n }\n | {\n /** Mime type of posted data. */\n mimeType: string\n params: { name: string; value?: string }[]\n }\n}\n\nconst ResponseSchema = Type.Object({\n status: Type.Number(),\n statusText: Type.String(),\n headers: Type.Array(HeaderSchema),\n cookies: Type.Array(HeaderSchema),\n httpVersion: Type.String(),\n redirectURL: Type.String(),\n headersSize: Type.Number(),\n bodySize: Type.Number(),\n content: Type.Object({\n size: Type.Number(),\n mimeType: Type.String(),\n encoding: Type.Optional(Type.String()),\n text: Type.Optional(Type.String()),\n }),\n})\n\ntype Response = {\n /** Response status. */\n status: number\n /** Response status description. */\n statusText: string\n /** Response HTTP Version. */\n httpVersion: string\n /** List of cookie objects. */\n cookies: Header[]\n /** List of header objects. */\n headers: Header[]\n /** Details about the response body. */\n content: {\n size: number\n mimeType: string\n encoding?: string\n text?: string\n }\n /** Redirection target URL from the Location response header. */\n redirectURL: string\n /**\n * Total number of bytes from the start of the HTTP response message until\n * (and including) the double CRLF before the body.\n *\n * Set to `-1` if the info is not available.\n *\n * _The size of received response-headers is computed only from headers\n * that are really received from the server. Additional headers appended by\n * the browser are not included in this number, but they appear in the list\n * of header objects._\n */\n headersSize: number\n /**\n * Size of the received response body in bytes.\n *\n * - Set to zero in case of responses coming from the cache (`304`).\n * - Set to `-1` if the info is not available.\n */\n bodySize: number\n}\n\nconst HistoryEntrySchema = Type.Object({\n /**\n * Total elapsed time of the request in milliseconds.\n *\n * This is the sum of all timings available in the timings object\n * (i.e. not including `-1` values).\n */\n time: Type.Number(),\n /** Timestamp of the request. */\n timestamp: Type.Number(),\n /** Detailed info about the request. */\n request: RequestSchema,\n /** Detailed info about the response. */\n response: ResponseSchema,\n /** Meta data about the request. */\n meta: Type.Object({\n /** The example key for the request. */\n example: Type.String(),\n }),\n requestMetadata: Type.Object({\n /** Variables used in the request.\n *\n * Since HAR format does not support variables, we need to store them here.\n * This way we can easily re-use the request with the same variables.\n * We don't need to do any server + variables matching and replacement.\n */\n variables: Type.Record(Type.String(), Type.String()),\n // Other meta fields (e.g., server) can be added here in the future.\n }),\n})\n\nexport type HistoryEntry = {\n /**\n * Total elapsed time of the request in milliseconds.\n *\n * This is the sum of all timings available in the timings object\n * (i.e. not including `-1` values).\n */\n time: number\n /** Timestamp of the request. */\n timestamp: number\n /** Detailed info about the request. */\n request: Request\n /** Detailed info about the response. */\n response: Response\n /** Meta data about the request. */\n meta: {\n /** The example key for the request. */\n example: string\n }\n /** Metadata about the request. */\n requestMetadata: {\n /** Variables used in the request. */\n variables: Record<string, string>\n // Other meta fields (e.g., server) can be added here in the future.\n }\n}\n\n/**\n * Schema for the path method history.\n *\n * {\n * \"path\": {\n * \"method\": [Entry]\n * }\n * }\n */\nconst PathMethodHistorySchema = Type.Record(Type.String(), Type.Record(Type.String(), Type.Array(HistoryEntrySchema)))\n\n/**\n * Type for the path method history.\n *\n * {\n * \"path\": {\n * \"method\": [Entry]\n * }\n * }\n */\nexport type PathMethodHistory = Record<string, Record<string, HistoryEntry[]>>\nexport const DocumentHistorySchema = Type.Record(Type.String(), PathMethodHistorySchema)\n\n/**\n * Type for the document history.\n *\n * {\n * \"documentName\": {\n * \"path\": {\n * \"method\": [Entry]\n * }\n * }\n * }\n */\nexport type DocumentHistory = Record<string, PathMethodHistory>\n"],
5
+ "mappings": "AAAA,SAAS,YAAY;AAErB,MAAM,eAAe,KAAK,OAAO;AAAA,EAC/B,MAAM,KAAK,OAAO;AAAA,EAClB,OAAO,KAAK,OAAO;AACrB,CAAC;AAUD,MAAM,gBAAgB,KAAK,OAAO;AAAA;AAAA,EAEhC,KAAK,KAAK,OAAO;AAAA;AAAA,EAEjB,QAAQ,KAAK,OAAO;AAAA;AAAA,EAEpB,aAAa,KAAK,OAAO;AAAA;AAAA,EAEzB,SAAS,KAAK,MAAM,YAAY;AAAA;AAAA,EAEhC,SAAS,KAAK,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,aAAa,KAAK,OAAO;AAAA;AAAA,EAEzB,aAAa,KAAK,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpC,UAAU,KAAK,OAAO;AAAA;AAAA,EAEtB,UAAU,KAAK;AAAA,IACb,KAAK,MAAM;AAAA,MACT,KAAK,OAAO;AAAA;AAAA,QAEV,UAAU,KAAK,OAAO;AAAA,QACtB,MAAM,KAAK,OAAO;AAAA,MACpB,CAAC;AAAA,MACD,KAAK,OAAO;AAAA;AAAA,QAEV,UAAU,KAAK,OAAO;AAAA,QACtB,QAAQ,KAAK,MAA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,wBAAwB,KAAK,OAAO,KAAK,OAAO,GAAG,uBAAuB;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,6 @@
1
1
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
2
  import type { PartialDeep } from 'type-fest';
3
+ import type { SecretsAuth } from '../../entities/auth/schema.js';
3
4
  import type { OAuthFlowsObject, SecurityRequirementObject, SecuritySchemeObject } from '../../schemas/v3.1/strict/openapi-document.js';
4
5
  import type { ApiKeyObject, HttpObject, OAuth2Object } from '../../schemas/v3.1/strict/security-scheme.js';
5
6
  /**
@@ -75,6 +76,19 @@ export type AuthEvents = {
75
76
  /** The name of the security scheme to update */
76
77
  name: string;
77
78
  };
79
+ /**
80
+ * Update a security scheme in the OpenAPI document's components object.
81
+ * Use this event to update secret information or configuration for UI-auth flows,
82
+ * such as username, password, tokens for HTTP/ApiKey/OAuth2 schemes.
83
+ */
84
+ 'auth:update:security-scheme-secrets': {
85
+ /** The data to update the security scheme with */
86
+ payload: PartialDeep<SecretsAuth[string]> & {
87
+ type: SecretsAuth[string]['type'];
88
+ };
89
+ /** The name of the security scheme to update */
90
+ name: string;
91
+ };
78
92
  /**
79
93
  * Update the selected scopes for a given security scheme.
80
94
  * Triggers when the user selects/deselects scopes for an OAuth2 (or other scopes-supporting) scheme in the UI.