@veramo/cli 4.3.1-next.7 → 4.3.1-unstable.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/bin/veramo.js +1 -1
- package/build/cli.d.ts +13 -13
- package/build/cli.d.ts.map +1 -1
- package/build/cli.js +23 -19
- package/build/cli.js.map +1 -1
- package/build/config.d.ts +1 -1
- package/build/config.d.ts.map +1 -1
- package/build/config.js +27 -17
- package/build/config.js.map +1 -1
- package/build/credential.js +69 -32
- package/build/credential.js.map +1 -1
- package/build/dev.js +62 -40
- package/build/dev.js.map +1 -1
- package/build/did.js +84 -70
- package/build/did.js.map +1 -1
- package/build/discover.js +20 -9
- package/build/discover.js.map +1 -1
- package/build/execute.js +30 -16
- package/build/execute.js.map +1 -1
- package/build/explore/credentials.d.ts +1 -1
- package/build/explore/credentials.d.ts.map +1 -1
- package/build/explore/credentials.js +37 -19
- package/build/explore/credentials.js.map +1 -1
- package/build/explore/index.js +19 -9
- package/build/explore/index.js.map +1 -1
- package/build/explore/main.d.ts +1 -1
- package/build/explore/main.d.ts.map +1 -1
- package/build/explore/main.js +42 -24
- package/build/explore/main.js.map +1 -1
- package/build/explore/managed-identifiers.d.ts +1 -1
- package/build/explore/managed-identifiers.d.ts.map +1 -1
- package/build/explore/managed-identifiers.js +32 -14
- package/build/explore/managed-identifiers.js.map +1 -1
- package/build/explore/messages.d.ts +1 -1
- package/build/explore/messages.d.ts.map +1 -1
- package/build/explore/messages.js +31 -13
- package/build/explore/messages.js.map +1 -1
- package/build/explore/presentations.d.ts +1 -1
- package/build/explore/presentations.d.ts.map +1 -1
- package/build/explore/presentations.js +37 -19
- package/build/explore/presentations.js.map +1 -1
- package/build/explore/styles.js +4 -1
- package/build/explore/styles.js.map +1 -1
- package/build/explore/utils.js +17 -8
- package/build/explore/utils.js.map +1 -1
- package/build/lib/agentCreator.js +7 -3
- package/build/lib/agentCreator.js.map +1 -1
- package/build/lib/objectCreator.d.ts +1 -1
- package/build/lib/objectCreator.d.ts.map +1 -1
- package/build/lib/objectCreator.js +28 -21
- package/build/lib/objectCreator.js.map +1 -1
- package/build/message.js +19 -8
- package/build/message.js.map +1 -1
- package/build/presentation.js +71 -34
- package/build/presentation.js.map +1 -1
- package/build/sdr.js +68 -50
- package/build/sdr.js.map +1 -1
- package/build/server.js +25 -11
- package/build/server.js.map +1 -1
- package/build/setup.d.ts +1 -0
- package/build/setup.d.ts.map +1 -1
- package/build/setup.js +17 -8
- package/build/setup.js.map +1 -1
- package/build/util.js +32 -17
- package/build/util.js.map +1 -1
- package/build/version.d.ts.map +1 -1
- package/build/version.js +5 -6
- package/build/version.js.map +1 -1
- package/default/default.yml +1 -1
- package/package.json +31 -38
- package/src/cli.ts +14 -15
- package/src/config.ts +4 -5
- package/src/credential.ts +3 -3
- package/src/dev.ts +3 -8
- package/src/did.ts +1 -1
- package/src/discover.ts +1 -1
- package/src/execute.ts +4 -4
- package/src/explore/credentials.ts +3 -3
- package/src/explore/index.ts +3 -4
- package/src/explore/main.ts +6 -6
- package/src/explore/managed-identifiers.ts +3 -3
- package/src/explore/messages.ts +3 -3
- package/src/explore/presentations.ts +3 -3
- package/src/lib/agentCreator.ts +1 -1
- package/src/lib/objectCreator.ts +14 -14
- package/src/message.ts +2 -2
- package/src/presentation.ts +2 -2
- package/src/sdr.ts +3 -3
- package/src/server.ts +3 -3
- package/src/setup.ts +3 -2
- package/src/version.ts +2 -6
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getCredentialsTable = void 0;
|
|
16
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
17
|
+
const utils_1 = require("./utils");
|
|
18
|
+
const styles_1 = require("./styles");
|
|
19
|
+
const utils_2 = require("@veramo/utils");
|
|
20
|
+
const getCredentialsTable = (agent, screen) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6
21
|
screen.title = 'Credentials';
|
|
7
|
-
const credentialsTable =
|
|
22
|
+
const credentialsTable = blessed_1.default.listtable({
|
|
8
23
|
top: '0',
|
|
9
24
|
left: '0',
|
|
10
25
|
border: 'line',
|
|
@@ -14,21 +29,23 @@ export const getCredentialsTable = async (agent, screen) => {
|
|
|
14
29
|
width: '100%',
|
|
15
30
|
height: '100%',
|
|
16
31
|
mouse: true,
|
|
17
|
-
style: styles.listtable,
|
|
32
|
+
style: styles_1.styles.listtable,
|
|
18
33
|
});
|
|
19
|
-
const credentials =
|
|
34
|
+
const credentials = yield agent.dataStoreORMGetVerifiableCredentials();
|
|
20
35
|
credentialsTable.setData([['Created', 'Type', 'From', 'To']].concat(credentials.map(({ verifiableCredential: m }) => [
|
|
21
|
-
shortDate(m.issuanceDate),
|
|
22
|
-
asArray(m.type || []).join(','),
|
|
23
|
-
shortDid(extractIssuer(m)),
|
|
24
|
-
shortDid(m.credentialSubject.id),
|
|
36
|
+
(0, utils_1.shortDate)(m.issuanceDate),
|
|
37
|
+
(0, utils_2.asArray)(m.type || []).join(','),
|
|
38
|
+
(0, utils_1.shortDid)((0, utils_2.extractIssuer)(m)),
|
|
39
|
+
(0, utils_1.shortDid)(m.credentialSubject.id),
|
|
25
40
|
])));
|
|
26
|
-
credentialsTable.on('select',
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
credentialsTable.on('select', function (data) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const i = credentialsTable.getItemIndex(data);
|
|
44
|
+
showCredential(credentials[i - 1]);
|
|
45
|
+
});
|
|
29
46
|
});
|
|
30
47
|
function showCredential(credential) {
|
|
31
|
-
const credentialBox =
|
|
48
|
+
const credentialBox = blessed_1.default.box({
|
|
32
49
|
label: 'Credential',
|
|
33
50
|
top: 'center',
|
|
34
51
|
left: 'center',
|
|
@@ -53,7 +70,7 @@ export const getCredentialsTable = async (agent, screen) => {
|
|
|
53
70
|
content: JSON.stringify(credential, null, 2),
|
|
54
71
|
});
|
|
55
72
|
credentialBox.key(['c'], function (ch, key) {
|
|
56
|
-
var messageBox =
|
|
73
|
+
var messageBox = blessed_1.default.message({
|
|
57
74
|
parent: screen,
|
|
58
75
|
top: 'center',
|
|
59
76
|
left: 'center',
|
|
@@ -65,7 +82,7 @@ export const getCredentialsTable = async (agent, screen) => {
|
|
|
65
82
|
fg: 'green'
|
|
66
83
|
},
|
|
67
84
|
});
|
|
68
|
-
const success = copyToClipboard(JSON.stringify(credential, null, 2));
|
|
85
|
+
const success = (0, utils_1.copyToClipboard)(JSON.stringify(credential, null, 2));
|
|
69
86
|
const message = success ? 'Copied to clipboard.' : 'Could not copy to clipboard.';
|
|
70
87
|
messageBox.display(message, () => { });
|
|
71
88
|
});
|
|
@@ -78,5 +95,6 @@ export const getCredentialsTable = async (agent, screen) => {
|
|
|
78
95
|
screen.render();
|
|
79
96
|
}
|
|
80
97
|
return credentialsTable;
|
|
81
|
-
};
|
|
98
|
+
});
|
|
99
|
+
exports.getCredentialsTable = getCredentialsTable;
|
|
82
100
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/explore/credentials.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/explore/credentials.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA0C;AAE1C,mCAA8D;AAE9D,qCAAiC;AACjC,yCAAsD;AAE/C,MAAM,mBAAmB,GAAG,CAAO,KAAsB,EAAE,MAAsB,EAAE,EAAE;IAC1F,MAAM,CAAC,KAAK,GAAG,aAAa,CAAA;IAE5B,MAAM,gBAAgB,GAAG,iBAAO,CAAC,SAAS,CAAC;QACzC,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,eAAM,CAAC,SAAS;KACxB,CAAC,CAAA;IAEF,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,oCAAoC,EAAE,CAAA;IACtE,gBAAgB,CAAC,OAAO,CACtB,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CACxC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAC/C,IAAA,iBAAS,EAAC,CAAC,CAAC,YAAY,CAAC;QACzB,IAAA,eAAO,EAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/B,IAAA,gBAAQ,EAAC,IAAA,qBAAa,EAAC,CAAC,CAAC,CAAC;QAC1B,IAAA,gBAAQ,EAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC;KACjC,CAAC,CACH,CACF,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A,uBAAe,EAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;YACpE,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,8BAA8B,CAAA;YACjF,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;QACF,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,EAAE,GAAG;YAC7C,aAAa,CAAC,OAAO,EAAE,CAAA;YACvB,MAAM,CAAC,MAAM,EAAE,CAAA;QACjB,CAAC,CAAC,CAAA;QAEF,aAAa,CAAC,KAAK,EAAE,CAAA;QACrB,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;QAC5B,MAAM,CAAC,MAAM,EAAE,CAAA;IACjB,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA,CAAA;AAvFY,QAAA,mBAAmB,uBAuF/B"}
|
package/build/explore/index.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const setup_1 = require("../setup");
|
|
13
|
+
const commander_1 = require("commander");
|
|
14
|
+
const main_1 = require("./main");
|
|
15
|
+
commander_1.program
|
|
6
16
|
.command('explore')
|
|
7
17
|
.description('launch Verifiable Data explorer')
|
|
8
|
-
.action(
|
|
9
|
-
const agent = getAgent(program.opts().config);
|
|
10
|
-
|
|
11
|
-
});
|
|
18
|
+
.action((cmd) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const agent = (0, setup_1.getAgent)(commander_1.program.opts().config);
|
|
20
|
+
yield (0, main_1.renderMainScreen)(agent);
|
|
21
|
+
}));
|
|
12
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/explore/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/explore/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oCAAmC;AACnC,yCAAmC;AACnC,iCAAyC;AAEzC,mBAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,iCAAiC,CAAC;KAC9C,MAAM,CAAC,CAAO,GAAG,EAAE,EAAE;IACpB,MAAM,KAAK,GAAG,IAAA,gBAAQ,EAAC,mBAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,IAAA,uBAAgB,EAAC,KAAK,CAAC,CAAA;AAC/B,CAAC,CAAA,CAAC,CAAA"}
|
package/build/explore/main.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/explore/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/explore/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAU1C,eAAO,MAAM,gBAAgB,UAAiB,eAAe,kBAoD5D,CAAA"}
|
package/build/explore/main.js
CHANGED
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.renderMainScreen = void 0;
|
|
16
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
17
|
+
const styles_1 = require("./styles");
|
|
18
|
+
const managed_identifiers_1 = require("./managed-identifiers");
|
|
19
|
+
const messages_1 = require("./messages");
|
|
20
|
+
const credentials_1 = require("./credentials");
|
|
21
|
+
const presentations_1 = require("./presentations");
|
|
7
22
|
const defaultScreenTitle = 'Agent';
|
|
8
|
-
|
|
23
|
+
const renderMainScreen = (agent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
9
24
|
// Create a screen object.
|
|
10
|
-
const screen =
|
|
25
|
+
const screen = blessed_1.default.screen({
|
|
11
26
|
smartCSR: true,
|
|
12
27
|
});
|
|
13
28
|
screen.title = defaultScreenTitle;
|
|
14
29
|
const mainMenuItems = [
|
|
15
|
-
{ title: 'Managed identifiers', getComponent: getManagedIdentifiersTable },
|
|
16
|
-
{ title: 'Messages', getComponent: getMessagesTable },
|
|
17
|
-
{ title: 'Credentials', getComponent: getCredentialsTable },
|
|
18
|
-
{ title: 'Presentations', getComponent: getPresentationsTable },
|
|
30
|
+
{ title: 'Managed identifiers', getComponent: managed_identifiers_1.getManagedIdentifiersTable },
|
|
31
|
+
{ title: 'Messages', getComponent: messages_1.getMessagesTable },
|
|
32
|
+
{ title: 'Credentials', getComponent: credentials_1.getCredentialsTable },
|
|
33
|
+
{ title: 'Presentations', getComponent: presentations_1.getPresentationsTable },
|
|
19
34
|
];
|
|
20
|
-
const menu =
|
|
35
|
+
const menu = blessed_1.default.list({
|
|
21
36
|
label: 'Agent',
|
|
22
37
|
top: 'center',
|
|
23
38
|
left: 'center',
|
|
@@ -28,20 +43,22 @@ export const renderMainScreen = async (agent) => {
|
|
|
28
43
|
height: '70%',
|
|
29
44
|
vi: true,
|
|
30
45
|
mouse: true,
|
|
31
|
-
style: styles.list,
|
|
46
|
+
style: styles_1.styles.list,
|
|
32
47
|
items: mainMenuItems.map((i) => i.title),
|
|
33
48
|
});
|
|
34
|
-
menu.on('select',
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
component.
|
|
39
|
-
|
|
49
|
+
menu.on('select', function (data) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const i = menu.getItemIndex(data);
|
|
52
|
+
const component = yield mainMenuItems[i].getComponent(agent, screen);
|
|
53
|
+
component.key(['escape'], function (ch, key) {
|
|
54
|
+
component.destroy();
|
|
55
|
+
screen.title = defaultScreenTitle;
|
|
56
|
+
screen.render();
|
|
57
|
+
});
|
|
58
|
+
screen.append(component);
|
|
59
|
+
component.focus();
|
|
40
60
|
screen.render();
|
|
41
61
|
});
|
|
42
|
-
screen.append(component);
|
|
43
|
-
component.focus();
|
|
44
|
-
screen.render();
|
|
45
62
|
});
|
|
46
63
|
screen.append(menu);
|
|
47
64
|
menu.focus();
|
|
@@ -49,5 +66,6 @@ export const renderMainScreen = async (agent) => {
|
|
|
49
66
|
return process.exit(0);
|
|
50
67
|
});
|
|
51
68
|
screen.render();
|
|
52
|
-
};
|
|
69
|
+
});
|
|
70
|
+
exports.renderMainScreen = renderMainScreen;
|
|
53
71
|
//# sourceMappingURL=main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/explore/main.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/explore/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA6B;AAE7B,qCAAiC;AAEjC,+DAAkE;AAClE,yCAA6C;AAC7C,+CAAmD;AACnD,mDAAuD;AAEvD,MAAM,kBAAkB,GAAG,OAAO,CAAA;AAE3B,MAAM,gBAAgB,GAAG,CAAO,KAAsB,EAAE,EAAE;IAC/D,0BAA0B;IAC1B,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,CAAC;QAC5B,QAAQ,EAAE,IAAI;KACf,CAAC,CAAA;IAEF,MAAM,CAAC,KAAK,GAAG,kBAAkB,CAAA;IAEjC,MAAM,aAAa,GAAG;QACpB,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,gDAA0B,EAAE;QAC1E,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,2BAAgB,EAAE;QACrD,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,iCAAmB,EAAE;QAC3D,EAAE,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,qCAAqB,EAAE;KAChE,CAAA;IAED,MAAM,IAAI,GAAG,iBAAO,CAAC,IAAI,CAAC;QACxB,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,QAAQ;QACb,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM;QACd,KA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
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Widgets } from 'blessed';
|
|
2
|
-
import { ConfiguredAgent } from '../setup
|
|
2
|
+
import { ConfiguredAgent } from '../setup';
|
|
3
3
|
export declare const getManagedIdentifiersTable: (agent: ConfiguredAgent, screen: Widgets.Screen) => Promise<Widgets.ListTableElement>;
|
|
4
4
|
//# sourceMappingURL=managed-identifiers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-identifiers.d.ts","sourceRoot":"","sources":["../../src/explore/managed-identifiers.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"managed-identifiers.d.ts","sourceRoot":"","sources":["../../src/explore/managed-identifiers.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,0BAA0B,UAAiB,eAAe,UAAU,cAAc,sCA8E9F,CAAA"}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getManagedIdentifiersTable = void 0;
|
|
16
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
17
|
+
const utils_1 = require("./utils");
|
|
18
|
+
const styles_1 = require("./styles");
|
|
19
|
+
const getManagedIdentifiersTable = (agent, screen) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5
20
|
screen.title = 'Managed identifiers';
|
|
6
|
-
const managedIdentifiersTable =
|
|
21
|
+
const managedIdentifiersTable = blessed_1.default.listtable({
|
|
7
22
|
top: '0',
|
|
8
23
|
left: '0',
|
|
9
24
|
border: 'line',
|
|
@@ -13,16 +28,18 @@ export const getManagedIdentifiersTable = async (agent, screen) => {
|
|
|
13
28
|
width: '100%',
|
|
14
29
|
height: '100%',
|
|
15
30
|
mouse: true,
|
|
16
|
-
style: styles.listtable,
|
|
31
|
+
style: styles_1.styles.listtable,
|
|
17
32
|
});
|
|
18
|
-
const identifiers =
|
|
33
|
+
const identifiers = yield agent.didManagerFind();
|
|
19
34
|
managedIdentifiersTable.setData([['DID', 'Alias']].concat(identifiers.map((i) => [i.did, i.alias || ''])));
|
|
20
|
-
managedIdentifiersTable.on('select',
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
managedIdentifiersTable.on('select', function (data) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const i = managedIdentifiersTable.getItemIndex(data);
|
|
38
|
+
showIdentifier(identifiers[i - 1]);
|
|
39
|
+
});
|
|
23
40
|
});
|
|
24
41
|
function showIdentifier(identifier) {
|
|
25
|
-
const identifierBox =
|
|
42
|
+
const identifierBox = blessed_1.default.box({
|
|
26
43
|
label: identifier.did,
|
|
27
44
|
top: 'center',
|
|
28
45
|
left: 'center',
|
|
@@ -47,7 +64,7 @@ export const getManagedIdentifiersTable = async (agent, screen) => {
|
|
|
47
64
|
content: JSON.stringify(identifier, null, 2),
|
|
48
65
|
});
|
|
49
66
|
identifierBox.key(['c'], function (ch, key) {
|
|
50
|
-
var messageBox =
|
|
67
|
+
var messageBox = blessed_1.default.message({
|
|
51
68
|
parent: screen,
|
|
52
69
|
top: 'center',
|
|
53
70
|
left: 'center',
|
|
@@ -59,7 +76,7 @@ export const getManagedIdentifiersTable = async (agent, screen) => {
|
|
|
59
76
|
fg: 'green'
|
|
60
77
|
},
|
|
61
78
|
});
|
|
62
|
-
const success = copyToClipboard(JSON.stringify(identifier, null, 2));
|
|
79
|
+
const success = (0, utils_1.copyToClipboard)(JSON.stringify(identifier, null, 2));
|
|
63
80
|
const message = success ? 'Copied to clipboard.' : 'Could not copy to clipboard.';
|
|
64
81
|
messageBox.display(message, () => { });
|
|
65
82
|
});
|
|
@@ -72,5 +89,6 @@ export const getManagedIdentifiersTable = async (agent, screen) => {
|
|
|
72
89
|
screen.render();
|
|
73
90
|
}
|
|
74
91
|
return managedIdentifiersTable;
|
|
75
|
-
};
|
|
92
|
+
});
|
|
93
|
+
exports.getManagedIdentifiersTable = getManagedIdentifiersTable;
|
|
76
94
|
//# sourceMappingURL=managed-identifiers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-identifiers.js","sourceRoot":"","sources":["../../src/explore/managed-identifiers.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"managed-identifiers.js","sourceRoot":"","sources":["../../src/explore/managed-identifiers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA0C;AAE1C,mCAAyC;AAEzC,qCAAiC;AAE1B,MAAM,0BAA0B,GAAG,CAAO,KAAsB,EAAE,MAAsB,EAAE,EAAE;IACjG,MAAM,CAAC,KAAK,GAAG,qBAAqB,CAAA;IAEpC,MAAM,uBAAuB,GAAG,iBAAO,CAAC,SAAS,CAAC;QAChD,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,G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import { Widgets } from 'blessed';
|
|
2
|
-
import { ConfiguredAgent } from '../setup
|
|
2
|
+
import { ConfiguredAgent } from '../setup';
|
|
3
3
|
export declare const getMessagesTable: (agent: ConfiguredAgent, screen: Widgets.Screen) => Promise<Widgets.ListTableElement>;
|
|
4
4
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/explore/messages.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/explore/messages.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,gBAAgB,UAAiB,eAAe,UAAU,cAAc,sCAiEpF,CAAA"}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getMessagesTable = void 0;
|
|
16
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
17
|
+
const utils_1 = require("./utils");
|
|
18
|
+
const styles_1 = require("./styles");
|
|
19
|
+
const getMessagesTable = (agent, screen) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5
20
|
screen.title = 'Messages';
|
|
6
|
-
const messageTable =
|
|
21
|
+
const messageTable = blessed_1.default.listtable({
|
|
7
22
|
top: '0',
|
|
8
23
|
left: '0',
|
|
9
24
|
border: 'line',
|
|
@@ -13,16 +28,18 @@ export const getMessagesTable = async (agent, screen) => {
|
|
|
13
28
|
width: '100%',
|
|
14
29
|
height: '100%',
|
|
15
30
|
mouse: true,
|
|
16
|
-
style: styles.listtable,
|
|
31
|
+
style: styles_1.styles.listtable,
|
|
17
32
|
});
|
|
18
|
-
const messages =
|
|
19
|
-
messageTable.setData([['Created', 'Type', 'From', 'To']].concat(messages.map((m) => [shortDate(m.createdAt), m.type, shortDid(m.from), shortDid(m.to)])));
|
|
20
|
-
messageTable.on('select',
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
const messages = yield agent.dataStoreORMGetMessages();
|
|
34
|
+
messageTable.setData([['Created', 'Type', 'From', 'To']].concat(messages.map((m) => [(0, utils_1.shortDate)(m.createdAt), m.type, (0, utils_1.shortDid)(m.from), (0, utils_1.shortDid)(m.to)])));
|
|
35
|
+
messageTable.on('select', function (data) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const i = messageTable.getItemIndex(data);
|
|
38
|
+
showMessage(messages[i - 1]);
|
|
39
|
+
});
|
|
23
40
|
});
|
|
24
41
|
function showMessage(message) {
|
|
25
|
-
const messageBox =
|
|
42
|
+
const messageBox = blessed_1.default.box({
|
|
26
43
|
label: 'Message',
|
|
27
44
|
top: 'center',
|
|
28
45
|
left: 'center',
|
|
@@ -55,5 +72,6 @@ export const getMessagesTable = async (agent, screen) => {
|
|
|
55
72
|
screen.render();
|
|
56
73
|
}
|
|
57
74
|
return messageTable;
|
|
58
|
-
};
|
|
75
|
+
});
|
|
76
|
+
exports.getMessagesTable = getMessagesTable;
|
|
59
77
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/explore/messages.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/explore/messages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA0C;AAE1C,mCAA6C;AAE7C,qCAAiC;AAE1B,MAAM,gBAAgB,GAAG,CAAO,KAAsB,EAAE,MAAsB,EAAE,EAAE;IACvF,MAAM,CAAC,KAAK,GAAG,UAAU,CAAA;IAEzB,MAAM,YAAY,GAAG,iBAAO,CAAC,SAAS,CAAC;QACrC,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,eAAM,CAAC,SAAS;KACxB,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,uBAAuB,EAAE,CAAA;IACtD,YAAY,CAAC,OAAO,CAClB,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CACxC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,iBAAS,EAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAA,gBAAQ,EAAC,CAAC,CAAC,IAAI,CAAC,EAAE,IAAA,gBAAQ,EAAC,CAAC,C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Y,QAAA,gBAAgB,oBAiE5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Widgets } from 'blessed';
|
|
2
|
-
import { ConfiguredAgent } from '../setup
|
|
2
|
+
import { ConfiguredAgent } from '../setup';
|
|
3
3
|
export declare const getPresentationsTable: (agent: ConfiguredAgent, screen: Widgets.Screen) => Promise<Widgets.ListTableElement>;
|
|
4
4
|
//# sourceMappingURL=presentations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentations.d.ts","sourceRoot":"","sources":["../../src/explore/presentations.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"presentations.d.ts","sourceRoot":"","sources":["../../src/explore/presentations.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,eAAO,MAAM,qBAAqB,UAAiB,eAAe,UAAU,cAAc,sCAuFzF,CAAA"}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getPresentationsTable = void 0;
|
|
16
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
17
|
+
const utils_1 = require("./utils");
|
|
18
|
+
const styles_1 = require("./styles");
|
|
19
|
+
const utils_2 = require("@veramo/utils");
|
|
20
|
+
const getPresentationsTable = (agent, screen) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6
21
|
screen.title = 'Presentations';
|
|
7
|
-
const presentationsTable =
|
|
22
|
+
const presentationsTable = blessed_1.default.listtable({
|
|
8
23
|
top: '0',
|
|
9
24
|
left: '0',
|
|
10
25
|
border: 'line',
|
|
@@ -14,21 +29,23 @@ export const getPresentationsTable = async (agent, screen) => {
|
|
|
14
29
|
width: '100%',
|
|
15
30
|
height: '100%',
|
|
16
31
|
mouse: true,
|
|
17
|
-
style: styles.listtable,
|
|
32
|
+
style: styles_1.styles.listtable,
|
|
18
33
|
});
|
|
19
|
-
const presentations =
|
|
34
|
+
const presentations = yield agent.dataStoreORMGetVerifiablePresentations({});
|
|
20
35
|
presentationsTable.setData([['Created', 'Type', 'Holder', 'Verifier']].concat(presentations.map(({ verifiablePresentation: m }) => [
|
|
21
|
-
shortDate(m.issuanceDate),
|
|
22
|
-
asArray(m.type || []).join(','),
|
|
23
|
-
shortDid(m.holder),
|
|
24
|
-
shortDid(asArray(m.verifier || []).join(',')),
|
|
36
|
+
(0, utils_1.shortDate)(m.issuanceDate),
|
|
37
|
+
(0, utils_2.asArray)(m.type || []).join(','),
|
|
38
|
+
(0, utils_1.shortDid)(m.holder),
|
|
39
|
+
(0, utils_1.shortDid)((0, utils_2.asArray)(m.verifier || []).join(',')),
|
|
25
40
|
])));
|
|
26
|
-
presentationsTable.on('select',
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
presentationsTable.on('select', function (data) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const i = presentationsTable.getItemIndex(data);
|
|
44
|
+
showPresentation(presentations[i - 1]);
|
|
45
|
+
});
|
|
29
46
|
});
|
|
30
47
|
function showPresentation(presentation) {
|
|
31
|
-
const presentationBox =
|
|
48
|
+
const presentationBox = blessed_1.default.box({
|
|
32
49
|
label: 'Presentation',
|
|
33
50
|
top: 'center',
|
|
34
51
|
left: 'center',
|
|
@@ -53,7 +70,7 @@ export const getPresentationsTable = async (agent, screen) => {
|
|
|
53
70
|
content: JSON.stringify(presentation, null, 2),
|
|
54
71
|
});
|
|
55
72
|
presentationBox.key(['c'], function (ch, key) {
|
|
56
|
-
var messageBox =
|
|
73
|
+
var messageBox = blessed_1.default.message({
|
|
57
74
|
parent: screen,
|
|
58
75
|
top: 'center',
|
|
59
76
|
left: 'center',
|
|
@@ -65,7 +82,7 @@ export const getPresentationsTable = async (agent, screen) => {
|
|
|
65
82
|
fg: 'green'
|
|
66
83
|
},
|
|
67
84
|
});
|
|
68
|
-
const success = copyToClipboard(JSON.stringify(presentation, null, 2));
|
|
85
|
+
const success = (0, utils_1.copyToClipboard)(JSON.stringify(presentation, null, 2));
|
|
69
86
|
const message = success ? 'Copied to clipboard.' : 'Could not copy to clipboard.';
|
|
70
87
|
messageBox.display(message, () => { });
|
|
71
88
|
});
|
|
@@ -78,5 +95,6 @@ export const getPresentationsTable = async (agent, screen) => {
|
|
|
78
95
|
screen.render();
|
|
79
96
|
}
|
|
80
97
|
return presentationsTable;
|
|
81
|
-
};
|
|
98
|
+
});
|
|
99
|
+
exports.getPresentationsTable = getPresentationsTable;
|
|
82
100
|
//# sourceMappingURL=presentations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentations.js","sourceRoot":"","sources":["../../src/explore/presentations.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"presentations.js","sourceRoot":"","sources":["../../src/explore/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M,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,8BAA8B,CAAA;YACjF,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;QACF,eAAe,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,EAAE,GAAG;YAC/C,eAAe,CAAC,OAAO,EAAE,CAAA;YACzB,MAAM,CAAC,MAAM,EAAE,CAAA;QACjB,CAAC,CAAC,CAAA;QAEF,eAAe,CAAC,KAAK,EAAE,CAAA;QACvB,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;QAC9B,MAAM,CAAC,MAAM,EAAE,CAAA;IACjB,CAAC;IAED,OAAO,kBAAkB,CAAA;AAC3B,CAAC,CAAA,CAAA;AAvFY,QAAA,qBAAqB,yBAuFjC"}
|
package/build/explore/styles.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/explore/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/explore/styles.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,EAAE,EAAE,OAAO;YACX,EAAE,EAAE,MAAM;YACV,MAAM,EAAE;gBACN,EAAE,EAAE,SAAS;aACd;YACD,KAAK,EAAE;gBACL,EAAE,EAAE,OAAO;aACZ;SACF;KACF;IACD,SAAS,EAAE;QACT,MAAM,EAAE;YACN,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,IAAI;SACX;QACD,IAAI,EAAE;YACJ,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE;gBACR,EAAE,EAAE,MAAM;aACX;SACF;KACF;CACF,CAAA"}
|