repzo 1.0.279 → 1.0.280

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.279",
3
+ "version": "1.0.280",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/index.ts CHANGED
@@ -149,6 +149,10 @@ export const end_points = {
149
149
  JOB_CATEGORY: "job-category",
150
150
  JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze",
151
151
  VISIT_REASON: "visit-reason",
152
+ TARGET_RULE: "target-rule",
153
+ PLAN: "plan",
154
+ CALENDAR: "calendar",
155
+ LINE_TARGET: "line-target",
152
156
  BULK_IMPORT: "bulk-import",
153
157
  } as const;
154
158
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
@@ -250,6 +254,11 @@ export const availableService = [
250
254
  "clmFetch",
251
255
  "pdfMergeField",
252
256
  "visitReason",
257
+ "targetRule",
258
+ "plan",
259
+ "calendar",
260
+ "lineTarget",
261
+ "bulkImport",
253
262
  ] as const;
254
263
  export type AvailableService = (typeof availableService)[number];
255
264
 
@@ -7007,6 +7016,220 @@ export default class Repzo {
7007
7016
  },
7008
7017
  };
7009
7018
 
7019
+ targetRule = {
7020
+ _path: Repzo._end_points.TARGET_RULE,
7021
+ find: async (
7022
+ params?: Service.TargetRule.Find.Params,
7023
+ ): Promise<Service.TargetRule.Find.Result> => {
7024
+ let res: Service.TargetRule.Find.Result = await this._fetch(
7025
+ this.svAPIEndpoint,
7026
+ this.targetRule._path,
7027
+ params,
7028
+ );
7029
+ return res;
7030
+ },
7031
+ get: async (
7032
+ id: Service.TargetRule.Get.ID,
7033
+ ): Promise<Service.TargetRule.Get.Result> => {
7034
+ return await this._fetch(
7035
+ this.svAPIEndpoint,
7036
+ this.targetRule._path + `/${id}`,
7037
+ );
7038
+ },
7039
+ create: async (
7040
+ body: Service.TargetRule.Create.Body,
7041
+ ): Promise<Service.TargetRule.Create.Result> => {
7042
+ let res = await this._create(
7043
+ this.svAPIEndpoint,
7044
+ this.targetRule._path,
7045
+ body,
7046
+ );
7047
+ return res;
7048
+ },
7049
+ update: async (
7050
+ id: Service.TargetRule.Update.ID,
7051
+ body: Service.TargetRule.Update.Body,
7052
+ ): Promise<Service.TargetRule.Update.Result> => {
7053
+ let res: Service.TargetRule.Update.Result = await this._update(
7054
+ this.svAPIEndpoint,
7055
+ this.targetRule._path + `/${id}`,
7056
+ body,
7057
+ );
7058
+ return res;
7059
+ },
7060
+ remove: async (
7061
+ id: Service.TargetRule.Remove.ID,
7062
+ ): Promise<Service.TargetRule.Remove.Result> => {
7063
+ let res: Service.TargetRule.Remove.Result = await this._delete(
7064
+ this.svAPIEndpoint,
7065
+ this.targetRule._path + `/${id}`,
7066
+ );
7067
+ return res;
7068
+ },
7069
+ };
7070
+
7071
+ plan = {
7072
+ _path: Repzo._end_points.PLAN,
7073
+ find: async (
7074
+ params?: Service.Plan.Find.Params,
7075
+ ): Promise<Service.Plan.Find.Result> => {
7076
+ let res: Service.Plan.Find.Result = await this._fetch(
7077
+ this.svAPIEndpoint,
7078
+ this.plan._path,
7079
+ params,
7080
+ );
7081
+ return res;
7082
+ },
7083
+ get: async (
7084
+ id: Service.Plan.Get.ID,
7085
+ params?: Service.Plan.Get.Params,
7086
+ ): Promise<Service.Plan.Get.Result> => {
7087
+ return await this._fetch(
7088
+ this.svAPIEndpoint,
7089
+ this.plan._path + `/${id}`,
7090
+ params,
7091
+ );
7092
+ },
7093
+ create: async (
7094
+ body: Service.Plan.Create.Body,
7095
+ ): Promise<Service.Plan.Create.Result> => {
7096
+ let res = await this._create(this.svAPIEndpoint, this.plan._path, body);
7097
+ return res;
7098
+ },
7099
+ update: async (
7100
+ id: Service.Plan.Update.ID,
7101
+ body: Service.Plan.Update.Body,
7102
+ ): Promise<Service.Plan.Update.Result> => {
7103
+ let res: Service.Plan.Update.Result = await this._update(
7104
+ this.svAPIEndpoint,
7105
+ this.plan._path + `/${id}`,
7106
+ body,
7107
+ );
7108
+ return res;
7109
+ },
7110
+ remove: async (
7111
+ id: Service.Plan.Remove.ID,
7112
+ ): Promise<Service.Plan.Remove.Result> => {
7113
+ let res: Service.Plan.Remove.Result = await this._delete(
7114
+ this.svAPIEndpoint,
7115
+ this.plan._path + `/${id}`,
7116
+ );
7117
+ return res;
7118
+ },
7119
+ };
7120
+
7121
+ calendar = {
7122
+ _path: Repzo._end_points.CALENDAR,
7123
+ find: async (
7124
+ params?: Service.Calendar.Find.Params,
7125
+ ): Promise<Service.Calendar.Find.Result> => {
7126
+ let res: Service.Calendar.Find.Result = await this._fetch(
7127
+ this.svAPIEndpoint,
7128
+ this.calendar._path,
7129
+ params,
7130
+ );
7131
+ return res;
7132
+ },
7133
+ get: async (
7134
+ id: Service.Calendar.Get.ID,
7135
+ params?: Service.Calendar.Get.Params,
7136
+ ): Promise<Service.Calendar.Get.Result> => {
7137
+ return await this._fetch(
7138
+ this.svAPIEndpoint,
7139
+ this.calendar._path + `/${id}`,
7140
+ params,
7141
+ );
7142
+ },
7143
+ create: async (
7144
+ body: Service.Calendar.Create.Body,
7145
+ params?: Service.Calendar.Create.Params,
7146
+ ): Promise<Service.Calendar.Create.Result> => {
7147
+ let res = await this._create(
7148
+ this.svAPIEndpoint,
7149
+ this.calendar._path,
7150
+ body,
7151
+ params,
7152
+ );
7153
+ return res;
7154
+ },
7155
+ update: async (
7156
+ id: Service.Calendar.Update.ID,
7157
+ body: Service.Calendar.Update.Body,
7158
+ ): Promise<Service.Calendar.Update.Result> => {
7159
+ let res: Service.Calendar.Update.Result = await this._update(
7160
+ this.svAPIEndpoint,
7161
+ this.calendar._path + `/${id}`,
7162
+ body,
7163
+ );
7164
+ return res;
7165
+ },
7166
+ remove: async (
7167
+ id: Service.Calendar.Remove.ID,
7168
+ ): Promise<Service.Calendar.Remove.Result> => {
7169
+ let res: Service.Calendar.Remove.Result = await this._delete(
7170
+ this.svAPIEndpoint,
7171
+ this.calendar._path + `/${id}`,
7172
+ );
7173
+ return res;
7174
+ },
7175
+ };
7176
+
7177
+ lineTarget = {
7178
+ _path: Repzo._end_points.LINE_TARGET,
7179
+ find: async (
7180
+ params?: Service.LineTarget.Find.Params,
7181
+ ): Promise<Service.LineTarget.Find.Result> => {
7182
+ let res: Service.LineTarget.Find.Result = await this._fetch(
7183
+ this.svAPIEndpoint,
7184
+ this.lineTarget._path,
7185
+ params,
7186
+ );
7187
+ return res;
7188
+ },
7189
+ get: async (
7190
+ id: Service.LineTarget.Get.ID,
7191
+ params?: Service.LineTarget.Get.Params,
7192
+ ): Promise<Service.LineTarget.Get.Result> => {
7193
+ return await this._fetch(
7194
+ this.svAPIEndpoint,
7195
+ this.lineTarget._path + `/${id}`,
7196
+ params,
7197
+ );
7198
+ },
7199
+ create: async (
7200
+ body: Service.LineTarget.Create.Body,
7201
+ ): Promise<Service.LineTarget.Create.Result> => {
7202
+ let res = await this._create(
7203
+ this.svAPIEndpoint,
7204
+ this.lineTarget._path,
7205
+ body,
7206
+ );
7207
+ return res;
7208
+ },
7209
+ update: async (
7210
+ id: Service.LineTarget.Update.ID,
7211
+ body: Service.LineTarget.Update.Body,
7212
+ ): Promise<Service.LineTarget.Update.Result> => {
7213
+ let res: Service.LineTarget.Update.Result = await this._update(
7214
+ this.svAPIEndpoint,
7215
+ this.lineTarget._path + `/${id}`,
7216
+ body,
7217
+ );
7218
+ return res;
7219
+ },
7220
+ remove: async (
7221
+ id: Service.LineTarget.Remove.ID,
7222
+ params?: Service.LineTarget.Remove.Params,
7223
+ ): Promise<Service.LineTarget.Remove.Result> => {
7224
+ let res: Service.LineTarget.Remove.Result = await this._delete(
7225
+ this.svAPIEndpoint,
7226
+ this.lineTarget._path + (id ? `/${id}` : ""),
7227
+ params,
7228
+ );
7229
+ return res;
7230
+ },
7231
+ };
7232
+
7010
7233
  bulkImport = {
7011
7234
  _path: Repzo._end_points.BULK_IMPORT,
7012
7235
  find: async (
@@ -0,0 +1,329 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: Repzo API - Calendar
4
+ version: 1.0.0
5
+ description: OpenAPI specification for Repzo Calendar endpoints.
6
+ servers:
7
+ - url: https://sv.api.repzo.me
8
+ paths:
9
+ /calendar:
10
+ get:
11
+ summary: Find calendars
12
+ operationId: findCalendars
13
+ parameters:
14
+ - in: query
15
+ name: params
16
+ schema:
17
+ type: object
18
+ description: Query parameters for filtering calendars
19
+ responses:
20
+ "200":
21
+ description: A list of calendars
22
+ content:
23
+ application/json:
24
+ schema:
25
+ $ref: "#/components/schemas/CalendarFindResult"
26
+ post:
27
+ summary: Create a calendar
28
+ operationId: createCalendar
29
+ parameters:
30
+ - in: query
31
+ name: assignTo
32
+ schema:
33
+ type: string
34
+ description: Plan ID to assign the new calendar to
35
+ - in: query
36
+ name: assignedToMe
37
+ schema:
38
+ type: boolean
39
+ description: When true, assigns the new calendar to the current rep's assigned plan
40
+ requestBody:
41
+ required: true
42
+ content:
43
+ application/json:
44
+ schema:
45
+ $ref: "#/components/schemas/CalendarCreateBody"
46
+ responses:
47
+ "201":
48
+ description: Calendar created
49
+ content:
50
+ application/json:
51
+ schema:
52
+ $ref: "#/components/schemas/CalendarCreateResult"
53
+ /calendar/{id}:
54
+ get:
55
+ summary: Get a calendar by ID
56
+ operationId: getCalendar
57
+ parameters:
58
+ - in: path
59
+ name: id
60
+ required: true
61
+ schema:
62
+ type: string
63
+ responses:
64
+ "200":
65
+ description: Calendar details
66
+ content:
67
+ application/json:
68
+ schema:
69
+ $ref: "#/components/schemas/CalendarGetResult"
70
+ put:
71
+ summary: Update a calendar
72
+ operationId: updateCalendar
73
+ parameters:
74
+ - in: path
75
+ name: id
76
+ required: true
77
+ schema:
78
+ type: string
79
+ requestBody:
80
+ required: true
81
+ content:
82
+ application/json:
83
+ schema:
84
+ $ref: "#/components/schemas/CalendarUpdateBody"
85
+ responses:
86
+ "200":
87
+ description: Calendar updated
88
+ content:
89
+ application/json:
90
+ schema:
91
+ $ref: "#/components/schemas/CalendarUpdateResult"
92
+ delete:
93
+ summary: Disable a calendar
94
+ operationId: removeCalendar
95
+ parameters:
96
+ - in: path
97
+ name: id
98
+ required: true
99
+ schema:
100
+ type: string
101
+ responses:
102
+ "200":
103
+ description: Calendar disabled
104
+ content:
105
+ application/json:
106
+ schema:
107
+ $ref: "#/components/schemas/CalendarRemoveResult"
108
+ components:
109
+ schemas:
110
+ CalendarType:
111
+ type: string
112
+ enum: [weekly, weeklyGroup]
113
+ CalendarDay:
114
+ type: string
115
+ enum: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
116
+ CalendarUser:
117
+ type: object
118
+ properties:
119
+ _id:
120
+ type: string
121
+ type:
122
+ type: string
123
+ enum: [admin, rep]
124
+ rep:
125
+ type: string
126
+ admin:
127
+ type: string
128
+ name:
129
+ type: string
130
+ CalendarClientEntry:
131
+ type: object
132
+ properties:
133
+ client:
134
+ type: string
135
+ from:
136
+ type: string
137
+ to:
138
+ type: string
139
+ visit_reason:
140
+ type: string
141
+ visit_note:
142
+ type: string
143
+ CalendarWeeklyDetails:
144
+ type: object
145
+ properties:
146
+ type:
147
+ type: string
148
+ enum: [weekly]
149
+ days:
150
+ type: array
151
+ items:
152
+ $ref: "#/components/schemas/CalendarDay"
153
+ every:
154
+ type: number
155
+ CalendarDaysGroup:
156
+ type: object
157
+ properties:
158
+ days:
159
+ type: array
160
+ items:
161
+ $ref: "#/components/schemas/CalendarDay"
162
+ CalendarWeeklyGroupDetails:
163
+ type: object
164
+ properties:
165
+ type:
166
+ type: string
167
+ enum: [weeklyGroup]
168
+ daysGroups:
169
+ type: array
170
+ items:
171
+ $ref: "#/components/schemas/CalendarDaysGroup"
172
+ groupSize:
173
+ type: number
174
+ CalendarDetails:
175
+ oneOf:
176
+ - $ref: "#/components/schemas/CalendarWeeklyDetails"
177
+ - $ref: "#/components/schemas/CalendarWeeklyGroupDetails"
178
+ CalendarFindResult:
179
+ type: object
180
+ properties:
181
+ data:
182
+ type: array
183
+ items:
184
+ $ref: "#/components/schemas/Calendar"
185
+ meta:
186
+ type: object
187
+ CalendarCreateBody:
188
+ type: object
189
+ required:
190
+ - name
191
+ - type
192
+ - details
193
+ - sync_id
194
+ - startsAt
195
+ properties:
196
+ name:
197
+ type: string
198
+ type:
199
+ $ref: "#/components/schemas/CalendarType"
200
+ details:
201
+ $ref: "#/components/schemas/CalendarDetails"
202
+ sync_id:
203
+ type: string
204
+ startsAt:
205
+ type: string
206
+ description: "Date in YYYY-MM-DD format"
207
+ endsAt:
208
+ type: string
209
+ description: "Date in YYYY-MM-DD format"
210
+ routes:
211
+ type: array
212
+ items:
213
+ type: string
214
+ clients:
215
+ type: array
216
+ items:
217
+ $ref: "#/components/schemas/CalendarClientEntry"
218
+ occurrences:
219
+ type: number
220
+ disabled:
221
+ type: boolean
222
+ note:
223
+ type: string
224
+ visit_reason:
225
+ type: string
226
+ visit_note:
227
+ type: string
228
+ CalendarCreateResult:
229
+ type: object
230
+ properties:
231
+ data:
232
+ $ref: "#/components/schemas/Calendar"
233
+ CalendarGetResult:
234
+ type: object
235
+ properties:
236
+ data:
237
+ $ref: "#/components/schemas/Calendar"
238
+ CalendarUpdateBody:
239
+ type: object
240
+ properties:
241
+ name:
242
+ type: string
243
+ type:
244
+ $ref: "#/components/schemas/CalendarType"
245
+ details:
246
+ $ref: "#/components/schemas/CalendarDetails"
247
+ sync_id:
248
+ type: string
249
+ startsAt:
250
+ type: string
251
+ endsAt:
252
+ type: string
253
+ routes:
254
+ type: array
255
+ items:
256
+ type: string
257
+ clients:
258
+ type: array
259
+ items:
260
+ $ref: "#/components/schemas/CalendarClientEntry"
261
+ occurrences:
262
+ type: number
263
+ disabled:
264
+ type: boolean
265
+ note:
266
+ type: string
267
+ visit_reason:
268
+ type: string
269
+ visit_note:
270
+ type: string
271
+ CalendarUpdateResult:
272
+ type: object
273
+ properties:
274
+ data:
275
+ $ref: "#/components/schemas/Calendar"
276
+ CalendarRemoveResult:
277
+ type: object
278
+ properties:
279
+ data:
280
+ $ref: "#/components/schemas/Calendar"
281
+ Calendar:
282
+ type: object
283
+ properties:
284
+ _id:
285
+ type: string
286
+ name:
287
+ type: string
288
+ type:
289
+ $ref: "#/components/schemas/CalendarType"
290
+ details:
291
+ $ref: "#/components/schemas/CalendarDetails"
292
+ creator:
293
+ $ref: "#/components/schemas/CalendarUser"
294
+ editor:
295
+ $ref: "#/components/schemas/CalendarUser"
296
+ routes:
297
+ type: array
298
+ items:
299
+ type: string
300
+ sync_id:
301
+ type: string
302
+ clients:
303
+ type: array
304
+ items:
305
+ $ref: "#/components/schemas/CalendarClientEntry"
306
+ occurrences:
307
+ type: number
308
+ startsAt:
309
+ type: string
310
+ endsAt:
311
+ type: string
312
+ disabled:
313
+ type: boolean
314
+ note:
315
+ type: string
316
+ visit_reason:
317
+ type: string
318
+ visit_note:
319
+ type: string
320
+ company_namespace:
321
+ type: array
322
+ items:
323
+ type: string
324
+ createdAt:
325
+ type: string
326
+ format: date-time
327
+ updatedAt:
328
+ type: string
329
+ format: date-time