@hey-api/openapi-ts 0.80.18 → 0.81.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.
@@ -1,4 +1,4 @@
1
- import { l as Config, L as Logger, c as IR, U as UserConfig, W as WatchValues } from './types.d-CFCN8diW.cjs';
1
+ import { l as Config, L as Logger, c as IR, U as UserConfig, W as WatchValues } from './types.d-BGYcYtD8.cjs';
2
2
  import { JSONSchema } from '@hey-api/json-schema-ref-parser';
3
3
  import 'semver';
4
4
  import 'node:fs';
@@ -1,4 +1,4 @@
1
- import { l as Config, L as Logger, c as IR, U as UserConfig, W as WatchValues } from './types.d-CFCN8diW.js';
1
+ import { l as Config, L as Logger, c as IR, U as UserConfig, W as WatchValues } from './types.d-BGYcYtD8.js';
2
2
  import { JSONSchema } from '@hey-api/json-schema-ref-parser';
3
3
  import 'semver';
4
4
  import 'node:fs';
package/dist/internal.js CHANGED
@@ -1,2 +1,2 @@
1
- import {createRequire}from'module';export{L as getSpec,K as initConfigs,F as parseOpenApiSpec}from'./chunk-4ELE5AM4.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
1
+ import {createRequire}from'module';export{L as getSpec,K as initConfigs,F as parseOpenApiSpec}from'./chunk-A2YBSPFD.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
2
2
  //# sourceMappingURL=internal.js.map
@@ -7706,6 +7706,12 @@ type WalkEvents =
7706
7706
  | {
7707
7707
  server: IR$1.ServerObject;
7708
7708
  type: 'server';
7709
+ }
7710
+ | {
7711
+ key: string;
7712
+ method: keyof IR$1.PathItemObject;
7713
+ operation: IR$1.OperationObject;
7714
+ type: 'webhook';
7709
7715
  };
7710
7716
 
7711
7717
  type WalkEventType = WalkEvents['type'];
@@ -8861,6 +8867,41 @@ type UserConfig$8 = Plugin.Name<'@hey-api/typescript'> & {
8861
8867
  */
8862
8868
  response?: StringName;
8863
8869
  };
8870
+ /**
8871
+ * Configuration for webhook-specific types.
8872
+ *
8873
+ * Controls generation of types for webhook payloads and webhook requests.
8874
+ *
8875
+ * Can be:
8876
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
8877
+ * - `object`: Full configuration object
8878
+ *
8879
+ * @default '{{name}}WebhookRequest'
8880
+ */
8881
+ webhooks?:
8882
+ | StringName
8883
+ | {
8884
+ /**
8885
+ * The casing convention to use for generated webhook type names.
8886
+ *
8887
+ * @default 'PascalCase'
8888
+ */
8889
+ case?: StringCase;
8890
+ /**
8891
+ * Custom naming pattern for generated webhook type names. The name
8892
+ * variable is obtained from the webhook key.
8893
+ *
8894
+ * @default '{{name}}WebhookRequest'
8895
+ */
8896
+ name?: StringName;
8897
+ /**
8898
+ * Custom naming pattern for generated webhook type names. The name
8899
+ * variable is obtained from the webhook key.
8900
+ *
8901
+ * @default '{{name}}WebhookPayload'
8902
+ */
8903
+ payload?: StringName;
8904
+ };
8864
8905
 
8865
8906
  // DEPRECATED OPTIONS BELOW
8866
8907
 
@@ -9055,6 +9096,33 @@ type Config$7 = Plugin.Name<'@hey-api/typescript'> & {
9055
9096
  */
9056
9097
  response: StringName;
9057
9098
  };
9099
+ /**
9100
+ * Configuration for webhook-specific types.
9101
+ *
9102
+ * Controls generation of types for webhook payloads and webhook requests.
9103
+ */
9104
+ webhooks: {
9105
+ /**
9106
+ * The casing convention to use for generated webhook type names.
9107
+ *
9108
+ * @default 'PascalCase'
9109
+ */
9110
+ case: StringCase;
9111
+ /**
9112
+ * Custom naming pattern for generated webhook type names. The name
9113
+ * variable is obtained from the webhook key.
9114
+ *
9115
+ * @default '{{name}}WebhookRequest'
9116
+ */
9117
+ name: StringName;
9118
+ /**
9119
+ * Custom naming pattern for generated webhook type names. The name
9120
+ * variable is obtained from the webhook key.
9121
+ *
9122
+ * @default '{{name}}WebhookPayload'
9123
+ */
9124
+ payload: StringName;
9125
+ };
9058
9126
 
9059
9127
  // DEPRECATED OPTIONS BELOW
9060
9128
 
@@ -9107,10 +9175,10 @@ declare const schemaToType: ({ onRef, plugin, schema, state, }: {
9107
9175
  }) => typescript__default.TypeNode;
9108
9176
 
