@digicap-web/sdk 0.1.0-dev.13 → 0.1.0-dev.14

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.cjs CHANGED
@@ -1066,6 +1066,18 @@ var UserRepository = class {
1066
1066
  constructor(baseURL) {
1067
1067
  this.baseURL = baseURL;
1068
1068
  }
1069
+ async collect() {
1070
+ const url = `${this.baseURL}/users`;
1071
+ const response = await fetch(url, {
1072
+ method: "GET",
1073
+ headers: { "Content-Type": "application/json" },
1074
+ credentials: "include"
1075
+ });
1076
+ if (!response.ok) {
1077
+ throw new Error(response.statusText);
1078
+ }
1079
+ return UserSchema.array().parse(response.json());
1080
+ }
1069
1081
  async get(userId) {
1070
1082
  const url = `${this.baseURL}/users/${userId}`;
1071
1083
  const response = await fetch(url, {
package/dist/index.d.cts CHANGED
@@ -548,6 +548,7 @@ declare class MuseumRepository {
548
548
  declare class UserRepository {
549
549
  readonly baseURL: string;
550
550
  constructor(baseURL: string);
551
+ collect(): Promise<User[]>;
551
552
  get(userId: UserId): Promise<User>;
552
553
  getMe(): Promise<User>;
553
554
  getMuseums(): Promise<MuseumList>;
package/dist/index.d.ts CHANGED
@@ -548,6 +548,7 @@ declare class MuseumRepository {
548
548
  declare class UserRepository {
549
549
  readonly baseURL: string;
550
550
  constructor(baseURL: string);
551
+ collect(): Promise<User[]>;
551
552
  get(userId: UserId): Promise<User>;
552
553
  getMe(): Promise<User>;
553
554
  getMuseums(): Promise<MuseumList>;
package/dist/index.js CHANGED
@@ -954,6 +954,18 @@ var UserRepository = class {
954
954
  constructor(baseURL) {
955
955
  this.baseURL = baseURL;
956
956
  }
957
+ async collect() {
958
+ const url = `${this.baseURL}/users`;
959
+ const response = await fetch(url, {
960
+ method: "GET",
961
+ headers: { "Content-Type": "application/json" },
962
+ credentials: "include"
963
+ });
964
+ if (!response.ok) {
965
+ throw new Error(response.statusText);
966
+ }
967
+ return UserSchema.array().parse(response.json());
968
+ }
957
969
  async get(userId) {
958
970
  const url = `${this.baseURL}/users/${userId}`;
959
971
  const response = await fetch(url, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digicap-web/sdk",
3
- "version": "0.1.0-dev.13",
3
+ "version": "0.1.0-dev.14",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [