repzo 1.0.195 → 1.0.197

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
@@ -103,6 +103,9 @@ export declare const end_points: {
103
103
  readonly REPORT_FILTER: "report-filter";
104
104
  readonly SAFE_CRUD: "safe-crud";
105
105
  readonly PAYMENT_METHOD: "payment-method";
106
+ readonly REPORT_VIEW: "report-view";
107
+ readonly REPORT_VIEW_DEFAULT: "report-view-default";
108
+ readonly REPORT_VIEW_FAVORITE: "report-view-favorite";
106
109
  };
107
110
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
108
111
  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", "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"];
@@ -217,6 +220,9 @@ export default class Repzo {
217
220
  readonly REPORT_FILTER: "report-filter";
218
221
  readonly SAFE_CRUD: "safe-crud";
219
222
  readonly PAYMENT_METHOD: "payment-method";
223
+ readonly REPORT_VIEW: "report-view";
224
+ readonly REPORT_VIEW_DEFAULT: "report-view-default";
225
+ readonly REPORT_VIEW_FAVORITE: "report-view-favorite";
220
226
  };
221
227
  private _fetch;
222
228
  private _create;
@@ -1032,4 +1038,26 @@ export default class Repzo {
1032
1038
  update: (id: Service.PaymentMethod.Update.ID, body: Service.PaymentMethod.Update.Body) => Promise<Service.PaymentMethod.Update.Result>;
1033
1039
  remove: (id: Service.PaymentMethod.Update.ID, params: Service.PaymentMethod.Remove.Params) => Promise<Service.PaymentMethod.Remove.Result>;
1034
1040
  };
1041
+ reportView: {
1042
+ _path: "report-view";
1043
+ find: (params?: Service.ReportView.Find.Params) => Promise<Service.ReportView.Find.Result>;
1044
+ get: (id: Service.ReportView.Get.ID, params?: Service.ReportView.Get.Params) => Promise<Service.ReportView.Get.Result>;
1045
+ create: (body: Service.ReportView.Create.Body) => Promise<Service.ReportView.Create.Result>;
1046
+ update: (id: Service.ReportView.Update.ID, body: Service.ReportView.Update.Body) => Promise<Service.ReportView.Update.Result>;
1047
+ remove: (id: Service.ReportView.Remove.ID, params: Service.ReportView.Remove.Params) => Promise<Service.ReportView.Remove.Result>;
1048
+ };
1049
+ reportViewFavorite: {
1050
+ _path: "report-view-favorite";
1051
+ find: (params?: Service.ReportViewFavorite.Find.Params) => Promise<Service.ReportViewFavorite.Find.Result>;
1052
+ get: (id: Service.ReportViewFavorite.Get.ID, params?: Service.ReportViewFavorite.Get.Params) => Promise<Service.ReportViewFavorite.Get.Result>;
1053
+ create: (body: Service.ReportViewFavorite.Create.Body) => Promise<Service.ReportViewFavorite.Create.Result>;
1054
+ remove: (id: Service.ReportViewFavorite.Remove.ID, params: Service.ReportViewFavorite.Remove.Params) => Promise<Service.ReportViewFavorite.Remove.Result>;
1055
+ };
1056
+ reportViewDefault: {
1057
+ _path: "report-view-default";
1058
+ find: (params?: Service.ReportViewDefault.Find.Params) => Promise<Service.ReportViewDefault.Find.Result>;
1059
+ get: (id: Service.ReportViewDefault.Get.ID, params?: Service.ReportViewDefault.Get.Params) => Promise<Service.ReportViewDefault.Get.Result>;
1060
+ create: (body: Service.ReportViewDefault.Create.Body) => Promise<Service.ReportViewDefault.Create.Result>;
1061
+ remove: (id: Service.ReportViewDefault.Remove.ID, params: Service.ReportViewDefault.Remove.Params) => Promise<Service.ReportViewDefault.Remove.Result>;
1062
+ };
1035
1063
  }
package/lib/index.js CHANGED
@@ -104,6 +104,9 @@ export const end_points = {
104
104
  REPORT_FILTER: "report-filter",
105
105
  SAFE_CRUD: "safe-crud",
106
106
  PAYMENT_METHOD: "payment-method",
107
+ REPORT_VIEW: "report-view",
108
+ REPORT_VIEW_DEFAULT: "report-view-default",
109
+ REPORT_VIEW_FAVORITE: "report-view-favorite",
107
110
  };
108
111
  export const availableService = [
109
112
  "client",
@@ -2119,6 +2122,64 @@ class Repzo {
2119
2122
  return res;
2120
2123
  },
2121
2124
  };
2125
+ this.reportView = {
2126
+ _path: Repzo._end_points.REPORT_VIEW,
2127
+ find: async (params) => {
2128
+ let res = await this._fetch(this.svAPIEndpoint, this.reportView._path, params);
2129
+ return res;
2130
+ },
2131
+ get: async (id, params) => {
2132
+ return await this._fetch(this.svAPIEndpoint, this.reportView._path + `/${id}`, params);
2133
+ },
2134
+ create: async (body) => {
2135
+ let res = await this._create(this.svAPIEndpoint, this.reportView._path, body);
2136
+ return res;
2137
+ },
2138
+ update: async (id, body) => {
2139
+ let res = await this._update(this.svAPIEndpoint, this.reportView._path + `/${id}`, body);
2140
+ return res;
2141
+ },
2142
+ remove: async (id, params) => {
2143
+ let res = await this._delete(this.svAPIEndpoint, this.reportView._path + `/${id}`, params);
2144
+ return res;
2145
+ },
2146
+ };
2147
+ this.reportViewFavorite = {
2148
+ _path: Repzo._end_points.REPORT_VIEW_FAVORITE,
2149
+ find: async (params) => {
2150
+ let res = await this._fetch(this.svAPIEndpoint, this.reportViewFavorite._path, params);
2151
+ return res;
2152
+ },
2153
+ get: async (id, params) => {
2154
+ return await this._fetch(this.svAPIEndpoint, this.reportViewFavorite._path + `/${id}`, params);
2155
+ },
2156
+ create: async (body) => {
2157
+ let res = await this._create(this.svAPIEndpoint, this.reportViewFavorite._path, body);
2158
+ return res;
2159
+ },
2160
+ remove: async (id, params) => {
2161
+ let res = await this._delete(this.svAPIEndpoint, this.reportViewFavorite._path + `/${id}`, params);
2162
+ return res;
2163
+ },
2164
+ };
2165
+ this.reportViewDefault = {
2166
+ _path: Repzo._end_points.REPORT_VIEW_DEFAULT,
2167
+ find: async (params) => {
2168
+ let res = await this._fetch(this.svAPIEndpoint, this.reportViewDefault._path, params);
2169
+ return res;
2170
+ },
2171
+ get: async (id, params) => {
2172
+ return await this._fetch(this.svAPIEndpoint, this.reportViewDefault._path + `/${id}`, params);
2173
+ },
2174
+ create: async (body) => {
2175
+ let res = await this._create(this.svAPIEndpoint, this.reportViewDefault._path, body);
2176
+ return res;
2177
+ },
2178
+ remove: async (id, params) => {
2179
+ let res = await this._delete(this.svAPIEndpoint, this.reportViewDefault._path + `/${id}`, params);
2180
+ return res;
2181
+ },
2182
+ };
2122
2183
  this.svAPIEndpoint =
2123
2184
  !options?.env || options?.env == "production"
2124
2185
  ? "https://sv.api.repzo.me"
@@ -452,7 +452,7 @@ export declare namespace Service {
452
452
  };
453
453
  paymentTerm?: StringId;
454
454
  speciality?: StringId[];
455
- company_namespace: string[];
455
+ company_namespace?: string[];
456
456
  channel?: StringId;
457
457
  isChain?: boolean;
458
458
  chain?: StringId;
@@ -16532,6 +16532,285 @@ export declare namespace Service {
16532
16532
  type Result = Data;
16533
16533
  }
16534
16534
  }
