@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 CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.34.1-test.2/config/assets/logo.svg) Appsemble Node Utilities
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.34.2/config/assets/logo.svg) Appsemble Node Utilities
2
2
 
3
3
  > NodeJS utilities used by Appsemble internally.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/node-utils)](https://www.npmjs.com/package/@appsemble/node-utils)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.34.1-test.2/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.34.1-test.2)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.34.2/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.34.2)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](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.1-test.2/LICENSE.md) ©
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, app });
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.1-test.2",
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.1-test.2",
44
- "@appsemble/utils": "0.34.1-test.2",
45
- "@appsemble/lang-sdk": "0.34.1-test.2",
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({ getApp, getCurrentAppMember, }: Options): Middleware;
3
+ export declare function createGetCurrentAppMemberController({ getCurrentAppMember }: Options): Middleware;
@@ -1,11 +1,6 @@
1
- export function createGetCurrentAppMemberController({ getApp, getCurrentAppMember, }) {
1
+ export function createGetCurrentAppMemberController({ getCurrentAppMember }) {
2
2
  return async (ctx) => {
3
- const { appId } = ctx.pathParams;
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
  };