Commit f913711
STRATCONN-6541 [Appcues] server side integration (#3581)
* Add Appcues (Actions) server-side destination
Create new Appcues destination with single 'send' action that supports:
- Track events (with event_name, properties)
- Identify calls (with user_traits)
- Group calls (with groupId, group_traits)
The action can send up to 3 requests per Segment event based on populated fields.
Supports both US and EU regional endpoints.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Refactor Appcues destination with code organization improvements
- Move types to types.ts and functions to functions.ts
- Rename event_name field to event for consistency
- Use spread operator syntax instead of conditional assignments
- Add context, integrations, timestamp, and messageId fields
- Add conditional default mapping for user_traits (context.traits first, then traits)
- Remove default mapping for group_traits
- Update tests to cover new fields and conditional mappings
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Refactor Appcues send action to separate concerns
- Move field definitions to send/fields.ts
- Move perform function logic to functions.ts as performSend()
- Simplify send/index.ts to only contain action configuration
This improves code organization and makes the action easier to maintain.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Move types and functions into send action folder
- Move types.ts and functions.ts into send/ folder (action-specific)
- Create separate types for track, identify, and group requests
- Replace 'any' with 'unknown' for better type safety
- BaseAppcuesRequest shared fields across all request types
- AppcuesTrackRequest, AppcuesIdentifyRequest, AppcuesGroupRequest
for specific request types
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Refine types and naming conventions
- Make AppcuesIdentifyRequest traits optional
- Rename performSend to send for clarity
- Change fields type from ActionDefinition['fields'] to Record<string, InputField>
- Remove unused imports in fields.ts
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Hide endpoint URLs behind region selection
- Create constants.ts with REGION_ENDPOINTS mapping
- Change authentication field from 'endpoint' to 'region'
- Store only region identifiers ('US', 'EU') in settings
- Map region to actual URL at runtime in send function
- Add validation for invalid regions
- Update all tests to use region instead of full URLs
- Add test for invalid region error handling
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Add event type field with conditional requirements
- Add required 'type' field with choices: track, page, screen, identify, group
- Add 'name' field that only displays for page/screen events
- Make 'event' required when type is 'track'
- Make 'groupId' required when type is 'group'
- Add AppcuesPageRequest and AppcuesScreenRequest types
- Update send function to build appropriate request based on type
- Always send identify call if user_traits is populated (for non-identify events)
- Always send group call if groupId and group_traits are populated (for non-group events)
- Add comprehensive tests for all event types and combinations
- Add error handling for missing required fields and invalid types
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Make required attribute conditional for event and groupId fields
- Change event field required from boolean to conditional object
- Change groupId field required from boolean to conditional object
- Both now use same conditions as depends_on for consistency
- event is required only when type is 'track'
- groupId is required only when type is 'group'
- Keeps depends_on rules for field visibility unchanged
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Make properties field visible only for track, page, and screen events
- Add depends_on rule to properties field
- Field now only displays when type is track, page, or screen
- Hidden for identify and group event types
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Make groupId optional for group events
- Remove required attribute from groupId field
- Update send function to skip group request if groupId is not provided
- Update test to verify no request is sent when groupId is missing
- Keep depends_on rule for field visibility (only shows for type = group)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Make user_traits field visible only for track, page, screen, and identify events
- Add depends_on rule to user_traits field
- Field now only displays when type is track, page, screen, or identify
- Hidden for group event type
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Refactor send function to reduce redundancy
- Replace switch statement with if/else if chain for better readability
- Make additional event logic more explicit with clear comments
- Use array.includes() for track/page/screen check
- Clarify event sending rules:
- Primary event always sent based on type
- Additional identify sent for track, page, screen if user_traits present
- Additional group sent for non-group types if groupId and group_traits present
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Merge redundant identify and group conditions
- Merge identify logic: single condition handles both identify type and track/page/screen with user_traits
- Merge group logic: single condition handles both group type and other types with groupId and group_traits
- Replace if/else if chain with independent if statements for each event type
- Move invalid type validation to end after all event processing
- Reduces code duplication and makes logic flow clearer
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Update group event logic to match identify pattern
- Group events now sent for type === 'group' OR track/page/screen with groupId
- Remove depends_on visibility restriction from groupId field (always visible)
- group_traits already has no visibility restriction (always visible)
- Group call includes optional group_traits when present
- Mirrors identify logic: track/page/screen can trigger both identify and group
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Remove comments and update error handling
- Remove all code comments
- Add back event name validation for track events
- Use PayloadValidationError for all validation errors
- Remove invalid type validation (handled by field choices)
- Keep endpoint validation with PayloadValidationError
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Condense nested group condition into single statement
- Combine nested if statements into single condition
- Check groupId && (type === 'group' || type in track/page/screen)
- Removes redundant inner groupId check
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Add presets for all 5 event types
- Create presets.ts with 5 presets: Track, Page, Screen, Identify, Group
- Each preset subscribes to its corresponding event type
- All presets use defaultValues from send action fields
- Group preset includes custom mapping for group_traits to $.traits
- Import and register presets in destination index.ts
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Simplify integrations field description
- Update description from "Integrations object to control which destinations receive this event" to "Integrations object"
- Update both fields.ts and generated-types.ts
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Fix unit tests to match current implementation
- Remove invalid event type test (validation removed from code)
- Simplify groupId test to not expect error (groupId now optional)
- Remove duplicate test cases
- Update test names for clarity
- All 12 tests now match current send function behavior
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Code complete
* remobing registration
---------
Co-authored-by: Claude Opus 4.6 <[email protected]>1 parent 592a698 commit f913711
11 files changed
Lines changed: 998 additions & 0 deletions
File tree
- packages/destination-actions/src/destinations/appcues
- __tests__
- send
- __tests__
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments