@digi-frontend/dgate-api-documentation 1.0.7 → 1.0.9

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 (42) hide show
  1. package/dist/_virtual/index3.js +1 -1
  2. package/dist/_virtual/index4.js +1 -1
  3. package/dist/_virtual/index5.js +1 -1
  4. package/dist/_virtual/index6.js +1 -1
  5. package/dist/node_modules/digitinary-ui/dist/index.js +1 -1
  6. package/dist/node_modules/digitinary-ui/dist/index.js.map +1 -1
  7. package/dist/node_modules/js-yaml/dist/js-yaml.mjs.js +3 -0
  8. package/dist/node_modules/js-yaml/dist/js-yaml.mjs.js.map +1 -0
  9. package/dist/node_modules/toposort/index.js +1 -1
  10. package/dist/node_modules/yup/index.esm.js +1 -1
  11. package/dist/src/components/InfoForm/InfoForm.js +1 -1
  12. package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
  13. package/dist/src/components/JsonInput/JsonInput.js +2 -0
  14. package/dist/src/components/JsonInput/JsonInput.js.map +1 -0
  15. package/dist/src/components/JsonInput/style.module.scss.js +2 -0
  16. package/dist/src/components/JsonInput/style.module.scss.js.map +1 -0
  17. package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
  18. package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
  19. package/dist/src/components/table/table.js +1 -1
  20. package/dist/src/components/table/table.js.map +1 -1
  21. package/dist/src/components/table/tags-table.js +2 -0
  22. package/dist/src/components/table/tags-table.js.map +1 -0
  23. package/dist/src/constants/index.js +1 -1
  24. package/dist/src/constants/index.js.map +1 -1
  25. package/dist/src/helpers/layout.helper.js +1 -1
  26. package/dist/src/helpers/layout.helper.js.map +1 -1
  27. package/dist/src/layout/layout.js +1 -1
  28. package/dist/src/layout/layout.js.map +1 -1
  29. package/dist/src/layout/layout.module.css.js +1 -1
  30. package/dist/styles.css +694 -498
  31. package/dist/types/components/InfoForm/InfoForm.d.ts +3 -1
  32. package/dist/types/components/JsonInput/JsonInput.d.ts +13 -0
  33. package/dist/types/components/MethodAccordion/MethodAccordion.d.ts +1 -2
  34. package/dist/types/components/table/tags-table.d.ts +11 -0
  35. package/dist/types/constants/index.d.ts +18 -4
  36. package/dist/types/layout/layout.d.ts +1 -0
  37. package/dist/types/types/layout.type.d.ts +9 -1
  38. package/dist/types/types/openApi.d.ts +13 -1
  39. package/package.json +2 -2
  40. package/src/components/MethodAccordion/MethodAccordion.module.scss +41 -23
  41. package/src/components/MethodAccordion/MethodAccordion.tsx +3 -2
  42. package/src/components/table/table.tsx +3 -3
@@ -1,2 +1,4 @@
1
- declare const InfoForm: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const InfoForm: ({ readOnly }: {
2
+ readOnly?: boolean;
3
+ }) => import("react/jsx-runtime").JSX.Element;
2
4
  export default InfoForm;
