@hey-api/openapi-ts 0.86.12 → 0.87.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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as StringCase, B as FunctionTypeParameter, C as PluginHandler, D as Client$3, E as Client$4, F as ImportExportItemObject, H as SyntaxKindKeyword, I as Modifier, L as tsNodeToString, M as LazyOrAsync, N as MaybeArray, O as Client$1, P as Comments, R as AccessLevel, S as Client$2, T as Client$5, U as types_d_exports, V as ObjectValue, _ as OpenApiSchemaObject, b as Client$7, d as OpenApi, f as OpenApiMetaObject, g as OpenApiResponseObject, h as OpenApiRequestBodyObject, i as UserConfig, j as IR, k as Client, l as Context, m as OpenApiParameterObject, o as DefinePlugin, p as OpenApiOperationObject, s as Plugin, t as LegacyIR, u as Logger, v as TypeTransformer, w as Client$6, x as Operation, y as ExpressionTransformer, z as FunctionParameter } from "./types-BRmx9r9T.js";
1
+ import { C as Client$1, D as LazyOrAsync, E as IR, O as MaybeArray, S as Client$3, T as StringCase, _ as Client$2, a as Plugin, b as Client$5, c as OpenApiOperationObject, d as OpenApiResponseObject, f as OpenApiSchemaObject, g as ExpressionTransformer, h as TypeTransformer, i as DefinePlugin, l as OpenApiParameterObject, m as Logger, n as UserConfig, o as OpenApi, p as Context, s as OpenApiMetaObject, u as OpenApiRequestBodyObject, v as PluginHandler, w as Client, x as Client$4, y as Client$6 } from "./config-oAoGatJ7.js";
2
2
  import "@hey-api/codegen-core";
3
3
  import * as typescript0 from "typescript";
4
4
  import ts from "typescript";
@@ -10,7 +10,7 @@ import ts from "typescript";
10
10
  *
11
11
  * @param userConfig User provided {@link UserConfig} configuration(s).
12
12
  */
13
- declare const createClient: (userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, logger?: Logger) => Promise<ReadonlyArray<Client$7 | Context>>;
13
+ declare const createClient: (userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, logger?: Logger) => Promise<ReadonlyArray<Context>>;
14
14
  //#endregion
15
15
  //#region src/config/parser.d.ts
16
16
  declare const defaultPaginationKeywords: readonly ["after", "before", "cursor", "offset", "page", "start"];
@@ -47,6 +47,435 @@ declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin
47
47
  */
48
48
  name: any;
49
49
  };
