@graphql-mesh/cache-cfw-kv 1.0.0-alpha-20230523154127-518d8667d → 1.0.0-alpha-20230523154231-8c60b52d9

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/cjs/index.js CHANGED
@@ -10,24 +10,28 @@ class CFWorkerKVCache {
10
10
  }
11
11
  }
12
12
  async get(key) {
13
- return this.kvNamespace?.get(key, 'json');
13
+ var _a;
14
+ return (_a = this.kvNamespace) === null || _a === void 0 ? void 0 : _a.get(key, 'json');
14
15
  }
15
16
  async getKeysByPrefix(prefix) {
16
- const result = await this.kvNamespace?.list({
17
+ var _a;
18
+ const result = await ((_a = this.kvNamespace) === null || _a === void 0 ? void 0 : _a.list({
17
19
  prefix,
18
- });
20
+ }));
19
21
  if (!result) {
20
22
  return [];
21
23
  }
22
24
  return result.keys.map(keyEntry => keyEntry.name);
23
25
  }
24
26
  async set(key, value, options) {
25
- return this.kvNamespace?.put(key, JSON.stringify(value), {
26
- expirationTtl: options?.ttl,
27
+ var _a;
28
+ return (_a = this.kvNamespace) === null || _a === void 0 ? void 0 : _a.put(key, JSON.stringify(value), {
29
+ expirationTtl: options === null || options === void 0 ? void 0 : options.ttl,
27
30
  });
28
31
  }
29
32
  async delete(key) {
30
- return this.kvNamespace?.delete(key);
33
+ var _a;
34
+ return (_a = this.kvNamespace) === null || _a === void 0 ? void 0 : _a.delete(key);
31
35
  }
32
36
  }
33
37
  exports.default = CFWorkerKVCache;
package/esm/index.js CHANGED
@@ -8,23 +8,27 @@ export default class CFWorkerKVCache {
8
8
  }
9
9
  }
10
10
  async get(key) {
11
- return this.kvNamespace?.get(key, 'json');
11
+ var _a;
12
+ return (_a = this.kvNamespace) === null || _a === void 0 ? void 0 : _a.get(key, 'json');
12
13
  }
13
14
  async getKeysByPrefix(prefix) {
14
- const result = await this.kvNamespace?.list({
15
+ var _a;
16
+ const result = await ((_a = this.kvNamespace) === null || _a === void 0 ? void 0 : _a.list({
15
17
  prefix,
16
- });
18
+ }));
17
19
  if (!result) {
18
20
  return [];
19
21
  }
20
22
  return result.keys.map(keyEntry => keyEntry.name);
21
23
  }
22
24
  async set(key, value, options) {
23
- return this.kvNamespace?.put(key, JSON.stringify(value), {
24
- expirationTtl: options?.ttl,
25
+ var _a;
26
+ return (_a = this.kvNamespace) === null || _a === void 0 ? void 0 : _a.put(key, JSON.stringify(value), {
27
+ expirationTtl: options === null || options === void 0 ? void 0 : options.ttl,
25
28
  });
26
29
  }
27
30
  async delete(key) {
28
- return this.kvNamespace?.delete(key);
31
+ var _a;
32
+ return (_a = this.kvNamespace) === null || _a === void 0 ? void 0 : _a.delete(key);
29
33
  }
30
34
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@graphql-mesh/cache-cfw-kv",
3
- "version": "1.0.0-alpha-20230523154127-518d8667d",
3
+ "version": "1.0.0-alpha-20230523154231-8c60b52d9",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@graphql-mesh/types": "1.0.0-alpha-20230523154127-518d8667d",
7
- "@graphql-mesh/utils": "1.0.0-alpha-20230523154127-518d8667d",
6
+ "@graphql-mesh/types": "1.0.0-alpha-20230523154231-8c60b52d9",
7
+ "@graphql-mesh/utils": "1.0.0-alpha-20230523154231-8c60b52d9",
8
8
  "graphql": "*",
9
9
  "tslib": "^2.4.0"
10
10
  },
@@ -15,9 +15,6 @@
15
15
  "directory": "packages/cache/cfw-kv"
16
16
  },
17
17
  "license": "MIT",
18
- "engines": {
19
- "node": ">=16.0.0"
20
- },
21
18
  "main": "cjs/index.js",
22
19
  "module": "esm/index.js",
23
20
  "typings": "typings/index.d.ts",