@adonisjs/cache 1.1.3 → 1.3.0

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.
@@ -14,6 +14,10 @@ export default class CacheClear extends BaseCommand {
14
14
  * Optionally select a namespace to clear. Defaults to the whole cache.
15
15
  */
16
16
  namespace: string;
17
+ /**
18
+ * Optionally specify tags to invalidate. Can be used multiple times.
19
+ */
20
+ tags: string[];
17
21
  /**
18
22
  * Handle command
19
23
  */
@@ -45,12 +45,24 @@ var CacheClear = class extends BaseCommand {
45
45
  this.exitCode = 1;
46
46
  return;
47
47
  }
48
+ if (this.namespace && this.tags && this.tags.length > 0) {
49
+ this.logger.error(
50
+ "Cannot use --namespace and --tags options together. Please choose one or the other."
51
+ );
52
+ this.exitCode = 1;
53
+ return;
54
+ }
48
55
  if (this.app.inProduction) {
49
56
  const shouldClear = await this.#takeProductionConsent();
50
57
  if (!shouldClear) return;
51
58
  }
52
59
  const cacheHandler = cache.use(this.store);
53
- if (this.namespace) {
60
+ if (this.tags && this.tags.length > 0) {
61
+ await cacheHandler.deleteByTag({ tags: this.tags });
62
+ this.logger.success(
63
+ `Invalidated tags [${this.tags.join(", ")}] for "${this.store}" cache successfully`
64
+ );
65
+ } else if (this.namespace) {
54
66
  await cacheHandler.namespace(this.namespace).clear();
55
67
  this.logger.success(
56
68
  `Cleared namespace "${this.namespace}" for "${this.store}" cache successfully`
@@ -67,6 +79,9 @@ __decorateClass([
67
79
  __decorateClass([
68
80
  flags.string({ description: "Select a cache namespace to clear", alias: "n" })
69
81
  ], CacheClear.prototype, "namespace", 2);
82
+ __decorateClass([
83
+ flags.array({ description: "Specify tags to invalidate", alias: "t" })
84
+ ], CacheClear.prototype, "tags", 2);
70
85
  export {
71
86
  CacheClear as default
72
87
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../commands/cache_clear.ts"],"sourcesContent":["/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { args, BaseCommand, flags } from '@adonisjs/core/ace'\n\nimport { CacheService } from '../src/types.js'\nimport { CommandOptions } from '@adonisjs/core/types/ace'\n\nexport default class CacheClear extends BaseCommand {\n static commandName = 'cache:clear'\n static description = 'Clear the application cache'\n static options: CommandOptions = {\n startApp: true,\n }\n\n /**\n * Choose a custom cache store to clear. Otherwise, we use the\n * default one\n */\n @args.string({ description: 'Define a custom cache store to clear', required: false })\n declare store: string\n\n /**\n * Optionally select a namespace to clear. Defaults to the whole cache.\n */\n @flags.string({ description: 'Select a cache namespace to clear', alias: 'n' })\n declare namespace: string\n\n /**\n * Prompts to take consent when clearing the cache in production\n */\n async #takeProductionConsent(): Promise<boolean> {\n const question = 'You are in production environment. Want to continue clearing the cache?'\n try {\n return await this.prompt.confirm(question)\n } catch (error) {\n return false\n }\n }\n\n /**\n * Check if the given cache exist\n */\n #cacheExists(cache: CacheService, cacheName: string) {\n try {\n cache.use(cacheName)\n return true\n } catch (error) {\n return false\n }\n }\n\n /**\n * Handle command\n */\n async run() {\n const cache = await this.app.container.make('cache.manager')\n this.store = this.store || cache.defaultStoreName\n\n /**\n * Exit if cache store doesn't exist\n */\n if (!this.#cacheExists(cache, this.store)) {\n this.logger.error(\n `\"${this.store}\" is not a valid cache store. Double check config/cache.ts file`\n )\n this.exitCode = 1\n return\n }\n\n /**\n * Take consent when clearing the cache in production\n */\n if (this.app.inProduction) {\n const shouldClear = await this.#takeProductionConsent()\n if (!shouldClear) return\n }\n\n /**\n * Finally clear the cache\n */\n const cacheHandler = cache.use(this.store)\n if (this.namespace) {\n await cacheHandler.namespace(this.namespace).clear()\n this.logger.success(\n `Cleared namespace \"${this.namespace}\" for \"${this.store}\" cache successfully`\n )\n } else {\n await cacheHandler.clear()\n this.logger.success(`Cleared \"${this.store}\" cache successfully`)\n }\n }\n}\n"],"mappings":";;;;;AASA,SAAS,MAAM,aAAa,aAAa;AAKzC,IAAqB,aAArB,cAAw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;AAMA;AAAA,EADP,MAAM,OAAO,EAAE,aAAa,qCAAqC,OAAO,IAAI,CAAC;AAAA,GAjB3D,WAkBX;","names":[]}
1
+ {"version":3,"sources":["../../commands/cache_clear.ts"],"sourcesContent":["/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { args, BaseCommand, flags } from '@adonisjs/core/ace'\n\nimport { CacheService } from '../src/types.js'\nimport { CommandOptions } from '@adonisjs/core/types/ace'\n\nexport default class CacheClear extends BaseCommand {\n static commandName = 'cache:clear'\n static description = 'Clear the application cache'\n static options: CommandOptions = {\n startApp: true,\n }\n\n /**\n * Choose a custom cache store to clear. Otherwise, we use the\n * default one\n */\n @args.string({ description: 'Define a custom cache store to clear', required: false })\n declare store: string\n\n /**\n * Optionally select a namespace to clear. Defaults to the whole cache.\n */\n @flags.string({ description: 'Select a cache namespace to clear', alias: 'n' })\n declare namespace: string\n\n /**\n * Optionally specify tags to invalidate. Can be used multiple times.\n */\n @flags.array({ description: 'Specify tags to invalidate', alias: 't' })\n declare tags: string[]\n\n /**\n * Prompts to take consent when clearing the cache in production\n */\n async #takeProductionConsent(): Promise<boolean> {\n const question = 'You are in production environment. Want to continue clearing the cache?'\n try {\n return await this.prompt.confirm(question)\n } catch (error) {\n return false\n }\n }\n\n /**\n * Check if the given cache exist\n */\n #cacheExists(cache: CacheService, cacheName: string) {\n try {\n cache.use(cacheName)\n return true\n } catch (error) {\n return false\n }\n }\n\n /**\n * Handle command\n */\n async run() {\n const cache = await this.app.container.make('cache.manager')\n this.store = this.store || cache.defaultStoreName\n\n /**\n * Exit if cache store doesn't exist\n */\n if (!this.#cacheExists(cache, this.store)) {\n this.logger.error(\n `\"${this.store}\" is not a valid cache store. Double check config/cache.ts file`\n )\n this.exitCode = 1\n return\n }\n\n /**\n * Validate that namespace and tags are not used together\n */\n if (this.namespace && this.tags && this.tags.length > 0) {\n this.logger.error(\n 'Cannot use --namespace and --tags options together. Please choose one or the other.'\n )\n this.exitCode = 1\n return\n }\n\n /**\n * Take consent when clearing the cache in production\n */\n if (this.app.inProduction) {\n const shouldClear = await this.#takeProductionConsent()\n if (!shouldClear) return\n }\n\n /**\n * Finally clear the cache\n */\n const cacheHandler = cache.use(this.store)\n\n if (this.tags && this.tags.length > 0) {\n await cacheHandler.deleteByTag({ tags: this.tags })\n this.logger.success(\n `Invalidated tags [${this.tags.join(', ')}] for \"${this.store}\" cache successfully`\n )\n } else if (this.namespace) {\n await cacheHandler.namespace(this.namespace).clear()\n this.logger.success(\n `Cleared namespace \"${this.namespace}\" for \"${this.store}\" cache successfully`\n )\n } else {\n await cacheHandler.clear()\n this.logger.success(`Cleared \"${this.store}\" cache successfully`)\n }\n }\n}\n"],"mappings":";;;;;AASA,SAAS,MAAM,aAAa,aAAa;AAKzC,IAAqB,aAArB,cAAwC,YAAY;AAAA,EAClD,OAAO,cAAc;AAAA,EACrB,OAAO,cAAc;AAAA,EACrB,OAAO,UAA0B;AAAA,IAC/B,UAAU;AAAA,EACZ;AAAA;AAAA;AAAA;AAAA,EAwBA,MAAM,yBAA2C;AAC/C,UAAM,WAAW;AACjB,QAAI;AACF,aAAO,MAAM,KAAK,OAAO,QAAQ,QAAQ;AAAA,IAC3C,SAAS,OAAO;AACd,aAAO;AAAA,IACT;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,OAAqB,WAAmB;AACnD,QAAI;AACF,YAAM,IAAI,SAAS;AACnB,aAAO;AAAA,IACT,SAAS,OAAO;AACd,aAAO;AAAA,IACT;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MAAM;AACV,UAAM,QAAQ,MAAM,KAAK,IAAI,UAAU,KAAK,eAAe;AAC3D,SAAK,QAAQ,KAAK,SAAS,MAAM;AAKjC,QAAI,CAAC,KAAK,aAAa,OAAO,KAAK,KAAK,GAAG;AACzC,WAAK,OAAO;AAAA,QACV,IAAI,KAAK,KAAK;AAAA,MAChB;AACA,WAAK,WAAW;AAChB;AAAA,IACF;AAKA,QAAI,KAAK,aAAa,KAAK,QAAQ,KAAK,KAAK,SAAS,GAAG;AACvD,WAAK,OAAO;AAAA,QACV;AAAA,MACF;AACA,WAAK,WAAW;AAChB;AAAA,IACF;AAKA,QAAI,KAAK,IAAI,cAAc;AACzB,YAAM,cAAc,MAAM,KAAK,uBAAuB;AACtD,UAAI,CAAC,YAAa;AAAA,IACpB;AAKA,UAAM,eAAe,MAAM,IAAI,KAAK,KAAK;AAEzC,QAAI,KAAK,QAAQ,KAAK,KAAK,SAAS,GAAG;AACrC,YAAM,aAAa,YAAY,EAAE,MAAM,KAAK,KAAK,CAAC;AAClD,WAAK,OAAO;AAAA,QACV,qBAAqB,KAAK,KAAK,KAAK,IAAI,CAAC,UAAU,KAAK,KAAK;AAAA,MAC/D;AAAA,IACF,WAAW,KAAK,WAAW;AACzB,YAAM,aAAa,UAAU,KAAK,SAAS,EAAE,MAAM;AACnD,WAAK,OAAO;AAAA,QACV,sBAAsB,KAAK,SAAS,UAAU,KAAK,KAAK;AAAA,MAC1D;AAAA,IACF,OAAO;AACL,YAAM,aAAa,MAAM;AACzB,WAAK,OAAO,QAAQ,YAAY,KAAK,KAAK,sBAAsB;AAAA,IAClE;AAAA,EACF;AACF;AA/FU;AAAA,EADP,KAAK,OAAO,EAAE,aAAa,wCAAwC,UAAU,MAAM,CAAC;AAAA,GAXlE,WAYX;AAMA;AAAA,EADP,MAAM,OAAO,EAAE,aAAa,qCAAqC,OAAO,IAAI,CAAC;AAAA,GAjB3D,WAkBX;AAMA;AAAA,EADP,MAAM,MAAM,EAAE,aAAa,8BAA8B,OAAO,IAAI,CAAC;AAAA,GAvBnD,WAwBX;","names":[]}
@@ -0,0 +1,21 @@
1
+ import { BaseCommand } from '@adonisjs/core/ace';
2
+ import { CommandOptions } from '@adonisjs/core/types/ace';
3
+ export default class CacheDelete extends BaseCommand {
4
+ #private;
5
+ static commandName: string;
6
+ static description: string;
7
+ static options: CommandOptions;
8
+ /**
9
+ * The cache key to delete
10
+ */
11
+ key: string;
12
+ /**
13
+ * Choose a custom cache store to delete from. Otherwise, we use the
14
+ * default one
15
+ */
16
+ store: string;
17
+ /**
18
+ * Handle command
19
+ */
20
+ run(): Promise<void>;
21
+ }
@@ -0,0 +1,70 @@
1
+ import {
2
+ __decorateClass
3
+ } from "../chunk-EUXUH3YW.js";
4
+
5
+ // commands/cache_delete.ts
6
+ import { args, BaseCommand } from "@adonisjs/core/ace";
7
+ var CacheDelete = class extends BaseCommand {
8
+ static commandName = "cache:delete";
9
+ static description = "Delete a specific cache entry by key";
10
+ static options = {
11
+ startApp: true
12
+ };
13
+ /**
14
+ * Prompts to take consent when deleting cache entry in production
15
+ */
16
+ async #takeProductionConsent() {
17
+ const question = `You are in production environment. Want to continue deleting cache key "${this.key}"?`;
18
+ try {
19
+ return await this.prompt.confirm(question);
20
+ } catch (error) {
21
+ return false;
22
+ }
23
+ }
24
+ /**
25
+ * Check if the given cache exist
26
+ */
27
+ #cacheExists(cache, cacheName) {
28
+ try {
29
+ cache.use(cacheName);
30
+ return true;
31
+ } catch (error) {
32
+ return false;
33
+ }
34
+ }
35
+ /**
36
+ * Handle command
37
+ */
38
+ async run() {
39
+ const cache = await this.app.container.make("cache.manager");
40
+ this.store = this.store || cache.defaultStoreName;
41
+ if (!this.#cacheExists(cache, this.store)) {
42
+ this.logger.error(
43
+ `"${this.store}" is not a valid cache store. Double check config/cache.ts file`
44
+ );
45
+ this.exitCode = 1;
46
+ return;
47
+ }
48
+ if (this.app.inProduction) {
49
+ const shouldDelete = await this.#takeProductionConsent();
50
+ if (!shouldDelete) return;
51
+ }
52
+ const cacheHandler = cache.use(this.store);
53
+ const deleted = await cacheHandler.delete({ key: this.key });
54
+ if (deleted) {
55
+ this.logger.success(`Deleted cache key "${this.key}" from "${this.store}" cache successfully`);
56
+ } else {
57
+ this.logger.warning(`Cache key "${this.key}" not found in "${this.store}" cache`);
58
+ }
59
+ }
60
+ };
61
+ __decorateClass([
62
+ args.string({ description: "The cache key to delete" })
63
+ ], CacheDelete.prototype, "key", 2);
64
+ __decorateClass([
65
+ args.string({ description: "Define a custom cache store to delete from", required: false })
66
+ ], CacheDelete.prototype, "store", 2);
67
+ export {
68
+ CacheDelete as default
69
+ };
70
+ //# sourceMappingURL=cache_delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../commands/cache_delete.ts"],"sourcesContent":["/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { args, BaseCommand } from '@adonisjs/core/ace'\n\nimport { CacheService } from '../src/types.js'\nimport { CommandOptions } from '@adonisjs/core/types/ace'\n\nexport default class CacheDelete extends BaseCommand {\n static commandName = 'cache:delete'\n static description = 'Delete a specific cache entry by key'\n static options: CommandOptions = {\n startApp: true,\n }\n\n /**\n * The cache key to delete\n */\n @args.string({ description: 'The cache key to delete' })\n declare key: string\n\n /**\n * Choose a custom cache store to delete from. Otherwise, we use the\n * default one\n */\n @args.string({ description: 'Define a custom cache store to delete from', required: false })\n declare store: string\n\n /**\n * Prompts to take consent when deleting cache entry in production\n */\n async #takeProductionConsent(): Promise<boolean> {\n const question = `You are in production environment. Want to continue deleting cache key \"${this.key}\"?`\n try {\n return await this.prompt.confirm(question)\n } catch (error) {\n return false\n }\n }\n\n /**\n * Check if the given cache exist\n */\n #cacheExists(cache: CacheService, cacheName: string) {\n try {\n cache.use(cacheName)\n return true\n } catch (error) {\n return false\n }\n }\n\n /**\n * Handle command\n */\n async run() {\n const cache = await this.app.container.make('cache.manager')\n this.store = this.store || cache.defaultStoreName\n\n /**\n * Exit if cache store doesn't exist\n */\n if (!this.#cacheExists(cache, this.store)) {\n this.logger.error(\n `\"${this.store}\" is not a valid cache store. Double check config/cache.ts file`\n )\n this.exitCode = 1\n return\n }\n\n /**\n * Take consent when deleting cache entry in production\n */\n if (this.app.inProduction) {\n const shouldDelete = await this.#takeProductionConsent()\n if (!shouldDelete) return\n }\n\n /**\n * Finally delete the cache entry\n */\n const cacheHandler = cache.use(this.store)\n const deleted = await cacheHandler.delete({ key: this.key })\n\n if (deleted) {\n this.logger.success(`Deleted cache key \"${this.key}\" from \"${this.store}\" cache successfully`)\n } else {\n this.logger.warning(`Cache key \"${this.key}\" not found in \"${this.store}\" cache`)\n }\n }\n}\n"],"mappings":";;;;;AASA,SAAS,MAAM,mBAAmB;AAKlC,IAAqB,cAArB,cAAyC,YAAY;AAAA,EACnD,OAAO,cAAc;AAAA,EACrB,OAAO,cAAc;AAAA,EACrB,OAAO,UAA0B;AAAA,IAC/B,UAAU;AAAA,EACZ;AAAA;AAAA;AAAA;AAAA,EAkBA,MAAM,yBAA2C;AAC/C,UAAM,WAAW,2EAA2E,KAAK,GAAG;AACpG,QAAI;AACF,aAAO,MAAM,KAAK,OAAO,QAAQ,QAAQ;AAAA,IAC3C,SAAS,OAAO;AACd,aAAO;AAAA,IACT;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,OAAqB,WAAmB;AACnD,QAAI;AACF,YAAM,IAAI,SAAS;AACnB,aAAO;AAAA,IACT,SAAS,OAAO;AACd,aAAO;AAAA,IACT;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MAAM;AACV,UAAM,QAAQ,MAAM,KAAK,IAAI,UAAU,KAAK,eAAe;AAC3D,SAAK,QAAQ,KAAK,SAAS,MAAM;AAKjC,QAAI,CAAC,KAAK,aAAa,OAAO,KAAK,KAAK,GAAG;AACzC,WAAK,OAAO;AAAA,QACV,IAAI,KAAK,KAAK;AAAA,MAChB;AACA,WAAK,WAAW;AAChB;AAAA,IACF;AAKA,QAAI,KAAK,IAAI,cAAc;AACzB,YAAM,eAAe,MAAM,KAAK,uBAAuB;AACvD,UAAI,CAAC,aAAc;AAAA,IACrB;AAKA,UAAM,eAAe,MAAM,IAAI,KAAK,KAAK;AACzC,UAAM,UAAU,MAAM,aAAa,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC;AAE3D,QAAI,SAAS;AACX,WAAK,OAAO,QAAQ,sBAAsB,KAAK,GAAG,WAAW,KAAK,KAAK,sBAAsB;AAAA,IAC/F,OAAO;AACL,WAAK,OAAO,QAAQ,cAAc,KAAK,GAAG,mBAAmB,KAAK,KAAK,SAAS;AAAA,IAClF;AAAA,EACF;AACF;AAvEU;AAAA,EADP,KAAK,OAAO,EAAE,aAAa,0BAA0B,CAAC;AAAA,GAVpC,YAWX;AAOA;AAAA,EADP,KAAK,OAAO,EAAE,aAAa,8CAA8C,UAAU,MAAM,CAAC;AAAA,GAjBxE,YAkBX;","names":[]}
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '@adonisjs/core/ace';
2
+ import { CommandOptions } from '@adonisjs/core/types/ace';
3
+ export default class CachePrune extends BaseCommand {
4
+ #private;
5
+ static commandName: string;
6
+ static description: string;
7
+ static options: CommandOptions;
8
+ /**
9
+ * Choose a custom cache store to prune. Otherwise, we use the
10
+ * default one
11
+ */
12
+ store: string;
13
+ /**
14
+ * Handle command
15
+ */
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,63 @@
1
+ import {
2
+ __decorateClass
3
+ } from "../chunk-EUXUH3YW.js";
4
+
5
+ // commands/cache_prune.ts
6
+ import { args, BaseCommand } from "@adonisjs/core/ace";
7
+ var CachePrune = class extends BaseCommand {
8
+ static commandName = "cache:prune";
9
+ static description = "Remove expired cache entries from the selected store. This command is only useful for stores without native TTL support, like Database or File drivers.";
10
+ static options = {
11
+ startApp: true
12
+ };
13
+ /**
14
+ * Prompts to take consent when pruning the cache in production
15
+ */
16
+ async #takeProductionConsent() {
17
+ const question = "You are in production environment. Want to continue pruning expired cache entries?";
18
+ try {
19
+ return await this.prompt.confirm(question);
20
+ } catch (error) {
21
+ return false;
22
+ }
23
+ }
24
+ /**
25
+ * Check if the given cache exist
26
+ */
27
+ #cacheExists(cache, cacheName) {
28
+ try {
29
+ cache.use(cacheName);
30
+ return true;
31
+ } catch (error) {
32
+ return false;
33
+ }
34
+ }
35
+ /**
36
+ * Handle command
37
+ */
38
+ async run() {
39
+ const cache = await this.app.container.make("cache.manager");
40
+ this.store = this.store || cache.defaultStoreName;
41
+ if (!this.#cacheExists(cache, this.store)) {
42
+ this.logger.error(
43
+ `"${this.store}" is not a valid cache store. Double check config/cache.ts file`
44
+ );
45
+ this.exitCode = 1;
46
+ return;
47
+ }
48
+ if (this.app.inProduction) {
49
+ const shouldPrune = await this.#takeProductionConsent();
50
+ if (!shouldPrune) return;
51
+ }
52
+ const cacheHandler = cache.use(this.store);
53
+ await cacheHandler.prune();
54
+ this.logger.success(`Pruned expired entries from "${this.store}" cache successfully`);
55
+ }
56
+ };
57
+ __decorateClass([
58
+ args.string({ description: "Define a custom cache store to prune", required: false })
59
+ ], CachePrune.prototype, "store", 2);
60
+ export {
61
+ CachePrune as default
62
+ };
63
+ //# sourceMappingURL=cache_prune.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../commands/cache_prune.ts"],"sourcesContent":["/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { args, BaseCommand } from '@adonisjs/core/ace'\n\nimport { CacheService } from '../src/types.js'\nimport { CommandOptions } from '@adonisjs/core/types/ace'\n\nexport default class CachePrune extends BaseCommand {\n static commandName = 'cache:prune'\n static description =\n 'Remove expired cache entries from the selected store. This command is only useful for stores without native TTL support, like Database or File drivers.'\n static options: CommandOptions = {\n startApp: true,\n }\n\n /**\n * Choose a custom cache store to prune. Otherwise, we use the\n * default one\n */\n @args.string({ description: 'Define a custom cache store to prune', required: false })\n declare store: string\n\n /**\n * Prompts to take consent when pruning the cache in production\n */\n async #takeProductionConsent(): Promise<boolean> {\n const question =\n 'You are in production environment. Want to continue pruning expired cache entries?'\n try {\n return await this.prompt.confirm(question)\n } catch (error) {\n return false\n }\n }\n\n /**\n * Check if the given cache exist\n */\n #cacheExists(cache: CacheService, cacheName: string) {\n try {\n cache.use(cacheName)\n return true\n } catch (error) {\n return false\n }\n }\n\n /**\n * Handle command\n */\n async run() {\n const cache = await this.app.container.make('cache.manager')\n this.store = this.store || cache.defaultStoreName\n\n /**\n * Exit if cache store doesn't exist\n */\n if (!this.#cacheExists(cache, this.store)) {\n this.logger.error(\n `\"${this.store}\" is not a valid cache store. Double check config/cache.ts file`\n )\n this.exitCode = 1\n return\n }\n\n /**\n * Take consent when pruning the cache in production\n */\n if (this.app.inProduction) {\n const shouldPrune = await this.#takeProductionConsent()\n if (!shouldPrune) return\n }\n\n /**\n * Finally prune the cache\n */\n const cacheHandler = cache.use(this.store)\n await cacheHandler.prune()\n\n this.logger.success(`Pruned expired entries from \"${this.store}\" cache successfully`)\n }\n}\n"],"mappings":";;;;;AASA,SAAS,MAAM,mBAAmB;AAKlC,IAAqB,aAArB,cAAwC,YAAY;AAAA,EAClD,OAAO,cAAc;AAAA,EACrB,OAAO,cACL;AAAA,EACF,OAAO,UAA0B;AAAA,IAC/B,UAAU;AAAA,EACZ;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,yBAA2C;AAC/C,UAAM,WACJ;AACF,QAAI;AACF,aAAO,MAAM,KAAK,OAAO,QAAQ,QAAQ;AAAA,IAC3C,SAAS,OAAO;AACd,aAAO;AAAA,IACT;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,OAAqB,WAAmB;AACnD,QAAI;AACF,YAAM,IAAI,SAAS;AACnB,aAAO;AAAA,IACT,SAAS,OAAO;AACd,aAAO;AAAA,IACT;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MAAM;AACV,UAAM,QAAQ,MAAM,KAAK,IAAI,UAAU,KAAK,eAAe;AAC3D,SAAK,QAAQ,KAAK,SAAS,MAAM;AAKjC,QAAI,CAAC,KAAK,aAAa,OAAO,KAAK,KAAK,GAAG;AACzC,WAAK,OAAO;AAAA,QACV,IAAI,KAAK,KAAK;AAAA,MAChB;AACA,WAAK,WAAW;AAChB;AAAA,IACF;AAKA,QAAI,KAAK,IAAI,cAAc;AACzB,YAAM,cAAc,MAAM,KAAK,uBAAuB;AACtD,UAAI,CAAC,YAAa;AAAA,IACpB;AAKA,UAAM,eAAe,MAAM,IAAI,KAAK,KAAK;AACzC,UAAM,aAAa,MAAM;AAEzB,SAAK,OAAO,QAAQ,gCAAgC,KAAK,KAAK,sBAAsB;AAAA,EACtF;AACF;AA7DU;AAAA,EADP,KAAK,OAAO,EAAE,aAAa,wCAAwC,UAAU,MAAM,CAAC;AAAA,GAZlE,WAaX;","names":[]}
@@ -1 +1 @@
1
- {"commands":[{"commandName":"cache:clear","description":"Clear the application cache","help":"","namespace":"cache","aliases":[],"flags":[{"name":"namespace","flagName":"namespace","required":false,"type":"string","description":"Select a cache namespace to clear","alias":"n"}],"args":[{"name":"store","argumentName":"store","required":false,"description":"Define a custom cache store to clear","type":"string"}],"options":{"startApp":true},"filePath":"cache_clear.js"}],"version":1}
1
+ {"commands":[{"commandName":"cache:clear","description":"Clear the application cache","help":"","namespace":"cache","aliases":[],"flags":[{"name":"namespace","flagName":"namespace","required":false,"type":"string","description":"Select a cache namespace to clear","alias":"n"},{"name":"tags","flagName":"tags","required":false,"type":"array","description":"Specify tags to invalidate","alias":"t"}],"args":[{"name":"store","argumentName":"store","required":false,"description":"Define a custom cache store to clear","type":"string"}],"options":{"startApp":true},"filePath":"cache_clear.js"},{"commandName":"cache:delete","description":"Delete a specific cache entry by key","help":"","namespace":"cache","aliases":[],"flags":[],"args":[{"name":"key","argumentName":"key","required":true,"description":"The cache key to delete","type":"string"},{"name":"store","argumentName":"store","required":false,"description":"Define a custom cache store to delete from","type":"string"}],"options":{"startApp":true},"filePath":"cache_delete.js"},{"commandName":"cache:prune","description":"Remove expired cache entries from the selected store. This command is only useful for stores without native TTL support, like Database or File drivers.","help":"","namespace":"cache","aliases":[],"flags":[],"args":[{"name":"store","argumentName":"store","required":false,"description":"Define a custom cache store to prune","type":"string"}],"options":{"startApp":true},"filePath":"cache_prune.js"}],"version":1}
package/build/config.stub CHANGED
@@ -18,6 +18,8 @@ const cacheConfig = defineConfig({
18
18
  {{#if driver === 'database'}}
19
19
  .useL2Layer(drivers.database({
20
20
  connectionName: 'primary',
21
+ autoCreateTable: false,
22
+ tableName: 'cache',
21
23
  }))
22
24
  {{#elif driver === 'redis'}}
23
25
  .useL2Layer(drivers.redis({
package/build/index.js CHANGED
@@ -56,8 +56,8 @@ var Store = class {
56
56
  };
57
57
 
58
58
  // stubs/main.ts
59
- import { dirname } from "node:path";
60
- import { fileURLToPath } from "node:url";
59
+ import { dirname } from "path";
60
+ import { fileURLToPath } from "url";
61
61
  var stubsRoot = dirname(fileURLToPath(import.meta.url));
62
62
 
63
63
  // configure.ts
@@ -100,6 +100,15 @@ async function configure(command) {
100
100
  await codemods.defineEnvValidations({ variables: envValidations });
101
101
  }
102
102
  await codemods.makeUsingStub(stubsRoot, "config.stub", { driver });
103
+ if (driver === "database") {
104
+ await codemods.makeUsingStub(stubsRoot, "migration.stub", {
105
+ entity: command.app.generators.createEntity("cache"),
106
+ migration: {
107
+ folder: "database/migrations",
108
+ fileName: `${(/* @__PURE__ */ new Date()).getTime()}_create_cache_table.ts`
109
+ }
110
+ });
111
+ }
103
112
  }
104
113
 
105
114
  // src/define_config.ts
@@ -120,7 +129,10 @@ var drivers = {
120
129
  const redis = await app.container.make("redis");
121
130
  const { redisDriver } = await import("bentocache/drivers/redis");
122
131
  const redisConnection = redis.connection(config.connectionName);
123
- return redisDriver({ connection: redisConnection.ioConnection });
132
+ return redisDriver({
133
+ connection: redisConnection.ioConnection,
134
+ prefix: config.prefix || "bentocache"
135
+ });
124
136
  });
125
137
  },
126
138
  /**
@@ -132,7 +144,10 @@ var drivers = {
132
144
  const redis = await app.container.make("redis");
133
145
  const { redisBusDriver } = await import("bentocache/drivers/redis");
134
146
  const redisConnection = redis.connection(config.connectionName);
135
- return redisBusDriver({ connection: redisConnection.ioConnection.options });
147
+ return redisBusDriver({
148
+ connection: redisConnection.ioConnection.options,
149
+ retryQueue: config.retryQueue
150
+ });
136
151
  });
137
152
  },
138
153
  /**
@@ -159,7 +174,13 @@ var drivers = {
159
174
  );
160
175
  }
161
176
  const { knexDriver } = await import("bentocache/drivers/knex");
162
- return knexDriver({ connection: db.connection(connectionName).getWriteClient() });
177
+ return knexDriver({
178
+ connection: db.connection(connectionName).getWriteClient(),
179
+ autoCreateTable: config?.autoCreateTable ?? true,
180
+ tableName: config?.tableName || "bentocache",
181
+ pruneInterval: config?.pruneInterval ?? false,
182
+ prefix: config?.prefix || "bentocache"
183
+ });
163
184
  });
164
185
  },
165
186
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../index.ts","../src/store.ts","../stubs/main.ts","../configure.ts","../src/define_config.ts","../src/drivers.ts"],"sourcesContent":["/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from 'bentocache'\n\nexport { store } from './src/store.js'\nexport { configure } from './configure.js'\nexport { defineConfig } from './src/define_config.js'\nexport { drivers } from './src/drivers.js'\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { bentostore } from 'bentocache'\nimport { configProvider } from '@adonisjs/core'\nimport type { ConfigProvider } from '@adonisjs/core/types'\nimport {\n RawCommonOptions,\n CreateDriverResult,\n L1CacheDriver,\n CreateBusDriverResult,\n L2CacheDriver,\n} from 'bentocache/types'\n\n/**\n * Create a new store\n */\nexport function store(options?: RawCommonOptions & { prefix?: string }) {\n return new Store(options)\n}\n\nexport class Store {\n #baseOptions: RawCommonOptions & { prefix?: string } = {}\n #l1?: ConfigProvider<CreateDriverResult<L1CacheDriver>>\n #l2?: ConfigProvider<CreateDriverResult<L2CacheDriver>>\n #bus?: ConfigProvider<CreateBusDriverResult>\n\n constructor(baseOptions: RawCommonOptions & { prefix?: string } = {}) {\n this.#baseOptions = baseOptions\n }\n\n /**\n * Add a L1 layer to your store. This is usually a memory driver\n * for fast access purposes.\n */\n useL1Layer(driver: ConfigProvider<CreateDriverResult<L1CacheDriver>>) {\n this.#l1 = driver\n return this\n }\n\n /**\n * Add a L2 layer to your store. This is usually something\n * distributed like Redis, DynamoDB, Sql database, etc.\n */\n useL2Layer(driver: ConfigProvider<CreateDriverResult<L2CacheDriver>>) {\n this.#l2 = driver\n return this\n }\n\n /**\n * Add a bus to your store. It will be used to synchronize L1 layers between\n * different instances of your application.\n */\n useBus(bus: ConfigProvider<CreateBusDriverResult>) {\n this.#bus = bus\n return this\n }\n\n /**\n * Create a config provider for the store\n */\n entry() {\n return configProvider.create(async (app) => {\n const storeInstance = bentostore(this.#baseOptions)\n\n if (this.#l1) storeInstance.useL1Layer(await this.#l1?.resolver(app))\n if (this.#l2) storeInstance.useL2Layer(await this.#l2?.resolver(app))\n if (this.#bus) storeInstance.useBus(await this.#bus?.resolver(app))\n\n return storeInstance\n })\n }\n}\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { dirname } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nexport const stubsRoot = dirname(fileURLToPath(import.meta.url))\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport type Configure from '@adonisjs/core/commands/configure'\n\nimport { stubsRoot } from './stubs/main.js'\n\nconst DRIVERS = ['redis', 'file', 'database', 'dynamodb'] as const\nconst DRIVERS_INFO: {\n [K in (typeof DRIVERS)[number]]: {\n envVars?: Record<string, number | string>\n envValidations?: Record<string, string>\n }\n} = {\n file: {},\n redis: {},\n database: {},\n dynamodb: {\n envValidations: {\n AWS_ACCESS_KEY_ID: `Env.schema.string()`,\n AWS_SECRET_ACCESS_KEY: `Env.schema.string()`,\n AWS_REGION: `Env.schema.string()`,\n DYNAMODB_ENDPOINT: `Env.schema.string()`,\n },\n envVars: {\n AWS_ACCESS_KEY_ID: '',\n AWS_SECRET_ACCESS_KEY: '',\n AWS_REGION: '',\n DYNAMODB_ENDPOINT: '',\n },\n },\n}\n\n/**\n * Configures the package\n */\nexport async function configure(command: Configure) {\n const driver = await command.prompt.choice(\n 'Select the cache driver you plan to use',\n ['redis', 'file', 'database', 'dynamodb'],\n {\n hint: 'You can always change it later',\n }\n )\n\n const codemods = await command.createCodemods()\n\n /**\n * Publish provider\n */\n await codemods.updateRcFile((rcFile) => {\n rcFile.addProvider('@adonisjs/cache/cache_provider').addCommand('@adonisjs/cache/commands')\n })\n\n const { envVars, envValidations } = DRIVERS_INFO[driver]\n\n /**\n * Define environment variables\n */\n if (envVars) {\n await codemods.defineEnvVariables(envVars)\n }\n\n /**\n * Define environment validations\n */\n if (envValidations) {\n await codemods.defineEnvValidations({ variables: envValidations })\n }\n\n /**\n * Publish config\n */\n await codemods.makeUsingStub(stubsRoot, 'config.stub', { driver: driver })\n}\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { Store } from './store.js'\nimport { CacheOptions } from './types.js'\n\n/**\n * Define cache configuration\n */\nexport function defineConfig<KnownCaches extends Record<string, Store>>(\n config: CacheOptions & {\n default: keyof KnownCaches\n stores: KnownCaches\n }\n) {\n return config\n}\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/// <reference types=\"@adonisjs/redis/redis_provider\" />\n/// <reference types=\"@adonisjs/lucid/database_provider\" />\n\nimport { configProvider } from '@adonisjs/core'\nimport type { RedisConnection } from '@adonisjs/redis'\nimport type { ConfigProvider } from '@adonisjs/core/types'\nimport type { RedisConnections } from '@adonisjs/redis/types'\nimport {\n MemoryConfig,\n CreateDriverResult,\n L1CacheDriver,\n L2CacheDriver,\n CreateBusDriverResult,\n DynamoDBConfig,\n FileConfig,\n KyselyConfig,\n OrchidConfig,\n} from 'bentocache/types'\nimport { RuntimeException } from '@adonisjs/core/exceptions'\n\n/**\n * Different drivers supported by the cache module\n */\nexport const drivers: {\n memory: (config?: MemoryConfig) => ConfigProvider<CreateDriverResult<L1CacheDriver>>\n redis: (config: {\n connectionName?: keyof RedisConnections\n }) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n redisBus: (config: {\n connectionName?: keyof RedisConnections\n }) => ConfigProvider<CreateBusDriverResult>\n database: (config?: {\n connectionName?: string\n }) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n dynamodb: (config: DynamoDBConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n file: (config: FileConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n kysely: (config: KyselyConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n orchid: (config: OrchidConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n} = {\n /**\n * Redis driver for L2 layer\n * You must install @adonisjs/redis to use this driver\n */\n redis(config) {\n return configProvider.create(async (app) => {\n const redis = await app.container.make('redis')\n const { redisDriver } = await import('bentocache/drivers/redis')\n\n const redisConnection = redis.connection(config.connectionName) as any as RedisConnection\n return redisDriver({ connection: redisConnection.ioConnection })\n })\n },\n\n /**\n * Redis driver for the sync bus\n * You must install @adonisjs/redis to use this driver\n */\n redisBus(config) {\n return configProvider.create(async (app) => {\n const redis = await app.container.make('redis')\n const { redisBusDriver } = await import('bentocache/drivers/redis')\n\n const redisConnection = redis.connection(config.connectionName) as any as RedisConnection\n return redisBusDriver({ connection: redisConnection.ioConnection.options })\n })\n },\n\n /**\n * Memory driver for L1 layer\n */\n memory(config) {\n return configProvider.create(async () => {\n const { memoryDriver } = await import('bentocache/drivers/memory')\n return memoryDriver(config)\n })\n },\n\n /**\n * Database driver for L2 layer\n * You must install @adonisjs/lucid to use this driver\n */\n database(config) {\n return configProvider.create(async (app) => {\n const db = await app.container.make('lucid.db')\n const connectionName = config?.connectionName || db.primaryConnectionName\n const connection = db.manager.get(connectionName)\n\n /**\n * Throw error when mentioned connection is not specified\n * in the database file\n */\n if (!connection) {\n throw new RuntimeException(\n `Invalid connection name \"${connectionName}\" referenced by \"config/cache.ts\" file. First register the connection inside \"config/database.ts\" file`\n )\n }\n\n const { knexDriver } = await import('bentocache/drivers/knex')\n return knexDriver({ connection: db.connection(connectionName).getWriteClient() })\n })\n },\n\n /**\n * DynamoDB driver for L2 layer\n * You must install @aws-sdk/client-dynamodb to use this driver\n */\n dynamodb(config) {\n return configProvider.create(async () => {\n const { dynamoDbDriver } = await import('bentocache/drivers/dynamodb')\n return dynamoDbDriver(config)\n })\n },\n\n /**\n * File driver for L2 layer\n */\n file(config) {\n return configProvider.create(async () => {\n const { fileDriver } = await import('bentocache/drivers/file')\n return fileDriver(config)\n })\n },\n\n /**\n * Kysely driver for L2 layer\n */\n kysely(config) {\n return configProvider.create(async () => {\n const { kyselyDriver } = await import('bentocache/drivers/kysely')\n return kyselyDriver(config)\n })\n },\n\n /**\n * Orchid driver for L2 layer\n */\n orchid(config) {\n return configProvider.create(async () => {\n const { orchidDriver } = await import('bentocache/drivers/orchid')\n return orchidDriver(config)\n })\n },\n}\n"],"mappings":";;;AASA,cAAc;;;ACAd,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAaxB,SAAS,MAAM,SAAkD;AACtE,SAAO,IAAI,MAAM,OAAO;AAC1B;AAEO,IAAM,QAAN,MAAY;AAAA,EACjB,eAAuD,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,cAAsD,CAAC,GAAG;AACpE,SAAK,eAAe;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW,QAA2D;AACpE,SAAK,MAAM;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW,QAA2D;AACp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ts","../src/define_config.ts","../src/drivers.ts"],"sourcesContent":["/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from 'bentocache'\n\nexport { store } from './src/store.js'\nexport { configure } from './configure.js'\nexport { defineConfig } from './src/define_config.js'\nexport { drivers } from './src/drivers.js'\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { bentostore } from 'bentocache'\nimport { configProvider } from '@adonisjs/core'\nimport type { ConfigProvider } from '@adonisjs/core/types'\nimport {\n RawCommonOptions,\n CreateDriverResult,\n L1CacheDriver,\n CreateBusDriverResult,\n L2CacheDriver,\n} from 'bentocache/types'\n\n/**\n * Create a new store\n */\nexport function store(options?: RawCommonOptions & { prefix?: string }) {\n return new Store(options)\n}\n\nexport class Store {\n #baseOptions: RawCommonOptions & { prefix?: string } = {}\n #l1?: ConfigProvider<CreateDriverResult<L1CacheDriver>>\n #l2?: ConfigProvider<CreateDriverResult<L2CacheDriver>>\n #bus?: ConfigProvider<CreateBusDriverResult>\n\n constructor(baseOptions: RawCommonOptions & { prefix?: string } = {}) {\n this.#baseOptions = baseOptions\n }\n\n /**\n * Add a L1 layer to your store. This is usually a memory driver\n * for fast access purposes.\n */\n useL1Layer(driver: ConfigProvider<CreateDriverResult<L1CacheDriver>>) {\n this.#l1 = driver\n return this\n }\n\n /**\n * Add a L2 layer to your store. This is usually something\n * distributed like Redis, DynamoDB, Sql database, etc.\n */\n useL2Layer(driver: ConfigProvider<CreateDriverResult<L2CacheDriver>>) {\n this.#l2 = driver\n return this\n }\n\n /**\n * Add a bus to your store. It will be used to synchronize L1 layers between\n * different instances of your application.\n */\n useBus(bus: ConfigProvider<CreateBusDriverResult>) {\n this.#bus = bus\n return this\n }\n\n /**\n * Create a config provider for the store\n */\n entry() {\n return configProvider.create(async (app) => {\n const storeInstance = bentostore(this.#baseOptions)\n\n if (this.#l1) storeInstance.useL1Layer(await this.#l1?.resolver(app))\n if (this.#l2) storeInstance.useL2Layer(await this.#l2?.resolver(app))\n if (this.#bus) storeInstance.useBus(await this.#bus?.resolver(app))\n\n return storeInstance\n })\n }\n}\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { dirname } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nexport const stubsRoot = dirname(fileURLToPath(import.meta.url))\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport type Configure from '@adonisjs/core/commands/configure'\n\nimport { stubsRoot } from './stubs/main.js'\n\nconst DRIVERS = ['redis', 'file', 'database', 'dynamodb'] as const\nconst DRIVERS_INFO: {\n [K in (typeof DRIVERS)[number]]: {\n envVars?: Record<string, number | string>\n envValidations?: Record<string, string>\n }\n} = {\n file: {},\n redis: {},\n database: {},\n dynamodb: {\n envValidations: {\n AWS_ACCESS_KEY_ID: `Env.schema.string()`,\n AWS_SECRET_ACCESS_KEY: `Env.schema.string()`,\n AWS_REGION: `Env.schema.string()`,\n DYNAMODB_ENDPOINT: `Env.schema.string()`,\n },\n envVars: {\n AWS_ACCESS_KEY_ID: '',\n AWS_SECRET_ACCESS_KEY: '',\n AWS_REGION: '',\n DYNAMODB_ENDPOINT: '',\n },\n },\n}\n\n/**\n * Configures the package\n */\nexport async function configure(command: Configure) {\n const driver = await command.prompt.choice(\n 'Select the cache driver you plan to use',\n ['redis', 'file', 'database', 'dynamodb'],\n {\n hint: 'You can always change it later',\n }\n )\n\n const codemods = await command.createCodemods()\n\n /**\n * Publish provider\n */\n await codemods.updateRcFile((rcFile) => {\n rcFile.addProvider('@adonisjs/cache/cache_provider').addCommand('@adonisjs/cache/commands')\n })\n\n const { envVars, envValidations } = DRIVERS_INFO[driver]\n\n /**\n * Define environment variables\n */\n if (envVars) {\n await codemods.defineEnvVariables(envVars)\n }\n\n /**\n * Define environment validations\n */\n if (envValidations) {\n await codemods.defineEnvValidations({ variables: envValidations })\n }\n\n /**\n * Publish config\n */\n await codemods.makeUsingStub(stubsRoot, 'config.stub', { driver: driver })\n\n /**\n * Create migration for database driver\n */\n if (driver === 'database') {\n await codemods.makeUsingStub(stubsRoot, 'migration.stub', {\n entity: command.app.generators.createEntity('cache'),\n migration: {\n folder: 'database/migrations',\n fileName: `${new Date().getTime()}_create_cache_table.ts`,\n },\n })\n }\n}\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { Store } from './store.js'\nimport { CacheOptions } from './types.js'\n\n/**\n * Define cache configuration\n */\nexport function defineConfig<KnownCaches extends Record<string, Store>>(\n config: CacheOptions & {\n default: keyof KnownCaches\n stores: KnownCaches\n }\n) {\n return config\n}\n","/*\n * @adonisjs/cache\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/// <reference types=\"@adonisjs/redis/redis_provider\" />\n/// <reference types=\"@adonisjs/lucid/database_provider\" />\n\nimport { configProvider } from '@adonisjs/core'\nimport type { RedisConnection } from '@adonisjs/redis'\nimport type { ConfigProvider } from '@adonisjs/core/types'\nimport type { RedisConnections } from '@adonisjs/redis/types'\nimport {\n MemoryConfig,\n CreateDriverResult,\n L1CacheDriver,\n L2CacheDriver,\n CreateBusDriverResult,\n DynamoDBConfig,\n FileConfig,\n RedisConfig,\n BusOptions,\n KyselyConfig,\n OrchidConfig,\n DatabaseConfig,\n} from 'bentocache/types'\nimport { RuntimeException } from '@adonisjs/core/exceptions'\n\n/**\n * Different drivers supported by the cache module\n */\nexport const drivers: {\n memory: (config?: MemoryConfig) => ConfigProvider<CreateDriverResult<L1CacheDriver>>\n redis: (\n config: Omit<RedisConfig, 'connection'> & { connectionName?: keyof RedisConnections }\n ) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n redisBus: (\n config: BusOptions & { connectionName?: keyof RedisConnections }\n ) => ConfigProvider<CreateBusDriverResult>\n database: (\n config?: DatabaseConfig & { connectionName?: string }\n ) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n dynamodb: (config: DynamoDBConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n file: (config: FileConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n kysely: (config: KyselyConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n orchid: (config: OrchidConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>\n} = {\n /**\n * Redis driver for L2 layer\n * You must install @adonisjs/redis to use this driver\n */\n redis(config) {\n return configProvider.create(async (app) => {\n const redis = await app.container.make('redis')\n const { redisDriver } = await import('bentocache/drivers/redis')\n\n const redisConnection = redis.connection(config.connectionName) as any as RedisConnection\n return redisDriver({\n connection: redisConnection.ioConnection,\n prefix: config.prefix || 'bentocache',\n })\n })\n },\n\n /**\n * Redis driver for the sync bus\n * You must install @adonisjs/redis to use this driver\n */\n redisBus(config) {\n return configProvider.create(async (app) => {\n const redis = await app.container.make('redis')\n const { redisBusDriver } = await import('bentocache/drivers/redis')\n\n const redisConnection = redis.connection(config.connectionName) as any as RedisConnection\n return redisBusDriver({\n connection: redisConnection.ioConnection.options,\n retryQueue: config.retryQueue,\n })\n })\n },\n\n /**\n * Memory driver for L1 layer\n */\n memory(config) {\n return configProvider.create(async () => {\n const { memoryDriver } = await import('bentocache/drivers/memory')\n return memoryDriver(config)\n })\n },\n\n /**\n * Database driver for L2 layer\n * You must install @adonisjs/lucid to use this driver\n */\n database(config) {\n return configProvider.create(async (app) => {\n const db = await app.container.make('lucid.db')\n const connectionName = config?.connectionName || db.primaryConnectionName\n const connection = db.manager.get(connectionName)\n\n /**\n * Throw error when mentioned connection is not specified\n * in the database file\n */\n if (!connection) {\n throw new RuntimeException(\n `Invalid connection name \"${connectionName}\" referenced by \"config/cache.ts\" file. First register the connection inside \"config/database.ts\" file`\n )\n }\n\n const { knexDriver } = await import('bentocache/drivers/knex')\n return knexDriver({\n connection: db.connection(connectionName).getWriteClient(),\n autoCreateTable: config?.autoCreateTable ?? true,\n tableName: config?.tableName || 'bentocache',\n pruneInterval: config?.pruneInterval ?? false,\n prefix: config?.prefix || 'bentocache',\n })\n })\n },\n\n /**\n * DynamoDB driver for L2 layer\n * You must install @aws-sdk/client-dynamodb to use this driver\n */\n dynamodb(config) {\n return configProvider.create(async () => {\n const { dynamoDbDriver } = await import('bentocache/drivers/dynamodb')\n return dynamoDbDriver(config)\n })\n },\n\n /**\n * File driver for L2 layer\n */\n file(config) {\n return configProvider.create(async () => {\n const { fileDriver } = await import('bentocache/drivers/file')\n return fileDriver(config)\n })\n },\n\n /**\n * Kysely driver for L2 layer\n */\n kysely(config) {\n return configProvider.create(async () => {\n const { kyselyDriver } = await import('bentocache/drivers/kysely')\n return kyselyDriver(config)\n })\n },\n\n /**\n * Orchid driver for L2 layer\n */\n orchid(config) {\n return configProvider.create(async () => {\n const { orchidDriver } = await import('bentocache/drivers/orchid')\n return orchidDriver(config)\n })\n },\n}\n"],"mappings":";;;AASA,cAAc;;;ACAd,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAaxB,SAAS,MAAM,SAAkD;AACtE,SAAO,IAAI,MAAM,OAAO;AAC1B;AAEO,IAAM,QAAN,MAAY;AAAA,EACjB,eAAuD,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,cAAsD,CAAC,GAAG;AACpE,SAAK,eAAe;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW,QAA2D;AACpE,SAAK,MAAM;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW,QAA2D;AACpE,SAAK,MAAM;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,KAA4C;A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AAOA,gBAAe,OAAO,YAAY;AACvC,YAAM,EAAE,aAAa,IAAI,MAAM,OAAO,2BAA2B;AACjE,aAAO,aAAa,MAAM;AAAA,IAC5B,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,QAAQ;AACb,WAAOA,gBAAe,OAAO,YAAY;AACvC,YAAM,EAAE,aAAa,IAAI,MAAM,OAAO,2BAA2B;AACjE,aAAO,aAAa,MAAM;AAAA,IAC5B,CAAC;AAAA,EACH;AACF;","names":["configProvider"]}
@@ -1 +1 @@
1
- {"inputs":{"src/store.ts":{"bytes":2107,"imports":[{"path":"bentocache","kind":"import-statement","external":true},{"path":"@adonisjs/core","kind":"import-statement","external":true},{"path":"bentocache/types","kind":"import-statement","external":true}],"format":"esm"},"stubs/main.ts":{"bytes":319,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true}],"format":"esm"},"configure.ts":{"bytes":1883,"imports":[{"path":"stubs/main.ts","kind":"import-statement","original":"./stubs/main.js"}],"format":"esm"},"src/define_config.ts":{"bytes":473,"imports":[{"path":"./store.js","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true}],"format":"esm"},"src/drivers.ts":{"bytes":4713,"imports":[{"path":"@adonisjs/core","kind":"import-statement","external":true},{"path":"bentocache/types","kind":"import-statement","external":true},{"path":"@adonisjs/core/exceptions","kind":"import-statement","external":true},{"path":"bentocache/drivers/redis","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/redis","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/memory","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/knex","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/dynamodb","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/file","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/kysely","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/orchid","kind":"dynamic-import","external":true}],"format":"esm"},"index.ts":{"bytes":383,"imports":[{"path":"bentocache","kind":"import-statement","external":true},{"path":"src/store.ts","kind":"import-statement","original":"./src/store.js"},{"path":"configure.ts","kind":"import-statement","original":"./configure.js"},{"path":"src/define_config.ts","kind":"import-statement","original":"./src/define_config.js"},{"path":"src/drivers.ts","kind":"import-statement","original":"./src/drivers.js"}],"format":"esm"},"commands/cache_clear.ts":{"bytes":2583,"imports":[{"path":"@adonisjs/core/ace","kind":"import-statement","external":true},{"path":"../src/types.js","kind":"import-statement","external":true},{"path":"@adonisjs/core/types/ace","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/bindings/repl.ts":{"bytes":910,"imports":[],"format":"esm"},"src/debug.ts":{"bytes":256,"imports":[{"path":"node:util","kind":"import-statement","external":true}],"format":"esm"},"src/bindings/edge.ts":{"bytes":474,"imports":[{"path":"src/debug.ts","kind":"import-statement","original":"../debug.js"},{"path":"../types.js","kind":"import-statement","external":true},{"path":"edge.js","kind":"dynamic-import","external":true}],"format":"esm"},"providers/cache_provider.ts":{"bytes":3079,"imports":[{"path":"../index.js","kind":"import-statement","external":true},{"path":"src/bindings/repl.ts","kind":"import-statement","original":"../src/bindings/repl.js"},{"path":"src/bindings/edge.ts","kind":"import-statement","original":"../src/bindings/edge.js"},{"path":"bentocache","kind":"dynamic-import","external":true}],"format":"esm"},"services/main.ts":{"bytes":476,"imports":[{"path":"@adonisjs/core/services/app","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":1047,"imports":[{"path":"bentocache/types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"build/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":13928},"build/index.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"bentocache","kind":"import-statement","external":true},{"path":"bentocache","kind":"import-statement","external":true},{"path":"@adonisjs/core","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"@adonisjs/core","kind":"import-statement","external":true},{"path":"@adonisjs/core/exceptions","kind":"import-statement","external":true},{"path":"bentocache/drivers/redis","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/redis","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/memory","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/knex","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/dynamodb","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/file","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/kysely","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/orchid","kind":"dynamic-import","external":true}],"exports":["configure","defineConfig","drivers","store"],"entryPoint":"index.ts","inputs":{"index.ts":{"bytesInOutput":28},"src/store.ts":{"bytesInOutput":1304},"stubs/main.ts":{"bytesInOutput":136},"configure.ts":{"bytesInOutput":1170},"src/define_config.ts":{"bytesInOutput":51},"src/drivers.ts":{"bytesInOutput":3081}},"bytes":5969},"build/commands/cache_clear.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3999},"build/commands/cache_clear.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"@adonisjs/core/ace","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"commands/cache_clear.ts","inputs":{"commands/cache_clear.ts":{"bytesInOutput":1953}},"bytes":2075},"build/providers/cache_provider.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":6765},"build/providers/cache_provider.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"node:util","kind":"import-statement","external":true},{"path":"edge.js","kind":"dynamic-import","external":true},{"path":"bentocache","kind":"dynamic-import","external":true}],"exports":["default"],"entryPoint":"providers/cache_provider.ts","inputs":{"src/bindings/repl.ts":{"bytesInOutput":443},"src/debug.ts":{"bytesInOutput":86},"src/bindings/edge.ts":{"bytesInOutput":211},"providers/cache_provider.ts":{"bytesInOutput":1658}},"bytes":2567},"build/services/main.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":718},"build/services/main.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"@adonisjs/core/services/app","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"services/main.ts","inputs":{"services/main.ts":{"bytesInOutput":146}},"bytes":229},"build/chunk-EUXUH3YW.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"build/chunk-EUXUH3YW.js":{"imports":[],"exports":["__decorateClass"],"inputs":{},"bytes":524},"build/src/types.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":1214},"build/src/types.js":{"imports":[{"path":"bentocache/types","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/types.ts","inputs":{"src/types.ts":{"bytesInOutput":34}},"bytes":50}}}
1
+ {"inputs":{"src/store.ts":{"bytes":2107,"imports":[{"path":"bentocache","kind":"import-statement","external":true},{"path":"@adonisjs/core","kind":"import-statement","external":true},{"path":"bentocache/types","kind":"import-statement","external":true}],"format":"esm"},"stubs/main.ts":{"bytes":319,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"url","kind":"import-statement","external":true}],"format":"esm"},"configure.ts":{"bytes":2238,"imports":[{"path":"stubs/main.ts","kind":"import-statement","original":"./stubs/main.js"}],"format":"esm"},"src/define_config.ts":{"bytes":473,"imports":[{"path":"./store.js","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true}],"format":"esm"},"src/drivers.ts":{"bytes":5176,"imports":[{"path":"@adonisjs/core","kind":"import-statement","external":true},{"path":"bentocache/types","kind":"import-statement","external":true},{"path":"@adonisjs/core/exceptions","kind":"import-statement","external":true},{"path":"bentocache/drivers/redis","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/redis","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/memory","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/knex","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/dynamodb","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/file","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/kysely","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/orchid","kind":"dynamic-import","external":true}],"format":"esm"},"index.ts":{"bytes":383,"imports":[{"path":"bentocache","kind":"import-statement","external":true},{"path":"src/store.ts","kind":"import-statement","original":"./src/store.js"},{"path":"configure.ts","kind":"import-statement","original":"./configure.js"},{"path":"src/define_config.ts","kind":"import-statement","original":"./src/define_config.js"},{"path":"src/drivers.ts","kind":"import-statement","original":"./src/drivers.js"}],"format":"esm"},"commands/cache_clear.ts":{"bytes":3317,"imports":[{"path":"@adonisjs/core/ace","kind":"import-statement","external":true},{"path":"../src/types.js","kind":"import-statement","external":true},{"path":"@adonisjs/core/types/ace","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"commands/cache_delete.ts":{"bytes":2514,"imports":[{"path":"@adonisjs/core/ace","kind":"import-statement","external":true},{"path":"../src/types.js","kind":"import-statement","external":true},{"path":"@adonisjs/core/types/ace","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"commands/cache_prune.ts":{"bytes":2313,"imports":[{"path":"@adonisjs/core/ace","kind":"import-statement","external":true},{"path":"../src/types.js","kind":"import-statement","external":true},{"path":"@adonisjs/core/types/ace","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/bindings/repl.ts":{"bytes":910,"imports":[],"format":"esm"},"src/debug.ts":{"bytes":256,"imports":[{"path":"util","kind":"import-statement","external":true}],"format":"esm"},"src/bindings/edge.ts":{"bytes":474,"imports":[{"path":"src/debug.ts","kind":"import-statement","original":"../debug.js"},{"path":"../types.js","kind":"import-statement","external":true},{"path":"edge.js","kind":"dynamic-import","external":true}],"format":"esm"},"providers/cache_provider.ts":{"bytes":3079,"imports":[{"path":"../index.js","kind":"import-statement","external":true},{"path":"src/bindings/repl.ts","kind":"import-statement","original":"../src/bindings/repl.js"},{"path":"src/bindings/edge.ts","kind":"import-statement","original":"../src/bindings/edge.js"},{"path":"bentocache","kind":"dynamic-import","external":true}],"format":"esm"},"services/main.ts":{"bytes":476,"imports":[{"path":"@adonisjs/core/services/app","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":1047,"imports":[{"path":"bentocache/types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"build/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":15172},"build/index.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"bentocache","kind":"import-statement","external":true},{"path":"bentocache","kind":"import-statement","external":true},{"path":"@adonisjs/core","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"url","kind":"import-statement","external":true},{"path":"@adonisjs/core","kind":"import-statement","external":true},{"path":"@adonisjs/core/exceptions","kind":"import-statement","external":true},{"path":"bentocache/drivers/redis","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/redis","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/memory","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/knex","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/dynamodb","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/file","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/kysely","kind":"dynamic-import","external":true},{"path":"bentocache/drivers/orchid","kind":"dynamic-import","external":true}],"exports":["configure","defineConfig","drivers","store"],"entryPoint":"index.ts","inputs":{"index.ts":{"bytesInOutput":28},"src/store.ts":{"bytesInOutput":1304},"stubs/main.ts":{"bytesInOutput":126},"configure.ts":{"bytesInOutput":1487},"src/define_config.ts":{"bytesInOutput":51},"src/drivers.ts":{"bytesInOutput":3424}},"bytes":6619},"build/commands/cache_clear.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":5125},"build/commands/cache_clear.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"@adonisjs/core/ace","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"commands/cache_clear.ts","inputs":{"commands/cache_clear.ts":{"bytesInOutput":2556}},"bytes":2678},"build/commands/cache_delete.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3932},"build/commands/cache_delete.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"@adonisjs/core/ace","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"commands/cache_delete.ts","inputs":{"commands/cache_delete.ts":{"bytesInOutput":1914}},"bytes":2038},"build/commands/cache_prune.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3481},"build/commands/cache_prune.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"@adonisjs/core/ace","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"commands/cache_prune.ts","inputs":{"commands/cache_prune.ts":{"bytesInOutput":1727}},"bytes":1849},"build/providers/cache_provider.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":6765},"build/providers/cache_provider.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"util","kind":"import-statement","external":true},{"path":"edge.js","kind":"dynamic-import","external":true},{"path":"bentocache","kind":"dynamic-import","external":true}],"exports":["default"],"entryPoint":"providers/cache_provider.ts","inputs":{"src/bindings/repl.ts":{"bytesInOutput":443},"src/debug.ts":{"bytesInOutput":81},"src/bindings/edge.ts":{"bytesInOutput":211},"providers/cache_provider.ts":{"bytesInOutput":1658}},"bytes":2562},"build/services/main.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":718},"build/services/main.js":{"imports":[{"path":"build/chunk-EUXUH3YW.js","kind":"import-statement"},{"path":"@adonisjs/core/services/app","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"services/main.ts","inputs":{"services/main.ts":{"bytesInOutput":146}},"bytes":229},"build/chunk-EUXUH3YW.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"build/chunk-EUXUH3YW.js":{"imports":[],"exports":["__decorateClass"],"inputs":{},"bytes":524},"build/src/types.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":1214},"build/src/types.js":{"imports":[{"path":"bentocache/types","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/types.ts","inputs":{"src/types.ts":{"bytesInOutput":34}},"bytes":50}}}
@@ -0,0 +1,22 @@
1
+ {{{
2
+ exports({
3
+ to: app.makePath(migration.folder, entity.path, migration.fileName)
4
+ })
5
+ }}}
6
+ import { BaseSchema } from '@adonisjs/lucid/schema'
7
+
8
+ export default class extends BaseSchema {
9
+ protected tableName = 'cache'
10
+
11
+ async up() {
12
+ this.schema.createTable(this.tableName, (table) => {
13
+ table.string('key', 255).notNullable().primary()
14
+ table.text('value', 'longtext')
15
+ table.timestamp('expires_at').nullable()
16
+ })
17
+ }
18
+
19
+ async down() {
20
+ this.schema.dropTable(this.tableName)
21
+ }
22
+ }
@@ -16,7 +16,7 @@ function defineReplBindings(app, Repl) {
16
16
  }
17
17
 
18
18
  // src/debug.ts
19
- import { debuglog } from "node:util";
19
+ import { debuglog } from "util";
20
20
  var debug_default = debuglog("adonisjs:cache");
21
21
 
22
22
  // src/bindings/edge.ts
@@ -1,18 +1,18 @@
1
1
  import type { ConfigProvider } from '@adonisjs/core/types';
2
2
  import type { RedisConnections } from '@adonisjs/redis/types';
3
- import { MemoryConfig, CreateDriverResult, L1CacheDriver, L2CacheDriver, CreateBusDriverResult, DynamoDBConfig, FileConfig, KyselyConfig, OrchidConfig } from 'bentocache/types';
3
+ import { MemoryConfig, CreateDriverResult, L1CacheDriver, L2CacheDriver, CreateBusDriverResult, DynamoDBConfig, FileConfig, RedisConfig, BusOptions, KyselyConfig, OrchidConfig, DatabaseConfig } from 'bentocache/types';
4
4
  /**
5
5
  * Different drivers supported by the cache module
6
6
  */
7
7
  export declare const drivers: {
8
8
  memory: (config?: MemoryConfig) => ConfigProvider<CreateDriverResult<L1CacheDriver>>;
9
- redis: (config: {
9
+ redis: (config: Omit<RedisConfig, 'connection'> & {
10
10
  connectionName?: keyof RedisConnections;
11
11
  }) => ConfigProvider<CreateDriverResult<L2CacheDriver>>;
12
- redisBus: (config: {
12
+ redisBus: (config: BusOptions & {
13
13
  connectionName?: keyof RedisConnections;
14
14
  }) => ConfigProvider<CreateBusDriverResult>;
15
- database: (config?: {
15
+ database: (config?: DatabaseConfig & {
16
16
  connectionName?: string;
17
17
  }) => ConfigProvider<CreateDriverResult<L2CacheDriver>>;
18
18
  dynamodb: (config: DynamoDBConfig) => ConfigProvider<CreateDriverResult<L2CacheDriver>>;
@@ -29,18 +29,5 @@ export declare class Store {
29
29
  /**
30
30
  * Create a config provider for the store
31
31
  */
32
- entry(): ConfigProvider<{
33
- "__#116@#private": any;
34
- useL1Layer(driver: CreateDriverResult<L1CacheDriver>): /*elided*/ any;
35
- useL2Layer(driver: CreateDriverResult<L2CacheDriver>): /*elided*/ any;
36
- useBus(bus: CreateBusDriverResult): /*elided*/ any;
37
- readonly entry: {
38
- options: RawCommonOptions & {
39
- prefix?: string;
40
- };
41
- l1: CreateDriverResult<L1CacheDriver> | undefined;
42
- l2: CreateDriverResult<L2CacheDriver> | undefined;
43
- bus: CreateBusDriverResult | undefined;
44
- };
45
- }>;
32
+ entry(): ConfigProvider<import("bentocache").BentoStore>;
46
33
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/cache",
3
3
  "description": "Official caching module for AdonisJS framework",
4
- "version": "1.1.3",
4
+ "version": "1.3.0",
5
5
  "engines": {
6
6
  "node": ">=20.6.0"
7
7
  },
@@ -39,40 +39,40 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@adonisjs/assembler": "^7.8.2",
42
- "@adonisjs/core": "^6.17.2",
43
- "@adonisjs/eslint-config": "^2.0.0",
44
- "@adonisjs/lucid": "^21.6.0",
45
- "@adonisjs/prettier-config": "^1.4.0",
42
+ "@adonisjs/core": "^6.19.0",
43
+ "@adonisjs/eslint-config": "^2.1.0",
44
+ "@adonisjs/lucid": "^21.7.0",
45
+ "@adonisjs/prettier-config": "^1.4.5",
46
46
  "@adonisjs/redis": "^9.2.0",
47
- "@adonisjs/tsconfig": "^1.4.0",
47
+ "@adonisjs/tsconfig": "^1.4.1",
48
48
  "@japa/assert": "^4.0.1",
49
49
  "@japa/expect-type": "^2.0.3",
50
50
  "@japa/file-system": "^2.3.2",
51
51
  "@japa/runner": "^4.2.0",
52
52
  "@japa/snapshot": "^2.0.8",
53
- "@release-it/conventional-changelog": "^10.0.0",
54
- "@swc/core": "^1.10.16",
55
- "@types/node": "~20.17.19",
56
- "better-sqlite3": "^11.8.1",
53
+ "@release-it/conventional-changelog": "^10.0.1",
54
+ "@swc/core": "^1.13.1",
55
+ "@types/node": "~24.0.15",
56
+ "better-sqlite3": "^12.2.0",
57
57
  "c8": "^10.1.3",
58
58
  "copyfiles": "^2.4.1",
59
59
  "del-cli": "^6.0.0",
60
60
  "edge.js": "^6.2.1",
61
- "eslint": "^9.20.1",
62
- "ioredis": "^5.5.0",
61
+ "eslint": "^9.31.0",
62
+ "ioredis": "^5.6.1",
63
63
  "knex": "^3.1.0",
64
- "luxon": "^3.5.0",
65
- "mysql2": "^3.12.0",
64
+ "luxon": "^3.7.1",
65
+ "mysql2": "^3.14.2",
66
66
  "p-event": "^6.0.1",
67
- "pg": "^8.13.3",
68
- "prettier": "^3.5.1",
69
- "release-it": "^18.1.2",
67
+ "pg": "^8.16.3",
68
+ "prettier": "^3.6.2",
69
+ "release-it": "^19.0.4",
70
70
  "ts-node-maintained": "^10.9.5",
71
- "tsup": "^8.3.6",
72
- "typescript": "~5.7.3"
71
+ "tsup": "^8.5.0",
72
+ "typescript": "~5.8.3"
73
73
  },
74
74
  "dependencies": {
75
- "bentocache": "^1.2.0"
75
+ "bentocache": "^1.5.0"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "@adonisjs/assembler": "^7.0.0",
@@ -151,7 +151,9 @@
151
151
  "src/types.ts",
152
152
  "providers/cache_provider.ts",
153
153
  "services/main.ts",
154
- "commands/cache_clear.ts"
154
+ "commands/cache_clear.ts",
155
+ "commands/cache_delete.ts",
156
+ "commands/cache_prune.ts"
155
157
  ],
156
158
  "outDir": "./build",
157
159
  "clean": true,
@@ -160,5 +162,5 @@
160
162
  "sourcemap": true,
161
163
  "target": "esnext"
162
164
  },
163
- "packageManager": "pnpm@10.4.0"
165
+ "packageManager": "pnpm@10.13.1"
164
166
  }