Skip to content

Commit de95539

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(eloqua): align integration with staging CI contracts
1 parent ad4c5af commit de95539

6 files changed

Lines changed: 50 additions & 28 deletions

File tree

‎apps/docs/openapi-v2-workflows.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16894,6 +16894,11 @@
1689416894
"confluence.spaces",
1689516895
"confluence.spacesById",
1689616896
"confluence.pages",
16897+
"eloqua.campaigns",
16898+
"eloqua.contactLists",
16899+
"eloqua.emails",
16900+
"eloqua.forms",
16901+
"eloqua.segments",
1689716902
"google.tasks.lists",
1689816903
"gmail.labels",
1689916904
"google.calendar",
@@ -17076,6 +17081,11 @@
1707617081
"confluence.spaces",
1707717082
"confluence.spacesById",
1707817083
"confluence.pages",
17084+
"eloqua.campaigns",
17085+
"eloqua.contactLists",
17086+
"eloqua.emails",
17087+
"eloqua.forms",
17088+
"eloqua.segments",
1707917089
"google.tasks.lists",
1708017090
"gmail.labels",
1708117091
"google.calendar",

‎apps/sim/blocks/blocks/eloqua.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
parseOptionalJsonInput,
88
parseOptionalNumberInput,
99
} from '@/blocks/utils'
10-
import type { EloquaResponse } from '@/tools/eloqua/types'
1110

1211
const APPLICATION_LIST_OPERATIONS = [
1312
'list_contacts',
@@ -169,7 +168,7 @@ function bulkPageParams(
169168
}
170169
}
171170