16535
+ namespace ReportView {
16536
+ interface ColumnViewSettings {
16537
+ key: string;
16538
+ position: number;
16539
+ width: number;
16540
+ is_pinned: boolean;
16541
+ }
16542
+ interface Data {
16543
+ _id?: string;
16544
+ name: string;
16545
+ disabled: boolean;
16546
+ creator: Admin;
16547
+ editor: Admin;
16548
+ column_view_settings?: ColumnViewSettings[];
16549
+ position?: number;
16550
+ payload?: {
16551
+ maxAnyOfLength?: number;
16552
+ anyOf: {
16553
+ criteria: {
16554
+ key: string;
16555
+ operator: string;
16556
+ value: any;
16557
+ }[];
16558
+ }[];
16559
+ options?: {
16560
+ page?: number;
16561
+ limit?: number;
16562
+ sort?: {
16563
+ key: string;
16564
+ type: "asc" | "desc";
16565
+ }[];
16566
+ totals_summary?: "all" | "page" | "none";
16567
+ };
16568
+ group?: {
16569
+ _id: string;
16570
+ fields: {
16571
+ key: string;
16572
+ accumulator: "sum" | "min" | "max" | "avg" | "first" | "last" | "addToSet" | "push";
16573
+ }[];
16574
+ }[];
16575
+ columns?: ReportColumn.Data[];
16576
+ projection?: {
16577
+ key: string;
16578
+ label: string;
16579
+ }[];
16580
+ };
16581
+ is_public: boolean;
16582
+ report_view_type: "kanban" | "table" | "agenda";
16583
+ paramsQuery?: {
16584
+ [key: string]: any;
16585
+ };
16586
+ report_type: ReportType;
16587
+ company_namespace: string[];
16588
+ teams?: string[];
16589
+ createdAt?: Date;
16590
+ updatedAt?: Date;
16591
+ }
16592
+ interface CreateBody {
16593
+ name: string;
16594
+ column_view_settings?: ColumnViewSettings[];
16595
+ position?: number;
16596
+ payload?: {
16597
+ maxAnyOfLength?: number;
16598
+ anyOf: {
16599
+ criteria: {
16600
+ key: string;
16601
+ operator: string;
16602
+ value: any;
16603
+ }[];
16604
+ }[];
16605
+ options?: {
16606
+ page?: number;
16607
+ limit?: number;
16608
+ sort?: {
16609
+ key: string;
16610
+ type: "asc" | "desc";
16611
+ }[];
16612
+ totals_summary?: "all" | "page" | "none";
16613
+ };
16614
+ group?: {
16615
+ _id: string;
16616
+ fields: {
16617
+ key: string;
16618
+ accumulator: "sum" | "min" | "max" | "avg" | "first" | "last" | "addToSet" | "push";
16619
+ }[];
16620
+ }[];
16621
+ columns?: ReportColumn.Data[];
16622
+ projection?: {
16623
+ key: string;
16624
+ label: string;
16625
+ }[];
16626
+ };
16627
+ is_public?: boolean;
16628
+ report_view_type: "kanban" | "table" | "agenda";
16629
+ paramsQuery?: {
16630
+ [key: string]: any;
16631
+ };
16632
+ }
16633
+ interface UpdateBody {
16634
+ name?: string;
16635
+ column_view_settings?: ColumnViewSettings[];
16636
+ position?: number;
16637
+ payload?: {
16638
+ maxAnyOfLength?: number;
16639
+ anyOf: {
16640
+ criteria: {
16641
+ key: string;
16642
+ operator: string;
16643
+ value: any;
16644
+ }[];
16645
+ }[];
16646
+ options?: {
16647
+ page?: number;
16648
+ limit?: number;
16649
+ sort?: {
16650
+ key: string;
16651
+ type: "asc" | "desc";
16652
+ }[];
16653
+ totals_summary?: "all" | "page" | "none";
16654
+ };
16655
+ group?: {
16656
+ _id: string;
16657
+ fields: {
16658
+ key: string;
16659
+ accumulator: "sum" | "min" | "max" | "avg" | "first" | "last" | "addToSet" | "push";
16660
+ }[];
16661
+ }[];
16662
+ columns?: ReportColumn.Data[];
16663
+ projection?: {
16664
+ key: string;
16665
+ label: string;
16666
+ }[];
16667
+ };
16668
+ is_public?: boolean;
16669
+ report_view_type?: "kanban" | "table" | "agenda";
16670
+ paramsQuery?: {
16671
+ [key: string]: any;
16672
+ };
16673
+ }
16674
+ namespace Find {
16675
+ type Params = DefaultPaginationQueryParams & {
16676
+ _id?: StringId | StringId[];
16677
+ name?: string | string[];
16678
+ disabled?: boolean;
16679
+ is_public?: boolean;
16680
+ report_view_type?: ("kanban" | "table" | "agenda")[];
16681
+ report_type?: ReportType | ReportType[];
16682
+ mine_views?: boolean;
16683
+ teams?: StringId | StringId[];
16684
+ search?: string;
16685
+ };
16686
+ interface Result extends DefaultPaginationResult {
16687
+ data: Data[];
16688
+ }
16689
+ }
16690
+ namespace Get {
16691
+ type ID = StringId;
16692
+ type Params = {};
16693
+ type Result = Data;
16694
+ }
16695
+ namespace Create {
16696
+ type params = {
16697
+ add_to_favorite?: boolean;
16698
+ set_as_default?: boolean;
16699
+ };
16700
+ type Body = CreateBody;
16701
+ type Result = Data;
16702
+ }
16703
+ namespace Update {
16704
+ type ID = StringId;
16705
+ type Body = UpdateBody;
16706
+ type Result = Data;
16707
+ }
16708
+ namespace Remove {
16709
+ type ID = StringId;
16710
+ type Params = {};
16711
+ type Result = Data;
16712
+ }
16713
+ }
16714
+ namespace ReportViewFavorite {
16715
+ interface Data {
16716
+ _id?: string;
16717
+ user: Admin;
16718
+ report_view: StringId;
16719
+ report_type: ReportType;
16720
+ company_namespace: string[];
16721
+ createdAt?: Date;
16722
+ updatedAt?: Date;
16723
+ }
16724
+ interface CreateBody {
16725
+ user?: Admin;
16726
+ report_view: StringId;
16727
+ report_type?: ReportType;
16728
+ }
16729
+ type populateDoc = Data & {
16730
+ report_view_populated?: ReportView.Data;
16731
+ };
16732
+ namespace Find {
16733
+ type Params = DefaultPaginationQueryParams & {
16734
+ _id?: StringId | StringId[];
16735
+ "user._id"?: StringId | StringId[];
16736
+ report_view?: StringId | StringId[];
16737
+ report_type?: ReportType | ReportType[];
16738
+ populatedKeys?: "report_view"[];
16739
+ };
16740
+ interface Result extends DefaultPaginationResult {
16741
+ data: populateDoc[];
16742
+ }
16743
+ }
16744
+ namespace Get {
16745
+ type ID = StringId;
16746
+ type Params = {
16747
+ populatedKeys?: "report_view"[];
16748
+ };
16749
+ type Result = populateDoc;
16750
+ }
16751
+ namespace Create {
16752
+ type Body = CreateBody;
16753
+ type Result = Data;
16754
+ }
16755
+ namespace Remove {
16756
+ type ID = StringId;
16757
+ type Params = {};
16758
+ type Result = {
16759
+ acknowledged: boolean;
16760
+ deletedCount: number;
16761
+ };
16762
+ }
16763
+ }
16764
+ namespace ReportViewDefault {
16765
+ interface Data {
16766
+ _id?: string;
16767
+ user: Admin;
16768
+ report_view: StringId;
16769
+ report_type: ReportType;
16770
+ company_namespace: string[];
16771
+ createdAt?: Date;
16772
+ updatedAt?: Date;
16773
+ }
16774
+ interface CreateBody {
16775
+ user?: Admin;
16776
+ report_view: StringId;
16777
+ report_type?: ReportType;
16778
+ }
16779
+ type populateDoc = Data & {
16780
+ report_view_populated?: ReportView.Data;
16781
+ };
16782
+ namespace Find {
16783
+ type Params = DefaultPaginationQueryParams & {
16784
+ _id?: StringId | StringId[];
16785
+ "user._id"?: StringId | StringId[];
16786
+ report_view?: StringId | StringId[];
16787
+ report_type?: ReportType | ReportType[];
16788
+ populatedKeys?: "report_view"[];
16789
+ };
16790
+ interface Result extends DefaultPaginationResult {
16791
+ data: populateDoc[];
16792
+ }
16793
+ }
16794
+ namespace Get {
16795
+ type ID = StringId;
16796
+ type Params = {
16797
+ populatedKeys?: "report_view"[];
16798
+ };
16799
+ type Result = populateDoc;
16800
+ }
16801
+ namespace Create {
16802
+ type Body = CreateBody;
16803
+ type Result = Data;
16804
+ }
16805
+ namespace Remove {
16806
+ type ID = StringId;
16807
+ type Params = {};
16808
+ type Result = {
16809
+ acknowledged: boolean;
16810
+ deletedCount: number;
16811
+ };
16812
+ }
16813
+ }
16535
16814
  }
