@appsemble/node-utils 0.34.1-test.2 → 0.34.2
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/README.md +3 -3
- package/app.js +1 -1
- package/package.json +4 -4
- package/server/controllers/apps/members/current/createGetCurrentAppMemberController.d.ts +1 -1
- package/server/controllers/apps/members/current/createGetCurrentAppMemberController.js +2 -7
- package/server/controllers/common/apps/resources/createCountAppResourcesController.js +1 -0
- package/server/controllers/common/apps/resources/createDeleteAppResourceController.js +1 -0
- package/server/controllers/common/apps/resources/createGetAppResourceByIdController.js +1 -0
- package/server/controllers/common/apps/resources/createQueryAppResourcesController.js +1 -0
- package/server/controllers/common/apps/resources/createUpdateAppResourceController.js +1 -0
- package/server/types.d.ts +0 -2
- package/server/utils/resources.js +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble Node Utilities
|
|
2
2
|
|
|
3
3
|
> NodeJS utilities used by Appsemble internally.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/node-utils)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.34.2)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -26,5 +26,5 @@ compatibility is not guaranteed.
|
|
|
26
26
|
|
|
27
27
|
## License
|
|
28
28
|
|
|
29
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.34.
|
|
29
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.34.2/LICENSE.md) ©
|
|
30
30
|
[Appsemble](https://appsemble.com)
|
package/app.js
CHANGED
|
@@ -34,7 +34,7 @@ export async function getRemapperContext(app, language, options, context) {
|
|
|
34
34
|
language,
|
|
35
35
|
});
|
|
36
36
|
const appVariables = await getAppVariables({ context, app });
|
|
37
|
-
const appMemberInfo = await getCurrentAppMember({ context
|
|
37
|
+
const appMemberInfo = await getCurrentAppMember({ context });
|
|
38
38
|
const cache = objectCache((message) => new IntlMessageFormat(message, language, undefined, {
|
|
39
39
|
formatters: {
|
|
40
40
|
// XXX: idk
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/node-utils",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.2",
|
|
4
4
|
"description": "NodeJS utilities used by Appsemble internally.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"test": "vitest"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@appsemble/types": "0.34.
|
|
44
|
-
"@appsemble/utils": "0.34.
|
|
45
|
-
"@appsemble/lang-sdk": "0.34.
|
|
43
|
+
"@appsemble/types": "0.34.2",
|
|
44
|
+
"@appsemble/utils": "0.34.2",
|
|
45
|
+
"@appsemble/lang-sdk": "0.34.2",
|
|
46
46
|
"@formatjs/fast-memoize": "^2.0.0",
|
|
47
47
|
"@fortawesome/fontawesome-free": "^6.0.0",
|
|
48
48
|
"@kubernetes/client-node": "^0.22.2",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Middleware } from 'koa';
|
|
2
2
|
import { type Options } from '../../../../types.js';
|
|
3
|
-
export declare function createGetCurrentAppMemberController({
|
|
3
|
+
export declare function createGetCurrentAppMemberController({ getCurrentAppMember }: Options): Middleware;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
export function createGetCurrentAppMemberController({
|
|
1
|
+
export function createGetCurrentAppMemberController({ getCurrentAppMember }) {
|
|
2
2
|
return async (ctx) => {
|
|
3
|
-
|
|
4
|
-
const app = await getApp({
|
|
5
|
-
context: ctx,
|
|
6
|
-
query: { where: { id: appId }, attributes: ['id'] },
|
|
7
|
-
});
|
|
8
|
-
ctx.body = await getCurrentAppMember({ context: ctx, app });
|
|
3
|
+
ctx.body = await getCurrentAppMember({ context: ctx });
|
|
9
4
|
};
|
|
10
5
|
}
|
|
11
6
|
//# sourceMappingURL=createGetCurrentAppMemberController.js.map
|
|
@@ -20,6 +20,7 @@ export function createCountAppResourcesController(options) {
|
|
|
20
20
|
where || {},
|
|
21
21
|
{
|
|
22
22
|
type: resourceType,
|
|
23
|
+
AppId: appId,
|
|
23
24
|
GroupId: selectedGroupId ?? null,
|
|
24
25
|
expires: { or: [{ gt: new Date() }, null] },
|
|
25
26
|
...(app.demoMode ? { seed: false, ephemeral: true } : {}),
|
|
@@ -8,6 +8,7 @@ export function createDeleteAppResourceController(options) {
|
|
|
8
8
|
where: {
|
|
9
9
|
id: resourceId,
|
|
10
10
|
type: resourceType,
|
|
11
|
+
AppId: appId,
|
|
11
12
|
GroupId: selectedGroupId ?? null,
|
|
12
13
|
expires: { or: [{ gt: new Date() }, { eq: null }] },
|
|
13
14
|
...(app.demoMode ? { seed: false, ephemeral: true } : {}),
|
|
@@ -9,6 +9,7 @@ export function createGetAppResourceByIdController(options) {
|
|
|
9
9
|
where: {
|
|
10
10
|
id: resourceId,
|
|
11
11
|
type: resourceType,
|
|
12
|
+
AppId: appId,
|
|
12
13
|
GroupId: selectedGroupId ?? null,
|
|
13
14
|
expires: { or: [{ gt: new Date() }, null] },
|
|
14
15
|
...(app.demoMode ? { seed: false, ephemeral: true } : {}),
|
|
@@ -30,6 +30,7 @@ export function createQueryAppResourcesController(options) {
|
|
|
30
30
|
where,
|
|
31
31
|
{
|
|
32
32
|
type: resourceType,
|
|
33
|
+
AppId: appId,
|
|
33
34
|
GroupId: selectedGroupId ?? null,
|
|
34
35
|
expires: { or: [{ gt: new Date() }, null] },
|
|
35
36
|
...(app.demoMode && !isSameOrigin ? { seed: false, ephemeral: true } : {}),
|
|
@@ -8,6 +8,7 @@ export function createUpdateAppResourceController(options) {
|
|
|
8
8
|
where: {
|
|
9
9
|
id: resourceId,
|
|
10
10
|
type: resourceType,
|
|
11
|
+
AppId: appId,
|
|
11
12
|
GroupId: selectedGroupId ?? null,
|
|
12
13
|
expires: { or: [{ gt: new Date() }, null] },
|
|
13
14
|
...(app.demoMode ? { seed: false, ephemeral: true } : {}),
|
package/server/types.d.ts
CHANGED
|
@@ -206,7 +206,6 @@ export interface GetCspParams {
|
|
|
206
206
|
}
|
|
207
207
|
export interface GetCurrentAppMemberParams {
|
|
208
208
|
context: ParameterizedContext<DefaultState, DefaultContextInterface, any>;
|
|
209
|
-
app: App;
|
|
210
209
|
}
|
|
211
210
|
export interface GetCurrentAppMemberGroupsParams {
|
|
212
211
|
context: ParameterizedContext<DefaultState, DefaultContextInterface, any>;
|
|
@@ -245,7 +244,6 @@ export interface ReloadUserParams {
|
|
|
245
244
|
context: ParameterizedContext<DefaultState, DefaultContextInterface, any>;
|
|
246
245
|
}
|
|
247
246
|
export interface ParseQueryParams {
|
|
248
|
-
tableName: string;
|
|
249
247
|
$filter: string;
|
|
250
248
|
$orderby: string;
|
|
251
249
|
resourceDefinition: ResourceDefinition;
|
|
@@ -9,7 +9,6 @@ export function generateResourceQuery(ctx, { parseQuery }, resourceDefinition) {
|
|
|
9
9
|
$orderby: ctx.queryParams.$orderby,
|
|
10
10
|
// @ts-expect-error 2322 null is not assignable to type (strictNullChecks)
|
|
11
11
|
resourceDefinition,
|
|
12
|
-
tableName: 'Resource',
|
|
13
12
|
});
|
|
14
13
|
}
|
|
15
14
|
catch (error) {
|
|
@@ -30,6 +29,7 @@ export async function deleteResourcesRecursively(type, app, options, context) {
|
|
|
30
29
|
attributes: ['id'],
|
|
31
30
|
where: {
|
|
32
31
|
type,
|
|
32
|
+
AppId: app.id,
|
|
33
33
|
or: [{ seed: true }, { ephemeral: true }],
|
|
34
34
|
},
|
|
35
35
|
};
|