50
+ declare namespace types_d_exports {
51
+ export { AccessLevel, FunctionParameter, FunctionTypeParameter, ObjectValue, SyntaxKindKeyword, createAnonymousFunction, createArrayLiteralExpression, createArrowFunction, createAsExpression, createAssignment, createAwaitExpression, createBlock, createConditionalExpression, createEnumDeclaration, createForOfStatement, createFunctionTypeNode, createGetAccessorDeclaration, createIndexedAccessTypeNode, createKeywordTypeNode, createLiteralTypeNode, createMappedTypeNode, createNamespaceDeclaration, createNewExpression, createNull, createObjectType, createParameterDeclaration, createPropertyAccessChain, createPropertyAccessExpression, createPropertyAssignment, createRegularExpressionLiteral, createStringLiteral, createTemplateLiteralType, createTypeAliasDeclaration, createTypeNode, createTypeOfExpression, createTypeOperatorNode, createTypeParameterDeclaration, createTypeParenthesizedNode, createTypeReferenceNode, syntaxKindKeyword, toExpression, toParameterDeclarations, toTypeParameters };
52
+ }
53
+ type AccessLevel = 'private' | 'protected' | 'public';
54
+ type FunctionParameter = {
55
+ accessLevel?: AccessLevel;
56
+ default?: any;
57
+ isReadOnly?: boolean;
58
+ isRequired?: boolean;
59
+ name: string;
60
+ type?: any | ts.TypeNode;
61
+ } | {
62
+ destructure: ReadonlyArray<FunctionParameter>;
63
+ type?: any | ts.TypeNode;
64
+ };
65
+ interface FunctionTypeParameter {
66
+ default?: any;
67
+ extends?: string | ts.TypeNode;
68
+ name: string | ts.Identifier;
69
+ }
70
+ declare const createTypeNode: (base: any | ts.TypeNode, args?: (any | ts.TypeNode)[]) => ts.TypeNode;
71
+ declare const createPropertyAccessChain: ({
72
+ expression,
73
+ name
74
+ }: {
75
+ expression: ts.Expression;
76
+ name: string | ts.MemberName;
77
+ }) => ts.PropertyAccessChain;
78
+ declare const createPropertyAccessExpression: ({
79
+ expression,
80
+ isOptional,
81
+ name
82
+ }: {
83
+ expression: string | ts.Expression;
84
+ isOptional?: boolean;
85
+ name: string | number | ts.MemberName;
86
+ }) => ts.PropertyAccessChain | ts.PropertyAccessExpression | ts.ElementAccessExpression;
87
+ declare const createNull: () => ts.NullLiteral;
88
+ /**
89
+ * Convert an unknown value to an expression.
90
+ * @param identifiers - list of keys that are treated as identifiers.
91
+ * @param shorthand - if shorthand syntax is allowed.
92
+ * @param unescape - if string should be unescaped.
93
+ * @param value - the unknown value.
94
+ * @returns ts.Expression
95
+ */
96
+ declare const toExpression: <T = unknown>({
97
+ identifiers,
98
+ isValueAccess,
99
+ shorthand,
100
+ unescape,
101
+ value
102
+ }: {
103
+ identifiers?: string[];
104
+ isValueAccess?: boolean;
105
+ shorthand?: boolean;
106
+ unescape?: boolean;
107
+ value: T;
108
+ }) => ts.Expression | undefined;
109
+ /**
110
+ * Convert parameters to the declaration array expected by TypeScript
111
+ * Compiler API.
112
+ * @param parameters - the parameters to convert to declarations
113
+ * @returns ts.ParameterDeclaration[]
114
+ */
115
+ declare const toParameterDeclarations: (parameters: ReadonlyArray<FunctionParameter>) => ts.ParameterDeclaration[];
116
+ type SyntaxKindKeyword = 'any' | 'async' | 'boolean' | 'export' | 'never' | 'number' | 'private' | 'protected' | 'public' | 'readonly' | 'static' | 'string' | 'undefined' | 'unknown' | 'void';
117
+ declare const syntaxKindKeyword: <T extends SyntaxKindKeyword>({
118
+ keyword
119
+ }: {
120
+ keyword: T;
121
+ }) => T extends "protected" ? ts.SyntaxKind.ProtectedKeyword : T extends "public" ? ts.SyntaxKind.PublicKeyword : T extends "private" ? ts.SyntaxKind.PrivateKeyword : T extends "export" ? ts.SyntaxKind.ExportKeyword : T extends "async" ? ts.SyntaxKind.ExportKeyword : T extends "readonly" ? ts.SyntaxKind.ExportKeyword : T extends "static" ? ts.SyntaxKind.ExportKeyword : ts.SyntaxKind.AnyKeyword | ts.SyntaxKind.BooleanKeyword | ts.SyntaxKind.NeverKeyword | ts.SyntaxKind.NumberKeyword | ts.SyntaxKind.StringKeyword | ts.SyntaxKind.UndefinedKeyword | ts.SyntaxKind.UnknownKeyword | ts.SyntaxKind.VoidKeyword;
122
+ declare const createKeywordTypeNode: ({
123
+ keyword
124
+ }: {
125
+ keyword: Extract<SyntaxKindKeyword, "any" | "boolean" | "never" | "number" | "string" | "undefined" | "unknown" | "void">;
126
+ }) => ts.KeywordTypeNode<ts.SyntaxKind.VoidKeyword | ts.SyntaxKind.AnyKeyword | ts.SyntaxKind.BooleanKeyword | ts.SyntaxKind.NeverKeyword | ts.SyntaxKind.NumberKeyword | ts.SyntaxKind.StringKeyword | ts.SyntaxKind.UndefinedKeyword | ts.SyntaxKind.UnknownKeyword>;
127
+ declare const toTypeParameters: (types: (FunctionTypeParameter | ts.TypeParameterDeclaration)[]) => ts.TypeParameterDeclaration[];
128
+ declare const createTypeOperatorNode: ({
129
+ operator,
130
+ type
131
+ }: {
132
+ operator: "keyof" | "readonly" | "unique";
133
+ type: ts.TypeNode;
134
+ }) => ts.TypeOperatorNode;
135
+ declare const createTypeParameterDeclaration: ({
136
+ constraint,
137
+ defaultType,
138
+ modifiers,
139
+ name
140
+ }: {
141
+ constraint?: ts.TypeNode;
142
+ defaultType?: ts.TypeNode;
143
+ modifiers?: Array<ts.Modifier>;
144
+ name: string | ts.Identifier;
145
+ }) => ts.TypeParameterDeclaration;
146
+ declare const createMappedTypeNode: ({
147
+ members,
148
+ nameType,
149
+ questionToken,
150
+ readonlyToken,
151
+ type,
152
+ typeParameter
153
+ }: {
154
+ members?: ts.NodeArray<ts.TypeElement>;
155
+ nameType?: ts.TypeNode;
156
+ questionToken?: ts.QuestionToken | ts.PlusToken | ts.MinusToken;
157
+ readonlyToken?: ts.ReadonlyKeyword | ts.PlusToken | ts.MinusToken;
158
+ type?: ts.TypeNode;
159
+ typeParameter: ts.TypeParameterDeclaration;
160
+ }) => ts.MappedTypeNode;
161
+ declare const createLiteralTypeNode: ({
162
+ literal
163
+ }: {
164
+ literal: ts.LiteralTypeNode["literal"];
165
+ }) => ts.LiteralTypeNode;
166
+ /**
167
+ * Create arrow function type expression.
168
+ */
169
+ declare const createArrowFunction: ({
170
+ async,
171
+ comment,
172
+ multiLine,
173
+ parameters,
174
+ returnType,
175
+ statements,
176
+ types
177
+ }: {
178
+ async?: boolean;
179
+ comment?: Comments;
180
+ multiLine?: boolean;
181
+ parameters?: ReadonlyArray<FunctionParameter>;
182
+ returnType?: string | ts.TypeNode;
183
+ statements?: ts.Statement[] | ts.Expression;
184
+ types?: FunctionTypeParameter[];
185
+ }) => ts.ArrowFunction;
186
+ /**
187
+ * Create anonymous function type expression.
188
+ */
189
+ declare const createAnonymousFunction: ({
190
+ async,
191
+ comment,
192
+ multiLine,
193
+ parameters,
194
+ returnType,
195
+ statements,
196
+ types
197
+ }: {
198
+ async?: boolean;
199
+ comment?: Comments;
200
+ multiLine?: boolean;
201
+ parameters?: FunctionParameter[];
202
+ returnType?: string | ts.TypeNode;
203
+ statements?: ReadonlyArray<ts.Statement>;
204
+ types?: FunctionTypeParameter[];
205
+ }) => ts.FunctionExpression;
206
+ /**
207
+ * Create Array type expression.
208
+ */
209
+ declare const createArrayLiteralExpression: <T>({
210
+ elements,
211
+ multiLine
212
+ }: {
213
+ /**
214
+ * The array to create.
215
+ */
216
+ elements: T[];
217
+ /**
218
+ * Should the array be multi line?
219
+ *
220
+ * @default false
221
+ */
222
+ multiLine?: boolean;
223
+ }) => ts.ArrayLiteralExpression;
224
+ declare const createAwaitExpression: ({
225
+ expression
226
+ }: {
227
+ expression: ts.Expression;
228
+ }) => ts.AwaitExpression;
229
+ declare const createFunctionTypeNode: ({
230
+ parameters,
231
+ returnType,
232
+ typeParameters
233
+ }: {
234
+ parameters?: ts.ParameterDeclaration[];
235
+ returnType: ts.TypeNode;
236
+ typeParameters?: ts.TypeParameterDeclaration[];
237
+ }) => ts.FunctionTypeNode;
238
+ type ObjectValue = {
239
+ assertion?: 'any' | ts.TypeNode;
240
+ comments?: Comments;
241
+ spread: string;
242
+ } | {
243
+ comments?: Comments;
244
+ isValueAccess?: boolean;
245
+ key: string;
246
+ shorthand?: boolean;
247
+ value: any;
248
+ };
249
+ /**
250
+ * Create Object type expression.
251
+ * @param comments - comments to add to each property.
252
+ * @param identifier - keys that should be treated as identifiers.
253
+ * @param multiLine - if the object should be multiline.
254
+ * @param obj - the object to create expression with.
255
+ * @param shorthand - if shorthand syntax should be used.
256
+ * @param unescape - if properties strings should be unescaped.
257
+ * @returns ts.ObjectLiteralExpression
258
+ */
259
+ declare const createObjectType: <T extends Record<string, any> | Array<ObjectValue>>({
260
+ comments,
261
+ identifiers,
262
+ multiLine,
263
+ obj,
264
+ shorthand,
265
+ unescape
266
+ }: {
267
+ comments?: Comments;
268
+ identifiers?: string[];
269
+ multiLine?: boolean;
270
+ obj: T;
271
+ shorthand?: boolean;
272
+ unescape?: boolean;
273
+ }) => ts.ObjectLiteralExpression;
274
+ /**
275
+ * Create enum declaration. Example `export enum T = { X, Y };`
276
+ * @param asConst - whether to use const enums.
277
+ * @param comments - comments to add to each property.
278
+ * @param leadingComment - leading comment to add to enum.
279
+ * @param name - the name of the enum.
280
+ * @param obj - the object representing the enum.
281
+ * @returns ts.EnumDeclaration
282
+ */
283
+ declare const createEnumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({
284
+ asConst,
285
+ comments: enumMemberComments,
286
+ leadingComment: comments,
287
+ name,
288
+ obj
289
+ }: {
290
+ asConst: boolean;
291
+ comments?: Record<string | number, Comments>;
292
+ leadingComment?: Comments;
293
+ name: string | ts.TypeReferenceNode;
294
+ obj: T;
295
+ }) => ts.EnumDeclaration;
296
+ /**
297
+ * Create namespace declaration. Example `export namespace MyNamespace { ... }`
298
+ * @param name - the name of the namespace.
299
+ * @param nodes - the nodes in the namespace.
300
+ * @returns
301
+ */
302
+ declare const createNamespaceDeclaration: ({
303
+ name,
304
+ statements
305
+ }: {
306
+ name: string;
307
+ statements: Array<ts.Statement>;
308
+ }) => ts.ModuleDeclaration;
309
+ declare const createIndexedAccessTypeNode: ({
310
+ indexType,
311
+ objectType
312
+ }: {
313
+ indexType: ts.TypeNode;
314
+ objectType: ts.TypeNode;
315
+ }) => ts.IndexedAccessTypeNode;
316
+ declare const createGetAccessorDeclaration: ({
317
+ modifiers,
318
+ name,
319
+ returnType,
320
+ statements
321
+ }: {
322
+ modifiers?: Modifier | ReadonlyArray<Modifier>;
323
+ name: string | ts.PropertyName;
324
+ returnType?: string | ts.Identifier;
325
+ statements: ReadonlyArray<ts.Statement>;
326
+ }) => ts.GetAccessorDeclaration;
327
+ declare const createStringLiteral: ({
328
+ isSingleQuote,
329
+ text
330
+ }: {
331
+ isSingleQuote?: boolean;
332
+ text: string;
333
+ }) => ts.StringLiteral;
334
+ declare const createConditionalExpression: ({
335
+ condition,
336
+ whenFalse,
337
+ whenTrue
338
+ }: {
339
+ condition: ts.Expression;
340
+ whenFalse: ts.Expression;
341
+ whenTrue: ts.Expression;
342
+ }) => ts.ConditionalExpression;
343
+ declare const createTypeOfExpression: ({
344
+ text
345
+ }: {
346
+ text: string | ts.Identifier;
347
+ }) => ts.TypeOfExpression;
348
+ /**
349
+ * Create a type alias declaration. Example `export type X = Y;`.
350
+ * @param comment (optional) comments to add
351
+ * @param name the name of the type
352
+ * @param type the type
353
+ * @returns ts.TypeAliasDeclaration
354
+ */
355
+ declare const createTypeAliasDeclaration: ({
356
+ comment,
357
+ exportType,
358
+ name,
359
+ type,
360
+ typeParameters
361
+ }: {
362
+ comment?: Comments;
363
+ exportType?: boolean;
364
+ name: string | ts.TypeReferenceNode;
365
+ type: string | ts.TypeNode | ts.Identifier;
366
+ typeParameters?: FunctionTypeParameter[];
367
+ }) => ts.TypeAliasDeclaration;
368
+ declare const createTypeReferenceNode: ({
369
+ typeArguments,
370
+ typeName
371
+ }: {
372
+ typeArguments?: ts.TypeNode[];
373
+ typeName: string | ts.EntityName;
374
+ }) => ts.TypeReferenceNode;
375
+ declare const createTypeParenthesizedNode: ({
376
+ type
377
+ }: {
378
+ type: ts.TypeNode;
379
+ }) => ts.ParenthesizedTypeNode;
380
+ declare const createParameterDeclaration: ({
381
+ initializer,
382
+ modifiers,
383
+ name,
384
+ required,
385
+ type
386
+ }: {
387
+ initializer?: ts.Expression;
388
+ modifiers?: ReadonlyArray<ts.ModifierLike>;
389
+ name: string | ts.BindingName;
390
+ required?: boolean;
391
+ type?: ts.TypeNode;
392
+ }) => ts.ParameterDeclaration;
393
+ declare const createNewExpression: ({
394
+ argumentsArray,
395
+ expression,
396
+ typeArguments
397
+ }: {
398
+ argumentsArray?: Array<ts.Expression>;
399
+ expression: ts.Expression;
400
+ typeArguments?: Array<ts.TypeNode>;
401
+ }) => ts.NewExpression;
402
+ declare const createForOfStatement: ({
403
+ awaitModifier,
404
+ expression,
405
+ initializer,
406
+ statement
407
+ }: {
408
+ awaitModifier?: ts.AwaitKeyword;
409
+ expression: ts.Expression;
410
+ initializer: ts.ForInitializer;
411
+ statement: ts.Statement;
412
+ }) => ts.ForOfStatement;
413
+ declare const createAssignment: ({
414
+ left,
415
+ right
416
+ }: {
417
+ left: ts.Expression;
418
+ right: ts.Expression;
419
+ }) => ts.AssignmentExpression<ts.EqualsToken>;
420
+ declare const createBlock: ({
421
+ multiLine,
422
+ statements
423
+ }: {
424
+ multiLine?: boolean;
425
+ statements: ReadonlyArray<ts.Statement>;
426
+ }) => ts.Block;
427
+ declare const createPropertyAssignment: ({
428
+ initializer,
429
+ name
430
+ }: {
431
+ initializer: ts.Expression;
432
+ name: string | ts.PropertyName;
433
+ }) => ts.PropertyAssignment;
434
+ declare const createRegularExpressionLiteral: ({
435
+ flags,
436
+ text
437
+ }: {
438
+ flags?: ReadonlyArray<"g" | "i" | "m" | "s" | "u" | "y">;
439
+ text: string;
440
+ }) => ts.RegularExpressionLiteral;
441
+ declare const createAsExpression: ({
442
+ expression,
443
+ type
444
+ }: {
445
+ expression: ts.Expression;
446
+ type: ts.TypeNode;
447
+ }) => ts.AsExpression;
448
+ declare const createTemplateLiteralType: ({
449
+ value
450
+ }: {
451
+ value: ReadonlyArray<string | ts.TypeNode>;
452
+ }) => ts.TemplateLiteralTypeNode;
453
+ //#endregion
454
+ //#region src/tsc/utils.d.ts
455
+ interface ImportExportItemObject<Name extends string | undefined = string | undefined, Alias extends string | undefined = undefined> {
456
+ alias?: Alias;
457
+ asType?: boolean;
458
+ name: Name;
459
+ }
460
+ /**
461
+ * Print a TypeScript node to a string.
462
+ * @param node the node to print
463
+ * @returns string
464
+ */
465
+ declare function tsNodeToString({
466
+ node,
467
+ unescape
468
+ }: {
469
+ node: ts.Node;
470
+ unescape?: boolean;
471
+ }): string;
472
+ type Modifier = AccessLevel | 'async' | 'export' | 'readonly' | 'static';
473
+ type CommentLines = Array<string | null | false | undefined>;
474
+ type CommentObject = {
475
+ jsdoc?: boolean;
476
+ lines: CommentLines;
477
+ };
478
+ type Comments = CommentLines | Array<CommentObject>;
50
479
  declare namespace module_d_exports {
51
480
  export { ImportExportItem, createCallExpression, createConstVariable, createExportAllDeclaration, createNamedExportDeclarations, createNamedImportDeclarations };
52
481
  }
