@digi-frontend/dgate-api-documentation 1.0.1 → 1.0.4
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/.editorconfig +12 -12
- package/.prettierignore +7 -7
- package/.prettierrc +15 -15
- package/dist/{2e10bbdb265df50e.svg → 43595976d1fdccbf.svg} +4 -4
- package/dist/{8789eb84283ea95b.svg → 56dc416b683db280.svg} +5 -5
- package/dist/{bb8b87cace25e052.svg → 64efc2716808c4a4.svg} +3 -3
- package/dist/{d32ce84bbd78babd.svg → 72db3b05a96dd600.svg} +3 -3
- package/dist/{d501922060662842.svg → 844eba3f2e42a9eb.svg} +3 -3
- package/dist/_virtual/index10.js +1 -1
- package/dist/_virtual/index21.js +2 -0
- package/dist/_virtual/index21.js.map +1 -0
- package/dist/_virtual/index3.js +1 -1
- package/dist/_virtual/index4.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index7.js +1 -1
- package/dist/_virtual/index8.js +1 -1
- package/dist/_virtual/index9.js +1 -1
- package/dist/_virtual/node2.js +2 -0
- package/dist/_virtual/node2.js.map +1 -0
- package/dist/_virtual/node3.js +2 -0
- package/dist/_virtual/node3.js.map +1 -0
- package/dist/{070dc6ecd197bc80.svg → a7568b270e175038.svg} +8 -8
- package/dist/{9bdff13f8d8fa48a.svg → af16a554be8c4d69.svg} +3 -3
- package/dist/{7f54eeb0bb2d1150.svg → b82c7612e73342f3.svg} +3 -3
- package/dist/node_modules/digitinary-ui/dist/index.js +1 -1
- package/dist/node_modules/digitinary-ui/dist/index.js.map +1 -1
- package/dist/node_modules/domelementtype/lib/index.js +1 -1
- package/dist/node_modules/formik/dist/formik.esm.js +1 -1
- package/dist/node_modules/html-dom-parser/lib/index.js +1 -1
- package/dist/node_modules/html-dom-parser/lib/server/html-to-dom.js +1 -1
- package/dist/node_modules/html-dom-parser/lib/server/html-to-dom.js.map +1 -1
- package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/index.js +2 -0
- package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/index.js.map +1 -0
- package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/node.js +2 -0
- package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/node.js.map +1 -0
- package/dist/node_modules/html-react-parser/esm/index.mjs.js +1 -1
- package/dist/node_modules/html-react-parser/esm/index.mjs.js.map +1 -1
- package/dist/node_modules/html-react-parser/lib/index.js +1 -1
- package/dist/node_modules/html-react-parser/lib/index.js.map +1 -1
- package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/index.js +2 -0
- package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/index.js.map +1 -0
- package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/node.js +2 -0
- package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/node.js.map +1 -0
- package/dist/node_modules/htmlparser2/dist/commonjs/Parser.js +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/Parser.js.map +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/Tokenizer.js +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/Tokenizer.js.map +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/index.js +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/index.js.map +1 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/encode.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/escape.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/index.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/index.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/index.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/index.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/node.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/node.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/index.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/index.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/querying.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +1 -0
- package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +2 -0
- package/dist/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +1 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -1
- package/dist/node_modules/react-fast-compare/index.js +1 -1
- package/dist/node_modules/react-fast-compare/index.js.map +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-property/lib/index.js +1 -1
- package/dist/node_modules/react-property/lib/index.js.map +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/toposort/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +1 -1
- package/dist/node_modules/yup/index.esm.js.map +1 -1
- package/dist/src/assets/icons/AddRow.svg.js +1 -1
- package/dist/src/assets/icons/AddRow.svg.js.map +1 -1
- package/dist/src/assets/icons/CheckMarkSquare.svg.js +2 -0
- package/dist/src/assets/icons/CheckMarkSquare.svg.js.map +1 -0
- package/dist/src/assets/icons/CloseIcon.svg.js +1 -1
- package/dist/src/assets/icons/CloseIcon.svg.js.map +1 -1
- package/dist/src/assets/icons/DeleteIcon.svg.js +1 -1
- package/dist/src/assets/icons/DeleteIcon.svg.js.map +1 -1
- package/dist/src/assets/icons/DownArrow.svg.js +1 -1
- package/dist/src/assets/icons/DownArrow.svg.js.map +1 -1
- package/dist/src/assets/icons/EditIcon.svg.js +1 -1
- package/dist/src/assets/icons/EditIcon.svg.js.map +1 -1
- package/dist/src/assets/icons/UpArrow.svg.js +1 -1
- package/dist/src/assets/icons/UpArrow.svg.js.map +1 -1
- package/dist/src/assets/icons/deleteOutlinedIcon.svg.js +2 -0
- package/dist/src/assets/icons/deleteOutlinedIcon.svg.js.map +1 -0
- package/dist/src/components/Chips/Chips.js +2 -0
- package/dist/src/components/Chips/Chips.js.map +1 -0
- package/dist/src/components/InfoForm/InfoForm.js +1 -1
- package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
- package/dist/src/components/LivePreview/LivePreview.js +1 -1
- package/dist/src/components/LivePreview/LivePreview.js.map +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
- package/dist/src/components/SVGLoader/SVGLoader.js.map +1 -1
- package/dist/src/components/SectionHead/SectionHead.js.map +1 -1
- package/dist/src/components/SimpleLabelValue/SimpleLabelValue.js.map +1 -1
- package/dist/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/src/components/dialog/index.js +1 -1
- package/dist/src/components/dialog/index.js.map +1 -1
- package/dist/src/components/table/table.js +1 -1
- package/dist/src/components/table/table.js.map +1 -1
- package/dist/src/constants/index.js +1 -1
- package/dist/src/constants/index.js.map +1 -1
- package/dist/src/constants/regex.js +1 -1
- package/dist/src/constants/regex.js.map +1 -1
- package/dist/src/helpers/layout.helper.js +1 -1
- package/dist/src/helpers/layout.helper.js.map +1 -1
- package/dist/src/helpers/methodAccordion.helper.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/layout/layout.js +1 -1
- package/dist/src/layout/layout.js.map +1 -1
- package/dist/src/layout/layout.module.css.js +1 -1
- package/dist/src/validator/form.scheme.js +1 -1
- package/dist/src/validator/form.scheme.js.map +1 -1
- package/dist/styles.css +500 -2036
- package/dist/types/assets/icons/index.d.ts +1 -17
- package/dist/types/components/InfoForm/InfoForm.d.ts +1 -3
- package/dist/types/components/LivePreview/LivePreview.d.ts +0 -1
- package/dist/types/components/MethodAccordion/MethodAccordion.d.ts +3 -7
- package/dist/types/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/components/dialog/dialog.d.ts +0 -6
- package/dist/types/components/dialog/index.d.ts +1 -1
- package/dist/types/components/table/table.d.ts +1 -2
- package/dist/types/constants/index.d.ts +4 -23
- package/dist/types/constants/regex.d.ts +0 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/layout/layout.d.ts +1 -4
- package/dist/types/types/index.d.ts +16 -25
- package/dist/types/types/layout.type.d.ts +1 -11
- package/dist/types/types/openApi.d.ts +5 -18
- package/dist/types/validator/form.scheme.d.ts +3 -12
- package/package.json +42 -47
- package/rollup.config.js +35 -37
- package/src/assets/icons/AddRow.svg +3 -3
- package/src/assets/icons/CheckMarkSquare.svg +5 -5
- package/src/assets/icons/CloseIcon.svg +4 -4
- package/src/assets/icons/DeleteIcon.svg +3 -3
- package/src/assets/icons/DownArrow.svg +3 -3
- package/src/assets/icons/EditIcon.svg +3 -3
- package/src/assets/icons/UpArrow.svg +3 -3
- package/src/assets/icons/deleteOutlinedIcon.svg +8 -8
- package/src/assets/icons/index.ts +8 -24
- package/src/components/Chips/Chips.tsx +87 -87
- package/src/components/Chips/style.scss +147 -147
- package/src/components/InfoForm/InfoForm.module.scss +20 -165
- package/src/components/InfoForm/InfoForm.tsx +138 -424
- package/src/components/LivePreview/LivePreview.module.scss +5 -181
- package/src/components/LivePreview/LivePreview.tsx +80 -224
- package/src/components/MethodAccordion/MethodAccordion.module.scss +289 -399
- package/src/components/MethodAccordion/MethodAccordion.tsx +431 -1063
- package/src/components/SVGLoader/SVGLoader.tsx +94 -96
- package/src/components/SectionHead/SectionHead.scss +29 -29
- package/src/components/SectionHead/SectionHead.tsx +22 -22
- package/src/components/SimpleLabelValue/SimpleLabelValue.tsx +31 -31
- package/src/components/SimpleLabelValue/index.ts +1 -1
- package/src/components/SimpleLabelValue/style.scss +30 -30
- package/src/components/Tooltip/Tooltip.scss +130 -133
- package/src/components/Tooltip/Tooltip.tsx +86 -85
- package/src/components/_global.scss +337 -337
- package/src/components/dialog/dialog.ts +54 -61
- package/src/components/dialog/index.tsx +85 -88
- package/src/components/dialog/style.scss +104 -188
- package/src/components/table/style.scss +179 -223
- package/src/components/table/table.tsx +307 -490
- package/src/constants/index.ts +66 -95
- package/src/constants/regex.ts +5 -7
- package/src/global.d.ts +13 -13
- package/src/helpers/layout.helper.ts +118 -187
- package/src/helpers/methodAccordion.helper.ts +19 -19
- package/src/index.ts +1 -2
- package/src/layout/layout.module.css +38 -65
- package/src/layout/layout.tsx +75 -181
- package/src/types/index.ts +0 -28
- package/src/types/layout.type.ts +22 -32
- package/src/types/openApi.ts +95 -109
- package/src/types/transformedOpenApi.ts +52 -52
- package/src/validator/form.scheme.ts +70 -96
- package/tsconfig.json +33 -33
- package/dist/16702d92fd6d1730.svg +0 -6
- package/dist/2b546d6e9fdf604a.svg +0 -3
- package/dist/2c3c6c2c3b835504.svg +0 -5
- package/dist/55b5994c5781482b.svg +0 -5
- package/dist/60bef8083c55f46b.svg +0 -6
- package/dist/68c710e0583e19e6.svg +0 -5
- package/dist/731221b3f242672d.svg +0 -4
- package/dist/8520b6792278d9df.svg +0 -6
- package/dist/9506ef7a26a74147.svg +0 -12
- package/dist/9b7aee27757b5036.svg +0 -3
- package/dist/_virtual/core.js +0 -2
- package/dist/_virtual/core.js.map +0 -1
- package/dist/_virtual/core2.js +0 -2
- package/dist/_virtual/core2.js.map +0 -1
- package/dist/_virtual/format.js +0 -2
- package/dist/_virtual/format.js.map +0 -1
- package/dist/_virtual/json.js +0 -2
- package/dist/_virtual/json.js.map +0 -1
- package/dist/cceb1e5dc06b0b85.svg +0 -4
- package/dist/d140a601c85bac25.svg +0 -3
- package/dist/d6d0a98ec38e6b77.svg +0 -3
- package/dist/e04479ad425e7d58.svg +0 -4
- package/dist/f4452c3ebcf0d5da.svg +0 -4
- package/dist/f4a32992f02af522.svg +0 -5
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js.map +0 -1
- package/dist/node_modules/dom-serializer/lib/foreignNames.js +0 -2
- package/dist/node_modules/dom-serializer/lib/foreignNames.js.map +0 -1
- package/dist/node_modules/dom-serializer/lib/index.js +0 -2
- package/dist/node_modules/dom-serializer/lib/index.js.map +0 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js +0 -2
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map +0 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js +0 -2
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map +0 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/encode.js +0 -2
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map +0 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/escape.js +0 -2
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map +0 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js +0 -2
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js +0 -2
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js +0 -2
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map +0 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js +0 -2
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js.map +0 -1
- package/dist/node_modules/domhandler/lib/index.js +0 -2
- package/dist/node_modules/domhandler/lib/index.js.map +0 -1
- package/dist/node_modules/domhandler/lib/node.js +0 -2
- package/dist/node_modules/domhandler/lib/node.js.map +0 -1
- package/dist/node_modules/domutils/lib/feeds.js +0 -2
- package/dist/node_modules/domutils/lib/feeds.js.map +0 -1
- package/dist/node_modules/domutils/lib/helpers.js +0 -2
- package/dist/node_modules/domutils/lib/helpers.js.map +0 -1
- package/dist/node_modules/domutils/lib/index.js +0 -2
- package/dist/node_modules/domutils/lib/index.js.map +0 -1
- package/dist/node_modules/domutils/lib/legacy.js +0 -2
- package/dist/node_modules/domutils/lib/legacy.js.map +0 -1
- package/dist/node_modules/domutils/lib/manipulation.js +0 -2
- package/dist/node_modules/domutils/lib/manipulation.js.map +0 -1
- package/dist/node_modules/domutils/lib/querying.js +0 -2
- package/dist/node_modules/domutils/lib/querying.js.map +0 -1
- package/dist/node_modules/domutils/lib/stringify.js +0 -2
- package/dist/node_modules/domutils/lib/stringify.js.map +0 -1
- package/dist/node_modules/domutils/lib/traversal.js +0 -2
- package/dist/node_modules/domutils/lib/traversal.js.map +0 -1
- package/dist/node_modules/entities/dist/commonjs/decode-codepoint.js +0 -2
- package/dist/node_modules/entities/dist/commonjs/decode-codepoint.js.map +0 -1
- package/dist/node_modules/entities/dist/commonjs/decode.js +0 -2
- package/dist/node_modules/entities/dist/commonjs/decode.js.map +0 -1
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-html.js +0 -2
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +0 -1
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +0 -2
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +0 -1
- package/dist/node_modules/fast-json-stable-stringify/index.js +0 -2
- package/dist/node_modules/fast-json-stable-stringify/index.js.map +0 -1
- package/dist/node_modules/fault/index.js +0 -2
- package/dist/node_modules/fault/index.js.map +0 -1
- package/dist/node_modules/format/format.js +0 -2
- package/dist/node_modules/format/format.js.map +0 -1
- package/dist/node_modules/highlight.js/lib/core.js +0 -2
- package/dist/node_modules/highlight.js/lib/core.js.map +0 -1
- package/dist/node_modules/highlight.js/lib/languages/json.js +0 -2
- package/dist/node_modules/highlight.js/lib/languages/json.js.map +0 -1
- package/dist/node_modules/js-yaml/dist/js-yaml.mjs.js +0 -3
- package/dist/node_modules/js-yaml/dist/js-yaml.mjs.js.map +0 -1
- package/dist/node_modules/lowlight/lib/core.js +0 -2
- package/dist/node_modules/lowlight/lib/core.js.map +0 -1
- package/dist/node_modules/nanoid/index.js +0 -2
- package/dist/node_modules/nanoid/index.js.map +0 -1
- package/dist/node_modules/nanoid/url-alphabet/index.js +0 -2
- package/dist/node_modules/nanoid/url-alphabet/index.js.map +0 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js +0 -2
- package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js.map +0 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js +0 -2
- package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js.map +0 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js +0 -2
- package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js.map +0 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/hljs/json.js +0 -2
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/hljs/json.js.map +0 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/light.js +0 -2
- package/dist/node_modules/react-syntax-highlighter/dist/esm/light.js.map +0 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/hljs/stackoverflow-dark.js +0 -2
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/hljs/stackoverflow-dark.js.map +0 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/hljs/stackoverflow-light.js +0 -2
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/hljs/stackoverflow-light.js.map +0 -1
- package/dist/src/assets/icons/ApiIcon.svg.js +0 -2
- package/dist/src/assets/icons/ApiIcon.svg.js.map +0 -1
- package/dist/src/assets/icons/ArrowBack.svg.js +0 -2
- package/dist/src/assets/icons/ArrowBack.svg.js.map +0 -1
- package/dist/src/assets/icons/BookIcon.svg.js +0 -2
- package/dist/src/assets/icons/BookIcon.svg.js.map +0 -1
- package/dist/src/assets/icons/CopySticker.svg.js +0 -2
- package/dist/src/assets/icons/CopySticker.svg.js.map +0 -1
- package/dist/src/assets/icons/DeleteOutlinedIcon.svg.js +0 -2
- package/dist/src/assets/icons/DeleteOutlinedIcon.svg.js.map +0 -1
- package/dist/src/assets/icons/FilterIcon.svg.js +0 -2
- package/dist/src/assets/icons/FilterIcon.svg.js.map +0 -1
- package/dist/src/assets/icons/Plus.svg.js +0 -2
- package/dist/src/assets/icons/Plus.svg.js.map +0 -1
- package/dist/src/assets/icons/PlusSquare.svg.js +0 -2
- package/dist/src/assets/icons/PlusSquare.svg.js.map +0 -1
- package/dist/src/assets/icons/RequestOption.svg.js +0 -2
- package/dist/src/assets/icons/RequestOption.svg.js.map +0 -1
- package/dist/src/assets/icons/arrowDownGray.svg.js +0 -2
- package/dist/src/assets/icons/arrowDownGray.svg.js.map +0 -1
- package/dist/src/assets/icons/arrowRightGray.svg.js +0 -2
- package/dist/src/assets/icons/arrowRightGray.svg.js.map +0 -1
- package/dist/src/assets/icons/close-circle.svg.js +0 -2
- package/dist/src/assets/icons/close-circle.svg.js.map +0 -1
- package/dist/src/assets/icons/copy.svg.js +0 -2
- package/dist/src/assets/icons/copy.svg.js.map +0 -1
- package/dist/src/assets/icons/document.svg.js +0 -2
- package/dist/src/assets/icons/document.svg.js.map +0 -1
- package/dist/src/assets/icons/eye.svg.js +0 -2
- package/dist/src/assets/icons/eye.svg.js.map +0 -1
- package/dist/src/assets/icons/infoIcon.svg.js +0 -2
- package/dist/src/assets/icons/infoIcon.svg.js.map +0 -1
- package/dist/src/assets/icons/searchIcon.svg.js +0 -2
- package/dist/src/assets/icons/searchIcon.svg.js.map +0 -1
- package/dist/src/components/JsonInput/JsonInput.js +0 -2
- package/dist/src/components/JsonInput/JsonInput.js.map +0 -1
- package/dist/src/components/JsonInput/style.module.scss.js +0 -2
- package/dist/src/components/JsonInput/style.module.scss.js.map +0 -1
- package/dist/src/components/table/tags-table.js +0 -2
- package/dist/src/components/table/tags-table.js.map +0 -1
- package/dist/src/constants/methods.constant.js +0 -2
- package/dist/src/constants/methods.constant.js.map +0 -1
- package/dist/src/context/SectionToggleContext.js +0 -2
- package/dist/src/context/SectionToggleContext.js.map +0 -1
- package/dist/src/helpers/docs.helper.js +0 -2
- package/dist/src/helpers/docs.helper.js.map +0 -1
- package/dist/src/layout/docsComponents/Codebox/Codebox.js +0 -2
- package/dist/src/layout/docsComponents/Codebox/Codebox.js.map +0 -1
- package/dist/src/layout/docsComponents/Codebox/style.module.scss.js +0 -2
- package/dist/src/layout/docsComponents/Codebox/style.module.scss.js.map +0 -1
- package/dist/src/layout/docsComponents/DocsAside/DocsAside.js +0 -2
- package/dist/src/layout/docsComponents/DocsAside/DocsAside.js.map +0 -1
- package/dist/src/layout/docsComponents/DocsAside/style.module.scss.js +0 -2
- package/dist/src/layout/docsComponents/DocsAside/style.module.scss.js.map +0 -1
- package/dist/src/layout/docsComponents/DocsContent/DocsContent.js +0 -2
- package/dist/src/layout/docsComponents/DocsContent/DocsContent.js.map +0 -1
- package/dist/src/layout/docsComponents/DocsContent/EndpointPage/index.js +0 -2
- package/dist/src/layout/docsComponents/DocsContent/EndpointPage/index.js.map +0 -1
- package/dist/src/layout/docsComponents/DocsContent/OverviewPage/index.js +0 -2
- package/dist/src/layout/docsComponents/DocsContent/OverviewPage/index.js.map +0 -1
- package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.js +0 -2
- package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.js.map +0 -1
- package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.module.scss.js +0 -2
- package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.module.scss.js.map +0 -1
- package/dist/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.js +0 -2
- package/dist/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.js.map +0 -1
- package/dist/src/layout/docsComponents/index.js +0 -2
- package/dist/src/layout/docsComponents/index.js.map +0 -1
- package/dist/src/layout/docsLayout.js +0 -2
- package/dist/src/layout/docsLayout.js.map +0 -1
- package/dist/src/utils/index.js +0 -2
- package/dist/src/utils/index.js.map +0 -1
- package/dist/types/components/JsonInput/JsonInput.d.ts +0 -14
- package/dist/types/components/table/tags-table.d.ts +0 -11
- package/dist/types/constants/methods.constant.d.ts +0 -16
- package/dist/types/context/SectionToggleContext.d.ts +0 -37
- package/dist/types/helpers/docs.helper.d.ts +0 -3
- package/dist/types/layout/docsComponents/Codebox/Codebox.d.ts +0 -4
- package/dist/types/layout/docsComponents/DocsAside/DocsAside.d.ts +0 -5
- package/dist/types/layout/docsComponents/DocsContent/DocsContent.d.ts +0 -12
- package/dist/types/layout/docsComponents/DocsContent/EndpointPage/index.d.ts +0 -7
- package/dist/types/layout/docsComponents/DocsContent/OverviewPage/index.d.ts +0 -9
- package/dist/types/layout/docsComponents/DocsHeader/DocsHeader.d.ts +0 -6
- package/dist/types/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.d.ts +0 -18
- package/dist/types/layout/docsComponents/index.d.ts +0 -17
- package/dist/types/layout/docsLayout.d.ts +0 -31
- package/dist/types/types/docsLayout.type.d.ts +0 -7
- package/dist/types/utils/index.d.ts +0 -2
- package/src/assets/icons/ApiIcon.svg +0 -12
- package/src/assets/icons/ArrowBack.svg +0 -3
- package/src/assets/icons/BookIcon.svg +0 -6
- package/src/assets/icons/CopySticker.svg +0 -6
- package/src/assets/icons/DeleteOutlinedIcon.svg +0 -8
- package/src/assets/icons/FilterIcon.svg +0 -4
- package/src/assets/icons/Plus.svg +0 -5
- package/src/assets/icons/PlusSquare.svg +0 -3
- package/src/assets/icons/RequestOption.svg +0 -5
- package/src/assets/icons/arrowDownGray.svg +0 -3
- package/src/assets/icons/arrowRightGray.svg +0 -3
- package/src/assets/icons/close-circle.svg +0 -5
- package/src/assets/icons/copy.svg +0 -4
- package/src/assets/icons/document.svg +0 -6
- package/src/assets/icons/eye.svg +0 -4
- package/src/assets/icons/infoIcon.svg +0 -5
- package/src/assets/icons/searchIcon.svg +0 -4
- package/src/components/JsonInput/JsonInput.tsx +0 -149
- package/src/components/JsonInput/style.module.scss +0 -133
- package/src/components/table/tags-table.tsx +0 -348
- package/src/constants/methods.constant.ts +0 -26
- package/src/context/SectionToggleContext.tsx +0 -121
- package/src/helpers/docs.helper.ts +0 -42
- package/src/layout/docsComponents/Codebox/Codebox.tsx +0 -61
- package/src/layout/docsComponents/Codebox/style.module.scss +0 -43
- package/src/layout/docsComponents/DocsAside/DocsAside.tsx +0 -93
- package/src/layout/docsComponents/DocsAside/style.module.scss +0 -113
- package/src/layout/docsComponents/DocsContent/DocsContent.tsx +0 -51
- package/src/layout/docsComponents/DocsContent/EndpointPage/index.tsx +0 -236
- package/src/layout/docsComponents/DocsContent/EndpointPage/style.scss +0 -309
- package/src/layout/docsComponents/DocsContent/OverviewPage/index.tsx +0 -192
- package/src/layout/docsComponents/DocsContent/OverviewPage/style.scss +0 -284
- package/src/layout/docsComponents/DocsContent/style.scss +0 -0
- package/src/layout/docsComponents/DocsHeader/DocsHeader.module.scss +0 -270
- package/src/layout/docsComponents/DocsHeader/DocsHeader.tsx +0 -187
- package/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.tsx +0 -229
- package/src/layout/docsComponents/DocsSideMenuTree/style.scss +0 -195
- package/src/layout/docsComponents/index.scss +0 -49
- package/src/layout/docsComponents/index.tsx +0 -28
- package/src/layout/docsLayout.tsx +0 -120
- package/src/types/docsLayout.type.ts +0 -7
- package/src/utils/index.ts +0 -12
- package/the_npm_commands.sh +0 -12
- package/variables.txt +0 -4
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type MethodOption = {
|
|
2
|
-
label: string
|
|
3
|
-
value: string
|
|
4
|
-
color: string
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const METHOD_OPTIONS: MethodOption[] = [
|
|
8
|
-
{ label: 'Post', value: 'POST', color: '#10b981' },
|
|
9
|
-
{ label: 'GET', value: 'GET', color: '#3b82f6' },
|
|
10
|
-
{ label: 'Delete', value: 'DELETE', color: '#ef4444' },
|
|
11
|
-
{ label: 'Put', value: 'PUT', color: '#f59e0b' },
|
|
12
|
-
{ label: 'PATCH', value: 'PATCH', color: '#C0F4E8' },
|
|
13
|
-
{ label: 'OPTIONS', value: 'OPTIONS', color: '#6b7280' },
|
|
14
|
-
{ label: 'HEAD', value: 'HEAD', color: '#8b5cf6' },
|
|
15
|
-
{ label: 'TRACE', value: 'TRACE', color: '#ec4899' },
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
export const METHOD_OPTIONS_CONFIG = [
|
|
19
|
-
{
|
|
20
|
-
list: METHOD_OPTIONS.map((method) => ({
|
|
21
|
-
labelConfig: { color: method.color, text: method.label },
|
|
22
|
-
value: method.value,
|
|
23
|
-
data: method,
|
|
24
|
-
})),
|
|
25
|
-
},
|
|
26
|
-
]
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useContext, useState, ReactNode, useMemo, useCallback } from 'react'
|
|
2
|
-
|
|
3
|
-
export enum SectionEnum {
|
|
4
|
-
OVERVIEW = 'overview',
|
|
5
|
-
RESOURCE = 'resource',
|
|
6
|
-
API_SECTION = 'apiSection',
|
|
7
|
-
TAG_SECTION = 'tagSection',
|
|
8
|
-
ENDPOINTS_SECTION = 'endpointsSection',
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
type SectionKey =
|
|
12
|
-
| `api_${string}_${SectionEnum}`
|
|
13
|
-
| `api_${string}_${SectionEnum}_${string | number}`
|
|
14
|
-
| `api_${string}_${SectionEnum}_${string | number}_${string | number}`
|
|
15
|
-
type ExpandedSections = Record<SectionKey, boolean>
|
|
16
|
-
|
|
17
|
-
interface SectionToggleContextType {
|
|
18
|
-
expandedSections: ExpandedSections
|
|
19
|
-
toggleSection: (
|
|
20
|
-
apiId: string,
|
|
21
|
-
sections: ToggleSectionDescriptor[],
|
|
22
|
-
options?: ToggleOptions
|
|
23
|
-
) => void
|
|
24
|
-
generateSectionKey: ({ apiId, type, index, id }: GenerateSectionKeyParams) => SectionKey
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface SectionToggleProviderProps {
|
|
28
|
-
children: ReactNode
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface ToggleSectionDescriptor {
|
|
32
|
-
type: SectionEnum
|
|
33
|
-
index?: string | number
|
|
34
|
-
setTo?: boolean
|
|
35
|
-
id?: string
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface ToggleOptions {
|
|
39
|
-
resetOthers?: boolean
|
|
40
|
-
filterKeys?: SectionEnum[]
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface GenerateSectionKeyParams {
|
|
44
|
-
apiId: string
|
|
45
|
-
type: SectionEnum
|
|
46
|
-
index?: string | number
|
|
47
|
-
id?: string | number
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const SectionToggleContext = createContext<SectionToggleContextType | null>(null)
|
|
51
|
-
|
|
52
|
-
export const useSectionToggle = () => {
|
|
53
|
-
const context = useContext(SectionToggleContext)
|
|
54
|
-
if (!context) {
|
|
55
|
-
throw new Error('useSectionToggle must be used within SectionToggleProvider')
|
|
56
|
-
}
|
|
57
|
-
return context
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const SectionToggleProvider = ({ children }: SectionToggleProviderProps) => {
|
|
61
|
-
const [expandedSections, setExpandedSections] = useState<ExpandedSections>({})
|
|
62
|
-
|
|
63
|
-
const generateSectionKey = ({ apiId, type, index, id }: GenerateSectionKeyParams): SectionKey => {
|
|
64
|
-
let key = `api_${apiId}_${type}`
|
|
65
|
-
|
|
66
|
-
if (index !== undefined) key += `_${index}`
|
|
67
|
-
if (id !== undefined) key += `_${id}`
|
|
68
|
-
|
|
69
|
-
return key as SectionKey
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const toggleSection = useCallback(
|
|
73
|
-
(apiId: string, sections: ToggleSectionDescriptor[], options: ToggleOptions = {}) => {
|
|
74
|
-
const { resetOthers = false, filterKeys = [] } = options
|
|
75
|
-
|
|
76
|
-
const sectionIds = sections.map(({ type, index, id }) =>
|
|
77
|
-
generateSectionKey({ apiId, type, index, id })
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
const sectionToggles = Object.fromEntries(
|
|
81
|
-
sections.map(({ type, index, setTo, id }) => {
|
|
82
|
-
const sectionId = generateSectionKey({ apiId, type, index, id })
|
|
83
|
-
const currentValue = expandedSections[sectionId]
|
|
84
|
-
|
|
85
|
-
return [sectionId, setTo !== undefined ? setTo : !currentValue]
|
|
86
|
-
})
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
if (resetOthers && filterKeys.length > 0) {
|
|
90
|
-
const filtered = Object.fromEntries(
|
|
91
|
-
Object.entries(expandedSections).filter(([key]) => {
|
|
92
|
-
const shouldKeep = key.includes(apiId) && !filterKeys.some((k) => key.includes(k))
|
|
93
|
-
return shouldKeep || sectionIds.includes(key as SectionKey)
|
|
94
|
-
})
|
|
95
|
-
)
|
|
96
|
-
const newState = { ...filtered, ...sectionToggles }
|
|
97
|
-
setExpandedSections(newState)
|
|
98
|
-
} else {
|
|
99
|
-
setExpandedSections((prev) => {
|
|
100
|
-
const next = { ...prev, ...sectionToggles }
|
|
101
|
-
|
|
102
|
-
return next
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
[expandedSections]
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
const contextValue = useMemo(
|
|
110
|
-
() => ({
|
|
111
|
-
expandedSections,
|
|
112
|
-
toggleSection,
|
|
113
|
-
generateSectionKey,
|
|
114
|
-
}),
|
|
115
|
-
[expandedSections, toggleSection]
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<SectionToggleContext.Provider value={contextValue}>{children}</SectionToggleContext.Provider>
|
|
120
|
-
)
|
|
121
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ApiSpecModel } from '@entities/index'
|
|
2
|
-
import { HTTPMethod, OpenAPIFile } from '@entities/openApi'
|
|
3
|
-
import { nanoid } from 'nanoid'
|
|
4
|
-
import { OverviewData, TagData } from 'src/layout/docsLayout'
|
|
5
|
-
|
|
6
|
-
export const transformOpenApiToDocs = (api: ApiSpecModel): OverviewData => {
|
|
7
|
-
const parsedOpenApi: OpenAPIFile =
|
|
8
|
-
typeof api.metaData.openApiJson === 'string'
|
|
9
|
-
? JSON.parse(api.metaData.openApiJson)
|
|
10
|
-
: api.metaData.openApiJson
|
|
11
|
-
|
|
12
|
-
const groupedPathsByTags: Record<string, TagData[]> = { default: [] }
|
|
13
|
-
const validTags = new Set(parsedOpenApi?.tags?.map(({ name }) => name) || [])
|
|
14
|
-
|
|
15
|
-
for (const [path, methods] of Object.entries(parsedOpenApi.paths)) {
|
|
16
|
-
for (const [method, methodData] of Object.entries(methods)) {
|
|
17
|
-
const entry = { ...methodData, method: method as HTTPMethod, path }
|
|
18
|
-
const resourceTags = methodData.tags ?? []
|
|
19
|
-
|
|
20
|
-
const matchedTags = resourceTags.filter((tag) => validTags.has(tag))
|
|
21
|
-
|
|
22
|
-
if (matchedTags.length > 0) {
|
|
23
|
-
matchedTags.forEach((tag) => {
|
|
24
|
-
if (!groupedPathsByTags[tag]) groupedPathsByTags[tag] = []
|
|
25
|
-
groupedPathsByTags[tag].push({ ...entry, id: nanoid(8) } as TagData)
|
|
26
|
-
})
|
|
27
|
-
} else {
|
|
28
|
-
groupedPathsByTags.default.push({ ...entry, id: nanoid(8) } as TagData)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
...parsedOpenApi.info,
|
|
35
|
-
apiSpecId: api.apiSpecId,
|
|
36
|
-
contextPath: api.contextPath,
|
|
37
|
-
associatedProduct: api.associatedProduct,
|
|
38
|
-
apiVersions: api.apiVersions,
|
|
39
|
-
tags: groupedPathsByTags,
|
|
40
|
-
servers: parsedOpenApi.servers,
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'
|
|
3
|
-
import json from 'react-syntax-highlighter/dist/esm/languages/hljs/json'
|
|
4
|
-
import * as hljs from 'react-syntax-highlighter/dist/esm/styles/hljs'
|
|
5
|
-
import styles from './style.module.scss'
|
|
6
|
-
import SVGLoader from '../../../components/SVGLoader/SVGLoader'
|
|
7
|
-
import { Copy } from '../../../assets/icons'
|
|
8
|
-
import { copyToClipboard } from '../../../utils'
|
|
9
|
-
|
|
10
|
-
SyntaxHighlighter.registerLanguage('json', json)
|
|
11
|
-
|
|
12
|
-
const Codebox = ({ code }: { code: string }) => {
|
|
13
|
-
const [theme, setTheme] = useState<'LIGHT' | 'DARK'>('DARK')
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div className={styles.codebox}>
|
|
17
|
-
<div className={styles.codebox_header}>
|
|
18
|
-
<div
|
|
19
|
-
role="button"
|
|
20
|
-
tabIndex={-1}
|
|
21
|
-
onClick={() => theme !== 'LIGHT' && setTheme('LIGHT')}
|
|
22
|
-
className={`${styles.codebox_header_themeToggle} ${styles.codebox_header_themeToggle_light}`}
|
|
23
|
-
title="Light theme"
|
|
24
|
-
></div>
|
|
25
|
-
<div
|
|
26
|
-
role="button"
|
|
27
|
-
tabIndex={-1}
|
|
28
|
-
onClick={() => theme !== 'DARK' && setTheme('DARK')}
|
|
29
|
-
className={`${styles.codebox_header_themeToggle} ${styles.codebox_header_themeToggle_dark}`}
|
|
30
|
-
title="Dark theme"
|
|
31
|
-
></div>
|
|
32
|
-
<SVGLoader
|
|
33
|
-
src={Copy}
|
|
34
|
-
width="0.75rem"
|
|
35
|
-
height="0.75rem"
|
|
36
|
-
className={styles.codebox_header_copyIcon}
|
|
37
|
-
onClick={() => copyToClipboard(code)}
|
|
38
|
-
/>
|
|
39
|
-
</div>
|
|
40
|
-
<SyntaxHighlighter
|
|
41
|
-
language="json"
|
|
42
|
-
style={theme === 'LIGHT' ? hljs.stackoverflowLight : hljs.stackoverflowDark}
|
|
43
|
-
showLineNumbers
|
|
44
|
-
wrapLines
|
|
45
|
-
customStyle={{
|
|
46
|
-
margin: 0,
|
|
47
|
-
height: '13.75rem',
|
|
48
|
-
overflowY: 'auto',
|
|
49
|
-
padding: '0.75rem 1rem 0 1.5rem',
|
|
50
|
-
backgroundColor: theme === 'DARK' ? '#455162' : '#F7F7F7',
|
|
51
|
-
fontSize: '0.75rem',
|
|
52
|
-
}}
|
|
53
|
-
lineProps={{ className: 'custom-code-line' }}
|
|
54
|
-
>
|
|
55
|
-
{code}
|
|
56
|
-
</SyntaxHighlighter>
|
|
57
|
-
</div>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export default Codebox
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
.codebox {
|
|
2
|
-
border-radius: 0.25rem;
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
|
|
5
|
-
&_header {
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
gap: 0.25rem;
|
|
9
|
-
padding-left: 0.5rem;
|
|
10
|
-
height: 1.75rem;
|
|
11
|
-
border: 1px solid #bbbec5;
|
|
12
|
-
border-top-right-radius: 0.25rem;
|
|
13
|
-
border-top-left-radius: 0.25rem;
|
|
14
|
-
|
|
15
|
-
&_themeToggle {
|
|
16
|
-
width: 0.75rem;
|
|
17
|
-
min-width: 0.75rem;
|
|
18
|
-
aspect-ratio: 1 / 1;
|
|
19
|
-
border: 1px solid transparent;
|
|
20
|
-
border-radius: 100%;
|
|
21
|
-
cursor: pointer;
|
|
22
|
-
|
|
23
|
-
&_dark {
|
|
24
|
-
background-color: #455162;
|
|
25
|
-
border-color: #6b7280;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&_light {
|
|
29
|
-
background-color: #edf1fb;
|
|
30
|
-
border-color: #6b7280;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&_copyIcon {
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:global(.custom-code-line),
|
|
40
|
-
:global(.custom-code-line span) {
|
|
41
|
-
font-family: 'Cascadia Code', sans-serif;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import { EndpointData } from 'src/layout/docsLayout'
|
|
3
|
-
import Codebox from '../Codebox/Codebox'
|
|
4
|
-
import { Option, SelectGroup } from 'digitinary-ui'
|
|
5
|
-
import { httpStatusCodes } from '../../../constants/index'
|
|
6
|
-
import { handleStatusColor } from '../../../helpers/methodAccordion.helper'
|
|
7
|
-
import styles from './style.module.scss'
|
|
8
|
-
|
|
9
|
-
const httpStatusCodeOptions: Option[] = httpStatusCodes.map((code) => ({
|
|
10
|
-
label: (
|
|
11
|
-
<div className={styles.statusCodeOptionContainer}>
|
|
12
|
-
<div
|
|
13
|
-
className={styles.statusCodeOptionCircle}
|
|
14
|
-
style={{ backgroundColor: handleStatusColor(code) }}
|
|
15
|
-
></div>
|
|
16
|
-
<span>{code}</span>
|
|
17
|
-
</div>
|
|
18
|
-
),
|
|
19
|
-
value: String(code),
|
|
20
|
-
}))
|
|
21
|
-
|
|
22
|
-
const DocsAside = ({ data }: { data: EndpointData }) => {
|
|
23
|
-
const [selectedResStatusCode, setSelectedResStatusCode] = useState(httpStatusCodeOptions[4])
|
|
24
|
-
const currentResponse = Object.entries(data.responses)
|
|
25
|
-
.map(([code, data]) => ({ code, data }))
|
|
26
|
-
.find((res) => res.code === selectedResStatusCode.value)
|
|
27
|
-
|
|
28
|
-
const stringifyRequestBody = () => {
|
|
29
|
-
if (data?.requestBody?.content) {
|
|
30
|
-
const contentKey = Object.keys(data?.requestBody?.content)[0]
|
|
31
|
-
return JSON.stringify(data?.requestBody?.content[contentKey]?.schema?.properties, null, 2)
|
|
32
|
-
} else {
|
|
33
|
-
return '{}'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const stringifyResponseBody = () => {
|
|
38
|
-
if (currentResponse?.data) {
|
|
39
|
-
const contentKey = Object.keys(currentResponse.data?.content)[0]
|
|
40
|
-
return JSON.stringify(currentResponse.data?.content[contentKey]?.schema?.properties, null, 2)
|
|
41
|
-
} else {
|
|
42
|
-
return '{}'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<aside className={styles.apiDocsAside}>
|
|
48
|
-
<h2 className={styles.apiDocsAside_title}>{data.summary}</h2>
|
|
49
|
-
<h4 className={styles.apiDocsAside_subtitle}>
|
|
50
|
-
<span className={styles.apiDocsAside_subtitle_method} data-method={data.method}>
|
|
51
|
-
{data.method}
|
|
52
|
-
</span>{' '}
|
|
53
|
-
<span>{data.path}</span>
|
|
54
|
-
</h4>
|
|
55
|
-
{!['delete', 'get'].includes(data.method) && data?.requestBody?.content && (
|
|
56
|
-
<div className={styles.codeboxSection}>
|
|
57
|
-
<div className={styles.codeboxHeader}>
|
|
58
|
-
<h6 className={styles.codeboxTitle}>Request</h6>
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
<Codebox code={stringifyRequestBody()} />
|
|
62
|
-
</div>
|
|
63
|
-
)}
|
|
64
|
-
{Object.keys(data?.responses || {})?.length > 0 && (
|
|
65
|
-
<div className={styles.codeboxSection}>
|
|
66
|
-
<div className={`${styles.codeboxHeader}`}>
|
|
67
|
-
<h6 className={styles.codeboxTitle}>Response</h6>
|
|
68
|
-
<SelectGroup
|
|
69
|
-
size="small"
|
|
70
|
-
withSearch={false}
|
|
71
|
-
isMultiple={false}
|
|
72
|
-
clearable={false}
|
|
73
|
-
placeholder="200"
|
|
74
|
-
options={[
|
|
75
|
-
{
|
|
76
|
-
list: httpStatusCodeOptions,
|
|
77
|
-
},
|
|
78
|
-
]}
|
|
79
|
-
value={selectedResStatusCode}
|
|
80
|
-
onChange={(value) => {
|
|
81
|
-
setSelectedResStatusCode(value)
|
|
82
|
-
}}
|
|
83
|
-
/>
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
<Codebox code={stringifyResponseBody()} />
|
|
87
|
-
</div>
|
|
88
|
-
)}
|
|
89
|
-
</aside>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default DocsAside
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
.apiDocsAside {
|
|
2
|
-
width: 22.5rem;
|
|
3
|
-
padding: 3rem 1.5rem;
|
|
4
|
-
background-color: #f0f1f2;
|
|
5
|
-
|
|
6
|
-
&_title {
|
|
7
|
-
font-size: 1.5rem;
|
|
8
|
-
line-height: 2rem;
|
|
9
|
-
font-weight: 600;
|
|
10
|
-
color: #12131a;
|
|
11
|
-
margin-bottom: 0.5rem;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&_subtitle {
|
|
15
|
-
margin-bottom: 2rem;
|
|
16
|
-
|
|
17
|
-
> span {
|
|
18
|
-
font-size: 1.25rem;
|
|
19
|
-
line-height: 1.75rem;
|
|
20
|
-
font-weight: 400;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&_method {
|
|
24
|
-
&[data-method='get'] {
|
|
25
|
-
color: #3a6cd1;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&[data-method='post'] {
|
|
29
|
-
color: #3aaa35;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&[data-method='put'] {
|
|
33
|
-
color: #faad14;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&[data-method='delete'] {
|
|
37
|
-
color: #da3f3f;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&[data-method='option'] {
|
|
41
|
-
color: #495d97;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&[data-method='head'] {
|
|
45
|
-
color: #9461c9;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&[data-method='patch'] {
|
|
49
|
-
color: #58e2c2;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.codeboxSection {
|
|
55
|
-
.codeboxHeader {
|
|
56
|
-
height: 2rem;
|
|
57
|
-
display: flex;
|
|
58
|
-
justify-content: space-between;
|
|
59
|
-
margin-bottom: 0.25rem;
|
|
60
|
-
|
|
61
|
-
h6 {
|
|
62
|
-
font-size: 1rem;
|
|
63
|
-
line-height: 1.25rem;
|
|
64
|
-
font-weight: 500;
|
|
65
|
-
color: #616874;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&:nth-of-type(2) {
|
|
70
|
-
margin-top: 3rem;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:global(.multiSelectGroup) {
|
|
74
|
-
:global(.selectDisplay) {
|
|
75
|
-
padding: 0;
|
|
76
|
-
|
|
77
|
-
:global(.select-label-container) {
|
|
78
|
-
min-width: 100%;
|
|
79
|
-
padding: 0;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
:global(.optionsList .option) {
|
|
84
|
-
height: 1.5rem;
|
|
85
|
-
padding: 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.statusCodeOptionContainer {
|
|
89
|
-
display: flex;
|
|
90
|
-
align-items: center;
|
|
91
|
-
gap: 0.625rem;
|
|
92
|
-
padding-left: 0.75rem;
|
|
93
|
-
|
|
94
|
-
.statusCodeOptionCircle {
|
|
95
|
-
width: 0.625rem;
|
|
96
|
-
min-width: 0.625rem;
|
|
97
|
-
aspect-ratio: 1 / 1;
|
|
98
|
-
border-radius: 100%;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:global(.multiSelectGroup .selectDisplay),
|
|
105
|
-
:global(.multiSelectGroup) {
|
|
106
|
-
width: 6.25rem !important;
|
|
107
|
-
height: 1.5rem !important;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
:global(.multiSelectGroup .selectDisplay .displayValueContainer .iconsContainer) {
|
|
111
|
-
padding-right: 0.75rem !important;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from 'react'
|
|
2
|
-
import './style.scss'
|
|
3
|
-
import { OverviewPage } from './OverviewPage'
|
|
4
|
-
import { EndpointPage } from './EndpointPage'
|
|
5
|
-
import { EndpointData, OverviewData } from 'src/layout/docsLayout'
|
|
6
|
-
|
|
7
|
-
const DocsContent = ({
|
|
8
|
-
data,
|
|
9
|
-
activeType,
|
|
10
|
-
setActiveItemData,
|
|
11
|
-
setActiveType,
|
|
12
|
-
onProductNavigate,
|
|
13
|
-
apis,
|
|
14
|
-
}: {
|
|
15
|
-
data: OverviewData | EndpointData
|
|
16
|
-
activeType: 'OVERVIEW' | 'ENDPOINT'
|
|
17
|
-
setActiveItemData: React.Dispatch<React.SetStateAction<OverviewData | EndpointData>>
|
|
18
|
-
setActiveType: React.Dispatch<React.SetStateAction<'OVERVIEW' | 'ENDPOINT'>>
|
|
19
|
-
onProductNavigate?: (productId: number) => void
|
|
20
|
-
apis: OverviewData[]
|
|
21
|
-
}) => {
|
|
22
|
-
const containerRef = useRef(null)
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
// This will scroll to the top when changing the overview
|
|
26
|
-
if (activeType === 'OVERVIEW' && containerRef?.current) {
|
|
27
|
-
containerRef?.current?.scrollTo({ top: 0, behavior: 'smooth' })
|
|
28
|
-
}
|
|
29
|
-
}, [data, activeType])
|
|
30
|
-
return (
|
|
31
|
-
<main ref={containerRef}>
|
|
32
|
-
{activeType === 'OVERVIEW' ? (
|
|
33
|
-
<OverviewPage
|
|
34
|
-
data={data as OverviewData}
|
|
35
|
-
setActiveItemData={setActiveItemData}
|
|
36
|
-
setActiveType={setActiveType}
|
|
37
|
-
onProductNavigate={onProductNavigate}
|
|
38
|
-
apis={apis}
|
|
39
|
-
/>
|
|
40
|
-
) : (
|
|
41
|
-
<EndpointPage
|
|
42
|
-
data={data as EndpointData}
|
|
43
|
-
setActiveType={setActiveType}
|
|
44
|
-
setActiveItemData={setActiveItemData}
|
|
45
|
-
/>
|
|
46
|
-
)}
|
|
47
|
-
</main>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default DocsContent
|