repzo 1.0.259 → 1.0.260

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/lib/index.d.ts CHANGED
@@ -132,6 +132,7 @@ export declare const end_points: {
132
132
  readonly SCHEDULED_EMAILS: "scheduled-emails";
133
133
  readonly DATA_FILE_WAREHOUSE: "data-file-warehouse";
134
134
  readonly DATA_SESSION: "data-session";
135
+ readonly ADMIN: "admin";
135
136
  };
136
137
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
137
138
  export declare const availableService: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField"];
@@ -279,6 +280,7 @@ export default class Repzo {
279
280
  readonly SCHEDULED_EMAILS: "scheduled-emails";
280
281
  readonly DATA_FILE_WAREHOUSE: "data-file-warehouse";
281
282
  readonly DATA_SESSION: "data-session";
283
+ readonly ADMIN: "admin";
282
284
  };
283
285
  private _retryRequest;
284
286
  private _fetch;
@@ -1295,4 +1297,13 @@ export default class Repzo {
1295
1297
  update: (id: Service.DataSession.Update.ID, body: Service.DataSession.Update.Body) => Promise<Service.DataSession.Update.Result>;
1296
1298
  remove: (id: Service.DataSession.Update.ID) => Promise<Service.DataSession.Remove.Result>;
1297
1299
  };
1300
+ admin: {
1301
+ _path: "admin";
1302
+ find: (params?: Service.Admin.Find.Params) => Promise<Service.Admin.Find.Result>;
1303
+ get: (id: Service.Admin.Get.ID, params?: Service.Admin.Get.Params) => Promise<Service.Admin.Get.Result>;
1304
+ create: (body: Service.Admin.Create.Body) => Promise<Service.Admin.Create.Result>;
1305
+ update: (id: Service.Admin.Update.ID, body: Service.Admin.Update.Body) => Promise<Service.Admin.Update.Result>;
1306
+ globalize: (id: Service.Admin.Globalize.ID) => Promise<Service.Admin.Globalize.Result>;
1307
+ remove: (id: Service.Admin.Update.ID) => Promise<Service.Admin.Remove.Result>;
1308
+ };
1298
1309
  }
package/lib/index.js CHANGED
@@ -134,6 +134,7 @@ export const end_points = {
134
134
  SCHEDULED_EMAILS: "scheduled-emails",
135
135
  DATA_FILE_WAREHOUSE: "data-file-warehouse",
136
136
  DATA_SESSION: "data-session",
137
+ ADMIN: "admin",
137
138
  };
138
139
  export const availableService = [
139
140
  "client",
@@ -2680,6 +2681,32 @@ class Repzo {
2680
2681
  return res;
2681
2682
  },
2682
2683
  };
2684
+ this.admin = {
2685
+ _path: Repzo._end_points.ADMIN,
2686
+ find: async (params) => {
2687
+ let res = await this._fetch(this.svAPIEndpoint, this.admin._path, params);
2688
+ return res;
2689
+ },
2690
+ get: async (id, params) => {
2691
+ return await this._fetch(this.svAPIEndpoint, this.admin._path + `/${id}`, params);
2692
+ },
2693
+ create: async (body) => {
2694
+ let res = await this._create(this.svAPIEndpoint, this.admin._path, body);
2695
+ return res;
2696
+ },
2697
+ update: async (id, body) => {
2698
+ let res = await this._update(this.svAPIEndpoint, this.admin._path + `/${id}`, body);
2699
+ return res;
2700
+ },
2701
+ globalize: async (id) => {
2702
+ let res = await this._update(this.svAPIEndpoint, this.admin._path + `/${id}`, {}, { globalize: true });
2703
+ return res;
2704
+ },
2705
+ remove: async (id) => {
2706
+ let res = await this._delete(this.svAPIEndpoint, this.admin._path + `/${id}`);
2707
+ return res;
2708
+ },
2709
+ };
2683
2710
  this.svAPIEndpoint =
2684
2711
  !options?.env || options?.env == "production"
2685
2712
  ? "https://sv.api.repzo.me"
@@ -12262,6 +12262,10 @@ export declare namespace Service {
12262
12262
  rep_must_start_day_within_specific_time_frame: boolean;
12263
12263
  };
