@activepieces/piece-greenhouse 0.0.3 → 0.0.5

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 +7 -12
  2. package/src/index.js +13 -50
  3. package/src/index.d.ts +0 -2
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-candidate-note.d.ts +0 -8
  7. package/src/lib/actions/create-candidate-note.d.ts.map +0 -1
  8. package/src/lib/actions/create-candidate-note.js +0 -97
  9. package/src/lib/actions/create-candidate-note.js.map +0 -1
  10. package/src/lib/actions/create-candidate.d.ts +0 -14
  11. package/src/lib/actions/create-candidate.d.ts.map +0 -1
  12. package/src/lib/actions/create-candidate.js +0 -122
  13. package/src/lib/actions/create-candidate.js.map +0 -1
  14. package/src/lib/actions/create-prospect.d.ts +0 -14
  15. package/src/lib/actions/create-prospect.d.ts.map +0 -1
  16. package/src/lib/actions/create-prospect.js +0 -126
  17. package/src/lib/actions/create-prospect.js.map +0 -1
  18. package/src/lib/actions/find-candidate.d.ts +0 -4
  19. package/src/lib/actions/find-candidate.d.ts.map +0 -1
  20. package/src/lib/actions/find-candidate.js +0 -43
  21. package/src/lib/actions/find-candidate.js.map +0 -1
  22. package/src/lib/actions/find-due-scorecard.d.ts +0 -4
  23. package/src/lib/actions/find-due-scorecard.d.ts.map +0 -1
  24. package/src/lib/actions/find-due-scorecard.js +0 -59
  25. package/src/lib/actions/find-due-scorecard.js.map +0 -1
  26. package/src/lib/actions/find-or-create-candidate.d.ts +0 -14
  27. package/src/lib/actions/find-or-create-candidate.d.ts.map +0 -1
  28. package/src/lib/actions/find-or-create-candidate.js +0 -131
  29. package/src/lib/actions/find-or-create-candidate.js.map +0 -1
  30. package/src/lib/actions/update-candidate.d.ts +0 -15
  31. package/src/lib/actions/update-candidate.d.ts.map +0 -1
  32. package/src/lib/actions/update-candidate.js +0 -132
  33. package/src/lib/actions/update-candidate.js.map +0 -1
  34. package/src/lib/auth.d.ts +0 -2
  35. package/src/lib/auth.d.ts.map +0 -1
  36. package/src/lib/auth.js +0 -30
  37. package/src/lib/auth.js.map +0 -1
  38. package/src/lib/common/index.d.ts +0 -58
  39. package/src/lib/common/index.d.ts.map +0 -1
  40. package/src/lib/common/index.js +0 -44
  41. package/src/lib/common/index.js.map +0 -1
  42. package/src/lib/triggers/candidate-hired.d.ts +0 -3
  43. package/src/lib/triggers/candidate-hired.d.ts.map +0 -1
  44. package/src/lib/triggers/candidate-hired.js +0 -93
  45. package/src/lib/triggers/candidate-hired.js.map +0 -1
  46. package/src/lib/triggers/job-updated.d.ts +0 -3
  47. package/src/lib/triggers/job-updated.d.ts.map +0 -1
  48. package/src/lib/triggers/job-updated.js +0 -96
  49. package/src/lib/triggers/job-updated.js.map +0 -1
  50. package/src/lib/triggers/new-candidate-application.d.ts +0 -3
  51. package/src/lib/triggers/new-candidate-application.d.ts.map +0 -1
  52. package/src/lib/triggers/new-candidate-application.js +0 -106
  53. package/src/lib/triggers/new-candidate-application.js.map +0 -1
  54. package/src/lib/triggers/new-job-post.d.ts +0 -3
  55. package/src/lib/triggers/new-job-post.d.ts.map +0 -1
  56. package/src/lib/triggers/new-job-post.js +0 -102
  57. package/src/lib/triggers/new-job-post.js.map +0 -1
  58. package/src/lib/triggers/new-scheduled-interview.d.ts +0 -11
  59. package/src/lib/triggers/new-scheduled-interview.d.ts.map +0 -1
  60. package/src/lib/triggers/new-scheduled-interview.js +0 -102
  61. package/src/lib/triggers/new-scheduled-interview.js.map +0 -1
  62. package/src/lib/triggers/new-scorecard-due.d.ts +0 -3
  63. package/src/lib/triggers/new-scorecard-due.d.ts.map +0 -1
  64. package/src/lib/triggers/new-scorecard-due.js +0 -90
  65. package/src/lib/triggers/new-scorecard-due.js.map +0 -1
