ng-openapi 0.0.25-alpha.5 → 0.0.25-alpha.6

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 (3) hide show
  1. package/cli.cjs +15 -1
  2. package/index.js +15 -1
  3. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1295,7 +1295,6 @@ var ServiceMethodBodyGenerator = class {
1295
1295
  this.generateQueryParams(context),
1296
1296
  this.generateHeaders(context),
1297
1297
  this.generateMultipartFormData(operation, context),
1298
- this.generateContextHelper(),
1299
1298
  this.generateRequestOptions(context),
1300
1299
  this.generateHttpRequest(operation, context)
1301
1300
  ];
@@ -2232,6 +2231,21 @@ var ServiceGenerator = class {
2232
2231
  isReadonly: true,
2233
2232
  initializer: clientContextTokenName
2234
2233
  });
2234
+ serviceClass.addMethod({
2235
+ name: "createContextWithClientId",
2236
+ scope: import_ts_morph4.Scope.Private,
2237
+ parameters: [
2238
+ {
2239
+ name: "existingContext",
2240
+ type: "HttpContext",
2241
+ hasQuestionToken: true
2242
+ }
2243
+ ],
2244
+ returnType: "HttpContext",
2245
+ statements: `
2246
+ const context = existingContext || new HttpContext();
2247
+ return context.set(this.clientContextToken, '${this.config.clientName || "default"}');`
2248
+ });
2235
2249
  operations.forEach((operation) => {
2236
2250
  this.methodGenerator.addServiceMethod(serviceClass, operation);
2237
2251
  });
package/index.js CHANGED
@@ -1339,7 +1339,6 @@ var _ServiceMethodBodyGenerator = class _ServiceMethodBodyGenerator {
1339
1339
  this.generateQueryParams(context),
1340
1340
  this.generateHeaders(context),
1341
1341
  this.generateMultipartFormData(operation, context),
1342
- this.generateContextHelper(),
1343
1342
  this.generateRequestOptions(context),
1344
1343
  this.generateHttpRequest(operation, context)
1345
1344
  ];
@@ -2284,6 +2283,21 @@ var _ServiceGenerator = class _ServiceGenerator {
2284
2283
  isReadonly: true,
2285
2284
  initializer: clientContextTokenName
2286
2285
  });
2286
+ serviceClass.addMethod({
2287
+ name: "createContextWithClientId",
2288
+ scope: import_ts_morph4.Scope.Private,
2289
+ parameters: [
2290
+ {
2291
+ name: "existingContext",
2292
+ type: "HttpContext",
2293
+ hasQuestionToken: true
2294
+ }
2295
+ ],
2296
+ returnType: "HttpContext",
2297
+ statements: `
2298
+ const context = existingContext || new HttpContext();
2299
+ return context.set(this.clientContextToken, '${this.config.clientName || "default"}');`
2300
+ });
2287
2301
  operations.forEach((operation) => {
2288
2302
  this.methodGenerator.addServiceMethod(serviceClass, operation);
2289
2303
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-openapi",
3
- "version": "0.0.25-alpha.5",
3
+ "version": "0.0.25-alpha.6",
4
4
  "description": "Generate Angular services and TypeScript types from OpenAPI/Swagger specifications",
5
5
  "keywords": [
6
6
  "angular",