@medusajs/cache-inmemory 1.8.8 → 1.8.9-next-20231031155310
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/initialize/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -44,7 +44,11 @@ var initialize = function (options) { return __awaiter(void 0, void 0, void 0, f
|
|
|
44
44
|
switch (_a.label) {
|
|
45
45
|
case 0:
|
|
46
46
|
serviceKey = modules_sdk_1.Modules.CACHE;
|
|
47
|
-
return [4 /*yield*/, modules_sdk_1.MedusaModule.bootstrap(
|
|
47
|
+
return [4 /*yield*/, modules_sdk_1.MedusaModule.bootstrap({
|
|
48
|
+
moduleKey: serviceKey,
|
|
49
|
+
defaultPath: "@medusajs/cache-inmemory",
|
|
50
|
+
declaration: options,
|
|
51
|
+
})];
|
|
48
52
|
case 1:
|
|
49
53
|
loaded = _a.sent();
|
|
50
54
|
return [2 /*return*/, loaded[serviceKey]];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAK8B;AAIvB,IAAM,UAAU,GAAG,UACxB,OAAgE;;;;;gBAE1D,UAAU,GAAG,qBAAO,CAAC,KAAK,CAAA;gBACjB,qBAAM,0BAAY,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAK8B;AAIvB,IAAM,UAAU,GAAG,UACxB,OAAgE;;;;;gBAE1D,UAAU,GAAG,qBAAO,CAAC,KAAK,CAAA;gBACjB,qBAAM,0BAAY,CAAC,SAAS,CAAgB;wBACzD,SAAS,EAAE,UAAU;wBACrB,WAAW,EAAE,0BAA0B;wBACvC,WAAW,EAAE,OAEgB;qBAC9B,CAAC,EAAA;;gBANI,MAAM,GAAG,SAMb;gBAEF,sBAAO,MAAM,CAAC,UAAU,CAAC,EAAA;;;KAC1B,CAAA;AAbY,QAAA,UAAU,cAatB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ICacheService } from "@medusajs/types";
|
|
3
3
|
import { CacheRecord, InMemoryCacheModuleOptions } from "../types";
|
|
4
|
-
|
|
4
|
+
type InjectedDependencies = {};
|
|
5
5
|
/**
|
|
6
6
|
* Class represents basic, in-memory, cache store.
|
|
7
7
|
*/
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shape of a record saved in `in-memory` cache
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type CacheRecord<T> = {
|
|
5
5
|
data: T;
|
|
6
6
|
/**
|
|
7
7
|
* Timestamp in milliseconds
|
|
8
8
|
*/
|
|
9
9
|
expire: number;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type InMemoryCacheModuleOptions = {
|
|
12
12
|
/**
|
|
13
13
|
* Time to keep data in cache (in seconds)
|
|
14
14
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/cache-inmemory",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.9-next-20231031155310",
|
|
4
4
|
"description": "In-memory Cache Module for Medusa",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -17,19 +17,20 @@
|
|
|
17
17
|
"author": "Medusa",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@medusajs/types": "
|
|
20
|
+
"@medusajs/types": "1.11.5-next-20231031155310",
|
|
21
21
|
"cross-env": "^5.2.1",
|
|
22
|
-
"jest": "^
|
|
23
|
-
"
|
|
24
|
-
"
|
|
22
|
+
"jest": "^29.6.3",
|
|
23
|
+
"rimraf": "^5.0.1",
|
|
24
|
+
"ts-jest": "^29.1.1",
|
|
25
|
+
"typescript": "^5.1.6"
|
|
25
26
|
},
|
|
26
27
|
"scripts": {
|
|
27
28
|
"watch": "tsc --build --watch",
|
|
28
|
-
"
|
|
29
|
-
"build": "tsc --build",
|
|
29
|
+
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
|
|
30
|
+
"build": "rimraf dist && tsc --build",
|
|
30
31
|
"test": "jest --passWithNoTests"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@medusajs/modules-sdk": "
|
|
34
|
+
"@medusajs/modules-sdk": "1.12.2-next-20231031155310"
|
|
34
35
|
}
|
|
35
36
|
}
|