shred-api-client 2.3.3 → 2.3.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/dist/index.d.mts CHANGED
@@ -732,6 +732,13 @@ declare const UserSchema: z.ZodObject<{
732
732
  type User = z.infer<typeof UserSchema>;
733
733
  type Preferences$1 = z.infer<typeof PreferencesSchema$1>;
734
734
  type Update = Pick<User, "name" | "profession" | "preferences" | "photoUrl" | "fcmToken" | "timezone" | "experienceId">;
735
+ type Create = Pick<User, "name" | "email"> & {
736
+ password?: string;
737
+ passwordConfirmation?: string;
738
+ invitationCode?: string;
739
+ role?: Role;
740
+ industries?: string[];
741
+ };
735
742
 
736
743
  type QueryOrderBy<T> = {
737
744
  field: keyof T | "modified";
@@ -779,7 +786,7 @@ interface IAPI$8 {
779
786
  getIntegrationToken: (ctx: Context) => Promise<string | null>;
780
787
  createIntegrationToken: (ctx: Context) => Promise<string>;
781
788
  search: (ctx: Context, query: QueryOptions<User>) => Promise<APIResponse<User>>;
782
- createUser: (email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null) => Promise<User>;
789
+ createUser: (data: Create) => Promise<User>;
783
790
  }
784
791
  declare const Endpoints$7: {
785
792
  ChangeEmail: {
@@ -848,6 +855,7 @@ declare const Endpoints$7: {
848
855
  };
849
856
  };
850
857
 
858
+ type index$9_Create = Create;
851
859
  type index$9_Role = Role;
852
860
  declare const index$9_Role: typeof Role;
853
861
  type index$9_System = System;
@@ -855,7 +863,7 @@ declare const index$9_System: typeof System;
855
863
  type index$9_Update = Update;
856
864
  declare const index$9_UserSchema: typeof UserSchema;
857
865
  declare namespace index$9 {
858
- export { Endpoints$7 as Endpoints, type User as Entity, type IAPI$8 as IAPI, type Preferences$1 as Preferences, PreferencesSchema$1 as PreferencesSchema, index$9_Role as Role, index$9_System as System, type index$9_Update as Update, index$9_UserSchema as UserSchema };
866
+ export { type index$9_Create as Create, Endpoints$7 as Endpoints, type User as Entity, type IAPI$8 as IAPI, type Preferences$1 as Preferences, PreferencesSchema$1 as PreferencesSchema, index$9_Role as Role, index$9_System as System, type index$9_Update as Update, index$9_UserSchema as UserSchema };
859
867
  }
860
868
 
861
869
  declare const PreferencesSchema: z.ZodObject<{
package/dist/index.d.ts CHANGED
@@ -732,6 +732,13 @@ declare const UserSchema: z.ZodObject<{
732
732
  type User = z.infer<typeof UserSchema>;
733
733
  type Preferences$1 = z.infer<typeof PreferencesSchema$1>;
734
734
  type Update = Pick<User, "name" | "profession" | "preferences" | "photoUrl" | "fcmToken" | "timezone" | "experienceId">;
735
+ type Create = Pick<User, "name" | "email"> & {
736
+ password?: string;
737
+ passwordConfirmation?: string;
738
+ invitationCode?: string;
739
+ role?: Role;
740
+ industries?: string[];
741
+ };
735
742
 
736
743
  type QueryOrderBy<T> = {
737
744
  field: keyof T | "modified";
@@ -779,7 +786,7 @@ interface IAPI$8 {
779
786
  getIntegrationToken: (ctx: Context) => Promise<string | null>;
780
787
  createIntegrationToken: (ctx: Context) => Promise<string>;
781
788
  search: (ctx: Context, query: QueryOptions<User>) => Promise<APIResponse<User>>;
782
- createUser: (email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null) => Promise<User>;
789
+ createUser: (data: Create) => Promise<User>;
783
790
  }
784
791
  declare const Endpoints$7: {
785
792
  ChangeEmail: {
@@ -848,6 +855,7 @@ declare const Endpoints$7: {
848
855
  };
849
856
  };
850
857
 
858
+ type index$9_Create = Create;
851
859
  type index$9_Role = Role;
852
860
  declare const index$9_Role: typeof Role;
853
861
  type index$9_System = System;
@@ -855,7 +863,7 @@ declare const index$9_System: typeof System;
855
863
  type index$9_Update = Update;
856
864
  declare const index$9_UserSchema: typeof UserSchema;
857
865
  declare namespace index$9 {
858
- export { Endpoints$7 as Endpoints, type User as Entity, type IAPI$8 as IAPI, type Preferences$1 as Preferences, PreferencesSchema$1 as PreferencesSchema, index$9_Role as Role, index$9_System as System, type index$9_Update as Update, index$9_UserSchema as UserSchema };
866
+ export { type index$9_Create as Create, Endpoints$7 as Endpoints, type User as Entity, type IAPI$8 as IAPI, type Preferences$1 as Preferences, PreferencesSchema$1 as PreferencesSchema, index$9_Role as Role, index$9_System as System, type index$9_Update as Update, index$9_UserSchema as UserSchema };
859
867
  }
860
868
 
861
869
  declare const PreferencesSchema: z.ZodObject<{
package/dist/index.js CHANGED
@@ -782,20 +782,13 @@ var UserAPI = class {
782
782
  );
783
783
  return data.token;
784
784
  }
785
- async createUser(email, name, password, passwordConfirmation, profession, invitationCode) {
785
+ async createUser(create) {
786
786
  const endpointData = user_exports.Endpoints.CreateUser;
787
787
  const data = await this.clientHTTP.makeRequest(
788
788
  this.env,
789
789
  endpointData.uri,
790
790
  endpointData.method,
791
- {
792
- email,
793
- name,
794
- password,
795
- passwordConfirmation,
796
- profession,
797
- invitationCode
798
- },
791
+ create,
799
792
  null
800
793
  );
801
794
  return data;