@tiangong-lca/tidas-sdk 0.1.20 → 0.1.22
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 +174 -451
- package/dist/core/base/TidasEntity.d.ts +190 -0
- package/dist/core/base/TidasEntity.d.ts.map +1 -0
- package/dist/core/base/TidasEntity.js +433 -0
- package/dist/core/base/TidasEntity.js.map +1 -0
- package/dist/core/config/GlobalConfig.d.ts +60 -0
- package/dist/core/config/GlobalConfig.d.ts.map +1 -0
- package/dist/core/config/GlobalConfig.js +110 -0
- package/dist/core/config/GlobalConfig.js.map +1 -0
- package/dist/core/config/ValidationConfig.d.ts +70 -0
- package/dist/core/config/ValidationConfig.d.ts.map +1 -0
- package/dist/core/config/ValidationConfig.js +157 -0
- package/dist/core/config/ValidationConfig.js.map +1 -0
- package/dist/core/copilot/ai.d.ts +150 -0
- package/dist/core/copilot/ai.d.ts.map +1 -0
- package/dist/core/copilot/ai.js +581 -0
- package/dist/core/copilot/ai.js.map +1 -0
- package/dist/core/copilot/base.d.ts +83 -0
- package/dist/core/copilot/base.d.ts.map +1 -0
- package/dist/core/copilot/base.js +193 -0
- package/dist/core/copilot/base.js.map +1 -0
- package/dist/core/copilot/index.d.ts +1 -0
- package/dist/core/copilot/index.d.ts.map +1 -0
- package/dist/core/copilot/index.js +2 -0
- package/dist/core/copilot/index.js.map +1 -0
- package/dist/core/entities/TidasContact.d.ts +14 -0
- package/dist/core/entities/TidasContact.d.ts.map +1 -0
- package/dist/core/entities/TidasContact.js +124 -0
- package/dist/core/entities/TidasContact.js.map +1 -0
- package/dist/core/entities/TidasFlow.d.ts +14 -0
- package/dist/core/entities/TidasFlow.d.ts.map +1 -0
- package/dist/core/entities/TidasFlow.js +143 -0
- package/dist/core/entities/TidasFlow.js.map +1 -0
- package/dist/core/entities/TidasFlowProperty.d.ts +14 -0
- package/dist/core/entities/TidasFlowProperty.d.ts.map +1 -0
- package/dist/core/entities/TidasFlowProperty.js +156 -0
- package/dist/core/entities/TidasFlowProperty.js.map +1 -0
- package/dist/core/entities/TidasLCIAMethod.d.ts +14 -0
- package/dist/core/entities/TidasLCIAMethod.d.ts.map +1 -0
- package/dist/core/entities/TidasLCIAMethod.js +177 -0
- package/dist/core/entities/TidasLCIAMethod.js.map +1 -0
- package/dist/core/entities/TidasLifeCycleModel.d.ts +14 -0
- package/dist/core/entities/TidasLifeCycleModel.d.ts.map +1 -0
- package/dist/core/entities/TidasLifeCycleModel.js +169 -0
- package/dist/core/entities/TidasLifeCycleModel.js.map +1 -0
- package/dist/core/entities/TidasProcess.d.ts +14 -0
- package/dist/core/entities/TidasProcess.d.ts.map +1 -0
- package/dist/core/entities/TidasProcess.js +191 -0
- package/dist/core/entities/TidasProcess.js.map +1 -0
- package/dist/core/entities/TidasSource.d.ts +14 -0
- package/dist/core/entities/TidasSource.d.ts.map +1 -0
- package/dist/core/entities/TidasSource.js +146 -0
- package/dist/core/entities/TidasSource.js.map +1 -0
- package/dist/core/entities/TidasUnitGroup.d.ts +14 -0
- package/dist/core/entities/TidasUnitGroup.d.ts.map +1 -0
- package/dist/core/entities/TidasUnitGroup.js +177 -0
- package/dist/core/entities/TidasUnitGroup.js.map +1 -0
- package/dist/core/factories/index.d.ts +46 -0
- package/dist/core/factories/index.d.ts.map +1 -0
- package/dist/core/factories/index.js +223 -0
- package/dist/core/factories/index.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +56 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/zod-factories.d.ts +71 -0
- package/dist/core/zod-factories.d.ts.map +1 -0
- package/dist/core/zod-factories.js +169 -0
- package/dist/core/zod-factories.js.map +1 -0
- package/dist/core/zod-proxy.d.ts +108 -0
- package/dist/core/zod-proxy.d.ts.map +1 -0
- package/dist/core/zod-proxy.js +382 -0
- package/dist/core/zod-proxy.js.map +1 -0
- package/dist/data/bundled-methodologies.json +1259 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/index.d.ts +48 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +112 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/tidas_contacts.schema.d.ts +124 -0
- package/dist/schemas/tidas_contacts.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_contacts.schema.js +75 -0
- package/dist/schemas/tidas_contacts.schema.js.map +1 -0
- package/dist/schemas/tidas_contacts_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_contacts_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_contacts_category.schema.js +53 -0
- package/dist/schemas/tidas_contacts_category.schema.js.map +1 -0
- package/dist/schemas/tidas_data_types.schema.d.ts +34 -0
- package/dist/schemas/tidas_data_types.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_data_types.schema.js +60 -0
- package/dist/schemas/tidas_data_types.schema.js.map +1 -0
- package/dist/schemas/tidas_flowproperties.schema.d.ts +152 -0
- package/dist/schemas/tidas_flowproperties.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_flowproperties.schema.js +88 -0
- package/dist/schemas/tidas_flowproperties.schema.js.map +1 -0
- package/dist/schemas/tidas_flowproperties_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_flowproperties_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_flowproperties_category.schema.js +28 -0
- package/dist/schemas/tidas_flowproperties_category.schema.js.map +1 -0
- package/dist/schemas/tidas_flows.schema.d.ts +215 -0
- package/dist/schemas/tidas_flows.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_flows.schema.js +165 -0
- package/dist/schemas/tidas_flows.schema.js.map +1 -0
- package/dist/schemas/tidas_flows_elementary_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_flows_elementary_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_flows_elementary_category.schema.js +309 -0
- package/dist/schemas/tidas_flows_elementary_category.schema.js.map +1 -0
- package/dist/schemas/tidas_flows_product_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_flows_product_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_flows_product_category.schema.js +28368 -0
- package/dist/schemas/tidas_flows_product_category.schema.js.map +1 -0
- package/dist/schemas/tidas_lciamethods.schema.d.ts +546 -0
- package/dist/schemas/tidas_lciamethods.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_lciamethods.schema.js +513 -0
- package/dist/schemas/tidas_lciamethods.schema.js.map +1 -0
- package/dist/schemas/tidas_lciamethods_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_lciamethods_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_lciamethods_category.schema.js +278 -0
- package/dist/schemas/tidas_lciamethods_category.schema.js.map +1 -0
- package/dist/schemas/tidas_lifecyclemodels.schema.d.ts +465 -0
- package/dist/schemas/tidas_lifecyclemodels.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_lifecyclemodels.schema.js +420 -0
- package/dist/schemas/tidas_lifecyclemodels.schema.js.map +1 -0
- package/dist/schemas/tidas_locations_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_locations_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_locations_category.schema.js +655 -0
- package/dist/schemas/tidas_locations_category.schema.js.map +1 -0
- package/dist/schemas/tidas_processes.schema.d.ts +626 -0
- package/dist/schemas/tidas_processes.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_processes.schema.js +659 -0
- package/dist/schemas/tidas_processes.schema.js.map +1 -0
- package/dist/schemas/tidas_processes_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_processes_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_processes_category.schema.js +4904 -0
- package/dist/schemas/tidas_processes_category.schema.js.map +1 -0
- package/dist/schemas/tidas_sources.schema.d.ts +113 -0
- package/dist/schemas/tidas_sources.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_sources.schema.js +73 -0
- package/dist/schemas/tidas_sources.schema.js.map +1 -0
- package/dist/schemas/tidas_sources_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_sources_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_sources_category.schema.js +43 -0
- package/dist/schemas/tidas_sources_category.schema.js.map +1 -0
- package/dist/schemas/tidas_unitgroups.schema.d.ts +140 -0
- package/dist/schemas/tidas_unitgroups.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_unitgroups.schema.js +103 -0
- package/dist/schemas/tidas_unitgroups.schema.js.map +1 -0
- package/dist/schemas/tidas_unitgroups_category.schema.d.ts +3 -0
- package/dist/schemas/tidas_unitgroups_category.schema.d.ts.map +1 -0
- package/dist/schemas/tidas_unitgroups_category.schema.js +28 -0
- package/dist/schemas/tidas_unitgroups_category.schema.js.map +1 -0
- package/dist/services/copilot-service.d.ts +147 -0
- package/dist/services/copilot-service.d.ts.map +1 -0
- package/dist/services/copilot-service.js +259 -0
- package/dist/services/copilot-service.js.map +1 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +24 -0
- package/dist/services/index.js.map +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +21 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/multi-lang-types.d.ts +23 -0
- package/dist/types/multi-lang-types.d.ts.map +1 -0
- package/dist/types/multi-lang-types.js +40 -0
- package/dist/types/multi-lang-types.js.map +1 -0
- package/dist/types/tidas_contacts.d.ts +72 -0
- package/dist/types/tidas_contacts.d.ts.map +1 -0
- package/dist/types/tidas_contacts.js +8 -0
- package/dist/types/tidas_contacts.js.map +1 -0
- package/dist/types/tidas_contacts_category.d.ts +43 -0
- package/dist/types/tidas_contacts_category.d.ts.map +1 -0
- package/dist/types/tidas_contacts_category.js +8 -0
- package/dist/types/tidas_contacts_category.js.map +1 -0
- package/dist/types/tidas_data_types.d.ts +116 -0
- package/dist/types/tidas_data_types.d.ts.map +1 -0
- package/dist/types/tidas_data_types.js +8 -0
- package/dist/types/tidas_data_types.js.map +1 -0
- package/dist/types/tidas_flowproperties.d.ts +73 -0
- package/dist/types/tidas_flowproperties.d.ts.map +1 -0
- package/dist/types/tidas_flowproperties.js +8 -0
- package/dist/types/tidas_flowproperties.js.map +1 -0
- package/dist/types/tidas_flowproperties_category.d.ts +23 -0
- package/dist/types/tidas_flowproperties_category.d.ts.map +1 -0
- package/dist/types/tidas_flowproperties_category.js +8 -0
- package/dist/types/tidas_flowproperties_category.js.map +1 -0
- package/dist/types/tidas_flows.d.ts +113 -0
- package/dist/types/tidas_flows.d.ts.map +1 -0
- package/dist/types/tidas_flows.js +8 -0
- package/dist/types/tidas_flows.js.map +1 -0
- package/dist/types/tidas_flows_elementary_category.d.ts +227 -0
- package/dist/types/tidas_flows_elementary_category.d.ts.map +1 -0
- package/dist/types/tidas_flows_elementary_category.js +8 -0
- package/dist/types/tidas_flows_elementary_category.js.map +1 -0
- package/dist/types/tidas_flows_product_category.d.ts +18351 -0
- package/dist/types/tidas_flows_product_category.d.ts.map +1 -0
- package/dist/types/tidas_flows_product_category.js +8 -0
- package/dist/types/tidas_flows_product_category.js.map +1 -0
- package/dist/types/tidas_lciamethods.d.ts +231 -0
- package/dist/types/tidas_lciamethods.d.ts.map +1 -0
- package/dist/types/tidas_lciamethods.js +8 -0
- package/dist/types/tidas_lciamethods.js.map +1 -0
- package/dist/types/tidas_lciamethods_category.d.ts +215 -0
- package/dist/types/tidas_lciamethods_category.d.ts.map +1 -0
- package/dist/types/tidas_lciamethods_category.js +8 -0
- package/dist/types/tidas_lciamethods_category.js.map +1 -0
- package/dist/types/tidas_lifecyclemodels.d.ts +259 -0
- package/dist/types/tidas_lifecyclemodels.d.ts.map +1 -0
- package/dist/types/tidas_lifecyclemodels.js +8 -0
- package/dist/types/tidas_lifecyclemodels.js.map +1 -0
- package/dist/types/tidas_locations_category.d.ts +7 -0
- package/dist/types/tidas_locations_category.d.ts.map +1 -0
- package/dist/types/tidas_locations_category.js +8 -0
- package/dist/types/tidas_locations_category.js.map +1 -0
- package/dist/types/tidas_processes.d.ts +301 -0
- package/dist/types/tidas_processes.d.ts.map +1 -0
- package/dist/types/tidas_processes.js +8 -0
- package/dist/types/tidas_processes.js.map +1 -0
- package/dist/types/tidas_processes_category.d.ts +3327 -0
- package/dist/types/tidas_processes_category.d.ts.map +1 -0
- package/dist/types/tidas_processes_category.js +8 -0
- package/dist/types/tidas_processes_category.js.map +1 -0
- package/dist/types/tidas_sources.d.ts +58 -0
- package/dist/types/tidas_sources.d.ts.map +1 -0
- package/dist/types/tidas_sources.js +8 -0
- package/dist/types/tidas_sources.js.map +1 -0
- package/dist/types/tidas_sources_category.d.ts +35 -0
- package/dist/types/tidas_sources_category.d.ts.map +1 -0
- package/dist/types/tidas_sources_category.js +8 -0
- package/dist/types/tidas_sources_category.js.map +1 -0
- package/dist/types/tidas_unitgroups.d.ts +85 -0
- package/dist/types/tidas_unitgroups.d.ts.map +1 -0
- package/dist/types/tidas_unitgroups.js +8 -0
- package/dist/types/tidas_unitgroups.js.map +1 -0
- package/dist/types/tidas_unitgroups_category.d.ts +23 -0
- package/dist/types/tidas_unitgroups_category.d.ts.map +1 -0
- package/dist/types/tidas_unitgroups_category.js +8 -0
- package/dist/types/tidas_unitgroups_category.js.map +1 -0
- package/dist/utils/diff.d.ts +47 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/diff.js +263 -0
- package/dist/utils/diff.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +31 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/object-utils.d.ts +47 -0
- package/dist/utils/object-utils.d.ts.map +1 -0
- package/dist/utils/object-utils.js +332 -0
- package/dist/utils/object-utils.js.map +1 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,530 +1,253 @@
|
|
|
1
1
|
# TIDAS TypeScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TypeScript SDK for TIDAS (TianGong Life Cycle Assessment data format) providing type-safe data manipulation, validation, and comprehensive schema support.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 🚀 Status
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Version**: 0.1.20 (Production Ready)
|
|
8
|
+
**Published**: [@tiangong-lca/tidas-sdk](https://www.npmjs.com/package/@tiangong-lca/tidas-sdk)
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## ✨ Features
|
|
11
|
+
|
|
12
|
+
- ✅ **Type-Safe Operations**: Full TypeScript support with generated types
|
|
13
|
+
- ✅ **Runtime Validation**: Zod schema validation for all TIDAS data types
|
|
14
|
+
- ✅ **Complete Schema Coverage**: Support for all 18 TIDAS data types
|
|
15
|
+
- ✅ **Property Access**: Convenient API for accessing nested properties
|
|
16
|
+
- ✅ **Object Utilities**: Factory functions and manipulation utilities
|
|
17
|
+
- ✅ **JSON Conversion**: Seamless serialization/deserialization
|
|
18
|
+
|
|
19
|
+
## 📦 Installation
|
|
10
20
|
|
|
11
21
|
```bash
|
|
12
22
|
npm install @tiangong-lca/tidas-sdk
|
|
13
23
|
```
|
|
14
24
|
|
|
25
|
+
## 🔧 Quick Start
|
|
26
|
+
|
|
15
27
|
### Basic Usage
|
|
16
28
|
|
|
17
29
|
```typescript
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
// Create a new Contact entity
|
|
21
|
-
const contact = createContact();
|
|
22
|
-
|
|
23
|
-
// Set multilingual name (recommended: use setText method)
|
|
24
|
-
contact.contactDataSet.contactInformation.dataSetInformation['common:name'].setText?.('Dr. Jane Smith', 'en');
|
|
25
|
-
contact.contactDataSet.contactInformation.dataSetInformation['common:name'].setText?.('Dr. Jane Smith', 'fr');
|
|
26
|
-
|
|
27
|
-
// You can also set the multilingual array directly
|
|
28
|
-
contact.contactDataSet.contactInformation.dataSetInformation['common:shortName'] = [
|
|
29
|
-
{ '@xml:lang': 'en', '#text': 'J. Smith' },
|
|
30
|
-
{ '@xml:lang': 'fr', '#text': 'J. Smith' },
|
|
31
|
-
];
|
|
30
|
+
import { createTidasContact, TidasContact } from '@tiangong-lca/tidas-sdk';
|
|
32
31
|
|
|
33
|
-
//
|
|
34
|
-
const
|
|
32
|
+
// Create a contact using factory function
|
|
33
|
+
const contact = createTidasContact({
|
|
34
|
+
name: "Example Organization",
|
|
35
|
+
email: "contact@example.com"
|
|
36
|
+
});
|
|
35
37
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
console.log('Valid:', validation.success);
|
|
38
|
+
// Access properties with type safety
|
|
39
|
+
console.log(contact.name); // "Example Organization"
|
|
39
40
|
|
|
40
|
-
// Convert to JSON
|
|
41
|
-
const json = contact.
|
|
42
|
-
console.log(json);
|
|
41
|
+
// Convert to JSON
|
|
42
|
+
const json = contact.toJSON();
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
The SDK provides multiple entry points for different use cases:
|
|
45
|
+
### Advanced Usage
|
|
48
46
|
|
|
49
47
|
```typescript
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
import {
|
|
49
|
+
TidasProcess,
|
|
50
|
+
createTidasProcess,
|
|
51
|
+
validateTidasData
|
|
52
|
+
} from '@tiangong-lca/tidas-sdk';
|
|
53
|
+
|
|
54
|
+
// Create and validate complex objects
|
|
55
|
+
const process = createTidasProcess({
|
|
56
|
+
name: "Manufacturing Process",
|
|
57
|
+
description: "Production of electronic components"
|
|
58
|
+
});
|
|
61
59
|
|
|
62
|
-
//
|
|
63
|
-
|
|
60
|
+
// Validate data
|
|
61
|
+
const validation = validateTidasData(process, 'Process');
|
|
62
|
+
if (!validation.success) {
|
|
63
|
+
console.error('Validation errors:', validation.errors);
|
|
64
|
+
}
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
## 🏗️
|
|
67
|
-
|
|
68
|
-
- **Type Safety**: Full TypeScript support with generated types from ILCD schemas
|
|
69
|
-
- **Runtime Validation**: Zod-based validation with configurable modes (strict/weak/ignore)
|
|
70
|
-
- **8 Entity Types**: Support for all core TIDAS entities
|
|
71
|
-
- **JSON Interoperability**: Seamless conversion between objects and JSON
|
|
72
|
-
- **Batch Operations**: Efficient processing of multiple entities
|
|
73
|
-
- **Multi-language Support**: Built-in support for multi-language text fields
|
|
74
|
-
- **Performance Optimized**: Configurable validation for performance-critical scenarios
|
|
75
|
-
- **AI-Powered Suggestions**: Improve data quality using TIDAS methodology rules
|
|
67
|
+
## 🏗️ Architecture
|
|
76
68
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
### 1. Creating Entities
|
|
80
|
-
|
|
81
|
-
The SDK supports all 8 TIDAS entity types:
|
|
69
|
+
### Module Structure
|
|
82
70
|
|
|
83
71
|
```typescript
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
72
|
+
// Core imports
|
|
73
|
+
import {
|
|
74
|
+
// Types
|
|
75
|
+
TidasContact,
|
|
76
|
+
TidasProcess,
|
|
77
|
+
TidasFlow,
|
|
78
|
+
// ... all 18 TIDAS types
|
|
79
|
+
|
|
80
|
+
// Factory functions
|
|
81
|
+
createTidasContact,
|
|
82
|
+
createTidasProcess,
|
|
83
|
+
createTidasFlow,
|
|
84
|
+
// ... all factory functions
|
|
85
|
+
|
|
86
|
+
// Utilities
|
|
87
|
+
validateTidasData,
|
|
88
|
+
convertToJSON,
|
|
89
|
+
convertFromJSON
|
|
90
|
+
} from '@tiangong-lca/tidas-sdk';
|
|
91
|
+
|
|
92
|
+
// Individual modules
|
|
93
|
+
import { TidasContact } from '@tiangong-lca/tidas-sdk/core';
|
|
94
|
+
import { TidasTypes } from '@tiangong-lca/tidas-sdk/types';
|
|
95
|
+
import { TidasSchemas } from '@tiangong-lca/tidas-sdk/schemas';
|
|
96
|
+
import { TidasUtils } from '@tiangong-lca/tidas-sdk/utils';
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Supported TIDAS Data Types
|
|
100
|
+
|
|
101
|
+
- TidasContact
|
|
102
|
+
- TidasFlow
|
|
103
|
+
- TidasProcess
|
|
104
|
+
- TidasSource
|
|
105
|
+
- TidasFlowProperty
|
|
106
|
+
- TidasUnitGroup
|
|
107
|
+
- TidasLCIAMethod
|
|
108
|
+
- TidasLifeCycleModel
|
|
109
|
+
- And 10 additional specialized types
|
|
110
|
+
|
|
111
|
+
## 🧪 Development
|
|
112
|
+
|
|
113
|
+
### Setup
|
|
104
114
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
```typescript
|
|
110
|
-
// Using setText/getText methods (recommended)
|
|
111
|
-
flow.flowDataSet.flowInformation.dataSetInformation.name.baseName.setText?.('Water', 'en');
|
|
112
|
-
flow.flowDataSet.flowInformation.dataSetInformation.name.baseName.setText?.('Wasser', 'de');
|
|
113
|
-
flow.flowDataSet.flowInformation.dataSetInformation.name.baseName.setText?.('Eau', 'fr');
|
|
114
|
-
|
|
115
|
-
// Get text in a specific language
|
|
116
|
-
const englishName = flow.flowDataSet.flowInformation.dataSetInformation.name.baseName.getText?.('en');
|
|
117
|
-
|
|
118
|
-
// Direct array assignment
|
|
119
|
-
flow.flowDataSet.flowInformation.dataSetInformation['common:generalComment'] = [
|
|
120
|
-
{ '@xml:lang': 'en', '#text': 'Pure water for industrial processes' },
|
|
121
|
-
{ '@xml:lang': 'de', '#text': 'Reines Wasser für industrielle Prozesse' },
|
|
122
|
-
{ '@xml:lang': 'fr', '#text': 'Eau pure pour les processus industriels' },
|
|
123
|
-
];
|
|
124
|
-
```
|
|
115
|
+
```bash
|
|
116
|
+
# Clone repository
|
|
117
|
+
git clone https://github.com/tiangong-lca/tidas-sdk.git
|
|
118
|
+
cd tidas-sdk/sdks/typescript
|
|
125
119
|
|
|
126
|
-
|
|
120
|
+
# Install dependencies
|
|
121
|
+
npm install
|
|
127
122
|
|
|
128
|
-
|
|
123
|
+
# Build the SDK
|
|
124
|
+
npm run build
|
|
129
125
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
createProcess,
|
|
133
|
-
setGlobalValidationMode,
|
|
134
|
-
getGlobalValidationMode
|
|
135
|
-
} from '@tiangong-lca/tidas-sdk/core';
|
|
136
|
-
|
|
137
|
-
// Strict validation (default) - Full schema validation, rejects on any error
|
|
138
|
-
const strictProcess = createProcess({}, { mode: 'strict' });
|
|
139
|
-
const result = strictProcess.validate();
|
|
140
|
-
|
|
141
|
-
// Weak validation - Non-critical issues become warnings
|
|
142
|
-
const weakProcess = createProcess({}, { mode: 'weak', includeWarnings: true });
|
|
143
|
-
const enhanced = weakProcess.validateEnhanced();
|
|
144
|
-
console.log('Warnings:', enhanced.warnings);
|
|
145
|
-
|
|
146
|
-
// Ignore validation - Skip validation for maximum performance
|
|
147
|
-
const fastProcess = createProcess({}, { mode: 'ignore' });
|
|
148
|
-
// Always passes validation - ideal for bulk operations
|
|
149
|
-
|
|
150
|
-
// Global validation configuration
|
|
151
|
-
setGlobalValidationMode('weak'); // Applies to all new entities
|
|
152
|
-
const process = createProcess(); // Uses weak validation
|
|
153
|
-
|
|
154
|
-
// Runtime configuration changes
|
|
155
|
-
process.setValidationMode('strict');
|
|
156
|
-
console.log('Current mode:', process.getValidationConfig().mode);
|
|
126
|
+
# Run tests
|
|
127
|
+
npm test
|
|
157
128
|
```
|
|
158
129
|
|
|
159
|
-
###
|
|
160
|
-
|
|
161
|
-
Create and process multiple entities efficiently:
|
|
162
|
-
|
|
163
|
-
```typescript
|
|
164
|
-
import { createFlowsBatch, createContactsBatch } from '@tiangong-lca/tidas-sdk/core';
|
|
165
|
-
|
|
166
|
-
// Create multiple entities at once
|
|
167
|
-
const flowsData = [
|
|
168
|
-
{ flowDataSet: { /* data 1 */ } },
|
|
169
|
-
{ flowDataSet: { /* data 2 */ } },
|
|
170
|
-
{ flowDataSet: { /* data 3 */ } },
|
|
171
|
-
];
|
|
172
|
-
|
|
173
|
-
const flows = createFlowsBatch(flowsData, { mode: 'weak' });
|
|
174
|
-
|
|
175
|
-
// Process in batch
|
|
176
|
-
flows.forEach((flow, index) => {
|
|
177
|
-
flow.flowDataSet.flowInformation.dataSetInformation.name.baseName.setText?.(
|
|
178
|
-
`Flow ${index + 1}`,
|
|
179
|
-
'en'
|
|
180
|
-
);
|
|
181
|
-
});
|
|
130
|
+
### Development Commands
|
|
182
131
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
console.log(`${successCount}/${flows.length} flows are valid`);
|
|
187
|
-
```
|
|
132
|
+
```bash
|
|
133
|
+
# Development mode (watch)
|
|
134
|
+
npm run dev
|
|
188
135
|
|
|
189
|
-
|
|
136
|
+
# Type checking
|
|
137
|
+
npm run typecheck
|
|
190
138
|
|
|
191
|
-
|
|
139
|
+
# Linting
|
|
140
|
+
npm run lint
|
|
141
|
+
npm run lint:fix
|
|
192
142
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const jsonObject = process.toJSON();
|
|
143
|
+
# Formatting
|
|
144
|
+
npm run format
|
|
145
|
+
npm run format:check
|
|
197
146
|
|
|
198
|
-
|
|
199
|
-
|
|
147
|
+
# Testing
|
|
148
|
+
npm test
|
|
149
|
+
npm run test:watch
|
|
150
|
+
npm run test:coverage
|
|
200
151
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
// Verify imported data
|
|
206
|
-
const validation = importedProcess.validate();
|
|
207
|
-
if (validation.success) {
|
|
208
|
-
console.log('Successfully imported and validated');
|
|
209
|
-
}
|
|
152
|
+
# Build
|
|
153
|
+
npm run clean
|
|
154
|
+
npm run build
|
|
210
155
|
```
|
|
211
156
|
|
|
212
|
-
###
|
|
157
|
+
### Testing
|
|
213
158
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
// Clone an existing entity
|
|
218
|
-
const originalContact = createContact();
|
|
219
|
-
originalContact.contactDataSet.contactInformation.dataSetInformation['common:name'].setText?.('Dr. Alice Johnson', 'en');
|
|
220
|
-
|
|
221
|
-
const clonedContact = originalContact.clone();
|
|
159
|
+
```bash
|
|
160
|
+
# Run all tests
|
|
161
|
+
npm test
|
|
222
162
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
{ '@xml:lang': 'en', '#text': 'Dr. Alice Johnson (Copy)' }
|
|
226
|
-
];
|
|
163
|
+
# Watch mode
|
|
164
|
+
npm run test:watch
|
|
227
165
|
|
|
228
|
-
|
|
229
|
-
|
|
166
|
+
# Coverage report
|
|
167
|
+
npm run test:coverage
|
|
230
168
|
```
|
|
231
169
|
|
|
232
|
-
|
|
170
|
+
## 📚 Examples
|
|
233
171
|
|
|
234
|
-
|
|
172
|
+
See the [examples](./examples/) directory for comprehensive usage examples:
|
|
235
173
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
massUnitGroup.unitGroupDataSet.unitGroupInformation.dataSetInformation['common:name'] = [
|
|
240
|
-
{ '@xml:lang': 'en', '#text': 'Mass units' }
|
|
241
|
-
];
|
|
242
|
-
|
|
243
|
-
const massFlowProperty = createFlowProperty();
|
|
244
|
-
massFlowProperty.flowPropertyDataSet.flowPropertiesInformation.dataSetInformation['common:name'] = [
|
|
245
|
-
{ '@xml:lang': 'en', '#text': 'Mass' }
|
|
246
|
-
];
|
|
247
|
-
|
|
248
|
-
// Reference unit group in flow property
|
|
249
|
-
const unitGroupUUID = massUnitGroup.unitGroupDataSet.unitGroupInformation.dataSetInformation['common:UUID'];
|
|
250
|
-
massFlowProperty.flowPropertyDataSet.flowPropertiesInformation.quantitativeReference.referenceToReferenceUnitGroup = {
|
|
251
|
-
'@type': 'unit group data set',
|
|
252
|
-
'@refObjectId': unitGroupUUID,
|
|
253
|
-
'@version': '1.0.0',
|
|
254
|
-
'@uri': '',
|
|
255
|
-
'common:shortDescription': [{ '@xml:lang': 'en', '#text': 'Mass units' }],
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
// Create a flow using this flow property
|
|
259
|
-
const co2Flow = createFlow();
|
|
260
|
-
const flowPropertyUUID = massFlowProperty.flowPropertyDataSet.flowPropertiesInformation.dataSetInformation['common:UUID'];
|
|
261
|
-
co2Flow.flowDataSet.flowProperties.flowProperty = {
|
|
262
|
-
'@dataSetInternalID': '0',
|
|
263
|
-
referenceToFlowPropertyDataSet: {
|
|
264
|
-
'@type': 'flow property data set',
|
|
265
|
-
'@refObjectId': flowPropertyUUID,
|
|
266
|
-
'@version': '1.0.0',
|
|
267
|
-
'@uri': '',
|
|
268
|
-
'common:shortDescription': [{ '@xml:lang': 'en', '#text': 'Mass' }],
|
|
269
|
-
},
|
|
270
|
-
meanValue: '1.0',
|
|
271
|
-
};
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### 8. AI-Powered Data Improvement
|
|
174
|
+
- [01-basic-usage](./examples/01-basic-usage/) - Basic object creation and manipulation
|
|
175
|
+
- [02-object-oriented-usage](./examples/02-object-oriented-usage/) - Advanced patterns
|
|
176
|
+
- [03-complete-tidas-entities](./examples/03-complete-tidas-entities/) - All data types
|
|
275
177
|
|
|
276
|
-
|
|
178
|
+
## 🔗 API Reference
|
|
277
179
|
|
|
278
|
-
|
|
279
|
-
import { createProcess, suggestData } from '@tiangong-lca/tidas-sdk';
|
|
180
|
+
### Factory Functions
|
|
280
181
|
|
|
281
|
-
|
|
282
|
-
process.env.OPENAI_API_KEY = 'your-api-key';
|
|
182
|
+
All TIDAS types have corresponding factory functions:
|
|
283
183
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
outputDiffSummary: true, // Get text diff summary
|
|
288
|
-
outputDiffHTML: true, // Get HTML diff viewer
|
|
289
|
-
});
|
|
184
|
+
```typescript
|
|
185
|
+
// General pattern
|
|
186
|
+
createTidas{Type}(data: Partial<Tidas{Type}>): Tidas{Type}
|
|
290
187
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
// Method 2: Using the suggestData service function
|
|
296
|
-
const improvedResult = await suggestData(
|
|
297
|
-
{ processDataSet: { /* data */ } },
|
|
298
|
-
'process',
|
|
299
|
-
{
|
|
300
|
-
skipPaths: ['administrativeInformation'], // Skip certain paths
|
|
301
|
-
maxRetries: 2, // Retry on validation failures
|
|
302
|
-
outputDiffSummary: true
|
|
303
|
-
}
|
|
304
|
-
);
|
|
305
|
-
|
|
306
|
-
// Method 3: Batch suggestions
|
|
307
|
-
import { batchSuggest } from '@tiangong-lca/tidas-sdk';
|
|
308
|
-
|
|
309
|
-
const results = await batchSuggest([
|
|
310
|
-
{ data: processData1, type: 'process' },
|
|
311
|
-
{ data: flowData, type: 'flow' },
|
|
312
|
-
{ data: contactData, type: 'contact' }
|
|
313
|
-
]);
|
|
188
|
+
// Examples
|
|
189
|
+
createTidasContact(data)
|
|
190
|
+
createTidasProcess(data)
|
|
191
|
+
createTidasFlow(data)
|
|
314
192
|
```
|
|
315
193
|
|
|
316
|
-
###
|
|
317
|
-
|
|
318
|
-
Handle validation errors gracefully:
|
|
194
|
+
### Validation
|
|
319
195
|
|
|
320
196
|
```typescript
|
|
321
|
-
//
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
console.log(`- ${issue.path.join('.')}: ${issue.message}`);
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// Enhanced validation with warnings
|
|
333
|
-
const weakProcess = createProcess({}, { mode: 'weak', includeWarnings: true });
|
|
334
|
-
const enhanced = weakProcess.validateEnhanced();
|
|
335
|
-
|
|
336
|
-
if (enhanced.warnings) {
|
|
337
|
-
console.log('Validation warnings:');
|
|
338
|
-
enhanced.warnings.forEach(warning => {
|
|
339
|
-
console.log(`[${warning.severity}] ${warning.path.join('.')}: ${warning.message}`);
|
|
340
|
-
});
|
|
197
|
+
// Validate any TIDAS data
|
|
198
|
+
const result = validateTidasData(data, 'Contact');
|
|
199
|
+
if (result.success) {
|
|
200
|
+
// Data is valid
|
|
201
|
+
} else {
|
|
202
|
+
// Handle validation errors
|
|
203
|
+
console.error(result.errors);
|
|
341
204
|
}
|
|
342
205
|
```
|
|
343
206
|
|
|
344
|
-
###
|
|
345
|
-
|
|
346
|
-
For performance-critical scenarios:
|
|
207
|
+
### Property Access
|
|
347
208
|
|
|
348
209
|
```typescript
|
|
349
|
-
//
|
|
350
|
-
const
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
{ mode: 'ignore' } // Skip validation for maximum speed
|
|
354
|
-
);
|
|
355
|
-
const endTime = performance.now();
|
|
356
|
-
console.log(`Created 1000 flows in ${endTime - startTime}ms`);
|
|
357
|
-
|
|
358
|
-
// Configure properties without validation overhead
|
|
359
|
-
manyFlows.forEach((flow, index) => {
|
|
360
|
-
flow.flowDataSet.flowInformation.dataSetInformation.name.baseName.setText?.(
|
|
361
|
-
`Flow ${index}`,
|
|
362
|
-
'en'
|
|
363
|
-
);
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
// Validate only when needed
|
|
367
|
-
const validationResults = manyFlows.map(f => f.validate());
|
|
210
|
+
// Access nested properties with type safety
|
|
211
|
+
const contact = createTidasContact(data);
|
|
212
|
+
const email = contact.email; // Type: string | undefined
|
|
213
|
+
const address = contact.address?.street; // Type: string | undefined
|
|
368
214
|
```
|
|
369
215
|
|
|
370
|
-
##
|
|
216
|
+
## 📖 Documentation
|
|
371
217
|
|
|
372
|
-
|
|
218
|
+
- **Development Guidelines**: [../../CLAUDE.md](../../CLAUDE.md)
|
|
219
|
+
- **Project Progress**: [../../docs/development-progress.md](../../docs/development-progress.md)
|
|
220
|
+
- **Requirements**: [../../docs/requirement-design.md](../../docs/requirement-design.md)
|
|
221
|
+
- **Release Notes**: [RELEASE.md](./RELEASE.md)
|
|
373
222
|
|
|
374
|
-
|
|
375
|
-
- `02-advanced-features/` - Advanced patterns including batch operations and relationships
|
|
376
|
-
- `03-validation-modes/` - Comprehensive validation configuration examples
|
|
223
|
+
## 🚀 Release
|
|
377
224
|
|
|
378
|
-
|
|
225
|
+
Automated release process:
|
|
379
226
|
|
|
380
227
|
```bash
|
|
381
|
-
|
|
382
|
-
npm
|
|
383
|
-
npm run run-basic # Basic entity usage
|
|
384
|
-
npm run run-advanced # Advanced usage patterns
|
|
385
|
-
npm run run-validation # Validation configuration demo
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
See [examples/README.md](examples/README.md) for detailed information.
|
|
389
|
-
|
|
390
|
-
## 🔧 Development
|
|
228
|
+
# Patch release (x.y.Z)
|
|
229
|
+
npm run release:patch
|
|
391
230
|
|
|
392
|
-
|
|
231
|
+
# Minor release (x.Y.z)
|
|
232
|
+
npm run release:minor
|
|
393
233
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
npm run build # Compile TypeScript
|
|
398
|
-
npm run dev # Watch mode
|
|
399
|
-
npm run generate-types # Generate types from schemas
|
|
400
|
-
npm run generate-schemas # Generate Zod schemas
|
|
401
|
-
npm run test # Run tests
|
|
402
|
-
npm run lint # Lint code
|
|
403
|
-
npm run format # Format code
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
### Project Structure
|
|
407
|
-
|
|
408
|
-
```
|
|
409
|
-
tidas-typescript/
|
|
410
|
-
├── src/
|
|
411
|
-
│ ├── types/ # Generated TypeScript types (18 files)
|
|
412
|
-
│ ├── schemas/ # Generated Zod schemas (18 files)
|
|
413
|
-
│ ├── core/ # Core functionality
|
|
414
|
-
│ │ ├── base/ # TidasEntity base class
|
|
415
|
-
│ │ ├── entities/ # 8 entity classes
|
|
416
|
-
│ │ ├── factories/ # Factory functions
|
|
417
|
-
│ │ └── config/ # Validation configuration
|
|
418
|
-
│ ├── utils/ # Utility functions
|
|
419
|
-
│ └── services/ # AI suggestion service
|
|
420
|
-
├── examples/ # Usage examples
|
|
421
|
-
├── scripts/ # Code generation scripts
|
|
422
|
-
└── dist/ # Compiled output
|
|
234
|
+
# Major release (X.y.z)
|
|
235
|
+
npm run release:major
|
|
423
236
|
```
|
|
424
237
|
|
|
425
238
|
## 🤝 Contributing
|
|
426
239
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
240
|
+
We welcome contributions! Please:
|
|
241
|
+
1. Follow the development guidelines
|
|
242
|
+
2. Add tests for new functionality
|
|
243
|
+
3. Ensure all tests pass and code is properly formatted
|
|
244
|
+
4. Update documentation as needed
|
|
432
245
|
|
|
433
246
|
## 📄 License
|
|
434
247
|
|
|
435
|
-
MIT License - see [LICENSE](LICENSE) file for details.
|
|
436
|
-
|
|
437
|
-
## 🏷️ Version
|
|
438
|
-
|
|
439
|
-
Current version: 0.1.16
|
|
248
|
+
MIT License - see [LICENSE](../LICENSE) file for details.
|
|
440
249
|
|
|
441
|
-
## 🔗
|
|
250
|
+
## 🔗 Related Packages
|
|
442
251
|
|
|
443
|
-
- [
|
|
444
|
-
- [
|
|
445
|
-
|
|
446
|
-
## 📖 API Reference
|
|
447
|
-
|
|
448
|
-
### Core Entities
|
|
449
|
-
|
|
450
|
-
All entity types follow the same pattern:
|
|
451
|
-
|
|
452
|
-
- `TidasContact` - Contact/organization information
|
|
453
|
-
- `TidasFlow` - Material or energy flows
|
|
454
|
-
- `TidasProcess` - Process datasets
|
|
455
|
-
- `TidasSource` - Literature sources
|
|
456
|
-
- `TidasFlowProperty` - Flow properties (e.g., mass, energy)
|
|
457
|
-
- `TidasUnitGroup` - Unit groups for measurements
|
|
458
|
-
- `TidasLCIAMethod` - LCIA methodology data
|
|
459
|
-
- `TidasLifeCycleModel` - Life cycle models
|
|
460
|
-
|
|
461
|
-
### Factory Functions
|
|
462
|
-
|
|
463
|
-
- `createContact(data?, config?)` - Create Contact entity
|
|
464
|
-
- `createFlow(data?, config?)` - Create Flow entity
|
|
465
|
-
- `createProcess(data?, config?)` - Create Process entity
|
|
466
|
-
- `createSource(data?, config?)` - Create Source entity
|
|
467
|
-
- `createFlowProperty(data?, config?)` - Create FlowProperty entity
|
|
468
|
-
- `createUnitGroup(data?, config?)` - Create UnitGroup entity
|
|
469
|
-
- `createLCIAMethod(data?, config?)` - Create LCIAMethod entity
|
|
470
|
-
- `createLifeCycleModel(data?, config?)` - Create LifeCycleModel entity
|
|
471
|
-
|
|
472
|
-
Batch factory functions:
|
|
473
|
-
|
|
474
|
-
- `createContactsBatch(dataArray, config?)` - Create multiple Contacts
|
|
475
|
-
- `createFlowsBatch(dataArray, config?)` - Create multiple Flows
|
|
476
|
-
- `createProcessesBatch(dataArray, config?)` - Create multiple Processes
|
|
477
|
-
- (Similar batch functions for all entity types)
|
|
478
|
-
|
|
479
|
-
### Entity Methods
|
|
480
|
-
|
|
481
|
-
All entities inherit these methods from `TidasEntity`:
|
|
482
|
-
|
|
483
|
-
- `validate()` - Validate entity data (legacy format)
|
|
484
|
-
- `validateEnhanced()` - Enhanced validation with warnings
|
|
485
|
-
- `toJSON()` - Convert to plain JavaScript object
|
|
486
|
-
- `toJSONString(indent?)` - Convert to JSON string
|
|
487
|
-
- `clone()` - Create a deep copy of the entity
|
|
488
|
-
- `getValue(path)` - Get nested value using dot notation
|
|
489
|
-
- `getValidationConfig()` - Get current validation configuration
|
|
490
|
-
- `setValidationMode(mode)` - Set validation mode
|
|
491
|
-
- `setValidationConfig(config)` - Set validation configuration
|
|
492
|
-
- `suggest(options?)` - AI-powered data improvement
|
|
493
|
-
|
|
494
|
-
### Validation Configuration
|
|
495
|
-
|
|
496
|
-
```typescript
|
|
497
|
-
interface ValidationConfig {
|
|
498
|
-
mode: 'strict' | 'weak' | 'ignore';
|
|
499
|
-
includeWarnings?: boolean;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
// Global configuration functions
|
|
503
|
-
setGlobalValidationMode(mode: 'strict' | 'weak' | 'ignore'): void
|
|
504
|
-
getGlobalValidationMode(): 'strict' | 'weak' | 'ignore'
|
|
505
|
-
setGlobalValidationConfig(config: Partial<ValidationConfig>): void
|
|
506
|
-
resetGlobalConfig(): void
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
### AI Suggestion Service
|
|
510
|
-
|
|
511
|
-
```typescript
|
|
512
|
-
// Suggest improvements for data
|
|
513
|
-
suggestData(
|
|
514
|
-
data: any,
|
|
515
|
-
dataType: DataType,
|
|
516
|
-
options?: SuggestOptions
|
|
517
|
-
): Promise<SuggestResult>
|
|
518
|
-
|
|
519
|
-
// Batch suggestions
|
|
520
|
-
batchSuggest(
|
|
521
|
-
items: Array<{ data: any; type: DataType }>,
|
|
522
|
-
options?: SuggestOptions
|
|
523
|
-
): Promise<SuggestResult[]>
|
|
524
|
-
|
|
525
|
-
// Validate API key
|
|
526
|
-
validateApiKey(): boolean
|
|
527
|
-
|
|
528
|
-
// Get available data types
|
|
529
|
-
getAvailableDataTypes(): string[]
|
|
530
|
-
```
|
|
252
|
+
- [tidas-tools](https://pypi.org/project/tidas-tools/): Python utilities for TIDAS data
|
|
253
|
+
- [tidas-python-sdk](../python/): Python SDK (in development)
|