@en-solutions/tgm-client-sdk 1.6.21
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/LICENSE +19 -0
- package/README.md +788 -0
- package/esm2022/en-solutions-tgm-client-sdk.mjs +5 -0
- package/esm2022/lib/components/database-manager/database-manager/database-manager.component.mjs +308 -0
- package/esm2022/lib/components/database-manager/database-manager.module.mjs +66 -0
- package/esm2022/lib/components/database-manager/object-browser/object-browser.component.mjs +98 -0
- package/esm2022/lib/components/database-manager/query-editor/query-editor.component.mjs +196 -0
- package/esm2022/lib/components/database-manager/query-toolbar/query-toolbar.component.mjs +70 -0
- package/esm2022/lib/components/database-manager/record-detail/record-detail.component.mjs +112 -0
- package/esm2022/lib/components/database-manager/registry/entity-registry.mjs +512 -0
- package/esm2022/lib/components/database-manager/results-grid/results-grid.component.mjs +165 -0
- package/esm2022/lib/components/database-manager/services/entity-schema.service.mjs +91 -0
- package/esm2022/lib/components/database-manager/services/query-executor.service.mjs +204 -0
- package/esm2022/lib/components/database-manager/table-data-viewer/table-data-viewer.component.mjs +166 -0
- package/esm2022/lib/components/database-manager/table-structure/table-structure.component.mjs +42 -0
- package/esm2022/lib/components/database-manager/types/database-manager.types.mjs +6 -0
- package/esm2022/lib/components/reporting/export-button/export-button.component.mjs +203 -0
- package/esm2022/lib/components/reporting/generated-report-list/generated-report-list.component.mjs +285 -0
- package/esm2022/lib/components/reporting/report-definition-form/report-definition-form.component.mjs +206 -0
- package/esm2022/lib/components/reporting/report-definition-list/report-definition-list.component.mjs +252 -0
- package/esm2022/lib/components/reporting/report-generate-dialog/report-generate-dialog.component.mjs +122 -0
- package/esm2022/lib/components/reporting/report-stats/report-stats.component.mjs +164 -0
- package/esm2022/lib/components/reporting/report-template-list/report-template-list.component.mjs +114 -0
- package/esm2022/lib/components/reporting/reporting.module.mjs +60 -0
- package/esm2022/lib/components/video-call/incoming-call/incoming-call.component.mjs +80 -0
- package/esm2022/lib/components/video-call/services/livekit-room.service.mjs +142 -0
- package/esm2022/lib/components/video-call/services/video-call-signaling.service.mjs +42 -0
- package/esm2022/lib/components/video-call/services/video-call-state.service.mjs +52 -0
- package/esm2022/lib/components/video-call/types/video-call.types.mjs +2 -0
- package/esm2022/lib/components/video-call/video-call.module.mjs +42 -0
- package/esm2022/lib/components/video-call/video-controls/video-controls.component.mjs +33 -0
- package/esm2022/lib/components/video-call/video-participant/video-participant.component.mjs +68 -0
- package/esm2022/lib/components/video-call/video-room/video-room.component.mjs +89 -0
- package/esm2022/lib/core/auth-interceptor.mjs +33 -0
- package/esm2022/lib/core/client-interceptor.mjs +34 -0
- package/esm2022/lib/core/error-handler.mjs +32 -0
- package/esm2022/lib/core/http-client.service.mjs +254 -0
- package/esm2022/lib/core/websocket.service.mjs +185 -0
- package/esm2022/lib/models/admin/audit.models.mjs +2 -0
- package/esm2022/lib/models/admin/backup.models.mjs +2 -0
- package/esm2022/lib/models/admin/client.models.mjs +2 -0
- package/esm2022/lib/models/admin/email-provider.models.mjs +2 -0
- package/esm2022/lib/models/admin/erp.models.mjs +2 -0
- package/esm2022/lib/models/admin/identity-provider.models.mjs +2 -0
- package/esm2022/lib/models/admin/index.mjs +14 -0
- package/esm2022/lib/models/admin/messaging-provider.models.mjs +2 -0
- package/esm2022/lib/models/admin/platform-admin.models.mjs +2 -0
- package/esm2022/lib/models/admin/queue.models.mjs +2 -0
- package/esm2022/lib/models/admin/role.models.mjs +2 -0
- package/esm2022/lib/models/admin/sandbox.models.mjs +2 -0
- package/esm2022/lib/models/admin/ticket.models.mjs +2 -0
- package/esm2022/lib/models/admin/webhook.models.mjs +2 -0
- package/esm2022/lib/models/api/ai.models.mjs +2 -0
- package/esm2022/lib/models/api/aip.models.mjs +2 -0
- package/esm2022/lib/models/api/cat.models.mjs +2 -0
- package/esm2022/lib/models/api/company.models.mjs +2 -0
- package/esm2022/lib/models/api/compliance.models.mjs +2 -0
- package/esm2022/lib/models/api/component.models.mjs +2 -0
- package/esm2022/lib/models/api/cortex-edge.models.mjs +2 -0
- package/esm2022/lib/models/api/cortex-event.models.mjs +2 -0
- package/esm2022/lib/models/api/cortex-insight.models.mjs +2 -0
- package/esm2022/lib/models/api/cortex-node.models.mjs +2 -0
- package/esm2022/lib/models/api/custom-field.models.mjs +2 -0
- package/esm2022/lib/models/api/deferral.models.mjs +2 -0
- package/esm2022/lib/models/api/diagnostic-report.models.mjs +2 -0
- package/esm2022/lib/models/api/document.models.mjs +2 -0
- package/esm2022/lib/models/api/energy.models.mjs +2 -0
- package/esm2022/lib/models/api/failure.models.mjs +2 -0
- package/esm2022/lib/models/api/fleet.models.mjs +2 -0
- package/esm2022/lib/models/api/inspection.models.mjs +2 -0
- package/esm2022/lib/models/api/intervention.models.mjs +2 -0
- package/esm2022/lib/models/api/iot.models.mjs +2 -0
- package/esm2022/lib/models/api/knowledge.models.mjs +2 -0
- package/esm2022/lib/models/api/loto.models.mjs +2 -0
- package/esm2022/lib/models/api/maintenance-record.models.mjs +2 -0
- package/esm2022/lib/models/api/maintenance.models.mjs +2 -0
- package/esm2022/lib/models/api/material.models.mjs +2 -0
- package/esm2022/lib/models/api/media.models.mjs +2 -0
- package/esm2022/lib/models/api/misc.models.mjs +2 -0
- package/esm2022/lib/models/api/project.models.mjs +2 -0
- package/esm2022/lib/models/api/quality.models.mjs +2 -0
- package/esm2022/lib/models/api/reporting.models.mjs +3 -0
- package/esm2022/lib/models/api/reservoir-websocket.models.mjs +17 -0
- package/esm2022/lib/models/api/reservoir.models.mjs +2 -0
- package/esm2022/lib/models/api/search.models.mjs +2 -0
- package/esm2022/lib/models/api/sensor.models.mjs +2 -0
- package/esm2022/lib/models/api/unit.models.mjs +2 -0
- package/esm2022/lib/models/api/user.models.mjs +2 -0
- package/esm2022/lib/models/api/warranty.models.mjs +2 -0
- package/esm2022/lib/models/api/work-permit.models.mjs +2 -0
- package/esm2022/lib/models/api/workflow.models.mjs +2 -0
- package/esm2022/lib/models/auth/index.mjs +4 -0
- package/esm2022/lib/models/auth/login.models.mjs +2 -0
- package/esm2022/lib/models/auth/sso.models.mjs +2 -0
- package/esm2022/lib/models/auth/totp.models.mjs +2 -0
- package/esm2022/lib/models/base.models.mjs +99 -0
- package/esm2022/lib/models/chat/chat.models.mjs +2 -0
- package/esm2022/lib/models/enums/cat.enums.mjs +17 -0
- package/esm2022/lib/models/enums/energy.enums.mjs +8 -0
- package/esm2022/lib/models/enums/erp.enums.mjs +5 -0
- package/esm2022/lib/models/enums/index.mjs +15 -0
- package/esm2022/lib/models/enums/inspection.enums.mjs +7 -0
- package/esm2022/lib/models/enums/loto.enums.mjs +25 -0
- package/esm2022/lib/models/enums/misc.enums.mjs +19 -0
- package/esm2022/lib/models/enums/quality.enums.mjs +22 -0
- package/esm2022/lib/models/enums/reservoir.enums.mjs +13 -0
- package/esm2022/lib/models/enums/sso.enums.mjs +3 -0
- package/esm2022/lib/models/enums/status.enums.mjs +41 -0
- package/esm2022/lib/models/enums/time.enums.mjs +5 -0
- package/esm2022/lib/models/enums/type.enums.mjs +45 -0
- package/esm2022/lib/models/enums/user.enums.mjs +6 -0
- package/esm2022/lib/models/enums/work-permit.enums.mjs +33 -0
- package/esm2022/lib/models/index.mjs +42 -0
- package/esm2022/lib/models/realtime/realtime-event.models.mjs +9 -0
- package/esm2022/lib/models/video/video-call.models.mjs +2 -0
- package/esm2022/lib/services/admin/activity-log.service.mjs +28 -0
- package/esm2022/lib/services/admin/announcement.service.mjs +37 -0
- package/esm2022/lib/services/admin/article-admin.service.mjs +37 -0
- package/esm2022/lib/services/admin/audit-log.service.mjs +53 -0
- package/esm2022/lib/services/admin/backup.service.mjs +28 -0
- package/esm2022/lib/services/admin/cache-admin.service.mjs +64 -0
- package/esm2022/lib/services/admin/client-admin.service.mjs +101 -0
- package/esm2022/lib/services/admin/client-api-key.service.mjs +31 -0
- package/esm2022/lib/services/admin/client-ocr.service.mjs +28 -0
- package/esm2022/lib/services/admin/client-usage.service.mjs +31 -0
- package/esm2022/lib/services/admin/data-export.service.mjs +19 -0
- package/esm2022/lib/services/admin/document-admin.service.mjs +40 -0
- package/esm2022/lib/services/admin/email-admin.service.mjs +28 -0
- package/esm2022/lib/services/admin/email-provider.service.mjs +58 -0
- package/esm2022/lib/services/admin/erp-admin.service.mjs +111 -0
- package/esm2022/lib/services/admin/identity-provider.service.mjs +46 -0
- package/esm2022/lib/services/admin/impersonation.service.mjs +19 -0
- package/esm2022/lib/services/admin/index.mjs +31 -0
- package/esm2022/lib/services/admin/messaging-provider.service.mjs +55 -0
- package/esm2022/lib/services/admin/notification.service.mjs +31 -0
- package/esm2022/lib/services/admin/platform-admin.service.mjs +34 -0
- package/esm2022/lib/services/admin/platform-webhook.service.mjs +34 -0
- package/esm2022/lib/services/admin/queue-admin.service.mjs +55 -0
- package/esm2022/lib/services/admin/role-admin.service.mjs +81 -0
- package/esm2022/lib/services/admin/sandbox-admin.service.mjs +34 -0
- package/esm2022/lib/services/admin/scheduler-admin.service.mjs +34 -0
- package/esm2022/lib/services/admin/subscription.service.mjs +28 -0
- package/esm2022/lib/services/admin/system-health.service.mjs +22 -0
- package/esm2022/lib/services/admin/user-admin.service.mjs +67 -0
- package/esm2022/lib/services/admin/user-permission.service.mjs +40 -0
- package/esm2022/lib/services/admin/webhook-admin.service.mjs +61 -0
- package/esm2022/lib/services/api/agent.service.mjs +29 -0
- package/esm2022/lib/services/api/ai-feedback.service.mjs +17 -0
- package/esm2022/lib/services/api/ai.service.mjs +66 -0
- package/esm2022/lib/services/api/aip-analysis.service.mjs +20 -0
- package/esm2022/lib/services/api/aip-financial.service.mjs +29 -0
- package/esm2022/lib/services/api/aip-geographic.service.mjs +30 -0
- package/esm2022/lib/services/api/aip-network.service.mjs +29 -0
- package/esm2022/lib/services/api/aip-performance.service.mjs +29 -0
- package/esm2022/lib/services/api/aip-resource.service.mjs +23 -0
- package/esm2022/lib/services/api/aip-workflow.service.mjs +32 -0
- package/esm2022/lib/services/api/aip.service.mjs +158 -0
- package/esm2022/lib/services/api/alert.service.mjs +26 -0
- package/esm2022/lib/services/api/anomaly-detection.service.mjs +40 -0
- package/esm2022/lib/services/api/asset-lifecycle.service.mjs +78 -0
- package/esm2022/lib/services/api/audit-entry.service.mjs +22 -0
- package/esm2022/lib/services/api/base-crud.service.mjs +37 -0
- package/esm2022/lib/services/api/bid.service.mjs +17 -0
- package/esm2022/lib/services/api/budget.service.mjs +17 -0
- package/esm2022/lib/services/api/bulk-operation.service.mjs +65 -0
- package/esm2022/lib/services/api/capex-project.service.mjs +17 -0
- package/esm2022/lib/services/api/cat.service.mjs +77 -0
- package/esm2022/lib/services/api/client-article.service.mjs +23 -0
- package/esm2022/lib/services/api/community.service.mjs +41 -0
- package/esm2022/lib/services/api/company-material-type.service.mjs +17 -0
- package/esm2022/lib/services/api/company-material.service.mjs +17 -0
- package/esm2022/lib/services/api/company.service.mjs +30 -0
- package/esm2022/lib/services/api/compliance.service.mjs +74 -0
- package/esm2022/lib/services/api/component-info.service.mjs +17 -0
- package/esm2022/lib/services/api/component-location.service.mjs +17 -0
- package/esm2022/lib/services/api/component.service.mjs +53 -0
- package/esm2022/lib/services/api/cortex-event.service.mjs +17 -0
- package/esm2022/lib/services/api/cortex-insight.service.mjs +23 -0
- package/esm2022/lib/services/api/cortex-node.service.mjs +17 -0
- package/esm2022/lib/services/api/cortex.service.mjs +29 -0
- package/esm2022/lib/services/api/custom-field.service.mjs +70 -0
- package/esm2022/lib/services/api/custom.service.mjs +43 -0
- package/esm2022/lib/services/api/dashboard.service.mjs +44 -0
- package/esm2022/lib/services/api/deferral.service.mjs +54 -0
- package/esm2022/lib/services/api/department.service.mjs +17 -0
- package/esm2022/lib/services/api/device-gateway.service.mjs +33 -0
- package/esm2022/lib/services/api/diagnostic-report.service.mjs +23 -0
- package/esm2022/lib/services/api/digital-twin.service.mjs +56 -0
- package/esm2022/lib/services/api/document.service.mjs +53 -0
- package/esm2022/lib/services/api/dynamic-crud.service.mjs +67 -0
- package/esm2022/lib/services/api/energy-analytics.service.mjs +42 -0
- package/esm2022/lib/services/api/energy-production.service.mjs +17 -0
- package/esm2022/lib/services/api/energy.service.mjs +91 -0
- package/esm2022/lib/services/api/entity-comment.service.mjs +31 -0
- package/esm2022/lib/services/api/event.service.mjs +17 -0
- package/esm2022/lib/services/api/export.service.mjs +216 -0
- package/esm2022/lib/services/api/extension.service.mjs +56 -0
- package/esm2022/lib/services/api/failure.service.mjs +53 -0
- package/esm2022/lib/services/api/fleet.service.mjs +140 -0
- package/esm2022/lib/services/api/inactive-component.service.mjs +17 -0
- package/esm2022/lib/services/api/index.mjs +101 -0
- package/esm2022/lib/services/api/inspection.service.mjs +29 -0
- package/esm2022/lib/services/api/intervention-request.service.mjs +17 -0
- package/esm2022/lib/services/api/intervention.service.mjs +17 -0
- package/esm2022/lib/services/api/knowledge.service.mjs +209 -0
- package/esm2022/lib/services/api/license.service.mjs +25 -0
- package/esm2022/lib/services/api/location.service.mjs +17 -0
- package/esm2022/lib/services/api/log.service.mjs +17 -0
- package/esm2022/lib/services/api/login-history.service.mjs +17 -0
- package/esm2022/lib/services/api/maintenance-plan.service.mjs +17 -0
- package/esm2022/lib/services/api/maintenance-record.service.mjs +17 -0
- package/esm2022/lib/services/api/material-consumable.service.mjs +41 -0
- package/esm2022/lib/services/api/material-instrument.service.mjs +29 -0
- package/esm2022/lib/services/api/material-item.service.mjs +53 -0
- package/esm2022/lib/services/api/material-tooling.service.mjs +41 -0
- package/esm2022/lib/services/api/measurement-unit.service.mjs +17 -0
- package/esm2022/lib/services/api/misc-crud.service.mjs +329 -0
- package/esm2022/lib/services/api/note.service.mjs +37 -0
- package/esm2022/lib/services/api/outage-resource.service.mjs +28 -0
- package/esm2022/lib/services/api/plant-data.service.mjs +31 -0
- package/esm2022/lib/services/api/procurement.service.mjs +53 -0
- package/esm2022/lib/services/api/project.service.mjs +17 -0
- package/esm2022/lib/services/api/property-template.service.mjs +17 -0
- package/esm2022/lib/services/api/quality.service.mjs +29 -0
- package/esm2022/lib/services/api/recurring-event.service.mjs +17 -0
- package/esm2022/lib/services/api/reporting.service.mjs +117 -0
- package/esm2022/lib/services/api/reservoir-data.service.mjs +19 -0
- package/esm2022/lib/services/api/reservoir.service.mjs +209 -0
- package/esm2022/lib/services/api/room.service.mjs +17 -0
- package/esm2022/lib/services/api/sandbox.service.mjs +62 -0
- package/esm2022/lib/services/api/scheduled-report.service.mjs +17 -0
- package/esm2022/lib/services/api/search.service.mjs +77 -0
- package/esm2022/lib/services/api/sensor.service.mjs +36 -0
- package/esm2022/lib/services/api/sla-policy.service.mjs +17 -0
- package/esm2022/lib/services/api/sla.service.mjs +17 -0
- package/esm2022/lib/services/api/threshold-alert-rule.service.mjs +17 -0
- package/esm2022/lib/services/api/ticket.service.mjs +73 -0
- package/esm2022/lib/services/api/time-entry.service.mjs +17 -0
- package/esm2022/lib/services/api/todo.service.mjs +17 -0
- package/esm2022/lib/services/api/unit.service.mjs +17 -0
- package/esm2022/lib/services/api/upload.service.mjs +84 -0
- package/esm2022/lib/services/api/user.service.mjs +107 -0
- package/esm2022/lib/services/api/warehouse.service.mjs +29 -0
- package/esm2022/lib/services/api/warranty.service.mjs +29 -0
- package/esm2022/lib/services/api/work-order.service.mjs +28 -0
- package/esm2022/lib/services/api/work-permit.service.mjs +17 -0
- package/esm2022/lib/services/api/workflow.service.mjs +86 -0
- package/esm2022/lib/services/auth/auth.service.mjs +97 -0
- package/esm2022/lib/services/auth/index.mjs +5 -0
- package/esm2022/lib/services/auth/platform-auth.service.mjs +39 -0
- package/esm2022/lib/services/auth/sso-auth.service.mjs +46 -0
- package/esm2022/lib/services/auth/totp.service.mjs +34 -0
- package/esm2022/lib/services/chat/chat-rest.service.mjs +104 -0
- package/esm2022/lib/services/chat/chat-websocket.service.mjs +70 -0
- package/esm2022/lib/services/chat/index.mjs +3 -0
- package/esm2022/lib/services/index.mjs +8 -0
- package/esm2022/lib/services/realtime/index.mjs +2 -0
- package/esm2022/lib/services/realtime/realtime-event.service.mjs +187 -0
- package/esm2022/lib/services/reservoir/index.mjs +2 -0
- package/esm2022/lib/services/reservoir/reservoir-websocket.service.mjs +105 -0
- package/esm2022/lib/services/video/index.mjs +3 -0
- package/esm2022/lib/services/video/video-call-rest.service.mjs +42 -0
- package/esm2022/lib/services/video/video-call-websocket.service.mjs +55 -0
- package/esm2022/lib/tgm-sdk.config.mjs +32 -0
- package/esm2022/lib/tgm-sdk.module.mjs +38 -0
- package/esm2022/public-api.mjs +52 -0
- package/fesm2022/en-solutions-tgm-client-sdk.mjs +11029 -0
- package/fesm2022/en-solutions-tgm-client-sdk.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/database-manager/database-manager/database-manager.component.d.ts +70 -0
- package/lib/components/database-manager/database-manager.module.d.ts +15 -0
- package/lib/components/database-manager/object-browser/object-browser.component.d.ts +35 -0
- package/lib/components/database-manager/query-editor/query-editor.component.d.ts +31 -0
- package/lib/components/database-manager/query-toolbar/query-toolbar.component.d.ts +23 -0
- package/lib/components/database-manager/record-detail/record-detail.component.d.ts +35 -0
- package/lib/components/database-manager/registry/entity-registry.d.ts +16 -0
- package/lib/components/database-manager/results-grid/results-grid.component.d.ts +62 -0
- package/lib/components/database-manager/services/entity-schema.service.d.ts +37 -0
- package/lib/components/database-manager/services/query-executor.service.d.ts +57 -0
- package/lib/components/database-manager/table-data-viewer/table-data-viewer.component.d.ts +54 -0
- package/lib/components/database-manager/table-structure/table-structure.component.d.ts +16 -0
- package/lib/components/database-manager/types/database-manager.types.d.ts +71 -0
- package/lib/components/reporting/export-button/export-button.component.d.ts +50 -0
- package/lib/components/reporting/generated-report-list/generated-report-list.component.d.ts +93 -0
- package/lib/components/reporting/report-definition-form/report-definition-form.component.d.ts +65 -0
- package/lib/components/reporting/report-definition-list/report-definition-list.component.d.ts +90 -0
- package/lib/components/reporting/report-generate-dialog/report-generate-dialog.component.d.ts +46 -0
- package/lib/components/reporting/report-stats/report-stats.component.d.ts +47 -0
- package/lib/components/reporting/report-template-list/report-template-list.component.d.ts +39 -0
- package/lib/components/reporting/reporting.module.d.ts +14 -0
- package/lib/components/video-call/incoming-call/incoming-call.component.d.ts +20 -0
- package/lib/components/video-call/services/livekit-room.service.d.ts +28 -0
- package/lib/components/video-call/services/video-call-signaling.service.d.ts +21 -0
- package/lib/components/video-call/services/video-call-state.service.d.ts +25 -0
- package/lib/components/video-call/types/video-call.types.d.ts +49 -0
- package/lib/components/video-call/video-call.module.d.ts +11 -0
- package/lib/components/video-call/video-controls/video-controls.component.d.ts +13 -0
- package/lib/components/video-call/video-participant/video-participant.component.d.ts +17 -0
- package/lib/components/video-call/video-room/video-room.component.d.ts +30 -0
- package/lib/core/auth-interceptor.d.ts +13 -0
- package/lib/core/client-interceptor.d.ts +14 -0
- package/lib/core/error-handler.d.ts +13 -0
- package/lib/core/http-client.service.d.ts +61 -0
- package/lib/core/websocket.service.d.ts +37 -0
- package/lib/models/admin/audit.models.d.ts +73 -0
- package/lib/models/admin/backup.models.d.ts +101 -0
- package/lib/models/admin/client.models.d.ts +99 -0
- package/lib/models/admin/email-provider.models.d.ts +56 -0
- package/lib/models/admin/erp.models.d.ts +188 -0
- package/lib/models/admin/identity-provider.models.d.ts +1 -0
- package/lib/models/admin/index.d.ts +13 -0
- package/lib/models/admin/messaging-provider.models.d.ts +49 -0
- package/lib/models/admin/platform-admin.models.d.ts +33 -0
- package/lib/models/admin/queue.models.d.ts +54 -0
- package/lib/models/admin/role.models.d.ts +50 -0
- package/lib/models/admin/sandbox.models.d.ts +54 -0
- package/lib/models/admin/ticket.models.d.ts +48 -0
- package/lib/models/admin/webhook.models.d.ts +65 -0
- package/lib/models/api/ai.models.d.ts +75 -0
- package/lib/models/api/aip.models.d.ts +545 -0
- package/lib/models/api/cat.models.d.ts +260 -0
- package/lib/models/api/company.models.d.ts +125 -0
- package/lib/models/api/compliance.models.d.ts +74 -0
- package/lib/models/api/component.models.d.ts +294 -0
- package/lib/models/api/cortex-edge.models.d.ts +14 -0
- package/lib/models/api/cortex-event.models.d.ts +12 -0
- package/lib/models/api/cortex-insight.models.d.ts +25 -0
- package/lib/models/api/cortex-node.models.d.ts +10 -0
- package/lib/models/api/custom-field.models.d.ts +37 -0
- package/lib/models/api/deferral.models.d.ts +81 -0
- package/lib/models/api/diagnostic-report.models.d.ts +29 -0
- package/lib/models/api/document.models.d.ts +95 -0
- package/lib/models/api/energy.models.d.ts +210 -0
- package/lib/models/api/failure.models.d.ts +171 -0
- package/lib/models/api/fleet.models.d.ts +193 -0
- package/lib/models/api/inspection.models.d.ts +110 -0
- package/lib/models/api/intervention.models.d.ts +254 -0
- package/lib/models/api/iot.models.d.ts +15 -0
- package/lib/models/api/knowledge.models.d.ts +340 -0
- package/lib/models/api/loto.models.d.ts +51 -0
- package/lib/models/api/maintenance-record.models.d.ts +100 -0
- package/lib/models/api/maintenance.models.d.ts +188 -0
- package/lib/models/api/material.models.d.ts +261 -0
- package/lib/models/api/media.models.d.ts +106 -0
- package/lib/models/api/misc.models.d.ts +929 -0
- package/lib/models/api/project.models.d.ts +118 -0
- package/lib/models/api/quality.models.d.ts +153 -0
- package/lib/models/api/reporting.models.d.ts +76 -0
- package/lib/models/api/reservoir-websocket.models.d.ts +48 -0
- package/lib/models/api/reservoir.models.d.ts +274 -0
- package/lib/models/api/search.models.d.ts +30 -0
- package/lib/models/api/sensor.models.d.ts +117 -0
- package/lib/models/api/unit.models.d.ts +82 -0
- package/lib/models/api/user.models.d.ts +253 -0
- package/lib/models/api/warranty.models.d.ts +51 -0
- package/lib/models/api/work-permit.models.d.ts +70 -0
- package/lib/models/api/workflow.models.d.ts +52 -0
- package/lib/models/auth/index.d.ts +3 -0
- package/lib/models/auth/login.models.d.ts +134 -0
- package/lib/models/auth/sso.models.d.ts +136 -0
- package/lib/models/auth/totp.models.d.ts +19 -0
- package/lib/models/base.models.d.ts +90 -0
- package/lib/models/chat/chat.models.d.ts +171 -0
- package/lib/models/enums/cat.enums.d.ts +114 -0
- package/lib/models/enums/energy.enums.d.ts +50 -0
- package/lib/models/enums/erp.enums.d.ts +49 -0
- package/lib/models/enums/index.d.ts +14 -0
- package/lib/models/enums/inspection.enums.d.ts +61 -0
- package/lib/models/enums/loto.enums.d.ts +41 -0
- package/lib/models/enums/misc.enums.d.ts +151 -0
- package/lib/models/enums/quality.enums.d.ts +25 -0
- package/lib/models/enums/reservoir.enums.d.ts +80 -0
- package/lib/models/enums/sso.enums.d.ts +15 -0
- package/lib/models/enums/status.enums.d.ts +296 -0
- package/lib/models/enums/time.enums.d.ts +51 -0
- package/lib/models/enums/type.enums.d.ts +324 -0
- package/lib/models/enums/user.enums.d.ts +31 -0
- package/lib/models/enums/work-permit.enums.d.ts +56 -0
- package/lib/models/index.d.ts +41 -0
- package/lib/models/realtime/realtime-event.models.d.ts +95 -0
- package/lib/models/video/video-call.models.d.ts +65 -0
- package/lib/services/admin/activity-log.service.d.ts +13 -0
- package/lib/services/admin/announcement.service.d.ts +17 -0
- package/lib/services/admin/article-admin.service.d.ts +17 -0
- package/lib/services/admin/audit-log.service.d.ts +22 -0
- package/lib/services/admin/backup.service.d.ts +15 -0
- package/lib/services/admin/cache-admin.service.d.ts +26 -0
- package/lib/services/admin/client-admin.service.d.ts +38 -0
- package/lib/services/admin/client-api-key.service.d.ts +15 -0
- package/lib/services/admin/client-ocr.service.d.ts +14 -0
- package/lib/services/admin/client-usage.service.d.ts +15 -0
- package/lib/services/admin/data-export.service.d.ts +10 -0
- package/lib/services/admin/document-admin.service.d.ts +18 -0
- package/lib/services/admin/email-admin.service.d.ts +14 -0
- package/lib/services/admin/email-provider.service.d.ts +25 -0
- package/lib/services/admin/erp-admin.service.d.ts +41 -0
- package/lib/services/admin/identity-provider.service.d.ts +21 -0
- package/lib/services/admin/impersonation.service.d.ts +11 -0
- package/lib/services/admin/index.d.ts +30 -0
- package/lib/services/admin/messaging-provider.service.d.ts +24 -0
- package/lib/services/admin/notification.service.d.ts +15 -0
- package/lib/services/admin/platform-admin.service.d.ts +17 -0
- package/lib/services/admin/platform-webhook.service.d.ts +16 -0
- package/lib/services/admin/queue-admin.service.d.ts +24 -0
- package/lib/services/admin/role-admin.service.d.ts +37 -0
- package/lib/services/admin/sandbox-admin.service.d.ts +17 -0
- package/lib/services/admin/scheduler-admin.service.d.ts +61 -0
- package/lib/services/admin/subscription.service.d.ts +15 -0
- package/lib/services/admin/system-health.service.d.ts +11 -0
- package/lib/services/admin/user-admin.service.d.ts +27 -0
- package/lib/services/admin/user-permission.service.d.ts +18 -0
- package/lib/services/admin/webhook-admin.service.d.ts +26 -0
- package/lib/services/api/agent.service.d.ts +16 -0
- package/lib/services/api/ai-feedback.service.d.ts +9 -0
- package/lib/services/api/ai.service.d.ts +36 -0
- package/lib/services/api/aip-analysis.service.d.ts +13 -0
- package/lib/services/api/aip-financial.service.d.ts +16 -0
- package/lib/services/api/aip-geographic.service.d.ts +16 -0
- package/lib/services/api/aip-network.service.d.ts +16 -0
- package/lib/services/api/aip-performance.service.d.ts +16 -0
- package/lib/services/api/aip-resource.service.d.ts +14 -0
- package/lib/services/api/aip-workflow.service.d.ts +24 -0
- package/lib/services/api/aip.service.d.ts +73 -0
- package/lib/services/api/alert.service.d.ts +15 -0
- package/lib/services/api/anomaly-detection.service.d.ts +26 -0
- package/lib/services/api/asset-lifecycle.service.d.ts +29 -0
- package/lib/services/api/audit-entry.service.d.ts +13 -0
- package/lib/services/api/base-crud.service.d.ts +18 -0
- package/lib/services/api/bid.service.d.ts +10 -0
- package/lib/services/api/budget.service.d.ts +10 -0
- package/lib/services/api/bulk-operation.service.d.ts +26 -0
- package/lib/services/api/capex-project.service.d.ts +10 -0
- package/lib/services/api/cat.service.d.ts +40 -0
- package/lib/services/api/client-article.service.d.ts +14 -0
- package/lib/services/api/community.service.d.ts +21 -0
- package/lib/services/api/company-material-type.service.d.ts +10 -0
- package/lib/services/api/company-material.service.d.ts +9 -0
- package/lib/services/api/company.service.d.ts +15 -0
- package/lib/services/api/compliance.service.d.ts +35 -0
- package/lib/services/api/component-info.service.d.ts +10 -0
- package/lib/services/api/component-location.service.d.ts +10 -0
- package/lib/services/api/component.service.d.ts +32 -0
- package/lib/services/api/cortex-event.service.d.ts +10 -0
- package/lib/services/api/cortex-insight.service.d.ts +14 -0
- package/lib/services/api/cortex-node.service.d.ts +10 -0
- package/lib/services/api/cortex.service.d.ts +15 -0
- package/lib/services/api/custom-field.service.d.ts +33 -0
- package/lib/services/api/custom.service.d.ts +23 -0
- package/lib/services/api/dashboard.service.d.ts +18 -0
- package/lib/services/api/deferral.service.d.ts +29 -0
- package/lib/services/api/department.service.d.ts +9 -0
- package/lib/services/api/device-gateway.service.d.ts +16 -0
- package/lib/services/api/diagnostic-report.service.d.ts +14 -0
- package/lib/services/api/digital-twin.service.d.ts +29 -0
- package/lib/services/api/document.service.d.ts +28 -0
- package/lib/services/api/dynamic-crud.service.d.ts +41 -0
- package/lib/services/api/energy-analytics.service.d.ts +16 -0
- package/lib/services/api/energy-production.service.d.ts +10 -0
- package/lib/services/api/energy.service.d.ts +46 -0
- package/lib/services/api/entity-comment.service.d.ts +16 -0
- package/lib/services/api/event.service.d.ts +10 -0
- package/lib/services/api/export.service.d.ts +48 -0
- package/lib/services/api/extension.service.d.ts +24 -0
- package/lib/services/api/failure.service.d.ts +28 -0
- package/lib/services/api/fleet.service.d.ts +71 -0
- package/lib/services/api/inactive-component.service.d.ts +10 -0
- package/lib/services/api/index.d.ts +101 -0
- package/lib/services/api/inspection.service.d.ts +16 -0
- package/lib/services/api/intervention-request.service.d.ts +10 -0
- package/lib/services/api/intervention.service.d.ts +10 -0
- package/lib/services/api/knowledge.service.d.ts +106 -0
- package/lib/services/api/license.service.d.ts +14 -0
- package/lib/services/api/location.service.d.ts +9 -0
- package/lib/services/api/log.service.d.ts +9 -0
- package/lib/services/api/login-history.service.d.ts +10 -0
- package/lib/services/api/maintenance-plan.service.d.ts +10 -0
- package/lib/services/api/maintenance-record.service.d.ts +10 -0
- package/lib/services/api/material-consumable.service.d.ts +22 -0
- package/lib/services/api/material-instrument.service.d.ts +16 -0
- package/lib/services/api/material-item.service.d.ts +28 -0
- package/lib/services/api/material-tooling.service.d.ts +22 -0
- package/lib/services/api/measurement-unit.service.d.ts +10 -0
- package/lib/services/api/misc-crud.service.d.ts +167 -0
- package/lib/services/api/note.service.d.ts +14 -0
- package/lib/services/api/outage-resource.service.d.ts +15 -0
- package/lib/services/api/plant-data.service.d.ts +14 -0
- package/lib/services/api/procurement.service.d.ts +27 -0
- package/lib/services/api/project.service.d.ts +10 -0
- package/lib/services/api/property-template.service.d.ts +10 -0
- package/lib/services/api/quality.service.d.ts +16 -0
- package/lib/services/api/recurring-event.service.d.ts +10 -0
- package/lib/services/api/reporting.service.d.ts +38 -0
- package/lib/services/api/reservoir-data.service.d.ts +10 -0
- package/lib/services/api/reservoir.service.d.ts +109 -0
- package/lib/services/api/room.service.d.ts +10 -0
- package/lib/services/api/sandbox.service.d.ts +26 -0
- package/lib/services/api/scheduled-report.service.d.ts +10 -0
- package/lib/services/api/search.service.d.ts +54 -0
- package/lib/services/api/sensor.service.d.ts +17 -0
- package/lib/services/api/sla-policy.service.d.ts +10 -0
- package/lib/services/api/sla.service.d.ts +10 -0
- package/lib/services/api/threshold-alert-rule.service.d.ts +10 -0
- package/lib/services/api/ticket.service.d.ts +60 -0
- package/lib/services/api/time-entry.service.d.ts +10 -0
- package/lib/services/api/todo.service.d.ts +10 -0
- package/lib/services/api/unit.service.d.ts +10 -0
- package/lib/services/api/upload.service.d.ts +50 -0
- package/lib/services/api/user.service.d.ts +59 -0
- package/lib/services/api/warehouse.service.d.ts +15 -0
- package/lib/services/api/warranty.service.d.ts +16 -0
- package/lib/services/api/work-order.service.d.ts +17 -0
- package/lib/services/api/work-permit.service.d.ts +10 -0
- package/lib/services/api/workflow.service.d.ts +33 -0
- package/lib/services/auth/auth.service.d.ts +33 -0
- package/lib/services/auth/index.d.ts +4 -0
- package/lib/services/auth/platform-auth.service.d.ts +16 -0
- package/lib/services/auth/sso-auth.service.d.ts +21 -0
- package/lib/services/auth/totp.service.d.ts +18 -0
- package/lib/services/chat/chat-rest.service.d.ts +40 -0
- package/lib/services/chat/chat-websocket.service.d.ts +34 -0
- package/lib/services/chat/index.d.ts +2 -0
- package/lib/services/index.d.ts +7 -0
- package/lib/services/realtime/index.d.ts +1 -0
- package/lib/services/realtime/realtime-event.service.d.ts +137 -0
- package/lib/services/reservoir/index.d.ts +1 -0
- package/lib/services/reservoir/reservoir-websocket.service.d.ts +47 -0
- package/lib/services/video/index.d.ts +2 -0
- package/lib/services/video/video-call-rest.service.d.ts +19 -0
- package/lib/services/video/video-call-websocket.service.d.ts +31 -0
- package/lib/tgm-sdk.config.d.ts +36 -0
- package/lib/tgm-sdk.module.d.ts +13 -0
- package/package.json +40 -0
- package/public-api.d.ts +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,788 @@
|
|
|
1
|
+
# @en-solutions/tgm-client-sdk
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The **TGM Client SDK** is a comprehensive, type-safe Angular library that provides services for every endpoint exposed by the TGM Manager backend API. It ships **90+ injectable services** covering authentication, CRUD operations across dozens of domain entities, real-time chat (STOMP/WebSocket), video calling (LiveKit), reservoir management, platform administration, file management, search, AI integration, workflow approvals, and more.
|
|
13
|
+
|
|
14
|
+
Everything is fully typed: **125 const-object enums**, **165+ DTOs and interfaces**, and a generic `BaseCrudService<T>` pattern that gives every domain entity a consistent `getAll`, `getById`, `create`, `update`, `delete`, and `count` API out of the box.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Architecture
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
@en-solutions/tgm-client-sdk
|
|
22
|
+
|
|
|
23
|
+
|-- src/
|
|
24
|
+
| |-- public-api.ts Library entry point (barrel exports)
|
|
25
|
+
| |
|
|
26
|
+
| |-- lib/
|
|
27
|
+
| |-- tgm-sdk.module.ts TgmSdkModule with forRoot() configuration
|
|
28
|
+
| |-- tgm-sdk.config.ts TgmSdkConfig interface, InjectionToken, TokenStorageStrategy
|
|
29
|
+
| |
|
|
30
|
+
| |-- core/
|
|
31
|
+
| | |-- http-client.service.ts TgmHttpClient -- central HTTP layer with auth & multi-tenancy
|
|
32
|
+
| | |-- auth-interceptor.ts Attaches Authorization: Bearer <token> header
|
|
33
|
+
| | |-- client-interceptor.ts Attaches X-Client-ID header for tenant routing
|
|
34
|
+
| | |-- websocket.service.ts STOMP-over-SockJS WebSocket abstraction
|
|
35
|
+
| | |-- error-handler.ts TgmApiError class and mapHttpError utility
|
|
36
|
+
| |
|
|
37
|
+
| |-- models/
|
|
38
|
+
| | |-- base.models.ts ApiResponse, PagedResponse, PaginationParams, BaseEntity
|
|
39
|
+
| | |-- enums/ 125 const-object enums across 11 files
|
|
40
|
+
| | | |-- status.enums.ts WorkOrderStatus, UnitStatus, AlertStatus, etc.
|
|
41
|
+
| | | |-- type.enums.ts WorkOrderType, ComponentType, DocumentType, etc.
|
|
42
|
+
| | | |-- energy.enums.ts EnergySourceType, GridConnectionStatus, etc.
|
|
43
|
+
| | | |-- erp.enums.ts ERPProvider, SyncStatus, etc.
|
|
44
|
+
| | | |-- sso.enums.ts SsoProvider, SsoStrategy, etc.
|
|
45
|
+
| | | |-- inspection.enums.ts InspectionStatus, InspectionType, etc.
|
|
46
|
+
| | | |-- user.enums.ts UserRole, UserStatus, etc.
|
|
47
|
+
| | | |-- time.enums.ts Frequency, DayOfWeek, etc.
|
|
48
|
+
| | | |-- misc.enums.ts Priority, Severity, Currency, etc.
|
|
49
|
+
| | | |-- reservoir.enums.ts GateType, SampleType, AIScenarioType, ReadingType, etc.
|
|
50
|
+
| | |-- auth/ Login, SSO, TOTP request/response DTOs
|
|
51
|
+
| | |-- admin/ Client, Ticket, ERP, Webhook, Role, Audit DTOs
|
|
52
|
+
| | |-- api/ 23 domain model files (units, work orders, reservoir, etc.)
|
|
53
|
+
| | | |-- reservoir.models.ts GateSystem, AlertDefinition, AIScenario, TimeSeriesQueryParams, etc.
|
|
54
|
+
| | |-- chat/ Conversation, ChatMessage, Presence, Typing DTOs
|
|
55
|
+
| | |-- video/ VideoCall, participant, signaling event DTOs
|
|
56
|
+
| |
|
|
57
|
+
| |-- services/
|
|
58
|
+
| | |-- auth/ 4 services -- AuthService, SsoAuthService, TotpService, PlatformAuthService
|
|
59
|
+
| | |-- api/ 57 services -- Domain CRUD (units, work orders, components, reservoir, etc.)
|
|
60
|
+
| | |-- admin/ 30 services -- Platform admin, client management, ERP, webhooks
|
|
61
|
+
| | |-- chat/ 2 services -- ChatRestService, ChatWebSocketService
|
|
62
|
+
| | |-- video/ 2 services -- VideoCallRestService, VideoCallWebSocketService
|
|
63
|
+
| | |-- reservoir/ 1 service -- ReservoirWebSocketService (real-time 4-stream WebSocket)
|
|
64
|
+
| |
|
|
65
|
+
| |-- components/
|
|
66
|
+
| |-- video-call/
|
|
67
|
+
| |-- video-call.module.ts VideoCallModule (standalone Angular module)
|
|
68
|
+
| |-- video-room/ VideoRoomComponent
|
|
69
|
+
| |-- video-controls/ VideoControlsComponent
|
|
70
|
+
| |-- video-participant/ VideoParticipantComponent
|
|
71
|
+
| |-- incoming-call/ IncomingCallComponent
|
|
72
|
+
| |-- services/ LivekitRoomService, VideoCallSignalingService, VideoCallStateService
|
|
73
|
+
| |-- types/ ParticipantInfo, VideoCallState
|
|
74
|
+
|
|
|
75
|
+
|-- docs/ 10 detailed Markdown guides
|
|
76
|
+
|-- ng-package.json ng-packagr build configuration
|
|
77
|
+
|-- package.json Package metadata, scripts, dependencies
|
|
78
|
+
|-- tsconfig.json TypeScript configuration
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Features
|
|
84
|
+
|
|
85
|
+
- **Type-safe services** -- Every API endpoint is wrapped in an Angular `@Injectable` service with full TypeScript generics and strict return types.
|
|
86
|
+
- **Generic BaseCrudService pattern** -- Domain services extend `BaseCrudService<T, CreateReq, UpdateReq>` which provides `getAll()`, `getById()`, `create()`, `update()`, `delete()`, and `count()` automatically.
|
|
87
|
+
- **Automatic authentication** -- JWT tokens are attached to every request via `AuthInterceptor`. On a `401` response, the SDK transparently refreshes the token and retries the original request.
|
|
88
|
+
- **Pluggable token storage** -- Implement `TokenStorageStrategy` to swap between in-memory (default), `localStorage`, `sessionStorage`, or any custom persistence layer.
|
|
89
|
+
- **Multi-tenancy support** -- The `ClientInterceptor` attaches an `X-Client-ID` header to every request. The client ID can be set statically in configuration or changed at runtime via `TgmHttpClient.setClientId()`.
|
|
90
|
+
- **Real-time chat** -- `ChatWebSocketService` provides reactive observables for incoming messages, typing indicators, presence updates, read receipts, and emoji reactions over STOMP/SockJS.
|
|
91
|
+
- **Video calling** -- `VideoCallRestService` manages call lifecycle (initiate, answer, join, end). Pre-built Angular components (`VideoRoomComponent`, `VideoControlsComponent`, `VideoParticipantComponent`, `IncomingCallComponent`) integrate with LiveKit for WebRTC video/audio.
|
|
92
|
+
- **Reservoir management** -- 11 services for hydroelectric dam operations including gate control, sensor time-series, environmental compliance, and AI optimization scenarios, plus a real-time 4-stream WebSocket service.
|
|
93
|
+
- **125 const-object enums** -- `WorkOrderStatus`, `UnitStatus`, `AlertSeverity`, `ERPProvider`, `GateType`, `AIScenarioType`, and 119 more, all defined as const objects with companion union types for compile-time safety and runtime iteration.
|
|
94
|
+
- **165+ DTOs and interfaces** -- Covering units, components, work orders, inspections, interventions, fleet, energy, compliance, quality, materials, sensors, budgets, projects, warranties, knowledge base, reservoir management, and more.
|
|
95
|
+
- **File upload and download** -- `UploadService` supports single/multi-file upload, file linking, batch operations, and binary download.
|
|
96
|
+
- **Platform administration** -- 30 admin services for client management, API keys, subscriptions, ERP connections, identity providers, webhooks, backups, audit logs, impersonation, OCR, and system health.
|
|
97
|
+
- **AI and search integration** -- `AiService` and `SearchService` for platform-wide intelligent search and AI-powered features.
|
|
98
|
+
- **Structured error handling** -- All HTTP errors are mapped to a `TgmSdkError` object with status code, message, raw error body, and original `HttpErrorResponse`.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Installation
|
|
103
|
+
|
|
104
|
+
### From GitHub Packages (recommended)
|
|
105
|
+
|
|
106
|
+
The SDK is published to **GitHub Packages** under the `@ensolutions` scope.
|
|
107
|
+
|
|
108
|
+
#### 1. Create a GitHub Personal Access Token (PAT)
|
|
109
|
+
|
|
110
|
+
Go to **GitHub > Settings > Developer settings > Personal access tokens > Tokens (classic)** and create a token with the `read:packages` scope.
|
|
111
|
+
|
|
112
|
+
#### 2. Configure npm to use GitHub Packages for the `@ensolutions` scope
|
|
113
|
+
|
|
114
|
+
Create or edit an `.npmrc` file in your Angular project root:
|
|
115
|
+
|
|
116
|
+
```ini
|
|
117
|
+
@en-solutions:registry=https://npm.pkg.github.com
|
|
118
|
+
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_PAT
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
> **Tip**: To avoid committing your token, set it as an environment variable instead:
|
|
122
|
+
> ```ini
|
|
123
|
+
> @en-solutions:registry=https://npm.pkg.github.com
|
|
124
|
+
> //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
|
|
125
|
+
> ```
|
|
126
|
+
> Then export it in your shell: `export GITHUB_TOKEN=ghp_xxxxxxxxxxxx`
|
|
127
|
+
|
|
128
|
+
#### 3. Install the SDK
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npm install @en-solutions/tgm-client-sdk
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### CI/CD (GitHub Actions)
|
|
135
|
+
|
|
136
|
+
In GitHub Actions, the built-in `GITHUB_TOKEN` secret has `read:packages` permission by default:
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
- name: Install dependencies
|
|
140
|
+
run: npm ci
|
|
141
|
+
env:
|
|
142
|
+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
With this `.npmrc` in your project:
|
|
146
|
+
```ini
|
|
147
|
+
@en-solutions:registry=https://npm.pkg.github.com
|
|
148
|
+
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### From source (npm link for local development)
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Build the SDK
|
|
155
|
+
cd /path/to/tgm-client-sdk
|
|
156
|
+
npm install
|
|
157
|
+
npm run build
|
|
158
|
+
|
|
159
|
+
# Link it globally
|
|
160
|
+
npm link
|
|
161
|
+
|
|
162
|
+
# In your Angular application
|
|
163
|
+
cd /path/to/your-angular-app
|
|
164
|
+
npm link @en-solutions/tgm-client-sdk
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Peer Dependencies
|
|
168
|
+
|
|
169
|
+
These must already be installed in your Angular application:
|
|
170
|
+
|
|
171
|
+
| Package | Version |
|
|
172
|
+
|--------------------|------------|
|
|
173
|
+
| `@angular/common` | `^18.0.0` |
|
|
174
|
+
| `@angular/core` | `^18.0.0` |
|
|
175
|
+
| `rxjs` | `^7.8.0` |
|
|
176
|
+
|
|
177
|
+
### Runtime Dependencies (bundled)
|
|
178
|
+
|
|
179
|
+
| Package | Purpose |
|
|
180
|
+
|--------------------|-----------------------------------------------|
|
|
181
|
+
| `@stomp/stompjs` | STOMP WebSocket protocol for chat and video signaling |
|
|
182
|
+
| `sockjs-client` | WebSocket fallback transport |
|
|
183
|
+
| `livekit-client` | LiveKit WebRTC video/audio room integration |
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Quick Start
|
|
188
|
+
|
|
189
|
+
### 1. Import the module
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
import { NgModule } from '@angular/core';
|
|
193
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
194
|
+
import { TgmSdkModule } from '@en-solutions/tgm-client-sdk';
|
|
195
|
+
|
|
196
|
+
@NgModule({
|
|
197
|
+
imports: [
|
|
198
|
+
BrowserModule,
|
|
199
|
+
TgmSdkModule.forRoot({
|
|
200
|
+
baseUrl: 'http://localhost:1337',
|
|
201
|
+
clientId: 'my-tenant-id',
|
|
202
|
+
}),
|
|
203
|
+
],
|
|
204
|
+
bootstrap: [AppComponent],
|
|
205
|
+
})
|
|
206
|
+
export class AppModule {}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### 2. Inject a service and make a call
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
import { Component, OnInit } from '@angular/core';
|
|
213
|
+
import { UnitService, Unit, PagedResponse } from '@en-solutions/tgm-client-sdk';
|
|
214
|
+
|
|
215
|
+
@Component({
|
|
216
|
+
selector: 'app-units',
|
|
217
|
+
template: `
|
|
218
|
+
<ul>
|
|
219
|
+
<li *ngFor="let unit of units">{{ unit.name }} -- {{ unit.status }}</li>
|
|
220
|
+
</ul>
|
|
221
|
+
`,
|
|
222
|
+
})
|
|
223
|
+
export class UnitsComponent implements OnInit {
|
|
224
|
+
units: Unit[] = [];
|
|
225
|
+
|
|
226
|
+
constructor(private unitService: UnitService) {}
|
|
227
|
+
|
|
228
|
+
ngOnInit(): void {
|
|
229
|
+
this.unitService.getAll({ page: 0, pageSize: 25 }).subscribe({
|
|
230
|
+
next: (response: PagedResponse<Unit>) => {
|
|
231
|
+
this.units = response.data;
|
|
232
|
+
console.log('Total units:', response.meta.pagination.total);
|
|
233
|
+
},
|
|
234
|
+
error: (err) => console.error('Failed to load units:', err.message),
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Configuration
|
|
243
|
+
|
|
244
|
+
The `TgmSdkConfig` interface accepts the following options:
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
TgmSdkModule.forRoot({
|
|
248
|
+
baseUrl: 'http://localhost:1337',
|
|
249
|
+
clientId: 'my-tenant-id',
|
|
250
|
+
wsEndpoint: '/ws',
|
|
251
|
+
tokenStorage: new MyCustomTokenStorage(),
|
|
252
|
+
autoRefresh: true,
|
|
253
|
+
tokenKey: 'jwt',
|
|
254
|
+
refreshTokenKey: 'refreshToken',
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
| Option | Type | Default | Description |
|
|
259
|
+
|--------------------|-------------------------|--------------------|-------------|
|
|
260
|
+
| `baseUrl` | `string` | **(required)** | Base URL of the TGM Manager backend (e.g., `http://localhost:1337`). Trailing slashes are automatically stripped. |
|
|
261
|
+
| `clientId` | `string` | `undefined` | Static client/tenant identifier. Sent as the `X-Client-ID` header on every request. Can also be changed at runtime with `TgmHttpClient.setClientId()`. |
|
|
262
|
+
| `wsEndpoint` | `string` | `'/ws'` | WebSocket endpoint path for STOMP connections (chat and video signaling). |
|
|
263
|
+
| `tokenStorage` | `TokenStorageStrategy` | `InMemoryTokenStorage` | Pluggable token persistence. Implement `getToken()`, `setToken()`, `removeToken()`, `getRefreshToken()`, `setRefreshToken()`, `removeRefreshToken()` for custom storage. |
|
|
264
|
+
| `autoRefresh` | `boolean` | `true` | When `true`, the SDK automatically attempts to refresh the JWT using the stored refresh token on any `401` response, then retries the original request. |
|
|
265
|
+
| `tokenKey` | `string` | `'jwt'` | The property name used to extract the access token from authentication response payloads. |
|
|
266
|
+
| `refreshTokenKey` | `string` | `'refreshToken'` | The property name used to extract the refresh token from authentication response payloads. |
|
|
267
|
+
|
|
268
|
+
### Custom Token Storage Example
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
export class LocalStorageTokenStorage implements TokenStorageStrategy {
|
|
272
|
+
getToken(): string | null {
|
|
273
|
+
return localStorage.getItem('tgm_token');
|
|
274
|
+
}
|
|
275
|
+
setToken(token: string): void {
|
|
276
|
+
localStorage.setItem('tgm_token', token);
|
|
277
|
+
}
|
|
278
|
+
removeToken(): void {
|
|
279
|
+
localStorage.removeItem('tgm_token');
|
|
280
|
+
}
|
|
281
|
+
getRefreshToken(): string | null {
|
|
282
|
+
return localStorage.getItem('tgm_refresh_token');
|
|
283
|
+
}
|
|
284
|
+
setRefreshToken(token: string): void {
|
|
285
|
+
localStorage.setItem('tgm_refresh_token', token);
|
|
286
|
+
}
|
|
287
|
+
removeRefreshToken(): void {
|
|
288
|
+
localStorage.removeItem('tgm_refresh_token');
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Usage
|
|
293
|
+
TgmSdkModule.forRoot({
|
|
294
|
+
baseUrl: 'http://localhost:1337',
|
|
295
|
+
tokenStorage: new LocalStorageTokenStorage(),
|
|
296
|
+
});
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Usage Examples
|
|
302
|
+
|
|
303
|
+
### Authentication
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
import { AuthService, AuthResponse } from '@en-solutions/tgm-client-sdk';
|
|
307
|
+
|
|
308
|
+
// Login with email/password
|
|
309
|
+
this.authService.login({ identifier: 'user@example.com', password: 'secret' }).subscribe({
|
|
310
|
+
next: (res: AuthResponse) => {
|
|
311
|
+
console.log('Logged in as:', res.user.username);
|
|
312
|
+
// Tokens are stored automatically via handleAuthResponse()
|
|
313
|
+
},
|
|
314
|
+
error: (err) => console.error('Login failed:', err.message),
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// Badge/PIN login
|
|
318
|
+
this.authService.badgeLogin({ badgeNumber: 'ABC123', pin: '1234' }).subscribe();
|
|
319
|
+
|
|
320
|
+
// Check authentication state reactively
|
|
321
|
+
this.authService.isAuthenticated$.subscribe((isAuth) => {
|
|
322
|
+
console.log('Authenticated:', isAuth);
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
// Logout (clears tokens and resets user state)
|
|
326
|
+
this.authService.logout();
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### CRUD Operations
|
|
330
|
+
|
|
331
|
+
Every domain service that extends `BaseCrudService` provides these methods:
|
|
332
|
+
|
|
333
|
+
```typescript
|
|
334
|
+
import { WorkOrderService, WorkOrder, WorkOrderStatus } from '@en-solutions/tgm-client-sdk';
|
|
335
|
+
|
|
336
|
+
// List with pagination, sorting, and filtering
|
|
337
|
+
this.workOrderService.getAll({
|
|
338
|
+
page: 0,
|
|
339
|
+
pageSize: 50,
|
|
340
|
+
sort: 'createdAt',
|
|
341
|
+
order: 'DESC',
|
|
342
|
+
status: WorkOrderStatus.IN_PROGRESS,
|
|
343
|
+
}).subscribe((response) => {
|
|
344
|
+
console.log(response.data); // WorkOrder[]
|
|
345
|
+
console.log(response.meta.pagination.total); // Total count
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
// Get by ID
|
|
349
|
+
this.workOrderService.getById(42).subscribe((response) => {
|
|
350
|
+
console.log(response.data); // WorkOrder
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// Create
|
|
354
|
+
this.workOrderService.create({
|
|
355
|
+
title: 'Replace pump bearings',
|
|
356
|
+
unitId: 7,
|
|
357
|
+
priority: 'HIGH',
|
|
358
|
+
}).subscribe((response) => {
|
|
359
|
+
console.log('Created:', response.data.id);
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
// Update
|
|
363
|
+
this.workOrderService.update(42, { status: WorkOrderStatus.COMPLETED }).subscribe();
|
|
364
|
+
|
|
365
|
+
// Delete
|
|
366
|
+
this.workOrderService.delete(42).subscribe();
|
|
367
|
+
|
|
368
|
+
// Count
|
|
369
|
+
this.workOrderService.count().subscribe((response) => {
|
|
370
|
+
console.log('Total work orders:', response.data);
|
|
371
|
+
});
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Pagination Pattern
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
import { PaginationParams, PagedResponse } from '@en-solutions/tgm-client-sdk';
|
|
378
|
+
|
|
379
|
+
loadPage(page: number): void {
|
|
380
|
+
const params: PaginationParams = {
|
|
381
|
+
page,
|
|
382
|
+
pageSize: 25,
|
|
383
|
+
sort: 'name',
|
|
384
|
+
order: 'ASC',
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
this.unitService.getAll(params).subscribe((res: PagedResponse<Unit>) => {
|
|
388
|
+
this.items = res.data;
|
|
389
|
+
this.totalPages = res.meta.pagination.pageCount;
|
|
390
|
+
this.totalItems = res.meta.pagination.total;
|
|
391
|
+
this.currentPage = res.meta.pagination.page;
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### File Upload
|
|
397
|
+
|
|
398
|
+
```typescript
|
|
399
|
+
import { UploadService } from '@en-solutions/tgm-client-sdk';
|
|
400
|
+
|
|
401
|
+
// Single file upload
|
|
402
|
+
onFileSelected(event: Event): void {
|
|
403
|
+
const file = (event.target as HTMLInputElement).files?.[0];
|
|
404
|
+
if (file) {
|
|
405
|
+
this.uploadService.upload(file).subscribe({
|
|
406
|
+
next: (res) => console.log('Uploaded:', res.data),
|
|
407
|
+
error: (err) => console.error('Upload failed:', err.message),
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// Multiple file upload
|
|
413
|
+
this.uploadService.uploadMultiple(fileList).subscribe();
|
|
414
|
+
|
|
415
|
+
// Download
|
|
416
|
+
this.uploadService.download(fileId).subscribe((blob: Blob) => {
|
|
417
|
+
const url = URL.createObjectURL(blob);
|
|
418
|
+
window.open(url);
|
|
419
|
+
});
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Real-Time Chat (WebSocket)
|
|
423
|
+
|
|
424
|
+
```typescript
|
|
425
|
+
import { ChatWebSocketService, ChatRestService, ChatMessage } from '@en-solutions/tgm-client-sdk';
|
|
426
|
+
|
|
427
|
+
// Connect to the WebSocket
|
|
428
|
+
this.chatWs.connect();
|
|
429
|
+
|
|
430
|
+
// Listen for incoming messages
|
|
431
|
+
this.chatWs.messages$.subscribe((message: ChatMessage) => {
|
|
432
|
+
console.log(`[${message.sender.username}]: ${message.content}`);
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
// Listen for typing indicators
|
|
436
|
+
this.chatWs.typing$.subscribe((event) => {
|
|
437
|
+
console.log(`User ${event.userId} is ${event.typing ? 'typing' : 'idle'}`);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
// Listen for presence updates
|
|
441
|
+
this.chatWs.presence$.subscribe((presence) => {
|
|
442
|
+
console.log(`User ${presence.userId} is ${presence.status}`);
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
// Send a message
|
|
446
|
+
this.chatWs.sendMessage({
|
|
447
|
+
conversationId: 1,
|
|
448
|
+
content: 'Hello, team!',
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// Send typing indicator
|
|
452
|
+
this.chatWs.sendTyping(1, true);
|
|
453
|
+
|
|
454
|
+
// Mark messages as read
|
|
455
|
+
this.chatWs.markRead(1, 456);
|
|
456
|
+
|
|
457
|
+
// REST API for conversation management
|
|
458
|
+
this.chatRest.getConversations({ page: 0, pageSize: 20 }).subscribe();
|
|
459
|
+
this.chatRest.createConversation({ name: 'Project Alpha', participantIds: [2, 3, 4] }).subscribe();
|
|
460
|
+
|
|
461
|
+
// Disconnect when done
|
|
462
|
+
this.chatWs.disconnect();
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### Video Calls
|
|
466
|
+
|
|
467
|
+
```typescript
|
|
468
|
+
import {
|
|
469
|
+
VideoCallRestService,
|
|
470
|
+
VideoCallWebSocketService,
|
|
471
|
+
VideoCallModule,
|
|
472
|
+
} from '@en-solutions/tgm-client-sdk';
|
|
473
|
+
|
|
474
|
+
// Initiate a call
|
|
475
|
+
this.videoCallRest.initiateCall({
|
|
476
|
+
targetUserId: 5,
|
|
477
|
+
companyId: 1,
|
|
478
|
+
type: 'VIDEO',
|
|
479
|
+
}).subscribe((res) => {
|
|
480
|
+
console.log('Call initiated:', res.data.id);
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
// Answer an incoming call
|
|
484
|
+
this.videoCallRest.answerCall(callId, true).subscribe((res) => {
|
|
485
|
+
// res.data contains the LiveKit token for room connection
|
|
486
|
+
console.log('LiveKit token:', res.data?.token);
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
// End a call
|
|
490
|
+
this.videoCallRest.endCall(callId).subscribe();
|
|
491
|
+
|
|
492
|
+
// Use the pre-built video components by importing VideoCallModule
|
|
493
|
+
// in your feature module:
|
|
494
|
+
@NgModule({
|
|
495
|
+
imports: [VideoCallModule],
|
|
496
|
+
})
|
|
497
|
+
export class MyFeatureModule {}
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
### Reservoir Management
|
|
501
|
+
|
|
502
|
+
```typescript
|
|
503
|
+
import {
|
|
504
|
+
GateSystemService,
|
|
505
|
+
AlertDefinitionService,
|
|
506
|
+
ReservoirTimeSeriesService,
|
|
507
|
+
GateControlService,
|
|
508
|
+
ReservoirWebSocketService,
|
|
509
|
+
GateSystem,
|
|
510
|
+
AlertDefinition,
|
|
511
|
+
GateType,
|
|
512
|
+
GateControlType,
|
|
513
|
+
} from '@en-solutions/tgm-client-sdk';
|
|
514
|
+
|
|
515
|
+
// --- CRUD: Create a gate system ---
|
|
516
|
+
this.gateSystemService.create({
|
|
517
|
+
name: 'Spillway Gate A1',
|
|
518
|
+
reservoirId: 1,
|
|
519
|
+
gateType: GateType.SPILLWAY,
|
|
520
|
+
controlType: GateControlType.HYDRAULIC,
|
|
521
|
+
}).subscribe((res) => {
|
|
522
|
+
console.log('Created gate system:', res.data.id);
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
// --- CRUD: List alert definitions with pagination ---
|
|
526
|
+
this.alertDefinitionService.getAll({
|
|
527
|
+
page: 0,
|
|
528
|
+
pageSize: 25,
|
|
529
|
+
sort: 'createdAt',
|
|
530
|
+
order: 'DESC',
|
|
531
|
+
}).subscribe((res) => {
|
|
532
|
+
console.log('Alert definitions:', res.data);
|
|
533
|
+
console.log('Total:', res.meta.pagination.total);
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
// --- Time-Series: Query sensor data ---
|
|
537
|
+
this.timeSeriesService.getSensorTimeSeries('reservoir-1', 'water_level', {
|
|
538
|
+
start: '2025-01-01T00:00:00Z',
|
|
539
|
+
end: '2025-01-31T23:59:59Z',
|
|
540
|
+
interval: '1h',
|
|
541
|
+
aggregation: 'mean',
|
|
542
|
+
}).subscribe((res) => {
|
|
543
|
+
console.log('Sensor readings:', res.data);
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
// --- Time-Series: Get weather forecast ---
|
|
547
|
+
this.timeSeriesService.getWeatherForecast('reservoir-1', {
|
|
548
|
+
start: '2025-02-01T00:00:00Z',
|
|
549
|
+
end: '2025-02-07T23:59:59Z',
|
|
550
|
+
}).subscribe((res) => {
|
|
551
|
+
console.log('Weather forecast:', res.data);
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
// --- Gate Control: Operate a gate ---
|
|
555
|
+
this.gateControlService.operateGate('gate-42', {
|
|
556
|
+
targetPosition: 75.0,
|
|
557
|
+
reason: 'Flood management -- increasing discharge',
|
|
558
|
+
}).subscribe((res) => {
|
|
559
|
+
console.log('Gate operation event:', res.data);
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
// --- Gate Control: Acknowledge an alert ---
|
|
563
|
+
this.gateControlService.acknowledgeAlert(123, {
|
|
564
|
+
acknowledgedBy: 'operator@example.com',
|
|
565
|
+
notes: 'Inspected on-site, situation resolved',
|
|
566
|
+
}).subscribe((res) => {
|
|
567
|
+
console.log('Alert acknowledged:', res.data);
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
// --- Real-Time WebSocket: Connect to reservoir streams ---
|
|
571
|
+
this.reservoirWs.connect('reservoir-1');
|
|
572
|
+
|
|
573
|
+
// Listen for live sensor data
|
|
574
|
+
this.reservoirWs.sensors$.subscribe((data) => {
|
|
575
|
+
console.log('Sensor update:', data);
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
// Listen for external data (weather, grid market, lab results)
|
|
579
|
+
this.reservoirWs.externalData$.subscribe((data) => {
|
|
580
|
+
console.log('External data:', data);
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
// Listen for manual data (inspections, operator readings)
|
|
584
|
+
this.reservoirWs.manualData$.subscribe((data) => {
|
|
585
|
+
console.log('Manual data:', data);
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
// Listen for status alerts and operating events
|
|
589
|
+
this.reservoirWs.statusAlerts$.subscribe((alert) => {
|
|
590
|
+
console.log('Status alert:', alert);
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
// Disconnect when done
|
|
594
|
+
this.reservoirWs.disconnect();
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### Runtime Multi-Tenancy
|
|
598
|
+
|
|
599
|
+
```typescript
|
|
600
|
+
import { TgmHttpClient } from '@en-solutions/tgm-client-sdk';
|
|
601
|
+
|
|
602
|
+
// Switch tenant at runtime (updates X-Client-ID header for all subsequent requests)
|
|
603
|
+
this.httpClient.setClientId('new-tenant-id');
|
|
604
|
+
|
|
605
|
+
// Check current tenant
|
|
606
|
+
console.log('Current client:', this.httpClient.getClientId());
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
---
|
|
610
|
+
|
|
611
|
+
## API Reference
|
|
612
|
+
|
|
613
|
+
### Auth Services (4 services)
|
|
614
|
+
|
|
615
|
+
| Service | Methods | Description |
|
|
616
|
+
|------------------------|---------|-------------|
|
|
617
|
+
| `AuthService` | 16 | Local login, badge login, registration, password reset, email verification, token refresh, user state |
|
|
618
|
+
| `SsoAuthService` | -- | SSO login flows (SAML, OIDC, etc.) |
|
|
619
|
+
| `TotpService` | -- | TOTP (time-based one-time password) setup and verification |
|
|
620
|
+
| `PlatformAuthService` | -- | Platform admin authentication (separate from tenant auth) |
|
|
621
|
+
|
|
622
|
+
### API Services (57 services)
|
|
623
|
+
|
|
624
|
+
| Service | Domain | Service | Domain |
|
|
625
|
+
|------------------------------|--------|------------------------------|--------|
|
|
626
|
+
| `UnitService` | Units / Plants | `WorkOrderService` | Work orders |
|
|
627
|
+
| `ComponentService` | Components / Assets | `InterventionService` | Interventions |
|
|
628
|
+
| `InterventionRequestService` | Intervention requests | `InspectionService` | Inspections |
|
|
629
|
+
| `CompanyService` | Companies | `UserService` | Users |
|
|
630
|
+
| `DepartmentService` | Departments | `LocationService` | Locations |
|
|
631
|
+
| `RoomService` | Rooms | `DocumentService` | Documents |
|
|
632
|
+
| `MaterialItemService` | Material items | `MaterialConsumableService` | Consumables |
|
|
633
|
+
| `MaterialToolingService` | Tooling | `MaterialInstrumentService` | Instruments |
|
|
634
|
+
| `SensorService` | IoT sensors | `AlertService` | Alerts |
|
|
635
|
+
| `EnergyService` | Energy data | `FleetService` | Fleet management |
|
|
636
|
+
| `WarrantyService` | Warranties | `ComplianceService` | Compliance |
|
|
637
|
+
| `QualityService` | Quality (RCA, CAPA) | `FailureService` | Failure tracking |
|
|
638
|
+
| `ProjectService` | Projects | `CapexProjectService` | CapEx projects |
|
|
639
|
+
| `BudgetService` | Budgets | `BidService` | Bids / Tenders |
|
|
640
|
+
| `WorkflowService` | Workflow approvals | `TodoService` | To-do items |
|
|
641
|
+
| `NoteService` | Notes | `LogService` | Activity logs |
|
|
642
|
+
| `EventService` | Events | `CommunityService` | Community |
|
|
643
|
+
| `KnowledgeService` | Knowledge base | `CustomFieldService` | Custom fields |
|
|
644
|
+
| `DashboardService` | Dashboard | `SearchService` | Global search |
|
|
645
|
+
| `AiService` | AI features | `UploadService` | File upload/download |
|
|
646
|
+
| `ExportService` | Data export | `ExtensionService` | Extensions |
|
|
647
|
+
| `SandboxService` | Sandboxes | `LoginHistoryService` | Login history |
|
|
648
|
+
| `MiscCrudService` | Misc entities | | |
|
|
649
|
+
|
|
650
|
+
### Reservoir Management Services (11 services + 1 WebSocket)
|
|
651
|
+
|
|
652
|
+
| Service | Endpoint | Description |
|
|
653
|
+
|---------|----------|-------------|
|
|
654
|
+
| `GateSystemService` | `/api/gate-systems` | Gate system configuration (CRUD) |
|
|
655
|
+
| `AlertDefinitionService` | `/api/alert-definitions` | Alert rule definitions (CRUD) |
|
|
656
|
+
| `ManualReadingService` | `/api/manual-readings` | Operator manual gauge readings (CRUD) |
|
|
657
|
+
| `LaboratoryResultService` | `/api/laboratory-results` | Lab water/sediment analysis results (CRUD) |
|
|
658
|
+
| `FishMonitoringService` | `/api/fish-monitoring` | Fish passage monitoring data (CRUD) |
|
|
659
|
+
| `RegulatoryUpdateService` | `/api/regulatory-updates` | Regulatory compliance updates (CRUD) |
|
|
660
|
+
| `OperationalObservationService` | `/api/operational-observations` | Field operator observations (CRUD) |
|
|
661
|
+
| `BathymetricSurveyService` | `/api/bathymetric-surveys` | Reservoir bathymetry surveys (CRUD) |
|
|
662
|
+
| `AIScenarioService` | `/api/ai-scenarios` | AI turbine dispatch optimization scenarios (CRUD) |
|
|
663
|
+
| `ReservoirTimeSeriesService` | `/api/reservoirs/{id}/timeseries/*` | InfluxDB queries for sensor, weather, grid market, and gate data |
|
|
664
|
+
| `GateControlService` | `/api/gates/{id}/operate` | Gate operations and alert acknowledgment |
|
|
665
|
+
| `ReservoirWebSocketService` | STOMP `/topic/reservoir/{id}/*` | Real-time 4-stream WebSocket (sensors, external, manual, status) |
|
|
666
|
+
|
|
667
|
+
### Admin / Platform Services (30 services)
|
|
668
|
+
|
|
669
|
+
| Service | Description |
|
|
670
|
+
|----------------------------|-------------|
|
|
671
|
+
| `PlatformAdminService` | Platform-level admin operations |
|
|
672
|
+
| `ClientAdminService` | Client/tenant CRUD and provisioning |
|
|
673
|
+
| `ClientApiKeyService` | API key management per client |
|
|
674
|
+
| `ClientUsageService` | Usage metrics and quotas |
|
|
675
|
+
| `ClientOcrService` | OCR processing management |
|
|
676
|
+
| `SubscriptionService` | Subscription plans and billing |
|
|
677
|
+
| `RoleAdminService` | Role definitions and permissions |
|
|
678
|
+
| `UserAdminService` | User administration across clients |
|
|
679
|
+
| `UserPermissionService` | Fine-grained permission management |
|
|
680
|
+
| `ImpersonationService` | Admin impersonation of users |
|
|
681
|
+
| `TicketService` *(client-facing)* | Support ticket creation, viewing, and comments |
|
|
682
|
+
| `ErpAdminService` | ERP integration configuration |
|
|
683
|
+
| `IdentityProviderService` | SSO/IdP setup (SAML, OIDC, LDAP) |
|
|
684
|
+
| `WebhookAdminService` | Webhook endpoint management |
|
|
685
|
+
| `PlatformWebhookService` | Platform-level webhook events |
|
|
686
|
+
| `EmailAdminService` | Email template management |
|
|
687
|
+
| `EmailProviderService` | Email provider configuration |
|
|
688
|
+
| `MessagingProviderService` | SMS/push notification providers |
|
|
689
|
+
| `NotificationService` | Notification delivery |
|
|
690
|
+
| `AnnouncementService` | Platform announcements |
|
|
691
|
+
| `ArticleAdminService` | Knowledge base administration |
|
|
692
|
+
| `DocumentAdminService` | Document administration |
|
|
693
|
+
| `BackupService` | Database backup and restore |
|
|
694
|
+
| `CacheAdminService` | Cache management and invalidation |
|
|
695
|
+
| `QueueAdminService` | Background job queue management |
|
|
696
|
+
| `DataExportService` | Bulk data export operations |
|
|
697
|
+
| `AuditLogService` | Audit trail queries |
|
|
698
|
+
| `ActivityLogService` | Activity log queries |
|
|
699
|
+
| `SystemHealthService` | Health checks and system status |
|
|
700
|
+
| `SandboxAdminService` | Sandbox environment management |
|
|
701
|
+
|
|
702
|
+
### Chat Services (2 services)
|
|
703
|
+
|
|
704
|
+
| Service | Description |
|
|
705
|
+
|-------------------------|-------------|
|
|
706
|
+
| `ChatRestService` | REST API for conversations, messages, participants, reactions, read receipts, presence (28 methods) |
|
|
707
|
+
| `ChatWebSocketService` | Real-time STOMP/WebSocket for messages, typing, presence, reactions, read receipts (8 methods) |
|
|
708
|
+
|
|
709
|
+
### Video Call Services (2 services + 4 components)
|
|
710
|
+
|
|
711
|
+
| Service / Component | Description |
|
|
712
|
+
|-----------------------------|-------------|
|
|
713
|
+
| `VideoCallRestService` | REST API for call initiation, answer, join, end, history (7 methods) |
|
|
714
|
+
| `VideoCallWebSocketService` | WebSocket signaling for call events |
|
|
715
|
+
| `VideoRoomComponent` | Pre-built video room UI component |
|
|
716
|
+
| `VideoControlsComponent` | Mic/camera/screen-share toggle controls |
|
|
717
|
+
| `VideoParticipantComponent` | Individual participant video tile |
|
|
718
|
+
| `IncomingCallComponent` | Incoming call notification with accept/decline |
|
|
719
|
+
|
|
720
|
+
---
|
|
721
|
+
|
|
722
|
+
## Documentation
|
|
723
|
+
|
|
724
|
+
Detailed guides are available in the [`docs/`](./docs/) folder:
|
|
725
|
+
|
|
726
|
+
| Document | Description |
|
|
727
|
+
|----------|-------------|
|
|
728
|
+
| [Getting Started](./docs/getting-started.md) | Installation, setup, and first request |
|
|
729
|
+
| [Configuration](./docs/configuration.md) | TgmSdkConfig options, token storage, multi-tenancy |
|
|
730
|
+
| [Authentication](./docs/authentication.md) | Login, SSO, TOTP, platform auth, token management |
|
|
731
|
+
| [API Services](./docs/api-services.md) | BaseCrudService pattern and all domain services |
|
|
732
|
+
| [Admin Services](./docs/admin-services.md) | Platform admin, client management, ERP, webhooks |
|
|
733
|
+
| [Real-Time](./docs/real-time.md) | WebSocket chat and video call integration |
|
|
734
|
+
| [Models](./docs/models.md) | DTOs, enums, base models, and type patterns |
|
|
735
|
+
| [Error Handling](./docs/error-handling.md) | TgmApiError, error types, global handling |
|
|
736
|
+
| [Examples](./docs/examples.md) | Practical code examples for common use cases |
|
|
737
|
+
|
|
738
|
+
---
|
|
739
|
+
|
|
740
|
+
## Development
|
|
741
|
+
|
|
742
|
+
### Prerequisites
|
|
743
|
+
|
|
744
|
+
- Node.js 18+
|
|
745
|
+
- npm 9+
|
|
746
|
+
- Angular CLI (optional, for scaffolding tests)
|
|
747
|
+
|
|
748
|
+
### Build
|
|
749
|
+
|
|
750
|
+
```bash
|
|
751
|
+
# Production build (outputs to ./dist/)
|
|
752
|
+
npm run build
|
|
753
|
+
|
|
754
|
+
# Watch mode for development
|
|
755
|
+
npm run build:watch
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
### Lint
|
|
759
|
+
|
|
760
|
+
```bash
|
|
761
|
+
# Type-check without emitting (uses tsc --noEmit)
|
|
762
|
+
npm run lint
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
### Link for Local Testing
|
|
766
|
+
|
|
767
|
+
```bash
|
|
768
|
+
# In the SDK directory
|
|
769
|
+
npm run build
|
|
770
|
+
npm link
|
|
771
|
+
|
|
772
|
+
# In a consuming Angular application
|
|
773
|
+
npm link @en-solutions/tgm-client-sdk
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
### Project Scripts
|
|
777
|
+
|
|
778
|
+
| Script | Command | Description |
|
|
779
|
+
|-----------------|--------------------------------------|-------------|
|
|
780
|
+
| `build` | `ng-packagr -p ng-package.json` | Build the library for distribution |
|
|
781
|
+
| `build:watch` | `ng-packagr -p ng-package.json --watch` | Rebuild on file changes |
|
|
782
|
+
| `lint` | `tsc --noEmit` | Type-check all source files |
|
|
783
|
+
|
|
784
|
+
---
|
|
785
|
+
|
|
786
|
+
## License
|
|
787
|
+
|
|
788
|
+
**Proprietary** -- This is an internal SDK developed and maintained by ENSolutions. Unauthorized distribution is prohibited.
|