{"_id":"@artful-ai/rest-crud-api-interface-ng","_rev":"1-113aaf712ca7600427e7729546743bfd","name":"@artful-ai/rest-crud-api-interface-ng","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@artful-ai/rest-crud-api-interface-ng","version":"1.0.0","description":"an angular interface to the artful.ai api rest-crud","main":"index.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"roman pshichenko"},"license":"MIT","_id":"@artful-ai/rest-crud-api-interface-ng@1.0.0","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Q8p9leFXzckmZrJzpdqbv93m6Xa3WEugmO2JI4OZ3VjP4KJUCQxXXXCSYC1rxA5KlVoQzMBGuCpweaJZzz4hpA==","shasum":"be0fe31071afb2edfb600492767c2b297f9e7b93","tarball":"https://registry.npmjs.org/@artful-ai/rest-crud-api-interface-ng/-/rest-crud-api-interface-ng-1.0.0.tgz","fileCount":21,"unpackedSize":41919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu2XPCRA9TVsSAnZWagAAG18P/3zsWKBf1IDv6cm0tBXH\nVZTVQZMbjAv+4giyjZfSMlpQtzfoCwBYHF/bdRABckQnIY6AOU4EMbiOoKuz\noRMGxz+IGLAgCgEqo5lwEruL7EXATkkj3WevurC95tAKGgWQ1SpyW3FHTEm4\nyYyqBJJpCN1+ruAVoSVu0rHLAEPq1kTlgTfP+ZAyl8wIH3lxblIR1ammJTPE\nz3Uj2RMuURCAFIKYCD9yGLUdCHJdpCIFFoc/WcTwEBZE9RvqvZnoz88/E4Zq\nY9uQdgq2br/0BCmJ2FOiwVwue9j8snb0dsumHXpCbBu9p4uu19iMlQBveQVy\nBYhEuKrpn8h/S+z9H0eMV6scVKQVeH4BFdhAzZl4H1BlbMqEnL77Shrj3e8c\nB1zPKQJVO8F4uD7vwZB14oiR1s9kauJb8LRd9VY+NpjCqmRDMpVRWciKz54e\nWO2HqWmcD6oHqy73UZKBRaoTK6bnxq6QaJyfp/xf13RSrqBiSMVnsxMxDKoJ\nzLlKy3Bkpe6NlQ+8vVWifQk7cqIlMQqTnne6D1/fi6vbd/LpKnKCgtZXDLsm\nMXBtrS43gg31Kp2FNfEJYHmQwJzUgcMOvn79C0Cw1dYsjnKN2xXd+noQ8kfC\nzLTNROVA+Y9f3jQl+Mxt+d0ZnqTaKfY8dKCLIZC2J0VbJjWcyqdIhrWl4Xc9\nzIN1\r\n=RS68\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFUuOHoYAwJjWMe7J2xtNuq5I9sGYblXx4Hc4YglZ+WkAiEAwLGSQuCcVEV6atD1c1jxjX3r7PgYtFGI9p16cI9hkGU="}]},"maintainers":[{"name":"artful-ai","email":"pshichenko@hotmail.com"}],"_npmUser":{"name":"artful-ai","email":"pshichenko@hotmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rest-crud-api-interface-ng_1.0.0_1589339599112_0.000649987856355283"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-13T03:13:19.076Z","1.0.0":"2020-05-13T03:13:19.230Z","modified":"2022-04-04T15:37:13.372Z"},"maintainers":[{"name":"artful-ai","email":"pshichenko@hotmail.com"}],"description":"an angular interface to the artful.ai api rest-crud","author":{"name":"roman pshichenko"},"license":"MIT","readme":"## @\n\n### Building\n\nTo install the required dependencies and to build the typescript sources run:\n```\nnpm install\nnpm run build\n```\n\n### publishing\n\nFirst build the package then run ```npm publish```\n\n### consuming\n\nNavigate to the folder of your consuming project and run one of next commands.\n\n_published:_\n\n```\nnpm install @ --save\n```\n\n_without publishing (not recommended):_\n\n```\nnpm install PATH_TO_GENERATED_PACKAGE/-.tgz --save\n```\n\n_It's important to take the tgz file, otherwise you'll get trouble with links on windows_\n\n_using `npm link`:_\n\nIn PATH_TO_GENERATED_PACKAGE:\n```\nnpm link\n```\n\nIn your project:\n```\nnpm link \n```\n\n__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.\nPlease refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.\nPublished packages are not effected by this issue.\n\n\n#### General usage\n\nIn your Angular project:\n\n\n```\n// without configuring providers\nimport { ApiModule } from '';\nimport { HttpClientModule } from '@angular/common/http';\n\n\n@NgModule({\n    imports: [\n        ApiModule,\n        // make sure to import the HttpClientModule in the AppModule only,\n        // see https://github.com/angular/angular/issues/20575\n        HttpClientModule\n    ],\n    declarations: [ AppComponent ],\n    providers: [],\n    bootstrap: [ AppComponent ]\n})\nexport class AppModule {}\n```\n\n```\n// configuring providers\nimport { ApiModule, Configuration, ConfigurationParameters } from '';\n\nexport function apiConfigFactory (): Configuration => {\n  const params: ConfigurationParameters = {\n    // set configuration parameters here.\n  }\n  return new Configuration(params);\n}\n\n@NgModule({\n    imports: [ ApiModule.forRoot(apiConfigFactory) ],\n    declarations: [ AppComponent ],\n    providers: [],\n    bootstrap: [ AppComponent ]\n})\nexport class AppModule {}\n```\n\n```\n// configuring providers with an authentication service that manages your access tokens\nimport { ApiModule, Configuration } from '';\n\n@NgModule({\n    imports: [ ApiModule ],\n    declarations: [ AppComponent ],\n    providers: [\n      {\n        provide: Configuration,\n        useFactory: (authService: AuthService) => new Configuration(\n          {\n            basePath: environment.apiUrl,\n            accessToken: authService.getAccessToken.bind(authService)\n          }\n        ),\n        deps: [AuthService],\n        multi: false\n      }\n    ],\n    bootstrap: [ AppComponent ]\n})\nexport class AppModule {}\n```\n\n```\nimport { DefaultApi } from '';\n\nexport class AppComponent {\n\t constructor(private apiGateway: DefaultApi) { }\n}\n```\n\nNote: The ApiModule is restricted to being instantiated once app wide.\nThis is to ensure that all services are treated as singletons.\n\n#### Using multiple OpenAPI files / APIs / ApiModules\nIn order to use multiple `ApiModules` generated from different OpenAPI files,\nyou can create an alias name when importing the modules\nin order to avoid naming conflicts:\n```\nimport { ApiModule } from 'my-api-path';\nimport { ApiModule as OtherApiModule } from 'my-other-api-path';\nimport { HttpClientModule } from '@angular/common/http';\n\n\n@NgModule({\n  imports: [\n    ApiModule,\n    OtherApiModule,\n    // make sure to import the HttpClientModule in the AppModule only,\n    // see https://github.com/angular/angular/issues/20575\n    HttpClientModule\n  ]\n})\nexport class AppModule {\n\n}\n```\n\n\n### Set service base path\nIf different than the generated base path, during app bootstrap, you can provide the base path to your service. \n\n```\nimport { BASE_PATH } from '';\n\nbootstrap(AppComponent, [\n    { provide: BASE_PATH, useValue: 'https://your-web-service.com' },\n]);\n```\nor\n\n```\nimport { BASE_PATH } from '';\n\n@NgModule({\n    imports: [],\n    declarations: [ AppComponent ],\n    providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],\n    bootstrap: [ AppComponent ]\n})\nexport class AppModule {}\n```\n\n\n#### Using @angular/cli\nFirst extend your `src/environments/*.ts` files by adding the corresponding base path:\n\n```\nexport const environment = {\n  production: false,\n  API_BASE_PATH: 'http://127.0.0.1:8080'\n};\n```\n\nIn the src/app/app.module.ts:\n```\nimport { BASE_PATH } from '';\nimport { environment } from '../environments/environment';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [ ],\n  providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],\n  bootstrap: [ AppComponent ]\n})\nexport class AppModule { }\n```  \n","readmeFilename":"README.md"}