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