@activepieces/piece-savvycal 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +20 -66
  3. package/src/index.d.ts +0 -3
  4. package/src/index.js.map +0 -1
  5. package/src/lib/actions/cancel-event.d.ts +0 -5
  6. package/src/lib/actions/cancel-event.js +0 -38
  7. package/src/lib/actions/cancel-event.js.map +0 -1
  8. package/src/lib/actions/create-event.d.ts +0 -20
  9. package/src/lib/actions/create-event.js +0 -235
  10. package/src/lib/actions/create-event.js.map +0 -1
  11. package/src/lib/actions/delete-scheduling-link.d.ts +0 -10
  12. package/src/lib/actions/delete-scheduling-link.js +0 -69
  13. package/src/lib/actions/delete-scheduling-link.js.map +0 -1
  14. package/src/lib/actions/duplicate-scheduling-link.d.ts +0 -10
  15. package/src/lib/actions/duplicate-scheduling-link.js +0 -65
  16. package/src/lib/actions/duplicate-scheduling-link.js.map +0 -1
  17. package/src/lib/actions/find-events-by-email.d.ts +0 -7
  18. package/src/lib/actions/find-events-by-email.js +0 -53
  19. package/src/lib/actions/find-events-by-email.js.map +0 -1
  20. package/src/lib/actions/get-current-user.d.ts +0 -3
  21. package/src/lib/actions/get-current-user.js +0 -38
  22. package/src/lib/actions/get-current-user.js.map +0 -1
  23. package/src/lib/actions/get-event.d.ts +0 -5
  24. package/src/lib/actions/get-event.js +0 -34
  25. package/src/lib/actions/get-event.js.map +0 -1
  26. package/src/lib/actions/get-link-slots.d.ts +0 -10
  27. package/src/lib/actions/get-link-slots.js +0 -72
  28. package/src/lib/actions/get-link-slots.js.map +0 -1
  29. package/src/lib/actions/get-scheduling-link.d.ts +0 -10
  30. package/src/lib/actions/get-scheduling-link.js +0 -65
  31. package/src/lib/actions/get-scheduling-link.js.map +0 -1
  32. package/src/lib/actions/get-workflow-rules.d.ts +0 -7
  33. package/src/lib/actions/get-workflow-rules.js +0 -52
  34. package/src/lib/actions/get-workflow-rules.js.map +0 -1
  35. package/src/lib/actions/list-events.d.ts +0 -14
  36. package/src/lib/actions/list-events.js +0 -149
  37. package/src/lib/actions/list-events.js.map +0 -1
  38. package/src/lib/actions/list-scheduling-links.d.ts +0 -7
  39. package/src/lib/actions/list-scheduling-links.js +0 -51
  40. package/src/lib/actions/list-scheduling-links.js.map +0 -1
  41. package/src/lib/actions/list-workflows.d.ts +0 -3
  42. package/src/lib/actions/list-workflows.js +0 -37
  43. package/src/lib/actions/list-workflows.js.map +0 -1
  44. package/src/lib/actions/toggle-scheduling-link.d.ts +0 -10
  45. package/src/lib/actions/toggle-scheduling-link.js +0 -65
  46. package/src/lib/actions/toggle-scheduling-link.js.map +0 -1
  47. package/src/lib/auth.d.ts +0 -6
  48. package/src/lib/auth.js +0 -60
  49. package/src/lib/auth.js.map +0 -1
  50. package/src/lib/common/index.d.ts +0 -98
  51. package/src/lib/common/index.js +0 -151
  52. package/src/lib/common/index.js.map +0 -1
  53. package/src/lib/triggers/new-event.d.ts +0 -42
  54. package/src/lib/triggers/new-event.js +0 -193
  55. package/src/lib/triggers/new-event.js.map +0 -1
  56. package/src/lib/triggers/new-poll-response.d.ts +0 -18
  57. package/src/lib/triggers/new-poll-response.js +0 -84
  58. package/src/lib/triggers/new-poll-response.js.map +0 -1
  59. package/src/lib/triggers/workflow-action-triggered.d.ts +0 -10
  60. package/src/lib/triggers/workflow-action-triggered.js +0 -68
  61. package/src/lib/triggers/workflow-action-triggered.js.map +0 -1
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLinkSlotsAction = 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.getLinkSlotsAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.savvyCalAuth,
11
- name: 'get_link_slots',
12
- displayName: 'Get Available Slots',
13
- description: 'Returns available time slots for booking on a scheduling link. Useful for displaying availability or for picking a slot before calling Create Event.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Returns the currently bookable time slots for a given scheduling link. Use to check availability or to pick a valid start/end time before calling Create Event. Requires the link id. Read-only and idempotent, though results reflect live availability and change over time.', idempotent: true },
16
- props: {
17
- team_id: pieces_framework_1.Property.Dropdown({
18
- auth: auth_1.savvyCalAuth,
19
- displayName: 'Team',
20
- description: 'Filter scheduling links by team. Leave empty to show all teams.',
21
- refreshers: [],
22
- required: false,
23
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
24
- if (!auth)
25
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
26
- try {
27
- const options = yield (0, common_1.buildTeamOptions)((0, auth_1.getToken)(auth));
28
- return { disabled: false, options };
29
- }
30
- catch (_b) {
31
- return { disabled: true, options: [], placeholder: 'Failed to load teams.' };
32
- }
33
- }),
34
- }),
35
- link_id: pieces_framework_1.Property.Dropdown({
36
- auth: auth_1.savvyCalAuth,
37
- displayName: 'Scheduling Link',
38
- description: 'Select the scheduling link to query slots for.',
39
- refreshers: ['team_id'],
40
- required: true,
41
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, team_id }) {
42
- if (!auth)
43
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
44
- try {
45
- const options = yield (0, common_1.buildLinkOptions)((0, auth_1.getToken)(auth), team_id);
46
- return { disabled: false, options };
47
- }
48
- catch (_b) {
49
- return { disabled: true, options: [], placeholder: 'Failed to load scheduling links.' };
50
- }
51
- }),
52
- }),
53
- },
54
- run(context) {
55
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
- var _a;
57
- const response = yield (0, common_1.savvyCalApiCall)({
58
- token: (0, auth_1.getToken)(context.auth),
59
- method: pieces_common_1.HttpMethod.GET,
60
- path: `/links/${context.propsValue.link_id}/slots`,
61
- });
62
- const slots = Array.isArray(response.body) ? response.body : (_a = response.body.entries) !== null && _a !== void 0 ? _a : [];
63
- return slots.map((slot) => ({
64
- start_at: slot.start_at,
65
- end_at: slot.end_at,
66
- duration_minutes: slot.duration,
67
- rank: slot.rank,
68
- }));
69
- });
70
- },
71
- });
72
- //# sourceMappingURL=get-link-slots.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-link-slots.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-link-slots.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAAgF;AAChF,kCAAiD;AASpC,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,sJAAsJ;IACnK,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,gRAAgR,EAAE,UAAU,EAAE,IAAI,EAAE;IAC/T,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,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI;oBAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;gBACpG,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,MAAM,IAAA,yBAAgB,EAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;oBACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;gBACtC,CAAC;gBAAC,WAAM,CAAC;oBACP,OAAO,EAAE,QAAQ,EAAE,IAAI,E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,CAAC,MAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,mCAAI,EAAE,CAAC;YACzF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,gBAAgB,EAAE,IAAI,CAAC,QAAQ;gBAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC,CAAC;QACN,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const getSchedulingLinkAction: 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
- }>;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSchedulingLinkAction = 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.getSchedulingLinkAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.savvyCalAuth,
11
- name: 'get_scheduling_link',
12
- displayName: 'Get Scheduling Link',
13
- description: 'Retrieves the details of a specific scheduling link by its ID.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Fetches the full configuration of a single SavvyCal scheduling link by its id, including its custom fields. Use to inspect a known link before booking or to read its settings; get the id from List Scheduling Links. Read-only and idempotent.', idempotent: true },
16
- props: {
17
- team_id: pieces_framework_1.Property.Dropdown({
18
- auth: auth_1.savvyCalAuth,
19
- displayName: 'Team',
20
- description: 'Filter scheduling links by team. Leave empty to show all teams.',
21
- refreshers: [],
22
- required: false,
23
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
24
- if (!auth)
25
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
26
- try {
27
- const options = yield (0, common_1.buildTeamOptions)((0, auth_1.getToken)(auth));
28
- return { disabled: false, options };
29
- }
30
- catch (_b) {
31
- return { disabled: true, options: [], placeholder: 'Failed to load teams.' };
32
- }
33
- }),
34
- }),
35
- link_id: pieces_framework_1.Property.Dropdown({
36
- auth: auth_1.savvyCalAuth,
37
- displayName: 'Scheduling Link',
38
- description: 'Select the scheduling link to retrieve.',
39
- refreshers: ['team_id'],
40
- required: true,
41
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, team_id }) {
42
- if (!auth)
43
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
44
- try {
45
- const options = yield (0, common_1.buildLinkOptions)((0, auth_1.getToken)(auth), team_id);
46
- return { disabled: false, options };
47
- }
48
- catch (_b) {
49
- return { disabled: true, options: [], placeholder: 'Failed to load scheduling links.' };
50
- }
51
- }),
52
- }),
53
- },
54
- run(context) {
55
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
- const response = yield (0, common_1.savvyCalApiCall)({
57
- token: (0, auth_1.getToken)(context.auth),
58
- method: pieces_common_1.HttpMethod.GET,
59
- path: `/links/${context.propsValue.link_id}`,
60
- });
61
- return (0, common_1.flattenLink)(response.body);
62
- });
63
- },
64
- });
65
- //# sourceMappingURL=get-scheduling-link.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-scheduling-link.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-scheduling-link.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAMmB;AACnB,kCAAiD;AAEpC,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,gEAAgE;IAC7E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kPAAkP,EAAE,UAAU,EAAE,IAAI,EAAE;IACjS,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,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI;oBAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;gBACpG,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,MAAM,IAAA,yBAAgB,EAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;oBACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;gBACtC,CAAC;gBAAC,WAAM,CAAC;oBACP,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;gBAC/E,CAAC;YACH,CAAC,CAAA;SACF,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,yCAAyC;YACtD,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAA0B,EAAE,oDAArB,EAAE,IAAI,EAAE,OAAO,EAAE;gBAC/B,IAAI,CAAC,IAAI;oBAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;gBACpG,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,MAAM,IAAA,yBAAgB,EAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE,OAAwB,CAAC,CAAC;oBACjF,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;gBACtC,CAAC;gBAAC,WAAM,CAAC;oBACP,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;gBAC1F,CAAC;YACH,CAAC,CAAA;SACF,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,GAAG;gBACtB,IAAI,EAAE,UAAU,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;aAC7C,CAAC,CAAC;YACH,OAAO,IAAA,oBAAW,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare const getWorkflowRulesAction: 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
- workflow_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (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
- }>;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWorkflowRulesAction = 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.getWorkflowRulesAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.savvyCalAuth,
11
- name: 'get_workflow_rules',
12
- displayName: 'Get Workflow Rules',
13
- description: 'Returns the rules configured for a specific workflow.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Returns the trigger/action rules configured on a specific SavvyCal workflow, identified by its workflow id. Use to inspect how a workflow is set up; get the id from List Workflows. Read-only and idempotent.', idempotent: true },
16
- props: {
17
- workflow_id: pieces_framework_1.Property.Dropdown({
18
- auth: auth_1.savvyCalAuth,
19
- displayName: 'Workflow',
20
- description: 'Select the workflow whose rules you want to retrieve.',
21
- refreshers: [],
22
- required: true,
23
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
24
- if (!auth)
25
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
26
- try {
27
- const options = yield (0, common_1.buildWorkflowOptions)((0, auth_1.getToken)(auth));
28
- return { disabled: false, options };
29
- }
30
- catch (_b) {
31
- return { disabled: true, options: [], placeholder: 'Failed to load workflows.' };
32
- }
33
- }),
34
- }),
35
- },
36
- run(context) {
37
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
- var _a;
39
- const response = yield (0, common_1.savvyCalApiCall)({
40
- token: (0, auth_1.getToken)(context.auth),
41
- method: pieces_common_1.HttpMethod.GET,
42
- path: `/workflows/${context.propsValue.workflow_id}/rules`,
43
- });
44
- const rules = Array.isArray(response.body) ? response.body : (_a = response.body.entries) !== null && _a !== void 0 ? _a : [];
45
- return {
46
- workflow_id: context.propsValue.workflow_id,
47
- rules,
48
- };
49
- });
50
- },
51
- });
52
- //# sourceMappingURL=get-workflow-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-workflow-rules.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-workflow-rules.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAAkE;AAClE,kCAAiD;AAUpC,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,uDAAuD;IACpE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,gNAAgN,EAAE,UAAU,EAAE,IAAI,EAAE;IAC/P,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,uDAAuD;YACpE,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI;oBAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;gBACpG,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,MAAM,IAAA,6BAAoB,EAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;oBAC3D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;gBACtC,CAAC;gBAAC,WAAM,CAAC;oBACP,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;gBACnF,CAAC;YACH,CAAC,CAAA;SACF,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAA+D;gBACnG,KAAK,EAAE,IAAA,eAAQ,EAAC,OAAO,CAAC,IAAI,CAAC;gBAC7B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,cAAc,OAAO,CAAC,UAAU,CAAC,WAAW,QAAQ;aAC3D,CAAC,CAAC;YACH,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,mCAAI,EAAE,CAAC;YACzF,OAAO;gBACL,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;gBAC3C,KAAK;aACN,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const listEventsAction: 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
- states: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
5
- start_after: import("@activepieces/pieces-framework").DateTimeProperty<false>;
6
- start_before: import("@activepieces/pieces-framework").DateTimeProperty<false>;
7
- team_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, (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
- link_ids: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- }>)[]>;
13
- limit: import("@activepieces/pieces-framework").NumberProperty<false>;
14
- }>;
@@ -1,149 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listEventsAction = 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.listEventsAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.savvyCalAuth,
11
- name: 'list_events',
12
- displayName: 'List Events',
13
- description: 'Returns a list of scheduled meetings from your SavvyCal account.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Lists SavvyCal events across the account, optionally filtered by state(s), start date window, team, or specific scheduling links. Use to browse or find bookings when you do not have an event id; leave all filters empty to return every event. Read-only and idempotent.', idempotent: true },
16
- props: {
17
- states: pieces_framework_1.Property.StaticMultiSelectDropdown({
18
- displayName: 'State',
19
- description: 'Filter events by their current status. Leave empty to return all statuses.',
20
- required: false,
21
- options: {
22
- options: [
23
- { label: 'Confirmed', value: 'confirmed' },
24
- { label: 'Canceled', value: 'canceled' },
25
- { label: 'Awaiting Reschedule', value: 'awaiting_reschedule' },
26
- { label: 'Awaiting Checkout', value: 'awaiting_checkout' },
27
- { label: 'Checkout Expired', value: 'checkout_expired' },
28
- { label: 'Awaiting Approval', value: 'awaiting_approval' },
29
- { label: 'Declined', value: 'declined' },
30
- { label: 'Tentative', value: 'tentative' },
31
- ],
32
- },
33
- }),
34
- start_after: pieces_framework_1.Property.DateTime({
35
- displayName: 'Start After',
36
- description: 'Only return events that start after this date and time.',
37
- required: false,
38
- }),
39
- start_before: pieces_framework_1.Property.DateTime({
40
- displayName: 'Start Before',
41
- description: 'Only return events that start before this date and time.',
42
- required: false,
43
- }),
44
- team_id: pieces_framework_1.Property.Dropdown({
45
- auth: auth_1.savvyCalAuth,
46
- displayName: 'Team',
47
- description: 'Filter scheduling links by team. Leave empty to show all teams.',
48
- refreshers: [],
49
- required: false,
50
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
51
- if (!auth)
52
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
53
- try {
54
- const options = yield (0, common_1.buildTeamOptions)((0, auth_1.getToken)(auth));
55
- return { disabled: false, options };
56
- }
57
- catch (_b) {
58
- return { disabled: true, options: [], placeholder: 'Failed to load teams.' };
59
- }
60
- }),
61
- }),
62
- link_ids: pieces_framework_1.Property.MultiSelectDropdown({
63
- auth: auth_1.savvyCalAuth,
64
- displayName: 'Scheduling Links',
65
- description: 'Only return events booked through the selected scheduling links. Leave empty for all links.',
66
- refreshers: ['team_id'],
67
- required: false,
68
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, team_id }) {
69
- if (!auth)
70
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
71
- try {
72
- const options = yield (0, common_1.buildLinkOptions)((0, auth_1.getToken)(auth), team_id);
73
- return { disabled: false, options };
74
- }
75
- catch (_b) {
76
- return { disabled: true, options: [], placeholder: 'Failed to load scheduling links.' };
77
- }
78
- }),
79
- }),
80
- limit: pieces_framework_1.Property.Number({
81
- displayName: 'Maximum Results',
82
- description: 'Maximum number of events to return. Leave empty to return all matching events.',
83
- required: false,
84
- }),
85
- },
86
- run(context) {
87
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
88
- var _a, _b;
89
- const token = (0, auth_1.getToken)(context.auth);
90
- const { states, start_after, start_before, link_ids, limit } = context.propsValue;
91
- const selectedStates = states;
92
- const selectedLinkIds = link_ids;
93
- const hasLinkFilter = selectedLinkIds && selectedLinkIds.length > 0;
94
- const needsClientFilter = (hasLinkFilter && selectedLinkIds.length > 1) || (selectedStates && selectedStates.length > 1);
95
- const queryParams = {};
96
- if (start_after)
97
- queryParams['start_after'] = start_after;
98
- if (start_before)
99
- queryParams['start_before'] = start_before;
100
- if (selectedStates && selectedStates.length === 1) {
101
- queryParams['state'] = selectedStates[0];
102
- }
103
- if (hasLinkFilter && selectedLinkIds.length === 1) {
104
- queryParams['link_id'] = selectedLinkIds[0];
105
- }
106
- if (limit && needsClientFilter) {
107
- // Paginate page by page and stop as soon as we have enough post-filter results,
108
- // so we never fetch unbounded pages when a limit is set alongside a client-side filter.
109
- let after = null;
110
- const collected = [];
111
- do {
112
- const params = Object.assign({ limit: '100' }, queryParams);
113
- if (after)
114
- params['after'] = after;
115
- const response = yield (0, common_1.savvyCalApiCall)({
116
- token,
117
- method: pieces_common_1.HttpMethod.GET,
118
- path: '/events',
119
- queryParams: params,
120
- });
121
- for (const event of response.body.entries) {
122
- const matchesState = !selectedStates || selectedStates.length === 0 || selectedStates.includes(event.state);
123
- const matchesLink = !hasLinkFilter || selectedLinkIds.includes((_b = (_a = event.link) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '');
124
- if (matchesState && matchesLink)
125
- collected.push(event);
126
- }
127
- after = collected.length >= limit ? null : response.body.metadata.after;
128
- } while (after);
129
- return collected.slice(0, limit).map(common_1.flattenEvent);
130
- }
131
- if (limit) {
132
- queryParams['limit'] = String(limit);
133
- const response = yield (0, common_1.savvyCalApiCall)({
134
- token,
135
- method: pieces_common_1.HttpMethod.GET,
136
- path: '/events',
137
- queryParams,
138
- });
139
- return response.body.entries.map(common_1.flattenEvent);
140
- }
141
- const events = yield (0, common_1.savvyCalPaginatedCall)({ token, path: '/events', queryParams });
142
- return events
143
- .filter((e) => !selectedStates || selectedStates.length === 0 || selectedStates.includes(e.state))
144
- .filter((e) => { var _a, _b; return !hasLinkFilter || selectedLinkIds.includes((_b = (_a = e.link) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ''); })
145
- .map(common_1.flattenEvent);
146
- });
147
- },
148
- });
149
- //# sourceMappingURL=list-events.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-events.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-events.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAAoI;AACpI,kCAAiD;AAEpC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,kEAAkE;IAC/E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,6QAA6Q,EAAE,UAAU,EAAE,IAAI,EAAE;IAC5T,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,yBAAyB,CAAC;YACzC,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,4EAA4E;YACzF,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC1C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;oBACxC,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;oBAC9D,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBAC1D,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;oBACxD,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBAC1D,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;oBACxC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;iBAC3C;aACF;SACF,CAAC;QACF,WAAW,EAAE,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0,0 @@
1
- export declare const listSchedulingLinksAction: 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
- }>;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listSchedulingLinksAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const common_1 = require("../common");
7
- const auth_1 = require("../auth");
8
- exports.listSchedulingLinksAction = (0, pieces_framework_1.createAction)({
9
- auth: auth_1.savvyCalAuth,
10
- name: 'list_scheduling_links',
11
- displayName: 'List Scheduling Links',
12
- description: 'Returns all scheduling links configured in your SavvyCal account.',
13
- audience: 'both',
14
- aiMetadata: { description: 'Lists the scheduling links in the account, optionally filtered to a single team (or to personal links). Use to discover available links and their ids before booking, querying slots, or managing a link. Read-only and idempotent.', idempotent: true },
15
- props: {
16
- team_id: pieces_framework_1.Property.Dropdown({
17
- auth: auth_1.savvyCalAuth,
18
- displayName: 'Team',
19
- description: 'Filter scheduling links by team. Leave empty to show all teams.',
20
- refreshers: [],
21
- required: false,
22
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
23
- if (!auth)
24
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
25
- try {
26
- const options = yield (0, common_1.buildTeamOptions)((0, auth_1.getToken)(auth));
27
- return { disabled: false, options };
28
- }
29
- catch (_b) {
30
- return { disabled: true, options: [], placeholder: 'Failed to load teams.' };
31
- }
32
- }),
33
- }),
34
- },
35
- run(context) {
36
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
37
- const links = yield (0, common_1.savvyCalPaginatedCall)({
38
- token: (0, auth_1.getToken)(context.auth),
39
- path: '/links',
40
- });
41
- const { team_id } = context.propsValue;
42
- const filtered = team_id
43
- ? team_id === 'personal'
44
- ? links.filter((l) => l.scope === null)
45
- : links.filter((l) => { var _a; return ((_a = l.scope) === null || _a === void 0 ? void 0 : _a.id) === team_id; })
46
- : links;
47
- return filtered.map(common_1.flattenLink);
48
- });
49
- },
50
- });
51
- //# sourceMappingURL=list-scheduling-links.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-scheduling-links.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-scheduling-links.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,sCAAyG;AACzG,kCAAiD;AAEpC,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,mEAAmE;IAChF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,qOAAqO,EAAE,UAAU,EAAE,IAAI,EAAE;IACpR,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,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI;oBAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;gBACpG,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,MAAM,IAAA,yBAAgB,EAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;oBACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;gBACtC,CAAC;gBAAC,WAAM,CAAC;oBACP,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;gBAC/E,CAAC;YACH,CAAC,CAAA;SACF,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,KAAK,GAAG,MAAM,IAAA,8BAAqB,EAAyB;gBAChE,KAAK,EAAE,IAAA,eAAQ,EAAC,OAAO,CAAC,IAAI,CAAC;gBAC7B,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YAEH,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACvC,MAAM,QAAQ,GAAG,OAAO;gBACtB,CAAC,CAAC,OAAO,KAAK,UAAU;oBACtB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC;oBACvC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,CAAC,CAAC,KAAK,0CAAE,EAAE,MAAK,OAAO,CAAA,EAAA,CAAC;gBAChD,CAAC,CAAC,KAAK,CAAC;YAEV,OAAO,QAAQ,CAAC,GAAG,CAAC,oBAAW,CAAC,CAAC;QACnC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const listWorkflowsAction: 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
- }>)[], {}>;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listWorkflowsAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const common_1 = require("../common");
7
- const auth_1 = require("../auth");
8
- exports.listWorkflowsAction = (0, pieces_framework_1.createAction)({
9
- auth: auth_1.savvyCalAuth,
10
- name: 'list_workflows',
11
- displayName: 'List Workflows',
12
- description: 'Returns all workflows configured in your SavvyCal account.',
13
- audience: 'both',
14
- aiMetadata: { description: 'Lists all SavvyCal automation workflows in the account with their ids and names. Use to discover available workflows, typically to obtain a workflow id for Get Workflow Rules. Read-only and idempotent.', idempotent: true },
15
- props: {},
16
- run(context) {
17
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
- const workflows = yield (0, common_1.savvyCalPaginatedCall)({
19
- token: (0, auth_1.getToken)(context.auth),
20
- path: '/workflows',
21
- });
22
- return workflows.map((workflow) => {
23
- var _a, _b, _c, _d, _e, _f, _g;
24
- return ({
25
- id: workflow.id,
26
- name: workflow.name,
27
- active: (_a = workflow.active) !== null && _a !== void 0 ? _a : null,
28
- team_id: (_c = (_b = workflow.scope) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : null,
29
- team_name: (_e = (_d = workflow.scope) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : null,
30
- created_at: (_f = workflow.created_at) !== null && _f !== void 0 ? _f : null,
31
- updated_at: (_g = workflow.updated_at) !== null && _g !== void 0 ? _g : null,
32
- });
33
- });
34
- });
35
- },
36
- });
37
- //# sourceMappingURL=list-workflows.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-workflows.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-workflows.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,sCAAkD;AAClD,kCAAiD;AAWpC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,4DAA4D;IACzE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,2MAA2M,EAAE,UAAU,EAAE,IAAI,EAAE;IAC1P,KAAK,EAAE,EAAE;IACH,GAAG,CAAC,OAAO;;YACf,MAAM,SAAS,GAAG,MAAM,IAAA,8BAAqB,EAAmB;gBAC9D,KAAK,EAAE,IAAA,eAAQ,EAAC,OAAO,CAAC,IAAI,CAAC;gBAC7B,IAAI,EAAE,YAAY;aACnB,CAAC,CAAC;YACH,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;;gBAAC,OAAA,CAAC;oBAClC,EAAE,EAAE,QAAQ,CAAC,EAAE;oBACf,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,MAAM,EAAE,MAAA,QAAQ,CAAC,MAAM,mCAAI,IAAI;oBAC/B,OAAO,EAAE,MAAA,MAAA,QAAQ,CAAC,KAAK,0CAAE,EAAE,mCAAI,IAAI;oBACnC,SAAS,EAAE,MAAA,MAAA,QAAQ,CAAC,KAAK,0CAAE,IAAI,mCAAI,IAAI;oBACvC,UAAU,EAAE,MAAA,QAAQ,CAAC,UAAU,mCAAI,IAAI;oBACvC,UAAU,EAAE,MAAA,QAAQ,CAAC,UAAU,mCAAI,IAAI;iBACxC,CAAC,CAAA;aAAA,CAAC,CAAC;QACN,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const toggleSchedulingLinkAction: 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
- }>;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toggleSchedulingLinkAction = 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.toggleSchedulingLinkAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.savvyCalAuth,
11
- name: 'toggle_scheduling_link',
12
- displayName: 'Toggle Scheduling Link',
13
- description: 'Switches a scheduling link between active and disabled states.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Flips a scheduling link between active and disabled, identified by its link id. Use to enable or pause a link; note it toggles relative to the link\'s current state, so repeating the call alternates the state rather than converging — not idempotent.', idempotent: false },
16
- props: {
17
- team_id: pieces_framework_1.Property.Dropdown({
18
- auth: auth_1.savvyCalAuth,
19
- displayName: 'Team',
20
- description: 'Filter scheduling links by team. Leave empty to show all teams.',
21
- refreshers: [],
22
- required: false,
23
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
24
- if (!auth)
25
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
26
- try {
27
- const options = yield (0, common_1.buildTeamOptions)((0, auth_1.getToken)(auth));
28
- return { disabled: false, options };
29
- }
30
- catch (_b) {
31
- return { disabled: true, options: [], placeholder: 'Failed to load teams.' };
32
- }
33
- }),
34
- }),
35
- link_id: pieces_framework_1.Property.Dropdown({
36
- auth: auth_1.savvyCalAuth,
37
- displayName: 'Scheduling Link',
38
- description: 'Select the scheduling link to toggle.',
39
- refreshers: ['team_id'],
40
- required: true,
41
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, team_id }) {
42
- if (!auth)
43
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
44
- try {
45
- const options = yield (0, common_1.buildLinkOptions)((0, auth_1.getToken)(auth), team_id);
46
- return { disabled: false, options };
47
- }
48
- catch (_b) {
49
- return { disabled: true, options: [], placeholder: 'Failed to load scheduling links.' };
50
- }
51
- }),
52
- }),
53
- },
54
- run(context) {
55
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
- const response = yield (0, common_1.savvyCalApiCall)({
57
- token: (0, auth_1.getToken)(context.auth),
58
- method: pieces_common_1.HttpMethod.POST,
59
- path: `/links/${context.propsValue.link_id}/toggle`,
60
- });
61
- return (0, common_1.flattenLink)(response.body);
62
- });
63
- },
64
- });
65
- //# sourceMappingURL=toggle-scheduling-link.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle-scheduling-link.js","sourceRoot":"","sources":["../../../../src/lib/actions/toggle-scheduling-link.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAMmB;AACnB,kCAAiD;AAEpC,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,gEAAgE;IAC7E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,2PAA2P,EAAE,UAAU,EAAE,KAAK,EAAE;IAC3S,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,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CAAC;YACH,CAAC,CAAA;SACF,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,SAAS;aACpD,CAAC,CAAC;YACH,OAAO,IAAA,oBAAW,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;KAAA;CACF,CAAC,CAAC"}
package/src/lib/auth.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
2
- export declare const savvyCalAuth: (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- }>)[];
5
- export type SavvyCalAuthValue = AppConnectionValueForAuthProperty<typeof savvyCalAuth>;
6
- export declare function getToken(auth: SavvyCalAuthValue): string;