@meridianjs/workspace-member 1.2.0 → 2.0.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.
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -0
- package/dist/index.mjs +9 -0
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -18,6 +18,8 @@ declare class WorkspaceMemberModuleService extends WorkspaceMemberModuleService_
|
|
|
18
18
|
getAccessRequest(id: string): Promise<any | null>;
|
|
19
19
|
listPendingAccessRequests(workspaceId: string): Promise<any[]>;
|
|
20
20
|
updateAccessRequestStatus(id: string, status: "approved" | "denied"): Promise<any>;
|
|
21
|
+
getUserPendingRequests(userId: string): Promise<any[]>;
|
|
22
|
+
deleteAccessRequest(id: string): Promise<void>;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
declare const _default: _meridianjs_types.ModuleDefinition;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ declare class WorkspaceMemberModuleService extends WorkspaceMemberModuleService_
|
|
|
18
18
|
getAccessRequest(id: string): Promise<any | null>;
|
|
19
19
|
listPendingAccessRequests(workspaceId: string): Promise<any[]>;
|
|
20
20
|
updateAccessRequestStatus(id: string, status: "approved" | "denied"): Promise<any>;
|
|
21
|
+
getUserPendingRequests(userId: string): Promise<any[]>;
|
|
22
|
+
deleteAccessRequest(id: string): Promise<void>;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
declare const _default: _meridianjs_types.ModuleDefinition;
|
package/dist/index.js
CHANGED
|
@@ -113,6 +113,15 @@ var WorkspaceMemberModuleService = class extends (0, import_framework_utils3.Mer
|
|
|
113
113
|
await repo.persistAndFlush(record);
|
|
114
114
|
return record;
|
|
115
115
|
}
|
|
116
|
+
async getUserPendingRequests(userId) {
|
|
117
|
+
const repo = this.container.resolve("workspaceAccessRequestRepository");
|
|
118
|
+
return repo.find({ user_id: userId, status: "pending" }, { orderBy: { created_at: "ASC" } });
|
|
119
|
+
}
|
|
120
|
+
async deleteAccessRequest(id) {
|
|
121
|
+
const repo = this.container.resolve("workspaceAccessRequestRepository");
|
|
122
|
+
const record = await repo.findOne({ id });
|
|
123
|
+
if (record) await repo.removeAndFlush(record);
|
|
124
|
+
}
|
|
116
125
|
};
|
|
117
126
|
|
|
118
127
|
// src/loaders/default.ts
|
package/dist/index.mjs
CHANGED
|
@@ -88,6 +88,15 @@ var WorkspaceMemberModuleService = class extends MeridianService({
|
|
|
88
88
|
await repo.persistAndFlush(record);
|
|
89
89
|
return record;
|
|
90
90
|
}
|
|
91
|
+
async getUserPendingRequests(userId) {
|
|
92
|
+
const repo = this.container.resolve("workspaceAccessRequestRepository");
|
|
93
|
+
return repo.find({ user_id: userId, status: "pending" }, { orderBy: { created_at: "ASC" } });
|
|
94
|
+
}
|
|
95
|
+
async deleteAccessRequest(id) {
|
|
96
|
+
const repo = this.container.resolve("workspaceAccessRequestRepository");
|
|
97
|
+
const record = await repo.findOne({ id });
|
|
98
|
+
if (record) await repo.removeAndFlush(record);
|
|
99
|
+
}
|
|
91
100
|
};
|
|
92
101
|
|
|
93
102
|
// src/loaders/default.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meridianjs/workspace-member",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Meridian workspace-member module — tracks workspace membership and roles",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"prepublishOnly": "npm run build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@meridianjs/framework-utils": "^
|
|
29
|
-
"@meridianjs/types": "^
|
|
28
|
+
"@meridianjs/framework-utils": "^2.0.0",
|
|
29
|
+
"@meridianjs/types": "^2.0.0",
|
|
30
30
|
"@mikro-orm/core": "^6.4.3",
|
|
31
31
|
"@mikro-orm/postgresql": "^6.4.3"
|
|
32
32
|
},
|