{"id":29099902,"url":"https://github.com/bcc-code/tripletex-client-dotnet","last_synced_at":"2025-06-28T17:37:48.576Z","repository":{"id":64342903,"uuid":"563756496","full_name":"bcc-code/tripletex-client-dotnet","owner":"bcc-code","description":"[BCC IT] SDK for Tripltex API","archived":false,"fork":false,"pushed_at":"2024-12-13T04:44:22.000Z","size":2003,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-21T01:59:13.084Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcc-code.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":"2022-11-09T09:14:07.000Z","updated_at":"2024-12-13T04:44:26.000Z","dependencies_parsed_at":"2024-07-12T12:57:44.943Z","dependency_job_id":"f314c5d5-60f3-4589-af21-3d9a9e7c44bd","html_url":"https://github.com/bcc-code/tripletex-client-dotnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bcc-code/tripletex-client-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcc-code%2Ftripletex-client-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcc-code%2Ftripletex-client-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcc-code%2Ftripletex-client-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcc-code%2Ftripletex-client-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcc-code","download_url":"https://codeload.github.com/bcc-code/tripletex-client-dotnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcc-code%2Ftripletex-client-dotnet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261960494,"owners_count":23236570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-06-28T17:37:47.731Z","updated_at":"2025-06-28T17:37:48.570Z","avatar_url":"https://github.com/bcc-code.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tripletex Client for .Net\n\nA .Net Client/SDK based on the Tripletex swagger specification: https://tripletex.no/v2/swagger.json\n\nAvailable as NuGet package `https://www.nuget.org/packages/BccCode.Tripletex.Client`\n\n## Project Structure\n\n* **BccCode.Tripletex.Client** - SDK\n    - TripletexClientGenerated.cs -- client generated using NSwag.net\n\t- TripletexClient.cs -- custom extentions to generated client, to better facilitate authentication, token caching etc.\n\n* **BccCode.Tripletex.Tests** - SDK tests\n\n\n## Updating client \nIn order to re-generate the client code (based on a new swagger specification):\n1. open the project in Visual Studio 2022\n2. Select \"Generate\" as the build configuration (instead of Release or Debug)\n3. Build the project\n\nThe project file includes a number of \"PreBuildEvents\" which are run when the project is built in with \"Generate\" configuration selected.   \nThese prebuild tasks perform the following operations:\n* Generate code using Nswag.net using the configuration in `nswag.json`\n* Removes invalid characters such as '\u003e' and ':' which are included in the path names of some of the Tripltex API endpoints\n* Transforms the name and positioning of \"verbs\" used as part of the method names.\n* Removes \"required\" JSON validation which doesn't work since Tripletex doesn't always return the entire model.\n\n## .Net SDK\n\nTo use the SDK in a .Net application, add the `BccCode.Tripletex.Client` nuget package.\n\nThe `ITripletexClient` service can be added to the applications services during startup (startup.cs or program.cs) using the following code (.net 6):\n\n```csharp\n\\\\ ...\n\nbuilder.Services.AddTripletexClient(new TripletexClientOptions\n{\n    EmployeeToken = \"\u003cyour employee token\u003e\",\n    ConsumerToken = \"\u003cyour consumer token\u003e\"\n\n});\n\n```\n\nAlternatively, the configuration can be read automatically from a \"Tripletex\" section in your configuration:\n\n```csharp\n\\\\ ...\n\nbuilder.Services.AddTripletexClient(); //Read from \"Tripletex\" configuration section:\n\n```\n\n**appsettings.json**\n```json\n\n{\n  \"Tripletex\": {\n    \"EmployeeToken\": \"\u003cUSE USER SECRETS\u003e\",\n    \"ConsumerToken\": \"\u003cUSE USER SECRETS\u003e\"\n  }\n}\n```\n\n**Environment Variables**\n```bash\n\nTRIPLETEX__EMPLOYEETOKEN=\u003cyour employee token\u003e\nTRIPLETEX__CONSUMERTOKEN=\u003cyour employee token\u003e\n\n\n```\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcc-code%2Ftripletex-client-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcc-code%2Ftripletex-client-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcc-code%2Ftripletex-client-dotnet/lists"}