@uvrn/sdk 1.0.2 → 1.3.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/README.md +6 -2
- package/dist/builder.d.ts +192 -0
- package/dist/builder.d.ts.map +1 -0
- package/dist/builder.js +264 -0
- package/dist/builder.js.map +1 -0
- package/dist/client.d.ts +140 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +376 -0
- package/dist/client.js.map +1 -0
- package/dist/errors/index.d.ts +45 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +72 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +44 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/sdk.d.ts +150 -0
- package/dist/types/sdk.d.ts.map +1 -0
- package/dist/types/sdk.js +6 -0
- package/dist/types/sdk.js.map +1 -0
- package/dist/validators.d.ts +61 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +219 -0
- package/dist/validators.js.map +1 -0
- package/package.json +17 -29
package/dist/client.js
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Delta Engine SDK Client
|
|
4
|
+
*
|
|
5
|
+
* Main client class for interacting with Delta Engine in multiple modes:
|
|
6
|
+
* - CLI: Spawns CLI process
|
|
7
|
+
* - HTTP: Makes API requests
|
|
8
|
+
* - Local: Direct function calls
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.DeltaEngineClient = void 0;
|
|
45
|
+
const validators_1 = require("./validators");
|
|
46
|
+
const errors_1 = require("./errors");
|
|
47
|
+
const child_process_1 = require("child_process");
|
|
48
|
+
const promises_1 = require("fs/promises");
|
|
49
|
+
const os_1 = require("os");
|
|
50
|
+
const path_1 = require("path");
|
|
51
|
+
const crypto_1 = require("crypto");
|
|
52
|
+
/**
|
|
53
|
+
* Client for interacting with Delta Engine
|
|
54
|
+
*
|
|
55
|
+
* Supports three execution modes:
|
|
56
|
+
* - **CLI**: Spawns the CLI executable
|
|
57
|
+
* - **HTTP**: Makes requests to REST API
|
|
58
|
+
* - **Local**: Direct import of core engine
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* // CLI mode
|
|
63
|
+
* const client = new DeltaEngineClient({
|
|
64
|
+
* mode: 'cli',
|
|
65
|
+
* cliPath: '/usr/local/bin/uvrn'
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* // HTTP mode
|
|
69
|
+
* const client = new DeltaEngineClient({
|
|
70
|
+
* mode: 'http',
|
|
71
|
+
* apiUrl: 'http://localhost:3000',
|
|
72
|
+
* timeout: 30000
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* // Local mode
|
|
76
|
+
* const client = new DeltaEngineClient({
|
|
77
|
+
* mode: 'local'
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
class DeltaEngineClient {
|
|
82
|
+
options;
|
|
83
|
+
/**
|
|
84
|
+
* Creates a new DeltaEngineClient
|
|
85
|
+
*
|
|
86
|
+
* @param options - Client configuration
|
|
87
|
+
* @throws {ConfigurationError} if configuration is invalid
|
|
88
|
+
*/
|
|
89
|
+
constructor(options) {
|
|
90
|
+
// Validate configuration
|
|
91
|
+
this.validateOptions(options);
|
|
92
|
+
// Set defaults
|
|
93
|
+
this.options = {
|
|
94
|
+
mode: options.mode,
|
|
95
|
+
cliPath: options.cliPath || '',
|
|
96
|
+
apiUrl: options.apiUrl || '',
|
|
97
|
+
timeout: options.timeout || 30000,
|
|
98
|
+
retries: options.retries || 3
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Validates client options
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
validateOptions(options) {
|
|
106
|
+
if (!options.mode) {
|
|
107
|
+
throw new errors_1.ConfigurationError('mode is required');
|
|
108
|
+
}
|
|
109
|
+
if (!['cli', 'http', 'local'].includes(options.mode)) {
|
|
110
|
+
throw new errors_1.ConfigurationError(`Invalid mode: ${options.mode}. Must be 'cli', 'http', or 'local'`);
|
|
111
|
+
}
|
|
112
|
+
if (options.mode === 'cli' && !options.cliPath) {
|
|
113
|
+
throw new errors_1.ConfigurationError('cliPath is required for CLI mode');
|
|
114
|
+
}
|
|
115
|
+
if (options.mode === 'http' && !options.apiUrl) {
|
|
116
|
+
throw new errors_1.ConfigurationError('apiUrl is required for HTTP mode');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Executes a bundle and returns a receipt
|
|
121
|
+
*
|
|
122
|
+
* @param bundle - The DeltaBundle to execute
|
|
123
|
+
* @returns Promise resolving to DeltaReceipt
|
|
124
|
+
* @throws {ValidationError} if bundle is invalid
|
|
125
|
+
* @throws {ExecutionError} if execution fails
|
|
126
|
+
* @throws {NetworkError} if HTTP request fails (HTTP mode only)
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const bundle = {
|
|
131
|
+
* bundleId: 'test-1',
|
|
132
|
+
* claim: 'Revenue matches forecast',
|
|
133
|
+
* dataSpecs: [...],
|
|
134
|
+
* thresholdPct: 0.05
|
|
135
|
+
* };
|
|
136
|
+
*
|
|
137
|
+
* const receipt = await client.runEngine(bundle);
|
|
138
|
+
* console.log('Outcome:', receipt.outcome);
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
async runEngine(bundle) {
|
|
142
|
+
// Validate bundle first
|
|
143
|
+
const validation = (0, validators_1.validateBundle)(bundle);
|
|
144
|
+
if (!validation.valid) {
|
|
145
|
+
throw new errors_1.ValidationError('Invalid bundle', validation.errors || []);
|
|
146
|
+
}
|
|
147
|
+
// Execute based on mode
|
|
148
|
+
switch (this.options.mode) {
|
|
149
|
+
case 'cli':
|
|
150
|
+
return this.runEngineCLI(bundle);
|
|
151
|
+
case 'http':
|
|
152
|
+
return this.runEngineHTTP(bundle);
|
|
153
|
+
case 'local':
|
|
154
|
+
return this.runEngineLocal(bundle);
|
|
155
|
+
default:
|
|
156
|
+
throw new errors_1.ConfigurationError(`Unsupported mode: ${this.options.mode}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Executes bundle via CLI mode
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
163
|
+
async runEngineCLI(bundle) {
|
|
164
|
+
const tempFile = (0, path_1.join)((0, os_1.tmpdir)(), `delta-bundle-${(0, crypto_1.randomBytes)(8).toString('hex')}.json`);
|
|
165
|
+
try {
|
|
166
|
+
// Write bundle to temp file
|
|
167
|
+
await (0, promises_1.writeFile)(tempFile, JSON.stringify(bundle, null, 2));
|
|
168
|
+
// Spawn CLI process
|
|
169
|
+
const result = await this.spawnCLI(tempFile);
|
|
170
|
+
// Parse and validate receipt
|
|
171
|
+
const receipt = JSON.parse(result);
|
|
172
|
+
const receiptValidation = (0, validators_1.validateReceipt)(receipt);
|
|
173
|
+
if (!receiptValidation.valid) {
|
|
174
|
+
throw new errors_1.ValidationError('Invalid receipt from CLI', receiptValidation.errors || []);
|
|
175
|
+
}
|
|
176
|
+
return receipt;
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
if (error instanceof errors_1.DeltaEngineError) {
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
182
|
+
throw new errors_1.ExecutionError(`CLI execution failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
183
|
+
}
|
|
184
|
+
finally {
|
|
185
|
+
// Clean up temp file
|
|
186
|
+
try {
|
|
187
|
+
await (0, promises_1.unlink)(tempFile);
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// Ignore cleanup errors
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Spawns CLI process and captures output
|
|
196
|
+
* @internal
|
|
197
|
+
*/
|
|
198
|
+
spawnCLI(bundlePath) {
|
|
199
|
+
return new Promise((resolve, reject) => {
|
|
200
|
+
const child = (0, child_process_1.spawn)(this.options.cliPath, ['run', bundlePath], {
|
|
201
|
+
timeout: this.options.timeout
|
|
202
|
+
});
|
|
203
|
+
let stdout = '';
|
|
204
|
+
let stderr = '';
|
|
205
|
+
child.stdout?.on('data', (data) => {
|
|
206
|
+
stdout += data.toString();
|
|
207
|
+
});
|
|
208
|
+
child.stderr?.on('data', (data) => {
|
|
209
|
+
stderr += data.toString();
|
|
210
|
+
});
|
|
211
|
+
child.on('error', (error) => {
|
|
212
|
+
reject(new errors_1.ExecutionError(`Failed to spawn CLI: ${error.message}`));
|
|
213
|
+
});
|
|
214
|
+
child.on('close', (code) => {
|
|
215
|
+
if (code === 0) {
|
|
216
|
+
resolve(stdout);
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
reject(new errors_1.ExecutionError(`CLI exited with code ${code ?? -1}`, code ?? undefined, stderr));
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Executes bundle via HTTP API mode
|
|
226
|
+
* @internal
|
|
227
|
+
*/
|
|
228
|
+
async runEngineHTTP(bundle) {
|
|
229
|
+
const url = `${this.options.apiUrl}/api/v1/delta/run`;
|
|
230
|
+
try {
|
|
231
|
+
const response = await this.fetchWithRetry(url, {
|
|
232
|
+
method: 'POST',
|
|
233
|
+
headers: {
|
|
234
|
+
'Content-Type': 'application/json'
|
|
235
|
+
},
|
|
236
|
+
body: JSON.stringify(bundle)
|
|
237
|
+
});
|
|
238
|
+
if (!response.ok) {
|
|
239
|
+
const errorBody = await response.text();
|
|
240
|
+
throw new errors_1.NetworkError(`HTTP ${response.status}: ${response.statusText}`, response.status, errorBody);
|
|
241
|
+
}
|
|
242
|
+
const receipt = await response.json();
|
|
243
|
+
// Validate receipt
|
|
244
|
+
const validation = (0, validators_1.validateReceipt)(receipt);
|
|
245
|
+
if (!validation.valid) {
|
|
246
|
+
throw new errors_1.ValidationError('Invalid receipt from API', validation.errors || []);
|
|
247
|
+
}
|
|
248
|
+
return receipt;
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
if (error instanceof errors_1.DeltaEngineError) {
|
|
252
|
+
throw error;
|
|
253
|
+
}
|
|
254
|
+
throw new errors_1.NetworkError(`HTTP request failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Fetch with retry logic
|
|
259
|
+
* @internal
|
|
260
|
+
*/
|
|
261
|
+
async fetchWithRetry(url, options, attempt = 1) {
|
|
262
|
+
try {
|
|
263
|
+
const controller = new AbortController();
|
|
264
|
+
const timeoutId = setTimeout(() => controller.abort(), this.options.timeout);
|
|
265
|
+
const response = await fetch(url, {
|
|
266
|
+
...options,
|
|
267
|
+
signal: controller.signal
|
|
268
|
+
});
|
|
269
|
+
clearTimeout(timeoutId);
|
|
270
|
+
return response;
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
if (attempt < this.options.retries) {
|
|
274
|
+
// Exponential backoff
|
|
275
|
+
const delay = Math.min(1000 * Math.pow(2, attempt - 1), 10000);
|
|
276
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
277
|
+
return this.fetchWithRetry(url, options, attempt + 1);
|
|
278
|
+
}
|
|
279
|
+
throw error;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Executes bundle via local mode (direct import)
|
|
284
|
+
* @internal
|
|
285
|
+
*/
|
|
286
|
+
async runEngineLocal(bundle) {
|
|
287
|
+
try {
|
|
288
|
+
// Dynamic import to avoid bundling core if not needed
|
|
289
|
+
const { runDeltaEngine } = await Promise.resolve().then(() => __importStar(require('@uvrn/core')));
|
|
290
|
+
const receipt = runDeltaEngine(bundle);
|
|
291
|
+
// Validate receipt
|
|
292
|
+
const validation = (0, validators_1.validateReceipt)(receipt);
|
|
293
|
+
if (!validation.valid) {
|
|
294
|
+
throw new errors_1.ValidationError('Invalid receipt from local engine', validation.errors || []);
|
|
295
|
+
}
|
|
296
|
+
return receipt;
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
if (error instanceof errors_1.DeltaEngineError) {
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
302
|
+
throw new errors_1.ExecutionError(`Local execution failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Validates a bundle without executing it
|
|
307
|
+
*
|
|
308
|
+
* @param bundle - The bundle to validate
|
|
309
|
+
* @returns ValidationResult with detailed errors
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```typescript
|
|
313
|
+
* const result = await client.validateBundle(bundle);
|
|
314
|
+
* if (!result.valid) {
|
|
315
|
+
* console.error('Validation errors:', result.errors);
|
|
316
|
+
* }
|
|
317
|
+
* ```
|
|
318
|
+
*/
|
|
319
|
+
async validateBundle(bundle) {
|
|
320
|
+
return (0, validators_1.validateBundle)(bundle);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Verifies a receipt's integrity and determinism
|
|
324
|
+
*
|
|
325
|
+
* Checks:
|
|
326
|
+
* 1. Receipt hash integrity
|
|
327
|
+
* 2. Deterministic replay (if original bundle available)
|
|
328
|
+
*
|
|
329
|
+
* @param receipt - The receipt to verify
|
|
330
|
+
* @returns VerificationResult with detailed information
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* ```typescript
|
|
334
|
+
* const result = await client.verifyReceipt(receipt);
|
|
335
|
+
* if (!result.verified) {
|
|
336
|
+
* console.error('Receipt verification failed!');
|
|
337
|
+
* }
|
|
338
|
+
* if (!result.deterministic) {
|
|
339
|
+
* console.warn('Non-deterministic execution detected!');
|
|
340
|
+
* }
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
async verifyReceipt(receipt) {
|
|
344
|
+
// Validate receipt structure first
|
|
345
|
+
const validation = (0, validators_1.validateReceipt)(receipt);
|
|
346
|
+
if (!validation.valid) {
|
|
347
|
+
return {
|
|
348
|
+
verified: false,
|
|
349
|
+
deterministic: false,
|
|
350
|
+
error: `Invalid receipt structure: ${validation.errors?.map(e => e.message).join(', ')}`
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
// Verify hash
|
|
354
|
+
const hashValid = (0, validators_1.verifyReceiptHash)(receipt);
|
|
355
|
+
if (!hashValid) {
|
|
356
|
+
return {
|
|
357
|
+
verified: false,
|
|
358
|
+
deterministic: false,
|
|
359
|
+
originalHash: receipt.hash,
|
|
360
|
+
error: 'Receipt hash verification failed - receipt may have been tampered with'
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
// For determinism check, we would need the original bundle
|
|
364
|
+
// This is a limitation - receipts don't currently store bundles
|
|
365
|
+
return {
|
|
366
|
+
verified: true,
|
|
367
|
+
deterministic: true, // Assumed true if hash is valid
|
|
368
|
+
originalHash: receipt.hash,
|
|
369
|
+
details: {
|
|
370
|
+
note: 'Determinism check requires original bundle replay'
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
exports.DeltaEngineClient = DeltaEngineClient;
|
|
376
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIH,6CAAkF;AAClF,qCAMkB;AAClB,iDAAsC;AACtC,0CAAgD;AAChD,2BAA4B;AAC5B,+BAA4B;AAC5B,mCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAa,iBAAiB;IACX,OAAO,CAA0B;IAElD;;;;;OAKG;IACH,YAAY,OAAsB;QAChC,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,CAAC,KAAK,EAAE,CAAC;YACtB,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,KAAK;gBACpB,KAAK,EAAE,8BAA8B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aACzF,CAAC;QACJ,CAAC;QAED,cAAc;QACd,MAAM,SAAS,GAAG,IAAA,8BAAiB,EAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,KAAK;gBACpB,YAAY,EAAE,OAAO,CAAC,IAAI;gBAC1B,KAAK,EAAE,wEAAwE;aAChF,CAAC;QACJ,CAAC;QAED,2DAA2D;QAC3D,gEAAgE;QAChE,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI,EAAE,gCAAgC;YACrD,YAAY,EAAE,OAAO,CAAC,IAAI;YAC1B,OAAO,EAAE;gBACP,IAAI,EAAE,mDAAmD;aAC1D;SACF,CAAC;IACJ,CAAC;CACF;AA9UD,8CA8UC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Error Classes for Delta Engine SDK
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Base error class for all Delta Engine SDK errors
|
|
6
|
+
*/
|
|
7
|
+
export declare class DeltaEngineError extends Error {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Error thrown when bundle or receipt validation fails
|
|
12
|
+
*/
|
|
13
|
+
export declare class ValidationError extends DeltaEngineError {
|
|
14
|
+
readonly errors: Array<{
|
|
15
|
+
field: string;
|
|
16
|
+
message: string;
|
|
17
|
+
}>;
|
|
18
|
+
constructor(message: string, errors?: Array<{
|
|
19
|
+
field: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}>);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown during engine execution
|
|
25
|
+
*/
|
|
26
|
+
export declare class ExecutionError extends DeltaEngineError {
|
|
27
|
+
readonly exitCode?: number;
|
|
28
|
+
readonly stderr?: string;
|
|
29
|
+
constructor(message: string, exitCode?: number, stderr?: string);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Error thrown during HTTP API communication (HTTP mode only)
|
|
33
|
+
*/
|
|
34
|
+
export declare class NetworkError extends DeltaEngineError {
|
|
35
|
+
readonly statusCode?: number;
|
|
36
|
+
readonly response?: unknown;
|
|
37
|
+
constructor(message: string, statusCode?: number, response?: unknown);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Error thrown when configuration is invalid
|
|
41
|
+
*/
|
|
42
|
+
export declare class ConfigurationError extends DeltaEngineError {
|
|
43
|
+
constructor(message: string);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAK5B;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,gBAAgB;IACnD,SAAgB,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;gBAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAM;CAMpF;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,SAAgB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClC,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEpB,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAOhE;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpC,SAAgB,QAAQ,CAAC,EAAE,OAAO,CAAC;gBAEvB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO;CAOrE;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,gBAAgB;gBAC1C,OAAO,EAAE,MAAM;CAK5B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Custom Error Classes for Delta Engine SDK
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ConfigurationError = exports.NetworkError = exports.ExecutionError = exports.ValidationError = exports.DeltaEngineError = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Base error class for all Delta Engine SDK errors
|
|
9
|
+
*/
|
|
10
|
+
class DeltaEngineError extends Error {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = 'DeltaEngineError';
|
|
14
|
+
Object.setPrototypeOf(this, DeltaEngineError.prototype);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DeltaEngineError = DeltaEngineError;
|
|
18
|
+
/**
|
|
19
|
+
* Error thrown when bundle or receipt validation fails
|
|
20
|
+
*/
|
|
21
|
+
class ValidationError extends DeltaEngineError {
|
|
22
|
+
errors;
|
|
23
|
+
constructor(message, errors = []) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = 'ValidationError';
|
|
26
|
+
this.errors = errors;
|
|
27
|
+
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ValidationError = ValidationError;
|
|
31
|
+
/**
|
|
32
|
+
* Error thrown during engine execution
|
|
33
|
+
*/
|
|
34
|
+
class ExecutionError extends DeltaEngineError {
|
|
35
|
+
exitCode;
|
|
36
|
+
stderr;
|
|
37
|
+
constructor(message, exitCode, stderr) {
|
|
38
|
+
super(message);
|
|
39
|
+
this.name = 'ExecutionError';
|
|
40
|
+
this.exitCode = exitCode;
|
|
41
|
+
this.stderr = stderr;
|
|
42
|
+
Object.setPrototypeOf(this, ExecutionError.prototype);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.ExecutionError = ExecutionError;
|
|
46
|
+
/**
|
|
47
|
+
* Error thrown during HTTP API communication (HTTP mode only)
|
|
48
|
+
*/
|
|
49
|
+
class NetworkError extends DeltaEngineError {
|
|
50
|
+
statusCode;
|
|
51
|
+
response;
|
|
52
|
+
constructor(message, statusCode, response) {
|
|
53
|
+
super(message);
|
|
54
|
+
this.name = 'NetworkError';
|
|
55
|
+
this.statusCode = statusCode;
|
|
56
|
+
this.response = response;
|
|
57
|
+
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.NetworkError = NetworkError;
|
|
61
|
+
/**
|
|
62
|
+
* Error thrown when configuration is invalid
|
|
63
|
+
*/
|
|
64
|
+
class ConfigurationError extends DeltaEngineError {
|
|
65
|
+
constructor(message) {
|
|
66
|
+
super(message);
|
|
67
|
+
this.name = 'ConfigurationError';
|
|
68
|
+
Object.setPrototypeOf(this, ConfigurationError.prototype);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.ConfigurationError = ConfigurationError;
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;GAEG;AACH,MAAa,gBAAiB,SAAQ,KAAK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CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACF;AAXD,oCAWC;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,gBAAgB;IACtD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;CACF;AAND,gDAMC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @uvrn/sdk
|
|
3
|
+
*
|
|
4
|
+
* TypeScript SDK for interacting with Loosechain Delta Engine
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export { DeltaEngineClient } from './client';
|
|
9
|
+
export { BundleBuilder } from './builder';
|
|
10
|
+
export { validateBundle, validateReceipt, verifyReceiptHash, replayReceipt } from './validators';
|
|
11
|
+
export { DeltaEngineError, ValidationError, ExecutionError, NetworkError, ConfigurationError } from './errors';
|
|
12
|
+
export type { MetricPoint, DataSpec, DeltaBundle, DeltaRound, Outcome, DeltaReceipt, CoreValidationResult, CoreVerifyResult, EngineOpts, ClientMode, ClientOptions, ValidationError as ValidationErrorType, ValidationResult, VerificationResult, ReplayResult, BundleBuilderOptions } from './types';
|
|
13
|
+
export { DeltaEngineClient as default } from './client';
|
|
14
|
+
/**
|
|
15
|
+
* Package version
|
|
16
|
+
*/
|
|
17
|
+
export declare const VERSION = "1.0.0";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAGlB,YAAY,EAEV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,UAAU,EACV,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EAGV,UAAU,EACV,aAAa,EACb,eAAe,IAAI,mBAAmB,EACtC,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @uvrn/sdk
|
|
4
|
+
*
|
|
5
|
+
* TypeScript SDK for interacting with Loosechain Delta Engine
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.VERSION = exports.default = exports.ConfigurationError = exports.NetworkError = exports.ExecutionError = exports.ValidationError = exports.DeltaEngineError = exports.replayReceipt = exports.verifyReceiptHash = exports.validateReceipt = exports.validateBundle = exports.BundleBuilder = exports.DeltaEngineClient = void 0;
|
|
11
|
+
// Export main client
|
|
12
|
+
var client_1 = require("./client");
|
|
13
|
+
Object.defineProperty(exports, "DeltaEngineClient", { enumerable: true, get: function () { return client_1.DeltaEngineClient; } });
|
|
14
|
+
// Export builder utility
|
|
15
|
+
var builder_1 = require("./builder");
|
|
16
|
+
Object.defineProperty(exports, "BundleBuilder", { enumerable: true, get: function () { return builder_1.BundleBuilder; } });
|
|
17
|
+
// Export validators
|
|
18
|
+
var validators_1 = require("./validators");
|
|
19
|
+
Object.defineProperty(exports, "validateBundle", { enumerable: true, get: function () { return validators_1.validateBundle; } });
|
|
20
|
+
Object.defineProperty(exports, "validateReceipt", { enumerable: true, get: function () { return validators_1.validateReceipt; } });
|
|
21
|
+
Object.defineProperty(exports, "verifyReceiptHash", { enumerable: true, get: function () { return validators_1.verifyReceiptHash; } });
|
|
22
|
+
Object.defineProperty(exports, "replayReceipt", { enumerable: true, get: function () { return validators_1.replayReceipt; } });
|
|
23
|
+
// Export error classes
|
|
24
|
+
var errors_1 = require("./errors");
|
|
25
|
+
Object.defineProperty(exports, "DeltaEngineError", { enumerable: true, get: function () { return errors_1.DeltaEngineError; } });
|
|
26
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_1.ValidationError; } });
|
|
27
|
+
Object.defineProperty(exports, "ExecutionError", { enumerable: true, get: function () { return errors_1.ExecutionError; } });
|
|
28
|
+
Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return errors_1.NetworkError; } });
|
|
29
|
+
Object.defineProperty(exports, "ConfigurationError", { enumerable: true, get: function () { return errors_1.ConfigurationError; } });
|
|
30
|
+
// Export default
|
|
31
|
+
var client_2 = require("./client");
|
|
32
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return client_2.DeltaEngineClient; } });
|
|
33
|
+
/**
|
|
34
|
+
* Package version
|
|
35
|
+
*/
|
|
36
|
+
exports.VERSION = '1.0.0';
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,qBAAqB;AACrB,mCAA6C;AAApC,2GAAA,iBAAiB,OAAA;AAE1B,yBAAyB;AACzB,qCAA0C;AAAjC,wGAAA,aAAa,OAAA;AAEtB,oBAAoB;AACpB,2CAKsB;AAJpB,4GAAA,cAAc,OAAA;AACd,6GAAA,eAAe,OAAA;AACf,+GAAA,iBAAiB,OAAA;AACjB,2GAAA,aAAa,OAAA;AAGf,uBAAuB;AACvB,mCAMkB;AALhB,0GAAA,gBAAgB,OAAA;AAChB,yGAAA,eAAe,OAAA;AACf,wGAAA,cAAc,OAAA;AACd,sGAAA,YAAY,OAAA;AACZ,4GAAA,kBAAkB,OAAA;AA0BpB,iBAAiB;AACjB,mCAAwD;AAA/C,iGAAA,iBAAiB,OAAW;AAErC;;GAEG;AACU,QAAA,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type Exports for Delta Engine SDK
|
|
3
|
+
*
|
|
4
|
+
* Re-exports core types from uvrn-core and SDK-specific types
|
|
5
|
+
*/
|
|
6
|
+
export type {
|
|
7
|
+
/**
|
|
8
|
+
* A single metric data point with key, value, and optional metadata
|
|
9
|
+
*/
|
|
10
|
+
MetricPoint,
|
|
11
|
+
/**
|
|
12
|
+
* Specification for a data source containing metrics
|
|
13
|
+
*/
|
|
14
|
+
DataSpec,
|
|
15
|
+
/**
|
|
16
|
+
* Complete bundle submitted to Delta Engine for verification
|
|
17
|
+
*/
|
|
18
|
+
DeltaBundle,
|
|
19
|
+
/**
|
|
20
|
+
* Information about a single engine execution round
|
|
21
|
+
*/
|
|
22
|
+
DeltaRound,
|
|
23
|
+
/**
|
|
24
|
+
* Final outcome of engine execution: 'consensus' or 'indeterminate'
|
|
25
|
+
*/
|
|
26
|
+
Outcome,
|
|
27
|
+
/**
|
|
28
|
+
* Receipt produced by Delta Engine after processing a bundle
|
|
29
|
+
*/
|
|
30
|
+
DeltaReceipt,
|
|
31
|
+
/**
|
|
32
|
+
* Result of validation operations
|
|
33
|
+
*/
|
|
34
|
+
ValidationResult as CoreValidationResult,
|
|
35
|
+
/**
|
|
36
|
+
* Result of verification operations
|
|
37
|
+
*/
|
|
38
|
+
VerifyResult as CoreVerifyResult,
|
|
39
|
+
/**
|
|
40
|
+
* Options for engine execution
|
|
41
|
+
*/
|
|
42
|
+
EngineOpts } from '@uvrn/core';
|
|
43
|
+
export type { ClientMode, ClientOptions, ValidationError, ValidationResult, VerificationResult, ReplayResult, BundleBuilderOptions } from './sdk';
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY;AACV;;GAEG;AACH,WAAW;AAEX;;GAEG;AACH,QAAQ;AAER;;GAEG;AACH,WAAW;AAEX;;GAEG;AACH,UAAU;AAEV;;GAEG;AACH,OAAO;AAEP;;GAEG;AACH,YAAY;AAEZ;;GAEG;AACH,gBAAgB,IAAI,oBAAoB;AAExC;;GAEG;AACH,YAAY,IAAI,gBAAgB;AAEhC;;GAEG;AACH,UAAU,EACX,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACrB,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|