From cf9a10ded48c010bf8460b92994db8c4016841ad Mon Sep 17 00:00:00 2001 From: boufni95 Date: Thu, 10 Apr 2025 17:16:48 +0000 Subject: [PATCH] fix path --- proto/autogenerated/client.md | 4 ++-- proto/autogenerated/go/http_client.go | 4 ++-- proto/autogenerated/ts/express_server.ts | 4 ++-- proto/autogenerated/ts/http_client.ts | 4 ++-- proto/service/methods.proto | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index 4cba96b7..93fb4efc 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -807,7 +807,7 @@ The nostr server will send back a message response, and inside the body there wi - ResetMetricsStorages - auth type: __Metrics__ - http method: __post__ - - http route: __/api/admin/metrics/reset__ + - http route: __/api/metrics/reset__ - This methods has an __empty__ __request__ body - This methods has an __empty__ __response__ body @@ -912,7 +912,7 @@ The nostr server will send back a message response, and inside the body there wi - ZipMetricsStorages - auth type: __Metrics__ - http method: __post__ - - http route: __/api/admin/metrics/zip__ + - http route: __/api/metrics/zip__ - This methods has an __empty__ __request__ body - output: [ZippedMetrics](#ZippedMetrics) diff --git a/proto/autogenerated/go/http_client.go b/proto/autogenerated/go/http_client.go index ec489a7a..970a39d0 100644 --- a/proto/autogenerated/go/http_client.go +++ b/proto/autogenerated/go/http_client.go @@ -1759,7 +1759,7 @@ func NewClient(params ClientParams) *Client { if err != nil { return err } - finalRoute := "/api/admin/metrics/reset" + finalRoute := "/api/metrics/reset" body := []byte{} resBody, err := doPostRequest(params.BaseURL+finalRoute, body, auth) if err != nil { @@ -2110,7 +2110,7 @@ func NewClient(params ClientParams) *Client { if err != nil { return nil, err } - finalRoute := "/api/admin/metrics/zip" + finalRoute := "/api/metrics/zip" body := []byte{} resBody, err := doPostRequest(params.BaseURL+finalRoute, body, auth) if err != nil { diff --git a/proto/autogenerated/ts/express_server.ts b/proto/autogenerated/ts/express_server.ts index 37170364..92f54ba2 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -1633,7 +1633,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.ResetMetricsStorages) throw new Error('method: ResetMetricsStorages is not implemented') - app.post('/api/admin/metrics/reset', async (req, res) => { + app.post('/api/metrics/reset', async (req, res) => { const info: Types.RequestInfo = { rpcName: 'ResetMetricsStorages', 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 = {} @@ -1935,7 +1935,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.ZipMetricsStorages) throw new Error('method: ZipMetricsStorages is not implemented') - app.post('/api/admin/metrics/zip', async (req, res) => { + app.post('/api/metrics/zip', async (req, res) => { const info: Types.RequestInfo = { rpcName: 'ZipMetricsStorages', 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 757f9021..8ba73a0f 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -842,7 +842,7 @@ export default (params: ClientParams) => ({ ResetMetricsStorages: async (): Promise => { const auth = await params.retrieveMetricsAuth() if (auth === null) throw new Error('retrieveMetricsAuth() returned null') - let finalRoute = '/api/admin/metrics/reset' + let finalRoute = '/api/metrics/reset' const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data if (data.status === 'OK') { @@ -1009,7 +1009,7 @@ export default (params: ClientParams) => ({ ZipMetricsStorages: async (): Promise => { const auth = await params.retrieveMetricsAuth() if (auth === null) throw new Error('retrieveMetricsAuth() returned null') - let finalRoute = '/api/admin/metrics/zip' + let finalRoute = '/api/metrics/zip' const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data if (data.status === 'OK') { diff --git a/proto/service/methods.proto b/proto/service/methods.proto index f1aebe7b..0d129d29 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -237,14 +237,14 @@ service LightningPub { rpc ZipMetricsStorages(structs.Empty) returns (structs.ZippedMetrics) { option (auth_type) = "Metrics"; option (http_method) = "post"; - option (http_route) = "/api/admin/metrics/zip"; + option (http_route) = "/api/metrics/zip"; option (nostr) = true; } rpc ResetMetricsStorages(structs.Empty) returns (structs.Empty) { option (auth_type) = "Metrics"; option (http_method) = "post"; - option (http_route) = "/api/admin/metrics/reset"; + option (http_route) = "/api/metrics/reset"; option (nostr) = true; }