@mondaydotcomorg/monday-authorization 1.2.15 → 1.2.17

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.
@@ -16,6 +16,10 @@ export declare class AuthorizationService {
16
16
  */
17
17
  static isAuthorized(accountId: number, userId: number, resources: Resource[], action: Action): Promise<AuthorizeResponse>;
18
18
  static isAuthorized(accountId: number, userId: number, authorizationRequestObjects: AuthorizationObject[]): Promise<AuthorizeResponse>;
19
+ /**
20
+ * @deprecated - Please use Ignite instead: https://github.com/DaPulse/ignite-monorepo/blob/master/packages/ignite-sdk/README.md
21
+ * @sunsetDate 2024-12-31
22
+ */
19
23
  static isUserGrantedWithFeature(accountId: number, userId: number, featureName: string, options?: {
20
24
  shouldSkipCache?: boolean;
21
25
  }): Promise<boolean>;
@@ -33,6 +33,10 @@ class AuthorizationService {
33
33
  throw new Error('isAuthorized accepts either 3 or 4 arguments');
34
34
  }
35
35
  }
36
+ /**
37
+ * @deprecated - Please use Ignite instead: https://github.com/DaPulse/ignite-monorepo/blob/master/packages/ignite-sdk/README.md
38
+ * @sunsetDate 2024-12-31
39
+ */
36
40
  static async isUserGrantedWithFeature(accountId, userId, featureName, options = {}) {
37
41
  const cachedKey = this.getCachedKeyName(userId, featureName);
38
42
  const shouldSkipCache = options.shouldSkipCache ?? false;
@@ -16,6 +16,10 @@ export declare class AuthorizationService {
16
16
  */
17
17
  static isAuthorized(accountId: number, userId: number, resources: Resource[], action: Action): Promise<AuthorizeResponse>;
18
18
  static isAuthorized(accountId: number, userId: number, authorizationRequestObjects: AuthorizationObject[]): Promise<AuthorizeResponse>;
19
+ /**
20
+ * @deprecated - Please use Ignite instead: https://github.com/DaPulse/ignite-monorepo/blob/master/packages/ignite-sdk/README.md
21
+ * @sunsetDate 2024-12-31
22
+ */
19
23
  static isUserGrantedWithFeature(accountId: number, userId: number, featureName: string, options?: {
20
24
  shouldSkipCache?: boolean;
21
25
  }): Promise<boolean>;
@@ -25,6 +25,10 @@ class AuthorizationService {
25
25
  throw new Error('isAuthorized accepts either 3 or 4 arguments');
26
26
  }
27
27
  }
28
+ /**
29
+ * @deprecated - Please use Ignite instead: https://github.com/DaPulse/ignite-monorepo/blob/master/packages/ignite-sdk/README.md
30
+ * @sunsetDate 2024-12-31
31
+ */
28
32
  static async isUserGrantedWithFeature(accountId, userId, featureName, options = {}) {
29
33
  const cachedKey = this.getCachedKeyName(userId, featureName);
30
34
  const shouldSkipCache = options.shouldSkipCache ?? false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondaydotcomorg/monday-authorization",
3
- "version": "1.2.15",
3
+ "version": "1.2.17",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "BSD-3-Clause",
@@ -25,19 +25,31 @@
25
25
  "@mondaydotcomorg/monday-sns": "^1.0.6",
26
26
  "@mondaydotcomorg/trident-backend-api": "^0.24.3",
27
27
  "lodash": "^4.17.21",
28
- "node-fetch": "^2.6.7",
28
+ "node-fetch": "^2.7.0",
29
29
  "on-headers": "^1.0.2",
30
30
  "ts-node": "^10.0.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@mondaydotcomorg/trident-library": "^0.6.53",
34
34
  "@types/express": "^4.17.20",
35
+ "@types/ioredis-mock": "^8.2.5",
35
36
  "@types/lodash": "^4.17.10",
37
+ "@types/mocha": "8.2.2",
36
38
  "@types/on-headers": "^1.0.0",
39
+ "@types/prompts": "2.4.9",
37
40
  "@types/supertest": "^2.0.11",
41
+ "chai": "4.2.0",
42
+ "chai-as-promised": "7.1.1",
43
+ "chai-http": "4.3.0",
44
+ "eslint": "7.8.1",
45
+ "eslint-config-prettier": "6.15.0",
46
+ "eslint-plugin-import": "2.22.0",
38
47
  "express": "^4.17.1",
39
48
  "ioredis": "^5.2.4",
40
49
  "ioredis-mock": "^8.2.2",
50
+ "mocha": "8.1.3",
51
+ "prettier": "2.1.2",
52
+ "sinon": "^9.2.4",
41
53
  "supertest": "^6.1.3",
42
54
  "typescript": "^5.2.2"
43
55
  },
@@ -52,6 +64,5 @@
52
64
  "build": {
53
65
  "esmMjsRename": true
54
66
  }
55
- },
56
- "gitHead": "3dfd65e8950f37c7be9e3a593d914172c184a256"
67
+ }
57
68
  }
package/CHANGELOG.md DELETED
@@ -1,33 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
- and this project adheres to [Semantic Versioning](http://semver.org/).
7
-
8
- ## [1.2.9] - 2024-10-06
9
- ### Added
10
- - [`authz/bashanye/add-async-resource-attributes-support`](https://github.com/DaPulse/monday-npm-packages/pull/6859)
11
- - `AuthorizationAttributesService` - now supports async upsert and delete - requests sent through SNS-SQS).
12
-
13
- ## [1.2.3] - 2024-06-10
14
- ### Added
15
-
16
- - [`feature/yarden/resource-attributes-api-support-authz-sdk (#5826)`](https://github.com/DaPulse/monday-npm-packages/pull/5826)
17
- - `AuthorizationAttributesService` - now supports upsert (`upsertResourceAttributesSync`) and delete (`deleteResourceAttributesSync`) resource attributes in the authorization MS
18
-
19
- ## [1.2.0] - 2024-01-05
20
- ### Added
21
- - `isAuthorized` now return the unauthorized objects - regardless to the unauthorized ids (which may be missing resource ids if resource has no id, like `feature` e.g.)
22
-
23
- ## [1.1.0] - 2023-08-09
24
-
25
- ### ⚠ BREAKING CHANGES
26
-
27
- - `canActionInScope` now returns an object of type `{ can: boolean; reason: string; }` instead of `boolean`.
28
- This version is considered minor because no one uses this function yet.
29
-
30
- ### Changed
31
-
32
- - [`feature/idan/can-action-in-scope/change-behavior-on-error (#3689)`](https://github.com/DaPulse/monday-npm-packages/pull/3689)
33
- - `canActionInScope`, `canActionInScopeMultiple` and `isAuthorized` are now throwing an error instead of returning `false` when an error occurs as part of the authorization http request (status code is not 2XX)