@@ -1,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCandidateAction = 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.updateCandidateAction = (0, pieces_framework_1.createAction)({
10
- name: 'update_candidate',
11
- displayName: 'Update Candidate',
12
- description: 'Updates an existing candidate profile in Greenhouse. Only fields you provide will be changed.',
13
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Updates fields on an existing candidate identified by numeric candidate ID; only the fields you supply are changed, and the rest are left untouched. Use to amend a candidate name, contact details, current role, links, or tags. Idempotent — re-sending the same field values leaves the record in the same state; note that supplying email/phone replaces the primary value and supplying tags replaces all existing tags.',
16
- idempotent: true,
17
- },
18
- auth: auth_1.greenhouseAuth,
19
- props: {
20
- candidate_id: pieces_framework_1.Property.ShortText({
21
- displayName: 'Candidate ID',
22
- description: 'The numeric ID of the candidate to update. Found in the candidate URL in Greenhouse ' +
23
- '(e.g. `https://app.greenhouse.io/people/**123456**`), or mapped from a previous **Create Candidate** step.',
24
- required: true,
25
- }),
26
- first_name: pieces_framework_1.Property.ShortText({
27
- displayName: 'First Name',
28
- description: "Updated first name for the candidate.",
29
- required: false,
30
- }),
31
- last_name: pieces_framework_1.Property.ShortText({
32
- displayName: 'Last Name',
33
- description: "Updated last name for the candidate.",
34
- required: false,
35
- }),
36
- email: pieces_framework_1.Property.ShortText({
37
- displayName: 'Email Address',
38
- description: "Updated email address. This replaces the candidate's primary email.",
39
- required: false,
40
- }),
41
- email_type: pieces_framework_1.Property.StaticDropdown({
42
- displayName: 'Email Type',
43
- description: 'The type of the updated email address.',
44
- required: false,
45
- defaultValue: 'personal',
46
- options: {
47
- options: [
48
- { label: 'Personal', value: 'personal' },
49
- { label: 'Work', value: 'work' },
50
- { label: 'Other', value: 'other' },
51
- ],
52
- },
53
- }),
54
- phone: pieces_framework_1.Property.ShortText({
55
- displayName: 'Phone Number',
56
- description: "Updated phone number. This replaces the candidate's primary phone.",
57
- required: false,
58
- }),
59
- phone_type: pieces_framework_1.Property.StaticDropdown({
60
- displayName: 'Phone Type',
61
- description: 'The type of the updated phone number.',
62
- required: false,
63
- defaultValue: 'mobile',
64
- options: {
65
- options: [
66
- { label: 'Mobile', value: 'mobile' },
67
- { label: 'Home', value: 'home' },
68
- { label: 'Work', value: 'work' },
69
- { label: 'Skype', value: 'skype' },
70
- { label: 'Other', value: 'other' },
71
- ],
72
- },
73
- }),
74
- company: pieces_framework_1.Property.ShortText({
75
- displayName: 'Current Company',
76
- description: "Updated current employer.",
77
- required: false,
78
- }),
79
- title: pieces_framework_1.Property.ShortText({
80
- displayName: 'Current Job Title',
81
- description: "Updated current job title.",
82
- required: false,
83
- }),
84
- linkedin_url: pieces_framework_1.Property.ShortText({
85
- displayName: 'LinkedIn URL',
86
- description: "Updated LinkedIn profile URL (e.g. `https://linkedin.com/in/johndoe`).",
87
- required: false,
88
- }),
89
- website_url: pieces_framework_1.Property.ShortText({
90
- displayName: 'Website URL',
91
- description: "Updated personal website or portfolio URL.",
92
- required: false,
93
- }),
94
- tags: pieces_framework_1.Property.Array({
95
- displayName: 'Tags',
96
- description: 'Replaces all existing tags on the candidate with this list. Leave blank to keep existing tags unchanged.',
97
- required: false,
98
- }),
99
- },
100
- run(context) {
101
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
102
- const { candidate_id, first_name, last_name, email, email_type, phone, phone_type, company, title, linkedin_url, website_url, tags, } = context.propsValue;
103
- const body = {};
104
- if (first_name)
105
- body['first_name'] = first_name;
106
- if (last_name)
107
- body['last_name'] = last_name;
108
- if (company)
109
- body['company'] = company;
110
- if (title)
111
- body['title'] = title;
112
- if (tags && tags.length > 0)
113
- body['tags'] = tags;
114
- if (email)
115
- body['email_addresses'] = [{ value: email, type: email_type !== null && email_type !== void 0 ? email_type : 'personal' }];
116
- if (phone)
117
- body['phone_numbers'] = [{ value: phone, type: phone_type !== null && phone_type !== void 0 ? phone_type : 'mobile' }];
118
- if (website_url)
119
- body['website_addresses'] = [{ value: website_url, type: 'personal' }];
120
- if (linkedin_url)
121
- body['social_media_addresses'] = [{ value: linkedin_url }];
122
- const response = yield (0, common_1.greenhouseApiCall)({
123
- accessToken: context.auth.access_token,
124
- method: pieces_common_1.HttpMethod.PATCH,
125
- endpoint: `/candidates/${candidate_id}`,
126
- body,
127
- });
128
- return (0, common_1.shapeCandidate)(response.body.candidate);
129
- });
130
- },
131
- });
132
- //# sourceMappingURL=update-candidate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-candidate.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-candidate.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,sCAAmF;AAEtE,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,+FAA+F;IAC5G,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,iaAAia;QACna,UAAU,EAAE,IAAI;KACjB;IACD,IAAI,EAAE,qBAAc;IACpB,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,sFAAsF;gBACtF,4GAA4G;YAC9G,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,qEAAqE;YAClF,QAAQ,EAAE,KA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UAAU,GAAI,UAAU,EAAE,CAAC,CAAC;YACxF,IAAI,KAAK;gBAAE,IAAI,CAAC,eAAe,CAAC,GAAG,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,EAAqC;gBAC3E,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,MAAM,EAAE,0BAAU,CAAC,KAAK;gBACxB,QAAQ,EAAE,eAAe,YAAY,EAAE;gBACvC,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,IAAA,uBAAc,EAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;KAAA;CACF,CAAC,CAAC"}
package/src/lib/auth.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const greenhouseAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
2
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,+GAwBzB,CAAC"}
package/src/lib/auth.js DELETED
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.greenhouseAuth = void 0;
4
- const pieces_framework_1 = require("@activepieces/pieces-framework");
5
- exports.greenhouseAuth = pieces_framework_1.PieceAuth.OAuth2({
6
- displayName: 'Greenhouse',
7
- description: `To connect Greenhouse, you need OAuth2 credentials from a registered Greenhouse partner application.
8
-
9
- **Steps to get credentials:**
10
- 1. Contact **partner-support@greenhouse.io** to register your integration.
11
- 2. Provide: integration name, required scopes, and your redirect URI.
12
- 3. Greenhouse will issue a **Client ID** and **Client Secret**.
13
-
14
- **Required scopes:** \`harvest:candidates:list\`, \`harvest:candidates:create\`, \`harvest:candidates:update\`, \`harvest:applications:list\`, \`harvest:jobs:list\`, \`harvest:job_posts:list\`, \`harvest:interviews:list\`, \`harvest:scorecards:list\`, \`harvest:notes:create\``,
15
- authUrl: 'https://auth.greenhouse.io/authorize',
16
- tokenUrl: 'https://auth.greenhouse.io/token',
17
- scope: [
18
- 'harvest:candidates:list',
19
- 'harvest:candidates:create',
20
- 'harvest:candidates:update',
21
- 'harvest:applications:list',
22
- 'harvest:jobs:list',
23
- 'harvest:job_posts:list',
24
- 'harvest:interviews:list',
25
- 'harvest:scorecards:list',
26
- 'harvest:notes:create',
27
- ],
28
- required: true,
29
- });
30
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAE9C,QAAA,cAAc,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE;;;;;;;qRAOsQ;IACnR,OAAO,EAAE,sCAAsC;IAC/C,QAAQ,EAAE,kCAAkC;IAC5C,KAAK,EAAE;QACL,yBAAyB;QACzB,2BAA2B;QAC3B,2BAA2B;QAC3B,2BAA2B;QAC3B,mBAAmB;QACnB,wBAAwB;QACxB,yBAAyB;QACzB,yBAAyB;QACzB,sBAAsB;KACvB;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
@@ -1,58 +0,0 @@
1
- import { HttpMethod, HttpMessageBody, QueryParams } from '@activepieces/pieces-common';
2
- export declare function greenhouseApiCall<T extends HttpMessageBody>({ accessToken, method, endpoint, body, queryParams, }: {
3
- accessToken: string;
4
- method: HttpMethod;
5
- endpoint: string;
6
- body?: Record<string, unknown>;
7
- queryParams?: QueryParams;
8
- }): Promise<import("@activepieces/pieces-common").HttpResponse<T>>;
9
- export type GreenhouseCandidate = {
10
- id: number;
11
- first_name: string;
12
- last_name: string;
13
- preferred_name: string | null;
14
- company: string | null;
15
- title: string | null;
16
- created_at: string;
17
- updated_at: string;
18
- last_activity_at: string | null;
19
- private: boolean;
20
- can_email: boolean;
21
- tags: string[];
22
- email_addresses: {
23
- value: string;
24
- type: string;
25
- }[];
26
- phone_numbers: {
27
- value: string;
28
- type: string;
29
- }[];
30
- website_addresses: {
31
- value: string;
32
- type: string;
33
- }[];
34
- social_media_addresses: {
35
- value: string;
36
- }[];
37
- };
38
- export declare function shapeCandidate(c: GreenhouseCandidate): {
39
- id: number;
40
- first_name: string;
41
- last_name: string;
42
- preferred_name: string | null;
43
- company: string | null;
44
- title: string | null;
45
- created_at: string;
46
- updated_at: string;
47
- last_activity_at: string | null;
48
- private: boolean;
49
- can_email: boolean;
50
- primary_email: string;
51
- primary_email_type: string;
52
- primary_phone: string;
53
- primary_phone_type: string;
54
- website_url: string | null;
55
- linkedin_url: string;
56
- tags: string;
57
- };
58
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,eAAe,EACf,WAAW,EACZ,MAAM,6BAA6B,CAAC;AAIrC,wBAAsB,iBAAiB,CAAC,CAAC,SAAS,eAAe,EAAE,EACjE,WAAW,EACX,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,kEAUA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,aAAa,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,iBAAiB,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,sBAAsB,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C,CAAC;AAEF,wBAAgB,cAAc,CAAC,CAAC,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;EAqBpD"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.greenhouseApiCall = greenhouseApiCall;
4
- exports.shapeCandidate = shapeCandidate;
5
- const tslib_1 = require("tslib");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const BASE_URL = 'https://harvest.greenhouse.io/v3';
8
- function greenhouseApiCall(_a) {
9
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ accessToken, method, endpoint, body, queryParams, }) {
10
- return pieces_common_1.httpClient.sendRequest({
11
- method,
12
- url: `${BASE_URL}${endpoint}`,
13
- headers: {
14
- Authorization: `Bearer ${accessToken}`,
15
- },
16
- body,
17
- queryParams,
18
- });
19
- });
20
- }
21
- function shapeCandidate(c) {
22
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
23
- return {
24
- id: c.id,
25
- first_name: c.first_name,
26
- last_name: c.last_name,
27
- preferred_name: (_a = c.preferred_name) !== null && _a !== void 0 ? _a : null,
28
- company: c.company,
29
- title: c.title,
30
- created_at: c.created_at,
31
- updated_at: c.updated_at,
32
- last_activity_at: c.last_activity_at,
33
- private: c.private,
34
- can_email: c.can_email,
35
- primary_email: (_d = (_c = (_b = c.email_addresses) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : null,
36
- primary_email_type: (_g = (_f = (_e = c.email_addresses) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.type) !== null && _g !== void 0 ? _g : null,
37
- primary_phone: (_k = (_j = (_h = c.phone_numbers) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.value) !== null && _k !== void 0 ? _k : null,
38
- primary_phone_type: (_o = (_m = (_l = c.phone_numbers) === null || _l === void 0 ? void 0 : _l[0]) === null || _m === void 0 ? void 0 : _m.type) !== null && _o !== void 0 ? _o : null,
39
- website_url: (_r = (_q = (_p = c.website_addresses) === null || _p === void 0 ? void 0 : _p.find((w) => w.type === 'personal')) === null || _q === void 0 ? void 0 : _q.value) !== null && _r !== void 0 ? _r : null,
40
- linkedin_url: (_u = (_t = (_s = c.social_media_addresses) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.value) !== null && _u !== void 0 ? _u : null,
41
- tags: ((_v = c.tags) !== null && _v !== void 0 ? _v : []).join(', '),
42
- };
43
- }
44
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;AASA,8CAsBC;AAqBD,wCAqBC;;AAzED,+DAKqC;AAErC,MAAM,QAAQ,GAAG,kCAAkC,CAAC;AAEpD,SAAsB,iBAAiB;iEAA4B,EACjE,WAAW,EACX,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,GAOZ;QACC,OAAO,0BAAU,CAAC,WAAW,CAAI;YAC/B,MAAM;YACN,GAAG,EAAE,GAAG,QAAQ,GAAG,QAAQ,EAAE;YAC7B,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,WAAW,EAAE;aACvC;YACD,IAAI;YACJ,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;CAAA;AAqBD,SAAgB,cAAc,CAAC,CAAsB;;IACnD,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,cAAc,EAAE,MAAA,CAAC,CAAC,cAAc,mCAAI,IAAI;QACxC,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;QACpC,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,aAAa,EAAE,MAAA,MAAA,MAAA,CAAC,CAAC,eAAe,0CAAG,CAAC,CAAC,0CAAE,KAAK,mCAAI,IAAI;QACpD,kBAAkB,EAAE,MAAA,MAAA,MAAA,CAAC,CAAC,eAAe,0CAAG,CAAC,CAAC,0CAAE,IAAI,mCAAI,IAAI;QACxD,aAAa,EAAE,MAAA,MAAA,MAAA,CAAC,CAAC,aAAa,0CAAG,CAAC,CAAC,0CAAE,KAAK,mCAAI,IAAI;QAClD,kBAAkB,EAAE,MAAA,MAAA,MAAA,CAAC,CAAC,aAAa,0CAAG,CAAC,CAAC,0CAAE,IAAI,mCAAI,IAAI;QACtD,WAAW,EAAE,MAAA,MAAA,MAAA,CAAC,CAAC,iBAAiB,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,0CAAE,KAAK,mCAAI,IAAI;QACnF,YAAY,EAAE,MAAA,MAAA,MAAA,CAAC,CAAC,sBAAsB,0CAAG,CAAC,CAAC,0CAAE,KAAK,mCAAI,IAAI;QAC1D,IAAI,EAAE,CAAC,MAAA,CAAC,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;KAChC,CAAC;AACJ,CAAC"}
@@ -1,3 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const candidateHiredTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}>;
3
- //# sourceMappingURL=candidate-hired.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidate-hired.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/candidate-hired.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAqExC,eAAO,MAAM,qBAAqB,kwBAqChC,CAAC"}
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.candidateHiredTrigger = 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
- const polling = {
10
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
11
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS }) {
12
- const createdAfter = lastFetchEpochMS > 0
13
- ? new Date(lastFetchEpochMS).toISOString()
14
- : new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
15
- const response = yield (0, common_1.greenhouseApiCall)({
16
- accessToken: auth.access_token,
17
- method: pieces_common_1.HttpMethod.GET,
18
- endpoint: '/applications',
19
- queryParams: {
20
- status: 'hired',
21
- 'created_at[gte]': createdAfter,
22
- per_page: '500',
23
- },
24
- });
25
- const applications = Array.isArray(response.body) ? response.body : [];
26
- return applications.map((app) => {
27
- var _a;
28
- return ({
29
- epochMilliSeconds: new Date((_a = app.last_activity_at) !== null && _a !== void 0 ? _a : app.created_at).getTime(),
30
- data: {
31
- id: app.id,
32
- candidate_id: app.candidate_id,
33
- job_id: app.job_id,
34
- job_post_id: app.job_post_id,
35
- prospect: app.prospect,
36
- status: app.status,
37
- created_at: app.created_at,
38
- hired_at: app.last_activity_at,
39
- location_address: app.location_address,
40
- source_id: app.source_id,
41
- referrer_id: app.referrer_id,
42
- stage_id: app.stage_id,
43
- },
44
- });
45
- });
46
- }),
47
- };
48
- exports.candidateHiredTrigger = (0, pieces_framework_1.createTrigger)({
49
- auth: auth_1.greenhouseAuth,
50
- name: 'candidate_hired',
51
- displayName: 'Candidate Hired',
52
- description: 'Triggers when a candidate is hired.',
53
- aiMetadata: {
54
- description: 'Fires when a candidate application reaches the hired status in Greenhouse, representing a completed hire. Use to kick off onboarding or downstream HR steps; polls applications filtered to hired status.',
55
- },
56
- props: {},
57
- sampleData: {
58
- id: 48206478,
59
- candidate_id: 36952451,
60
- job_id: 211706,
61
- job_post_id: 123,
62
- prospect: false,
63
- status: 'hired',
64
- created_at: '2024-02-01T14:26:02.000Z',
65
- hired_at: '2024-03-15T10:00:00.000Z',
66
- location_address: 'New York, New York, USA',
67
- source_id: 33,
68
- referrer_id: null,
69
- stage_id: null,
70
- },
71
- type: pieces_framework_1.TriggerStrategy.POLLING,
72
- test(context) {
73
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
74
- return yield pieces_common_1.pollingHelper.test(polling, context);
75
- });
76
- },
77
- onEnable(context) {
78
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
- yield pieces_common_1.pollingHelper.onEnable(polling, context);
80
- });
81
- },
82
- onDisable(context) {
83
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
84
- yield pieces_common_1.pollingHelper.onDisable(polling, context);
85
- });
86
- },
87
- run(context) {
88
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
89
- return yield pieces_common_1.pollingHelper.poll(polling, context);
90
- });
91
- },
92
- });
93
- //# sourceMappingURL=candidate-hired.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidate-hired.js","sourceRoot":"","sources":["../../../../src/lib/triggers/candidate-hired.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,kCAAyC;AACzC,sCAA8C;AAoB9C,MAAM,OAAO,GAAmD;IAC9D,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAmC,EAAE,oDAA9B,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACtC,MAAM,YAAY,GAChB,gBAAgB,GAAG,CAAC;YAClB,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE;YAC1C,C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B;aACF,CAAC,CAAA;SAAA,CAAC,CAAC;IACN,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,qBAAqB,GAAG,IAAA,gCAAa,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,qCAAqC;IAClD,UAAU,EAAE;QACV,WAAW,EACT,2MAA2M;KAC9M;IACD,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,EAAE,EAAE,QAAQ;QACZ,YAAY,EAAE,QAAQ;QACtB,MAAM,EAAE,MAAM;QACd,WAAW,EAAE,GAAG;QAChB,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,0BAA0B;QACtC,QAAQ,EAAE,0BAA0B;QACpC,gBAAgB,EAAE,yBAAyB;QAC3C,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const jobUpdatedTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}>;
3
- //# sourceMappingURL=job-updated.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"job-updated.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/job-updated.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AA+ExC,eAAO,MAAM,iBAAiB,kwBAuC5B,CAAC"}
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jobUpdatedTrigger = 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
- const polling = {
10
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
11
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS }) {
12
- const updatedAfter = lastFetchEpochMS > 0
13
- ? new Date(lastFetchEpochMS).toISOString()
14
- : new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
15
- const response = yield (0, common_1.greenhouseApiCall)({
16
- accessToken: auth.access_token,
17
- method: pieces_common_1.HttpMethod.GET,
18
- endpoint: '/jobs',
19
- queryParams: {
20
- 'updated_at[gte]': updatedAfter,
21
- per_page: '500',
22
- },
23
- });
24
- const jobs = Array.isArray(response.body) ? response.body : [];
25
- return jobs.map((job) => {
26
- var _a, _b, _c;
27
- return ({
28
- epochMilliSeconds: new Date(job.updated_at).getTime(),
29
- data: {
30
- id: job.id,
31
- name: job.name,
32
- requisition_id: job.requisition_id,
33
- status: job.status,
34
- confidential: job.confidential,
35
- is_template: job.is_template,
36
- created_at: job.created_at,
37
- opened_at: job.opened_at,
38
- closed_at: job.closed_at,
39
- updated_at: job.updated_at,
40
- department_id: job.department_id,
41
- office_ids: ((_a = job.office_ids) !== null && _a !== void 0 ? _a : []).join(', '),
42
- open_openings: ((_b = job.openings) !== null && _b !== void 0 ? _b : []).filter((o) => o.open).length,
43
- total_openings: ((_c = job.openings) !== null && _c !== void 0 ? _c : []).length,
44
- },
45
- });
46
- });
47
- }),
48
- };
49
- exports.jobUpdatedTrigger = (0, pieces_framework_1.createTrigger)({
50
- auth: auth_1.greenhouseAuth,
51
- name: 'job_updated',
52
- displayName: 'Job Updated',
53
- description: 'Triggers when an existing job is updated.',
54
- aiMetadata: {
55
- description: 'Fires when an existing job in Greenhouse is modified, representing any change to its details, status, or openings. Polls jobs by their updated timestamp, so the same job can fire again each time it changes.',
56
- },
57
- props: {},
58
- sampleData: {
59
- id: 6404,
60
- name: 'Senior Software Engineer',
61
- requisition_id: 'ENG-2024-001',
62
- status: 'open',
63
- confidential: false,
64
- is_template: false,
65
- created_at: '2024-01-15T14:42:58.000Z',
66
- opened_at: '2024-01-20T14:42:58.000Z',
67
- closed_at: null,
68
- updated_at: '2024-03-10T16:22:15.000Z',
69
- department_id: 12345,
70
- office_ids: '47012',
71
- open_openings: 2,
72
- total_openings: 3,
73
- },
74
- type: pieces_framework_1.TriggerStrategy.POLLING,
75
- test(context) {
76
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
77
- return yield pieces_common_1.pollingHelper.test(polling, context);
78
- });
79
- },
80
- onEnable(context) {
81
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
82
- yield pieces_common_1.pollingHelper.onEnable(polling, context);
83
- });
84
- },
85
- onDisable(context) {
86
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
87
- yield pieces_common_1.pollingHelper.onDisable(polling, context);
88
- });
89
- },
90
- run(context) {
91
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
92
- return yield pieces_common_1.pollingHelper.poll(polling, context);
93
- });
94
- },
95
- });
96
- //# sourceMappingURL=job-updated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"job-updated.js","sourceRoot":"","sources":["../../../../src/lib/triggers/job-updated.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,kCAAyC;AACzC,sCAA8C;AA6B9C,MAAM,OAAO,GAAmD;IAC9D,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAmC,EAAE,oDAA9B,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACtC,MAAM,YAAY,GAChB,gBAAgB,GAAG,CAAC;YAClB,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE;YAC1C,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAE/D,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAAkB;YACxD,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,QAAQ,EAAE,OAAO;YACjB,WAAW,EAAE;gBACX,iBAAiB,EAAE,YAAY;gBAC/B,QAAQ,EAAE,KAAK;aAChB;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAE/D,OAAO,IAAI,CAAC,GAAG,CAAC,CA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AAE,0BAA0B;QAChC,cAAc,EAAE,cAAc;QAC9B,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,KAAK;QACnB,WAAW,EAAE,KAAK;QAClB,UAAU,EAAE,0BAA0B;QACtC,SAAS,EAAE,0BAA0B;QACrC,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,0BAA0B;QACtC,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,OAAO;QACnB,aAAa,EAAE,CAAC;QAChB,cAAc,EAAE,CAAC;KAClB;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newCandidateApplicationTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}>;
3
- //# sourceMappingURL=new-candidate-application.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-candidate-application.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-candidate-application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAqFxC,eAAO,MAAM,8BAA8B,kwBA4CzC,CAAC"}
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newCandidateApplicationTrigger = 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
- const polling = {
10
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
11
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS }) {
12
- const createdAfter = lastFetchEpochMS > 0
13
- ? new Date(lastFetchEpochMS).toISOString()
14
- : new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
15
- const response = yield (0, common_1.greenhouseApiCall)({
16
- accessToken: auth.access_token,
17
- method: pieces_common_1.HttpMethod.GET,
18
- endpoint: '/applications',
19
- queryParams: {
20
- 'created_at[gte]': createdAfter,
21
- per_page: '500',
22
- },
23
- });
24
- const applications = Array.isArray(response.body) ? response.body : [];
25
- return applications.map((app) => {
26
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
27
- return ({
28
- epochMilliSeconds: new Date(app.created_at).getTime(),
29
- data: {
30
- id: app.id,
31
- candidate_id: app.candidate_id,
32
- job_id: app.job_id,
33
- job_post_id: app.job_post_id,
34
- prospect: app.prospect,
35
- status: app.status,
36
- created_at: app.created_at,
37
- rejected_at: app.rejected_at,
38
- last_activity_at: app.last_activity_at,
39
- location_address: app.location_address,
40
- source_id: app.source_id,
41
- referrer_id: app.referrer_id,
42
- rejection_reason_id: app.rejection_reason_id,
43
- stage_id: app.stage_id,
44
- prospect_office_id: (_b = (_a = app.prospect_details) === null || _a === void 0 ? void 0 : _a.office_id) !== null && _b !== void 0 ? _b : null,
45
- prospect_department_id: (_d = (_c = app.prospect_details) === null || _c === void 0 ? void 0 : _c.department_id) !== null && _d !== void 0 ? _d : null,
46
- prospect_pool_id: (_f = (_e = app.prospect_details) === null || _e === void 0 ? void 0 : _e.pool_id) !== null && _f !== void 0 ? _f : null,
47
- prospect_pool_stage_id: (_h = (_g = app.prospect_details) === null || _g === void 0 ? void 0 : _g.pool_stage_id) !== null && _h !== void 0 ? _h : null,
48
- prospect_owner_id: (_k = (_j = app.prospect_details) === null || _j === void 0 ? void 0 : _j.prospect_owner_id) !== null && _k !== void 0 ? _k : null,
49
- },
50
- });
51
- });
52
- }),
53
- };
54
- exports.newCandidateApplicationTrigger = (0, pieces_framework_1.createTrigger)({
55
- auth: auth_1.greenhouseAuth,
56
- name: 'new_candidate_application',
57
- displayName: 'New Candidate Application',
58
- description: 'Triggers when a new application is submitted by a candidate.',
59
- aiMetadata: {
60
- description: 'Fires when a new candidate application is created in Greenhouse, representing a candidate applying to (or being added against) a job or prospect pool. Polls for newly created applications and emits each one once.',
61
- },
62
- props: {},
63
- sampleData: {
64
- id: 985314,
65
- candidate_id: 123456,
66
- job_id: 144371,
67
- job_post_id: null,
68
- prospect: false,
69
- status: 'active',
70
- created_at: '2024-03-15T09:30:00.000Z',
71
- rejected_at: null,
72
- last_activity_at: '2024-03-15T09:30:00.000Z',
73
- location_address: 'New York, New York, USA',
74
- source_id: 12,
75
- referrer_id: null,
76
- rejection_reason_id: null,
77
- stage_id: 77,
78
- prospect_office_id: null,
79
- prospect_department_id: null,
80
- prospect_pool_id: null,
81
- prospect_pool_stage_id: null,
82
- prospect_owner_id: null,
83
- },
84
- type: pieces_framework_1.TriggerStrategy.POLLING,
85
- test(context) {
86
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
87
- return yield pieces_common_1.pollingHelper.test(polling, context);
88
- });
89
- },
90
- onEnable(context) {
91
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
92
- yield pieces_common_1.pollingHelper.onEnable(polling, context);
93
- });
94
- },
95
- onDisable(context) {
96
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
97
- yield pieces_common_1.pollingHelper.onDisable(polling, context);
98
- });
99
- },
100
- run(context) {
101
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
102
- return yield pieces_common_1.pollingHelper.poll(polling, context);
103
- });
104
- },
105
- });
106
- //# sourceMappingURL=new-candidate-application.js.map