You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`id` <code>string | "current"</code> The ID of the token. Specify `current` to get information about the token that was used to authenticate the request.
474
+
-`request` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The ID of the request.
@@ -712,6 +731,27 @@ Your current primary account e-mail address
712
731
-`address` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [null](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/null)</code> Your primary e-mail address. May ben null if anonymised.
713
732
-`verified` <code>[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)</code> Whether this e-mail address has been verified
714
733
734
+
<aname="interface-cloudnoderequest"></a>
735
+
736
+
### Interface: `Cloudnode.Request`
737
+
738
+
A request
739
+
740
+
-`id` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The ID of the request
741
+
-`method` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The request method (e.g. GET, POST, HEAD, etc.
742
+
-`scheme` <code>"http" | "https"</code> The URL scheme
743
+
-`host` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The requested host name
744
+
-`url` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The request URL path
745
+
-`status` <code>[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)</code> The HTTP status code that was returned to this request
746
+
-`ip` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> The IP address of the client that made the request (can be both IPv4 and IPv6)
747
+
-`date` <code>[Date](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date)</code> The time when the request was received
748
+
-`responseTime` <code>[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)</code> The time in milliseconds that the request took to process
749
+
-`hasEvents` <code>[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)</code> Whether any server-side error events occurred while processing this request
750
+
-`requestHeaders` <code>[Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [null](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/null)</code> The request headers that were received
751
+
-`requestBody` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [null](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/null)</code> The request body that was received (likely parsed and formatted as JSON)
752
+
-`responseHeaders` <code>[Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [null](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/null)</code> The headers that were returned by the server
753
+
-`responseBody` <code>{type: "Buffer", data: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)[]} | [null](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/null)</code> The response body that was returned by the server in response to this request
Copy file name to clipboardExpand all lines: browser/Cloudnode.js
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -336,6 +336,22 @@ class Cloudnode {
336
336
listRequests: async(id,limit=10,page=1)=>{
337
337
returnawaitthis.#sendRequest({"type": "operation","description": "Get list of recent requests made with the token","token": "tokens.get.own.requests","method": "GET","path": "/token/:id/requests","parameters": {"path": {"id": {"description": "The ID of the token. Specify `current` to get information about the token that was used to authenticate the request.","type": "string | \"current\"","required": true}},"query": {"limit": {"description": "The number of requests to return per page. No more than 50.","default": "10","type": "number","required": false},"page": {"description": "The page number. No more than 2³² (4294967296).","default": "1","type": "number","required": false}}},"returns": [{"status": 200,"type": "ShortRequest[]"},{"status": 404,"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status": 422,"type": "Error & {code: \"INVALID_DATA\"}"},{"status": 401,"type": "Error & {code: \"UNAUTHORIZED\"}"},{"status": 403,"type": "Error & {code: \"NO_PERMISSION\"}"},{"status": 429,"type": "Error & {code: \"RATE_LIMITED\"}"},{"status": 500,"type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status": 503,"type": "Error & {code: \"MAINTENANCE\"}"}]},{id: `${id}`},{limit: `${limit}`,page: `${page}`},{});
338
338
},
339
+
/**
340
+
* Get a recent request by ID
341
+
* @GET /token/:id/requests/:request
342
+
* @param id The ID of the token. Specify `current` to get information about the token that was used to authenticate the request.
returnawaitthis.#sendRequest({"type": "operation","description": "Get a recent request by ID","token": "tokens.get.own.requests","method": "GET","path": "/token/:id/requests/:request","parameters": {"path": {"id": {"description": "The ID of the token. Specify `current` to get information about the token that was used to authenticate the request.","type": "string | \"current\"","required": true},"request": {"description": "The ID of the request.","type": "string","required": true}}},"returns": [{"status": 200,"type": "Request"},{"status": 404,"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status": 422,"type": "Error & {code: \"INVALID_DATA\"}"},{"status": 401,"type": "Error & {code: \"UNAUTHORIZED\"}"},{"status": 403,"type": "Error & {code: \"NO_PERMISSION\"}"},{"status": 429,"type": "Error & {code: \"RATE_LIMITED\"}"},{"status": 500,"type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status": 503,"type": "Error & {code: \"MAINTENANCE\"}"}]},{id: `${id}`,request: `${request}`},{},{});
Copy file name to clipboardExpand all lines: src/Cloudnode.js
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -336,6 +336,22 @@ class Cloudnode {
336
336
listRequests: async(id,limit=10,page=1)=>{
337
337
returnawaitthis.#sendRequest({"type": "operation","description": "Get list of recent requests made with the token","token": "tokens.get.own.requests","method": "GET","path": "/token/:id/requests","parameters": {"path": {"id": {"description": "The ID of the token. Specify `current` to get information about the token that was used to authenticate the request.","type": "string | \"current\"","required": true}},"query": {"limit": {"description": "The number of requests to return per page. No more than 50.","default": "10","type": "number","required": false},"page": {"description": "The page number. No more than 2³² (4294967296).","default": "1","type": "number","required": false}}},"returns": [{"status": 200,"type": "ShortRequest[]"},{"status": 404,"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status": 422,"type": "Error & {code: \"INVALID_DATA\"}"},{"status": 401,"type": "Error & {code: \"UNAUTHORIZED\"}"},{"status": 403,"type": "Error & {code: \"NO_PERMISSION\"}"},{"status": 429,"type": "Error & {code: \"RATE_LIMITED\"}"},{"status": 500,"type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status": 503,"type": "Error & {code: \"MAINTENANCE\"}"}]},{id: `${id}`},{limit: `${limit}`,page: `${page}`},{});
338
338
},
339
+
/**
340
+
* Get a recent request by ID
341
+
* @GET /token/:id/requests/:request
342
+
* @param id The ID of the token. Specify `current` to get information about the token that was used to authenticate the request.
returnawaitthis.#sendRequest({"type": "operation","description": "Get a recent request by ID","token": "tokens.get.own.requests","method": "GET","path": "/token/:id/requests/:request","parameters": {"path": {"id": {"description": "The ID of the token. Specify `current` to get information about the token that was used to authenticate the request.","type": "string | \"current\"","required": true},"request": {"description": "The ID of the request.","type": "string","required": true}}},"returns": [{"status": 200,"type": "Request"},{"status": 404,"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status": 422,"type": "Error & {code: \"INVALID_DATA\"}"},{"status": 401,"type": "Error & {code: \"UNAUTHORIZED\"}"},{"status": 403,"type": "Error & {code: \"NO_PERMISSION\"}"},{"status": 429,"type": "Error & {code: \"RATE_LIMITED\"}"},{"status": 500,"type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status": 503,"type": "Error & {code: \"MAINTENANCE\"}"}]},{id: `${id}`,request: `${request}`},{},{});
0 commit comments