{"id":25830877,"url":"https://github.com/lab5e/ng-spanapi","last_synced_at":"2026-01-24T23:33:33.011Z","repository":{"id":97095606,"uuid":"359820221","full_name":"lab5e/ng-spanapi","owner":"lab5e","description":"Angular client library for the Span API","archived":false,"fork":false,"pushed_at":"2025-06-11T21:58:58.000Z","size":477,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-08T14:18:58.462Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lab5e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-20T13:10:41.000Z","updated_at":"2025-06-11T21:59:02.000Z","dependencies_parsed_at":"2024-08-28T15:45:17.574Z","dependency_job_id":"1482065f-4dfc-4a3c-9cdb-eebb96dafc69","html_url":"https://github.com/lab5e/ng-spanapi","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/lab5e/ng-spanapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-spanapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-spanapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-spanapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-spanapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lab5e","download_url":"https://codeload.github.com/lab5e/ng-spanapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-spanapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28739003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-28T19:34:28.169Z","updated_at":"2026-01-24T23:33:31.701Z","avatar_url":"https://github.com/lab5e.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## @lab5e/ng-spanapi@5.0.5\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 dist``` (don't forget to specify the `dist` folder!)\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 @lab5e/ng-spanapi@5.0.5 --save\n```\n\n_without publishing (not recommended):_\n\n```\nnpm install PATH_TO_GENERATED_PACKAGE/dist.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/dist:\n```\nnpm link\n```\n\nIn your project:\n```\nnpm link @lab5e/ng-spanapi\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 '@lab5e/ng-spanapi';\nimport { HttpClientModule } from '@angular/common/http';\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 '@lab5e/ng-spanapi';\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 '@lab5e/ng-spanapi';\n\n@NgModule({\n    imports: [ ApiModule ],\n    declarations: [ AppComponent ],\n    providers: [\n      {\n        provide: Configuration,\n        useFactory: (authService: AuthService) =\u003e 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 '@lab5e/ng-spanapi';\n\nexport class AppComponent {\n    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@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 '@lab5e/ng-spanapi';\n\nbootstrap(AppComponent, [\n    { provide: BASE_PATH, useValue: 'https://your-web-service.com' },\n]);\n```\nor\n\n```\nimport { BASE_PATH } from '@lab5e/ng-spanapi';\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 '@lab5e/ng-spanapi';\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\n### Customizing path parameter encoding\n\nWithout further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'\nand Dates for format 'date-time' are encoded correctly.\n\nOther styles (e.g. \"matrix\") are not that easy to encode\nand thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).\n\nTo implement your own parameter encoding (or call another library),\npass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object\n(see [General Usage](#general-usage) above).\n\nExample value for use in your Configuration-Provider:\n```typescript\nnew Configuration({\n    encodeParam: (param: Param) =\u003e myFancyParamEncoder(param),\n})\n```\n\n[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations\n[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values\n[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab5e%2Fng-spanapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flab5e%2Fng-spanapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab5e%2Fng-spanapi/lists"}