repzo 1.0.125 → 1.0.127

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
@@ -95,6 +95,8 @@ export default class Repzo {
95
95
  readonly WORKORDER_PORTAL: "workorder-portal";
96
96
  readonly APPROVAL: "approvals";
97
97
  readonly ACTIVITY_FEEDBACK: "activity-feedback";
98
+ readonly ACTIVITY_FEEDBACKV2: "activity-feedback-v2";
99
+ readonly FEEDBACK_OPTION: "feedback-options";
98
100
  };
99
101
  private _fetch;
100
102
  private _create;
@@ -751,6 +753,40 @@ export default class Repzo {
751
753
  body: Service.ActivityFeedback.Update.Body
752
754
  ) => Promise<Service.ActivityFeedback.Update.Result>;
753
755
  };
756
+ activityFeedbackV2: {
757
+ _path: "activity-feedback-v2";
758
+ find: (
759
+ params?: Service.ActivityFeedbackV2.Find.Params
760
+ ) => Promise<Service.ActivityFeedbackV2.Find.Result>;
761
+ get: (
762
+ id: Service.ActivityFeedbackV2.Get.ID,
763
+ params?: Service.ActivityFeedbackV2.Get.Params
764
+ ) => Promise<Service.ActivityFeedbackV2.Get.Result>;
765
+ create: (
766
+ body: Service.ActivityFeedbackV2.Create.Body
767
+ ) => Promise<Service.ActivityFeedbackV2.Create.Result>;
768
+ update: (
769
+ id: Service.ActivityFeedbackV2.Update.ID,
770
+ body: Service.ActivityFeedbackV2.Update.Body
771
+ ) => Promise<Service.ActivityFeedbackV2.Update.Result>;
772
+ };
773
+ feedbackOption: {
774
+ _path: "feedback-options";
775
+ find: (
776
+ params?: Service.FeedbackOption.Find.Params
777
+ ) => Promise<Service.FeedbackOption.Find.Result>;
778
+ get: (
779
+ id: Service.FeedbackOption.Get.ID,
780
+ params?: Service.FeedbackOption.Get.Params
781
+ ) => Promise<Service.FeedbackOption.Get.Result>;
782
+ create: (
783
+ body: Service.FeedbackOption.Create.Body
784
+ ) => Promise<Service.FeedbackOption.Create.Result>;
785
+ update: (
786
+ id: Service.FeedbackOption.Update.ID,
787
+ body: Service.FeedbackOption.Update.Body
788
+ ) => Promise<Service.FeedbackOption.Update.Result>;
789
+ };
754
790
  invoice: {
755
791
  _path: "fullinvoices";
756
792
  find: (
package/lib/index.js CHANGED
@@ -84,6 +84,8 @@ export default class Repzo {
84
84
  WORKORDER_PORTAL: "workorder-portal",
85
85
  APPROVAL: "approvals",
86
86
  ACTIVITY_FEEDBACK: "activity-feedback",
87
+ ACTIVITY_FEEDBACKV2: "activity-feedback-v2",
88
+ FEEDBACK_OPTION: "feedback-options",
87
89
  };
88
90
  this.END_POINTS = this._end_points;
89
91
  this.client = {
@@ -1458,6 +1460,74 @@ export default class Repzo {
1458
1460
  return res;
1459
1461
  },
1460
1462
  };
1463
+ this.activityFeedbackV2 = {
1464
+ _path: this._end_points.ACTIVITY_FEEDBACKV2,
1465
+ find: async (params) => {
1466
+ let res = await this._fetch(
1467
+ this.svAPIEndpoint,
1468
+ this.activityFeedbackV2._path,
1469
+ params
1470
+ );
1471
+ return res;
1472
+ },
1473
+ get: async (id, params) => {
1474
+ return await this._fetch(
1475
+ this.svAPIEndpoint,
1476
+ this.activityFeedbackV2._path + `/${id}`,
1477
+ params
1478
+ );
1479
+ },
1480
+ create: async (body) => {
1481
+ let res = await this._create(
1482
+ this.svAPIEndpoint,
1483
+ this.activityFeedbackV2._path,
1484
+ body
1485
+ );
1486
+ return res;
1487
+ },
1488
+ update: async (id, body) => {
1489
+ let res = await this._update(
1490
+ this.svAPIEndpoint,
1491
+ this.activityFeedbackV2._path + `/${id}`,
1492
+ body
1493
+ );
1494
+ return res;
1495
+ },
1496
+ };
1497
+ this.feedbackOption = {
1498
+ _path: this._end_points.FEEDBACK_OPTION,
1499
+ find: async (params) => {
1500
+ let res = await this._fetch(
1501
+ this.svAPIEndpoint,
1502
+ this.feedbackOption._path,
1503
+ params
1504
+ );
1505
+ return res;
1506
+ },
1507
+ get: async (id, params) => {
1508
+ return await this._fetch(
1509
+ this.svAPIEndpoint,
1510
+ this.feedbackOption._path + `/${id}`,
1511
+ params
1512
+ );
1513
+ },
1514
+ create: async (body) => {
1515
+ let res = await this._create(
1516
+ this.svAPIEndpoint,
1517
+ this.feedbackOption._path,
1518
+ body
1519
+ );
1520
+ return res;
1521
+ },
1522
+ update: async (id, body) => {
1523
+ let res = await this._update(
1524
+ this.svAPIEndpoint,
1525
+ this.feedbackOption._path + `/${id}`,
1526
+ body
1527
+ );
1528
+ return res;
1529
+ },
1530
+ };
1461
1531
  this.invoice = {
1462
1532
  _path: this._end_points.INVOICE,
1463
1533
  find: async (params) => {
@@ -4911,6 +4911,126 @@ export declare namespace Service {
4911
4911
  type Result = ActivityFeedbackSchema;
4912
4912
  }
4913
4913
  }
4914
+ namespace ActivityFeedbackV2 {
4915
+ export interface ActivityFeedbackV2Schema {
4916
+ _id: string;
4917
+ route?: string;
4918
+ visit_id: string;
4919
+ visit_UUID: string;
4920
+ teams?: string[];
4921
+ company_namespace: string[];
4922
+ createdAt: Date;
4923
+ updatedAt: Date;
4924
+ }
4925
+ export interface CreateBody {
4926
+ route?: string;
4927
+ visit_id: string;
4928
+ visit_UUID: string;
4929
+ teams?: string[];
4930
+ }
4931
+ export interface UpdateBody {
4932
+ route?: string;
4933
+ visit_id?: string;
4934
+ visit_UUID?: string;
4935
+ teams?: string[];
4936
+ }
4937
+ export type PopulatedKeys =
4938
+ | "teams"
4939
+ | "route"
4940
+ | "visit_id"
4941
+ | "feed_back_option";
4942
+ type ActivityFeedbackV2SchemaWithPopulatedKeys = ActivityFeedbackV2Schema & {
4943
+ teams_populated?: string[] | Team.TeamSchema[];
4944
+ route_populated?: string | Route.RouteSchema;
4945
+ visit_id_populated?: string | Visit.VisitSchema;
4946
+ feed_back_option_populated?: string;
4947
+ };
4948
+ export namespace Find {
4949
+ type Params = DefaultPaginationQueryParams & {
4950
+ route?: string;
4951
+ teams?: string[];
4952
+ visit_id?: string;
4953
+ from_createdAt?: number;
4954
+ to_createdAt?: number;
4955
+ from__id?: string;
4956
+ to__id?: string;
4957
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
4958
+ [key: string]: any;
4959
+ sortBy?: {
4960
+ field: "_id";
4961
+ type: "asc" | "desc";
4962
+ }[];
4963
+ };
4964
+ interface Result extends DefaultPaginationResult {
4965
+ data: ActivityFeedbackV2SchemaWithPopulatedKeys[];
4966
+ absolute_total: number;
4967
+ page_total: number;
4968
+ }
4969
+ }
4970
+ export namespace Create {
4971
+ type Body = CreateBody;
4972
+ type Result = ActivityFeedbackV2Schema;
4973
+ }
4974
+ export namespace Get {
4975
+ type ID = string;
4976
+ interface Params {}
4977
+ type Result = ActivityFeedbackV2SchemaWithPopulatedKeys;
4978
+ }
4979
+ export namespace Update {
4980
+ type ID = string;
4981
+ type Body = UpdateBody;
4982
+ type Result = ActivityFeedbackV2Schema;
4983
+ }
4984
+ export {};
4985
+ }
4986
+ namespace FeedbackOption {
4987
+ interface FeedbackOptionSchema {
4988
+ _id: string;
4989
+ label: string;
4990
+ score?: number;
4991
+ disabled: boolean;
4992
+ company_namespace: string[];
4993
+ createdAt: Date;
4994
+ updatedAt: Date;
4995
+ }
4996
+ interface CreateBody {
4997
+ label: string;
4998
+ score?: number;
4999
+ }
5000
+ interface UpdateBody {
5001
+ label: string;
5002
+ score?: number;
5003
+ disabled?: boolean;
5004
+ }
5005
+ namespace Find {
5006
+ type Params = DefaultPaginationQueryParams & {
5007
+ label?: string;
5008
+ score?: number;
5009
+ deleted_at?: number;
5010
+ disabled?: boolean;
5011
+ [key: string]: any;
5012
+ };
5013
+ interface Result extends DefaultPaginationResult {
5014
+ data: FeedbackOptionSchema[];
5015
+ absolute_total: number;
5016
+ page_total: number;
5017
+ }
5018
+ }
5019
+ namespace Create {
5020
+ type Body = CreateBody;
5021
+ type Result = FeedbackOptionSchema;
5022
+ }
5023
+ namespace Get {
5024
+ type ID = string;
5025
+ interface Params {}
5026
+ type Result = FeedbackOptionSchema;
5027
+ }
5028
+ namespace Update {
5029
+ type ID = string;
5030
+ type Body = UpdateBody;
5031
+ type Result = FeedbackOptionSchema;
5032
+ }
5033
+ }
4914
5034
  namespace Workorder {
4915
5035
  export interface WorkorderSchema {
4916
5036
  _id: StringId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.125",
3
+ "version": "1.0.127",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -119,6 +119,8 @@ export default class Repzo {
119
119
  WORKORDER_PORTAL: "workorder-portal",
120
120
  APPROVAL: "approvals",
121
121
  ACTIVITY_FEEDBACK: "activity-feedback",
122
+ ACTIVITY_FEEDBACKV2: "activity-feedback-v2",
123
+ FEEDBACK_OPTION: "feedback-options",
122
124
  } as const;
123
125
  public END_POINTS = this._end_points;
124
126
  private async _fetch(baseUrl: string, path: string, params?: Params) {
@@ -2061,6 +2063,98 @@ export default class Repzo {
2061
2063
  },
2062
2064
  };
2063
2065
 
2066
+ activityFeedbackV2 = {
2067
+ _path: this._end_points.ACTIVITY_FEEDBACKV2,
2068
+ find: async (
2069
+ params?: Service.ActivityFeedbackV2.Find.Params
2070
+ ): Promise<Service.ActivityFeedbackV2.Find.Result> => {
2071
+ let res: Service.ActivityFeedbackV2.Find.Result = await this._fetch(
2072
+ this.svAPIEndpoint,
2073
+ this.activityFeedbackV2._path,
2074
+ params
2075
+ );
2076
+ return res;
2077
+ },
2078
+ get: async (
2079
+ id: Service.ActivityFeedbackV2.Get.ID,
2080
+ params?: Service.ActivityFeedbackV2.Get.Params
2081
+ ): Promise<Service.ActivityFeedbackV2.Get.Result> => {
2082
+ return await this._fetch(
2083
+ this.svAPIEndpoint,
2084
+ this.activityFeedbackV2._path + `/${id}`,
2085
+ params
2086
+ );
2087
+ },
2088
+ create: async (
2089
+ body: Service.ActivityFeedbackV2.Create.Body
2090
+ ): Promise<Service.ActivityFeedbackV2.Create.Result> => {
2091
+ let res = await this._create(
2092
+ this.svAPIEndpoint,
2093
+ this.activityFeedbackV2._path,
2094
+ body
2095
+ );
2096
+ return res;
2097
+ },
2098
+
2099
+ update: async (
2100
+ id: Service.ActivityFeedbackV2.Update.ID,
2101
+ body: Service.ActivityFeedbackV2.Update.Body
2102
+ ): Promise<Service.ActivityFeedbackV2.Update.Result> => {
2103
+ let res: Service.ActivityFeedbackV2.Update.Result = await this._update(
2104
+ this.svAPIEndpoint,
2105
+ this.activityFeedbackV2._path + `/${id}`,
2106
+ body
2107
+ );
2108
+ return res;
2109
+ },
2110
+ };
2111
+
2112
+ feedbackOption = {
2113
+ _path: this._end_points.FEEDBACK_OPTION,
2114
+ find: async (
2115
+ params?: Service.FeedbackOption.Find.Params
2116
+ ): Promise<Service.FeedbackOption.Find.Result> => {
2117
+ let res: Service.FeedbackOption.Find.Result = await this._fetch(
2118
+ this.svAPIEndpoint,
2119
+ this.feedbackOption._path,
2120
+ params
2121
+ );
2122
+ return res;
2123
+ },
2124
+ get: async (
2125
+ id: Service.FeedbackOption.Get.ID,
2126
+ params?: Service.FeedbackOption.Get.Params
2127
+ ): Promise<Service.FeedbackOption.Get.Result> => {
2128
+ return await this._fetch(
2129
+ this.svAPIEndpoint,
2130
+ this.feedbackOption._path + `/${id}`,
2131
+ params
2132
+ );
2133
+ },
2134
+ create: async (
2135
+ body: Service.FeedbackOption.Create.Body
2136
+ ): Promise<Service.FeedbackOption.Create.Result> => {
2137
+ let res = await this._create(
2138
+ this.svAPIEndpoint,
2139
+ this.feedbackOption._path,
2140
+ body
2141
+ );
2142
+ return res;
2143
+ },
2144
+
2145
+ update: async (
2146
+ id: Service.FeedbackOption.Update.ID,
2147
+ body: Service.FeedbackOption.Update.Body
2148
+ ): Promise<Service.FeedbackOption.Update.Result> => {
2149
+ let res: Service.FeedbackOption.Update.Result = await this._update(
2150
+ this.svAPIEndpoint,
2151
+ this.feedbackOption._path + `/${id}`,
2152
+ body
2153
+ );
2154
+ return res;
2155
+ },
2156
+ };
2157
+
2064
2158
  invoice = {
2065
2159
  _path: this._end_points.INVOICE,
2066
2160
  find: async (
@@ -0,0 +1,246 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: Repzo API - Brand
4
+ version: 1.0.0
5
+ description: OpenAPI specification for Repzo Brand endpoints.
6
+ servers:
7
+ - url: https://sv.api.repzo.me
8
+ paths:
9
+ /product-brand:
10
+ get:
11
+ summary: Find brands
12
+ operationId: findBrands
13
+ parameters:
14
+ - in: query
15
+ name: params
16
+ schema:
17
+ type: object
18
+ description: Query parameters for filtering brands
19
+ responses:
20
+ '200':
21
+ description: A list of brands
22
+ content:
23
+ application/json:
24
+ schema:
25
+ $ref: '#/components/schemas/BrandFindResult'
26
+ post:
27
+ summary: Create a brand
28
+ operationId: createBrand
29
+ requestBody:
30
+ required: true
31
+ content:
32
+ application/json:
33
+ schema:
34
+ $ref: '#/components/schemas/BrandCreateBody'
35
+ responses:
36
+ '201':
37
+ description: Brand created
38
+ content:
39
+ application/json:
40
+ schema:
41
+ $ref: '#/components/schemas/BrandCreateResult'
42
+ /product-brand/{id}:
43
+ get:
44
+ summary: Get a brand by ID
45
+ operationId: getBrand
46
+ parameters:
47
+ - in: path
48
+ name: id
49
+ required: true
50
+ schema:
51
+ type: string
52
+ responses:
53
+ '200':
54
+ description: Brand details
55
+ content:
56
+ application/json:
57
+ schema:
58
+ $ref: '#/components/schemas/BrandGetResult'
59
+ put:
60
+ summary: Update a brand
61
+ operationId: updateBrand
62
+ parameters:
63
+ - in: path
64
+ name: id
65
+ required: true
66
+ schema:
67
+ type: string
68
+ requestBody:
69
+ required: true
70
+ content:
71
+ application/json:
72
+ schema:
73
+ $ref: '#/components/schemas/BrandUpdateBody'
74
+ responses:
75
+ '200':
76
+ description: Brand updated
77
+ content:
78
+ application/json:
79
+ schema:
80
+ $ref: '#/components/schemas/BrandUpdateResult'
81
+ delete:
82
+ summary: Remove a brand
83
+ operationId: removeBrand
84
+ parameters:
85
+ - in: path
86
+ name: id
87
+ required: true
88
+ schema:
89
+ type: string
90
+ responses:
91
+ '200':
92
+ description: Brand removed
93
+ content:
94
+ application/json:
95
+ schema:
96
+ $ref: '#/components/schemas/BrandRemoveResult'
97
+ components:
98
+ schemas:
99
+ BrandFindResult:
100
+ type: object
101
+ description: Result of finding brands
102
+ properties:
103
+ data:
104
+ type: array
105
+ items:
106
+ $ref: '#/components/schemas/BrandSchema'
107
+ total_result:
108
+ type: number
109
+ description: Total number of brands
110
+ current_count:
111
+ type: number
112
+ description: Count of brands in current page
113
+ total_pages:
114
+ type: number
115
+ description: Total number of pages
116
+ current_page:
117
+ type: number
118
+ description: Current page number
119
+ per_page:
120
+ type: number
121
+ description: Number of brands per page
122
+ first_page_url:
123
+ type: string
124
+ description: URL for the first page
125
+ last_page_url:
126
+ type: string
127
+ description: URL for the last page
128
+ next_page_url:
129
+ type: string
130
+ nullable: true
131
+ description: URL for the next page
132
+ prev_page_url:
133
+ type: string
134
+ nullable: true
135
+ description: URL for the previous page
136
+ path:
137
+ type: string
138
+ description: Base URL path
139
+ BrandSchema:
140
+ type: object
141
+ description: Brand schema
142
+ properties:
143
+ _id:
144
+ type: string
145
+ description: Unique identifier for the brand
146
+ name:
147
+ type: string
148
+ description: Name of the brand
149
+ local_name:
150
+ type: string
151
+ description: Localized name of the brand
152
+ disabled:
153
+ type: boolean
154
+ description: Whether the brand is disabled
155
+ integration_meta:
156
+ type: object
157
+ additionalProperties: true
158
+ description: Integration metadata
159
+ company_namespace:
160
+ type: array
161
+ items:
162
+ type: string
163
+ description: Company namespaces
164
+ createdAt:
165
+ type: string
166
+ format: date-time
167
+ description: Creation timestamp
168
+ updatedAt:
169
+ type: string
170
+ format: date-time
171
+ description: Last update timestamp
172
+ __v:
173
+ type: number
174
+ description: Version number
175
+ BrandCreateBody:
176
+ type: object
177
+ description: Body for creating a brand
178
+ required:
179
+ - name
180
+ properties:
181
+ name:
182
+ type: string
183
+ description: Name of the brand
184
+ local_name:
185
+ type: string
186
+ description: Localized name of the brand
187
+ disabled:
188
+ type: boolean
189
+ description: Whether the brand is disabled
190
+ integration_meta:
191
+ type: object
192
+ additionalProperties: true
193
+ description: Integration metadata
194
+ company_namespace:
195
+ type: array
196
+ items:
197
+ type: string
198
+ description: Company namespaces
199
+ BrandCreateResult:
200
+ $ref: '#/components/schemas/BrandSchema'
201
+ description: Result of creating a brand
202
+ BrandGetResult:
203
+ $ref: '#/components/schemas/BrandSchema'
204
+ description: Result of getting a brand
205
+ BrandUpdateBody:
206
+ type: object
207
+ description: Body for updating a brand
208
+ properties:
209
+ name:
210
+ type: string
211
+ description: Name of the brand
212
+ local_name:
213
+ type: string
214
+ description: Localized name of the brand
215
+ disabled:
216
+ type: boolean
217
+ description: Whether the brand is disabled
218
+ integration_meta:
219
+ type: object
220
+ additionalProperties: true
221
+ description: Integration metadata
222
+ company_namespace:
223
+ type: array
224
+ items:
225
+ type: string
226
+ description: Company namespaces
227
+ _id:
228
+ type: string
229
+ description: Unique identifier for the brand
230
+ createdAt:
231
+ type: string
232
+ format: date-time
233
+ description: Creation timestamp
234
+ updatedAt:
235
+ type: string
236
+ format: date-time
237
+ description: Last update timestamp
238
+ __v:
239
+ type: number
240
+ description: Version number
241
+ BrandUpdateResult:
242
+ $ref: '#/components/schemas/BrandSchema'
243
+ description: Result of updating a brand
244
+ BrandRemoveResult:
245
+ $ref: '#/components/schemas/BrandSchema'
246
+ description: Result of removing a brand