@medusajs/api-key 0.1.1 → 0.1.2-next-20240429170320
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/joiner-config.js
CHANGED
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.joinerConfig = exports.entityNameToLinkableKeysMap = exports.LinkableKeys = void 0;
|
|
7
7
|
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
|
8
8
|
const api_key_1 = __importDefault(require("./models/api-key"));
|
|
9
|
-
exports.LinkableKeys = {
|
|
9
|
+
exports.LinkableKeys = {
|
|
10
|
+
api_key_id: api_key_1.default.name,
|
|
11
|
+
};
|
|
10
12
|
const entityLinkableKeysMap = {};
|
|
11
13
|
Object.entries(exports.LinkableKeys).forEach(([key, value]) => {
|
|
12
14
|
entityLinkableKeysMap[value] ?? (entityLinkableKeysMap[value] = []);
|
package/dist/models/api-key.js
CHANGED
|
@@ -47,10 +47,12 @@ __decorate([
|
|
|
47
47
|
__metadata("design:type", String)
|
|
48
48
|
], ApiKey.prototype, "salt", void 0);
|
|
49
49
|
__decorate([
|
|
50
|
+
(0, utils_1.Searchable)(),
|
|
50
51
|
(0, core_1.Property)({ columnType: "text" }),
|
|
51
52
|
__metadata("design:type", String)
|
|
52
53
|
], ApiKey.prototype, "redacted", void 0);
|
|
53
54
|
__decorate([
|
|
55
|
+
(0, utils_1.Searchable)(),
|
|
54
56
|
(0, core_1.Property)({ columnType: "text" }),
|
|
55
57
|
__metadata("design:type", String)
|
|
56
58
|
], ApiKey.prototype, "title", void 0);
|
|
File without changes
|
|
@@ -202,6 +202,9 @@ class ApiKeyModuleService extends utils_1.ModulesSdkUtils.abstractModuleServiceF
|
|
|
202
202
|
}
|
|
203
203
|
// There can only be 2 secret keys at most, and one has to be with a revoked_at date set, so only 1 can be newly created.
|
|
204
204
|
const secretKeysToCreate = data.filter((k) => k.type === utils_1.ApiKeyType.SECRET);
|
|
205
|
+
if (!secretKeysToCreate.length) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
205
208
|
if (secretKeysToCreate.length > 1) {
|
|
206
209
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `You can only create one secret key at a time. You tried to create ${secretKeysToCreate.length} secret keys.`);
|
|
207
210
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/api-key",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2-next-20240429170320",
|
|
4
4
|
"description": "Medusa API Key module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@mikro-orm/cli": "5.9.7",
|
|
41
41
|
"cross-env": "^5.2.1",
|
|
42
42
|
"jest": "^29.6.3",
|
|
43
|
-
"medusa-test-utils": "
|
|
43
|
+
"medusa-test-utils": "1.1.44-next-20240429170320",
|
|
44
44
|
"rimraf": "^3.0.2",
|
|
45
45
|
"ts-jest": "^29.1.1",
|
|
46
46
|
"ts-node": "^10.9.1",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"typescript": "^5.1.6"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@medusajs/modules-sdk": "
|
|
52
|
-
"@medusajs/types": "
|
|
53
|
-
"@medusajs/utils": "
|
|
51
|
+
"@medusajs/modules-sdk": "1.12.11-next-20240429170320",
|
|
52
|
+
"@medusajs/types": "1.12.0-next-20240429170320",
|
|
53
|
+
"@medusajs/utils": "1.12.0-next-20240429170320",
|
|
54
54
|
"@mikro-orm/core": "5.9.7",
|
|
55
55
|
"@mikro-orm/migrations": "5.9.7",
|
|
56
56
|
"@mikro-orm/postgresql": "5.9.7",
|