16536
16815
  export type StringId = string;
16537
16816
  export type NameSpaces = string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.195",
3
+ "version": "1.0.197",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/index.ts CHANGED
@@ -114,6 +114,9 @@ export const end_points = {
114
114
  REPORT_FILTER: "report-filter",
115
115
  SAFE_CRUD: "safe-crud",
116
116
  PAYMENT_METHOD: "payment-method",
117
+ REPORT_VIEW: "report-view",
118
+ REPORT_VIEW_DEFAULT: "report-view-default",
119
+ REPORT_VIEW_FAVORITE: "report-view-favorite",
117
120
  } as const;
118
121
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
119
122
 
@@ -5399,6 +5402,152 @@ export default class Repzo {
5399
5402
  return res;
5400
5403
  },
5401
5404
  };
5405
+
5406
+ reportView = {
5407
+ _path: Repzo._end_points.REPORT_VIEW,
5408
+ find: async (
5409
+ params?: Service.ReportView.Find.Params,
5410
+ ): Promise<Service.ReportView.Find.Result> => {
5411
+ let res: Service.ReportView.Find.Result = await this._fetch(
5412
+ this.svAPIEndpoint,
5413
+ this.reportView._path,
5414
+ params,
5415
+ );
5416
+ return res;
5417
+ },
5418
+ get: async (
5419
+ id: Service.ReportView.Get.ID,
5420
+ params?: Service.ReportView.Get.Params,
5421
+ ): Promise<Service.ReportView.Get.Result> => {
5422
+ return await this._fetch(
5423
+ this.svAPIEndpoint,
5424
+ this.reportView._path + `/${id}`,
5425
+ params,
5426
+ );
5427
+ },
5428
+ create: async (
5429
+ body: Service.ReportView.Create.Body,
5430
+ ): Promise<Service.ReportView.Create.Result> => {
5431
+ let res = await this._create(
5432
+ this.svAPIEndpoint,
5433
+ this.reportView._path,
5434
+ body,
5435
+ );
5436
+ return res;
5437
+ },
5438
+ update: async (
5439
+ id: Service.ReportView.Update.ID,
5440
+ body: Service.ReportView.Update.Body,
5441
+ ): Promise<Service.ReportView.Update.Result> => {
5442
+ let res: Service.ReportView.Update.Result = await this._update(
5443
+ this.svAPIEndpoint,
5444
+ this.reportView._path + `/${id}`,
5445
+ body,
5446
+ );
5447
+ return res;
5448
+ },
5449
+ remove: async (
5450
+ id: Service.ReportView.Remove.ID,
5451
+ params: Service.ReportView.Remove.Params,
5452
+ ): Promise<Service.ReportView.Remove.Result> => {
5453
+ let res: Service.ReportView.Remove.Result = await this._delete(
5454
+ this.svAPIEndpoint,
5455
+ this.reportView._path + `/${id}`,
5456
+ params,
5457
+ );
5458
+ return res;
5459
+ },
5460
+ };
5461
+
5462
+ reportViewFavorite = {
5463
+ _path: Repzo._end_points.REPORT_VIEW_FAVORITE,
5464
+ find: async (
5465
+ params?: Service.ReportViewFavorite.Find.Params,
5466
+ ): Promise<Service.ReportViewFavorite.Find.Result> => {
5467
+ let res: Service.ReportViewFavorite.Find.Result = await this._fetch(
5468
+ this.svAPIEndpoint,
5469
+ this.reportViewFavorite._path,
5470
+ params,
5471
+ );
5472
+ return res;
5473
+ },
5474
+ get: async (
5475
+ id: Service.ReportViewFavorite.Get.ID,
5476
+ params?: Service.ReportViewFavorite.Get.Params,
5477
+ ): Promise<Service.ReportViewFavorite.Get.Result> => {
5478
+ return await this._fetch(
5479
+ this.svAPIEndpoint,
5480
+ this.reportViewFavorite._path + `/${id}`,
5481
+ params,
5482
+ );
5483
+ },
5484
+ create: async (
5485
+ body: Service.ReportViewFavorite.Create.Body,
5486
+ ): Promise<Service.ReportViewFavorite.Create.Result> => {
5487
+ let res = await this._create(
5488
+ this.svAPIEndpoint,
5489
+ this.reportViewFavorite._path,
5490
+ body,
5491
+ );
5492
+ return res;
5493
+ },
5494
+ remove: async (
5495
+ id: Service.ReportViewFavorite.Remove.ID,
5496
+ params: Service.ReportViewFavorite.Remove.Params,
5497
+ ): Promise<Service.ReportViewFavorite.Remove.Result> => {
5498
+ let res: Service.ReportViewFavorite.Remove.Result = await this._delete(
5499
+ this.svAPIEndpoint,
5500
+ this.reportViewFavorite._path + `/${id}`,
5501
+ params,
5502
+ );
5503
+ return res;
5504
+ },
5505
+ };
5506
+
5507
+ reportViewDefault = {
5508
+ _path: Repzo._end_points.REPORT_VIEW_DEFAULT,
5509
+ find: async (
5510
+ params?: Service.ReportViewDefault.Find.Params,
5511
+ ): Promise<Service.ReportViewDefault.Find.Result> => {
5512
+ let res: Service.ReportViewDefault.Find.Result = await this._fetch(
5513
+ this.svAPIEndpoint,
5514
+ this.reportViewDefault._path,
5515
+ params,
5516
+ );
5517
+ return res;
5518
+ },
5519
+ get: async (
5520
+ id: Service.ReportViewDefault.Get.ID,
5521
+ params?: Service.ReportViewDefault.Get.Params,
5522
+ ): Promise<Service.ReportViewDefault.Get.Result> => {
5523
+ return await this._fetch(
5524
+ this.svAPIEndpoint,
5525
+ this.reportViewDefault._path + `/${id}`,
5526
+ params,
5527
+ );
5528
+ },
5529
+ create: async (
5530
+ body: Service.ReportViewDefault.Create.Body,
5531
+ ): Promise<Service.ReportViewDefault.Create.Result> => {
5532
+ let res = await this._create(
5533
+ this.svAPIEndpoint,
5534
+ this.reportViewDefault._path,
5535
+ body,
5536
+ );
5537
+ return res;
5538
+ },
5539
+ remove: async (
5540
+ id: Service.ReportViewDefault.Remove.ID,
5541
+ params: Service.ReportViewDefault.Remove.Params,
5542
+ ): Promise<Service.ReportViewDefault.Remove.Result> => {
5543
+ let res: Service.ReportViewDefault.Remove.Result = await this._delete(
5544
+ this.svAPIEndpoint,
5545
+ this.reportViewDefault._path + `/${id}`,
5546
+ params,
5547
+ );
5548
+ return res;
5549
+ },
5550
+ };
5402
5551
  }
5403
5552
 
5404
5553
  function normalizeParams(params: Params): { [key: string]: any } {
@@ -610,7 +610,7 @@ export namespace Service {
610
610
  customFields?: { [key: string]: string | number | boolean | StringId };
611
611
  paymentTerm?: StringId;
612
612
  speciality?: StringId[];
613
- company_namespace: string[];
613
+ company_namespace?: string[];
614
614
  channel?: StringId;
615
615
  isChain?: boolean;
616
616
  chain?: StringId;
@@ -18771,6 +18771,297 @@ export namespace Service {
18771
18771
  export type Result = Data;
18772
18772
  }
18773
18773
  }
18774
+
18775
+ export namespace ReportView {
18776
+ export interface ColumnViewSettings {
18777
+ key: string;
18778
+ position: number;
18779
+ width: number;
18780
+ is_pinned: boolean;
18781
+ }
18782
+ export interface Data {
18783
+ _id?: string;
18784
+ name: string;
18785
+ disabled: boolean;
18786
+ creator: Admin;
18787
+ editor: Admin;
18788
+ column_view_settings?: ColumnViewSettings[];
18789
+ position?: number;
18790
+ payload?: {
18791
+ maxAnyOfLength?: number;
18792
+ anyOf: {
18793
+ criteria: {
18794
+ key: string;
18795
+ operator: string;
18796
+ value: any;
18797
+ }[];
18798
+ }[];
18799
+ options?: {
18800
+ page?: number;
18801
+ limit?: number;
18802
+ sort?: { key: string; type: "asc" | "desc" }[];
18803
+ totals_summary?: "all" | "page" | "none";
18804
+ };
18805
+ group?: {
18806
+ _id: string;
18807
+ fields: {
18808
+ key: string;
18809
+ accumulator:
18810
+ | "sum"
18811
+ | "min"
18812
+ | "max"
18813
+ | "avg"
18814
+ | "first"
18815
+ | "last"
18816
+ | "addToSet"
18817
+ | "push";
18818
+ }[];
18819
+ }[];
18820
+ columns?: ReportColumn.Data[];
18821
+ projection?: { key: string; label: string }[];
18822
+ };
18823
+ is_public: boolean;
18824
+ report_view_type: "kanban" | "table" | "agenda";
18825
+ paramsQuery?: { [key: string]: any };
18826
+ report_type: ReportType;
18827
+ company_namespace: string[];
18828
+ teams?: string[];
18829
+ createdAt?: Date;
18830
+ updatedAt?: Date;
18831
+ }
18832
+
18833
+ export interface CreateBody {
18834
+ name: string;
18835
+ column_view_settings?: ColumnViewSettings[];
18836
+ position?: number;
18837
+ payload?: {
18838
+ maxAnyOfLength?: number;
18839
+ anyOf: {
18840
+ criteria: {
18841
+ key: string;
18842
+ operator: string;
18843
+ value: any;
18844
+ }[];
18845
+ }[];
18846
+ options?: {
18847
+ page?: number;
18848
+ limit?: number;
18849
+ sort?: { key: string; type: "asc" | "desc" }[];
18850
+ totals_summary?: "all" | "page" | "none";
18851
+ };
18852
+ group?: {
18853
+ _id: string;
18854
+ fields: {
18855
+ key: string;
18856
+ accumulator:
18857
+ | "sum"
18858
+ | "min"
18859
+ | "max"
18860
+ | "avg"
18861
+ | "first"
18862
+ | "last"
18863
+ | "addToSet"
18864
+ | "push";
18865
+ }[];
18866
+ }[];
18867
+ columns?: ReportColumn.Data[];
18868
+ projection?: { key: string; label: string }[];
18869
+ };
18870
+ is_public?: boolean;
18871
+ report_view_type: "kanban" | "table" | "agenda";
18872
+ paramsQuery?: { [key: string]: any };
18873
+ }
18874
+
18875
+ export interface UpdateBody {
18876
+ name?: string;
18877
+ column_view_settings?: ColumnViewSettings[];
18878
+ position?: number;
18879
+ payload?: {
18880
+ maxAnyOfLength?: number;
18881
+ anyOf: {
18882
+ criteria: {
18883
+ key: string;
18884
+ operator: string;
18885
+ value: any;
18886
+ }[];
18887
+ }[];
18888
+ options?: {
18889
+ page?: number;
18890
+ limit?: number;
18891
+ sort?: { key: string; type: "asc" | "desc" }[];
18892
+ totals_summary?: "all" | "page" | "none";
18893
+ };
18894
+ group?: {
18895
+ _id: string;
18896
+ fields: {
18897
+ key: string;
18898
+ accumulator:
18899
+ | "sum"
18900
+ | "min"
18901
+ | "max"
18902
+ | "avg"
18903
+ | "first"
18904
+ | "last"
18905
+ | "addToSet"
18906
+ | "push";
18907
+ }[];
18908
+ }[];
18909
+ columns?: ReportColumn.Data[];
18910
+ projection?: { key: string; label: string }[];
18911
+ };
18912
+ is_public?: boolean;
18913
+ report_view_type?: "kanban" | "table" | "agenda";
18914
+ paramsQuery?: { [key: string]: any };
18915
+ }
18916
+
18917
+ export namespace Find {
18918
+ export type Params = DefaultPaginationQueryParams & {
18919
+ _id?: StringId | StringId[];
18920
+ name?: string | string[];
18921
+ disabled?: boolean;
18922
+ is_public?: boolean;
18923
+ report_view_type?: ("kanban" | "table" | "agenda")[];
18924
+ report_type?: ReportType | ReportType[];
18925
+ mine_views?: boolean;
18926
+ teams?: StringId | StringId[];
18927
+ search?: string;
18928
+ };
18929
+ export interface Result extends DefaultPaginationResult {
18930
+ data: Data[];
18931
+ }
18932
+ }
18933
+
18934
+ export namespace Get {
18935
+ export type ID = StringId;
18936
+ export type Params = {};
18937
+ export type Result = Data;
18938
+ }
18939
+
18940
+ export namespace Create {
18941
+ export type params = {
18942
+ add_to_favorite?: boolean;
18943
+ set_as_default?: boolean;
18944
+ };
18945
+ export type Body = CreateBody;
18946
+ export type Result = Data;
18947
+ }
18948
+
18949
+ export namespace Update {
18950
+ export type ID = StringId;
18951
+ export type Body = UpdateBody;
18952
+ export type Result = Data;
18953
+ }
18954
+
18955
+ export namespace Remove {
18956
+ export type ID = StringId;
18957
+ export type Params = {};
18958
+ export type Result = Data;
18959
+ }
18960
+ }
18961
+
18962
+ export namespace ReportViewFavorite {
18963
+ export interface Data {
18964
+ _id?: string;
18965
+ user: Admin;
18966
+ report_view: StringId;
18967
+ report_type: ReportType;
18968
+ company_namespace: string[];
18969
+ createdAt?: Date;
18970
+ updatedAt?: Date;
18971
+ }
18972
+
18973
+ export interface CreateBody {
18974
+ user?: Admin;
18975
+ report_view: StringId;
18976
+ report_type?: ReportType;
18977
+ }
18978
+
18979
+ export type populateDoc = Data & {
18980
+ report_view_populated?: ReportView.Data;
18981
+ };
18982
+
18983
+ export namespace Find {
18984
+ export type Params = DefaultPaginationQueryParams & {
18985
+ _id?: StringId | StringId[];
18986
+ "user._id"?: StringId | StringId[];
18987
+ report_view?: StringId | StringId[];
18988
+ report_type?: ReportType | ReportType[];
18989
+ populatedKeys?: "report_view"[];
18990
+ };
18991
+ export interface Result extends DefaultPaginationResult {
18992
+ data: populateDoc[];
18993
+ }
18994
+ }
18995
+ export namespace Get {
18996
+ export type ID = StringId;
18997
+ export type Params = { populatedKeys?: "report_view"[] };
18998
+ export type Result = populateDoc;
18999
+ }
19000
+ export namespace Create {
19001
+ export type Body = CreateBody;
19002
+ export type Result = Data;
19003
+ }
19004
+ export namespace Remove {
19005
+ export type ID = StringId;
19006
+ export type Params = {};
19007
+ export type Result = {
19008
+ acknowledged: boolean;
19009
+ deletedCount: number;
19010
+ };
19011
+ }
19012
+ }
19013
+
19014
+ export namespace ReportViewDefault {
19015
+ export interface Data {
19016
+ _id?: string;
19017
+ user: Admin;
19018
+ report_view: StringId;
19019
+ report_type: ReportType;
19020
+ company_namespace: string[];
19021
+ createdAt?: Date;
19022
+ updatedAt?: Date;
19023
+ }
19024
+
19025
+ export interface CreateBody {
19026
+ user?: Admin;
19027
+ report_view: StringId;
19028
+ report_type?: ReportType;
19029
+ }
19030
+
19031
+ export type populateDoc = Data & {
19032
+ report_view_populated?: ReportView.Data;
19033
+ };
19034
+
19035
+ export namespace Find {
19036
+ export type Params = DefaultPaginationQueryParams & {
19037
+ _id?: StringId | StringId[];
19038
+ "user._id"?: StringId | StringId[];
19039
+ report_view?: StringId | StringId[];
19040
+ report_type?: ReportType | ReportType[];
19041
+ populatedKeys?: "report_view"[];
19042
+ };
19043
+ export interface Result extends DefaultPaginationResult {
19044
+ data: populateDoc[];
19045
+ }
19046
+ }
19047
+ export namespace Get {
19048
+ export type ID = StringId;
19049
+ export type Params = { populatedKeys?: "report_view"[] };
19050
+ export type Result = populateDoc;
19051
+ }
19052
+ export namespace Create {
19053
+ export type Body = CreateBody;
19054
+ export type Result = Data;
19055
+ }
19056
+ export namespace Remove {
19057
+ export type ID = StringId;
19058
+ export type Params = {};
19059
+ export type Result = {
19060
+ acknowledged: boolean;
19061
+ deletedCount: number;
19062
+ };
19063
+ }
19064
+ }
18774
19065
  }
18775
19066
 
18776
19067
  export type StringId = string;