9109
9177
  type GetIdArgs$1 = {
9110
- type: 'ClientOptions';
9178
+ type: 'ClientOptions' | 'Webhooks';
9111
9179
  } | {
9112
9180
  operation: IR$1.OperationObject;
9113
- type: 'data' | 'error' | 'errors' | 'response' | 'responses';
9181
+ type: 'data' | 'error' | 'errors' | 'response' | 'responses' | 'webhook-payload' | 'webhook-request';
9114
9182
  } | {
9115
9183
  type: 'ref';
9116
9184
  value: string;
@@ -11945,6 +12013,42 @@ type UserConfig$1 = Plugin.Name<'valibot'> & {
11945
12013
  */
11946
12014
  name?: StringName;
11947
12015
  };
12016
+ /**
12017
+ * Configuration for webhook-specific Valibot schemas.
12018
+ *
12019
+ * Controls generation of Valibot schemas for webhook payloads.
12020
+ *
12021
+ * Can be:
12022
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
12023
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
12024
+ * - `object`: Full configuration object
12025
+ *
12026
+ * @default true
12027
+ */
12028
+ webhooks?:
12029
+ | boolean
12030
+ | StringName
12031
+ | {
12032
+ /**
12033
+ * The casing convention to use for generated names.
12034
+ *
12035
+ * @default 'camelCase'
12036
+ */
12037
+ case?: StringCase;
12038
+ /**
12039
+ * Whether to generate Valibot schemas for webhook definitions.
12040
+ *
12041
+ * @default true
12042
+ */
12043
+ enabled?: boolean;
12044
+ /**
12045
+ * Custom naming pattern for generated schema names. The name variable
12046
+ * is obtained from the webhook key.
12047
+ *
12048
+ * @default 'v{{name}}WebhookRequest'
12049
+ */
12050
+ name?: StringName;
12051
+ };
11948
12052
  };
11949
12053
 
11950
12054
  type Config$1 = Plugin.Name<'valibot'> & {
@@ -12062,6 +12166,32 @@ type Config$1 = Plugin.Name<'valibot'> & {
12062
12166
  */
12063
12167
  name: StringName;
12064
12168
  };
12169
+ /**
12170
+ * Configuration for webhook-specific Valibot schemas.
12171
+ *
12172
+ * Controls generation of Valibot schemas for webhook payloads.
12173
+ */
12174
+ webhooks: {
12175
+ /**
12176
+ * The casing convention to use for generated names.
12177
+ *
12178
+ * @default 'camelCase'
12179
+ */
12180
+ case: StringCase;
12181
+ /**
12182
+ * Whether to generate Valibot schemas for webhook definitions.
12183
+ *
12184
+ * @default true
12185
+ */
12186
+ enabled: boolean;
12187
+ /**
12188
+ * Custom naming pattern for generated schema names. The name variable
12189
+ * is obtained from the webhook key.
12190
+ *
12191
+ * @default 'v{{name}}WebhookRequest'
12192
+ */
12193
+ name: StringName;
12194
+ };
12065
12195
  };
12066
12196
 
12067
12197
  type ValibotPlugin = DefinePlugin<UserConfig$1, Config$1, Api$1>;
@@ -12418,6 +12548,83 @@ type UserConfig = Plugin.Name<'zod'> & {
12418
12548
  enabled?: boolean;
12419
12549
  };
12420
12550
  };
12551
+ /**
12552
+ * Configuration for webhook-specific Zod schemas.
12553
+ *
12554
+ * Controls generation of Zod schemas for webhook payloads.
12555
+ *
12556
+ * Can be:
12557
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
12558
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
12559
+ * - `object`: Full configuration object
12560
+ *
12561
+ * @default true
12562
+ */
12563
+ webhooks?:
12564
+ | boolean
12565
+ | StringName
12566
+ | {
12567
+ /**
12568
+ * The casing convention to use for generated names.
12569
+ *
12570
+ * @default 'camelCase'
12571
+ */
12572
+ case?: StringCase;
12573
+ /**
12574
+ * Whether to generate Zod schemas for webhook definitions.
12575
+ *
12576
+ * @default true
12577
+ */
12578
+ enabled?: boolean;
12579
+ /**
12580
+ * Custom naming pattern for generated schema names. The name variable
12581
+ * is obtained from the webhook key.
12582
+ *
12583
+ * @default 'z{{name}}WebhookRequest'
12584
+ */
12585
+ name?: StringName;
12586
+ /**
12587
+ * Configuration for TypeScript type generation from Zod schemas.
12588
+ *
12589
+ * Controls generation of TypeScript types based on the generated Zod schemas.
12590
+ */
12591
+ types?: {
12592
+ /**
12593
+ * Configuration for `z.infer` types.
12594
+ *
12595
+ * Can be:
12596
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
12597
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
12598
+ * - `object`: Full configuration object
12599
+ *
12600
+ * @default false
12601
+ */
12602
+ infer?:
12603
+ | boolean
12604
+ | StringName
12605
+ | {
12606
+ /**
12607
+ * The casing convention to use for generated type names.
12608
+ *
12609
+ * @default 'PascalCase'
12610
+ */
12611
+ case?: StringCase;
12612
+ /**
12613
+ * Whether to generate TypeScript types from Zod schemas.
12614
+ *
12615
+ * @default true
12616
+ */
12617
+ enabled?: boolean;
12618
+ /**
12619
+ * Custom naming pattern for generated type names. The name variable is
12620
+ * obtained from the Zod schema name.
12621
+ *
12622
+ * @default '{{name}}WebhookRequestZodType'
12623
+ */
12624
+ name?: StringName;
12625
+ };
12626
+ };
12627
+ };
12421
12628
  };
