@3sixty/data-processing-models 0.0.0-stage → 0.20.0-next.0
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 +201 -0
- package/README.md +24 -2
- package/dist/es/factories/dataConverterConnectorFactory.js +9 -0
- package/dist/es/factories/dataConverterConnectorFactory.js.map +1 -0
- package/dist/es/factories/dataExtractorConnectorFactory.js +9 -0
- package/dist/es/factories/dataExtractorConnectorFactory.js.map +1 -0
- package/dist/es/index.js +20 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IDataConverterConnector.js +2 -0
- package/dist/es/models/IDataConverterConnector.js.map +1 -0
- package/dist/es/models/IDataExtractorConnector.js +2 -0
- package/dist/es/models/IDataExtractorConnector.js.map +1 -0
- package/dist/es/models/IDataProcessingComponent.js +2 -0
- package/dist/es/models/IDataProcessingComponent.js.map +1 -0
- package/dist/es/models/IExtractRule.js +2 -0
- package/dist/es/models/IExtractRule.js.map +1 -0
- package/dist/es/models/IRule.js +2 -0
- package/dist/es/models/IRule.js.map +1 -0
- package/dist/es/models/IRuleGroup.js +2 -0
- package/dist/es/models/IRuleGroup.js.map +1 -0
- package/dist/es/models/IStructuredData.js +4 -0
- package/dist/es/models/IStructuredData.js.map +1 -0
- package/dist/es/models/api/IDataProcessingConvertRequest.js +4 -0
- package/dist/es/models/api/IDataProcessingConvertRequest.js.map +1 -0
- package/dist/es/models/api/IDataProcessingConvertResponse.js +4 -0
- package/dist/es/models/api/IDataProcessingConvertResponse.js.map +1 -0
- package/dist/es/models/api/IDataProcessingExtractRequest.js +4 -0
- package/dist/es/models/api/IDataProcessingExtractRequest.js.map +1 -0
- package/dist/es/models/api/IDataProcessingExtractResponse.js +4 -0
- package/dist/es/models/api/IDataProcessingExtractResponse.js.map +1 -0
- package/dist/es/models/api/IDataProcessingRuleGroupGetRequest.js +4 -0
- package/dist/es/models/api/IDataProcessingRuleGroupGetRequest.js.map +1 -0
- package/dist/es/models/api/IDataProcessingRuleGroupGetResponse.js +2 -0
- package/dist/es/models/api/IDataProcessingRuleGroupGetResponse.js.map +1 -0
- package/dist/es/models/api/IDataProcessingRuleGroupListRequest.js +4 -0
- package/dist/es/models/api/IDataProcessingRuleGroupListRequest.js.map +1 -0
- package/dist/es/models/api/IDataProcessingRuleGroupListResponse.js +2 -0
- package/dist/es/models/api/IDataProcessingRuleGroupListResponse.js.map +1 -0
- package/dist/es/models/api/IDataProcessingRuleGroupRemoveRequest.js +4 -0
- package/dist/es/models/api/IDataProcessingRuleGroupRemoveRequest.js.map +1 -0
- package/dist/es/models/api/IDataProcessingRuleGroupSetRequest.js +2 -0
- package/dist/es/models/api/IDataProcessingRuleGroupSetRequest.js.map +1 -0
- package/dist/types/factories/dataConverterConnectorFactory.d.ts +6 -0
- package/dist/types/factories/dataExtractorConnectorFactory.d.ts +6 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/models/IDataConverterConnector.d.ts +17 -0
- package/dist/types/models/IDataExtractorConnector.d.ts +14 -0
- package/dist/types/models/IDataProcessingComponent.d.ts +58 -0
- package/dist/types/models/IExtractRule.d.ts +23 -0
- package/dist/types/models/IRule.d.ts +23 -0
- package/dist/types/models/IRuleGroup.d.ts +18 -0
- package/dist/types/models/IStructuredData.d.ts +13 -0
- package/dist/types/models/api/IDataProcessingConvertRequest.d.ts +18 -0
- package/dist/types/models/api/IDataProcessingConvertResponse.d.ts +9 -0
- package/dist/types/models/api/IDataProcessingExtractRequest.d.ts +26 -0
- package/dist/types/models/api/IDataProcessingExtractResponse.d.ts +9 -0
- package/dist/types/models/api/IDataProcessingRuleGroupGetRequest.d.ts +14 -0
- package/dist/types/models/api/IDataProcessingRuleGroupGetResponse.d.ts +10 -0
- package/dist/types/models/api/IDataProcessingRuleGroupListRequest.d.ts +18 -0
- package/dist/types/models/api/IDataProcessingRuleGroupListResponse.d.ts +19 -0
- package/dist/types/models/api/IDataProcessingRuleGroupRemoveRequest.d.ts +14 -0
- package/dist/types/models/api/IDataProcessingRuleGroupSetRequest.d.ts +28 -0
- package/docs/changelog.md +0 -0
- package/docs/examples.md +35 -0
- package/docs/reference/index.md +24 -0
- package/docs/reference/interfaces/IDataConverterConnector.md +43 -0
- package/docs/reference/interfaces/IDataExtractorConnector.md +35 -0
- package/docs/reference/interfaces/IDataProcessingComponent.md +170 -0
- package/docs/reference/interfaces/IDataProcessingConvertRequest.md +23 -0
- package/docs/reference/interfaces/IDataProcessingConvertResponse.md +11 -0
- package/docs/reference/interfaces/IDataProcessingExtractRequest.md +35 -0
- package/docs/reference/interfaces/IDataProcessingExtractResponse.md +11 -0
- package/docs/reference/interfaces/IDataProcessingRuleGroupGetRequest.md +17 -0
- package/docs/reference/interfaces/IDataProcessingRuleGroupGetResponse.md +11 -0
- package/docs/reference/interfaces/IDataProcessingRuleGroupListRequest.md +23 -0
- package/docs/reference/interfaces/IDataProcessingRuleGroupListResponse.md +23 -0
- package/docs/reference/interfaces/IDataProcessingRuleGroupRemoveRequest.md +17 -0
- package/docs/reference/interfaces/IDataProcessingRuleGroupSetRequest.md +37 -0
- package/docs/reference/interfaces/IRule.md +39 -0
- package/docs/reference/interfaces/IRuleGroup.md +27 -0
- package/docs/reference/variables/DataConverterConnectorFactory.md +5 -0
- package/docs/reference/variables/DataExtractorConnectorFactory.md +5 -0
- package/locales/en.json +1 -0
- package/package.json +53 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2024 IOTA Stiftung.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 3Sixty Data Processing Models
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared data models and schema definitions for processing pipelines.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install @3sixty/data-processing-models
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
Usage of the APIs is shown in the examples [docs/examples.md](docs/examples.md)
|
|
14
|
+
|
|
15
|
+
## Reference
|
|
16
|
+
|
|
17
|
+
Detailed reference documentation for the API can be found in [docs/reference/index.md](docs/reference/index.md)
|
|
18
|
+
|
|
19
|
+
## Changelog
|
|
20
|
+
|
|
21
|
+
The changes between each version can be found in [docs/changelog.md](docs/changelog.md)
|
|
22
|
+
|
|
23
|
+
## Origin
|
|
24
|
+
|
|
25
|
+
This package is derived from the original [iotaledger/twin-data-processing](https://github.com/iotaledger/twin-data-processing/tree/next/packages/data-processing-models) repository.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { Factory } from "@3sixty/core";
|
|
4
|
+
/**
|
|
5
|
+
* Factory for creating data converter connectors.
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
|
+
export const DataConverterConnectorFactory = Factory.createFactory("data-converter", true);
|
|
9
|
+
//# sourceMappingURL=dataConverterConnectorFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataConverterConnectorFactory.js","sourceRoot":"","sources":["../../../src/factories/dataConverterConnectorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAO,CAAC,aAAa,CACjE,gBAAgB,EAChB,IAAI,CACJ,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IDataConverterConnector } from \"../models/IDataConverterConnector.js\";\n\n/**\n * Factory for creating data converter connectors.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DataConverterConnectorFactory = Factory.createFactory<IDataConverterConnector>(\n\t\"data-converter\",\n\ttrue\n);\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { Factory } from "@3sixty/core";
|
|
4
|
+
/**
|
|
5
|
+
* Factory for creating data extractor connectors.
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
|
+
export const DataExtractorConnectorFactory = Factory.createFactory("data-extractor");
|
|
9
|
+
//# sourceMappingURL=dataExtractorConnectorFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataExtractorConnectorFactory.js","sourceRoot":"","sources":["../../../src/factories/dataExtractorConnectorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,6BAA6B,GACzC,OAAO,CAAC,aAAa,CAA0B,gBAAgB,CAAC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IDataExtractorConnector } from \"../models/IDataExtractorConnector.js\";\n\n/**\n * Factory for creating data extractor connectors.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DataExtractorConnectorFactory =\n\tFactory.createFactory<IDataExtractorConnector>(\"data-extractor\");\n"]}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
export * from "./factories/dataConverterConnectorFactory.js";
|
|
4
|
+
export * from "./factories/dataExtractorConnectorFactory.js";
|
|
5
|
+
export * from "./models/api/IDataProcessingConvertRequest.js";
|
|
6
|
+
export * from "./models/api/IDataProcessingConvertResponse.js";
|
|
7
|
+
export * from "./models/api/IDataProcessingExtractRequest.js";
|
|
8
|
+
export * from "./models/api/IDataProcessingExtractResponse.js";
|
|
9
|
+
export * from "./models/api/IDataProcessingRuleGroupGetRequest.js";
|
|
10
|
+
export * from "./models/api/IDataProcessingRuleGroupGetResponse.js";
|
|
11
|
+
export * from "./models/api/IDataProcessingRuleGroupListRequest.js";
|
|
12
|
+
export * from "./models/api/IDataProcessingRuleGroupListResponse.js";
|
|
13
|
+
export * from "./models/api/IDataProcessingRuleGroupRemoveRequest.js";
|
|
14
|
+
export * from "./models/api/IDataProcessingRuleGroupSetRequest.js";
|
|
15
|
+
export * from "./models/IDataConverterConnector.js";
|
|
16
|
+
export * from "./models/IDataProcessingComponent.js";
|
|
17
|
+
export * from "./models/IDataExtractorConnector.js";
|
|
18
|
+
export * from "./models/IRule.js";
|
|
19
|
+
export * from "./models/IRuleGroup.js";
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/dataConverterConnectorFactory.js\";\nexport * from \"./factories/dataExtractorConnectorFactory.js\";\nexport * from \"./models/api/IDataProcessingConvertRequest.js\";\nexport * from \"./models/api/IDataProcessingConvertResponse.js\";\nexport * from \"./models/api/IDataProcessingExtractRequest.js\";\nexport * from \"./models/api/IDataProcessingExtractResponse.js\";\nexport * from \"./models/api/IDataProcessingRuleGroupGetRequest.js\";\nexport * from \"./models/api/IDataProcessingRuleGroupGetResponse.js\";\nexport * from \"./models/api/IDataProcessingRuleGroupListRequest.js\";\nexport * from \"./models/api/IDataProcessingRuleGroupListResponse.js\";\nexport * from \"./models/api/IDataProcessingRuleGroupRemoveRequest.js\";\nexport * from \"./models/api/IDataProcessingRuleGroupSetRequest.js\";\nexport * from \"./models/IDataConverterConnector.js\";\nexport * from \"./models/IDataProcessingComponent.js\";\nexport * from \"./models/IDataExtractorConnector.js\";\nexport * from \"./models/IRule.js\";\nexport * from \"./models/IRuleGroup.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataConverterConnector.js","sourceRoot":"","sources":["../../../src/models/IDataConverterConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\n\n/**\n * Interface describing a connector for converting data.\n */\nexport interface IDataConverterConnector extends IComponent {\n\t/**\n\t * Returns the MIME types that this connector can convert.\n\t * @returns The supported MIME type strings.\n\t */\n\tmimeTypes(): string[];\n\n\t/**\n\t * Converts the data to a structured object.\n\t * @param data The binary data to convert.\n\t * @returns The parsed structured object.\n\t */\n\tconvert(data: Uint8Array): Promise<unknown>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataExtractorConnector.js","sourceRoot":"","sources":["../../../src/models/IDataExtractorConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { IRule } from \"./IRule.js\";\n\n/**\n * Interface describing a connector for extracting data.\n */\nexport interface IDataExtractorConnector extends IComponent {\n\t/**\n\t * Extracts data from the provided input.\n\t * @param data The object to extract from.\n\t * @param rules The rules to use to extract the data.\n\t * @returns The extracted data.\n\t */\n\textract(data: unknown, rules: IRule[]): Promise<unknown>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingComponent.js","sourceRoot":"","sources":["../../../src/models/IDataProcessingComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { IRuleGroup } from \"./IRuleGroup.js\";\n\n/**\n * Interface describing a component for processing data.\n */\nexport interface IDataProcessingComponent extends IComponent {\n\t/**\n\t * Set an extraction rule group.\n\t * @param ruleGroup The rule group to store.\n\t * @returns A promise that resolves when the rule group has been stored.\n\t */\n\truleGroupSet(ruleGroup: IRuleGroup): Promise<void>;\n\n\t/**\n\t * Get a rule group for extraction.\n\t * @param ruleGroupId The id of the rule group to get.\n\t * @returns The rule group.\n\t */\n\truleGroupGet(ruleGroupId: string): Promise<IRuleGroup>;\n\n\t/**\n\t * Remove a rule group.\n\t * @param ruleGroupId The id of the rule group to remove.\n\t * @returns A promise that resolves when the rule group has been removed.\n\t */\n\truleGroupRemove(ruleGroupId: string): Promise<void>;\n\n\t/**\n\t * Extracts data from the provided input.\n\t * @param ruleGroupId The id of the rule group to use to extract data.\n\t * @param data The data to extract from.\n\t * @param overrideExtractorType An optional override for the extractor type.\n\t * @param overrideMimeType An optional override for the mime type for conversion, will auto detect if not provided.\n\t * @returns The extracted data.\n\t */\n\textract(\n\t\truleGroupId: string,\n\t\tdata: Uint8Array,\n\t\toverrideExtractorType?: string,\n\t\toverrideMimeType?: string\n\t): Promise<unknown>;\n\n\t/**\n\t * Converts data from the provided input to a structured JSON document.\n\t * @param data The data to convert.\n\t * @param overrideMimeType An optional override for the mime type, will auto detect if empty.\n\t * @returns The converted data.\n\t */\n\tconvert(data: Uint8Array, overrideMimeType?: string): Promise<unknown>;\n\n\t/**\n\t * Query the rule group entries.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t */\n\tquery(\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The entities, which can be partial if a limited keys list was provided.\n\t\t */\n\t\tentities: IRuleGroup[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IExtractRule.js","sourceRoot":"","sources":["../../../src/models/IExtractRule.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { CoerceType } from \"@3sixty/core\";\n\n/**\n * Definition for the data to extract.\n */\nexport interface IExtractRule {\n\t/**\n\t * The JSONPath expression identifying the data to extract from the document.\n\t * @see https://www.rfc-editor.org/rfc/rfc9535.html\n\t */\n\tsource: string;\n\n\t/**\n\t * The target path of where to store the extracted data, using dotted or numeric index notation.\n\t */\n\ttarget: string;\n\n\t/**\n\t * When extracting objects, should the path be maintained in the target object.\n\t */\n\tmaintainNestingDepth?: number;\n\n\t/**\n\t * Should the data be coerced to a specific type.\n\t */\n\tcoerce?: CoerceType;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRule.js","sourceRoot":"","sources":["../../../src/models/IRule.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { CoerceType } from \"@3sixty/core\";\n\n/**\n * Rule defining how to extract data from an object.\n */\nexport interface IRule {\n\t/**\n\t * The JSONPath expression identifying the data to extract from the document.\n\t * @see https://www.rfc-editor.org/rfc/rfc9535.html\n\t */\n\tsource: string;\n\n\t/**\n\t * The target path of where to store the extracted data, using dotted or numeric index notation.\n\t */\n\ttarget: string;\n\n\t/**\n\t * When extracting objects, how much of the original path should be maintained in the target object.\n\t */\n\tretainPathDepth?: number;\n\n\t/**\n\t * Should the data be coerced to a specific type.\n\t */\n\tcoerce?: CoerceType;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRuleGroup.js","sourceRoot":"","sources":["../../../src/models/IRuleGroup.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRule } from \"./IRule.js\";\n\n/**\n * Group of rules for extraction.\n */\nexport interface IRuleGroup {\n\t/**\n\t * The id for the rule group.\n\t */\n\tid: string;\n\n\t/**\n\t * The label for the rule group.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The rules.\n\t */\n\trules: IRule[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IStructuredData.js","sourceRoot":"","sources":["../../../src/models/IStructuredData.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Definition for the structured data.\n */\nexport interface IStructuredData {\n\t/**\n\t * The MIME type of the data.\n\t */\n\tsourceMimeType: string;\n\n\t/**\n\t * The structured object.\n\t */\n\tobject: unknown;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingConvertRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingConvertRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Perform a conversion on the data.\n */\nexport interface IDataProcessingConvertRequest {\n\t/**\n\t * The request body containing the data to convert.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The binary data to convert in base64.\n\t\t */\n\t\tdata: string;\n\n\t\t/**\n\t\t * Use the specified mime type for conversion, will auto detect if undefined.\n\t\t */\n\t\toverrideMimeType?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingConvertResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingConvertResponse.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Response to converting data.\n */\nexport interface IDataProcessingConvertResponse {\n\t/**\n\t * The converted data as an object.\n\t */\n\tbody: unknown;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingExtractRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingExtractRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Perform an extraction on the data with the specified ruleset.\n */\nexport interface IDataProcessingExtractRequest {\n\t/**\n\t * The request body containing the data and rule group to use for extraction.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The rule group id to use for the extraction.\n\t\t */\n\t\truleGroupId: string;\n\n\t\t/**\n\t\t * The binary data to extract from in base64.\n\t\t */\n\t\tdata: string;\n\n\t\t/**\n\t\t * The default extractor connector will be used if not specified.\n\t\t */\n\t\toverrideExtractorType?: string;\n\n\t\t/**\n\t\t * An optional override for the mime type for conversion, will auto detect if not provided.\n\t\t */\n\t\toverrideMimeType?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingExtractResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingExtractResponse.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Response to extracting data.\n */\nexport interface IDataProcessingExtractResponse {\n\t/**\n\t * The extracted data in extended JSON format, preserving types such as bigint, dates, and Uint8Array.\n\t */\n\tbody: unknown;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingRuleGroupGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingRuleGroupGetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a rule group.\n */\nexport interface IDataProcessingRuleGroupGetRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the rule group to retrieve.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingRuleGroupGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingRuleGroupGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRuleGroup } from \"../IRuleGroup.js\";\n\n/**\n * Get a rule group response.\n */\nexport interface IDataProcessingRuleGroupGetResponse {\n\t/**\n\t * The rule group data.\n\t */\n\tbody: IRuleGroup;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingRuleGroupListRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingRuleGroupListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get a list of the rule group entries.\n */\nexport interface IDataProcessingRuleGroupListRequest {\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The optional cursor to get next chunk.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit the number of entities to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingRuleGroupListResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingRuleGroupListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRuleGroup } from \"../IRuleGroup.js\";\n\n/**\n * Response for rule group entry list request.\n */\nexport interface IDataProcessingRuleGroupListResponse {\n\t/**\n\t * The response body containing the list of rule groups and optional pagination cursor.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The entities, which can be partial if a limited keys list was provided.\n\t\t */\n\t\tentities: IRuleGroup[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingRuleGroupRemoveRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingRuleGroupRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Remove a rule group.\n */\nexport interface IDataProcessingRuleGroupRemoveRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the rule group to remove.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDataProcessingRuleGroupSetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDataProcessingRuleGroupSetRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRule } from \"../IRule.js\";\n\n/**\n * Set a rule group.\n */\nexport interface IDataProcessingRuleGroupSetRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the rule group to set.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The rule group data to store.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The label for the rule group.\n\t\t */\n\t\tlabel: string;\n\n\t\t/**\n\t\t * The rules.\n\t\t */\n\t\trules: IRule[];\n\t};\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Factory } from "@3sixty/core";
|
|
2
|
+
import type { IDataConverterConnector } from "../models/IDataConverterConnector.js";
|
|
3
|
+
/**
|
|
4
|
+
* Factory for creating data converter connectors.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DataConverterConnectorFactory: Factory<IDataConverterConnector>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Factory } from "@3sixty/core";
|
|
2
|
+
import type { IDataExtractorConnector } from "../models/IDataExtractorConnector.js";
|
|
3
|
+
/**
|
|
4
|
+
* Factory for creating data extractor connectors.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DataExtractorConnectorFactory: Factory<IDataExtractorConnector>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./factories/dataConverterConnectorFactory.js";
|
|
2
|
+
export * from "./factories/dataExtractorConnectorFactory.js";
|
|
3
|
+
export * from "./models/api/IDataProcessingConvertRequest.js";
|
|
4
|
+
export * from "./models/api/IDataProcessingConvertResponse.js";
|
|
5
|
+
export * from "./models/api/IDataProcessingExtractRequest.js";
|
|
6
|
+
export * from "./models/api/IDataProcessingExtractResponse.js";
|
|
7
|
+
export * from "./models/api/IDataProcessingRuleGroupGetRequest.js";
|
|
8
|
+
export * from "./models/api/IDataProcessingRuleGroupGetResponse.js";
|
|
9
|
+
export * from "./models/api/IDataProcessingRuleGroupListRequest.js";
|
|
10
|
+
export * from "./models/api/IDataProcessingRuleGroupListResponse.js";
|
|
11
|
+
export * from "./models/api/IDataProcessingRuleGroupRemoveRequest.js";
|
|
12
|
+
export * from "./models/api/IDataProcessingRuleGroupSetRequest.js";
|
|
13
|
+
export * from "./models/IDataConverterConnector.js";
|
|
14
|
+
export * from "./models/IDataProcessingComponent.js";
|
|
15
|
+
export * from "./models/IDataExtractorConnector.js";
|
|
16
|
+
export * from "./models/IRule.js";
|
|
17
|
+
export * from "./models/IRuleGroup.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IComponent } from "@3sixty/core";
|
|
2
|
+
/**
|
|
3
|
+
* Interface describing a connector for converting data.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDataConverterConnector extends IComponent {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the MIME types that this connector can convert.
|
|
8
|
+
* @returns The supported MIME type strings.
|
|
9
|
+
*/
|
|
10
|
+
mimeTypes(): string[];
|
|
11
|
+
/**
|
|
12
|
+
* Converts the data to a structured object.
|
|
13
|
+
* @param data The binary data to convert.
|
|
14
|
+
* @returns The parsed structured object.
|
|
15
|
+
*/
|
|
16
|
+
convert(data: Uint8Array): Promise<unknown>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IComponent } from "@3sixty/core";
|
|
2
|
+
import type { IRule } from "./IRule.js";
|
|
3
|
+
/**
|
|
4
|
+
* Interface describing a connector for extracting data.
|
|
5
|
+
*/
|
|
6
|
+
export interface IDataExtractorConnector extends IComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Extracts data from the provided input.
|
|
9
|
+
* @param data The object to extract from.
|
|
10
|
+
* @param rules The rules to use to extract the data.
|
|
11
|
+
* @returns The extracted data.
|
|
12
|
+
*/
|
|
13
|
+
extract(data: unknown, rules: IRule[]): Promise<unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { IComponent } from "@3sixty/core";
|
|
2
|
+
import type { IRuleGroup } from "./IRuleGroup.js";
|
|
3
|
+
/**
|
|
4
|
+
* Interface describing a component for processing data.
|
|
5
|
+
*/
|
|
6
|
+
export interface IDataProcessingComponent extends IComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Set an extraction rule group.
|
|
9
|
+
* @param ruleGroup The rule group to store.
|
|
10
|
+
* @returns A promise that resolves when the rule group has been stored.
|
|
11
|
+
*/
|
|
12
|
+
ruleGroupSet(ruleGroup: IRuleGroup): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a rule group for extraction.
|
|
15
|
+
* @param ruleGroupId The id of the rule group to get.
|
|
16
|
+
* @returns The rule group.
|
|
17
|
+
*/
|
|
18
|
+
ruleGroupGet(ruleGroupId: string): Promise<IRuleGroup>;
|
|
19
|
+
/**
|
|
20
|
+
* Remove a rule group.
|
|
21
|
+
* @param ruleGroupId The id of the rule group to remove.
|
|
22
|
+
* @returns A promise that resolves when the rule group has been removed.
|
|
23
|
+
*/
|
|
24
|
+
ruleGroupRemove(ruleGroupId: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Extracts data from the provided input.
|
|
27
|
+
* @param ruleGroupId The id of the rule group to use to extract data.
|
|
28
|
+
* @param data The data to extract from.
|
|
29
|
+
* @param overrideExtractorType An optional override for the extractor type.
|
|
30
|
+
* @param overrideMimeType An optional override for the mime type for conversion, will auto detect if not provided.
|
|
31
|
+
* @returns The extracted data.
|
|
32
|
+
*/
|
|
33
|
+
extract(ruleGroupId: string, data: Uint8Array, overrideExtractorType?: string, overrideMimeType?: string): Promise<unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Converts data from the provided input to a structured JSON document.
|
|
36
|
+
* @param data The data to convert.
|
|
37
|
+
* @param overrideMimeType An optional override for the mime type, will auto detect if empty.
|
|
38
|
+
* @returns The converted data.
|
|
39
|
+
*/
|
|
40
|
+
convert(data: Uint8Array, overrideMimeType?: string): Promise<unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Query the rule group entries.
|
|
43
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
44
|
+
* @param limit Limit the number of entities to return.
|
|
45
|
+
* @returns All the entities for the storage matching the conditions,
|
|
46
|
+
* and a cursor which can be used to request more entities.
|
|
47
|
+
*/
|
|
48
|
+
query(cursor?: string, limit?: number): Promise<{
|
|
49
|
+
/**
|
|
50
|
+
* The entities, which can be partial if a limited keys list was provided.
|
|
51
|
+
*/
|
|
52
|
+
entities: IRuleGroup[];
|
|
53
|
+
/**
|
|
54
|
+
* An optional cursor, when defined can be used to call find to get more entities.
|
|
55
|
+
*/
|
|
56
|
+
cursor?: string;
|
|
57
|
+
}>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CoerceType } from "@3sixty/core";
|
|
2
|
+
/**
|
|
3
|
+
* Definition for the data to extract.
|
|
4
|
+
*/
|
|
5
|
+
export interface IExtractRule {
|
|
6
|
+
/**
|
|
7
|
+
* The JSONPath expression identifying the data to extract from the document.
|
|
8
|
+
* @see https://www.rfc-editor.org/rfc/rfc9535.html
|
|
9
|
+
*/
|
|
10
|
+
source: string;
|
|
11
|
+
/**
|
|
12
|
+
* The target path of where to store the extracted data, using dotted or numeric index notation.
|
|
13
|
+
*/
|
|
14
|
+
target: string;
|
|
15
|
+
/**
|
|
16
|
+
* When extracting objects, should the path be maintained in the target object.
|
|
17
|
+
*/
|
|
18
|
+
maintainNestingDepth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Should the data be coerced to a specific type.
|
|
21
|
+
*/
|
|
22
|
+
coerce?: CoerceType;
|
|
23
|
+
}
|