@lukoweb/apitogo 0.1.1 → 0.1.3
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/cli/cli.js +168 -57
- package/dist/declarations/lib/ui/Command.d.ts +1 -1
- package/dist/declarations/lib/util/MdxComponents.d.ts +1 -1
- package/package.json +2 -1
- package/src/app/main.tsx +150 -150
- package/src/config/loader.ts +245 -245
- package/src/index.ts +33 -33
- package/src/lib/authentication/components/CallbackHandler.tsx +45 -45
- package/src/lib/authentication/components/SignIn.tsx +46 -46
- package/src/lib/authentication/components/SignUp.tsx +48 -48
- package/src/lib/authentication/providers/clerk.tsx +224 -224
- package/src/lib/authentication/ui/AuthCard.tsx +7 -7
- package/src/lib/authentication/ui/EmailLinkCallbackUi.tsx +129 -125
- package/src/lib/authentication/ui/EmailLinkSentUi.tsx +105 -101
- package/src/lib/authentication/ui/EmailLinkSignInUi.tsx +100 -96
- package/src/lib/authentication/ui/EmailVerificationUi.tsx +128 -124
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +620 -616
- package/src/lib/components/AiAssistantMenuItems.tsx +102 -102
- package/src/lib/components/Autocomplete.tsx +123 -123
- package/src/lib/components/DeveloperHint.tsx +39 -35
- package/src/lib/components/Header.tsx +260 -260
- package/src/lib/components/Layout.tsx +53 -53
- package/src/lib/components/Main.tsx +51 -51
- package/src/lib/components/Mermaid.tsx +74 -70
- package/src/lib/components/MobileTopNavigation.tsx +276 -276
- package/src/lib/components/MultiSelect.tsx +86 -82
- package/src/lib/components/TopNavigation.tsx +103 -103
- package/src/lib/components/index.ts +26 -26
- package/src/lib/components/navigation/NavigationCategory.tsx +157 -157
- package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -35
- package/src/lib/components/navigation/NavigationItem.tsx +181 -177
- package/src/lib/core/RouteGuard.tsx +193 -193
- package/src/lib/errors/ErrorMessage.tsx +50 -46
- package/src/lib/plugins/api-catalog/Catalog.tsx +80 -80
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +128 -124
- package/src/lib/plugins/api-keys/CreateApiKeyDialog.tsx +49 -49
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +72 -72
- package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -342
- package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +127 -127
- package/src/lib/plugins/markdown/MdxPage.tsx +285 -285
- package/src/lib/plugins/openapi/ApiHeader.tsx +96 -96
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +88 -88
- package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +94 -94
- package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -52
- package/src/lib/plugins/openapi/OperationListItem.tsx +183 -183
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +63 -63
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +120 -117
- package/src/lib/plugins/openapi/SchemaInfo.tsx +344 -344
- package/src/lib/plugins/openapi/SchemaList.tsx +113 -113
- package/src/lib/plugins/openapi/Sidecar.tsx +312 -309
- package/src/lib/plugins/openapi/SidecarExamples.tsx +177 -174
- package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -58
- package/src/lib/plugins/openapi/components/ResponseContent.tsx +117 -114
- package/src/lib/plugins/openapi/playground/BodyPanel.tsx +274 -271
- package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +51 -51
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +60 -60
- package/src/lib/plugins/openapi/playground/Headers.tsx +188 -181
- package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +75 -75
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +38 -38
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +45 -45
- package/src/lib/plugins/openapi/playground/Playground.tsx +602 -599
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +56 -56
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +151 -148
- package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +70 -70
- package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -91
- package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -50
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +355 -355
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +106 -102
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +189 -184
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +299 -299
- package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +162 -162
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +202 -202
- package/src/lib/plugins/search-pagefind/ResultList.tsx +122 -118
- package/src/lib/ui/ActionButton.tsx +21 -21
- package/src/lib/ui/Command.tsx +191 -191
- package/src/lib/util/MdxComponents.tsx +150 -150
- package/src/vite/config.ts +234 -231
- package/src/vite/dev-server.ts +291 -291
- package/src/vite/plugin-api-keys.ts +50 -50
- package/src/vite/plugin-api.ts +320 -318
- package/src/vite/plugin-auth.ts +38 -38
- package/src/vite/plugin-component.ts +45 -39
- package/src/vite/plugin-config.ts +75 -75
- package/src/vite/plugin-custom-pages.ts +36 -36
- package/src/vite/plugin-docs.ts +202 -202
- package/src/vite/plugin-markdown-export.ts +214 -214
- package/src/vite/plugin-mdx.ts +149 -149
- package/src/vite/plugin-navigation.ts +106 -106
- package/src/vite/plugin-search.ts +47 -47
- package/src/vite/plugin.ts +42 -42
- package/src/vite/prerender/prerender.ts +233 -233
package/dist/cli/cli.js
CHANGED
|
@@ -131,7 +131,7 @@ import { stat } from "node:fs/promises";
|
|
|
131
131
|
var fileExists;
|
|
132
132
|
var init_file_exists = __esm({
|
|
133
133
|
"src/config/file-exists.ts"() {
|
|
134
|
-
fileExists = (
|
|
134
|
+
fileExists = (path30) => stat(path30).then(() => true).catch(() => false);
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
|
|
@@ -3816,7 +3816,7 @@ import {
|
|
|
3816
3816
|
// package.json
|
|
3817
3817
|
var package_default = {
|
|
3818
3818
|
name: "@lukoweb/apitogo",
|
|
3819
|
-
version: "0.1.
|
|
3819
|
+
version: "0.1.2",
|
|
3820
3820
|
type: "module",
|
|
3821
3821
|
sideEffects: [
|
|
3822
3822
|
"**/*.css",
|
|
@@ -4003,6 +4003,7 @@ var package_default = {
|
|
|
4003
4003
|
"strip-ansi": "7.2.0",
|
|
4004
4004
|
"tailwind-merge": "3.5.0",
|
|
4005
4005
|
tailwindcss: "4.2.1",
|
|
4006
|
+
tar: "7.5.10",
|
|
4006
4007
|
"tw-animate-css": "1.4.0",
|
|
4007
4008
|
unified: "11.0.5",
|
|
4008
4009
|
"unist-util-visit": "5.1.0",
|
|
@@ -4406,14 +4407,14 @@ var flattenAllOf = (schema2) => {
|
|
|
4406
4407
|
};
|
|
4407
4408
|
|
|
4408
4409
|
// src/lib/util/traverse.ts
|
|
4409
|
-
var traverse = (specification, transform,
|
|
4410
|
-
const transformed = transform(specification,
|
|
4410
|
+
var traverse = (specification, transform, path30 = []) => {
|
|
4411
|
+
const transformed = transform(specification, path30);
|
|
4411
4412
|
if (typeof transformed !== "object" || transformed === null) {
|
|
4412
4413
|
return transformed;
|
|
4413
4414
|
}
|
|
4414
4415
|
const result = Array.isArray(transformed) ? [] : {};
|
|
4415
4416
|
for (const [key, value] of Object.entries(transformed)) {
|
|
4416
|
-
const currentPath = [...
|
|
4417
|
+
const currentPath = [...path30, key];
|
|
4417
4418
|
if (Array.isArray(value)) {
|
|
4418
4419
|
result[key] = value.map(
|
|
4419
4420
|
(item, index) => typeof item === "object" && item != null ? traverse(item, transform, [...currentPath, index.toString()]) : item
|
|
@@ -4441,9 +4442,9 @@ var resolveLocalRef = (schema2, ref) => {
|
|
|
4441
4442
|
if (schemaCache?.has(ref)) {
|
|
4442
4443
|
return schemaCache.get(ref);
|
|
4443
4444
|
}
|
|
4444
|
-
const
|
|
4445
|
+
const path30 = ref.split("/").slice(1);
|
|
4445
4446
|
let current = schema2;
|
|
4446
|
-
for (const segment of
|
|
4447
|
+
for (const segment of path30) {
|
|
4447
4448
|
if (!current || typeof current !== "object") {
|
|
4448
4449
|
current = null;
|
|
4449
4450
|
}
|
|
@@ -4462,7 +4463,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4462
4463
|
}
|
|
4463
4464
|
const cloned = structuredClone(schema2);
|
|
4464
4465
|
const visited = /* @__PURE__ */ new Set();
|
|
4465
|
-
const resolve = async (current,
|
|
4466
|
+
const resolve = async (current, path30) => {
|
|
4466
4467
|
if (isIndexableObject(current)) {
|
|
4467
4468
|
if (visited.has(current)) {
|
|
4468
4469
|
return CIRCULAR_REF;
|
|
@@ -4470,7 +4471,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4470
4471
|
visited.add(current);
|
|
4471
4472
|
if (Array.isArray(current)) {
|
|
4472
4473
|
for (let index = 0; index < current.length; index++) {
|
|
4473
|
-
current[index] = await resolve(current[index], `${
|
|
4474
|
+
current[index] = await resolve(current[index], `${path30}/${index}`);
|
|
4474
4475
|
}
|
|
4475
4476
|
} else {
|
|
4476
4477
|
if ("$ref" in current && typeof current.$ref === "string") {
|
|
@@ -4481,13 +4482,13 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4481
4482
|
for (const resolver of resolvers) {
|
|
4482
4483
|
const resolved = await resolver($ref);
|
|
4483
4484
|
if (resolved) {
|
|
4484
|
-
result2 = await resolve(resolved,
|
|
4485
|
+
result2 = await resolve(resolved, path30);
|
|
4485
4486
|
break;
|
|
4486
4487
|
}
|
|
4487
4488
|
}
|
|
4488
4489
|
if (result2 === void 0) {
|
|
4489
4490
|
const resolved = await resolveLocalRef(cloned, $ref);
|
|
4490
|
-
result2 = await resolve(resolved,
|
|
4491
|
+
result2 = await resolve(resolved, path30);
|
|
4491
4492
|
}
|
|
4492
4493
|
if (hasSiblings) {
|
|
4493
4494
|
if (result2 === CIRCULAR_REF) {
|
|
@@ -4500,7 +4501,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4500
4501
|
return result2;
|
|
4501
4502
|
}
|
|
4502
4503
|
for (const key in current) {
|
|
4503
|
-
current[key] = await resolve(current[key], `${
|
|
4504
|
+
current[key] = await resolve(current[key], `${path30}/${key}`);
|
|
4504
4505
|
}
|
|
4505
4506
|
}
|
|
4506
4507
|
visited.delete(current);
|
|
@@ -4539,9 +4540,9 @@ var upgradeSchema = (schema2) => {
|
|
|
4539
4540
|
}
|
|
4540
4541
|
return sub;
|
|
4541
4542
|
});
|
|
4542
|
-
schema2 = traverse(schema2, (sub,
|
|
4543
|
+
schema2 = traverse(schema2, (sub, path30) => {
|
|
4543
4544
|
if (sub.example !== void 0) {
|
|
4544
|
-
if (isSchemaPath(
|
|
4545
|
+
if (isSchemaPath(path30 ?? [])) {
|
|
4545
4546
|
sub.examples = [sub.example];
|
|
4546
4547
|
} else {
|
|
4547
4548
|
sub.examples = {
|
|
@@ -4554,11 +4555,11 @@ var upgradeSchema = (schema2) => {
|
|
|
4554
4555
|
}
|
|
4555
4556
|
return sub;
|
|
4556
4557
|
});
|
|
4557
|
-
schema2 = traverse(schema2, (schema3,
|
|
4558
|
+
schema2 = traverse(schema2, (schema3, path30) => {
|
|
4558
4559
|
if (schema3.type === "object" && schema3.properties !== void 0) {
|
|
4559
|
-
const parentPath =
|
|
4560
|
+
const parentPath = path30?.slice(0, -1);
|
|
4560
4561
|
const isMultipart = parentPath?.some((segment, index) => {
|
|
4561
|
-
return segment === "content" &&
|
|
4562
|
+
return segment === "content" && path30?.[index + 1] === "multipart/form-data";
|
|
4562
4563
|
});
|
|
4563
4564
|
if (isMultipart) {
|
|
4564
4565
|
const entries = Object.entries(schema3.properties);
|
|
@@ -4572,8 +4573,8 @@ var upgradeSchema = (schema2) => {
|
|
|
4572
4573
|
}
|
|
4573
4574
|
return schema3;
|
|
4574
4575
|
});
|
|
4575
|
-
schema2 = traverse(schema2, (schema3,
|
|
4576
|
-
if (
|
|
4576
|
+
schema2 = traverse(schema2, (schema3, path30) => {
|
|
4577
|
+
if (path30?.includes("content") && path30.includes("application/octet-stream")) {
|
|
4577
4578
|
return {};
|
|
4578
4579
|
}
|
|
4579
4580
|
if (schema3.type === "string" && schema3.format === "binary") {
|
|
@@ -4599,11 +4600,11 @@ var upgradeSchema = (schema2) => {
|
|
|
4599
4600
|
}
|
|
4600
4601
|
return sub;
|
|
4601
4602
|
});
|
|
4602
|
-
schema2 = traverse(schema2, (schema3,
|
|
4603
|
+
schema2 = traverse(schema2, (schema3, path30) => {
|
|
4603
4604
|
if (schema3.type === "string" && schema3.format === "byte") {
|
|
4604
|
-
const parentPath =
|
|
4605
|
+
const parentPath = path30?.slice(0, -1);
|
|
4605
4606
|
const contentMediaType = parentPath?.find(
|
|
4606
|
-
(_, index) =>
|
|
4607
|
+
(_, index) => path30?.[index - 1] === "content"
|
|
4607
4608
|
);
|
|
4608
4609
|
return {
|
|
4609
4610
|
type: "string",
|
|
@@ -4615,7 +4616,7 @@ var upgradeSchema = (schema2) => {
|
|
|
4615
4616
|
});
|
|
4616
4617
|
return schema2;
|
|
4617
4618
|
};
|
|
4618
|
-
function isSchemaPath(
|
|
4619
|
+
function isSchemaPath(path30) {
|
|
4619
4620
|
const schemaLocations = [
|
|
4620
4621
|
["components", "schemas"],
|
|
4621
4622
|
"properties",
|
|
@@ -4628,10 +4629,10 @@ function isSchemaPath(path29) {
|
|
|
4628
4629
|
];
|
|
4629
4630
|
return schemaLocations.some((location) => {
|
|
4630
4631
|
if (Array.isArray(location)) {
|
|
4631
|
-
return location.every((segment, index) =>
|
|
4632
|
+
return location.every((segment, index) => path30[index] === segment);
|
|
4632
4633
|
}
|
|
4633
|
-
return
|
|
4634
|
-
}) ||
|
|
4634
|
+
return path30.includes(location);
|
|
4635
|
+
}) || path30.includes("schema") || path30.some((segment) => segment.endsWith("Schema"));
|
|
4635
4636
|
}
|
|
4636
4637
|
|
|
4637
4638
|
// src/lib/oas/parser/index.ts
|
|
@@ -4713,13 +4714,13 @@ var OPENAPI_PROPS = /* @__PURE__ */ new Set([
|
|
|
4713
4714
|
"anyOf",
|
|
4714
4715
|
"oneOf"
|
|
4715
4716
|
]);
|
|
4716
|
-
var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(),
|
|
4717
|
+
var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(), path30 = [], currentRefPaths = /* @__PURE__ */ new Set()) => {
|
|
4717
4718
|
if (obj === null || typeof obj !== "object") return obj;
|
|
4718
4719
|
const refPath = obj.__$ref;
|
|
4719
4720
|
const isCircular = currentPath.has(obj) || typeof refPath === "string" && currentRefPaths.has(refPath);
|
|
4720
4721
|
if (isCircular) {
|
|
4721
4722
|
if (typeof refPath === "string") return SCHEMA_REF_PREFIX + refPath;
|
|
4722
|
-
const circularProp =
|
|
4723
|
+
const circularProp = path30.find((p) => !OPENAPI_PROPS.has(p)) || path30[0];
|
|
4723
4724
|
return [CIRCULAR_REF, circularProp].filter(Boolean).join(":");
|
|
4724
4725
|
}
|
|
4725
4726
|
if (refs.has(obj)) return refs.get(obj);
|
|
@@ -4729,7 +4730,7 @@ var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs
|
|
|
4729
4730
|
value,
|
|
4730
4731
|
currentPath,
|
|
4731
4732
|
refs,
|
|
4732
|
-
[...
|
|
4733
|
+
[...path30, key],
|
|
4733
4734
|
currentRefPaths
|
|
4734
4735
|
);
|
|
4735
4736
|
const result = Array.isArray(obj) ? obj.map((item, i) => recurse(item, i.toString())) : Object.fromEntries(
|
|
@@ -4764,7 +4765,7 @@ var resolveExtensions = (obj) => Object.fromEntries(
|
|
|
4764
4765
|
var getAllTags = (schema2) => {
|
|
4765
4766
|
const rootTags = schema2.tags ?? [];
|
|
4766
4767
|
const operations = Object.values(schema2.paths ?? {}).flatMap(
|
|
4767
|
-
(
|
|
4768
|
+
(path30) => HttpMethods.map((k) => path30?.[k]).filter((op) => op != null)
|
|
4768
4769
|
);
|
|
4769
4770
|
const operationTags = new Set(operations.flatMap((op) => op.tags ?? []));
|
|
4770
4771
|
const hasUntaggedOperations = operations.some(
|
|
@@ -4819,7 +4820,7 @@ var getAllSlugs = (ops, schemaTags = []) => {
|
|
|
4819
4820
|
var getOperationSlugKey = (op) => [op.path, op.method, op.operationId, op.summary].filter(Boolean).join("-");
|
|
4820
4821
|
var getAllOperations = (paths) => {
|
|
4821
4822
|
const operations = Object.entries(paths ?? {}).flatMap(
|
|
4822
|
-
([
|
|
4823
|
+
([path30, value]) => HttpMethods.flatMap((method) => {
|
|
4823
4824
|
if (!value?.[method]) return [];
|
|
4824
4825
|
const operation = value[method];
|
|
4825
4826
|
const pathParameters = value.parameters ?? [];
|
|
@@ -4839,7 +4840,7 @@ var getAllOperations = (paths) => {
|
|
|
4839
4840
|
return {
|
|
4840
4841
|
...operation,
|
|
4841
4842
|
method,
|
|
4842
|
-
path:
|
|
4843
|
+
path: path30,
|
|
4843
4844
|
parameters,
|
|
4844
4845
|
servers,
|
|
4845
4846
|
tags: operation.tags ?? []
|
|
@@ -5197,8 +5198,8 @@ var Schema = builder.objectRef("Schema").implement({
|
|
|
5197
5198
|
}),
|
|
5198
5199
|
paths: t.field({
|
|
5199
5200
|
type: [PathItem],
|
|
5200
|
-
resolve: (root) => Object.entries(root.paths ?? {}).map(([
|
|
5201
|
-
path:
|
|
5201
|
+
resolve: (root) => Object.entries(root.paths ?? {}).map(([path30, value]) => ({
|
|
5202
|
+
path: path30,
|
|
5202
5203
|
// biome-ignore lint/style/noNonNullAssertion: value is guaranteed to be defined
|
|
5203
5204
|
methods: Object.keys(value)
|
|
5204
5205
|
}))
|
|
@@ -5345,7 +5346,7 @@ init_joinUrl();
|
|
|
5345
5346
|
|
|
5346
5347
|
// src/vite/api/schema-codegen.ts
|
|
5347
5348
|
var unescapeJsonPointer = (uri) => decodeURIComponent(uri.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
5348
|
-
var getSegmentsFromPath = (
|
|
5349
|
+
var getSegmentsFromPath = (path30) => path30.split("/").slice(1).map(unescapeJsonPointer);
|
|
5349
5350
|
var createLocalRefMap = (obj) => {
|
|
5350
5351
|
const refMap = /* @__PURE__ */ new Map();
|
|
5351
5352
|
const siblingsMap = /* @__PURE__ */ new Map();
|
|
@@ -5376,16 +5377,16 @@ var replaceMarkers = (code, mergedRefs) => code.replace(/"__refMap:(.*?)"/g, '__
|
|
|
5376
5377
|
/"__refMap\+Siblings:(.*?)"/g,
|
|
5377
5378
|
(_, key) => mergedRefs.get(key) ?? `__refMap["${key}"]`
|
|
5378
5379
|
);
|
|
5379
|
-
var lookup = (schema2,
|
|
5380
|
-
const parts = getSegmentsFromPath(
|
|
5380
|
+
var lookup = (schema2, path30, filePath) => {
|
|
5381
|
+
const parts = getSegmentsFromPath(path30);
|
|
5381
5382
|
let val = schema2;
|
|
5382
5383
|
for (const part of parts) {
|
|
5383
5384
|
while (val.$ref?.startsWith("#/")) {
|
|
5384
|
-
val = val.$ref ===
|
|
5385
|
+
val = val.$ref === path30 ? val : lookup(schema2, val.$ref, filePath);
|
|
5385
5386
|
}
|
|
5386
5387
|
if (val[part] === void 0) {
|
|
5387
5388
|
throw new Error(
|
|
5388
|
-
`Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${
|
|
5389
|
+
`Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${path30}`
|
|
5389
5390
|
);
|
|
5390
5391
|
}
|
|
5391
5392
|
val = val[part];
|
|
@@ -5630,8 +5631,8 @@ var SchemaManager = class {
|
|
|
5630
5631
|
}
|
|
5631
5632
|
}
|
|
5632
5633
|
};
|
|
5633
|
-
getLatestSchema = (
|
|
5634
|
-
getSchemasForPath = (
|
|
5634
|
+
getLatestSchema = (path30) => this.processedSchemas[path30]?.at(0);
|
|
5635
|
+
getSchemasForPath = (path30) => this.processedSchemas[path30];
|
|
5635
5636
|
getSchemaImports = () => Object.values(this.processedSchemas).flat().filter((s) => s.importKey);
|
|
5636
5637
|
getUrlToFilePathMap = () => {
|
|
5637
5638
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -6074,7 +6075,9 @@ var viteApiPlugin = async () => {
|
|
|
6074
6075
|
`const configuredApiCatalogPlugins = [];`
|
|
6075
6076
|
];
|
|
6076
6077
|
if (config2.apis) {
|
|
6077
|
-
code.push(
|
|
6078
|
+
code.push(
|
|
6079
|
+
'import { openApiPlugin } from "@lukoweb/apitogo/plugins/openapi";'
|
|
6080
|
+
);
|
|
6078
6081
|
code.push(
|
|
6079
6082
|
`const apis = Array.isArray(config.apis) ? config.apis : [config.apis]`
|
|
6080
6083
|
);
|
|
@@ -6271,8 +6274,14 @@ var viteAliasPlugin = () => {
|
|
|
6271
6274
|
const config2 = getCurrentConfig();
|
|
6272
6275
|
const replacements = [
|
|
6273
6276
|
["@lukoweb/apitogo/components", "src/lib/components/index.ts"],
|
|
6274
|
-
[
|
|
6275
|
-
|
|
6277
|
+
[
|
|
6278
|
+
"@lukoweb/apitogo/plugins/openapi",
|
|
6279
|
+
"src/lib/plugins/openapi/index.tsx"
|
|
6280
|
+
],
|
|
6281
|
+
[
|
|
6282
|
+
"@lukoweb/apitogo/plugins/api-catalog",
|
|
6283
|
+
"src/lib/plugins/api-catalog/index.tsx"
|
|
6284
|
+
],
|
|
6276
6285
|
[
|
|
6277
6286
|
"@lukoweb/apitogo/plugins/search-inkeep",
|
|
6278
6287
|
"src/lib/plugins/search-inkeep/index.tsx"
|
|
@@ -7429,7 +7438,10 @@ async function getViteConfig(dir, configEnv) {
|
|
|
7429
7438
|
),
|
|
7430
7439
|
emptyOutDir: true,
|
|
7431
7440
|
rollupOptions: {
|
|
7432
|
-
input: configEnv.command === "build" ? configEnv.isSsrBuild ? [
|
|
7441
|
+
input: configEnv.command === "build" ? configEnv.isSsrBuild ? [
|
|
7442
|
+
"@lukoweb/apitogo/app/entry.server.tsx",
|
|
7443
|
+
config2.__meta.configPath
|
|
7444
|
+
] : "@lukoweb/apitogo/app/entry.client.tsx" : void 0,
|
|
7433
7445
|
external: [joinUrl(config2.basePath, "/pagefind/pagefind.js")]
|
|
7434
7446
|
},
|
|
7435
7447
|
chunkSizeWarningLimit: 1500
|
|
@@ -7709,14 +7721,14 @@ async function generateSitemap({
|
|
|
7709
7721
|
|
|
7710
7722
|
// src/vite/prerender/utils.ts
|
|
7711
7723
|
init_joinUrl();
|
|
7712
|
-
var resolveRoutePath = (
|
|
7713
|
-
const segments =
|
|
7724
|
+
var resolveRoutePath = (path30) => {
|
|
7725
|
+
const segments = path30.split("/");
|
|
7714
7726
|
if (segments.some((s) => s.startsWith(":") && !s.endsWith("?"))) {
|
|
7715
7727
|
return void 0;
|
|
7716
7728
|
}
|
|
7717
7729
|
return segments.filter((s) => !s.startsWith(":")).join("/") || void 0;
|
|
7718
7730
|
};
|
|
7719
|
-
var isSkipped = (
|
|
7731
|
+
var isSkipped = (path30) => path30.includes("*") || /^\d+$/.test(path30);
|
|
7720
7732
|
var resolveRoutes = (routes, parentPath = "") => routes.flatMap((route) => {
|
|
7721
7733
|
if (route.path && isSkipped(route.path)) return [];
|
|
7722
7734
|
const routePath = route.path ? resolveRoutePath(route.path) : void 0;
|
|
@@ -8082,6 +8094,22 @@ function printDiagnosticsToConsole(message) {
|
|
|
8082
8094
|
function printWarningToConsole(message) {
|
|
8083
8095
|
console.error(message);
|
|
8084
8096
|
}
|
|
8097
|
+
async function printCriticalFailureToConsoleAndExit(message) {
|
|
8098
|
+
console.error(colors8.bold(colors8.red(message)));
|
|
8099
|
+
await Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
|
|
8100
|
+
process.exit(1);
|
|
8101
|
+
});
|
|
8102
|
+
}
|
|
8103
|
+
function printResultToConsole(message) {
|
|
8104
|
+
console.log(colors8.bold(colors8.green(message)));
|
|
8105
|
+
}
|
|
8106
|
+
function textOrJson(text) {
|
|
8107
|
+
try {
|
|
8108
|
+
return JSON.parse(text);
|
|
8109
|
+
} catch {
|
|
8110
|
+
return text;
|
|
8111
|
+
}
|
|
8112
|
+
}
|
|
8085
8113
|
|
|
8086
8114
|
// src/cli/build/handler.ts
|
|
8087
8115
|
init_package_json();
|
|
@@ -8612,7 +8640,7 @@ async function dev(argv) {
|
|
|
8612
8640
|
printDiagnosticsToConsole("Ctrl+C to exit");
|
|
8613
8641
|
printDiagnosticsToConsole("");
|
|
8614
8642
|
printDiagnosticsToConsole(
|
|
8615
|
-
`\u{1F680} Running
|
|
8643
|
+
`\u{1F680} Running APIToGo v${packageJson2.version}: ${url}`
|
|
8616
8644
|
);
|
|
8617
8645
|
printDiagnosticsToConsole("");
|
|
8618
8646
|
let hasExited = false;
|
|
@@ -8679,6 +8707,89 @@ var dev_default = {
|
|
|
8679
8707
|
}
|
|
8680
8708
|
};
|
|
8681
8709
|
|
|
8710
|
+
// src/cli/deploy/handler.ts
|
|
8711
|
+
import { access, readFile as readFile4 } from "node:fs/promises";
|
|
8712
|
+
import path28 from "node:path";
|
|
8713
|
+
import { create as createTar } from "tar";
|
|
8714
|
+
var DEPLOY_ENDPOINT = "http://localhost:3000/deploy";
|
|
8715
|
+
var ARCHIVE_NAME = "dist.tgz";
|
|
8716
|
+
var createDeploymentArchive = async (dir) => {
|
|
8717
|
+
const distDir = path28.join(dir, "dist");
|
|
8718
|
+
await access(distDir);
|
|
8719
|
+
const archivePath = path28.join(dir, ARCHIVE_NAME);
|
|
8720
|
+
await createTar(
|
|
8721
|
+
{
|
|
8722
|
+
cwd: dir,
|
|
8723
|
+
file: archivePath,
|
|
8724
|
+
gzip: true,
|
|
8725
|
+
portable: true
|
|
8726
|
+
},
|
|
8727
|
+
["dist"]
|
|
8728
|
+
);
|
|
8729
|
+
return archivePath;
|
|
8730
|
+
};
|
|
8731
|
+
async function deploy(argv) {
|
|
8732
|
+
await build({ ...argv, preview: void 0 });
|
|
8733
|
+
const dir = path28.resolve(process.cwd(), argv.dir);
|
|
8734
|
+
try {
|
|
8735
|
+
printDiagnosticsToConsole("Creating deployment archive...");
|
|
8736
|
+
const archivePath = await createDeploymentArchive(dir);
|
|
8737
|
+
printDiagnosticsToConsole(`Uploading ${path28.basename(archivePath)}...`);
|
|
8738
|
+
const archiveBuffer = await readFile4(archivePath);
|
|
8739
|
+
const formData = new FormData();
|
|
8740
|
+
formData.append(
|
|
8741
|
+
"file",
|
|
8742
|
+
new Blob([archiveBuffer], { type: "application/gzip" }),
|
|
8743
|
+
path28.basename(archivePath)
|
|
8744
|
+
);
|
|
8745
|
+
const response = await fetch(DEPLOY_ENDPOINT, {
|
|
8746
|
+
method: "POST",
|
|
8747
|
+
body: formData
|
|
8748
|
+
});
|
|
8749
|
+
const responseText = await response.text();
|
|
8750
|
+
if (!response.ok) {
|
|
8751
|
+
throw new Error(
|
|
8752
|
+
`Deploy failed with ${response.status}: ${JSON.stringify(textOrJson(responseText))}`
|
|
8753
|
+
);
|
|
8754
|
+
}
|
|
8755
|
+
printResultToConsole(`Deployment uploaded to ${DEPLOY_ENDPOINT}`);
|
|
8756
|
+
if (responseText.trim()) {
|
|
8757
|
+
printDiagnosticsToConsole(JSON.stringify(textOrJson(responseText), null, 2));
|
|
8758
|
+
}
|
|
8759
|
+
} catch (error) {
|
|
8760
|
+
await printCriticalFailureToConsoleAndExit(
|
|
8761
|
+
error instanceof Error ? error.message : String(error)
|
|
8762
|
+
);
|
|
8763
|
+
}
|
|
8764
|
+
}
|
|
8765
|
+
|
|
8766
|
+
// src/cli/cmds/deploy.ts
|
|
8767
|
+
var deploy_default = {
|
|
8768
|
+
desc: "Build, archive, and deploy",
|
|
8769
|
+
command: "deploy",
|
|
8770
|
+
builder: (yargs2) => yargs2.option("dir", {
|
|
8771
|
+
type: "string",
|
|
8772
|
+
describe: "The directory containing your project",
|
|
8773
|
+
default: ".",
|
|
8774
|
+
normalize: true,
|
|
8775
|
+
hidden: true
|
|
8776
|
+
}).option("experimental-ssr", {
|
|
8777
|
+
type: "boolean",
|
|
8778
|
+
describe: "Build for server-side rendering (experimental)",
|
|
8779
|
+
default: false
|
|
8780
|
+
}).option("adapter", {
|
|
8781
|
+
type: "string",
|
|
8782
|
+
describe: "SSR adapter (node, cloudflare, vercel)",
|
|
8783
|
+
choices: ["node", "cloudflare", "vercel"],
|
|
8784
|
+
default: "node"
|
|
8785
|
+
}),
|
|
8786
|
+
handler: async (argv) => {
|
|
8787
|
+
process.env.NODE_ENV = "production";
|
|
8788
|
+
await captureEvent({ argv, event: "apitogo deploy" });
|
|
8789
|
+
await deploy(argv);
|
|
8790
|
+
}
|
|
8791
|
+
};
|
|
8792
|
+
|
|
8682
8793
|
// src/cli/cmds/preview.ts
|
|
8683
8794
|
var previewCommand = {
|
|
8684
8795
|
desc: "Preview production build",
|
|
@@ -8703,7 +8814,7 @@ var preview_default = previewCommand;
|
|
|
8703
8814
|
|
|
8704
8815
|
// src/cli/common/outdated.ts
|
|
8705
8816
|
import { existsSync as existsSync2, mkdirSync } from "node:fs";
|
|
8706
|
-
import { readFile as
|
|
8817
|
+
import { readFile as readFile5, writeFile as writeFile6 } from "node:fs/promises";
|
|
8707
8818
|
import { join } from "node:path";
|
|
8708
8819
|
import colors10 from "picocolors";
|
|
8709
8820
|
import { gt } from "semver";
|
|
@@ -8753,12 +8864,12 @@ function box(message, {
|
|
|
8753
8864
|
|
|
8754
8865
|
// src/cli/common/xdg/lib.ts
|
|
8755
8866
|
import { homedir } from "node:os";
|
|
8756
|
-
import
|
|
8867
|
+
import path29 from "node:path";
|
|
8757
8868
|
function defineDirectoryWithFallback(xdgName, fallback) {
|
|
8758
8869
|
if (process.env[xdgName]) {
|
|
8759
8870
|
return process.env[xdgName];
|
|
8760
8871
|
} else {
|
|
8761
|
-
return
|
|
8872
|
+
return path29.join(homedir(), fallback);
|
|
8762
8873
|
}
|
|
8763
8874
|
}
|
|
8764
8875
|
var XDG_CONFIG_HOME = defineDirectoryWithFallback(
|
|
@@ -8773,15 +8884,15 @@ var XDG_STATE_HOME = defineDirectoryWithFallback(
|
|
|
8773
8884
|
"XDG_DATA_HOME",
|
|
8774
8885
|
".local/state"
|
|
8775
8886
|
);
|
|
8776
|
-
var ZUDOKU_XDG_CONFIG_HOME =
|
|
8887
|
+
var ZUDOKU_XDG_CONFIG_HOME = path29.join(
|
|
8777
8888
|
XDG_CONFIG_HOME,
|
|
8778
8889
|
CLI_XDG_FOLDER_NAME
|
|
8779
8890
|
);
|
|
8780
|
-
var ZUDOKU_XDG_DATA_HOME =
|
|
8891
|
+
var ZUDOKU_XDG_DATA_HOME = path29.join(
|
|
8781
8892
|
XDG_DATA_HOME,
|
|
8782
8893
|
CLI_XDG_FOLDER_NAME
|
|
8783
8894
|
);
|
|
8784
|
-
var ZUDOKU_XDG_STATE_HOME =
|
|
8895
|
+
var ZUDOKU_XDG_STATE_HOME = path29.join(
|
|
8785
8896
|
XDG_STATE_HOME,
|
|
8786
8897
|
CLI_XDG_FOLDER_NAME
|
|
8787
8898
|
);
|
|
@@ -8830,7 +8941,7 @@ async function getVersionCheckInfo() {
|
|
|
8830
8941
|
let versionCheckInfo;
|
|
8831
8942
|
if (existsSync2(versionCheckPath)) {
|
|
8832
8943
|
try {
|
|
8833
|
-
versionCheckInfo = await
|
|
8944
|
+
versionCheckInfo = await readFile5(versionCheckPath, "utf-8").then(
|
|
8834
8945
|
JSON.parse
|
|
8835
8946
|
);
|
|
8836
8947
|
} catch {
|
|
@@ -8935,7 +9046,7 @@ var cli = yargs(hideBin(process.argv)).option("zuplo", {
|
|
|
8935
9046
|
process.env.ZUPLO = "1";
|
|
8936
9047
|
printDiagnosticsToConsole("Running in Zuplo mode");
|
|
8937
9048
|
}
|
|
8938
|
-
}).middleware(warnPackageVersionMismatch).command(build_default).command(dev_default).command(preview_default).demandCommand().strictCommands().version(packageJson?.version).fail(false).help();
|
|
9049
|
+
}).middleware(warnPackageVersionMismatch).command(build_default).command(dev_default).command(deploy_default).command(preview_default).demandCommand().strictCommands().version(packageJson?.version).fail(false).help();
|
|
8939
9050
|
try {
|
|
8940
9051
|
void warnIfOutdatedVersion(packageJson?.version);
|
|
8941
9052
|
await cli.argv;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { DialogContent } from "@lukoweb/apitogo/ui/Dialog.js";
|
|
1
2
|
import type { DialogProps } from "@radix-ui/react-dialog";
|
|
2
3
|
import { Command as CommandPrimitive } from "cmdk";
|
|
3
4
|
import type { ComponentPropsWithoutRef } from "react";
|
|
4
5
|
import * as React from "react";
|
|
5
|
-
import { DialogContent } from "@lukoweb/apitogo/ui/Dialog.js";
|
|
6
6
|
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MDXComponents } from "mdx/types.js";
|
|
2
1
|
import { Alert } from "@lukoweb/apitogo/ui/Alert.js";
|
|
2
|
+
import type { MDXComponents } from "mdx/types.js";
|
|
3
3
|
import { Badge } from "../ui/Badge.js";
|
|
4
4
|
export type MdxComponentsType = Readonly<MDXComponents> | null | undefined;
|
|
5
5
|
export declare const MdxComponents: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lukoweb/apitogo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css",
|
|
@@ -254,6 +254,7 @@
|
|
|
254
254
|
"strip-ansi": "7.2.0",
|
|
255
255
|
"tailwind-merge": "3.5.0",
|
|
256
256
|
"tailwindcss": "4.2.1",
|
|
257
|
+
"tar": "7.5.10",
|
|
257
258
|
"tw-animate-css": "1.4.0",
|
|
258
259
|
"unified": "11.0.5",
|
|
259
260
|
"unist-util-visit": "5.1.0",
|