@digi-frontend/dgate-api-documentation 1.0.52 → 1.0.53
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/dist/_virtual/index4.js +1 -1
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/node_modules/toposort/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +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/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/helpers/layout.helper.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsContent/EndpointPage/index.js +1 -1
- package/dist/src/layout/docsComponents/DocsContent/EndpointPage/index.js.map +1 -1
- package/dist/src/layout/docsLayout.js +1 -1
- package/dist/src/layout/docsLayout.js.map +1 -1
- package/dist/src/layout/layout.js.map +1 -1
- package/dist/styles.css +768 -762
- package/package.json +1 -1
- package/src/components/MethodAccordion/MethodAccordion.tsx +15 -8
- package/src/components/table/style.scss +6 -0
- package/src/components/table/table.tsx +33 -35
- package/src/constants/index.ts +1 -1
- package/src/helpers/layout.helper.ts +1 -7
- package/src/layout/docsComponents/DocsContent/EndpointPage/index.tsx +1 -1
- package/src/layout/docsLayout.tsx +0 -1
- package/src/layout/layout.tsx +1 -1
package/package.json
CHANGED
|
@@ -100,7 +100,13 @@ const MethodsAccordion = ({
|
|
|
100
100
|
id: `header_${index}`,
|
|
101
101
|
paramName: item,
|
|
102
102
|
paramType: capitalize('header'),
|
|
103
|
-
schemaType: capitalize(data?.schema?.type) || ''
|
|
103
|
+
schemaType: `${capitalize(data?.schema?.type) || ''} ${
|
|
104
|
+
data?.schema?.type?.toLowerCase() == 'array' &&
|
|
105
|
+
data?.schema?.items &&
|
|
106
|
+
data?.schema?.items?.type
|
|
107
|
+
? ` _ ${capitalize(data?.schema?.items?.type)}`
|
|
108
|
+
: ''
|
|
109
|
+
}`,
|
|
104
110
|
required: (
|
|
105
111
|
<>
|
|
106
112
|
{readOnly ? (
|
|
@@ -177,7 +183,6 @@ const MethodsAccordion = ({
|
|
|
177
183
|
maxLength={120}
|
|
178
184
|
onChange={(value) => {
|
|
179
185
|
if (value === '' || regex.ASCII.test(value)) {
|
|
180
|
-
// onResponseTableChange('description', value, item, indexRef.current)
|
|
181
186
|
setFieldValue(
|
|
182
187
|
`responses[${indexRef.current}].headers[${item}].description`,
|
|
183
188
|
value
|
|
@@ -362,15 +367,18 @@ const MethodsAccordion = ({
|
|
|
362
367
|
}
|
|
363
368
|
|
|
364
369
|
const generateTableData = (items, isForRequest?: boolean) => {
|
|
365
|
-
|
|
366
|
-
? items.filter((item) => item.in && item.in.toLowerCase() != 'header')
|
|
367
|
-
: items.filter((item) => item.in && item.in.toLowerCase() == 'header')
|
|
368
|
-
return data.map((item, index) => {
|
|
370
|
+
return items?.map((item, index) => {
|
|
369
371
|
return {
|
|
370
372
|
id: index,
|
|
371
373
|
paramName: item.name,
|
|
372
374
|
paramType: capitalize(item.in),
|
|
373
|
-
schemaType: capitalize(item
|
|
375
|
+
schemaType: `${capitalize(item?.schema?.type) || ''} ${
|
|
376
|
+
item?.schema?.type?.toLowerCase() == 'array' &&
|
|
377
|
+
item?.schema?.items &&
|
|
378
|
+
item?.schema?.items?.type
|
|
379
|
+
? ` _ ${capitalize(item?.schema?.items?.type)}`
|
|
380
|
+
: ''
|
|
381
|
+
}`,
|
|
374
382
|
required: (
|
|
375
383
|
<>
|
|
376
384
|
{readOnly ? (
|
|
@@ -652,7 +660,6 @@ const MethodsAccordion = ({
|
|
|
652
660
|
}
|
|
653
661
|
|
|
654
662
|
const saveNewResponseRow = (value) => {
|
|
655
|
-
// setTableResponseData([...tableResponseData, values])
|
|
656
663
|
setFieldValue(`responses[${indexRef.current}].headers[${value.name}]`, value)
|
|
657
664
|
}
|
|
658
665
|
|
|
@@ -186,7 +186,10 @@ const ParamterTable = ({
|
|
|
186
186
|
</td>
|
|
187
187
|
|
|
188
188
|
<td key={'parameter schema type'}>
|
|
189
|
-
<div
|
|
189
|
+
<div
|
|
190
|
+
data-id="TEXT_DESCRIPTION"
|
|
191
|
+
className="tableData select-inputs"
|
|
192
|
+
>
|
|
190
193
|
<SelectGroupV2
|
|
191
194
|
disabled={readOnly}
|
|
192
195
|
clearable={false}
|
|
@@ -211,41 +214,36 @@ const ParamterTable = ({
|
|
|
211
214
|
isMultiple={false}
|
|
212
215
|
withSearch={false}
|
|
213
216
|
/>{' '}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
]}
|
|
243
|
-
isMultiple={false}
|
|
244
|
-
withSearch={false}
|
|
245
|
-
/>
|
|
217
|
+
{!!values?.schema?.type && values?.schema?.type.toLowerCase() === 'array' ? (
|
|
218
|
+
<SelectGroupV2
|
|
219
|
+
disabled={readOnly}
|
|
220
|
+
clearable={false}
|
|
221
|
+
value={{
|
|
222
|
+
label: capitalize(values?.schema?.items?.type),
|
|
223
|
+
value: values.schema?.items?.type,
|
|
224
|
+
}}
|
|
225
|
+
errorMsg={!!errors?.schema?.items?.type && errors?.schema?.items?.type}
|
|
226
|
+
onChange={(item) =>
|
|
227
|
+
setFieldValue('schema.items.type', item?.value?.toLowerCase())
|
|
228
|
+
} // Updates state on selection
|
|
229
|
+
options={[
|
|
230
|
+
{
|
|
231
|
+
list: [
|
|
232
|
+
{ label: 'String', value: 'string' },
|
|
233
|
+
{ label: 'Integer', value: 'integer' },
|
|
234
|
+
{ label: 'Boolean', value: 'boolean' },
|
|
235
|
+
{ label: 'Object', value: 'object' },
|
|
236
|
+
{ label: 'Array', value: 'array' },
|
|
237
|
+
{ label: 'Number', value: 'number' },
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
]}
|
|
241
|
+
isMultiple={false}
|
|
242
|
+
withSearch={false}
|
|
243
|
+
/>
|
|
246
244
|
) : (
|
|
247
|
-
'
|
|
248
|
-
)}
|
|
245
|
+
''
|
|
246
|
+
)}
|
|
249
247
|
</div>
|
|
250
248
|
</td>
|
|
251
249
|
|
package/src/constants/index.ts
CHANGED
|
@@ -70,7 +70,7 @@ export const paramsTableHeaders = [
|
|
|
70
70
|
},
|
|
71
71
|
{ id: 'paramType', label: 'In', sortable: false, classes: 'requiredParam' },
|
|
72
72
|
{ id: 'schemaType', label: 'Schema-Type', sortable: false, classes: 'requiredParam' },
|
|
73
|
-
{ id: 'arraySchemaType', label: 'Array Schema Type', sortable: false },
|
|
73
|
+
// { id: 'arraySchemaType', label: 'Array Schema Type', sortable: false },
|
|
74
74
|
{ id: 'enum', label: 'Enum', sortable: false },
|
|
75
75
|
{ id: 'required', label: 'Required', sortable: false, classes: 'requiredParam' },
|
|
76
76
|
{ id: 'description', label: 'Description', sortable: false },
|
|
@@ -119,13 +119,7 @@ const validateBodyForResponse = (content, method) => {
|
|
|
119
119
|
return {}
|
|
120
120
|
}
|
|
121
121
|
let _content = JSON.parse((content?.schema as any)?.properties as string)
|
|
122
|
-
|
|
123
|
-
// if (!_content?.body) {
|
|
124
|
-
// _content = {
|
|
125
|
-
// body: _content,
|
|
126
|
-
// }
|
|
127
|
-
// }
|
|
128
|
-
// }
|
|
122
|
+
|
|
129
123
|
return _content
|
|
130
124
|
}
|
|
131
125
|
|
|
@@ -177,7 +177,7 @@ export const EndpointPage = ({ data }) => {
|
|
|
177
177
|
</tr>
|
|
178
178
|
</thead>
|
|
179
179
|
<tbody>
|
|
180
|
-
{Object.keys(headersList).map((key, index) => (
|
|
180
|
+
{!!headersList && Object.keys(headersList) && Object.keys(headersList).map((key, index) => (
|
|
181
181
|
<tr>
|
|
182
182
|
<td>{key}</td>
|
|
183
183
|
<td>{headersList[key]?.required.toString()}</td>
|
|
@@ -45,7 +45,6 @@ const DocsLayout = ({ apis }: ILayoutProps): JSX.Element => {
|
|
|
45
45
|
const [expandedSections, setExpandedSections] = useState({})
|
|
46
46
|
const allData = useRef([]);
|
|
47
47
|
const [pending, setPending] = useState(true)
|
|
48
|
-
console.log({ apis, transformedOpenApis, activeItemData })
|
|
49
48
|
useEffect(() => {
|
|
50
49
|
if (transformedOpenApis.length === 0) {
|
|
51
50
|
const t = structuredClone(apis)
|