@apaleo/angular-payment-api-proxy
TypeScript icon, indicating that this package has built-in type declarations

0.12.74 • Public • Published

@

Building

To install the required dependencies and to build the typescript sources run:

npm install
npm run build

publishing

First build the package than run npm publish

consuming

Navigate to the folder of your consuming project and run one of next commands.

published:

npm install @ --save

without publishing (not recommended):

npm install PATH_TO_GENERATED_PACKAGE --save

using npm link:

In PATH_TO_GENERATED_PACKAGE:

npm link

In your project:

npm link 

Note for Windows users: The Angular CLI has troubles to use linked npm packages. Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. Published packages are not effected by this issue.

General usage

In your Angular project:

// without configuring providers
import { ApiModule } from '';
import { HttpClientModule } from '@angular/common/http';

@NgModule({
    imports: [
        ApiModule,
        // make sure to import the HttpClientModule in the AppModule only,
        // see https://github.com/angular/angular/issues/20575
        HttpClientModule
    ],
    declarations: [ AppComponent ],
    providers: [],
    bootstrap: [ AppComponent ]
})
export class AppModule {}
// configuring providers
import { ApiModule, Configuration, ConfigurationParameters } from '';

export function apiConfigFactory (): Configuration => {
  const params: ConfigurationParameters = {
    // set configuration parameters here.
  }
  return new Configuration(params);
}

@NgModule({
    imports: [ ApiModule.forRoot(apiConfigFactory) ],
    declarations: [ AppComponent ],
    providers: [],
    bootstrap: [ AppComponent ]
})
export class AppModule {}
import { DefaultApi } from '';

export class AppComponent {
	 constructor(private apiGateway: DefaultApi) { }
}

Note: The ApiModule is restricted to being instantiated once app wide. This is to ensure that all services are treated as singletons.

Using multiple swagger files / APIs / ApiModules

In order to use multiple ApiModules generated from different swagger files, you can create an alias name when importing the modules in order to avoid naming conflicts:

import { ApiModule } from 'my-api-path';
import { ApiModule as OtherApiModule } from 'my-other-api-path';
import { HttpClientModule } from '@angular/common/http';

@NgModule({
  imports: [
    ApiModule,
    OtherApiModule,
    // make sure to import the HttpClientModule in the AppModule only,
    // see https://github.com/angular/angular/issues/20575
    HttpClientModule
  ]
})
export class AppModule {

}

Set service base path

If different than the generated base path, during app bootstrap, you can provide the base path to your service.

import { BASE_PATH } from '';

bootstrap(AppComponent, [
    { provide: BASE_PATH, useValue: 'https://your-web-service.com' },
]);

or

import { BASE_PATH } from '';

@NgModule({
    imports: [],
    declarations: [ AppComponent ],
    providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],
    bootstrap: [ AppComponent ]
})
export class AppModule {}

Using @angular/cli

First extend your src/environments/*.ts files by adding the corresponding base path:

export const environment = {
  production: false,
  API_BASE_PATH: 'http://127.0.0.1:8080'
};

In the src/app/app.module.ts:

import { BASE_PATH } from '';
import { environment } from '../environments/environment';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [ ],
  providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],
  bootstrap: [ AppComponent ]
})
export class AppModule { }

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.12.742latest

Version History

VersionDownloads (Last 7 Days)Published
0.12.742
0.12.730
0.12.720
0.12.710
0.12.700
0.12.690
0.12.681
0.12.670
0.12.660
0.12.650
0.12.641
0.12.630
0.12.620
0.12.611
0.12.600
0.12.590
0.12.580
0.12.570
0.12.560
0.12.550
0.12.540
0.12.532
0.12.521
0.12.511
0.12.501
0.12.491
0.12.481
0.12.470
0.12.460
0.12.451
0.12.441
0.12.430
0.12.420
0.12.411
0.12.401
0.12.391
0.12.380
0.12.371
0.12.361
0.12.351
0.12.340
0.12.330
0.12.320
0.12.310
0.12.301
0.12.290
0.12.281
0.12.271
0.12.261
0.12.250
0.12.241
0.12.231
0.12.220
0.12.210
0.12.201
0.12.190
0.12.181
0.12.170
0.12.161
0.12.150
0.12.140
0.12.131
0.12.122
0.12.110
0.12.101
0.12.90
0.12.81
0.12.70
0.12.60
0.12.51
0.12.40
0.12.31
0.12.20
0.12.11
0.12.01
0.11.41
0.11.30
0.11.21
0.11.11
0.11.00
0.10.90
0.10.81
0.10.71
0.10.61
0.10.50
0.10.40
0.10.30
0.10.21
0.10.10
0.10.00
0.9.131
0.9.121
0.9.110
0.9.100
0.9.90
0.9.81
0.9.70
0.9.60
0.9.51
0.9.41
0.9.30
0.6.220
0.9.20
0.6.210
0.9.10
0.9.00
0.6.200
0.6.190
0.6.180
0.6.170
0.6.160
0.6.150
0.6.140
0.6.130
0.6.120
0.6.110
0.6.100
2.0.30
0.6.90
0.6.80
2.0.20
2.0.10
2.0.00
0.6.70
0.6.60
0.6.50
0.6.40
0.6.30
0.6.20
0.6.11
0.6.01
0.5.80
0.5.70
0.5.60
0.5.50
0.5.40
0.5.30
0.5.20
0.5.10
0.4.80
0.4.70
0.4.60
0.4.50
0.4.41
0.4.10
0.1.290
0.1.280
0.1.270
0.1.260
0.1.250
0.1.240
0.1.230
0.1.220
0.1.210
0.1.200
0.1.190
0.1.180
0.1.170
0.1.160
0.1.150
0.1.140
0.1.130
0.1.120
0.1.110
0.1.100
0.1.90
0.1.80
0.1.71
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00

Package Sidebar

Install

npm i @apaleo/angular-payment-api-proxy

Weekly Downloads

54

Version

0.12.74

License

Apache-2.0

Unpacked Size

2.31 MB

Total Files

165

Last publish

Collaborators

  • pgrm
  • apaleo-operations