zudoku 0.1.1-dev.1 → 0.1.1-dev.11

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 (163) hide show
  1. package/cli.js +2 -0
  2. package/dist/app/App.js +20 -0
  3. package/dist/app/App.js.map +1 -0
  4. package/dist/app/DevPortal.d.ts +0 -1
  5. package/dist/app/authentication/openid.js +2 -2
  6. package/dist/app/authentication/openid.js.map +1 -1
  7. package/dist/app/components/Dialog.d.ts +19 -0
  8. package/dist/app/components/Dialog.js +23 -0
  9. package/dist/app/components/Dialog.js.map +1 -0
  10. package/dist/app/components/Header.d.ts +0 -1
  11. package/dist/app/components/Input.d.ts +5 -0
  12. package/dist/app/components/Input.js +9 -0
  13. package/dist/app/components/Input.js.map +1 -0
  14. package/dist/app/components/SyntaxHighlight.js +2 -0
  15. package/dist/app/components/SyntaxHighlight.js.map +1 -1
  16. package/dist/app/components/context/DevPortalProvider.d.ts +0 -1
  17. package/dist/app/components/navigation/SideNavigationWrapper.d.ts +1 -2
  18. package/dist/app/components/navigation/useNavigationCollapsibleState.d.ts +0 -1
  19. package/dist/app/main.js +3 -15
  20. package/dist/app/main.js.map +1 -1
  21. package/dist/app/plugins/markdown/index.d.ts +0 -1
  22. package/dist/app/plugins/openapi/ColorizedParam.d.ts +5 -1
  23. package/dist/app/plugins/openapi/ColorizedParam.js +10 -5
  24. package/dist/app/plugins/openapi/ColorizedParam.js.map +1 -1
  25. package/dist/app/plugins/openapi/MakeRequest.js +18 -6
  26. package/dist/app/plugins/openapi/MakeRequest.js.map +1 -1
  27. package/dist/app/plugins/openapi/OperationList.d.ts +2 -45
  28. package/dist/app/plugins/openapi/OperationList.js +16 -16
  29. package/dist/app/plugins/openapi/OperationList.js.map +1 -1
  30. package/dist/app/plugins/openapi/OperationListItem.d.ts +2 -2
  31. package/dist/app/plugins/openapi/OperationListItem.js +2 -2
  32. package/dist/app/plugins/openapi/OperationListItem.js.map +1 -1
  33. package/dist/app/plugins/openapi/RequestBodySidecarBox.js +8 -8
  34. package/dist/app/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  35. package/dist/app/plugins/openapi/ResponsesSidecarBox.js +1 -1
  36. package/dist/app/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  37. package/dist/app/plugins/openapi/Sidecar.js +73 -18
  38. package/dist/app/plugins/openapi/Sidecar.js.map +1 -1
  39. package/dist/app/plugins/openapi/SidecarBox.d.ts +3 -5
  40. package/dist/app/plugins/openapi/SidecarBox.js +3 -5
  41. package/dist/app/plugins/openapi/SidecarBox.js.map +1 -1
  42. package/dist/app/plugins/openapi/graphql/fragment-masking.d.ts +19 -0
  43. package/dist/app/plugins/openapi/graphql/fragment-masking.js +16 -0
  44. package/dist/app/plugins/openapi/graphql/fragment-masking.js.map +1 -0
  45. package/dist/app/plugins/openapi/graphql/gql.d.ts +58 -0
  46. package/dist/app/plugins/openapi/graphql/gql.js +22 -0
  47. package/dist/app/plugins/openapi/graphql/gql.js.map +1 -0
  48. package/dist/app/plugins/openapi/graphql/graphql.d.ts +282 -0
  49. package/dist/app/plugins/openapi/graphql/graphql.js +526 -0
  50. package/dist/app/plugins/openapi/graphql/graphql.js.map +1 -0
  51. package/dist/app/plugins/openapi/graphql/index.d.ts +2 -836
  52. package/dist/app/plugins/openapi/graphql/index.js +2 -3
  53. package/dist/app/plugins/openapi/graphql/index.js.map +1 -1
  54. package/dist/app/plugins/openapi/index.d.ts +0 -1
  55. package/dist/app/plugins/openapi/playground/Playground.d.ts +8 -0
  56. package/dist/app/plugins/openapi/playground/Playground.js +98 -0
  57. package/dist/app/plugins/openapi/playground/Playground.js.map +1 -0
  58. package/dist/app/plugins/openapi/util/urql.d.ts +0 -1
  59. package/dist/app/ui/Button.d.ts +11 -0
  60. package/dist/app/ui/Button.js +34 -0
  61. package/dist/app/ui/Button.js.map +1 -0
  62. package/dist/app/ui/Card.js +1 -1
  63. package/dist/app/ui/Card.js.map +1 -1
  64. package/dist/app/ui/Tabs.d.ts +7 -0
  65. package/dist/app/ui/Tabs.js +13 -0
  66. package/dist/app/ui/Tabs.js.map +1 -0
  67. package/dist/app/util/MdxComponents.d.ts +2 -2
  68. package/dist/app/util/createVariantComponent.d.ts +15 -0
  69. package/dist/app/util/createVariantComponent.js +12 -0
  70. package/dist/app/util/createVariantComponent.js.map +1 -0
  71. package/dist/app/util/createWaitForNotify.d.ts +1 -1
  72. package/dist/app/util/slugify.d.ts +0 -1
  73. package/dist/cli/cmds/dev.js +0 -1
  74. package/dist/cli/cmds/dev.js.map +1 -1
  75. package/dist/cli/common/logger.d.ts +1 -2
  76. package/dist/cli/common/logger.js +2 -4
  77. package/dist/cli/common/logger.js.map +1 -1
  78. package/dist/cli/dev/handler.d.ts +1 -1
  79. package/dist/cli/dev/handler.js +11 -2
  80. package/dist/cli/dev/handler.js.map +1 -1
  81. package/dist/config/config.d.ts +11 -5
  82. package/dist/ts.d.ts +6 -0
  83. package/dist/ts.js +62 -0
  84. package/dist/ts.js.map +1 -0
  85. package/dist/vite/config.d.ts +1 -0
  86. package/dist/vite/config.js +80 -16
  87. package/dist/vite/config.js.map +1 -1
  88. package/dist/vite/config.test.d.ts +1 -0
  89. package/dist/vite/config.test.js +10 -0
  90. package/dist/vite/config.test.js.map +1 -0
  91. package/dist/vite/dev-server.js +3 -2
  92. package/dist/vite/dev-server.js.map +1 -1
  93. package/dist/vite/html.d.ts +1 -1
  94. package/dist/vite/html.js +2 -3
  95. package/dist/vite/html.js.map +1 -1
  96. package/dist/vite/plugin-api.d.ts +4 -0
  97. package/dist/vite/plugin-api.js +47 -0
  98. package/dist/vite/plugin-api.js.map +1 -0
  99. package/dist/vite/plugin-auth.d.ts +4 -0
  100. package/dist/vite/plugin-auth.js +29 -0
  101. package/dist/vite/plugin-auth.js.map +1 -0
  102. package/dist/vite/plugin-config.d.ts +6 -0
  103. package/dist/vite/plugin-config.js +24 -0
  104. package/dist/vite/plugin-config.js.map +1 -0
  105. package/dist/vite/plugin-docs.d.ts +4 -0
  106. package/dist/vite/plugin-docs.js +43 -0
  107. package/dist/vite/plugin-docs.js.map +1 -0
  108. package/dist/vite/plugin-docs.test.d.ts +1 -0
  109. package/dist/vite/plugin-docs.test.js +31 -0
  110. package/dist/vite/plugin-docs.test.js.map +1 -0
  111. package/dist/vite/plugin-html.d.ts +3 -0
  112. package/dist/vite/plugin-html.js +50 -0
  113. package/dist/vite/plugin-html.js.map +1 -0
  114. package/dist/vite/plugin-mdx.d.ts +8 -0
  115. package/dist/vite/plugin-mdx.js +61 -0
  116. package/dist/vite/plugin-mdx.js.map +1 -0
  117. package/dist/vite/plugin-metadata.d.ts +6 -0
  118. package/dist/vite/plugin-metadata.js +24 -0
  119. package/dist/vite/plugin-metadata.js.map +1 -0
  120. package/dist/vite/plugin.d.ts +2 -6
  121. package/dist/vite/plugin.js +14 -104
  122. package/dist/vite/plugin.js.map +1 -1
  123. package/package.json +32 -22
  124. package/src/app/App.tsx +30 -0
  125. package/src/app/components/Dialog.tsx +119 -0
  126. package/src/app/components/Input.tsx +24 -0
  127. package/src/app/components/SyntaxHighlight.tsx +2 -0
  128. package/src/app/main.tsx +3 -16
  129. package/src/app/plugins/openapi/ColorizedParam.tsx +18 -9
  130. package/src/app/plugins/openapi/MakeRequest.tsx +19 -0
  131. package/src/app/plugins/openapi/OperationList.tsx +20 -22
  132. package/src/app/plugins/openapi/OperationListItem.tsx +3 -3
  133. package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +31 -28
  134. package/src/app/plugins/openapi/ResponsesSidecarBox.tsx +1 -1
  135. package/src/app/plugins/openapi/Sidecar.tsx +81 -20
  136. package/src/app/plugins/openapi/SidecarBox.tsx +30 -29
  137. package/src/app/plugins/openapi/graphql/fragment-masking.ts +111 -0
  138. package/src/app/plugins/openapi/graphql/gql.ts +70 -0
  139. package/src/app/plugins/openapi/graphql/graphql.ts +795 -0
  140. package/src/app/plugins/openapi/graphql/index.ts +2 -13
  141. package/src/app/plugins/openapi/playground/Playground.tsx +309 -0
  142. package/src/app/plugins/openapi/queries.graphql +6 -0
  143. package/src/app/ui/Button.tsx +56 -0
  144. package/src/app/ui/Card.tsx +1 -1
  145. package/src/app/ui/Tabs.tsx +52 -0
  146. package/src/app/util/createVariantComponent.tsx +30 -0
  147. package/dist/app/app.js +0 -69
  148. package/dist/app/app.js.map +0 -1
  149. package/dist/app/config.d.ts +0 -3
  150. package/dist/app/config.js +0 -9
  151. package/dist/app/config.js.map +0 -1
  152. package/dist/app/markdowns.d.ts +0 -3
  153. package/dist/app/markdowns.js +0 -5
  154. package/dist/app/markdowns.js.map +0 -1
  155. package/dist/app/plugins/openapi/util/getCode.d.ts +0 -2
  156. package/dist/app/plugins/openapi/util/getCode.js +0 -54
  157. package/dist/app/plugins/openapi/util/getCode.js.map +0 -1
  158. package/src/app/app.tsx +0 -85
  159. package/src/app/config.ts +0 -20
  160. package/src/app/markdowns.ts +0 -7
  161. package/src/app/plugins/openapi/graphql/env.d.ts +0 -48
  162. package/src/app/plugins/openapi/util/getCode.tsx +0 -69
  163. /package/dist/app/{app.d.ts → App.d.ts} +0 -0