12422
12629
 
12423
12630
  type Config = Plugin.Name<'zod'> & {
@@ -12689,13 +12896,70 @@ type Config = Plugin.Name<'zod'> & {
12689
12896
  enabled: boolean;
12690
12897
  };
12691
12898
  };
12899
+ /**
12900
+ * Configuration for webhook-specific Zod schemas.
12901
+ *
12902
+ * Controls generation of Zod schemas for webhook payloads.
12903
+ */
12904
+ webhooks: {
12905
+ /**
12906
+ * The casing convention to use for generated names.
12907
+ *
12908
+ * @default 'camelCase'
12909
+ */
12910
+ case: StringCase;
12911
+ /**
12912
+ * Whether to generate Zod schemas for webhook definitions.
12913
+ *
12914
+ * @default true
12915
+ */
12916
+ enabled: boolean;
12917
+ /**
12918
+ * Custom naming pattern for generated schema names. The name variable is
12919
+ * is obtained from the webhook key.
12920
+ *
12921
+ * @default 'z{{name}}WebhookRequest'
12922
+ */
12923
+ name: StringName;
12924
+ /**
12925
+ * Configuration for TypeScript type generation from Zod schemas.
12926
+ *
12927
+ * Controls generation of TypeScript types based on the generated Zod schemas.
12928
+ */
12929
+ types: {
12930
+ /**
12931
+ * Configuration for `z.infer` types.
12932
+ */
12933
+ infer: {
12934
+ /**
12935
+ * The casing convention to use for generated type names.
12936
+ *
12937
+ * @default 'PascalCase'
12938
+ */
12939
+ case: StringCase;
12940
+ /**
12941
+ * Whether to generate TypeScript types from Zod schemas.
12942
+ *
12943
+ * @default true
12944
+ */
12945
+ enabled: boolean;
12946
+ /**
12947
+ * Custom naming pattern for generated type names. The name variable is
12948
+ * obtained from the Zod schema name.
12949
+ *
12950
+ * @default '{{name}}WebhookRequestZodType'
12951
+ */
12952
+ name: StringName;
12953
+ };
12954
+ };
12955
+ };
12692
12956
  };
12693
12957
 
12694
12958
  type ZodPlugin = DefinePlugin<UserConfig, Config, Api>;
12695
12959
 
12696
12960
  type GetIdArgs = {
12697
12961
  operation: IR$1.OperationObject;
12698
- type: 'data' | 'responses' | 'type-infer-data' | 'type-infer-responses';
12962
+ type: 'data' | 'responses' | 'type-infer-data' | 'type-infer-responses' | 'type-infer-webhook-request' | 'webhook-request';
12699
12963
  } | {
12700
12964
  type: 'ref' | 'type-infer-ref';
12701
12965
  value: string;
@@ -13041,10 +13305,13 @@ type IRSecurityObject = SecuritySchemeObject$2;
13041
13305
 
13042
13306
  type IRServerObject = ServerObject$1;
13043
13307
 
13308
+ type IRWebhookObject = IRPathItemObject;
13309
+
13044
13310
  interface IRModel {
13045
13311
  components?: IRComponentsObject;
13046
13312
  paths?: IRPathsObject;
13047
13313
  servers?: ReadonlyArray<IRServerObject>;
13314
+ webhooks?: Record<string, IRWebhookObject>;
13048
13315
  }
13049
13316
 
13050
13317
  declare namespace IR$1 {
@@ -13058,12 +13325,14 @@ declare namespace IR$1 {
13058
13325
  export type ParametersObject = IRParametersObject;
13059
13326
  export type PathItemObject = IRPathItemObject;
13060
13327
  export type PathsObject = IRPathsObject;
13328
+ export type ReferenceObject = ReferenceObject;
13061
13329
  export type RequestBodyObject = IRRequestBodyObject;
13062
13330
  export type ResponseObject = IRResponseObject;
13063
13331
  export type ResponsesObject = IRResponsesObject;
13064
13332
  export type SchemaObject = IRSchemaObject;
13065
13333
  export type SecurityObject = IRSecurityObject;
13066
13334
  export type ServerObject = IRServerObject;
13335
+ export type WebhookObject = IRWebhookObject;
13067
13336
  }
13068
13337
 
13069
13338
  declare namespace LegacyIR {