@@ -0,0 +1,13 @@
1
+ declare const JsonInput: ({ placeholder, label, value, onValidation, onChange, dataId, className, errorMessage, acceptType, fieldIsDisabled, }: {
2
+ placeholder: any;
3
+ label: any;
4
+ value: any;
5
+ onValidation: any;
6
+ onChange: any;
7
+ dataId: any;
8
+ className?: string;
9
+ errorMessage: any;
10
+ acceptType?: string;
11
+ fieldIsDisabled: any;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ export default JsonInput;
@@ -1,9 +1,8 @@
1
1
  import { TransformedMethod } from '../../types/layout.type';
2
- declare const MethodsAccordion: ({ method, path, setFieldValue, readOnly, handleSave, }: {
2
+ declare const MethodsAccordion: ({ method, path, setFieldValue, readOnly, }: {
3
3
  method: TransformedMethod;
4
4
  path: string;
5
5
  setFieldValue: (key: string, value: string) => void;
6
6
  readOnly?: boolean;
7
- handleSave: (data: any) => unknown;
8
7
  }) => import("react/jsx-runtime").JSX.Element;
9
8
  export default MethodsAccordion;
@@ -0,0 +1,11 @@
1
+ import './style.scss';
2
+ declare const TagsTable: ({ id, headCells, data, isFormOpen, setIsFormOpen, saveNewRow, readOnly }: {
3
+ id: any;
4
+ headCells: any;
5
+ data: any;
6
+ isFormOpen: any;
7
+ setIsFormOpen: any;
8
+ saveNewRow: any;
9
+ readOnly: any;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ export default TagsTable;
@@ -2,36 +2,50 @@ export declare const methodColorMapping: {
2
2
  get: {
3
3
  label: string;
4
4
  color: string;
5
+ order: number;
5
6
  };
6
7
  post: {
7
8
  label: string;
8
9
  color: string;
10
+ order: number;
9
11
  };
10
12
  put: {
11
13
  label: string;
12
14
  color: string;
15
+ order: number;
13
16
  };
14
17
  delete: {
15
18
  label: string;
16
19
  color: string;
20
+ order: number;
17
21
  };
18
- PATCH: {
22
+ patch: {
19
23
  label: string;
20
24
  color: string;
25
+ order: number;
21
26
  };
22
- OPTIONS: {
27
+ options: {
23
28
  label: string;
24
29
  color: string;
30
+ order: number;
25
31
  };
26
- TRACE: {
32
+ trace: {
27
33
  label: string;
28
34
  color: string;
35
+ order: number;
29
36
  };
30
- HEAD: {
37
+ head: {
31
38
  label: string;
32
39
  color: string;
40
+ order: number;
33
41
  };
34
42
  };
43
+ export declare const tagsTableHeaders: {
44
+ id: string;
45
+ label: string;
46
+ sortable: boolean;
47
+ classes: string;
48
+ }[];
35
49
  export declare const paramsTableHeaders: ({
36
50
  id: string;
37
51
  label: string;
@@ -2,6 +2,7 @@ import { JSX } from 'react';
2
2
  import { OpenAPIFile } from '../types/openApi';
3
3
  interface ILayoutProps {
4
4
  openApiJson?: OpenAPIFile;
5
+ handleSave?: (values: unknown) => unknown;
5
6
  }
6
7
  declare const Layout: ({ openApiJson, handleSave }: ILayoutProps) => JSX.Element;
7
8
  export default Layout;
@@ -3,7 +3,15 @@ export type TransformedMethod = {
3
3
  type: HTTPMethod;
4
4
  tags: string[];
5
5
  parameters: any;
6
- requestBody: any;
6
+ requestBody: {
7
+ content: {
8
+ contentType: string;
9
+ schema: {
10
+ properties: string;
11
+ type: string;
12
+ };
13
+ };
14
+ };
7
15
  responses: {
8
16
  code: string;
9
17
  content: {
@@ -33,6 +33,18 @@ export interface OpenAPIFile {
33
33
  tags?: {
34
34
  name: string;
35
35
  description?: string;
36
+ externalDocs?: {
37
+ url: string;
38
+ description: string;
39
+ }[];
40
+ }[];
41
+ }
42
+ export interface Tags {
43
+ name: string;
44
+ description?: string;
45
+ externalDocs?: {
46
+ url: string;
47
+ description: string;
36
48
  }[];
37
49
  }
38
50
  interface Parameter {
@@ -71,7 +83,7 @@ interface Schema {
71
83
  enum?: string[];
72
84
  required?: string[];
73
85
  }
74
- interface SecurityScheme {
86
+ export interface SecurityScheme {
75
87
  type: 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
76
88
  description?: string;
77
89
  name?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digi-frontend/dgate-api-documentation",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "main": "dist/src/index.js",
5
5
  "module": "dist/src/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "license": "ISC",
17
17
  "description": "",
18
18
  "dependencies": {
19
- "digitinary-ui": "^1.0.156",
19
+ "digitinary-ui": "1.0.166",
20
20
  "formik": "^2.4.6",
21
21
  "html-react-parser": "^5.2.2",
22
22
  "js-yaml": "^4.1.0",
@@ -3,17 +3,19 @@
3
3
  box-shadow: none !important;
4
4
  margin-bottom: 0 !important;
5
5
 
6
- :global(.summary) {
6
+ :global(.accordion-header) {
7
7
  padding: 0 !important;
8
8
  margin: 1.25rem 1.875rem 0 1.875rem !important;
9
9
  height: 2.625rem;
10
+ border: none !important;
11
+ background-color: transparent !important;
10
12
  }
11
13
 
12
14
  :global(.iconContainer .dropdownIcon) {
13
15
  display: none !important;
14
16
  }
15
17
 
16
- :global(.details.show) {
18
+ :global(.accordion-details.expanded) {
17
19
  border: none !important;
18
20
  padding: 0 !important;
19
21
  }
@@ -26,11 +28,13 @@
26
28
 
27
29
  .methodSummary {
28
30
  display: flex;
31
+ align-items: center;
29
32
  gap: 0.3125rem;
30
33
  background-color: #f8f9fb;
31
34
  width: 100%;
32
35
  padding: 0.3125rem;
33
36
  border-radius: 0.3125rem;
37
+ font-size: 0.875rem;
34
38
 
35
39
  .methodLabel {
36
40
  display: grid;
@@ -41,6 +45,11 @@
41
45
  border-radius: 0.1875rem;
42
46
  text-transform: capitalize;
43
47
  }
48
+
49
+ .methodPath {
50
+ display: block;
51
+ line-height: 1.25rem !important;
52
+ }
44
53
  }
45
54
 
46
55
  .methodExpandArrowContainer {
@@ -62,6 +71,16 @@
62
71
  transition: rotate 0.3s ease-in-out;
63
72
  }
64
73
  }
74
+
75
+ &.readOnly {
76
+ .methodSummary {
77
+ background-color: #ebecf2;
78
+ }
79
+
80
+ .methodExpandArrowContainer {
81
+ background-color: #ebecf2;
82
+ }
83
+ }
65
84
  }
66
85
 
67
86
  .methodAccordionContent {
@@ -70,16 +89,6 @@
70
89
  gap: 1.25rem;
71
90
  padding-inline: 1.875rem;
72
91
 
73
- .divTest {
74
- background-color: red;
75
- height: 40px;
76
- width: 15px;
77
- }
78
-
79
- .divTest:focus {
80
- background-color: black;
81
- }
82
-
83
92
  .methodDesc {
84
93
  margin-top: 1.25rem;
85
94
  }
@@ -171,19 +180,24 @@
171
180
 
172
181
  .requestAccordion,
173
182
  .responseAccordion {
174
- border-top: 1px solid #babdcc;
183
+ border: 1px solid #babdcc;
175
184
  border-radius: 0.3125rem !important;
176
185
  box-shadow: none !important;
177
186
  margin-bottom: 0 !important;
178
187
  cursor: default !important;
179
188
 
180
- :global(.summary) {
189
+ :global(.accordion-header) {
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: space-between;
181
193
  margin: 0 !important;
182
- padding: 1rem !important;
183
- height: auto !important;
194
+ padding: 0 !important;
195
+ height: 4.0625rem !important;
196
+ border-radius: 0.3125rem !important;
197
+ background-color: white !important;
184
198
  }
185
199
 
186
- :global(.details.show) {
200
+ :global(.accordion-details.expanded) {
187
201
  border-top: 1px solid #babdcc !important;
188
202
  padding: 1.25rem !important;
189
203
  padding: 0 !important;
@@ -199,23 +213,27 @@
199
213
  }
200
214
  }
201
215
 
202
- :global(.details.show .textArea .containerTextArea) {
216
+ :global(.accordion-details.expanded .textArea .containerTextArea) {
203
217
  display: flex;
204
218
  }
205
219
 
206
- :global(.details.show .textArea .containerTextArea .inputField) {
220
+ :global(.accordion-details.expanded .textArea .containerTextArea .inputField) {
207
221
  height: 100%;
208
222
  padding: 1.25rem;
209
223
  }
210
224
 
211
225
  .requestAccordionSummary,
212
226
  .responseAccordionSummary {
227
+ width: 100%;
228
+ display: flex;
229
+ justify-content: space-between;
213
230
  font-weight: 700;
214
231
  font-size: 1.125rem;
215
232
  line-height: 1.5rem;
216
233
  display: flex;
217
234
  align-items: center;
218
235
  cursor: default !important;
236
+ margin-inline: 0.625rem 1.25rem;
219
237
  }
220
238
 
221
239
  .responseAccordionSummary_title,
@@ -233,18 +251,18 @@
233
251
  }
234
252
  }
235
253
 
236
- :global(.details) {
254
+ :global(.accordion-details) {
237
255
  :global(.textArea .inputField) {
238
256
  padding: 0;
239
257
  border: none;
240
258
  }
241
259
  }
242
260
 
243
- :global(.summary .iconContainer .dropdownIcon) {
261
+ :global(.accordion-header .iconContainer .dropdownIcon) {
244
262
  display: none !important;
245
263
  }
246
264
 
247
- :global(.summary) {
265
+ :global(.accordion-header) {
248
266
  cursor: default;
249
267
  }
250
268
  }
@@ -272,7 +290,7 @@
272
290
  }
273
291
  }
274
292
 
275
- :global(.summary) {
293
+ :global(.accordion-header) {
276
294
  overflow: visible;
277
295
  cursor: default;
278
296
  }
@@ -54,7 +54,7 @@ const MethodsAccordion = ({
54
54
  const [selectedParamIndex, setSelectedParamIndex] = useState<number | null>(null)
55
55
  const [selectedParamName, setSelectedParamName] = useState<string | null>(null)
56
56
  const [tableRecords, setTableRecords] = useState()
57
-
57
+
58
58
  const [selectedStatusCode, setSelectedStatusCode] = useState(httpStatusCodeOptions[4])
59
59
  const currentResponse =
60
60
  method.responses.find((res) => Number(res.code) === selectedStatusCode.value) || '{}'
@@ -220,7 +220,7 @@ const MethodsAccordion = ({
220
220
  onChange={() => setIsExpanded((prev) => ({ ...prev, method: !prev.method }))}
221
221
  className={styles.methodAccordion}
222
222
  summary={
223
- <div className={styles.methodSummaryContainer}>
223
+ <div className={`${styles.methodSummaryContainer} ${readOnly ? styles.readOnly : ''}`}>
224
224
  <div className={styles.methodSummary}>
225
225
  <span
226
226
  style={{
@@ -339,6 +339,7 @@ const MethodsAccordion = ({
339
339
  <SelectGroup
340
340
  withSearch={false}
341
341
  isMultiple={false}
342
+ clearable={false}
342
343
  placeholder="200"
343
344
  options={[
344
345
  {
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react'
2
2
  import './style.scss'
3
- import { Button, Input, SelectGroup, Switch, TextArea } from 'digitinary-ui'
3
+ import { Button, Input, SelectGroupV2, Switch, TextArea } from 'digitinary-ui'
4
4
  import Tooltip from '../Tooltip/Tooltip'
5
5
  import SVGLoader from '../SVGLoader/SVGLoader'
6
6
  import { AddRow, EditIcon, DeleteIcon } from '../../assets/icons'
@@ -125,7 +125,7 @@ const ParamterTable = ({
125
125
 
126
126
  <td key={'parameter in'}>
127
127
  <div data-id="TEXT_DESCRIPTION" className="tableData">
128
- <SelectGroup
128
+ <SelectGroupV2
129
129
  disabled={readOnly}
130
130
  value={{
131
131
  label: capitalize(values.in),
@@ -152,7 +152,7 @@ const ParamterTable = ({
152
152
 
153
153
  <td key={'parameter schema type'}>
154
154
  <div data-id="TEXT_DESCRIPTION" className="tableData">
155
- <SelectGroup
155
+ <SelectGroupV2
156
156
  disabled={readOnly}
157
157
  value={{
158
158
  label: capitalize(values.schema.type),