diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index b680cdbf..12ec7d3c 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -580,7 +580,7 @@ The nostr server will send back a message response, and inside the body there wi - GetUserOffer - auth type: __User__ - - http method: __get__ + - http method: __post__ - http route: __/api/user/offer/get__ - input: [OfferId](#OfferId) - output: [OfferConfig](#OfferConfig) diff --git a/proto/autogenerated/go/http_client.go b/proto/autogenerated/go/http_client.go index 0289dfd3..a5a0806f 100644 --- a/proto/autogenerated/go/http_client.go +++ b/proto/autogenerated/go/http_client.go @@ -1087,7 +1087,14 @@ func NewClient(params ClientParams) *Client { return nil, err } finalRoute := "/api/user/offer/get" - resBody, err := doGetRequest(params.BaseURL+finalRoute, auth) + body, err := json.Marshal(req) + if err != nil { + return nil, err + } + resBody, err := doPostRequest(params.BaseURL+finalRoute, body, auth) + if err != nil { + return nil, err + } result := ResultError{} err = json.Unmarshal(resBody, &result) if err != nil { diff --git a/proto/autogenerated/ts/express_server.ts b/proto/autogenerated/ts/express_server.ts index 603d93d5..3c418d2d 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -1114,7 +1114,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.GetUserOffer) throw new Error('method: GetUserOffer is not implemented') - app.get('/api/user/offer/get', async (req, res) => { + app.post('/api/user/offer/get', async (req, res) => { const info: Types.RequestInfo = { rpcName: 'GetUserOffer', 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 b2ed71f6..5ca384df 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -512,7 +512,7 @@ export default (params: ClientParams) => ({ const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') let finalRoute = '/api/user/offer/get' - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + 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') { const result = data diff --git a/proto/autogenerated/ts/nostr_client.ts b/proto/autogenerated/ts/nostr_client.ts index 94dd8852..5cf127d2 100644 --- a/proto/autogenerated/ts/nostr_client.ts +++ b/proto/autogenerated/ts/nostr_client.ts @@ -440,6 +440,7 @@ export default (params: NostrClientParams, send: (to:string, message: NostrRequ const auth = await params.retrieveNostrUserAuth() if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') const nostrRequest: NostrRequest = {} + nostrRequest.body = request const data = await send(params.pubDestination, {rpcName:'GetUserOffer',authIdentifier:auth, ...nostrRequest }) 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 a372331d..b5a91007 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -477,7 +477,7 @@ service LightningPub { rpc GetUserOffer(structs.OfferId) returns (structs.OfferConfig){ option (auth_type) = "User"; - option (http_method) = "get"; + option (http_method) = "post"; option (http_route) = "/api/user/offer/get"; option (nostr) = true; }