@activepieces/piece-savvycal 0.0.2 → 0.1.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/package.json +5 -5
- package/src/i18n/de.json +73 -94
- package/src/i18n/es.json +73 -94
- package/src/i18n/fr.json +81 -75
- package/src/i18n/ja.json +73 -94
- package/src/i18n/nl.json +72 -93
- package/src/i18n/pt.json +73 -94
- package/src/i18n/ru.json +74 -0
- package/src/i18n/translation.json +38 -14
- package/src/i18n/vi.json +74 -0
- package/src/i18n/zh.json +40 -61
- package/src/index.d.ts +3 -2
- package/src/index.js +31 -40
- package/src/index.js.map +1 -1
- package/src/lib/actions/cancel-event.d.ts +3 -1
- package/src/lib/actions/cancel-event.js +3 -3
- package/src/lib/actions/cancel-event.js.map +1 -1
- package/src/lib/actions/create-event.d.ts +15 -2
- package/src/lib/actions/create-event.js +169 -24
- package/src/lib/actions/create-event.js.map +1 -1
- package/src/lib/actions/delete-scheduling-link.d.ts +10 -0
- package/src/lib/actions/delete-scheduling-link.js +67 -0
- package/src/lib/actions/delete-scheduling-link.js.map +1 -0
- package/src/lib/actions/duplicate-scheduling-link.d.ts +10 -0
- package/src/lib/actions/duplicate-scheduling-link.js +63 -0
- package/src/lib/actions/duplicate-scheduling-link.js.map +1 -0
- package/src/lib/actions/find-events-by-email.d.ts +3 -1
- package/src/lib/actions/find-events-by-email.js +3 -3
- package/src/lib/actions/find-events-by-email.js.map +1 -1
- package/src/lib/actions/get-current-user.d.ts +3 -1
- package/src/lib/actions/get-current-user.js +3 -3
- package/src/lib/actions/get-current-user.js.map +1 -1
- package/src/lib/actions/get-event.d.ts +3 -1
- package/src/lib/actions/get-event.js +3 -3
- package/src/lib/actions/get-event.js.map +1 -1
- package/src/lib/actions/get-link-slots.d.ts +10 -0
- package/src/lib/actions/get-link-slots.js +70 -0
- package/src/lib/actions/get-link-slots.js.map +1 -0
- package/src/lib/actions/get-scheduling-link.d.ts +10 -0
- package/src/lib/actions/get-scheduling-link.js +63 -0
- package/src/lib/actions/get-scheduling-link.js.map +1 -0
- package/src/lib/actions/get-workflow-rules.d.ts +7 -0
- package/src/lib/actions/get-workflow-rules.js +50 -0
- package/src/lib/actions/get-workflow-rules.js.map +1 -0
- package/src/lib/actions/list-events.d.ts +10 -3
- package/src/lib/actions/list-events.js +76 -24
- package/src/lib/actions/list-events.js.map +1 -1
- package/src/lib/actions/list-scheduling-links.d.ts +7 -1
- package/src/lib/actions/list-scheduling-links.js +30 -17
- package/src/lib/actions/list-scheduling-links.js.map +1 -1
- package/src/lib/actions/list-workflows.d.ts +3 -0
- package/src/lib/actions/list-workflows.js +35 -0
- package/src/lib/actions/list-workflows.js.map +1 -0
- package/src/lib/actions/toggle-scheduling-link.d.ts +10 -0
- package/src/lib/actions/toggle-scheduling-link.js +63 -0
- package/src/lib/actions/toggle-scheduling-link.js.map +1 -0
- package/src/lib/auth.d.ts +6 -0
- package/src/lib/auth.js +60 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/index.d.ts +28 -0
- package/src/lib/common/index.js +98 -29
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/triggers/new-event.d.ts +36 -4
- package/src/lib/triggers/new-event.js +85 -18
- package/src/lib/triggers/new-event.js.map +1 -1
- package/src/lib/triggers/new-poll-response.d.ts +18 -0
- package/src/lib/triggers/new-poll-response.js +81 -0
- package/src/lib/triggers/new-poll-response.js.map +1 -0
- package/src/lib/triggers/workflow-action-triggered.d.ts +10 -0
- package/src/lib/triggers/workflow-action-triggered.js +65 -0
- package/src/lib/triggers/workflow-action-triggered.js.map +1 -0
- package/src/lib/common/webhook-trigger-factory.d.ts +0 -7
- package/src/lib/common/webhook-trigger-factory.js +0 -96
- package/src/lib/common/webhook-trigger-factory.js.map +0 -1
- package/src/lib/triggers/booking-canceled.d.ts +0 -1
- package/src/lib/triggers/booking-canceled.js +0 -11
- package/src/lib/triggers/booking-canceled.js.map +0 -1
- package/src/lib/triggers/booking-rescheduled.d.ts +0 -1
- package/src/lib/triggers/booking-rescheduled.js +0 -11
- package/src/lib/triggers/booking-rescheduled.js.map +0 -1
- package/src/lib/triggers/new-booking.d.ts +0 -1
- package/src/lib/triggers/new-booking.js +0 -11
- package/src/lib/triggers/new-booking.js.map +0 -1
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
1
|
+
export declare const savvyCal: import("@activepieces/pieces-framework").Piece<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
}>)[]>;
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.savvyCal =
|
|
3
|
+
exports.savvyCal = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
@@ -12,64 +12,55 @@ const cancel_event_1 = require("./lib/actions/cancel-event");
|
|
|
12
12
|
const create_event_1 = require("./lib/actions/create-event");
|
|
13
13
|
const find_events_by_email_1 = require("./lib/actions/find-events-by-email");
|
|
14
14
|
const list_scheduling_links_1 = require("./lib/actions/list-scheduling-links");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
15
|
+
const get_scheduling_link_1 = require("./lib/actions/get-scheduling-link");
|
|
16
|
+
const delete_scheduling_link_1 = require("./lib/actions/delete-scheduling-link");
|
|
17
|
+
const duplicate_scheduling_link_1 = require("./lib/actions/duplicate-scheduling-link");
|
|
18
|
+
const toggle_scheduling_link_1 = require("./lib/actions/toggle-scheduling-link");
|
|
19
|
+
const get_link_slots_1 = require("./lib/actions/get-link-slots");
|
|
20
|
+
const list_workflows_1 = require("./lib/actions/list-workflows");
|
|
21
|
+
const get_workflow_rules_1 = require("./lib/actions/get-workflow-rules");
|
|
18
22
|
const new_event_1 = require("./lib/triggers/new-event");
|
|
23
|
+
const new_poll_response_1 = require("./lib/triggers/new-poll-response");
|
|
24
|
+
const workflow_action_triggered_1 = require("./lib/triggers/workflow-action-triggered");
|
|
25
|
+
const auth_1 = require("./lib/auth");
|
|
19
26
|
const common_1 = require("./lib/common");
|
|
20
|
-
exports.savvyCalAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
21
|
-
displayName: 'Personal Access Token',
|
|
22
|
-
description: `To get your SavvyCal API token:
|
|
23
|
-
1. Log in to your SavvyCal account at https://savvycal.com
|
|
24
|
-
2. Go to **Settings > Developer**
|
|
25
|
-
3. Click **Create Token**
|
|
26
|
-
4. Give it a name and copy the token (it starts with \`pt_secret_\`)
|
|
27
|
-
|
|
28
|
-
**Note:** Keep this token secret — it gives full access to your SavvyCal account.`,
|
|
29
|
-
required: true,
|
|
30
|
-
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
31
|
-
try {
|
|
32
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
33
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
34
|
-
url: `${common_1.SAVVYCAL_BASE_URL}/me`,
|
|
35
|
-
authentication: {
|
|
36
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
37
|
-
token: auth,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
return { valid: true };
|
|
41
|
-
}
|
|
42
|
-
catch (_b) {
|
|
43
|
-
return { valid: false, error: 'Invalid token. Please check your Personal Access Token and try again.' };
|
|
44
|
-
}
|
|
45
|
-
}),
|
|
46
|
-
});
|
|
47
27
|
exports.savvyCal = (0, pieces_framework_1.createPiece)({
|
|
48
28
|
displayName: 'SavvyCal',
|
|
49
29
|
description: 'Scheduling tool that lets invitees overlay their calendar when picking a time.',
|
|
50
30
|
minimumSupportedRelease: '0.36.1',
|
|
51
31
|
logoUrl: 'https://cdn.activepieces.com/pieces/savvycal.png',
|
|
52
32
|
categories: [shared_1.PieceCategory.PRODUCTIVITY],
|
|
53
|
-
auth:
|
|
54
|
-
authors: ['bst1n', 'sanket-a11y'],
|
|
33
|
+
auth: auth_1.savvyCalAuth,
|
|
34
|
+
authors: ['bst1n', 'sanket-a11y', 'onyedikachi-david'],
|
|
55
35
|
actions: [
|
|
56
|
-
get_current_user_1.getCurrentUserAction,
|
|
57
|
-
list_events_1.listEventsAction,
|
|
58
|
-
get_event_1.getEventAction,
|
|
59
|
-
cancel_event_1.cancelEventAction,
|
|
60
36
|
create_event_1.createEventAction,
|
|
37
|
+
cancel_event_1.cancelEventAction,
|
|
38
|
+
get_event_1.getEventAction,
|
|
39
|
+
list_events_1.listEventsAction,
|
|
61
40
|
find_events_by_email_1.findEventsByEmailAction,
|
|
62
41
|
list_scheduling_links_1.listSchedulingLinksAction,
|
|
42
|
+
get_scheduling_link_1.getSchedulingLinkAction,
|
|
43
|
+
get_link_slots_1.getLinkSlotsAction,
|
|
44
|
+
toggle_scheduling_link_1.toggleSchedulingLinkAction,
|
|
45
|
+
duplicate_scheduling_link_1.duplicateSchedulingLinkAction,
|
|
46
|
+
delete_scheduling_link_1.deleteSchedulingLinkAction,
|
|
47
|
+
list_workflows_1.listWorkflowsAction,
|
|
48
|
+
get_workflow_rules_1.getWorkflowRulesAction,
|
|
49
|
+
get_current_user_1.getCurrentUserAction,
|
|
63
50
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
64
51
|
baseUrl: () => common_1.SAVVYCAL_BASE_URL,
|
|
65
|
-
auth:
|
|
52
|
+
auth: auth_1.savvyCalAuth,
|
|
66
53
|
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
67
54
|
return ({
|
|
68
|
-
Authorization: `Bearer ${auth}`,
|
|
55
|
+
Authorization: `Bearer ${(0, auth_1.getToken)(auth)}`,
|
|
69
56
|
});
|
|
70
57
|
}),
|
|
71
58
|
}),
|
|
72
59
|
],
|
|
73
|
-
triggers: [
|
|
60
|
+
triggers: [
|
|
61
|
+
new_event_1.newEventTrigger,
|
|
62
|
+
new_poll_response_1.newPollResponseTrigger,
|
|
63
|
+
workflow_action_triggered_1.workflowActionTriggeredTrigger,
|
|
64
|
+
],
|
|
74
65
|
});
|
|
75
66
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,+DAAwE;AACxE,iDAAqD;AAErD,qEAAsE;AACtE,2DAA6D;AAC7D,uDAAyD;AACzD,6DAA+D;AAC/D,6DAA+D;AAC/D,6EAA6E;AAC7E,+EAAgF;AAChF,2EAA4E;AAC5E,iFAAkF;AAClF,uFAAwF;AACxF,iFAAkF;AAClF,iEAAkE;AAClE,iEAAmE;AACnE,yEAA0E;AAE1E,wDAA2D;AAC3D,wEAA0E;AAC1E,wFAA0F;AAE1F,qCAAoD;AACpD,yCAAiD;AAEpC,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,gFAAgF;IAC7F,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,UAAU,EAAE,CAAC,sBAAa,CAAC,YAAY,CAAC;IACxC,IAAI,EAAE,mBAAY;IAClB,OAAO,EAAE,CAAC,OAAO,EAAC,aAAa,EAAE,mBAAmB,CAAC;IACrD,OAAO,EAAE;QACP,gCAAiB;QACjB,gCAAiB;QACjB,0BAAc;QACd,8BAAgB;QAChB,8CAAuB;QAEvB,iDAAyB;QACzB,6CAAuB;QACvB,mCAAkB;QAClB,mDAA0B;QAC1B,yDAA6B;QAC7B,mDAA0B;QAE1B,oCAAmB;QACnB,2CAAsB;QAEtB,uCAAoB;QAEpB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,0BAAiB;YAChC,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE;iBAC1C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE;QACR,2BAAe;QACf,0CAAsB;QACtB,0DAA8B;KAC/B;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare const cancelEventAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const cancelEventAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
}>)[], {
|
|
2
4
|
event_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
5
|
}>;
|
|
@@ -5,9 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
-
const
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
9
|
exports.cancelEventAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth:
|
|
10
|
+
auth: auth_1.savvyCalAuth,
|
|
11
11
|
name: 'cancel_event',
|
|
12
12
|
displayName: 'Cancel Event',
|
|
13
13
|
description: 'Cancels a scheduled meeting in SavvyCal.',
|
|
@@ -21,7 +21,7 @@ exports.cancelEventAction = (0, pieces_framework_1.createAction)({
|
|
|
21
21
|
run(context) {
|
|
22
22
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
yield (0, common_1.savvyCalApiCall)({
|
|
24
|
-
token: context.auth
|
|
24
|
+
token: (0, auth_1.getToken)(context.auth),
|
|
25
25
|
method: pieces_common_1.HttpMethod.POST,
|
|
26
26
|
path: `/events/${context.propsValue.event_id}/cancel`,
|
|
27
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel-event.js","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"cancel-event.js","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAA4C;AAC5C,kCAAiD;AAEpC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,0CAA0C;IACvD,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,8HAA8H;YAC3I,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAA,wBAAe,EAAC;gBACpB,KAAK,EAAE,IAAA,eAAQ,EAAC,OAAO,CAAC,IAAI,CAAC;gBAC7B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,WAAW,OAAO,CAAC,UAAU,CAAC,QAAQ,SAAS;aACtD,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;gBACrC,OAAO,EAAE,+BAA+B;aACzC,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
export declare const createEventAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").
|
|
2
|
-
|
|
1
|
+
export declare const createEventAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
}>)[], {
|
|
4
|
+
team_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
5
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>)[]>;
|
|
7
|
+
link_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
8
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
9
|
+
}>)[]>;
|
|
3
10
|
start_at: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
4
11
|
end_at: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
5
12
|
attendee_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
13
|
attendee_email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
14
|
+
time_zone: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
15
|
+
phone_number: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
16
|
+
custom_fields: import("@activepieces/pieces-framework").DynamicProperties<false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
17
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
18
|
+
}>)[]>;
|
|
19
|
+
metadata: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
7
20
|
}>;
|
|
@@ -5,20 +5,38 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
-
const
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
9
|
exports.createEventAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth:
|
|
10
|
+
auth: auth_1.savvyCalAuth,
|
|
11
11
|
name: 'create_event',
|
|
12
12
|
displayName: 'Create Event',
|
|
13
13
|
description: 'Books a meeting on a scheduling link at a specific time slot.',
|
|
14
14
|
props: {
|
|
15
|
+
team_id: pieces_framework_1.Property.Dropdown({
|
|
16
|
+
auth: auth_1.savvyCalAuth,
|
|
17
|
+
displayName: 'Team',
|
|
18
|
+
description: 'Filter scheduling links by team. Leave empty to show all teams.',
|
|
19
|
+
refreshers: [],
|
|
20
|
+
required: false,
|
|
21
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
22
|
+
if (!auth)
|
|
23
|
+
return { disabled: true, options: [], placeholder: 'Please connect your account first' };
|
|
24
|
+
try {
|
|
25
|
+
const options = yield (0, common_1.buildTeamOptions)((0, auth_1.getToken)(auth));
|
|
26
|
+
return { disabled: false, options };
|
|
27
|
+
}
|
|
28
|
+
catch (_b) {
|
|
29
|
+
return { disabled: true, options: [], placeholder: 'Failed to load teams.' };
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
}),
|
|
15
33
|
link_id: pieces_framework_1.Property.Dropdown({
|
|
16
|
-
auth:
|
|
34
|
+
auth: auth_1.savvyCalAuth,
|
|
17
35
|
displayName: 'Scheduling Link',
|
|
18
36
|
description: 'Select the scheduling link to book a meeting on.',
|
|
19
|
-
refreshers: [],
|
|
37
|
+
refreshers: ['team_id'],
|
|
20
38
|
required: true,
|
|
21
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
39
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, team_id }) {
|
|
22
40
|
if (!auth)
|
|
23
41
|
return {
|
|
24
42
|
disabled: true,
|
|
@@ -26,17 +44,8 @@ exports.createEventAction = (0, pieces_framework_1.createAction)({
|
|
|
26
44
|
placeholder: 'Please connect your account first',
|
|
27
45
|
};
|
|
28
46
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
path: '/links',
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
disabled: false,
|
|
35
|
-
options: links.map((l) => ({
|
|
36
|
-
label: `${l.name} (${l.slug})`,
|
|
37
|
-
value: l.id,
|
|
38
|
-
})),
|
|
39
|
-
};
|
|
47
|
+
const options = yield (0, common_1.buildLinkOptions)((0, auth_1.getToken)(auth), team_id);
|
|
48
|
+
return { disabled: false, options };
|
|
40
49
|
}
|
|
41
50
|
catch (_b) {
|
|
42
51
|
return {
|
|
@@ -67,22 +76,158 @@ exports.createEventAction = (0, pieces_framework_1.createAction)({
|
|
|
67
76
|
description: 'Email address of the person booking the meeting.',
|
|
68
77
|
required: true,
|
|
69
78
|
}),
|
|
79
|
+
time_zone: pieces_framework_1.Property.ShortText({
|
|
80
|
+
displayName: 'Time Zone',
|
|
81
|
+
description: "Attendee's local time zone in Olson format (e.g. America/New_York, Europe/London, Africa/Lagos).",
|
|
82
|
+
required: true,
|
|
83
|
+
}),
|
|
84
|
+
phone_number: pieces_framework_1.Property.ShortText({
|
|
85
|
+
displayName: 'Phone Number',
|
|
86
|
+
description: "Attendee's phone number in international format (e.g. +15555555555). Required only if the scheduling link asks for it.",
|
|
87
|
+
required: false,
|
|
88
|
+
}),
|
|
89
|
+
custom_fields: pieces_framework_1.Property.DynamicProperties({
|
|
90
|
+
auth: auth_1.savvyCalAuth,
|
|
91
|
+
displayName: 'Custom Fields',
|
|
92
|
+
description: 'Additional questions configured on the scheduling link (e.g. Company, Why are we meeting?). Filled in dynamically based on the selected link.',
|
|
93
|
+
required: false,
|
|
94
|
+
refreshers: ['link_id'],
|
|
95
|
+
props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, link_id }) {
|
|
96
|
+
if (!auth || !link_id)
|
|
97
|
+
return {};
|
|
98
|
+
try {
|
|
99
|
+
const fields = yield fetchLinkFields((0, auth_1.getToken)(auth), link_id);
|
|
100
|
+
return buildCustomFieldProps(fields);
|
|
101
|
+
}
|
|
102
|
+
catch (_b) {
|
|
103
|
+
return {};
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
}),
|
|
107
|
+
metadata: pieces_framework_1.Property.Object({
|
|
108
|
+
displayName: 'Metadata',
|
|
109
|
+
description: 'Custom key/value pairs to attach to the event. Useful for tracking the source flow or correlating with external systems.',
|
|
110
|
+
required: false,
|
|
111
|
+
}),
|
|
70
112
|
},
|
|
71
113
|
run(context) {
|
|
72
114
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
const token = (0, auth_1.getToken)(context.auth);
|
|
116
|
+
const { link_id, start_at, end_at, attendee_name, attendee_email, time_zone, phone_number, custom_fields, metadata, } = context.propsValue;
|
|
117
|
+
const linkFields = yield fetchLinkFields(token, link_id);
|
|
118
|
+
const submittedFields = serializeCustomFields({
|
|
119
|
+
linkFields,
|
|
120
|
+
customFields: custom_fields,
|
|
121
|
+
});
|
|
122
|
+
const body = {
|
|
123
|
+
start_at,
|
|
124
|
+
end_at,
|
|
125
|
+
display_name: attendee_name,
|
|
126
|
+
email: attendee_email,
|
|
127
|
+
time_zone,
|
|
128
|
+
};
|
|
129
|
+
if (phone_number)
|
|
130
|
+
body['phone_number'] = phone_number;
|
|
131
|
+
if (submittedFields.length > 0)
|
|
132
|
+
body['fields'] = submittedFields;
|
|
133
|
+
if (metadata && Object.keys(metadata).length > 0)
|
|
134
|
+
body['metadata'] = metadata;
|
|
73
135
|
const response = yield (0, common_1.savvyCalApiCall)({
|
|
74
|
-
token
|
|
136
|
+
token,
|
|
75
137
|
method: pieces_common_1.HttpMethod.POST,
|
|
76
|
-
path: `/links/${
|
|
77
|
-
body
|
|
78
|
-
start_at: context.propsValue.start_at,
|
|
79
|
-
end_at: context.propsValue.end_at,
|
|
80
|
-
display_name: context.propsValue.attendee_name,
|
|
81
|
-
email: context.propsValue.attendee_email,
|
|
82
|
-
},
|
|
138
|
+
path: `/links/${link_id}/events`,
|
|
139
|
+
body,
|
|
83
140
|
});
|
|
84
141
|
return (0, common_1.flattenEvent)(response.body);
|
|
85
142
|
});
|
|
86
143
|
},
|
|
87
144
|
});
|
|
145
|
+
function fetchLinkFields(token, linkId) {
|
|
146
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
var _a;
|
|
148
|
+
const response = yield (0, common_1.savvyCalApiCall)({
|
|
149
|
+
token,
|
|
150
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
151
|
+
path: `/links/${linkId}`,
|
|
152
|
+
});
|
|
153
|
+
return (_a = response.body.fields) !== null && _a !== void 0 ? _a : [];
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function buildCustomFieldProps(fields) {
|
|
157
|
+
var _a;
|
|
158
|
+
const props = {};
|
|
159
|
+
for (const field of fields) {
|
|
160
|
+
if (isHiddenFieldType(field.type))
|
|
161
|
+
continue;
|
|
162
|
+
const params = {
|
|
163
|
+
displayName: field.label,
|
|
164
|
+
required: (_a = field.is_required) !== null && _a !== void 0 ? _a : false,
|
|
165
|
+
};
|
|
166
|
+
const choices = normalizeFieldOptions(field);
|
|
167
|
+
if (isMultiSelectFieldType(field.type)) {
|
|
168
|
+
props[field.id] = pieces_framework_1.Property.StaticMultiSelectDropdown(Object.assign(Object.assign({}, params), { options: { options: choices } }));
|
|
169
|
+
}
|
|
170
|
+
else if (isSingleSelectFieldType(field.type)) {
|
|
171
|
+
props[field.id] = pieces_framework_1.Property.StaticDropdown(Object.assign(Object.assign({}, params), { options: { options: choices } }));
|
|
172
|
+
}
|
|
173
|
+
else if (isLongTextFieldType(field.type)) {
|
|
174
|
+
props[field.id] = pieces_framework_1.Property.LongText(params);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
props[field.id] = pieces_framework_1.Property.ShortText(params);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return props;
|
|
181
|
+
}
|
|
182
|
+
function serializeCustomFields({ linkFields, customFields, }) {
|
|
183
|
+
if (!customFields)
|
|
184
|
+
return [];
|
|
185
|
+
const result = [];
|
|
186
|
+
for (const field of linkFields) {
|
|
187
|
+
const raw = customFields[field.id];
|
|
188
|
+
if (raw === undefined || raw === null || raw === '')
|
|
189
|
+
continue;
|
|
190
|
+
const value = Array.isArray(raw) ? raw.join(MULTI_SELECT_VALUE_DELIMITER) : String(raw);
|
|
191
|
+
result.push({ id: field.id, label: field.label, type: field.type, value });
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
function normalizeFieldOptions(field) {
|
|
196
|
+
var _a, _b;
|
|
197
|
+
const raw = (_b = (_a = field.options) !== null && _a !== void 0 ? _a : field.choices) !== null && _b !== void 0 ? _b : [];
|
|
198
|
+
return raw.map((opt) => {
|
|
199
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
200
|
+
if (typeof opt === 'string')
|
|
201
|
+
return { label: opt, value: opt };
|
|
202
|
+
return {
|
|
203
|
+
label: (_d = (_c = (_b = (_a = opt.label) !== null && _a !== void 0 ? _a : opt.name) !== null && _b !== void 0 ? _b : opt.value) !== null && _c !== void 0 ? _c : opt.id) !== null && _d !== void 0 ? _d : '',
|
|
204
|
+
value: (_h = (_g = (_f = (_e = opt.value) !== null && _e !== void 0 ? _e : opt.id) !== null && _f !== void 0 ? _f : opt.name) !== null && _g !== void 0 ? _g : opt.label) !== null && _h !== void 0 ? _h : '',
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function isMultiSelectFieldType(type) {
|
|
209
|
+
const t = type.toLowerCase();
|
|
210
|
+
return t === 'checkboxes' || t === 'multi_select' || t === 'checkbox_group';
|
|
211
|
+
}
|
|
212
|
+
function isSingleSelectFieldType(type) {
|
|
213
|
+
const t = type.toLowerCase();
|
|
214
|
+
return (t === 'select' ||
|
|
215
|
+
t === 'select_menu' ||
|
|
216
|
+
t === 'dropdown' ||
|
|
217
|
+
t === 'radio' ||
|
|
218
|
+
t === 'radio_buttons' ||
|
|
219
|
+
t === 'single_select');
|
|
220
|
+
}
|
|
221
|
+
function isLongTextFieldType(type) {
|
|
222
|
+
const t = type.toLowerCase();
|
|
223
|
+
return t === 'long_text' || t === 'textarea' || t === 'paragraph';
|
|
224
|
+
}
|
|
225
|
+
function isHiddenFieldType(type) {
|
|
226
|
+
return type.toLowerCase() === 'hidden';
|
|
227
|
+
}
|
|
228
|
+
// SavvyCal's CreateEventRequest documents fields[].value as a string. Multi-select
|
|
229
|
+
// (checkboxes) selections are joined with this delimiter. The exact format SavvyCal
|
|
230
|
+
// expects on the receiving side isn't documented; ", " matches common form-encoding
|
|
231
|
+
// conventions. Adjust here if SavvyCal rejects multi-select payloads.
|
|
232
|
+
const MULTI_SELECT_VALUE_DELIMITER = ', ';
|
|
88
233
|
//# sourceMappingURL=create-event.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-event.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-event.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-event.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-event.ts"],"names":[],"mappings":";;;;AAAA,qEAKwC;AACxC,+DAAyD;AACzD,sCAQmB;AACnB,kCAAiD;AAEpC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAA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b,CAAC,KAAK,eAAe;QACrB,CAAC,KAAK,eAAe,CACtB,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7B,OAAO,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,WAAW,CAAC;AACpE,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC;AACzC,CAAC;AAED,mFAAmF;AACnF,oFAAoF;AACpF,oFAAoF;AACpF,sEAAsE;AACtE,MAAM,4BAA4B,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const deleteSchedulingLinkAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
}>)[], {
|
|
4
|
+
team_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
5
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>)[]>;
|
|
7
|
+
link_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
8
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
9
|
+
}>)[]>;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteSchedulingLinkAction = 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 common_1 = require("../common");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
|
+
exports.deleteSchedulingLinkAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.savvyCalAuth,
|
|
11
|
+
name: 'delete_scheduling_link',
|
|
12
|
+
displayName: 'Delete Scheduling Link',
|
|
13
|
+
description: 'Permanently deletes a scheduling link from your SavvyCal account.',
|
|
14
|
+
props: {
|
|
15
|
+
team_id: pieces_framework_1.Property.Dropdown({
|
|
16
|
+
auth: auth_1.savvyCalAuth,
|
|
17
|
+
displayName: 'Team',
|
|
18
|
+
description: 'Filter scheduling links by team. Leave empty to show all teams.',
|
|
19
|
+
refreshers: [],
|
|
20
|
+
required: false,
|
|
21
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
22
|
+
if (!auth)
|
|
23
|
+
return { disabled: true, options: [], placeholder: 'Please connect your account first' };
|
|
24
|
+
try {
|
|
25
|
+
const options = yield (0, common_1.buildTeamOptions)((0, auth_1.getToken)(auth));
|
|
26
|
+
return { disabled: false, options };
|
|
27
|
+
}
|
|
28
|
+
catch (_b) {
|
|
29
|
+
return { disabled: true, options: [], placeholder: 'Failed to load teams.' };
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
}),
|
|
33
|
+
link_id: pieces_framework_1.Property.Dropdown({
|
|
34
|
+
auth: auth_1.savvyCalAuth,
|
|
35
|
+
displayName: 'Scheduling Link',
|
|
36
|
+
description: 'Select the scheduling link to delete. This action cannot be undone.',
|
|
37
|
+
refreshers: ['team_id'],
|
|
38
|
+
required: true,
|
|
39
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, team_id }) {
|
|
40
|
+
if (!auth)
|
|
41
|
+
return { disabled: true, options: [], placeholder: 'Please connect your account first' };
|
|
42
|
+
try {
|
|
43
|
+
const options = yield (0, common_1.buildLinkOptions)((0, auth_1.getToken)(auth), team_id);
|
|
44
|
+
return { disabled: false, options };
|
|
45
|
+
}
|
|
46
|
+
catch (_b) {
|
|
47
|
+
return { disabled: true, options: [], placeholder: 'Failed to load scheduling links.' };
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
run(context) {
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
yield (0, common_1.savvyCalApiCall)({
|
|
55
|
+
token: (0, auth_1.getToken)(context.auth),
|
|
56
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
57
|
+
path: `/links/${context.propsValue.link_id}`,
|
|
58
|
+
});
|
|
59
|
+
return {
|
|
60
|
+
success: true,
|
|
61
|
+
link_id: context.propsValue.link_id,
|
|
62
|
+
message: 'Scheduling link deleted successfully.',
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=delete-scheduling-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-scheduling-link.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-scheduling-link.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAAgF;AAChF,kCAAiD;AAEpC,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,mEAAmE;IAChF,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,iEAAiE;YAC9E,UAAU,EAAE,EAAE;YACd,Q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kCAAkC,EAAE,CAAC;gBAC1F,CAAC;YACH,CAAC,CAAA;SACF,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAA,wBAAe,EAAC;gBACpB,KAAK,EAAE,IAAA,eAAQ,EAAC,OAAO,CAAC,IAAI,CAAC;gBAC7B,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,IAAI,EAAE,UAAU,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;aAC7C,CAAC,CAAC;YACH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBACnC,OAAO,EAAE,uCAAuC;aACjD,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const duplicateSchedulingLinkAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
}>)[], {
|
|
4
|
+
team_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
5
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>)[]>;
|
|
7
|
+
link_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
8
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
9
|
+
}>)[]>;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.duplicateSchedulingLinkAction = 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 common_1 = require("../common");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
|
+
exports.duplicateSchedulingLinkAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.savvyCalAuth,
|
|
11
|
+
name: 'duplicate_scheduling_link',
|
|
12
|
+
displayName: 'Duplicate Scheduling Link',
|
|
13
|
+
description: 'Creates a copy of an existing scheduling link.',
|
|
14
|
+
props: {
|
|
15
|
+
team_id: pieces_framework_1.Property.Dropdown({
|
|
16
|
+
auth: auth_1.savvyCalAuth,
|
|
17
|
+
displayName: 'Team',
|
|
18
|
+
description: 'Filter scheduling links by team. Leave empty to show all teams.',
|
|
19
|
+
refreshers: [],
|
|
20
|
+
required: false,
|
|
21
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
22
|
+
if (!auth)
|
|
23
|
+
return { disabled: true, options: [], placeholder: 'Please connect your account first' };
|
|
24
|
+
try {
|
|
25
|
+
const options = yield (0, common_1.buildTeamOptions)((0, auth_1.getToken)(auth));
|
|
26
|
+
return { disabled: false, options };
|
|
27
|
+
}
|
|
28
|
+
catch (_b) {
|
|
29
|
+
return { disabled: true, options: [], placeholder: 'Failed to load teams.' };
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
}),
|
|
33
|
+
link_id: pieces_framework_1.Property.Dropdown({
|
|
34
|
+
auth: auth_1.savvyCalAuth,
|
|
35
|
+
displayName: 'Scheduling Link',
|
|
36
|
+
description: 'Select the scheduling link to duplicate.',
|
|
37
|
+
refreshers: ['team_id'],
|
|
38
|
+
required: true,
|
|
39
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, team_id }) {
|
|
40
|
+
if (!auth)
|
|
41
|
+
return { disabled: true, options: [], placeholder: 'Please connect your account first' };
|
|
42
|
+
try {
|
|
43
|
+
const options = yield (0, common_1.buildLinkOptions)((0, auth_1.getToken)(auth), team_id);
|
|
44
|
+
return { disabled: false, options };
|
|
45
|
+
}
|
|
46
|
+
catch (_b) {
|
|
47
|
+
return { disabled: true, options: [], placeholder: 'Failed to load scheduling links.' };
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
run(context) {
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const response = yield (0, common_1.savvyCalApiCall)({
|
|
55
|
+
token: (0, auth_1.getToken)(context.auth),
|
|
56
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
57
|
+
path: `/links/${context.propsValue.link_id}/duplicate`,
|
|
58
|
+
});
|
|
59
|
+
return (0, common_1.flattenLink)(response.body);
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=duplicate-scheduling-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicate-scheduling-link.js","sourceRoot":"","sources":["../../../../src/lib/actions/duplicate-scheduling-link.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAMmB;AACnB,kCAAiD;AAEpC,QAAA,6BAA6B,GAAG,IAAA,+BAAY,EAAC;IACxD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,iEAAiE;YAC9E,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAiB,EAAE,oDAAZ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,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAyB;gBAC7D,KAAK,EAAE,IAAA,eAAQ,EAAC,OAAO,CAAC,IAAI,CAAC;gBAC7B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,UAAU,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY;aACvD,CAAC,CAAC;YACH,OAAO,IAAA,oBAAW,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const findEventsByEmailAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const findEventsByEmailAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
}>)[], {
|
|
2
4
|
attendee_email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
5
|
start_after: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
4
6
|
start_before: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|