@noatgnu/cupcake-vanilla 1.2.14 → 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 +90 -36
- package/fesm2022/noatgnu-cupcake-vanilla.mjs +251 -13
- package/fesm2022/noatgnu-cupcake-vanilla.mjs.map +1 -1
- package/index.d.ts +56 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,63 +1,117 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Cupcake Vanilla
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
##
|
|
5
|
+
## Key Features
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
ng generate component component-name
|
|
11
|
-
```
|
|
13
|
+
## Installation
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
To install the `@noatgnu/cupcake-vanilla` library, run the following command:
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
|
|
18
|
+
npm install @noatgnu/cupcake-vanilla
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
|
|
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
|
-
|
|
23
|
+
## Services
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
ng build cupcake-vanilla
|
|
25
|
-
```
|
|
25
|
+
### MetadataTableService
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
The `MetadataTableService` is the cornerstone of the metadata management system:
|
|
28
28
|
|
|
29
|
-
|
|
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
|
-
|
|
34
|
+
**Usage:**
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
cd dist/cupcake-vanilla
|
|
36
|
-
```
|
|
36
|
+
```typescript
|
|
37
|
+
import { MetadataTableService } from '@noatgnu/cupcake-vanilla';
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
50
|
+
### AsyncTaskService
|
|
44
51
|
|
|
45
|
-
|
|
52
|
+
The `AsyncTaskService` is used to manage long-running background tasks:
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
74
|
+
### ChunkedUploadService
|
|
52
75
|
|
|
53
|
-
|
|
76
|
+
The `ChunkedUploadService` provides a reliable way to upload large files:
|
|
54
77
|
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
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
|
-
|
|
112
|
+
- `MetadataTable`
|
|
113
|
+
- `MetadataColumn`
|
|
114
|
+
- `AsyncTaskStatus`
|
|
115
|
+
- `ChunkedUploadStatus`
|
|
62
116
|
|
|
63
|
-
|
|
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.
|