boltdocs 2.8.4 → 2.9.0
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/bin/boltdocs.js +7 -6
- package/dist/{banner-DFACg5Dy.d.cts → banner-C_xkGxzI.d.cts} +1 -1
- package/dist/{banner-BLTQUA2O.d.ts → banner-D2NddBfF.d.ts} +1 -1
- package/dist/cache-C2PiGyg8.cjs +6 -0
- package/dist/cache-DFW4R3S0.mjs +6 -0
- package/dist/chunk-Ds5LZdWN.cjs +6 -0
- package/dist/client/index.cjs +464 -279
- package/dist/client/index.d.cts +74 -8
- package/dist/client/index.d.ts +74 -8
- package/dist/client/index.js +463 -280
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +4 -4
- package/dist/client/primitives.d.cts +1 -1
- package/dist/client/primitives.d.ts +1 -1
- package/dist/client/primitives.js +4 -4
- package/dist/client/theme/neutral.css +5 -3
- package/dist/client/theme/reset.css +19 -0
- package/dist/{docs-layout-CVCf3xkZ.cjs → docs-layout-3TpAt6MB.cjs} +302 -238
- package/dist/{docs-layout-BBv6wILp.js → docs-layout-6FQ8__ok.js} +303 -239
- package/dist/doctor-BY1tSmQd.mjs +34 -0
- package/dist/{doctor-DT4jh07O.cjs → doctor-Bknon8f5.cjs} +1 -1
- package/dist/doctor-DcFLi4t1.cjs +34 -0
- package/dist/{doctor-BGPdO1Ah.mjs → doctor-wsPTzt8Y.mjs} +1 -1
- package/dist/{generator-CC2yHzhZ.cjs → generator-BEIF6MOx.cjs} +2 -2
- package/dist/{generator-BHCrLU6h.mjs → generator-DILs0EFN.mjs} +1 -1
- package/dist/handler-B31cxNw0.mjs +6 -0
- package/dist/handler-DfhH9D1b.mjs +28 -0
- package/dist/handler-Djy0HfsI.cjs +28 -0
- package/dist/{icons-dev-C8sFxeBk.cjs → icons-dev-BryEFkJu.cjs} +90 -4
- package/dist/{icons-dev-CFcv5Nb8.js → icons-dev-kJyGWNeg.js} +73 -5
- package/dist/{image-DCMxxidi.cjs → image-B9YA_oQ_.cjs} +17 -9
- package/dist/{image-DufDOid8.js → image-CjYu9Eml.js} +17 -9
- package/dist/{mdx-Bto8CvGl.js → mdx-Cy_c2zio.js} +116 -33
- package/dist/{mdx-BH9kHiF9.cjs → mdx-WXjAMS8Y.cjs} +121 -32
- package/dist/{meta-loader-Cv9O0Pzl.cjs → meta-loader-D0V6oOQt.cjs} +1 -1
- package/dist/node/cli-entry.cjs +3 -3
- package/dist/node/cli-entry.mjs +3 -3
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +368 -24
- package/dist/node/index.d.mts +369 -24
- package/dist/node/index.mjs +1 -1
- package/dist/node/routes/worker.cjs +1 -1
- package/dist/node/routes/worker.mjs +1 -1
- package/dist/node-DV-EPtMU.mjs +160 -0
- package/dist/node-vOVNRABe.cjs +160 -0
- package/dist/{package-DlgexgpQ.mjs → package-BK_82QLX.mjs} +1 -1
- package/dist/{package-CwNjt3Sd.cjs → package-OxKE0p6j.cjs} +1 -1
- package/dist/{parser-B7-6PyQz.cjs → parser-C2Pw18LY.cjs} +1 -1
- package/dist/{parser-BzB-zCkF.cjs → parser-DJoEF96Y.cjs} +1 -1
- package/dist/{parser-9LqyiEnB.mjs → parser-DScG_PTs.mjs} +1 -1
- package/dist/routes--LYHSHT7.cjs +6 -0
- package/dist/routes-BAsfsn_e.mjs +6 -0
- package/dist/routes-C6Kr2HFN.cjs +6 -0
- package/dist/routes-CKgGAy8P.mjs +6 -0
- package/dist/{search-dialog-Cvux-qSk.cjs → search-dialog-BhXg05Ri.cjs} +1 -1
- package/dist/{search-dialog-CmHYOt18.cjs → search-dialog-BsAiQgnx.cjs} +2 -2
- package/dist/{search-dialog-jHZ21G4i.js → search-dialog-CaOO1Q4i.js} +2 -2
- package/dist/{search-dialog-Cr7SC8Xt.cjs → search-dialog-CzwvKoLW.cjs} +1 -1
- package/dist/{search-dialog-DBNaG5At.js → search-dialog-DRNJsxOv.js} +1 -1
- package/dist/{search-dialog-e86WPpck.js → search-dialog-DaR66wl0.js} +1 -1
- package/dist/shiki-adapter-CUtj-xKv.cjs +6 -0
- package/dist/shiki-adapter-EZptJAmW.mjs +6 -0
- package/dist/shiki-adapter-F-P-lDon.mjs +6 -0
- package/dist/shiki-adapter-PQBl32AN.cjs +6 -0
- package/dist/{sidebar-kQBonN82.d.ts → sidebar-BtJyWHy4.d.cts} +42 -5
- package/dist/{sidebar---RgTmZD.d.cts → sidebar-C4fuRYYS.d.ts} +42 -5
- package/dist/{utils-BYITg7T5.mjs → utils-DC4Wq-S2.mjs} +1 -1
- package/dist/{utils-Cjmx1hhk.cjs → utils-wHud9ny5.cjs} +1 -1
- package/dist/worker-pool-BS1LX67P.cjs +6 -0
- package/dist/worker-pool-DRv8ef4z.mjs +6 -0
- package/package.json +6 -3
- package/src/shared/types.ts +36 -3
- package/dist/cache-BMUyNiiA.mjs +0 -6
- package/dist/cache-CKm45d2w.cjs +0 -6
- package/dist/chunk-CU-zTemE.cjs +0 -6
- package/dist/doctor-Dnv77Lfx.mjs +0 -28
- package/dist/doctor-VBPlQf7d.cjs +0 -28
- package/dist/node-JM9bx0mO.cjs +0 -160
- package/dist/node-q-Y2mdLX.mjs +0 -160
- package/dist/routes-3sAccArX.cjs +0 -6
- package/dist/routes-DZpXqq1p.mjs +0 -6
- package/dist/routes-DjoxNeef.mjs +0 -6
- package/dist/routes-DpJnb2VS.cjs +0 -6
- package/dist/worker-pool-DXLyeHJg.cjs +0 -6
- package/dist/worker-pool-Kn4F9gDq.mjs +0 -6
- /package/dist/{meta-loader-DzwDFtdT.mjs → meta-loader-By22EnYa.mjs} +0 -0
package/dist/node/index.d.mts
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { InlineConfig, Plugin } from "vite";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { EXIT, SKIP } from "unist-util-visit";
|
|
5
|
+
import { VercelRequest, VercelResponse } from "@vercel/node";
|
|
6
|
+
import { HandlerEvent, HandlerResponse } from "@netlify/functions";
|
|
7
|
+
import { Writable } from "node:stream";
|
|
8
|
+
|
|
5
9
|
//#region src/shared/types.d.ts
|
|
6
10
|
/**
|
|
7
11
|
* Represents a single social link in the configuration.
|
|
@@ -194,15 +198,47 @@ interface BoltdocsAlgoliaConfig {
|
|
|
194
198
|
apiKey: string;
|
|
195
199
|
indexName: string;
|
|
196
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Configuration for Giscus comments.
|
|
203
|
+
*/
|
|
204
|
+
interface BoltdocsGiscusConfig {
|
|
205
|
+
repo: string;
|
|
206
|
+
repoId: string;
|
|
207
|
+
category?: string;
|
|
208
|
+
categoryId?: string;
|
|
209
|
+
mapping?: 'pathname' | 'url' | 'title' | 'og:title' | 'specific' | 'number';
|
|
210
|
+
strict?: '0' | '1' | boolean;
|
|
211
|
+
reactionsEnabled?: '0' | '1' | boolean;
|
|
212
|
+
emitMetadata?: '0' | '1' | boolean;
|
|
213
|
+
inputPosition?: 'top' | 'bottom';
|
|
214
|
+
theme?: string;
|
|
215
|
+
darkTheme?: string;
|
|
216
|
+
lang?: string;
|
|
217
|
+
loading?: 'lazy' | 'eager';
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Configuration for custom feedback system using GitHub Discussions API.
|
|
221
|
+
*/
|
|
222
|
+
interface BoltdocsCustomFeedbackConfig {
|
|
223
|
+
enabled: boolean;
|
|
224
|
+
owner: string;
|
|
225
|
+
repo: string;
|
|
226
|
+
categorySlug?: string;
|
|
227
|
+
endpoint?: string;
|
|
228
|
+
}
|
|
197
229
|
interface BoltdocsIntegrationsConfig {
|
|
198
230
|
ga4?: BoltdocsGA4Config;
|
|
199
231
|
gtm?: BoltdocsGTMConfig;
|
|
200
232
|
algolia?: BoltdocsAlgoliaConfig;
|
|
233
|
+
feedback?: {
|
|
234
|
+
giscus?: BoltdocsGiscusConfig;
|
|
235
|
+
custom?: BoltdocsCustomFeedbackConfig;
|
|
236
|
+
};
|
|
201
237
|
}
|
|
202
238
|
/**
|
|
203
239
|
* The root configuration object for Boltdocs.
|
|
204
240
|
*/
|
|
205
|
-
interface BoltdocsConfig {
|
|
241
|
+
interface BoltdocsConfig$1 {
|
|
206
242
|
siteUrl?: string;
|
|
207
243
|
docsDir?: string;
|
|
208
244
|
base?: string;
|
|
@@ -215,9 +251,8 @@ interface BoltdocsConfig {
|
|
|
215
251
|
security?: BoltdocsSecurityConfig;
|
|
216
252
|
seo?: BoltdocsSeoConfig;
|
|
217
253
|
integrations?: BoltdocsIntegrationsConfig;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
vite?: any;
|
|
254
|
+
directoryMeta?: Record<string, unknown>;
|
|
255
|
+
vite?: unknown;
|
|
221
256
|
}
|
|
222
257
|
/**
|
|
223
258
|
* Global namespace for Boltdocs types that can be augmented by generated code.
|
|
@@ -249,7 +284,7 @@ type BoltdocsRoutePathWithFallback = BoltdocsRoutePath extends never ? string :
|
|
|
249
284
|
*
|
|
250
285
|
* @param config - The Boltdocs configuration object
|
|
251
286
|
*/
|
|
252
|
-
declare function defineConfig(config: BoltdocsConfig): BoltdocsConfig;
|
|
287
|
+
declare function defineConfig(config: BoltdocsConfig$1): BoltdocsConfig$1;
|
|
253
288
|
//#endregion
|
|
254
289
|
//#region src/node/config.d.ts
|
|
255
290
|
/**
|
|
@@ -260,7 +295,7 @@ declare function defineConfig(config: BoltdocsConfig): BoltdocsConfig;
|
|
|
260
295
|
* @param root - The project root directory (defaults to process.cwd())
|
|
261
296
|
* @returns The merged configuration object
|
|
262
297
|
*/
|
|
263
|
-
declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig>;
|
|
298
|
+
declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig$1>;
|
|
264
299
|
//#endregion
|
|
265
300
|
//#region src/node/plugin/types.d.ts
|
|
266
301
|
/**
|
|
@@ -280,7 +315,7 @@ interface BoltdocsPluginOptions {
|
|
|
280
315
|
* @param config - The resolved Boltdocs configuration containing custom plugins and components
|
|
281
316
|
* @returns A string of JavaScript code to be evaluated by the browser
|
|
282
317
|
*/
|
|
283
|
-
declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig): string;
|
|
318
|
+
declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig$1): string;
|
|
284
319
|
//#endregion
|
|
285
320
|
//#region src/node/routes/types.d.ts
|
|
286
321
|
/**
|
|
@@ -364,27 +399,29 @@ interface RouteMeta {
|
|
|
364
399
|
slugParts?: string[];
|
|
365
400
|
}
|
|
366
401
|
//#endregion
|
|
367
|
-
//#region src/node/
|
|
402
|
+
//#region src/node/cache.d.ts
|
|
368
403
|
/**
|
|
369
|
-
*
|
|
370
|
-
* Ensures consistent path handling across different operating systems.
|
|
371
|
-
*
|
|
372
|
-
* @param p - The file path to normalize
|
|
373
|
-
* @returns The normalized path using forward slashes
|
|
404
|
+
* Specialized cache for processed assets (e.g., optimized images).
|
|
374
405
|
*/
|
|
375
|
-
declare
|
|
406
|
+
declare class AssetCache {
|
|
407
|
+
private readonly assetsDir;
|
|
408
|
+
private hashMap;
|
|
409
|
+
constructor(root?: string);
|
|
410
|
+
getFileHash(filePath: string): Promise<string>;
|
|
411
|
+
get(sourcePath: string, cacheKey: string): Promise<string | null>;
|
|
412
|
+
set(sourcePath: string, cacheKey: string, content: Buffer | string, sourceHash: string): void;
|
|
413
|
+
private getCachedPath;
|
|
414
|
+
clear(): void;
|
|
415
|
+
flush(): Promise<void>;
|
|
416
|
+
}
|
|
376
417
|
/**
|
|
377
|
-
*
|
|
378
|
-
* Prevents multiple dots to avoid path traversal tricks.
|
|
379
|
-
*
|
|
380
|
-
* @param name - The name to sanitize
|
|
381
|
-
* @returns The sanitized name
|
|
418
|
+
* Flushes all pending background cache operations.
|
|
382
419
|
*/
|
|
383
|
-
declare function
|
|
420
|
+
declare function flushCache(): Promise<void>;
|
|
384
421
|
//#endregion
|
|
385
422
|
//#region src/node/plugins/plugin-types.d.ts
|
|
386
423
|
interface PluginContext {
|
|
387
|
-
readonly config: BoltdocsConfig;
|
|
424
|
+
readonly config: BoltdocsConfig$1;
|
|
388
425
|
readonly logger: PluginLogger;
|
|
389
426
|
readonly store: PluginStore;
|
|
390
427
|
readonly meta: PluginMeta;
|
|
@@ -413,6 +450,14 @@ interface PluginLifecycleHooks {
|
|
|
413
450
|
beforeDev?: (ctx: PluginContext) => Promise<void> | void;
|
|
414
451
|
afterDev?: (ctx: PluginContext) => Promise<void> | void;
|
|
415
452
|
buildEnd?: (ctx: PluginContext) => Promise<void> | void;
|
|
453
|
+
transformSource?: (ctx: PluginContext, params: {
|
|
454
|
+
code: string;
|
|
455
|
+
filePath: string;
|
|
456
|
+
}) => Promise<{
|
|
457
|
+
code: string;
|
|
458
|
+
}> | {
|
|
459
|
+
code: string;
|
|
460
|
+
};
|
|
416
461
|
transformMdx?: (ctx: PluginContext, params: {
|
|
417
462
|
code: string;
|
|
418
463
|
filePath: string;
|
|
@@ -494,7 +539,7 @@ declare class PluginLifecycleManager {
|
|
|
494
539
|
private store;
|
|
495
540
|
private docsDir;
|
|
496
541
|
private rootDir;
|
|
497
|
-
constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig, docsDir?: string, rootDir?: string);
|
|
542
|
+
constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig$1, docsDir?: string, rootDir?: string);
|
|
498
543
|
runHook(hookName: keyof PluginLifecycleHooks, ...args: unknown[]): Promise<void>;
|
|
499
544
|
runChain<TParams>(hookName: keyof PluginLifecycleHooks, initialParams: TParams): Promise<TParams>;
|
|
500
545
|
private getSortedPlugins;
|
|
@@ -686,12 +731,312 @@ declare const MDX_NODES: {
|
|
|
686
731
|
//#region src/node/plugins/index.d.ts
|
|
687
732
|
declare function createPlugin(plugin: SecureBoltdocsPlugin): SecureBoltdocsPlugin;
|
|
688
733
|
//#endregion
|
|
734
|
+
//#region src/node/feedback/adapters/vercel.d.ts
|
|
735
|
+
declare function handleVercelFeedback(req: VercelRequest, res: VercelResponse): Promise<VercelResponse | undefined>;
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/node/feedback/adapters/netlify.d.ts
|
|
738
|
+
declare function handleNetlifyFeedback(event: HandlerEvent, env?: Record<string, string | undefined>): Promise<HandlerResponse>;
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/node/feedback/adapters/web.d.ts
|
|
741
|
+
declare function handleWebFeedback(request: Request, env?: Record<string, string | undefined>): Promise<Response>;
|
|
742
|
+
//#endregion
|
|
743
|
+
//#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/common/api-gateway.d.ts
|
|
744
|
+
// Default authorizer type, prefer using a specific type with the "...WithAuthorizer..." variant types.
|
|
745
|
+
// Note that this doesn't have to be a context from a custom lambda outhorizer, AWS also has a cognito
|
|
746
|
+
// authorizer type and could add more, so the property won't always be a string.
|
|
747
|
+
type APIGatewayEventDefaultAuthorizerContext = undefined | null | {
|
|
748
|
+
[name: string]: any;
|
|
749
|
+
};
|
|
750
|
+
// The requestContext property of both request authorizer and proxy integration events.
|
|
751
|
+
interface APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext> {
|
|
752
|
+
accountId: string;
|
|
753
|
+
apiId: string; // This one is a bit confusing: it is not actually present in authorizer calls
|
|
754
|
+
// and proxy calls without an authorizer. We model this by allowing undefined in the type,
|
|
755
|
+
// since it ends up the same and avoids breaking users that are testing the property.
|
|
756
|
+
// This lets us allow parameterizing the authorizer for proxy events that know what authorizer
|
|
757
|
+
// context values they have.
|
|
758
|
+
authorizer: TAuthorizerContext;
|
|
759
|
+
connectedAt?: number | undefined;
|
|
760
|
+
connectionId?: string | undefined;
|
|
761
|
+
domainName?: string | undefined;
|
|
762
|
+
domainPrefix?: string | undefined;
|
|
763
|
+
eventType?: string | undefined;
|
|
764
|
+
extendedRequestId?: string | undefined;
|
|
765
|
+
protocol: string;
|
|
766
|
+
httpMethod: string;
|
|
767
|
+
identity: APIGatewayEventIdentity;
|
|
768
|
+
messageDirection?: string | undefined;
|
|
769
|
+
messageId?: string | null | undefined;
|
|
770
|
+
path: string;
|
|
771
|
+
stage: string;
|
|
772
|
+
requestId: string;
|
|
773
|
+
requestTime?: string | undefined;
|
|
774
|
+
requestTimeEpoch: number;
|
|
775
|
+
resourceId: string;
|
|
776
|
+
resourcePath: string;
|
|
777
|
+
routeKey?: string | undefined;
|
|
778
|
+
}
|
|
779
|
+
interface APIGatewayEventClientCertificate {
|
|
780
|
+
clientCertPem: string;
|
|
781
|
+
serialNumber: string;
|
|
782
|
+
subjectDN: string;
|
|
783
|
+
issuerDN: string;
|
|
784
|
+
validity: {
|
|
785
|
+
notAfter: string;
|
|
786
|
+
notBefore: string;
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
interface APIGatewayEventIdentity {
|
|
790
|
+
accessKey: string | null;
|
|
791
|
+
accountId: string | null;
|
|
792
|
+
apiKey: string | null;
|
|
793
|
+
apiKeyId: string | null;
|
|
794
|
+
caller: string | null;
|
|
795
|
+
clientCert: APIGatewayEventClientCertificate | null;
|
|
796
|
+
cognitoAuthenticationProvider: string | null;
|
|
797
|
+
cognitoAuthenticationType: string | null;
|
|
798
|
+
cognitoIdentityId: string | null;
|
|
799
|
+
cognitoIdentityPoolId: string | null;
|
|
800
|
+
principalOrgId: string | null;
|
|
801
|
+
sourceIp: string;
|
|
802
|
+
user: string | null;
|
|
803
|
+
userAgent: string | null;
|
|
804
|
+
userArn: string | null;
|
|
805
|
+
vpcId?: string | undefined;
|
|
806
|
+
vpceId?: string | undefined;
|
|
807
|
+
}
|
|
808
|
+
//#endregion
|
|
809
|
+
//#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/handler.d.ts
|
|
810
|
+
/**
|
|
811
|
+
* {@link Handler} context parameter.
|
|
812
|
+
* See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}.
|
|
813
|
+
*/
|
|
814
|
+
interface Context {
|
|
815
|
+
callbackWaitsForEmptyEventLoop: boolean;
|
|
816
|
+
functionName: string;
|
|
817
|
+
functionVersion: string;
|
|
818
|
+
invokedFunctionArn: string;
|
|
819
|
+
memoryLimitInMB: string;
|
|
820
|
+
awsRequestId: string;
|
|
821
|
+
logGroupName: string;
|
|
822
|
+
logStreamName: string;
|
|
823
|
+
identity?: CognitoIdentity | undefined;
|
|
824
|
+
clientContext?: ClientContext | undefined;
|
|
825
|
+
tenantId?: string | undefined;
|
|
826
|
+
getRemainingTimeInMillis(): number; // Functions for compatibility with earlier Node.js Runtime v0.10.42
|
|
827
|
+
// No longer documented, so they are deprecated, but they still work
|
|
828
|
+
// as of the 12.x runtime, so they are not removed from the types.
|
|
829
|
+
/** @deprecated Use handler callback or promise result */
|
|
830
|
+
done(error?: Error, result?: any): void;
|
|
831
|
+
/** @deprecated Use handler callback with first argument or reject a promise result */
|
|
832
|
+
fail(error: Error | string): void;
|
|
833
|
+
/** @deprecated Use handler callback with second argument or resolve a promise result */
|
|
834
|
+
succeed(messageOrObject: any): void; // Unclear what behavior this is supposed to have, I couldn't find any still extant reference,
|
|
835
|
+
// and it behaves like the above, ignoring the object parameter.
|
|
836
|
+
/** @deprecated Use handler callback or promise result */
|
|
837
|
+
succeed(message: string, object: any): void;
|
|
838
|
+
}
|
|
839
|
+
interface CognitoIdentity {
|
|
840
|
+
cognitoIdentityId: string;
|
|
841
|
+
cognitoIdentityPoolId: string;
|
|
842
|
+
}
|
|
843
|
+
interface ClientContext {
|
|
844
|
+
client: ClientContextClient;
|
|
845
|
+
custom?: any;
|
|
846
|
+
env: ClientContextEnv;
|
|
847
|
+
}
|
|
848
|
+
interface ClientContextClient {
|
|
849
|
+
installationId: string;
|
|
850
|
+
appTitle: string;
|
|
851
|
+
appVersionName: string;
|
|
852
|
+
appVersionCode: string;
|
|
853
|
+
appPackageName: string;
|
|
854
|
+
}
|
|
855
|
+
interface ClientContextEnv {
|
|
856
|
+
platformVersion: string;
|
|
857
|
+
platform: string;
|
|
858
|
+
make: string;
|
|
859
|
+
model: string;
|
|
860
|
+
locale: string;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Interface for using response streaming from AWS Lambda.
|
|
864
|
+
* To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
|
|
865
|
+
*
|
|
866
|
+
* The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
|
|
867
|
+
* The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
|
|
868
|
+
*
|
|
869
|
+
* {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
|
|
870
|
+
* {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
|
|
871
|
+
*
|
|
872
|
+
* @example <caption>Writing to the response stream</caption>
|
|
873
|
+
* import 'aws-lambda';
|
|
874
|
+
*
|
|
875
|
+
* export const handler = awslambda.streamifyResponse(
|
|
876
|
+
* async (event, responseStream, context) => {
|
|
877
|
+
* responseStream.setContentType("text/plain");
|
|
878
|
+
* responseStream.write("Hello, world!");
|
|
879
|
+
* responseStream.end();
|
|
880
|
+
* }
|
|
881
|
+
* );
|
|
882
|
+
*
|
|
883
|
+
* @example <caption>Using pipeline</caption>
|
|
884
|
+
* import 'aws-lambda';
|
|
885
|
+
* import { Readable } from 'stream';
|
|
886
|
+
* import { pipeline } from 'stream/promises';
|
|
887
|
+
* import zlib from 'zlib';
|
|
888
|
+
*
|
|
889
|
+
* export const handler = awslambda.streamifyResponse(
|
|
890
|
+
* async (event, responseStream, context) => {
|
|
891
|
+
* // As an example, convert event to a readable stream.
|
|
892
|
+
* const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
|
|
893
|
+
*
|
|
894
|
+
* await pipeline(requestStream, zlib.createGzip(), responseStream);
|
|
895
|
+
* }
|
|
896
|
+
* );
|
|
897
|
+
*/
|
|
898
|
+
type StreamifyHandler<TEvent = any, TResult = any> = (event: TEvent, responseStream: awslambda.HttpResponseStream, context: Context) => TResult | Promise<TResult>;
|
|
899
|
+
declare global {
|
|
900
|
+
namespace awslambda {
|
|
901
|
+
class HttpResponseStream extends Writable {
|
|
902
|
+
static from(writable: Writable, metadata: Record<string, unknown>): HttpResponseStream;
|
|
903
|
+
setContentType: (contentType: string) => void;
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Decorator for using response streaming from AWS Lambda.
|
|
907
|
+
* To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
|
|
908
|
+
*
|
|
909
|
+
* The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
|
|
910
|
+
* The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
|
|
911
|
+
*
|
|
912
|
+
* {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
|
|
913
|
+
* {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
|
|
914
|
+
*
|
|
915
|
+
* @example <caption>Writing to the response stream</caption>
|
|
916
|
+
* import 'aws-lambda';
|
|
917
|
+
*
|
|
918
|
+
* export const handler = awslambda.streamifyResponse(
|
|
919
|
+
* async (event, responseStream, context) => {
|
|
920
|
+
* responseStream.setContentType("text/plain");
|
|
921
|
+
* responseStream.write("Hello, world!");
|
|
922
|
+
* responseStream.end();
|
|
923
|
+
* }
|
|
924
|
+
* );
|
|
925
|
+
*
|
|
926
|
+
* @example <caption>Using pipeline</caption>
|
|
927
|
+
* import 'aws-lambda';
|
|
928
|
+
* import { Readable } from 'stream';
|
|
929
|
+
* import { pipeline } from 'stream/promises';
|
|
930
|
+
* import zlib from 'zlib';
|
|
931
|
+
*
|
|
932
|
+
* export const handler = awslambda.streamifyResponse(
|
|
933
|
+
* async (event, responseStream, context) => {
|
|
934
|
+
* // As an example, convert event to a readable stream.
|
|
935
|
+
* const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
|
|
936
|
+
*
|
|
937
|
+
* await pipeline(requestStream, zlib.createGzip(), responseStream);
|
|
938
|
+
* }
|
|
939
|
+
* );
|
|
940
|
+
*/
|
|
941
|
+
function streamifyResponse<TEvent = any, TResult = void>(handler: StreamifyHandler<TEvent, TResult>): StreamifyHandler<TEvent, TResult>;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
//#endregion
|
|
945
|
+
//#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts
|
|
946
|
+
/**
|
|
947
|
+
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
|
|
948
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
949
|
+
*/
|
|
950
|
+
type APIGatewayProxyEvent = APIGatewayProxyEventBase<APIGatewayEventDefaultAuthorizerContext>;
|
|
951
|
+
interface APIGatewayProxyEventHeaders {
|
|
952
|
+
[name: string]: string | undefined;
|
|
953
|
+
}
|
|
954
|
+
interface APIGatewayProxyEventMultiValueHeaders {
|
|
955
|
+
[name: string]: string[] | undefined;
|
|
956
|
+
}
|
|
957
|
+
interface APIGatewayProxyEventPathParameters {
|
|
958
|
+
[name: string]: string | undefined;
|
|
959
|
+
}
|
|
960
|
+
interface APIGatewayProxyEventQueryStringParameters {
|
|
961
|
+
[name: string]: string | undefined;
|
|
962
|
+
}
|
|
963
|
+
interface APIGatewayProxyEventMultiValueQueryStringParameters {
|
|
964
|
+
[name: string]: string[] | undefined;
|
|
965
|
+
}
|
|
966
|
+
interface APIGatewayProxyEventStageVariables {
|
|
967
|
+
[name: string]: string | undefined;
|
|
968
|
+
}
|
|
969
|
+
interface APIGatewayProxyEventBase<TAuthorizerContext> {
|
|
970
|
+
body: string | null;
|
|
971
|
+
headers: APIGatewayProxyEventHeaders;
|
|
972
|
+
multiValueHeaders: APIGatewayProxyEventMultiValueHeaders;
|
|
973
|
+
httpMethod: string;
|
|
974
|
+
isBase64Encoded: boolean;
|
|
975
|
+
path: string;
|
|
976
|
+
pathParameters: APIGatewayProxyEventPathParameters | null;
|
|
977
|
+
queryStringParameters: APIGatewayProxyEventQueryStringParameters | null;
|
|
978
|
+
multiValueQueryStringParameters: APIGatewayProxyEventMultiValueQueryStringParameters | null;
|
|
979
|
+
stageVariables: APIGatewayProxyEventStageVariables | null;
|
|
980
|
+
requestContext: APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext>;
|
|
981
|
+
resource: string;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
|
|
985
|
+
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
986
|
+
*/
|
|
987
|
+
interface APIGatewayProxyResult {
|
|
988
|
+
statusCode: number;
|
|
989
|
+
headers?: {
|
|
990
|
+
[header: string]: boolean | number | string;
|
|
991
|
+
} | undefined;
|
|
992
|
+
multiValueHeaders?: {
|
|
993
|
+
[header: string]: Array<boolean | number | string>;
|
|
994
|
+
} | undefined;
|
|
995
|
+
body: string;
|
|
996
|
+
isBase64Encoded?: boolean | undefined;
|
|
997
|
+
}
|
|
998
|
+
//#endregion
|
|
999
|
+
//#region src/node/feedback/adapters/aws.d.ts
|
|
1000
|
+
declare function handleAwsFeedback(event: APIGatewayProxyEvent, env?: Record<string, string | undefined>): Promise<APIGatewayProxyResult>;
|
|
1001
|
+
//#endregion
|
|
1002
|
+
//#region src/node/feedback/handler.d.ts
|
|
1003
|
+
interface FeedbackHandlerOptions {
|
|
1004
|
+
owner?: string;
|
|
1005
|
+
repo?: string;
|
|
1006
|
+
categorySlug?: string;
|
|
1007
|
+
token?: string;
|
|
1008
|
+
appId?: string;
|
|
1009
|
+
privateKey?: string;
|
|
1010
|
+
installationId?: string;
|
|
1011
|
+
}
|
|
1012
|
+
declare function handleFeedback(payload: unknown, env?: Record<string, string | undefined>, options?: FeedbackHandlerOptions): Promise<{
|
|
1013
|
+
success: boolean;
|
|
1014
|
+
}>;
|
|
1015
|
+
//#endregion
|
|
1016
|
+
//#region src/node/utils.d.ts
|
|
1017
|
+
/**
|
|
1018
|
+
* Normalizes a file path by replacing Windows backslashes with forward slashes.
|
|
1019
|
+
* Ensures consistent path handling across different operating systems.
|
|
1020
|
+
*
|
|
1021
|
+
* @param p - The file path to normalize
|
|
1022
|
+
* @returns The normalized path using forward slashes
|
|
1023
|
+
*/
|
|
1024
|
+
declare function normalizePath(p: string): string;
|
|
1025
|
+
/**
|
|
1026
|
+
* Sanitizes a filename or path component by removing dangerous characters.
|
|
1027
|
+
* Prevents multiple dots to avoid path traversal tricks.
|
|
1028
|
+
*
|
|
1029
|
+
* @param name - The name to sanitize
|
|
1030
|
+
* @returns The sanitized name
|
|
1031
|
+
*/
|
|
1032
|
+
declare function sanitizeFilename(name: string): string;
|
|
1033
|
+
//#endregion
|
|
689
1034
|
//#region src/node/index.d.ts
|
|
690
1035
|
declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
|
|
691
1036
|
/**
|
|
692
1037
|
* Generates the complete Vite configuration for a Boltdocs project.
|
|
693
1038
|
* This is used by the Boltdocs CLI to run Vite without a user-defined vite.config.ts.
|
|
694
1039
|
*/
|
|
695
|
-
declare function createViteConfig(root: string, mode?: 'development' | 'production'): Promise<InlineConfig>;
|
|
1040
|
+
declare function createViteConfig(root: string, mode?: 'development' | 'production', preResolvedConfig?: BoltdocsConfig): Promise<InlineConfig>;
|
|
696
1041
|
//#endregion
|
|
697
|
-
export { type BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, EXIT, MDX_NODES, NodeWithHProperties, PluginCompatibilityError, PluginContext, PluginError, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, type RouteMeta, SKIP, SecureBoltdocsPlugin, addNodeClass, createMdxAttribute, createMdxElement, createPlugin, createRehypeElement, createViteConfig, boltdocs as default, defineConfig, generateEntryCode, getNodeProperty, hasNodeClass, normalizePath, parseMetaString, removeNodeClass, resolveConfig, sanitizeFilename, setNodeProperty, validatePlugins, visitMdxElements, visitNodes, visitRehypeElements, visitRemarkHeadings, visitRemarkLinks };
|
|
1042
|
+
export { AssetCache, type BoltdocsConfig$1 as BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, EXIT, MDX_NODES, NodeWithHProperties, PluginCompatibilityError, PluginContext, PluginError, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, type RouteMeta, SKIP, SecureBoltdocsPlugin, addNodeClass, createMdxAttribute, createMdxElement, createPlugin, createRehypeElement, createViteConfig, boltdocs as default, defineConfig, flushCache, generateEntryCode, getNodeProperty, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, hasNodeClass, normalizePath, parseMetaString, removeNodeClass, resolveConfig, sanitizeFilename, setNodeProperty, validatePlugins, visitMdxElements, visitNodes, visitRehypeElements, visitRemarkHeadings, visitRemarkLinks };
|
package/dist/node/index.mjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{A as e,
|
|
6
|
+
import{A as e,C as t,D as n,M as r,O as i,S as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,j as h,k as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"../node-DV-EPtMU.mjs";import{f as A,u as j}from"../utils-DC4Wq-S2.mjs";import{a as M,n as N}from"../cache-DFW4R3S0.mjs";import{g as P,h as F}from"../doctor-BY1tSmQd.mjs";import{o as I,r as L}from"../shiki-adapter-F-P-lDon.mjs";import{t as R}from"../handler-DfhH9D1b.mjs";export{N as AssetCache,i as BoltdocsPluginStore,_ as EXIT,I as MDX_NODES,g as PluginCompatibilityError,e as PluginError,h as PluginHookError,D as PluginLifecycleManager,r as PluginValidationError,T as SKIP,u as addNodeClass,d as createMdxAttribute,x as createMdxElement,l as createPlugin,v as createRehypeElement,y as createViteConfig,w as default,P as defineConfig,M as flushCache,C as generateEntryCode,p as getNodeProperty,S as handleAwsFeedback,R as handleFeedback,s as handleNetlifyFeedback,b as handleVercelFeedback,m as handleWebFeedback,f as hasNodeClass,j as normalizePath,L as parseMetaString,o as removeNodeClass,F as resolveConfig,A as sanitizeFilename,E as setNodeProperty,n as validatePlugins,k as visitMdxElements,c as visitNodes,O as visitRehypeElements,a as visitRemarkHeadings,t as visitRemarkLinks};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
require(`../../chunk-
|
|
6
|
+
require(`../../chunk-Ds5LZdWN.cjs`);const e=require(`../../parser-C2Pw18LY.cjs`);let t=require(`node:worker_threads`);if(!t.parentPort)throw Error(`This file must be run as a worker thread.`);t.parentPort.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e.t(n.file,n.docsDir,n.basePath,n.config);t.parentPort?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t.parentPort?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{n as e}from"../../parser-
|
|
6
|
+
import{n as e}from"../../parser-DScG_PTs.mjs";import{parentPort as t}from"node:worker_threads";if(!t)throw Error(`This file must be run as a worker thread.`);t.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e(n.file,n.docsDir,n.basePath,n.config);t?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});export{};
|