repzo 1.0.270 → 1.0.273
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 +17 -0
- package/lib/index.js +35 -0
- package/lib/types/index.d.ts +130 -13
- package/package.json +1 -1
- package/src/index.ts +82 -0
- package/src/types/index.ts +178 -14
package/lib/index.d.ts
CHANGED
|
@@ -133,6 +133,8 @@ export declare const end_points: {
|
|
|
133
133
|
readonly DATA_FILE_WAREHOUSE: "data-file-warehouse";
|
|
134
134
|
readonly DATA_SESSION: "data-session";
|
|
135
135
|
readonly ADMIN: "admin";
|
|
136
|
+
readonly JOB_CATEGORY: "job-category";
|
|
137
|
+
readonly JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze";
|
|
136
138
|
};
|
|
137
139
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
138
140
|
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"];
|
|
@@ -281,6 +283,8 @@ export default class Repzo {
|
|
|
281
283
|
readonly DATA_FILE_WAREHOUSE: "data-file-warehouse";
|
|
282
284
|
readonly DATA_SESSION: "data-session";
|
|
283
285
|
readonly ADMIN: "admin";
|
|
286
|
+
readonly JOB_CATEGORY: "job-category";
|
|
287
|
+
readonly JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze";
|
|
284
288
|
};
|
|
285
289
|
private _retryRequest;
|
|
286
290
|
private _fetch;
|
|
@@ -1248,6 +1252,7 @@ export default class Repzo {
|
|
|
1248
1252
|
get: (id: Service.ActivityFormV2Result.Get.ID, params?: Service.ActivityFormV2Result.Get.Params) => Promise<Service.ActivityFormV2Result.Get.Result>;
|
|
1249
1253
|
create: (body: Service.ActivityFormV2Result.Create.Body) => Promise<Service.ActivityFormV2Result.Create.Result>;
|
|
1250
1254
|
update: (id: Service.ActivityFormV2Result.Update.ID, body: Service.ActivityFormV2Result.Update.Body) => Promise<Service.ActivityFormV2Result.Update.Result>;
|
|
1255
|
+
patch: (params: Service.ActivityFormV2Result.Patch.Params, body: Service.ActivityFormV2Result.Patch.Body) => Promise<Service.ActivityFormV2Result.Patch.Result>;
|
|
1251
1256
|
};
|
|
1252
1257
|
lineClassification: {
|
|
1253
1258
|
_path: "line-classification";
|
|
@@ -1308,4 +1313,16 @@ export default class Repzo {
|
|
|
1308
1313
|
globalize: (id: Service.Admin.Globalize.ID) => Promise<Service.Admin.Globalize.Result>;
|
|
1309
1314
|
remove: (id: Service.Admin.Update.ID) => Promise<Service.Admin.Remove.Result>;
|
|
1310
1315
|
};
|
|
1316
|
+
jobCategory: {
|
|
1317
|
+
_path: "job-category";
|
|
1318
|
+
find: (params?: Service.JobCategory.Find.Params) => Promise<Service.JobCategory.Find.Result>;
|
|
1319
|
+
get: (id: Service.JobCategory.Get.ID, params?: Service.JobCategory.Get.Params) => Promise<Service.JobCategory.Get.Result>;
|
|
1320
|
+
create: (body: Service.JobCategory.Create.Body) => Promise<Service.JobCategory.Create.Result>;
|
|
1321
|
+
update: (id: Service.JobCategory.Update.ID, body: Service.JobCategory.Update.Body) => Promise<Service.JobCategory.Update.Result>;
|
|
1322
|
+
remove: (id: Service.JobCategory.Remove.ID) => Promise<Service.JobCategory.Remove.Result>;
|
|
1323
|
+
};
|
|
1324
|
+
jobCategoryAutoSkipAnalyze: {
|
|
1325
|
+
_path: "job-category-autoskip-analyze";
|
|
1326
|
+
create: (body: Service.JobCategoryAutoSkipAnalyze.Create.Body) => Promise<Service.JobCategoryAutoSkipAnalyze.Create.Result>;
|
|
1327
|
+
};
|
|
1311
1328
|
}
|
package/lib/index.js
CHANGED
|
@@ -135,6 +135,8 @@ export const end_points = {
|
|
|
135
135
|
DATA_FILE_WAREHOUSE: "data-file-warehouse",
|
|
136
136
|
DATA_SESSION: "data-session",
|
|
137
137
|
ADMIN: "admin",
|
|
138
|
+
JOB_CATEGORY: "job-category",
|
|
139
|
+
JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze",
|
|
138
140
|
};
|
|
139
141
|
export const availableService = [
|
|
140
142
|
"client",
|
|
@@ -2548,6 +2550,10 @@ class Repzo {
|
|
|
2548
2550
|
let res = await this._update(this.svAPIEndpoint, this.activityFormV2Result._path + `/${id}`, body);
|
|
2549
2551
|
return res;
|
|
2550
2552
|
},
|
|
2553
|
+
patch: async (params, body) => {
|
|
2554
|
+
let res = await this._patch(this.svAPIEndpoint, this.activityFormV2Result._path, body, params);
|
|
2555
|
+
return res;
|
|
2556
|
+
},
|
|
2551
2557
|
};
|
|
2552
2558
|
this.lineClassification = {
|
|
2553
2559
|
_path: Repzo._end_points.LINE_CLASSIFICATION,
|
|
@@ -2715,6 +2721,35 @@ class Repzo {
|
|
|
2715
2721
|
return res;
|
|
2716
2722
|
},
|
|
2717
2723
|
};
|
|
2724
|
+
this.jobCategory = {
|
|
2725
|
+
_path: Repzo._end_points.JOB_CATEGORY,
|
|
2726
|
+
find: async (params) => {
|
|
2727
|
+
let res = await this._fetch(this.svAPIEndpoint, this.jobCategory._path, params);
|
|
2728
|
+
return res;
|
|
2729
|
+
},
|
|
2730
|
+
get: async (id, params) => {
|
|
2731
|
+
return await this._fetch(this.svAPIEndpoint, this.jobCategory._path + `/${id}`, params);
|
|
2732
|
+
},
|
|
2733
|
+
create: async (body) => {
|
|
2734
|
+
let res = await this._create(this.svAPIEndpoint, this.jobCategory._path, body);
|
|
2735
|
+
return res;
|
|
2736
|
+
},
|
|
2737
|
+
update: async (id, body) => {
|
|
2738
|
+
let res = await this._update(this.svAPIEndpoint, this.jobCategory._path + `/${id}`, body);
|
|
2739
|
+
return res;
|
|
2740
|
+
},
|
|
2741
|
+
remove: async (id) => {
|
|
2742
|
+
let res = await this._delete(this.svAPIEndpoint, this.jobCategory._path + `/${id}`);
|
|
2743
|
+
return res;
|
|
2744
|
+
},
|
|
2745
|
+
};
|
|
2746
|
+
this.jobCategoryAutoSkipAnalyze = {
|
|
2747
|
+
_path: Repzo._end_points.JOB_CATEGORY_AUTOSKIP_ANALYZE,
|
|
2748
|
+
create: async (body) => {
|
|
2749
|
+
let res = await this._create(this.svAPIEndpoint, this.jobCategoryAutoSkipAnalyze._path, body);
|
|
2750
|
+
return res;
|
|
2751
|
+
},
|
|
2752
|
+
};
|
|
2718
2753
|
this.svAPIEndpoint =
|
|
2719
2754
|
!options?.env || options?.env == "production"
|
|
2720
2755
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2909,17 +2909,21 @@ export declare namespace Service {
|
|
|
2909
2909
|
}
|
|
2910
2910
|
namespace JobCategory {
|
|
2911
2911
|
interface JobSchema {
|
|
2912
|
-
|
|
2912
|
+
_id?: StringId;
|
|
2913
|
+
type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
|
2913
2914
|
description: string;
|
|
2914
|
-
tag?:
|
|
2915
|
-
product_id?:
|
|
2916
|
-
form_id?:
|
|
2917
|
-
msl_id?:
|
|
2915
|
+
tag?: StringId | Tag.TagSchema;
|
|
2916
|
+
product_id?: StringId;
|
|
2917
|
+
form_id?: StringId;
|
|
2918
|
+
msl_id?: StringId;
|
|
2919
|
+
template_id?: StringId;
|
|
2920
|
+
formV2_id?: StringId;
|
|
2918
2921
|
is_required: boolean;
|
|
2919
2922
|
order: number;
|
|
2920
2923
|
}
|
|
2924
|
+
export type AutoSkipActivitySlugs = "activity-ai-sales-order" | "ocr-invoice-job-group" | "activity-audit" | "activity-availability" | "activity-checkout-display" | "activity-form-result" | "activity-form-v2-result" | "activity-item-status" | "activity-note" | "activity-photo" | "activity-planogram" | "activity-secondary-display" | "activity-shelfshare" | "activity-storecheck" | "activity-task" | "approval-request" | "asset-part-receival" | "asset-part-transfer" | "clicks" | "clm-feedback-activity" | "fullinvoices" | "payments" | "proforma" | "refund" | "return-asset-part-unit" | "store-asset-part-unit";
|
|
2921
2925
|
export interface JobCategorySchema {
|
|
2922
|
-
_id:
|
|
2926
|
+
_id: StringId;
|
|
2923
2927
|
en_name: string;
|
|
2924
2928
|
ar_name?: string;
|
|
2925
2929
|
from_date: number;
|
|
@@ -2930,12 +2934,93 @@ export declare namespace Service {
|
|
|
2930
2934
|
jobs: JobSchema[];
|
|
2931
2935
|
disabled?: boolean;
|
|
2932
2936
|
company_namespace: string[];
|
|
2937
|
+
enable_auto_skip_conditions?: boolean;
|
|
2938
|
+
auto_skip_conditions?: {
|
|
2939
|
+
enable_auto_skip_interval_conditions?: boolean;
|
|
2940
|
+
occurrences_per_interval?: number;
|
|
2941
|
+
interval?: "day" | "week" | "month" | "year" | "life_time" | "last_30_days";
|
|
2942
|
+
per_client?: boolean;
|
|
2943
|
+
per_rep?: boolean;
|
|
2944
|
+
enable_auto_skip_excluded_clients?: boolean;
|
|
2945
|
+
excluded_clients?: StringId[];
|
|
2946
|
+
enable_auto_skip_calendar_days?: boolean;
|
|
2947
|
+
skip_if_calendar_day_is_less_than?: number;
|
|
2948
|
+
skip_if_calendar_day_is_more_than?: number;
|
|
2949
|
+
enable_auto_skip_activity_existence?: boolean;
|
|
2950
|
+
auto_skip_activity_slugs?: AutoSkipActivitySlugs[];
|
|
2951
|
+
};
|
|
2933
2952
|
createdAt: string;
|
|
2934
2953
|
updatedAt: string;
|
|
2935
2954
|
__v: number;
|
|
2936
2955
|
}
|
|
2956
|
+
export type Data = JobCategorySchema;
|
|
2957
|
+
export type PopulatedDoc = Data & {
|
|
2958
|
+
jobs: (JobSchema & {
|
|
2959
|
+
tag?: string | Tag.TagSchema;
|
|
2960
|
+
})[];
|
|
2961
|
+
auto_skip_conditions?: Data["auto_skip_conditions"] & {
|
|
2962
|
+
excluded_clients?: (string | Client.ClientSchema)[];
|
|
2963
|
+
};
|
|
2964
|
+
};
|
|
2965
|
+
type CreateBody = Omit<Data, "_id" | "createdAt" | "updatedAt" | "__v">;
|
|
2966
|
+
type PopulatedKeys = "jobs.tag" | "auto_skip_conditions.excluded_clients";
|
|
2967
|
+
export namespace Find {
|
|
2968
|
+
type Params = DefaultPaginationQueryParams & {
|
|
2969
|
+
_id?: string[] | string;
|
|
2970
|
+
search?: string;
|
|
2971
|
+
disabled?: boolean;
|
|
2972
|
+
en_name?: string[] | string;
|
|
2973
|
+
from_updatedAt?: number;
|
|
2974
|
+
to_updatedAt?: number;
|
|
2975
|
+
from__id?: string;
|
|
2976
|
+
to__id?: string;
|
|
2977
|
+
populatedKeys?: PopulatedKeys[];
|
|
2978
|
+
[key: string]: any;
|
|
2979
|
+
};
|
|
2980
|
+
interface Result extends DefaultPaginationResult {
|
|
2981
|
+
data: PopulatedDoc[];
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
export namespace Get {
|
|
2985
|
+
type ID = string;
|
|
2986
|
+
type Params = {
|
|
2987
|
+
populatedKeys?: PopulatedKeys[];
|
|
2988
|
+
};
|
|
2989
|
+
type Result = PopulatedDoc;
|
|
2990
|
+
}
|
|
2991
|
+
export namespace Create {
|
|
2992
|
+
type Body = CreateBody;
|
|
2993
|
+
type Result = Data;
|
|
2994
|
+
}
|
|
2995
|
+
export namespace Update {
|
|
2996
|
+
type ID = StringId;
|
|
2997
|
+
type Body = Partial<Data>;
|
|
2998
|
+
type Result = Data;
|
|
2999
|
+
}
|
|
3000
|
+
export namespace Remove {
|
|
3001
|
+
type ID = string;
|
|
3002
|
+
type Result = Data;
|
|
3003
|
+
}
|
|
2937
3004
|
export {};
|
|
2938
3005
|
}
|
|
3006
|
+
namespace JobCategoryAutoSkipAnalyze {
|
|
3007
|
+
interface Data {
|
|
3008
|
+
client: StringId;
|
|
3009
|
+
rep?: StringId;
|
|
3010
|
+
visit_id?: string;
|
|
3011
|
+
job_category: (JobCategory.Data & {
|
|
3012
|
+
skipped?: boolean;
|
|
3013
|
+
jobs: (JobCategory.Data["jobs"][0] & {
|
|
3014
|
+
skipped?: boolean;
|
|
3015
|
+
})[];
|
|
3016
|
+
})[];
|
|
3017
|
+
company_namespace: string[];
|
|
3018
|
+
}
|
|
3019
|
+
namespace Create {
|
|
3020
|
+
type Body = Data;
|
|
3021
|
+
type Result = Data;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
2939
3024
|
namespace Tag {
|
|
2940
3025
|
type TagType = "photo" | "client" | "area" | "price";
|
|
2941
3026
|
export interface TagSchema {
|
|
@@ -7176,7 +7261,7 @@ export declare namespace Service {
|
|
|
7176
7261
|
field: "_id";
|
|
7177
7262
|
type: "asc" | "desc";
|
|
7178
7263
|
}[];
|
|
7179
|
-
nodeCycles?:
|
|
7264
|
+
nodeCycles?: StringId[] | StringId;
|
|
7180
7265
|
withCycle?: boolean;
|
|
7181
7266
|
conversion_status?: "converted" | "not_converted" | "all";
|
|
7182
7267
|
};
|
|
@@ -8218,7 +8303,7 @@ export declare namespace Service {
|
|
|
8218
8303
|
name: string;
|
|
8219
8304
|
disabled: boolean;
|
|
8220
8305
|
company_namespace: string[];
|
|
8221
|
-
type: "proforma" | "transfer" | "approval-request" | "receiving-material" | "asset-part-transfer" | "adjust-inventory" | "return-asset-part-unit" | "store-asset-part-unit";
|
|
8306
|
+
type: "proforma" | "transfer" | "approval-request" | "receiving-material" | "asset-part-transfer" | "adjust-inventory" | "return-asset-part-unit" | "store-asset-part-unit" | "activity-form-v2-result";
|
|
8222
8307
|
position?: number;
|
|
8223
8308
|
description?: string;
|
|
8224
8309
|
rules: {
|
|
@@ -8248,7 +8333,7 @@ export declare namespace Service {
|
|
|
8248
8333
|
}
|
|
8249
8334
|
export interface CreateBody {
|
|
8250
8335
|
name: string;
|
|
8251
|
-
type: "proforma" | "transfer" | "approval-request" | "receiving-material" | "asset-part-transfer" | "adjust-inventory" | "return-asset-part-unit" | "store-asset-part-unit";
|
|
8336
|
+
type: "proforma" | "transfer" | "approval-request" | "receiving-material" | "asset-part-transfer" | "adjust-inventory" | "return-asset-part-unit" | "store-asset-part-unit" | "activity-form-v2-result";
|
|
8252
8337
|
creator?: AdminCreator;
|
|
8253
8338
|
disabled?: boolean;
|
|
8254
8339
|
company_namespace?: string[];
|
|
@@ -8290,7 +8375,7 @@ export declare namespace Service {
|
|
|
8290
8375
|
name?: string;
|
|
8291
8376
|
disabled?: boolean;
|
|
8292
8377
|
company_namespace?: string[];
|
|
8293
|
-
type?: "proforma" | "transfer" | "approval-request" | "receiving-material" | "asset-part-transfer" | "adjust-inventory" | "return-asset-part-unit" | "store-asset-part-unit";
|
|
8378
|
+
type?: "proforma" | "transfer" | "approval-request" | "receiving-material" | "asset-part-transfer" | "adjust-inventory" | "return-asset-part-unit" | "store-asset-part-unit" | "activity-form-v2-result";
|
|
8294
8379
|
position?: number;
|
|
8295
8380
|
description?: string;
|
|
8296
8381
|
rules?: {
|
|
@@ -8383,7 +8468,7 @@ export declare namespace Service {
|
|
|
8383
8468
|
type CycleStatus = "pending" | "approved" | "processing" | "rejected";
|
|
8384
8469
|
export interface Schema {
|
|
8385
8470
|
_id: string;
|
|
8386
|
-
document_type: "proforma" | "transfer" | "approval-request" | "receiving-material" | "asset-part-transfer" | "adjust-inventory" | "return-asset-part-unit" | "store-asset-part-unit";
|
|
8471
|
+
document_type: "proforma" | "transfer" | "approval-request" | "receiving-material" | "asset-part-transfer" | "adjust-inventory" | "return-asset-part-unit" | "store-asset-part-unit" | "activity-form-v2-result";
|
|
8387
8472
|
document_id: string;
|
|
8388
8473
|
status: CycleStatus;
|
|
8389
8474
|
node?: AdminCreator | RepCreator | ClientCreator;
|
|
@@ -8582,7 +8667,7 @@ export declare namespace Service {
|
|
|
8582
8667
|
status?: TransferStatus | TransferStatus[];
|
|
8583
8668
|
custom_status?: string[] | string;
|
|
8584
8669
|
creator?: string[] | string;
|
|
8585
|
-
nodeCycles?:
|
|
8670
|
+
nodeCycles?: StringId[] | StringId;
|
|
8586
8671
|
from__id?: string;
|
|
8587
8672
|
to__id?: string;
|
|
8588
8673
|
populatedKeys?: PopulatedKeys[];
|
|
@@ -18019,6 +18104,7 @@ export declare namespace Service {
|
|
|
18019
18104
|
route?: StringId;
|
|
18020
18105
|
workorder?: StringId;
|
|
18021
18106
|
sync_id: string;
|
|
18107
|
+
status?: "pending" | "approved" | "processing" | "rejected";
|
|
18022
18108
|
geo_tag?: GeoTag;
|
|
18023
18109
|
geoPoint?: GeoPoint;
|
|
18024
18110
|
platform?: string;
|
|
@@ -18078,6 +18164,7 @@ export declare namespace Service {
|
|
|
18078
18164
|
results: DivisionResult[];
|
|
18079
18165
|
score?: number;
|
|
18080
18166
|
is_completed?: boolean;
|
|
18167
|
+
status?: "pending" | "approved" | "processing" | "rejected";
|
|
18081
18168
|
company_namespace?: string[];
|
|
18082
18169
|
}
|
|
18083
18170
|
export type UpdateBody = Partial<Data>;
|
|
@@ -18087,6 +18174,7 @@ export declare namespace Service {
|
|
|
18087
18174
|
photo_media_populated?: PopulatedMediaStorage & {
|
|
18088
18175
|
ContentLength?: number;
|
|
18089
18176
|
};
|
|
18177
|
+
cycle?: Cycle.Data;
|
|
18090
18178
|
};
|
|
18091
18179
|
type PopulatedKeys = "custom_list" | "client" | "workorder" | "visit" | "route" | "form_id" | "teams" | "tags" | "media";
|
|
18092
18180
|
export namespace Find {
|
|
@@ -18113,6 +18201,9 @@ export declare namespace Service {
|
|
|
18113
18201
|
visit?: StringId | StringId[];
|
|
18114
18202
|
workorder?: StringId | StringId[];
|
|
18115
18203
|
"serial_number.formatted"?: string | string[];
|
|
18204
|
+
status?: Data["status"] | Data["status"][];
|
|
18205
|
+
nodeCycles?: StringId[] | StringId;
|
|
18206
|
+
withCycle?: boolean;
|
|
18116
18207
|
};
|
|
18117
18208
|
interface Result extends DefaultPaginationResult {
|
|
18118
18209
|
data: PopulatedDoc[];
|
|
@@ -18122,6 +18213,7 @@ export declare namespace Service {
|
|
|
18122
18213
|
type ID = string;
|
|
18123
18214
|
type Params = {
|
|
18124
18215
|
populatedKeys?: PopulatedKeys[];
|
|
18216
|
+
withCycle?: boolean;
|
|
18125
18217
|
};
|
|
18126
18218
|
type Result = PopulatedDoc & {
|
|
18127
18219
|
can_edit_types?: boolean;
|
|
@@ -18133,9 +18225,34 @@ export declare namespace Service {
|
|
|
18133
18225
|
}
|
|
18134
18226
|
export namespace Update {
|
|
18135
18227
|
type ID = StringId;
|
|
18136
|
-
type Body = UpdateBody
|
|
18228
|
+
type Body = UpdateBody & {
|
|
18229
|
+
isResubmitted?: boolean;
|
|
18230
|
+
note?: string;
|
|
18231
|
+
stage?: number;
|
|
18232
|
+
};
|
|
18137
18233
|
type Result = Data;
|
|
18138
18234
|
}
|
|
18235
|
+
export namespace Patch {
|
|
18236
|
+
type Params = {
|
|
18237
|
+
updateStatus: true;
|
|
18238
|
+
};
|
|
18239
|
+
type Body = {
|
|
18240
|
+
readQuery: [{
|
|
18241
|
+
key: "_id";
|
|
18242
|
+
operator: "in";
|
|
18243
|
+
value: StringId[];
|
|
18244
|
+
}];
|
|
18245
|
+
writeQuery: {
|
|
18246
|
+
key: "status";
|
|
18247
|
+
command: "set";
|
|
18248
|
+
value: "approved" | "rejected";
|
|
18249
|
+
};
|
|
18250
|
+
};
|
|
18251
|
+
type Result = {
|
|
18252
|
+
nFound: number;
|
|
18253
|
+
nModified: number;
|
|
18254
|
+
};
|
|
18255
|
+
}
|
|
18139
18256
|
export {};
|
|
18140
18257
|
}
|
|
18141
18258
|
namespace LineClassification {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -145,6 +145,8 @@ export const end_points = {
|
|
|
145
145
|
DATA_FILE_WAREHOUSE: "data-file-warehouse",
|
|
146
146
|
DATA_SESSION: "data-session",
|
|
147
147
|
ADMIN: "admin",
|
|
148
|
+
JOB_CATEGORY: "job-category",
|
|
149
|
+
JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze",
|
|
148
150
|
} as const;
|
|
149
151
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
150
152
|
|
|
@@ -6417,6 +6419,18 @@ export default class Repzo {
|
|
|
6417
6419
|
);
|
|
6418
6420
|
return res;
|
|
6419
6421
|
},
|
|
6422
|
+
patch: async (
|
|
6423
|
+
params: Service.ActivityFormV2Result.Patch.Params,
|
|
6424
|
+
body: Service.ActivityFormV2Result.Patch.Body,
|
|
6425
|
+
): Promise<Service.ActivityFormV2Result.Patch.Result> => {
|
|
6426
|
+
let res: Service.ActivityFormV2Result.Patch.Result = await this._patch(
|
|
6427
|
+
this.svAPIEndpoint,
|
|
6428
|
+
this.activityFormV2Result._path,
|
|
6429
|
+
body,
|
|
6430
|
+
params,
|
|
6431
|
+
);
|
|
6432
|
+
return res;
|
|
6433
|
+
},
|
|
6420
6434
|
};
|
|
6421
6435
|
|
|
6422
6436
|
lineClassification = {
|
|
@@ -6819,6 +6833,74 @@ export default class Repzo {
|
|
|
6819
6833
|
return res;
|
|
6820
6834
|
},
|
|
6821
6835
|
};
|
|
6836
|
+
|
|
6837
|
+
jobCategory = {
|
|
6838
|
+
_path: Repzo._end_points.JOB_CATEGORY,
|
|
6839
|
+
find: async (
|
|
6840
|
+
params?: Service.JobCategory.Find.Params,
|
|
6841
|
+
): Promise<Service.JobCategory.Find.Result> => {
|
|
6842
|
+
let res: Service.JobCategory.Find.Result = await this._fetch(
|
|
6843
|
+
this.svAPIEndpoint,
|
|
6844
|
+
this.jobCategory._path,
|
|
6845
|
+
params,
|
|
6846
|
+
);
|
|
6847
|
+
return res;
|
|
6848
|
+
},
|
|
6849
|
+
get: async (
|
|
6850
|
+
id: Service.JobCategory.Get.ID,
|
|
6851
|
+
params?: Service.JobCategory.Get.Params,
|
|
6852
|
+
): Promise<Service.JobCategory.Get.Result> => {
|
|
6853
|
+
return await this._fetch(
|
|
6854
|
+
this.svAPIEndpoint,
|
|
6855
|
+
this.jobCategory._path + `/${id}`,
|
|
6856
|
+
params,
|
|
6857
|
+
);
|
|
6858
|
+
},
|
|
6859
|
+
create: async (
|
|
6860
|
+
body: Service.JobCategory.Create.Body,
|
|
6861
|
+
): Promise<Service.JobCategory.Create.Result> => {
|
|
6862
|
+
let res = await this._create(
|
|
6863
|
+
this.svAPIEndpoint,
|
|
6864
|
+
this.jobCategory._path,
|
|
6865
|
+
body,
|
|
6866
|
+
);
|
|
6867
|
+
return res;
|
|
6868
|
+
},
|
|
6869
|
+
update: async (
|
|
6870
|
+
id: Service.JobCategory.Update.ID,
|
|
6871
|
+
body: Service.JobCategory.Update.Body,
|
|
6872
|
+
): Promise<Service.JobCategory.Update.Result> => {
|
|
6873
|
+
let res: Service.JobCategory.Update.Result = await this._update(
|
|
6874
|
+
this.svAPIEndpoint,
|
|
6875
|
+
this.jobCategory._path + `/${id}`,
|
|
6876
|
+
body,
|
|
6877
|
+
);
|
|
6878
|
+
return res;
|
|
6879
|
+
},
|
|
6880
|
+
remove: async (
|
|
6881
|
+
id: Service.JobCategory.Remove.ID,
|
|
6882
|
+
): Promise<Service.JobCategory.Remove.Result> => {
|
|
6883
|
+
let res: Service.JobCategory.Remove.Result = await this._delete(
|
|
6884
|
+
this.svAPIEndpoint,
|
|
6885
|
+
this.jobCategory._path + `/${id}`,
|
|
6886
|
+
);
|
|
6887
|
+
return res;
|
|
6888
|
+
},
|
|
6889
|
+
};
|
|
6890
|
+
|
|
6891
|
+
jobCategoryAutoSkipAnalyze = {
|
|
6892
|
+
_path: Repzo._end_points.JOB_CATEGORY_AUTOSKIP_ANALYZE,
|
|
6893
|
+
create: async (
|
|
6894
|
+
body: Service.JobCategoryAutoSkipAnalyze.Create.Body,
|
|
6895
|
+
): Promise<Service.JobCategoryAutoSkipAnalyze.Create.Result> => {
|
|
6896
|
+
let res = await this._create(
|
|
6897
|
+
this.svAPIEndpoint,
|
|
6898
|
+
this.jobCategoryAutoSkipAnalyze._path,
|
|
6899
|
+
body,
|
|
6900
|
+
);
|
|
6901
|
+
return res;
|
|
6902
|
+
},
|
|
6903
|
+
};
|
|
6822
6904
|
}
|
|
6823
6905
|
|
|
6824
6906
|
function normalizeParams(params: Params): { [key: string]: any } {
|
package/src/types/index.ts
CHANGED
|
@@ -3409,18 +3409,66 @@ export namespace Service {
|
|
|
3409
3409
|
}
|
|
3410
3410
|
|
|
3411
3411
|
export namespace JobCategory {
|
|
3412
|
+
/* type
|
|
3413
|
+
0 => task
|
|
3414
|
+
1 => photo,
|
|
3415
|
+
2 => note,
|
|
3416
|
+
3 => form,
|
|
3417
|
+
4 => audit,
|
|
3418
|
+
5 => availability,
|
|
3419
|
+
6 => return
|
|
3420
|
+
7 => shelf share
|
|
3421
|
+
8 => secondary
|
|
3422
|
+
9 => checkout
|
|
3423
|
+
10 => item-status
|
|
3424
|
+
11 => retail-execution
|
|
3425
|
+
12 => form-v2
|
|
3426
|
+
13 => planogram
|
|
3427
|
+
*/
|
|
3428
|
+
|
|
3412
3429
|
interface JobSchema {
|
|
3413
|
-
|
|
3430
|
+
_id?: StringId;
|
|
3431
|
+
type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
|
3414
3432
|
description: string;
|
|
3415
|
-
tag?:
|
|
3416
|
-
product_id?:
|
|
3417
|
-
form_id?:
|
|
3418
|
-
msl_id?:
|
|
3433
|
+
tag?: StringId | Tag.TagSchema;
|
|
3434
|
+
product_id?: StringId;
|
|
3435
|
+
form_id?: StringId;
|
|
3436
|
+
msl_id?: StringId;
|
|
3437
|
+
template_id?: StringId;
|
|
3438
|
+
formV2_id?: StringId;
|
|
3419
3439
|
is_required: boolean;
|
|
3420
3440
|
order: number;
|
|
3421
3441
|
}
|
|
3442
|
+
|
|
3443
|
+
export type AutoSkipActivitySlugs =
|
|
3444
|
+
| "activity-ai-sales-order"
|
|
3445
|
+
| "ocr-invoice-job-group"
|
|
3446
|
+
| "activity-audit"
|
|
3447
|
+
| "activity-availability"
|
|
3448
|
+
| "activity-checkout-display"
|
|
3449
|
+
| "activity-form-result"
|
|
3450
|
+
| "activity-form-v2-result"
|
|
3451
|
+
| "activity-item-status"
|
|
3452
|
+
| "activity-note"
|
|
3453
|
+
| "activity-photo"
|
|
3454
|
+
| "activity-planogram"
|
|
3455
|
+
| "activity-secondary-display"
|
|
3456
|
+
| "activity-shelfshare"
|
|
3457
|
+
| "activity-storecheck"
|
|
3458
|
+
| "activity-task"
|
|
3459
|
+
| "approval-request"
|
|
3460
|
+
| "asset-part-receival"
|
|
3461
|
+
| "asset-part-transfer"
|
|
3462
|
+
| "clicks"
|
|
3463
|
+
| "clm-feedback-activity"
|
|
3464
|
+
| "fullinvoices"
|
|
3465
|
+
| "payments"
|
|
3466
|
+
| "proforma"
|
|
3467
|
+
| "refund"
|
|
3468
|
+
| "return-asset-part-unit"
|
|
3469
|
+
| "store-asset-part-unit";
|
|
3422
3470
|
export interface JobCategorySchema {
|
|
3423
|
-
_id:
|
|
3471
|
+
_id: StringId;
|
|
3424
3472
|
en_name: string;
|
|
3425
3473
|
ar_name?: string;
|
|
3426
3474
|
from_date: number;
|
|
@@ -3431,10 +3479,97 @@ export namespace Service {
|
|
|
3431
3479
|
jobs: JobSchema[];
|
|
3432
3480
|
disabled?: boolean;
|
|
3433
3481
|
company_namespace: string[];
|
|
3482
|
+
enable_auto_skip_conditions?: boolean;
|
|
3483
|
+
auto_skip_conditions?: {
|
|
3484
|
+
enable_auto_skip_interval_conditions?: boolean;
|
|
3485
|
+
occurrences_per_interval?: number;
|
|
3486
|
+
interval?:
|
|
3487
|
+
| "day"
|
|
3488
|
+
| "week"
|
|
3489
|
+
| "month"
|
|
3490
|
+
| "year"
|
|
3491
|
+
| "life_time"
|
|
3492
|
+
| "last_30_days";
|
|
3493
|
+
per_client?: boolean;
|
|
3494
|
+
per_rep?: boolean;
|
|
3495
|
+
enable_auto_skip_excluded_clients?: boolean;
|
|
3496
|
+
excluded_clients?: StringId[];
|
|
3497
|
+
enable_auto_skip_calendar_days?: boolean;
|
|
3498
|
+
skip_if_calendar_day_is_less_than?: number; // (1-31)
|
|
3499
|
+
skip_if_calendar_day_is_more_than?: number; // (1-31)
|
|
3500
|
+
enable_auto_skip_activity_existence?: boolean;
|
|
3501
|
+
auto_skip_activity_slugs?: AutoSkipActivitySlugs[];
|
|
3502
|
+
};
|
|
3434
3503
|
createdAt: string;
|
|
3435
3504
|
updatedAt: string;
|
|
3436
3505
|
__v: number;
|
|
3437
3506
|
}
|
|
3507
|
+
|
|
3508
|
+
export type Data = JobCategorySchema;
|
|
3509
|
+
|
|
3510
|
+
export type PopulatedDoc = Data & {
|
|
3511
|
+
jobs: (JobSchema & { tag?: string | Tag.TagSchema })[];
|
|
3512
|
+
auto_skip_conditions?: Data["auto_skip_conditions"] & {
|
|
3513
|
+
excluded_clients?: (string | Client.ClientSchema)[];
|
|
3514
|
+
};
|
|
3515
|
+
};
|
|
3516
|
+
|
|
3517
|
+
type CreateBody = Omit<Data, "_id" | "createdAt" | "updatedAt" | "__v">;
|
|
3518
|
+
type PopulatedKeys = "jobs.tag" | "auto_skip_conditions.excluded_clients";
|
|
3519
|
+
|
|
3520
|
+
export namespace Find {
|
|
3521
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
3522
|
+
_id?: string[] | string;
|
|
3523
|
+
search?: string;
|
|
3524
|
+
disabled?: boolean;
|
|
3525
|
+
en_name?: string[] | string;
|
|
3526
|
+
from_updatedAt?: number;
|
|
3527
|
+
to_updatedAt?: number;
|
|
3528
|
+
from__id?: string;
|
|
3529
|
+
to__id?: string;
|
|
3530
|
+
populatedKeys?: PopulatedKeys[];
|
|
3531
|
+
[key: string]: any;
|
|
3532
|
+
};
|
|
3533
|
+
export interface Result extends DefaultPaginationResult {
|
|
3534
|
+
data: PopulatedDoc[];
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
export namespace Get {
|
|
3538
|
+
export type ID = string;
|
|
3539
|
+
export type Params = { populatedKeys?: PopulatedKeys[] };
|
|
3540
|
+
export type Result = PopulatedDoc;
|
|
3541
|
+
}
|
|
3542
|
+
export namespace Create {
|
|
3543
|
+
export type Body = CreateBody;
|
|
3544
|
+
export type Result = Data;
|
|
3545
|
+
}
|
|
3546
|
+
export namespace Update {
|
|
3547
|
+
export type ID = StringId;
|
|
3548
|
+
export type Body = Partial<Data>;
|
|
3549
|
+
export type Result = Data;
|
|
3550
|
+
}
|
|
3551
|
+
export namespace Remove {
|
|
3552
|
+
export type ID = string;
|
|
3553
|
+
export type Result = Data;
|
|
3554
|
+
}
|
|
3555
|
+
}
|
|
3556
|
+
|
|
3557
|
+
export namespace JobCategoryAutoSkipAnalyze {
|
|
3558
|
+
export interface Data {
|
|
3559
|
+
client: StringId;
|
|
3560
|
+
rep?: StringId;
|
|
3561
|
+
visit_id?: string;
|
|
3562
|
+
job_category: (JobCategory.Data & {
|
|
3563
|
+
skipped?: boolean;
|
|
3564
|
+
jobs: (JobCategory.Data["jobs"][0] & { skipped?: boolean })[];
|
|
3565
|
+
})[];
|
|
3566
|
+
company_namespace: string[];
|
|
3567
|
+
}
|
|
3568
|
+
|
|
3569
|
+
export namespace Create {
|
|
3570
|
+
export type Body = Data;
|
|
3571
|
+
export type Result = Data;
|
|
3572
|
+
}
|
|
3438
3573
|
}
|
|
3439
3574
|
|
|
3440
3575
|
export namespace Tag {
|
|
@@ -7792,7 +7927,7 @@ export namespace Service {
|
|
|
7792
7927
|
field: "_id";
|
|
7793
7928
|
type: "asc" | "desc";
|
|
7794
7929
|
}[];
|
|
7795
|
-
nodeCycles?:
|
|
7930
|
+
nodeCycles?: StringId[] | StringId;
|
|
7796
7931
|
withCycle?: boolean;
|
|
7797
7932
|
conversion_status?: "converted" | "not_converted" | "all";
|
|
7798
7933
|
};
|
|
@@ -8830,7 +8965,8 @@ export namespace Service {
|
|
|
8830
8965
|
| "asset-part-transfer"
|
|
8831
8966
|
| "adjust-inventory"
|
|
8832
8967
|
| "return-asset-part-unit"
|
|
8833
|
-
| "store-asset-part-unit"
|
|
8968
|
+
| "store-asset-part-unit"
|
|
8969
|
+
| "activity-form-v2-result";
|
|
8834
8970
|
position?: number;
|
|
8835
8971
|
description?: string;
|
|
8836
8972
|
rules: {
|
|
@@ -8867,7 +9003,8 @@ export namespace Service {
|
|
|
8867
9003
|
| "asset-part-transfer"
|
|
8868
9004
|
| "adjust-inventory"
|
|
8869
9005
|
| "return-asset-part-unit"
|
|
8870
|
-
| "store-asset-part-unit"
|
|
9006
|
+
| "store-asset-part-unit"
|
|
9007
|
+
| "activity-form-v2-result";
|
|
8871
9008
|
creator?: AdminCreator;
|
|
8872
9009
|
disabled?: boolean;
|
|
8873
9010
|
company_namespace?: string[];
|
|
@@ -8907,7 +9044,8 @@ export namespace Service {
|
|
|
8907
9044
|
| "asset-part-transfer"
|
|
8908
9045
|
| "adjust-inventory"
|
|
8909
9046
|
| "return-asset-part-unit"
|
|
8910
|
-
| "store-asset-part-unit"
|
|
9047
|
+
| "store-asset-part-unit"
|
|
9048
|
+
| "activity-form-v2-result";
|
|
8911
9049
|
position?: number;
|
|
8912
9050
|
description?: string;
|
|
8913
9051
|
rules?: {
|
|
@@ -8995,7 +9133,8 @@ export namespace Service {
|
|
|
8995
9133
|
| "asset-part-transfer"
|
|
8996
9134
|
| "adjust-inventory"
|
|
8997
9135
|
| "return-asset-part-unit"
|
|
8998
|
-
| "store-asset-part-unit"
|
|
9136
|
+
| "store-asset-part-unit"
|
|
9137
|
+
| "activity-form-v2-result";
|
|
8999
9138
|
document_id: string;
|
|
9000
9139
|
status: CycleStatus;
|
|
9001
9140
|
node?: AdminCreator | RepCreator | ClientCreator;
|
|
@@ -9194,7 +9333,7 @@ export namespace Service {
|
|
|
9194
9333
|
status?: TransferStatus | TransferStatus[];
|
|
9195
9334
|
custom_status?: string[] | string;
|
|
9196
9335
|
creator?: string[] | string;
|
|
9197
|
-
nodeCycles?:
|
|
9336
|
+
nodeCycles?: StringId[] | StringId;
|
|
9198
9337
|
from__id?: string;
|
|
9199
9338
|
to__id?: string;
|
|
9200
9339
|
populatedKeys?: PopulatedKeys[];
|
|
@@ -20186,6 +20325,7 @@ export namespace Service {
|
|
|
20186
20325
|
route?: StringId;
|
|
20187
20326
|
workorder?: StringId;
|
|
20188
20327
|
sync_id: string;
|
|
20328
|
+
status?: "pending" | "approved" | "processing" | "rejected";
|
|
20189
20329
|
// mobile data
|
|
20190
20330
|
geo_tag?: GeoTag;
|
|
20191
20331
|
geoPoint?: GeoPoint;
|
|
@@ -20247,6 +20387,7 @@ export namespace Service {
|
|
|
20247
20387
|
results: DivisionResult[];
|
|
20248
20388
|
score?: number;
|
|
20249
20389
|
is_completed?: boolean;
|
|
20390
|
+
status?: "pending" | "approved" | "processing" | "rejected";
|
|
20250
20391
|
company_namespace?: string[];
|
|
20251
20392
|
}
|
|
20252
20393
|
export type UpdateBody = Partial<Data>;
|
|
@@ -20260,6 +20401,7 @@ export namespace Service {
|
|
|
20260
20401
|
photo_media_populated?: PopulatedMediaStorage & {
|
|
20261
20402
|
ContentLength?: number;
|
|
20262
20403
|
};
|
|
20404
|
+
cycle?: Cycle.Data;
|
|
20263
20405
|
};
|
|
20264
20406
|
|
|
20265
20407
|
type PopulatedKeys =
|
|
@@ -20297,6 +20439,9 @@ export namespace Service {
|
|
|
20297
20439
|
visit?: StringId | StringId[];
|
|
20298
20440
|
workorder?: StringId | StringId[];
|
|
20299
20441
|
"serial_number.formatted"?: string | string[];
|
|
20442
|
+
status?: Data["status"] | Data["status"][];
|
|
20443
|
+
nodeCycles?: StringId[] | StringId;
|
|
20444
|
+
withCycle?: boolean;
|
|
20300
20445
|
};
|
|
20301
20446
|
export interface Result extends DefaultPaginationResult {
|
|
20302
20447
|
data: PopulatedDoc[];
|
|
@@ -20304,7 +20449,10 @@ export namespace Service {
|
|
|
20304
20449
|
}
|
|
20305
20450
|
export namespace Get {
|
|
20306
20451
|
export type ID = string;
|
|
20307
|
-
export type Params = {
|
|
20452
|
+
export type Params = {
|
|
20453
|
+
populatedKeys?: PopulatedKeys[];
|
|
20454
|
+
withCycle?: boolean;
|
|
20455
|
+
};
|
|
20308
20456
|
export type Result = PopulatedDoc & { can_edit_types?: boolean };
|
|
20309
20457
|
}
|
|
20310
20458
|
export namespace Create {
|
|
@@ -20313,9 +20461,25 @@ export namespace Service {
|
|
|
20313
20461
|
}
|
|
20314
20462
|
export namespace Update {
|
|
20315
20463
|
export type ID = StringId;
|
|
20316
|
-
export type Body = UpdateBody
|
|
20464
|
+
export type Body = UpdateBody & {
|
|
20465
|
+
isResubmitted?: boolean;
|
|
20466
|
+
note?: string;
|
|
20467
|
+
stage?: number;
|
|
20468
|
+
};
|
|
20317
20469
|
export type Result = Data;
|
|
20318
20470
|
}
|
|
20471
|
+
export namespace Patch {
|
|
20472
|
+
export type Params = { updateStatus: true };
|
|
20473
|
+
export type Body = {
|
|
20474
|
+
readQuery: [{ key: "_id"; operator: "in"; value: StringId[] }];
|
|
20475
|
+
writeQuery: {
|
|
20476
|
+
key: "status";
|
|
20477
|
+
command: "set";
|
|
20478
|
+
value: "approved" | "rejected";
|
|
20479
|
+
};
|
|
20480
|
+
};
|
|
20481
|
+
export type Result = { nFound: number; nModified: number };
|
|
20482
|
+
}
|
|
20319
20483
|
}
|
|
20320
20484
|
|
|
20321
20485
|
export namespace LineClassification {
|