@pagopa/io-react-native-wallet 0.9.0 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ const QRCodePayload = z.object({
32
32
  * @returns The url for the Relying Party to connect with
33
33
  * @throws If the provided qr code fails to be decoded
34
34
  */
35
- const startFlowFromQR = async qrcode => {
35
+ const startFlowFromQR = qrcode => {
36
36
  const decoded = (0, _ioReactNativeJwt.decodeBase64)(qrcode);
37
37
  const decodedUrl = new URL(decoded);
38
38
  const protocol = decodedUrl.protocol;
@@ -1 +1 @@
1
- {"version":3,"names":["z","_interopRequireWildcard","require","_ioReactNativeJwt","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","QRCodePayload","object","protocol","string","resource","clientId","requestURI","startFlowFromQR","qrcode","decoded","decodeBase64","decodedUrl","URL","hostname","searchParams","result","safeParse","success","data","AuthRequestDecodeError","error","message","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAA4D,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,O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AGS,UAAU,CAACT,QAAQ;EACpC,MAAME,QAAQ,GAAGO,UAAU,CAACE,QAAQ;EACpC,MAAMP,UAAU,GAAGK,UAAU,CAACG,YAAY,CAAC1B,GAAG,CAAC,aAAa,CAAC;EAC7D,MAAMiB,QAAQ,GAAGM,UAAU,CAACG,YAAY,CAAC1B,GAAG,CAAC,WAAW,CAAC;EAEzD,MAAM2B,MAAM,GAAGf,aAAa,CAACgB,SAAS,CAAC;IACrCd,QAAQ;IACRE,QAAQ;IACRE,UAAU;IACVD;EACF,CAAC,CAAC;EAEF,IAAIU,MAAM,CAACE,OAAO,EAAE;IAClB,OAAOF,MAAM,CAACG,IAAI;EACpB,CAAC,MAAM;IACL,MAAM,IAAIC,8BAAsB,CAACJ,MAAM,CAACK,KAAK,CAACC,OAAO,EAAG,GAAEV,UAAW,EAAC,CAAC;EACzE;AACF,CAAC;AAACW,OAAA,CAAAf,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["z","_interopRequireWildcard","require","_ioReactNativeJwt","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","QRCodePayload","object","protocol","string","resource","clientId","requestURI","startFlowFromQR","qrcode","decoded","decodeBase64","decodedUrl","URL","hostname","searchParams","result","safeParse","success","data","AuthRequestDecodeError","error","message","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAA4D,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,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;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,eAAoC,GAAIC,MAAM,IAAK;EAC9D,MAAMC,OAAO,GAAG,IAAAC,8BAAY,EAACF,MAAM,CAAC;EACpC,MAAMG,UAAU,GAAG,IAAIC,GAAG,CAACH,OAAO,CAAC;EACnC,MAAMP,QAAQ,GAAGS,UAAU,CAACT,QAAQ;EACpC,MAAME,QAAQ,GAAGO,UAAU,CAACE,QAAQ;EACpC,MAAMP,UAAU,GAAGK,UAAU,CAACG,YAAY,CAAC1B,GAAG,CAAC,aAAa,CAAC;EAC7D,MAAMiB,QAAQ,GAAGM,UAAU,CAACG,YAAY,CAAC1B,GAAG,CAAC,WAAW,CAAC;EAEzD,MAAM2B,MAAM,GAAGf,aAAa,CAACgB,SAAS,CAAC;IACrCd,QAAQ;IACRE,QAAQ;IACRE,UAAU;IACVD;EACF,CAAC,CAAC;EAEF,IAAIU,MAAM,CAACE,OAAO,EAAE;IAClB,OAAOF,MAAM,CAACG,IAAI;EACpB,CAAC,MAAM;IACL,MAAM,IAAIC,8BAAsB,CAACJ,MAAM,CAACK,KAAK,CAACC,OAAO,EAAG,GAAEV,UAAW,EAAC,CAAC;EACzE;AACF,CAAC;AAACW,OAAA,CAAAf,eAAA,GAAAA,eAAA"}
@@ -4,6 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.WalletInstanceAttestationIssuingError = exports.ValidationFailed = exports.PidMetadataError = exports.PidIssuingError = exports.NoSuitableKeysFoundInEntityConfiguration = exports.IoWalletError = exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDislosures = exports.AuthRequestDecodeError = void 0;
7
+ /**
8
+ * utility to format a set of attributes into an error message string
9
+ *
10
+ * @example
11
+ * // returns "foo=value bar=(list, item)"
12
+ * serializeAttrs({ foo: "value", bar: ["list", "item"] })
13
+ *
14
+ * @param attrs A key value record set
15
+ * @returns a human-readable serialization of the set
16
+ */
17
+ const serializeAttrs = attrs => Object.entries(attrs).map(_ref => {
18
+ let [k, v] = _ref;
19
+ return [k, Array.isArray(v) ? `(${v.join(", ")})` : v];
20
+ }).map(_ => _.join("=")).join(" ");
21
+
7
22
  /**
8
23
  * A generic Error that all other io-wallet specific Error subclasses extend.
9
24
  *
@@ -49,7 +64,11 @@ class ValidationFailed extends IoWalletError {
49
64
  constructor(message) {
50
65
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
51
66
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
52
- super(message);
67
+ super(serializeAttrs({
68
+ message,
69
+ claim,
70
+ reason
71
+ }));
53
72
  this.claim = claim;
54
73
  this.reason = reason;
55
74
  }
@@ -73,7 +92,11 @@ class WalletInstanceAttestationIssuingError extends IoWalletError {
73
92
  constructor(message) {
74
93
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
75
94
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
76
- super(message);
95
+ super(serializeAttrs({
96
+ message,
97
+ claim,
98
+ reason
99
+ }));
77
100
  this.claim = claim;
78
101
  this.reason = reason;
79
102
  }
@@ -97,7 +120,11 @@ class AuthRequestDecodeError extends IoWalletError {
97
120
  constructor(message) {
98
121
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
99
122
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
100
- super(message);
123
+ super(serializeAttrs({
124
+ message,
125
+ claim,
126
+ reason
127
+ }));
101
128
  this.claim = claim;
102
129
  this.reason = reason;
103
130
  }
@@ -121,7 +148,11 @@ class PidIssuingError extends IoWalletError {
121
148
  constructor(message) {
122
149
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
123
150
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
124
- super(message);
151
+ super(serializeAttrs({
152
+ message,
153
+ claim,
154
+ reason
155
+ }));
125
156
  this.claim = claim;
126
157
  this.reason = reason;
127
158
  }
@@ -1 +1 @@
1
- {"version":3,"names":["IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","exports","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","Array","isArray","join","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CAACG,IAAI;IACjC;IACA,CAAAD,qBAAA,GAAAJ,KAAK,CAACM,iBAAiB,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,KAAK,EAAqB,IAAI,EAAE,IAAI,CAACE,WAAW,CAAC;EACnD;AACF;AACA;AACA;AACA;AACA;AAHAM,OAAA,CAAAT,aAAA,GAAAA,aAAA;AAIO,MAAMU,gBAAgB,SAASV,aAAa,CAAC;EAClD,WAAWE,IAAIA,CAAA,EAAsC;IACnD,OAAO,iCAAiC;EAC1C;EAEAA,IAAI,GAAG,iCAAiC;;EAExC;;EAGA;;EAGAC,WAAWA,CAACC,OAAe,EAAiD;IAAA,IAA/CO,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAAA,IA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C,WAAWC,IAAIA,CAAA,EAAoC;IACjD,OAAO,+BAA+B;EACxC;EAEAA,IAAI,GAAG,+BAA+B;;EAEtC;;EAGAC,WAAWA,CAACiB,MAAyB,EAAE;IACrC,MAAMC,CAAC,GAAGC,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC;IACnD,MAAMhB,OAAO,GAAI,yDAAwDiB,CAAC,CAACG,IAAI,CAC7E,IACF,CAAE,EAAC;IACH,KAAK,CAACpB,OAAO,CAAC;IACd,IAAI,CAACgB,MAAM,GAAGC,CAAC;EACjB;AACF;;AAEA;AACA;AACA;AACA;AAHAZ,OAAA,CAAAgB,qBAAA,GAAAA,qBAAA;AAIO,MAAMC,wCAAwC,SAASzB,KAAK,CAAC;EAClE,WAAWC,IAAIA,CAAA,EAAqC;IAClD,OAAO,gCAAgC;EACzC;EAEAA,IAAI,GAAG,gCAAgC;;EAEvC;AACF;AACA;EACEC,WAAWA,CAACwB,QAAgB,EAAE;IAC5B,MAAMvB,OAAO,GAAI,0DAAyDuB,QAAS,IAAG;IACtF,KAAK,CAACvB,OAAO,CAAC;EAChB;AACF;;AAEA;AACA;AACA;AACA;AAHAK,OAAA,CAAAiB,wCAAA,GAAAA,wCAAA;AAIO,MAAME,gBAAgB,SAAS3B,KAAK,CAAC;EAC1C,WAAWC,IAAIA,CAAA,EAAyB;IACtC,OAAO,oBAAoB;EAC7B;EAEAC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;EAChB;AACF;AAACK,OAAA,CAAAmB,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","exports","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAIC,KAAsC,IAC5DC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CAACG,IAAI;IACjC;IACA,CAAAD,qBAAA,GAAAJ,KAAK,CAACM,iBAAiB,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,KAAK,EAAqB,IAAI,EAAE,IAAI,CAACE,WAAW,CAAC;EACnD;AACF;AACA;AACA;AACA;AACA;AAHAM,OAAA,CAAAT,aAAA,GAAAA,aAAA;AAIO,MAAMU,gBAAgB,SAASV,aAAa,CAAC;EAClD,WAAWE,IAAIA,CAAA,EAAsC;IACnD,OAAO,iCAAiC;EAC1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IO,MAAME,gBAAgB,SAASxB,KAAK,CAAC;EAC1C,WAAWC,IAAIA,CAAA,EAAyB;IACtC,OAAO,oBAAoB;EAC7B;EAEAC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;EAChB;AACF;AAACK,OAAA,CAAAgB,gBAAA,GAAAA,gBAAA"}
@@ -24,7 +24,7 @@ const QRCodePayload = z.object({
24
24
  * @returns The url for the Relying Party to connect with
25
25
  * @throws If the provided qr code fails to be decoded
26
26
  */
27
- export const startFlowFromQR = async qrcode => {
27
+ export const startFlowFromQR = qrcode => {
28
28
  const decoded = decodeBase64(qrcode);
29
29
  const decodedUrl = new URL(decoded);
30
30
  const protocol = decodedUrl.protocol;
@@ -1 +1 @@
1
- {"version":3,"names":["z","decodeBase64","AuthRequestDecodeError","QRCodePayload","object","protocol","string","resource","clientId","requestURI","startFlowFromQR","qrcode","decoded","decodedUrl","URL","hostname","searchParams","get","result","safeParse","success","data","error","message"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AACxB,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,sBAAsB,QAAQ,oBAAoB;AAE3D,MAAMC,aAAa,GAAGH,CAAC,CAACI,MAAM,CAAC;EAC7BC,QAAQ,EAAEL,CAAC,CAACM,MAAM,CAAC,CAAC;EACpBC,QAAQ,EAAEP,CAAC,CAACM,MAAM,CAAC,CAAC;EAAE;EACtBE,QAAQ,EAAER,CAAC,CAACM,MAAM,CAAC,CAAC;EACpBG,UAAU,EAAET,CAAC,CAACM,MAAM,CAAC;AACvB,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,eAAoC,GAAG,MAAOC,MAAM,IAAK;EACpE,MAAMC,OAAO,GAAGX,YAAY,CAACU,MAAM,CAAC;EACpC,MAAME,UAAU,GAAG,IAAIC,GAAG,CAACF,OAAO,CAAC;EACnC,MAAMP,QAAQ,GAAGQ,UAAU,CAACR,QAAQ;EACpC,MAAME,QAAQ,GAAGM,UAAU,CAACE,QAAQ;EACpC,MAAMN,UAAU,GAAGI,UAAU,CAACG,YAAY,CAACC,GAAG,CAAC,aAAa,CAAC;EAC7D,MAAMT,QAAQ,GAAGK,UAAU,CAACG,YAAY,CAACC,GAAG,CAAC,WAAW,CAAC;EAEzD,MAAMC,MAAM,GAAGf,aAAa,CAACgB,SAAS,CAAC;IACrCd,QAAQ;IACRE,QAAQ;IACRE,UAAU;IACVD;EACF,CAAC,CAAC;EAEF,IAAIU,MAAM,CAACE,OAAO,EAAE;IAClB,OAAOF,MAAM,CAACG,IAAI;EACpB,CAAC,MAAM;IACL,MAAM,IAAInB,sBAAsB,CAACgB,MAAM,CAACI,KAAK,CAACC,OAAO,EAAG,GAAEV,UAAW,EAAC,CAAC;EACzE;AACF,CAAC"}
1
+ {"version":3,"names":["z","decodeBase64","AuthRequestDecodeError","QRCodePayload","object","protocol","string","resource","clientId","requestURI","startFlowFromQR","qrcode","decoded","decodedUrl","URL","hostname","searchParams","get","result","safeParse","success","data","error","message"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AACxB,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,sBAAsB,QAAQ,oBAAoB;AAE3D,MAAMC,aAAa,GAAGH,CAAC,CAACI,MAAM,CAAC;EAC7BC,QAAQ,EAAEL,CAAC,CAACM,MAAM,CAAC,CAAC;EACpBC,QAAQ,EAAEP,CAAC,CAACM,MAAM,CAAC,CAAC;EAAE;EACtBE,QAAQ,EAAER,CAAC,CAACM,MAAM,CAAC,CAAC;EACpBG,UAAU,EAAET,CAAC,CAACM,MAAM,CAAC;AACvB,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,eAAoC,GAAIC,MAAM,IAAK;EAC9D,MAAMC,OAAO,GAAGX,YAAY,CAACU,MAAM,CAAC;EACpC,MAAME,UAAU,GAAG,IAAIC,GAAG,CAACF,OAAO,CAAC;EACnC,MAAMP,QAAQ,GAAGQ,UAAU,CAACR,QAAQ;EACpC,MAAME,QAAQ,GAAGM,UAAU,CAACE,QAAQ;EACpC,MAAMN,UAAU,GAAGI,UAAU,CAACG,YAAY,CAACC,GAAG,CAAC,aAAa,CAAC;EAC7D,MAAMT,QAAQ,GAAGK,UAAU,CAACG,YAAY,CAACC,GAAG,CAAC,WAAW,CAAC;EAEzD,MAAMC,MAAM,GAAGf,aAAa,CAACgB,SAAS,CAAC;IACrCd,QAAQ;IACRE,QAAQ;IACRE,UAAU;IACVD;EACF,CAAC,CAAC;EAEF,IAAIU,MAAM,CAACE,OAAO,EAAE;IAClB,OAAOF,MAAM,CAACG,IAAI;EACpB,CAAC,MAAM;IACL,MAAM,IAAInB,sBAAsB,CAACgB,MAAM,CAACI,KAAK,CAACC,OAAO,EAAG,GAAEV,UAAW,EAAC,CAAC;EACzE;AACF,CAAC"}
@@ -1,3 +1,18 @@
1
+ /**
2
+ * utility to format a set of attributes into an error message string
3
+ *
4
+ * @example
5
+ * // returns "foo=value bar=(list, item)"
6
+ * serializeAttrs({ foo: "value", bar: ["list", "item"] })
7
+ *
8
+ * @param attrs A key value record set
9
+ * @returns a human-readable serialization of the set
10
+ */
11
+ const serializeAttrs = attrs => Object.entries(attrs).map(_ref => {
12
+ let [k, v] = _ref;
13
+ return [k, Array.isArray(v) ? `(${v.join(", ")})` : v];
14
+ }).map(_ => _.join("=")).join(" ");
15
+
1
16
  /**
2
17
  * A generic Error that all other io-wallet specific Error subclasses extend.
3
18
  *
@@ -42,7 +57,11 @@ export class ValidationFailed extends IoWalletError {
42
57
  constructor(message) {
43
58
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
44
59
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
45
- super(message);
60
+ super(serializeAttrs({
61
+ message,
62
+ claim,
63
+ reason
64
+ }));
46
65
  this.claim = claim;
47
66
  this.reason = reason;
48
67
  }
@@ -65,7 +84,11 @@ export class WalletInstanceAttestationIssuingError extends IoWalletError {
65
84
  constructor(message) {
66
85
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
67
86
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
68
- super(message);
87
+ super(serializeAttrs({
88
+ message,
89
+ claim,
90
+ reason
91
+ }));
69
92
  this.claim = claim;
70
93
  this.reason = reason;
71
94
  }
@@ -88,7 +111,11 @@ export class AuthRequestDecodeError extends IoWalletError {
88
111
  constructor(message) {
89
112
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
90
113
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
91
- super(message);
114
+ super(serializeAttrs({
115
+ message,
116
+ claim,
117
+ reason
118
+ }));
92
119
  this.claim = claim;
93
120
  this.reason = reason;
94
121
  }
@@ -111,7 +138,11 @@ export class PidIssuingError extends IoWalletError {
111
138
  constructor(message) {
112
139
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
113
140
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
114
- super(message);
141
+ super(serializeAttrs({
142
+ message,
143
+ claim,
144
+ reason
145
+ }));
115
146
  this.claim = claim;
116
147
  this.reason = reason;
117
148
  }
@@ -1 +1 @@
1
- {"version":3,"names":["IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","Array","isArray","join","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CAACG,IAAI;IACjC;IACA,CAAAD,qBAAA,GAAAJ,KAAK,CAACM,iBAAiB,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,KAAK,EAAqB,IAAI,EAAE,IAAI,CAACE,WAAW,CAAC;EACnD;AACF;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,gBAAgB,SAAST,aAAa,CAAC;EAClD,WAAWE,IAAIA,CAAA,EAAsC;IACnD,OAAO,iCAAiC;EAC1C;EAEAA,IAAI,GAAG,iCAAiC;;EAExC;;EAGA;;EAGAC,WAAWA,CAACC,OAAe,EAAiD;IAAA,IAA/CM,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAAA,IAAEG,MAAM,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACxE,KAAK,CAACP,OAAO,CAAC;IACd,IAAI,CAACM,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACI,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qCAAqC,SAASf,aAAa,CAAC;EACvE,WAAWE,IAAIA,CAAA,EAAwD;IACrE,OAAO,mDAAmD;EAC5D;EAEAA,IAAI,GAAG,mDAAmD;;EA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ACA;EACEC,WAAWA,CAACuB,QAAgB,EAAE;IAC5B,MAAMtB,OAAO,GAAI,0DAAyDsB,QAAS,IAAG;IACtF,KAAK,CAACtB,OAAO,CAAC;EAChB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMuB,gBAAgB,SAAS1B,KAAK,CAAC;EAC1C,WAAWC,IAAIA,CAAA,EAAyB;IACtC,OAAO,oBAAoB;EAC7B;EAEAC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;EAChB;AACF"}
1
+ {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAIC,KAAsC,IAC5DC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,W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,IAAIA,CAAA,EAAqC;IAClD,OAAO,gCAAgC;EACzC;EAEAA,IAAI,GAAG,gCAAgC;;EAEvC;AACF;AACA;EACEC,WAAWA,CAACoB,QAAgB,EAAE;IAC5B,MAAMnB,OAAO,GAAI,0DAAyDmB,QAAS,IAAG;IACtF,KAAK,CAACnB,OAAO,CAAC;EAChB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMoB,gBAAgB,SAASvB,KAAK,CAAC;EAC1C,WAAWC,IAAIA,CAAA,EAAyB;IACtC,OAAO,oBAAoB;EAC7B;EAEAC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;EAChB;AACF"}
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * @returns The type of the Credential to be issued and the url of the Issuer
6
6
  */
7
- export type StartFlow = () => Promise<{
7
+ export type StartFlow = () => {
8
8
  issuerUrl: string;
9
9
  credentialType: string;
10
- }>;
10
+ };
11
11
  //# sourceMappingURL=01-start-flow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/01-start-flow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC,CAAC"}
1
+ {"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/01-start-flow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -5,10 +5,10 @@
5
5
  * @param Optional parameters, depending on the starting touchoint
6
6
  * @returns The url for the Relying Party to connect with
7
7
  */
8
- export type StartFlow<T extends Array<unknown> = []> = (...args: T) => Promise<{
8
+ export type StartFlow<T extends Array<unknown> = []> = (...args: T) => {
9
9
  requestURI: string;
10
10
  clientId: string;
11
- }>;
11
+ };
12
12
  /**
13
13
  * Start a presentation flow by decoding an incoming QR-code
14
14
  *
@@ -1 +1 @@
1
- {"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/01-start-flow.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAoB/C,CAAC"}
1
+ {"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/01-start-flow.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAoB/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,6DAA6D;IAC7D,MAAM,KAAK,IAAI,IAAI,MAAM,CAExB;IAED,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAA2B;gBAE3B,OAAO,CAAC,EAAE,MAAM;CAM7B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,KAAK,IAAI,IAAI,gCAAgC,CAElD;IAED,IAAI,SAAoC;IAExC;;OAEG;gBACS,QAAQ,EAAE,MAAM;CAI7B;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,MAAM,KAAK,IAAI,IAAI,oBAAoB,CAEtC;gBAEW,OAAO,EAAE,MAAM;CAG5B"}
@@ -4,5 +4,5 @@
4
4
  * @returns The given response object
5
5
  */
6
6
  export declare const hasStatus: (status: number) => (res: Response) => Response;
7
- export type Out<FN> = FN extends (...args: any[]) => Promise<any> ? Awaited<ReturnType<FN>> : never;
7
+ export type Out<FN> = FN extends (...args: any[]) => Promise<any> ? Awaited<ReturnType<FN>> : FN extends (...args: any[]) => any ? ReturnType<FN> : never;
8
8
  //# sourceMappingURL=misc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,WACX,MAAM,WACT,QAAQ,KAAG,QAOhB,CAAC;AAIJ,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAC7D,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,GACvB,KAAK,CAAC"}
1
+ {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,WACX,MAAM,WACT,QAAQ,KAAG,QAOhB,CAAC;AAIJ,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAC7D,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,GACvB,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAClC,UAAU,CAAC,EAAE,CAAC,GACd,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-react-native-wallet",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Provide data structures, helpers and API for IO Wallet",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -109,4 +109,4 @@
109
109
  "react-native-uuid": "^2.0.1",
110
110
  "zod": "^3.21.4"
111
111
  }
112
- }
112
+ }
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @returns The type of the Credential to be issued and the url of the Issuer
6
6
  */
7
- export type StartFlow = () => Promise<{
7
+ export type StartFlow = () => {
8
8
  issuerUrl: string;
9
9
  credentialType: string;
10
- }>;
10
+ };
@@ -16,10 +16,10 @@ const QRCodePayload = z.object({
16
16
  * @param Optional parameters, depending on the starting touchoint
17
17
  * @returns The url for the Relying Party to connect with
18
18
  */
19
- export type StartFlow<T extends Array<unknown> = []> = (...args: T) => Promise<{
19
+ export type StartFlow<T extends Array<unknown> = []> = (...args: T) => {
20
20
  requestURI: string;
21
21
  clientId: string;
22
- }>;
22
+ };
23
23
 
24
24
  /**
25
25
  * Start a presentation flow by decoding an incoming QR-code
@@ -28,7 +28,7 @@ export type StartFlow<T extends Array<unknown> = []> = (...args: T) => Promise<{
28
28
  * @returns The url for the Relying Party to connect with
29
29
  * @throws If the provided qr code fails to be decoded
30
30
  */
31
- export const startFlowFromQR: StartFlow<[string]> = async (qrcode) => {
31
+ export const startFlowFromQR: StartFlow<[string]> = (qrcode) => {
32
32
  const decoded = decodeBase64(qrcode);
33
33
  const decodedUrl = new URL(decoded);
34
34
  const protocol = decodedUrl.protocol;
@@ -1,3 +1,19 @@
1
+ /**
2
+ * utility to format a set of attributes into an error message string
3
+ *
4
+ * @example
5
+ * // returns "foo=value bar=(list, item)"
6
+ * serializeAttrs({ foo: "value", bar: ["list", "item"] })
7
+ *
8
+ * @param attrs A key value record set
9
+ * @returns a human-readable serialization of the set
10
+ */
11
+ const serializeAttrs = (attrs: Record<string, string | string>): string =>
12
+ Object.entries(attrs)
13
+ .map(([k, v]) => [k, Array.isArray(v) ? `(${v.join(", ")})` : v])
14
+ .map((_) => _.join("="))
15
+ .join(" ");
16
+
1
17
  /**
2
18
  * A generic Error that all other io-wallet specific Error subclasses extend.
3
19
  *
@@ -42,8 +58,12 @@ export class ValidationFailed extends IoWalletError {
42
58
  /** Reason code for the validation failure. */
43
59
  reason: string;
44
60
 
45
- constructor(message: string, claim = "unspecified", reason = "unspecified") {
46
- super(message);
61
+ constructor(
62
+ message: string,
63
+ claim: string = "unspecified",
64
+ reason: string = "unspecified"
65
+ ) {
66
+ super(serializeAttrs({ message, claim, reason }));
47
67
  this.claim = claim;
48
68
  this.reason = reason;
49
69
  }
@@ -66,8 +86,12 @@ export class WalletInstanceAttestationIssuingError extends IoWalletError {
66
86
  /** Reason code for the validation failure. */
67
87
  reason: string;
68
88
 
69
- constructor(message: string, claim = "unspecified", reason = "unspecified") {
70
- super(message);
89
+ constructor(
90
+ message: string,
91
+ claim: string = "unspecified",
92
+ reason: string = "unspecified"
93
+ ) {
94
+ super(serializeAttrs({ message, claim, reason }));
71
95
  this.claim = claim;
72
96
  this.reason = reason;
73
97
  }
@@ -90,8 +114,12 @@ export class AuthRequestDecodeError extends IoWalletError {
90
114
  /** Reason code for the validation failure. */
91
115
  reason: string;
92
116
 
93
- constructor(message: string, claim = "unspecified", reason = "unspecified") {
94
- super(message);
117
+ constructor(
118
+ message: string,
119
+ claim: string = "unspecified",
120
+ reason: string = "unspecified"
121
+ ) {
122
+ super(serializeAttrs({ message, claim, reason }));
95
123
  this.claim = claim;
96
124
  this.reason = reason;
97
125
  }
@@ -114,8 +142,12 @@ export class PidIssuingError extends IoWalletError {
114
142
  /** Reason code for the validation failure. */
115
143
  reason: string;
116
144
 
117
- constructor(message: string, claim = "unspecified", reason = "unspecified") {
118
- super(message);
145
+ constructor(
146
+ message: string,
147
+ claim: string = "unspecified",
148
+ reason: string = "unspecified"
149
+ ) {
150
+ super(serializeAttrs({ message, claim, reason }));
119
151
  this.claim = claim;
120
152
  this.reason = reason;
121
153
  }
package/src/utils/misc.ts CHANGED
@@ -20,4 +20,6 @@ export const hasStatus =
20
20
  // helpful to bind the input of a function to the output of another
21
21
  export type Out<FN> = FN extends (...args: any[]) => Promise<any>
22
22
  ? Awaited<ReturnType<FN>>
23
+ : FN extends (...args: any[]) => any
24
+ ? ReturnType<FN>
23
25
  : never;