Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Auth Token Update Interface for Auth Webhook #911

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@
"@bufbuild/buf": "^1.28.1",
"@bufbuild/protoc-gen-es": "^1.6.0",
"@connectrpc/protoc-gen-connect-es": "^1.4.0",
"@types/express": "^5.0.0",
chacha912 marked this conversation as resolved.
Show resolved Hide resolved
"@types/google-protobuf": "^3.15.5",
"@types/long": "^4.0.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitest/coverage-istanbul": "^0.34.5",
"@vitest/coverage-v8": "^0.34.5",
"axios": "^1.7.7",
"eslint-plugin-tsdoc": "^0.2.16",
"express": "^4.21.1",
"prettier": "^2.7.1",
"ts-node": "^10.9.1",
"typedoc": "^0.25.13",
Expand All @@ -61,7 +64,7 @@
"vite": "^5.0.12",
"vite-plugin-commonjs": "^0.10.1",
"vite-plugin-dts": "^3.9.1",
"vite-tsconfig-paths": "^4.2.1",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^0.34.5"
},
"dependencies": {
Expand Down
12 changes: 12 additions & 0 deletions packages/sdk/src/api/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,18 @@ export function errorCodeOf(error: ConnectError): string {
return '';
}

/**
* `errorMetadataOf` returns the error code of the given connect error.
*/
export function errorMetadataOf(error: ConnectError): Record<string, string> {
const infos = error.findDetails(ErrorInfo);
for (const info of infos) {
return info.metadata;
}

return {};
}
chacha912 marked this conversation as resolved.
Show resolved Hide resolved

/**
* `fromChangeID` converts the given Protobuf format to model format.
*/
Expand Down
Loading
Loading