@scalar/workspace-store 0.40.1 → 0.40.2
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/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-examples.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-examples.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAE7E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,WAAW,eAAe,
|
|
1
|
+
{"version":3,"file":"traverse-examples.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-examples.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAE7E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,WAAW,eAAe,aAqCnE,CAAA"}
|
|
@@ -26,18 +26,6 @@ const traverseOperationExamples = (operation) => {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
if (operation.responses) {
|
|
30
|
-
Object.values(operation.responses).forEach((response) => {
|
|
31
|
-
const resolvedResponse = getResolvedRef(response) ?? {};
|
|
32
|
-
if ("content" in resolvedResponse && resolvedResponse.content) {
|
|
33
|
-
Object.values(resolvedResponse.content ?? {}).forEach((mediaType) => {
|
|
34
|
-
Object.keys(mediaType.examples ?? {}).forEach((key) => {
|
|
35
|
-
examples.add(key);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
29
|
return Array.from(examples);
|
|
42
30
|
};
|
|
43
31
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/navigation/helpers/traverse-examples.ts"],
|
|
4
|
-
"sourcesContent": ["import { getResolvedRef } from '@/helpers/get-resolved-ref'\nimport type { OperationObject } from '@/schemas/v3.1/strict/openapi-document'\n\n/**\n * Traverse the OpenAPI operation object and extract all example values.\n *\n * @param operation - The OpenAPI operation object to extract examples from\n */\nexport const traverseOperationExamples = (operation: OperationObject) => {\n // Add all examples from draft examples\n const examples = new Set<string>(operation['x-draft-examples'] ?? [])\n\n // Add all examples from request bodies\n if (operation.requestBody) {\n const requestBody = getResolvedRef(operation.requestBody)\n\n Object.values(requestBody.content ?? {}).forEach((mediaType) => {\n Object.keys(mediaType.examples ?? {}).forEach((key) => {\n examples.add(key)\n })\n })\n }\n\n // Add all examples from parameters\n if (operation.parameters) {\n operation.parameters.forEach((_parameter) => {\n const parameter = getResolvedRef(_parameter) ?? {}\n\n if ('content' in parameter && parameter.content) {\n Object.values(parameter.content).forEach((mediaType) => {\n Object.keys(mediaType.examples ?? {}).forEach((key) => {\n examples.add(key)\n })\n })\n }\n\n if ('examples' in parameter && parameter.examples) {\n Object.keys(parameter.examples ?? {}).forEach((key) => {\n examples.add(key)\n })\n }\n })\n }\n\n
|
|
5
|
-
"mappings": "AAAA,SAAS,sBAAsB;AAQxB,MAAM,4BAA4B,CAAC,cAA+B;AAEvE,QAAM,WAAW,IAAI,IAAY,UAAU,kBAAkB,KAAK,CAAC,CAAC;AAGpE,MAAI,UAAU,aAAa;AACzB,UAAM,cAAc,eAAe,UAAU,WAAW;AAExD,WAAO,OAAO,YAAY,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc;AAC9D,aAAO,KAAK,UAAU,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ;AACrD,iBAAS,IAAI,GAAG;AAAA,MAClB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAGA,MAAI,UAAU,YAAY;AACxB,cAAU,WAAW,QAAQ,CAAC,eAAe;AAC3C,YAAM,YAAY,eAAe,UAAU,KAAK,CAAC;AAEjD,UAAI,aAAa,aAAa,UAAU,SAAS;AAC/C,eAAO,OAAO,UAAU,OAAO,EAAE,QAAQ,CAAC,cAAc;AACtD,iBAAO,KAAK,UAAU,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ;AACrD,qBAAS,IAAI,GAAG;AAAA,UAClB,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAEA,UAAI,cAAc,aAAa,UAAU,UAAU;AACjD,eAAO,KAAK,UAAU,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ;AACrD,mBAAS,IAAI,GAAG;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;
|
|
4
|
+
"sourcesContent": ["import { getResolvedRef } from '@/helpers/get-resolved-ref'\nimport type { OperationObject } from '@/schemas/v3.1/strict/openapi-document'\n\n/**\n * Traverse the OpenAPI operation object and extract all example values.\n *\n * @param operation - The OpenAPI operation object to extract examples from\n */\nexport const traverseOperationExamples = (operation: OperationObject) => {\n // Add all examples from draft examples\n const examples = new Set<string>(operation['x-draft-examples'] ?? [])\n\n // Add all examples from request bodies\n if (operation.requestBody) {\n const requestBody = getResolvedRef(operation.requestBody)\n\n Object.values(requestBody.content ?? {}).forEach((mediaType) => {\n Object.keys(mediaType.examples ?? {}).forEach((key) => {\n examples.add(key)\n })\n })\n }\n\n // Add all examples from parameters\n if (operation.parameters) {\n operation.parameters.forEach((_parameter) => {\n const parameter = getResolvedRef(_parameter) ?? {}\n\n if ('content' in parameter && parameter.content) {\n Object.values(parameter.content).forEach((mediaType) => {\n Object.keys(mediaType.examples ?? {}).forEach((key) => {\n examples.add(key)\n })\n })\n }\n\n if ('examples' in parameter && parameter.examples) {\n Object.keys(parameter.examples ?? {}).forEach((key) => {\n examples.add(key)\n })\n }\n })\n }\n\n return Array.from(examples)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;AAQxB,MAAM,4BAA4B,CAAC,cAA+B;AAEvE,QAAM,WAAW,IAAI,IAAY,UAAU,kBAAkB,KAAK,CAAC,CAAC;AAGpE,MAAI,UAAU,aAAa;AACzB,UAAM,cAAc,eAAe,UAAU,WAAW;AAExD,WAAO,OAAO,YAAY,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc;AAC9D,aAAO,KAAK,UAAU,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ;AACrD,iBAAS,IAAI,GAAG;AAAA,MAClB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAGA,MAAI,UAAU,YAAY;AACxB,cAAU,WAAW,QAAQ,CAAC,eAAe;AAC3C,YAAM,YAAY,eAAe,UAAU,KAAK,CAAC;AAEjD,UAAI,aAAa,aAAa,UAAU,SAAS;AAC/C,eAAO,OAAO,UAAU,OAAO,EAAE,QAAQ,CAAC,cAAc;AACtD,iBAAO,KAAK,UAAU,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ;AACrD,qBAAS,IAAI,GAAG;AAAA,UAClB,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAEA,UAAI,cAAc,aAAa,UAAU,UAAU;AACjD,eAAO,KAAK,UAAU,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ;AACrD,mBAAS,IAAI,GAAG;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,MAAM,KAAK,QAAQ;AAC5B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"openapi",
|
|
17
17
|
"scalar"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.40.
|
|
19
|
+
"version": "0.40.2",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22"
|
|
22
22
|
},
|
|
@@ -141,10 +141,10 @@
|
|
|
141
141
|
"@scalar/helpers": "0.4.1",
|
|
142
142
|
"@scalar/code-highlight": "0.3.0",
|
|
143
143
|
"@scalar/json-magic": "0.12.3",
|
|
144
|
-
"@scalar/object-utils": "1.3.2",
|
|
145
144
|
"@scalar/openapi-upgrader": "0.2.0",
|
|
146
145
|
"@scalar/snippetz": "0.7.4",
|
|
147
|
-
"@scalar/types": "0.7.3"
|
|
146
|
+
"@scalar/types": "0.7.3",
|
|
147
|
+
"@scalar/object-utils": "1.3.2"
|
|
148
148
|
},
|
|
149
149
|
"devDependencies": {
|
|
150
150
|
"@google-cloud/storage": "7.16.0",
|