@goast/typescript 0.3.8-beta1 → 0.3.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.
@@ -94,15 +94,15 @@ export class DefaultTypeScriptEasyNetworkStubGenerator extends TypeScriptFileGen
94
94
  ],
95
95
  returnType: 'this',
96
96
  body: appendValueGroup([
97
- s `this.stubWrapper.stub2<${requestType}>()(${s.indent `
98
- ${ts.string(endpoint.method.toUpperCase())},
99
- ${this.getStubClassName(ctx)}.${this.getEndpointPathPropertyName(ctx, endpoint)},
100
- async (request) => {${s.indent `
101
- if (this.stubWrapper.options.rememberRequests) {${s.indent `
102
- this.${this.getEndpointRequestsFieldName(ctx, endpoint)}.push(request);`}
103
- }
104
- throw await response(${this.getResponderVariableName(ctx, endpoint)}, request);`}
105
- }`}
97
+ s `this.stubWrapper.stub2<${requestType}>()(${s.indent `
98
+ ${ts.string(endpoint.method.toUpperCase())},
99
+ ${this.getStubClassName(ctx)}.${this.getEndpointPathPropertyName(ctx, endpoint)},
100
+ async (request) => {${s.indent `
101
+ if (this.stubWrapper.options.rememberRequests) {${s.indent `
102
+ this.${this.getEndpointRequestsFieldName(ctx, endpoint)}.push(request);`}
103
+ }
104
+ throw await response(${this.getResponderVariableName(ctx, endpoint)}, request);`}
105
+ }`}
106
106
  );`,
107
107
  'return this;',
108
108
  ], '\n'),
@@ -133,7 +133,7 @@ export class DefaultTypeScriptFetchClientGenerator extends TypeScriptFileGenerat
133
133
  const method = this.getInterfaceEndpointMethod(ctx, endpoint);
134
134
  method.accessModifier = 'public';
135
135
  method.body = appendValueGroup([
136
- s `const url = new ${ctx.refs.urlBuilder()}(this.options.baseUrl)${s.indent `
136
+ s `const url = new ${ctx.refs.urlBuilder()}(this.options.baseUrl)${s.indent `
137
137
  .withPath(${ts.string(endpoint.path)})${(b) => b.forEach(endpoint.parameters, (b, p) => {
138
138
  switch (p.target) {
139
139
  case 'path':
@@ -143,7 +143,7 @@ export class DefaultTypeScriptFetchClientGenerator extends TypeScriptFileGenerat
143
143
  b.append(s `\n.withQueryParam(${ts.string(p.name)}, params.${toCasing(p.name, ctx.config.paramNameCasing)})`);
144
144
  break;
145
145
  }
146
- })}
146
+ })}
147
147
  .build();`}`,
148
148
  s `const response = (this.options.fetch ?? fetch)(url, ${ts.object({
149
149
  members: [
@@ -186,7 +186,7 @@ export class DefaultTypeScriptK6ClientGenerator extends TypeScriptFileGenerator
186
186
  ],
187
187
  }),
188
188
  parameters: [ts.constructorParameter('rootUrl'), ts.constructorParameter('defaultK6ParamsFactory')],
189
- body: s `this.rootUrl = rootUrl;
189
+ body: s `this.rootUrl = rootUrl;
190
190
  this._defaultK6ParamsFactory = defaultK6ParamsFactory;`,
191
191
  }),
192
192
  ...ctx.service.endpoints.map((e) => this.getEndpointMethod(ctx, e)),
@@ -245,11 +245,11 @@ export class DefaultTypeScriptK6ClientGenerator extends TypeScriptFileGenerator
245
245
  }
246
246
  : null,
247
247
  '',
248
- s `return /** @type {${returnType}} */ (${s.indent `
249
- ${ctx.config.async ? 'await rb.buildAsync' : 'rb.build'}({${s.indent `
250
- accept: ${ts.string(accept)},
251
- params: this.getK6Params(k6Params),`}
252
- })`}
248
+ s `return /** @type {${returnType}} */ (${s.indent `
249
+ ${ctx.config.async ? 'await rb.buildAsync' : 'rb.build'}({${s.indent `
250
+ accept: ${ts.string(accept)},
251
+ params: this.getK6Params(k6Params),`}
252
+ })`}
253
253
  );`,
254
254
  ], '\n'),
255
255
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goast/typescript",
3
- "version": "0.3.8-beta1",
3
+ "version": "0.3.8",
4
4
  "repository": "https://github.com/MaSch0212/goast.git",
5
5
  "description": "Provides gOAst generators for generating TypeScript code from OpenAPI specifications.",
6
6
  "keywords": [
@@ -30,6 +30,7 @@
30
30
  "@goast/core": "0.3.5",
31
31
  "tslib": "2.6.3"
32
32
  },
33
+ "packageManager": "pnpm@9.5.0",
33
34
  "module": "./esm/index.js",
34
35
  "main": "./cjs/index.js",
35
36
  "types": "./types/index.d.ts",
@@ -41,4 +42,4 @@
41
42
  },
42
43
  "./package.json": "./package.json"
43
44
  }
44
- }
45
+ }