api-farmer 0.0.7 → 0.0.8

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.
@@ -22740,6 +22740,9 @@ import { camelize, pascalCase } from "rattail";
22740
22740
  function transformModuleName({ name }) {
22741
22741
  return camelize(name);
22742
22742
  }
22743
+ function transformUrl({ path: path13, base }) {
22744
+ return (base ? path13.replace(base, "") : path13).replace(/{/g, ":").replace(/}/g, "");
22745
+ }
22743
22746
  function transformVerb({ method }) {
22744
22747
  switch (method) {
22745
22748
  case "post":
@@ -22750,9 +22753,6 @@ function transformVerb({ method }) {
22750
22753
  return pascalCase(method);
22751
22754
  }
22752
22755
  }
22753
- function transformUrl({ path: path13, base }) {
22754
- return (base ? path13.replace(base, "") : path13).replace(/{/g, ":").replace(/}/g, "");
22755
- }
22756
22756
  function transformEntity({ path: path13, method, base }) {
22757
22757
  path13 = base ? path13.replace(base, "") : path13;
22758
22758
  const words = path13.split("/").filter(Boolean);
@@ -22776,19 +22776,33 @@ function transformType({ verb, entity }) {
22776
22776
  function transformTypeValue({ path: path13, method }) {
22777
22777
  return `paths['${path13}']['${method}']`;
22778
22778
  }
22779
- function transformTypeQuery({ verb, entity }) {
22779
+ function transformTypeQuery({
22780
+ verb,
22781
+ entity
22782
+ }) {
22780
22783
  return `Api${verb}${entity}Query`;
22781
22784
  }
22782
- function transformTypeQueryValue({ type: type2 }) {
22785
+ function transformTypeQueryValue({
22786
+ type: type2
22787
+ }) {
22783
22788
  return `${type2}['parameters']['query']`;
22784
22789
  }
22785
- function transformTypeRequestBody({ verb, entity }) {
22790
+ function transformTypeRequestBody({
22791
+ verb,
22792
+ entity
22793
+ }) {
22786
22794
  return `Api${verb}${entity}RequestBody`;
22787
22795
  }
22788
- function transformTypeRequestBodyValue({ type: type2, required }) {
22796
+ function transformTypeRequestBodyValue({
22797
+ type: type2,
22798
+ required
22799
+ }) {
22789
22800
  return required ? `${type2}['requestBody']['content']['application/json']` : `NonNullable<${type2}['requestBody']>['content']['application/json'] | undefined`;
22790
22801
  }
22791
- function transformTypeResponseBody({ verb, entity }) {
22802
+ function transformTypeResponseBody({
22803
+ verb,
22804
+ entity
22805
+ }) {
22792
22806
  return `Api${verb}${entity}ResponseBody`;
22793
22807
  }
22794
22808
  function transformTypeResponseBodyValue({
@@ -22828,22 +22842,26 @@ function partitionApiModules(schema2, transformer, options8) {
22828
22842
  const pathItems = schemaPaths[path13];
22829
22843
  const childPayloads = Object.entries(pathItems).reduce((payloads3, [method, operation]) => {
22830
22844
  const url2 = transformer.url({ path: path13, base });
22831
- const entity = transformer.entity({ path: path13, method, base });
22832
- const verb = transformer.verb({ method });
22833
- const fn = transformer.fn({ verb, entity });
22834
- const type2 = transformer.type({ verb, entity });
22835
- const typeValue = transformer.typeValue({ path: path13, method });
22836
- const typeQuery = transformer.typeQuery({ verb, entity });
22837
- const typeQueryValue = hasQueryParameter(operation) ? transformer.typeQueryValue({ type: type2 }) : "never";
22838
- const typeRequestBody = transformer.typeRequestBody({ verb, entity });
22845
+ const args = { path: path13, base, url: url2, method, operation };
22846
+ const entity = transformer.entity(args);
22847
+ const verb = transformer.verb(args);
22848
+ const fn = transformer.fn({ ...args, verb, entity });
22849
+ const type2 = transformer.type({ ...args, verb, entity });
22850
+ const typeValue = transformer.typeValue({ ...args, verb, entity });
22851
+ const typeQuery = transformer.typeQuery({ ...args, type: type2, verb, entity });
22852
+ const typeQueryValue = hasQueryParameter(operation) ? transformer.typeQueryValue({ ...args, type: type2, verb, entity }) : "never";
22853
+ const typeRequestBody = transformer.typeRequestBody({ ...args, type: type2, verb, entity });
22839
22854
  const typeRequestBodyValue = operation.requestBody ? transformer.typeRequestBodyValue({
22855
+ ...args,
22840
22856
  type: type2,
22857
+ verb,
22858
+ entity,
22841
22859
  required: isRequiredRequestBody(operation.requestBody)
22842
22860
  }) : "never";
22843
22861
  const statusCode = statusCodes[method] ?? 200;
22844
22862
  const mime = getResponseMime(operation, statusCode);
22845
- const typeResponseBody = transformer.typeResponseBody({ verb, entity });
22846
- const typeResponseBodyValue = mime ? transformer.typeResponseBodyValue({ type: type2, statusCode, mime }) : "never";
22863
+ const typeResponseBody = transformer.typeResponseBody({ ...args, type: type2, verb, entity });
22864
+ const typeResponseBodyValue = mime ? transformer.typeResponseBodyValue({ ...args, type: type2, verb, entity, statusCode, mime }) : "never";
22847
22865
  payloads3.push({
22848
22866
  fn,
22849
22867
  url: url2,
@@ -22942,8 +22960,8 @@ export {
22942
22960
  defineConfig,
22943
22961
  getConfig,
22944
22962
  transformModuleName,
22945
- transformVerb,
22946
22963
  transformUrl,
22964
+ transformVerb,
22947
22965
  transformEntity,
22948
22966
  transformFn,
22949
22967
  transformType,
package/dist/cli.cjs CHANGED
@@ -102000,6 +102000,9 @@ var init_config = __esm({
102000
102000
  function transformModuleName({ name }) {
102001
102001
  return (0, import_rattail.camelize)(name);
102002
102002
  }
102003
+ function transformUrl({ path: path13, base }) {
102004
+ return (base ? path13.replace(base, "") : path13).replace(/{/g, ":").replace(/}/g, "");
102005
+ }
102003
102006
  function transformVerb({ method }) {
102004
102007
  switch (method) {
102005
102008
  case "post":
@@ -102010,9 +102013,6 @@ function transformVerb({ method }) {
102010
102013
  return (0, import_rattail.pascalCase)(method);
102011
102014
  }
102012
102015
  }
102013
- function transformUrl({ path: path13, base }) {
102014
- return (base ? path13.replace(base, "") : path13).replace(/{/g, ":").replace(/}/g, "");
102015
- }
102016
102016
  function transformEntity({ path: path13, method, base }) {
102017
102017
  path13 = base ? path13.replace(base, "") : path13;
102018
102018
  const words = path13.split("/").filter(Boolean);
@@ -102036,19 +102036,33 @@ function transformType({ verb, entity }) {
102036
102036
  function transformTypeValue({ path: path13, method }) {
102037
102037
  return `paths['${path13}']['${method}']`;
102038
102038
  }
102039
- function transformTypeQuery({ verb, entity }) {
102039
+ function transformTypeQuery({
102040
+ verb,
102041
+ entity
102042
+ }) {
102040
102043
  return `Api${verb}${entity}Query`;
102041
102044
  }
102042
- function transformTypeQueryValue({ type: type2 }) {
102045
+ function transformTypeQueryValue({
102046
+ type: type2
102047
+ }) {
102043
102048
  return `${type2}['parameters']['query']`;
102044
102049
  }
102045
- function transformTypeRequestBody({ verb, entity }) {
102050
+ function transformTypeRequestBody({
102051
+ verb,
102052
+ entity
102053
+ }) {
102046
102054
  return `Api${verb}${entity}RequestBody`;
102047
102055
  }
102048
- function transformTypeRequestBodyValue({ type: type2, required }) {
102056
+ function transformTypeRequestBodyValue({
102057
+ type: type2,
102058
+ required
102059
+ }) {
102049
102060
  return required ? `${type2}['requestBody']['content']['application/json']` : `NonNullable<${type2}['requestBody']>['content']['application/json'] | undefined`;
102050
102061
  }
102051
- function transformTypeResponseBody({ verb, entity }) {
102062
+ function transformTypeResponseBody({
102063
+ verb,
102064
+ entity
102065
+ }) {
102052
102066
  return `Api${verb}${entity}ResponseBody`;
102053
102067
  }
102054
102068
  function transformTypeResponseBodyValue({
@@ -102104,22 +102118,26 @@ function partitionApiModules(schema2, transformer, options8) {
102104
102118
  const pathItems = schemaPaths[path13];
102105
102119
  const childPayloads = Object.entries(pathItems).reduce((payloads3, [method, operation]) => {
102106
102120
  const url2 = transformer.url({ path: path13, base });
102107
- const entity = transformer.entity({ path: path13, method, base });
102108
- const verb = transformer.verb({ method });
102109
- const fn8 = transformer.fn({ verb, entity });
102110
- const type2 = transformer.type({ verb, entity });
102111
- const typeValue = transformer.typeValue({ path: path13, method });
102112
- const typeQuery = transformer.typeQuery({ verb, entity });
102113
- const typeQueryValue = hasQueryParameter(operation) ? transformer.typeQueryValue({ type: type2 }) : "never";
102114
- const typeRequestBody = transformer.typeRequestBody({ verb, entity });
102121
+ const args = { path: path13, base, url: url2, method, operation };
102122
+ const entity = transformer.entity(args);
102123
+ const verb = transformer.verb(args);
102124
+ const fn8 = transformer.fn({ ...args, verb, entity });
102125
+ const type2 = transformer.type({ ...args, verb, entity });
102126
+ const typeValue = transformer.typeValue({ ...args, verb, entity });
102127
+ const typeQuery = transformer.typeQuery({ ...args, type: type2, verb, entity });
102128
+ const typeQueryValue = hasQueryParameter(operation) ? transformer.typeQueryValue({ ...args, type: type2, verb, entity }) : "never";
102129
+ const typeRequestBody = transformer.typeRequestBody({ ...args, type: type2, verb, entity });
102115
102130
  const typeRequestBodyValue = operation.requestBody ? transformer.typeRequestBodyValue({
102131
+ ...args,
102116
102132
  type: type2,
102133
+ verb,
102134
+ entity,
102117
102135
  required: isRequiredRequestBody(operation.requestBody)
102118
102136
  }) : "never";
102119
102137
  const statusCode = statusCodes[method] ?? 200;
102120
102138
  const mime = getResponseMime(operation, statusCode);
102121
- const typeResponseBody = transformer.typeResponseBody({ verb, entity });
102122
- const typeResponseBodyValue = mime ? transformer.typeResponseBodyValue({ type: type2, statusCode, mime }) : "never";
102139
+ const typeResponseBody = transformer.typeResponseBody({ ...args, type: type2, verb, entity });
102140
+ const typeResponseBodyValue = mime ? transformer.typeResponseBodyValue({ ...args, type: type2, verb, entity, statusCode, mime }) : "never";
102123
102141
  payloads3.push({
102124
102142
  fn: fn8,
102125
102143
  url: url2,
package/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ import { Command } from "commander";
9
9
  var program = new Command();
10
10
  program.version(getCliVersion());
11
11
  program.action(async () => {
12
- const { generate } = await import("./generate-QIKM4YKD.js");
12
+ const { generate } = await import("./generate-C3K2GRQJ.js");
13
13
  return generate();
14
14
  });
15
15
  program.parse();
@@ -3,7 +3,7 @@ import {
3
3
  generateTypes,
4
4
  partitionApiModules,
5
5
  renderApiModules
6
- } from "./chunk-GHW46C2M.js";
6
+ } from "./chunk-L33J46FJ.js";
7
7
  import "./chunk-OBPECFFY.js";
8
8
  import "./chunk-6OIOYGN7.js";
9
9
  export {
package/dist/index.cjs CHANGED
@@ -79264,6 +79264,9 @@ var import_rattail = require("rattail");
79264
79264
  function transformModuleName({ name }) {
79265
79265
  return (0, import_rattail.camelize)(name);
79266
79266
  }
79267
+ function transformUrl({ path: path13, base }) {
79268
+ return (base ? path13.replace(base, "") : path13).replace(/{/g, ":").replace(/}/g, "");
79269
+ }
79267
79270
  function transformVerb({ method }) {
79268
79271
  switch (method) {
79269
79272
  case "post":
@@ -79274,9 +79277,6 @@ function transformVerb({ method }) {
79274
79277
  return (0, import_rattail.pascalCase)(method);
79275
79278
  }
79276
79279
  }
79277
- function transformUrl({ path: path13, base }) {
79278
- return (base ? path13.replace(base, "") : path13).replace(/{/g, ":").replace(/}/g, "");
79279
- }
79280
79280
  function transformEntity({ path: path13, method, base }) {
79281
79281
  path13 = base ? path13.replace(base, "") : path13;
79282
79282
  const words = path13.split("/").filter(Boolean);
@@ -79300,19 +79300,33 @@ function transformType({ verb, entity }) {
79300
79300
  function transformTypeValue({ path: path13, method }) {
79301
79301
  return `paths['${path13}']['${method}']`;
79302
79302
  }
79303
- function transformTypeQuery({ verb, entity }) {
79303
+ function transformTypeQuery({
79304
+ verb,
79305
+ entity
79306
+ }) {
79304
79307
  return `Api${verb}${entity}Query`;
79305
79308
  }
79306
- function transformTypeQueryValue({ type: type2 }) {
79309
+ function transformTypeQueryValue({
79310
+ type: type2
79311
+ }) {
79307
79312
  return `${type2}['parameters']['query']`;
79308
79313
  }
79309
- function transformTypeRequestBody({ verb, entity }) {
79314
+ function transformTypeRequestBody({
79315
+ verb,
79316
+ entity
79317
+ }) {
79310
79318
  return `Api${verb}${entity}RequestBody`;
79311
79319
  }
79312
- function transformTypeRequestBodyValue({ type: type2, required }) {
79320
+ function transformTypeRequestBodyValue({
79321
+ type: type2,
79322
+ required
79323
+ }) {
79313
79324
  return required ? `${type2}['requestBody']['content']['application/json']` : `NonNullable<${type2}['requestBody']>['content']['application/json'] | undefined`;
79314
79325
  }
79315
- function transformTypeResponseBody({ verb, entity }) {
79326
+ function transformTypeResponseBody({
79327
+ verb,
79328
+ entity
79329
+ }) {
79316
79330
  return `Api${verb}${entity}ResponseBody`;
79317
79331
  }
79318
79332
  function transformTypeResponseBodyValue({
@@ -102142,22 +102156,26 @@ function partitionApiModules(schema2, transformer, options8) {
102142
102156
  const pathItems = schemaPaths[path13];
102143
102157
  const childPayloads = Object.entries(pathItems).reduce((payloads3, [method, operation]) => {
102144
102158
  const url2 = transformer.url({ path: path13, base });
102145
- const entity = transformer.entity({ path: path13, method, base });
102146
- const verb = transformer.verb({ method });
102147
- const fn8 = transformer.fn({ verb, entity });
102148
- const type2 = transformer.type({ verb, entity });
102149
- const typeValue = transformer.typeValue({ path: path13, method });
102150
- const typeQuery = transformer.typeQuery({ verb, entity });
102151
- const typeQueryValue = hasQueryParameter(operation) ? transformer.typeQueryValue({ type: type2 }) : "never";
102152
- const typeRequestBody = transformer.typeRequestBody({ verb, entity });
102159
+ const args = { path: path13, base, url: url2, method, operation };
102160
+ const entity = transformer.entity(args);
102161
+ const verb = transformer.verb(args);
102162
+ const fn8 = transformer.fn({ ...args, verb, entity });
102163
+ const type2 = transformer.type({ ...args, verb, entity });
102164
+ const typeValue = transformer.typeValue({ ...args, verb, entity });
102165
+ const typeQuery = transformer.typeQuery({ ...args, type: type2, verb, entity });
102166
+ const typeQueryValue = hasQueryParameter(operation) ? transformer.typeQueryValue({ ...args, type: type2, verb, entity }) : "never";
102167
+ const typeRequestBody = transformer.typeRequestBody({ ...args, type: type2, verb, entity });
102153
102168
  const typeRequestBodyValue = operation.requestBody ? transformer.typeRequestBodyValue({
102169
+ ...args,
102154
102170
  type: type2,
102171
+ verb,
102172
+ entity,
102155
102173
  required: isRequiredRequestBody(operation.requestBody)
102156
102174
  }) : "never";
102157
102175
  const statusCode = statusCodes[method] ?? 200;
102158
102176
  const mime = getResponseMime(operation, statusCode);
102159
- const typeResponseBody = transformer.typeResponseBody({ verb, entity });
102160
- const typeResponseBodyValue = mime ? transformer.typeResponseBodyValue({ type: type2, statusCode, mime }) : "never";
102177
+ const typeResponseBody = transformer.typeResponseBody({ ...args, type: type2, verb, entity });
102178
+ const typeResponseBodyValue = mime ? transformer.typeResponseBodyValue({ ...args, type: type2, verb, entity, statusCode, mime }) : "never";
102161
102179
  payloads3.push({
102162
102180
  fn: fn8,
102163
102181
  url: url2,
package/dist/index.d.cts CHANGED
@@ -1,57 +1,69 @@
1
- import { OpenAPI3, OperationObject, RequestBodyObject, ReferenceObject } from 'openapi-typescript';
1
+ import { OperationObject, OpenAPI3, RequestBodyObject, ReferenceObject } from 'openapi-typescript';
2
2
  export { default as pluralize } from 'pluralize';
3
3
 
4
+ type TransformerBaseArgs = {
5
+ path: string;
6
+ base: string | undefined;
7
+ url: string;
8
+ method: string;
9
+ operation: OperationObject;
10
+ };
4
11
  declare function transformModuleName({ name }: {
5
12
  name: string;
6
13
  }): string;
7
- declare function transformVerb({ method }: {
8
- method: string;
9
- }): string;
10
14
  declare function transformUrl({ path, base }: {
11
15
  path: string;
12
- base?: string;
16
+ base: string | undefined;
13
17
  }): string;
14
- declare function transformEntity({ path, method, base }: {
15
- path: string;
18
+ declare function transformVerb({ method }: {
16
19
  method: string;
17
- base?: string;
18
20
  }): string;
21
+ declare function transformEntity({ path, method, base }: TransformerBaseArgs): string;
19
22
  declare function transformFn({ verb, entity }: {
20
23
  verb: string;
21
24
  entity: string;
22
- }): string;
25
+ } & TransformerBaseArgs): string;
23
26
  declare function transformType({ verb, entity }: {
24
27
  verb: string;
25
28
  entity: string;
26
- }): string;
29
+ } & TransformerBaseArgs): string;
27
30
  declare function transformTypeValue({ path, method }: {
28
- path: string;
29
- method: string;
30
- }): string;
31
- declare function transformTypeQuery({ verb, entity }: {
32
31
  verb: string;
33
32
  entity: string;
34
- }): string;
35
- declare function transformTypeQueryValue({ type }: {
33
+ } & TransformerBaseArgs): string;
34
+ declare function transformTypeQuery({ verb, entity, }: {
36
35
  type: string;
37
- }): string;
38
- declare function transformTypeRequestBody({ verb, entity }: {
39
36
  verb: string;
40
37
  entity: string;
41
- }): string;
42
- declare function transformTypeRequestBodyValue({ type, required }: {
38
+ } & TransformerBaseArgs): string;
39
+ declare function transformTypeQueryValue({ type, }: {
40
+ type: string;
41
+ verb: string;
42
+ entity: string;
43
+ } & TransformerBaseArgs): string;
44
+ declare function transformTypeRequestBody({ verb, entity, }: {
45
+ type: string;
46
+ verb: string;
47
+ entity: string;
48
+ } & TransformerBaseArgs): string;
49
+ declare function transformTypeRequestBodyValue({ type, required, }: {
43
50
  type: string;
51
+ verb: string;
52
+ entity: string;
44
53
  required: boolean;
45
- }): string;
46
- declare function transformTypeResponseBody({ verb, entity }: {
54
+ } & TransformerBaseArgs): string;
55
+ declare function transformTypeResponseBody({ verb, entity, }: {
56
+ type: string;
47
57
  verb: string;
48
58
  entity: string;
49
- }): string;
59
+ } & TransformerBaseArgs): string;
50
60
  declare function transformTypeResponseBodyValue({ type, statusCode, mime, }: {
51
61
  type: string;
62
+ verb: string;
63
+ entity: string;
52
64
  statusCode: number;
53
65
  mime: string;
54
- }): string;
66
+ } & TransformerBaseArgs): string;
55
67
  interface Transformer {
56
68
  moduleName: typeof transformModuleName;
57
69
  verb: typeof transformVerb;
@@ -251,4 +263,4 @@ type Config = GenerateOptions;
251
263
  declare function defineConfig(config: Config): GenerateOptions;
252
264
  declare function getConfig(): Promise<Config>;
253
265
 
254
- export { type ApiModule, type ApiModulePayload, type ApiModuleTemplateData, type Config, type GenerateOptions, type Preset, type StatusCodeStrategy, type StatusCodes, type Transformer, createStatusCodesByStrategy, createTransformer, defineConfig, generate, generateTypes, getCliVersion, getConfig, getResponseMime, hasQueryParameter, isRequiredRequestBody, partitionApiModules, readSchema, readTemplateFile, renderApiModules, transformEntity, transformFn, transformModuleName, transformType, transformTypeQuery, transformTypeQueryValue, transformTypeRequestBody, transformTypeRequestBodyValue, transformTypeResponseBody, transformTypeResponseBodyValue, transformTypeValue, transformUrl, transformVerb };
266
+ export { type ApiModule, type ApiModulePayload, type ApiModuleTemplateData, type Config, type GenerateOptions, type Preset, type StatusCodeStrategy, type StatusCodes, type Transformer, type TransformerBaseArgs, createStatusCodesByStrategy, createTransformer, defineConfig, generate, generateTypes, getCliVersion, getConfig, getResponseMime, hasQueryParameter, isRequiredRequestBody, partitionApiModules, readSchema, readTemplateFile, renderApiModules, transformEntity, transformFn, transformModuleName, transformType, transformTypeQuery, transformTypeQueryValue, transformTypeRequestBody, transformTypeRequestBodyValue, transformTypeResponseBody, transformTypeResponseBodyValue, transformTypeValue, transformUrl, transformVerb };
package/dist/index.d.ts CHANGED
@@ -1,57 +1,69 @@
1
- import { OpenAPI3, OperationObject, RequestBodyObject, ReferenceObject } from 'openapi-typescript';
1
+ import { OperationObject, OpenAPI3, RequestBodyObject, ReferenceObject } from 'openapi-typescript';
2
2
  export { default as pluralize } from 'pluralize';
3
3
 
4
+ type TransformerBaseArgs = {
5
+ path: string;
6
+ base: string | undefined;
7
+ url: string;
8
+ method: string;
9
+ operation: OperationObject;
10
+ };
4
11
  declare function transformModuleName({ name }: {
5
12
  name: string;
6
13
  }): string;
7
- declare function transformVerb({ method }: {
8
- method: string;
9
- }): string;
10
14
  declare function transformUrl({ path, base }: {
11
15
  path: string;
12
- base?: string;
16
+ base: string | undefined;
13
17
  }): string;
14
- declare function transformEntity({ path, method, base }: {
15
- path: string;
18
+ declare function transformVerb({ method }: {
16
19
  method: string;
17
- base?: string;
18
20
  }): string;
21
+ declare function transformEntity({ path, method, base }: TransformerBaseArgs): string;
19
22
  declare function transformFn({ verb, entity }: {
20
23
  verb: string;
21
24
  entity: string;
22
- }): string;
25
+ } & TransformerBaseArgs): string;
23
26
  declare function transformType({ verb, entity }: {
24
27
  verb: string;
25
28
  entity: string;
26
- }): string;
29
+ } & TransformerBaseArgs): string;
27
30
  declare function transformTypeValue({ path, method }: {
28
- path: string;
29
- method: string;
30
- }): string;
31
- declare function transformTypeQuery({ verb, entity }: {
32
31
  verb: string;
33
32
  entity: string;
34
- }): string;
35
- declare function transformTypeQueryValue({ type }: {
33
+ } & TransformerBaseArgs): string;
34
+ declare function transformTypeQuery({ verb, entity, }: {
36
35
  type: string;
37
- }): string;
38
- declare function transformTypeRequestBody({ verb, entity }: {
39
36
  verb: string;
40
37
  entity: string;
41
- }): string;
42
- declare function transformTypeRequestBodyValue({ type, required }: {
38
+ } & TransformerBaseArgs): string;
39
+ declare function transformTypeQueryValue({ type, }: {
40
+ type: string;
41
+ verb: string;
42
+ entity: string;
43
+ } & TransformerBaseArgs): string;
44
+ declare function transformTypeRequestBody({ verb, entity, }: {
45
+ type: string;
46
+ verb: string;
47
+ entity: string;
48
+ } & TransformerBaseArgs): string;
49
+ declare function transformTypeRequestBodyValue({ type, required, }: {
43
50
  type: string;
51
+ verb: string;
52
+ entity: string;
44
53
  required: boolean;
45
- }): string;
46
- declare function transformTypeResponseBody({ verb, entity }: {
54
+ } & TransformerBaseArgs): string;
55
+ declare function transformTypeResponseBody({ verb, entity, }: {
56
+ type: string;
47
57
  verb: string;
48
58
  entity: string;
49
- }): string;
59
+ } & TransformerBaseArgs): string;
50
60
  declare function transformTypeResponseBodyValue({ type, statusCode, mime, }: {
51
61
  type: string;
62
+ verb: string;
63
+ entity: string;
52
64
  statusCode: number;
53
65
  mime: string;
54
- }): string;
66
+ } & TransformerBaseArgs): string;
55
67
  interface Transformer {
56
68
  moduleName: typeof transformModuleName;
57
69
  verb: typeof transformVerb;
@@ -251,4 +263,4 @@ type Config = GenerateOptions;
251
263
  declare function defineConfig(config: Config): GenerateOptions;
252
264
  declare function getConfig(): Promise<Config>;
253
265
 
254
- export { type ApiModule, type ApiModulePayload, type ApiModuleTemplateData, type Config, type GenerateOptions, type Preset, type StatusCodeStrategy, type StatusCodes, type Transformer, createStatusCodesByStrategy, createTransformer, defineConfig, generate, generateTypes, getCliVersion, getConfig, getResponseMime, hasQueryParameter, isRequiredRequestBody, partitionApiModules, readSchema, readTemplateFile, renderApiModules, transformEntity, transformFn, transformModuleName, transformType, transformTypeQuery, transformTypeQueryValue, transformTypeRequestBody, transformTypeRequestBodyValue, transformTypeResponseBody, transformTypeResponseBodyValue, transformTypeValue, transformUrl, transformVerb };
266
+ export { type ApiModule, type ApiModulePayload, type ApiModuleTemplateData, type Config, type GenerateOptions, type Preset, type StatusCodeStrategy, type StatusCodes, type Transformer, type TransformerBaseArgs, createStatusCodesByStrategy, createTransformer, defineConfig, generate, generateTypes, getCliVersion, getConfig, getResponseMime, hasQueryParameter, isRequiredRequestBody, partitionApiModules, readSchema, readTemplateFile, renderApiModules, transformEntity, transformFn, transformModuleName, transformType, transformTypeQuery, transformTypeQueryValue, transformTypeRequestBody, transformTypeRequestBodyValue, transformTypeResponseBody, transformTypeResponseBodyValue, transformTypeValue, transformUrl, transformVerb };
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  transformTypeValue,
20
20
  transformUrl,
21
21
  transformVerb
22
- } from "./chunk-GHW46C2M.js";
22
+ } from "./chunk-L33J46FJ.js";
23
23
  import {
24
24
  createStatusCodesByStrategy,
25
25
  getCliVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-farmer",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "API module generation tool based on Openapi3/Swagger2.",
5
5
  "keywords": [
6
6
  "cli",