diff --git a/components/workday/actions/change-business-title/change-business-title.mjs b/components/workday/actions/change-business-title/change-business-title.mjs index 6b42ce4ccbe29..945c7a7bb1bd0 100644 --- a/components/workday/actions/change-business-title/change-business-title.mjs +++ b/components/workday/actions/change-business-title/change-business-title.mjs @@ -4,7 +4,7 @@ export default { key: "workday-change-business-title", name: "Change Business Title", description: "Change the business title of a worker. [See the documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#common/v1/post-/workers/-ID-/businessTitleChanges)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/workday/actions/close-mentorship/close-mentorship.mjs b/components/workday/actions/close-mentorship/close-mentorship.mjs new file mode 100644 index 0000000000000..e813cc6779ec3 --- /dev/null +++ b/components/workday/actions/close-mentorship/close-mentorship.mjs @@ -0,0 +1,78 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-close-mentorship", + name: "Close Mentorship", + description: "End a mentorship for a given ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/post-/mentorships/-ID-/close)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + + type: "action", + props: { + workday, + mentorshipId: { + propDefinition: [ + workday, + "mentorshipId", + ], + }, + comment: { + type: "string", + label: "Comment", + description: "Last event comment (optional). Example: `Lorem ipsum dolor sit amet, ...`", + optional: true, + }, + startDate: { + type: "string", + label: "Start Date", + description: "Start date for the mentorship (ISO 8601). Example: `2025-10-18T07:00:00.000Z`", + }, + endDate: { + type: "string", + label: "End Date", + description: "End date for the mentorship (ISO 8601). Example: `2025-10-18T07:00:00.000Z`", + }, + closeMentorshipReason: { + type: "object", + label: "Close Mentorship Reason", + description: "Example: `{ \"id\": \"00000000000000000000000000000000\" }`", + }, + descriptor: { + type: "string", + label: "Descriptor", + description: "Display name. Example: `Lorem ipsum dolor sit ame`", + optional: true, + }, + }, + async run({ $ }) { + if ( + !this.closeMentorshipReason || + typeof this.closeMentorshipReason !== "object" || + !this.closeMentorshipReason.id || + !this.closeMentorshipReason.id.trim() + ) { + throw new ConfigurationError("closeMentorshipReason is required and must be an object with a non-empty id property."); + } + + const data = { + closeMentorshipReason: this.closeMentorshipReason, + startDate: this.startDate, + endDate: this.endDate, + }; + if (this.comment) data.comment = this.comment; + if (this.descriptor) data.descriptor = this.descriptor; + + const response = await this.workday.closeMentorship({ + id: this.mentorshipId, + data, + $, + }); + $.export("$summary", `Mentorship ${this.mentorshipId} closed`); + return response; + }, +}; diff --git a/components/workday/actions/create-digital-course/create-digital-course.mjs b/components/workday/actions/create-digital-course/create-digital-course.mjs new file mode 100644 index 0000000000000..6d46ab0b4e5c3 --- /dev/null +++ b/components/workday/actions/create-digital-course/create-digital-course.mjs @@ -0,0 +1,91 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; +import utils from "../../sources/common/utils.mjs"; + +export default { + key: "workday-create-digital-course", + name: "Create Digital Course", + description: "Create a digital learning course. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#learning/v1/post-/manageDigitalCourses)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + topics: { + type: "string[]", + label: "Topics", + description: "The topics of the learning course event. Example: `[ { \"descriptor\": \"Leadership\", \"id\": \"topic-id-1\" } ]`", + }, + title: { + type: "string", + label: "Title", + description: "Course title. Example: `Digital Leadership 101`", + }, + availabilityStatus: { + type: "object", + label: "Availability Status", + description: "The status of the learning course event. Example: `{ \"id\": \"status-id-1\" }`", + }, + lessons: { + type: "string[]", + label: "Lessons", + description: "The course lessons of the learning course event. Example: `[ { \"title\": \"Lesson 1\", \"type\": { \"id\": \"type-id\" }, \"order\": 1, \"url\": \"https://...\", \"required\": true } ]`", + }, + description: { + type: "string", + label: "Description", + description: "Course description. Example: `Learn digital leadership strategies for remote teams.`", + }, + }, + async run({ $ }) { + const parsedTopics = utils.parseJsonInput(this.topics); + const parsedLessons = utils.parseJsonInput(this.lessons); + + if (!Array.isArray(parsedTopics) || parsedTopics.length === 0) { + throw new ConfigurationError("`topics` must be a non-empty array."); + } + for (const t of parsedTopics) { + if (!t.id || !t.descriptor) { + throw new ConfigurationError("Each topic must have both `id` and `descriptor`."); + } + } + + if (!Array.isArray(parsedLessons) || parsedLessons.length === 0) { + throw new ConfigurationError("`lessons` must be a non-empty array."); + } + for (const l of parsedLessons) { + if (!l.title || !l.type?.id || typeof l.order !== "number" || !l.url) { + throw new ConfigurationError("Each lesson must include `title`, `type` (object with id), `order` (integer), and `url`."); + } + } + + if (!this.title || !this.title.trim()) { + throw new ConfigurationError("`title` is required."); + } + if (!this.availabilityStatus || typeof this.availabilityStatus !== "object" || !this.availabilityStatus.id) { + throw new ConfigurationError("`availabilityStatus` is required and must be an object with a non-empty 'id'."); + } + if (!this.description || !this.description.trim()) { + throw new ConfigurationError("`description` is required."); + } + + const data = { + topics: parsedTopics, + title: this.title, + availabilityStatus: this.availabilityStatus, + lessons: parsedLessons, + description: this.description, + }; + + const response = await this.workday.createDigitalCourse({ + $, + data, + }); + $.export("$summary", "Digital course created"); + return response; + }, +}; diff --git a/components/workday/actions/create-distribution-request/create-distribution-request.mjs b/components/workday/actions/create-distribution-request/create-distribution-request.mjs new file mode 100644 index 0000000000000..ad044ff87cb37 --- /dev/null +++ b/components/workday/actions/create-distribution-request/create-distribution-request.mjs @@ -0,0 +1,80 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-distribution-request", + name: "Create Distribution Request", + description: "Create a new distribution request. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#journeys/v1/post-/distributionRequests)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + builder: { + type: "object", + label: "Builder", + description: "A journey builder object. Example: `{ \"id\": \"00000000000000000000000000000000\" }`", + }, + category: { + type: "object", + label: "Category", + description: "A journey category object. Example: `{ \"id\": \"00000000000000000000000000000000\" }`", + }, + discoverableBuilder: { + type: "object", + label: "Discoverable Builder", + description: "A discoverable journey builder object. Example: `{ \"id\": \"00000000000000000000000000000000\" }`", + }, + includePreviousRecipients: { + type: "boolean", + label: "Include Previous Recipients", + description: "Whether to include previous recipients. Example: `true`", + optional: true, + }, + relatedRole: { + type: "object", + label: "Related Role", + description: "Related role object. Example: `{ \"id\": \"00000000000000000000000000000000\" }`", + }, + descriptor: { + type: "string", + label: "Descriptor", + description: "Display name for the instance. Example: `Distribution Request for Training`", + optional: true, + }, + }, + async run({ $ }) { + if (!this.builder || typeof this.builder !== "object" || !this.builder.id || !this.builder.id.trim()) { + throw new ConfigurationError("Builder is required and must be an object with a non-empty id property."); + } + if (!this.category || typeof this.category !== "object" || !this.category.id || !this.category.id.trim()) { + throw new ConfigurationError("Category is required and must be an object with a non-empty id property."); + } + if (this.discoverableBuilder && (typeof this.discoverableBuilder !== "object" || !this.discoverableBuilder.id || !this.discoverableBuilder.id.trim())) { + throw new ConfigurationError("Discoverable Builder (if provided) must be an object with a non-empty id property."); + } + if (this.relatedRole && (typeof this.relatedRole !== "object" || !this.relatedRole.id || !this.relatedRole.id.trim())) { + throw new ConfigurationError("Related Role (if provided) must be an object with a non-empty id property."); + } + + const data = { + builder: this.builder, + category: this.category, + }; + if (this.discoverableBuilder) data.discoverableBuilder = this.discoverableBuilder; + if (typeof this.includePreviousRecipients === "boolean") data.includePreviousRecipients = this.includePreviousRecipients; + if (this.relatedRole) data.relatedRole = this.relatedRole; + if (this.descriptor) data.descriptor = this.descriptor; + + const response = await this.workday.createDistributionRequest({ + $, + data, + }); + $.export("$summary", "Distribution request created"); + return response; + }, +}; diff --git a/components/workday/actions/create-home-contact-information-change/create-home-contact-information-change.mjs b/components/workday/actions/create-home-contact-information-change/create-home-contact-information-change.mjs new file mode 100644 index 0000000000000..f108b45278c4b --- /dev/null +++ b/components/workday/actions/create-home-contact-information-change/create-home-contact-information-change.mjs @@ -0,0 +1,36 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-home-contact-information-change", + name: "create Home Contact Information Change", + description: "creates a home contact change for a worker. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + workerId: { + propDefinition: [ + workday, + "workerId", + ], + }, + }, + async run({ $ }) { + if (!this.workerId || !this.workerId.trim()) { + throw new ConfigurationError("Worker ID is required."); + } + const response = await this.workday.createHomeContactInformationChange({ + workerId: this.workerId, + data: {}, + $, + }); + $.export("$summary", `Home contact change event created for worker ID ${this.workerId}`); + return response; + }, +}; diff --git a/components/workday/actions/create-job-change/create-job-change.mjs b/components/workday/actions/create-job-change/create-job-change.mjs index 8f46fd2789cec..f0e5a086b0b98 100644 --- a/components/workday/actions/create-job-change/create-job-change.mjs +++ b/components/workday/actions/create-job-change/create-job-change.mjs @@ -4,7 +4,7 @@ export default { key: "workday-create-job-change", name: "Create Job Change", description: "Create a job change for a worker. [See the documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#common/v1/post-/workers/-ID-/jobChanges)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/workday/actions/create-mentorship-for-me/create-mentorship-for-me.mjs b/components/workday/actions/create-mentorship-for-me/create-mentorship-for-me.mjs new file mode 100644 index 0000000000000..852b3bda0f907 --- /dev/null +++ b/components/workday/actions/create-mentorship-for-me/create-mentorship-for-me.mjs @@ -0,0 +1,86 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-mentorship-for-me", + name: "Create Mentorship For Current User", + description: "Creates a mentorship for the current user. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/post-/createMentorshipForMe)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + endDate: { + type: "string", + label: "End Date", + description: "Proposed end date (ISO 8601 format). Example: '2025-10-18T07:00:00.000Z'", + }, + startDate: { + type: "string", + label: "Start Date", + description: "Proposed start date (ISO 8601 format). Example: '2025-10-18T07:00:00.000Z'", + }, + purpose: { + type: "string", + label: "Purpose", + description: "Purpose of the mentorship.", + }, + mentor: { + type: "object", + label: "Mentor", + description: "Object with at least an `id`. Example: `{ id: \"00000000000000000000000000000000\"}`", + }, + comment: { + type: "string", + label: "Comment", + description: "Optional. Comment field for notes or special requests.", + optional: true, + }, + mentorType: { + type: "object", + label: "Mentor Type", + description: "Object with at least an `id`. Example: `{ id: \"00000000000000000000000000000000\"}`", + optional: true, + }, + descriptor: { + type: "string", + label: "Descriptor", + description: "Optional. Display name of the mentorship.", + optional: true, + }, + }, + async run({ $ }) { + if (!this.endDate || !this.endDate.trim()) throw new ConfigurationError("End Date is required and cannot be empty."); + if (!this.startDate || !this.startDate.trim()) throw new ConfigurationError("Start Date is required and cannot be empty."); + if (!this.purpose || !this.purpose.trim()) throw new ConfigurationError("Purpose is required and cannot be empty."); + if (!this.mentor || typeof this.mentor !== "object" || !this.mentor.id || !this.mentor.id.trim()) { + throw new ConfigurationError("Mentor is required and must be an object with a non-empty id property."); + } + if (this.mentorType !== undefined) { + if (typeof this.mentorType !== "object" || !this.mentorType.id || !this.mentorType.id.trim()) { + throw new ConfigurationError("If provided, mentorType must be an object with a non-empty id property."); + } + } + + const data = { + endDate: this.endDate, + startDate: this.startDate, + purpose: this.purpose, + mentor: this.mentor, + }; + if (this.comment) data.comment = this.comment; + if (this.mentorType) data.mentorType = this.mentorType; + if (this.descriptor) data.descriptor = this.descriptor; + + const response = await this.workday.createMentorshipForMe({ + $, + data, + }); + $.export("$summary", "Mentorship created for current user"); + return response; + }, +}; diff --git a/components/workday/actions/create-mentorship-for-worker/create-mentorship-for-worker.mjs b/components/workday/actions/create-mentorship-for-worker/create-mentorship-for-worker.mjs new file mode 100644 index 0000000000000..ca336cb85bfa4 --- /dev/null +++ b/components/workday/actions/create-mentorship-for-worker/create-mentorship-for-worker.mjs @@ -0,0 +1,94 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-mentorship-for-worker", + name: "Create Mentorship For Worker", + description: "Create a mentorship for a specific worker. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/post-/createMentorshipForWorker)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + endDate: { + type: "string", + label: "End Date", + description: "Proposed end date (ISO 8601 format). Example :`2025-10-18T07:00:00.000Z`", + }, + startDate: { + type: "string", + label: "Start Date", + description: "Proposed start date (ISO 8601 format). Example :`2025-10-18T07:00:00.000Z`", + }, + purpose: { + type: "string", + label: "Purpose", + description: "Purpose of the mentorship.", + }, + mentor: { + type: "object", + label: "Mentor", + description: "Object with at least an `id` property. Example : `{\"id\": \"00000000000000000000000000000000\"}`", + }, + comment: { + type: "string", + label: "Comment", + description: "Comment for notes (optional).", + optional: true, + }, + mentorType: { + type: "object", + label: "Mentor Type", + description: "Object with at least an `id` property. Example payload: `{\"id\": \"00000000000000000000000000000000\"}`", + }, + mentee: { + type: "object", + label: "Mentee", + description: "Object with at least an `id` property. Example : `{\"id\": \"00000000000000000000000000000000\"}`", + }, + descriptor: { + type: "string", + label: "Descriptor", + description: "Display name of the mentorship (optional).", + optional: true, + }, + }, + async run({ $ }) { + if (!this.endDate || !this.endDate.trim()) throw new ConfigurationError("End Date is required and cannot be empty."); + if (!this.startDate || !this.startDate.trim()) throw new ConfigurationError("Start Date is required and cannot be empty."); + if (!this.purpose || !this.purpose.trim()) throw new ConfigurationError("Purpose is required and cannot be empty."); + if (!this.mentor || typeof this.mentor !== "object" || !this.mentor.id || !this.mentor.id.trim()) { + throw new ConfigurationError("Mentor is required and must be an object with a non-empty id property."); + } + if (!this.mentee || typeof this.mentee !== "object" || !this.mentee.id || !this.mentee.id.trim()) { + throw new ConfigurationError("Mentee is required and must be an object with a non-empty id property."); + } + if (this.mentorType !== undefined) { + if (typeof this.mentorType !== "object" || !this.mentorType.id || !this.mentorType.id.trim()) { + throw new ConfigurationError("If provided, mentorType must be an object with a non-empty id property."); + } + } + + const data = { + endDate: this.endDate, + startDate: this.startDate, + purpose: this.purpose, + mentor: this.mentor, + mentee: this.mentee, + mentorType: this.mentorType, + }; + if (this.comment) data.comment = this.comment; + if (this.descriptor) data.descriptor = this.descriptor; + + const response = await this.workday.createMentorshipForWorker({ + $, + data, + }); + $.export("$summary", "Mentorship created for worker"); + return response; + }, +}; diff --git a/components/workday/actions/create-organization-assignment-change/create-organization-assignment-change.mjs b/components/workday/actions/create-organization-assignment-change/create-organization-assignment-change.mjs new file mode 100644 index 0000000000000..088a70aa39c12 --- /dev/null +++ b/components/workday/actions/create-organization-assignment-change/create-organization-assignment-change.mjs @@ -0,0 +1,80 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-organization-assignment-change", + name: "Create Organization Assignment Change", + description: "Create a new organization assignment change compliant with Workday API structure.[See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/post-/organizationAssignmentChanges)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + position: { + type: "object", + label: "Position", + description: "Position with at least an `id` property. Example: `{ id: \"00000000000000000000000000000000\"}`", + }, + date: { + type: "string", + label: "Date", + description: "Example: `2025-10-18T07:00:00.000Z`", + }, + massActionWorksheet: { + type: "object", + label: "Mass Action Worksheet", + description: "Mass Action Worksheet with at least an `id` property if supplied. Example: `{ id: \"00000000000000000000000000000000\"}`", + optional: true, + }, + massActionHeader: { + type: "object", + label: "Mass Action Header", + description: "Mass Action Header with at least an `id` property if supplied. Example: `{ id: \"00000000000000000000000000000000\"}`", + optional: true, + }, + descriptor: { + type: "string", + label: "Descriptor", + description: "Display name for the change.", + optional: true, + }, + }, + async run({ $ }) { + if (!this.position || typeof this.position !== "object" || !this.position.id || !this.position.id.trim()) { + throw new ConfigurationError("Position object is required, with a non-empty id property."); + } + if (!this.date || !this.date.trim()) { + throw new ConfigurationError("Date is required and cannot be empty."); + } + if (this.massActionWorksheet !== undefined) { + if (typeof this.massActionWorksheet !== "object" || !this.massActionWorksheet.id || !this.massActionWorksheet.id.trim()) { + throw new ConfigurationError("If provided, Mass Action Worksheet must be an object with a non-empty id property."); + } + } + if (this.massActionHeader !== undefined) { + if (typeof this.massActionHeader !== "object" || !this.massActionHeader.id || !this.massActionHeader.id.trim()) { + throw new ConfigurationError("If provided, Mass Action Header must be an object with a non-empty id property."); + } + } + + // Build payload + const data = { + position: this.position, + date: this.date, + }; + if (this.massActionWorksheet) data.massActionWorksheet = this.massActionWorksheet; + if (this.massActionHeader) data.massActionHeader = this.massActionHeader; + if (this.descriptor) data.descriptor = this.descriptor; + + const response = await this.workday.createOrganizationAssignmentChange({ + $, + data, + }); + $.export("$summary", "Created organization assignment change"); + return response; + }, +}; diff --git a/components/workday/actions/create-payroll-input/create-payroll-input.mjs b/components/workday/actions/create-payroll-input/create-payroll-input.mjs new file mode 100644 index 0000000000000..b77b9b4a16a44 --- /dev/null +++ b/components/workday/actions/create-payroll-input/create-payroll-input.mjs @@ -0,0 +1,57 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-payroll-input", + name: "Create Payroll Input", + description: "Creates a payroll input instance. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/post-/payrollInputs)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + worker: { + type: "object", + label: "Worker", + description: "The worker for this payroll input. Example: `{ \"id\": \"worker-id\", \"descriptor\": \"Worker Name\" }`", + }, + payComponent: { + type: "object", + label: "Pay Component", + description: "The pay component for this payroll input. Example: `{ \"id\": \"component-id\", \"descriptor\": \"Comp Name\", \"code\": \"COMP01\" }`", + }, + startDate: { + type: "string", + label: "Start Date", + description: "Effective start date. Example: `2012-01-01T08:00:00.000Z`", + }, + }, + async run({ $ }) { + if (!this.worker || typeof this.worker !== "object" || !this.worker.id) { + throw new ConfigurationError("worker (object with non-empty id) is required."); + } + if (!this.payComponent || typeof this.payComponent !== "object" || !this.payComponent.id) { + throw new ConfigurationError("payComponent (object with non-empty id) is required."); + } + if (!this.startDate || !this.startDate.trim()) { + throw new ConfigurationError("startDate is required and cannot be empty."); + } + + const data = { + worker: this.worker, + payComponent: this.payComponent, + startDate: this.startDate, + }; + + const response = await this.workday.createPayrollInput({ + $, + data, + }); + $.export("$summary", "Payroll input Successfully created"); + return response; + }, +}; diff --git a/components/workday/actions/create-prospect/create-prospect.mjs b/components/workday/actions/create-prospect/create-prospect.mjs new file mode 100644 index 0000000000000..a0276430084a2 --- /dev/null +++ b/components/workday/actions/create-prospect/create-prospect.mjs @@ -0,0 +1,46 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-prospect", + name: "Create Prospect (Required Only)", + description: "Create a new prospect. [See documentation] (https://community.workday.com/sites/default/files/file-hosting/restapi/#recruiting/v4/post-/prospects)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + candidate: { + type: "object", + label: "Candidate", + description: "The candidate object. Must include `name.country.id`. Example: { \"name\": { \"country\": { \"id\": \"USA\" } } }", + }, + }, + async run({ $ }) { + if ( + !this.candidate || + typeof this.candidate !== "object" || + !this.candidate.name || + typeof this.candidate.name !== "object" || + !this.candidate.name.country || + typeof this.candidate.name.country !== "object" || + !this.candidate.name.country.id || + !this.candidate.name.country.id.trim() + ) { + throw new ConfigurationError("candidate.name.country.id is required."); + } + const data = { + candidate: this.candidate, + }; + const response = await this.workday.createProspect({ + data, + $, + }); + $.export("$summary", "Prospect created"); + return response; + }, +}; diff --git a/components/workday/actions/create-succession-plan/create-succession-plan.mjs b/components/workday/actions/create-succession-plan/create-succession-plan.mjs new file mode 100644 index 0000000000000..83e858e89a17d --- /dev/null +++ b/components/workday/actions/create-succession-plan/create-succession-plan.mjs @@ -0,0 +1,70 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-succession-plan", + name: "Create Succession Plan", + description: "Create a new succession plan. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/post-/successionPlans)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + position: { + type: "object", + label: "Position", + description: "The position associated with the succession plan. Example: `{ \"id\": \"00000000000000000000000000000000\" }`", + }, + supervisoryOrg: { + type: "object", + label: "Supervisory Organization", + description: "The organization associated with the succession plan. Example: `{ \"id\": \"00000000000000000000000000000000\" }`", + }, + successionPlan: { + type: "object", + label: "Succession Plan", + description: "The reference to the succession plan instance. Example: `{ \"id\": \"00000000000000000000000000000000\" }`", + }, + descriptor: { + type: "string", + label: "Descriptor", + description: "Display name of the instance.", + optional: true, + }, + }, + async run({ $ }) { + if ( + !this.position || typeof this.position !== "object" || !this.position.id || !this.position.id.trim() + ) { + throw new ConfigurationError("Position is required and must be an object with a non-empty id property."); + } + if ( + !this.supervisoryOrg || typeof this.supervisoryOrg !== "object" || !this.supervisoryOrg.id || !this.supervisoryOrg.id.trim() + ) { + throw new ConfigurationError("Supervisory Organization is required and must be an object with a non-empty id property."); + } + if ( + !this.successionPlan || typeof this.successionPlan !== "object" || !this.successionPlan.id || !this.successionPlan.id.trim() + ) { + throw new ConfigurationError("Succession Plan is required and must be an object with a non-empty id property."); + } + + const data = { + position: this.position, + supervisoryOrg: this.supervisoryOrg, + successionPlan: this.successionPlan, + }; + if (this.descriptor) data.descriptor = this.descriptor; + + const response = await this.workday.createSuccessionPlan({ + $, + data, + }); + $.export("$summary", "Succession plan created"); + return response; + }, +}; diff --git a/components/workday/actions/create-tax-rate/create-tax-rate.mjs b/components/workday/actions/create-tax-rate/create-tax-rate.mjs new file mode 100644 index 0000000000000..d158bdabd709d --- /dev/null +++ b/components/workday/actions/create-tax-rate/create-tax-rate.mjs @@ -0,0 +1,92 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-tax-rate", + name: "Create Tax Rate", + description: "Create a company tax rate. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/post-/taxRates)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + ein: { + type: "string", + label: "EIN", + description: "Tax authority EIN field. Example: `664-8144-7`", + optional: true, + }, + taxCode: { + type: "string", + label: "Tax Code", + description: "Tax deduction code. Example: `WL_SUIER`", + }, + applicableRate: { + type: "string", + label: "Applicable Rate", + description: "Tax rate override. Example: `9.9`", + optional: true, + }, + endDate: { + type: "string", + label: "End Date", + description: "End date for company tax reporting. Example: `2018-12-31T08:00:00.000Z`", + optional: true, + }, + stateInstance: { + type: "object", + label: "State Instance", + description: "Payroll tax authority object. Example: `{ \"id\": \"state-id\" }`", + }, + companyInstance: { + type: "object", + label: "Company Instance", + description: "Company object for tax reporting. Example: `{ \"id\": \"company-id\" }`", + optional: true, + }, + exempt: { + type: "boolean", + label: "Exempt", + description: "True if SUI rate is exempt. Example: `true`", + optional: true, + }, + startDate: { + type: "string", + label: "Start Date", + description: "Start date for company tax reporting. Example: `2008-01-01T08:00:00.000Z`", + }, + }, + async run({ $ }) { + if (this.stateInstance && (typeof this.stateInstance !== "object" || !this.stateInstance.id || !this.stateInstance.id.trim())) { + throw new ConfigurationError("stateInstance is required to have a non-empty id property."); + } + if (!this.taxCode || !this.taxCode.trim()) { + throw new ConfigurationError("Tax Code is required."); + } + if (!this.startDate || !this.startDate.trim()) { + throw new ConfigurationError("Start Date is required."); + } + + const data = { + stateInstance: this.stateInstance, + taxCode: this.taxCode, + startDate: this.startDate, + }; + if (this.applicableRate) data.applicableRate = this.applicableRate; + if (this.endDate) data.endDate = this.endDate; + if (this.ein) data.ein = this.ein; + if (this.companyInstance) data.companyInstance = this.companyInstance; + if (typeof this.exempt === "boolean") data.exempt = this.exempt; + + const response = await this.workday.createTaxRate({ + $, + data, + }); + $.export("$summary", "Tax rate created"); + return response; + }, +}; diff --git a/components/workday/actions/create-work-contact-information-change/create-work-contact-information-change.mjs b/components/workday/actions/create-work-contact-information-change/create-work-contact-information-change.mjs new file mode 100644 index 0000000000000..99a717ae1c56b --- /dev/null +++ b/components/workday/actions/create-work-contact-information-change/create-work-contact-information-change.mjs @@ -0,0 +1,36 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-create-work-contact-information-change", + name: "create Work Contact Information Change", + description: "create a work contact change event for a worker. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + workerId: { + propDefinition: [ + workday, + "workerId", + ], + }, + }, + async run({ $ }) { + if (!this.workerId || !this.workerId.trim()) { + throw new ConfigurationError("Worker ID is required."); + } + const response = await this.workday.createWorkContactInformationChange({ + workerId: this.workerId, + data: {}, + $, + }); + $.export("$summary", `Work contact change event created for worker ID ${this.workerId}`); + return response; + }, +}; diff --git a/components/workday/actions/delete-payroll-input/delete-payroll-input.mjs b/components/workday/actions/delete-payroll-input/delete-payroll-input.mjs new file mode 100644 index 0000000000000..b3d99dcd077ba --- /dev/null +++ b/components/workday/actions/delete-payroll-input/delete-payroll-input.mjs @@ -0,0 +1,35 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-delete-payroll-input", + name: "Delete Payroll Input", + description: "Delete a payroll input by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/delete-/payrollInputs/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: true, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + payrollInputId: { + propDefinition: [ + workday, + "payrollInputId", + ], + }, + }, + async run({ $ }) { + if (!this.payrollInputId || !this.payrollInputId.trim()) { + throw new ConfigurationError("Payroll Input ID is required."); + } + const response = await this.workday.deletePayrollInput({ + id: this.payrollInputId, + $, + }); + $.export("$summary", `Payroll input ${this.payrollInputId} deleted`); + return response; + }, +}; diff --git a/components/workday/actions/get-content-details/get-content-details.mjs b/components/workday/actions/get-content-details/get-content-details.mjs new file mode 100644 index 0000000000000..d9e05197f7610 --- /dev/null +++ b/components/workday/actions/get-content-details/get-content-details.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-content-details", + name: "Get Content Details", + description: "Get details of a learning content item by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#learning/v1/get-/content/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + contentId: { + propDefinition: [ + workday, + "contentId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getContent({ + id: this.contentId, + $, + }); + $.export("$summary", `Fetched details for content ID ${this.contentId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-feedback-badge-details/get-feedback-badge-details.mjs b/components/workday/actions/get-feedback-badge-details/get-feedback-badge-details.mjs new file mode 100644 index 0000000000000..245b49598a262 --- /dev/null +++ b/components/workday/actions/get-feedback-badge-details/get-feedback-badge-details.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-feedback-badge-details", + name: "Get Feedback Badge Details", + description: "Get details of a feedback badge by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#performanceEnablement/v5/get-/feedbackBadges/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + feedbackBadgeId: { + propDefinition: [ + workday, + "feedbackBadgeId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getFeedbackBadge({ + id: this.feedbackBadgeId, + $, + }); + $.export("$summary", `Fetched details for feedback badge ID ${this.feedbackBadgeId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-give-requested-feedback-event-details/get-give-requested-feedback-event-details.mjs b/components/workday/actions/get-give-requested-feedback-event-details/get-give-requested-feedback-event-details.mjs new file mode 100644 index 0000000000000..e937f3678eb29 --- /dev/null +++ b/components/workday/actions/get-give-requested-feedback-event-details/get-give-requested-feedback-event-details.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-give-requested-feedback-event-details", + name: "Get Give Requested Feedback Event Details", + description: "Get details of a requested feedback event by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#performanceEnablement/v5/get-/giveRequestedFeedbackEvents/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + giveRequestedFeedbackEventId: { + propDefinition: [ + workday, + "giveRequestedFeedbackEventId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getGiveRequestedFeedbackEvent({ + id: this.giveRequestedFeedbackEventId, + $, + }); + $.export("$summary", `Fetched details for feedback event ID ${this.giveRequestedFeedbackEventId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-home-contact-information-change/get-home-contact-information-change.mjs b/components/workday/actions/get-home-contact-information-change/get-home-contact-information-change.mjs new file mode 100644 index 0000000000000..1ee007465b7fe --- /dev/null +++ b/components/workday/actions/get-home-contact-information-change/get-home-contact-information-change.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-home-contact-information-change", + name: "Get Home Contact Information Change", + description: "Get a specific home contact information change by ID. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/homeContactInformationChanges-get)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + workday, + homeContactInformationChangeId: { + propDefinition: [ + workday, + "homeContactInformationChangeId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getHomeContactInformationChange({ + homeContactInformationChangeId: this.homeContactInformationChangeId, + $, + }); + $.export("$summary", `Successfully fetched home contact information change with ID ${this.homeContactInformationChangeId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-interview-details/get-interview-details.mjs b/components/workday/actions/get-interview-details/get-interview-details.mjs new file mode 100644 index 0000000000000..c002c2d4908b5 --- /dev/null +++ b/components/workday/actions/get-interview-details/get-interview-details.mjs @@ -0,0 +1,30 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-get-interview-details", + name: "Get Interview Details", + description: "Get details for a specific interview. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#recruiting/v4/get-/interviews/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + interviewId: { + propDefinition: [ + workday, + "interviewId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getInterview({ + id: this.interviewId, + $, + }); + $.export("$summary", `Fetched details for interview ID ${this.interviewId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-job-change-details/get-job-change-details.mjs b/components/workday/actions/get-job-change-details/get-job-change-details.mjs new file mode 100644 index 0000000000000..a41f3e29b4613 --- /dev/null +++ b/components/workday/actions/get-job-change-details/get-job-change-details.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-job-change-details", + name: "Get Job Change Details", + description: "Retrieve details for a specific job change by its ID. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/jobChanges/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + jobChangeId: { + propDefinition: [ + workday, + "jobChangeId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getJobChangeDetails({ + id: this.jobChangeId, + $, + }); + $.export("$summary", `Fetched job change details for ID ${this.jobChangeId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-job-details/get-job-details.mjs b/components/workday/actions/get-job-details/get-job-details.mjs new file mode 100644 index 0000000000000..4c034d03630aa --- /dev/null +++ b/components/workday/actions/get-job-details/get-job-details.mjs @@ -0,0 +1,30 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-get-job-details", + name: "Get Job Details", + description: "Get job details by ID.[See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/jobs/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + jobId: { + propDefinition: [ + workday, + "jobId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getJob({ + id: this.jobId, + $, + }); + $.export("$summary", `Fetched job ${this.jobId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-job-family-details/get-job-family-details.mjs b/components/workday/actions/get-job-family-details/get-job-family-details.mjs new file mode 100644 index 0000000000000..8e41daf315f17 --- /dev/null +++ b/components/workday/actions/get-job-family-details/get-job-family-details.mjs @@ -0,0 +1,30 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-get-job-family-details", + name: "Get Job Family Details", + description: "Get job family details by ID. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/jobProfiles/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + jobFamilyId: { + propDefinition: [ + workday, + "jobFamilyId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getJobFamily({ + id: this.jobFamilyId, + $, + }); + $.export("$summary", `Fetched job family ${this.jobFamilyId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-job-pay-group/get-job-pay-group.mjs b/components/workday/actions/get-job-pay-group/get-job-pay-group.mjs new file mode 100644 index 0000000000000..90afabf35ec9e --- /dev/null +++ b/components/workday/actions/get-job-pay-group/get-job-pay-group.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-job-pay-group", + name: "Get Job Pay Group", + description: "Get the payroll job's pay group by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/jobs/-ID-/payGroup)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + jobId: { + propDefinition: [ + workday, + "jobId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getJobPayGroup({ + id: this.jobId, + $, + }); + $.export("$summary", `Fetched pay group for job ID ${this.jobId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-job-posting/get-job-posting.mjs b/components/workday/actions/get-job-posting/get-job-posting.mjs new file mode 100644 index 0000000000000..71351d84bf5b1 --- /dev/null +++ b/components/workday/actions/get-job-posting/get-job-posting.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-job-posting", + name: "Get Job Posting", + description: "Get details for a job posting by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#recruiting/v4/get-/jobPostings/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + jobPostingId: { + propDefinition: [ + workday, + "jobPostingId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getJobPosting({ + id: this.jobPostingId, + $, + }); + $.export("$summary", `Fetched details for job posting ID ${this.jobPostingId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-job-profile-details/get-job-profile-details.mjs b/components/workday/actions/get-job-profile-details/get-job-profile-details.mjs new file mode 100644 index 0000000000000..e1a1e966c20a2 --- /dev/null +++ b/components/workday/actions/get-job-profile-details/get-job-profile-details.mjs @@ -0,0 +1,30 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-get-job-profile-details", + name: "Get Job Profile Details", + description: "Get job profile details by ID. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/jobProfiles/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + jobProfileId: { + propDefinition: [ + workday, + "jobProfileId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getJobProfile({ + id: this.jobProfileId, + $, + }); + $.export("$summary", `Fetched job profile ${this.jobProfileId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-mentorship-details/get-mentorship-details.mjs b/components/workday/actions/get-mentorship-details/get-mentorship-details.mjs new file mode 100644 index 0000000000000..ab3a27246e4e9 --- /dev/null +++ b/components/workday/actions/get-mentorship-details/get-mentorship-details.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-mentorship-details", + name: "Get Mentorship Details", + description: "Get details of a mentorship by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/get-/mentorships/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + mentorshipId: { + propDefinition: [ + workday, + "mentorshipId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getMentorship({ + id: this.mentorshipId, + $, + }); + $.export("$summary", `Fetched details for mentorship ID ${this.mentorshipId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-minimum-wage-rate-details/get-minimum-wage-rate-details.mjs b/components/workday/actions/get-minimum-wage-rate-details/get-minimum-wage-rate-details.mjs new file mode 100644 index 0000000000000..7713687b5ce88 --- /dev/null +++ b/components/workday/actions/get-minimum-wage-rate-details/get-minimum-wage-rate-details.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-minimum-wage-rate-details", + name: "Get Minimum Wage Rate Details", + description: "Get details of a minimum wage rate by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/minimumWageRates/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + minimumWageRateId: { + propDefinition: [ + workday, + "minimumWageRateId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getMinimumWageRate({ + id: this.minimumWageRateId, + $, + }); + $.export("$summary", `Fetched details for minimum wage rate ID ${this.minimumWageRateId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-org-assignment-change-details/get-org-assignment-change-details.mjs b/components/workday/actions/get-org-assignment-change-details/get-org-assignment-change-details.mjs new file mode 100644 index 0000000000000..acc40f25679bd --- /dev/null +++ b/components/workday/actions/get-org-assignment-change-details/get-org-assignment-change-details.mjs @@ -0,0 +1,32 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-org-assignment-change-details", + name: "Get Organization Assignment Change Details", + description: "Get details for an organization assignment change.[See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/organizationAssignmentChanges/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + organizationAssignmentChangeId: { + propDefinition: [ + workday, + "organizationAssignmentChangeId", + ], + }, + }, + + async run({ $ }) { + const response = await this.workday.getOrganizationAssignmentChange({ + id: this.organizationAssignmentChangeId, + $, + }); + $.export("$summary", `Fetched organization assignment change ${this.organizationAssignmentChangeId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-pay-group-detail/get-pay-group-detail.mjs b/components/workday/actions/get-pay-group-detail/get-pay-group-detail.mjs new file mode 100644 index 0000000000000..2030cab130439 --- /dev/null +++ b/components/workday/actions/get-pay-group-detail/get-pay-group-detail.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-pay-group-detail", + name: "Get Pay Group Detail", + description: "Get pay group detail by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/payGroupDetails/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + payGroupDetailId: { + propDefinition: [ + workday, + "payGroupDetailId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getPayGroupDetail({ + id: this.payGroupDetailId, + $, + }); + $.export("$summary", `Fetched pay group detail ID ${this.payGroupDetailId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-pay-group/get-pay-group.mjs b/components/workday/actions/get-pay-group/get-pay-group.mjs new file mode 100644 index 0000000000000..2d8b06767748a --- /dev/null +++ b/components/workday/actions/get-pay-group/get-pay-group.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-pay-group", + name: "Get Pay Group", + description: "Get pay group by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/payGroups/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + payGroupId: { + propDefinition: [ + workday, + "payGroupId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getPayGroup({ + id: this.payGroupId, + $, + }); + $.export("$summary", `Fetched pay group for ID ${this.payGroupId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-payroll-input-details/get-payroll-input-details.mjs b/components/workday/actions/get-payroll-input-details/get-payroll-input-details.mjs new file mode 100644 index 0000000000000..537ad8feb095b --- /dev/null +++ b/components/workday/actions/get-payroll-input-details/get-payroll-input-details.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-payroll-input-details", + name: "Get Payroll Input Details", + description: "Get details of a payroll input by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/payrollInputs/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + payrollInputId: { + propDefinition: [ + workday, + "payrollInputId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getPayrollInput({ + id: this.payrollInputId, + $, + }); + $.export("$summary", `Fetched details for payroll input ID ${this.payrollInputId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-person-photo/get-person-photo.mjs b/components/workday/actions/get-person-photo/get-person-photo.mjs new file mode 100644 index 0000000000000..93a13858fac6f --- /dev/null +++ b/components/workday/actions/get-person-photo/get-person-photo.mjs @@ -0,0 +1,32 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-person-photo", + name: "Get Person Photo", + description: "Get photo for a person by ID. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/get-/people/-ID-/photos)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + personId: { + propDefinition: [ + workday, + "personId", + ], + description: "The ID of the person whose photo to retrieve.", + }, + }, + async run({ $ }) { + const response = await this.workday.getPersonPhoto({ + id: this.personId, + $, + }); + $.export("$summary", `Successfully fetched photo for person ID ${this.personId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-person/get-person.mjs b/components/workday/actions/get-person/get-person.mjs new file mode 100644 index 0000000000000..1844f6cc8215d --- /dev/null +++ b/components/workday/actions/get-person/get-person.mjs @@ -0,0 +1,32 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-person", + name: "Get Person Details", + description: "Get details for a specific person by ID. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/get-/people/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + personId: { + propDefinition: [ + workday, + "personId", + ], + description: "The ID of the person to retrieve.", + }, + }, + async run({ $ }) { + const response = await this.workday.getPerson({ + id: this.personId, + $, + }); + $.export("$summary", `Successfully fetched person details for ID ${this.personId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-prospect-details/get-prospect-details.mjs b/components/workday/actions/get-prospect-details/get-prospect-details.mjs new file mode 100644 index 0000000000000..0ff13cd7f055f --- /dev/null +++ b/components/workday/actions/get-prospect-details/get-prospect-details.mjs @@ -0,0 +1,30 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-get-prospect-details", + name: "Get Prospect Details", + description: "Get details for a specific prospect by ID. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#recruiting/v4/get-/prospects/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + prospectId: { + propDefinition: [ + workday, + "prospectId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getProspect({ + id: this.prospectId, + $, + }); + $.export("$summary", `Fetched details for prospect ID ${this.prospectId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-succession-plan-details/get-succession-plan-details.mjs b/components/workday/actions/get-succession-plan-details/get-succession-plan-details.mjs new file mode 100644 index 0000000000000..8e93f30ff5a6a --- /dev/null +++ b/components/workday/actions/get-succession-plan-details/get-succession-plan-details.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-succession-plan-details", + name: "Get Succession Plan Details", + description: "Get details of a succession plan by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/get-/successionPlans/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + successionPlanId: { + propDefinition: [ + workday, + "successionPlanId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getSuccessionPlan({ + id: this.successionPlanId, + $, + }); + $.export("$summary", `Fetched details for succession plan ID ${this.successionPlanId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-supervisory-org-details/get-supervisory-org-details.mjs b/components/workday/actions/get-supervisory-org-details/get-supervisory-org-details.mjs new file mode 100644 index 0000000000000..c9fd3d605d44e --- /dev/null +++ b/components/workday/actions/get-supervisory-org-details/get-supervisory-org-details.mjs @@ -0,0 +1,32 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-supervisory-org-details", + name: "Get Supervisory Organization Details", + description: "Get details for a supervisory organization.[See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/supervisoryOrganizations/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + supervisoryOrganizationId: { + propDefinition: [ + workday, + "supervisoryOrganizationId", + ], + }, + }, + + async run({ $ }) { + const response = await this.workday.getSupervisoryOrganization({ + id: this.supervisoryOrganizationId, + $, + }); + $.export("$summary", `Fetched supervisory organization ${this.supervisoryOrganizationId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-supervisory-org-members/get-supervisory-org-members.mjs b/components/workday/actions/get-supervisory-org-members/get-supervisory-org-members.mjs new file mode 100644 index 0000000000000..a64bd373dd648 --- /dev/null +++ b/components/workday/actions/get-supervisory-org-members/get-supervisory-org-members.mjs @@ -0,0 +1,32 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-supervisory-org-members", + name: "Get Supervisory Organization Members", + description: "Get members of a supervisory organization.[See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/supervisoryOrganizations/-ID-/members)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + supervisoryOrganizationId: { + propDefinition: [ + workday, + "supervisoryOrganizationId", + ], + }, + }, + + async run({ $ }) { + const response = await this.workday.getSupervisoryOrganizationMembers({ + id: this.supervisoryOrganizationId, + $, + }); + $.export("$summary", `Fetched members in supervisory organization ${this.supervisoryOrganizationId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-work-contact-information-change/get-work-contact-information-change.mjs b/components/workday/actions/get-work-contact-information-change/get-work-contact-information-change.mjs new file mode 100644 index 0000000000000..a6623aa44463f --- /dev/null +++ b/components/workday/actions/get-work-contact-information-change/get-work-contact-information-change.mjs @@ -0,0 +1,29 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-get-work-contact-information-change", + name: "Get Work Contact Information Change", + description: "Get specific work contact information change by ID. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/get-/workContactInformationChanges/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + workContactInformationChangeId: { + type: "string", + label: "Work Contact Information Change ID", + description: "The ID of the work contact information change.", + }, + }, + async run({ $ }) { + const response = await this.workday.getWorkContactInformationChange({ + id: this.workContactInformationChangeId, + $, + }); + $.export("$summary", `Fetched change ${this.workContactInformationChangeId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-worker-anytime-feedback-events/get-worker-anytime-feedback-events.mjs b/components/workday/actions/get-worker-anytime-feedback-events/get-worker-anytime-feedback-events.mjs new file mode 100644 index 0000000000000..eefea14ab1893 --- /dev/null +++ b/components/workday/actions/get-worker-anytime-feedback-events/get-worker-anytime-feedback-events.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-worker-anytime-feedback-events", + name: "Get Worker Anytime Feedback Events", + description: "Retrieve anytime feedback events for a worker by ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#performanceEnablement/v5/get-/workers/-ID-/anytimeFeedbackEvents)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + workerId: { + propDefinition: [ + workday, + "workerId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getWorkerAnytimeFeedbackEvents({ + id: this.workerId, + $, + }); + $.export("$summary", `Fetched anytime feedback events for worker ID ${this.workerId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-worker-goals/get-worker-goals.mjs b/components/workday/actions/get-worker-goals/get-worker-goals.mjs new file mode 100644 index 0000000000000..403e2e2923026 --- /dev/null +++ b/components/workday/actions/get-worker-goals/get-worker-goals.mjs @@ -0,0 +1,31 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-get-worker-goals", + name: "Get Worker Goals", + description: "Retrieve a worker's goals by worker ID. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#performanceEnablement/v5/get-/workers/-ID-/goals)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + workerId: { + propDefinition: [ + workday, + "workerId", + ], + }, + }, + async run({ $ }) { + const response = await this.workday.getWorkerGoals({ + id: this.workerId, + $, + }); + $.export("$summary", `Fetched goals for worker ID ${this.workerId}`); + return response; + }, +}; diff --git a/components/workday/actions/get-worker/get-worker.mjs b/components/workday/actions/get-worker/get-worker.mjs index 1644f517ece2a..0b7d9af8a5ddc 100644 --- a/components/workday/actions/get-worker/get-worker.mjs +++ b/components/workday/actions/get-worker/get-worker.mjs @@ -4,7 +4,7 @@ export default { key: "workday-get-worker", name: "Get Worker", description: "Get a worker. [See the documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#common/v1/get-/workers/-ID-)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/workday/actions/list-content/list-content.mjs b/components/workday/actions/list-content/list-content.mjs new file mode 100644 index 0000000000000..0897f7f8f9db9 --- /dev/null +++ b/components/workday/actions/list-content/list-content.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-content", + name: "List Content", + description: "List all learning content. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#learning/v1/get-/content)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listContent({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} content items`); + return response; + }, +}; diff --git a/components/workday/actions/list-feedback-badges/list-feedback-badges.mjs b/components/workday/actions/list-feedback-badges/list-feedback-badges.mjs new file mode 100644 index 0000000000000..ea74009af7f7e --- /dev/null +++ b/components/workday/actions/list-feedback-badges/list-feedback-badges.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-feedback-badges", + name: "List Feedback Badges", + description: "List all feedback badges. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#performanceEnablement/v5/get-/feedbackBadges)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listFeedbackBadges({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} feedback badges`); + return response; + }, +}; diff --git a/components/workday/actions/list-give-requested-feedback-events/list-give-requested-feedback-events.mjs b/components/workday/actions/list-give-requested-feedback-events/list-give-requested-feedback-events.mjs new file mode 100644 index 0000000000000..737a7b51280dc --- /dev/null +++ b/components/workday/actions/list-give-requested-feedback-events/list-give-requested-feedback-events.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-give-requested-feedback-events", + name: "List Give Requested Feedback Events", + description: "List all requested feedback events. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#performanceEnablement/v5/get-/giveRequestedFeedbackEvents)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listGiveRequestedFeedbackEvents({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} feedback events`); + return response; + }, +}; diff --git a/components/workday/actions/list-holiday-events/list-holiday-events.mjs b/components/workday/actions/list-holiday-events/list-holiday-events.mjs new file mode 100644 index 0000000000000..f19f3cc5c1eda --- /dev/null +++ b/components/workday/actions/list-holiday-events/list-holiday-events.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-holiday-events", + name: "List Holiday Events", + description: "List all holiday events. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#holiday/v1/get-/holidayEvents)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listHolidayEvents({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} holiday events`); + return response; + }, +}; diff --git a/components/workday/actions/list-home-contact-information-changes/list-home-contact-information-changes.mjs b/components/workday/actions/list-home-contact-information-changes/list-home-contact-information-changes.mjs new file mode 100644 index 0000000000000..610bdaeaab873 --- /dev/null +++ b/components/workday/actions/list-home-contact-information-changes/list-home-contact-information-changes.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-home-contact-information-changes", + name: "List Home Contact Information Changes", + description: "List all home contact information changes. [See the documentation]( https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/homeContactInformationChanges)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listHomeContactInformationChanges({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} home contact change events`); + return response; + }, +}; diff --git a/components/workday/actions/list-interviews/list-interviews.mjs b/components/workday/actions/list-interviews/list-interviews.mjs new file mode 100644 index 0000000000000..cc85ac9e8d31b --- /dev/null +++ b/components/workday/actions/list-interviews/list-interviews.mjs @@ -0,0 +1,23 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-list-interviews", + name: "List Interviews", + description: "List all interviews. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#recruiting/v4/get-/interviews)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listInterviews({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} interviews`); + return response; + }, +}; diff --git a/components/workday/actions/list-job-changes/list-job-changes.mjs b/components/workday/actions/list-job-changes/list-job-changes.mjs new file mode 100644 index 0000000000000..f878fefa0cd84 --- /dev/null +++ b/components/workday/actions/list-job-changes/list-job-changes.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-job-changes", + name: "List Job Changes", + description: "Retrieve a list of all job changes. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/jobChanges)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listJobChanges({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} job changes`); + return response; + }, +}; diff --git a/components/workday/actions/list-job-families/list-job-families.mjs b/components/workday/actions/list-job-families/list-job-families.mjs new file mode 100644 index 0000000000000..36a8889823d28 --- /dev/null +++ b/components/workday/actions/list-job-families/list-job-families.mjs @@ -0,0 +1,23 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-list-job-families", + name: "List Job Families", + description: "List all job families. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/jobFamilies)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listJobFamilies({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} job families`); + return response; + }, +}; diff --git a/components/workday/actions/list-job-postings/list-job-postings.mjs b/components/workday/actions/list-job-postings/list-job-postings.mjs new file mode 100644 index 0000000000000..f8b0f62ded77e --- /dev/null +++ b/components/workday/actions/list-job-postings/list-job-postings.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-job-postings", + name: "List Job Postings", + description: "List all job postings. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#recruiting/v4/get-/jobPostings)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listJobPostings({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} job postings`); + return response; + }, +}; diff --git a/components/workday/actions/list-job-profiles/list-job-profiles.mjs b/components/workday/actions/list-job-profiles/list-job-profiles.mjs new file mode 100644 index 0000000000000..77947ca9667e9 --- /dev/null +++ b/components/workday/actions/list-job-profiles/list-job-profiles.mjs @@ -0,0 +1,23 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-list-job-profiles", + name: "List Job Profiles", + description: "List all job profiles. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/jobProfiles)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listJobProfiles({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} job profiles`); + return response; + }, +}; diff --git a/components/workday/actions/list-jobs/list-jobs.mjs b/components/workday/actions/list-jobs/list-jobs.mjs new file mode 100644 index 0000000000000..ebf4b6139072b --- /dev/null +++ b/components/workday/actions/list-jobs/list-jobs.mjs @@ -0,0 +1,23 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-list-jobs", + name: "List Jobs", + description: "List all jobs. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/jobs)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listJobs({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} jobs`); + return response; + }, +}; diff --git a/components/workday/actions/list-mentorships/list-mentorships.mjs b/components/workday/actions/list-mentorships/list-mentorships.mjs new file mode 100644 index 0000000000000..1e4cff5af8d44 --- /dev/null +++ b/components/workday/actions/list-mentorships/list-mentorships.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-mentorships", + name: "List Mentorships", + description: "List all mentorships. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/get-/mentorships)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listMentorships({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} mentorships`); + return response; + }, +}; diff --git a/components/workday/actions/list-minimum-wage-rates/list-minimum-wage-rates.mjs b/components/workday/actions/list-minimum-wage-rates/list-minimum-wage-rates.mjs new file mode 100644 index 0000000000000..fa831e35d3c6d --- /dev/null +++ b/components/workday/actions/list-minimum-wage-rates/list-minimum-wage-rates.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-minimum-wage-rates", + name: "List Minimum Wage Rates", + description: "List all minimum wage rates. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/minimumWageRates)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listMinimumWageRates({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} minimum wage rates`); + return response; + }, +}; diff --git a/components/workday/actions/list-org-assignment-changes/list-org-assignment-changes.mjs b/components/workday/actions/list-org-assignment-changes/list-org-assignment-changes.mjs new file mode 100644 index 0000000000000..0ace3a3e64967 --- /dev/null +++ b/components/workday/actions/list-org-assignment-changes/list-org-assignment-changes.mjs @@ -0,0 +1,25 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-org-assignment-changes", + name: "List Organization Assignment Changes", + description: "List all organization assignment changes.[See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/post-/organizationAssignmentChanges)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + + async run({ $ }) { + const response = await this.workday.listOrganizationAssignmentChanges({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} organization assignment changes`); + return response; + }, +}; diff --git a/components/workday/actions/list-organization-types/list-organization-types.mjs b/components/workday/actions/list-organization-types/list-organization-types.mjs index ec18cad5378dd..40af52c55451b 100644 --- a/components/workday/actions/list-organization-types/list-organization-types.mjs +++ b/components/workday/actions/list-organization-types/list-organization-types.mjs @@ -4,7 +4,7 @@ export default { key: "workday-list-organization-types", name: "List Organization Types", description: "List organization types. [See the documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#common/v1/organizationTypes)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/workday/actions/list-pay-group-details/list-pay-group-details.mjs b/components/workday/actions/list-pay-group-details/list-pay-group-details.mjs new file mode 100644 index 0000000000000..a81e2a236ec84 --- /dev/null +++ b/components/workday/actions/list-pay-group-details/list-pay-group-details.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-pay-group-details", + name: "List Pay Group Details", + description: "List all pay group details. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/payGroupDetails)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listPayGroupDetails({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} pay group details`); + return response; + }, +}; diff --git a/components/workday/actions/list-pay-groups/list-pay-groups.mjs b/components/workday/actions/list-pay-groups/list-pay-groups.mjs new file mode 100644 index 0000000000000..4c241e0af1bc9 --- /dev/null +++ b/components/workday/actions/list-pay-groups/list-pay-groups.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-pay-groups", + name: "List Pay Groups", + description: "List all pay groups. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/payGroups)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listPayGroups({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} pay groups`); + return response; + }, +}; diff --git a/components/workday/actions/list-payroll-inputs/list-payroll-inputs.mjs b/components/workday/actions/list-payroll-inputs/list-payroll-inputs.mjs new file mode 100644 index 0000000000000..5f2a909b50603 --- /dev/null +++ b/components/workday/actions/list-payroll-inputs/list-payroll-inputs.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-payroll-inputs", + name: "List Payroll Inputs", + description: "List all payroll inputs. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/payrollInputs)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listPayrollInputs({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} payroll inputs`); + return response; + }, +}; diff --git a/components/workday/actions/list-people/list-people.mjs b/components/workday/actions/list-people/list-people.mjs new file mode 100644 index 0000000000000..462de744f5a88 --- /dev/null +++ b/components/workday/actions/list-people/list-people.mjs @@ -0,0 +1,40 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-people", + name: "List People", + description: "List all people. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/get-/people)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + maxResults: { + propDefinition: [ + workday, + "maxResults", + ], + }, + }, + async run({ $ }) { + const results = this.workday.paginate({ + fn: this.workday.listPeople, + args: { + $, + }, + max: this.maxResults, + }); + + const data = []; + for await (const result of results) { + data.push(result); + } + + $.export("$summary", `Successfully fetched ${data.length} people`); + return data; + }, +}; diff --git a/components/workday/actions/list-prospects/list-prospects.mjs b/components/workday/actions/list-prospects/list-prospects.mjs new file mode 100644 index 0000000000000..133dee3008e80 --- /dev/null +++ b/components/workday/actions/list-prospects/list-prospects.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-prospects", + name: "List Prospects", + description: "List all prospects. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#recruiting/v4/get-/prospects/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listProspects({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} prospects`); + return response; + }, +}; diff --git a/components/workday/actions/list-succession-plans/list-succession-plans.mjs b/components/workday/actions/list-succession-plans/list-succession-plans.mjs new file mode 100644 index 0000000000000..af408d98ec5f5 --- /dev/null +++ b/components/workday/actions/list-succession-plans/list-succession-plans.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-succession-plans", + name: "List Succession Plans", + description: "List all succession plans. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/get-/successionPlans)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listSuccessionPlans({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} succession plans`); + return response; + }, +}; diff --git a/components/workday/actions/list-supervisory-organizations/list-supervisory-organizations.mjs b/components/workday/actions/list-supervisory-organizations/list-supervisory-organizations.mjs index 58cecfa4cc6d0..ab7e418ca9474 100644 --- a/components/workday/actions/list-supervisory-organizations/list-supervisory-organizations.mjs +++ b/components/workday/actions/list-supervisory-organizations/list-supervisory-organizations.mjs @@ -4,7 +4,7 @@ export default { key: "workday-list-supervisory-organizations", name: "List Supervisory Organizations", description: "List supervisory organizations. [See the documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#common/v1/get-/supervisoryOrganizations)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/workday/actions/list-tax-rates/list-tax-rates.mjs b/components/workday/actions/list-tax-rates/list-tax-rates.mjs new file mode 100644 index 0000000000000..9ae6d0807f607 --- /dev/null +++ b/components/workday/actions/list-tax-rates/list-tax-rates.mjs @@ -0,0 +1,24 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-tax-rates", + name: "List Tax Rates", + description: "List all company tax rates. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/get-/taxRates)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listTaxRates({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} tax rates`); + return response; + }, +}; diff --git a/components/workday/actions/list-work-contact-information-changes/list-work-contact-information-changes.mjs b/components/workday/actions/list-work-contact-information-changes/list-work-contact-information-changes.mjs new file mode 100644 index 0000000000000..1465d970a0004 --- /dev/null +++ b/components/workday/actions/list-work-contact-information-changes/list-work-contact-information-changes.mjs @@ -0,0 +1,23 @@ +import workday from "../../workday.app.mjs"; +export default { + key: "workday-list-work-contact-information-changes", + name: "List Work Contact Information Changes", + description: "List all work contact information changes. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/workContactInformationChanges)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + async run({ $ }) { + const response = await this.workday.listWorkContactInformationChanges({ + $, + }); + $.export("$summary", `Found ${response?.data?.length || 0} changes`); + return response; + }, +}; diff --git a/components/workday/actions/list-worker-payslips/list-worker-payslips.mjs b/components/workday/actions/list-worker-payslips/list-worker-payslips.mjs index 283be8da5a9df..ed300ca126035 100644 --- a/components/workday/actions/list-worker-payslips/list-worker-payslips.mjs +++ b/components/workday/actions/list-worker-payslips/list-worker-payslips.mjs @@ -4,7 +4,7 @@ export default { key: "workday-list-worker-payslips", name: "List Worker Payslips", description: "List the payslips for a worker. [See the documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#common/v1/get-/workers/-ID-/paySlips)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/workday/actions/list-workers/list-workers.mjs b/components/workday/actions/list-workers/list-workers.mjs new file mode 100644 index 0000000000000..ef17d9237941b --- /dev/null +++ b/components/workday/actions/list-workers/list-workers.mjs @@ -0,0 +1,25 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-list-workers", + name: "List Workers", + description: "List all workers.[See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#staffing/v7/get-/workers)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + workday, + }, + + async run({ $ }) { + const response = await this.workday.listWorkers({ + $, + }); + $.export("$summary", `Fetched ${response?.data?.length || 0} workers`); + return response; + }, +}; diff --git a/components/workday/actions/search-workers/search-workers.mjs b/components/workday/actions/search-workers/search-workers.mjs index 48795cbac7f55..1d9c72acebed6 100644 --- a/components/workday/actions/search-workers/search-workers.mjs +++ b/components/workday/actions/search-workers/search-workers.mjs @@ -4,7 +4,7 @@ export default { key: "workday-search-workers", name: "Search Workers", description: "Retrieve a list of workers based on a search query. [See the documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#common/v1/get-/workers)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/workday/actions/update-mentorship/update-mentorship.mjs b/components/workday/actions/update-mentorship/update-mentorship.mjs new file mode 100644 index 0000000000000..270f6bf98221c --- /dev/null +++ b/components/workday/actions/update-mentorship/update-mentorship.mjs @@ -0,0 +1,70 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-update-mentorship", + name: "Update Mentorship", + description: "Update a mentorship resource. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#talentManagement/v2/post-/mentorships/-ID-/edit)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + + type: "action", + props: { + workday, + mentorshipId: { + propDefinition: [ + workday, + "mentorshipId", + ], + }, + comment: { + type: "string", + label: "Comment", + description: "Comment field.", + optional: true, + }, + purpose: { + type: "string", + label: "Purpose", + description: "Updated purpose of mentorship.", + optional: true, + }, + startDate: { + type: "string", + label: "Start Date", + description: "Updated start date. Example: `2025-10-18T07:00:00.000Z`", + }, + endDate: { + type: "string", + label: "End Date", + description: "Updated end date (ISO 8601). Example: `2025-10-18T07:00:00.000Z`", + optional: true, + }, + descriptor: { + type: "string", + label: "Descriptor", + description: "Display name.", + optional: true, + }, + }, + async run({ $ }) { + const data = { + startDate: this.startDate, + }; + if (this.comment) data.comment = this.comment; + if (this.purpose) data.purpose = this.purpose; + if (this.endDate) data.endDate = this.endDate; + if (this.descriptor) data.descriptor = this.descriptor; + + const response = await this.workday.updateMentorship({ + id: this.mentorshipId, + data, + $, + }); + $.export("$summary", `Mentorship ${this.mentorshipId} updated`); + return response; + }, +}; diff --git a/components/workday/actions/update-payroll-input/update-payroll-input.mjs b/components/workday/actions/update-payroll-input/update-payroll-input.mjs new file mode 100644 index 0000000000000..d09c0aefcc3c1 --- /dev/null +++ b/components/workday/actions/update-payroll-input/update-payroll-input.mjs @@ -0,0 +1,65 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-update-payroll-input", + name: "Update Payroll Input", + description: "Update a payroll input. [See the Documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#payroll/v2/patch-/payrollInputs/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + + type: "action", + props: { + workday, + payrollInputId: { + propDefinition: [ + workday, + "payrollInputId", + ], + }, + worker: { + type: "object", + label: "Worker", + description: "The worker for this payroll input. Example: `{ \"id\": \"worker-id\", \"descriptor\": \"Worker Name\" }`", + optional: true, + }, + payComponent: { + type: "object", + label: "Pay Component", + description: "The pay component for this payroll input. Example: `{ \"id\": \"component-id\", \"descriptor\": \"Comp Name\", \"code\": \"COMP01\" }`", + optional: true, + }, + startDate: { + type: "string", + label: "Start Date", + description: "Effective start date. Example: `2012-01-01T08:00:00.000Z`", + optional: true, + }, + }, + async run({ $ }) { + if (!this.payrollInputId || !this.payrollInputId.trim()) { + throw new ConfigurationError("Payroll Input ID is required."); + } + + const data = {}; + if (this.worker !== undefined) data.worker = this.worker; + if (this.payComponent !== undefined) data.payComponent = this.payComponent; + if (this.startDate !== undefined) data.startDate = this.startDate; + + if (Object.keys(data).length === 0) { + throw new ConfigurationError("At least one field (worker, payComponent, startDate) must be provided to update."); + } + + const response = await this.workday.updatePayrollInput({ + id: this.payrollInputId, + data, + $, + }); + $.export("$summary", `Payroll input ${this.payrollInputId} successfully updated`); + return response; + }, +}; diff --git a/components/workday/actions/update-work-contact-information-change/update-work-contact-information-change.mjs b/components/workday/actions/update-work-contact-information-change/update-work-contact-information-change.mjs new file mode 100644 index 0000000000000..9bf4c136f44ff --- /dev/null +++ b/components/workday/actions/update-work-contact-information-change/update-work-contact-information-change.mjs @@ -0,0 +1,68 @@ +import workday from "../../workday.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + key: "workday-update-work-contact-information-change", + name: "Update Work Contact Information Change", + description: "Update an existing work contact information change. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/patch-/workContactInformationChanges/-ID-)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + + type: "action", + props: { + workday, + workContactInformationChangeId: { + propDefinition: [ + workday, + "workContactInformationChangeId", + ], + description: "The ID of the work contact information change.", + }, + alternateWorkLocation: { + type: "object", + label: "Alternate Work Location", + description: "Object for alternate work location. Must include at least `id`. Example: `{ id: \"...\", descriptor: \"...\"}`", + optional: true, + }, + descriptor: { + type: "string", + label: "Descriptor", + description: "Descriptor describing this change event.", + optional: true, + }, + id: { + type: "string", + label: "ID", + description: "Optional ID for the event (usually system-generated).", + optional: true, + }, + }, + async run({ $ }) { + const data = {}; + if (this.alternateWorkLocation) { + if ( + typeof this.alternateWorkLocation !== "object" + || !this.alternateWorkLocation.id + || typeof this.alternateWorkLocation.id !== "string" + || !this.alternateWorkLocation.id.length + ) { + throw new ConfigurationError("alternateWorkLocation must include a non-empty 'id' property."); + } + data.alternateWorkLocation = this.alternateWorkLocation; + } + if (this.descriptor) data.descriptor = this.descriptor; + if (this.id) data.id = this.id; + + const response = await this.workday.updateWorkContactInformationChange({ + id: this.workContactInformationChangeId, + $, + data, + }); + $.export("$summary", `Updated change ${this.workContactInformationChangeId}`); + return response; + }, +}; diff --git a/components/workday/actions/validate-phone-number/validate-phone-number.mjs b/components/workday/actions/validate-phone-number/validate-phone-number.mjs new file mode 100644 index 0000000000000..b6ab5159b65a9 --- /dev/null +++ b/components/workday/actions/validate-phone-number/validate-phone-number.mjs @@ -0,0 +1,32 @@ +import workday from "../../workday.app.mjs"; + +export default { + key: "workday-validate-phone-number", + name: "Validate Phone Number", + description: "Validate a phone number using Workday's REST API. [See documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#person/v4/post-/phoneValidation)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + workday, + completePhoneNumber: { + type: "string", + label: "Complete Phone Number", + description: "The complete phone number including country code. Example: '+19259519000'", + }, + }, + async run({ $ }) { + const response = await this.workday.validatePhoneNumber({ + $, + data: { + completePhoneNumber: this.completePhoneNumber, + }, + }); + $.export("$summary", "Phone number validation completed."); + return response; + }, +}; diff --git a/components/workday/package.json b/components/workday/package.json index 80ac89aeb9db2..4c99a9e79e80d 100644 --- a/components/workday/package.json +++ b/components/workday/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/workday", - "version": "0.1.1", + "version": "0.1.2", "description": "Pipedream Workday Components", "main": "workday.app.mjs", "keywords": [ diff --git a/components/workday/sources/common/utils.mjs b/components/workday/sources/common/utils.mjs new file mode 100644 index 0000000000000..cd0868241d928 --- /dev/null +++ b/components/workday/sources/common/utils.mjs @@ -0,0 +1,36 @@ +const parseObject = (obj) => { + if (!obj) return {}; + + if (typeof obj === "string") { + try { + return JSON.parse(obj); + } catch (e) { + return obj; + } + } + + if (Array.isArray(obj)) { + return obj.map((item) => parseObject(item)); + } + + if (typeof obj === "object") { + return Object.fromEntries(Object.entries(obj).map(([ + key, + value, + ]) => [ + key, + parseObject(value), + ])); + } + + return obj; +}; + +export default { + parseObject, + parseJsonInput: (value) => { + return value + ? parseObject(value) + : undefined; + }, +}; diff --git a/components/workday/sources/new-worker-created/new-worker-created.mjs b/components/workday/sources/new-worker-created/new-worker-created.mjs index 1dcb00ac277de..6a25e1f4f3880 100644 --- a/components/workday/sources/new-worker-created/new-worker-created.mjs +++ b/components/workday/sources/new-worker-created/new-worker-created.mjs @@ -6,7 +6,7 @@ export default { key: "workday-new-worker-created", name: "New Worker Created", description: "Emit new event for each new worker created in Workday. [See the documentation](https://community.workday.com/sites/default/files/file-hosting/restapi/#common/v1/get-/workers)", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/components/workday/workday.app.mjs b/components/workday/workday.app.mjs index 314e3243695be..5b86e99611002 100644 --- a/components/workday/workday.app.mjs +++ b/components/workday/workday.app.mjs @@ -56,6 +56,349 @@ export default { })) || []; }, }, + homeContactInformationChangeId: { + type: "string", + label: "Home Contact Information Change ID", + description: "The ID of a home contact information change event.", + async options({ page }) { + const { data } = await this.listHomeContactInformationChanges({ + params: { + limit: DEFAULT_LIMIT, + offset: page * DEFAULT_LIMIT, + }, + }); + return data?.map((change) => ({ + label: change.descriptor || change.id, + value: change.id, + })) || []; + }, + }, + workContactInformationChangeId: { + type: "string", + label: "Work Contact Information Change ID", + description: "The ID of a specific work contact information change event in Workday.", + async options({ page }) { + const { data } = await this.listWorkContactInformationChanges({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (data || []).map((item) => ({ + label: item?.descriptor || item?.id || String(item), + value: item?.id || String(item), + })); + }, + }, + jobPostingId: { + type: "string", + label: "Job Posting ID", + description: "The ID of the job posting.", + async options({ page }) { + const res = await this.listJobPostings({ + params: { + limit: 50, + offset: 50 * page, + }, + }); + return (res.data || []).map((posting) => ({ + label: posting?.descriptor || posting?.id || String(posting), + value: posting?.id || String(posting), + })); + }, + }, + prospectId: { + type: "string", + label: "Prospect ID", + description: "The ID of the prospect.", + async options({ page }) { + const res = await this.listProspects({ + params: { + limit: 50, + offset: 50 * page, + }, + }); + return (res.data || []).map((prospect) => ({ + label: prospect?.descriptor || prospect?.id || String(prospect), + value: prospect?.id || String(prospect), + })); + }, + }, + personId: { + type: "string", + label: "Person ID", + description: "The ID of a person record in Workday.", + async options({ page }) { + const { data } = await this.listPeople({ + params: { + limit: DEFAULT_LIMIT, + offset: page * DEFAULT_LIMIT, + }, + }); + return data?.map((person) => ({ + label: person.descriptor || person.id, + value: person.id, + })) || []; + }, + }, + jobChangeId: { + type: "string", + label: "Job Change ID", + description: "The Workday Job Change ID to retrieve details for.", + async options({ page }) { + const { data } = await this.listJobChanges({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (data || []).map((jobChange) => ({ + label: jobChange?.descriptor || jobChange?.id || String(jobChange), + value: jobChange?.id || String(jobChange), + })); + }, + }, + jobFamilyId: { + type: "string", + label: "Job Family ID", + description: "The Workday Job Family ID.", + async options({ page }) { + const res = await this.listJobFamilies({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((jf) => ({ + label: jf?.descriptor || jf?.id || String(jf), + value: jf?.id || String(jf), + })); + }, + }, + jobProfileId: { + type: "string", + label: "Job Profile ID", + description: "The Workday Job Profile ID.", + async options({ page }) { + const res = await this.listJobProfiles({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((jp) => ({ + label: jp?.descriptor || jp?.id || String(jp), + value: jp?.id || String(jp), + })); + }, + }, + jobId: { + type: "string", + label: "Job ID", + description: "Workday Job ID.", + async options({ page }) { + const res = await this.listJobs({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((j) => ({ + label: j?.descriptor || j?.id, + value: j?.id, + })); + }, + }, + organizationAssignmentChangeId: { + type: "string", + label: "Organization Assignment Change ID", + description: "ID for Organization Assignment Change.", + async options({ page }) { + const res = await this.listOrganizationAssignmentChanges({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((c) => ({ + label: c?.descriptor || c?.id, + value: c?.id, + })); + }, + }, + mentorshipId: { + type: "string", + label: "Mentorship ID", + description: "The ID of the mentorship.", + async options({ page }) { + const res = await this.listMentorships({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((m) => ({ + label: m?.descriptor || m?.id || String(m), + value: m?.id || String(m), + })); + }, + }, + successionPlanId: { + type: "string", + label: "Succession Plan ID", + description: "The ID of the succession plan.", + async options({ page }) { + const res = await this.listSuccessionPlans({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((p) => ({ + label: p?.descriptor || p?.id || String(p), + value: p?.id || String(p), + })); + }, + }, + contentId: { + type: "string", + label: "Content ID", + description: "The ID of the learning content.", + async options({ page }) { + const res = await this.listContent({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((c) => ({ + label: c?.descriptor || c?.id || String(c), + value: c?.id || String(c), + })); + }, + }, + minimumWageRateId: { + type: "string", + label: "Minimum Wage Rate ID", + description: "The ID of the minimum wage rate.", + async options({ page }) { + const res = await this.listMinimumWageRates({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((rate) => ({ + label: rate?.descriptor || rate?.id || String(rate), + value: rate?.id || String(rate), + })); + }, + }, + payGroupDetailId: { + type: "string", + label: "Pay Group Detail ID", + description: "The ID of the pay group detail.", + async options({ page }) { + const res = await this.listPayGroupDetails({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((pg) => ({ + label: pg?.descriptor || pg?.id || String(pg), + value: pg?.id || String(pg), + })); + }, + }, + payrollInputId: { + type: "string", + label: "Payroll Input ID", + description: "The ID of the payroll input.", + async options({ page }) { + const res = await this.listPayrollInputs({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((input) => ({ + label: input?.descriptor || input?.id || String(input), + value: input?.id || String(input), + })); + }, + }, + payGroupId: { + type: "string", + label: "Pay Group ID", + description: "The ID of the pay group.", + async options({ page }) { + const res = await this.listPayGroups({ + params: { + limit: 50, + offset: page * 50, + }, + }); + return (res.data || []).map((pg) => ({ + label: pg?.descriptor || pg?.id || String(pg), + value: pg?.id || String(pg), + })); + }, + }, + feedbackBadgeId: { + type: "string", + label: "Feedback Badge ID", + description: "The ID of the feedback badge.", + async options({ page }) { + const res = await this.listFeedbackBadges({ + params: { + limit: 50, + offset: 50 * page, + }, + }); + return (res.data || []).map((badge) => ({ + label: badge?.descriptor || badge?.id || String(badge), + value: badge?.id || String(badge), + })); + }, + }, + giveRequestedFeedbackEventId: { + type: "string", + label: "Requested Feedback Event ID", + description: "The ID of the give requested feedback event.", + async options({ page }) { + const res = await this.listGiveRequestedFeedbackEvents({ + params: { + limit: 50, + offset: 50 * page, + }, + }); + return (res.data || []).map((event) => ({ + label: event?.descriptor || event?.id || String(event), + value: event?.id || String(event), + })); + }, + }, + interviewId: { + type: "string", + label: "Interview ID", + description: "The ID of the interview.", + async options({ page }) { + const res = await this.listInterviews?.({ + params: { + limit: 50, + offset: 50 * page, + }, + }) || { + data: [], + }; + return (res.data || []).map((i) => ({ + label: i.descriptor || i.id, + value: i.id, + })); + }, + }, + maxResults: { type: "integer", label: "Max Results", @@ -137,6 +480,545 @@ export default { ...opts, }); }, + listHomeContactInformationChanges(opts = {}) { + return this._makeRequest({ + path: "/homeContactInformationChanges", + ...opts, + }); + }, + getHomeContactInformationChange({ + homeContactInformationChangeId, ...opts + }) { + return this._makeRequest({ + path: `/homeContactInformationChanges/${homeContactInformationChangeId}`, + ...opts, + }); + }, + + async createHomeContactInformationChange({ + workerId, ...opts + }) { + return this._makeRequest({ + path: `/workers/${workerId}/homeContactInformationChanges`, + method: "POST", + ...opts, + }); + }, + + listPeople(opts = {}) { + return this._makeRequest({ + path: "/people", + ...opts, + }); + }, + + getPerson({ + id, ...opts + }) { + return this._makeRequest({ + path: `/people/${id}`, + ...opts, + }); + }, + + getPersonPhoto({ + id, ...opts + }) { + return this._makeRequest({ + path: `/people/${id}/photos`, + ...opts, + }); + }, + + validatePhoneNumber(opts = {}) { + return this._makeRequest({ + path: "/phoneValidation/validate", + method: "POST", + ...opts, + }); + }, + listWorkContactInformationChanges(opts = {}) { + return this._makeRequest({ + path: "/workContactInformationChanges", + method: "GET", + ...opts, + }); + }, + getWorkContactInformationChange({ + id, ...opts + }) { + return this._makeRequest({ + path: `/workContactInformationChanges/${id}`, + method: "GET", + ...opts, + }); + }, + + async createWorkContactInformationChange({ + workerId, ...opts + }) { + return this._makeRequest({ + path: `/workers/${workerId}/workContactInformationChanges`, + method: "POST", + ...opts, + }); + }, + + updateWorkContactInformationChange({ + id, ...opts + }) { + return this._makeRequest({ + path: `/workContactInformationChanges/${id}`, + method: "PATCH", + ...opts, + }); + }, + listInterviews(opts = {}) { + return this._makeRequest({ + path: "/interviews", + method: "GET", + ...opts, + }); + }, + getInterview({ + id, ...opts + }) { + return this._makeRequest({ + path: `/interviews/${id}`, + method: "GET", + ...opts, + }); + }, + async listJobPostings(opts = {}) { + return this._makeRequest({ + path: "/jobPostings", + method: "GET", + ...opts, + }); + }, + + async getJobPosting({ + id, ...opts + }) { + return this._makeRequest({ + path: `/jobPostings/${id}`, + method: "GET", + ...opts, + }); + }, + getProspect({ + id, ...opts + }) { + return this._makeRequest({ + path: `/prospects/${id}`, + method: "GET", + ...opts, + }); + }, + createProspect(opts = {}) { + return this._makeRequest({ + path: "/prospects", + method: "POST", + ...opts, + }); + }, + async listProspects(opts = {}) { + return this._makeRequest({ + path: "/prospects", + method: "GET", + ...opts, + }); + }, + + getJobChangeDetails({ + id, ...opts + }) { + return this._makeRequest({ + path: `/jobChanges/${id}`, + method: "GET", + ...opts, + }); + }, + listJobChanges(opts = {}) { + return this._makeRequest({ + path: "/jobChanges", + method: "GET", + ...opts, + }); + }, + listJobFamilies(opts = {}) { + return this._makeRequest({ + path: "/jobFamilies", + method: "GET", + ...opts, + }); + }, + + getJobFamily({ + id, ...opts + }) { + return this._makeRequest({ + path: `/jobFamilies/${id}`, + method: "GET", + ...opts, + }); + }, + listJobProfiles(opts = {}) { + return this._makeRequest({ + path: "/jobProfiles", + method: "GET", + ...opts, + }); + }, + getJobProfile({ + id, ...opts + }) { + return this._makeRequest({ + path: `/jobProfiles/${id}`, + method: "GET", + ...opts, + }); + }, + listJobs(opts = {}) { + return this._makeRequest({ + path: "/jobs", + method: "GET", + ...opts, + }); + }, + getJob({ + id, ...opts + }) { + return this._makeRequest({ + path: `/jobs/${id}`, + method: "GET", + ...opts, + }); + }, + + listOrganizationAssignmentChanges(opts = {}) { + return this._makeRequest({ + path: "/organizationAssignmentChanges", + method: "GET", + ...opts, + }); + }, + getOrganizationAssignmentChange({ + id, ...opts + }) { + return this._makeRequest({ + path: `/organizationAssignmentChanges/${id}`, + method: "GET", + ...opts, + }); + }, + createOrganizationAssignmentChange(opts = {}) { + return this._makeRequest({ + path: "/organizationAssignmentChanges", + method: "POST" + , ...opts, + }); + }, + getSupervisoryOrganization({ + id, ...opts + }) { + return this._makeRequest({ + path: `/supervisoryOrganizations/${id}`, + method: "GET", + ...opts, + }); + }, + getSupervisoryOrganizationMembers({ + id, ...opts + }) { + return this._makeRequest({ + path: `/supervisoryOrganizations/${id}/members`, + method: "GET", + ...opts, + }); + }, + async getWorkerGoals({ + id, ...opts + }) { + return this._makeRequest({ + path: `/workers/${id}/goals`, + method: "GET", + ...opts, + }); + }, + + async getWorkerAnytimeFeedbackEvents({ + id, ...opts + }) { + return this._makeRequest({ + path: `/workers/${id}/anytimeFeedbackEvents`, + method: "GET", + ...opts, + }); + }, + async createMentorshipForMe(opts = {}) { + return this._makeRequest({ + path: "/createMentorshipForMe", + method: "POST", + ...opts, + }); + }, + async createMentorshipForWorker(opts = {}) { + return this._makeRequest({ + path: "/createMentorshipForWorker", + method: "POST", + ...opts, + }); + }, + async listMentorships(opts = {}) { + return this._makeRequest({ + path: "/mentorships", + method: "GET", + ...opts, + }); + }, + async getMentorship({ + id, ...opts + }) { + return this._makeRequest({ + path: `/mentorships/${id}`, + method: "GET", + ...opts, + }); + }, + async updateMentorship({ + id, data, ...opts + }) { + return this._makeRequest({ + path: `/mentorships/${id}/edit`, + method: "POST", + data, + ...opts, + }); + }, + async closeMentorship({ + id, data, ...opts + }) { + return this._makeRequest({ + path: `/mentorships/${id}/close`, + method: "POST", + data, + ...opts, + }); + }, + async createSuccessionPlan(opts = {}) { + return this._makeRequest({ + path: "/successionPlans", + method: "POST", + ...opts, + }); + }, + async listSuccessionPlans(opts = {}) { + return this._makeRequest({ + path: "/successionPlans", + method: "GET", + ...opts, + }); + }, + async getSuccessionPlan({ + id, ...opts + }) { + return this._makeRequest({ + path: `/successionPlans/${id}`, + method: "GET", + ...opts, + }); + }, + async listHolidayEvents(opts = {}) { + return this._makeRequest({ + path: "/holidayEvents", + method: "GET", + ...opts, + }); + }, + async createDistributionRequest(opts = {}) { + return this._makeRequest({ + path: "/distributionRequests", + method: "POST", + ...opts, + }); + }, + async listContent(opts = {}) { + return this._makeRequest({ + path: "/content", + method: "GET", + ...opts, + }); + }, + + async getContent({ + id, ...opts + }) { + return this._makeRequest({ + path: `/content/${id}`, + method: "GET", + ...opts, + }); + }, + async createDigitalCourse(opts = {}) { + return this._makeRequest({ + path: "/manageDigitalCourses", + method: "POST", + ...opts, + }); + }, + async getJobPayGroup({ + id, ...opts + }) { + return this._makeRequest({ + path: `/jobs/${id}/payGroup`, + method: "GET", + ...opts, + }); + }, + async listMinimumWageRates(opts = {}) { + return this._makeRequest({ + path: "/minimumWageRates", + method: "GET", + ...opts, + }); + }, + + async getMinimumWageRate({ + id, ...opts + }) { + return this._makeRequest({ + path: `/minimumWageRates/${id}`, + method: "GET", + ...opts, + }); + }, + async listPayGroupDetails(opts = {}) { + return this._makeRequest({ + path: "/payGroupDetails", + method: "GET", + ...opts, + }); + }, + + async getPayGroupDetail({ + id, ...opts + }) { + return this._makeRequest({ + path: `/payGroupDetails/${id}`, + method: "GET", + ...opts, + }); + }, + async listPayGroups(opts = {}) { + return this._makeRequest({ + path: "/payGroups", + method: "GET", + ...opts, + }); + }, + + async getPayGroup({ + id, ...opts + }) { + return this._makeRequest({ + path: `/payGroups/${id}`, + method: "GET", + ...opts, + }); + }, + async createPayrollInput(opts = {}) { + return this._makeRequest({ + path: "/payrollInputs", + method: "POST", + ...opts, + }); + }, + async listPayrollInputs(opts = {}) { + return this._makeRequest({ + path: "/payrollInputs", + method: "GET", + ...opts, + }); + }, + + async getPayrollInput({ + id, ...opts + }) { + return this._makeRequest({ + path: `/payrollInputs/${id}`, + method: "GET", + ...opts, + }); + }, + async updatePayrollInput({ + id, data, ...opts + }) { + return this._makeRequest({ + path: `/payrollInputs/${id}`, + method: "PATCH", + data, + ...opts, + }); + }, + async deletePayrollInput({ + id, ...opts + }) { + return this._makeRequest({ + path: `/payrollInputs/${id}`, + method: "DELETE", + ...opts, + }); + }, + async createTaxRate(opts = {}) { + return this._makeRequest({ + path: "/taxRates", + method: "POST", + ...opts, + }); + }, + async listTaxRates(opts = {}) { + return this._makeRequest({ + path: "/taxRates", + method: "GET", + ...opts, + }); + }, + async listFeedbackBadges(opts = {}) { + return this._makeRequest({ + path: "/feedbackBadges", + method: "GET", + ...opts, + }); + }, + + async getFeedbackBadge({ + id, ...opts + }) { + return this._makeRequest({ + path: `/feedbackBadges/${id}`, + method: "GET", + ...opts, + }); + }, + async listGiveRequestedFeedbackEvents(opts = {}) { + return this._makeRequest({ + path: "/giveRequestedFeedbackEvents", + method: "GET", + ...opts, + }); + }, + + async getGiveRequestedFeedbackEvent({ + id, ...opts + }) { + return this._makeRequest({ + path: `/giveRequestedFeedbackEvents/${id}`, + method: "GET", + ...opts, + }); + }, + async *paginate({ fn, args = {}, max, }) {