Allow deep-getting of pagination params from REST responses

This commit is contained in:
Andrew Kingston 2022-03-24 10:07:23 +00:00
parent 12e079128c
commit 8e361afcda
3 changed files with 200 additions and 883 deletions

View File

@ -149,6 +149,7 @@
"@types/jest": "^26.0.23", "@types/jest": "^26.0.23",
"@types/koa": "^2.13.3", "@types/koa": "^2.13.3",
"@types/koa-router": "^7.4.2", "@types/koa-router": "^7.4.2",
"@types/lodash": "4.14.180",
"@types/node": "^15.12.4", "@types/node": "^15.12.4",
"@types/oracledb": "^5.2.1", "@types/oracledb": "^5.2.1",
"@types/redis": "^4.0.11", "@types/redis": "^4.0.11",

View File

@ -11,6 +11,7 @@ import {
PaginationValues, PaginationValues,
} from "../definitions/datasource" } from "../definitions/datasource"
import { IntegrationBase } from "./base/IntegrationBase" import { IntegrationBase } from "./base/IntegrationBase"
import { get } from "lodash"
const BodyTypes = { const BodyTypes = {
NONE: "none", NONE: "none",
@ -163,7 +164,7 @@ module RestModule {
// Check if a pagination cursor exists in the response // Check if a pagination cursor exists in the response
let nextCursor = null let nextCursor = null
if (pagination?.responseParam) { if (pagination?.responseParam) {
nextCursor = data?.[pagination.responseParam] nextCursor = get(data, pagination.responseParam)
} }
return { return {

File diff suppressed because it is too large Load Diff