-
Notifications
You must be signed in to change notification settings - Fork 85
feat: ODP REST API for Sending ODP Events #786
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
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
3cb9ec6
Add ODP event, send event, & refactors
mikechu-optimizely 5d6144d
WIP testing sendOdpEvents
mikechu-optimizely 2890a0d
Unit tests + code ODP Client edits
mikechu-optimizely a3463b9
Refactor apiHost to apiEndpoint
mikechu-optimizely 9eba320
WIP code review changes
mikechu-optimizely e34e842
Separate/refactor send events and query segments unit tests
mikechu-optimizely 5d5f643
Code review requested changes
mikechu-optimizely c18637e
Code review resolutions
mikechu-optimizely fed5e9b
Validation refactoring per code review
mikechu-optimizely f40bd80
Replace execution context
mikechu-optimizely bbd1685
Ready OdpEvent for EventManager
mikechu-optimizely ec25064
Remove parameter wraps
mikechu-optimizely 6eb4f18
Update OdpResponseSchema jsdoc
mikechu-optimizely 5134c6e
Correct GraphQL vs REST managers
mikechu-optimizely e305858
Update unit tests + refactors
mikechu-optimizely 1a44aa7
Bug fix GraphQL-ifying query parameters
mikechu-optimizely 0ad9447
Change return on REST API Manager sendEvents()
mikechu-optimizely e9b2f38
WIP REST API Manager's test skeleton
mikechu-optimizely d5e5ec1
Refactor GQLMgr's name
mikechu-optimizely b480af4
Unit tests for REST API Manager
mikechu-optimizely d170d3d
Fix name of REST API class
mikechu-optimizely 182bf29
Update packages/optimizely-sdk/lib/plugins/odp/odp_client.ts
mikechu-optimizely 97b9f05
Update packages/optimizely-sdk/lib/plugins/odp/odp_client.ts
mikechu-optimizely 768aea1
Revert "Replace execution context"
mikechu-optimizely afae4ce
Apply only needed ODP_USER_KEY & ODP_CONFIG_STATE
mikechu-optimizely 33114a0
Code review changes
mikechu-optimizely 829c6de
Moved OdpClient logic up to GraphQLManager and...
mikechu-optimizely a9273fa
Update packages/optimizely-sdk/lib/plugins/odp/graphql_manager.ts
mikechu-optimizely 21a969c
More code review changes
mikechu-optimizely 9b3a620
Merge remote-tracking branch 'origin/mike/odp-rest-api-interface' int…
mikechu-optimizely 192b90b
Fixes after forgetting to pull first
mikechu-optimizely 52f3bd9
Merge branch 'master' into mike/odp-rest-api-interface
mikechu-optimizely 220bed5
Refactor constructors
mikechu-optimizely 7bfd1ca
More code review changes
mikechu-optimizely be1767d
Formatting & whitespace edits
mikechu-optimizely 740ae16
Merge branch 'master' into mike/odp-rest-api-interface
mikechu-optimizely ef9df47
Final clean up of execution context
mikechu-optimizely 6552e7f
Code review changes
mikechu-optimizely File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /** | ||
| * Copyright 2022, Optimizely | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| export class OdpEvent { | ||
| /** | ||
| * Type of event (typically "fullstack") | ||
| */ | ||
| public type: string; | ||
|
|
||
| /** | ||
| * Subcategory of the event type | ||
| */ | ||
| public action: string; | ||
|
|
||
| /** | ||
| * Key-value map of user identifiers | ||
| */ | ||
| public identifiers: Map<string, string>; | ||
|
|
||
| /** | ||
| * Event data in a key-value map | ||
| */ | ||
| public data: Map<string, unknown>; | ||
|
|
||
| /** | ||
| * Event to be sent and stored in the Optimizely Data Platform | ||
| * @param type Type of event (typically "fullstack") | ||
| * @param action Subcategory of the event type | ||
| * @param identifiers Key-value map of user identifiers | ||
| * @param data Event data in a key-value map. | ||
| */ | ||
| constructor(type: string, action: string, identifiers?: Map<string, string>, data?: Map<string, unknown>) { | ||
| this.type = type; | ||
| this.action = action; | ||
| this.identifiers = identifiers ?? new Map<string, string>(); | ||
| this.data = data ?? new Map<string, unknown>(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.