@noatgnu/cupcake-vanilla 1.2.13 → 1.2.15

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,63 +1,117 @@
1
- # CupcakeVanilla
1
+ # Cupcake Vanilla
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.1.0.
3
+ The `cupcake-vanilla` library is a powerful toolkit for managing complex metadata, handling asynchronous operations, and working with SDRF (Sample and Data Relationship Format) data within the Cupcake ecosystem.
4
4
 
5
- ## Code scaffolding
5
+ ## Key Features
6
6
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
7
+ - **Advanced Metadata Management:** A comprehensive suite of services and components for creating, editing, and validating metadata tables.
8
+ - **Asynchronous Task Handling:** A robust system for managing long-running background tasks like data imports and exports.
9
+ - **Chunked File Uploads:** A reliable mechanism for uploading large files by splitting them into smaller chunks.
10
+ - **SDRF Support:** Specialized components and services for working with SDRF data.
11
+ - **Reusable UI Components:** A rich set of components for metadata editing, validation, and more.
8
12
 
9
- ```bash
10
- ng generate component component-name
11
- ```
13
+ ## Installation
12
14
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
15
+ To install the `@noatgnu/cupcake-vanilla` library, run the following command:
14
16
 
15
17
  ```bash
16
- ng generate --help
18
+ npm install @noatgnu/cupcake-vanilla
17
19
  ```
18
20
 
19
- ## Building
21
+ This library is an extension of `@noatgnu/cupcake-core` and depends on it. Make sure you have `@noatgnu/cupcake-core` installed and configured in your application.
20
22
 
21
- To build the library, run:
23
+ ## Services
22
24
 
23
- ```bash
24
- ng build cupcake-vanilla
25
- ```
25
+ ### MetadataTableService
26
26
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
27
+ The `MetadataTableService` is the cornerstone of the metadata management system:
28
28
 
29
- ### Publishing the Library
29
+ - **CRUD Operations:** Full control over metadata tables and their columns.
30
+ - **Column Manipulation:** Add, remove, reorder, and combine columns.
31
+ - **Bulk Operations:** Perform bulk updates and deletions on columns.
32
+ - **Validation:** Validate changes to sample counts and other metadata.
30
33
 
31
- Once the project is built, you can publish your library by following these steps:
34
+ **Usage:**
32
35
 
33
- 1. Navigate to the `dist` directory:
34
- ```bash
35
- cd dist/cupcake-vanilla
36
- ```
36
+ ```typescript
37
+ import { MetadataTableService } from '@noatgnu/cupcake-vanilla';
37
38
 
38
- 2. Run the `npm publish` command to publish your library to the npm registry:
39
- ```bash
40
- npm publish
41
- ```
39
+ @Component({ ... })
40
+ export class MyComponent {
41
+ constructor(private metadataTableService: MetadataTableService) {
42
+ // Get all published metadata tables
43
+ this.metadataTableService.getMetadataTables({ isPublished: true }).subscribe(response => {
44
+ // ...
45
+ });
46
+ }
47
+ }
48
+ ```
42
49
 
43
- ## Running unit tests
50
+ ### AsyncTaskService
44
51
 
45
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
52
+ The `AsyncTaskService` is used to manage long-running background tasks:
46
53
 
47
- ```bash
48
- ng test
54
+ - **Task Monitoring:** Get the status of any asynchronous task.
55
+ - **Task Control:** Cancel queued or running tasks.
56
+ - **Result Retrieval:** Download the results of completed tasks.
57
+
58
+ **Usage:**
59
+
60
+ ```typescript
61
+ import { AsyncTaskService } from '@noatgnu/cupcake-vanilla';
62
+
63
+ @Component({ ... })
64
+ export class MyComponent {
65
+ constructor(private asyncTaskService: AsyncTaskService) {
66
+ const taskId = '...'; // ID of the async task
67
+ this.asyncTaskService.getAsyncTask(taskId).subscribe(status => {
68
+ // ...
69
+ });
70
+ }
71
+ }
49
72
  ```
50
73
 
51
- ## Running end-to-end tests
74
+ ### ChunkedUploadService
52
75
 
53
- For end-to-end (e2e) testing, run:
76
+ The `ChunkedUploadService` provides a reliable way to upload large files:
54
77
 
55
- ```bash
56
- ng e2e
78
+ - **Chunking:** Automatically splits large files into smaller, manageable chunks.
79
+ - **Progress Tracking:** Provides progress updates during the upload process.
80
+ - **Resumability (server-dependent):** Can be used to build resumable upload functionality.
81
+
82
+ **Usage:**
83
+
84
+ ```typescript
85
+ import { ChunkedUploadService } from '@noatgnu/cupcake-vanilla';
86
+
87
+ @Component({ ... })
88
+ export class MyComponent {
89
+ constructor(private chunkedUploadService: ChunkedUploadService) { }
90
+
91
+ uploadFile(file: File) {
92
+ this.chunkedUploadService.uploadFileInChunks(file).subscribe(response => {
93
+ // ...
94
+ });
95
+ }
96
+ }
57
97
  ```
58
98
 
59
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
99
+ ## Components
100
+
101
+ The `cupcake-vanilla` library includes a wide array of UI components to facilitate metadata management and data validation, including:
102
+
103
+ - **Metadata Table Editor:** A full-featured editor for metadata tables.
104
+ - **Validation Modals:** Modals for displaying validation results and resolving errors.
105
+ - **SDRF Input Components:** Specialized input fields for SDRF data types (e.g., age, modifications).
106
+ - **Excel Export/Import:** Modals for exporting and importing data from Excel files.
107
+
108
+ ## Models
109
+
110
+ The library provides a comprehensive set of models for working with metadata, async tasks, and SDRF data. Key models include:
60
111
 
61
- ## Additional Resources
112
+ - `MetadataTable`
113
+ - `MetadataColumn`
114
+ - `AsyncTaskStatus`
115
+ - `ChunkedUploadStatus`
62
116
 
63
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
117
+ With its powerful services and rich component library, `cupcake-vanilla` is an essential tool for building sophisticated data management and analysis applications on the Cupcake platform.