/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@pipedream/waitwhile@0.0.6/dist/app/waitwhile.app.mjs
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{defineApp}from"@pipedream/types";import api from"api";export default defineApp({type:"app",app:"waitwhile",propDefinitions:{addTag:{label:"Add Tag",type:"string",optional:!0,description:"Adds specified tag to existing tags"},content:{label:"Content",type:"string",description:"Optional notes"},customerId:{label:"Customer ID",type:"string",description:"Identifier of customer, automatically derived from visitor contact information if not provided.",async options({prevContext:t}){const{prevEndAt:e}=t,{endAt:i,results:s}=await this.listCustomers({startAfter:e});return{options:s.map((t=>({label:t.name,value:t.id}))),context:{prevEndAt:i}}}},customerNoteId:{label:"Customer Note ID",type:"string",description:"Identifier of customer-note",async options({customerId:t}){return{options:(await this.listCustomerNoteEntries(t)).map((t=>({label:t.createdByName,value:t.id})))}}},desc:{label:"Desc",type:"boolean",optional:!0,description:"Show result in descending order"},email:{label:"Email",type:"string",description:"Email address"},externalId:{label:"External Id",type:"string",optional:!0,description:"External identifier, optionally provided by client"},firstName:{label:"First Name",type:"string",description:"First name of customer"},fromDate:{label:"From Date",type:"string",optional:!0,description:"Date in ISO-8601 format"},fromTime:{label:"From Time",type:"string",optional:!0,description:"Date in ISO-8601 format"},inviteId:{label:"Invite ID",type:"string",description:"Unique identifier",async options({prevContext:t}){const{prevEndAt:e}=t,{endAt:i,results:s}=await this.listInvites({startAfter:e});return{options:s.map((t=>({label:t.name,value:t.id}))),context:{prevEndAt:i}}}},lastName:{label:"Last Name",type:"string",description:"Last name of customer"},limit:{label:"Limit",type:"string",optional:!0,description:"Max number of results"},locationId:{label:"Location ID",type:"string",description:"Identifier of location",async options({prevContext:t}){const{prevEndAt:e}=t,{endAt:i,results:s}=await this.listLocations({startAfter:e});return{options:s.map((t=>({label:t.name,value:t.id}))),context:{prevEndAt:i}}}},name:{label:"Name",type:"string",description:"Name"},phone:{label:"Phone",type:"string",optional:!0,description:"Phone number in E.164 format"},resourceId:{label:"Resource ID",type:"string",description:"Identifier of resource",optional:!0,async options({prevContext:t}){const{prevEndAt:e}=t,{endAt:i,results:s}=await this.listResources({startAfter:e});return{options:s.map((t=>({label:t.name,value:t.id}))),context:{prevEndAt:i}}}},removeTag:{label:"Remove Tag",type:"string",optional:!0,description:"Removes specified tag to existing tags"},startAfter:{label:"Start After",type:"string",optional:!0,description:"Identifier(s) or value(s) to paginate results (comma-separated)"},tag:{label:"Tag",type:"string",optional:!0,description:"Tag associated with visit"},toDate:{label:"To Date",type:"string",optional:!0,description:"Date in ISO-8601 format"},toTime:{label:"To Time",type:"string",optional:!0,description:"Date in ISO-8601 format"},visitId:{label:"Visit ID",type:"string",optional:!0,description:"Identifier of visit",async options({prevContext:t}){const{prevEndAt:e}=t,{endAt:i,results:s}=await this.listVisits({startAfter:e});return{options:s.map((t=>({label:t.name,value:t.id}))),context:{prevEndAt:i}}}}},methods:{_authToken(){return this.$auth.api_key},_client(){const t=api("@waitwhile/v2#5t18rl5qsy3p0");return t.auth(this._authToken()),t},async createCustomers(t){return await this._client().postCustomers(t)},async listCustomers(t){return await this._client().getCustomers(t)},async exportCustomers(t){return await this._client().getCustomersExport(t)},async searchCustomers(t){return await this._client().getCustomersSearch(t)},async retrieveCustomer(t){return await this._client().getCustomersCustomerid(t)},async updateCustomer(t){return await this._client().postCustomersCustomerid(t)},async removeCustomer(t){return await this._client().deleteCustomersCustomerid(t)},async listCustomerNoteEntries(t){return await this._client().getCustomersCustomeridNotes(t)},async addCustomerNoteEntry(t,e){return await this._client().postCustomersCustomeridNotes(t,e)},async getCustomerNoteById(t){return await this._client().getCustomersCustomeridNotesCustomernoteid(t)},async importCustomers(t){return await this._client().postCustomersImport(t)},async updateCustomerNoteEntry(t){return await this._client().postCustomersCustomeridNotesNoteid(t)},async deleteCustomerNoteEntry(t){return await this._client().deleteCustomersCustomeridNotesNoteid(t)},async listUserInvites(t){return await this._client().getInvites(t)},async createUserInvite(t){return await this._client().postInvites(t)},async retrieveUserInvite(t){return await this._client().getInvitesInviteid(t)},async removeUserInvite(t){return await this._client().deleteInvitesInviteid(t)},async resendUserInvite(t){return await this._client().postInvitesInviteidResend(t)},async listLocations(t){return await this._client().getLocations(t)},async listVisits(t){return await this._client().getVisits(t)},async listResources(t){return await this._client().getResources(t)},async listInvites(t){return await this._client().getInvites(t)}}});
//# sourceMappingURL=/sm/9d1d04fa69266111f47bdb8a98cbc0ae8b86b3c9ee97f9982c02a577c25f7b18.map