@hey-api/openapi-ts 0.86.12 → 0.87.1

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 (44) hide show
  1. package/README.md +8 -14
  2. package/dist/clients/angular/index.ts +0 -1
  3. package/dist/clients/angular/types.ts +0 -27
  4. package/dist/clients/axios/index.ts +0 -1
  5. package/dist/clients/axios/types.ts +0 -19
  6. package/dist/clients/fetch/index.ts +0 -1
  7. package/dist/clients/fetch/types.ts +0 -27
  8. package/dist/clients/next/index.ts +0 -1
  9. package/dist/clients/next/types.ts +0 -19
  10. package/dist/clients/nuxt/index.ts +0 -1
  11. package/dist/clients/nuxt/types.ts +0 -12
  12. package/dist/clients/ofetch/index.ts +0 -1
  13. package/dist/clients/ofetch/types.ts +0 -27
  14. package/dist/{types-BRmx9r9T.d.ts → config-CNi83ZTD.d.ts} +1395 -2417
  15. package/dist/{types-Dh80P1tV.d.cts → config-PWeoedFF.d.cts} +1447 -2471
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.cts +470 -25
  18. package/dist/index.d.ts +459 -16
  19. package/dist/index.js +1 -1
  20. package/dist/internal.cjs +1 -1
  21. package/dist/internal.d.cts +38 -1
  22. package/dist/internal.d.ts +38 -1
  23. package/dist/internal.js +1 -1
  24. package/dist/openApi-CCTdD3hW.cjs +19 -0
  25. package/dist/openApi-CCTdD3hW.cjs.map +1 -0
  26. package/dist/openApi-D7xrG_wR.js +19 -0
  27. package/dist/openApi-D7xrG_wR.js.map +1 -0
  28. package/dist/run.cjs +1 -1
  29. package/dist/run.cjs.map +1 -1
  30. package/dist/run.js +1 -1
  31. package/dist/run.js.map +1 -1
  32. package/dist/src-CZCpIWy7.js +11 -0
  33. package/dist/src-CZCpIWy7.js.map +1 -0
  34. package/dist/src-Cvd6zAsc.cjs +19 -0
  35. package/dist/src-Cvd6zAsc.cjs.map +1 -0
  36. package/package.json +1 -4
  37. package/dist/getSpec-1BMHZkPH.js +0 -25
  38. package/dist/getSpec-1BMHZkPH.js.map +0 -1
  39. package/dist/getSpec-xn4as4li.cjs +0 -25
  40. package/dist/getSpec-xn4as4li.cjs.map +0 -1
  41. package/dist/src-CQ_69Vcm.js +0 -1310
  42. package/dist/src-CQ_69Vcm.js.map +0 -1
  43. package/dist/src-DptUs1Ky.cjs +0 -1318
  44. package/dist/src-DptUs1Ky.cjs.map +0 -1
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-CNi83ZTD.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"];
@@ -38,7 +38,7 @@ declare const clientPluginHandler: ({
38
38
  }: Parameters<PluginHandler>[0]) => void;
39
39
  //#endregion
40
40
  //#region src/plugins/shared/utils/config.d.ts
