@pagopa/io-react-native-wallet 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/credential/presentation/03-get-request-object.js +3 -2
- package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/05-verify-request-object.js +57 -22
- package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +9 -13
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js +85 -3
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/README.md +14 -4
- package/lib/commonjs/credential/presentation/errors.js +18 -11
- package/lib/commonjs/credential/presentation/errors.js.map +1 -1
- package/lib/commonjs/credential/presentation/index.js +6 -0
- package/lib/commonjs/credential/presentation/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +14 -7
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/commonjs/utils/error-codes.js +9 -1
- package/lib/commonjs/utils/error-codes.js.map +1 -1
- package/lib/commonjs/utils/errors.js +31 -14
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/module/credential/presentation/03-get-request-object.js +3 -2
- package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/module/credential/presentation/05-verify-request-object.js +58 -23
- package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +8 -12
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js +82 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/README.md +14 -4
- package/lib/module/credential/presentation/errors.js +9 -9
- package/lib/module/credential/presentation/errors.js.map +1 -1
- package/lib/module/credential/presentation/index.js +2 -2
- package/lib/module/credential/presentation/index.js.map +1 -1
- package/lib/module/credential/presentation/types.js +12 -6
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/module/utils/error-codes.js +7 -0
- package/lib/module/utils/error-codes.js.map +1 -1
- package/lib/module/utils/errors.js +23 -14
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +2 -1
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +30 -2
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/errors.d.ts +6 -7
- package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/index.d.ts +3 -3
- package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +24 -17
- package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
- package/lib/typescript/utils/error-codes.d.ts +8 -0
- package/lib/typescript/utils/error-codes.d.ts.map +1 -1
- package/lib/typescript/utils/errors.d.ts +32 -18
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/credential/presentation/03-get-request-object.ts +3 -2
- package/src/credential/presentation/05-verify-request-object.ts +73 -15
- package/src/credential/presentation/07-evaluate-dcql-query.ts +7 -17
- package/src/credential/presentation/08-send-authorization-response.ts +110 -3
- package/src/credential/presentation/README.md +14 -4
- package/src/credential/presentation/errors.ts +9 -9
- package/src/credential/presentation/index.ts +4 -0
- package/src/credential/presentation/types.ts +22 -10
- package/src/utils/error-codes.ts +11 -0
- package/src/utils/errors.ts +59 -29
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IoWalletError","serializeAttrs","AuthRequestDecodeError","code","constructor","message","claim","arguments","length","undefined","reason","NoSuitableKeysFoundInEntityConfiguration","scenario","InvalidQRCodeError","
|
1
|
+
{"version":3,"names":["IoWalletError","serializeAttrs","DcqlError","AuthRequestDecodeError","code","constructor","message","claim","arguments","length","undefined","reason","NoSuitableKeysFoundInEntityConfiguration","scenario","InvalidQRCodeError","InvalidRequestObjectError","MissingDataError","missingAttributes","CredentialsNotFoundError","details"],"sourceRoot":"../../../../src","sources":["credential/presentation/errors.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,cAAc,QAAQ,oBAAoB;AAClE,SAASC,SAAS,QAAQ,MAAM;;AAEhC;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,SAASH,aAAa,CAAC;EACxDI,IAAI,GAAG,oDAAoD;;EAE3D;;EAGA;;EAGAC,WAAWA,CACTC,OAAe,EAGf;IAAA,IAFAC,KAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAAA,IAC7BG,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAE9B,KAAK,CAACP,cAAc,CAAC;MAAEK,OAAO;MAAEC,KAAK;MAAEI;IAAO,CAAC,CAAC,CAAC;IACjD,IAAI,CAACJ,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACI,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wCAAwC,SAASZ,aAAa,CAAC;EAC1EI,IAAI,GAAG,gCAAgC;;EAEvC;AACF;AACA;EACEC,WAAWA,CAACQ,QAAgB,EAAE;IAC5B,MAAMP,OAAO,GAAI,0DAAyDO,QAAS,IAAG;IACtF,KAAK,CAACP,OAAO,CAAC;EAChB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMQ,kBAAkB,SAASd,aAAa,CAAC;EACpDI,IAAI,GAAG,qBAAqB;;EAE5B;;EAGAC,WAAWA,CAACM,MAAc,EAAE;IAC1B,KAAK,CAAC,iBAAiB,CAAC;IACxB,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMI,yBAAyB,SAASf,aAAa,CAAC;EAC3DI,IAAI,GAAG,4BAA4B;;EAEnC;;EAGAC,WAAWA,CAACC,OAAe,EAA0B;IAAA,IAAxBK,MAAM,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACjD,KAAK,CAACF,OAAO,CAAC;IACd,IAAI,CAACK,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMK,gBAAgB,SAAShB,aAAa,CAAC;EAClDI,IAAI,GAAG,kBAAkB;;EAEzB;AACF;AACA;EACEC,WAAWA,CAACY,iBAAyB,EAAE;IACrC,MAAMX,OAAO,GAAI,kCAAiCW,iBAAkB,GAAE;IACtE,KAAK,CAACX,OAAO,CAAC;EAChB;AACF;AAQA;AACA;AACA;AACA;AACA,OAAO,MAAMY,wBAAwB,SAASlB,aAAa,CAAC;EAC1DI,IAAI,GAAG,2BAA2B;EAGlC;AACF;AACA;EACEC,WAAWA,CAACc,OAAyB,EAAE;IACrC,KAAK,CAAC,uDAAuD,CAAC;IAC9D,IAAI,CAACA,OAAO,GAAGA,OAAO;EACxB;AACF"}
|
@@ -6,7 +6,7 @@ import { verifyRequestObject } from "./05-verify-request-object";
|
|
6
6
|
import { fetchPresentDefinition } from "./06-fetch-presentation-definition";
|
7
7
|
import { evaluateInputDescriptors, prepareLegacyRemotePresentations } from "./07-evaluate-input-descriptor";
|
8
8
|
import { evaluateDcqlQuery, prepareRemotePresentations } from "./07-evaluate-dcql-query";
|
9
|
-
import { sendAuthorizationResponse, sendLegacyAuthorizationResponse } from "./08-send-authorization-response";
|
9
|
+
import { sendAuthorizationResponse, sendLegacyAuthorizationResponse, sendAuthorizationErrorResponse } from "./08-send-authorization-response";
|
10
10
|
import * as Errors from "./errors";
|
11
|
-
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, getJwksFromConfig, verifyRequestObject, fetchPresentDefinition, evaluateInputDescriptors, evaluateDcqlQuery, prepareLegacyRemotePresentations, prepareRemotePresentations, sendAuthorizationResponse, sendLegacyAuthorizationResponse, Errors };
|
11
|
+
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, getJwksFromConfig, verifyRequestObject, fetchPresentDefinition, evaluateInputDescriptors, evaluateDcqlQuery, prepareLegacyRemotePresentations, prepareRemotePresentations, sendAuthorizationResponse, sendLegacyAuthorizationResponse, sendAuthorizationErrorResponse, Errors };
|
12
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["startFlowFromQR","evaluateRelyingPartyTrust","getRequestObject","getJwksFromConfig","verifyRequestObject","fetchPresentDefinition","evaluateInputDescriptors","prepareLegacyRemotePresentations","evaluateDcqlQuery","prepareRemotePresentations","sendAuthorizationResponse","sendLegacyAuthorizationResponse","Errors"],"sourceRoot":"../../../../src","sources":["credential/presentation/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAwB,iBAAiB;AACjE,SACEC,yBAAyB,QAEpB,wBAAwB;AAC/B,SACEC,gBAAgB,QAEX,yBAAyB;AAChC,SAASC,iBAAiB,QAAwB,uBAAuB;AACzE,SACEC,mBAAmB,QAEd,4BAA4B;AACnC,SACEC,sBAAsB,QAEjB,oCAAoC;AAC3C,SACEC,wBAAwB,EACxBC,gCAAgC,QAG3B,gCAAgC;AACvC,SACEC,iBAAiB,EACjBC,0BAA0B,QAGrB,0BAA0B;AACjC,SACEC,yBAAyB,EAEzBC,+BAA+B,
|
1
|
+
{"version":3,"names":["startFlowFromQR","evaluateRelyingPartyTrust","getRequestObject","getJwksFromConfig","verifyRequestObject","fetchPresentDefinition","evaluateInputDescriptors","prepareLegacyRemotePresentations","evaluateDcqlQuery","prepareRemotePresentations","sendAuthorizationResponse","sendLegacyAuthorizationResponse","sendAuthorizationErrorResponse","Errors"],"sourceRoot":"../../../../src","sources":["credential/presentation/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAwB,iBAAiB;AACjE,SACEC,yBAAyB,QAEpB,wBAAwB;AAC/B,SACEC,gBAAgB,QAEX,yBAAyB;AAChC,SAASC,iBAAiB,QAAwB,uBAAuB;AACzE,SACEC,mBAAmB,QAEd,4BAA4B;AACnC,SACEC,sBAAsB,QAEjB,oCAAoC;AAC3C,SACEC,wBAAwB,EACxBC,gCAAgC,QAG3B,gCAAgC;AACvC,SACEC,iBAAiB,EACjBC,0BAA0B,QAGrB,0BAA0B;AACjC,SACEC,yBAAyB,EAEzBC,+BAA+B,EAE/BC,8BAA8B,QAEzB,kCAAkC;AACzC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAElC,SACEb,eAAe,EACfC,yBAAyB,EACzBC,gBAAgB,EAChBC,iBAAiB,EACjBC,mBAAmB,EACnBC,sBAAsB,EACtBC,wBAAwB,EACxBE,iBAAiB,EACjBD,gCAAgC,EAChCE,0BAA0B,EAC1BC,yBAAyB,EACzBC,+BAA+B,EAC/BC,8BAA8B,EAC9BC,MAAM"}
|
@@ -118,23 +118,29 @@ export const RequestObjectWalletCapabilities = z.object({
|
|
118
118
|
});
|
119
119
|
|
120
120
|
/**
|
121
|
-
*
|
122
|
-
*
|
121
|
+
* This type models the possible error responses the OpenID4VP protocol allows for a presentation of a credential.
|
122
|
+
* When the Wallet encounters one of these errors, it will notify the Relying Party through the `response_uri` endpoint.
|
123
|
+
* See https://italia.github.io/eid-wallet-it-docs/versione-corrente/en/pid-eaa-presentation.html#authorization-response-errors for more information.
|
123
124
|
*/
|
124
125
|
|
126
|
+
export const ErrorResponse = z.enum(["invalid_request_object", "invalid_request_uri", "vp_formats_not_supported", "invalid_request", "access_denied", "invalid_client"]);
|
127
|
+
|
125
128
|
/**
|
126
129
|
* @deprecated Use `DirectAuthorizationBodyPayload`
|
127
130
|
*/
|
128
|
-
|
131
|
+
const LegacyDirectAuthorizationBodyPayload = z.object({
|
129
132
|
vp_token: z.union([z.string(), z.array(z.string())]).optional(),
|
130
133
|
presentation_submission: z.record(z.string(), z.unknown())
|
131
134
|
});
|
132
135
|
|
133
136
|
/**
|
134
|
-
* Authorization Response payload
|
137
|
+
* Authorization Response payload sent to the Relying Party.
|
135
138
|
*/
|
136
139
|
|
137
|
-
export const DirectAuthorizationBodyPayload = z.object({
|
140
|
+
export const DirectAuthorizationBodyPayload = z.union([z.object({
|
138
141
|
vp_token: z.record(z.string(), z.string())
|
139
|
-
})
|
142
|
+
}), z.object({
|
143
|
+
error: ErrorResponse,
|
144
|
+
error_description: z.string()
|
145
|
+
}), LegacyDirectAuthorizationBodyPayload]);
|
140
146
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnixTime","z","Fields","object","path","array","string","min","id","optional","purpose","name","filter","any","boolean","intent_to_retain","Constraints","fields","limit_disclosure","enum","InputDescriptor","format","record","constraints","group","SubmissionRequirement","rule","from","from_nested","count","number","PresentationDefinition","input_descriptors","submission_requirements","RequestObject","iss","iat","exp","state","nonce","response_uri","response_uri_method","response_type","literal","response_mode","client_id","dcql_query","scope","presentation_definition","WalletMetadata","presentation_definition_uri_supported","client_id_schemes_supported","request_object_signing_alg_values_supported","vp_formats_supported","RequestObjectWalletCapabilities","wallet_metadata","wallet_nonce","LegacyDirectAuthorizationBodyPayload","vp_token","union","presentation_submission","unknown","DirectAuthorizationBodyPayload"],"sourceRoot":"../../../../src","sources":["credential/presentation/types.ts"],"mappings":"AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,OAAO,KAAKC,CAAC,MAAM,KAAK;;AAExB;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAQA,MAAMC,MAAM,GAAGD,CAAC,CAACE,MAAM,CAAC;EAC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GF,OAAO,MAAMwC,cAAc,GAAGhD,CAAC,CAACE,MAAM,CAAC;EACrC+C,qCAAqC,EAAEjD,CAAC,CAACa,OAAO,CAAC,CAAC,CAACL,QAAQ,CAAC,CAAC;EAC7D0C,2BAA2B,EAAElD,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAC3D2C,2CAA2C,EAAEnD,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAC3E4C,oBAAoB,EAAEpD,CAAC,CAACqB,MAAM,CAC5BrB,CAAC,CAACK,MAAM,CAAC,CAAC;EAAE;EACZL,CAAC,CAACE,MAAM,CAAC;IACP,mBAAmB,EAAEF,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC,CAAE;EACvD,CAAC,CACH;EACA;AACF,CAAC,CAAC;;AAEF;AACA;AACA;AACA;;AAIA,OAAO,MAAM6C,+BAA+B,GAAGrD,CAAC,CAACE,MAAM,CAAC;EACtDoD,eAAe,EAAEN,cAAc;EAC/BO,YAAY,EAAEvD,CAAC,CAACK,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC;AACpC,CAAC,CAAC;;AAEF;AACA;AACA;AACA;;
|
1
|
+
{"version":3,"names":["UnixTime","z","Fields","object","path","array","string","min","id","optional","purpose","name","filter","any","boolean","intent_to_retain","Constraints","fields","limit_disclosure","enum","InputDescriptor","format","record","constraints","group","SubmissionRequirement","rule","from","from_nested","count","number","PresentationDefinition","input_descriptors","submission_requirements","RequestObject","iss","iat","exp","state","nonce","response_uri","response_uri_method","response_type","literal","response_mode","client_id","dcql_query","scope","presentation_definition","WalletMetadata","presentation_definition_uri_supported","client_id_schemes_supported","request_object_signing_alg_values_supported","vp_formats_supported","RequestObjectWalletCapabilities","wallet_metadata","wallet_nonce","ErrorResponse","LegacyDirectAuthorizationBodyPayload","vp_token","union","presentation_submission","unknown","DirectAuthorizationBodyPayload","error","error_description"],"sourceRoot":"../../../../src","sources":["credential/presentation/types.ts"],"mappings":"AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,OAAO,KAAKC,CAAC,MAAM,KAAK;;AAExB;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAQA,MAAMC,MAAM,GAAGD,CAAC,CAACE,MAAM,CAAC;EACtBC,IAAI,EAAEH,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAAC;EAAE;EAClCC,EAAE,EAAEP,CAAC,CAACK,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAAE;EAC3BC,OAAO,EAAET,CAAC,CAACK,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAAE;EAChCE,IAAI,EAAEV,CAAC,CAACK,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAAE;EAC7BG,MAAM,EAAEX,CAAC,CAACY,GAAG,CAAC,CAAC,CAACJ,QAAQ,CAAC,CAAC;EAAE;EAC5BA,QAAQ,EAAER,CAAC,CAACa,OAAO,CAAC,CAAC,CAACL,QAAQ,CAAC,CAAC;EAAE;EAClCM,gBAAgB,EAAEd,CAAC,CAACa,OAAO,CAAC,CAAC,CAACL,QAAQ,CAAC,CAAC,CAAE;AAC5C,CAAC,CAAC;;AAEF;AACA,MAAMO,WAAW,GAAGf,CAAC,CAACE,MAAM,CAAC;EAC3Bc,MAAM,EAAEhB,CAAC,CAACI,KAAK,CAACH,MAAM,CAAC,CAACO,QAAQ,CAAC,CAAC;EAAE;EACpCS,gBAAgB,EAAEjB,CAAC,CAACkB,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAACV,QAAQ,CAAC,CAAC,CAAE;AAClE,CAAC,CAAC;;A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I,CAAC,CAClC,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,EACjB,eAAe,EACf,gBAAgB,CACjB,CAAC;;AAEF;AACA;AACA;AACA,MAAMuC,oCAAoC,GAAGzD,CAAC,CAACE,MAAM,CAAC;EACpDwD,QAAQ,EAAE1D,CAAC,CAAC2D,KAAK,CAAC,CAAC3D,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAC/DoD,uBAAuB,EAAE5D,CAAC,CAACqB,MAAM,CAACrB,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAAC6D,OAAO,CAAC,CAAC;AAC3D,CAAC,CAAC;;AAEF;AACA;AACA;;AAIA,OAAO,MAAMC,8BAA8B,GAAG9D,CAAC,CAAC2D,KAAK,CAAC,CACpD3D,CAAC,CAACE,MAAM,CAAC;EACPwD,QAAQ,EAAE1D,CAAC,CAACqB,MAAM,CAACrB,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAACK,MAAM,CAAC,CAAC;AAC3C,CAAC,CAAC,EACFL,CAAC,CAACE,MAAM,CAAC;EAAE6D,KAAK,EAAEP,aAAa;EAAEQ,iBAAiB,EAAEhE,CAAC,CAACK,MAAM,CAAC;AAAE,CAAC,CAAC,EACjEoD,oCAAoC,CACrC,CAAC"}
|
@@ -40,4 +40,11 @@ export const WalletProviderResponseErrorCodes = {
|
|
40
40
|
*/
|
41
41
|
WalletInstanceNotFound: "ERR_IO_WALLET_INSTANCE_NOT_FOUND"
|
42
42
|
};
|
43
|
+
export const RelyingPartyResponseErrorCodes = {
|
44
|
+
RelyingPartyGenericError: "ERR_RP_GENERIC_ERROR",
|
45
|
+
/**
|
46
|
+
* An error code thrown then the Relying Party rejects the Wallet's Authorization Response.
|
47
|
+
*/
|
48
|
+
InvalidAuthorizationResponse: "ERR_RP_INVALID_AUTHORIZATION_RESPONSE"
|
49
|
+
};
|
43
50
|
//# sourceMappingURL=error-codes.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IssuerResponseErrorCodes","IssuerGenericError","CredentialIssuingNotSynchronous","CredentialRequestFailed","CredentialInvalidStatus","StatusAttestationRequestFailed","WalletProviderResponseErrorCodes","WalletProviderGenericError","WalletInstanceCreationFailed","WalletInstanceAttestationIssuingFailed","WalletInstanceIntegrityFailed","WalletInstanceRevoked","WalletInstanceNotFound"],"sourceRoot":"../../../src","sources":["utils/error-codes.ts"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB,GAAG;EACtCC,kBAAkB,EAAE,0BAA0B;EAC9C;AACF;AACA;EACEC,+BAA+B,EAAE,wCAAwC;EACzE;AACF;AACA;EACEC,uBAAuB,EAAE,+BAA+B;EACxD;AACF;AACA;EACEC,uBAAuB,EAAE,+BAA+B;EACxD;AACF;AACA;EACEC,8BAA8B,EAAE;AAClC,CAAU;AAEV,OAAO,MAAMC,gCAAgC,GAAG;EAC9CC,0BAA0B,EAAE,sCAAsC;EAClE;AACF;AACA;EACEC,4BAA4B,EAAE,wCAAwC;EACtE;AACF;AACA;EACEC,sCAAsC,EACpC,mDAAmD;EACrD;AACF;AACA;EACEC,6BAA6B,EAAE,yCAAyC;EACxE;AACF;AACA;EACEC,qBAAqB,EAAE,gCAAgC;EACvD;AACF;AACA;EACEC,sBAAsB,EAAE;AAC1B,CAAU"}
|
1
|
+
{"version":3,"names":["IssuerResponseErrorCodes","IssuerGenericError","CredentialIssuingNotSynchronous","CredentialRequestFailed","CredentialInvalidStatus","StatusAttestationRequestFailed","WalletProviderResponseErrorCodes","WalletProviderGenericError","WalletInstanceCreationFailed","WalletInstanceAttestationIssuingFailed","WalletInstanceIntegrityFailed","WalletInstanceRevoked","WalletInstanceNotFound","RelyingPartyResponseErrorCodes","RelyingPartyGenericError","InvalidAuthorizationResponse"],"sourceRoot":"../../../src","sources":["utils/error-codes.ts"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB,GAAG;EACtCC,kBAAkB,EAAE,0BAA0B;EAC9C;AACF;AACA;EACEC,+BAA+B,EAAE,wCAAwC;EACzE;AACF;AACA;EACEC,uBAAuB,EAAE,+BAA+B;EACxD;AACF;AACA;EACEC,uBAAuB,EAAE,+BAA+B;EACxD;AACF;AACA;EACEC,8BAA8B,EAAE;AAClC,CAAU;AAEV,OAAO,MAAMC,gCAAgC,GAAG;EAC9CC,0BAA0B,EAAE,sCAAsC;EAClE;AACF;AACA;EACEC,4BAA4B,EAAE,wCAAwC;EACtE;AACF;AACA;EACEC,sCAAsC,EACpC,mDAAmD;EACrD;AACF;AACA;EACEC,6BAA6B,EAAE,yCAAyC;EACxE;AACF;AACA;EACEC,qBAAqB,EAAE,gCAAgC;EACvD;AACF;AACA;EACEC,sBAAsB,EAAE;AAC1B,CAAU;AAEV,OAAO,MAAMC,8BAA8B,GAAG;EAC5CC,wBAAwB,EAAE,sBAAsB;EAChD;AACF;AACA;EACEC,4BAA4B,EAAE;AAChC,CAAU"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes } from "./error-codes";
|
2
|
-
export { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes };
|
1
|
+
import { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes, RelyingPartyResponseErrorCodes } from "./error-codes";
|
2
|
+
export { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes, RelyingPartyResponseErrorCodes };
|
3
3
|
|
4
4
|
// An error reason that supports both a string and a generic JSON object
|
5
5
|
|
@@ -94,8 +94,6 @@ export class UnexpectedStatusCodeError extends IoWalletError {
|
|
94
94
|
/**
|
95
95
|
* An error subclass thrown when an Issuer HTTP request fails.
|
96
96
|
* The specific error can be found in the `code` property.
|
97
|
-
*
|
98
|
-
* The class is generic over the error code to narrow down the reason.
|
99
97
|
*/
|
100
98
|
export class IssuerResponseError extends UnexpectedStatusCodeError {
|
101
99
|
constructor(params) {
|
@@ -115,6 +113,17 @@ export class WalletProviderResponseError extends UnexpectedStatusCodeError {
|
|
115
113
|
this.code = params.code ?? WalletProviderResponseErrorCodes.WalletProviderGenericError;
|
116
114
|
}
|
117
115
|
}
|
116
|
+
|
117
|
+
/**
|
118
|
+
* An error subclass thrown when a Relying Party HTTP request fails.
|
119
|
+
* The specific error can be found in the `code` property.
|
120
|
+
*/
|
121
|
+
export class RelyingPartyResponseError extends UnexpectedStatusCodeError {
|
122
|
+
constructor(params) {
|
123
|
+
super(params);
|
124
|
+
this.code = params.code ?? RelyingPartyResponseErrorCodes.RelyingPartyGenericError;
|
125
|
+
}
|
126
|
+
}
|
118
127
|
/**
|
119
128
|
* Function to extract the error message from the Entity Configuration's supported error codes.
|
120
129
|
* @param errorCode The error code to map to a meaningful message
|
@@ -152,18 +161,18 @@ export function extractErrorMessageFromIssuerConf(errorCode, _ref5) {
|
|
152
161
|
}
|
153
162
|
|
154
163
|
/**
|
155
|
-
*
|
156
|
-
*
|
157
|
-
* @param
|
164
|
+
* Factory function to create a type guard for specific error classes.
|
165
|
+
*
|
166
|
+
* @param errorClass The error class to create the type guard for
|
167
|
+
* @returns A type guard that checks if the error is an instance of the given class and has the expected code
|
158
168
|
*/
|
159
|
-
|
169
|
+
const makeErrorTypeGuard = ErrorClass => (error, code) => error instanceof ErrorClass && error.code === (code ?? error.code);
|
170
|
+
export const isIssuerResponseError = makeErrorTypeGuard(IssuerResponseError);
|
171
|
+
export const isWalletProviderResponseError = makeErrorTypeGuard(WalletProviderResponseError);
|
172
|
+
export const isRelyingPartyResponseError = makeErrorTypeGuard(RelyingPartyResponseError);
|
173
|
+
|
174
|
+
// Mapping type between error classes and their allowed codes
|
160
175
|
|
161
|
-
/**
|
162
|
-
* Type guard for wallet provider errors.
|
163
|
-
* @param error The error to check
|
164
|
-
* @param code Optional code to narrow down the wallet provider error
|
165
|
-
*/
|
166
|
-
export const isWalletProviderResponseError = (error, code) => error instanceof WalletProviderResponseError && error.code === (code ?? error.code);
|
167
176
|
/**
|
168
177
|
* Builder class used to create specialized errors from type {@link UnexpectedStatusCodeError} that handles multiple status codes.
|
169
178
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IssuerResponseErrorCodes","WalletProviderResponseErrorCodes","serializeAttrs","attrs","Object","entries","filter","_ref","v","undefined","map","_ref2","k","Array","isArray","join","JSON","stringify","_","IoWalletError","Error","code","constructor","message","name","ValidationFailed","_ref3","claim","reason","UnexpectedStatusCodeError","_ref4","statusCode","IssuerResponseError","params","IssuerGenericError","WalletProviderResponseError","WalletProviderGenericError","extractErrorMessageFromIssuerConf","errorCode","_ref5","issuerConf","credentialType","credentialConfiguration","openid_credential_issuer","credential_configurations_supported","issuance_errors_supported","localesList","display","reduce","acc","_ref6","locale","rest","
|
1
|
+
{"version":3,"names":["IssuerResponseErrorCodes","WalletProviderResponseErrorCodes","RelyingPartyResponseErrorCodes","serializeAttrs","attrs","Object","entries","filter","_ref","v","undefined","map","_ref2","k","Array","isArray","join","JSON","stringify","_","IoWalletError","Error","code","constructor","message","name","ValidationFailed","_ref3","claim","reason","UnexpectedStatusCodeError","_ref4","statusCode","IssuerResponseError","params","IssuerGenericError","WalletProviderResponseError","WalletProviderGenericError","RelyingPartyResponseError","RelyingPartyGenericError","extractErrorMessageFromIssuerConf","errorCode","_ref5","issuerConf","credentialType","credentialConfiguration","openid_credential_issuer","credential_configurations_supported","issuance_errors_supported","localesList","display","reduce","acc","_ref6","locale","rest","makeErrorTypeGuard","ErrorClass","error","isIssuerResponseError","isWalletProviderResponseError","isRelyingPartyResponseError","ResponseErrorBuilder","errorCases","handle","status","buildFrom","originalError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAEA,SACEA,wBAAwB,EACxBC,gCAAgC,EAChCC,8BAA8B,QAIzB,eAAe;AAEtB,SACEF,wBAAwB,EACxBC,gCAAgC,EAChCC,8BAA8B;;AAGhC;;AAGA;AAC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CAC3DlB,yBACF,CAAC;;AAED;;AAuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMwB,oBAAoB,CAA6C;EACpEC,UAAU,GAEd,CAAC,CAAC;EAENxC,WAAWA,CAASkC,UAAa,EAAE;IAAA,KAAfA,UAAa,GAAbA,UAAa;EAAG;EAEpCO,MAAMA,CAACC,MAAoB,EAAE/B,MAAoB,EAAE;IACjD,IAAI,CAAC6B,UAAU,CAACE,MAAM,CAAC,GAAG/B,MAAM;IAChC,OAAO,IAAI;EACb;EAEAgC,SAASA,CAACC,aAAwC,EAAE;IAClD,MAAMjC,MAAM,GACV,IAAI,CAAC6B,UAAU,CAACI,aAAa,CAACnC,UAAU,CAAC,IAAI,IAAI,CAAC+B,UAAU,CAAC,GAAG,CAAC;IAEnE,IAAI7B,MAAM,EAAE;MACV,OAAO,IAAI,IAAI,CAACuB,UAAU,CAAC;QAAE,GAAGU,aAAa;QAAE,GAAGjC;MAAO,CAAC,CAAC;IAC7D;IAEA,OAAOiC,aAAa;EACtB;AACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"03-get-request-object.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/03-get-request-object.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"03-get-request-object.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/03-get-request-object.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,+BAA+B,CAAC;CACtD,KACE,OAAO,CAAC;IAAE,uBAAuB,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElD;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAsC9B,CAAC"}
|
@@ -9,12 +9,13 @@ export type VerifyRequestObject = (requestObjectEncodedJwt: string, context: {
|
|
9
9
|
requestObject: RequestObject;
|
10
10
|
}>;
|
11
11
|
/**
|
12
|
-
* Function to verify the Request Object's signature
|
12
|
+
* Function to verify the Request Object's validity, from the signature to the required properties.
|
13
13
|
* @param requestObjectEncodedJwt The Request Object in JWT format
|
14
14
|
* @param context.clientId The client ID to verify
|
15
15
|
* @param context.rpConf The Entity Configuration of the Relying Party
|
16
16
|
* @param context.state Optional state
|
17
17
|
* @returns The verified Request Object
|
18
|
+
* @throws {InvalidRequestObjectError} if the Request Object cannot be validated
|
18
19
|
*/
|
19
20
|
export declare const verifyRequestObject: VerifyRequestObject;
|
20
21
|
//# sourceMappingURL=05-verify-request-object.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"05-verify-request-object.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/05-verify-request-object.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,MAAM,mBAAmB,GAAG,CAChC,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,KACE,OAAO,CAAC;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAE/C
|
1
|
+
{"version":3,"file":"05-verify-request-object.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/05-verify-request-object.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,MAAM,mBAAmB,GAAG,CAChC,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,KACE,OAAO,CAAC;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAE/C;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAsCjC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"07-evaluate-dcql-query.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/07-evaluate-dcql-query.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"07-evaluate-dcql-query.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/07-evaluate-dcql-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA8B,MAAM,MAAM,CAAC;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD;;GAEG;AACH,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAC9B,gBAAgB,EAAE,CAAC,MAAM,EAAe,MAAM,CAAkB,EAAE,EAClE,KAAK,EAAE,SAAS,CAAC,KAAK,KACnB;IACH,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,UAAU,EAAE,CAAC;IAClC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,EAAE,CAAC;AAEJ,MAAM,MAAM,0BAA0B,GAAG,CACvC,WAAW,EAAE;IACX,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,EAAE,EACH,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAwEnC,eAAO,MAAM,iBAAiB,EAAE,iBAkE/B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,0BAqBxC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { type FetchJwks } from "./04-retrieve-rp-jwks";
|
2
2
|
import type { VerifyRequestObject } from "./05-verify-request-object";
|
3
3
|
import { type Out } from "../../utils/misc";
|
4
|
-
import { type RemotePresentation, DirectAuthorizationBodyPayload, type LegacyRemotePresentation
|
4
|
+
import { type RemotePresentation, DirectAuthorizationBodyPayload, ErrorResponse, type LegacyRemotePresentation } from "./types";
|
5
5
|
import * as z from "zod";
|
6
6
|
import type { JWK } from "../../utils/jwk";
|
7
7
|
import type { RelyingPartyEntityConfiguration } from "../../trust";
|
@@ -36,7 +36,15 @@ export declare const choosePublicKeyToEncrypt: (rpJwkKeys: Out<FetchJwks>["keys"
|
|
36
36
|
* @param payload - Object that contains the VP token to encrypt and the mapping of the credential disclosures
|
37
37
|
* @returns A URL-encoded string for an `application/x-www-form-urlencoded` POST body, where `response` contains the encrypted JWE.
|
38
38
|
*/
|
39
|
-
export declare const buildDirectPostJwtBody: (requestObject: Out<VerifyRequestObject>["requestObject"], rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"], payload: DirectAuthorizationBodyPayload
|
39
|
+
export declare const buildDirectPostJwtBody: (requestObject: Out<VerifyRequestObject>["requestObject"], rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"], payload: DirectAuthorizationBodyPayload) => Promise<string>;
|
40
|
+
/**
|
41
|
+
* Builds a URL-encoded form body for a direct POST response without encryption.
|
42
|
+
*
|
43
|
+
* @param requestObject - Contains state, nonce, and other relevant info.
|
44
|
+
* @param payload - Object that contains either the VP token to encrypt and the stringified mapping of the credential disclosures or the error code
|
45
|
+
* @returns A URL-encoded string suitable for an `application/x-www-form-urlencoded` POST body.
|
46
|
+
*/
|
47
|
+
export declare const buildDirectPostBody: (requestObject: Out<VerifyRequestObject>["requestObject"], payload: DirectAuthorizationBodyPayload) => Promise<string>;
|
40
48
|
/**
|
41
49
|
* Type definition for the function that sends the authorization response
|
42
50
|
* to the Relying Party, completing the presentation flow.
|
@@ -67,4 +75,24 @@ export type SendAuthorizationResponse = (requestObject: Out<VerifyRequestObject>
|
|
67
75
|
appFetch?: GlobalFetch["fetch"];
|
68
76
|
}) => Promise<AuthorizationResponse>;
|
69
77
|
export declare const sendAuthorizationResponse: SendAuthorizationResponse;
|
78
|
+
/**
|
79
|
+
* Type definition for the function that sends the authorization response
|
80
|
+
* to the Relying Party, completing the presentation flow.
|
81
|
+
*/
|
82
|
+
export type SendAuthorizationErrorResponse = (requestObject: Out<VerifyRequestObject>["requestObject"], error: {
|
83
|
+
error: ErrorResponse;
|
84
|
+
errorDescription: string;
|
85
|
+
}, context?: {
|
86
|
+
appFetch?: GlobalFetch["fetch"];
|
87
|
+
}) => Promise<AuthorizationResponse>;
|
88
|
+
/**
|
89
|
+
* Sends the authorization error response to the Relying Party (RP) using the specified `response_mode`.
|
90
|
+
* This function completes the presentation flow in an OpenID 4 Verifiable Presentations scenario.
|
91
|
+
*
|
92
|
+
* @param requestObject - The request details, including presentation requirements.
|
93
|
+
* @param error - The response error value, with description
|
94
|
+
* @param context - Contains optional custom fetch implementation.
|
95
|
+
* @returns Parsed and validated authorization response from the Relying Party.
|
96
|
+
*/
|
97
|
+
export declare const sendAuthorizationErrorResponse: SendAuthorizationErrorResponse;
|
70
98
|
//# sourceMappingURL=08-send-authorization-response.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"08-send-authorization-response.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/08-send-authorization-response.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EACL,KAAK,kBAAkB,EACvB,8BAA8B,EAC9B,KAAK,wBAAwB,
|
1
|
+
{"version":3,"file":"08-send-authorization-response.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/08-send-authorization-response.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EACL,KAAK,kBAAkB,EACvB,8BAA8B,EAC9B,aAAa,EACb,KAAK,wBAAwB,EAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAQnE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAUhC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,cACxB,IAAI,SAAS,CAAC,CAAC,MAAM,CAAC,KAChC,GAWF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAs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,EAAE,aAAa,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,EACzD,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,EAAE,8BAqB1C,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { IoWalletError } from "../../utils/errors";
|
2
|
+
export { DcqlError } from "dcql";
|
2
3
|
/**
|
3
4
|
* An error subclass thrown when auth request decode fail
|
4
5
|
*
|
@@ -33,15 +34,13 @@ export declare class InvalidQRCodeError extends IoWalletError {
|
|
33
34
|
constructor(reason: string);
|
34
35
|
}
|
35
36
|
/**
|
36
|
-
* When the
|
37
|
-
*
|
37
|
+
* When the Request Object sent by the Relying Party is not valid
|
38
38
|
*/
|
39
|
-
export declare class
|
39
|
+
export declare class InvalidRequestObjectError extends IoWalletError {
|
40
40
|
code: string;
|
41
|
-
/**
|
42
|
-
|
43
|
-
|
44
|
-
constructor(reason: string);
|
41
|
+
/** Detailed reason for the Request Object validation failure. */
|
42
|
+
reason: string;
|
43
|
+
constructor(message: string, reason?: string);
|
45
44
|
}
|
46
45
|
/**
|
47
46
|
* When some required data is missing to continue because certain attributes are not contained inside the wallet.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,oBAAoB,CAAC;
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,IAAI,SAAwD;IAE5D,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAGb,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAsB,EAC7B,MAAM,GAAE,MAAsB;CAMjC;AAED;;;GAGG;AACH,qBAAa,wCAAyC,SAAQ,aAAa;IACzE,IAAI,SAAoC;IAExC;;OAEG;gBACS,QAAQ,EAAE,MAAM;CAI7B;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,IAAI,SAAyB;IAE7B,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;gBAEH,MAAM,EAAE,MAAM;CAI3B;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,aAAa;IAC1D,IAAI,SAAgC;IAEpC,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAgB;CAIpD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,IAAI,SAAsB;IAE1B;;OAEG;gBACS,iBAAiB,EAAE,MAAM;CAItC;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,aAAa;IACzD,IAAI,SAA+B;IACnC,OAAO,EAAE,cAAc,EAAE,CAAC;IAE1B;;OAEG;gBACS,OAAO,EAAE,cAAc,EAAE;CAItC"}
|
@@ -6,8 +6,8 @@ import { verifyRequestObject, type VerifyRequestObject } from "./05-verify-reque
|
|
6
6
|
import { fetchPresentDefinition, type FetchPresentationDefinition } from "./06-fetch-presentation-definition";
|
7
7
|
import { evaluateInputDescriptors, prepareLegacyRemotePresentations, type EvaluateInputDescriptors, type PrepareLegacyRemotePresentations } from "./07-evaluate-input-descriptor";
|
8
8
|
import { evaluateDcqlQuery, prepareRemotePresentations, type EvaluateDcqlQuery, type PrepareRemotePresentations } from "./07-evaluate-dcql-query";
|
9
|
-
import { sendAuthorizationResponse, type SendAuthorizationResponse, sendLegacyAuthorizationResponse, type SendLegacyAuthorizationResponse } from "./08-send-authorization-response";
|
9
|
+
import { sendAuthorizationResponse, type SendAuthorizationResponse, sendLegacyAuthorizationResponse, type SendLegacyAuthorizationResponse, sendAuthorizationErrorResponse, type SendAuthorizationErrorResponse } from "./08-send-authorization-response";
|
10
10
|
import * as Errors from "./errors";
|
11
|
-
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, getJwksFromConfig, verifyRequestObject, fetchPresentDefinition, evaluateInputDescriptors, evaluateDcqlQuery, prepareLegacyRemotePresentations, prepareRemotePresentations, sendAuthorizationResponse, sendLegacyAuthorizationResponse, Errors, };
|
12
|
-
export type { StartFlow, EvaluateRelyingPartyTrust, GetRequestObject, FetchJwks, VerifyRequestObject, FetchPresentationDefinition, EvaluateInputDescriptors, EvaluateDcqlQuery, PrepareLegacyRemotePresentations, PrepareRemotePresentations, SendAuthorizationResponse, SendLegacyAuthorizationResponse, };
|
11
|
+
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, getJwksFromConfig, verifyRequestObject, fetchPresentDefinition, evaluateInputDescriptors, evaluateDcqlQuery, prepareLegacyRemotePresentations, prepareRemotePresentations, sendAuthorizationResponse, sendLegacyAuthorizationResponse, sendAuthorizationErrorResponse, Errors, };
|
12
|
+
export type { StartFlow, EvaluateRelyingPartyTrust, GetRequestObject, FetchJwks, VerifyRequestObject, FetchPresentationDefinition, EvaluateInputDescriptors, EvaluateDcqlQuery, PrepareLegacyRemotePresentations, PrepareRemotePresentations, SendAuthorizationResponse, SendLegacyAuthorizationResponse, SendAuthorizationErrorResponse, };
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,+BAA+B,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,+BAA+B,EACpC,8BAA8B,EAC9B,KAAK,8BAA8B,EACpC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,MAAM,GACP,CAAC;AACF,YAAY,EACV,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,GAC/B,CAAC"}
|
@@ -755,14 +755,32 @@ export declare const RequestObjectWalletCapabilities: z.ZodObject<{
|
|
755
755
|
wallet_nonce?: string | undefined;
|
756
756
|
}>;
|
757
757
|
/**
|
758
|
-
*
|
759
|
-
*
|
758
|
+
* This type models the possible error responses the OpenID4VP protocol allows for a presentation of a credential.
|
759
|
+
* When the Wallet encounters one of these errors, it will notify the Relying Party through the `response_uri` endpoint.
|
760
|
+
* See https://italia.github.io/eid-wallet-it-docs/versione-corrente/en/pid-eaa-presentation.html#authorization-response-errors for more information.
|
760
761
|
*/
|
761
|
-
export type
|
762
|
+
export type ErrorResponse = z.infer<typeof ErrorResponse>;
|
763
|
+
export declare const ErrorResponse: z.ZodEnum<["invalid_request_object", "invalid_request_uri", "vp_formats_not_supported", "invalid_request", "access_denied", "invalid_client"]>;
|
762
764
|
/**
|
763
|
-
*
|
765
|
+
* Authorization Response payload sent to the Relying Party.
|
764
766
|
*/
|
765
|
-
export
|
767
|
+
export type DirectAuthorizationBodyPayload = z.infer<typeof DirectAuthorizationBodyPayload>;
|
768
|
+
export declare const DirectAuthorizationBodyPayload: z.ZodUnion<[z.ZodObject<{
|
769
|
+
vp_token: z.ZodRecord<z.ZodString, z.ZodString>;
|
770
|
+
}, "strip", z.ZodTypeAny, {
|
771
|
+
vp_token: Record<string, string>;
|
772
|
+
}, {
|
773
|
+
vp_token: Record<string, string>;
|
774
|
+
}>, z.ZodObject<{
|
775
|
+
error: z.ZodEnum<["invalid_request_object", "invalid_request_uri", "vp_formats_not_supported", "invalid_request", "access_denied", "invalid_client"]>;
|
776
|
+
error_description: z.ZodString;
|
777
|
+
}, "strip", z.ZodTypeAny, {
|
778
|
+
error: "invalid_request_object" | "invalid_request_uri" | "vp_formats_not_supported" | "invalid_request" | "access_denied" | "invalid_client";
|
779
|
+
error_description: string;
|
780
|
+
}, {
|
781
|
+
error: "invalid_request_object" | "invalid_request_uri" | "vp_formats_not_supported" | "invalid_request" | "access_denied" | "invalid_client";
|
782
|
+
error_description: string;
|
783
|
+
}>, z.ZodObject<{
|
766
784
|
vp_token: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
767
785
|
presentation_submission: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
768
786
|
}, "strip", z.ZodTypeAny, {
|
@@ -771,16 +789,5 @@ export declare const LegacyDirectAuthorizationBodyPayload: z.ZodObject<{
|
|
771
789
|
}, {
|
772
790
|
presentation_submission: Record<string, unknown>;
|
773
791
|
vp_token?: string | string[] | undefined;
|
774
|
-
}>;
|
775
|
-
/**
|
776
|
-
* Authorization Response payload when using DCQL queries.
|
777
|
-
*/
|
778
|
-
export type DirectAuthorizationBodyPayload = z.infer<typeof DirectAuthorizationBodyPayload>;
|
779
|
-
export declare const DirectAuthorizationBodyPayload: z.ZodObject<{
|
780
|
-
vp_token: z.ZodRecord<z.ZodString, z.ZodString>;
|
781
|
-
}, "strip", z.ZodTypeAny, {
|
782
|
-
vp_token: Record<string, string>;
|
783
|
-
}, {
|
784
|
-
vp_token: Record<string, string>;
|
785
|
-
}>;
|
792
|
+
}>]>;
|
786
793
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACO,MAAM;IACzB,MAAM,EAAE;IACsC,aAAa;CACzE,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,eAAe,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAmBF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,CAAC"}
|
@@ -40,6 +40,14 @@ export declare const WalletProviderResponseErrorCodes: {
|
|
40
40
|
*/
|
41
41
|
readonly WalletInstanceNotFound: "ERR_IO_WALLET_INSTANCE_NOT_FOUND";
|
42
42
|
};
|
43
|
+
export declare const RelyingPartyResponseErrorCodes: {
|
44
|
+
readonly RelyingPartyGenericError: "ERR_RP_GENERIC_ERROR";
|
45
|
+
/**
|
46
|
+
* An error code thrown then the Relying Party rejects the Wallet's Authorization Response.
|
47
|
+
*/
|
48
|
+
readonly InvalidAuthorizationResponse: "ERR_RP_INVALID_AUTHORIZATION_RESPONSE";
|
49
|
+
};
|
43
50
|
export type IssuerResponseErrorCode = (typeof IssuerResponseErrorCodes)[keyof typeof IssuerResponseErrorCodes];
|
44
51
|
export type WalletProviderResponseErrorCode = (typeof WalletProviderResponseErrorCodes)[keyof typeof WalletProviderResponseErrorCodes];
|
52
|
+
export type RelyingPartyResponseErrorCode = (typeof RelyingPartyResponseErrorCodes)[keyof typeof RelyingPartyResponseErrorCodes];
|
45
53
|
//# sourceMappingURL=error-codes.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/utils/error-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;IAEnC;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,eAAO,MAAM,gCAAgC;;IAE3C;;OAEG;;IAEH;;OAEG;;IAGH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAE3E,MAAM,MAAM,+BAA+B,GACzC,CAAC,OAAO,gCAAgC,CAAC,CAAC,MAAM,OAAO,gCAAgC,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/utils/error-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;IAEnC;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,eAAO,MAAM,gCAAgC;;IAE3C;;OAEG;;IAEH;;OAEG;;IAGH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,eAAO,MAAM,8BAA8B;;IAEzC;;OAEG;;CAEK,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAE3E,MAAM,MAAM,+BAA+B,GACzC,CAAC,OAAO,gCAAgC,CAAC,CAAC,MAAM,OAAO,gCAAgC,CAAC,CAAC;AAE3F,MAAM,MAAM,6BAA6B,GACvC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,OAAO,8BAA8B,CAAC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ProblemDetail } from "../client/generated/wallet-provider";
|
2
2
|
import type { CredentialIssuerEntityConfiguration } from "../trust";
|
3
|
-
import { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes, type IssuerResponseErrorCode, type WalletProviderResponseErrorCode } from "./error-codes";
|
4
|
-
export { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes };
|
3
|
+
import { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes, RelyingPartyResponseErrorCodes, type IssuerResponseErrorCode, type WalletProviderResponseErrorCode, type RelyingPartyResponseErrorCode } from "./error-codes";
|
4
|
+
export { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes, RelyingPartyResponseErrorCodes, };
|
5
5
|
type GenericErrorReason = string | Record<string, unknown>;
|
6
6
|
/**
|
7
7
|
* utility to format a set of attributes into an error message string
|
@@ -62,8 +62,6 @@ export declare class UnexpectedStatusCodeError extends IoWalletError {
|
|
62
62
|
/**
|
63
63
|
* An error subclass thrown when an Issuer HTTP request fails.
|
64
64
|
* The specific error can be found in the `code` property.
|
65
|
-
*
|
66
|
-
* The class is generic over the error code to narrow down the reason.
|
67
65
|
*/
|
68
66
|
export declare class IssuerResponseError extends UnexpectedStatusCodeError {
|
69
67
|
code: IssuerResponseErrorCode;
|
@@ -88,6 +86,19 @@ export declare class WalletProviderResponseError extends UnexpectedStatusCodeErr
|
|
88
86
|
statusCode: number;
|
89
87
|
});
|
90
88
|
}
|
89
|
+
/**
|
90
|
+
* An error subclass thrown when a Relying Party HTTP request fails.
|
91
|
+
* The specific error can be found in the `code` property.
|
92
|
+
*/
|
93
|
+
export declare class RelyingPartyResponseError extends UnexpectedStatusCodeError {
|
94
|
+
code: RelyingPartyResponseErrorCode;
|
95
|
+
constructor(params: {
|
96
|
+
code?: RelyingPartyResponseErrorCode;
|
97
|
+
message: string;
|
98
|
+
reason: GenericErrorReason;
|
99
|
+
statusCode: number;
|
100
|
+
});
|
101
|
+
}
|
91
102
|
type LocalizedIssuanceError = {
|
92
103
|
[locale: string]: {
|
93
104
|
title: string;
|
@@ -106,21 +117,24 @@ export declare function extractErrorMessageFromIssuerConf(errorCode: string, { i
|
|
106
117
|
issuerConf: CredentialIssuerEntityConfiguration["payload"]["metadata"];
|
107
118
|
credentialType: string;
|
108
119
|
}): LocalizedIssuanceError | undefined;
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
120
|
+
export declare const isIssuerResponseError: (error: unknown, code?: IssuerResponseErrorCode | undefined) => error is IssuerResponseError;
|
121
|
+
export declare const isWalletProviderResponseError: (error: unknown, code?: WalletProviderResponseErrorCode | undefined) => error is WalletProviderResponseError;
|
122
|
+
export declare const isRelyingPartyResponseError: (error: unknown, code?: RelyingPartyResponseErrorCode | undefined) => error is RelyingPartyResponseError;
|
123
|
+
type ErrorCodeMap = {
|
124
|
+
type: typeof IssuerResponseError;
|
125
|
+
code: IssuerResponseErrorCode;
|
126
|
+
} | {
|
127
|
+
type: typeof WalletProviderResponseError;
|
128
|
+
code: WalletProviderResponseErrorCode;
|
129
|
+
} | {
|
130
|
+
type: typeof RelyingPartyResponseError;
|
131
|
+
code: RelyingPartyResponseErrorCode;
|
132
|
+
};
|
133
|
+
type ExtractErrorCode<T> = Extract<ErrorCodeMap, {
|
134
|
+
type: T;
|
135
|
+
}>["code"];
|
122
136
|
type ErrorCase<T> = {
|
123
|
-
code:
|
137
|
+
code: ExtractErrorCode<T>;
|
124
138
|
message: string;
|
125
139
|
reason?: GenericErrorReason;
|
126
140
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,8BAA8B,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EACnC,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,8BAA8B,GAC/B,CAAC;AAGF,KAAK,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,UA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