@objectstack/client 3.2.2 → 3.2.4
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +14 -0
- package/dist/index.js +7 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/index.ts +7 -7
- package/vitest.config.ts +13 -0
package/src/index.ts
CHANGED
|
@@ -820,10 +820,10 @@ export class ObjectStackClient {
|
|
|
820
820
|
*/
|
|
821
821
|
check: async (request: CheckPermissionRequest): Promise<CheckPermissionResponse> => {
|
|
822
822
|
const route = this.getRoute('permissions');
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
});
|
|
823
|
+
const params = new URLSearchParams({ object: request.object, action: request.action });
|
|
824
|
+
if (request.recordId !== undefined) params.set('recordId', request.recordId);
|
|
825
|
+
if (request.field !== undefined) params.set('field', request.field);
|
|
826
|
+
const res = await this.fetch(`${this.baseUrl}${route}/check?${params.toString()}`);
|
|
827
827
|
return this.unwrapResponse<CheckPermissionResponse>(res);
|
|
828
828
|
},
|
|
829
829
|
|
|
@@ -832,7 +832,7 @@ export class ObjectStackClient {
|
|
|
832
832
|
*/
|
|
833
833
|
getObjectPermissions: async (object: string): Promise<GetObjectPermissionsResponse> => {
|
|
834
834
|
const route = this.getRoute('permissions');
|
|
835
|
-
const res = await this.fetch(`${this.baseUrl}${route}/
|
|
835
|
+
const res = await this.fetch(`${this.baseUrl}${route}/objects/${encodeURIComponent(object)}`);
|
|
836
836
|
return this.unwrapResponse<GetObjectPermissionsResponse>(res);
|
|
837
837
|
},
|
|
838
838
|
|
|
@@ -841,7 +841,7 @@ export class ObjectStackClient {
|
|
|
841
841
|
*/
|
|
842
842
|
getEffectivePermissions: async (): Promise<GetEffectivePermissionsResponse> => {
|
|
843
843
|
const route = this.getRoute('permissions');
|
|
844
|
-
const res = await this.fetch(`${this.baseUrl}${route}/
|
|
844
|
+
const res = await this.fetch(`${this.baseUrl}${route}/effective`);
|
|
845
845
|
return this.unwrapResponse<GetEffectivePermissionsResponse>(res);
|
|
846
846
|
}
|
|
847
847
|
};
|
|
@@ -1679,7 +1679,7 @@ export class ObjectStackClient {
|
|
|
1679
1679
|
storage: '/api/v1/storage',
|
|
1680
1680
|
automation: '/api/v1/automation',
|
|
1681
1681
|
packages: '/api/v1/packages',
|
|
1682
|
-
permissions: '/api/v1/
|
|
1682
|
+
permissions: '/api/v1/permissions',
|
|
1683
1683
|
realtime: '/api/v1/realtime',
|
|
1684
1684
|
workflow: '/api/v1/workflow',
|
|
1685
1685
|
views: '/api/v1/ui/views',
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
// Exclude integration tests that require a running server
|
|
6
|
+
exclude: [
|
|
7
|
+
'**/node_modules/**',
|
|
8
|
+
'**/dist/**',
|
|
9
|
+
'tests/integration/**',
|
|
10
|
+
],
|
|
11
|
+
environment: 'node',
|
|
12
|
+
}
|
|
13
|
+
});
|