@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.33.1-next.3 → 0.33.1-next.68

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.
Files changed (88) hide show
  1. package/dist/index.cjs +2451 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +559 -0
  4. package/dist/index.d.ts +555 -8
  5. package/dist/index.js +2420 -31
  6. package/dist/index.js.map +1 -1
  7. package/package.json +41 -30
  8. package/src/agent/DidAuthSiopOpAuthenticator.ts +13 -14
  9. package/src/session/OpSession.ts +13 -13
  10. package/dist/agent/DidAuthSiopOpAuthenticator.d.ts +0 -36
  11. package/dist/agent/DidAuthSiopOpAuthenticator.d.ts.map +0 -1
  12. package/dist/agent/DidAuthSiopOpAuthenticator.js +0 -392
  13. package/dist/agent/DidAuthSiopOpAuthenticator.js.map +0 -1
  14. package/dist/index.d.ts.map +0 -1
  15. package/dist/link-handler/index.d.ts +0 -22
  16. package/dist/link-handler/index.d.ts.map +0 -1
  17. package/dist/link-handler/index.js +0 -57
  18. package/dist/link-handler/index.js.map +0 -1
  19. package/dist/localization/Localization.d.ts +0 -9
  20. package/dist/localization/Localization.d.ts.map +0 -1
  21. package/dist/localization/Localization.js +0 -46
  22. package/dist/localization/Localization.js.map +0 -1
  23. package/dist/localization/translations/en.json +0 -9
  24. package/dist/localization/translations/nl.json +0 -8
  25. package/dist/machine/CallbackStateListener.d.ts +0 -3
  26. package/dist/machine/CallbackStateListener.d.ts.map +0 -1
  27. package/dist/machine/CallbackStateListener.js +0 -48
  28. package/dist/machine/CallbackStateListener.js.map +0 -1
  29. package/dist/machine/Siopv2Machine.d.ts +0 -8
  30. package/dist/machine/Siopv2Machine.d.ts.map +0 -1
  31. package/dist/machine/Siopv2Machine.js +0 -364
  32. package/dist/machine/Siopv2Machine.js.map +0 -1
  33. package/dist/services/IdentifierService.d.ts +0 -3
  34. package/dist/services/IdentifierService.d.ts.map +0 -1
  35. package/dist/services/IdentifierService.js +0 -28
  36. package/dist/services/IdentifierService.js.map +0 -1
  37. package/dist/services/Siopv2MachineService.d.ts +0 -18
  38. package/dist/services/Siopv2MachineService.d.ts.map +0 -1
  39. package/dist/services/Siopv2MachineService.js +0 -299
  40. package/dist/services/Siopv2MachineService.js.map +0 -1
  41. package/dist/session/OID4VP.d.ts +0 -72
  42. package/dist/session/OID4VP.d.ts.map +0 -1
  43. package/dist/session/OID4VP.js +0 -224
  44. package/dist/session/OID4VP.js.map +0 -1
  45. package/dist/session/OpSession.d.ts +0 -39
  46. package/dist/session/OpSession.d.ts.map +0 -1
  47. package/dist/session/OpSession.js +0 -365
  48. package/dist/session/OpSession.js.map +0 -1
  49. package/dist/session/functions.d.ts +0 -37
  50. package/dist/session/functions.d.ts.map +0 -1
  51. package/dist/session/functions.js +0 -163
  52. package/dist/session/functions.js.map +0 -1
  53. package/dist/session/index.d.ts +0 -4
  54. package/dist/session/index.d.ts.map +0 -1
  55. package/dist/session/index.js +0 -20
  56. package/dist/session/index.js.map +0 -1
  57. package/dist/types/IDidAuthSiopOpAuthenticator.d.ts +0 -120
  58. package/dist/types/IDidAuthSiopOpAuthenticator.d.ts.map +0 -1
  59. package/dist/types/IDidAuthSiopOpAuthenticator.js +0 -10
  60. package/dist/types/IDidAuthSiopOpAuthenticator.js.map +0 -1
  61. package/dist/types/error/index.d.ts +0 -8
  62. package/dist/types/error/index.d.ts.map +0 -1
  63. package/dist/types/error/index.js +0 -3
  64. package/dist/types/error/index.js.map +0 -1
  65. package/dist/types/identifier/index.d.ts +0 -53
  66. package/dist/types/identifier/index.d.ts.map +0 -1
  67. package/dist/types/identifier/index.js +0 -5
  68. package/dist/types/identifier/index.js.map +0 -1
  69. package/dist/types/index.d.ts +0 -6
  70. package/dist/types/index.d.ts.map +0 -1
  71. package/dist/types/index.js +0 -22
  72. package/dist/types/index.js.map +0 -1
  73. package/dist/types/machine/index.d.ts +0 -124
  74. package/dist/types/machine/index.d.ts.map +0 -1
  75. package/dist/types/machine/index.js +0 -57
  76. package/dist/types/machine/index.js.map +0 -1
  77. package/dist/types/siop-service/index.d.ts +0 -80
  78. package/dist/types/siop-service/index.d.ts.map +0 -1
  79. package/dist/types/siop-service/index.js +0 -14
  80. package/dist/types/siop-service/index.js.map +0 -1
  81. package/dist/utils/CredentialUtils.d.ts +0 -23
  82. package/dist/utils/CredentialUtils.d.ts.map +0 -1
  83. package/dist/utils/CredentialUtils.js +0 -65
  84. package/dist/utils/CredentialUtils.js.map +0 -1
  85. package/dist/utils/dcql.d.ts +0 -5
  86. package/dist/utils/dcql.d.ts.map +0 -1
  87. package/dist/utils/dcql.js +0 -37
  88. package/dist/utils/dcql.js.map +0 -1
