Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions apify-api/plugins/apify.js

This file was deleted.

14 changes: 14 additions & 0 deletions apify-api/plugins/apify.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ClientReferencesLinksDecorator from './decorators/client-references-links-decorator.mjs';
import CodeSamplesDecorator from './decorators/code-samples-decorator.mjs';
import LegacyDocUrlDecorator from './decorators/legacy-doc-url-decorator.mjs';

export default () => ({
id: 'apify',
decorators: {
oas3: {
'legacy-doc-url-decorator': LegacyDocUrlDecorator,
'client-references-links-decorator': ClientReferencesLinksDecorator,
'code-samples-decorator': CodeSamplesDecorator,
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function ClientReferencesLinksDecorator(target) {
target.description = `${prepend}${target.description || ''}`;
}

module.exports = () => ({
export default () => ({
// Redocly is using a visitor pattern. What the following code does is that whenever the traverser leaves a node of
// type Tag or Operation, it executes prependLegacyUrlAnchor on it.
Tag: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { existsSync } = require('node:fs');
const path = require('node:path');
import { existsSync } from 'node:fs';
import path from 'node:path';

const X_CODE_SAMPLES_PROPERTY = 'x-codeSamples';

Expand Down Expand Up @@ -31,7 +31,7 @@ function CodeSamplesDecorator(target) {

for (const { lang, label, langSuffix } of LANGUAGES) {
const codeSamplePath = path.join(
__dirname,
import.meta.dirname,
`../../openapi/code_samples/${lang.toLowerCase()}/${operationId}.${langSuffix}`,
);

Expand All @@ -55,7 +55,7 @@ function CodeSamplesDecorator(target) {
}
}

module.exports = () => ({
export default () => ({
// Redocly is using a visitor pattern. What the following code does is that whenever the traverser leaves a node of
// type Tag or Operation, it executes CodeSamplesDecorator on it.
Tag: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function prependLegacyUrlAnchor(target) {
}
}

module.exports = () => ({
export default () => ({
// Redocly is using a visitor pattern. What the following code does is that whenever the traverser leaves a node of
// type Tag or Operation, it executes prependLegacyUrlAnchor on it.
Tag: {
Expand Down
609 changes: 252 additions & 357 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@docusaurus/theme-common": "^3.8.1",
"@docusaurus/theme-mermaid": "^3.8.1",
"@giscus/react": "^3.0.0",
"@redocly/cli": "^1.27.1",
"@redocly/cli": "^2.0.0",
"@signalwire/docusaurus-plugin-llms-txt": "^1.2.1",
"clsx": "^2.0.0",
"docusaurus-plugin-image-zoom": "^3.0.1",
Expand Down
19 changes: 9 additions & 10 deletions .redocly.yaml → redocly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@ extends:

rules:
# TODO we have quite a lot of errors in there, once we fix them, this should be flipped to `error` too
spec: warn
struct: warn
no-unused-components: error
nullable-type-sibling: warn

theme:
openapi:
htmlTemplate: openapi/docs/index.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can drop this too (as well as the file), its no longer user for anything


openapi:
expandDefaultResponse: true
expandDefaultRequest: true
expandResponses: all
schemasExpansionLevel: 2
jsonSamplesExpandLevel: 2
expandDefaultResponse: true
expandDefaultRequest: true
expandResponses: all
schemasExpansionLevel: 2
jsonSamplesExpandLevel: 2

plugins:
- apify-api/plugins/apify.js
- apify-api/plugins/apify.mjs

decorators:
apify/legacy-doc-url-decorator: on
Expand Down
Loading