@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.33.1-feature.vcdm2.tsup.32 → 0.33.1-next.3
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/dist/agent/DidAuthSiopOpAuthenticator.d.ts +36 -0
- package/dist/agent/DidAuthSiopOpAuthenticator.d.ts.map +1 -0
- package/dist/agent/DidAuthSiopOpAuthenticator.js +392 -0
- package/dist/agent/DidAuthSiopOpAuthenticator.js.map +1 -0
- package/dist/index.d.ts +8 -555
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -2420
- package/dist/index.js.map +1 -1
- package/dist/link-handler/index.d.ts +22 -0
- package/dist/link-handler/index.d.ts.map +1 -0
- package/dist/link-handler/index.js +57 -0
- package/dist/link-handler/index.js.map +1 -0
- package/dist/localization/Localization.d.ts +9 -0
- package/dist/localization/Localization.d.ts.map +1 -0
- package/dist/localization/Localization.js +46 -0
- package/dist/localization/Localization.js.map +1 -0
- package/dist/localization/translations/en.json +9 -0
- package/dist/localization/translations/nl.json +8 -0
- package/dist/machine/CallbackStateListener.d.ts +3 -0
- package/dist/machine/CallbackStateListener.d.ts.map +1 -0
- package/dist/machine/CallbackStateListener.js +48 -0
- package/dist/machine/CallbackStateListener.js.map +1 -0
- package/dist/machine/Siopv2Machine.d.ts +8 -0
- package/dist/machine/Siopv2Machine.d.ts.map +1 -0
- package/dist/machine/Siopv2Machine.js +364 -0
- package/dist/machine/Siopv2Machine.js.map +1 -0
- package/dist/services/IdentifierService.d.ts +3 -0
- package/dist/services/IdentifierService.d.ts.map +1 -0
- package/dist/services/IdentifierService.js +28 -0
- package/dist/services/IdentifierService.js.map +1 -0
- package/dist/services/Siopv2MachineService.d.ts +18 -0
- package/dist/services/Siopv2MachineService.d.ts.map +1 -0
- package/dist/services/Siopv2MachineService.js +299 -0
- package/dist/services/Siopv2MachineService.js.map +1 -0
- package/dist/session/OID4VP.d.ts +72 -0
- package/dist/session/OID4VP.d.ts.map +1 -0
- package/dist/session/OID4VP.js +224 -0
- package/dist/session/OID4VP.js.map +1 -0
- package/dist/session/OpSession.d.ts +39 -0
- package/dist/session/OpSession.d.ts.map +1 -0
- package/dist/session/OpSession.js +365 -0
- package/dist/session/OpSession.js.map +1 -0
- package/dist/session/functions.d.ts +37 -0
- package/dist/session/functions.d.ts.map +1 -0
- package/dist/session/functions.js +163 -0
- package/dist/session/functions.js.map +1 -0
- package/dist/session/index.d.ts +4 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +20 -0
- package/dist/session/index.js.map +1 -0
- package/dist/types/IDidAuthSiopOpAuthenticator.d.ts +120 -0
- package/dist/types/IDidAuthSiopOpAuthenticator.d.ts.map +1 -0
- package/dist/types/IDidAuthSiopOpAuthenticator.js +10 -0
- package/dist/types/IDidAuthSiopOpAuthenticator.js.map +1 -0
- package/dist/types/error/index.d.ts +8 -0
- package/dist/types/error/index.d.ts.map +1 -0
- package/dist/types/error/index.js +3 -0
- package/dist/types/error/index.js.map +1 -0
- package/dist/types/identifier/index.d.ts +53 -0
- package/dist/types/identifier/index.d.ts.map +1 -0
- package/dist/types/identifier/index.js +5 -0
- package/dist/types/identifier/index.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +22 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/machine/index.d.ts +124 -0
- package/dist/types/machine/index.d.ts.map +1 -0
- package/dist/types/machine/index.js +57 -0
- package/dist/types/machine/index.js.map +1 -0
- package/dist/types/siop-service/index.d.ts +80 -0
- package/dist/types/siop-service/index.d.ts.map +1 -0
- package/dist/types/siop-service/index.js +14 -0
- package/dist/types/siop-service/index.js.map +1 -0
- package/dist/utils/CredentialUtils.d.ts +23 -0
- package/dist/utils/CredentialUtils.d.ts.map +1 -0
- package/dist/utils/CredentialUtils.js +65 -0
- package/dist/utils/CredentialUtils.js.map +1 -0
- package/dist/utils/dcql.d.ts +5 -0
- package/dist/utils/dcql.d.ts.map +1 -0
- package/dist/utils/dcql.js +37 -0
- package/dist/utils/dcql.js.map +1 -0
- package/package.json +30 -41
- package/src/agent/DidAuthSiopOpAuthenticator.ts +14 -13
- package/src/session/OpSession.ts +13 -13
- package/dist/index.cjs +0 -2451
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -559
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
exports.Siopv2OID4VPLinkHandler = void 0;
|
|
13
|
+
const ssi_sdk_agent_config_1 = require("@sphereon/ssi-sdk.agent-config");
|
|
14
|
+
const ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
|
|
15
|
+
const ssi_sdk_xstate_machine_persistence_1 = require("@sphereon/ssi-sdk.xstate-machine-persistence");
|
|
16
|
+
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
17
|
+
const types_1 = require("../types");
|
|
18
|
+
const logger = ssi_types_1.Loggers.DEFAULT.options(types_1.LOGGER_NAMESPACE, {}).get(types_1.LOGGER_NAMESPACE);
|
|
19
|
+
class Siopv2OID4VPLinkHandler extends ssi_sdk_core_1.LinkHandlerAdapter {
|
|
20
|
+
constructor(args) {
|
|
21
|
+
super(Object.assign(Object.assign({}, args), { id: 'Siopv2' }));
|
|
22
|
+
this.context = args.context;
|
|
23
|
+
this.noStateMachinePersistence = args.noStateMachinePersistence === true;
|
|
24
|
+
this.stateNavigationListener = args.stateNavigationListener;
|
|
25
|
+
this.idOpts = args.idOpts;
|
|
26
|
+
}
|
|
27
|
+
handle(url, opts) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
var _a;
|
|
30
|
+
logger.debug(`handling SIOP link: ${url}`);
|
|
31
|
+
const siopv2Machine = yield this.context.agent.siopGetMachineInterpreter({
|
|
32
|
+
url,
|
|
33
|
+
idOpts: (_a = opts === null || opts === void 0 ? void 0 : opts.idOpts) !== null && _a !== void 0 ? _a : this.idOpts,
|
|
34
|
+
stateNavigationListener: this.stateNavigationListener,
|
|
35
|
+
});
|
|
36
|
+
const interpreter = siopv2Machine.interpreter;
|
|
37
|
+
if (!this.noStateMachinePersistence && !(opts === null || opts === void 0 ? void 0 : opts.machineState) && (0, ssi_sdk_agent_config_1.contextHasPlugin)(this.context, 'machineStatesFindActive')) {
|
|
38
|
+
const init = yield (0, ssi_sdk_xstate_machine_persistence_1.interpreterStartOrResume)({
|
|
39
|
+
interpreter,
|
|
40
|
+
context: this.context,
|
|
41
|
+
cleanupAllOtherInstances: true,
|
|
42
|
+
cleanupOnFinalState: true,
|
|
43
|
+
singletonCheck: true,
|
|
44
|
+
noRegistration: this.noStateMachinePersistence,
|
|
45
|
+
});
|
|
46
|
+
logger.debug(`SIOP machine started for link: ${url}`, init);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
interpreter.start(opts === null || opts === void 0 ? void 0 : opts.machineState);
|
|
51
|
+
logger.debug(`SIOP machine started for link: ${url}`);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.Siopv2OID4VPLinkHandler = Siopv2OID4VPLinkHandler;
|
|
57
|
+
//# sourceMappingURL=index.js.map
|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AAO,EAAE,yBAAyB,CAAC,EAAE,CAAC;gBACxH,MAAM,IAAI,GAAG,MAAM,IAAA,6DAAwB,EAAC;oBAC1C,WAAW;oBACX,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,wBAAwB,EAAE,IAAI;oBAC9B,mBAAmB,EAAE,IAAI;oBACzB,cAAc,EAAE,IAAI;oBACpB,cAAc,EAAE,IAAI,CAAC,yBAAyB;iBAC/C,CAAC,CAAA;gBACF,MAAM,CAAC,KAAK,CAAC,kCAAkC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAA;YAC7D,CAAC;iBAAM,CAAC;gBACN,aAAa;gBACb,WAAW,CAAC,KAAK,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAC,CAAA;gBACrC,MAAM,CAAC,KAAK,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAA;YACvD,CAAC;QACH,CAAC;KAAA;CACF;AAvDD,0DAuDC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare class Localization {
|
|
2
|
+
private static translationGetters;
|
|
3
|
+
static translate: any;
|
|
4
|
+
private static findSupportedLanguage;
|
|
5
|
+
static getLocale: () => string;
|
|
6
|
+
}
|
|
7
|
+
export declare const translate: any;
|
|
8
|
+
export default Localization;
|
|
9
|
+
//# sourceMappingURL=Localization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Localization.d.ts","sourceRoot":"","sources":["../../src/localization/Localization.ts"],"names":[],"mappings":"AAIA,cAAM,YAAY;IAChB,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAGhC;IAED,OAAc,SAAS,EAAE,GAAG,CAoB3B;IAED,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAQnC;IAED,OAAc,SAAS,QAAO,MAAM,CAEnC;CACF;AAED,eAAO,MAAM,SAAS,KAAyB,CAAA;AAC/C,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
var _a;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.translate = void 0;
|
|
8
|
+
const i18n_js_1 = __importDefault(require("i18n-js"));
|
|
9
|
+
const lodash_memoize_1 = __importDefault(require("lodash.memoize"));
|
|
10
|
+
const types_1 = require("../types");
|
|
11
|
+
class Localization {
|
|
12
|
+
}
|
|
13
|
+
_a = Localization;
|
|
14
|
+
Localization.translationGetters = {
|
|
15
|
+
[types_1.SupportedLanguage.ENGLISH]: () => require('./translations/en.json'),
|
|
16
|
+
[types_1.SupportedLanguage.DUTCH]: () => require('./translations/nl.json'),
|
|
17
|
+
};
|
|
18
|
+
Localization.translate = (0, lodash_memoize_1.default)((key, config) => {
|
|
19
|
+
// If no LocaleProvider is used we need to load the default locale as the translations will be empty
|
|
20
|
+
if (Object.keys(i18n_js_1.default.translations).length === 0) {
|
|
21
|
+
i18n_js_1.default.translations = {
|
|
22
|
+
[types_1.SupportedLanguage.ENGLISH]: _a.translationGetters[types_1.SupportedLanguage.ENGLISH](),
|
|
23
|
+
};
|
|
24
|
+
i18n_js_1.default.locale = types_1.SupportedLanguage.ENGLISH;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
i18n_js_1.default.translations = {
|
|
28
|
+
[i18n_js_1.default.locale]: Object.assign(Object.assign({}, i18n_js_1.default.translations[i18n_js_1.default.locale]), _a.translationGetters[_a.findSupportedLanguage(i18n_js_1.default.locale) || types_1.SupportedLanguage.ENGLISH]()),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return i18n_js_1.default.t(key, config);
|
|
32
|
+
}, (key, config) => (config ? key + JSON.stringify(config) : key));
|
|
33
|
+
Localization.findSupportedLanguage = (locale) => {
|
|
34
|
+
for (const language of Object.values(types_1.SupportedLanguage)) {
|
|
35
|
+
if (language === locale) {
|
|
36
|
+
return language;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
};
|
|
41
|
+
Localization.getLocale = () => {
|
|
42
|
+
return i18n_js_1.default.locale || types_1.SupportedLanguage.ENGLISH;
|
|
43
|
+
};
|
|
44
|
+
exports.translate = Localization.translate;
|
|
45
|
+
exports.default = Localization;
|
|
46
|
+
//# sourceMappingURL=Localization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Localization.js","sourceRoot":"","sources":["../../src/localization/Localization.ts"],"names":[],"mappings":";;;;;;;AAAA,sDAAuD;AACvD,oEAAoC;AACpC,oCAA4C;AAE5C,MAAM,YAAY;;;AACD,+BAAkB,GAAuC;IACtE,CAAC,yBAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,wBAAwB,CAAC;IACpE,CAAC,yBAAiB,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,wBAAwB,CAAC;CACnE,AAHgC,CAGhC;AAEa,sBAAS,GAAQ,IAAA,wBAAO,EACpC,CAAC,GAAU,EAAE,MAAyB,EAAE,EAAE;IACxC,oGAAoG;IACpG,IAAI,MAAM,CAAC,IAAI,CAAC,iBAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,iBAAI,CAAC,YAAY,GAAG;YAClB,CAAC,yBAAiB,CAAC,OAAO,CAAC,EAAE,EAAY,CAAC,kBAAkB,CAAC,yBAAiB,CAAC,OAAO,CAAC,EAAE;SAC1F,CAAA;QACD,iBAAI,CAAC,MAAM,GAAG,yBAAiB,CAAC,OAAO,CAAA;IACzC,CAAC;SAAM,CAAC;QACN,iBAAI,CAAC,YAAY,GAAG;YAClB,CAAC,iBAAI,CAAC,MAAM,CAAC,kCACR,iBAAI,CAAC,YAAY,CAAC,iBAAI,CAAC,MAAM,CAAC,GAC9B,EAAY,CAAC,kBAAkB,CAAC,EAAI,CAAC,qBAAqB,CAAC,iBAAI,CAAC,MAAM,CAAC,IAAI,yBAAiB,CAAC,OAAO,CAAC,EAAE,CAC3G;SACF,CAAA;IACH,CAAC;IAED,OAAO,iBAAI,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AAC5B,CAAC,EACD,CAAC,GAAU,EAAE,MAAyB,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CACzF,AApBsB,CAoBtB;AAEc,kCAAqB,GAAG,CAAC,MAAc,EAAsB,EAAE;IAC5E,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,yBAAiB,CAAC,EAAE,CAAC;QACxD,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YACxB,OAAO,QAAQ,CAAA;QACjB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,AARmC,CAQnC;AAEa,sBAAS,GAAG,GAAW,EAAE;IACrC,OAAO,iBAAI,CAAC,MAAM,IAAI,yBAAiB,CAAC,OAAO,CAAA;AACjD,CAAC,AAFsB,CAEtB;AAGU,QAAA,SAAS,GAAG,YAAY,CAAC,SAAS,CAAA;AAC/C,kBAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"siopv2_machine_identifier_error_title": "Getting identifier",
|
|
3
|
+
"siopv2_machine_create_config_error_title": "Creating siopV2 config",
|
|
4
|
+
"siopv2_machine_get_request_error_title": "Getting siopV2 request",
|
|
5
|
+
"siopv2_machine_get_selectable_credentials_error_title": "Getting siopV2 selectable credentials",
|
|
6
|
+
"siopv2_machine_retrieve_contact_error_title": "Retrieve contact",
|
|
7
|
+
"siopv2_machine_add_contact_identity_error_title": "Add contact identity",
|
|
8
|
+
"siopv2_machine_send_response_error_title": "Sending siopV2 response"
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"siopv2_machine_identifier_error_title": "Identifier ophalen",
|
|
3
|
+
"siopv2_machine_create_config_error_title": "SiopV2 configuratie maken",
|
|
4
|
+
"siopv2_machine_get_request_error_title": "SiopV2 verzoek ophalen",
|
|
5
|
+
"siopv2_machine_retrieve_contact_error_title": "Ophalen credential",
|
|
6
|
+
"siopv2_machine_add_contact_identity_error_title": "Toevoegen identiteit contact",
|
|
7
|
+
"siopv2_machine_send_response_error_title": "SiopV2 antwoord verzenden"
|
|
8
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Siopv2MachineInterpreter, Siopv2MachineState, Siopv2MachineStates } from '../types';
|
|
2
|
+
export declare const OID4VPCallbackStateListener: (callbacks?: Map<Siopv2MachineStates, (machine: Siopv2MachineInterpreter, state: Siopv2MachineState, opts?: any) => Promise<void>>) => (oid4vciMachine: Siopv2MachineInterpreter, state: Siopv2MachineState) => Promise<void>;
|
|
3
|
+
//# sourceMappingURL=CallbackStateListener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CallbackStateListener.d.ts","sourceRoot":"","sources":["../../src/machine/CallbackStateListener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAO5F,eAAO,MAAM,2BAA2B,eAC1B,GAAG,CAAC,mBAAmB,EAAE,CAAC,OAAO,EAAE,wBAAwB,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,sBAEnG,wBAAwB,SAAS,kBAAkB,KAAG,OAAO,CAAC,IAAI,CA+BjG,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
exports.OID4VPCallbackStateListener = void 0;
|
|
13
|
+
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
14
|
+
const logger = ssi_types_1.Loggers.DEFAULT.options('sphereon:siopv2-oid4vp:op-auth', {
|
|
15
|
+
defaultLogLevel: ssi_types_1.LogLevel.DEBUG,
|
|
16
|
+
methods: [ssi_types_1.LogMethod.CONSOLE],
|
|
17
|
+
}).get('sphereon:siopv2-oid4vp:op-auth');
|
|
18
|
+
const OID4VPCallbackStateListener = (callbacks) => {
|
|
19
|
+
return (oid4vciMachine, state) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
if (state._event.type === 'internal') {
|
|
21
|
+
logger.debug('oid4vpCallbackStateListener: internal event');
|
|
22
|
+
// Make sure we do not navigate when triggered by an internal event. We need to stay on current screen
|
|
23
|
+
// Make sure we do not navigate when state has not changed
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
logger.info(`VP state listener state: ${JSON.stringify(state.value)}`);
|
|
27
|
+
if (!callbacks || callbacks.size === 0) {
|
|
28
|
+
logger.info(`VP no callbacks registered for state: ${JSON.stringify(state.value)}`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
for (const [stateKey, callback] of callbacks) {
|
|
32
|
+
if (state.matches(stateKey)) {
|
|
33
|
+
logger.log(`VP state callback for state: ${JSON.stringify(state.value)}, will execute...`);
|
|
34
|
+
yield callback(oid4vciMachine, state)
|
|
35
|
+
.then(() => logger.log(`VP state callback executed for state: ${JSON.stringify(state.value)}`))
|
|
36
|
+
.catch((error) => {
|
|
37
|
+
logger.error(`VP state callback failed for state: ${JSON.stringify(state.value)}, error: ${JSON.stringify(error === null || error === void 0 ? void 0 : error.message)}, ${JSON.stringify(state.event)}`);
|
|
38
|
+
if (error.stack) {
|
|
39
|
+
logger.error(error.stack);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
exports.OID4VPCallbackStateListener = OID4VPCallbackStateListener;
|
|
48
|
+
//# sourceMappingURL=CallbackStateListener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CallbackStateListener.js","sourceRoot":"","sources":["../../src/machine/CallbackStateListener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAkE;AAGlE,MAAM,MAAM,GAAG,mBAAO,CAAC,OAAO,CAAC,OAAO,CAAC,gCAAgC,EAAE;IACvE,eAAe,EAAE,oBAAQ,CAAC,KAAK;IAC/B,OAAO,EAAE,CAAC,qBAAS,CAAC,OAAO,CAAC;CAC7B,CAAC,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;AAEjC,MAAM,2BAA2B,GAAG,CACzC,SAAiI,EACjI,EAAE;IACF,OAAO,CAAO,cAAwC,EAAE,KAAyB,EAAiB,EAAE;QAClG,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACrC,MAAM,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAA;YAC3D,sGAAsG;YACtG,0DAA0D;YAC1D,OAAM;QACR,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAA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InstanceOpts, Siopv2MachineInterpreter } from '../types';
|
|
2
|
+
export declare const logger: import("@sphereon/ssi-types").ISimpleLogger<unknown>;
|
|
3
|
+
export declare class Siopv2Machine {
|
|
4
|
+
static newInstance(opts: Siopv2MachineInstanceOpts): {
|
|
5
|
+
interpreter: Siopv2MachineInterpreter;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Siopv2Machine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Siopv2Machine.d.ts","sourceRoot":"","sources":["../../src/machine/Siopv2Machine.ts"],"names":[],"mappings":"AAKA,OAAO,EAWL,yBAAyB,EACzB,wBAAwB,EAKzB,MAAM,UAAU,CAAA;AAIjB,eAAO,MAAM,MAAM,sDAAwC,CAAA;AAiX3D,qBAAa,aAAa;IACxB,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,yBAAyB,GAAG;QAAE,WAAW,EAAE,wBAAwB,CAAA;KAAE;CAsC/F"}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Siopv2Machine = exports.logger = void 0;
|
|
4
|
+
const xstate_1 = require("xstate");
|
|
5
|
+
const Localization_1 = require("../localization/Localization");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const types_2 = require("../types");
|
|
8
|
+
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
9
|
+
exports.logger = ssi_types_1.Loggers.DEFAULT.get(types_2.LOGGER_NAMESPACE);
|
|
10
|
+
const Siopv2HasNoContactGuard = (_ctx, _event) => {
|
|
11
|
+
const { contact } = _ctx;
|
|
12
|
+
return contact === undefined;
|
|
13
|
+
};
|
|
14
|
+
const Siopv2HasContactGuard = (_ctx, _event) => {
|
|
15
|
+
const { contact } = _ctx;
|
|
16
|
+
return contact !== undefined;
|
|
17
|
+
};
|
|
18
|
+
const Siopv2HasAuthorizationRequestGuard = (_ctx, _event) => {
|
|
19
|
+
const { authorizationRequestData } = _ctx;
|
|
20
|
+
return authorizationRequestData !== undefined;
|
|
21
|
+
};
|
|
22
|
+
const Siopv2HasSelectableCredentialsAndContactGuard = (_ctx, _event) => {
|
|
23
|
+
const { authorizationRequestData, contact } = _ctx;
|
|
24
|
+
if (!authorizationRequestData) {
|
|
25
|
+
throw new Error('Missing authorization request data in context');
|
|
26
|
+
}
|
|
27
|
+
if (!contact) {
|
|
28
|
+
throw new Error('Missing contact request data in context');
|
|
29
|
+
}
|
|
30
|
+
return authorizationRequestData.presentationDefinitions !== undefined;
|
|
31
|
+
};
|
|
32
|
+
const Siopv2CreateContactGuard = (_ctx, _event) => {
|
|
33
|
+
const { contactAlias, hasContactConsent } = _ctx;
|
|
34
|
+
return hasContactConsent && contactAlias !== undefined && contactAlias.length > 0;
|
|
35
|
+
};
|
|
36
|
+
const Siopv2HasSelectedRequiredCredentialsGuard = (_ctx, _event) => {
|
|
37
|
+
const { authorizationRequestData } = _ctx;
|
|
38
|
+
if (authorizationRequestData === undefined) {
|
|
39
|
+
throw new Error('Missing authorization request data in context');
|
|
40
|
+
}
|
|
41
|
+
if (authorizationRequestData.presentationDefinitions === undefined || authorizationRequestData.presentationDefinitions.length === 0) {
|
|
42
|
+
throw Error('No presentation definitions present');
|
|
43
|
+
}
|
|
44
|
+
// FIXME: Return _ctx.selectedCredentials.length > 0 for now, given this is a really expensive operation and will be called in the next phase anyway
|
|
45
|
+
return _ctx.selectedCredentials.length > 0;
|
|
46
|
+
/*const definitionWithLocation: PresentationDefinitionWithLocation = authorizationRequestData.presentationDefinitions[0];
|
|
47
|
+
const pex: PEX = new PEX();
|
|
48
|
+
const evaluationResults: EvaluationResults = pex.evaluateCredentials(definitionWithLocation.definition, selectedCredentials);
|
|
49
|
+
|
|
50
|
+
return evaluationResults.areRequiredCredentialsPresent === Status.INFO;*/
|
|
51
|
+
};
|
|
52
|
+
const Siopv2IsSiopOnlyGuard = (_ctx, _event) => {
|
|
53
|
+
const { authorizationRequestData } = _ctx;
|
|
54
|
+
if (authorizationRequestData === undefined) {
|
|
55
|
+
throw new Error('Missing authorization request data in context');
|
|
56
|
+
}
|
|
57
|
+
return authorizationRequestData.presentationDefinitions === undefined;
|
|
58
|
+
};
|
|
59
|
+
const Siopv2IsSiopWithOID4VPGuard = (_ctx, _event) => {
|
|
60
|
+
const { authorizationRequestData, selectableCredentialsMap } = _ctx;
|
|
61
|
+
if (!authorizationRequestData) {
|
|
62
|
+
throw new Error('Missing authorization request data in context');
|
|
63
|
+
}
|
|
64
|
+
if (!selectableCredentialsMap) {
|
|
65
|
+
throw new Error('Missing selectableCredentialsMap in context');
|
|
66
|
+
}
|
|
67
|
+
return authorizationRequestData.presentationDefinitions !== undefined;
|
|
68
|
+
};
|
|
69
|
+
const createSiopv2Machine = (opts) => {
|
|
70
|
+
var _a;
|
|
71
|
+
const { url, idOpts } = opts;
|
|
72
|
+
const initialContext = {
|
|
73
|
+
url: new URL(url).toString(),
|
|
74
|
+
hasContactConsent: true,
|
|
75
|
+
contactAlias: '',
|
|
76
|
+
selectedCredentials: [],
|
|
77
|
+
idOpts: idOpts,
|
|
78
|
+
};
|
|
79
|
+
return (0, xstate_1.createMachine)({
|
|
80
|
+
id: (_a = opts === null || opts === void 0 ? void 0 : opts.machineId) !== null && _a !== void 0 ? _a : 'Siopv2',
|
|
81
|
+
predictableActionArguments: true,
|
|
82
|
+
initial: types_1.Siopv2MachineStates.createConfig,
|
|
83
|
+
schema: {
|
|
84
|
+
events: {},
|
|
85
|
+
guards: {},
|
|
86
|
+
services: {},
|
|
87
|
+
},
|
|
88
|
+
context: initialContext,
|
|
89
|
+
states: {
|
|
90
|
+
[types_1.Siopv2MachineStates.createConfig]: {
|
|
91
|
+
id: types_1.Siopv2MachineStates.createConfig,
|
|
92
|
+
invoke: {
|
|
93
|
+
src: types_1.Siopv2MachineServices.createConfig,
|
|
94
|
+
onDone: {
|
|
95
|
+
target: types_1.Siopv2MachineStates.getSiopRequest,
|
|
96
|
+
actions: (0, xstate_1.assign)({
|
|
97
|
+
didAuthConfig: (_ctx, _event) => _event.data,
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
onError: {
|
|
101
|
+
target: types_1.Siopv2MachineStates.handleError,
|
|
102
|
+
actions: (0, xstate_1.assign)({
|
|
103
|
+
error: (_ctx, _event) => ({
|
|
104
|
+
title: (0, Localization_1.translate)('siopv2_machine_create_config_error_title'),
|
|
105
|
+
message: _event.data.message,
|
|
106
|
+
stack: _event.data.stack,
|
|
107
|
+
}),
|
|
108
|
+
}),
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
[types_1.Siopv2MachineStates.getSiopRequest]: {
|
|
113
|
+
id: types_1.Siopv2MachineStates.getSiopRequest,
|
|
114
|
+
invoke: {
|
|
115
|
+
src: types_1.Siopv2MachineServices.getSiopRequest,
|
|
116
|
+
onDone: {
|
|
117
|
+
target: types_1.Siopv2MachineStates.retrieveContact,
|
|
118
|
+
actions: (0, xstate_1.assign)({
|
|
119
|
+
authorizationRequestData: (_ctx, _event) => _event.data,
|
|
120
|
+
}),
|
|
121
|
+
},
|
|
122
|
+
onError: {
|
|
123
|
+
target: types_1.Siopv2MachineStates.handleError,
|
|
124
|
+
actions: (0, xstate_1.assign)({
|
|
125
|
+
error: (_ctx, _event) => ({
|
|
126
|
+
title: (0, Localization_1.translate)('siopv2_machine_get_request_error_title'),
|
|
127
|
+
message: _event.data.message,
|
|
128
|
+
stack: _event.data.stack,
|
|
129
|
+
}),
|
|
130
|
+
}),
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
[types_1.Siopv2MachineStates.retrieveContact]: {
|
|
135
|
+
id: types_1.Siopv2MachineStates.retrieveContact,
|
|
136
|
+
invoke: {
|
|
137
|
+
src: types_1.Siopv2MachineServices.retrieveContact,
|
|
138
|
+
onDone: {
|
|
139
|
+
target: types_1.Siopv2MachineStates.transitionFromSetup,
|
|
140
|
+
actions: (0, xstate_1.assign)({ contact: (_ctx, _event) => _event.data }),
|
|
141
|
+
},
|
|
142
|
+
onError: {
|
|
143
|
+
target: types_1.Siopv2MachineStates.handleError,
|
|
144
|
+
actions: (0, xstate_1.assign)({
|
|
145
|
+
error: (_ctx, _event) => ({
|
|
146
|
+
title: (0, Localization_1.translate)('siopv2_machine_retrieve_contact_error_title'),
|
|
147
|
+
message: _event.data.message,
|
|
148
|
+
stack: _event.data.stack,
|
|
149
|
+
}),
|
|
150
|
+
}),
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
[types_1.Siopv2MachineStates.transitionFromSetup]: {
|
|
155
|
+
id: types_1.Siopv2MachineStates.transitionFromSetup,
|
|
156
|
+
always: [
|
|
157
|
+
{
|
|
158
|
+
target: types_1.Siopv2MachineStates.addContact,
|
|
159
|
+
cond: types_1.Siopv2MachineGuards.hasNoContactGuard,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
target: types_1.Siopv2MachineStates.sendResponse,
|
|
163
|
+
cond: types_1.Siopv2MachineGuards.siopOnlyGuard,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
target: types_1.Siopv2MachineStates.getSelectableCredentials,
|
|
167
|
+
cond: types_1.Siopv2MachineGuards.hasSelectableCredentialsAndContactGuard,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
target: types_1.Siopv2MachineStates.selectCredentials,
|
|
171
|
+
cond: types_1.Siopv2MachineGuards.siopWithOID4VPGuard,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
[types_1.Siopv2MachineStates.addContact]: {
|
|
176
|
+
id: types_1.Siopv2MachineStates.addContact,
|
|
177
|
+
initial: types_1.Siopv2MachineAddContactStates.idle,
|
|
178
|
+
on: {
|
|
179
|
+
[types_1.Siopv2MachineEvents.SET_CONTACT_CONSENT]: {
|
|
180
|
+
actions: (0, xstate_1.assign)({ hasContactConsent: (_ctx, _event) => _event.data }),
|
|
181
|
+
},
|
|
182
|
+
[types_1.Siopv2MachineEvents.SET_CONTACT_ALIAS]: {
|
|
183
|
+
actions: (0, xstate_1.assign)({ contactAlias: (_ctx, _event) => _event.data }),
|
|
184
|
+
},
|
|
185
|
+
[types_1.Siopv2MachineEvents.CREATE_CONTACT]: {
|
|
186
|
+
target: `.${types_1.Siopv2MachineAddContactStates.next}`,
|
|
187
|
+
actions: (0, xstate_1.assign)({ contact: (_ctx, _event) => _event.data }),
|
|
188
|
+
cond: types_1.Siopv2MachineGuards.createContactGuard,
|
|
189
|
+
},
|
|
190
|
+
[types_1.Siopv2MachineEvents.DECLINE]: {
|
|
191
|
+
target: types_1.Siopv2MachineStates.declined,
|
|
192
|
+
},
|
|
193
|
+
[types_1.Siopv2MachineEvents.PREVIOUS]: {
|
|
194
|
+
target: types_1.Siopv2MachineStates.aborted,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
states: {
|
|
198
|
+
[types_1.Siopv2MachineAddContactStates.idle]: {},
|
|
199
|
+
[types_1.Siopv2MachineAddContactStates.next]: {
|
|
200
|
+
always: {
|
|
201
|
+
target: `#${types_1.Siopv2MachineStates.transitionFromSetup}`,
|
|
202
|
+
cond: types_1.Siopv2MachineGuards.hasContactGuard,
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
[types_1.Siopv2MachineStates.addContactIdentity]: {
|
|
208
|
+
id: types_1.Siopv2MachineStates.addContactIdentity,
|
|
209
|
+
invoke: {
|
|
210
|
+
src: types_1.Siopv2MachineServices.addContactIdentity,
|
|
211
|
+
onDone: [
|
|
212
|
+
{
|
|
213
|
+
target: types_1.Siopv2MachineStates.getSelectableCredentials,
|
|
214
|
+
actions: (_ctx, _event) => {
|
|
215
|
+
var _a;
|
|
216
|
+
(_a = _ctx.contact) === null || _a === void 0 ? void 0 : _a.identities.push(_event.data);
|
|
217
|
+
},
|
|
218
|
+
cond: types_1.Siopv2MachineGuards.hasSelectableCredentialsAndContactGuard,
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
target: types_1.Siopv2MachineStates.sendResponse,
|
|
222
|
+
actions: (_ctx, _event) => {
|
|
223
|
+
var _a;
|
|
224
|
+
(_a = _ctx.contact) === null || _a === void 0 ? void 0 : _a.identities.push(_event.data);
|
|
225
|
+
},
|
|
226
|
+
cond: types_1.Siopv2MachineGuards.siopOnlyGuard,
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
onError: {
|
|
230
|
+
target: types_1.Siopv2MachineStates.handleError,
|
|
231
|
+
actions: (0, xstate_1.assign)({
|
|
232
|
+
error: (_ctx, _event) => ({
|
|
233
|
+
title: (0, Localization_1.translate)('siopv2_machine_add_contact_identity_error_title'),
|
|
234
|
+
message: _event.data.message,
|
|
235
|
+
stack: _event.data.stack,
|
|
236
|
+
}),
|
|
237
|
+
}),
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
[types_1.Siopv2MachineStates.getSelectableCredentials]: {
|
|
242
|
+
id: types_1.Siopv2MachineStates.getSelectableCredentials,
|
|
243
|
+
invoke: {
|
|
244
|
+
src: types_1.Siopv2MachineServices.getSelectableCredentials,
|
|
245
|
+
onDone: {
|
|
246
|
+
target: types_1.Siopv2MachineStates.selectCredentials,
|
|
247
|
+
actions: (0, xstate_1.assign)({
|
|
248
|
+
selectableCredentialsMap: (_ctx, _event) => _event.data,
|
|
249
|
+
}),
|
|
250
|
+
},
|
|
251
|
+
onError: {
|
|
252
|
+
target: types_1.Siopv2MachineStates.handleError,
|
|
253
|
+
actions: (0, xstate_1.assign)({
|
|
254
|
+
error: (_ctx, _event) => ({
|
|
255
|
+
title: (0, Localization_1.translate)('siopv2_machine_get_selectable_credentials_error_title'),
|
|
256
|
+
message: _event.data.message,
|
|
257
|
+
stack: _event.data.stack,
|
|
258
|
+
}),
|
|
259
|
+
}),
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
[types_1.Siopv2MachineStates.selectCredentials]: {
|
|
264
|
+
id: types_1.Siopv2MachineStates.selectCredentials,
|
|
265
|
+
on: {
|
|
266
|
+
[types_1.Siopv2MachineEvents.SET_SELECTED_CREDENTIALS]: {
|
|
267
|
+
actions: (0, xstate_1.assign)({ selectedCredentials: (_ctx, _event) => _event.data }),
|
|
268
|
+
},
|
|
269
|
+
[types_1.Siopv2MachineEvents.NEXT]: {
|
|
270
|
+
target: types_1.Siopv2MachineStates.sendResponse,
|
|
271
|
+
cond: types_1.Siopv2MachineGuards.hasSelectedRequiredCredentialsGuard,
|
|
272
|
+
},
|
|
273
|
+
[types_1.Siopv2MachineEvents.DECLINE]: {
|
|
274
|
+
target: types_1.Siopv2MachineStates.declined,
|
|
275
|
+
},
|
|
276
|
+
[types_1.Siopv2MachineEvents.PREVIOUS]: {
|
|
277
|
+
target: types_1.Siopv2MachineStates.aborted,
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
[types_1.Siopv2MachineStates.sendResponse]: {
|
|
282
|
+
id: types_1.Siopv2MachineStates.sendResponse,
|
|
283
|
+
invoke: {
|
|
284
|
+
src: types_1.Siopv2MachineServices.sendResponse,
|
|
285
|
+
onDone: {
|
|
286
|
+
target: types_1.Siopv2MachineStates.done,
|
|
287
|
+
actions: (0, xstate_1.assign)({
|
|
288
|
+
authorizationResponseData: (_ctx, _event) => _event.data,
|
|
289
|
+
}),
|
|
290
|
+
},
|
|
291
|
+
onError: {
|
|
292
|
+
target: types_1.Siopv2MachineStates.handleError,
|
|
293
|
+
actions: (0, xstate_1.assign)({
|
|
294
|
+
error: (_ctx, _event) => ({
|
|
295
|
+
title: (0, Localization_1.translate)('siopv2_machine_send_response_error_title'),
|
|
296
|
+
message: _event.data.message,
|
|
297
|
+
stack: _event.data.stack,
|
|
298
|
+
}),
|
|
299
|
+
}),
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
[types_1.Siopv2MachineStates.handleError]: {
|
|
304
|
+
id: types_1.Siopv2MachineStates.handleError,
|
|
305
|
+
on: {
|
|
306
|
+
[types_1.Siopv2MachineEvents.NEXT]: {
|
|
307
|
+
target: types_1.Siopv2MachineStates.error,
|
|
308
|
+
},
|
|
309
|
+
[types_1.Siopv2MachineEvents.PREVIOUS]: {
|
|
310
|
+
target: types_1.Siopv2MachineStates.error,
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
[types_1.Siopv2MachineStates.aborted]: {
|
|
315
|
+
id: types_1.Siopv2MachineStates.aborted,
|
|
316
|
+
type: 'final',
|
|
317
|
+
},
|
|
318
|
+
[types_1.Siopv2MachineStates.declined]: {
|
|
319
|
+
id: types_1.Siopv2MachineStates.declined,
|
|
320
|
+
type: 'final',
|
|
321
|
+
},
|
|
322
|
+
[types_1.Siopv2MachineStates.error]: {
|
|
323
|
+
id: types_1.Siopv2MachineStates.error,
|
|
324
|
+
type: 'final',
|
|
325
|
+
},
|
|
326
|
+
[types_1.Siopv2MachineStates.done]: {
|
|
327
|
+
id: types_1.Siopv2MachineStates.done,
|
|
328
|
+
type: 'final',
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
class Siopv2Machine {
|
|
334
|
+
static newInstance(opts) {
|
|
335
|
+
exports.logger.info('New Siopv2Machine instance');
|
|
336
|
+
const interpreter = (0, xstate_1.interpret)(createSiopv2Machine(opts).withConfig({
|
|
337
|
+
services: Object.assign({}, opts === null || opts === void 0 ? void 0 : opts.services),
|
|
338
|
+
guards: Object.assign({ Siopv2HasNoContactGuard,
|
|
339
|
+
Siopv2HasContactGuard,
|
|
340
|
+
Siopv2HasAuthorizationRequestGuard,
|
|
341
|
+
Siopv2HasSelectableCredentialsAndContactGuard,
|
|
342
|
+
Siopv2HasSelectedRequiredCredentialsGuard,
|
|
343
|
+
Siopv2IsSiopOnlyGuard,
|
|
344
|
+
Siopv2IsSiopWithOID4VPGuard,
|
|
345
|
+
Siopv2CreateContactGuard }, opts === null || opts === void 0 ? void 0 : opts.guards),
|
|
346
|
+
}));
|
|
347
|
+
if (typeof (opts === null || opts === void 0 ? void 0 : opts.subscription) === 'function') {
|
|
348
|
+
interpreter.onTransition(opts.subscription);
|
|
349
|
+
}
|
|
350
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.requireCustomNavigationHook) !== true) {
|
|
351
|
+
interpreter.onTransition((snapshot) => {
|
|
352
|
+
if (opts.stateNavigationListener !== undefined) {
|
|
353
|
+
void opts.stateNavigationListener(interpreter, snapshot);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
interpreter.onTransition((snapshot) => {
|
|
358
|
+
exports.logger.info('onTransition to new state', snapshot.value);
|
|
359
|
+
});
|
|
360
|
+
return { interpreter };
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
exports.Siopv2Machine = Siopv2Machine;
|
|
364
|
+
//# sourceMappingURL=Siopv2Machine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Siopv2Machine.js","sourceRoot":"","sources":["../../src/machine/Siopv2Machine.ts"],"names":[],"mappings":";;;AAEA,mCAA0E;AAC1E,+DAAwD;AAExD,oCAiBiB;AACjB,oCAAsI;AACtI,mDAA6C;AAEhC,QAAA,MAAM,GAAG,mBAAO,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAgB,CAAC,CAAA;AAE3D,MAAM,uBAAuB,GAAG,CAAC,IAA0B,EAAE,MAA+B,EAAW,EAAE;IACvG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IACxB,OAAO,OAAO,KAAK,SAAS,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAAC,IAA0B,EAAE,MAA+B,EAAW,EAAE;IACrG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IACxB,OAAO,OAAO,KAAK,S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