@@ -1,48 +0,0 @@
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
@@ -1 +0,0 @@
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,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AAA;AACH,CAAC,CAAA;AAlCY,QAAA,2BAA2B,+BAkCvC"}
@@ -1,8 +0,0 @@
1
- import { Siopv2MachineInstanceOpts, 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
@@ -1 +0,0 @@
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"}
@@ -1,364 +0,0 @@
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
@@ -1 +0,0 @@
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,SAAS,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,kCAAkC,GAAG,CAAC,IAA0B,EAAE,MAA+B,EAAW,EAAE;IAClH,MAAM,EAAE,wBAAwB,EAAE,GAAG,IAAI,CAAA;IACzC,OAAO,wBAAwB,KAAK,SAAS,CAAA;AAC/C,CAAC,CAAA;AAED,MAAM,6CAA6C,GAAG,CAAC,IAA0B,EAAE,MAA+B,EAAW,EAAE;IAC7H,MAAM,EAAE,wBAAwB,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAElD,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAClE,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;IAC5D,CAAC;IAED,OAAO,wBAAwB,CAAC,uBAAuB,KAAK,SAAS,CAAA;AACvE,CAAC,CAAA;AAED,M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ierWithKey: (args: GetIdentifierArgs) => Promise<IdentifierWithKey>;
3
- //# sourceMappingURL=IdentifierService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IdentifierService.d.ts","sourceRoot":"","sources":["../../src/services/IdentifierService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAG1E,eAAO,MAAM,oBAAoB,SAAgB,iBAAiB,KAAG,OAAO,CAAC,iBAAiB,CAc7F,CAAA"}
@@ -1,28 +0,0 @@
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.getIdentifierWithKey = void 0;
13
- const ssi_sdk_ext_did_resolver_jwk_1 = require("@sphereon/ssi-sdk-ext.did-resolver-jwk");
14
- const ssi_sdk_ext_did_utils_1 = require("@sphereon/ssi-sdk-ext.did-utils");
15
- const getIdentifierWithKey = (args) => __awaiter(void 0, void 0, void 0, function* () {
16
- var _a;
17
- const { keyOpts, context } = args;
18
- const agentContext = Object.assign(Object.assign({}, context), { agent: context.agent });
19
- const identifier = (_a = keyOpts.identifier) !== null && _a !== void 0 ? _a : (yield (0, ssi_sdk_ext_did_utils_1.getOrCreatePrimaryIdentifier)(agentContext, {
20
- method: keyOpts.didMethod,
21
- createOpts: { options: { type: keyOpts.keyType, use: ssi_sdk_ext_did_resolver_jwk_1.KeyUse.Signature, codecName: keyOpts.codecName } },
22
- }));
23
- const key = yield (0, ssi_sdk_ext_did_utils_1.getAuthenticationKey)({ identifier, keyType: keyOpts.keyType }, agentContext);
24
- const kid = key.meta.verificationMethod.id;
25
- return { identifier, key, kid };
26
- });
27
- exports.getIdentifierWithKey = getIdentifierWithKey;
28
- //# sourceMappingURL=IdentifierService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IdentifierService.js","sourceRoot":"","sources":["../../src/services/IdentifierService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yFAA+D;AAG/D,2EAAoG;AAE7F,MAAM,oBAAoB,GAAG,CAAO,IAAuB,EAA8B,EAAE;;IAChG,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IACjC,MAAM,YAAY,mCAAQ,OAAO,KAAE,KAAK,EAAE,OAAO,CAAC,KAAkB,GAAE,CAAA;IAEtE,MAAM,UAAU,GACd,MAAA,OAAO,CAAC,UAAU,mCAClB,CAAC,MAAM,IAAA,oDAA4B,EAAC,YAAY,EAAE;QAChD,MAAM,EAAE,OAAO,CAAC,SAAS;QACzB,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,qCAAM,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE;KACxG,CAAC,CAAC,CAAA;IACL,MAAM,GAAG,GAAkB,MAAM,IAAA,4CAAoB,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAA;IAC7G,MAAM,GAAG,GAAW,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAA;IAElD,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AACjC,CAAC,CAAA,CAAA;AAdY,QAAA,oBAAoB,wBAchC"}
@@ -1,18 +0,0 @@
1
- import { IPresentationDefinition } from '@sphereon/pex';
2
- import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution';
3
- import { ConnectionType } from '@sphereon/ssi-sdk.data-store';
4
- import { HasherSync } from '@sphereon/ssi-types';
5
- import { RequiredContext, SelectableCredentialsMap, VerifiableCredentialsWithDefinition } from '../types';
6
- import { DcqlQuery } from 'dcql';
7
- export declare const logger: import("@sphereon/ssi-types").ISimpleLogger<unknown>;
8
- export declare const siopSendAuthorizationResponse: (connectionType: ConnectionType, args: {
9
- sessionId: string;
10
- verifiableCredentialsWithDefinition?: VerifiableCredentialsWithDefinition[];
11
- idOpts?: ManagedIdentifierOptsOrResult;
12
- isFirstParty?: boolean;
13
- hasher?: HasherSync;
14
- dcqlQuery?: DcqlQuery;
15
- }, context: RequiredContext) => Promise<Response>;
16
- export declare const getSelectableCredentials: (presentationDefinition: IPresentationDefinition, context: RequiredContext) => Promise<SelectableCredentialsMap>;
17
- export declare const translateCorrelationIdToName: (correlationId: string, context: RequiredContext) => Promise<string | undefined>;
18
- //# sourceMappingURL=Siopv2MachineService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Siopv2MachineService.d.ts","sourceRoot":"","sources":["../../src/services/Siopv2MachineService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAO,MAAM,eAAe,CAAA;AAE5D,OAAO,EAA4B,6BAA6B,EAAE,MAAM,6CAA6C,CAAA;AAErH,OAAO,EAAE,cAAc,EAAkB,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAoB,UAAU,EAAiE,MAAM,qBAAqB,CAAA;AAEjI,OAAO,EAGL,eAAe,EAEf,wBAAwB,EAGxB,mCAAmC,EAEpC,MAAM,UAAU,CAAA;AAIjB,OAAO,EAAgE,SAAS,EAAE,MAAM,MAAM,CAAA;AAI9F,eAAO,MAAM,MAAM,sDAAwC,CAAA;AAqB3D,eAAO,MAAM,6BAA6B,mBACxB,cAAc,QACxB;IACJ,SAAS,EAAE,MAAM,CAAA;IACjB,mCAAmC,CAAC,EAAE,mCAAmC,EAAE,CAAA;IAC3E,MAAM,CAAC,EAAE,6BAA6B,CAAA;IACtC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,WACQ,eAAe,sBA6NzB,CAAA;AAYD,eAAO,MAAM,wBAAwB,2BACX,uBAAuB,WACtC,eAAe,KACvB,OAAO,CAAC,wBAAwB,CA8ClC,CAAA;AAED,eAAO,MAAM,4BAA4B,kBAAyB,MAAM,WAAW,eAAe,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAY9H,CAAA"}