@singularlogic/coreplatts 0.0.16 → 0.0.18

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
@@ -152,6 +152,13 @@ interface Bucket {
152
152
  creation_date?: Date;
153
153
  }
154
154
 
155
+ interface TotalInfo {
156
+ number_organizations: number;
157
+ number_datasets: number;
158
+ number_resources: number;
159
+ total_size: number;
160
+ }
161
+
155
162
  type TokenProvider = () => string | Promise<string>;
156
163
  interface IClient$1 {
157
164
  login(email: string, password: string): Promise<OidcToken>;
@@ -166,6 +173,7 @@ interface IClient$1 {
166
173
  removeOrganizationByID(organization: string, token?: string): Promise<Bucket>;
167
174
  getFolderByName(name: string, token?: string): Promise<Folder>;
168
175
  getFolderByID(id: string, token?: string): Promise<Folder>;
176
+ totalInfo(token?: string): Promise<TotalInfo>;
169
177
  }
170
178
  /**
171
179
  * Client supports:
@@ -182,6 +190,7 @@ declare class Client implements IClient$1 {
182
190
  private _axiosAccount;
183
191
  private _axiosManagement;
184
192
  private _tokenProvider?;
193
+ private _publicConsumer;
185
194
  constructor(managementURL: string, accountURL: string);
186
195
  /**
187
196
  * Set a token provider (Keycloak-friendly).
@@ -206,6 +215,7 @@ declare class Client implements IClient$1 {
206
215
  *
207
216
  * But the best pattern is: do not pass token in SPA and let interceptor handle it.
208
217
  */
218
+ totalInfo(): Promise<TotalInfo>;
209
219
  myUser(token?: string): Promise<User>;
210
220
  allOrganizations(token?: string): Promise<Group[]>;
211
221
  myOrganizations(token?: string): Promise<Group[]>;
@@ -227,4 +237,4 @@ declare class Client implements IClient$1 {
227
237
 
228
238
  type IClient = IClient$1;
229
239
 
230
- export { type Bucket, Client, type ErrorReport, type FileModel, type FolderList, type FolderModel, type Group, type IClient, type Meta, type MultipartWrapper, type OidcToken, type PartInfo, Role, type Updated, type User, type UserRoles };
240
+ export { type Bucket, Client, type ErrorReport, type FileModel, type FolderList, type FolderModel, type Group, type IClient, type Meta, type MultipartWrapper, type OidcToken, type PartInfo, Role, type TotalInfo, type Updated, type User, type UserRoles };
package/dist/index.js CHANGED
@@ -792,6 +792,17 @@ var FolderConsumer = class extends BaseConsumer {
792
792
  }
793
793
  };
794
794
 
795
+ // src/apis/management/public.consumer.ts
796
+ var _namespace7 = "public";
797
+ var PublicConsumer = class extends BaseConsumer {
798
+ constructor(_httpClient) {
799
+ super(_httpClient, _namespace7);
800
+ }
801
+ totalInfo() {
802
+ return this.getOne("/total", void 0, void 0);
803
+ }
804
+ };
805
+
795
806
  // src/client.ts
796
807
  var Client = class {
797
808
  constructor(managementURL, accountURL) {
@@ -805,6 +816,7 @@ var Client = class {
805
816
  this._groupConsumer = new GroupConsumer(axiosAccount);
806
817
  this._bucketConsumer = new BucketConsumer(axiosManagement);
807
818
  this._folderConsumer = new FolderConsumer(axiosManagement);
819
+ this._publicConsumer = new PublicConsumer(axiosManagement);
808
820
  }
809
821
  /**
810
822
  * Set a token provider (Keycloak-friendly).
@@ -873,6 +885,12 @@ var Client = class {
873
885
  * But the best pattern is: do not pass token in SPA and let interceptor handle it.
874
886
  */
875
887
  // -----------------------------
888
+ // Public APIs
889
+ // -----------------------------
890
+ totalInfo() {
891
+ return this._publicConsumer.totalInfo();
892
+ }
893
+ // -----------------------------
876
894
  // Account APIs
877
895
  // -----------------------------
878
896
  myUser(token) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularlogic/coreplatts",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [