lambda-toolkit 0.0.5-beta → 0.0.6-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1286,16 +1286,24 @@ const { QueryCommand } = __webpack_require__( 1671 );
|
|
|
1286
1286
|
const { camelize } = __webpack_require__( 5762 );
|
|
1287
1287
|
const parseItems = __webpack_require__( 7261 );
|
|
1288
1288
|
|
|
1289
|
-
|
|
1289
|
+
const query = async ( client, queryString, { prevItems = [], recursive, paginationToken, maxRows, rawResponse } ) => {
|
|
1290
1290
|
const response = await client.send( new QueryCommand( { QueryString: queryString, NextToken: paginationToken, MaxRows: maxRows } ) );
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1291
|
+
if ( !recursive && rawResponse ) {
|
|
1292
|
+
return response;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
const nextToken = response.NextToken;
|
|
1296
|
+
if ( nextToken && recursive ) {
|
|
1297
|
+
return query( client, queryString, { prevItems: parseItems( response ), recursive, paginationToken: nextToken, maxRows } );
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
const items = prevItems.concat( parseItems( response ) );
|
|
1301
|
+
return { nextToken, count: items.length, items, queryStatus: camelize( response.QueryStatus ) };
|
|
1297
1302
|
};
|
|
1298
1303
|
|
|
1304
|
+
module.exports = async ( client, queryString, { recursive = false, paginationToken = undefined, maxRows = undefined, rawResponse = false } = {} ) =>
|
|
1305
|
+
query( client, queryString, { recursive, paginationToken, maxRows, rawResponse } );
|
|
1306
|
+
|
|
1299
1307
|
|
|
1300
1308
|
/***/ }),
|
|
1301
1309
|
|