@activepieces/piece-greenhouse 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.
Files changed (65) hide show
  1. package/package.json +17 -0
  2. package/src/index.d.ts +2 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +50 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/create-candidate-note.d.ts +8 -0
  7. package/src/lib/actions/create-candidate-note.d.ts.map +1 -0
  8. package/src/lib/actions/create-candidate-note.js +92 -0
  9. package/src/lib/actions/create-candidate-note.js.map +1 -0
  10. package/src/lib/actions/create-candidate.d.ts +14 -0
  11. package/src/lib/actions/create-candidate.d.ts.map +1 -0
  12. package/src/lib/actions/create-candidate.js +117 -0
  13. package/src/lib/actions/create-candidate.js.map +1 -0
  14. package/src/lib/actions/create-prospect.d.ts +14 -0
  15. package/src/lib/actions/create-prospect.d.ts.map +1 -0
  16. package/src/lib/actions/create-prospect.js +121 -0
  17. package/src/lib/actions/create-prospect.js.map +1 -0
  18. package/src/lib/actions/find-candidate.d.ts +4 -0
  19. package/src/lib/actions/find-candidate.d.ts.map +1 -0
  20. package/src/lib/actions/find-candidate.js +38 -0
  21. package/src/lib/actions/find-candidate.js.map +1 -0
  22. package/src/lib/actions/find-due-scorecard.d.ts +4 -0
  23. package/src/lib/actions/find-due-scorecard.d.ts.map +1 -0
  24. package/src/lib/actions/find-due-scorecard.js +54 -0
  25. package/src/lib/actions/find-due-scorecard.js.map +1 -0
  26. package/src/lib/actions/find-or-create-candidate.d.ts +14 -0
  27. package/src/lib/actions/find-or-create-candidate.d.ts.map +1 -0
  28. package/src/lib/actions/find-or-create-candidate.js +126 -0
  29. package/src/lib/actions/find-or-create-candidate.js.map +1 -0
  30. package/src/lib/actions/update-candidate.d.ts +15 -0
  31. package/src/lib/actions/update-candidate.d.ts.map +1 -0
  32. package/src/lib/actions/update-candidate.js +127 -0
  33. package/src/lib/actions/update-candidate.js.map +1 -0
  34. package/src/lib/auth.d.ts +2 -0
  35. package/src/lib/auth.d.ts.map +1 -0
  36. package/src/lib/auth.js +30 -0
  37. package/src/lib/auth.js.map +1 -0
  38. package/src/lib/common/index.d.ts +58 -0
  39. package/src/lib/common/index.d.ts.map +1 -0
  40. package/src/lib/common/index.js +44 -0
  41. package/src/lib/common/index.js.map +1 -0
  42. package/src/lib/triggers/candidate-hired.d.ts +3 -0
  43. package/src/lib/triggers/candidate-hired.d.ts.map +1 -0
  44. package/src/lib/triggers/candidate-hired.js +90 -0
  45. package/src/lib/triggers/candidate-hired.js.map +1 -0
  46. package/src/lib/triggers/job-updated.d.ts +3 -0
  47. package/src/lib/triggers/job-updated.d.ts.map +1 -0
  48. package/src/lib/triggers/job-updated.js +93 -0
  49. package/src/lib/triggers/job-updated.js.map +1 -0
  50. package/src/lib/triggers/new-candidate-application.d.ts +3 -0
  51. package/src/lib/triggers/new-candidate-application.d.ts.map +1 -0
  52. package/src/lib/triggers/new-candidate-application.js +103 -0
  53. package/src/lib/triggers/new-candidate-application.js.map +1 -0
  54. package/src/lib/triggers/new-job-post.d.ts +3 -0
  55. package/src/lib/triggers/new-job-post.d.ts.map +1 -0
  56. package/src/lib/triggers/new-job-post.js +99 -0
  57. package/src/lib/triggers/new-job-post.js.map +1 -0
  58. package/src/lib/triggers/new-scheduled-interview.d.ts +11 -0
  59. package/src/lib/triggers/new-scheduled-interview.d.ts.map +1 -0
  60. package/src/lib/triggers/new-scheduled-interview.js +99 -0
  61. package/src/lib/triggers/new-scheduled-interview.js.map +1 -0
  62. package/src/lib/triggers/new-scorecard-due.d.ts +3 -0
  63. package/src/lib/triggers/new-scorecard-due.d.ts.map +1 -0
  64. package/src/lib/triggers/new-scorecard-due.js +87 -0
  65. package/src/lib/triggers/new-scorecard-due.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@activepieces/piece-greenhouse",