172-
export const EloquaBlock: BlockConfig<EloquaResponse> = {
171+
export const EloquaBlock: BlockConfig = {
173172
type: 'eloqua',
174173
name: 'Oracle Eloqua',
175174
description: 'Manage Eloqua contacts, accounts, marketing assets, and Bulk API syncs',

‎apps/sim/lib/oauth/eloqua.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @vitest-environment node
33
*/
4-
import { afterEach, describe, expect, it, vi } from 'vitest'
4+
import { describe, expect, it, vi } from 'vitest'
55
import {
66
ELOQUA_IDENTITY_URL,
77
ELOQUA_OAUTH_TOKEN_URL,
@@ -13,8 +13,6 @@ import {
1313
} from '@/lib/oauth/eloqua'
1414

1515
describe('Eloqua OAuth and instance discovery', () => {
16-
afterEach(() => vi.unstubAllGlobals())
17-
1816
it('exchanges a code with a Basic-authenticated JSON request', async () => {
1917
const fetchMock = vi.fn().mockResolvedValue(
2018
Response.json({

‎apps/sim/lib/selectors/server/providers/eloqua.test.ts‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
/**
22
* @vitest-environment node
33
*/
4-
import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'
4+
import { authOAuthUtilsMock, authOAuthUtilsMockFns } from '@sim/testing/mocks/auth-oauth-utils.mock'
5+
import {
6+
selectorCredentialBundleMock,
7+
selectorCredentialBundleMockFns,
8+
} from '@sim/testing/mocks/selector-credential-bundle.mock'
9+
import { beforeEach, describe, expect, it, vi } from 'vitest'
510

6-
const { mockFetch, mockGetCredential, mockResolveSelectorCredentialBundle } = vi.hoisted(() => ({
7-
mockFetch: vi.fn(),
8-
mockGetCredential: vi.fn(),
9-
mockResolveSelectorCredentialBundle: vi.fn(),
10-
}))
11+
const mockFetch = vi.hoisted(() => vi.fn())
1112

12-
vi.mock('@/lib/oauth/credential-service', () => ({
13-
getCredential: mockGetCredential,
14-
}))
13+
vi.mock('@/lib/oauth/credential-service', () => authOAuthUtilsMock)
1514

16-
vi.mock('@/lib/selectors/server/providers/credential-bundle', () => ({
17-
resolveSelectorCredentialBundle: mockResolveSelectorCredentialBundle,
18-
}))
15+
vi.mock('@/lib/selectors/server/providers/credential-bundle', () => selectorCredentialBundleMock)
1916

2017
import { SelectorConnectionUnavailableError } from '@/lib/selectors/server/errors'
2118
import { createSelectorProtectedValues } from '@/lib/selectors/server/protected-values'
2219
import { eloquaSelectorAttachments } from '@/lib/selectors/server/providers/eloqua'
2320
import type { ExecuteServerSelectorArgs } from '@/lib/selectors/server/types'
2421

22+
const mockGetCredential = authOAuthUtilsMockFns.mockGetCredential
23+
const mockResolveSelectorCredentialBundle =
24+
selectorCredentialBundleMockFns.mockResolveSelectorCredentialBundle
25+
2526
function args(
2627
request: ExecuteServerSelectorArgs['request'],
2728
selectorKey: ExecuteServerSelectorArgs['selectorKey'] = 'eloqua.campaigns',
@@ -55,7 +56,9 @@ function args(
5556

5657
describe('Oracle Eloqua server selector adapter', () => {
5758
beforeEach(() => {
58-
vi.clearAllMocks()
59+
mockFetch.mockReset()
60+
mockGetCredential.mockReset()
61+
mockResolveSelectorCredentialBundle.mockReset()
5962
vi.stubGlobal('fetch', mockFetch)
6063
mockGetCredential.mockResolvedValue({
6164
providerId: 'eloqua',
@@ -66,8 +69,6 @@ describe('Oracle Eloqua server selector adapter', () => {
6669
})
6770
})
6871

69-
afterAll(() => vi.unstubAllGlobals())
70-
7172
it('binds the credential pod, escapes prefix search, and paginates on demand', async () => {
7273
mockFetch
7374
.mockResolvedValueOnce(

‎apps/sim/tools/eloqua/utils.ts‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { truncate } from '@sim/utils/string'
21
import { normalizeEloquaInstanceUrl } from '@/lib/oauth/eloqua'
32
import type {
43
EloquaApplicationResource,
@@ -14,7 +13,7 @@ export const ELOQUA_OAUTH_CONFIG = {
1413
authoritativeParams: ['instanceUrl'],
1514
} as const satisfies OAuthConfig
1615

17-
export const ELOQUA_MAX_INLINE_IMPORT_BYTES = 10 * 1024 * 1024
16+
const ELOQUA_MAX_INLINE_IMPORT_BYTES = 10 * 1024 * 1024
1817

1918
export const ELOQUA_AUTH_PARAMS: ToolConfig['params'] = {
2019
accessToken: {
@@ -123,7 +122,7 @@ const ELOQUA_APPLICATION_COMMON_PROPERTIES: Record<string, ToolOutputProperty> =
123122
depth: stringField('Response detail depth'),
124123
}
125124

126-
export const ELOQUA_APPLICATION_RESOURCE_PROPERTIES: Record<
125+
const ELOQUA_APPLICATION_RESOURCE_PROPERTIES: Record<
127126
EloquaApplicationResource,
128127
Record<string, ToolOutputProperty>
129128
> = {
@@ -676,8 +675,3 @@ export async function eloquaJsonObject(response: Response, label: string) {
676675
}
677676
return requireEloquaObject(value, `${label} response`)
678677
}
679-
680-
export function boundedProviderMessage(value: unknown): string | undefined {
681-
if (typeof value !== 'string' || !value.trim()) return undefined
682-
return truncate(value.trim(), 2_000)
683-
}

‎packages/sim-cli/src/generated/v2-api.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6282,6 +6282,11 @@ export type GetSelectorBody = {
62826282
| 'confluence.spaces'
62836283
| 'confluence.spacesById'
62846284
| 'confluence.pages'
6285+
| 'eloqua.campaigns'
6286+
| 'eloqua.contactLists'
6287+
| 'eloqua.emails'
6288+
| 'eloqua.forms'
6289+
| 'eloqua.segments'
62856290
| 'google.tasks.lists'
62866291
| 'gmail.labels'
62876292
| 'google.calendar'
@@ -9085,6 +9090,11 @@ export type ListSelectorBody = {
90859090
| 'confluence.spaces'
90869091
| 'confluence.spacesById'
90879092
| 'confluence.pages'
9093+
| 'eloqua.campaigns'
9094+
| 'eloqua.contactLists'
9095+
| 'eloqua.emails'
9096+
| 'eloqua.forms'
9097+
| 'eloqua.segments'
90889098
| 'google.tasks.lists'
90899099
| 'gmail.labels'
90909100
| 'google.calendar'
@@ -17102,6 +17112,11 @@ export const V2_OPERATIONS = {
1710217112
'confluence.spaces',
1710317113
'confluence.spacesById',
1710417114
'confluence.pages',
17115+
'eloqua.campaigns',
17116+
'eloqua.contactLists',
17117+
'eloqua.emails',
17118+
'eloqua.forms',
17119+
'eloqua.segments',
1710517120
'google.tasks.lists',
1710617121
'gmail.labels',
1710717122
'google.calendar',
@@ -19192,6 +19207,11 @@ export const V2_OPERATIONS = {
1919219207
'confluence.spaces',
1919319208
'confluence.spacesById',
1919419209
'confluence.pages',
19210+
'eloqua.campaigns',
19211+
'eloqua.contactLists',
19212+
'eloqua.emails',
19213+
'eloqua.forms',
19214+
'eloqua.segments',
1919519215
'google.tasks.lists',
1919619216
'gmail.labels',
1919719217
'google.calendar',

0 commit comments

Comments
 (0)