@ng-openapi/http-resource 0.0.19 → 0.0.21-pr-39-bugfix-missing-rxjs-import-f652172.0

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 (4) hide show
  1. package/index.cjs +35 -10
  2. package/index.d.ts +0 -1
  3. package/index.js +35 -10
  4. package/package.json +1 -1
package/index.cjs CHANGED
@@ -3458,26 +3458,51 @@ var HttpResourceGenerator = class {
3458
3458
  const sourceFile = this.project.createSourceFile(filePath, "", {
3459
3459
  overwrite: true
3460
3460
  });
3461
- this.addImports(sourceFile);
3462
3461
  this.addServiceClass(sourceFile, resourceName, operations);
3463
- sourceFile.fixMissingImports().organizeImports().formatText();
3462
+ sourceFile.fixMissingImports().formatText();
3464
3463
  sourceFile.saveSync();
3465
3464
  }
3466
- addImports(sourceFile) {
3465
+ addServiceClass(sourceFile, resourceName, operations) {
3466
+ const className = `${resourceName}`;
3467
+ const basePathTokenName = getBasePathTokenName(this.config.clientName);
3468
+ const clientContextTokenName = getClientContextTokenName(this.config.clientName);
3469
+ sourceFile.insertText(0, HTTP_RESOURCE_GENERATOR_HEADER_COMMENT(resourceName));
3467
3470
  sourceFile.addImportDeclarations([
3468
3471
  {
3469
3472
  namedImports: [
3470
- "Injectable"
3473
+ "HttpContext",
3474
+ "HttpContextToken",
3475
+ "HttpHeaders",
3476
+ "HttpParams",
3477
+ "httpResource",
3478
+ "HttpResourceOptions",
3479
+ "HttpResourceRef",
3480
+ "HttpResourceRequest"
3481
+ ],
3482
+ moduleSpecifier: "@angular/common/http"
3483
+ },
3484
+ {
3485
+ namedImports: [
3486
+ "inject",
3487
+ "Injectable",
3488
+ "Signal"
3471
3489
  ],
3472
3490
  moduleSpecifier: "@angular/core"
3491
+ },
3492
+ {
3493
+ namedImports: [
3494
+ basePathTokenName,
3495
+ clientContextTokenName
3496
+ ],
3497
+ moduleSpecifier: "../tokens"
3498
+ },
3499
+ {
3500
+ namedImports: [
3501
+ "HttpParamsBuilder"
3502
+ ],
3503
+ moduleSpecifier: "../utils/http-params-builder"
3473
3504
  }
3474
3505
  ]);
3475
- }
3476
- addServiceClass(sourceFile, resourceName, operations) {
3477
- const className = `${resourceName}`;
3478
- const basePathTokenName = getBasePathTokenName(this.config.clientName);
3479
- const clientContextTokenName = getClientContextTokenName(this.config.clientName);
3480
- sourceFile.insertText(0, HTTP_RESOURCE_GENERATOR_HEADER_COMMENT(resourceName));
3481
3506
  const serviceClass = sourceFile.addClass({
3482
3507
  name: className,
3483
3508
  isExported: true,
package/index.d.ts CHANGED
@@ -148,7 +148,6 @@ declare class HttpResourceGenerator implements IPluginGenerator {
148
148
  generate(outputRoot: string): Promise<void>;
149
149
  private groupPathsByController;
150
150
  private generateServiceFile;
151
- private addImports;
152
151
  private addServiceClass;
153
152
  }
154
153
 
package/index.js CHANGED
@@ -3424,26 +3424,51 @@ var HttpResourceGenerator = class {
3424
3424
  const sourceFile = this.project.createSourceFile(filePath, "", {
3425
3425
  overwrite: true
3426
3426
  });
3427
- this.addImports(sourceFile);
3428
3427
  this.addServiceClass(sourceFile, resourceName, operations);
3429
- sourceFile.fixMissingImports().organizeImports().formatText();
3428
+ sourceFile.fixMissingImports().formatText();
3430
3429
  sourceFile.saveSync();
3431
3430
  }
3432
- addImports(sourceFile) {
3431
+ addServiceClass(sourceFile, resourceName, operations) {
3432
+ const className = `${resourceName}`;
3433
+ const basePathTokenName = getBasePathTokenName(this.config.clientName);
3434
+ const clientContextTokenName = getClientContextTokenName(this.config.clientName);
3435
+ sourceFile.insertText(0, HTTP_RESOURCE_GENERATOR_HEADER_COMMENT(resourceName));
3433
3436
  sourceFile.addImportDeclarations([
3434
3437
  {
3435
3438
  namedImports: [
3436
- "Injectable"
3439
+ "HttpContext",
3440
+ "HttpContextToken",
3441
+ "HttpHeaders",
3442
+ "HttpParams",
3443
+ "httpResource",
3444
+ "HttpResourceOptions",
3445
+ "HttpResourceRef",
3446
+ "HttpResourceRequest"
3447
+ ],
3448
+ moduleSpecifier: "@angular/common/http"
3449
+ },
3450
+ {
3451
+ namedImports: [
3452
+ "inject",
3453
+ "Injectable",
3454
+ "Signal"
3437
3455
  ],
3438
3456
  moduleSpecifier: "@angular/core"
3457
+ },
3458
+ {
3459
+ namedImports: [
3460
+ basePathTokenName,
3461
+ clientContextTokenName
3462
+ ],
3463
+ moduleSpecifier: "../tokens"
3464
+ },
3465
+ {
3466
+ namedImports: [
3467
+ "HttpParamsBuilder"
3468
+ ],
3469
+ moduleSpecifier: "../utils/http-params-builder"
3439
3470
  }
3440
3471
  ]);
3441
- }
3442
- addServiceClass(sourceFile, resourceName, operations) {
3443
- const className = `${resourceName}`;
3444
- const basePathTokenName = getBasePathTokenName(this.config.clientName);
3445
- const clientContextTokenName = getClientContextTokenName(this.config.clientName);
3446
- sourceFile.insertText(0, HTTP_RESOURCE_GENERATOR_HEADER_COMMENT(resourceName));
3447
3472
  const serviceClass = sourceFile.addClass({
3448
3473
  name: className,
3449
3474
  isExported: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-openapi/http-resource",
3
- "version": "0.0.19",
3
+ "version": "0.0.21-pr-39-bugfix-missing-rxjs-import-f652172.0",
4
4
  "description": "HTTP Resource plugin for ng-openapi - Angular HTTP utilities with caching and state management",
5
5
  "keywords": [
6
6
  "angular",