12264
12264
  allow_assigning_non_creator_teams_when_creating_client?: boolean;
12265
+ enable_email_mfa: boolean;
12266
+ enable_whatsapp_mfa: boolean;
12267
+ enable_authenticator_mfa: boolean;
12268
+ minimum_accepted_mfa: number;
12265
12269
  createdAt: Date;
12266
12270
  updatedAt: Date;
12267
12271
  }
@@ -12450,6 +12454,10 @@ export declare namespace Service {
12450
12454
  };
12451
12455
  first_business_day_in_week?: "Sun" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat";
12452
12456
  allow_assigning_non_creator_teams_when_creating_client?: boolean;
12457
+ enable_email_mfa: boolean;
12458
+ enable_whatsapp_mfa: boolean;
12459
+ enable_authenticator_mfa: boolean;
12460
+ minimum_accepted_mfa: number;
12453
12461
  }
12454
12462
  namespace Update {
12455
12463
  type ID = StringId;
@@ -14556,7 +14564,7 @@ export declare namespace Service {
14556
14564
  grace_until: number;
14557
14565
  subscription_status: CompanyNamespace.Data["subscription_status"];
14558
14566
  }
14559
- export interface Data {
14567
+ interface LoginResponse {
14560
14568
  access_token: string;
14561
14569
  refresh_token: string;
14562
14570
  login_status: "success";
@@ -14585,7 +14593,37 @@ export declare namespace Service {
14585
14593
  assessment_enforcement_state: "suggest" | "enforce" | "ignore";
14586
14594
  repzo_internal_user: boolean;
14587
14595
  allow_treating_invoice_as_proforma_for_etax: boolean;
14596
+ mfa_method?: MFA_Method;
14597
+ settings_mfa: {
14598
+ enable_email_mfa: boolean;
14599
+ enable_whatsapp_mfa: boolean;
14600
+ enable_authenticator_mfa: boolean;
14601
+ minimum_accepted_mfa: number;
14602
+ can_skip: boolean;
14603
+ suggest_mfa: MFA_Method[];
14604
+ };
14605
+ admin_mfa: Pick<Admin.Data, "email_mfa_enabled" | "whatsapp_mfa_enabled" | "authenticator_mfa_enabled" | "recovery_codes_mfa_enabled">;
14606
+ }
14607
+ interface MFAPendingResponse {
14608
+ login_status: "pending";
14609
+ mfa_token: string;
14610
+ mfa_methods: ({
14611
+ method: "email";
14612
+ masked_email: string;
14613
+ blocked_until: number | null;
14614
+ } | {
14615
+ method: "whatsapp";
14616
+ masked_phone: string;
14617
+ blocked_until: number | null;
14618
+ } | {
14619
+ method: "authenticator";
14620
+ blocked_until: number | null;
14621
+ } | {
14622
+ method: "recovery_codes";
14623
+ blocked_until: number | null;
14624
+ })[];
14588
14625
  }
14626
+ export type Data = LoginResponse | MFAPendingResponse;
14589
14627
  export {};
14590
14628
  }
14591
14629
  namespace AuthenticateRep {
@@ -18419,6 +18457,196 @@ export declare namespace Service {
18419
18457
  }
18420
18458
  export {};
18421
18459
  }
18460
+ namespace Admin {
18461
+ export interface Data {
18462
+ _id: StringId;
18463
+ email: string;
18464
+ name: string;
18465
+ phone?: string;
18466
+ disabled: boolean;
18467
+ profile_photo?: string;
18468
+ notification_id?: string;
18469
+ password: string;
18470
+ owner?: boolean;
18471
+ repzo_internal_user?: boolean;
18472
+ can_reset_namespace?: boolean;
18473
+ permissions: {
18474
+ client: {
18475
+ can_view_list?: boolean;
18476
+ can_add?: boolean;
18477
+ can_edit?: boolean;
18478
+ can_verify?: boolean;
18479
+ can_disable?: boolean;
18480
+ can_enable?: boolean;
18481
+ can_export_client?: boolean;
18482
+ can_reset_location?: boolean;
18483
+ };
18484
+ representative: {
18485
+ can_change_password?: boolean;
18486
+ can_change_permission?: boolean;
18487
+ can_edit?: boolean;
18488
+ can_add?: boolean;
18489
+ can_view_list?: boolean;
18490
+ };
18491
+ settings: {
18492
+ can_view_settings?: boolean;
18493
+ };
18494
+ sales: {
18495
+ edit_purchase_order?: boolean;
18496
+ approve_purchase_order?: boolean;
18497
+ approve_invoice?: boolean;
18498
+ cancelled_invoice?: boolean;
18499
+ cancelled_purchase_order?: boolean;
18500
+ };
18501
+ reports: {
18502
+ purchase_order?: boolean;
18503
+ invoice?: boolean;
18504
+ visit?: boolean;
18505
+ note?: boolean;
18506
+ photo?: boolean;
18507
+ task?: boolean;
18508
+ representative?: boolean;
18509
+ client_coverage_by_tag?: boolean;
18510
+ client_coverage_by_area?: boolean;
18511
+ client_coverage?: boolean;
18512
+ route?: boolean;
18513
+ audit?: boolean;
18514
+ frequency?: boolean;
18515
+ unvisit?: boolean;
18516
+ can_view_reports?: boolean;
18517
+ };
18518
+ timeline: {
18519
+ can_view_timeline?: boolean;
18520
+ };
18521
+ form: {
18522
+ can_view_form_report?: boolean;
18523
+ can_create_form?: boolean;
18524
+ can_delete_form?: boolean;
18525
+ can_view_form?: boolean;
18526
+ };
18527
+ product: {
18528
+ can_view_list?: boolean;
18529
+ can_add?: boolean;
18530
+ can_edit?: boolean;
18531
+ can_disable?: boolean;
18532
+ };
18533
+ home: {
18534
+ can_view?: boolean;
18535
+ };
18536
+ };
18537
+ teams: StringId[];
18538
+ media?: StringId[];
18539
+ cover_photo?: StringId;
18540
+ company_namespace: string[];
18541
+ company_group: string;
18542
+ ai_administrator?: boolean;
18543
+ abilities: {
18544
+ ability: StringId;
18545
+ m_read: boolean;
18546
+ m_create: boolean;
18547
+ m_update: boolean;
18548
+ m_remove: boolean;
18549
+ }[];
18550
+ last_login_time?: number;
18551
+ email_mfa_enabled: boolean;
18552
+ email_mfa_activate_time?: number;
18553
+ email_otp_blocked_until?: number;
18554
+ whatsapp_mfa_enabled: boolean;
18555
+ whatsapp_mfa_activate_time?: number;
18556
+ whatsapp_phone?: string;
18557
+ whatsapp_otp_blocked_until?: number;
18558
+ authenticator_mfa_enabled: boolean;
18559
+ authenticator_mfa_activate_time?: number;
18560
+ authenticator_mfa_secret?: string;
18561
+ authenticator_otp_blocked_until?: number;
18562
+ recovery_codes_mfa_enabled: boolean;
18563
+ recovery_codes_mfa_activate_time?: number;
18564
+ recovery_codes_otp_blocked_until?: number;
18565
+ recovery_codes?: string[];
18566
+ recovery_codes_used?: string[];
18567
+ createdAt: Date;
18568
+ updatedAt: Date;
18569
+ }
18570
+ export interface CreateBody {
18571
+ email: string;
18572
+ name: string;
18573
+ password: string;
18574
+ phone?: string;
18575
+ disabled?: boolean;
18576
+ profile_photo?: string;
18577
+ notification_id?: string;
18578
+ owner?: boolean;
18579
+ permissions?: Data["permissions"];
18580
+ teams?: StringId[];
18581
+ media?: StringId[];
18582
+ cover_photo?: StringId;
18583
+ company_namespace?: string[];
18584
+ company_group?: string;
18585
+ }
18586
+ export type UpdateBody = Partial<Data>;
18587
+ export type PopulatedDoc = Data & {
18588
+ media?: PopulatedMediaStorage[];
18589
+ cover_photo?: PopulatedMediaStorage;
18590
+ abilities?: (Data["abilities"][0] & {
18591
+ ability: StringId | {
18592
+ name: string;
18593
+ _id: StringId;
18594
+ };
18595
+ })[];
18596
+ role?: {
18597
+ _id: StringId;
18598
+ name: string;
18599
+ };
18600
+ };
18601
+ type PopulatedKeys = "media" | "cover_photo" | "abilities";
18602
+ export namespace Find {
18603
+ type Params = DefaultPaginationQueryParams & {
18604
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
18605
+ _id?: StringId | StringId[];
18606
+ disabled?: boolean;
18607
+ teams?: StringId | StringId[];
18608
+ name?: string | string[];
18609
+ email?: string | string[];
18610
+ search?: string;
18611
+ repzo_internal_user?: boolean;
18612
+ company_namespace?: string | string[];
18613
+ };
18614
+ interface Result extends DefaultPaginationResult {
18615
+ data: PopulatedDoc[];
18616
+ }
18617
+ }
18618
+ export namespace Get {
18619
+ type ID = string;
18620
+ type Params = {
18621
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
18622
+ };
18623
+ type Result = PopulatedDoc;
18624
+ }
18625
+ export namespace Create {
18626
+ type Body = CreateBody;
18627
+ type Result = Data;
18628
+ }
18629
+ export namespace Update {
18630
+ type ID = StringId;
18631
+ type Body = UpdateBody;
18632
+ type Result = Data;
18633
+ }
18634
+ export namespace Globalize {
18635
+ type ID = StringId;
18636
+ type Params = {
18637
+ globalize: true;
18638
+ };
18639
+ type Body = {};
18640
+ type Result = {
18641
+ success: boolean;
18642
+ };
18643
+ }
18644
+ export namespace Remove {
18645
+ type ID = string;
18646
+ type Result = Data;
18647
+ }
18648
+ export {};
18649
+ }
18422
18650
  }
18423
18651
  export type StringId = string;
18424
18652
  export type NameSpaces = string[];
@@ -18504,6 +18732,7 @@ export interface ReportKey {
18504
18732
  totals_key?: string;
18505
18733
  [key: string]: any;
18506
18734
  }
18735
+ type MFA_Method = "email" | "whatsapp" | "authenticator" | "recovery_codes";
18507
18736
  type RepzoModel = "socialPlatform" | "activityAiSalesOrder" | "reportUblInvoice" | "ublIntegrationSettings" | "ublIntegration" | "ublConnectionAttempts" | "quickConvertToPdf" | "warehouses" | "transfers" | "transactions" | "taxes" | "productvariations" | "products" | "pricelistsitems" | "pricelists" | "payments" | "ledger_payments" | "mslsales" | "mslproducts" | "measureunits" | "measureunitfamilies" | "invoice" | "ledger_goods" | "fullinvoices" | "checks" | "clients" | "activities" | "bigReports" | "admins"
18508
18737
  /**
18509
18738
  * @deprecated representatives shall be used
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.259",
3
+ "version": "1.0.260",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/index.ts CHANGED
@@ -144,6 +144,7 @@ export const end_points = {
144
144
  SCHEDULED_EMAILS: "scheduled-emails",
145
145
  DATA_FILE_WAREHOUSE: "data-file-warehouse",
146
146
  DATA_SESSION: "data-session",
147
+ ADMIN: "admin",
147
148
  } as const;
148
149
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
149
150
 
@@ -6732,6 +6733,67 @@ export default class Repzo {
6732
6733
  return res;
6733
6734
  },
6734
6735
  };
6736
+
6737
+ admin = {
6738
+ _path: Repzo._end_points.ADMIN,
6739
+ find: async (
6740
+ params?: Service.Admin.Find.Params,
6741
+ ): Promise<Service.Admin.Find.Result> => {
6742
+ let res: Service.Admin.Find.Result = await this._fetch(
6743
+ this.svAPIEndpoint,
6744
+ this.admin._path,
6745
+ params,
6746
+ );
6747
+ return res;
6748
+ },
6749
+ get: async (
6750
+ id: Service.Admin.Get.ID,
6751
+ params?: Service.Admin.Get.Params,
6752
+ ): Promise<Service.Admin.Get.Result> => {
6753
+ return await this._fetch(
6754
+ this.svAPIEndpoint,
6755
+ this.admin._path + `/${id}`,
6756
+ params,
6757
+ );
6758
+ },
6759
+ create: async (
6760
+ body: Service.Admin.Create.Body,
6761
+ ): Promise<Service.Admin.Create.Result> => {
6762
+ let res = await this._create(this.svAPIEndpoint, this.admin._path, body);
6763
+ return res;
6764
+ },
6765
+ update: async (
6766
+ id: Service.Admin.Update.ID,
6767
+ body: Service.Admin.Update.Body,
6768
+ ): Promise<Service.Admin.Update.Result> => {
6769
+ let res: Service.Admin.Update.Result = await this._update(
6770
+ this.svAPIEndpoint,
6771
+ this.admin._path + `/${id}`,
6772
+ body,
6773
+ );
6774
+ return res;
6775
+ },
6776
+ globalize: async (
6777
+ id: Service.Admin.Globalize.ID,
6778
+ ): Promise<Service.Admin.Globalize.Result> => {
6779
+ let res: Service.Admin.Globalize.Result = await this._update(
6780
+ this.svAPIEndpoint,
6781
+ this.admin._path + `/${id}`,
6782
+ {},
6783
+ { globalize: true },
6784
+ );
6785
+ return res;
6786
+ },
6787
+ remove: async (
6788
+ id: Service.Admin.Update.ID,
6789
+ ): Promise<Service.Admin.Remove.Result> => {
6790
+ let res: Service.Admin.Remove.Result = await this._delete(
6791
+ this.svAPIEndpoint,
6792
+ this.admin._path + `/${id}`,
6793
+ );
6794
+ return res;
6795
+ },
6796
+ };
6735
6797
  }
6736
6798
 
6737
6799
  function normalizeParams(params: Params): { [key: string]: any } {
@@ -13060,6 +13060,10 @@ export namespace Service {
13060
13060
  rep_must_start_day_within_specific_time_frame: boolean;
13061
13061
  };
13062
13062
  allow_assigning_non_creator_teams_when_creating_client?: boolean;
13063
+ enable_email_mfa: boolean;
13064
+ enable_whatsapp_mfa: boolean;
13065
+ enable_authenticator_mfa: boolean;
13066
+ minimum_accepted_mfa: number;
13063
13067
  createdAt: Date;
13064
13068
  updatedAt: Date;
13065
13069
  }
@@ -13228,6 +13232,10 @@ export namespace Service {
13228
13232
  | "Fri"
13229
13233
  | "Sat";
13230
13234
  allow_assigning_non_creator_teams_when_creating_client?: boolean;
13235
+ enable_email_mfa: boolean;
13236
+ enable_whatsapp_mfa: boolean;
13237
+ enable_authenticator_mfa: boolean;
13238
+ minimum_accepted_mfa: number;
13231
13239
  }
13232
13240
 
13233
13241
  export namespace Update {
@@ -15623,7 +15631,7 @@ export namespace Service {
15623
15631
  grace_until: number;
15624
15632
  subscription_status: CompanyNamespace.Data["subscription_status"];
15625
15633
  }
15626
- export interface Data {
15634
+ interface LoginResponse {
15627
15635
  access_token: string;
15628
15636
  refresh_token: string;
15629
15637
  login_status: "success";
@@ -15650,7 +15658,42 @@ export namespace Service {
15650
15658
  assessment_enforcement_state: "suggest" | "enforce" | "ignore";
15651
15659
  repzo_internal_user: boolean;
15652
15660
  allow_treating_invoice_as_proforma_for_etax: boolean;
15661
+ mfa_method?: MFA_Method;
15662
+ settings_mfa: {
15663
+ enable_email_mfa: boolean;
15664
+ enable_whatsapp_mfa: boolean;
15665
+ enable_authenticator_mfa: boolean;
15666
+ minimum_accepted_mfa: number;
15667
+ can_skip: boolean;
15668
+ suggest_mfa: MFA_Method[];
15669
+ };
15670
+ admin_mfa: Pick<
15671
+ Admin.Data,
15672
+ | "email_mfa_enabled"
15673
+ | "whatsapp_mfa_enabled"
15674
+ | "authenticator_mfa_enabled"
15675
+ | "recovery_codes_mfa_enabled"
15676
+ >;
15677
+ }
15678
+ interface MFAPendingResponse {
15679
+ login_status: "pending";
15680
+ mfa_token: string;
15681
+ mfa_methods: (
15682
+ | {
15683
+ method: "email";
15684
+ masked_email: string;
15685
+ blocked_until: number | null;
15686
+ }
15687
+ | {
15688
+ method: "whatsapp";
15689
+ masked_phone: string;
15690
+ blocked_until: number | null;
15691
+ }
15692
+ | { method: "authenticator"; blocked_until: number | null }
15693
+ | { method: "recovery_codes"; blocked_until: number | null }
15694
+ )[];
15653
15695
  }
15696
+ export type Data = LoginResponse | MFAPendingResponse;
15654
15697
  }
15655
15698
 
15656
15699
  export namespace AuthenticateRep {
@@ -20673,6 +20716,189 @@ export namespace Service {
20673
20716
  export type Result = Data;
20674
20717
  }
20675
20718
  }
20719
+
20720
+ export namespace Admin {
20721
+ export interface Data {
20722
+ _id: StringId;
20723
+ email: string;
20724
+ name: string;
20725
+ phone?: string;
20726
+ disabled: boolean;
20727
+ profile_photo?: string;
20728
+ notification_id?: string;
20729
+ password: string;
20730
+ owner?: boolean;
20731
+ repzo_internal_user?: boolean;
20732
+ can_reset_namespace?: boolean;
20733
+ permissions: {
20734
+ client: {
20735
+ can_view_list?: boolean;
20736
+ can_add?: boolean;
20737
+ can_edit?: boolean;
20738
+ can_verify?: boolean;
20739
+ can_disable?: boolean;
20740
+ can_enable?: boolean;
20741
+ can_export_client?: boolean;
20742
+ can_reset_location?: boolean;
20743
+ };
20744
+ representative: {
20745
+ can_change_password?: boolean;
20746
+ can_change_permission?: boolean;
20747
+ can_edit?: boolean;
20748
+ can_add?: boolean;
20749
+ can_view_list?: boolean;
20750
+ };
20751
+ settings: {
20752
+ can_view_settings?: boolean;
20753
+ };
20754
+ sales: {
20755
+ edit_purchase_order?: boolean;
20756
+ approve_purchase_order?: boolean;
20757
+ approve_invoice?: boolean;
20758
+ cancelled_invoice?: boolean;
20759
+ cancelled_purchase_order?: boolean;
20760
+ };
20761
+ reports: {
20762
+ purchase_order?: boolean;
20763
+ invoice?: boolean;
20764
+ visit?: boolean;
20765
+ note?: boolean;
20766
+ photo?: boolean;
20767
+ task?: boolean;
20768
+ representative?: boolean;
20769
+ client_coverage_by_tag?: boolean;
20770
+ client_coverage_by_area?: boolean;
20771
+ client_coverage?: boolean;
20772
+ route?: boolean;
20773
+ audit?: boolean;
20774
+ frequency?: boolean;
20775
+ unvisit?: boolean;
20776
+ can_view_reports?: boolean;
20777
+ };
20778
+ timeline: {
20779
+ can_view_timeline?: boolean;
20780
+ };
20781
+ form: {
20782
+ can_view_form_report?: boolean;
20783
+ can_create_form?: boolean;
20784
+ can_delete_form?: boolean;
20785
+ can_view_form?: boolean;
20786
+ };
20787
+ product: {
20788
+ can_view_list?: boolean;
20789
+ can_add?: boolean;
20790
+ can_edit?: boolean;
20791
+ can_disable?: boolean;
20792
+ };
20793
+ home: { can_view?: boolean };
20794
+ };
20795
+ teams: StringId[];
20796
+ media?: StringId[];
20797
+ cover_photo?: StringId;
20798
+ company_namespace: string[];
20799
+ company_group: string;
20800
+ ai_administrator?: boolean;
20801
+ abilities: {
20802
+ ability: StringId;
20803
+ m_read: boolean;
20804
+ m_create: boolean;
20805
+ m_update: boolean;
20806
+ m_remove: boolean;
20807
+ }[];
20808
+ last_login_time?: number;
20809
+ // Email MFA
20810
+ email_mfa_enabled: boolean;
20811
+ email_mfa_activate_time?: number;
20812
+ email_otp_blocked_until?: number;
20813
+ // WhatsApp MFA
20814
+ whatsapp_mfa_enabled: boolean;
20815
+ whatsapp_mfa_activate_time?: number;
20816
+ whatsapp_phone?: string;
20817
+ whatsapp_otp_blocked_until?: number;
20818
+ // Authenticator MFA
20819
+ authenticator_mfa_enabled: boolean;
20820
+ authenticator_mfa_activate_time?: number;
20821
+ authenticator_mfa_secret?: string;
20822
+ authenticator_otp_blocked_until?: number;
20823
+ // Recovery codes
20824
+ recovery_codes_mfa_enabled: boolean;
20825
+ recovery_codes_mfa_activate_time?: number;
20826
+ recovery_codes_otp_blocked_until?: number;
20827
+ recovery_codes?: string[];
20828
+ recovery_codes_used?: string[];
20829
+ createdAt: Date;
20830
+ updatedAt: Date;
20831
+ }
20832
+ export interface CreateBody {
20833
+ email: string;
20834
+ name: string;
20835
+ password: string;
20836
+ phone?: string;
20837
+ disabled?: boolean;
20838
+ profile_photo?: string;
20839
+ notification_id?: string;
20840
+ owner?: boolean;
20841
+ permissions?: Data["permissions"];
20842
+ teams?: StringId[];
20843
+ media?: StringId[];
20844
+ cover_photo?: StringId;
20845
+ company_namespace?: string[];
20846
+ company_group?: string;
20847
+ }
20848
+ export type UpdateBody = Partial<Data>;
20849
+
20850
+ export type PopulatedDoc = Data & {
20851
+ media?: PopulatedMediaStorage[];
20852
+ cover_photo?: PopulatedMediaStorage;
20853
+ abilities?: (Data["abilities"][0] & {
20854
+ ability: StringId | { name: string; _id: StringId };
20855
+ })[];
20856
+ role?: { _id: StringId; name: string };
20857
+ };
20858
+
20859
+ type PopulatedKeys = "media" | "cover_photo" | "abilities";
20860
+
20861
+ export namespace Find {
20862
+ export type Params = DefaultPaginationQueryParams & {
20863
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
20864
+ _id?: StringId | StringId[];
20865
+ disabled?: boolean;
20866
+ teams?: StringId | StringId[];
20867
+ name?: string | string[];
20868
+ email?: string | string[];
20869
+ search?: string;
20870
+ repzo_internal_user?: boolean;
20871
+ company_namespace?: string | string[];
20872
+ };
20873
+ export interface Result extends DefaultPaginationResult {
20874
+ data: PopulatedDoc[];
20875
+ }
20876
+ }
20877
+ export namespace Get {
20878
+ export type ID = string;
20879
+ export type Params = { populatedKeys?: PopulatedKeys | PopulatedKeys[] };
20880
+ export type Result = PopulatedDoc;
20881
+ }
20882
+ export namespace Create {
20883
+ export type Body = CreateBody;
20884
+ export type Result = Data;
20885
+ }
20886
+ export namespace Update {
20887
+ export type ID = StringId;
20888
+ export type Body = UpdateBody;
20889
+ export type Result = Data;
20890
+ }
20891
+ export namespace Globalize {
20892
+ export type ID = StringId;
20893
+ export type Params = { globalize: true };
20894
+ export type Body = {};
20895
+ export type Result = { success: boolean };
20896
+ }
20897
+ export namespace Remove {
20898
+ export type ID = string;
20899
+ export type Result = Data;
20900
+ }
20901
+ }
20676
20902
  }
20677
20903
 
20678
20904
  export type StringId = string;
@@ -20791,6 +21017,8 @@ export interface ReportKey {
20791
21017
  [key: string]: any;
20792
21018
  }
20793
21019
 
21020
+ type MFA_Method = "email" | "whatsapp" | "authenticator" | "recovery_codes";
21021
+
20794
21022
  type RepzoModel =
20795
21023
  | "socialPlatform"
20796
21024
  | "activityAiSalesOrder"