@malevich-studio/strapi-sdk-typescript 1.2.19 → 1.2.20

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/dist/index.d.ts CHANGED
@@ -179,9 +179,11 @@ declare abstract class Strapi {
179
179
  uploadForm(form: FormData): Promise<File[]>;
180
180
  private baseFetch;
181
181
  private permissionsList?;
182
- abstract me(): Promise<{
182
+ abstract me(data: Query<'id' | 'documentId', 'id' | 'documentId', {}, {
183
+ role: Query<'id' | 'documentId', 'id' | 'documentId', {}, {}>;
184
+ }>): Promise<{
183
185
  role?: {
184
- documentId?: string;
186
+ id?: number;
185
187
  };
186
188
  }>;
187
189
  can(uid: string, controller: string, action: PermissionAction): Promise<boolean>;
package/dist/index.mjs CHANGED
@@ -21436,8 +21436,8 @@ class Strapi {
21436
21436
  }
21437
21437
  async can(uid, controller, action) {
21438
21438
  if (!this.permissionsList) {
21439
- const { role } = await this.me();
21440
- const response = await this.fetchData(`users-permissions/role/${role?.documentId}`);
21439
+ const { role } = await this.me({ populate: { role: { fields: ["id"] } } });
21440
+ const response = await this.fetchData(`users-permissions/roles/${role?.id}`);
21441
21441
  this.permissionsList = response.role.permissions;
21442
21442
  }
21443
21443
  if (!this.permissionsList[uid]) {