@ngreenberg/egain-contentmgr-sdk
v1.0.6
Published
OpenAPI client for @ngreenberg/contentmgr-sdk
Maintainers
Readme
@ngreenberg/contentmgr-sdk
Docs viewer: https://unpkg.com/@ngreenberg/contentmgr-sdk@latest/docs/index.html
This generator creates TypeScript/JavaScript client that utilizes axios. The generated Node module can be used in the following environments:
Environment
- Node.js
- Webpack
- Browserify
Language level
- ES5 - you must have a Promises/A+ library installed
- ES6
Module system
- CommonJS
- ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via package.json. (Reference)
Building
To build and compile the typescript sources to javascript use:
npm install
npm run buildPublishing
First build the package then run npm publish
Consuming
navigate to the folder of your consuming project and run one of the following commands.
published:
npm install @ngreenberg/[email protected] --saveunPublished (not recommended):
npm install PATH_TO_GENERATED_PACKAGE --saveDocumentation for API Endpoints
ContentImportApi
|Method | HTTP request | Description| |------------- | ------------- | -------------| |createImport | POST /import/content | Import content from external sources| |createImportValidation | POST /import/content/validate | Validate content structure and format before import| |getImportContent | GET /import/content/{job_id}/status | Get the current status of an import or validation job| |patchImportContentValidation | POST /import/content/{job_id}/cancel | Cancel an import or validation job|
createImport
createImport(importContent)
Import Content ## Overview This API initiates a bulk content import operation from Amazon S3 buckets. It creates an asynchronous import job that processes content in the background, allowing you to import large volumes of content without blocking your application. ## How It Works 1. Job Creation: The API creates an import job and returns a unique job ID 2. Content Processing: Content is processed asynchronously in the background 3. Status Monitoring: Use the job ID to monitor progress via the Status API 4. Completion: Job completes when all content is processed or errors occur ## Supported Operations - Import: Add new content to the knowledge base - Update: Modify existing content ## Data Source Types - AWS S3 bucket - Shared file path ## Best Practices - Scheduling: Use scheduleTime for off-peak imports to minimize system impact - Monitoring: Regularly check job status and logs for any issues - Error Handling: Review failed items and retry with corrections ## Permissions | Actor | Permission | | ------- | --------| | User |User must be a department user.Content can only be imported in user's home department.User must have 'Author' role.Content can only be imported if the user has all the required languages assigned.|
Example
import {
ContentImportApi,
Configuration,
ImportContent
} from '@ngreenberg/contentmgr-sdk';
const configuration = new Configuration();
const apiInstance = new ContentImportApi(configuration);
let importContent: ImportContent; //
const { status, data } = await apiInstance.createImport(
importContent
);Parameters
|Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | importContent | ImportContent| | |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers | |-------------|-------------|------------------| |202 | ## Import Job Accepted The import job has been successfully created and queued for processing. The job will begin execution according to the specified schedule or immediately if no schedule is provided. Next Steps: 1. Use the returned job ID to monitor progress via the Status API 2. Check job logs for any validation warnings or errors 3. Monitor job completion and review results Expected Processing Time: - Small jobs (< 1,000 items): 5-15 minutes - Medium jobs (1,000-10,000 items): 15-60 minutes - Large jobs (> 10,000 items): 1-4 hours (depending on content complexity) | * location - Location Header This header contains the URL to check the status of your validation job. The job ID (7A84B875-6F75-4C7B-B137-0632B62DB0BD in this example) is your unique identifier for tracking this operation. Usage: ```bash GET /knowledge/contentmgr/v4/import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ``` | |400 | Bad Request | - | |401 | Unauthorized | - | |403 | Forbidden | - | |406 | Not acceptable | - | |412 | Preconditions failed | - | |500 | Internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createImportValidation
createImportValidation(validateImportContent)
Validate Import Content ## Overview This API enables users to validate content structure, format, and compliance before importing it into the production knowledge base. Validation is a non-destructive operation that checks content without making any changes to your existing data. ## What Validation Checks - Content Structure: Verifies required fields and data types - Format Compliance: Ensures content meets platform requirements - Language Support: Validates content against supported languages - Metadata Mapping: Checks field mappings and transformations - Business Rules: Validates against department-specific rules ## Validation Benefits - Risk Mitigation: Identify issues before affecting production data - Quality Assurance: Ensure content meets organizational standards - Cost Savings: Avoid failed imports that waste processing time - Compliance: Meet regulatory and internal content requirements ## Validation Process 1. Content Analysis: System analyzes content structure and format 2. Rule Validation: Applies business rules and validation logic 3. Quality Assessment: Evaluates content quality and completeness 4. Report Generation: Creates detailed validation report 5. Issue Categorization: Classifies issues by severity and type ## Common Validation Issues - Missing Required Fields: Title, description, category, etc. - Invalid Data Types: Incorrect field formats (dates, numbers, etc.) - Language Mismatches: Content language not supported by department ## Best Practices - Always Validate First: Run validation before any import operation - Review Reports: Carefully examine validation results and warnings - Fix Issues: Address validation errors before proceeding with import - Test Small Batches: Validate with small content samples first - Iterate: Use validation feedback to improve content quality ## Permissions | Actor | Permission | | ------- | --------| | User |User must be a department user.User must have 'Author' role.Content can only be imported if the user has all the required languages assigned.|
Example
import {
ContentImportApi,
Configuration,
ValidateImportContent
} from '@ngreenberg/contentmgr-sdk';
const configuration = new Configuration();
const apiInstance = new ContentImportApi(configuration);
let validateImportContent: ValidateImportContent; //
const { status, data } = await apiInstance.createImportValidation(
validateImportContent
);Parameters
|Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | validateImportContent | ValidateImportContent| | |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers | |-------------|-------------|------------------| |202 | ## Validation Job Accepted The content validation job has been successfully created and queued for processing. The system will analyze your content structure, format, and compliance without making any changes to your existing data. Validation Process: 1. Content Analysis: System examines content structure and format 2. Rule Validation: Applies business rules and validation logic 3. Quality Assessment: Evaluates content quality and completeness 4. Report Generation: Creates detailed validation report with issues and recommendations Expected Processing Time: - Small content sets (< 1,000 items): 2-10 minutes - Medium content sets (1,000-10,000 items): 10-30 minutes - Large content sets (> 10,000 items): 30-90 minutes Next Steps: 1. Use the returned job ID to monitor validation progress 2. Review validation results and address any issues 3. Proceed with import only after validation passes | * location - Location Header This header contains the URL to check the status of your validation job. The job ID (7A84B875-6F75-4C7B-B137-0632B62DB0BD in this example) is your unique identifier for tracking this operation. Usage: ```bash GET /knowledge/contentmgr/v4/import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ``` | |400 | Bad Request | - | |401 | Unauthorized | - | |403 | Forbidden | - | |406 | Not acceptable | - | |412 | Preconditions failed | - | |500 | Internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getImportContent
ImportStatus getImportContent()
Get Import Job Status ## Overview This API provides real-time status information for content import and validation operations. Use this endpoint to monitor job progress, check completion status, and access detailed logs and error information. ## Status Values - Scheduled: Job is queued and waiting for scheduled execution time - In Progress: Job is actively processing content - Completed: Job finished successfully - Failed: Job encountered errors and could not complete - Cancelled: Job was manually cancelled by user ## Response Information - Current Status: Real-time job status - Progress Metrics: Items processed, total items, completion percentage - Log Files: Location of detailed operation logs - Error Details: Specific errors encountered during processing - Timing Information: Start time, estimated completion, actual completion ## Log File Access Log files contain detailed information about: - Content processing steps - Validation results - Error details with context ## Permissions | Actor | Permission | | ------- | --------| | User |User must be a department user.User must have 'Author' role.The job must have been created by the logged in user, or the logged in user must have 'View' permissions on the user who created the job.|
Example
import {
ContentImportApi,
Configuration
} from '@ngreenberg/contentmgr-sdk';
const configuration = new Configuration();
const apiInstance = new ContentImportApi(configuration);
let jobId: string; //**Job ID Parameter** The unique identifier for the import or validation job. This ID was returned when the job was created via the Import or Validate API. **Format:** UUID v4 (e.g., 7A84B875-6F75-4C7B-B137-0632B62DB0BD) **Example Usage:** ```bash GET /import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ``` (default to undefined)
const { status, data } = await apiInstance.getImportContent(
jobId
);Parameters
|Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | jobId | [string] | Job ID Parameter The unique identifier for the import or validation job. This ID was returned when the job was created via the Import or Validate API. Format: UUID v4 (e.g., 7A84B875-6F75-4C7B-B137-0632B62DB0BD) Example Usage: ```bash GET /import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ``` | defaults to undefined|
Return type
ImportStatus
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers | |-------------|-------------|------------------| |200 | ## Job Status Retrieved Successfully The current status and progress information for the specified import or validation job. Response Details: - Status: Current job state (Scheduled, In Progress, Completed, etc.) - Progress: Number of items processed vs. total items - Logs: Location of detailed operation logs - Timing: Start time and estimated completion - Errors: Any validation or processing errors encountered | - | |400 | Bad Request | - | |401 | Unauthorized | - | |403 | Forbidden | - | |404 | Not Found | - | |406 | Not acceptable | - | |500 | Internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
patchImportContentValidation
patchImportContentValidation()
Cancel Import or Validation Job ## Overview This API allows users to cancel import or validation operations that are currently in progress or scheduled for future execution. Cancellation is immediate for scheduled jobs and graceful for running jobs. ## Cancellation Behavior - Scheduled Jobs: Immediate cancellation, no processing occurs - In Progress Jobs: Graceful shutdown, current item completes, no new items start - Completed Jobs: Cannot be cancelled (returns error) - Failed Jobs: Cannot be cancelled (already stopped) ## When to Cancel - Content Issues: Discover problems with source content - Timing Changes: Need to reschedule for different time - Resource Constraints: System resources are needed elsewhere - User Request: Manual cancellation by authorized users - System Maintenance: Planned maintenance windows ## Cancellation Process 1. Request Received: System receives cancellation request 2. Status Check: Verifies current job status 3. Graceful Shutdown: For running jobs, completes current item 4. Resource Cleanup: Releases allocated system resources 5. Status Update: Marks job as cancelled 6. Notification: Updates job status and logs ## Post-Cancellation - Job Status: Changes to "Cancelled" - Partial Results: Any completed items remain in system - Logs: Cancellation reason and timing recorded - Resources: System resources freed for other operations ## Best Practices - Monitor Jobs: Regularly check job status to identify candidates for cancellation - Plan Cancellations: Schedule cancellations during low-usage periods - Resource Planning: Consider resource impact before cancelling large jobs ## Permissions | Actor | Permission | | ------- | --------| | User |User must be a department user.Content can only be validated for user's home department.User must have 'Author' role.The job must have been created by the logged in user, or the logged in user must have 'Edit' permissions on the user who created the job.|
Example
import {
ContentImportApi,
Configuration
} from '@ngreenberg/contentmgr-sdk';
const configuration = new Configuration();
const apiInstance = new ContentImportApi(configuration);
let jobId: string; //**Job ID Parameter** The unique identifier for the import or validation job. This ID was returned when the job was created via the Import or Validate API. **Format:** UUID v4 (e.g., 7A84B875-6F75-4C7B-B137-0632B62DB0BD) **Example Usage:** ```bash GET /import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ``` (default to undefined)
const { status, data } = await apiInstance.patchImportContentValidation(
jobId
);Parameters
|Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | jobId | [string] | Job ID Parameter The unique identifier for the import or validation job. This ID was returned when the job was created via the Import or Validate API. Format: UUID v4 (e.g., 7A84B875-6F75-4C7B-B137-0632B62DB0BD) Example Usage: ```bash GET /import/content/7A84B875-6F75-4C7B-B137-0632B62DB0BD/status ``` | defaults to undefined|
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers | |-------------|-------------|------------------| |204 | No content | - | |401 | Unauthorized | - | |403 | Forbidden | - | |404 | Not Found | - | |406 | Not acceptable | - | |500 | Internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
HealthCheckApi
|Method | HTTP request | Description| |------------- | ------------- | -------------| |getHealth | GET /import/content/health | Check service health status|
getHealth
GetHealth200Response getHealth()
Service Health Check ## Overview This API provides comprehensive health status information for the Import Content service. It's designed for infrastructure monitoring, load balancer health checks, and operational monitoring to ensure service availability and performance. ## Health Check Features - Service Status: Overall service health (healthy/unhealthy) - Version Information: Current API version and build details ## Monitoring Use Cases - Load Balancers: Automatic health checks for traffic routing - Alerting Systems: Automated notifications for service issues ## Health Status Values - Healthy: Service is operating normally - Unhealthy: Service is experiencing critical issues - Maintenance: Service is under planned maintenance ## Response Components - Status: Current health state - Timestamp: When health check was performed - Version: API version information - Uptime: Service uptime since last restart ## Monitoring Best Practices - Check Frequency: Monitor every 1-2 minutes for production - Response Time: Track health check response times ## Permissions | Actor | Permission | | ------- | --------| | System |No authentication required for basic health checks.This endpoint is designed for infrastructure monitoring.Rate limiting applies to prevent abuse.|
Example
import {
HealthCheckApi,
Configuration
} from '@ngreenberg/contentmgr-sdk';
const configuration = new Configuration();
const apiInstance = new HealthCheckApi(configuration);
const { status, data } = await apiInstance.getHealth();Parameters
This endpoint does not have any parameters.
Return type
GetHealth200Response
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers | |-------------|-------------|------------------| |200 | ## Service is Healthy The Import Content service is operating normally with all components functioning as expected. Health Status Details: - Overall Status: Service is healthy and ready to process requests Response Information: - Status: Current health state (healthy, degraded, unhealthy) - Timestamp: When health check was performed - Version: Current API version | - | |503 | ## Service is Unhealthy The Import Content service is experiencing critical issues and may not be able to process requests properly. Health Status Details: - Overall Status: Service is unhealthy and may not function correctly Response Information: - Status: Current health state (unhealthy) - Timestamp: When health check was performed - Version: Current API version - Issues: List of detected health problems | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
