@machhub-dev/sdk-ts 1.0.13 → 1.0.15

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.
@@ -25,4 +25,5 @@ export declare class Auth {
25
25
  createGroup(name: string, features: Feature[]): Promise<Group>;
26
26
  addUserToGroup(userId: string, groupId: string): Promise<ActionResponse>;
27
27
  addPermissionsToGroup(group_id: string, permissions: Feature[]): Promise<ActionResponse>;
28
+ getPermissions(): Promise<Feature[]>;
28
29
  }
@@ -142,6 +142,10 @@ class Auth {
142
142
  group_id, permissions
143
143
  }).post("/auth/permission");
144
144
  }
145
+ async getPermissions() {
146
+ const res = await this.httpService.request.get("/auth/permission");
147
+ return res.permissions ?? [];
148
+ }
145
149
  }
146
150
  exports.Auth = Auth;
147
151
  // In-memory fallback for environments without localStorage (e.g. Node.js)
@@ -3,4 +3,5 @@ export type { LoginResponse, PermissionResponse, User, Group, Feature, Permissio
3
3
  export type { Operator } from './types/operator.models.js';
4
4
  export type { BaseResponse } from './types/response.models.js';
5
5
  export type { RecordID } from './types/recordID.models.js';
6
+ export { StringToRecordID, RecordIDToString, emptyRecordID } from './types/recordID.models.js';
6
7
  export type { HistorizedData } from './types/tag.models.js';
package/dist/cjs/index.js CHANGED
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SDK = void 0;
3
+ exports.emptyRecordID = exports.RecordIDToString = exports.StringToRecordID = exports.SDK = void 0;
4
4
  var sdk_ts_js_1 = require("./sdk-ts.js");
5
5
  Object.defineProperty(exports, "SDK", { enumerable: true, get: function () { return sdk_ts_js_1.SDK; } });
6
+ var recordID_models_js_1 = require("./types/recordID.models.js");
7
+ Object.defineProperty(exports, "StringToRecordID", { enumerable: true, get: function () { return recordID_models_js_1.StringToRecordID; } });
8
+ Object.defineProperty(exports, "RecordIDToString", { enumerable: true, get: function () { return recordID_models_js_1.RecordIDToString; } });
9
+ Object.defineProperty(exports, "emptyRecordID", { enumerable: true, get: function () { return recordID_models_js_1.emptyRecordID; } });
@@ -25,4 +25,5 @@ export declare class Auth {
25
25
  createGroup(name: string, features: Feature[]): Promise<Group>;
26
26
  addUserToGroup(userId: string, groupId: string): Promise<ActionResponse>;
27
27
  addPermissionsToGroup(group_id: string, permissions: Feature[]): Promise<ActionResponse>;
28
+ getPermissions(): Promise<Feature[]>;
28
29
  }
@@ -139,6 +139,10 @@ export class Auth {
139
139
  group_id, permissions
140
140
  }).post("/auth/permission");
141
141
  }
142
+ async getPermissions() {
143
+ const res = await this.httpService.request.get("/auth/permission");
144
+ return res.permissions ?? [];
145
+ }
142
146
  }
143
147
  // In-memory fallback for environments without localStorage (e.g. Node.js)
144
148
  Auth.memoryStore = new Map();
package/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export type { LoginResponse, PermissionResponse, User, Group, Feature, Permissio
3
3
  export type { Operator } from './types/operator.models.js';
4
4
  export type { BaseResponse } from './types/response.models.js';
5
5
  export type { RecordID } from './types/recordID.models.js';
6
+ export { StringToRecordID, RecordIDToString, emptyRecordID } from './types/recordID.models.js';
6
7
  export type { HistorizedData } from './types/tag.models.js';
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export { SDK } from './sdk-ts.js';
2
+ export { StringToRecordID, RecordIDToString, emptyRecordID } from './types/recordID.models.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machhub-dev/sdk-ts",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "MACHHUB TYPESCRIPT SDK",
5
5
  "keywords": [
6
6
  "machhub",
@@ -161,4 +161,9 @@ export class Auth {
161
161
  group_id, permissions
162
162
  }).post("/auth/permission");
163
163
  }
164
+
165
+ public async getPermissions(): Promise<Feature[]> {
166
+ const res: {permissions: Feature[]} = await this.httpService.request.get("/auth/permission");
167
+ return res.permissions ?? [];
168
+ }
164
169
  }
package/src/index.ts CHANGED
@@ -5,4 +5,5 @@ export type { LoginResponse, PermissionResponse, User, Group, Feature, Permissio
5
5
  export type { Operator } from './types/operator.models.js';
6
6
  export type { BaseResponse } from './types/response.models.js';
7
7
  export type { RecordID } from './types/recordID.models.js';
8
+ export { StringToRecordID, RecordIDToString, emptyRecordID } from './types/recordID.models.js';
8
9
  export type { HistorizedData } from './types/tag.models.js';