package/src/app/app.tsx DELETED
@@ -1,85 +0,0 @@
1
- import "./main.css";
2
-
3
- import DevPortal from "./DevPortal.js";
4
- import { markdownPlugin } from "./plugins/markdown/index.js";
5
- import { openApiPlugin } from "./plugins/openapi/index.js";
6
-
7
- import config from "./config.js";
8
-
9
- // async function getAuthProvider(authConfig: AuthenticationConfig) {
10
- // if (authConfig.type === "clerk") {
11
- // const clerkProvider = await import("./authentication/clerk.js");
12
- // return clerkProvider(authConfig);
13
- // } else {
14
- // throw new Error(
15
- // `The authentication type "${authConfig.type}" is not supported.`,
16
- // );
17
- // }
18
- // //openIdAuth({
19
- // // clientId: oauth.client_id,
20
- // // authorizationEndpoint: oauth.authorize_url,
21
- // // tokenEndpoint: oauth.token_fetch_url,
22
- // // })
23
- // }
24
-
25
- export default function App() {
26
- return (
27
- <DevPortal
28
- meta={{
29
- headerTitle: config?.ui?.headerTitle ?? "Developer Portal",
30
- pageTitle: config?.ui?.pageTitle ?? "%s | Dev Portal",
31
- logo: config?.ui?.logo ?? "https://cdn.zuplo.com/www/favicon.png",
32
- favicon:
33
- config?.ui?.metadata?.favicon ??
34
- "https://cdn.zuplo.com/www/favicon.png",
35
- }}
36
- navigation={config.navigation ?? []}
37
- // authentication={
38
- // config.authentication
39
- // ? getAuthProvider(config.authentication)
40
- // : undefined
41
- // }
42
- plugins={[
43
- ...(config.docs
44
- ? Array.isArray(config.docs)
45
- ? config.docs
46
- : [config.docs]
47
- : []
48
- ).map((docs) =>
49
- markdownPlugin({
50
- markdownFiles: docs?.files ?? {},
51
- }),
52
- ),
53
- ...(config.apis
54
- ? Array.isArray(config.apis)
55
- ? config.apis
56
- : [config.apis]
57
- : []
58
- ).map((api) => openApiPlugin(api)),
59
-
60
- // apiKeyPlugin({
61
- // // consumerEndpoint:
62
- // // "https://zudoku-customer-main-b36fa2f.d2.zuplo.dev/v1/developer/api-keys",
63
- // getConsumers: async (ctx) => {
64
- // const accessToken = await ctx.authentication?.getToken?.(ctx);
65
-
66
- // if (!accessToken) {
67
- // return;
68
- // }
69
-
70
- // const consumers = await fetch(
71
- // "https://zudoku-customer-main-b36fa2f.d2.zuplo.dev/v1/developer/api-keys",
72
- // {
73
- // headers: {
74
- // Authorization: `Bearer ${accessToken}`,
75
- // },
76
- // },
77
- // );
78
-
79
- // return { consumers: [await consumers.json()] };
80
- // },
81
- // }),
82
- ]}
83
- />
84
- );
85
- }
package/src/app/config.ts DELETED
@@ -1,20 +0,0 @@
1
- import type { ZudokuConfig } from "../config/config.js";
2
-
3
- interface ZuploConfigImport {
4
- default: ZudokuConfig;
5
- }
6
-
7
- // Search for config files
8
- const configs = import.meta.glob<ZuploConfigImport>(
9
- "/zudoku.config.{js,jsx,ts,tsx,mjs}",
10
- { eager: true },
11
- );
12
-
13
- let config: ZudokuConfig = {};
14
-
15
- // If we found any, load the first one
16
- if (Object.keys(configs).length > 0) {
17
- config = configs[Object.keys(configs)[0]].default;
18
- }
19
-
20
- export default config;
@@ -1,7 +0,0 @@
1
- import { MDXImport } from "./plugins/markdown/index.js";
2
-
3
- const markdowns = import.meta.glob<MDXImport>("/pages/**/*.mdx", {
4
- eager: false,
5
- });
6
-
7
- export default markdowns;
@@ -1,48 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
-
4
- /** An IntrospectionQuery representation of your schema.
5
- *
6
- * @remarks
7
- * This is an introspection of your schema saved as a file by GraphQLSP.
8
- * It will automatically be used by `gql.tada` to infer the types of your GraphQL documents.
9
- * If you need to reuse this data or update your `scalars`, update `tadaOutputLocation` to
10
- * instead save to a .ts instead of a .d.ts file.
11
- */
12
- export type introspection = {
13
- name: never;
14
- query: 'Query';
15
- mutation: never;
16
- subscription: never;
17
- types: {
18
- 'Boolean': unknown;
19
- 'EncodingItem': { kind: 'OBJECT'; name: 'EncodingItem'; fields: { 'allowReserved': { name: 'allowReserved'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'contentType': { name: 'contentType'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'explode': { name: 'explode'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'headers': { name: 'headers'; type: { kind: 'SCALAR'; name: 'JSONObject'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'style': { name: 'style'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
20
- 'ExampleItem': { kind: 'OBJECT'; name: 'ExampleItem'; fields: { 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'externalValue': { name: 'externalValue'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'summary': { name: 'summary'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'value': { name: 'value'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
21
- 'Float': unknown;
22
- 'ID': unknown;
23
- 'Int': unknown;
24
- 'JSON': unknown;
25
- 'JSONObject': unknown;
26
- 'MediaTypeObject': { kind: 'OBJECT'; name: 'MediaTypeObject'; fields: { 'encoding': { name: 'encoding'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'EncodingItem'; ofType: null; }; }; } }; 'examples': { name: 'examples'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExampleItem'; ofType: null; }; }; } }; 'mediaType': { name: 'mediaType'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'schema': { name: 'schema'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; }; };
27
- 'OperationItem': { kind: 'OBJECT'; name: 'OperationItem'; fields: { 'contentTypes': { name: 'contentTypes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; } }; 'deprecated': { name: 'deprecated'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'method': { name: 'method'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'operationId': { name: 'operationId'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'parameters': { name: 'parameters'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ParameterItem'; ofType: null; }; }; } }; 'path': { name: 'path'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'requestBody': { name: 'requestBody'; type: { kind: 'OBJECT'; name: 'RequestBodyObject'; ofType: null; } }; 'responses': { name: 'responses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ResponseItem'; ofType: null; }; }; }; } }; 'slug': { name: 'slug'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'summary': { name: 'summary'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'tags': { name: 'tags'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TagItem'; ofType: null; }; }; } }; }; };
28
- 'ParameterIn': { name: 'ParameterIn'; enumValues: 'cookie' | 'header' | 'path' | 'query'; };
29
- 'ParameterItem': { kind: 'OBJECT'; name: 'ParameterItem'; fields: { 'allowEmptyValue': { name: 'allowEmptyValue'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'allowReserved': { name: 'allowReserved'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'deprecated': { name: 'deprecated'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'examples': { name: 'examples'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ExampleItem'; ofType: null; }; }; } }; 'explode': { name: 'explode'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'in': { name: 'in'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'ParameterIn'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'required': { name: 'required'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'schema': { name: 'schema'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'style': { name: 'style'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
30
- 'PathItem': { kind: 'OBJECT'; name: 'PathItem'; fields: { 'methods': { name: 'methods'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; } }; 'path': { name: 'path'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
31
- 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'schema': { name: 'schema'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Schema'; ofType: null; }; } }; }; };
32
- 'RequestBodyObject': { kind: 'OBJECT'; name: 'RequestBodyObject'; fields: { 'content': { name: 'content'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'MediaTypeObject'; ofType: null; }; }; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'required': { name: 'required'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; }; };
33
- 'ResponseItem': { kind: 'OBJECT'; name: 'ResponseItem'; fields: { 'content': { name: 'content'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'MediaTypeObject'; ofType: null; }; }; } }; 'description': { name: 'description'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'headers': { name: 'headers'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'links': { name: 'links'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'statusCode': { name: 'statusCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
34
- 'Schema': { kind: 'OBJECT'; name: 'Schema'; fields: { 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'openapi': { name: 'openapi'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'operations': { name: 'operations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'OperationItem'; ofType: null; }; }; }; } }; 'paths': { name: 'paths'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PathItem'; ofType: null; }; }; }; } }; 'tags': { name: 'tags'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SchemaTag'; ofType: null; }; }; }; } }; 'title': { name: 'title'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'url': { name: 'url'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'version': { name: 'version'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
35
- 'SchemaTag': { kind: 'OBJECT'; name: 'SchemaTag'; fields: { 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'operations': { name: 'operations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'OperationItem'; ofType: null; }; }; }; } }; }; };
36
- 'SchemaType': { name: 'SchemaType'; enumValues: 'json' | 'url' | 'yaml'; };
37
- 'String': unknown;
38
- 'TagItem': { kind: 'OBJECT'; name: 'TagItem'; fields: { 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
39
- };
40
- };
41
-
42
- import * as gqlTada from "gql.tada";
43
-
44
- declare module "gql.tada" {
45
- interface setupSchema {
46
- introspection: introspection;
47
- }
48
- }
@@ -1,69 +0,0 @@
1
- import type { OperationListItemResult } from "../OperationList.js";
2
-
3
- export const getCode = (operation: OperationListItemResult, option: string) => {
4
- switch (option) {
5
- case "curl":
6
- return (
7
- `curl --request ${operation.method.toLocaleUpperCase()} \\\n` +
8
- ` --url ${operation.path} \\\n` +
9
- ` --header 'Content-Type: application/json'`
10
- );
11
- case "wget":
12
- return (
13
- `wget --method=${operation.method.toLocaleUpperCase()} \\\n` +
14
- ` --header='Content-Type: application/json' \\\n` +
15
- ` ${operation.path}`
16
- );
17
- case "js":
18
- return (
19
- `fetch('${operation.path}', {\n` +
20
- ` method: '${operation.method.toLocaleUpperCase()}',\n` +
21
- ` headers: { 'Content-Type': 'application/json' },\n` +
22
- `});`
23
- );
24
- case "ruby":
25
- return (
26
- `require 'net/http'\n\n` +
27
- `url = URI.parse('${operation.path}')\n` +
28
- `http = Net::HTTP.new(url.host, url.port)\n` +
29
- `request = Net::HTTP::${operation.method}.new(url)\n` +
30
- `request['Content-Type'] = 'application/json'\n` +
31
- `http.request(request)`
32
- );
33
- case "php":
34
- return (
35
- `$ch = curl_init('${operation.path}');\n` +
36
- `curl_setopt($ch, CURLOPT_CUSTOMREQUEST, '${operation.method.toLocaleUpperCase()}');\n` +
37
- `curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n` +
38
- `curl_exec($ch);\n` +
39
- `curl_close($ch);`
40
- );
41
- case "go":
42
- return (
43
- `package main\n\n` +
44
- `import (\n` +
45
- ` "net/http"\n` +
46
- ` "strings"\n` +
47
- `)\n\n` +
48
- `func main() {\n` +
49
- ` client := &http.Client{}\n` +
50
- ` req, _ := http.NewRequest("${operation.method.toLocaleUpperCase()}", "${operation.path}", strings.NewReader(""))\n` +
51
- ` req.Header.Set("Content-Type", "application/json")\n` +
52
- ` client.Do(req)\n` +
53
- `}`
54
- );
55
- case "rust":
56
- return (
57
- `use reqwest::Client;\n\n` +
58
- `fn main() {\n` +
59
- ` let client = Client::new();\n` +
60
- ` let res = client\n` +
61
- ` .${operation.method.toLocaleLowerCase()}("${operation.path}")\n` +
62
- ` .header("Content-Type", "application/json")\n` +
63
- ` .send();\n` +
64
- `}`
65
- );
66
- default:
67
- return "";
68
- }
69
- };
File without changes