@relazio/plugin-sdk 0.1.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 +22 -0
- package/README.md +255 -0
- package/dist/core/manifest.d.ts +21 -0
- package/dist/core/manifest.d.ts.map +1 -0
- package/dist/core/manifest.js +96 -0
- package/dist/core/plugin.d.ts +110 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/plugin.js +272 -0
- package/dist/core/types.d.ts +222 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/jobs/progress.d.ts +79 -0
- package/dist/jobs/progress.d.ts.map +1 -0
- package/dist/jobs/progress.js +165 -0
- package/dist/registry/installation.d.ts +101 -0
- package/dist/registry/installation.d.ts.map +1 -0
- package/dist/registry/installation.js +148 -0
- package/dist/security/hmac.d.ts +28 -0
- package/dist/security/hmac.d.ts.map +1 -0
- package/dist/security/hmac.js +68 -0
- package/dist/server/express.d.ts +43 -0
- package/dist/server/express.d.ts.map +1 -0
- package/dist/server/express.js +279 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Relazio Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# Relazio - Plugin SDK
|
|
2
|
+
|
|
3
|
+
> Official SDK for building external plugins for Relazio
|
|
4
|
+
|
|
5
|
+
[](https://github.com/relazio/plugin-sdk)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
**Platform**: Relazio (dal latino *relatio* - relazione, rapporto)
|
|
9
|
+
**Platform Version**: 2.0.0
|
|
10
|
+
**SDK Status**: π Documentation Phase
|
|
11
|
+
**Target Release**: Q1 2026
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## π Overview
|
|
16
|
+
|
|
17
|
+
Questo repository contiene la documentazione e, in futuro, il codice sorgente dell'SDK ufficiale per creare plugin esterni per **Relazio**.
|
|
18
|
+
|
|
19
|
+
### Platform Features Implemented β
|
|
20
|
+
|
|
21
|
+
Il sistema plugin esterni della piattaforma Γ¨ **PRODUCTION READY** (Dicembre 2025):
|
|
22
|
+
|
|
23
|
+
- β
Manifest validation (HTTPS, TLS, Zod)
|
|
24
|
+
- β
Installation flow completo
|
|
25
|
+
- β
Webhook system con HMAC-SHA256
|
|
26
|
+
- β
Job queue con 7 stati
|
|
27
|
+
- β
Rate limiting (30/min, 500/hour, 2000/day)
|
|
28
|
+
- β
Timeout enforcement (30 min max)
|
|
29
|
+
- β
Security completa
|
|
30
|
+
- β
E2E testing (44 test, 91% pass)
|
|
31
|
+
|
|
32
|
+
### SDK Packages Status
|
|
33
|
+
|
|
34
|
+
- β
`@relazio/plugin-sdk` - NPM package (TypeScript/JavaScript) - **COMPLETO** β
|
|
35
|
+
- β
Core plugin system
|
|
36
|
+
- β
Sync & async transforms
|
|
37
|
+
- β
HMAC signature utilities
|
|
38
|
+
- β
Job progress tracking
|
|
39
|
+
- β
Express server integration
|
|
40
|
+
- β
**Multi-tenant support** (NEW!)
|
|
41
|
+
- [ ] `relazio-plugin-sdk` - PyPI package (Python) - Q1 2026
|
|
42
|
+
- [ ] CLI tool per scaffold plugin - Q1 2026
|
|
43
|
+
- [ ] Mock platform per testing locale - Q2 2026
|
|
44
|
+
- β
Repository esempi plugin - **4 esempi disponibili**
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## π Documentazione
|
|
49
|
+
|
|
50
|
+
Tutta la documentazione Γ¨ disponibile nella cartella `docs/`:
|
|
51
|
+
|
|
52
|
+
### Per Utenti
|
|
53
|
+
|
|
54
|
+
- **[EXTERNAL_PLUGINS_README.md](docs/EXTERNAL_PLUGINS_README.md)** - Quick start guide per installare e usare plugin esterni
|
|
55
|
+
|
|
56
|
+
### Per Sviluppatori
|
|
57
|
+
|
|
58
|
+
- **[QUICKSTART.md](QUICKSTART.md)** - β Quick start per creare plugin (3 righe di codice!)
|
|
59
|
+
- **[SDK.md](docs/SDK.md)** - β SDK API reference completa (TypeScript/Python)
|
|
60
|
+
- **[MULTI_TENANT.md](docs/MULTI_TENANT.md)** - Guida multi-tenancy (architettura standard)
|
|
61
|
+
- **[CONFIGURATION.md](docs/CONFIGURATION.md)** - Guida configurazione (string, number, boolean, select)
|
|
62
|
+
- **[EXTERNAL_PLUGINS.md](docs/EXTERNAL_PLUGINS.md)** - Architettura sistema plugin esterni
|
|
63
|
+
- **[EXTERNAL_PLUGINS_FLOW.md](docs/EXTERNAL_PLUGINS_FLOW.md)** - Flussi dettagliati step-by-step
|
|
64
|
+
- **[IMPLEMENTATION_EXTERNAL_PLUGINS.md](docs/IMPLEMENTATION_EXTERNAL_PLUGINS.md)** - Piano implementazione (reference)
|
|
65
|
+
|
|
66
|
+
### Reference
|
|
67
|
+
|
|
68
|
+
- **[EXTERNAL_PLUGINS_COMPLETE.md](docs/EXTERNAL_PLUGINS_COMPLETE.md)** - Riepilogo completo dell'implementazione platform
|
|
69
|
+
- **[PLUGIN_SYSTEM.md](docs/PLUGIN_SYSTEM.md)** - Plugin built-in (reference)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## π Quick Start
|
|
74
|
+
|
|
75
|
+
### Installazione
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm install @relazio/plugin-sdk
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Esempio Minimo
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { RelazioPlugin } from '@relazio/plugin-sdk';
|
|
85
|
+
|
|
86
|
+
const plugin = new RelazioPlugin({
|
|
87
|
+
id: 'my-plugin',
|
|
88
|
+
name: 'My Plugin',
|
|
89
|
+
version: '1.0.0',
|
|
90
|
+
author: 'Your Name',
|
|
91
|
+
description: 'What it does',
|
|
92
|
+
category: 'network'
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Registra transform
|
|
96
|
+
plugin.transform({
|
|
97
|
+
id: 'my-transform',
|
|
98
|
+
name: 'My Transform',
|
|
99
|
+
description: 'Transforms data',
|
|
100
|
+
inputType: 'domain',
|
|
101
|
+
outputTypes: ['ip'],
|
|
102
|
+
|
|
103
|
+
handler: async (input, config) => {
|
|
104
|
+
// input.organizationId contiene l'ID dell'organizzazione
|
|
105
|
+
console.log(`Processing for org: ${input.organizationId}`);
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
entities: [
|
|
109
|
+
{
|
|
110
|
+
type: 'ip',
|
|
111
|
+
value: '8.8.8.8',
|
|
112
|
+
label: 'Google DNS'
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
edges: []
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Avvia server multi-tenant
|
|
121
|
+
plugin.start({
|
|
122
|
+
port: 3000,
|
|
123
|
+
multiTenant: true // β Gestisce automaticamente tutto!
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**π Il plugin gestisce automaticamente:**
|
|
128
|
+
- β
Endpoint `/register` per nuove organizzazioni
|
|
129
|
+
- β
Generazione automatica webhook secrets
|
|
130
|
+
- β
Gestione separata per ogni organization
|
|
131
|
+
- β
Zero configurazione manuale necessaria!
|
|
132
|
+
|
|
133
|
+
### Esempi Completi
|
|
134
|
+
|
|
135
|
+
Vedi la cartella `examples/` per esempi funzionanti:
|
|
136
|
+
- **Email Parser** - Transform sincrona semplice
|
|
137
|
+
- **DNS Toolkit** - Multiple transforms sincrone
|
|
138
|
+
- **Multi-Tenant Plugin** - Transform asincrona con multi-organization
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## π― Roadmap
|
|
143
|
+
|
|
144
|
+
### Phase 1: Documentation β
(Completata - Dicembre 2025)
|
|
145
|
+
- [x] Architecture design
|
|
146
|
+
- [x] SDK API design
|
|
147
|
+
- [x] Flow documentation
|
|
148
|
+
- [x] Security requirements
|
|
149
|
+
- [x] Platform implementation
|
|
150
|
+
|
|
151
|
+
### Phase 2: TypeScript SDK β
(Completata - Dicembre 2025)
|
|
152
|
+
- [x] Core SDK implementation
|
|
153
|
+
- [x] Manifest generator
|
|
154
|
+
- [x] HMAC signing utilities
|
|
155
|
+
- [x] Webhook handler
|
|
156
|
+
- [x] Job progress tracking
|
|
157
|
+
- [x] Testing utilities
|
|
158
|
+
- [x] Esempi funzionanti
|
|
159
|
+
- [ ] NPM package publication (Q1 2026)
|
|
160
|
+
- [ ] CLI tool (Q1 2026)
|
|
161
|
+
|
|
162
|
+
### Phase 3: Python SDK (Q1 2026)
|
|
163
|
+
- [ ] Core SDK implementation
|
|
164
|
+
- [ ] Manifest generator
|
|
165
|
+
- [ ] HMAC signing utilities
|
|
166
|
+
- [ ] Webhook handler (Flask/FastAPI)
|
|
167
|
+
- [ ] Job progress tracking
|
|
168
|
+
- [ ] Testing utilities
|
|
169
|
+
- [ ] CLI tool
|
|
170
|
+
- [ ] PyPI package publication
|
|
171
|
+
|
|
172
|
+
### Phase 4: Developer Experience (Q2 2026)
|
|
173
|
+
- [ ] Developer portal
|
|
174
|
+
- [ ] Plugin examples repository
|
|
175
|
+
- [ ] Video tutorials
|
|
176
|
+
- [ ] Plugin templates (starter kits)
|
|
177
|
+
- [ ] Testing playground
|
|
178
|
+
- [ ] Plugin marketplace submission
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## π Security Requirements
|
|
183
|
+
|
|
184
|
+
### Mandatory (Enforced by Platform)
|
|
185
|
+
|
|
186
|
+
- β
**HTTPS**: All endpoints must use HTTPS (HTTP rejected)
|
|
187
|
+
- β
**TLS Valid**: Valid SSL certificate required
|
|
188
|
+
- β
**HMAC Signature**: All webhooks must be signed with HMAC-SHA256
|
|
189
|
+
- β
**Rate Limiting**: 30 req/min, 500 req/hour, 2000 req/day
|
|
190
|
+
- β
**Timeouts**: 30s sync, 5s async response, 30 min job max
|
|
191
|
+
|
|
192
|
+
### SDK Handles
|
|
193
|
+
|
|
194
|
+
- HMAC signature generation
|
|
195
|
+
- Webhook endpoint setup
|
|
196
|
+
- Job progress tracking
|
|
197
|
+
- Error handling
|
|
198
|
+
- Timeout awareness
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## π¦ Package Structure (Future)
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
@relazio/plugin-sdk/
|
|
206
|
+
βββ src/
|
|
207
|
+
β βββ core/
|
|
208
|
+
β β βββ plugin.ts # Main Plugin class
|
|
209
|
+
β β βββ manifest.ts # Manifest generator
|
|
210
|
+
β β βββ types.ts # TypeScript types
|
|
211
|
+
β βββ server/
|
|
212
|
+
β β βββ express.ts # Express integration
|
|
213
|
+
β β βββ fastify.ts # Fastify integration
|
|
214
|
+
β βββ security/
|
|
215
|
+
β β βββ hmac.ts # HMAC utilities
|
|
216
|
+
β βββ jobs/
|
|
217
|
+
β β βββ progress.ts # Job progress tracking
|
|
218
|
+
β βββ testing/
|
|
219
|
+
β βββ mock-platform.ts # Mock platform for tests
|
|
220
|
+
βββ examples/
|
|
221
|
+
β βββ dns-plugin/
|
|
222
|
+
β βββ ip-lookup/
|
|
223
|
+
β βββ shodan-integration/
|
|
224
|
+
βββ docs/
|
|
225
|
+
βββ (all documentation files)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## π€ Contributing
|
|
231
|
+
|
|
232
|
+
Il progetto Γ¨ attualmente in fase di sviluppo. I contributi saranno benvenuti a partire da Q1 2026.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## π License
|
|
237
|
+
|
|
238
|
+
MIT License - see LICENSE file for details.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## π Links
|
|
243
|
+
|
|
244
|
+
- **Platform Repository**: [github.com/relazio/relazio](https://github.com/relazio/relazio)
|
|
245
|
+
- **Documentation**: [docs/](docs/)
|
|
246
|
+
- **Website**: Coming soon
|
|
247
|
+
- **Discord**: Coming soon
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
**Status**: π Documentation Complete, Implementation Q1 2026
|
|
252
|
+
**Platform**: β
Production Ready (Dicembre 2025)
|
|
253
|
+
**SDK**: π§ In Development (Q1 2026)
|
|
254
|
+
|
|
255
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PluginManifest, PluginConfig, ConfigSchema, TransformConfig, AsyncTransformConfig, ManifestOptions } from '../core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Genera manifest JSON valido per la piattaforma Relazio
|
|
4
|
+
*/
|
|
5
|
+
export declare class ManifestGenerator {
|
|
6
|
+
private config;
|
|
7
|
+
private transforms;
|
|
8
|
+
private configSchema?;
|
|
9
|
+
constructor(config: PluginConfig);
|
|
10
|
+
setConfigSchema(schema: ConfigSchema): void;
|
|
11
|
+
addTransform(transform: TransformConfig | AsyncTransformConfig): void;
|
|
12
|
+
/**
|
|
13
|
+
* Genera manifest completo
|
|
14
|
+
*/
|
|
15
|
+
generate(options: ManifestOptions): PluginManifest;
|
|
16
|
+
/**
|
|
17
|
+
* Genera manifest come JSON string
|
|
18
|
+
*/
|
|
19
|
+
generateJSON(options: ManifestOptions, indent?: number): string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/core/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,eAAe,EAEhB,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,UAAU,CAAqD;IACvE,OAAO,CAAC,YAAY,CAAC,CAAe;gBAExB,MAAM,EAAE,YAAY;IAIhC,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAI3C,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,oBAAoB,GAAG,IAAI;IAIrE;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc;IA4ElD;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAI,GAAG,MAAM;CAI3D"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManifestGenerator = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Genera manifest JSON valido per la piattaforma Relazio
|
|
6
|
+
*/
|
|
7
|
+
class ManifestGenerator {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.transforms = [];
|
|
10
|
+
this.config = config;
|
|
11
|
+
}
|
|
12
|
+
setConfigSchema(schema) {
|
|
13
|
+
this.configSchema = schema;
|
|
14
|
+
}
|
|
15
|
+
addTransform(transform) {
|
|
16
|
+
this.transforms.push(transform);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Genera manifest completo
|
|
20
|
+
*/
|
|
21
|
+
generate(options) {
|
|
22
|
+
if (this.transforms.length === 0) {
|
|
23
|
+
throw new Error('Al least one transform is required');
|
|
24
|
+
}
|
|
25
|
+
// Allow HTTP for localhost/development, require HTTPS for production
|
|
26
|
+
const url = new URL(options.endpoint);
|
|
27
|
+
const isLocalhost = url.hostname === 'localhost' || url.hostname === '127.0.0.1' || url.hostname === '0.0.0.0';
|
|
28
|
+
if (!options.endpoint.startsWith('https://') && !isLocalhost) {
|
|
29
|
+
throw new Error('Endpoint must use HTTPS (except for localhost development)');
|
|
30
|
+
}
|
|
31
|
+
// Raccogli tutti gli input/output types
|
|
32
|
+
const inputTypes = new Set();
|
|
33
|
+
const outputTypes = new Set();
|
|
34
|
+
let hasAsync = false;
|
|
35
|
+
for (const transform of this.transforms) {
|
|
36
|
+
inputTypes.add(transform.inputType);
|
|
37
|
+
transform.outputTypes.forEach((type) => outputTypes.add(type));
|
|
38
|
+
// Check if it's async transform
|
|
39
|
+
if ('async' in transform) {
|
|
40
|
+
hasAsync = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const manifest = {
|
|
44
|
+
manifestVersion: '1.0',
|
|
45
|
+
plugin: {
|
|
46
|
+
id: this.config.id,
|
|
47
|
+
name: this.config.name,
|
|
48
|
+
description: this.config.description,
|
|
49
|
+
version: this.config.version,
|
|
50
|
+
author: this.config.author,
|
|
51
|
+
homepage: this.config.homepage,
|
|
52
|
+
documentation: this.config.documentation,
|
|
53
|
+
license: this.config.license || 'MIT',
|
|
54
|
+
icon: this.config.icon,
|
|
55
|
+
logoUrl: this.config.logoUrl,
|
|
56
|
+
category: this.config.category,
|
|
57
|
+
capabilities: {
|
|
58
|
+
inputTypes: Array.from(inputTypes),
|
|
59
|
+
outputTypes: Array.from(outputTypes),
|
|
60
|
+
estimatedTime: hasAsync ? 'minutes' : 'seconds',
|
|
61
|
+
supportsAsync: hasAsync,
|
|
62
|
+
},
|
|
63
|
+
transforms: this.transforms.map((transform) => ({
|
|
64
|
+
id: transform.id,
|
|
65
|
+
name: transform.name,
|
|
66
|
+
description: transform.description,
|
|
67
|
+
inputType: transform.inputType,
|
|
68
|
+
outputTypes: transform.outputTypes,
|
|
69
|
+
endpoint: `${options.endpoint}/${transform.id}`,
|
|
70
|
+
method: 'POST',
|
|
71
|
+
async: 'async' in transform,
|
|
72
|
+
})),
|
|
73
|
+
metadata: {
|
|
74
|
+
tags: options.tags || [],
|
|
75
|
+
minimumPlatformVersion: options.minimumPlatformVersion || '2.0.0',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
// Aggiungi configurazione se presente
|
|
80
|
+
if (this.configSchema && Object.keys(this.configSchema).length > 0) {
|
|
81
|
+
manifest.plugin.configuration = {
|
|
82
|
+
required: Object.values(this.configSchema).some((field) => field.required),
|
|
83
|
+
schema: this.configSchema,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return manifest;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Genera manifest come JSON string
|
|
90
|
+
*/
|
|
91
|
+
generateJSON(options, indent = 2) {
|
|
92
|
+
const manifest = this.generate(options);
|
|
93
|
+
return JSON.stringify(manifest, null, indent);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.ManifestGenerator = ManifestGenerator;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { PluginConfig, ConfigSchema, TransformConfig, AsyncTransformConfig, StartOptions, ManifestOptions, PluginManifest, TransformInput, TransformResult } from './types';
|
|
2
|
+
import { JobQueue, type WebhookSecretProvider } from '../jobs/progress';
|
|
3
|
+
import { InstallationRegistry } from '../registry/installation';
|
|
4
|
+
/**
|
|
5
|
+
* Classe principale per creare plugin Relazio
|
|
6
|
+
*/
|
|
7
|
+
export declare class RelazioPlugin {
|
|
8
|
+
private config;
|
|
9
|
+
private manifestGenerator;
|
|
10
|
+
private transforms;
|
|
11
|
+
private asyncTransforms;
|
|
12
|
+
private configSchema?;
|
|
13
|
+
private jobQueue?;
|
|
14
|
+
private server?;
|
|
15
|
+
private webhookSecret?;
|
|
16
|
+
private multiTenant;
|
|
17
|
+
private secretProvider?;
|
|
18
|
+
private registry?;
|
|
19
|
+
constructor(config: PluginConfig);
|
|
20
|
+
/**
|
|
21
|
+
* Definisci schema di configurazione
|
|
22
|
+
*/
|
|
23
|
+
configure(schema: ConfigSchema): void;
|
|
24
|
+
/**
|
|
25
|
+
* Registra una transform sincrona
|
|
26
|
+
*/
|
|
27
|
+
transform(config: TransformConfig): void;
|
|
28
|
+
/**
|
|
29
|
+
* Registra una transform asincrona
|
|
30
|
+
*/
|
|
31
|
+
asyncTransform(config: AsyncTransformConfig): void;
|
|
32
|
+
/**
|
|
33
|
+
* Imposta webhook secret (single-tenant mode)
|
|
34
|
+
*/
|
|
35
|
+
setWebhookSecret(secret: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Abilita multi-tenancy con secret provider
|
|
38
|
+
*/
|
|
39
|
+
enableMultiTenant(secretProvider: WebhookSecretProvider): void;
|
|
40
|
+
/**
|
|
41
|
+
* Abilita multi-tenancy con gestione automatica in-memory
|
|
42
|
+
* Utile per development/testing
|
|
43
|
+
*/
|
|
44
|
+
enableMultiTenantInMemory(): InstallationRegistry;
|
|
45
|
+
/**
|
|
46
|
+
* Ottieni registry (solo multi-tenant)
|
|
47
|
+
*/
|
|
48
|
+
getRegistry(): InstallationRegistry | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Genera manifest JSON
|
|
51
|
+
*/
|
|
52
|
+
generateManifest(options: ManifestOptions): PluginManifest;
|
|
53
|
+
/**
|
|
54
|
+
* Esegui una transform (usato internamente)
|
|
55
|
+
*/
|
|
56
|
+
executeTransform(transformId: string, input: TransformInput): Promise<TransformResult>;
|
|
57
|
+
/**
|
|
58
|
+
* Esegui una transform asincrona (usato internamente)
|
|
59
|
+
*/
|
|
60
|
+
executeAsyncTransform(transformId: string, input: TransformInput, callbackUrl: string, organizationId?: string): Promise<{
|
|
61
|
+
jobId: string;
|
|
62
|
+
estimatedTime?: number;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Avvia il server plugin
|
|
66
|
+
*/
|
|
67
|
+
start(options: StartOptions): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Ferma il server
|
|
70
|
+
*/
|
|
71
|
+
stop(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Ottieni configurazione plugin
|
|
74
|
+
*/
|
|
75
|
+
getConfig(): PluginConfig;
|
|
76
|
+
/**
|
|
77
|
+
* Ottieni lista transforms
|
|
78
|
+
*/
|
|
79
|
+
getTransforms(): string[];
|
|
80
|
+
/**
|
|
81
|
+
* Ottieni lista async transforms
|
|
82
|
+
*/
|
|
83
|
+
getAsyncTransforms(): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Ottieni tutte le transforms
|
|
86
|
+
*/
|
|
87
|
+
getAllTransforms(): Array<TransformConfig | AsyncTransformConfig>;
|
|
88
|
+
/**
|
|
89
|
+
* Verifica se una transform esiste
|
|
90
|
+
*/
|
|
91
|
+
hasTransform(transformId: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Verifica se una transform Γ¨ asincrona
|
|
94
|
+
*/
|
|
95
|
+
isAsyncTransform(transformId: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Ottieni job queue (per monitoring)
|
|
98
|
+
*/
|
|
99
|
+
getJobQueue(): JobQueue | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Verifica se Γ¨ in modalitΓ multi-tenant
|
|
102
|
+
*/
|
|
103
|
+
isMultiTenant(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Ottieni secret provider (solo multi-tenant)
|
|
106
|
+
*/
|
|
107
|
+
getSecretProvider(): WebhookSecretProvider | undefined;
|
|
108
|
+
}
|
|
109
|
+
export { RelazioPlugin as OSINTPlugin };
|
|
110
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/core/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,QAAQ,EAAE,KAAK,qBAAqB,EAA0B,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,UAAU,CAAsC;IACxD,OAAO,CAAC,eAAe,CAA2C;IAClE,OAAO,CAAC,YAAY,CAAC,CAAe;IACpC,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAC,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,CAAuB;gBAE5B,MAAM,EAAE,YAAY;IAKhC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAKrC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IASxC;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAkBlD;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAYtC;;OAEG;IACH,iBAAiB,CAAC,cAAc,EAAE,qBAAqB,GAAG,IAAI;IAiB9D;;;OAGG;IACH,yBAAyB,IAAI,oBAAoB;IAMjD;;OAEG;IACH,WAAW,IAAI,oBAAoB,GAAG,SAAS;IAI/C;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc;IAI1D;;OAEG;IACG,gBAAgB,CACpB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,eAAe,CAAC;IAU3B;;OAEG;IACG,qBAAqB,CACzB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,cAAc,EACrB,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAsCrD;;OAEG;IACG,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBjD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;OAEG;IACH,SAAS,IAAI,YAAY;IAIzB;;OAEG;IACH,aAAa,IAAI,MAAM,EAAE;IAIzB;;OAEG;IACH,kBAAkB,IAAI,MAAM,EAAE;IAI9B;;OAEG;IACH,gBAAgB,IAAI,KAAK,CAAC,eAAe,GAAG,oBAAoB,CAAC;IAOjE;;OAEG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAI1C;;OAEG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAI9C;;OAEG;IACH,WAAW,IAAI,QAAQ,GAAG,SAAS;IAInC;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,iBAAiB,IAAI,qBAAqB,GAAG,SAAS;CAGvD;AAGD,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,CAAC"}
|