41
- declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) => (userConfig?: Omit<Plugin.UserConfig<T["config"]>, "name">) => Omit<Plugin.Config<T>, "name"> & {
41
+ declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) => (userConfig?: Omit<T["config"], "name">) => Omit<Plugin.Config<T>, "name"> & {
42
42
  /**
43
43
  * Cast name to `any` so it doesn't throw type error in `plugins` array.
44
44
  * We could allow any `string` as plugin `name` in the object syntax, but
@@ -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
  }
@@ -226,7 +655,8 @@ declare const tsc: {
226
655
  exportClass,
227
656
  extendedClasses,
228
657
  name,
229
- nodes
658
+ nodes,
659
+ typeParameters
230
660
  }: {
231
661
  decorator?: {
232
662
  args: any[];
@@ -236,6 +666,7 @@ declare const tsc: {
236
666
  extendedClasses?: ReadonlyArray<string>;
237
667
  name: string;
238
668
  nodes: ReadonlyArray<typescript0.ClassElement>;
669
+ typeParameters?: ReadonlyArray<typescript0.TypeParameterDeclaration>;
239
670
  }) => typescript0.ClassDeclaration;
240
671
  conditionalExpression: ({
241
672
  condition,
@@ -339,9 +770,7 @@ declare const tsc: {
339
770
  returnType?: string | typescript0.Identifier;
340
771
  statements: ReadonlyArray<typescript0.Statement>;
341
772
  }) => typescript0.GetAccessorDeclaration;
342
- identifier: ({
343
- text
344
- }: {
773
+ identifier: (args: string | {
345
774
  text: string;
346
775
  }) => typescript0.Identifier;
347
776
  ifStatement: ({
@@ -475,6 +904,13 @@ declare const tsc: {
475
904
  required?: boolean;
476
905
  type?: typescript0.TypeNode;
477
906
  }) => typescript0.ParameterDeclaration;
907
+ prefixUnaryExpression: ({
908
+ expression,
909
+ prefix
910
+ }: {
911
+ expression: string | typescript0.Expression;
912
+ prefix: ("!" | "-") | typescript0.PrefixUnaryOperator;
913
+ }) => typescript0.PrefixUnaryExpression;
478
914
  propertyAccessExpression: ({
479
915
  expression,
480
916
  isOptional,
@@ -498,12 +934,12 @@ declare const tsc: {
498
934
  }) => typescript0.PropertyAssignment;
499
935
  propertyDeclaration: ({
500
936
  initializer,
501
- modifier,
937
+ modifiers,
502
938
  name,
503
939
  type
504
940
  }: {
505
941
  initializer?: typescript0.Expression;
506
- modifier?: Modifier;
942
+ modifiers?: Modifier | ReadonlyArray<Modifier>;
507
943
  name: string | typescript0.PropertyName;
508
944
  type?: typescript0.TypeNode;
509
945
  }) => typescript0.PropertyDeclaration;
@@ -769,7 +1205,8 @@ declare const compiler: {
769
1205
  exportClass,
770
1206
  extendedClasses,
771
1207
  name,
772
- nodes
1208
+ nodes,
1209
+ typeParameters
773
1210
  }: {
774
1211
  decorator?: {
775
1212
  args: any[];
@@ -779,6 +1216,7 @@ declare const compiler: {
779
1216
  extendedClasses?: ReadonlyArray<string>;
780
1217
  name: string;
781
1218
  nodes: ReadonlyArray<typescript0.ClassElement>;
1219
+ typeParameters?: ReadonlyArray<typescript0.TypeParameterDeclaration>;
782
1220
  }) => typescript0.ClassDeclaration;
783
1221
  conditionalExpression: ({
784
1222
  condition,
@@ -882,9 +1320,7 @@ declare const compiler: {
882
1320
  returnType?: string | typescript0.Identifier;
883
1321
  statements: ReadonlyArray<typescript0.Statement>;
884
1322
  }) => typescript0.GetAccessorDeclaration;
885
- identifier: ({
886
- text
887
- }: {
1323
+ identifier: (args: string | {
888
1324
  text: string;
889
1325
  }) => typescript0.Identifier;
890
1326
  ifStatement: ({
@@ -1018,6 +1454,13 @@ declare const compiler: {
1018
1454
  required?: boolean;
1019
1455
  type?: typescript0.TypeNode;
1020
1456
  }) => typescript0.ParameterDeclaration;
1457
+ prefixUnaryExpression: ({
1458
+ expression,
1459
+ prefix
1460
+ }: {
1461
+ expression: string | typescript0.Expression;
1462
+ prefix: ("!" | "-") | typescript0.PrefixUnaryOperator;
1463
+ }) => typescript0.PrefixUnaryExpression;
1021
1464
  propertyAccessExpression: ({
1022
1465
  expression,
1023
1466
  isOptional,
@@ -1041,12 +1484,12 @@ declare const compiler: {
1041
1484
  }) => typescript0.PropertyAssignment;
1042
1485
  propertyDeclaration: ({
1043
1486
  initializer,
1044
- modifier,
1487
+ modifiers,
1045
1488
  name,
1046
1489
  type
1047
1490
  }: {
1048
1491
  initializer?: typescript0.Expression;
1049
- modifier?: Modifier;
1492
+ modifiers?: Modifier | ReadonlyArray<Modifier>;
1050
1493
  name: string | typescript0.PropertyName;
1051
1494
  type?: typescript0.TypeNode;
1052
1495
  }) => typescript0.PropertyDeclaration;
@@ -1272,5 +1715,5 @@ declare module '@hey-api/codegen-core' {
1272
1715
  */
1273
1716
  declare const defineConfig: <T extends MaybeArray<UserConfig>>(config: LazyOrAsync<T>) => Promise<T>;
1274
1717
  //#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 };
1718
+ 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
1719
  //# 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-D7xrG_wR.js";import{i as c,n as l,r as u,t as d}from"./src-CZCpIWy7.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-CCTdD3hW.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-PWeoedFF.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-CNi83ZTD.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