@awell-health/awell-extensions 1.0.70 → 1.0.72
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/dist/extensions/healthie/actions/createPatient.d.ts +0 -1
- package/dist/extensions/healthie/actions/createPatient.js +1 -2
- package/dist/extensions/healthie/actions/createPatient.js.map +1 -1
- package/dist/extensions/healthie/actions/index.d.ts +0 -1
- package/dist/extensions/markdown.json +1 -1
- package/dist/extensions/sendbird/v1/actions/createTicket/config/dataPoints.d.ts +8 -0
- package/dist/extensions/sendbird/v1/actions/createTicket/config/dataPoints.js +8 -0
- package/dist/extensions/sendbird/v1/actions/createTicket/config/dataPoints.js.map +1 -1
- package/dist/extensions/sendbird/v1/actions/createTicket/config/fields.d.ts +10 -0
- package/dist/extensions/sendbird/v1/actions/createTicket/config/fields.js +8 -0
- package/dist/extensions/sendbird/v1/actions/createTicket/config/fields.js.map +1 -1
- package/dist/extensions/sendbird/v1/actions/createTicket/createTicket.js +19 -2
- package/dist/extensions/sendbird/v1/actions/createTicket/createTicket.js.map +1 -1
- package/dist/extensions/sendbird/v1/actions/createTicket/createTicket.test.js +7 -1
- package/dist/extensions/sendbird/v1/actions/createTicket/createTicket.test.js.map +1 -1
- package/dist/extensions/sendbird/v1/types.d.ts +3 -0
- package/package.json +1 -1
@@ -31,7 +31,7 @@ const fields = {
|
|
31
31
|
skipped_email: {
|
32
32
|
id: 'skipped_email',
|
33
33
|
label: 'Skipped email.',
|
34
|
-
description: 'When
|
34
|
+
description: 'When disabled, an email is not required to create the patient.',
|
35
35
|
type: extensions_core_1.FieldType.BOOLEAN,
|
36
36
|
},
|
37
37
|
email: {
|
@@ -39,7 +39,6 @@ const fields = {
|
|
39
39
|
label: 'Email',
|
40
40
|
description: 'The email address of the patient.',
|
41
41
|
type: extensions_core_1.FieldType.STRING,
|
42
|
-
stringType: extensions_core_1.StringType.EMAIL,
|
43
42
|
required: true, // required until conditional field validation is implemented (based on `skipped_email`)
|
44
43
|
},
|
45
44
|
phone_number: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createPatient.js","sourceRoot":"","sources":["../../../../extensions/healthie/actions/createPatient.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAC9B,mEAMsC;AACtC,mEAAwD;AACxD,oCAAmC;AACnC,oDAAmD;AAEnD,sCAAqE;AAErE,MAAM,MAAM,GAAG;IACb,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,2FAA2F;QAC7F,IAAI,EAAE,2BAAS,CAAC,MAAM;KACvB;IACD,aAAa,EAAE;QACb,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,
|
1
|
+
{"version":3,"file":"createPatient.js","sourceRoot":"","sources":["../../../../extensions/healthie/actions/createPatient.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAC9B,mEAMsC;AACtC,mEAAwD;AACxD,oCAAmC;AACnC,oDAAmD;AAEnD,sCAAqE;AAErE,MAAM,MAAM,GAAG;IACb,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,+B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,CAAC,YAAY,0CAAE,IAAI,0CAAE,EAAE,CAAA;gBAErD,MAAM,UAAU,CAAC;oBACf,WAAW,EAAE;wBACX,iBAAiB;qBAClB;iBACF,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,4CAA4C,EAAE;4BAC1D,KAAK,EAAE;gCACL,QAAQ,EAAE,kBAAkB;gCAC5B,OAAO,EAAE,4BAA4B;6BACtC;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,sBAAa,EAAE;gBAChC,MAAM,MAAM,GAAG,IAAA,mCAA0B,EAAC,GAAG,CAAC,MAAM,CAAC,CAAA;gBACrD,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE,MAAM;iBACf,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,KAAK,GAAG,GAAY,CAAA;gBAC1B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,gCAAgC,EAAE;4BAC9C,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,KAAK,CAAC,OAAO;6BACvB;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
|
@@ -240,7 +240,6 @@ export declare const actions: {
|
|
240
240
|
label: string;
|
241
241
|
description: string;
|
242
242
|
type: import("@awell-health/extensions-core").FieldType.STRING;
|
243
|
-
stringType: import("@awell-health/extensions-core").StringType.EMAIL;
|
244
243
|
required: true;
|
245
244
|
};
|
246
245
|
phone_number: {
|
@@ -65,7 +65,7 @@
|
|
65
65
|
},
|
66
66
|
"sendbird": {
|
67
67
|
"readme": "---\ntitle: Sendbird\ndescription: Sendbird is a cloud-based chat and messaging platform that enables developers to integrate real-time messaging functionality into their applications.\n---\n\n# Sendbird\n\nSendbird is a cloud-based chat and messaging platform that enables developers to integrate real-time messaging functionality into their applications.\n\nSendbird offers a range of features, including real-time chat, group chat, one-on-one messaging, push notifications, and file sharing. It supports various platforms and programming languages, making it flexible and accessible for developers to integrate with different applications.\n\n## Extension settings\n\nIn order to set up this extension, you will need:\n\n1. An **Application ID** - visit https://dashboard.sendbird.com/ to retrieve **Application ID** for the app of your choosing\n2. A **Chat API token** - visit Application's settings and go to **Settings > Application > General > API tokens** to retrieve either Master API token or Secondary API token\n3. A **Desk API token** - visit Application's settings and go to **Settings > Desk > Credentials** to retrieve Desk API token\n\n## Custom Actions\n\n### Create user\n\nCreates a user in Sendbird using the Chat API. See [Update metadata](#update-metadata) to check metadata field details. The `userId` of the newly created user is then saved as a data point.\n\n### Update user\n\nUpdates a user using the Chat API.\n\nPlease note that updating `metadata` of a user needs to be done with the [Update metadata action](#update-metadata).\n\n### Delete user\n\nDeletes a user in Sendbird using the Chat API.\n\n### Get user\n\nRetrieve information about a user using the Chat API. The following fields are saved as a data point:\n\n- Nickname\n- Access token\n- Is active\n- Created at\n- Last seen at\n- Has ever logged in\n- Metadata (stored as string)\n\n### Update metadata\n\nUpdates the user's metadata using the Chat API. Only updates existing or adds new fields to metadata. To delete some metedata fields, check the [Delete metadata action](#delete-metadata).\n\nMetadata is a JSON object that can store up to five key-value items of additional user information such as a phone number, an email address, or a long description of the user. The key must not have a comma (,) and its length is limited to 128 characters. The value must be a string and its length is limited to 190 characters.\n\n### Delete metadata\n\nDeletes user metadata using the Chat API. Takes the key of a metadata item to be deleted (deletes one key at a time if a key is provided). If not specified, all items of the metadata are deleted.\n\n### Deactivate user\n\nDeactivates a user, using the \"Update user\" endpoint, in the Chat API. Optionally, it can be set for the user to `Leave all group channels upon deactivation`.\n\nThe user is deactivated by setting `is_active` to false.\n\n### Activate user\n\nActivates a user, using the \"Update user\" endpoint, in the Chat API. The user is activated by setting `is_active` to true.\n\n### Create customer\n\nCreates a customer using the Desk API. Only the `sendbirdId` is passed and it must be an ID that already exists in Sendbird's Chat platform (eg: the `userId` of an existing user). The `customerId` of the newly created customer is stored as data point.\n\nTo add custom fields to your customer, use the [Update custom fields action](#update-customers-custom-fields).\n\n### Get customer\n\nRetrieves information on a specific customer using the Desk API. The following fields are saved as a data point:\n\n- Sendbird ID\n- Channel Type\n- Project\n- Created At\n- Display Name\n- Custom Fields (stored as string)\n\n### Update customer's custom fields\n\nUpdates a customer's custom fields using the Desk API.\n\nCustom fields is a JSON object that can store up to twenty key-value items for additional customer information such as a phone number, an email address, or a long description of the customer.\n\nThe specified keys must be registered as a custom field in Settings > Customer fields of your dashboard beforehand. The key must not have a comma (,) and its length is limited to 20 characters. The value's length is limited to 190 characters.\n\n### Create ticket\n\nCreates a ticket using the Desk API. The `ticketId` of the newly created ticket is stored as data point.\n\nPlease note that the Ticket won't be shown in the Sendbird console **until** the user for which that Ticket was created writes a message inside the Chat.\n",
|
68
|
-
"changelog": "# Sendbird changelog\n"
|
68
|
+
"changelog": "# Sendbird changelog\n\n## 2023-08-22\n\n- add `relatedChannelUrls` field to `Create ticket` action\n"
|
69
69
|
},
|
70
70
|
"sendgrid-extension": {
|
71
71
|
"readme": "---\ntitle: Sendgrid\ndescription: SendGrid is a cloud-based email delivery platform that provides services for sending and managing email campaigns, transactional emails, and other types of messages.\n---\n# Sendgrid\n\nSendGrid is a cloud-based email delivery platform that provides services for sending and managing email campaigns, transactional emails, and other types of messages.\n\n## Extension settings\n\nIn order to set up this extension, you will need to provide:\n\n1. An API key\n2. A from name\n3. A from email\n\n## Custom Actions\n\n### Send email\n\nAllows for sending a plain email to a recipient.\n\n### Send email with a template\n\nAllows for sending an email based on a template to a recipient. You can also insert variables so they are rendered in your template.\n\n### Add or update contact\n\nAllows adding or updating contacts. The contact to update will be determined only by the email field and any fields omitted from the request will remain as they were. A contact's ID cannot be used to update the contact.\n\nPlease note that custom fields need to have been already created if you wish to set their values for the contacts being upserted. To do this, please use the \"Create Custom Field Definition\" endpoint. They also can be created in **Marketing -> Custom Fields** section in Sendgrid.\n\n### Add and remove emails from suppression lists\n\nSuppression lists ([link on SendGrid's website](https://docs.sendgrid.com/api-reference/suppressions-suppressions/add-suppressions-to-a-suppression-group)) are unsubscribe groups. Use these actions to add an email address to any number of unsubscribe groups. You can apply a suppression add/remove to multiple groups by using comma-separated lists for the groups. Only a single email can be used. **This functionality is different from SendGrid's API, which allows multiple email addresses for a single group**.\n\n### Check an import status\n\nAllows user to check the status of contact import jobs when given a jobID. Statuses are either: `pending`, `completed`, `failed`, or `errored`.",
|
@@ -10,5 +10,13 @@ exports.dataPoints = {
|
|
10
10
|
*/
|
11
11
|
valueType: 'number',
|
12
12
|
},
|
13
|
+
channelUrl: {
|
14
|
+
key: 'channelUrl',
|
15
|
+
valueType: 'string',
|
16
|
+
},
|
17
|
+
relatedChannelUrls: {
|
18
|
+
key: 'relatedChannelUrls',
|
19
|
+
valueType: 'string',
|
20
|
+
},
|
13
21
|
};
|
14
22
|
//# sourceMappingURL=dataPoints.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../../extensions/sendbird/v1/actions/createTicket/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf;;;UAGE;QACF,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../../extensions/sendbird/v1/actions/createTicket/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf;;;UAGE;QACF,SAAS,EAAE,QAAQ;KACpB;IACD,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,QAAQ;KACpB;IACD,kBAAkB,EAAE;QAClB,GAAG,EAAE,oBAAoB;QACzB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
@@ -16,6 +16,13 @@ export declare const fields: {
|
|
16
16
|
required: true;
|
17
17
|
description: string;
|
18
18
|
};
|
19
|
+
relatedChannelUrls: {
|
20
|
+
label: string;
|
21
|
+
id: string;
|
22
|
+
type: FieldType.STRING;
|
23
|
+
required: false;
|
24
|
+
description: string;
|
25
|
+
};
|
19
26
|
groupKey: {
|
20
27
|
label: string;
|
21
28
|
id: string;
|
@@ -41,18 +48,21 @@ export declare const fields: {
|
|
41
48
|
export declare const FieldsValidationSchema: z.ZodObject<{
|
42
49
|
customerId: z.ZodNumber;
|
43
50
|
channelName: z.ZodString;
|
51
|
+
relatedChannelUrls: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
|
44
52
|
groupKey: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
|
45
53
|
priority: z.ZodUnion<[z.ZodOptional<z.ZodEnum<[TicketPriority, ...TicketPriority[]]>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
|
46
54
|
customFields: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, import("../../../types").Metadata, string>, string, string>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
|
47
55
|
}, "strip", z.ZodTypeAny, {
|
48
56
|
channelName: string;
|
49
57
|
customerId: number;
|
58
|
+
relatedChannelUrls?: string | undefined;
|
50
59
|
groupKey?: string | undefined;
|
51
60
|
priority?: TicketPriority | undefined;
|
52
61
|
customFields?: string | undefined;
|
53
62
|
}, {
|
54
63
|
channelName: string;
|
55
64
|
customerId: number;
|
65
|
+
relatedChannelUrls?: string | undefined;
|
56
66
|
groupKey?: string | undefined;
|
57
67
|
priority?: "" | TicketPriority | undefined;
|
58
68
|
customFields?: string | undefined;
|
@@ -20,6 +20,13 @@ exports.fields = {
|
|
20
20
|
required: true,
|
21
21
|
description: 'Specifies the title of a ticket, which will be the group channel name in Sendbird Chat platform as well. Maximum length is 100 characters.',
|
22
22
|
},
|
23
|
+
relatedChannelUrls: {
|
24
|
+
label: 'Related channel URLs',
|
25
|
+
id: 'relatedChannelUrls',
|
26
|
+
type: extensions_core_1.FieldType.STRING,
|
27
|
+
required: false,
|
28
|
+
description: 'A comma-separated string of group channel URLs for reference, where the corresponding customer belongs. Can have up to 3 group channel URLs.',
|
29
|
+
},
|
23
30
|
groupKey: {
|
24
31
|
label: 'Group key',
|
25
32
|
id: 'groupKey',
|
@@ -46,6 +53,7 @@ const priorityEnum = zod_1.z.enum(Object.values(types_1.TicketPriority));
|
|
46
53
|
exports.FieldsValidationSchema = zod_1.z.object({
|
47
54
|
customerId: zod_1.z.coerce.number(),
|
48
55
|
channelName: zod_1.z.string().max(100).nonempty(),
|
56
|
+
relatedChannelUrls: (0, extensions_core_1.makeStringOptional)((0, extensions_core_1.validateCommaSeparatedList)((value) => zod_1.z.string().safeParse(value).success, false)),
|
49
57
|
groupKey: (0, extensions_core_1.makeStringOptional)(zod_1.z.string().regex(/^[a-z0-9\-_]*$/)),
|
50
58
|
priority: (0, extensions_core_1.makeStringOptional)(priorityEnum),
|
51
59
|
customFields: (0, extensions_core_1.makeStringOptional)(validation_1.CustomFieldsValidationSchema),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/sendbird/v1/actions/createTicket/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/sendbird/v1/actions/createTicket/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAKsC;AACtC,oDAAkE;AAClE,0CA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,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3C,kBAAkB,EAAE,IAAA,oCAAkB,EACpC,IAAA,4CAA0B,EACxB,CAAC,KAAK,EAAE,EAAE,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAC9C,KAAK,CACN,CACF;IACD,QAAQ,EAAE,IAAA,oCAAkB,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAChE,QAAQ,EAAE,IAAA,oCAAkB,EAAC,YAAY,CAAC;IAC1C,YAAY,EAAE,IAAA,oCAAkB,EAAC,yCAA4B,CAAC;CACb,CAAC,CAAA"}
|
@@ -7,6 +7,7 @@ const extensions_core_1 = require("@awell-health/extensions-core");
|
|
7
7
|
const settings_1 = require("../../../settings");
|
8
8
|
const config_1 = require("./config");
|
9
9
|
const client_1 = require("../../client");
|
10
|
+
const lodash_1 = require("lodash");
|
10
11
|
exports.createTicket = {
|
11
12
|
key: 'createTicket',
|
12
13
|
title: 'Create ticket',
|
@@ -16,8 +17,9 @@ exports.createTicket = {
|
|
16
17
|
dataPoints: config_1.dataPoints,
|
17
18
|
previewable: false,
|
18
19
|
onActivityCreated: async (payload, onComplete, onError) => {
|
20
|
+
var _a;
|
19
21
|
try {
|
20
|
-
const { settings: { applicationId, chatApiToken, deskApiToken }, fields: { customerId, channelName, groupKey, priority, customFields }, } = (0, extensions_core_1.validate)({
|
22
|
+
const { settings: { applicationId, chatApiToken, deskApiToken }, fields: { customerId, channelName, groupKey, priority, customFields, relatedChannelUrls, }, } = (0, extensions_core_1.validate)({
|
21
23
|
schema: zod_1.z.object({
|
22
24
|
settings: settings_1.SettingsValidationSchema,
|
23
25
|
fields: config_1.FieldsValidationSchema,
|
@@ -35,8 +37,23 @@ exports.createTicket = {
|
|
35
37
|
groupKey,
|
36
38
|
priority,
|
37
39
|
customFields,
|
40
|
+
relatedChannelUrls,
|
41
|
+
});
|
42
|
+
const { data: { id, channelUrl, relatedChannels }, } = res;
|
43
|
+
/**
|
44
|
+
* Array data point types not supported yet so storing as a comma-separated string
|
45
|
+
*/
|
46
|
+
const relatedChannelUrlsArray = (0, lodash_1.isEmpty)(relatedChannels) || (0, lodash_1.isNil)(relatedChannels)
|
47
|
+
? undefined
|
48
|
+
: JSON.parse(relatedChannels);
|
49
|
+
const relatedChannelUrlsDataPoint = (_a = relatedChannelUrlsArray === null || relatedChannelUrlsArray === void 0 ? void 0 : relatedChannelUrlsArray.map((value) => value.channel_url).join(',')) !== null && _a !== void 0 ? _a : undefined;
|
50
|
+
await onComplete({
|
51
|
+
data_points: {
|
52
|
+
ticketId: String(id),
|
53
|
+
channelUrl,
|
54
|
+
relatedChannelUrls: relatedChannelUrlsDataPoint,
|
55
|
+
},
|
38
56
|
});
|
39
|
-
await onComplete({ data_points: { ticketId: String(res.data.id) } });
|
40
57
|
}
|
41
58
|
catch (err) {
|
42
59
|
if (err instanceof zod_1.ZodError) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createTicket.js","sourceRoot":"","sources":["../../../../../../extensions/sendbird/v1/actions/createTicket/createTicket.ts"],"names":[],"mappings":";;;AAAA,6BAAiC;AACjC,+DAAmD;AAGnD,mEAAkE;AAClE,gDAA4D;AAC5D,qCAAqE;AACrE,yCAIqB;
|
1
|
+
{"version":3,"file":"createTicket.js","sourceRoot":"","sources":["../../../../../../extensions/sendbird/v1/actions/createTicket/createTicket.ts"],"names":[],"mappings":";;;AAAA,6BAAiC;AACjC,+DAAmD;AAGnD,mEAAkE;AAClE,gDAA4D;AAC5D,qCAAqE;AACrE,yCAIqB;AACrB,mCAAuC;AAE1B,QAAA,YAAY,GAA2C;IAClE,GAAG,EAAE,cAAc;IACnB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,sCAAsC;IACnD,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAN,e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M,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;oBACpB,UAAU;oBACV,kBAAkB,EAAE,2BAA2B;iBAChD;aACF,CAAC,CAAA;SACH;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,cAAQ,EAAE;gBAC3B,MAAM,KAAK,GAAG,IAAA,mCAAY,EAAC,GAAG,CAAC,CAAA;gBAC/B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;4BAC3B,KAAK,EAAE;gCACL,QAAQ,EAAE,aAAa;gCACvB,OAAO,EAAE,KAAK,CAAC,OAAO;6BACvB;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;iBAAM,IAAI,IAAA,4BAAmB,EAAC,GAAG,CAAC,EAAE;gBACnC,MAAM,MAAM,GAAG,IAAA,yCAAgC,EAAC,GAAG,CAAC,CAAA;gBACpD,MAAM,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;aAC1B;iBAAM;gBACL,MAAM,OAAO,GAAI,GAAa,CAAC,OAAO,CAAA;gBACtC,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE;4BACrB,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO;6BACR;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
|
@@ -19,6 +19,7 @@ describe('Create ticket', () => {
|
|
19
19
|
fields: {
|
20
20
|
customerId: __mocks__1.mockedTicketData.customer.id,
|
21
21
|
channelName: __mocks__1.mockedTicketData.channelName,
|
22
|
+
relatedChannelUrls: `${__mocks__1.mockedChannelNames.channel1},${__mocks__1.mockedChannelNames.channel2}`,
|
22
23
|
groupKey: __mocks__1.mockedTicketData.group.key,
|
23
24
|
priority: __mocks__1.mockedTicketData.priority,
|
24
25
|
customFields: JSON.stringify({
|
@@ -39,6 +40,7 @@ describe('Create ticket', () => {
|
|
39
40
|
expect(__mocks__1.SendbirdClientMockImplementation.deskApi.createTicket).toHaveBeenCalledWith({
|
40
41
|
customerId: __mocks__1.mockedTicketData.customer.id,
|
41
42
|
channelName: __mocks__1.mockedTicketData.channelName,
|
43
|
+
relatedChannelUrls: `${__mocks__1.mockedChannelNames.channel1},${__mocks__1.mockedChannelNames.channel2}`,
|
42
44
|
groupKey: __mocks__1.mockedTicketData.group.key,
|
43
45
|
priority: __mocks__1.mockedTicketData.priority,
|
44
46
|
customFields: JSON.stringify({
|
@@ -46,7 +48,11 @@ describe('Create ticket', () => {
|
|
46
48
|
}),
|
47
49
|
});
|
48
50
|
expect(onComplete).toHaveBeenCalledWith({
|
49
|
-
data_points: {
|
51
|
+
data_points: {
|
52
|
+
ticketId: String(__mocks__1.mockedTicketData.id),
|
53
|
+
channelUrl: __mocks__1.mockedTicketData.channelUrl,
|
54
|
+
relatedChannelUrls: `${__mocks__1.mockedChannelNames.channel1},${__mocks__1.mockedChannelNames.channel2}`,
|
55
|
+
},
|
50
56
|
});
|
51
57
|
expect(onError).not.toHaveBeenCalled();
|
52
58
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createTicket.test.js","sourceRoot":"","sources":["../../../../../../extensions/sendbird/v1/actions/createTicket/createTicket.test.ts"],"names":[],"mappings":";;AAAA,
|
1
|
+
{"version":3,"file":"createTicket.test.js","sourceRoot":"","sources":["../../../../../../extensions/sendbird/v1/actions/createTicket/createTicket.test.ts"],"names":[],"mappings":";;AAAA,qDAI+B;AAC/B,0BAAiC;AACjC,oDAA8D;AAE9D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;AAEzB,Q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AAoB,CAAC;YACrB,UAAU,EAAE,2BAAgB,CAAC,QAAQ,CAAC,EAAE;YACxC,WAAW,EAAE,2BAAgB,CAAC,WAAW;YACzC,kBAAkB,EAAE,GAAG,6BAAkB,CAAC,QAAQ,IAAI,6BAAkB,CAAC,QAAQ,EAAE;YACnF,QAAQ,EAAE,2BAAgB,CAAC,KAAK,CAAC,GAAG;YACpC,QAAQ,EAAE,2BAAgB,CAAC,QAAQ;YACnC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;gBAC3B,CAAC,2BAAgB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EACpC,2BAAgB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK;aACzC,CAAC;SACH,CAAC,CAAA;QACF,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,QAAQ,EAAE,MAAM,CAAC,2BAAgB,CAAC,EAAE,CAAC;gBACrC,UAAU,EAAE,2BAAgB,CAAC,UAAU;gBACvC,kBAAkB,EAAE,GAAG,6BAAkB,CAAC,QAAQ,IAAI,6BAAkB,CAAC,QAAQ,EAAE;aACpF;SACF,CAAC,CAAA;QACF,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAA;IACxC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -67,10 +67,13 @@ export interface Ticket {
|
|
67
67
|
createdAt: string;
|
68
68
|
issuedAt: string;
|
69
69
|
closedAt: string;
|
70
|
+
channelUrl: string;
|
71
|
+
relatedChannels?: string;
|
70
72
|
}
|
71
73
|
export interface CreateTicketInput extends Pick<Ticket, 'channelName'> {
|
72
74
|
customerId: number;
|
73
75
|
groupKey?: string;
|
74
76
|
customFields?: string;
|
75
77
|
priority?: TicketPriority;
|
78
|
+
relatedChannelUrls?: string;
|
76
79
|
}
|