@pagopa/io-react-native-wallet 2.1.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +4 -3
  2. package/lib/commonjs/credential/index.js +3 -1
  3. package/lib/commonjs/credential/index.js.map +1 -1
  4. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +82 -58
  5. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  6. package/lib/commonjs/credential/offer/01-start-flow.js +75 -0
  7. package/lib/commonjs/credential/offer/01-start-flow.js.map +1 -0
  8. package/lib/commonjs/credential/offer/02-fetch-credential-offer.js +45 -0
  9. package/lib/commonjs/credential/offer/02-fetch-credential-offer.js.map +1 -0
  10. package/lib/commonjs/credential/offer/README.md +174 -0
  11. package/lib/commonjs/credential/offer/errors.js +22 -0
  12. package/lib/commonjs/credential/offer/errors.js.map +1 -0
  13. package/lib/commonjs/credential/offer/index.js +25 -0
  14. package/lib/commonjs/credential/offer/index.js.map +1 -0
  15. package/lib/commonjs/credential/offer/types.js +51 -0
  16. package/lib/commonjs/credential/offer/types.js.map +1 -0
  17. package/lib/commonjs/credential/presentation/01-start-flow.js +1 -1
  18. package/lib/commonjs/credentials-catalogue/README.md +15 -0
  19. package/lib/commonjs/credentials-catalogue/fetch-and-parse-catalogue.js +42 -0
  20. package/lib/commonjs/credentials-catalogue/fetch-and-parse-catalogue.js.map +1 -0
  21. package/lib/commonjs/credentials-catalogue/index.js +13 -0
  22. package/lib/commonjs/credentials-catalogue/index.js.map +1 -0
  23. package/lib/commonjs/credentials-catalogue/types.js +99 -0
  24. package/lib/commonjs/credentials-catalogue/types.js.map +1 -0
  25. package/lib/commonjs/index.js +5 -1
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/commonjs/mdoc/index.js +15 -0
  28. package/lib/commonjs/mdoc/index.js.map +1 -1
  29. package/lib/commonjs/mdoc/utils.js +37 -1
  30. package/lib/commonjs/mdoc/utils.js.map +1 -1
  31. package/lib/commonjs/utils/nestedProperty.js +21 -10
  32. package/lib/commonjs/utils/nestedProperty.js.map +1 -1
  33. package/lib/commonjs/utils/zod.js +28 -0
  34. package/lib/commonjs/utils/zod.js.map +1 -0
  35. package/lib/module/credential/index.js +2 -1
  36. package/lib/module/credential/index.js.map +1 -1
  37. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +83 -59
  38. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  39. package/lib/module/credential/offer/01-start-flow.js +66 -0
  40. package/lib/module/credential/offer/01-start-flow.js.map +1 -0
  41. package/lib/module/credential/offer/02-fetch-credential-offer.js +38 -0
  42. package/lib/module/credential/offer/02-fetch-credential-offer.js.map +1 -0
  43. package/lib/module/credential/offer/README.md +174 -0
  44. package/lib/module/credential/offer/errors.js +14 -0
  45. package/lib/module/credential/offer/errors.js.map +1 -0
  46. package/lib/module/credential/offer/index.js +5 -0
  47. package/lib/module/credential/offer/index.js.map +1 -0
  48. package/lib/module/credential/offer/types.js +41 -0
  49. package/lib/module/credential/offer/types.js.map +1 -0
  50. package/lib/module/credential/presentation/01-start-flow.js +1 -1
  51. package/lib/module/credentials-catalogue/README.md +15 -0
  52. package/lib/module/credentials-catalogue/fetch-and-parse-catalogue.js +35 -0
  53. package/lib/module/credentials-catalogue/fetch-and-parse-catalogue.js.map +1 -0
  54. package/lib/module/credentials-catalogue/index.js +2 -0
  55. package/lib/module/credentials-catalogue/index.js.map +1 -0
  56. package/lib/module/credentials-catalogue/types.js +89 -0
  57. package/lib/module/credentials-catalogue/types.js.map +1 -0
  58. package/lib/module/index.js +3 -1
  59. package/lib/module/index.js.map +1 -1
  60. package/lib/module/mdoc/index.js +1 -0
  61. package/lib/module/mdoc/index.js.map +1 -1
  62. package/lib/module/mdoc/utils.js +35 -0
  63. package/lib/module/mdoc/utils.js.map +1 -1
  64. package/lib/module/utils/nestedProperty.js +21 -10
  65. package/lib/module/utils/nestedProperty.js.map +1 -1
  66. package/lib/module/utils/zod.js +20 -0
  67. package/lib/module/utils/zod.js.map +1 -0
  68. package/lib/typescript/credential/index.d.ts +2 -1
  69. package/lib/typescript/credential/index.d.ts.map +1 -1
  70. package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -1
  71. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  72. package/lib/typescript/credential/offer/01-start-flow.d.ts +172 -0
  73. package/lib/typescript/credential/offer/01-start-flow.d.ts.map +1 -0
  74. package/lib/typescript/credential/offer/02-fetch-credential-offer.d.ts +20 -0
  75. package/lib/typescript/credential/offer/02-fetch-credential-offer.d.ts.map +1 -0
  76. package/lib/typescript/credential/offer/errors.d.ts +10 -0
  77. package/lib/typescript/credential/offer/errors.d.ts.map +1 -0
  78. package/lib/typescript/credential/offer/index.d.ts +7 -0
  79. package/lib/typescript/credential/offer/index.d.ts.map +1 -0
  80. package/lib/typescript/credential/offer/types.d.ts +264 -0
  81. package/lib/typescript/credential/offer/types.d.ts.map +1 -0
  82. package/lib/typescript/credential/presentation/01-start-flow.d.ts +1 -1
  83. package/lib/typescript/credentials-catalogue/fetch-and-parse-catalogue.d.ts +15 -0
  84. package/lib/typescript/credentials-catalogue/fetch-and-parse-catalogue.d.ts.map +1 -0
  85. package/lib/typescript/credentials-catalogue/index.d.ts +3 -0
  86. package/lib/typescript/credentials-catalogue/index.d.ts.map +1 -0
  87. package/lib/typescript/credentials-catalogue/types.d.ts +844 -0
  88. package/lib/typescript/credentials-catalogue/types.d.ts.map +1 -0
  89. package/lib/typescript/index.d.ts +3 -1
  90. package/lib/typescript/index.d.ts.map +1 -1
  91. package/lib/typescript/mdoc/index.d.ts +1 -0
  92. package/lib/typescript/mdoc/index.d.ts.map +1 -1
  93. package/lib/typescript/mdoc/utils.d.ts +50 -0
  94. package/lib/typescript/mdoc/utils.d.ts.map +1 -1
  95. package/lib/typescript/utils/nestedProperty.d.ts +2 -1
  96. package/lib/typescript/utils/nestedProperty.d.ts.map +1 -1
  97. package/lib/typescript/utils/zod.d.ts +15 -0
  98. package/lib/typescript/utils/zod.d.ts.map +1 -0
  99. package/package.json +21 -2
  100. package/src/credential/index.ts +2 -1
  101. package/src/credential/issuance/01-start-flow.ts +1 -1
  102. package/src/credential/issuance/07-verify-and-parse-credential.ts +60 -26
  103. package/src/credential/offer/01-start-flow.ts +89 -0
  104. package/src/credential/offer/02-fetch-credential-offer.ts +54 -0
  105. package/src/credential/offer/README.md +174 -0
  106. package/src/credential/offer/errors.ts +17 -0
  107. package/src/credential/offer/index.ts +16 -0
  108. package/src/credential/offer/types.ts +59 -0
  109. package/src/credential/presentation/01-start-flow.ts +1 -1
  110. package/src/credentials-catalogue/README.md +15 -0
  111. package/src/credentials-catalogue/fetch-and-parse-catalogue.ts +54 -0
  112. package/src/credentials-catalogue/index.ts +2 -0
  113. package/src/credentials-catalogue/types.ts +97 -0
  114. package/src/index.ts +4 -0
  115. package/src/mdoc/index.ts +1 -0
  116. package/src/mdoc/utils.ts +43 -0
  117. package/src/utils/nestedProperty.ts +35 -10
  118. package/src/utils/zod.ts +28 -0
@@ -1 +1 @@
1
- {"version":3,"names":["isObject","buildName","display","reduce","names","_ref","locale","name","handleNullKeyCase","currentObject","rest","sourceValue","displayData","Array","isArray","node","existingValue","value","mappedArray","map","item","idx","createNestedProperty","handleStringKeyCase","key","nextSourceValue","isLeaf","length","hasRestKey","some","r","handleRestKey","nextObject","handleNumberKeyCase","newArray","nextValue","undefined","path","currentNode","restKey"],"sourceRoot":"../../../src","sources":["utils/nestedProperty.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,QAAQ;;AAEjC;;AAGA;;AAGA;;AAMA;;AAGA;;AAGA;AACA,MAAMC,SAAS,GAAIC,OAAoB,IACrCA,OAAO,CAACC,MAAM,CACZ,CAACC,KAAK,EAAAC,IAAA;EAAA,IAAE;IAAEC,MAAM;IAAEC;EAAK,CAAC,GAAAF,IAAA;EAAA,OAAM;IAAE,GAAGD,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;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMZ,oBAAoB,GAAGA,CAClCb,aAA8B,EAC9B4B,IAAU,EACV1B,WAAoB,EACpBC,WAAwB,KACJ;EACpB,MAAM,CAACY,GAAG,EAAE,GAAGd,IAAI,CAAC,GAAG2B,IAAI;EAE3B,QAAQ,IAAI;IACV,KAAKb,GAAG,KAAK,IAAI;MACf,OAAOhB,iBAAiB,CAACC,aAAa,EAAEC,IAAI,EAAEC,WAAW,EAAEC,WAAW,CAAC;IAEzE,KAAK,OAAOY,GAAG,KAAK,QAAQ;MAC1B,OAAOD,mBAAmB,CACxBd,aAAa,EACbe,GAAG,EACHd,IAAI,EACJC,WAAW,EACXC,WACF,CAAC;IAEH,KAAK,OAAOY,GAAG,KAAK,QAAQ;MAC1B,OAAOS,mBAAmB,CACxBxB,aAAa,EACbe,GAAG,EACHd,IAAI,EACJC,WAAW,EACXC,WACF,CAAC;IAEH;MACE,OAAOH,aAAa;EACxB;AACF,CAAC;;AAED;AACA,MAAMsB,aAAa,GAAGA,CACpBtB,aAAkC,EAClCe,GAAW,EACXd,IAAU,EACVC,WAAoC,EACpCC,WAAwB,KACJ;EACpB,MAAM0B,WAAW,GAAG7B,aAAa,CAACe,GAAG,CAAC,IAAI,CAAC,CAAC;EAC5C;EACA,MAAMe,OAAO,GAAG7B,IAAI,CAAC,CAAC,CAAW;EACjC,MAAMe,eAAe,GAAGd,WAAW,CAAC4B,OAAO,CAAC;;EAE5C;EACA,OAAO;IACL,GAAG9B,aAAa;IAChB,CAACe,GAAG,GAAG;MACL,GAAGc,WAAW;MACdrB,KAAK,EAAEK,oBAAoB,CACzBgB,WAAW,CAACrB,KAAK,IAAI,CAAC,CAAC,EACvBP,IAAI,EACJe,eAAe,EACfb,WACF;IACF;EACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["isObject","buildName","display","reduce","names","_ref","locale","name","handleNullKeyCase","currentObject","rest","sourceValue","displayData","Array","isArray","node","existingValue","value","mappedArray","map","item","idx","createNestedProperty","handleStringKeyCase","key","skipMissingLeaves","nextSourceValue","isLeaf","length","hasRestKey","some","r","handleRestKey","nextObject","handleNumberKeyCase","newArray","nextValue","undefined","path","arguments","currentNode","restKey"],"sourceRoot":"../../../src","sources":["utils/nestedProperty.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,QAAQ;;AAEjC;;AAGA;;AAGA;;AAMA;;AAGA;;AAGA;AACA,MAAMC,SAAS,GAAIC,OAAoB,IACrCA,OAAO,CAACC,MAAM,CACZ,CAACC,KAAK,EAAAC,IAAA;EAAA,IAAE;IAAEC,MAAM;IAAEC;EAAK,CAAC,GAAAF,IAAA;EAAA,OAAM;IAAE,GAAGD,KAAK;IAAE,CAACE,MAAM,GAAGC;EAAK,CAAC;AAAA,CAAC,EAC3D,CAAC,CACH,CAAC;;AAEH;AACA,MAAMC,iBAAiB,GAAGA,CACxBC,aAA8B,EAC9BC,IAAU,EACVC,WAAoB,EACpBC,WAAwB,KACJ;EACpB,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,WAAW,CAAC,EAAE,OAAOF,aAAa;;EAErD;EACA,MAAMM,IAAI,GAAGN,aAAiD;EAC9D,MAAMO,aAAa,GAAGH,KAAK,CAACC,OAAO,CAACC,IAAI,CAACE,KAAK,CAAC,GAAGF,IAAI,CAACE,KAAK,GAAG,EAAE;EAEjE,MAAMC,WAAW,GAAGP,WAAW,CAACQ,GAAG,CAAC,CAACC,IAAI,EAAEC,GAAG;EAC5C;EACA;EACAC,oBAAoB,CAClBN,aAAa,CAACK,GAAG,CAAC,IAAI,CAAC,CAAC,EACxBX,IAAI,EACJU,IAAI,EACJR,WAAW,EACX,IACF,CACF,CAAC;EAED,OAAO;IACL,GAAGG,IAAI;IACPE,KAAK,EAAEC,WAAW;IAClBX,IAAI,EAAEQ,IAAI,CAACR,IAAI,IAAIN,SAAS,CAACW,WAAW;EAC1C,CAAC;AACH,CAAC;;AAED;AACA,MAAMW,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ACbe,GAAG,EACHd,IAAI,EACJC,WAAW,EACXC,WACF,CAAC;IAEH;MACE,OAAOH,aAAa;EACxB;AACF,CAAC;;AAED;AACA,MAAMuB,aAAa,GAAGA,CACpBvB,aAAkC,EAClCe,GAAW,EACXd,IAAU,EACVC,WAAoC,EACpCC,WAAwB,KACJ;EACpB,MAAM4B,WAAW,GAAG/B,aAAa,CAACe,GAAG,CAAC,IAAI,CAAC,CAAC;EAC5C,MAAMiB,OAAO,GAAG/B,IAAI,CAAC,CAAC,CAAW;EACjC,MAAMgB,eAAe,GAAGf,WAAW,CAAC8B,OAAO,CAAC;EAC5C,IAAI,OAAOf,eAAe,KAAK,WAAW,EAAE;IAC1C,OAAOjB,aAAa;EACtB;EAEA,OAAO;IACL,GAAGA,aAAa;IAChB,CAACe,GAAG,GAAG;MACL,GAAGgB,WAAW;MACdvB,KAAK,EAAEK,oBAAoB,CACzBkB,WAAW,CAACvB,KAAK,IAAI,CAAC,CAAC,EACvBP,IAAI,EACJgB,eAAe,EACfd,WACF;IACF;EACF,CAAC;AACH,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @see https://github.com/JacobWeisenburger/zod_utilz/blob/main/src/stringToJSON.ts
3
+ */
4
+
5
+ import { z } from "zod";
6
+ const literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
7
+ const jsonSchema = z.lazy(() => z.union([literalSchema, z.array(jsonSchema), z.record(jsonSchema)]));
8
+ export const json = () => jsonSchema;
9
+ export const stringToJSONSchema = z.string().transform((str, ctx) => {
10
+ try {
11
+ return JSON.parse(str);
12
+ } catch (e) {
13
+ ctx.addIssue({
14
+ code: "custom",
15
+ message: "Invalid JSON"
16
+ });
17
+ return z.NEVER;
18
+ }
19
+ });
20
+ //# sourceMappingURL=zod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["z","literalSchema","union","string","number","boolean","null","jsonSchema","lazy","array","record","json","stringToJSONSchema","transform","str","ctx","JSON","parse","e","addIssue","code","message","NEVER"],"sourceRoot":"../../../src","sources":["utils/zod.ts"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,MAAMC,aAAa,GAAGD,CAAC,CAACE,KAAK,CAAC,CAACF,CAAC,CAACG,MAAM,CAAC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,EAAEJ,CAAC,CAACK,OAAO,CAAC,CAAC,EAAEL,CAAC,CAACM,IAAI,CAAC,CAAC,CAAC,CAAC;AAM9E,MAAMC,UAA2B,GAAGP,CAAC,CAACQ,IAAI,CAAC,MACzCR,CAAC,CAACE,KAAK,CAAC,CAACD,aAAa,EAAED,CAAC,CAACS,KAAK,CAACF,UAAU,CAAC,EAAEP,CAAC,CAACU,MAAM,CAACH,UAAU,CAAC,CAAC,CACpE,CAAC;AAED,OAAO,MAAMI,IAAI,GAAGA,CAAA,KAAMJ,UAAU;AAEpC,OAAO,MAAMK,kBAAkB,GAAGZ,CAAC,CAChCG,MAAM,CAAC,CAAC,CACRU,SAAS,CAAC,CAACC,GAAG,EAAEC,GAAG,KAAuC;EACzD,IAAI;IACF,OAAOC,IAAI,CAACC,KAAK,CAACH,GAAG,CAAC;EACxB,CAAC,CAAC,OAAOI,CAAC,EAAE;IACVH,GAAG,CAACI,QAAQ,CAAC;MAAEC,IAAI,EAAE,QAAQ;MAAEC,OAAO,EAAE;IAAe,CAAC,CAAC;IACzD,OAAOrB,CAAC,CAACsB,KAAK;EAChB;AACF,CAAC,CAAC"}
@@ -2,5 +2,6 @@ import * as Issuance from "./issuance";
2
2
  import * as Presentation from "./presentation";
3
3
  import * as Status from "./status";
4
4
  import * as Trustmark from "./trustmark";
5
- export { Issuance, Presentation, Status, Trustmark };
5
+ import * as Offer from "./offer";
6
+ export { Issuance, Presentation, Status, Trustmark, Offer };
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/credential/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/credential/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WARNING: This is the first function to be called in the issuing flow. The next function to be called is {@link evaluateIssuerTrust}.
3
3
  * The beginning of the issuing flow.
4
- * To be implemented accordind to the user touchpoint
4
+ * To be implemented according to the user touchpoint
5
5
  *
6
6
  * @returns The configuration ID of the Credential to be issued and the url of the Issuer
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"07-verify-and-parse-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/07-verify-and-parse-credential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAU/D,KAAK,UAAU,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,CAAC;AAQzD,MAAM,MAAM,wBAAwB,GAAG,CACrC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,EAC/C,yBAAyB,EAAE,MAAM,EACjC,OAAO,EAAE;IACP,uBAAuB,EAAE,aAAa,CAAC;IACvC;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,EACD,YAAY,CAAC,EAAE,MAAM,KAClB,OAAO,CAAC;IACX,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;CAC5B,CAAC,CAAC;AAGH,KAAK,gBAAgB,GAAG;IACtB,oBAAoB;IACpB,CAAC,KAAK,EAAE,MAAM,GAAG;QACf,IAAI,EACA,yBAAyB,CAAC,MAAM,CAC9B,MAAM,EACN,MAAM,CACP,GACD,4BAA4B,CAAC,MAAM,GACnC,SAAS,CAAC;QACd,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;CACH,CAAC;AA6XF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,EAAE,wBAuCtC,CAAC"}
1
+ {"version":3,"file":"07-verify-and-parse-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/07-verify-and-parse-credential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAU/D,KAAK,UAAU,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,CAAC;AAQzD,MAAM,MAAM,wBAAwB,GAAG,CACrC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,EAC/C,yBAAyB,EAAE,MAAM,EACjC,OAAO,EAAE;IACP,uBAAuB,EAAE,aAAa,CAAC;IACvC;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,EACD,YAAY,CAAC,EAAE,MAAM,KAClB,OAAO,CAAC;IACX,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;CAC5B,CAAC,CAAC;AAGH,KAAK,gBAAgB,GAAG;IACtB,oBAAoB;IACpB,CAAC,KAAK,EAAE,MAAM,GAAG;QACf,IAAI,EACA,yBAAyB,CAAC,MAAM,CAC9B,MAAM,EACN,MAAM,CACP,GACD,4BAA4B,CAAC,MAAM,GACnC,SAAS,CAAC;QACd,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;CACH,CAAC;AA+ZF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,EAAE,wBAuCtC,CAAC"}
@@ -0,0 +1,172 @@
1
+ import * as z from "zod";
2
+ declare const CredentialOfferParams: z.ZodUnion<[z.ZodObject<{
3
+ credential_offer: z.ZodPipeline<z.ZodEffects<z.ZodString, string | number | boolean | {
4
+ [key: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
5
+ } | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null, string>, z.ZodObject<{
6
+ credential_issuer: z.ZodString;
7
+ credential_configuration_ids: z.ZodArray<z.ZodString, "many">;
8
+ grants: z.ZodOptional<z.ZodObject<{
9
+ authorization_code: z.ZodOptional<z.ZodObject<{
10
+ issuer_state: z.ZodOptional<z.ZodString>;
11
+ authorization_server: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ issuer_state?: string | undefined;
14
+ authorization_server?: string | undefined;
15
+ }, {
16
+ issuer_state?: string | undefined;
17
+ authorization_server?: string | undefined;
18
+ }>>;
19
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code": z.ZodOptional<z.ZodObject<{
20
+ "pre-authorized_code": z.ZodString;
21
+ tx_code: z.ZodOptional<z.ZodObject<{
22
+ input_mode: z.ZodOptional<z.ZodEnum<["numeric", "text"]>>;
23
+ length: z.ZodOptional<z.ZodNumber>;
24
+ description: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ input_mode?: "numeric" | "text" | undefined;
27
+ length?: number | undefined;
28
+ description?: string | undefined;
29
+ }, {
30
+ input_mode?: "numeric" | "text" | undefined;
31
+ length?: number | undefined;
32
+ description?: string | undefined;
33
+ }>>;
34
+ authorization_server: z.ZodOptional<z.ZodString>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ "pre-authorized_code": string;
37
+ tx_code?: {
38
+ input_mode?: "numeric" | "text" | undefined;
39
+ length?: number | undefined;
40
+ description?: string | undefined;
41
+ } | undefined;
42
+ authorization_server?: string | undefined;
43
+ }, {
44
+ "pre-authorized_code": string;
45
+ tx_code?: {
46
+ input_mode?: "numeric" | "text" | undefined;
47
+ length?: number | undefined;
48
+ description?: string | undefined;
49
+ } | undefined;
50
+ authorization_server?: string | undefined;
51
+ }>>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ authorization_code?: {
54
+ issuer_state?: string | undefined;
55
+ authorization_server?: string | undefined;
56
+ } | undefined;
57
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
58
+ "pre-authorized_code": string;
59
+ tx_code?: {
60
+ input_mode?: "numeric" | "text" | undefined;
61
+ length?: number | undefined;
62
+ description?: string | undefined;
63
+ } | undefined;
64
+ authorization_server?: string | undefined;
65
+ } | undefined;
66
+ }, {
67
+ authorization_code?: {
68
+ issuer_state?: string | undefined;
69
+ authorization_server?: string | undefined;
70
+ } | undefined;
71
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
72
+ "pre-authorized_code": string;
73
+ tx_code?: {
74
+ input_mode?: "numeric" | "text" | undefined;
75
+ length?: number | undefined;
76
+ description?: string | undefined;
77
+ } | undefined;
78
+ authorization_server?: string | undefined;
79
+ } | undefined;
80
+ }>>;
81
+ }, "strip", z.ZodTypeAny, {
82
+ credential_issuer: string;
83
+ credential_configuration_ids: string[];
84
+ grants?: {
85
+ authorization_code?: {
86
+ issuer_state?: string | undefined;
87
+ authorization_server?: string | undefined;
88
+ } | undefined;
89
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
90
+ "pre-authorized_code": string;
91
+ tx_code?: {
92
+ input_mode?: "numeric" | "text" | undefined;
93
+ length?: number | undefined;
94
+ description?: string | undefined;
95
+ } | undefined;
96
+ authorization_server?: string | undefined;
97
+ } | undefined;
98
+ } | undefined;
99
+ }, {
100
+ credential_issuer: string;
101
+ credential_configuration_ids: string[];
102
+ grants?: {
103
+ authorization_code?: {
104
+ issuer_state?: string | undefined;
105
+ authorization_server?: string | undefined;
106
+ } | undefined;
107
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
108
+ "pre-authorized_code": string;
109
+ tx_code?: {
110
+ input_mode?: "numeric" | "text" | undefined;
111
+ length?: number | undefined;
112
+ description?: string | undefined;
113
+ } | undefined;
114
+ authorization_server?: string | undefined;
115
+ } | undefined;
116
+ } | undefined;
117
+ }>>;
118
+ credential_offer_uri: z.ZodUndefined;
119
+ }, "strip", z.ZodTypeAny, {
120
+ credential_offer: {
121
+ credential_issuer: string;
122
+ credential_configuration_ids: string[];
123
+ grants?: {
124
+ authorization_code?: {
125
+ issuer_state?: string | undefined;
126
+ authorization_server?: string | undefined;
127
+ } | undefined;
128
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
129
+ "pre-authorized_code": string;
130
+ tx_code?: {
131
+ input_mode?: "numeric" | "text" | undefined;
132
+ length?: number | undefined;
133
+ description?: string | undefined;
134
+ } | undefined;
135
+ authorization_server?: string | undefined;
136
+ } | undefined;
137
+ } | undefined;
138
+ };
139
+ credential_offer_uri?: undefined;
140
+ }, {
141
+ credential_offer: string;
142
+ credential_offer_uri?: undefined;
143
+ }>, z.ZodObject<{
144
+ credential_offer: z.ZodUndefined;
145
+ credential_offer_uri: z.ZodString;
146
+ }, "strip", z.ZodTypeAny, {
147
+ credential_offer_uri: string;
148
+ credential_offer?: undefined;
149
+ }, {
150
+ credential_offer_uri: string;
151
+ credential_offer?: undefined;
152
+ }>]>;
153
+ type CredentialOfferParams = z.infer<typeof CredentialOfferParams>;
154
+ /**
155
+ * The beginning of the credential offer flow.
156
+ * To be implemented according to the user touchpoint
157
+ *
158
+ * @param params Credential offer encoded url
159
+ * @returns Object containing the credential offer by reference or by value
160
+ */
161
+ export type StartFlow = (encodedUrl: string) => CredentialOfferParams;
162
+ /**
163
+ * Start a credential offer flow by validating and parse an encoded url
164
+ * extracted from a QR code or a deep link.
165
+ *
166
+ * @param params The encoded url to be validated and parsed
167
+ * @returns Object containing the credential offer by reference or by value
168
+ * @throws If the provided encoded url is not valid
169
+ */
170
+ export declare const startFlowFromQR: StartFlow;
171
+ export {};
172
+ //# sourceMappingURL=01-start-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/01-start-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAUzB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASzB,CAAC;AACH,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,qBAAqB,CAAC;AAEtE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,SAiD7B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { CredentialOffer } from "./types";
2
+ export type GetCredentialOffer = (credentialOfferUri: string, context: {
3
+ appFetch?: GlobalFetch["fetch"];
4
+ }) => Promise<CredentialOffer>;
5
+ /**
6
+ * Fetches and validates a credential offer from a given URI.
7
+ *
8
+ * This function performs an HTTP GET request to the specified `credentialOfferUri`,
9
+ * expecting a JSON response that matches the `CredentialOfferSchema`. If the response
10
+ * is invalid or does not conform to the schema, an error is logged and an
11
+ * `InvalidCredentialOfferError` is thrown.
12
+ *
13
+ * @param credentialOfferUri - The URI from which to fetch the credential offer.
14
+ * @param context - Optional context object that may provide a custom `appFetch` implementation.
15
+ * @returns The validated credential offer data.
16
+ * @throws {IssuerResponseError} If the HTTP response status is not 200.
17
+ * @throws {InvalidCredentialOfferError} If the response does not match the expected schema.
18
+ */
19
+ export declare const fetchCredentialOffer: GetCredentialOffer;
20
+ //# sourceMappingURL=02-fetch-credential-offer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"02-fetch-credential-offer.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/02-fetch-credential-offer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,MAAM,kBAAkB,GAAG,CAC/B,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE;IACP,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAyBlC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { IoWalletError } from "../../utils/errors";
2
+ export declare class InvalidCredentialOfferError extends IoWalletError {
3
+ code: string;
4
+ constructor(message?: string);
5
+ }
6
+ export declare class InvalidQRCodeError extends IoWalletError {
7
+ code: string;
8
+ constructor(message?: string);
9
+ }
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAa,2BAA4B,SAAQ,aAAa;IAC5D,IAAI,SAAkC;gBAE1B,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,IAAI,SAAyB;gBAEjB,OAAO,CAAC,EAAE,MAAM;CAG7B"}
@@ -0,0 +1,7 @@
1
+ import { startFlowFromQR, type StartFlow } from "./01-start-flow";
2
+ import { fetchCredentialOffer, type GetCredentialOffer } from "./02-fetch-credential-offer";
3
+ import * as Errors from "./errors";
4
+ export type { CredentialOffer, Grants, AuthorizationCodeGrant, PreAuthorizedCodeGrant, TransactionCode, } from "./types";
5
+ export { Errors, fetchCredentialOffer, startFlowFromQR };
6
+ export type { GetCredentialOffer, StartFlow };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,oBAAoB,EACpB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,YAAY,EACV,eAAe,EACf,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,264 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * OAuth 2.0 Authorization Code flow parameters.
4
+ */
5
+ export declare const AuthorizationCodeGrantSchema: z.ZodObject<{
6
+ issuer_state: z.ZodOptional<z.ZodString>;
7
+ authorization_server: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ issuer_state?: string | undefined;
10
+ authorization_server?: string | undefined;
11
+ }, {
12
+ issuer_state?: string | undefined;
13
+ authorization_server?: string | undefined;
14
+ }>;
15
+ export type AuthorizationCodeGrant = z.infer<typeof AuthorizationCodeGrantSchema>;
16
+ /**
17
+ * Transaction Code requirements for Pre-Authorized Code flow.
18
+ */
19
+ export declare const TransactionCodeSchema: z.ZodObject<{
20
+ input_mode: z.ZodOptional<z.ZodEnum<["numeric", "text"]>>;
21
+ length: z.ZodOptional<z.ZodNumber>;
22
+ description: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ input_mode?: "numeric" | "text" | undefined;
25
+ length?: number | undefined;
26
+ description?: string | undefined;
27
+ }, {
28
+ input_mode?: "numeric" | "text" | undefined;
29
+ length?: number | undefined;
30
+ description?: string | undefined;
31
+ }>;
32
+ export type TransactionCode = z.infer<typeof TransactionCodeSchema>;
33
+ /**
34
+ * Pre-Authorized Code flow parameters.
35
+ */
36
+ export declare const PreAuthorizedCodeGrantSchema: z.ZodObject<{
37
+ "pre-authorized_code": z.ZodString;
38
+ tx_code: z.ZodOptional<z.ZodObject<{
39
+ input_mode: z.ZodOptional<z.ZodEnum<["numeric", "text"]>>;
40
+ length: z.ZodOptional<z.ZodNumber>;
41
+ description: z.ZodOptional<z.ZodString>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ input_mode?: "numeric" | "text" | undefined;
44
+ length?: number | undefined;
45
+ description?: string | undefined;
46
+ }, {
47
+ input_mode?: "numeric" | "text" | undefined;
48
+ length?: number | undefined;
49
+ description?: string | undefined;
50
+ }>>;
51
+ authorization_server: z.ZodOptional<z.ZodString>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ "pre-authorized_code": string;
54
+ tx_code?: {
55
+ input_mode?: "numeric" | "text" | undefined;
56
+ length?: number | undefined;
57
+ description?: string | undefined;
58
+ } | undefined;
59
+ authorization_server?: string | undefined;
60
+ }, {
61
+ "pre-authorized_code": string;
62
+ tx_code?: {
63
+ input_mode?: "numeric" | "text" | undefined;
64
+ length?: number | undefined;
65
+ description?: string | undefined;
66
+ } | undefined;
67
+ authorization_server?: string | undefined;
68
+ }>;
69
+ export type PreAuthorizedCodeGrant = z.infer<typeof PreAuthorizedCodeGrantSchema>;
70
+ /**
71
+ * Supported grant types for Credential Offer.
72
+ */
73
+ export declare const GrantsSchema: z.ZodObject<{
74
+ authorization_code: z.ZodOptional<z.ZodObject<{
75
+ issuer_state: z.ZodOptional<z.ZodString>;
76
+ authorization_server: z.ZodOptional<z.ZodString>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ issuer_state?: string | undefined;
79
+ authorization_server?: string | undefined;
80
+ }, {
81
+ issuer_state?: string | undefined;
82
+ authorization_server?: string | undefined;
83
+ }>>;
84
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code": z.ZodOptional<z.ZodObject<{
85
+ "pre-authorized_code": z.ZodString;
86
+ tx_code: z.ZodOptional<z.ZodObject<{
87
+ input_mode: z.ZodOptional<z.ZodEnum<["numeric", "text"]>>;
88
+ length: z.ZodOptional<z.ZodNumber>;
89
+ description: z.ZodOptional<z.ZodString>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ input_mode?: "numeric" | "text" | undefined;
92
+ length?: number | undefined;
93
+ description?: string | undefined;
94
+ }, {
95
+ input_mode?: "numeric" | "text" | undefined;
96
+ length?: number | undefined;
97
+ description?: string | undefined;
98
+ }>>;
99
+ authorization_server: z.ZodOptional<z.ZodString>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ "pre-authorized_code": string;
102
+ tx_code?: {
103
+ input_mode?: "numeric" | "text" | undefined;
104
+ length?: number | undefined;
105
+ description?: string | undefined;
106
+ } | undefined;
107
+ authorization_server?: string | undefined;
108
+ }, {
109
+ "pre-authorized_code": string;
110
+ tx_code?: {
111
+ input_mode?: "numeric" | "text" | undefined;
112
+ length?: number | undefined;
113
+ description?: string | undefined;
114
+ } | undefined;
115
+ authorization_server?: string | undefined;
116
+ }>>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ authorization_code?: {
119
+ issuer_state?: string | undefined;
120
+ authorization_server?: string | undefined;
121
+ } | undefined;
122
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
123
+ "pre-authorized_code": string;
124
+ tx_code?: {
125
+ input_mode?: "numeric" | "text" | undefined;
126
+ length?: number | undefined;
127
+ description?: string | undefined;
128
+ } | undefined;
129
+ authorization_server?: string | undefined;
130
+ } | undefined;
131
+ }, {
132
+ authorization_code?: {
133
+ issuer_state?: string | undefined;
134
+ authorization_server?: string | undefined;
135
+ } | undefined;
136
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
137
+ "pre-authorized_code": string;
138
+ tx_code?: {
139
+ input_mode?: "numeric" | "text" | undefined;
140
+ length?: number | undefined;
141
+ description?: string | undefined;
142
+ } | undefined;
143
+ authorization_server?: string | undefined;
144
+ } | undefined;
145
+ }>;
146
+ export type Grants = z.infer<typeof GrantsSchema>;
147
+ /**
148
+ * Credential Offer object as defined in OpenID4VCI Section 4.1.1.
149
+ */
150
+ export declare const CredentialOfferSchema: z.ZodObject<{
151
+ credential_issuer: z.ZodString;
152
+ credential_configuration_ids: z.ZodArray<z.ZodString, "many">;
153
+ grants: z.ZodOptional<z.ZodObject<{
154
+ authorization_code: z.ZodOptional<z.ZodObject<{
155
+ issuer_state: z.ZodOptional<z.ZodString>;
156
+ authorization_server: z.ZodOptional<z.ZodString>;
157
+ }, "strip", z.ZodTypeAny, {
158
+ issuer_state?: string | undefined;
159
+ authorization_server?: string | undefined;
160
+ }, {
161
+ issuer_state?: string | undefined;
162
+ authorization_server?: string | undefined;
163
+ }>>;
164
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code": z.ZodOptional<z.ZodObject<{
165
+ "pre-authorized_code": z.ZodString;
166
+ tx_code: z.ZodOptional<z.ZodObject<{
167
+ input_mode: z.ZodOptional<z.ZodEnum<["numeric", "text"]>>;
168
+ length: z.ZodOptional<z.ZodNumber>;
169
+ description: z.ZodOptional<z.ZodString>;
170
+ }, "strip", z.ZodTypeAny, {
171
+ input_mode?: "numeric" | "text" | undefined;
172
+ length?: number | undefined;
173
+ description?: string | undefined;
174
+ }, {
175
+ input_mode?: "numeric" | "text" | undefined;
176
+ length?: number | undefined;
177
+ description?: string | undefined;
178
+ }>>;
179
+ authorization_server: z.ZodOptional<z.ZodString>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ "pre-authorized_code": string;
182
+ tx_code?: {
183
+ input_mode?: "numeric" | "text" | undefined;
184
+ length?: number | undefined;
185
+ description?: string | undefined;
186
+ } | undefined;
187
+ authorization_server?: string | undefined;
188
+ }, {
189
+ "pre-authorized_code": string;
190
+ tx_code?: {
191
+ input_mode?: "numeric" | "text" | undefined;
192
+ length?: number | undefined;
193
+ description?: string | undefined;
194
+ } | undefined;
195
+ authorization_server?: string | undefined;
196
+ }>>;
197
+ }, "strip", z.ZodTypeAny, {
198
+ authorization_code?: {
199
+ issuer_state?: string | undefined;
200
+ authorization_server?: string | undefined;
201
+ } | undefined;
202
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
203
+ "pre-authorized_code": string;
204
+ tx_code?: {
205
+ input_mode?: "numeric" | "text" | undefined;
206
+ length?: number | undefined;
207
+ description?: string | undefined;
208
+ } | undefined;
209
+ authorization_server?: string | undefined;
210
+ } | undefined;
211
+ }, {
212
+ authorization_code?: {
213
+ issuer_state?: string | undefined;
214
+ authorization_server?: string | undefined;
215
+ } | undefined;
216
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
217
+ "pre-authorized_code": string;
218
+ tx_code?: {
219
+ input_mode?: "numeric" | "text" | undefined;
220
+ length?: number | undefined;
221
+ description?: string | undefined;
222
+ } | undefined;
223
+ authorization_server?: string | undefined;
224
+ } | undefined;
225
+ }>>;
226
+ }, "strip", z.ZodTypeAny, {
227
+ credential_issuer: string;
228
+ credential_configuration_ids: string[];
229
+ grants?: {
230
+ authorization_code?: {
231
+ issuer_state?: string | undefined;
232
+ authorization_server?: string | undefined;
233
+ } | undefined;
234
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
235
+ "pre-authorized_code": string;
236
+ tx_code?: {
237
+ input_mode?: "numeric" | "text" | undefined;
238
+ length?: number | undefined;
239
+ description?: string | undefined;
240
+ } | undefined;
241
+ authorization_server?: string | undefined;
242
+ } | undefined;
243
+ } | undefined;
244
+ }, {
245
+ credential_issuer: string;
246
+ credential_configuration_ids: string[];
247
+ grants?: {
248
+ authorization_code?: {
249
+ issuer_state?: string | undefined;
250
+ authorization_server?: string | undefined;
251
+ } | undefined;
252
+ "urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
253
+ "pre-authorized_code": string;
254
+ tx_code?: {
255
+ input_mode?: "numeric" | "text" | undefined;
256
+ length?: number | undefined;
257
+ description?: string | undefined;
258
+ } | undefined;
259
+ authorization_server?: string | undefined;
260
+ } | undefined;
261
+ } | undefined;
262
+ }>;
263
+ export type CredentialOffer = z.infer<typeof CredentialOfferSchema>;
264
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;EAGvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -18,7 +18,7 @@ declare const PresentationParams: z.ZodObject<{
18
18
  export type PresentationParams = z.infer<typeof PresentationParams>;
19
19
  /**
20
20
  * The beginning of the presentation flow.
21
- * To be implemented accordind to the user touchpoint
21
+ * To be implemented according to the user touchpoint
22
22
  *
23
23
  * @param params Presentation parameters, depending on the starting touchpoint
24
24
  * @returns The url for the Relying Party to connect with
@@ -0,0 +1,15 @@
1
+ import { DigitalCredentialsCatalogue } from "./types";
2
+ type GetCatalogueContext = {
3
+ appFetch?: GlobalFetch["fetch"];
4
+ };
5
+ /**
6
+ * Fetch and parse the Digital Credential Catalogue from the Trust Anchor.
7
+ * The catalogue's JWT signature is verified against the Trust Anchor's JWKs.
8
+ *
9
+ * @param trustAnchorUrl Base URL of the Trust Anchor
10
+ * @param context.appFetch (optional) fetch API implementation. Default: built-in fetch
11
+ * @returns The Digital Credential Catalogue payload
12
+ */
13
+ export declare const fetchAndParseCatalogue: (trustAnchorBaseUrl: string, { appFetch }?: GetCatalogueContext) => Promise<DigitalCredentialsCatalogue["payload"]>;
14
+ export {};
15
+ //# sourceMappingURL=fetch-and-parse-catalogue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-and-parse-catalogue.d.ts","sourceRoot":"","sources":["../../../src/credentials-catalogue/fetch-and-parse-catalogue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAGtD,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,uBACb,MAAM,iBACJ,mBAAmB,KACxC,QAAQ,2BAA2B,CAAC,SAAS,CAAC,CAgChD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { fetchAndParseCatalogue } from "./fetch-and-parse-catalogue";
2
+ export { type DigitalCredentialsCatalogue } from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/credentials-catalogue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,SAAS,CAAC"}