@awell-health/awell-extensions 2.1.26 → 2.1.27

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.
Files changed (26) hide show
  1. package/dist/extensions/awell/v1/actions/stopTrack/config/fields.d.ts +4 -4
  2. package/dist/extensions/awell/v1/actions/stopTrack/config/fields.js +5 -5
  3. package/dist/extensions/awell/v1/actions/stopTrack/config/fields.js.map +1 -1
  4. package/dist/extensions/awell/v1/actions/stopTrack/stopTrack.js +48 -17
  5. package/dist/extensions/awell/v1/actions/stopTrack/stopTrack.js.map +1 -1
  6. package/dist/extensions/awellTasks/api/schema/GetCareflowComments.schema.d.ts +4 -4
  7. package/dist/extensions/dateHelpers/actions/checkWorkingHours/checkWorkingHours.d.ts +4 -0
  8. package/dist/extensions/dateHelpers/actions/checkWorkingHours/checkWorkingHours.js +75 -0
  9. package/dist/extensions/dateHelpers/actions/checkWorkingHours/checkWorkingHours.js.map +1 -0
  10. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/dataPoints.d.ts +10 -0
  11. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/dataPoints.js +14 -0
  12. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/dataPoints.js.map +1 -0
  13. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/fields.d.ts +38 -0
  14. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/fields.js +38 -0
  15. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/fields.js.map +1 -0
  16. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/index.d.ts +2 -0
  17. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/index.js +9 -0
  18. package/dist/extensions/dateHelpers/actions/checkWorkingHours/config/index.js.map +1 -0
  19. package/dist/extensions/dateHelpers/actions/checkWorkingHours/index.d.ts +1 -0
  20. package/dist/extensions/dateHelpers/actions/checkWorkingHours/index.js +18 -0
  21. package/dist/extensions/dateHelpers/actions/checkWorkingHours/index.js.map +1 -0
  22. package/dist/extensions/dateHelpers/actions/index.d.ts +23 -0
  23. package/dist/extensions/dateHelpers/actions/index.js +2 -0
  24. package/dist/extensions/dateHelpers/actions/index.js.map +1 -1
  25. package/dist/extensions/freshdesk/lib/api/schema/UpdateTicket.schema.d.ts +2 -2
  26. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { FieldType } from '@awell-health/extensions-core';
2
2
  import { z } from 'zod';
