@skyswitch/piece-connectuc 0.0.1
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/README.md +7 -0
- package/bun.lockb +0 -0
- package/package.json +27 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +70 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-contact.d.ts +10 -0
- package/src/lib/actions/create-contact.d.ts.map +1 -0
- package/src/lib/actions/create-contact.js +87 -0
- package/src/lib/actions/create-contact.js.map +1 -0
- package/src/lib/actions/do-not-disturb.d.ts +5 -0
- package/src/lib/actions/do-not-disturb.d.ts.map +1 -0
- package/src/lib/actions/do-not-disturb.js +53 -0
- package/src/lib/actions/do-not-disturb.js.map +1 -0
- package/src/lib/actions/initiate-call.d.ts +7 -0
- package/src/lib/actions/initiate-call.d.ts.map +1 -0
- package/src/lib/actions/initiate-call.js +68 -0
- package/src/lib/actions/initiate-call.js.map +1 -0
- package/src/lib/actions/send-sms.d.ts +7 -0
- package/src/lib/actions/send-sms.d.ts.map +1 -0
- package/src/lib/actions/send-sms.js +76 -0
- package/src/lib/actions/send-sms.js.map +1 -0
- package/src/lib/common/api-helpers.d.ts +16 -0
- package/src/lib/common/api-helpers.d.ts.map +1 -0
- package/src/lib/common/api-helpers.js +28 -0
- package/src/lib/common/api-helpers.js.map +1 -0
- package/src/lib/common/webhook-helpers.d.ts +35 -0
- package/src/lib/common/webhook-helpers.d.ts.map +1 -0
- package/src/lib/common/webhook-helpers.js +100 -0
- package/src/lib/common/webhook-helpers.js.map +1 -0
- package/src/lib/triggers/EXAMPLE_NEW_TRIGGER.d.ts +27 -0
- package/src/lib/triggers/EXAMPLE_NEW_TRIGGER.d.ts.map +1 -0
- package/src/lib/triggers/EXAMPLE_NEW_TRIGGER.js +85 -0
- package/src/lib/triggers/EXAMPLE_NEW_TRIGGER.js.map +1 -0
- package/src/lib/triggers/new-cdr.d.ts +11 -0
- package/src/lib/triggers/new-cdr.d.ts.map +1 -0
- package/src/lib/triggers/new-cdr.js +73 -0
- package/src/lib/triggers/new-cdr.js.map +1 -0
- package/src/lib/triggers/new-incoming-call.d.ts +15 -0
- package/src/lib/triggers/new-incoming-call.d.ts.map +1 -0
- package/src/lib/triggers/new-incoming-call.js +77 -0
- package/src/lib/triggers/new-incoming-call.js.map +1 -0
- package/src/lib/triggers/new-outgoing-call.d.ts +11 -0
- package/src/lib/triggers/new-outgoing-call.d.ts.map +1 -0
- package/src/lib/triggers/new-outgoing-call.js +64 -0
- package/src/lib/triggers/new-outgoing-call.js.map +1 -0
- package/src/lib/triggers/new-recording.d.ts +11 -0
- package/src/lib/triggers/new-recording.d.ts.map +1 -0
- package/src/lib/triggers/new-recording.js +64 -0
- package/src/lib/triggers/new-recording.js.map +1 -0
- package/src/lib/triggers/new-sms.d.ts +11 -0
- package/src/lib/triggers/new-sms.d.ts.map +1 -0
- package/src/lib/triggers/new-sms.js +71 -0
- package/src/lib/triggers/new-sms.js.map +1 -0
- package/src/lib/triggers/new-voicemail.d.ts +11 -0
- package/src/lib/triggers/new-voicemail.d.ts.map +1 -0
- package/src/lib/triggers/new-voicemail.js +67 -0
- package/src/lib/triggers/new-voicemail.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -0
package/README.md
ADDED
package/bun.lockb
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skyswitch/piece-connectuc",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"types": "./src/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@sinclair/typebox": "0.34.11",
|
|
9
|
+
"ai": "^6.0.0",
|
|
10
|
+
"axios": "1.13.1",
|
|
11
|
+
"axios-retry": "4.4.1",
|
|
12
|
+
"deepmerge-ts": "7.1.0",
|
|
13
|
+
"form-data": "4.0.4",
|
|
14
|
+
"mime-types": "2.1.35",
|
|
15
|
+
"nanoid": "3.3.8",
|
|
16
|
+
"semver": "7.6.0",
|
|
17
|
+
"socket.io-client": "4.8.1",
|
|
18
|
+
"tslib": "^2.3.0",
|
|
19
|
+
"zod": "4.1.13",
|
|
20
|
+
"@activepieces/pieces-common": "0.11.5",
|
|
21
|
+
"@activepieces/pieces-framework": "0.25.3",
|
|
22
|
+
"@activepieces/shared": "0.35.0"
|
|
23
|
+
},
|
|
24
|
+
"resolutions": {
|
|
25
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const connectucAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
|
|
2
|
+
export declare const connectuc: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/pieces/community/connectuc/src/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,aAAa,+GA+CxB,CAAC;AAEH,eAAO,MAAM,SAAS,+JAQpB,CAAC"}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectuc = exports.connectucAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const new_recording_1 = require("./lib/triggers/new-recording");
|
|
8
|
+
const new_cdr_1 = require("./lib/triggers/new-cdr");
|
|
9
|
+
const new_incoming_call_1 = require("./lib/triggers/new-incoming-call");
|
|
10
|
+
const new_outgoing_call_1 = require("./lib/triggers/new-outgoing-call");
|
|
11
|
+
const new_voicemail_1 = require("./lib/triggers/new-voicemail");
|
|
12
|
+
const new_sms_1 = require("./lib/triggers/new-sms");
|
|
13
|
+
const create_contact_1 = require("./lib/actions/create-contact");
|
|
14
|
+
const do_not_disturb_1 = require("./lib/actions/do-not-disturb");
|
|
15
|
+
const initiate_call_1 = require("./lib/actions/initiate-call");
|
|
16
|
+
const send_sms_1 = require("./lib/actions/send-sms");
|
|
17
|
+
exports.connectucAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
18
|
+
authUrl: "https://auth.uc-technologies.com/oauth2/authorize",
|
|
19
|
+
tokenUrl: "https://auth.uc-technologies.com/oauth2/token",
|
|
20
|
+
required: true,
|
|
21
|
+
scope: [],
|
|
22
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
23
|
+
var _b;
|
|
24
|
+
try {
|
|
25
|
+
console.log("Validating ConnectUC OAuth2 credentials...");
|
|
26
|
+
console.log("Access token:", auth.access_token);
|
|
27
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
28
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
29
|
+
url: "https://auth.uc-technologies.com/oauth2/userinfo",
|
|
30
|
+
authentication: {
|
|
31
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
32
|
+
token: auth.access_token,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
console.log("Response status:", response.status);
|
|
36
|
+
console.log("Response body:", response.body);
|
|
37
|
+
if (response.status === 200) {
|
|
38
|
+
return { valid: true };
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
valid: false,
|
|
42
|
+
error: "Failed to validate ConnectUC credentials"
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.log("Validation error:", error);
|
|
47
|
+
console.log("Error response:", error.response);
|
|
48
|
+
if (((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 401) {
|
|
49
|
+
return {
|
|
50
|
+
valid: false,
|
|
51
|
+
error: "Invalid or expired access token. Please reconnect your ConnectUC account."
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
valid: false,
|
|
56
|
+
error: `Connection validation failed: ${error.message || "Unknown error occurred"}`
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
exports.connectuc = (0, pieces_framework_1.createPiece)({
|
|
62
|
+
displayName: "ConnectUC",
|
|
63
|
+
auth: exports.connectucAuth,
|
|
64
|
+
minimumSupportedRelease: '0.36.1',
|
|
65
|
+
logoUrl: "https://cuc-media.s3.us-east-1.amazonaws.com/cuc_logo_120x120.png",
|
|
66
|
+
authors: [],
|
|
67
|
+
actions: [create_contact_1.createContactAction, do_not_disturb_1.doNotDisturbAction, initiate_call_1.initiateCallAction, send_sms_1.sendSmsAction],
|
|
68
|
+
triggers: [new_recording_1.newRecording, new_cdr_1.newCdr, new_incoming_call_1.newIncomingCall, new_outgoing_call_1.newOutgoingCall, new_voicemail_1.newVoicemail, new_sms_1.newSms],
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/connectuc/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6F;AAC7F,+DAAyF;AACzF,gEAA4D;AAC5D,oDAAgD;AAChD,wEAAmE;AACnE,wEAAmE;AACnE,gEAA4D;AAC5D,oDAAgD;AAChD,iEAAmE;AACnE,iEAAkE;AAClE,+DAAiE;AACjE,qDAAuD;AAE1C,QAAA,aAAa,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,mDAAmD;IAC5D,QAAQ,EAAE,+CAA+C;IACzD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AK,EAAE,iCAAiC,KAAK,CAAC,OAAO,IAAI,wBAAwB,EAAE;aACpF,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,SAAS,GAAG,IAAA,8BAAW,EAAC;IACnC,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,qBAAa;IACnB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,mEAAmE;IAC5E,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC,oCAAmB,EAAE,mCAAkB,EAAE,kCAAkB,EAAE,wBAAa,CAAC;IACrF,QAAQ,EAAE,CAAC,4BAAY,EAAE,gBAAM,EAAE,mCAAe,EAAE,mCAAe,EAAE,4BAAY,EAAE,gBAAM,CAAC;CACzF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const createContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
owner_uid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
phones: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
7
|
+
company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=create-contact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-contact.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/actions/create-contact.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;;;;;;;EA8E9B,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createContactAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const index_1 = require("../../index");
|
|
7
|
+
const api_helpers_1 = require("../common/api-helpers");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.createContactAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.connectucAuth,
|
|
11
|
+
name: 'create-contact',
|
|
12
|
+
displayName: 'Create Contact',
|
|
13
|
+
description: 'Create a new contact in ConnectUC',
|
|
14
|
+
props: {
|
|
15
|
+
owner_uid: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Owner UID',
|
|
17
|
+
description: 'The user ID of the contact owner in the format of user@domain',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
first_name: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'First Name',
|
|
22
|
+
description: 'The first name of the contact',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
last_name: pieces_framework_1.Property.ShortText({
|
|
26
|
+
displayName: 'Last Name',
|
|
27
|
+
description: 'The last name of the contact',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
email: pieces_framework_1.Property.ShortText({
|
|
31
|
+
displayName: 'Email',
|
|
32
|
+
description: 'The email address of the contact',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
phones: pieces_framework_1.Property.Array({
|
|
36
|
+
displayName: 'Phones',
|
|
37
|
+
description: 'The phone numbers of the contact',
|
|
38
|
+
required: true,
|
|
39
|
+
}),
|
|
40
|
+
company: pieces_framework_1.Property.ShortText({
|
|
41
|
+
displayName: 'Company',
|
|
42
|
+
description: 'The company of the contact',
|
|
43
|
+
required: false,
|
|
44
|
+
}),
|
|
45
|
+
tags: pieces_framework_1.Property.Array({
|
|
46
|
+
displayName: 'Tags',
|
|
47
|
+
description: 'The tags of the contact',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
51
|
+
run(context) {
|
|
52
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
const { owner_uid, first_name, last_name, email, phones, company, tags } = context.propsValue;
|
|
55
|
+
// Map phones to the required format
|
|
56
|
+
const tels = phones.map((phone) => ({ number: phone, type: 'work' }));
|
|
57
|
+
// Map tags to the required format
|
|
58
|
+
const formattedTags = tags ? tags.map((tag) => ({ name: tag })) : [];
|
|
59
|
+
// Build request body - always send all fields with defaults
|
|
60
|
+
const body = {
|
|
61
|
+
first_name: first_name,
|
|
62
|
+
last_name: last_name,
|
|
63
|
+
emails: [{ value: email, type: 'work' }],
|
|
64
|
+
tels: tels,
|
|
65
|
+
company: company || '',
|
|
66
|
+
tags: formattedTags,
|
|
67
|
+
};
|
|
68
|
+
try {
|
|
69
|
+
// Make API call to create contact
|
|
70
|
+
const response = yield (0, api_helpers_1.connectucApiCall)({
|
|
71
|
+
accessToken: context.auth.access_token,
|
|
72
|
+
endpoint: `/users/${owner_uid}/contacts`,
|
|
73
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
74
|
+
body,
|
|
75
|
+
});
|
|
76
|
+
return response;
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
// Provide helpful error message
|
|
80
|
+
const err = error;
|
|
81
|
+
const errorMessage = ((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.message) || err.message || 'Unknown error occurred';
|
|
82
|
+
throw new Error(`Failed to create contact: ${errorMessage}`);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=create-contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-contact.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/actions/create-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAA4C;AAC5C,uDAAyD;AACzD,+DAAyD;AAE5C,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mCAAmC;IAChD,KAAK,EAAE;QACH,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,+DAA+D;YAC5E,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACnB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACjB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,KA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,GAAG,CAAC,QAAQ,0CAAE,IAAI,0CAAE,OAAO,KAAI,GAAG,CAAC,OAAO,IAAI,wBAAwB,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,6BAA6B,YAAY,EAAE,CAAC,CAAC;YACjE,CAAC;QACL,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const doNotDisturbAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
uid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
dnd: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
4
|
+
}>;
|
|
5
|
+
//# sourceMappingURL=do-not-disturb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"do-not-disturb.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/actions/do-not-disturb.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB;;;EA0C7B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doNotDisturbAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const index_1 = require("../../index");
|
|
7
|
+
const api_helpers_1 = require("../common/api-helpers");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.doNotDisturbAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.connectucAuth,
|
|
11
|
+
name: 'do-not-disturb',
|
|
12
|
+
displayName: 'Set Do Not Disturb',
|
|
13
|
+
description: 'Enable or disable Do Not Disturb status for a user in ConnectUC',
|
|
14
|
+
props: {
|
|
15
|
+
uid: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'UID',
|
|
17
|
+
description: 'The user ID to set Do Not Disturb status for in the format of user@domain',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
dnd: pieces_framework_1.Property.Checkbox({
|
|
21
|
+
displayName: 'Do Not Disturb',
|
|
22
|
+
description: 'Enable or disable Do Not Disturb status',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
run(context) {
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const { uid, dnd } = context.propsValue;
|
|
30
|
+
// Build request body
|
|
31
|
+
const body = {
|
|
32
|
+
dnd: dnd,
|
|
33
|
+
};
|
|
34
|
+
try {
|
|
35
|
+
// Make API call to set DND status
|
|
36
|
+
const response = yield (0, api_helpers_1.connectucApiCall)({
|
|
37
|
+
accessToken: context.auth.access_token,
|
|
38
|
+
endpoint: `/users/${uid}/dnd/update`,
|
|
39
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
40
|
+
body,
|
|
41
|
+
});
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
// Provide helpful error message
|
|
46
|
+
const err = error;
|
|
47
|
+
const errorMessage = ((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.message) || err.message || 'Unknown error occurred';
|
|
48
|
+
throw new Error(`Failed to set Do Not Disturb status: ${errorMessage}`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=do-not-disturb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"do-not-disturb.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/actions/do-not-disturb.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAA4C;AAC5C,uDAAyD;AACzD,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AAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const initiateCallAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
uid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
fromUid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
toNumber: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
callerId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=initiate-call.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initiate-call.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/actions/initiate-call.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB;;;;;EA0D7B,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initiateCallAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const index_1 = require("../../index");
|
|
7
|
+
const api_helpers_1 = require("../common/api-helpers");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.initiateCallAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.connectucAuth,
|
|
11
|
+
name: 'initiate-call',
|
|
12
|
+
displayName: 'Initiate Call',
|
|
13
|
+
description: 'Initiate an outbound call from a ConnectUC extension',
|
|
14
|
+
props: {
|
|
15
|
+
uid: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'UID',
|
|
17
|
+
description: 'The user ID in the format of user@domain',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
fromUid: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'From UID',
|
|
22
|
+
description: 'The origin extension and domain of the call',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
toNumber: pieces_framework_1.Property.ShortText({
|
|
26
|
+
displayName: 'To Number',
|
|
27
|
+
description: 'The destination number of the call',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
callerId: pieces_framework_1.Property.ShortText({
|
|
31
|
+
displayName: 'Caller ID',
|
|
32
|
+
description: 'The caller ID to display for the call',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
36
|
+
run(context) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
const { uid, fromUid, toNumber, callerId } = context.propsValue;
|
|
40
|
+
// Build request body
|
|
41
|
+
const body = {
|
|
42
|
+
fromUid: fromUid,
|
|
43
|
+
toNumber: toNumber,
|
|
44
|
+
};
|
|
45
|
+
// Add optional caller ID if provided
|
|
46
|
+
if (callerId) {
|
|
47
|
+
body['callerId'] = callerId;
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
// Make API call to initiate call
|
|
51
|
+
const response = yield (0, api_helpers_1.connectucApiCall)({
|
|
52
|
+
accessToken: context.auth.access_token,
|
|
53
|
+
endpoint: `/users/${uid}/activepieces/initiate-call`,
|
|
54
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
55
|
+
body,
|
|
56
|
+
});
|
|
57
|
+
return response;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
// Provide helpful error message
|
|
61
|
+
const err = error;
|
|
62
|
+
const errorMessage = ((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.message) || err.message || 'Unknown error occurred';
|
|
63
|
+
throw new Error(`Failed to initiate call: ${errorMessage}`);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=initiate-call.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initiate-call.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/actions/initiate-call.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAA4C;AAC5C,uDAAyD;AACzD,+DAAyD;AAE5C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,sDAAsD;IACnE,KAAK,EAAE;QACH,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACpB,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;;YACb,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEhE,qBAAqB;YACrB,MAAM,IAAI,GAA4B;gBAClC,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,QAAQ;aACrB,CAAC;YAEF,qCAAqC;YACrC,IAAI,QAAQ,EAAE,CAAC;gBACX,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;YAChC,CAAC;YAED,IAAI,CAAC;gBACD,iCAAiC;gBACjC,MAAM,QAAQ,GAAG,MAAM,IAAA,8BAAgB,EAAC;oBACpC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;oBACtC,QAAQ,EAAE,UAAU,GAAG,6BAA6B;oBACpD,MAAM,EAAE,0BAAU,CAAC,IAAI;oBACvB,IAAI;iBACP,CAAC,CAAC;gBAEH,OAAO,QAAQ,CAAC;YACpB,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACtB,gCAAgC;gBAChC,MAAM,GAAG,GAAG,KAAyE,CAAC;gBACtF,MAAM,YAAY,GAAG,CAAA,MAAA,MAAA,GAAG,CAAC,QAAQ,0CAAE,IAAI,0CAAE,OAAO,KAAI,GAAG,CAAC,OAAO,IAAI,wBAAwB,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,4BAA4B,YAAY,EAAE,CAAC,CAAC;YAChE,CAAC;QACL,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const sendSmsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
recipients: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
3
|
+
content: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
|
+
sender: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
attachment_urls: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=send-sms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-sms.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/actions/send-sms.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;EAiExB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendSmsAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const index_1 = require("../../index");
|
|
7
|
+
const api_helpers_1 = require("../common/api-helpers");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
const crypto_1 = require("crypto");
|
|
10
|
+
exports.sendSmsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: index_1.connectucAuth,
|
|
12
|
+
name: 'send-sms',
|
|
13
|
+
displayName: 'Send SMS',
|
|
14
|
+
description: 'Send an SMS message through ConnectUC',
|
|
15
|
+
props: {
|
|
16
|
+
recipients: pieces_framework_1.Property.Array({
|
|
17
|
+
displayName: 'SMS Destinations',
|
|
18
|
+
description: 'The phone number to send the SMS to',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
content: pieces_framework_1.Property.LongText({
|
|
22
|
+
displayName: 'Message',
|
|
23
|
+
description: 'The SMS message content',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
sender: pieces_framework_1.Property.ShortText({
|
|
27
|
+
displayName: 'SMS Sender',
|
|
28
|
+
description: 'The SMS message sender',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
attachment_urls: pieces_framework_1.Property.Array({
|
|
32
|
+
displayName: 'Media Attachments',
|
|
33
|
+
description: 'The media attachment urls for the SMS message',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
run(context) {
|
|
38
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const { recipients, content, sender, attachment_urls } = context.propsValue;
|
|
41
|
+
const media = attachment_urls && attachment_urls.length > 0 ? attachment_urls.map((url) => {
|
|
42
|
+
const filename = url.split('/').pop();
|
|
43
|
+
return ({
|
|
44
|
+
url: url,
|
|
45
|
+
filename: filename ? filename : 'attachment'
|
|
46
|
+
});
|
|
47
|
+
}) : [];
|
|
48
|
+
// Build request body
|
|
49
|
+
const body = {
|
|
50
|
+
application: 'connectuc',
|
|
51
|
+
content: content,
|
|
52
|
+
media: media,
|
|
53
|
+
recipients: recipients,
|
|
54
|
+
referenceId: (0, crypto_1.randomUUID)(),
|
|
55
|
+
sender: sender,
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
// Make API call to send SMS
|
|
59
|
+
const response = yield (0, api_helpers_1.connectucApiCall)({
|
|
60
|
+
accessToken: context.auth.access_token,
|
|
61
|
+
endpoint: '/sms/messages',
|
|
62
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
63
|
+
body,
|
|
64
|
+
});
|
|
65
|
+
return response;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
// Provide helpful error message
|
|
69
|
+
const err = error;
|
|
70
|
+
const errorMessage = ((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.message) || err.message || 'Unknown error occurred';
|
|
71
|
+
throw new Error(`Failed to send SMS: ${errorMessage}`);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=send-sms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-sms.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/actions/send-sms.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAA4C;AAC5C,uDAAyD;AACzD,+DAAyD;AACzD,mCAAoC;AAEvB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,uCAAuC;I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B,WAAW,EAAE,IAAA,mBAAU,GAAE;gBACzB,MAAM,EAAE,MAAM;aACjB,CAAC;YAEF,IAAI,CAAC;gBACD,4BAA4B;gBAC5B,MAAM,QAAQ,GAAG,MAAM,IAAA,8BAAgB,EAAC;oBACpC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;oBACtC,QAAQ,EAAE,eAAe;oBACzB,MAAM,EAAE,0BAAU,CAAC,IAAI;oBACvB,IAAI;iBACP,CAAC,CAAC;gBAEH,OAAO,QAAQ,CAAC;YACpB,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACtB,gCAAgC;gBAChC,MAAM,GAAG,GAAG,KAAyE,CAAC;gBACtF,MAAM,YAAY,GAAG,CAAA,MAAA,MAAA,GAAG,CAAC,QAAQ,0CAAE,IAAI,0CAAE,OAAO,KAAI,GAAG,CAAC,OAAO,IAAI,wBAAwB,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;YAC3D,CAAC;QACL,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HttpMethod } from '@activepieces/pieces-common';
|
|
2
|
+
export declare const CONNECTUC_BASE_URL = "https://staging.connectuc.engineering";
|
|
3
|
+
interface ApiCallParams {
|
|
4
|
+
accessToken: string;
|
|
5
|
+
endpoint: string;
|
|
6
|
+
method: HttpMethod;
|
|
7
|
+
body?: unknown;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Makes an authenticated API call to the ConnectUC API
|
|
11
|
+
* @param params - API call parameters including auth token, endpoint, method, and optional body
|
|
12
|
+
* @returns The response body from the API
|
|
13
|
+
*/
|
|
14
|
+
export declare function connectucApiCall<T = unknown>(params: ApiCallParams): Promise<T>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=api-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/common/api-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAsB,MAAM,6BAA6B,CAAC;AAEzF,eAAO,MAAM,kBAAkB,0CAA0C,CAAC;AAE1E,UAAU,aAAa;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,CAcrF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONNECTUC_BASE_URL = void 0;
|
|
4
|
+
exports.connectucApiCall = connectucApiCall;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
exports.CONNECTUC_BASE_URL = 'https://staging.connectuc.engineering';
|
|
8
|
+
/**
|
|
9
|
+
* Makes an authenticated API call to the ConnectUC API
|
|
10
|
+
* @param params - API call parameters including auth token, endpoint, method, and optional body
|
|
11
|
+
* @returns The response body from the API
|
|
12
|
+
*/
|
|
13
|
+
function connectucApiCall(params) {
|
|
14
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const { accessToken, endpoint, method, body } = params;
|
|
16
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
17
|
+
method,
|
|
18
|
+
url: `${exports.CONNECTUC_BASE_URL}${endpoint}`,
|
|
19
|
+
authentication: {
|
|
20
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
21
|
+
token: accessToken,
|
|
22
|
+
},
|
|
23
|
+
body,
|
|
24
|
+
});
|
|
25
|
+
return response.body;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=api-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-helpers.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/common/api-helpers.ts"],"names":[],"mappings":";;;AAgBA,4CAcC;;AA9BD,+DAAyF;AAE5E,QAAA,kBAAkB,GAAG,uCAAuC,CAAC;AAS1E;;;;GAIG;AACH,SAAsB,gBAAgB,CAAc,MAAqB;;QACrE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAEvD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAI;YAC7C,MAAM;YACN,GAAG,EAAE,GAAG,0BAAkB,GAAG,QAAQ,EAAE;YACvC,cAAc,EAAE;gBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,WAAW;aACrB;YACD,IAAI;SACP,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TriggerHookContext } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const CONNECTUC_BASE_URL = "https://staging.connectuc.engineering/activepieces";
|
|
3
|
+
export declare const CONNECTUC_WEBHOOK_TRIGGER_KEY = "connectuc_webhook";
|
|
4
|
+
interface WebhookResponse {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
interface RegisterWebhookParams {
|
|
8
|
+
auth: {
|
|
9
|
+
access_token: string;
|
|
10
|
+
};
|
|
11
|
+
webhookUrl: string;
|
|
12
|
+
event?: string;
|
|
13
|
+
events?: string[];
|
|
14
|
+
context: TriggerHookContext<any, any, any>;
|
|
15
|
+
}
|
|
16
|
+
interface UnregisterWebhookParams {
|
|
17
|
+
auth: {
|
|
18
|
+
access_token: string;
|
|
19
|
+
};
|
|
20
|
+
webhookUrl: string;
|
|
21
|
+
context: TriggerHookContext<any, any, any>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Registers a webhook with the ConnectUC API
|
|
25
|
+
* @param params - Registration parameters including auth, webhook URL, events, and context
|
|
26
|
+
* @returns The webhook response containing the webhook ID
|
|
27
|
+
*/
|
|
28
|
+
export declare function registerConnectUCWebhook(params: RegisterWebhookParams): Promise<WebhookResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Unregisters a webhook from the ConnectUC API
|
|
31
|
+
* @param params - Unregistration parameters including auth, context, and trigger key
|
|
32
|
+
*/
|
|
33
|
+
export declare function unregisterConnectUCWebhook(params: UnregisterWebhookParams): Promise<void>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=webhook-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-helpers.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/connectuc/src/lib/common/webhook-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,eAAO,MAAM,kBAAkB,uDAAuD,CAAC;AACvF,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AAEjE,UAAU,eAAe;IACrB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,UAAU,qBAAqB;IAC3B,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CAC9C;AAED,UAAU,uBAAuB;IAC7B,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAuDtG;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyB/F"}
|