repzo 1.0.175 → 1.0.177
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 +9 -0
- package/lib/index.js +19 -0
- package/lib/types/index.d.ts +105 -0
- package/package.json +1 -1
- package/src/index.ts +49 -0
- package/src/types/index.ts +170 -0
package/lib/index.d.ts
CHANGED
|
@@ -99,6 +99,7 @@ export declare const end_points: {
|
|
|
99
99
|
readonly REPORT_COLUMN_GROUP: "report-column-group";
|
|
100
100
|
readonly REPORT_COLUMN: "report-column";
|
|
101
101
|
readonly REPORT_SORT: "report-sort";
|
|
102
|
+
readonly REPORT_FILTER: "report-filter";
|
|
102
103
|
};
|
|
103
104
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
104
105
|
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"];
|
|
@@ -209,6 +210,7 @@ export default class Repzo {
|
|
|
209
210
|
readonly REPORT_COLUMN_GROUP: "report-column-group";
|
|
210
211
|
readonly REPORT_COLUMN: "report-column";
|
|
211
212
|
readonly REPORT_SORT: "report-sort";
|
|
213
|
+
readonly REPORT_FILTER: "report-filter";
|
|
212
214
|
};
|
|
213
215
|
private _fetch;
|
|
214
216
|
private _create;
|
|
@@ -1000,4 +1002,11 @@ export default class Repzo {
|
|
|
1000
1002
|
update: (id: Service.ReportSort.Update.ID, body: Service.ReportSort.Update.Body) => Promise<Service.ReportSort.Update.Result>;
|
|
1001
1003
|
remove: (id: Service.ReportSort.Remove.ID, params: Service.ReportSort.Remove.Params) => Promise<Service.ReportSort.Remove.Result>;
|
|
1002
1004
|
};
|
|
1005
|
+
reportFilter: {
|
|
1006
|
+
_path: "report-filter";
|
|
1007
|
+
find: (params?: Service.ReportFilter.Find.Params) => Promise<Service.ReportFilter.Find.Result>;
|
|
1008
|
+
get: (id: Service.ReportFilter.Get.ID, params?: Service.ReportFilter.Get.Params) => Promise<Service.ReportFilter.Get.Result>;
|
|
1009
|
+
create: (body: Service.ReportFilter.Create.Body) => Promise<Service.ReportFilter.Create.Result>;
|
|
1010
|
+
update: (id: Service.ReportFilter.Update.ID, body: Service.ReportFilter.Update.Body) => Promise<Service.ReportFilter.Update.Result>;
|
|
1011
|
+
};
|
|
1003
1012
|
}
|
package/lib/index.js
CHANGED
|
@@ -100,6 +100,7 @@ export const end_points = {
|
|
|
100
100
|
REPORT_COLUMN_GROUP: "report-column-group",
|
|
101
101
|
REPORT_COLUMN: "report-column",
|
|
102
102
|
REPORT_SORT: "report-sort",
|
|
103
|
+
REPORT_FILTER: "report-filter",
|
|
103
104
|
};
|
|
104
105
|
export const availableService = [
|
|
105
106
|
"client",
|
|
@@ -2057,6 +2058,24 @@ class Repzo {
|
|
|
2057
2058
|
return res;
|
|
2058
2059
|
},
|
|
2059
2060
|
};
|
|
2061
|
+
this.reportFilter = {
|
|
2062
|
+
_path: Repzo._end_points.REPORT_FILTER,
|
|
2063
|
+
find: async (params) => {
|
|
2064
|
+
let res = await this._fetch(this.svAPIEndpoint, this.reportFilter._path, params);
|
|
2065
|
+
return res;
|
|
2066
|
+
},
|
|
2067
|
+
get: async (id, params) => {
|
|
2068
|
+
return await this._fetch(this.svAPIEndpoint, this.reportFilter._path + `/${id}`, params);
|
|
2069
|
+
},
|
|
2070
|
+
create: async (body) => {
|
|
2071
|
+
let res = await this._create(this.svAPIEndpoint, this.reportFilter._path, body);
|
|
2072
|
+
return res;
|
|
2073
|
+
},
|
|
2074
|
+
update: async (id, body) => {
|
|
2075
|
+
let res = await this._update(this.svAPIEndpoint, this.reportFilter._path + `/${id}`, body);
|
|
2076
|
+
return res;
|
|
2077
|
+
},
|
|
2078
|
+
};
|
|
2060
2079
|
this.svAPIEndpoint =
|
|
2061
2080
|
!options?.env || options?.env == "production"
|
|
2062
2081
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -16147,6 +16147,111 @@ export declare namespace Service {
|
|
|
16147
16147
|
type Result = Data;
|
|
16148
16148
|
}
|
|
16149
16149
|
}
|
|
16150
|
+
namespace ReportFilter {
|
|
16151
|
+
type AccumulatorOperator = "sum" | "count" | "avg" | "max" | "min" | "first" | "last" | "addToSet" | "push";
|
|
16152
|
+
type AccumulatorLabel = "Sum" | "Count" | "Average" | "Max" | "Min" | "First" | "Last" | "Unique" | "ALL";
|
|
16153
|
+
interface Accumulator {
|
|
16154
|
+
operator: AccumulatorOperator;
|
|
16155
|
+
label?: AccumulatorLabel;
|
|
16156
|
+
}
|
|
16157
|
+
interface Field {
|
|
16158
|
+
label: string;
|
|
16159
|
+
key: string;
|
|
16160
|
+
accumulator: Accumulator[];
|
|
16161
|
+
}
|
|
16162
|
+
interface GroupData {
|
|
16163
|
+
id_label: string;
|
|
16164
|
+
id: string;
|
|
16165
|
+
fields: Field[];
|
|
16166
|
+
}
|
|
16167
|
+
interface StaticData {
|
|
16168
|
+
label: string;
|
|
16169
|
+
value: string;
|
|
16170
|
+
}
|
|
16171
|
+
type DataType = "string" | "number" | "array" | "boolean";
|
|
16172
|
+
type InputType = "string" | "list" | "checkbox" | "date" | "number" | "date_range" | "number_range" | "group_by";
|
|
16173
|
+
type Operator = "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "in" | "nin" | "between" | "today" | "yesterday" | "last_seven_days" | "last_thirty_days" | "last_month" | "last_three_months" | "last_six_months" | "last_twelve_months";
|
|
16174
|
+
type DateFormat = "s" | "YYYY-MM-DD" | "YYYY-MM-DD HH:mm:ssZ" | "ISO";
|
|
16175
|
+
interface Data {
|
|
16176
|
+
_id: string;
|
|
16177
|
+
label: string;
|
|
16178
|
+
key: string;
|
|
16179
|
+
render_key: string;
|
|
16180
|
+
filter_key: string;
|
|
16181
|
+
is_multi_select?: boolean;
|
|
16182
|
+
is_static?: boolean;
|
|
16183
|
+
type: DataType;
|
|
16184
|
+
input_type: InputType;
|
|
16185
|
+
operators?: Operator[];
|
|
16186
|
+
date_format?: DateFormat;
|
|
16187
|
+
searchable?: boolean;
|
|
16188
|
+
report_types: ReportType[];
|
|
16189
|
+
endpoint?: string;
|
|
16190
|
+
static_data?: StaticData[];
|
|
16191
|
+
group_data: GroupData[];
|
|
16192
|
+
createdAt?: Date;
|
|
16193
|
+
updatedAt?: Date;
|
|
16194
|
+
}
|
|
16195
|
+
interface CreateBody {
|
|
16196
|
+
label: string;
|
|
16197
|
+
key: string;
|
|
16198
|
+
render_key: string;
|
|
16199
|
+
filter_key: string;
|
|
16200
|
+
report_types: ReportType[];
|
|
16201
|
+
type: DataType;
|
|
16202
|
+
input_type: InputType;
|
|
16203
|
+
is_multi_select?: boolean;
|
|
16204
|
+
is_static?: boolean;
|
|
16205
|
+
operators?: Operator[];
|
|
16206
|
+
date_format?: DateFormat;
|
|
16207
|
+
searchable?: boolean;
|
|
16208
|
+
endpoint?: string;
|
|
16209
|
+
static_data?: StaticData[];
|
|
16210
|
+
group_data: GroupData[];
|
|
16211
|
+
}
|
|
16212
|
+
interface UpdateBody {
|
|
16213
|
+
label?: string;
|
|
16214
|
+
key?: string;
|
|
16215
|
+
render_key?: string;
|
|
16216
|
+
filter_key?: string;
|
|
16217
|
+
report_types?: ReportType[];
|
|
16218
|
+
type?: DataType;
|
|
16219
|
+
input_type?: InputType;
|
|
16220
|
+
is_multi_select?: boolean;
|
|
16221
|
+
is_static?: boolean;
|
|
16222
|
+
operators?: Operator[];
|
|
16223
|
+
date_format?: DateFormat;
|
|
16224
|
+
searchable?: boolean;
|
|
16225
|
+
endpoint?: string;
|
|
16226
|
+
static_data?: StaticData[];
|
|
16227
|
+
group_data: GroupData[];
|
|
16228
|
+
}
|
|
16229
|
+
namespace Find {
|
|
16230
|
+
type Params = DefaultPaginationQueryParams & {
|
|
16231
|
+
report_types?: ReportType | ReportType[];
|
|
16232
|
+
from_createdAt?: Date;
|
|
16233
|
+
to_updatedAt?: Date;
|
|
16234
|
+
search?: string;
|
|
16235
|
+
};
|
|
16236
|
+
interface Result extends DefaultPaginationResult {
|
|
16237
|
+
data: Data[];
|
|
16238
|
+
}
|
|
16239
|
+
}
|
|
16240
|
+
namespace Get {
|
|
16241
|
+
type ID = StringId;
|
|
16242
|
+
type Params = {};
|
|
16243
|
+
type Result = Data;
|
|
16244
|
+
}
|
|
16245
|
+
namespace Create {
|
|
16246
|
+
type Body = CreateBody;
|
|
16247
|
+
type Result = Data;
|
|
16248
|
+
}
|
|
16249
|
+
namespace Update {
|
|
16250
|
+
type ID = StringId;
|
|
16251
|
+
type Body = Partial<UpdateBody>;
|
|
16252
|
+
type Result = Data;
|
|
16253
|
+
}
|
|
16254
|
+
}
|
|
16150
16255
|
}
|
|
16151
16256
|
export type StringId = string;
|
|
16152
16257
|
export type NameSpaces = string[];
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -110,6 +110,7 @@ export const end_points = {
|
|
|
110
110
|
REPORT_COLUMN_GROUP: "report-column-group",
|
|
111
111
|
REPORT_COLUMN: "report-column",
|
|
112
112
|
REPORT_SORT: "report-sort",
|
|
113
|
+
REPORT_FILTER: "report-filter",
|
|
113
114
|
} as const;
|
|
114
115
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
115
116
|
|
|
@@ -5251,6 +5252,54 @@ export default class Repzo {
|
|
|
5251
5252
|
return res;
|
|
5252
5253
|
},
|
|
5253
5254
|
};
|
|
5255
|
+
|
|
5256
|
+
reportFilter = {
|
|
5257
|
+
_path: Repzo._end_points.REPORT_FILTER,
|
|
5258
|
+
find: async (
|
|
5259
|
+
params?: Service.ReportFilter.Find.Params,
|
|
5260
|
+
): Promise<Service.ReportFilter.Find.Result> => {
|
|
5261
|
+
let res: Service.ReportFilter.Find.Result = await this._fetch(
|
|
5262
|
+
this.svAPIEndpoint,
|
|
5263
|
+
this.reportFilter._path,
|
|
5264
|
+
params,
|
|
5265
|
+
);
|
|
5266
|
+
return res;
|
|
5267
|
+
},
|
|
5268
|
+
|
|
5269
|
+
get: async (
|
|
5270
|
+
id: Service.ReportFilter.Get.ID,
|
|
5271
|
+
params?: Service.ReportFilter.Get.Params,
|
|
5272
|
+
): Promise<Service.ReportFilter.Get.Result> => {
|
|
5273
|
+
return await this._fetch(
|
|
5274
|
+
this.svAPIEndpoint,
|
|
5275
|
+
this.reportFilter._path + `/${id}`,
|
|
5276
|
+
params,
|
|
5277
|
+
);
|
|
5278
|
+
},
|
|
5279
|
+
|
|
5280
|
+
create: async (
|
|
5281
|
+
body: Service.ReportFilter.Create.Body,
|
|
5282
|
+
): Promise<Service.ReportFilter.Create.Result> => {
|
|
5283
|
+
let res = await this._create(
|
|
5284
|
+
this.svAPIEndpoint,
|
|
5285
|
+
this.reportFilter._path,
|
|
5286
|
+
body,
|
|
5287
|
+
);
|
|
5288
|
+
return res;
|
|
5289
|
+
},
|
|
5290
|
+
|
|
5291
|
+
update: async (
|
|
5292
|
+
id: Service.ReportFilter.Update.ID,
|
|
5293
|
+
body: Service.ReportFilter.Update.Body,
|
|
5294
|
+
): Promise<Service.ReportFilter.Update.Result> => {
|
|
5295
|
+
let res: Service.ReportFilter.Update.Result = await this._update(
|
|
5296
|
+
this.svAPIEndpoint,
|
|
5297
|
+
this.reportFilter._path + `/${id}`,
|
|
5298
|
+
body,
|
|
5299
|
+
);
|
|
5300
|
+
return res;
|
|
5301
|
+
},
|
|
5302
|
+
};
|
|
5254
5303
|
}
|
|
5255
5304
|
|
|
5256
5305
|
function normalizeParams(params: Params): { [key: string]: any } {
|
package/src/types/index.ts
CHANGED
|
@@ -18207,6 +18207,176 @@ export namespace Service {
|
|
|
18207
18207
|
export type Result = Data;
|
|
18208
18208
|
}
|
|
18209
18209
|
}
|
|
18210
|
+
|
|
18211
|
+
export namespace ReportFilter {
|
|
18212
|
+
export type AccumulatorOperator =
|
|
18213
|
+
| "sum"
|
|
18214
|
+
| "count"
|
|
18215
|
+
| "avg"
|
|
18216
|
+
| "max"
|
|
18217
|
+
| "min"
|
|
18218
|
+
| "first"
|
|
18219
|
+
| "last"
|
|
18220
|
+
| "addToSet"
|
|
18221
|
+
| "push";
|
|
18222
|
+
|
|
18223
|
+
export type AccumulatorLabel =
|
|
18224
|
+
| "Sum"
|
|
18225
|
+
| "Count"
|
|
18226
|
+
| "Average"
|
|
18227
|
+
| "Max"
|
|
18228
|
+
| "Min"
|
|
18229
|
+
| "First"
|
|
18230
|
+
| "Last"
|
|
18231
|
+
| "Unique"
|
|
18232
|
+
| "ALL";
|
|
18233
|
+
|
|
18234
|
+
export interface Accumulator {
|
|
18235
|
+
operator: AccumulatorOperator;
|
|
18236
|
+
label?: AccumulatorLabel;
|
|
18237
|
+
}
|
|
18238
|
+
|
|
18239
|
+
export interface Field {
|
|
18240
|
+
label: string;
|
|
18241
|
+
key: string;
|
|
18242
|
+
accumulator: Accumulator[];
|
|
18243
|
+
}
|
|
18244
|
+
|
|
18245
|
+
export interface GroupData {
|
|
18246
|
+
id_label: string;
|
|
18247
|
+
id: string;
|
|
18248
|
+
fields: Field[];
|
|
18249
|
+
}
|
|
18250
|
+
|
|
18251
|
+
export interface StaticData {
|
|
18252
|
+
label: string;
|
|
18253
|
+
value: string;
|
|
18254
|
+
}
|
|
18255
|
+
|
|
18256
|
+
export type DataType = "string" | "number" | "array" | "boolean";
|
|
18257
|
+
|
|
18258
|
+
export type InputType =
|
|
18259
|
+
| "string"
|
|
18260
|
+
| "list"
|
|
18261
|
+
| "checkbox"
|
|
18262
|
+
| "date"
|
|
18263
|
+
| "number"
|
|
18264
|
+
| "date_range"
|
|
18265
|
+
| "number_range"
|
|
18266
|
+
| "group_by";
|
|
18267
|
+
|
|
18268
|
+
export type Operator =
|
|
18269
|
+
| "eq"
|
|
18270
|
+
| "ne"
|
|
18271
|
+
| "gt"
|
|
18272
|
+
| "lt"
|
|
18273
|
+
| "gte"
|
|
18274
|
+
| "lte"
|
|
18275
|
+
| "in"
|
|
18276
|
+
| "nin"
|
|
18277
|
+
| "between"
|
|
18278
|
+
| "today"
|
|
18279
|
+
| "yesterday"
|
|
18280
|
+
| "last_seven_days"
|
|
18281
|
+
| "last_thirty_days"
|
|
18282
|
+
| "last_month"
|
|
18283
|
+
| "last_three_months"
|
|
18284
|
+
| "last_six_months"
|
|
18285
|
+
| "last_twelve_months";
|
|
18286
|
+
|
|
18287
|
+
export type DateFormat =
|
|
18288
|
+
| "s"
|
|
18289
|
+
| "YYYY-MM-DD"
|
|
18290
|
+
| "YYYY-MM-DD HH:mm:ssZ"
|
|
18291
|
+
| "ISO";
|
|
18292
|
+
|
|
18293
|
+
export interface Data {
|
|
18294
|
+
_id: string;
|
|
18295
|
+
label: string;
|
|
18296
|
+
key: string;
|
|
18297
|
+
render_key: string;
|
|
18298
|
+
filter_key: string;
|
|
18299
|
+
is_multi_select?: boolean;
|
|
18300
|
+
is_static?: boolean;
|
|
18301
|
+
type: DataType;
|
|
18302
|
+
input_type: InputType;
|
|
18303
|
+
operators?: Operator[];
|
|
18304
|
+
date_format?: DateFormat;
|
|
18305
|
+
searchable?: boolean;
|
|
18306
|
+
report_types: ReportType[];
|
|
18307
|
+
endpoint?: string;
|
|
18308
|
+
static_data?: StaticData[];
|
|
18309
|
+
group_data: GroupData[];
|
|
18310
|
+
createdAt?: Date;
|
|
18311
|
+
updatedAt?: Date;
|
|
18312
|
+
}
|
|
18313
|
+
|
|
18314
|
+
export interface CreateBody {
|
|
18315
|
+
label: string;
|
|
18316
|
+
key: string;
|
|
18317
|
+
render_key: string;
|
|
18318
|
+
filter_key: string;
|
|
18319
|
+
report_types: ReportType[];
|
|
18320
|
+
type: DataType;
|
|
18321
|
+
input_type: InputType;
|
|
18322
|
+
is_multi_select?: boolean;
|
|
18323
|
+
is_static?: boolean;
|
|
18324
|
+
operators?: Operator[];
|
|
18325
|
+
date_format?: DateFormat;
|
|
18326
|
+
searchable?: boolean;
|
|
18327
|
+
endpoint?: string;
|
|
18328
|
+
static_data?: StaticData[];
|
|
18329
|
+
group_data: GroupData[];
|
|
18330
|
+
}
|
|
18331
|
+
|
|
18332
|
+
export interface UpdateBody {
|
|
18333
|
+
label?: string;
|
|
18334
|
+
key?: string;
|
|
18335
|
+
render_key?: string;
|
|
18336
|
+
filter_key?: string;
|
|
18337
|
+
report_types?: ReportType[];
|
|
18338
|
+
type?: DataType;
|
|
18339
|
+
input_type?: InputType;
|
|
18340
|
+
is_multi_select?: boolean;
|
|
18341
|
+
is_static?: boolean;
|
|
18342
|
+
operators?: Operator[];
|
|
18343
|
+
date_format?: DateFormat;
|
|
18344
|
+
searchable?: boolean;
|
|
18345
|
+
endpoint?: string;
|
|
18346
|
+
static_data?: StaticData[];
|
|
18347
|
+
group_data: GroupData[];
|
|
18348
|
+
}
|
|
18349
|
+
|
|
18350
|
+
export namespace Find {
|
|
18351
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
18352
|
+
report_types?: ReportType | ReportType[];
|
|
18353
|
+
from_createdAt?: Date;
|
|
18354
|
+
to_updatedAt?: Date;
|
|
18355
|
+
search?: string;
|
|
18356
|
+
};
|
|
18357
|
+
|
|
18358
|
+
export interface Result extends DefaultPaginationResult {
|
|
18359
|
+
data: Data[];
|
|
18360
|
+
}
|
|
18361
|
+
}
|
|
18362
|
+
|
|
18363
|
+
export namespace Get {
|
|
18364
|
+
export type ID = StringId;
|
|
18365
|
+
export type Params = {};
|
|
18366
|
+
export type Result = Data;
|
|
18367
|
+
}
|
|
18368
|
+
|
|
18369
|
+
export namespace Create {
|
|
18370
|
+
export type Body = CreateBody;
|
|
18371
|
+
export type Result = Data;
|
|
18372
|
+
}
|
|
18373
|
+
|
|
18374
|
+
export namespace Update {
|
|
18375
|
+
export type ID = StringId;
|
|
18376
|
+
export type Body = Partial<UpdateBody>;
|
|
18377
|
+
export type Result = Data;
|
|
18378
|
+
}
|
|
18379
|
+
}
|
|
18210
18380
|
}
|
|
18211
18381
|
|
|
18212
18382
|
export type StringId = string;
|