Skip to content

Commit

Permalink
feat: count cloudflare-kv keys; fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shrpne committed Jul 18, 2023
1 parent f6900c1 commit edb7f55
Show file tree
Hide file tree
Showing 7 changed files with 3,041 additions and 1,385 deletions.
15 changes: 15 additions & 0 deletions api/cloudflare-kv.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,18 @@ export function getStoredValue(address) {
return response.data;
});
}

/**
* @param {object} [params]
* @param {string} [params.cursor]
* @param {number} [params.limit] - 1000 by default
* @return {Promise<{result: any, resultInfo: {count: number, cursor: string}}>}}
*/
export function listKeys(params) {
return instance.get('keys', {
params,
})
.then((response) => {
return response.data;
});
}
1 change: 1 addition & 0 deletions assets/axios-default-adapter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios from 'axios';
import adapters from 'axios/lib/adapters/adapters.js';
// import adapters from 'axios/unsafe/adapters/adapters.js';

const getAdapter = adapters.getAdapter;

Expand Down
2 changes: 1 addition & 1 deletion assets/less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
.card__cover {border-radius: 16px 16px 0 0; vertical-align: top; width: 100%;}
.card__badge {.u-h--uppercase(); position: absolute; bottom: 16px; right: 0; padding: 4px 8px; box-shadow: 0px 2px 2px rgba(0,0,0, 0.25); border-radius: 8px 0px 0px 8px; color: @c-black;}
.card__badge--top {bottom: auto; top: 16px;}
.card__badge--megachain-farmers {background: #00AD45; color: #fff; font-size: 16px; line-height: 20px; text-transform: none; padding: 6px 16px;}
.card__badge--megachain-farmers {background: #00AD45; color: #fff; font-size: 16px; line-height: 20px; text-transform: none; padding: 6px 16px; letter-spacing: 0;}
.card__badge--coming-soon {background: #faff00;}

@media (min-width: @breakpoint-medium-up) {
Expand Down
12 changes: 11 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
const esModules = ['date-fns'].join('|');
const esModules = [
'date-fns',
'lodash-es',
'@babel/runtime',
'axios-extensions',
'axios',
'camelcase-keys',
'camelcase',
'quick-lru',
].join('|');

export default {
moduleNameMapper: {
'~(.*)$': '<rootDir>/$1',
'axios/lib/adapters/adapters.js': '<rootDir>/node_modules/axios/lib/adapters/adapters.js',
},
transform: {
'^.+\\.jsx?$': '<rootDir>/jest-babel.config.js',
Expand Down
Loading

0 comments on commit edb7f55

Please sign in to comment.