@@ -1272,5 +1701,5 @@ declare module '@hey-api/codegen-core' {
1272
1701
  */
1273
1702
  declare const defineConfig: <T extends MaybeArray<UserConfig>>(config: LazyOrAsync<T>) => Promise<T>;
1274
1703
  //#endregion
1275
- export { type Client as AngularClient, type Client$1 as AxiosClient, type Client$2 as Client, type DefinePlugin, type ExpressionTransformer, type Client$3 as FetchClient, type IR, type LegacyIR, Logger, type Client$4 as NextClient, type Client$5 as NuxtClient, type Client$6 as OfetchClient, type OpenApi, type OpenApiMetaObject, type OpenApiOperationObject, type OpenApiParameterObject, type OpenApiRequestBodyObject, type OpenApiResponseObject, type OpenApiSchemaObject, type Operation, type Plugin, type TypeTransformer, type UserConfig, clientDefaultConfig, clientDefaultMeta, clientPluginHandler, compiler, createClient, defaultPaginationKeywords, defaultPlugins, defineConfig, definePluginConfig, tsc, utils };
1704
+ export { type Client as AngularClient, type Client$1 as AxiosClient, type Client$2 as Client, type DefinePlugin, type ExpressionTransformer, type Client$3 as FetchClient, type IR, Logger, type Client$4 as NextClient, type Client$5 as NuxtClient, type Client$6 as OfetchClient, type OpenApi, type OpenApiMetaObject, type OpenApiOperationObject, type OpenApiParameterObject, type OpenApiRequestBodyObject, type OpenApiResponseObject, type OpenApiSchemaObject, type Plugin, type TypeTransformer, type UserConfig, clientDefaultConfig, clientDefaultMeta, clientPluginHandler, compiler, createClient, defaultPaginationKeywords, defaultPlugins, defineConfig, definePluginConfig, tsc, utils };
1276
1705
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t,b as n,c as r,r as i,s as a,v as o,x as s}from"./getSpec-1BMHZkPH.js";import{i as c,n as l,r as u,t as d}from"./src-CQ_69Vcm.js";export{c as Logger,a as clientDefaultConfig,r as clientDefaultMeta,t as clientPluginHandler,e as compiler,u as createClient,s as defaultPaginationKeywords,i as defaultPlugins,d as defineConfig,n as definePluginConfig,o as tsc,l as utils};
1
+ import{a as e,c as t,d as n,h as r,l as i,m as a,o,u as s}from"./openApi-DXfWYPpF.js";import{i as c,n as l,r as u,t as d}from"./src-CTUbY-zd.js";export{c as Logger,t as clientDefaultConfig,i as clientDefaultMeta,o as clientPluginHandler,s as compiler,u as createClient,r as defaultPaginationKeywords,e as defaultPlugins,d as defineConfig,a as definePluginConfig,n as tsc,l as utils};
package/dist/internal.cjs CHANGED
@@ -1 +1 @@
1
- const e=require(`./getSpec-xn4as4li.cjs`);exports.getSpec=e.t,exports.initConfigs=e.n,exports.parseOpenApiSpec=e.u;
1
+ const e=require(`./openApi-BWD76jue.cjs`);exports.getSpec=e.r,exports.initConfigs=e.i,exports.parseOpenApiSpec=e.t;
@@ -1,4 +1,4 @@
1
- import { a as Input, c as parseOpenApiSpec, i as UserConfig, n as WatchValues, r as Config, u as Logger } from "./types-Dh80P1tV.cjs";
1
+ import { m as Logger, n as UserConfig, p as Context, r as Input, t as Config } from "./config-B2o9ax_a.cjs";
2
2
  import { getResolvedInput } from "@hey-api/json-schema-ref-parser";
