@meshmakers/octo-services 3.3.34 → 3.3.380

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.
package/README.md CHANGED
@@ -1,24 +1,105 @@
1
- # OctoServices
1
+ # @meshmakers/octo-services
2
2
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0.
3
+ Angular library providing services for interacting with OctoMesh backend APIs.
4
4
 
5
- ## Code scaffolding
5
+ ## Features
6
6
 
7
- Run `ng generate component component-name --project octo-services` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project octo-services`.
8
- > Note: Don't forget to add `--project octo-services` or else it will be added to the default project in your `angular.json` file.
7
+ - **HTTP Services** - REST API clients for Asset Repository, Identity Service, Bot Service
8
+ - **GraphQL Services** - Construction Kit queries for types, attributes, and models
9
+ - **Job Management** - Background job execution with progress tracking
10
+ - **Error Handling** - Apollo Link for GraphQL error handling with user notifications
9
11
 
10
- ## Build
12
+ ## Documentation
13
+
14
+ - [Developer Documentation](docs/README.md) - Complete API reference and usage examples
15
+ - [AI Context](CLAUDE.md) - Guidelines for AI-assisted development
16
+
17
+ ## Quick Start
18
+
19
+ ### 1. Implement Configuration Service
20
+
21
+ ```typescript
22
+ import { Injectable } from '@angular/core';
23
+ import { IConfigurationService, AddInConfiguration } from '@meshmakers/octo-services';
24
+
25
+ @Injectable({ providedIn: 'root' })
26
+ export class AppConfigurationService implements IConfigurationService {
27
+ private _config: AddInConfiguration = {} as AddInConfiguration;
28
+
29
+ get config(): AddInConfiguration {
30
+ return this._config;
31
+ }
32
+
33
+ async loadConfigAsync(): Promise<void> {
34
+ this._config = await fetch('/assets/config.json').then(r => r.json());
35
+ }
36
+ }
37
+ ```
38
+
39
+ ### 2. Register Providers
11
40
 
12
- Run `ng build octo-services` to build the project. The build artifacts will be stored in the `dist/` directory.
41
+ ```typescript
42
+ import { CONFIGURATION_SERVICE } from '@meshmakers/octo-services';
43
+ import { AppConfigurationService } from './services/app-configuration.service';
13
44
 
14
- ## Publishing
45
+ export const appConfig: ApplicationConfig = {
46
+ providers: [
47
+ { provide: CONFIGURATION_SERVICE, useClass: AppConfigurationService }
48
+ ]
49
+ };
50
+ ```
51
+
52
+ ### 3. Use Services
53
+
54
+ ```typescript
55
+ import { HealthService, CkTypeSelectorService } from '@meshmakers/octo-services';
56
+
57
+ @Component({ ... })
58
+ export class MyComponent {
59
+ private readonly healthService = inject(HealthService);
60
+ private readonly ckTypeSelector = inject(CkTypeSelectorService);
61
+
62
+ async checkHealth(): Promise<void> {
63
+ const health = await this.healthService.getAssetRepoServiceHealthAsync();
64
+ console.log('Status:', health?.status);
65
+ }
66
+
67
+ loadTypes(): void {
68
+ this.ckTypeSelector.getCkTypes({ searchText: 'Customer' })
69
+ .subscribe(result => console.log('Types:', result.items));
70
+ }
71
+ }
72
+ ```
73
+
74
+ ## Available Services
75
+
76
+ | Service | Description |
77
+ |---------|-------------|
78
+ | `HealthService` | Backend health checks |
79
+ | `AssetRepoService` | Tenant and model management |
80
+ | `IdentityService` | User, role, and client management |
81
+ | `BotService` | Background job execution |
82
+ | `JobManagementService` | Job progress tracking with UI |
83
+ | `CkTypeSelectorService` | Query CK types |
84
+ | `CkTypeAttributeService` | Query CK type/record attributes |
85
+ | `CkModelService` | Check model availability and versions |
86
+ | `AttributeSelectorService` | Query available query columns |
87
+
88
+ ## Build
15
89
 
16
- After building your library with `ng build octo-services`, go to the dist folder `cd dist/octo-services` and run `npm publish`.
90
+ ```bash
91
+ # From frontend-libraries directory
92
+ npm run build:octo-services
93
+ ```
17
94
 
18
- ## Running unit tests
95
+ ## Test
19
96
 
20
- Run `ng test octo-services` to execute the unit tests via [Karma](https://karma-runner.github.io).
97
+ ```bash
98
+ npm test -- --project=@meshmakers/octo-services --watch=false
99
+ ```
21
100
 
22
- ## Further help
101
+ ## Lint
23
102
 
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
103
+ ```bash
104
+ npx ng lint @meshmakers/octo-services
105
+ ```