Skip to content

Upgrade Node engine requirements to ^18.12 || ^22.13 #2730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { RequestClient } from '@segment/actions-core/create-request-client'
import { EngageDestinationCache, ExecuteInput } from '@segment/actions-core/destination-kit'
import { MaybePromise } from '@segment/actions-core/destination-kit/types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { CacheSerializer, EngageActionPerformer } from './EngageActionPerformer'
import { isRetryableError } from './isRetryableError'
import { AggregateError } from './AggregateError'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Friendbuy.trackCustomEvent', () => {
const [trackCustomEvent] = await friendbuyDestination({
merchantId,
subscriptions
})
} as any)
// console.log('trackCustomEvent', JSON.stringify(trackCustomEvent, null, 2), trackCustomEvent)
expect(trackCustomEvent).toBeDefined()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Friendbuy.trackPage', () => {
const [trackPage] = await friendbuyDestination({
merchantId,
subscriptions
})
} as any)
expect(trackPage).toBeDefined()

await trackPage.load(Context.system(), {} as Analytics)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Friendbuy.trackPurchase', () => {

test('all fields', async () => {
const orderId = 'my order'
const products = [
const products: Record<string, unknown>[] = [
{ sku: 'sku1', name: 'shorts', price: 19.99, quantity: 2 },
{ price: 5.99 },
{
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('Friendbuy.trackPurchase', () => {
const [trackPurchase] = await friendbuyDestination({
merchantId,
subscriptions
})
} as any)
// console.log('trackPurchase', JSON.stringify(trackPurchase, null, 2), trackPurchase)
expect(trackPurchase).toBeDefined()

Expand Down Expand Up @@ -117,8 +117,8 @@ describe('Friendbuy.trackPurchase', () => {
},
true
])
expect((window.friendbuyAPI?.push as any).mock.calls[0][0][2].products[1].quantity).toBe(1)
expect((window.friendbuyAPI?.push as any).mock.calls[0][0][2].products[2].imageUrl).toBe(products[2].image_url)
expect((window.friendbuyAPI!.push as any).mock.calls[0][0][2].products[1].quantity).toBe(1)
expect((window.friendbuyAPI!.push as any).mock.calls[0][0][2].products[2].imageUrl).toBe(products[2].image_url)
}

{
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-destinations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"size": "size-limit"
},
"dependencies": {
"tslib": "^2.3.1",
"tslib": "^2.8.1",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@segment/action-destinations": "^3.288.0",
"@segment/actions-core": "^3.121.0",
"@segment/destinations-manifest": "^1.71.0",
"@types/node": "^22.13.1",
"chalk": "^4.1.1",
"chokidar": "^3.5.1",
"dotenv": "^10.0.0",
Expand All @@ -71,14 +72,14 @@
"jsdom": "^24.1.1",
"json-diff": "^0.5.4",
"json-schema-to-typescript": "^10.1.5",
"lodash": "^4.17.20",
"lodash": "^4.17.21",
"mustache": "^4.2.0",
"ora": "^5.4.0",
"prompts": "^2.4.2",
"slugify": "^1.6.1",
"to-title-case": "^1.0.0",
"tsconfig-paths": "^3.9.0",
"tslib": "^2.3.1"
"tslib": "^2.8.1"
},
"oclif": {
"commands": "./dist/commands",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@
"@segment/destination-subscriptions": "<rootDir>/../destination-subscriptions/src"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/destination-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"@types/google-libphonenumber": "^7.4.23",
"@types/jest": "^27.0.0",
"@types/ssh2-sftp-client": "^9.0.0",
"@types/ssh2-sftp-client": "^9.0.4",
"jest": "^27.3.1",
"nock": "^13.1.4"
},
Expand Down Expand Up @@ -89,4 +89,4 @@
]
},
"gitHead": "9c04e12c4a0e81f6b68dca0a297fb2c0209d2431"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { ExtId, MessageSendPerformer, OperationContext, ResponseError, track, Profile } from '@segment/actions-shared'
import type { Settings } from '../generated-types'
import type { Payload } from './generated-types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { TwilioMessageSender } from '../utils'
import { ExtId, track } from '@segment/actions-shared'
import type { Payload as PushPayload } from './generated-types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { Payload } from './generated-types'
import { PayloadValidationError } from '@segment/actions-core'
import { PhoneMessageSender } from '../utils'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Liquid as LiquidJs } from 'liquidjs'
import type { Payload } from './generated-types'
import { IntegrationError } from '@segment/actions-core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Liquid as LiquidJs } from 'liquidjs'
import type { Settings } from '../generated-types'
import { IntegrationError, PayloadValidationError } from '@segment/actions-core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Settings } from '../generated-types'
import type { ExecuteInput, ModifiedResponse, RequestClient } from '@segment/actions-core'
import type { DynamicFieldItem, ExecuteInput, ModifiedResponse, RequestClient } from '@segment/actions-core'
import get from 'lodash/get'
import { ActivityTypes, PipedriveFields } from './domain'
import { DynamicFieldResponse } from '@segment/actions-core'
Expand Down Expand Up @@ -45,7 +45,7 @@ interface SearchRequest<T extends ItemType> {
field_key: string
}

const cache = {}
const cache: Record<string, DynamicFieldItem[]> = {}

class PipedriveClient {
private settings: Settings
Expand Down Expand Up @@ -85,9 +85,11 @@ class PipedriveClient {
}

async getFields(item: keyof PipedriveFieldTypes): Promise<DynamicFieldResponse> {
const cachedFields = get(cache, item, [])
const cachedFields = cache[item] ?? []
if (cachedFields.length > 0) {
return cachedFields
return {
choices: cachedFields
}
}
const response = await this._request<PipedriveFields>(
`https://${this.settings.domain}.pipedrive.com/api/v1/${pipedriveFieldMap[item]}`,
Expand All @@ -97,16 +99,16 @@ class PipedriveClient {
}
)
const body = response.data
const fields = body.data.map((f) => ({
const fields: DynamicFieldItem[] = body.data.map((f) => ({
label: f.name,
value: f.key
}))
const record = {
choices: fields,
pagination: {}

cache[item] = fields

return {
choices: cachedFields
}
cachedFields[item] = record
return record
}

async getActivityTypes(): Promise<DynamicFieldResponse> {
Expand Down
Loading
Loading