3
+ "version": "0.0.1",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@activepieces/pieces-common": "0.12.3",
9
+ "@activepieces/pieces-framework": "0.28.1",
10
+ "@activepieces/shared": "0.67.1",
11
+ "tslib": "2.6.2"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
15
+ "lint": "eslint 'src/**/*.ts'"
16
+ }
17
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const greenhouse: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,UAAU,+JAyBrB,CAAC"}
package/src/index.js ADDED
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.greenhouse = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const shared_1 = require("@activepieces/shared");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ const auth_1 = require("./lib/auth");
9
+ const create_candidate_1 = require("./lib/actions/create-candidate");
10
+ const create_candidate_note_1 = require("./lib/actions/create-candidate-note");
11
+ const create_prospect_1 = require("./lib/actions/create-prospect");
12
+ const update_candidate_1 = require("./lib/actions/update-candidate");
13
+ const find_candidate_1 = require("./lib/actions/find-candidate");
14
+ const find_or_create_candidate_1 = require("./lib/actions/find-or-create-candidate");
15
+ const find_due_scorecard_1 = require("./lib/actions/find-due-scorecard");
16
+ const new_candidate_application_1 = require("./lib/triggers/new-candidate-application");
17
+ const candidate_hired_1 = require("./lib/triggers/candidate-hired");
18
+ const new_job_post_1 = require("./lib/triggers/new-job-post");
19
+ const job_updated_1 = require("./lib/triggers/job-updated");
20
+ const new_scheduled_interview_1 = require("./lib/triggers/new-scheduled-interview");
21
+ const new_scorecard_due_1 = require("./lib/triggers/new-scorecard-due");
22
+ exports.greenhouse = (0, pieces_framework_1.createPiece)({
23
+ displayName: 'Greenhouse',
24
+ description: 'Recruiting and onboarding software',
25
+ auth: auth_1.greenhouseAuth,
26
+ minimumSupportedRelease: '0.36.1',
27
+ logoUrl: 'https://cdn.activepieces.com/pieces/greenhouse.png',
28
+ categories: [shared_1.PieceCategory.HUMAN_RESOURCES],
29
+ authors: ['onyedikachi-david'],
30
+ actions: [
31
+ create_candidate_1.createCandidateAction,
32
+ create_candidate_note_1.createCandidateNoteAction,
33
+ create_prospect_1.createProspectAction,
34
+ update_candidate_1.updateCandidateAction,
35
+ find_candidate_1.findCandidateAction,
36
+ find_or_create_candidate_1.findOrCreateCandidateAction,
37
+ find_due_scorecard_1.findDueScorecardAction,
38
+ (0, pieces_common_1.createCustomApiCallAction)({
39
+ baseUrl: () => 'https://harvest.greenhouse.io/v3',
40
+ auth: auth_1.greenhouseAuth,
41
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
42
+ return ({
43
+ Authorization: `Bearer ${auth.access_token}`,
44
+ });
45
+ }),
46
+ }),
47
+ ],
48
+ triggers: [new_candidate_application_1.newCandidateApplicationTrigger, candidate_hired_1.candidateHiredTrigger, new_job_post_1.newJobPostTrigger, job_updated_1.jobUpdatedTrigger, new_scheduled_interview_1.newScheduledInterviewTrigger, new_scorecard_due_1.newScorecardDueTrigger],
49
+ });
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,iDAAqD;AACrD,+DAAwE;AACxE,qCAA4C;AAC5C,qEAAuE;AACvE,+EAAgF;AAChF,mEAAqE;AACrE,qEAAuE;AACvE,iEAAmE;AACnE,qFAAqF;AACrF,yEAA0E;AAC1E,wFAA0F;AAC1F,oEAAuE;AACvE,8DAAgE;AAChE,4DAA+D;AAC/D,oFAAsF;AACtF,wEAA0E;AAE7D,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,oCAAoC;IACjD,IAAI,EAAE,qBAAc;IACpB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,oDAAoD;IAC7D,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,CAAC;IAC3C,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE;QACP,wCAAqB;QACrB,iDAAyB;QACzB,sCAAoB;QACpB,wCAAqB;QACrB,oCAAmB;QACnB,sDAA2B;QAC3B,2CAAsB;QACtB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,kCAAkC;YACjD,IAAI,EAAE,qBAAc;YACpB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,YAAY,EAAE;iBAC7C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,0DAA8B,EAAE,uCAAqB,EAAE,gCAAiB,EAAE,+BAAiB,EAAE,sDAA4B,EAAE,0CAAsB,CAAC;CAC9J,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const createCandidateNoteAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ candidate_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ note_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
4
+ body: import("@activepieces/pieces-framework").LongTextProperty<true>;
5
+ visibility: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
6
+ user_id: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ }>;
8
+ //# sourceMappingURL=create-candidate-note.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-candidate-note.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-candidate-note.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,yBAAyB;;;;;;EAsFpC,CAAC"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCandidateNoteAction = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.createCandidateNoteAction = (0, pieces_framework_1.createAction)({
10
+ name: 'create_candidate_note',
11
+ displayName: 'Create Candidate Note',
12
+ description: 'Adds a note to an existing candidate profile in Greenhouse.',
13
+ auth: auth_1.greenhouseAuth,
14
+ props: {
15
+ candidate_id: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Candidate ID',
17
+ description: 'The numeric ID of the candidate to add the note to. Found in the candidate URL in Greenhouse ' +
18
+ '(e.g. `https://app.greenhouse.io/people/**123456**`), or mapped from a previous **Create Candidate** step.',
19
+ required: true,
20
+ }),
21
+ note_type: pieces_framework_1.Property.StaticDropdown({
22
+ displayName: 'Note Type',
23
+ description: 'The type of note to create.',
24
+ required: true,
25
+ defaultValue: 'NOTE',
26
+ options: {
27
+ options: [
28
+ { label: 'Note', value: 'NOTE' },
29
+ { label: 'Activity', value: 'ACTIVITY' },
30
+ ],
31
+ },
32
+ }),
33
+ body: pieces_framework_1.Property.LongText({
34
+ displayName: 'Note',
35
+ description: 'The content of the note.',
36
+ required: true,
37
+ }),
38
+ visibility: pieces_framework_1.Property.StaticDropdown({
39
+ displayName: 'Visibility',
40
+ description: 'Who can see this note. **Admin Only** — only admins; **Private** — only the author; **Public** — all Greenhouse users.',
41
+ required: true,
42
+ defaultValue: 'public',
43
+ options: {
44
+ options: [
45
+ { label: 'Public (all users)', value: 'public' },
46
+ { label: 'Private (author only)', value: 'private' },
47
+ { label: 'Admin Only', value: 'admin_only' },
48
+ ],
49
+ },
50
+ }),
51
+ user_id: pieces_framework_1.Property.ShortText({
52
+ displayName: 'Author User ID',
53
+ description: 'Optional. The Greenhouse user ID to attribute this note to. ' +
54
+ 'To find it: go to **Configure → Users**, click a user, and copy the number from the URL ' +
55
+ '(e.g. `https://app.greenhouse.io/people/**12345**`).',
56
+ required: false,
57
+ }),
58
+ },
59
+ run(context) {
60
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
+ const { candidate_id, note_type, body, visibility, user_id } = context.propsValue;
62
+ const noteBody = {
63
+ candidate_id: Number(candidate_id),
64
+ note_type,
65
+ body,
66
+ visibility,
67
+ };
68
+ if (user_id)
69
+ noteBody['user_id'] = Number(user_id);
70
+ const response = yield (0, common_1.greenhouseApiCall)({
71
+ accessToken: context.auth.access_token,
72
+ method: pieces_common_1.HttpMethod.POST,
73
+ endpoint: '/notes',
74
+ body: noteBody,
75
+ });
76
+ const note = response.body;
77
+ return {
78
+ id: note.id,
79
+ candidate_id: note.candidate_id,
80
+ application_id: note.application_id,
81
+ body: note.body,
82
+ subject: note.subject,
83
+ type: note.type,
84
+ visibility: note.visibility,
85
+ created_at: note.created_at,
86
+ updated_at: note.updated_at,
87
+ user_id: note.user_id,
88
+ };
89
+ });
90
+ },
91
+ });
92
+ //# sourceMappingURL=create-candidate-note.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-candidate-note.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-candidate-note.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,sCAA8C;AAejC,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,6DAA6D;IAC1E,IAAI,EAAE,qBAAc;IACpB,KAAK,EAAE;QACL,YAAY,EAAE,2BA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EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAElF,MAAM,QAAQ,GAA4B;gBACxC,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC;gBAClC,SAAS;gBACT,IAAI;gBACJ,UAAU;aACX,CAAC;YAEF,IAAI,OAAO;gBAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;YAEnD,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAiB;gBACvD,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,QAAQ,EAAE,QAAQ;gBAClB,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO;gBACL,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const createCandidateAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ email_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ phone_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
8
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ linkedin_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ website_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
13
+ }>;
14
+ //# sourceMappingURL=create-candidate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-candidate.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-candidate.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAmHhC,CAAC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCandidateAction = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.createCandidateAction = (0, pieces_framework_1.createAction)({
10
+ name: 'create_candidate',
11
+ displayName: 'Create Candidate',
12
+ description: 'Creates a new candidate profile in Greenhouse.',
13
+ auth: auth_1.greenhouseAuth,
14
+ props: {
15
+ first_name: pieces_framework_1.Property.ShortText({
16
+ displayName: 'First Name',
17
+ description: "The candidate's first name.",
18
+ required: true,
19
+ }),
20
+ last_name: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Last Name',
22
+ description: "The candidate's last name.",
23
+ required: true,
24
+ }),
25
+ email: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Email Address',
27
+ description: "The candidate's email address.",
28
+ required: false,
29
+ }),
30
+ email_type: pieces_framework_1.Property.StaticDropdown({
31
+ displayName: 'Email Type',
32
+ description: 'The type of email address provided.',
33
+ required: false,
34
+ defaultValue: 'personal',
35
+ options: {
36
+ options: [
37
+ { label: 'Personal', value: 'personal' },
38
+ { label: 'Work', value: 'work' },
39
+ { label: 'Other', value: 'other' },
40
+ ],
41
+ },
42
+ }),
43
+ phone: pieces_framework_1.Property.ShortText({
44
+ displayName: 'Phone Number',
45
+ description: "The candidate's phone number.",
46
+ required: false,
47
+ }),
48
+ phone_type: pieces_framework_1.Property.StaticDropdown({
49
+ displayName: 'Phone Type',
50
+ description: 'The type of phone number provided.',
51
+ required: false,
52
+ defaultValue: 'mobile',
53
+ options: {
54
+ options: [
55
+ { label: 'Mobile', value: 'mobile' },
56
+ { label: 'Home', value: 'home' },
57
+ { label: 'Work', value: 'work' },
58
+ { label: 'Skype', value: 'skype' },
59
+ { label: 'Other', value: 'other' },
60
+ ],
61
+ },
62
+ }),
63
+ company: pieces_framework_1.Property.ShortText({
64
+ displayName: 'Current Company',
65
+ description: "The candidate's current employer.",
66
+ required: false,
67
+ }),
68
+ title: pieces_framework_1.Property.ShortText({
69
+ displayName: 'Current Job Title',
70
+ description: "The candidate's current job title.",
71
+ required: false,
72
+ }),
73
+ linkedin_url: pieces_framework_1.Property.ShortText({
74
+ displayName: 'LinkedIn URL',
75
+ description: "URL to the candidate's LinkedIn profile (e.g. `https://linkedin.com/in/johndoe`).",
76
+ required: false,
77
+ }),
78
+ website_url: pieces_framework_1.Property.ShortText({
79
+ displayName: 'Website URL',
80
+ description: "URL to the candidate's personal website or portfolio.",
81
+ required: false,
82
+ }),
83
+ tags: pieces_framework_1.Property.Array({
84
+ displayName: 'Tags',
85
+ description: 'Labels to attach to this candidate (e.g. `referral`, `engineering`). Each item in the list becomes one tag.',
86
+ required: false,
87
+ }),
88
+ },
89
+ run(context) {
90
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
91
+ const { first_name, last_name, email, email_type, phone, phone_type, company, title, linkedin_url, website_url, tags, } = context.propsValue;
92
+ const body = { first_name, last_name };
93
+ if (company)
94
+ body['company'] = company;
95
+ if (title)
96
+ body['title'] = title;
97
+ if (tags && tags.length > 0)
98
+ body['tags'] = tags;
99
+ if (email)
100
+ body['email_addresses'] = [{ value: email, type: email_type !== null && email_type !== void 0 ? email_type : 'personal' }];
101
+ if (phone)
102
+ body['phone_numbers'] = [{ value: phone, type: phone_type !== null && phone_type !== void 0 ? phone_type : 'mobile' }];
103
+ if (website_url)
104
+ body['website_addresses'] = [{ value: website_url, type: 'personal' }];
105
+ if (linkedin_url)
106
+ body['social_media_addresses'] = [{ value: linkedin_url }];
107
+ const response = yield (0, common_1.greenhouseApiCall)({
108
+ accessToken: context.auth.access_token,
109
+ method: pieces_common_1.HttpMethod.POST,
110
+ endpoint: '/candidates',
111
+ body,
112
+ });
113
+ return (0, common_1.shapeCandidate)(response.body.candidate);
114
+ });
115
+ },
116
+ });
117
+ //# sourceMappingURL=create-candidate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-candidate.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-candidate.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,sCAA8D;AAEjD,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,gDAAgD;IAC7D,IAAI,EAAE,qBAAc;IACpB,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,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CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,QAAQ,EAAE,CAAC,CAAC;YACpF,IAAI,WAAW;gBAAE,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YACxF,IAAI,YAAY;gBAAE,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;YAE7E,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAsD;gBAC5F,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,QAAQ,EAAE,aAAa;gBACvB,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,IAAA,uBAAc,EAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const createProspectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ email_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ phone_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
8
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ linkedin_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ website_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
13
+ }>;
14
+ //# sourceMappingURL=create-prospect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-prospect.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-prospect.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAuH/B,CAAC"}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createProspectAction = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.createProspectAction = (0, pieces_framework_1.createAction)({
10
+ name: 'create_prospect',
11
+ displayName: 'Create Prospect',
12
+ description: 'Creates a new prospect in Greenhouse — a person who has not yet applied to a specific job.',
13
+ auth: auth_1.greenhouseAuth,
14
+ props: {
15
+ first_name: pieces_framework_1.Property.ShortText({
16
+ displayName: 'First Name',
17
+ description: "The prospect's first name.",
18
+ required: true,
19
+ }),
20
+ last_name: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Last Name',
22
+ description: "The prospect's last name.",
23
+ required: true,
24
+ }),
25
+ email: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Email Address',
27
+ description: "The prospect's email address.",
28
+ required: false,
29
+ }),
30
+ email_type: pieces_framework_1.Property.StaticDropdown({
31
+ displayName: 'Email Type',
32
+ description: 'The type of email address provided.',
33
+ required: false,
34
+ defaultValue: 'personal',
35
+ options: {
36
+ options: [
37
+ { label: 'Personal', value: 'personal' },
38
+ { label: 'Work', value: 'work' },
39
+ { label: 'Other', value: 'other' },
40
+ ],
41
+ },
42
+ }),
43
+ phone: pieces_framework_1.Property.ShortText({
44
+ displayName: 'Phone Number',
45
+ description: "The prospect's phone number.",
46
+ required: false,
47
+ }),
48
+ phone_type: pieces_framework_1.Property.StaticDropdown({
49
+ displayName: 'Phone Type',
50
+ description: 'The type of phone number provided.',
51
+ required: false,
52
+ defaultValue: 'mobile',
53
+ options: {
54
+ options: [
55
+ { label: 'Mobile', value: 'mobile' },
56
+ { label: 'Home', value: 'home' },
57
+ { label: 'Work', value: 'work' },
58
+ { label: 'Skype', value: 'skype' },
59
+ { label: 'Other', value: 'other' },
60
+ ],
61
+ },
62
+ }),
63
+ company: pieces_framework_1.Property.ShortText({
64
+ displayName: 'Current Company',
65
+ description: "The prospect's current employer.",
66
+ required: false,
67
+ }),
68
+ title: pieces_framework_1.Property.ShortText({
69
+ displayName: 'Current Job Title',
70
+ description: "The prospect's current job title.",
71
+ required: false,
72
+ }),
73
+ linkedin_url: pieces_framework_1.Property.ShortText({
74
+ displayName: 'LinkedIn URL',
75
+ description: "URL to the prospect's LinkedIn profile (e.g. `https://linkedin.com/in/johndoe`).",
76
+ required: false,
77
+ }),
78
+ website_url: pieces_framework_1.Property.ShortText({
79
+ displayName: 'Website URL',
80
+ description: "URL to the prospect's personal website or portfolio.",
81
+ required: false,
82
+ }),
83
+ tags: pieces_framework_1.Property.Array({
84
+ displayName: 'Tags',
85
+ description: 'Labels to attach to this prospect (e.g. `referral`, `engineering`). Each item in the list becomes one tag.',
86
+ required: false,
87
+ }),
88
+ },
89
+ run(context) {
90
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
91
+ const { first_name, last_name, email, email_type, phone, phone_type, company, title, linkedin_url, website_url, tags, } = context.propsValue;
92
+ const body = {
93
+ first_name,
94
+ last_name,
95
+ application: { prospect: true },
96
+ };
97
+ if (company)
98
+ body['company'] = company;
99
+ if (title)
100
+ body['title'] = title;
101
+ if (tags && tags.length > 0)
102
+ body['tags'] = tags;
103
+ if (email)
104
+ body['email_addresses'] = [{ value: email, type: email_type !== null && email_type !== void 0 ? email_type : 'personal' }];
105
+ if (phone)
106
+ body['phone_numbers'] = [{ value: phone, type: phone_type !== null && phone_type !== void 0 ? phone_type : 'mobile' }];
107
+ if (website_url)
108
+ body['website_addresses'] = [{ value: website_url, type: 'personal' }];
109
+ if (linkedin_url)
110
+ body['social_media_addresses'] = [{ value: linkedin_url }];
111
+ const response = yield (0, common_1.greenhouseApiCall)({
112
+ accessToken: context.auth.access_token,
113
+ method: pieces_common_1.HttpMethod.POST,
114
+ endpoint: '/candidates',
115
+ body,
116
+ });
117
+ return (0, common_1.shapeCandidate)(response.body.candidate);
118
+ });
119
+ },
120
+ });
121
+ //# sourceMappingURL=create-prospect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-prospect.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-prospect.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,sCAAmF;AAEtE,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,4FAA4F;IACzG,IAAI,EAAE,qBAAc;IACpB,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAClC,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,UAAU;YACxB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE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,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YACxF,IAAI,YAAY;gBAAE,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;YAE7E,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAqC;gBAC3E,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,QAAQ,EAAE,aAAa;gBACvB,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,IAAA,uBAAc,EAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const findCandidateAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ }>;
4
+ //# sourceMappingURL=find-candidate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-candidate.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-candidate.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;EA8B9B,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findCandidateAction = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.findCandidateAction = (0, pieces_framework_1.createAction)({
10
+ name: 'find_candidate',
11
+ displayName: 'Find Candidate',
12
+ description: 'Searches for a candidate in Greenhouse by email address. Returns the first match.',
13
+ auth: auth_1.greenhouseAuth,
14
+ props: {
15
+ email: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Email Address',
17
+ description: 'The email address to search for. Returns the first candidate whose profile contains this address.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { email } = context.propsValue;
24
+ const response = yield (0, common_1.greenhouseApiCall)({
25
+ accessToken: context.auth.access_token,
26
+ method: pieces_common_1.HttpMethod.GET,
27
+ endpoint: '/candidates',
28
+ queryParams: { email },
29
+ });
30
+ const candidates = Array.isArray(response.body) ? response.body : [];
31
+ if (candidates.length === 0) {
32
+ return { found: false };
33
+ }
34
+ return Object.assign({ found: true }, (0, common_1.shapeCandidate)(candidates[0]));
35
+ });
36
+ },
37
+ });
38
+ //# sourceMappingURL=find-candidate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-candidate.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-candidate.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,sCAAmF;AAEtE,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mFAAmF;IAChG,IAAI,EAAE,qBAAc;IACpB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,mGAAmG;YAChH,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAErC,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAwB;gBAC9D,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,QAAQ,EAAE,aAAa;gBACvB,WAAW,EAAE,EAAE,KAAK,EAAE;aACvB,CAAC,CAAC;YAEH,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAErE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;YAC1B,CAAC;YAED,uBAAS,KAAK,EAAE,IAAI,IAAK,IAAA,uBAAc,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAG;QAC3D,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const findDueScorecardAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ scorecard_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ }>;
4
+ //# sourceMappingURL=find-due-scorecard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-due-scorecard.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-due-scorecard.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,sBAAsB;;EAgDjC,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findDueScorecardAction = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.findDueScorecardAction = (0, pieces_framework_1.createAction)({
10
+ name: 'find_due_scorecard',
11
+ displayName: 'Find Due Scorecard',
12
+ description: 'Retrieves the full details of a scorecard by its ID. Use with the New Scorecard Due trigger to look up the scorecard that fired the flow.',
13
+ auth: auth_1.greenhouseAuth,
14
+ props: {
15
+ scorecard_id: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Scorecard ID',
17
+ description: 'The numeric ID of the scorecard to retrieve. Typically mapped from a **New Scorecard Due** trigger step.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { scorecard_id } = context.propsValue;
24
+ const response = yield (0, common_1.greenhouseApiCall)({
25
+ accessToken: context.auth.access_token,
26
+ method: pieces_common_1.HttpMethod.GET,
27
+ endpoint: '/scorecards',
28
+ queryParams: { ids: scorecard_id },
29
+ });
30
+ const scorecards = Array.isArray(response.body) ? response.body : [];
31
+ const s = scorecards[0];
32
+ if (!s) {
33
+ return null;
34
+ }
35
+ return {
36
+ id: s.id,
37
+ application_id: s.application_id,
38
+ interview_kit_id: s.interview_kit_id,
39
+ interviewer_id: s.interviewer_id,
40
+ submitter_id: s.submitter_id,
41
+ status: s.status,
42
+ candidate_rating: s.candidate_rating,
43
+ notes: s.notes,
44
+ public_notes: s.public_notes,
45
+ private_notes: s.private_notes,
46
+ interviewed_at: s.interviewed_at,
47
+ submitted_at: s.submitted_at,
48
+ created_at: s.created_at,
49
+ updated_at: s.updated_at,
50
+ };
51
+ });
52
+ },
53
+ });
54
+ //# sourceMappingURL=find-due-scorecard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-due-scorecard.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-due-scorecard.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,sCAA8C;AAmBjC,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EACT,2IAA2I;IAC7I,IAAI,EAAE,qBAAc;IACpB,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,0GAA0G;YAC5G,QAAQ,EAAE,IAAI;SACf,CAAC;KACH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ces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ email: 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_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ phone_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
8
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ linkedin_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ website_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
13
+ }>;
14
+ //# sourceMappingURL=find-or-create-candidate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-or-create-candidate.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-or-create-candidate.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;EAkItC,CAAC"}