3
3
  export declare const fields: {
4
- trackId: {
4
+ trackDefinitionId: {
5
5
  id: string;
6
6
  label: string;
7
7
  description: string;
@@ -10,9 +10,9 @@ export declare const fields: {
10
10
  };
11
11
  };
12
12
  export declare const FieldsValidationSchema: z.ZodObject<{
13
- trackId: z.ZodString;
13
+ trackDefinitionId: z.ZodString;
14
14
  }, "strip", z.ZodTypeAny, {
15
- trackId: string;
15
+ trackDefinitionId: string;
16
16
  }, {
17
- trackId: string;
17
+ trackDefinitionId: string;
18
18
  }>;
@@ -4,15 +4,15 @@ exports.FieldsValidationSchema = exports.fields = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
5
  const zod_1 = require("zod");
6
6
  exports.fields = {
7
- trackId: {
8
- id: 'trackId',
9
- label: 'Track ID',
10
- description: 'The ID of the track that you want to stop.',
7
+ trackDefinitionId: {
8
+ id: 'trackDefinitionId',
9
+ label: 'Track definition ID',
10
+ description: 'The definitionID of the track that you want to stop.',
11
11
  type: extensions_core_1.FieldType.STRING,
12
12
  required: true,
13
13
  },
14
14
  };
15
15
  exports.FieldsValidationSchema = zod_1.z.object({
16
- trackId: zod_1.z.string().nonempty('Track ID is required'),
16
+ trackDefinitionId: zod_1.z.string().nonempty('Track definition ID is required'),
17
17
  });
18
18
  //# sourceMappingURL=fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/awell/v1/actions/stopTrack/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,4CAA4C;QACzD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;CACH,CAAC,CAAA"}
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/awell/v1/actions/stopTrack/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,sDAAsD;QACnE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;CACxB,CAAC,CAAA"}
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stopTrack = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
- const config_1 = require("./config");
6
5
  const zod_1 = require("zod");
7
6
  const addEventLog_1 = require("../../../../../src/lib/awell/addEventLog");
7
+ const config_1 = require("./config");
8
8
  exports.stopTrack = {
9
9
  key: 'stopTrack',
10
10
  category: extensions_core_1.Category.WORKFLOW,
@@ -13,7 +13,8 @@ exports.stopTrack = {
13
13
  fields: config_1.fields,
14
14
  previewable: false, // We don't have pathways in Preview, only cases.
15
15
  onEvent: async ({ payload, onComplete, helpers }) => {
16
- const { fields: { trackId }, pathway: { id: pathwayId }, } = (0, extensions_core_1.validate)({
16
+ var _a, _b;
17
+ const { fields: { trackDefinitionId }, pathway: { id: careFlowId }, } = (0, extensions_core_1.validate)({
17
18
  schema: zod_1.z.object({
18
19
  fields: config_1.FieldsValidationSchema,
19
20
  pathway: config_1.PathwayValidationSchema,
@@ -21,25 +22,55 @@ exports.stopTrack = {
21
22
  payload,
22
23
  });
23
24
  const awellSdk = await helpers.awellSdk();
24
- await awellSdk.orchestration.mutation({
25
- stopTrack: {
25
+ const elementsResponse = await awellSdk.orchestration.query({
26
+ pathwayElements: {
26
27
  __args: {
27
- input: {
28
- track_id: trackId,
29
- pathway_id: pathwayId,
30
- },
28
+ pathway_id: careFlowId,
29
+ },
30
+ elements: {
31
+ id: true,
32
+ status: true,
33
+ definition_id: true,
34
+ name: true,
31
35
  },
32
- code: true,
33
- success: true,
34
36
  },
35
37
  });
36
- await onComplete({
37
- events: [
38
- (0, addEventLog_1.addActivityEventLog)({
39
- message: `Track successfully stopped.`,
40
- }),
41
- ],
42
- });
38
+ const activeTracks = (_b = (_a = elementsResponse.pathwayElements) === null || _a === void 0 ? void 0 : _a.elements) === null || _b === void 0 ? void 0 : _b.filter((element) => element.definition_id === trackDefinitionId &&
39
+ (element.status === 'ACTIVE' ||
40
+ element.status === 'SCHEDULED' ||
41
+ element.status === 'POSTPONED'));
42
+ if (activeTracks.length > 0) {
43
+ const events = [];
44
+ for (const activeTrack of activeTracks) {
45
+ await awellSdk.orchestration.mutation({
46
+ stopTrack: {
47
+ __args: {
48
+ input: {
49
+ track_id: activeTrack.id,
50
+ pathway_id: careFlowId,
51
+ },
52
+ },
53
+ code: true,
54
+ success: true,
55
+ },
56
+ });
57
+ events.push((0, addEventLog_1.addActivityEventLog)({
58
+ message: `Track ${activeTrack.name} with ID ${activeTrack.id} successfully stopped.`,
59
+ }));
60
+ }
61
+ await onComplete({
62
+ events,
63
+ });
64
+ }
65
+ else {
66
+ await onComplete({
67
+ events: [
68
+ (0, addEventLog_1.addActivityEventLog)({
69
+ message: `No active track found with definition ID ${trackDefinitionId} in care flow ${careFlowId}.`,
70
+ }),
71
+ ],
72
+ });
73
+ }
43
74
  },
44
75
  };
45
76
  //# sourceMappingURL=stopTrack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stopTrack.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/stopTrack/stopTrack.ts"],"names":[],"mappings":";;;AAEA,mEAAkE;AAClE,qCAIiB;AACjB,6BAAuB;AACvB,0EAA8E;AAEjE,QAAA,SAAS,GAA2C;IAC/D,GAAG,EAAE,WAAW;IAChB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK,EAAE,iDAAiD;IACrE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAiB,EAAE;QACjE,MAAM,EACJ,MAAM,EAAE,EAAE,OAAO,EAAE,EACnB,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,GAC3B,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;gBAC9B,OAAO,EAAE,gCAAuB;aACjC,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;QACzC,MAAM,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;YACpC,SAAS,EAAE;gBACT,MAAM,EAAE;oBACN,KAAK,EAAE;wBACL,QAAQ,EAAE,OAAO;wBACjB,UAAU,EAAE,SAAS;qBACtB;iBACF;gBACD,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,IAAI;aACd;SACF,CAAC,CAAA;QAEF,MAAM,UAAU,CAAC;YACf,MAAM,E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CAAC,eAAe,0CAAE,QAAQ,0CAAE,MAAM,CACrE,CAAC,OAAO,EAAE,EAAE,CACV,OAAO,CAAC,aAAa,KAAK,iBAAiB;YAC3C,CAAC,OAAO,CAAC,MAAM,KAAK,QAAQ;gBAC1B,OAAO,CAAC,MAAM,KAAK,WAAW;gBAC9B,OAAO,CAAC,MAAM,KAAK,WAAW,CAAC,CACpC,CAAA;QACD,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,EAAE,CAAA;YACjB,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;gBACvC,MAAM,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;oBACpC,SAAS,EAAE;wBACT,MAAM,EAAE;4BACN,KAAK,EAAE;gCACL,QAAQ,EAAE,WAAW,CAAC,EAAE;gCACxB,UAAU,EAAE,UAAU;6BACvB;yBACF;wBACD,IAAI,EAAE,IAAI;wBACV,OAAO,EAAE,IAAI;qBACd;iBACF,CAAC,CAAA;gBACF,MAAM,CAAC,IAAI,CACT,IAAA,iCAAmB,EAAC;oBAClB,OAAO,EAAE,SAAS,WAAW,CAAC,IAAI,YAAY,WAAW,CAAC,EAAE,wBAAwB;iBACrF,CAAC,CACH,CAAA;YACH,CAAC;YACD,MAAM,UAAU,CAAC;gBACf,MAAM;aACP,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,UAAU,CAAC;gBACf,MAAM,EAAE;oBACN,IAAA,iCAAmB,EAAC;wBAClB,OAAO,EAAE,4CAA4C,iBAAiB,iBAAiB,UAAU,GAAG;qBACrG,CAAC;iBACH;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -99,6 +99,7 @@ export declare const GetCareflowCommentsResponseSchema: z.ZodObject<{
99
99
  }>;
100
100
  parent_id: z.ZodNullable<z.ZodString>;
101
101
  }, "strip", z.ZodTypeAny, {
102
+ parent_id: string | null;
102
103
  comment_id: string;
103
104
  comment: {
104
105
  status: string;
@@ -120,8 +121,8 @@ export declare const GetCareflowCommentsResponseSchema: z.ZodObject<{
120
121
  stytch_user_id?: string | undefined;
121
122
  };
122
123
  };
123
- parent_id: string | null;
124
124
  }, {
125
+ parent_id: string | null;
125
126
  comment_id: string;
126
127
  comment: {
127
128
  status: string;
@@ -143,7 +144,6 @@ export declare const GetCareflowCommentsResponseSchema: z.ZodObject<{
143
144
  stytch_user_id?: string | undefined;
144
145
  };
145
146
  };
146
- parent_id: string | null;
147
147
  }>, "many">;
148
148
  pagination: z.ZodObject<{
149
149
  total_count: z.ZodNumber;
@@ -165,6 +165,7 @@ export declare const GetCareflowCommentsResponseSchema: z.ZodObject<{
165
165
  limit: number;
166
166
  };
167
167
  comments: {
168
+ parent_id: string | null;
168
169
  comment_id: string;
169
170
  comment: {
170
171
  status: string;
@@ -186,7 +187,6 @@ export declare const GetCareflowCommentsResponseSchema: z.ZodObject<{
186
187
  stytch_user_id?: string | undefined;
187
188
  };
188
189
  };
189
- parent_id: string | null;
190
190
  }[];
191
191
  }, {
192
192
  pagination: {
@@ -195,6 +195,7 @@ export declare const GetCareflowCommentsResponseSchema: z.ZodObject<{
195
195
  limit: number;
196
196
  };
197
197
  comments: {
198
+ parent_id: string | null;
198
199
  comment_id: string;
199
200
  comment: {
200
201
  status: string;
@@ -216,7 +217,6 @@ export declare const GetCareflowCommentsResponseSchema: z.ZodObject<{
216
217
  stytch_user_id?: string | undefined;
217
218
  };
218
219
  };
219
- parent_id: string | null;
220
220
  }[];
221
221
  }>;
222
222
  export type GetCareflowCommentsResponseType = z.infer<typeof GetCareflowCommentsResponseSchema>;
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../settings';
3
+ import { dataPoints, fields } from './config';
4
+ export declare const checkWorkingHours: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkWorkingHours = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const date_fns_1 = require("date-fns");
6
+ const date_fns_tz_1 = require("date-fns-tz");
7
+ const config_1 = require("./config");
8
+ exports.checkWorkingHours = {
9
+ key: 'checkWorkingHours',
10
+ title: 'Check Working Hours',
11
+ description: 'Check if the current time is within working hours and calculate minutes to next working hours if not',
12
+ category: extensions_core_1.Category.WORKFLOW,
13
+ fields: config_1.fields,
14
+ dataPoints: config_1.dataPoints,
15
+ previewable: true,
16
+ onActivityCreated: async (payload, onComplete, onError) => {
17
+ const { workingHoursStart, workingHoursEnd, timezone } = config_1.FieldsValidationSchema.parse(payload.fields);
18
+ // Get current UTC time
19
+ const now = new Date();
20
+ // Convert current UTC time to the specified timezone
21
+ const currentTimeInTimezone = (0, date_fns_tz_1.utcToZonedTime)(now, timezone);
22
+ // Parse working hours
23
+ const [startHour, startMinute] = workingHoursStart.split(':').map(Number);
24
+ const [endHour, endMinute] = workingHoursEnd.split(':').map(Number);
25
+ // Validate that end time is after start time
26
+ const startTotalMinutes = startHour * 60 + startMinute;
27
+ const endTotalMinutes = endHour * 60 + endMinute;
28
+ if (endTotalMinutes <= startTotalMinutes) {
29
+ await onError({
30
+ events: [
31
+ {
32
+ date: new Date().toISOString(),
33
+ text: {
34
+ en: 'Working hours end time must be after start time. Cross-midnight hours are not supported.',
35
+ },
36
+ error: {
37
+ category: 'BAD_REQUEST',
38
+ message: 'Working hours end time must be after start time',
39
+ },
40
+ },
41
+ ],
42
+ });
43
+ return;
44
+ }
45
+ // Get current time in minutes since midnight using date-fns
46
+ const currentHour = (0, date_fns_1.getHours)(currentTimeInTimezone);
47
+ const currentMinute = (0, date_fns_1.getMinutes)(currentTimeInTimezone);
48
+ const currentTotalMinutes = currentHour * 60 + currentMinute;
49
+ // Check if within working hours
50
+ const isWithinWorkingHours = currentTotalMinutes >= startTotalMinutes &&
51
+ currentTotalMinutes < endTotalMinutes;
52
+ let minutesToNextWorkingHours;
53
+ // Calculate minutes to next working hours only if not currently within working hours
54
+ if (!isWithinWorkingHours) {
55
+ if (currentTotalMinutes < startTotalMinutes) {
56
+ // Before working hours today
57
+ minutesToNextWorkingHours = startTotalMinutes - currentTotalMinutes;
58
+ }
59
+ else {
60
+ // After working hours today, so next working hours is tomorrow
61
+ const minutesUntilMidnight = 24 * 60 - currentTotalMinutes;
62
+ minutesToNextWorkingHours = minutesUntilMidnight + startTotalMinutes;
63
+ }
64
+ }
65
+ await onComplete({
66
+ data_points: {
67
+ isWithinWorkingHours: String(isWithinWorkingHours),
68
+ minutesToNextWorkingHours: minutesToNextWorkingHours !== undefined
69
+ ? String(minutesToNextWorkingHours)
70
+ : undefined,
71
+ },
72
+ });
73
+ },
74
+ };
75
+ //# sourceMappingURL=checkWorkingHours.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkWorkingHours.js","sourceRoot":"","sources":["../../../../../extensions/dateHelpers/actions/checkWorkingHours/checkWorkingHours.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AACxD,uCAA+C;AAC/C,6CAA4C;AAE5C,qCAAqE;AAExD,QAAA,iBAAiB,GAI1B;IACF,GAAG,EAAE,mBAAmB;IACxB,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,sGAAsG;IACxG,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACxD,MAAM,EAAE,iBAAiB,EAAE,eAAe,EAAE,QAAQ,EAAE,GACpD,+BAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE9C,uBAAuB;QACvB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QAEtB,qDAAqD;QACrD,MAAM,qBAAqB,GAAG,IAAA,4BAAc,EAAC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,GAAG,iBAAiB,GAAG,mBAAmB,CAAA;YACrE,CAAC;iBAAM,CAAC;gBACN,+DAA+D;gBAC/D,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,mBAAmB,CAAA;gBAC1D,yBAAyB,GAAG,oBAAoB,GAAG,iBAAiB,CAAA;YACtE,CAAC;QACH,CAAC;QAED,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,CAAC;gBAClD,yBAAyB,EACvB,yBAAyB,KAAK,SAAS;oBACrC,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC;oBACnC,CAAC,CAAC,SAAS;aAChB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -0,0 +1,10 @@
1
+ export declare const dataPoints: {
2
+ isWithinWorkingHours: {
3
+ key: string;
4
+ valueType: "boolean";
5
+ };
6
+ minutesToNextWorkingHours: {
7
+ key: string;
8
+ valueType: "number";
9
+ };
10
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {
5
+ isWithinWorkingHours: {
6
+ key: 'isWithinWorkingHours',
7
+ valueType: 'boolean',
8
+ },
9
+ minutesToNextWorkingHours: {
10
+ key: 'minutesToNextWorkingHours',
11
+ valueType: 'number',
12
+ },
13
+ };
14
+ //# sourceMappingURL=dataPoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/dateHelpers/actions/checkWorkingHours/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,oBAAoB,EAAE;QACpB,GAAG,EAAE,sBAAsB;QAC3B,SAAS,EAAE,SAAS;KACrB;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,2BAA2B;QAChC,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ import { FieldType } from '@awell-health/extensions-core';
3
+ export declare const fields: {
4
+ workingHoursStart: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ };
11
+ workingHoursEnd: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: true;
17
+ };
18
+ timezone: {
19
+ id: string;
20
+ label: string;
21
+ description: string;
22
+ type: FieldType.STRING;
23
+ required: false;
24
+ };
25
+ };
26
+ export declare const FieldsValidationSchema: z.ZodObject<{
27
+ workingHoursStart: z.ZodString;
28
+ workingHoursEnd: z.ZodString;
29
+ timezone: z.ZodDefault<z.ZodOptional<z.ZodString>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ timezone: string;
32
+ workingHoursStart: string;
33
+ workingHoursEnd: string;
34
+ }, {
35
+ workingHoursStart: string;
36
+ workingHoursEnd: string;
37
+ timezone?: string | undefined;
38
+ }>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldsValidationSchema = exports.fields = void 0;
4
+ const zod_1 = require("zod");
5
+ const extensions_core_1 = require("@awell-health/extensions-core");
6
+ exports.fields = {
7
+ workingHoursStart: {
8
+ id: 'workingHoursStart',
9
+ label: 'Working hours start',
10
+ description: 'The start time of working hours in HH:MM format (e.g., "09:00"). Uses 24-hour format.',
11
+ type: extensions_core_1.FieldType.STRING,
12
+ required: true,
13
+ },
14
+ workingHoursEnd: {
15
+ id: 'workingHoursEnd',
16
+ label: 'Working hours end',
17
+ description: 'The end time of working hours in HH:MM format (e.g., "17:00"). Uses 24-hour format.',
18
+ type: extensions_core_1.FieldType.STRING,
19
+ required: true,
20
+ },
21
+ timezone: {
22
+ id: 'timezone',
23
+ label: 'Timezone',
24
+ description: 'The IANA timezone identifier to use for the working hours check (e.g., "America/New_York", "Europe/London", "Asia/Tokyo", "UTC"). If not specified, UTC will be used.',
25
+ type: extensions_core_1.FieldType.STRING,
26
+ required: false,
27
+ },
28
+ };
29
+ exports.FieldsValidationSchema = zod_1.z.object({
30
+ workingHoursStart: zod_1.z.string().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/, {
31
+ message: 'Working hours start must be in HH:MM format (e.g., "09:00")',
32
+ }),
33
+ workingHoursEnd: zod_1.z.string().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/, {
34
+ message: 'Working hours end must be in HH:MM format (e.g., "17:00")',
35
+ }),
36
+ timezone: zod_1.z.string().optional().default('UTC'),
37
+ });
38
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/dateHelpers/actions/checkWorkingHours/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAAqE;AAExD,QAAA,MAAM,GAAG;IACpB,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACT,uFAAuF;QACzF,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,eAAe,EAAE;QACf,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,qFAAqF;QACvF,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,UAAU;QACjB,WAAW,EACT,uKAAuK;QACzK,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mCAAmC,EAAE;QACvE,OAAO,EAAE,6DAA6D;KACvE,CAAC;IACF,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mCAAmC,EAAE;QACrE,OAAO,EAAE,2DAA2D;KACrE,CAAC;IACF,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACG,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { fields, FieldsValidationSchema } from './fields';
2
+ export { dataPoints } from './dataPoints';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = exports.FieldsValidationSchema = exports.fields = void 0;
4
+ var fields_1 = require("./fields");
5
+ Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
6
+ Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
7
+ var dataPoints_1 = require("./dataPoints");
8
+ Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return dataPoints_1.dataPoints; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/dateHelpers/actions/checkWorkingHours/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1 @@
1
+ export * from './checkWorkingHours';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./checkWorkingHours"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/dateHelpers/actions/checkWorkingHours/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAmC"}
@@ -15,4 +15,27 @@ export declare const actions: {
15
15
  required: false;
16
16
  };
17
17
  }, {}, "nextWorkday" | "referenceDateIsWeekday">;
18
+ checkWorkingHours: import("@awell-health/extensions-core").Action<{
19
+ workingHoursStart: {
20
+ id: string;
21
+ label: string;
22
+ description: string;
23
+ type: import("@awell-health/extensions-core").FieldType.STRING;
24
+ required: true;
25
+ };
26
+ workingHoursEnd: {
27
+ id: string;
28
+ label: string;
29
+ description: string;
30
+ type: import("@awell-health/extensions-core").FieldType.STRING;
31
+ required: true;
32
+ };
33
+ timezone: {
34
+ id: string;
35
+ label: string;
36
+ description: string;
37
+ type: import("@awell-health/extensions-core").FieldType.STRING;
38
+ required: false;
39
+ };
40
+ }, {}, "isWithinWorkingHours" | "minutesToNextWorkingHours">;
18
41
  };
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.actions = void 0;
4
4
  const getNextWorkday_1 = require("./getNextWorkday");
5
+ const checkWorkingHours_1 = require("./checkWorkingHours");
5
6
  exports.actions = {
6
7
  getNextWorkday: getNextWorkday_1.getNextWorkday,
8
+ checkWorkingHours: checkWorkingHours_1.checkWorkingHours,
7
9
  };
8
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/dateHelpers/actions/index.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEpC,QAAA,OAAO,GAAG;IACrB,cAAc,EAAd,+BAAc;CACf,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/dateHelpers/actions/index.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AACjD,2DAAuD;AAE1C,QAAA,OAAO,GAAG;IACrB,cAAc,EAAd,+BAAc;IACd,iBAAiB,EAAjB,qCAAiB;CAClB,CAAA"}
@@ -34,8 +34,8 @@ export declare const UpdateTicketInputSchema: z.ZodObject<{
34
34
  priority?: 1 | 2 | 3 | 4 | undefined;
35
35
  phone?: string | undefined;
36
36
  name?: string | undefined;
37
- subject?: string | null | undefined;
38
37
  parent_id?: number | undefined;
38
+ subject?: string | null | undefined;
39
39
  description?: string | undefined;
40
40
  tags?: string[] | undefined;
41
41
  group_id?: number | undefined;
@@ -62,8 +62,8 @@ export declare const UpdateTicketInputSchema: z.ZodObject<{
62
62
  priority?: 1 | 2 | 3 | 4 | undefined;
63
63
  phone?: string | undefined;
64
64
  name?: string | undefined;
65
- subject?: string | null | undefined;
66
65
  parent_id?: number | undefined;
66
+ subject?: string | null | undefined;
67
67
  description?: string | undefined;
68
68
  tags?: string[] | undefined;
69
69
  group_id?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.1.26",
3
+ "version": "2.1.27",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {