repzo 1.0.259 → 1.0.261

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"
@@ -3917,10 +3917,7 @@ export declare namespace Service {
3917
3917
  filter_type: "product" | "category" | "sub_category" | "product_group" | "brand" | "variant" | "cart_total" | "items_count" | "client" | "tag" | "channel" | "distinct_variants_count" | "distinct_products_count" | "promotion" | "cart_type" | "invoice_payment_type" | "creator_id";
3918
3918
  value: string[];
3919
3919
  operator: "lte" | "lt" | "gte" | "gt" | "eq";
3920
- reject_if_pass: {
3921
- type: Boolean;
3922
- default: false;
3923
- };
3920
+ reject_if_pass: boolean;
3924
3921
  limit_type: "count" | "price_amount";
3925
3922
  limit_value: number;
3926
3923
  exclude_additional_items_taxable_subtotal?: boolean;
@@ -12262,6 +12259,10 @@ export declare namespace Service {
12262
12259
  rep_must_start_day_within_specific_time_frame: boolean;
12263
12260
  };
12264
12261
  allow_assigning_non_creator_teams_when_creating_client?: boolean;
12262
+ enable_email_mfa: boolean;
12263
+ enable_whatsapp_mfa: boolean;
12264
+ enable_authenticator_mfa: boolean;
12265
+ minimum_accepted_mfa: number;
12265
12266
  createdAt: Date;
12266
12267
  updatedAt: Date;
12267
12268
  }
@@ -12450,6 +12451,10 @@ export declare namespace Service {
12450
12451
  };
12451
12452
  first_business_day_in_week?: "Sun" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat";
12452
12453
  allow_assigning_non_creator_teams_when_creating_client?: boolean;
12454
+ enable_email_mfa: boolean;
12455
+ enable_whatsapp_mfa: boolean;
12456
+ enable_authenticator_mfa: boolean;
12457
+ minimum_accepted_mfa: number;
12453
12458
  }
12454
12459
  namespace Update {
12455
12460
  type ID = StringId;
@@ -14556,7 +14561,7 @@ export declare namespace Service {
14556
14561
  grace_until: number;
14557
14562
  subscription_status: CompanyNamespace.Data["subscription_status"];
14558
14563
  }
14559
- export interface Data {
14564
+ interface LoginResponse {
14560
14565
  access_token: string;
14561
14566
  refresh_token: string;
14562
14567
  login_status: "success";
@@ -14585,7 +14590,37 @@ export declare namespace Service {
14585
14590
  assessment_enforcement_state: "suggest" | "enforce" | "ignore";
14586
14591
  repzo_internal_user: boolean;
14587
14592
  allow_treating_invoice_as_proforma_for_etax: boolean;
14593
+ mfa_method?: MFA_Method;
14594
+ settings_mfa: {
14595
+ enable_email_mfa: boolean;
14596
+ enable_whatsapp_mfa: boolean;
14597
+ enable_authenticator_mfa: boolean;
14598
+ minimum_accepted_mfa: number;
14599
+ can_skip: boolean;
14600
+ suggest_mfa: MFA_Method[];
14601
+ };
14602
+ admin_mfa: Pick<Admin.Data, "email_mfa_enabled" | "whatsapp_mfa_enabled" | "authenticator_mfa_enabled" | "recovery_codes_mfa_enabled">;
14603
+ }
14604
+ interface MFAPendingResponse {
14605
+ login_status: "pending";
14606
+ mfa_token: string;
14607
+ mfa_methods: ({
14608
+ method: "email";
14609
+ masked_email: string;
14610
+ blocked_until: number | null;
14611
+ } | {
14612
+ method: "whatsapp";
14613
+ masked_phone: string;
14614
+ blocked_until: number | null;
14615
+ } | {
14616
+ method: "authenticator";
14617
+ blocked_until: number | null;
14618
+ } | {
14619
+ method: "recovery_codes";
14620
+ blocked_until: number | null;
14621
+ })[];
14588
14622
  }
14623
+ export type Data = LoginResponse | MFAPendingResponse;
14589
14624
  export {};
14590
14625
  }
14591
14626
  namespace AuthenticateRep {
@@ -18419,6 +18454,196 @@ export declare namespace Service {
18419
18454
  }
18420
18455
  export {};
18421
18456
  }
18457
+ namespace Admin {
18458
+ export interface Data {
18459
+ _id: StringId;
18460
+ email: string;
18461
+ name: string;
18462
+ phone?: string;
18463
+ disabled: boolean;
18464
+ profile_photo?: string;
18465
+ notification_id?: string;
18466
+ password: string;
18467
+ owner?: boolean;
18468
+ repzo_internal_user?: boolean;
18469
+ can_reset_namespace?: boolean;
18470
+ permissions: {
18471
+ client: {
18472
+ can_view_list?: boolean;
18473
+ can_add?: boolean;
18474
+ can_edit?: boolean;
18475
+ can_verify?: boolean;
18476
+ can_disable?: boolean;
18477
+ can_enable?: boolean;
18478
+ can_export_client?: boolean;
18479
+ can_reset_location?: boolean;
18480
+ };
18481
+ representative: {
18482
+ can_change_password?: boolean;
18483
+ can_change_permission?: boolean;
18484
+ can_edit?: boolean;
18485
+ can_add?: boolean;
18486
+ can_view_list?: boolean;
18487
+ };
18488
+ settings: {
18489
+ can_view_settings?: boolean;
18490
+ };
18491
+ sales: {
18492
+ edit_purchase_order?: boolean;
18493
+ approve_purchase_order?: boolean;
18494
+ approve_invoice?: boolean;
18495
+ cancelled_invoice?: boolean;
18496
+ cancelled_purchase_order?: boolean;
18497
+ };
18498
+ reports: {
18499
+ purchase_order?: boolean;
18500
+ invoice?: boolean;
18501
+ visit?: boolean;
18502
+ note?: boolean;
18503
+ photo?: boolean;
18504
+ task?: boolean;
18505
+ representative?: boolean;
18506
+ client_coverage_by_tag?: boolean;
18507
+ client_coverage_by_area?: boolean;
18508
+ client_coverage?: boolean;
18509
+ route?: boolean;
18510
+ audit?: boolean;
18511
+ frequency?: boolean;
18512
+ unvisit?: boolean;
18513
+ can_view_reports?: boolean;
18514
+ };
18515
+ timeline: {
18516
+ can_view_timeline?: boolean;
18517
+ };
18518
+ form: {
18519
+ can_view_form_report?: boolean;
18520
+ can_create_form?: boolean;
18521
+ can_delete_form?: boolean;
18522
+ can_view_form?: boolean;
18523
+ };
18524
+ product: {
18525
+ can_view_list?: boolean;
18526
+ can_add?: boolean;
18527
+ can_edit?: boolean;
18528
+ can_disable?: boolean;
18529
+ };
18530
+ home: {
18531
+ can_view?: boolean;
18532
+ };
18533
+ };
18534
+ teams: StringId[];
18535
+ media?: StringId[];
18536
+ cover_photo?: StringId;
18537
+ company_namespace: string[];
18538
+ company_group: string;
18539
+ ai_administrator?: boolean;
18540
+ abilities: {
18541
+ ability: StringId;
18542
+ m_read: boolean;
18543
+ m_create: boolean;
18544
+ m_update: boolean;
18545
+ m_remove: boolean;
18546
+ }[];
18547
+ last_login_time?: number;
18548
+ email_mfa_enabled: boolean;
18549
+ email_mfa_activate_time?: number;
18550
+ email_otp_blocked_until?: number;
18551
+ whatsapp_mfa_enabled: boolean;
18552
+ whatsapp_mfa_activate_time?: number;
18553
+ whatsapp_phone?: string;
18554
+ whatsapp_otp_blocked_until?: number;
18555
+ authenticator_mfa_enabled: boolean;
18556
+ authenticator_mfa_activate_time?: number;
18557
+ authenticator_mfa_secret?: string;
18558
+ authenticator_otp_blocked_until?: number;
18559
+ recovery_codes_mfa_enabled: boolean;
18560
+ recovery_codes_mfa_activate_time?: number;
18561
+ recovery_codes_otp_blocked_until?: number;
18562
+ recovery_codes?: string[];
18563
+ recovery_codes_used?: string[];
18564
+ createdAt: Date;
18565
+ updatedAt: Date;
18566
+ }
18567
+ export interface CreateBody {
18568
+ email: string;
18569
+ name: string;
18570
+ password: string;
18571
+ phone?: string;
18572
+ disabled?: boolean;
18573
+ profile_photo?: string;
18574
+ notification_id?: string;
18575
+ owner?: boolean;
18576
+ permissions?: Data["permissions"];
18577
+ teams?: StringId[];
18578
+ media?: StringId[];
18579
+ cover_photo?: StringId;
18580
+ company_namespace?: string[];
18581
+ company_group?: string;
18582
+ }
18583
+ export type UpdateBody = Partial<Data>;
18584
+ export type PopulatedDoc = Data & {
18585
+ media?: PopulatedMediaStorage[];
18586
+ cover_photo?: PopulatedMediaStorage;
18587
+ abilities?: (Data["abilities"][0] & {
18588
+ ability: StringId | {
18589
+ name: string;
18590
+ _id: StringId;
18591
+ };
18592
+ })[];
18593
+ role?: {
18594
+ _id: StringId;
18595
+ name: string;
18596
+ };
18597
+ };
18598
+ type PopulatedKeys = "media" | "cover_photo" | "abilities";
18599
+ export namespace Find {
18600
+ type Params = DefaultPaginationQueryParams & {
18601
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
18602
+ _id?: StringId | StringId[];
18603
+ disabled?: boolean;
18604
+ teams?: StringId | StringId[];
18605
+ name?: string | string[];
18606
+ email?: string | string[];
18607
+ search?: string;
18608
+ repzo_internal_user?: boolean;
18609
+ company_namespace?: string | string[];
18610
+ };
18611
+ interface Result extends DefaultPaginationResult {
18612
+ data: PopulatedDoc[];
18613
+ }
18614
+ }
18615
+ export namespace Get {
18616
+ type ID = string;
18617
+ type Params = {
18618
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
18619
+ };
18620
+ type Result = PopulatedDoc;
18621
+ }
18622
+ export namespace Create {
18623
+ type Body = CreateBody;
18624
+ type Result = Data;
18625
+ }
18626
+ export namespace Update {
18627
+ type ID = StringId;
18628
+ type Body = UpdateBody;
18629
+ type Result = Data;
18630
+ }
18631
+ export namespace Globalize {
18632
+ type ID = StringId;
18633
+ type Params = {
18634
+ globalize: true;
18635
+ };
18636
+ type Body = {};
18637
+ type Result = {
18638
+ success: boolean;
18639
+ };
18640
+ }
18641
+ export namespace Remove {
18642
+ type ID = string;
18643
+ type Result = Data;
18644
+ }
18645
+ export {};
18646
+ }
18422
18647
  }
18423
18648
  export type StringId = string;
18424
18649
  export type NameSpaces = string[];
@@ -18504,6 +18729,7 @@ export interface ReportKey {
18504
18729
  totals_key?: string;
18505
18730
  [key: string]: any;
18506
18731
  }
18732
+ type MFA_Method = "email" | "whatsapp" | "authenticator" | "recovery_codes";
18507
18733
  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
18734
  /**
18509
18735
  * @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.261",
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 } {
@@ -4467,7 +4467,7 @@ export namespace Service {
4467
4467
  | "creator_id";
4468
4468
  value: string[];
4469
4469
  operator: "lte" | "lt" | "gte" | "gt" | "eq";
4470
- reject_if_pass: { type: Boolean; default: false };
4470
+ reject_if_pass: boolean;
4471
4471
  limit_type: "count" | "price_amount";
4472
4472
  limit_value: number;
4473
4473
  exclude_additional_items_taxable_subtotal?: boolean;
@@ -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"