@prauga/flexdoc-backend 2.9.0 → 2.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/framework-adapters.d.ts +13 -0
  2. package/dist/framework-adapters.js +42 -9
  3. package/dist/framework-adapters.js.map +1 -1
  4. package/dist/framework-adapters.test.js +8 -0
  5. package/dist/framework-adapters.test.js.map +1 -1
  6. package/dist/hono-adapter.d.ts +3 -0
  7. package/dist/hono-adapter.js +65 -7
  8. package/dist/hono-adapter.js.map +1 -1
  9. package/dist/hono-adapter.test.js +20 -6
  10. package/dist/hono-adapter.test.js.map +1 -1
  11. package/dist/host-execution-route.d.ts +29 -0
  12. package/dist/host-execution-route.js +212 -0
  13. package/dist/host-execution-route.js.map +1 -0
  14. package/dist/host-execution-route.test.d.ts +1 -0
  15. package/dist/host-execution-route.test.js +290 -0
  16. package/dist/host-execution-route.test.js.map +1 -0
  17. package/dist/host-execution.d.ts +168 -0
  18. package/dist/host-execution.js +768 -0
  19. package/dist/host-execution.js.map +1 -0
  20. package/dist/index.d.ts +3 -1
  21. package/dist/index.js +9 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/interfaces.d.ts +31 -0
  24. package/dist/page-cache.d.ts +7 -0
  25. package/dist/page-cache.js +35 -0
  26. package/dist/page-cache.js.map +1 -0
  27. package/dist/page-cache.test.d.ts +1 -0
  28. package/dist/page-cache.test.js +43 -0
  29. package/dist/page-cache.test.js.map +1 -0
  30. package/dist/renderer/flexdoc.standalone.css +1 -1
  31. package/dist/renderer/flexdoc.standalone.js +69 -53
  32. package/dist/setup.js +46 -9
  33. package/dist/setup.js.map +1 -1
  34. package/dist/setup.test.js +30 -1
  35. package/dist/setup.test.js.map +1 -1
  36. package/dist/template.d.ts +1 -0
  37. package/dist/template.js +11 -1
  38. package/dist/template.js.map +1 -1
  39. package/dist/template.test.js +25 -0
  40. package/dist/template.test.js.map +1 -1
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +2 -2
@@ -0,0 +1,168 @@
1
+ import type { FlexDocHostExecutionCapability, FlexDocHostExecutionOptions, FlexDocHostExecutionPublicOptions } from './interfaces';
2
+ type HeaderEntry = [string, string];
3
+ type HostAuth = {
4
+ type?: 'none' | 'inherit';
5
+ } | {
6
+ type: 'bearer';
7
+ token?: string;
8
+ } | {
9
+ type: 'oauth2';
10
+ accessToken?: string;
11
+ } | {
12
+ type: 'basic';
13
+ username?: string;
14
+ password?: string;
15
+ } | {
16
+ type: 'apiKey';
17
+ key?: string;
18
+ value?: string;
19
+ in?: 'header' | 'query' | 'cookie';
20
+ } | {
21
+ type: 'digest';
22
+ username?: string;
23
+ password?: string;
24
+ } | {
25
+ type: 'hawk';
26
+ id?: string;
27
+ key?: string;
28
+ algorithm?: 'sha1' | 'sha256';
29
+ ext?: string;
30
+ } | {
31
+ type: 'ntlm';
32
+ username?: string;
33
+ password?: string;
34
+ domain?: string;
35
+ workstation?: string;
36
+ } | {
37
+ type: 'oauth1';
38
+ consumerKey?: string;
39
+ consumerSecret?: string;
40
+ token?: string;
41
+ tokenSecret?: string;
42
+ signatureMethod?: 'HMAC-SHA1' | 'HMAC-SHA256' | 'PLAINTEXT';
43
+ realm?: string;
44
+ } | {
45
+ type: 'awsv4';
46
+ accessKey?: string;
47
+ secretKey?: string;
48
+ sessionToken?: string;
49
+ region?: string;
50
+ service?: string;
51
+ };
52
+ export interface HostExecutionRequestDraft {
53
+ method?: string;
54
+ url?: string;
55
+ query?: Array<{
56
+ key?: string;
57
+ value?: string;
58
+ enabled?: boolean;
59
+ }>;
60
+ headers?: Array<{
61
+ key?: string;
62
+ value?: string;
63
+ enabled?: boolean;
64
+ }>;
65
+ body?: string;
66
+ contentType?: string;
67
+ bodyMode?: 'none' | 'raw' | 'json' | 'urlencoded' | 'formdata' | 'binary' | 'graphql';
68
+ urlencoded?: Array<{
69
+ key?: string;
70
+ value?: string;
71
+ enabled?: boolean;
72
+ }>;
73
+ formData?: Array<{
74
+ key?: string;
75
+ value?: string;
76
+ enabled?: boolean;
77
+ type?: 'text' | 'file';
78
+ fileName?: string;
79
+ contentType?: string;
80
+ }>;
81
+ binary?: {
82
+ fileName?: string;
83
+ contentType?: string;
84
+ };
85
+ graphql?: {
86
+ query?: string;
87
+ variables?: string;
88
+ };
89
+ auth?: HostAuth;
90
+ }
91
+ export interface HostExecutionEnvelope {
92
+ request: HostExecutionRequestDraft;
93
+ certificateId?: string;
94
+ cookieJar?: 'session';
95
+ timeoutMs?: number;
96
+ bodyBase64?: string;
97
+ }
98
+ export interface HostExecutionUploadedFile {
99
+ name: string;
100
+ contentType?: string;
101
+ data: Buffer;
102
+ }
103
+ export interface ParsedHostExecutionEnvelope extends HostExecutionEnvelope {
104
+ formDataFiles?: Map<number, HostExecutionUploadedFile>;
105
+ }
106
+ export interface HostExecutionResponse {
107
+ status: number;
108
+ statusText: string;
109
+ headers: HeaderEntry[];
110
+ body: string;
111
+ responseTime: number;
112
+ cookies?: Array<{
113
+ name: string;
114
+ value: string;
115
+ domain?: string;
116
+ path?: string;
117
+ httpOnly?: boolean;
118
+ }>;
119
+ error?: string;
120
+ }
121
+ interface CookieRecord {
122
+ name: string;
123
+ value: string;
124
+ domain: string;
125
+ path: string;
126
+ hostOnly: boolean;
127
+ secure: boolean;
128
+ httpOnly: boolean;
129
+ expiresAt?: number;
130
+ }
131
+ export declare class HostExecutionForbiddenError extends Error {
132
+ }
133
+ export declare class HostExecutionUnsupportedError extends Error {
134
+ }
135
+ export declare class HostExecutionBadRequestError extends Error {
136
+ }
137
+ export interface HostExecutionState {
138
+ enabled: boolean;
139
+ options: FlexDocHostExecutionOptions;
140
+ capabilities: FlexDocHostExecutionCapability[];
141
+ certificates: Map<string, {
142
+ id: string;
143
+ name: string;
144
+ cert: string;
145
+ key: string;
146
+ passphrase?: string;
147
+ }>;
148
+ sessionSecret: Buffer;
149
+ jars: Map<string, CookieRecord[]>;
150
+ }
151
+ export declare function createHostExecutionState(value: boolean | FlexDocHostExecutionOptions | undefined): HostExecutionState;
152
+ export declare function publicHostExecutionOptions(state: HostExecutionState, rendererBasePath: string): FlexDocHostExecutionPublicOptions | undefined;
153
+ export declare function ensureHostExecutionSession(state: HostExecutionState, cookieHeader?: string): {
154
+ sessionId: string;
155
+ setCookie?: string;
156
+ };
157
+ export declare function isCookieDomainAllowed(responseHostname: string, candidateDomain: string): boolean;
158
+ export declare function publicCookiesForSession(state: HostExecutionState, sessionId: string): HostExecutionResponse['cookies'];
159
+ export declare function clearCookiesForSession(state: HostExecutionState, sessionId: string): void;
160
+ export declare function allowedHostExecutionOrigins(state: HostExecutionState, spec: any, docsOrigin?: string): Set<string>;
161
+ export declare function assertHostExecutionUrlAllowed(url: URL, allowedOrigins: Set<string>): void;
162
+ export declare function assertHostExecutionResolvedAddressAllowed(address: string): void;
163
+ export declare function executeHostRequest(state: HostExecutionState, envelope: ParsedHostExecutionEnvelope, context: {
164
+ spec: any;
165
+ sessionId: string;
166
+ docsOrigin?: string;
167
+ }): Promise<HostExecutionResponse>;
168
+ export {};