@cooperation/vc-storage 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +136 -0
- package/dist/index.js +3 -0
- package/dist/models/CredentialEngine.js +187 -0
- package/dist/models/CredentialVerefier.js +36 -0
- package/dist/models/GoogleDriveStorage.js +174 -0
- package/dist/models/StorageContext.js +50 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/CredentialEngine.d.ts +45 -0
- package/dist/types/models/CredentialVerefier.d.ts +9 -0
- package/dist/types/models/GoogleDriveStorage.d.ts +17 -0
- package/dist/types/models/StorageContext.d.ts +0 -0
- package/dist/types/utils/context.d.ts +538 -0
- package/dist/types/utils/saveToGoogle.d.ts +10 -0
- package/dist/utils/context.js +539 -0
- package/dist/utils/saveToGoogle.js +53 -0
- package/package.json +43 -0
@@ -0,0 +1,538 @@
|
|
1
|
+
declare let localOBContext: {
|
2
|
+
'@context': {
|
3
|
+
'@protected': boolean;
|
4
|
+
id: string;
|
5
|
+
type: string;
|
6
|
+
OpenBadgeCredential: {
|
7
|
+
'@id': string;
|
8
|
+
};
|
9
|
+
Achievement: {
|
10
|
+
'@id': string;
|
11
|
+
'@context': {
|
12
|
+
'@protected': boolean;
|
13
|
+
id: string;
|
14
|
+
type: string;
|
15
|
+
achievementType: {
|
16
|
+
'@id': string;
|
17
|
+
};
|
18
|
+
alignment: {
|
19
|
+
'@id': string;
|
20
|
+
'@container': string;
|
21
|
+
};
|
22
|
+
creator: {
|
23
|
+
'@id': string;
|
24
|
+
};
|
25
|
+
creditsAvailable: {
|
26
|
+
'@id': string;
|
27
|
+
'@type': string;
|
28
|
+
};
|
29
|
+
criteria: {
|
30
|
+
'@id': string;
|
31
|
+
'@type': string;
|
32
|
+
};
|
33
|
+
fieldOfStudy: {
|
34
|
+
'@id': string;
|
35
|
+
};
|
36
|
+
humanCode: {
|
37
|
+
'@id': string;
|
38
|
+
};
|
39
|
+
image: {
|
40
|
+
'@id': string;
|
41
|
+
'@type': string;
|
42
|
+
};
|
43
|
+
otherIdentifier: {
|
44
|
+
'@id': string;
|
45
|
+
'@container': string;
|
46
|
+
};
|
47
|
+
related: {
|
48
|
+
'@id': string;
|
49
|
+
'@container': string;
|
50
|
+
};
|
51
|
+
resultDescription: {
|
52
|
+
'@id': string;
|
53
|
+
'@container': string;
|
54
|
+
};
|
55
|
+
specialization: {
|
56
|
+
'@id': string;
|
57
|
+
};
|
58
|
+
tag: {
|
59
|
+
'@id': string;
|
60
|
+
'@container': string;
|
61
|
+
};
|
62
|
+
version: {
|
63
|
+
'@id': string;
|
64
|
+
};
|
65
|
+
inLanguage: {
|
66
|
+
'@id': string;
|
67
|
+
};
|
68
|
+
};
|
69
|
+
};
|
70
|
+
AchievementCredential: {
|
71
|
+
'@id': string;
|
72
|
+
};
|
73
|
+
AchievementSubject: {
|
74
|
+
'@id': string;
|
75
|
+
'@context': {
|
76
|
+
'@protected': boolean;
|
77
|
+
id: string;
|
78
|
+
type: string;
|
79
|
+
achievement: {
|
80
|
+
'@id': string;
|
81
|
+
};
|
82
|
+
activityEndDate: {
|
83
|
+
'@id': string;
|
84
|
+
'@type': string;
|
85
|
+
};
|
86
|
+
activityStartDate: {
|
87
|
+
'@id': string;
|
88
|
+
'@type': string;
|
89
|
+
};
|
90
|
+
creditsEarned: {
|
91
|
+
'@id': string;
|
92
|
+
'@type': string;
|
93
|
+
};
|
94
|
+
identifier: {
|
95
|
+
'@id': string;
|
96
|
+
'@container': string;
|
97
|
+
};
|
98
|
+
image: {
|
99
|
+
'@id': string;
|
100
|
+
'@type': string;
|
101
|
+
};
|
102
|
+
licenseNumber: {
|
103
|
+
'@id': string;
|
104
|
+
};
|
105
|
+
result: {
|
106
|
+
'@id': string;
|
107
|
+
'@container': string;
|
108
|
+
};
|
109
|
+
role: {
|
110
|
+
'@id': string;
|
111
|
+
};
|
112
|
+
source: {
|
113
|
+
'@id': string;
|
114
|
+
'@type': string;
|
115
|
+
};
|
116
|
+
term: {
|
117
|
+
'@id': string;
|
118
|
+
};
|
119
|
+
};
|
120
|
+
};
|
121
|
+
Address: {
|
122
|
+
'@id': string;
|
123
|
+
'@context': {
|
124
|
+
'@protected': boolean;
|
125
|
+
id: string;
|
126
|
+
type: string;
|
127
|
+
addressCountry: {
|
128
|
+
'@id': string;
|
129
|
+
};
|
130
|
+
addressCountryCode: {
|
131
|
+
'@id': string;
|
132
|
+
};
|
133
|
+
addressLocality: {
|
134
|
+
'@id': string;
|
135
|
+
};
|
136
|
+
addressRegion: {
|
137
|
+
'@id': string;
|
138
|
+
};
|
139
|
+
geo: {
|
140
|
+
'@id': string;
|
141
|
+
};
|
142
|
+
postOfficeBoxNumber: {
|
143
|
+
'@id': string;
|
144
|
+
};
|
145
|
+
postalCode: {
|
146
|
+
'@id': string;
|
147
|
+
};
|
148
|
+
streetAddress: {
|
149
|
+
'@id': string;
|
150
|
+
};
|
151
|
+
};
|
152
|
+
};
|
153
|
+
Alignment: {
|
154
|
+
'@id': string;
|
155
|
+
'@context': {
|
156
|
+
'@protected': boolean;
|
157
|
+
id: string;
|
158
|
+
type: string;
|
159
|
+
targetCode: {
|
160
|
+
'@id': string;
|
161
|
+
};
|
162
|
+
targetDescription: {
|
163
|
+
'@id': string;
|
164
|
+
};
|
165
|
+
targetFramework: {
|
166
|
+
'@id': string;
|
167
|
+
};
|
168
|
+
targetName: {
|
169
|
+
'@id': string;
|
170
|
+
};
|
171
|
+
targetType: {
|
172
|
+
'@id': string;
|
173
|
+
};
|
174
|
+
targetUrl: {
|
175
|
+
'@id': string;
|
176
|
+
'@type': string;
|
177
|
+
};
|
178
|
+
};
|
179
|
+
};
|
180
|
+
Criteria: {
|
181
|
+
'@id': string;
|
182
|
+
};
|
183
|
+
EndorsementCredential: {
|
184
|
+
'@id': string;
|
185
|
+
};
|
186
|
+
EndorsementSubject: {
|
187
|
+
'@id': string;
|
188
|
+
'@context': {
|
189
|
+
'@protected': boolean;
|
190
|
+
id: string;
|
191
|
+
type: string;
|
192
|
+
endorsementComment: {
|
193
|
+
'@id': string;
|
194
|
+
};
|
195
|
+
};
|
196
|
+
};
|
197
|
+
Evidence: {
|
198
|
+
'@id': string;
|
199
|
+
'@context': {
|
200
|
+
'@protected': boolean;
|
201
|
+
id: string;
|
202
|
+
type: string;
|
203
|
+
audience: {
|
204
|
+
'@id': string;
|
205
|
+
};
|
206
|
+
genre: {
|
207
|
+
'@id': string;
|
208
|
+
};
|
209
|
+
};
|
210
|
+
};
|
211
|
+
GeoCoordinates: {
|
212
|
+
'@id': string;
|
213
|
+
'@context': {
|
214
|
+
'@protected': boolean;
|
215
|
+
id: string;
|
216
|
+
type: string;
|
217
|
+
latitude: {
|
218
|
+
'@id': string;
|
219
|
+
};
|
220
|
+
longitude: {
|
221
|
+
'@id': string;
|
222
|
+
};
|
223
|
+
};
|
224
|
+
};
|
225
|
+
IdentifierEntry: {
|
226
|
+
'@id': string;
|
227
|
+
'@context': {
|
228
|
+
'@protected': boolean;
|
229
|
+
id: string;
|
230
|
+
type: string;
|
231
|
+
identifier: {
|
232
|
+
'@id': string;
|
233
|
+
};
|
234
|
+
identifierType: {
|
235
|
+
'@id': string;
|
236
|
+
};
|
237
|
+
};
|
238
|
+
};
|
239
|
+
IdentityObject: {
|
240
|
+
'@id': string;
|
241
|
+
'@context': {
|
242
|
+
'@protected': boolean;
|
243
|
+
id: string;
|
244
|
+
type: string;
|
245
|
+
hashed: {
|
246
|
+
'@id': string;
|
247
|
+
'@type': string;
|
248
|
+
};
|
249
|
+
identityHash: {
|
250
|
+
'@id': string;
|
251
|
+
};
|
252
|
+
identityType: {
|
253
|
+
'@id': string;
|
254
|
+
};
|
255
|
+
salt: {
|
256
|
+
'@id': string;
|
257
|
+
};
|
258
|
+
};
|
259
|
+
};
|
260
|
+
Image: {
|
261
|
+
'@id': string;
|
262
|
+
'@context': {
|
263
|
+
'@protected': boolean;
|
264
|
+
id: string;
|
265
|
+
type: string;
|
266
|
+
caption: {
|
267
|
+
'@id': string;
|
268
|
+
};
|
269
|
+
};
|
270
|
+
};
|
271
|
+
Profile: {
|
272
|
+
'@id': string;
|
273
|
+
'@context': {
|
274
|
+
'@protected': boolean;
|
275
|
+
id: string;
|
276
|
+
type: string;
|
277
|
+
additionalName: {
|
278
|
+
'@id': string;
|
279
|
+
};
|
280
|
+
address: {
|
281
|
+
'@id': string;
|
282
|
+
'@type': string;
|
283
|
+
};
|
284
|
+
dateOfBirth: {
|
285
|
+
'@id': string;
|
286
|
+
'@type': string;
|
287
|
+
};
|
288
|
+
email: {
|
289
|
+
'@id': string;
|
290
|
+
};
|
291
|
+
familyName: {
|
292
|
+
'@id': string;
|
293
|
+
};
|
294
|
+
familyNamePrefix: {
|
295
|
+
'@id': string;
|
296
|
+
};
|
297
|
+
givenName: {
|
298
|
+
'@id': string;
|
299
|
+
};
|
300
|
+
honorificPrefix: {
|
301
|
+
'@id': string;
|
302
|
+
};
|
303
|
+
honorificSuffix: {
|
304
|
+
'@id': string;
|
305
|
+
};
|
306
|
+
image: {
|
307
|
+
'@id': string;
|
308
|
+
'@type': string;
|
309
|
+
};
|
310
|
+
otherIdentifier: {
|
311
|
+
'@id': string;
|
312
|
+
'@container': string;
|
313
|
+
};
|
314
|
+
parentOrg: {
|
315
|
+
'@id': string;
|
316
|
+
'@type': string;
|
317
|
+
};
|
318
|
+
patronymicName: {
|
319
|
+
'@id': string;
|
320
|
+
};
|
321
|
+
phone: {
|
322
|
+
'@id': string;
|
323
|
+
};
|
324
|
+
official: {
|
325
|
+
'@id': string;
|
326
|
+
};
|
327
|
+
};
|
328
|
+
};
|
329
|
+
Related: {
|
330
|
+
'@id': string;
|
331
|
+
'@context': {
|
332
|
+
'@protected': boolean;
|
333
|
+
id: string;
|
334
|
+
type: string;
|
335
|
+
version: {
|
336
|
+
'@id': string;
|
337
|
+
};
|
338
|
+
inLanguage: {
|
339
|
+
'@id': string;
|
340
|
+
};
|
341
|
+
};
|
342
|
+
};
|
343
|
+
Result: {
|
344
|
+
'@id': string;
|
345
|
+
'@context': {
|
346
|
+
'@protected': boolean;
|
347
|
+
id: string;
|
348
|
+
type: string;
|
349
|
+
achievedLevel: {
|
350
|
+
'@id': string;
|
351
|
+
'@type': string;
|
352
|
+
};
|
353
|
+
resultDescription: {
|
354
|
+
'@id': string;
|
355
|
+
'@type': string;
|
356
|
+
};
|
357
|
+
status: {
|
358
|
+
'@id': string;
|
359
|
+
};
|
360
|
+
value: {
|
361
|
+
'@id': string;
|
362
|
+
};
|
363
|
+
};
|
364
|
+
};
|
365
|
+
ResultDescription: {
|
366
|
+
'@id': string;
|
367
|
+
'@context': {
|
368
|
+
'@protected': boolean;
|
369
|
+
id: string;
|
370
|
+
type: string;
|
371
|
+
allowedValue: {
|
372
|
+
'@id': string;
|
373
|
+
'@container': string;
|
374
|
+
};
|
375
|
+
requiredLevel: {
|
376
|
+
'@id': string;
|
377
|
+
'@type': string;
|
378
|
+
};
|
379
|
+
requiredValue: {
|
380
|
+
'@id': string;
|
381
|
+
};
|
382
|
+
resultType: {
|
383
|
+
'@id': string;
|
384
|
+
};
|
385
|
+
rubricCriterionLevel: {
|
386
|
+
'@id': string;
|
387
|
+
'@container': string;
|
388
|
+
};
|
389
|
+
valueMax: {
|
390
|
+
'@id': string;
|
391
|
+
};
|
392
|
+
valueMin: {
|
393
|
+
'@id': string;
|
394
|
+
};
|
395
|
+
};
|
396
|
+
};
|
397
|
+
RubricCriterionLevel: {
|
398
|
+
'@id': string;
|
399
|
+
'@context': {
|
400
|
+
'@protected': boolean;
|
401
|
+
id: string;
|
402
|
+
type: string;
|
403
|
+
level: {
|
404
|
+
'@id': string;
|
405
|
+
};
|
406
|
+
points: {
|
407
|
+
'@id': string;
|
408
|
+
};
|
409
|
+
};
|
410
|
+
};
|
411
|
+
alignment: {
|
412
|
+
'@id': string;
|
413
|
+
'@container': string;
|
414
|
+
};
|
415
|
+
description: {
|
416
|
+
'@id': string;
|
417
|
+
};
|
418
|
+
endorsement: {
|
419
|
+
'@id': string;
|
420
|
+
'@container': string;
|
421
|
+
};
|
422
|
+
image: {
|
423
|
+
'@id': string;
|
424
|
+
'@type': string;
|
425
|
+
};
|
426
|
+
inLanguage: {
|
427
|
+
'@id': string;
|
428
|
+
};
|
429
|
+
name: {
|
430
|
+
'@id': string;
|
431
|
+
};
|
432
|
+
narrative: {
|
433
|
+
'@id': string;
|
434
|
+
};
|
435
|
+
url: {
|
436
|
+
'@id': string;
|
437
|
+
'@type': string;
|
438
|
+
};
|
439
|
+
awardedDate: {
|
440
|
+
'@id': string;
|
441
|
+
'@type': string;
|
442
|
+
};
|
443
|
+
};
|
444
|
+
};
|
445
|
+
declare let localED25519Context: {
|
446
|
+
'@context': {
|
447
|
+
id: string;
|
448
|
+
type: string;
|
449
|
+
'@protected': boolean;
|
450
|
+
proof: {
|
451
|
+
'@id': string;
|
452
|
+
'@type': string;
|
453
|
+
'@container': string;
|
454
|
+
};
|
455
|
+
Ed25519VerificationKey2020: {
|
456
|
+
'@id': string;
|
457
|
+
'@context': {
|
458
|
+
'@protected': boolean;
|
459
|
+
id: string;
|
460
|
+
type: string;
|
461
|
+
controller: {
|
462
|
+
'@id': string;
|
463
|
+
'@type': string;
|
464
|
+
};
|
465
|
+
revoked: {
|
466
|
+
'@id': string;
|
467
|
+
'@type': string;
|
468
|
+
};
|
469
|
+
publicKeyMultibase: {
|
470
|
+
'@id': string;
|
471
|
+
'@type': string;
|
472
|
+
};
|
473
|
+
};
|
474
|
+
};
|
475
|
+
Ed25519Signature2020: {
|
476
|
+
'@id': string;
|
477
|
+
'@context': {
|
478
|
+
'@protected': boolean;
|
479
|
+
id: string;
|
480
|
+
type: string;
|
481
|
+
challenge: string;
|
482
|
+
created: {
|
483
|
+
'@id': string;
|
484
|
+
'@type': string;
|
485
|
+
};
|
486
|
+
domain: string;
|
487
|
+
expires: {
|
488
|
+
'@id': string;
|
489
|
+
'@type': string;
|
490
|
+
};
|
491
|
+
nonce: string;
|
492
|
+
proofPurpose: {
|
493
|
+
'@id': string;
|
494
|
+
'@type': string;
|
495
|
+
'@context': {
|
496
|
+
'@protected': boolean;
|
497
|
+
id: string;
|
498
|
+
type: string;
|
499
|
+
assertionMethod: {
|
500
|
+
'@id': string;
|
501
|
+
'@type': string;
|
502
|
+
'@container': string;
|
503
|
+
};
|
504
|
+
authentication: {
|
505
|
+
'@id': string;
|
506
|
+
'@type': string;
|
507
|
+
'@container': string;
|
508
|
+
};
|
509
|
+
capabilityInvocation: {
|
510
|
+
'@id': string;
|
511
|
+
'@type': string;
|
512
|
+
'@container': string;
|
513
|
+
};
|
514
|
+
capabilityDelegation: {
|
515
|
+
'@id': string;
|
516
|
+
'@type': string;
|
517
|
+
'@container': string;
|
518
|
+
};
|
519
|
+
keyAgreement: {
|
520
|
+
'@id': string;
|
521
|
+
'@type': string;
|
522
|
+
'@container': string;
|
523
|
+
};
|
524
|
+
};
|
525
|
+
};
|
526
|
+
proofValue: {
|
527
|
+
'@id': string;
|
528
|
+
'@type': string;
|
529
|
+
};
|
530
|
+
verificationMethod: {
|
531
|
+
'@id': string;
|
532
|
+
'@type': string;
|
533
|
+
};
|
534
|
+
};
|
535
|
+
};
|
536
|
+
};
|
537
|
+
};
|
538
|
+
export { localOBContext, localED25519Context };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* Save data to Google Drive in the specified folder type.
|
3
|
+
* @param {object} data - The data to save.
|
4
|
+
* @param {'VC' | 'DID' | 'UnsignedVC'} type - The type of data being saved.
|
5
|
+
* @throws Will throw an error if the save operation fails.
|
6
|
+
*/
|
7
|
+
import { GoogleDriveStorage } from '../models/GoogleDriveStorage';
|
8
|
+
export declare function saveToGoogleDrive(storage: GoogleDriveStorage, data: any, type: 'VC' | 'DID' | 'UnsignedVC' | 'SESSION'): Promise<{
|
9
|
+
id: string;
|
10
|
+
}>;
|