3
3
 
4
4
  //#region src/config/init.d.ts
@@ -22,6 +22,25 @@ declare const initConfigs: ({
22
22
  userConfigs: ReadonlyArray<UserConfig>;
23
23
  }) => Promise<Configs>;
24
24
  //#endregion
25
+ //#region src/types/types.d.ts
26
+ interface WatchValues {
27
+ /**
28
+ * Headers to be sent with each HEAD and/or GET request. This effectively
29
+ * serves as a mechanism resolver because setting certain headers will opt
30
+ * into comparing the specifications using that method.
31
+ */
32
+ headers: Headers;
33
+ /**
34
+ * Can we send a HEAD request instead of fetching the whole specification?
35
+ * This value will be set after the first successful fetch.
36
+ */
37
+ isHeadMethodSupported?: boolean;
38
+ /**
39
+ * String content of the last successfully fetched specification.
40
+ */
41
+ lastValue?: string;
42
+ }
43
+ //#endregion
25
44
  //#region src/getSpec.d.ts
26
45
  type SpecResponse = {
27
46
  arrayBuffer: ArrayBuffer | undefined;
@@ -50,5 +69,23 @@ declare const getSpec: ({
50
69
  watch: WatchValues;
51
70
  }) => Promise<SpecResponse | SpecError>;
52
71
  //#endregion
72
+ //#region src/openApi/index.d.ts
73
+ /**
74
+ * @internal
75
+ * Parse the resolved OpenAPI specification. This will populate and return
76
+ * `context` with intermediate representation obtained from the parsed spec.
77
+ */
78
+ declare const parseOpenApiSpec: ({
79
+ config,
80
+ dependencies,
81
+ logger,
82
+ spec
83
+ }: {
84
+ config: Config;
85
+ dependencies: Record<string, string>;
86
+ logger: Logger;
87
+ spec: unknown;
88
+ }) => Context;
89
+ //#endregion
53
90
  export { getSpec, initConfigs, parseOpenApiSpec };
54
91
  //# sourceMappingURL=internal.d.cts.map
@@ -1,4 +1,4 @@
1
- import { a as Input, c as parseOpenApiSpec, i as UserConfig, n as WatchValues, r as Config, u as Logger } from "./types-BRmx9r9T.js";
1
+ import { m as Logger, n as UserConfig, p as Context, r as Input, t as Config } from "./config-oAoGatJ7.js";
2
2
  import { getResolvedInput } from "@hey-api/json-schema-ref-parser";
3
3
 
4
4
  //#region src/config/init.d.ts
@@ -22,6 +22,25 @@ declare const initConfigs: ({
22
22
  userConfigs: ReadonlyArray<UserConfig>;
23
23
  }) => Promise<Configs>;
24
24
  //#endregion
25
+ //#region src/types/types.d.ts
26
+ interface WatchValues {
27
+ /**
28
+ * Headers to be sent with each HEAD and/or GET request. This effectively
29
+ * serves as a mechanism resolver because setting certain headers will opt
30
+ * into comparing the specifications using that method.
31
+ */
32
+ headers: Headers;
33
+ /**
34
+ * Can we send a HEAD request instead of fetching the whole specification?
35
+ * This value will be set after the first successful fetch.
36
+ */
37
+ isHeadMethodSupported?: boolean;
38
+ /**
39
+ * String content of the last successfully fetched specification.
40
+ */
41
+ lastValue?: string;
42
+ }
43
+ //#endregion
25
44
  //#region src/getSpec.d.ts
26
45
  type SpecResponse = {
27
46
  arrayBuffer: ArrayBuffer | undefined;
@@ -50,5 +69,23 @@ declare const getSpec: ({
50
69
  watch: WatchValues;
51
70
  }) => Promise<SpecResponse | SpecError>;
52
71
  //#endregion
72
+ //#region src/openApi/index.d.ts
73
+ /**
74
+ * @internal
75
+ * Parse the resolved OpenAPI specification. This will populate and return
76
+ * `context` with intermediate representation obtained from the parsed spec.
77
+ */
78
+ declare const parseOpenApiSpec: ({
79
+ config,
80
+ dependencies,
81
+ logger,
82
+ spec
83
+ }: {
84
+ config: Config;
85
+ dependencies: Record<string, string>;
86
+ logger: Logger;
87
+ spec: unknown;
88
+ }) => Context;
89
+ //#endregion
53
90
  export { getSpec, initConfigs, parseOpenApiSpec };
54
91
  //# sourceMappingURL=internal.d.ts.map
package/dist/internal.js CHANGED
@@ -1 +1 @@
1
- import{n as e,t,u as n}from"./getSpec-1BMHZkPH.js";export{t as getSpec,e as initConfigs,n as parseOpenApiSpec};
1
+ import{i as e,r as t,t as n}from"./openApi-DXfWYPpF.js";export{t as getSpec,e as initConfigs,n as parseOpenApiSpec};