diff --git a/integration-templates/unanet/actions/create-company.ts b/integration-templates/unanet/actions/create-company.ts new file mode 100644 index 0000000000..0994e629a3 --- /dev/null +++ b/integration-templates/unanet/actions/create-company.ts @@ -0,0 +1,16 @@ +import type { NangoAction, Entity, Company } from '../../models'; + +import { getOrCreateCompany } from '../helpers/get-or-create-company.js'; + +export default async function runAction(nango: NangoAction, input: Entity): Promise { + if (!input?.name) { + throw new nango.ActionError({ + message: 'Name is required to create a company', + code: 'missing_name' + }); + } + + const company = await getOrCreateCompany(nango, input.name); + + return company; +} diff --git a/integration-templates/unanet/actions/create-lead.ts b/integration-templates/unanet/actions/create-lead.ts new file mode 100644 index 0000000000..5578e787c6 --- /dev/null +++ b/integration-templates/unanet/actions/create-lead.ts @@ -0,0 +1,31 @@ +import type { NangoAction, Lead } from '../../models'; +import type { UnanetLead } from '../types'; +import { toLead } from '../mappers/to-lead.js'; + +export default async function runAction(nango: NangoAction, input: Lead): Promise { + if (!input?.name) { + throw new nango.ActionError({ + message: 'Name is required to create a lead', + code: 'missing_name' + }); + } + + const data: UnanetLead = { + Name: input.name + }; + + if (input.activities) { + const note = input.activities.map((activity) => { + return activity.message; + }); + + data.Notes = note.join(','); + } + + const response = await nango.post({ + endpoint: '/api/leads', + data: [data] + }); + + return toLead(response.data[0]); +} diff --git a/integration-templates/unanet/actions/create-opportunity.ts b/integration-templates/unanet/actions/create-opportunity.ts new file mode 100644 index 0000000000..d2ef98ba91 --- /dev/null +++ b/integration-templates/unanet/actions/create-opportunity.ts @@ -0,0 +1,56 @@ +import type { NangoAction, Opportunity } from '../../models'; +import type { CreateUnanetOpportunity } from '../types'; + +import { getOrCreateCompany } from '../helpers/get-or-create-company.js'; +import { findStage } from '../helpers/find-stage.js'; +import { toOpportunity } from '../mappers/to-opportunity.js'; + +export default async function runAction(nango: NangoAction, input: Opportunity): Promise { + if (!input.companyName) { + throw new nango.ActionError({ + message: 'Company Name is required to create an opportunity', + code: 'missing_company_name' + }); + } + + if (!input.name) { + throw new nango.ActionError({ + message: 'Name is required to create an opportunity', + code: 'missing_name' + }); + } + + if (!input.stage) { + throw new nango.ActionError({ + message: 'Stage is required to create an opportunity', + code: 'missing_stage' + }); + } + + const company = await getOrCreateCompany(nango, input.companyName); + + const stage = await findStage(nango, input.stage); + + if (!stage) { + throw new nango.ActionError({ + message: 'Stage not found. Please use a valid stage', + code: 'stage_not_found' + }); + } + + const opportunity: CreateUnanetOpportunity = { + ClientId: Number(company.id), + ClientName: company.name, + OpportunityName: input.name, + Stage: input.stage, + StageId: stage.id, + ActiveInd: Number(input.active || true) + }; + + const response = await nango.post({ + endpoint: '/api/opportunities', + data: [opportunity] + }); + + return toOpportunity(response.data[0]); +} diff --git a/integration-templates/unanet/actions/get-company.ts b/integration-templates/unanet/actions/get-company.ts new file mode 100644 index 0000000000..af7d7bdd0f --- /dev/null +++ b/integration-templates/unanet/actions/get-company.ts @@ -0,0 +1,16 @@ +import type { NangoAction, Entity, Company } from '../../models'; + +import { getCompany } from '../helpers/get-or-create-company.js'; + +export default async function runAction(nango: NangoAction, input: Entity): Promise { + if (!input?.name) { + throw new nango.ActionError({ + message: 'Name is required to create a company', + code: 'missing_name' + }); + } + + const company = await getCompany(nango, input.name); + + return company; +} diff --git a/integration-templates/unanet/actions/get-schema.ts b/integration-templates/unanet/actions/get-schema.ts new file mode 100644 index 0000000000..61b0542017 --- /dev/null +++ b/integration-templates/unanet/actions/get-schema.ts @@ -0,0 +1,18 @@ +import type { NangoAction, Entity, Schema } from '../../models'; + +export default async function runAction(nango: NangoAction, input: Entity): Promise { + if (!input?.name) { + throw new nango.ActionError({ + message: 'Name is required to look up an entity schema', + code: 'missing_name' + }); + } + + const response = await nango.get({ + endpoint: `/api/${input.name}/schema` + }); + + const { data } = response; + + return data; +} diff --git a/integration-templates/unanet/actions/list-stages.ts b/integration-templates/unanet/actions/list-stages.ts new file mode 100644 index 0000000000..046a417450 --- /dev/null +++ b/integration-templates/unanet/actions/list-stages.ts @@ -0,0 +1,13 @@ +import type { NangoAction, Stage } from '../../models'; +import type { UnanetStage } from '../types'; +import { toStage } from '../mappers/to-stage.js'; + +export default async function runAction(nango: NangoAction, _input?: void): Promise { + const response = await nango.get({ + endpoint: '/api/opportunities/stage' + }); + + const { data } = response; + + return data.map(toStage); +} diff --git a/integration-templates/unanet/actions/update-lead.ts b/integration-templates/unanet/actions/update-lead.ts new file mode 100644 index 0000000000..03643657b6 --- /dev/null +++ b/integration-templates/unanet/actions/update-lead.ts @@ -0,0 +1,35 @@ +import type { NangoAction, Lead } from '../../models'; +import type { UnanetLead } from '../types'; +import { toLead } from '../mappers/to-lead.js'; + +export default async function runAction(nango: NangoAction, input: Lead): Promise { + if (!input.id) { + throw new nango.ActionError({ + message: 'ID is required to update a lead', + code: 'missing_id' + }); + } + + const data: UnanetLead = { + Name: input.name + }; + + if (input.description) { + data.Description = input.description; + } + + if (input.activities) { + const note = input.activities.map((activity) => { + return activity.message; + }); + + data.Notes = note.join(','); + } + + const response = await nango.put({ + endpoint: `/api/leads/${input.id}`, + data + }); + + return toLead(response.data); +} diff --git a/integration-templates/unanet/helpers/find-stage.ts b/integration-templates/unanet/helpers/find-stage.ts new file mode 100644 index 0000000000..95602098fc --- /dev/null +++ b/integration-templates/unanet/helpers/find-stage.ts @@ -0,0 +1,16 @@ +import type { Stage, NangoAction } from '../../models'; +import { toStage } from '../mappers/to-stage.js'; + +export async function findStage(nango: NangoAction, name: string): Promise { + const response = await nango.get({ + endpoint: `/api/opportunities/stage/search?q=StageName:"${name}"` + }); + + const { data } = response; + + if (data && data.length > 0) { + return toStage(data[0]); + } + + return null; +} diff --git a/integration-templates/unanet/helpers/get-or-create-company.ts b/integration-templates/unanet/helpers/get-or-create-company.ts new file mode 100644 index 0000000000..eca5b96ea1 --- /dev/null +++ b/integration-templates/unanet/helpers/get-or-create-company.ts @@ -0,0 +1,35 @@ +import type { Company, NangoAction } from '../../models'; +import { toCompany } from '../mappers/to-company.js'; + +export async function getCompany(nango: NangoAction, name: string): Promise { + const response = await nango.get({ + endpoint: `/api/companies/search?q=Name:"${name}"` + }); + + const { data } = response; + + if (data.length > 0) { + return toCompany(data[0]); + } + + return null; +} + +export async function getOrCreateCompany(nango: NangoAction, name: string): Promise { + const foundCompany = await getCompany(nango, name); + + if (foundCompany) { + return foundCompany; + } + + const company = await nango.post({ + endpoint: '/api/companies', + data: [ + { + Name: name + } + ] + }); + + return toCompany(company.data); +} diff --git a/integration-templates/unanet/mappers/to-company.ts b/integration-templates/unanet/mappers/to-company.ts new file mode 100644 index 0000000000..75b5a8df2d --- /dev/null +++ b/integration-templates/unanet/mappers/to-company.ts @@ -0,0 +1,12 @@ +import type { UnanetCompany } from '../types'; +import type { Company } from '../../models'; + +export function toCompany(company: UnanetCompany): Company { + return { + id: company.CompanyId.toString(), + name: company.Name, + externalId: company.ExternalId, + shortName: company.Acronym, + description: company.Notes + }; +} diff --git a/integration-templates/unanet/mappers/to-lead.ts b/integration-templates/unanet/mappers/to-lead.ts new file mode 100644 index 0000000000..b9f28ba673 --- /dev/null +++ b/integration-templates/unanet/mappers/to-lead.ts @@ -0,0 +1,26 @@ +import type { Lead } from '../../models'; +import type { UnanetLead } from '../types'; + +export function toLead(unanetLead: UnanetLead): Lead { + if (!unanetLead.LeadId) { + throw new Error('LeadId is required'); + } + + const lead: Lead = { + id: unanetLead.LeadId?.toString(), + name: unanetLead.Name, + description: unanetLead.Description || '', + createdAt: unanetLead.CreateDate ? new Date(unanetLead.CreateDate).toISOString() : '', + updatedAt: unanetLead.ModifyDate ? new Date(unanetLead.ModifyDate).toISOString() : '' + }; + + if (unanetLead.StageId) { + lead.stage = { + id: unanetLead.StageId, + name: unanetLead.StageName || '', + status: unanetLead.StageTypeName || '' + }; + } + + return lead; +} diff --git a/integration-templates/unanet/mappers/to-opportunity.ts b/integration-templates/unanet/mappers/to-opportunity.ts new file mode 100644 index 0000000000..2d9ba18dba --- /dev/null +++ b/integration-templates/unanet/mappers/to-opportunity.ts @@ -0,0 +1,14 @@ +import type { Opportunity } from '../../models'; +import type { UnanetOpportunity } from '../types'; + +export function toOpportunity(opportunity: UnanetOpportunity): Opportunity { + return { + name: opportunity.OpportunityName, + description: '', + id: opportunity.OpportunityId.toString(), + externalId: opportunity.ExternalId, + companyName: opportunity.ClientName, + stage: opportunity.Stage, + active: opportunity.ActiveInd === 1 + }; +} diff --git a/integration-templates/unanet/mappers/to-stage.ts b/integration-templates/unanet/mappers/to-stage.ts new file mode 100644 index 0000000000..2e54bfda71 --- /dev/null +++ b/integration-templates/unanet/mappers/to-stage.ts @@ -0,0 +1,10 @@ +import type { Stage } from '../../models'; +import type { UnanetStage } from '../types'; + +export function toStage(stage: UnanetStage): Stage { + return { + id: stage.StageID, + name: stage.StageName, + status: stage.StageType.StageTypeName + }; +} diff --git a/integration-templates/unanet/nango.yaml b/integration-templates/unanet/nango.yaml new file mode 100644 index 0000000000..ee266389fe --- /dev/null +++ b/integration-templates/unanet/nango.yaml @@ -0,0 +1,96 @@ +integrations: + unanet: + actions: + create-lead: + endpoint: POST /lead + description: Create a lead with information about the opportunity and company + input: Lead + update-lead: + endpoint: PUT /lead + description: Update a lead + get-schema: + endpoint: GET /schema + input: Entity + description: Get the schema of any entity + output: Schema[] + get-company: + endpoint: GET /company + input: Entity + output: Company | null + description: Retrieve information about a company + create-company: + endpoint: POST /company + input: Entity + output: Company + description: Create a company in the system + create-opportunity: + endpoint: POST /opportunity + input: Opportunity + description: Create an opportunity in the system + list-stages: + endpoint: GET /stages + description: List all the stages that exist in the system + output: Stage + +models: + Timestamps: + createdAt?: string + updatedAt?: string + Entity: + name: string + Location: + city: string + country: string + Stage: + id: number + name: string + status: string + Company: + name: string + externalId: string + shortName: string + description: string + id?: string + Opportunity: + name: string + description: string + id?: string + externalId: string + companyName: string + stage: string + active: boolean + Activity: + createdAt: string + id: string + message: string + Lead: + __extends: Timestamps + id: string + description: string + comments?: Comment[] + activities?: Activity[] + opportunity?: Opportunity + name: string + stage?: Stage + Schema: + PropertyName: string + Group: string | null + Label: string + Description: string | null + Enabled: boolean + ReadOnly: boolean + Required: boolean + DefaultValue: string | null + DataType: number + MaxLength: number | null + UnicodeSupported: boolean + Searchable: boolean + ArrayType: string | null + IsPrimaryKey: boolean + IsExternalId: boolean + ObjectEndpoint: string | null + IsHidden: boolean + IsIncludedInResponse: boolean + SchemaEndpoint: string | null + SortOrder: number + CustomSort: boolean diff --git a/integration-templates/unanet/types.ts b/integration-templates/unanet/types.ts new file mode 100644 index 0000000000..0717b0359a --- /dev/null +++ b/integration-templates/unanet/types.ts @@ -0,0 +1,298 @@ +export interface UnanetCompany { + CompanyId: number; + Name: string; + Acronym: string; + Website: string; + ExternalId: string; + FPISImportId: string; + ParentCompanyName: string; + TickerSymbol: string; + SalesTarget: number; + AnnualRevenue: number; + NumberOfEmployees: number; + IsHeadquarters: boolean; + ContactFirmsShortText1: string; + ContactFirmsShortText2: string; + ContactFirmsShortText3: string; + ContactFirmsShortText4: string; + ContactFirmsShortText5: string; + ContactFirmsLongText1: string; + ContactFirmsLongText2: string; + ContactFirmsLongText3: string; + ContactFirmsLongText4: string; + ContactFirmsLongText5: string; + ContactFirmsNumber1: number; + ContactFirmsNumber2: number; + ContactFirmsNumber3: number; + ContactFirmsNumber4: number; + ContactFirmsNumber5: number; + ContactFirmsDate1: string; + ContactFirmsDate2: string; + ContactFirmsDate3: string; + ContactFirmsDate4: string; + ContactFirmsDate5: string; + ContactFirmsValueListID1: number; + ContactFirmsValueListID2: number; + ContactFirmsValueListID3: number; + ContactFirmsValueListID4: number; + ContactFirmsValueListID5: number; + ContactFirmsMoney1: number; + ContactFirmsMoney2: number; + ContactFirmsMoney3: number; + ContactFirmsMoney4: number; + ContactFirmsMoney5: number; + ContactFirmsPercent1: number; + ContactFirmsPercent2: number; + ContactFirmsPercent3: number; + ContactFirmsPercent4: number; + ContactFirmsPercent5: number; + DUNSNumber: string; + OtherCompanyName: string; + Division: string; + IsDeleted: boolean; + Notes: string; + CreateDateTime: string; + CreatedByUserId: number; + LastModifiedDateTime: string; + LastModifiedByUserId: number; + LastDeletedDateTime: string; + LastDeletedByUserId: number; + ParentCompanyId: number; + Services: string; + Sector: string; + ROW_VERSION: string; + version_userName: string; + version_device: string; + AddrLat: number; + AddrLong: number; + isConfidential: boolean; +} + +export type CreateUnanetOpportunity = Partial & Pick; + +export interface UnanetOpportunity { + OpportunityId: number; + ClientId: number; + ClientName: string; + SF255Form: number; + SF330Form: number; + OpportunityName: string; + EstimatedSelectionDate: Date; + CloseDate: Date; + Cost: number; + Size: number; + SizeUnit: string; + Fee: number; + Probability: number; + NextAction: string; + RFPRecieved: boolean; + ProposalNumber: string; + ProposalDueDate: Date; + ExpectedRFPDate: Date; + QualsDueDate: Date; + ProposalSubmitted: boolean; + PresentationDate: Date; + Comments: string; + MarketingCostBudget: number; + MarketingCostActual: number; + OpportunityNumber: string; + ActiveInd: number; + DeleteRecord: boolean; + Address1: string; + Address2: string; + City: string; + State: string; + PostalCode: string; + Country: string; + OpportunityDescription: string; + ExternalId: string; + OpportunityShortText1: string; + OpportunityShortText2: string; + OpportunityShortText3: string; + OpportunityShortText4: string; + OpportunityShortText5: string; + OpportunityNumber1: number; + OpportunityNumber2: number; + OpportunityNumber3: number; + OpportunityNumber4: number; + OpportunityNumber5: number; + OpportunityDate1: Date; + OpportunityDate2: Date; + OpportunityDate3: Date; + OpportunityDate4: Date; + OpportunityDate5: Date; + OpportunityValueListID1: number; + OpportunityValueListID2: number; + OpportunityValueListID3: number; + OpportunityValueListID4: number; + OpportunityValueListID5: number; + OpportunityMoney1: number; + OpportunityMoney2: number; + OpportunityMoney3: number; + OpportunityMoney4: number; + OpportunityMoney5: number; + OpportunityPercent1: number; + OpportunityPercent2: number; + OpportunityPercent3: number; + OpportunityPercent4: number; + OpportunityPercent5: number; + EstimatedStartDate: Date; + EstimatedCompletionDate: Date; + FirmFee: number; + ProjectProbability: number; + OwnerId: number; + OwnerName: string; + TeamOppFirmOrgFeeSource: number; + OppType: number; + PreConStartDate: Date; + PreConEndDate: Date; + DesignStartDate: Date; + DesignCompletionDate: Date; + ConstructionStartDate: Date; + ConstructionCompletionDate: Date; + fundProbability: number; + ShortListed: boolean; + Interviewed: boolean; + ShortListedDate: Date; + Score: number; + CreateDateTime: Date; + CreatedByUserId: number; + LastModifiedDateTime: Date; + LastModifiedByUserId: number; + LastDeletedDateTime: Date; + LastDeletedByUserId: number; + EstimatedFeePercentage: number; + FactoredFee: number; + GrossRevenueSTD: number; + GrossMarginDollarsSTD: number; + GrossMarginPercentSTD: number; + FactoredCostSTD: number; + FeeCIPercent: number; + FeeCIDifVolume: number; + LaborDifferentialDollars: number; + OppSelfPerformHours: number; + EstimatedManagementUnits: number; + GrossMargin: number; + GrossMarginPercent: number; + MasterOpportunityId: number; + OppTypeDescription: string; + AutoNumber: number; + Stage: string; + StageType: string; + Note: string; + RedZoneScore: number; + OpportunityLongText1: string; + OpportunityLongText2: string; + OpportunityLongText3: string; + OpportunityLongText4: string; + OpportunityLongText5: string; + approvalLevel: string; + approvalStatus: string; + OppLat: number; + OppLong: number; + StageId: number; + County: string; + RegionId: number; + WorkHoursEngineer: number; + WorkHoursConstruction: number; + WorkHoursDesign: number; + FeePercent: number; + SolicitationNumber: string; + OnCallContractStartDate: Date; + OnCallContractEndDate: Date; + OriginalFirmEstimatedFee: number; + OppFormID: number; + Markup: number; + PropertyId: number; + ReferredByID: number; + Contacts: object[]; + Region: object[]; + primarycategories: object[]; + secondarycategories: object[]; + Offices: object[]; + Divisions: object[]; + Studios: object[]; + PracticeAreas: object[]; + Territories: object[]; + OfficeDivision: object[]; + servicetypes: object[]; + SubmittalType: object; + ProspectType: object[]; + StaffTeam: object[]; + Role: object; + Sf330ProfileCode: object; + DeliveryMethod: object[]; + servicefeebreakdown: object; + clienttypes: object[]; + Companies: object[]; + Documents: object[]; + Emails: object[]; + Competition: object[]; + ClonedFrom: object; +} + +export interface UnanetLead { + LeadId?: number; + Name: string; + Description?: string; + NextAction?: string; + Date?: string; + TickDate?: string; + CreateDate?: string; + IsDeleted?: boolean; + Email?: string; + Phone?: string; + ContactFirst?: string; + ContactLast?: string; + NumOfViews?: number; + EstimatedCost?: number; + State?: string; + City?: string; + Country?: string; + BidDate?: string; + LegacyId?: string; + ModifyDate?: string; + Deliverable?: string; + Notes?: string; + ROW_VERSION?: Uint8Array; + CreatedByUserId?: number; + ModifiedByUserId?: number; + SolicitationNumber?: string; + UnitSize?: string; + EstimatedSize?: number; + StageId?: number; + StageName?: string; + StageTypeId?: number; + StageTypeName?: string; + AssignedTo?: any[]; + AssociatedCompanies?: any[]; + ContractTypes?: any[]; + Offices?: any[]; + OfficeDivisions?: any[]; + Divisions?: any[]; + Studios?: any[]; + PracticeAreas?: any[]; + Territories?: any[]; + PrimaryCategories?: any[]; + riskprofile?: any; + LeadTypes?: any[]; + score?: any; + SecondaryCategories?: any[]; + ServiceTypes?: any[]; + Source?: any[]; + stage?: any; + recordsource?: any[]; + Opportunity?: UnanetOpportunity[][]; + AssociatedContacts?: any[]; + PotentialClient?: any; + Naics?: any[]; +} + +export interface UnanetStage { + StageID: number; + StageName: string; + StageType: { + StageTypeID: number; + StageTypeName: string; + }; +} diff --git a/package-lock.json b/package-lock.json index ec6889555e..f2ee97bc77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33258,37 +33258,11 @@ "acorn": "^8" } }, - "packages/shared/node_modules/@nangohq/utils/node_modules/agent-base": { - "version": "7.1.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, "packages/shared/node_modules/@nangohq/utils/node_modules/async": { "version": "3.2.5", "inBundle": true, "license": "MIT" }, - "packages/shared/node_modules/@nangohq/utils/node_modules/asynckit": { - "version": "0.4.0", - "inBundle": true, - "license": "MIT" - }, - "packages/shared/node_modules/@nangohq/utils/node_modules/axios": { - "version": "1.7.2", - "inBundle": true, - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "packages/shared/node_modules/@nangohq/utils/node_modules/cjs-module-lexer": { "version": "1.3.1", "inBundle": true, @@ -33334,17 +33308,6 @@ "text-hex": "1.0.x" } }, - "packages/shared/node_modules/@nangohq/utils/node_modules/combined-stream": { - "version": "1.0.8", - "inBundle": true, - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "packages/shared/node_modules/@nangohq/utils/node_modules/crypto-randomuuid": { "version": "1.0.0", "inBundle": true, @@ -33400,27 +33363,6 @@ "node": ">=18" } }, - "packages/shared/node_modules/@nangohq/utils/node_modules/debug": { - "version": "4.3.5", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "packages/shared/node_modules/@nangohq/utils/node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "inBundle": true, - "license": "MIT" - }, "packages/shared/node_modules/@nangohq/utils/node_modules/delay": { "version": "5.0.0", "inBundle": true, @@ -33432,14 +33374,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "packages/shared/node_modules/@nangohq/utils/node_modules/delayed-stream": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "packages/shared/node_modules/@nangohq/utils/node_modules/detect-newline": { "version": "3.1.0", "inBundle": true, @@ -33468,62 +33402,6 @@ "inBundle": true, "license": "MIT" }, - "packages/shared/node_modules/@nangohq/utils/node_modules/follow-redirects": { - "version": "1.15.6", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "packages/shared/node_modules/@nangohq/utils/node_modules/form-data": { - "version": "4.0.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "packages/shared/node_modules/@nangohq/utils/node_modules/http-proxy-agent": { - "version": "7.0.2", - "inBundle": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "packages/shared/node_modules/@nangohq/utils/node_modules/https-proxy-agent": { - "version": "7.0.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, "packages/shared/node_modules/@nangohq/utils/node_modules/ieee754": { "version": "1.2.1", "funding": [ @@ -33673,25 +33551,6 @@ "node": ">= 0.6" } }, - "packages/shared/node_modules/@nangohq/utils/node_modules/mime-db": { - "version": "1.52.0", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "packages/shared/node_modules/@nangohq/utils/node_modules/mime-types": { - "version": "2.1.35", - "inBundle": true, - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "packages/shared/node_modules/@nangohq/utils/node_modules/module-details-from-path": { "version": "1.0.3", "inBundle": true, @@ -33811,11 +33670,6 @@ "node": ">=12.0.0" } }, - "packages/shared/node_modules/@nangohq/utils/node_modules/proxy-from-env": { - "version": "1.1.0", - "inBundle": true, - "license": "MIT" - }, "packages/shared/node_modules/@nangohq/utils/node_modules/readable-stream": { "version": "3.6.2", "inBundle": true, diff --git a/packages/shared/flows.yaml b/packages/shared/flows.yaml index 479c6dae16..d1d86d09c1 100644 --- a/packages/shared/flows.yaml +++ b/packages/shared/flows.yaml @@ -2877,6 +2877,101 @@ integrations: links: self: string related: string + unanet: + actions: + create-lead: + endpoint: POST /lead + description: Create a lead with information about the opportunity and company + input: Lead + update-lead: + endpoint: PUT /lead + description: Update a lead + get-schema: + endpoint: GET /schema + input: Entity + description: Get the schema of any entity + output: Schema[] + get-company: + endpoint: GET /company + input: Entity + output: Company | null + description: Retrieve information about a company + create-company: + endpoint: POST /company + input: Entity + output: Company + description: Create a company in the system + create-opportunity: + endpoint: POST /opportunity + input: Opportunity + description: Create an opportunity in the system + list-stages: + endpoint: GET /stages + description: List all the stages that exist in the system + output: Stage + models: + Timestamps: + createdAt?: string + updatedAt?: string + Entity: + name: string + Location: + city: string + country: string + Stage: + id: number + name: string + status: string + Company: + name: string + externalId: string + shortName: string + description: string + id?: string + Opportunity: + name: string + description: string + id?: string + externalId: string + companyName: string + stage: string + active: boolean + Activity: + createdAt: string + id: string + message: string + Lead: + createdAt?: string + updatedAt?: string + id: string + description: string + comments?: Comment[] + activities?: Activity[] + opportunity?: Opportunity + name: string + stage?: Stage + Schema: + PropertyName: string + Group: string | null + Label: string + Description: string | null + Enabled: boolean + ReadOnly: boolean + Required: boolean + DefaultValue: string | null + DataType: number + MaxLength: number | null + UnicodeSupported: boolean + Searchable: boolean + ArrayType: string | null + IsPrimaryKey: boolean + IsExternalId: boolean + ObjectEndpoint: string | null + IsHidden: boolean + IsIncludedInResponse: boolean + SchemaEndpoint: string | null + SortOrder: number + CustomSort: boolean wildix-pbx: syncs: colleagues: diff --git a/packages/shared/lib/services/proxy.service.ts b/packages/shared/lib/services/proxy.service.ts index cd360df3d7..9be866b77e 100644 --- a/packages/shared/lib/services/proxy.service.ts +++ b/packages/shared/lib/services/proxy.service.ts @@ -436,6 +436,7 @@ class ProxyService { case 'OAUTH2': tokenPair = { accessToken: config.token }; break; + case 'BASIC': case 'API_KEY': case 'OAUTH2_CC': if (value.includes('connectionConfig')) {