From 41de0864d562b7e5b4d137fc90438a82447bac7a Mon Sep 17 00:00:00 2001 From: boufni95 Date: Thu, 17 Oct 2024 16:13:05 +0000 Subject: [PATCH 1/2] fix url --- proto/service/methods.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/service/methods.proto b/proto/service/methods.proto index ed6b0649..87f502c5 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -321,7 +321,7 @@ service LightningPub { rpc GetNPubLinkingState(structs.GetNPubLinking) returns (structs.NPubLinking) { option (auth_type) = "App"; option (http_method) = "post"; - option (http_route) = "/api/app/user/npub/token"; + option (http_route) = "/api/app/user/npub/state"; } rpc RequestNPubLinkingToken(structs.RequestNPubLinkingTokenRequest) returns (structs.RequestNPubLinkingTokenResponse) { option (auth_type) = "App"; From 3bc6add51ae9dc2f704b86c94ed0d6032e2108a4 Mon Sep 17 00:00:00 2001 From: boufni95 Date: Thu, 17 Oct 2024 16:13:29 +0000 Subject: [PATCH 2/2] gen --- proto/autogenerated/client.md | 2 +- proto/autogenerated/go/http_client.go | 2 +- proto/autogenerated/ts/express_server.ts | 2 +- proto/autogenerated/ts/http_client.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index cbe44a34..9a0c99c6 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -478,7 +478,7 @@ The nostr server will send back a message response, and inside the body there wi - GetNPubLinkingState - auth type: __App__ - http method: __post__ - - http route: __/api/app/user/npub/token__ + - http route: __/api/app/user/npub/state__ - input: [GetNPubLinking](#GetNPubLinking) - output: [NPubLinking](#NPubLinking) diff --git a/proto/autogenerated/go/http_client.go b/proto/autogenerated/go/http_client.go index 229ef34a..67935d5b 100644 --- a/proto/autogenerated/go/http_client.go +++ b/proto/autogenerated/go/http_client.go @@ -840,7 +840,7 @@ func NewClient(params ClientParams) *Client { if err != nil { return nil, err } - finalRoute := "/api/app/user/npub/token" + finalRoute := "/api/app/user/npub/state" body, err := json.Marshal(req) if err != nil { return nil, err diff --git a/proto/autogenerated/ts/express_server.ts b/proto/autogenerated/ts/express_server.ts index 86933f07..a103e9fd 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -879,7 +879,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.GetNPubLinkingState) throw new Error('method: GetNPubLinkingState is not implemented') - app.post('/api/app/user/npub/token', async (req, res) => { + app.post('/api/app/user/npub/state', async (req, res) => { const info: Types.RequestInfo = { rpcName: 'GetNPubLinkingState', batch: false, nostr: false, batchSize: 0} const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } let authCtx: Types.AuthContext = {} diff --git a/proto/autogenerated/ts/http_client.ts b/proto/autogenerated/ts/http_client.ts index e0fe4804..5fc32cbb 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -391,7 +391,7 @@ export default (params: ClientParams) => ({ GetNPubLinkingState: async (request: Types.GetNPubLinking): Promise => { const auth = await params.retrieveAppAuth() if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/user/npub/token' + let finalRoute = '/api/app/user/npub/state' const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data if (data.status === 'OK') {