├── .editorconfig ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── build.yml │ └── npm-publish.yml ├── .gitignore ├── .prettierignore ├── .prettierrc.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── codegeneration ├── DateTime.ts ├── OneOf.ts ├── config.json ├── openapitools.json ├── package-lock.json ├── package.json ├── postgen.js ├── rollup.config.js └── template │ ├── README.mustache │ ├── apis.index.mustache │ ├── apis.mustache │ ├── gitignore │ ├── index.mustache │ ├── licenseInfo.mustache │ ├── modelEnum.mustache │ ├── modelGeneric.mustache │ ├── modelOneOf.mustache │ ├── models.index.mustache │ ├── models.mustache │ ├── npmignore.mustache │ ├── package.mustache │ ├── runtime.mustache │ └── tsconfig.mustache ├── lerna.json ├── openapi ├── .github │ ├── CONTRIBUTING.md │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── common │ └── components │ │ ├── ABTOrder.yaml │ │ ├── AuthenticatedState.yaml │ │ ├── CustomerId.yaml │ │ ├── Order.yaml │ │ ├── Parameters.yaml │ │ ├── Preview.yaml │ │ ├── Product.yaml │ │ ├── QAMode.yaml │ │ ├── QAModePreviewIndex.yaml │ │ ├── ResponseTokens.yaml │ │ ├── UnexpectedError.yaml │ │ └── VisitorId.yaml └── delivery │ ├── api.yaml │ ├── components │ ├── Address.yaml │ ├── AnalyticsPayload.yaml │ ├── AnalyticsRequest.yaml │ ├── AnalyticsResponse.yaml │ ├── Application.yaml │ ├── AudienceManager.yaml │ ├── Browser.yaml │ ├── ChannelType.yaml │ ├── ClientHints.yaml │ ├── Context.yaml │ ├── DecisioningMethod.yaml │ ├── DeliveryRequest.yaml │ ├── DeliveryResponse.yaml │ ├── DeviceType.yaml │ ├── ExecuteRequest.yaml │ ├── ExecuteResponse.yaml │ ├── ExecutionMode.yaml │ ├── ExperienceCloud.yaml │ ├── Geo.yaml │ ├── LoggingType.yaml │ ├── MboxRequest.yaml │ ├── MboxResponse.yaml │ ├── Metric.yaml │ ├── MetricType.yaml │ ├── MobilePlatform.yaml │ ├── MobilePlatformType.yaml │ ├── Notification.yaml │ ├── NotificationMbox.yaml │ ├── NotificationPageLoad.yaml │ ├── NotificationResponse.yaml │ ├── NotificationView.yaml │ ├── Option.yaml │ ├── OptionType.yaml │ ├── PageLoadResponse.yaml │ ├── PrefetchMboxResponse.yaml │ ├── PrefetchRequest.yaml │ ├── PrefetchResponse.yaml │ ├── Property.yaml │ ├── RequestDetails.yaml │ ├── Screen.yaml │ ├── ScreenOrientationType.yaml │ ├── Telemetry.yaml │ ├── TelemetryEntry.yaml │ ├── TelemetryFeatures.yaml │ ├── TelemetryRequest.yaml │ ├── Trace.yaml │ ├── TraceResponse.yaml │ ├── View.yaml │ ├── ViewRequest.yaml │ └── Window.yaml │ ├── examples │ ├── notificationsForDisplayedContent.json │ ├── responseForPrefetchViewsForMobileChannel.json │ └── responseForPrefetchViewsForWebChannel.json │ └── markdown │ └── api-description.md ├── package-lock.json ├── package.json ├── packages ├── target-decisioning-engine │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .npmignore │ ├── LICENSE_BANNER.txt │ ├── README.md │ ├── babel.config.js │ ├── jest.config.js │ ├── jest.polyfills.js │ ├── package-lock.json │ ├── package.json │ ├── rollup.config.js │ ├── src │ │ ├── allocationProvider.js │ │ ├── allocationProvider.spec.js │ │ ├── artifactProvider.js │ │ ├── artifactProvider.spec.js │ │ ├── constants.js │ │ ├── contextProvider.js │ │ ├── contextProvider.spec.js │ │ ├── decisionProvider.js │ │ ├── enums.js │ │ ├── events.js │ │ ├── filters.js │ │ ├── geoProvider.js │ │ ├── geoProvider.spec.js │ │ ├── index.js │ │ ├── index.spec.js │ │ ├── messages.js │ │ ├── notificationProvider.js │ │ ├── notificationProvider.spec.js │ │ ├── obfuscationProvider.js │ │ ├── obfuscationProvider.spec.js │ │ ├── postProcessors.js │ │ ├── requestProvider.js │ │ ├── requestProvider.spec.js │ │ ├── ruleEvaluator.js │ │ ├── timings.js │ │ ├── traceProvider.js │ │ ├── utils.js │ │ └── utils.spec.js │ ├── test │ │ ├── artifact │ │ │ ├── rules.bin │ │ │ └── rules.json │ │ ├── decisioning.spec.js │ │ ├── decisions.scratch.spec.js │ │ ├── schema │ │ │ ├── artifact.json │ │ │ ├── artifacts │ │ │ │ ├── TEST_ARTIFACT_AB_MULTI_SIMPLE.json │ │ │ │ ├── TEST_ARTIFACT_AB_SIMPLE.json │ │ │ │ ├── TEST_ARTIFACT_ADDRESS.json │ │ │ │ ├── TEST_ARTIFACT_ATJS.json │ │ │ │ ├── TEST_ARTIFACT_BLANK.json │ │ │ │ ├── TEST_ARTIFACT_BROWSER.json │ │ │ │ ├── TEST_ARTIFACT_CAMPAIGN_MACROS.json │ │ │ │ ├── TEST_ARTIFACT_FEATURE_FLAG.json │ │ │ │ ├── TEST_ARTIFACT_GEO.json │ │ │ │ ├── TEST_ARTIFACT_GLOBAL_MBOX.json │ │ │ │ ├── TEST_ARTIFACT_PAGELOAD_VEC_AB.json │ │ │ │ ├── TEST_ARTIFACT_PAGELOAD_VEC_XT.json │ │ │ │ ├── TEST_ARTIFACT_PARAMS.json │ │ │ │ ├── TEST_ARTIFACT_PRIORITIES.json │ │ │ │ ├── TEST_ARTIFACT_PROPERTIES.json │ │ │ │ ├── TEST_ARTIFACT_TIMEFRAME.json │ │ │ │ ├── TEST_ARTIFACT_UNSUPPORTED.json │ │ │ │ └── TEST_ARTIFACT_VIEWS.json │ │ │ └── models │ │ │ │ ├── TEST_SUITE_AB_SIMPLE.json │ │ │ │ ├── TEST_SUITE_ADDRESS.json │ │ │ │ ├── TEST_SUITE_BROWSER.json │ │ │ │ ├── TEST_SUITE_GEO.json │ │ │ │ ├── TEST_SUITE_MACROS.json │ │ │ │ ├── TEST_SUITE_MULTIPLE.json │ │ │ │ ├── TEST_SUITE_NOTIFICATIONS.json │ │ │ │ ├── TEST_SUITE_PAGELOAD.json │ │ │ │ ├── TEST_SUITE_PAGELOAD_VEC_AB.json │ │ │ │ ├── TEST_SUITE_PAGELOAD_VEC_XT.json │ │ │ │ ├── TEST_SUITE_PARAMS.json │ │ │ │ ├── TEST_SUITE_PRIORITY.json │ │ │ │ ├── TEST_SUITE_PROPERTIES.json │ │ │ │ ├── TEST_SUITE_RESPONSE_TOKENS.json │ │ │ │ ├── TEST_SUITE_TELEMETRY.json │ │ │ │ ├── TEST_SUITE_TIMEFRAME.json │ │ │ │ ├── TEST_SUITE_TRACE.json │ │ │ │ └── TEST_SUITE_VIEWS.json │ │ ├── test.utils.js │ │ └── test.utils.spec.js │ └── types │ │ ├── DecisioningArtifact.d.ts │ │ ├── DecisioningConfig.d.ts │ │ ├── DecisioningContext.d.ts │ │ └── TargetDeliveryRequest.d.ts ├── target-nodejs-sdk │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .npmignore │ ├── LICENSE_BANNER.txt │ ├── babel.config.js │ ├── demo │ │ ├── .gitignore │ │ ├── assets │ │ │ ├── AppMeasurement.js │ │ │ ├── VisitorAPI.js │ │ │ ├── script.js │ │ │ └── style.css │ │ ├── demo.js │ │ ├── index.html │ │ ├── package-lock.json │ │ └── package.json │ ├── jest.config.js │ ├── jest.polyfills.js │ ├── package-lock.json │ ├── package.json │ ├── packfiles.txt │ ├── rollup.config.js │ ├── sample │ │ ├── config.json │ │ ├── public │ │ │ ├── AppMeasurement.js │ │ │ ├── VisitorAPI.js │ │ │ └── at.js │ │ ├── server.js │ │ └── templates │ │ │ └── index.tpl │ ├── src │ │ ├── cookies.js │ │ ├── events.js │ │ ├── helper.js │ │ ├── index.browser.js │ │ ├── index.js │ │ ├── index.server.js │ │ ├── messages.js │ │ ├── target.js │ │ ├── utils.js │ │ └── validators.js │ ├── test │ │ ├── attributes.spec.js │ │ ├── cookies.spec.js │ │ ├── decisioning.spec.js │ │ ├── execution.spec.js │ │ ├── helper.spec.js │ │ ├── index.spec.js │ │ ├── mockTelemetryProvider.js │ │ ├── proxy.spec.js │ │ ├── request.spec.js │ │ ├── scratch.spec.js │ │ ├── target.spec.js │ │ └── telemetry.spec.js │ └── types │ │ └── SDKResponse.d.ts └── target-tools │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .npmignore │ ├── LICENSE_BANNER.txt │ ├── README.md │ ├── babel.config.js │ ├── delivery-api-client │ ├── apis │ │ ├── DeliveryApi.d.ts │ │ └── index.d.ts │ ├── index.d.ts │ ├── index.js │ ├── models │ │ ├── Action.d.ts │ │ ├── Address.d.ts │ │ ├── AnalyticsPayload.d.ts │ │ ├── AnalyticsRequest.d.ts │ │ ├── AnalyticsResponse.d.ts │ │ ├── Application.d.ts │ │ ├── AudienceManager.d.ts │ │ ├── AuthenticatedState.d.ts │ │ ├── Browser.d.ts │ │ ├── ChannelType.d.ts │ │ ├── ClientHints.d.ts │ │ ├── Context.d.ts │ │ ├── CustomerId.d.ts │ │ ├── DateTime.d.ts │ │ ├── DecisioningMethod.d.ts │ │ ├── DeliveryRequest.d.ts │ │ ├── DeliveryResponse.d.ts │ │ ├── DeviceType.d.ts │ │ ├── ExecuteRequest.d.ts │ │ ├── ExecuteResponse.d.ts │ │ ├── ExecutionMode.d.ts │ │ ├── ExperienceCloud.d.ts │ │ ├── Geo.d.ts │ │ ├── LoggingType.d.ts │ │ ├── MboxRequest.d.ts │ │ ├── MboxRequestAllOf.d.ts │ │ ├── MboxResponse.d.ts │ │ ├── Metric.d.ts │ │ ├── MetricType.d.ts │ │ ├── MobilePlatform.d.ts │ │ ├── MobilePlatformType.d.ts │ │ ├── Notification.d.ts │ │ ├── NotificationAllOf.d.ts │ │ ├── NotificationMbox.d.ts │ │ ├── NotificationPageLoad.d.ts │ │ ├── NotificationResponse.d.ts │ │ ├── NotificationView.d.ts │ │ ├── OneOf.d.ts │ │ ├── Option.d.ts │ │ ├── OptionType.d.ts │ │ ├── Order.d.ts │ │ ├── PageLoadResponse.d.ts │ │ ├── PrefetchMboxResponse.d.ts │ │ ├── PrefetchMboxResponseAllOf.d.ts │ │ ├── PrefetchRequest.d.ts │ │ ├── PrefetchResponse.d.ts │ │ ├── Preview.d.ts │ │ ├── Product.d.ts │ │ ├── Property.d.ts │ │ ├── QAMode.d.ts │ │ ├── QAModePreviewIndex.d.ts │ │ ├── RequestDetails.d.ts │ │ ├── Screen.d.ts │ │ ├── ScreenOrientationType.d.ts │ │ ├── Telemetry.d.ts │ │ ├── TelemetryEntry.d.ts │ │ ├── TelemetryFeatures.d.ts │ │ ├── TelemetryRequest.d.ts │ │ ├── Trace.d.ts │ │ ├── UnexpectedError.d.ts │ │ ├── View.d.ts │ │ ├── ViewRequest.d.ts │ │ ├── ViewRequestAllOf.d.ts │ │ ├── VisitorId.d.ts │ │ ├── Window.d.ts │ │ └── index.d.ts │ └── runtime.d.ts │ ├── jest.config.js │ ├── package-lock.json │ ├── package.json │ ├── rollup.config.js │ ├── src │ ├── InMemoryTelemetryStore.js │ ├── attributesProvider.js │ ├── attributesProvider.spec.js │ ├── clientInfo.js │ ├── clientInfo.spec.js │ ├── constants.js │ ├── enums.js │ ├── eventProvider.js │ ├── eventProvider.spec.js │ ├── fetchWithTelemetry.js │ ├── fetchWithTelemetry.spec.js │ ├── hashing.js │ ├── hashing.spec.js │ ├── index.browser.js │ ├── index.js │ ├── lodash │ │ ├── index.js │ │ └── internal │ │ │ ├── _arrayEach.js │ │ │ ├── _arrayMap.js │ │ │ ├── _baseEach.js │ │ │ ├── _baseGetTag.js │ │ │ ├── _castFunction.js │ │ │ ├── assign.js │ │ │ ├── assign.spec.js │ │ │ ├── delay.js │ │ │ ├── filter.js │ │ │ ├── filter.spec.js │ │ │ ├── first.js │ │ │ ├── first.spec.js │ │ │ ├── flatten.js │ │ │ ├── flatten.spec.js │ │ │ ├── flow.js │ │ │ ├── flow.spec.js │ │ │ ├── forEach.js │ │ │ ├── forEach.spec.js │ │ │ ├── hash.js │ │ │ ├── hash.spec.js │ │ │ ├── identity.js │ │ │ ├── includes.js │ │ │ ├── includes.spec.js │ │ │ ├── isArray.js │ │ │ ├── isArray.spec.js │ │ │ ├── isArrayLike.js │ │ │ ├── isBlank.js │ │ │ ├── isBlank.spec.js │ │ │ ├── isEmpty.js │ │ │ ├── isEmpty.spec.js │ │ │ ├── isFunction.js │ │ │ ├── isFunction.spec.js │ │ │ ├── isLength.js │ │ │ ├── isNil.js │ │ │ ├── isNil.spec.js │ │ │ ├── isNotBlank.js │ │ │ ├── isNotBlank.spec.js │ │ │ ├── isNumber.js │ │ │ ├── isNumber.spec.js │ │ │ ├── isObject.js │ │ │ ├── isObject.spec.js │ │ │ ├── isObjectLike.js │ │ │ ├── isPlainObject.js │ │ │ ├── isString.js │ │ │ ├── isString.spec.js │ │ │ ├── join.js │ │ │ ├── join.spec.js │ │ │ ├── keys.js │ │ │ ├── keys.spec.js │ │ │ ├── map.js │ │ │ ├── map.spec.js │ │ │ ├── now.js │ │ │ ├── reduce.js │ │ │ ├── reduce.spec.js │ │ │ ├── reverse.js │ │ │ ├── reverse.spec.js │ │ │ ├── split.js │ │ │ ├── split.spec.js │ │ │ ├── toArray.js │ │ │ ├── toArray.spec.js │ │ │ ├── trim.js │ │ │ ├── trim.spec.js │ │ │ ├── values.js │ │ │ └── values.spec.js │ ├── logging.js │ ├── logging.spec.js │ ├── memoize.spec.js │ ├── messages.js │ ├── networking.js │ ├── networking.spec.js │ ├── parsing.js │ ├── perftool.js │ ├── perftool.spec.js │ ├── telemetryProvider.js │ ├── telemetryProvider.spec.js │ ├── utils.js │ ├── utils.spec.js │ ├── uuid.spec.js │ └── uuid │ │ ├── index.browser.js │ │ ├── index.js │ │ ├── rng.browser.js │ │ ├── rng.js │ │ ├── stringify.js │ │ └── v4.js │ └── types │ ├── FetchHeaders.d.ts │ └── FetchResponse.d.ts └── tools ├── artifact.json ├── mapCoverage.js ├── npm-publish.js └── updateTestSchema.sh /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ### Expected Behaviour 5 | 6 | ### Actual Behaviour 7 | 8 | ### Reproduce Scenario (including but not limited to) 9 | 10 | #### Steps to Reproduce 11 | 12 | #### Platform and Version 13 | 14 | #### Sample Code that illustrates the problem 15 | 16 | #### Logs taken while reproducing problem 17 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | jobs: 10 | build: 11 | name: Build 12 | runs-on: ubuntu-latest 13 | 14 | strategy: 15 | matrix: 16 | node-version: [14.x, 16.x, 18.x] 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Use Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@master 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | - name: build, test, generate coverage 24 | run: | 25 | npm ci 26 | npm run build 27 | npm run test 28 | env: 29 | CI: true 30 | - name: coveralls 31 | uses: coverallsapp/github-action@master 32 | with: 33 | github-token: ${{ secrets.GITHUB_TOKEN }} 34 | flag-name: Node.js-${{ matrix.node-version }} 35 | parallel: true 36 | 37 | coverage: 38 | needs: build 39 | runs-on: ubuntu-latest 40 | steps: 41 | - name: coveralls report 42 | uses: coverallsapp/github-action@master 43 | with: 44 | github-token: ${{ secrets.GITHUB_TOKEN }} 45 | parallel-finished: true 46 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | name: npm-publish 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | semverBump: 6 | description: "Bump which semver version number? (major, minor, patch)" 7 | required: true 8 | default: "patch" 9 | 10 | jobs: 11 | npm-publish: 12 | name: npm-publish 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@master 17 | with: 18 | fetch-depth: 0 19 | token: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }} 20 | 21 | - name: Configure git user for release commits 22 | run: | 23 | git config user.email "Grp-opensourceoffice@adobe.com" 24 | git config user.name "Adobe Release Bot" 25 | - name: Set up Node.js 26 | uses: actions/setup-node@master 27 | with: 28 | node-version: 14 29 | registry-url: "https://registry.npmjs.org" 30 | 31 | - name: Publish to registry.npmjs.org 32 | run: | 33 | npm ci 34 | npm run publish ${{ github.event.inputs.semverBump }} 35 | env: 36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 | GH_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }} 38 | NODE_AUTH_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} 39 | NPM_AUTH_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} 40 | NPM_AUTH: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} 41 | NPM_REGISTRY: registry.npmjs.org 42 | CI: true 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode 3 | .nyc_output 4 | bower_components 5 | build 6 | coverage 7 | checkstyle 8 | lib 9 | dist 10 | node_modules 11 | npm-debug.log 12 | .DS_Store 13 | *.iml 14 | *.map 15 | *.tgz 16 | bundlesize-stats*.html 17 | .npmrc 18 | codegeneration/node_modules 19 | codegeneration/build 20 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .git 3 | node_modules 4 | lib 5 | coverage 6 | dist 7 | sample 8 | VisitorAPI.js 9 | AppMeasurement.js 10 | package-lock.json 11 | public 12 | delivery-api-client 13 | schema 14 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "quoteProps": "consistent", 3 | "arrowParens": "avoid", 4 | "trailingComma": "none" 5 | } 6 | -------------------------------------------------------------------------------- /codegeneration/DateTime.ts: -------------------------------------------------------------------------------- 1 | export type DateTime = Date; 2 | 3 | export function DateTimeFromJSON(value: any): Date { 4 | return new Date(value); 5 | } 6 | 7 | export function DateTimeFromJSONTyped( 8 | value: any, 9 | ignoreDiscriminator: boolean 10 | ): Date { 11 | return new Date(value); 12 | } 13 | 14 | export function DateTimeToJSON(value?: DateTime | null): any { 15 | return value != null && typeof value !== "undefined" 16 | ? value.toISOString() 17 | : ""; 18 | } 19 | -------------------------------------------------------------------------------- /codegeneration/OneOf.ts: -------------------------------------------------------------------------------- 1 | export type OneOfstringobjectarray = string | object | any[]; 2 | export type OneOfstringobject = string | object; 3 | 4 | export function OneOfstringobjectFromJSON(value: any): OneOfstringobject { 5 | return value; 6 | } 7 | 8 | export function OneOfstringobjectFromJSONTyped( 9 | value: any, 10 | ignoreDiscriminator: boolean 11 | ): OneOfstringobject { 12 | return value; 13 | } 14 | 15 | export function OneOfstringobjectToJSON(value?: OneOfstringobject | null): any { 16 | return value; 17 | } 18 | 19 | export function OneOfstringobjectarrayFromJSON( 20 | value: any 21 | ): OneOfstringobjectarray { 22 | return value; 23 | } 24 | 25 | export function OneOfstringobjectarrayFromJSONTyped( 26 | value: any, 27 | ignoreDiscriminator: boolean 28 | ): OneOfstringobjectarray { 29 | return value; 30 | } 31 | 32 | export function OneOfstringobjectarrayToJSON( 33 | value?: OneOfstringobject | null 34 | ): any { 35 | return value; 36 | } 37 | -------------------------------------------------------------------------------- /codegeneration/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmName": "@adobe/target-delivery-api-client", 3 | "npmVersion": "2.1.8", 4 | "sortParamsByRequiredFlag": true, 5 | "ensureUniqueParams": true, 6 | "allowUnicodeIdentifiers": false, 7 | "prependFormOrBodyParameters": false, 8 | "modelPropertyNaming": "camelCase", 9 | "supportsES6": true, 10 | "typescriptThreePlus": true, 11 | "snapshot": false 12 | } 13 | -------------------------------------------------------------------------------- /codegeneration/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "4.0.1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /codegeneration/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Node.js sdk codegenerator", 3 | "version": "1.0.0", 4 | "description": "Open API code generation helper", 5 | "scripts": { 6 | "precodegen": "shx rm -rf ./build ../packages/target-tools/delivery-api-client && shx mkdir ../packages/target-tools/delivery-api-client && openapi-generator-cli version-manager set 4.0.1", 7 | "generate": "openapi-generator-cli generate --skip-validate-spec -g typescript-fetch -c ./config.json -i ../openapi/delivery/api.yaml -o ./build -t ./template && node ./postgen", 8 | "copy-generated": "shx cp -r ./build/dist/* ../packages/target-tools/delivery-api-client", 9 | "codegen": "npm run generate && npm run copy-generated", 10 | "codegenhelp": "openapi-generator-cli config-help -g typescript-fetch" 11 | }, 12 | "devDependencies": { 13 | "@openapitools/openapi-generator-cli": "^2.3.9", 14 | "shelljs": "^0.8.5", 15 | "shx": "^0.3.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /codegeneration/postgen.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const fs = require("fs"); 3 | 4 | const OUT_PATH = `${process.cwd()}/build`; 5 | 6 | const readAndReplace = function (filePath, func) { 7 | const fileContents = fs.readFileSync(filePath, "utf8"); 8 | 9 | const newFileContents = func(fileContents); 10 | 11 | fs.writeFileSync(filePath, newFileContents, "utf8"); 12 | }; 13 | 14 | const walk = function (dir) { 15 | let results = []; 16 | const list = fs.readdirSync(dir); 17 | list.forEach(function (file) { 18 | file = dir + "/" + file; 19 | const stat = fs.statSync(file); 20 | if (stat && stat.isDirectory()) { 21 | results = results.concat(walk(file)); 22 | } else { 23 | results.push(file); 24 | } 25 | }); 26 | return results; 27 | }; 28 | 29 | const files = walk(OUT_PATH); 30 | 31 | files 32 | .filter(filePath => filePath.endsWith(".ts")) 33 | .forEach(filePath => { 34 | console.log(filePath); 35 | 36 | readAndReplace(filePath, fileContents => { 37 | return fileContents 38 | .replace(/DateFromJSON/g, "DateTimeFromJSON") 39 | .replace(/DateToJSON/g, "DateTimeToJSON"); 40 | }); 41 | }); 42 | 43 | readAndReplace(`${process.cwd()}/build/apis/DeliveryApi.ts`, fileContents => { 44 | return fileContents.replace(/ExecuteRequest/g, "ExecuteDeliveryRequest"); 45 | }); 46 | 47 | shell.cp("rollup.config.js", "build"); 48 | shell.cp("DateTime.ts", "build/models"); 49 | shell.cp("OneOf.ts", "build/models"); 50 | 51 | shell.cd("build"); 52 | 53 | shell.echo("export * from './DateTime';").toEnd("models/index.ts"); 54 | shell.echo("export * from './OneOf';").toEnd("models/index.ts"); 55 | 56 | shell.exec("npm i"); 57 | shell.exec("npm run build"); 58 | -------------------------------------------------------------------------------- /codegeneration/rollup.config.js: -------------------------------------------------------------------------------- 1 | import pkg from "./package.json"; 2 | import typescript from "rollup-plugin-typescript2"; 3 | import resolve from "rollup-plugin-node-resolve"; 4 | import json from "rollup-plugin-json"; 5 | import commonjs from "rollup-plugin-commonjs"; 6 | 7 | export default { 8 | input: "index.ts", 9 | output: { 10 | file: pkg.main, 11 | format: "es", 12 | sourcemap: true 13 | }, 14 | external: [...Object.keys(pkg.dependencies || {})], 15 | plugins: [ 16 | json(), 17 | resolve(), 18 | commonjs(), 19 | typescript({ 20 | typescript: require("typescript") 21 | }) 22 | ] 23 | }; 24 | -------------------------------------------------------------------------------- /codegeneration/template/README.mustache: -------------------------------------------------------------------------------- 1 | ## {{npmName}}@{{npmVersion}} 2 | 3 | This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: 4 | 5 | Environment 6 | * Node.js 7 | * Webpack 8 | * Browserify 9 | 10 | Language level 11 | * ES5 - you must have a Promises/A+ library installed 12 | * ES6 13 | 14 | Module system 15 | * CommonJS 16 | * ES6 module system 17 | 18 | It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) 19 | 20 | ### Building 21 | 22 | To build and compile the typescript sources to javascript use: 23 | ``` 24 | npm install 25 | npm run build 26 | ``` 27 | 28 | ### Publishing 29 | 30 | First build the package then run ```npm publish``` 31 | 32 | ### Consuming 33 | 34 | navigate to the folder of your consuming project and run one of the following commands. 35 | 36 | _published:_ 37 | 38 | ``` 39 | npm install {{npmName}}@{{npmVersion}} --save 40 | ``` 41 | 42 | _unPublished (not recommended):_ 43 | 44 | ``` 45 | npm install PATH_TO_GENERATED_PACKAGE --save 46 | -------------------------------------------------------------------------------- /codegeneration/template/apis.index.mustache: -------------------------------------------------------------------------------- 1 | {{#apiInfo}} 2 | {{#apis}} 3 | {{#operations}} 4 | export * from './{{ classFilename }}'; 5 | {{/operations}} 6 | {{/apis}} 7 | {{/apiInfo}} 8 | -------------------------------------------------------------------------------- /codegeneration/template/gitignore: -------------------------------------------------------------------------------- 1 | wwwroot/*.js 2 | node_modules 3 | typings 4 | dist 5 | -------------------------------------------------------------------------------- /codegeneration/template/index.mustache: -------------------------------------------------------------------------------- 1 | export * from './runtime'; 2 | {{#apiInfo}} 3 | {{#apis.0}} 4 | export * from './apis'; 5 | {{/apis.0}} 6 | {{/apiInfo}} 7 | {{#models.0}} 8 | export * from './models'; 9 | {{/models.0}} 10 | -------------------------------------------------------------------------------- /codegeneration/template/licenseInfo.mustache: -------------------------------------------------------------------------------- 1 | /** 2 | * {{{appName}}} 3 | * {{{appDescription}}} 4 | * 5 | * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} 6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | */ 12 | -------------------------------------------------------------------------------- /codegeneration/template/modelEnum.mustache: -------------------------------------------------------------------------------- 1 | /** 2 | * {{{description}}} 3 | * @export 4 | * @enum {string} 5 | */ 6 | export enum {{classname}} { 7 | {{#allowableValues}} 8 | {{#enumVars}} 9 | {{{name}}} = {{{value}}}{{^-last}},{{/-last}} 10 | {{/enumVars}} 11 | {{/allowableValues}} 12 | } 13 | 14 | export function {{classname}}FromJSON(json: any): {{classname}} { 15 | return {{classname}}FromJSONTyped(json, false); 16 | } 17 | 18 | export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boolean): {{classname}} { 19 | return json as {{classname}}; 20 | } 21 | 22 | export function {{classname}}ToJSON(value?: {{classname}} | null): any { 23 | return value as any; 24 | } 25 | -------------------------------------------------------------------------------- /codegeneration/template/models.index.mustache: -------------------------------------------------------------------------------- 1 | {{#models}} 2 | {{#model}} 3 | export * from './{{{ classFilename }}}'; 4 | {{/model}} 5 | {{/models}} 6 | -------------------------------------------------------------------------------- /codegeneration/template/models.mustache: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | {{>licenseInfo}} 4 | {{#models}} 5 | {{#model}} 6 | {{#isEnum}} 7 | {{>modelEnum}} 8 | {{/isEnum}} 9 | {{^isEnum}} 10 | {{#oneOf}} 11 | {{#-first}} 12 | {{>modelOneOf}} 13 | {{/-first}} 14 | {{/oneOf}} 15 | {{^oneOf}} 16 | {{>modelGeneric}} 17 | {{/oneOf}} 18 | {{/isEnum}} 19 | {{/model}} 20 | {{/models}} 21 | -------------------------------------------------------------------------------- /codegeneration/template/npmignore.mustache: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /codegeneration/template/package.mustache: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{npmName}}", 3 | "version": "{{npmVersion}}", 4 | "description": "OpenAPI client for {{npmName}}", 5 | "author": "OpenAPI-Generator", 6 | "main": "./dist/index.js", 7 | "typings": "./dist/index.d.ts", 8 | "scripts": { 9 | "tsbuild": "tsc", 10 | "build": "rollup -c rollup.config.js", 11 | "prepare": "npm run build" 12 | }, 13 | "devDependencies": { 14 | "@types/node": "^12.12.26", 15 | "typescript": "^{{#typescriptThreePlus}}3.6{{/typescriptThreePlus}}{{^typescriptThreePlus}}2.4{{/typescriptThreePlus}}", 16 | "rollup": "^1.17.0", 17 | "rollup-plugin-json": "^4.0.0", 18 | "rollup-plugin-commonjs": "^10.1.0", 19 | "rollup-plugin-node-resolve": "^5.2.0", 20 | "rollup-plugin-terser": "^5.1.1", 21 | "rollup-plugin-typescript2": "^0.22.0" 22 | }{{#npmRepository}},{{/npmRepository}} 23 | {{#npmRepository}} 24 | "publishConfig": { 25 | "registry": "{{npmRepository}}" 26 | } 27 | {{/npmRepository}} 28 | } 29 | -------------------------------------------------------------------------------- /codegeneration/template/tsconfig.mustache: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "target": "{{#supportsES6}}ESNext{{/supportsES6}}{{^supportsES6}}es5{{/supportsES6}}", 5 | "module": "ESNext", 6 | "noImplicitAny": false, 7 | "suppressImplicitAnyIndexErrors": true, 8 | "allowSyntheticDefaultImports": true, 9 | "moduleResolution": "node", 10 | "removeComments": true, 11 | "sourceMap": true, 12 | "noLib": false, 13 | "strict": true, 14 | "outDir": "dist", 15 | {{^supportsES6}} 16 | "lib": [ 17 | "ESNext", 18 | "dom" 19 | ], 20 | {{/supportsES6}} 21 | "typeRoots": [ 22 | "node_modules/@types" 23 | ] 24 | }, 25 | "exclude": [ 26 | "dist", 27 | "node_modules" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": ["packages/*"], 3 | "command": { 4 | "version": { 5 | "allowBranch": "main" 6 | }, 7 | "publish": { 8 | "allowBranch": "main" 9 | } 10 | }, 11 | "version": "independent" 12 | } 13 | -------------------------------------------------------------------------------- /openapi/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ### Expected Behaviour 5 | 6 | ### Actual Behaviour 7 | 8 | ### Reproduce Scenario (including but not limited to) 9 | 10 | #### Steps to Reproduce 11 | 12 | #### Platform and Version 13 | 14 | #### Sample Code that illustrates the problem 15 | 16 | #### Logs taken while reproducing problem 17 | -------------------------------------------------------------------------------- /openapi/README.md: -------------------------------------------------------------------------------- 1 | # Target OpenAPI 2 | This repository contains OpenAPI 3.0 specifications for Target REST APIs. 3 | 4 | The APIs described here are used by Target SDKs. 5 | 6 | ## Contributing 7 | 8 | Contributions are welcome! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information. 9 | 10 | ## Licensing 11 | 12 | This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information. 13 | -------------------------------------------------------------------------------- /openapi/common/components/ABTOrder.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.2" 2 | ABTOrder: 3 | type: object 4 | description: Object that describes the order details for ABT activities. 5 | properties: 6 | id: 7 | type: string 8 | maxLength: 250 9 | description: Order id. 10 | decisionStackId: 11 | type: integer 12 | description: The decision stack id 13 | total: 14 | type: number 15 | minimum: 0 16 | description: | 17 | Order Total. The amount of money in the current order. 18 | time: 19 | type: string 20 | format: date-time 21 | description: | 22 | Time in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format 23 | productIds: 24 | type: array 25 | description: A list of product ids 26 | items: 27 | type: integer 28 | -------------------------------------------------------------------------------- /openapi/common/components/AuthenticatedState.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | AuthenticatedState: 3 | type: string 4 | enum: ["unknown", "authenticated", "logged_out"] 5 | -------------------------------------------------------------------------------- /openapi/common/components/CustomerId.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | CustomerId: 3 | required: 4 | - id 5 | - integrationCode 6 | - authenticatedState 7 | type: object 8 | properties: 9 | id: 10 | type: string 11 | maxLength: 128 12 | integrationCode: 13 | type: string 14 | maxLength: 50 15 | description: This is the **alias** used when setting up a CRS datasource in the Marketing Cloud UI. 16 | authenticatedState: 17 | $ref: "./AuthenticatedState.yaml#/AuthenticatedState" 18 | -------------------------------------------------------------------------------- /openapi/common/components/Order.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.2" 2 | Order: 3 | type: object 4 | description: Object that describes the order details. 5 | properties: 6 | id: 7 | type: string 8 | maxLength: 250 9 | description: Order Id. 10 | total: 11 | type: number 12 | minimum: 0 13 | description: | 14 | Order Total. The amount of money in the current order. 15 | purchasedProductIds: 16 | type: array 17 | description: | 18 | Order's product ids. 19 | Validation 20 | * No blank values allowed. 21 | * Each product Id max length 50. 22 | * Product ids, separated by commas and concatenated, total length should not exceed 250. 23 | items: 24 | type: string 25 | time: 26 | type: string 27 | format: date-time 28 | description: | 29 | Time in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format 30 | experienceLocalId: 31 | type: integer 32 | minimum: 0 33 | maximum: 2147483647 34 | description: Id used to track the experience across POST/PUT requests 35 | duplicate: 36 | type: boolean 37 | description: Whether or not the order is a duplicate 38 | outlier: 39 | type: boolean 40 | description: Whether or not the order is abnormally different from the rest in volume 41 | -------------------------------------------------------------------------------- /openapi/common/components/Parameters.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Parameters: 3 | type: object 4 | maxProperties: 50 5 | description: | 6 | Parameters map. 7 | Same object is reused for mbox or profile parameters with slight validation differences. 8 | Following names are not allowed for mbox parameters: 'orderId', 'orderTotal', productPurchasedIds' 9 | Validation (for both mbox and profile parameters): 10 | * Max 50 parameters limit. 11 | * Parameter name should not be blank. 12 | * Parameter name max length 128. 13 | * Parameter name should not start with 'profile.' 14 | * Parameter value length max 5000. 15 | additionalProperties: 16 | type: string 17 | description: Name of the property 18 | -------------------------------------------------------------------------------- /openapi/common/components/Preview.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Preview: 3 | type: object 4 | description: | 5 | Use this object to enable the Preview mode in the request. 6 | Use the Preview mode to test the look and feel of your site for various location and offer combinations. 7 | 8 | properties: 9 | token: 10 | type: string 11 | description: | 12 | The token for the Preview mode. 13 | Validation 14 | * Verify that the token belongs to the client provided in request. 15 | -------------------------------------------------------------------------------- /openapi/common/components/Product.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Product: 3 | type: object 4 | description: The properties of the products 5 | properties: 6 | id: 7 | type: string 8 | maxLength: 128 9 | description: Product id. Should not be blank. 10 | categoryId: 11 | type: string 12 | maxLength: 128 13 | description: Category id. Should not be blank. 14 | -------------------------------------------------------------------------------- /openapi/common/components/QAModePreviewIndex.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | QAModePreviewIndex: 3 | type: object 4 | properties: 5 | activityIndex: 6 | type: integer 7 | minimum: 1 8 | description: | 9 | Index references the activity in the activity list (from the encrypted token). 10 | Validation 11 | * If the activity list index is out of boundaries of the activities list in the token or if it is null it will be ignored. 12 | * Activity list index starts with 1. 13 | * Should be at least one activity index, and should reference an activity specified in the token. 14 | experienceIndex: 15 | type: integer 16 | minimum: 1 17 | description: | 18 | When specified, the experience with this index in the activity definition will be selected. 19 | Validation 20 | * Can be null (unspecified) 21 | * If index is not specified or out of bounds, the experience will be selected via activity experience selector strategy. 22 | * Experience index starts with 1. 23 | -------------------------------------------------------------------------------- /openapi/common/components/ResponseTokens.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ResponseTokens: 3 | type: object 4 | description: | 5 | List of the response tokens and their values for the given option. 6 | Response tokens can be defined via the /v1/responsetokens API. 7 | The values for the tokens are computed for every option returned by a activity and represented as a dictionary: 8 | * Key - the response token name. 9 | * Value - the response token value. The value is usually a string, but it can be a list of string in case of 10 | 'category affinity' response token. 11 | additionalProperties: 12 | type: object 13 | properties: 14 | responseTokenName: 15 | type: string 16 | responseTokenValue: 17 | type: object 18 | -------------------------------------------------------------------------------- /openapi/common/components/UnexpectedError.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | UnexpectedError: 3 | type: object 4 | required: 5 | - status 6 | - message 7 | properties: 8 | status: 9 | type: integer 10 | format: int32 11 | description: | 12 | HTTP response codes: 13 | * `400` - Validation error (ex. invalid token) 14 | * `500` - An internal server error during processing 15 | message: 16 | type: string 17 | description: error message 18 | -------------------------------------------------------------------------------- /openapi/common/components/VisitorId.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | VisitorId: 3 | type: object 4 | description: | 5 | Object that contains the identifiers for the visitor. 6 | If no id is provided in the first request, Target will generate a VisitorId with a tntId. The code that runs on the 7 | client side is then responsible for passing this tntId value on all subsequent calls. 8 | 9 | Validation 10 | * Either tntId, thirdPartyId or maketingCloudVisistorId required. 11 | properties: 12 | tntId: 13 | type: string 14 | maxLength: 128 15 | description: | 16 | Tnt id - an unique identifier (UUID). 17 | If no visitor id is provided the TNT id will be generated by the TNT server. 18 | The TNT id retunred by the server may also contain the profile location hint, 19 | with the same format as for other endpoints (standard/ajax/json/..). 20 | Example 32440324234-2343423.23_41, in this example the 23_41 is the profile location hint. 21 | Tnt id retuned in the response (containting the profile location hint) should be used in the subsequent requests 22 | 23 | Validation 24 | * Should not contain a '.' (dot) unless the dot delimits the location hint. 25 | thirdPartyId: 26 | type: string 27 | maxLength: 128 28 | description: | 29 | Third party id 30 | marketingCloudVisitorId: 31 | type: string 32 | maxLength: 128 33 | description: | 34 | Marketing cloud visitor id 35 | customerIds: 36 | type: array 37 | maxItems: 50 38 | description: | 39 | Along with the marketing cloud visitor id, you can associate additional customer ids 40 | 41 | Validation 42 | * No null elements. 43 | items: 44 | $ref: "./CustomerId.yaml#/CustomerId" 45 | -------------------------------------------------------------------------------- /openapi/delivery/components/Address.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Address: 3 | type: object 4 | description: The address object. It indicates the current URL and the referring URL. 5 | properties: 6 | url: 7 | type: string 8 | maxLength: 4096 9 | description: URL 10 | referringUrl: 11 | type: string 12 | maxLength: 4096 13 | description: referral URL 14 | -------------------------------------------------------------------------------- /openapi/delivery/components/AnalyticsPayload.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | AnalyticsPayload: 3 | type: object 4 | description: | 5 | Analytics payload for client side integration that should be sent to Analytics after content has been applied. 6 | properties: 7 | pe: 8 | type: string 9 | description: Indicates to Adobe Analytics that the payload is an Adobe Target type 10 | tnta: 11 | type: string 12 | description: Contains Target metadata that describes the activity and experience 13 | -------------------------------------------------------------------------------- /openapi/delivery/components/AnalyticsRequest.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | AnalyticsRequest: 3 | type: object 4 | description: Integration with Adobe Analytics (A4T) 5 | properties: 6 | supplementalDataId: 7 | type: string 8 | description: | 9 | Supplemental data id, used for **server side** integrations. 10 | Format <16 hexadecimal digits>-<16 hexadecimal digits> 11 | maxLength: 33 12 | minLength: 33 13 | logging: 14 | $ref: "./LoggingType.yaml#/LoggingType" 15 | trackingServer: 16 | type: string 17 | description: tracking server domain (should not include http://) 18 | trackingServerSecure: 19 | type: string 20 | description: secure tracking server domain (should not include https://) 21 | -------------------------------------------------------------------------------- /openapi/delivery/components/AnalyticsResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | AnalyticsResponse: 3 | type: object 4 | description: Contains the analytics payload metadata 5 | properties: 6 | payload: 7 | $ref: "./AnalyticsPayload.yaml#/AnalyticsPayload" 8 | -------------------------------------------------------------------------------- /openapi/delivery/components/Application.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Application: 3 | type: object 4 | description: Application identifiers. If specified, should match the with the one from the activity. 5 | properties: 6 | id: 7 | type: string 8 | maxLength: 250 9 | description: | 10 | Application ID. 11 | If not specified - all activities with any applicationId will be evaluated. 12 | If specified - only activities with the matching applicationId will be evaluated. 13 | name: 14 | type: string 15 | maxLength: 250 16 | description: | 17 | Application name. 18 | If not specified - all activities with any applicationName will be evaluated. 19 | If specified - only activities with specified applicationName will be evaluated. 20 | version: 21 | type: string 22 | maxLength: 128 23 | description: | 24 | Application version 25 | If not specified - all activities with any applicationVersion will not be evaluated. 26 | If specified - only activities with specific applicationVersion will be evaluated. 27 | -------------------------------------------------------------------------------- /openapi/delivery/components/AudienceManager.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | AudienceManager: 3 | type: object 4 | description: Audience Manager Integration (AAM). 5 | properties: 6 | locationHint: 7 | type: integer 8 | minimum: 1 9 | description: | 10 | DCS location hint. 11 | Used to determine which AAM DCS Endpoint to hit in order to retrieve the profile. 12 | blob: 13 | type: string 14 | minLength: 1 15 | maxLength: 1024 16 | description: | 17 | AAM Blob. Used to send additional data to AAM. 18 | Validation 19 | * Cannot be blank. 20 | -------------------------------------------------------------------------------- /openapi/delivery/components/Browser.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Browser: 3 | type: object 4 | description: Browser object may be specified only when the Channel is Web. 5 | properties: 6 | host: 7 | type: string 8 | description: Current web page host 9 | language: 10 | type: string 11 | description: Language in Accept-Language header format, see RFC 7231 sec. 5.3.5 12 | webGLRenderer: 13 | type: string 14 | description: | 15 | This is an optional field, added to help with device detection using device atlas 16 | -------------------------------------------------------------------------------- /openapi/delivery/components/ChannelType.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ChannelType: 3 | type: string 4 | description: | 5 | Specifies the channel for the request. Only activities with the matching channel will be evaluated. 6 | enum: ["mobile", "web"] 7 | 8 | -------------------------------------------------------------------------------- /openapi/delivery/components/ClientHints.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ClientHints: 3 | type: object 4 | description: | 5 | Client hints data. Used in place of userAgent if provided. 6 | properties: 7 | mobile: 8 | type: boolean 9 | description: Sec-CH-UA-Mobile (low entropy) 10 | model: 11 | type: string 12 | description: Sec-CH-UA-Model 13 | platform: 14 | type: string 15 | description: Sec-CH-UA-Platform (low entropy) 16 | platformVersion: 17 | type: string 18 | description: Sec-CH-UA-Platform-Version 19 | browserUAWithMajorVersion: 20 | type: string 21 | description: Sec-CH-UA (low entropy) 22 | browserUAWithFullVersion: 23 | type: string 24 | description: Sec-CH-UA-Full-Version-List 25 | architecture: 26 | type: string 27 | description: Sec-CH-UA-Arch 28 | bitness: 29 | type: string 30 | description: Sec-CH-UA-Bitness 31 | -------------------------------------------------------------------------------- /openapi/delivery/components/Context.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Context: 3 | type: object 4 | required: 5 | - channel 6 | description: Specifies the context for the request, IE if it a web request then is should include user agent etc. 7 | properties: 8 | channel: 9 | $ref: "./ChannelType.yaml#/ChannelType" 10 | mobilePlatform: 11 | $ref: "./MobilePlatform.yaml#/MobilePlatform" 12 | application: 13 | $ref: "./Application.yaml#/Application" 14 | screen: 15 | $ref: "./Screen.yaml#/Screen" 16 | window: 17 | $ref: "./Window.yaml#/Window" 18 | browser: 19 | $ref: "./Browser.yaml#/Browser" 20 | address: 21 | $ref: "./Address.yaml#/Address" 22 | geo: 23 | $ref: "./Geo.yaml#/Geo" 24 | timeOffsetInMinutes: 25 | type: number 26 | description: Specifies minutes from UTC for specific client 27 | format: double 28 | userAgent: 29 | description: User-Agent should be sent only via this property. HTTP header User-Agent is ignored. 30 | type: string 31 | clientHints: 32 | $ref: "./ClientHints.yaml#/ClientHints" 33 | beacon: 34 | type: boolean 35 | default: false 36 | description: | 37 | In case beacon = true is provided in the request, the server will return a 204 No Content response with no response body. 38 | -------------------------------------------------------------------------------- /openapi/delivery/components/DecisioningMethod.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | DecisioningMethod: 3 | x-enum-as-string: true 4 | type: string 5 | enum: ["server-side", "on-device", "hybrid"] 6 | -------------------------------------------------------------------------------- /openapi/delivery/components/DeliveryRequest.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | DeliveryRequest: 3 | type: object 4 | required: 5 | - context 6 | properties: 7 | requestId: 8 | type: string 9 | maxLength: 128 10 | description: | 11 | The request ID that will be returned in the response. In case it is not provided, an UUID is generated and 12 | returned automatically. 13 | impressionId: 14 | description: | 15 | If not present it will be automatically generated (UUID). If present, second and subsequent requests with the 16 | same id will not increment impressions to activities/metrics. Similar to page id. 17 | type: string 18 | maxLength: 128 19 | id: 20 | $ref: "../../common/components/VisitorId.yaml#/VisitorId" 21 | environmentId: 22 | description: Valid client environment id. If not specified host will be determined base on the provided host. 23 | type: integer 24 | format: int64 25 | property: 26 | $ref: "./Property.yaml#/Property" 27 | trace: 28 | $ref: "./Trace.yaml#/Trace" 29 | context: 30 | $ref: "./Context.yaml#/Context" 31 | experienceCloud: 32 | $ref: "./ExperienceCloud.yaml#/ExperienceCloud" 33 | execute: 34 | $ref: "./ExecuteRequest.yaml#/ExecuteRequest" 35 | prefetch: 36 | $ref: "./PrefetchRequest.yaml#/PrefetchRequest" 37 | telemetry: 38 | $ref: "./Telemetry.yaml#/Telemetry" 39 | notifications: 40 | type: array 41 | description: Notifications for the displayed content, clicked selectors, and/or visited views or mboxes. 42 | items: 43 | $ref: "./Notification.yaml#/Notification" 44 | qaMode: 45 | $ref: "../../common/components/QAMode.yaml#/QAMode" 46 | preview: 47 | $ref: "../../common/components/Preview.yaml#/Preview" 48 | -------------------------------------------------------------------------------- /openapi/delivery/components/DeliveryResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | DeliveryResponse: 3 | type: object 4 | description: Delivery response. Returned content will be based upon the request and client's active activities. 5 | properties: 6 | status: 7 | type: integer 8 | requestId: 9 | type: string 10 | description: | 11 | ID of the processed request. 12 | If it's not sent in the request, a random ID (UUID) is generated and returned with the response. 13 | id: 14 | $ref: "../../common/components/VisitorId.yaml#/VisitorId" 15 | client: 16 | type: string 17 | description: Client's code. The one which was sent in the request's path. 18 | edgeHost: 19 | description: Cluster host name that served the response. Ideally, all subsequent requests should be made to that host. 20 | type: string 21 | execute: 22 | $ref: "./ExecuteResponse.yaml#/ExecuteResponse" 23 | prefetch: 24 | $ref: "./PrefetchResponse.yaml#/PrefetchResponse" 25 | notifications: 26 | type: array 27 | items: 28 | $ref: "./NotificationResponse.yaml#/NotificationResponse" 29 | telemetryServerToken: 30 | type: string 31 | description: Encoded data with request telemetry collected from Delivery API 32 | 33 | -------------------------------------------------------------------------------- /openapi/delivery/components/DeviceType.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | DeviceType: 3 | type: string 4 | description: | 5 | Field is mandatory when Mobile Platform is specified. 6 | Only activities that match the specified deviceType or have the device type set to 'null' will be 7 | evaluated. Ex if device type is 'phone' in the delivery request, then only activities that have the device type 8 | equal to 'phone' or set to 'null' will be evaluated. 9 | An activity with 'null' device type will be evaluated for requests for both, 'phone' and 'tablet'. 10 | enum: ["phone", "tablet"] 11 | 12 | -------------------------------------------------------------------------------- /openapi/delivery/components/ExecuteRequest.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ExecuteRequest: 3 | type: object 4 | description: | 5 | The execute part of the request that will be evaluated on the server side immediately. 6 | Impressions will be incremented for the matching activities. 7 | properties: 8 | pageLoad: 9 | $ref: "./RequestDetails.yaml#/RequestDetails" 10 | mboxes: 11 | type: array 12 | description: An array of mboxes other than global mbox. 13 | items: 14 | $ref: "./MboxRequest.yaml#/MboxRequest" 15 | -------------------------------------------------------------------------------- /openapi/delivery/components/ExecuteResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ExecuteResponse: 3 | type: object 4 | description: The object that contains responses from execute `pageLoad` and/or execute regional `mboxes` request. 5 | properties: 6 | pageLoad: 7 | $ref: "./PageLoadResponse.yaml#/PageLoadResponse" 8 | mboxes: 9 | type: array 10 | description: The list of responses for requested regional mboxes. 11 | items: 12 | $ref: "./MboxResponse.yaml#/MboxResponse" 13 | -------------------------------------------------------------------------------- /openapi/delivery/components/ExecutionMode.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ExecutionMode: 3 | type: string 4 | enum: ["edge", "local"] 5 | -------------------------------------------------------------------------------- /openapi/delivery/components/ExperienceCloud.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ExperienceCloud: 3 | type: object 4 | description: Integrations with Audience Manager and Analytics 5 | properties: 6 | audienceManager: 7 | $ref: "./AudienceManager.yaml#/AudienceManager" 8 | analytics: 9 | $ref: "./AnalyticsRequest.yaml#/AnalyticsRequest" 10 | -------------------------------------------------------------------------------- /openapi/delivery/components/LoggingType.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | LoggingType: 3 | type: string 4 | description: | 5 | Indicates whether integraion will be done via client side (from the client) or server side (edge servers) 6 | enum: ["server_side", "client_side"] 7 | 8 | -------------------------------------------------------------------------------- /openapi/delivery/components/MboxRequest.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | MboxRequest: 3 | required: 4 | - index 5 | - mbox 6 | description: Regional mbox request. 7 | allOf: 8 | - $ref: "./RequestDetails.yaml#/RequestDetails" 9 | - type: object 10 | properties: 11 | index: 12 | type: integer 13 | format: int32 14 | description: | 15 | An index for the mboxes to be executed or prefetched. 16 | Mbox index is used for correlation between the mbox request with the mbox response, for either prefetch or 17 | execute responses. Index should be unique in the mbox list. 18 | name: 19 | type: string 20 | description: | 21 | The name of the regional mbox to be evaluated. 22 | -------------------------------------------------------------------------------- /openapi/delivery/components/MboxResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | MboxResponse: 3 | type: object 4 | description: | 5 | Mbox response object. 6 | discriminator: 7 | propertyName: $_type 8 | properties: 9 | $_type: 10 | type: string 11 | index: 12 | type: integer 13 | format: int32 14 | description: | 15 | Indicates that the response is for mbox with the same index, as was specified in the prefetch or execute request. 16 | name: 17 | type: string 18 | description: | 19 | The name of the mbox. Since the same mbox name can be specified multiple times in the request it 20 | should be used in conjunction with the index. 21 | options: 22 | type: array 23 | description: | 24 | The option that was matched for the current mbox. Cannot be an offer with templates or a visual offer. 25 | items: 26 | $ref: "./Option.yaml#/Option" 27 | metrics: 28 | type: array 29 | description: Click metrics. 30 | items: 31 | $ref: "./Metric.yaml#/Metric" 32 | analytics: 33 | $ref: "./AnalyticsResponse.yaml#/AnalyticsResponse" 34 | trace: 35 | $ref: "./TraceResponse.yaml#/TraceResponse" 36 | -------------------------------------------------------------------------------- /openapi/delivery/components/Metric.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Metric: 3 | type: object 4 | properties: 5 | type: 6 | $ref: "./MetricType.yaml#/MetricType" 7 | selector: 8 | type: string 9 | description: The selector 10 | eventToken: 11 | description: The event token that should be sent with the notifications in case the click occurred. 12 | type: string 13 | analytics: 14 | description: Analytics payload for A4T integration 15 | $ref: "./AnalyticsResponse.yaml#/AnalyticsResponse" 16 | -------------------------------------------------------------------------------- /openapi/delivery/components/MetricType.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | MetricType: 3 | type: string 4 | description: Notification type. Currently only click and display are supported. 5 | enum: ["click", "display"] 6 | 7 | -------------------------------------------------------------------------------- /openapi/delivery/components/MobilePlatform.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | MobilePlatform: 3 | type: object 4 | required: 5 | - deviceType 6 | - platformType 7 | description: Mobile Platform should be specified when the channel is Mobile 8 | properties: 9 | deviceName: 10 | description: | 11 | Optional field, added to help with device detection using device atlas. 12 | This is equivalent of a.DeviceName field passed in from Mobile SDK 13 | type: string 14 | deviceType: 15 | $ref: "./DeviceType.yaml#/DeviceType" 16 | platformType: 17 | $ref: "./MobilePlatformType.yaml#/MobilePlatformType" 18 | version: 19 | type: string 20 | maxLength: 128 21 | description: | 22 | If not specified - all activities with any platformVersion will be evaluated. 23 | If specified - only activities with the same platformVersion will be evaluated. 24 | -------------------------------------------------------------------------------- /openapi/delivery/components/MobilePlatformType.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | MobilePlatformType: 3 | type: string 4 | description: Only activities with the specified mobile platform type will be evaluated. 5 | enum: ["android", "ios"] 6 | -------------------------------------------------------------------------------- /openapi/delivery/components/NotificationMbox.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | NotificationMbox: 3 | type: object 4 | properties: 5 | name: 6 | type: string 7 | maxLength: 250 8 | description: | 9 | Mbox name. 10 | Validation 11 | * No blank values allowed. 12 | * A '-clicked' suffix or the following names are not allowed for mbox names: ** display mboxes **, ** any mbox **, ** click from display mbox ** 13 | * Allowed chars: - '-, ./=`:;&!@#$%^&*()+|?~[]{}' 14 | state: 15 | type: string 16 | description: Mbox state token 17 | -------------------------------------------------------------------------------- /openapi/delivery/components/NotificationPageLoad.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | NotificationPageLoad: 3 | type: object 4 | description: Include this object to send display notifications for the prefetch page load contnet. 5 | properties: 6 | state: 7 | type: string 8 | description: Page Load state token 9 | -------------------------------------------------------------------------------- /openapi/delivery/components/NotificationResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | NotificationResponse: 3 | type: object 4 | description: | 5 | Notification response. Contains the result of a processed notification. 6 | properties: 7 | id: 8 | type: string 9 | description: | 10 | Notification id which indicates that the notification was processed successfully. 11 | trace: 12 | $ref: "./TraceResponse.yaml#/TraceResponse" 13 | -------------------------------------------------------------------------------- /openapi/delivery/components/NotificationView.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | NotificationView: 3 | type: object 4 | description: Notification for the displayed view. 5 | properties: 6 | name: 7 | type: string 8 | maxLength: 128 9 | description: | 10 | View Name - Unique view name. If the activity has a metric with a view with this name it will be matched, 11 | providing the Key matches as well or is null and view and metric targeting is matched. 12 | key: 13 | type: string 14 | maxLength: 512 15 | description: | 16 | View Key - An optional encoded String identifier used in advanced scenarios, such as View fingerprinting. 17 | Same matching conditions as for View Name. 18 | state: 19 | type: string 20 | description: View state token. 21 | -------------------------------------------------------------------------------- /openapi/delivery/components/Option.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Option: 3 | type: object 4 | description: The content from the activitiesc is returned via the option objects. 5 | properties: 6 | type: 7 | $ref: "./OptionType.yaml#/OptionType" 8 | content: 9 | description: | 10 | Content that should be applied/displayed/replaced etc, based on the option type. Content can be one of: 11 | * html 12 | * redirect link 13 | * link for a dynamic offer 14 | * raw json 15 | * one or more actions (json - from offers with templates and visual offers) 16 | Actions format is specific for delivery API. 17 | oneOf: 18 | - type: string 19 | - type: object 20 | - type: array 21 | items: 22 | $ref: "#/components/schemas/Action" 23 | eventToken: 24 | description: | 25 | Will be present only in response of a prefetch request. After the content is displayed the event token should be 26 | sent via notifications to the edge server so that visit/visitor/impression events could be logged. 27 | type: string 28 | responseTokens: 29 | $ref: "../../common/components/ResponseTokens.yaml#/ResponseTokens" 30 | 31 | components: 32 | schemas: 33 | Action: 34 | type: object 35 | properties: 36 | type: 37 | type: string 38 | selector: 39 | type: string 40 | cssSelector: 41 | type: string 42 | content: 43 | oneOf: 44 | - type: string 45 | - type: object 46 | -------------------------------------------------------------------------------- /openapi/delivery/components/OptionType.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | OptionType: 3 | type: string 4 | enum: ["html", "json", "redirect", "dynamic", "actions"] -------------------------------------------------------------------------------- /openapi/delivery/components/PageLoadResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | PageLoadResponse: 3 | type: object 4 | description: | 5 | Page load response. Contains the result of prefetching or executing a request that will retrieve content for 6 | all selectors not associated with a particular view. 7 | properties: 8 | options: 9 | type: array 10 | description: | 11 | List of options that should be applied. 12 | Note: options that have been set on selectors assigned to views will not be included here. 13 | items: 14 | $ref: "./Option.yaml#/Option" 15 | metrics: 16 | type: array 17 | description: | 18 | Click track metrics. Note that click metrics for selectors set with views will not be included here. 19 | In case the same activity is serving content for selectors both assinged to a view and selectors without any 20 | views, and having click track metrics that are not assotiated with any view within the activity, then: 21 | * in case of a prefetch only request, these metrics (tokens) will be set in the Prefetch response's metrics. 22 | * in case of an execute only request, the metrics will be set in the page load response's metrics. 23 | * in case of a request, with both, execute and prefetch, metrics will be set in the page load response's 24 | metrics only. 25 | items: 26 | $ref: "./Metric.yaml#/Metric" 27 | analytics: 28 | $ref: "./AnalyticsResponse.yaml#/AnalyticsResponse" 29 | state: 30 | type: string 31 | description: | 32 | View state token that must be sent back with display notification for the view. 33 | May only be present for prefetch requests. 34 | trace: 35 | $ref: "./TraceResponse.yaml#/TraceResponse" 36 | -------------------------------------------------------------------------------- /openapi/delivery/components/PrefetchMboxResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | PrefetchMboxResponse: 3 | allOf: 4 | - $ref: "./MboxResponse.yaml#/MboxResponse" 5 | - type: object 6 | properties: 7 | state: 8 | type: string 9 | description: Mbox state token that must be sent back with display notification for the mbox. 10 | -------------------------------------------------------------------------------- /openapi/delivery/components/PrefetchRequest.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | PrefetchRequest: 3 | type: object 4 | description: | 5 | Use this object to prefetch the content for `views` and/or `pageLoad` and/or `mboxes`. 6 | * `views` - the request to prefetch selectors grouped per view. 7 | * `pageLoad` - the request to prefetch selectors not assigned to any view. 8 | * `mboxes` - the request to prefetch mbox content. 9 | properties: 10 | views: 11 | type: array 12 | description: | 13 | An array of views 14 | items: 15 | $ref: "./ViewRequest.yaml#/ViewRequest" 16 | pageLoad: 17 | $ref: "./RequestDetails.yaml#/RequestDetails" 18 | mboxes: 19 | type: array 20 | description: Prefetch the content for the regional mbox. 21 | items: 22 | $ref: "./MboxRequest.yaml#/MboxRequest" 23 | -------------------------------------------------------------------------------- /openapi/delivery/components/PrefetchResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | PrefetchResponse: 3 | type: object 4 | description: | 5 | The object that will return the prefetched content based on the request, active activites etc 6 | properties: 7 | views: 8 | type: array 9 | description: | 10 | Contains all the views matching the request. 11 | items: 12 | $ref: "./View.yaml#/View" 13 | pageLoad: 14 | $ref: "./PageLoadResponse.yaml#/PageLoadResponse" 15 | mboxes: 16 | type: array 17 | description: | 18 | Prefetched mboxes, including content and notification tokens to be sent back when the mboxes are displayed. 19 | items: 20 | $ref: "./PrefetchMboxResponse.yaml#/PrefetchMboxResponse" 21 | metrics: 22 | type: array 23 | description: | 24 | The click track metrics that are not assigned to a view but are present in activites that have views, except 25 | in case the same activity is serving content for selectors both assinged to a view and selectors without any 26 | views, and having click track metrics that are not assotiated with any view within the activity, then: 27 | * in case of a prefetch only request, these metrics (tokens) will be set in the prefetch response's metrics. 28 | * in case of an execute only request, the metrics will be set in the page load response's metrics. 29 | * in case of a request, with both, execute and prefetch, metrics will be set in the page load response's 30 | metrics only. 31 | items: 32 | $ref: "./Metric.yaml#/Metric" 33 | -------------------------------------------------------------------------------- /openapi/delivery/components/Property.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Property: 3 | type: object 4 | required: 5 | - token 6 | description: | 7 | Specifies the at_property via the token field. It can be used to control the scope for the delivery. 8 | properties: 9 | token: 10 | description: | 11 | The at_property token 12 | 13 | Validation 14 | * Required if the property is specified. 15 | type: string 16 | -------------------------------------------------------------------------------- /openapi/delivery/components/RequestDetails.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | RequestDetails: 3 | type: object 4 | description: Object common for prefetch, execute and notifications in order to specify the request details. 5 | discriminator: 6 | propertyName: $_type 7 | properties: 8 | $_type: 9 | type: string 10 | address: 11 | $ref: "./Address.yaml#/Address" 12 | parameters: 13 | $ref: "../../common/components/Parameters.yaml#/Parameters" 14 | profileParameters: 15 | $ref: "../../common/components/Parameters.yaml#/Parameters" 16 | order: 17 | $ref: "../../common/components/Order.yaml#/Order" 18 | product: 19 | $ref: "../../common/components/Product.yaml#/Product" 20 | -------------------------------------------------------------------------------- /openapi/delivery/components/Screen.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Screen: 3 | type: object 4 | description: The properties that dictate a screen 5 | properties: 6 | width: 7 | type: number 8 | format: double 9 | description: width 10 | height: 11 | type: number 12 | format: double 13 | description: height 14 | colorDepth: 15 | type: number 16 | format: double 17 | description: color depth 18 | pixelRatio: 19 | type: number 20 | format: double 21 | description: Optional, Used for device detection using the device atlas 22 | orientation: 23 | $ref: "./ScreenOrientationType.yaml#/ScreenOrientationType" 24 | -------------------------------------------------------------------------------- /openapi/delivery/components/ScreenOrientationType.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ScreenOrientationType: 3 | type: string 4 | description: | 5 | If not specified, all activities with any screen orientation will be evaluated. 6 | If specified, only the activities with the matching screen orientation will evaluated. 7 | enum: ["portrait", "landscape"] 8 | -------------------------------------------------------------------------------- /openapi/delivery/components/Telemetry.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Telemetry: 3 | type: object 4 | description: Telemetry 5 | properties: 6 | entries: 7 | type: array 8 | description: An array of Telemetry Entries. 9 | items: 10 | $ref: "./TelemetryEntry.yaml#/TelemetryEntry" 11 | -------------------------------------------------------------------------------- /openapi/delivery/components/TelemetryEntry.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | TelemetryEntry: 3 | type: object 4 | description: Telemetry Entry. 5 | properties: 6 | requestId: 7 | type: string 8 | description: Request Id 9 | timestamp: 10 | type: integer 11 | format: int64 12 | description: Timestamp of the entry, in milliseconds elapsed since UNIX epoch. 13 | mode: 14 | $ref: "./ExecutionMode.yaml#/ExecutionMode" 15 | description: Execution Mode for request 16 | execution: 17 | type: number 18 | format: double 19 | description: Execution time in milliseconds. 20 | parsing: 21 | type: number 22 | format: double 23 | description: Response parsing time, in milliseconds elapsed since UNIX epoch. 24 | features: 25 | $ref: "./TelemetryFeatures.yaml#/TelemetryFeatures" 26 | description: Features used by the SDK 27 | request: 28 | $ref: "./TelemetryRequest.yaml#/TelemetryRequest" 29 | description: Details of the request either to Target or CDN 30 | telemetryServerToken: 31 | type: string 32 | description: Encoded data with telemetry collected from previous request to Delivery API 33 | -------------------------------------------------------------------------------- /openapi/delivery/components/TelemetryFeatures.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | TelemetryFeatures: 3 | type: object 4 | description: Telemetry Features 5 | properties: 6 | decisioningMethod: 7 | $ref: "./DecisioningMethod.yaml#/DecisioningMethod" 8 | description: Decisioning Method used 9 | executeMboxCount: 10 | type: integer 11 | description: Number of mboxes in execute request 12 | executePageLoad: 13 | type: boolean 14 | description: Indicates if execute pageLoad was used 15 | prefetchMboxCount: 16 | type: integer 17 | description: Number of prefetched mboxes 18 | prefetchPageLoad: 19 | type: boolean 20 | description: Indicates if prefetch pageLoad was used 21 | prefetchViewCount: 22 | type: integer 23 | description: Number of prefetched views 24 | -------------------------------------------------------------------------------- /openapi/delivery/components/TelemetryRequest.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | TelemetryRequest: 3 | type: object 4 | description: Telemetry Request 5 | properties: 6 | dns: 7 | type: number 8 | format: double 9 | description: DNS resolution time, in milliseconds elapsed since UNIX epoch. 10 | tls: 11 | type: number 12 | format: double 13 | description: TLS handshake time, in milliseconds elapsed since UNIX epoch. 14 | timeToFirstByte: 15 | type: number 16 | format: double 17 | description: Time to first byte, in milliseconds elapsed since UNIX epoch. 18 | download: 19 | type: number 20 | format: double 21 | description: Download time, in milliseconds elapsed since UNIX epoch. 22 | responseSize: 23 | type: integer 24 | format: int64 25 | description: Response size 26 | -------------------------------------------------------------------------------- /openapi/delivery/components/Trace.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Trace: 3 | type: object 4 | required: 5 | - authorizationToken 6 | description: | 7 | Enables the trace for delivery API. 8 | At present it is not be possible to set the metrics and packages for the trace. 9 | properties: 10 | authorizationToken: 11 | type: string 12 | usage: 13 | type: object 14 | additionalProperties: 15 | type: string 16 | description: | 17 | A String dictionary of client SDK usage tracking and internal diagnostics metadata. 18 | -------------------------------------------------------------------------------- /openapi/delivery/components/TraceResponse.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | TraceResponse: 3 | type: object 4 | description: | 5 | The object containing all trace data for the request, only present if the trace token was provided in the request. 6 | additionalProperties: 7 | type: object 8 | properties: 9 | traceKey: 10 | type: string 11 | traceValue: 12 | type: object 13 | -------------------------------------------------------------------------------- /openapi/delivery/components/View.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | View: 3 | type: object 4 | description: | 5 | This object will contain all the options for the selectors set for the current view, from the active activities, 6 | in case the context and targeting conditions from the request have been matched. 7 | properties: 8 | name: 9 | type: string 10 | maxLength: 128 11 | description: | 12 | View Name - Unique view name. If the activity has a metric with a view with this name it will be matched, 13 | providing the Key matches as well or is null and view and metric targeting is matched. 14 | key: 15 | type: string 16 | maxLength: 512 17 | description: | 18 | View Key - An optional encoded String identifier used in advanced scenarios, such as View fingerprinting. 19 | Same matching conditions as for View Name. 20 | options: 21 | type: array 22 | description: | 23 | The prefetched content (options) to be displayed for the current view. 24 | items: 25 | $ref: "./Option.yaml#/Option" 26 | metrics: 27 | type: array 28 | description: | 29 | Click track metrics for the current view. 30 | items: 31 | $ref: "./Metric.yaml#/Metric" 32 | analytics: 33 | $ref: "./AnalyticsResponse.yaml#/AnalyticsResponse" 34 | state: 35 | type: string 36 | description: View state token that must be sent back with display notification for the view. 37 | trace: 38 | $ref: "./TraceResponse.yaml#/TraceResponse" 39 | -------------------------------------------------------------------------------- /openapi/delivery/components/ViewRequest.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | ViewRequest: 3 | description: View request 4 | allOf: 5 | - $ref: "./RequestDetails.yaml#/RequestDetails" 6 | - type: object 7 | properties: 8 | name: 9 | type: string 10 | maxLength: 128 11 | description: | 12 | View Name - Unique view name. If the activity has a metric with a view with this name it will be matched, 13 | providing the Key matches as well or is null and view and metric targeting is matched. 14 | key: 15 | type: string 16 | maxLength: 512 17 | description: | 18 | View Key - An optional encoded String identifier used in advanced scenarios, such as View fingerprinting. 19 | Same matching conditions as for View Name. 20 | -------------------------------------------------------------------------------- /openapi/delivery/components/Window.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | Window: 3 | type: object 4 | description: The dimensions that dictate a window 5 | properties: 6 | width: 7 | type: number 8 | format: double 9 | description: width 10 | height: 11 | type: number 12 | format: double 13 | description: height 14 | 15 | -------------------------------------------------------------------------------- /openapi/delivery/examples/notificationsForDisplayedContent.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": { 3 | "tntId": "abcdefghijkl00014.1_1" 4 | }, 5 | "context": { 6 | "channel" : "web", 7 | "browser" : { 8 | "host" : "demo" 9 | }, 10 | "address" : { 11 | "url" : "http://demo.dev.tt-demo.com/demo/store/index.html?ad=a" 12 | }, 13 | "screen" : { 14 | "width" : 1200, 15 | "height": 1400 16 | } 17 | }, 18 | "experienceCloud": { 19 | "audienceManager": { 20 | } 21 | }, 22 | "notifications": [{ 23 | "id" : "notificationId1", 24 | "type": "display", 25 | "timestamp": 1552561951770, 26 | "parameters": { 27 | "ad" : "view" 28 | }, 29 | "tokens" : [ 30 | "1zIHw4w+hPht4NV5MyssK4usK1YQ35VnRXpXdevZO4L+y1IPq9i2NpPJJ/bX9FNd", 31 | "1zIHw4w+hPht4NV5MyssK4usK1YQ35VnRXpXdevZO4L+y1IPq9i2NpPJJ/bX9FNd" 32 | ] 33 | }] 34 | } 35 | -------------------------------------------------------------------------------- /openapi/delivery/examples/responseForPrefetchViewsForMobileChannel.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": 200, 3 | "requestId": "620db62f-fe6c-4d7e-a31f-93dd36da8117", 4 | "client": "demo", 5 | "id": { 6 | "tntId": "abcdefghijkl00014.1_1" 7 | }, 8 | "edgeHost": "mboxedge1.dev.tt.omtrdc.net", 9 | "prefetch": { 10 | "views": [ 11 | { 12 | "id": 1, 13 | "name": "webView1", 14 | "key": "32423dfs3452sdr25r", 15 | "options": [ 16 | { 17 | "content": [ 18 | { 19 | "type": "setHtml", 20 | "selector": "#top-menu", 21 | "content": "AAA" 22 | } 23 | ], 24 | "type": "actions", 25 | "eventToken": "1zIHw4w+hPht4NV5MyssK4usK1YQ35VnRXpXdevZO4L+y1IPq9i2NpPJJ/bX9FNd" 26 | }, 27 | { 28 | "content": [ 29 | { 30 | "type": "setHtml", 31 | "selector": "#sidebar", 32 | "content": "BBB" 33 | } 34 | ], 35 | "type": "actions", 36 | "eventToken": "1zIHw4w+hPht4NV5MyssK4usK1YQ35VnRXpXdevZO4L+y1IPq9i2NpPJJ/bX9FNd" 37 | } 38 | ] 39 | }, 40 | { 41 | "id": 2, 42 | "name": "webView2", 43 | "key": "11423dfs3452sdr233", 44 | "metrics": [ 45 | { 46 | "type": "click", 47 | "selector": "#campaignWithViewsViewIdInSelector", 48 | "eventToken": "cugVCufT8raDG+O9QFSX3w==" 49 | } 50 | ] 51 | } 52 | ], 53 | "metrics": [ 54 | { 55 | "type": "click", 56 | "selector": "#campaignWithViewsNoViewIdInSelector", 57 | "eventToken": "cugVCufT8raDG+O9QFSX3w==" 58 | } 59 | ] 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /openapi/delivery/examples/responseForPrefetchViewsForWebChannel.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": 200, 3 | "requestId": "5efee0d8-3779-4b12-a74e-e04848faf191", 4 | "client": "demo", 5 | "id": { 6 | "tntId": "abcdefghijkl00023.1_1" 7 | }, 8 | "edgeHost": "mboxedge28.tt.omtrdc.net", 9 | "prefetch": { 10 | "mboxes": [ 11 | { 12 | "index": 1, 13 | "name": "SummerOffer", 14 | "options": [ 15 | { 16 | "content": "

Enjoy this 15% discount on your next purchase

", 17 | "type": "html", 18 | "eventToken": "GcvBXDhdJFNR9E9r1tgjfmqipf", 19 | } 20 | ] 21 | } 22 | ] 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "adobe-sdk-packages", 3 | "private": true, 4 | "scripts": { 5 | "build": "lerna bootstrap && lerna run build", 6 | "clean": "lerna run clean", 7 | "coverage": "node tools/mapCoverage.js", 8 | "format": "lerna run format", 9 | "lint": "lerna run lint", 10 | "pretty-quick": "pretty-quick", 11 | "prepublish": "lerna bootstrap && lerna run build", 12 | "publish": "node tools/npm-publish.js", 13 | "test": "lerna run test --stream && npm run coverage", 14 | "updateTestArtifacts": "bash tools/updateTestSchema.sh", 15 | "codegen": "cd codegeneration && npm install && npm run codegen" 16 | }, 17 | "husky": { 18 | "hooks": { 19 | "pre-commit": "pretty-quick --staged" 20 | } 21 | }, 22 | "devDependencies": { 23 | "husky": "^4.3.0", 24 | "istanbul-lib-coverage": "^3.0.0", 25 | "istanbul-lib-report": "^3.0.0", 26 | "istanbul-reports": "^3.0.1", 27 | "lerna": "^4.0.0", 28 | "prettier": "^2.7.1", 29 | "pretty-quick": "^3.1.3" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | lib/** 3 | node_modules/** 4 | coverage/** 5 | babel.config.js 6 | test/artifact/** 7 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require("@adobe/target-tools/.eslintrc.js"); 2 | 3 | module.exports = { ...baseConfig }; 4 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/.npmignore: -------------------------------------------------------------------------------- 1 | *.log 2 | /.*/ 3 | /.eslint* 4 | /.editorconfig 5 | /.gitignore 6 | /.npmignore 7 | /webpack.* 8 | *.iws 9 | src/ 10 | coverage/ 11 | *.spec.js 12 | *.config.js 13 | *.tgz 14 | *.map 15 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/LICENSE_BANNER.txt: -------------------------------------------------------------------------------- 1 | <%= pkg.name %> v.<%= pkg.version %> 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/README.md: -------------------------------------------------------------------------------- 1 | # Adobe Target Decisioning Engine 2 | 3 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/babel.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require("@adobe/target-tools/babel.config.js"); 2 | 3 | const config = { 4 | ...baseConfig 5 | }; 6 | 7 | module.exports = config; 8 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/jest.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require("@adobe/target-tools/jest.config.js"); 2 | 3 | module.exports = { 4 | ...baseConfig, 5 | setupFiles: ["core-js", "./jest.polyfills.js"] 6 | }; 7 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/jest.polyfills.js: -------------------------------------------------------------------------------- 1 | import "fast-text-encoding"; 2 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/rollup.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | import path from "path"; 13 | import resolve from "@rollup/plugin-node-resolve"; 14 | import json from "@rollup/plugin-json"; 15 | import license from "rollup-plugin-license"; 16 | import commonjs from "@rollup/plugin-commonjs"; 17 | import babel from "rollup-plugin-babel"; 18 | import visualizer from "rollup-plugin-visualizer"; 19 | import pkg from "./package.json"; 20 | 21 | export default [ 22 | { 23 | input: "src/index.js", 24 | output: { 25 | name: "TargetDecisioningEngine", 26 | file: pkg.main, 27 | format: "cjs" 28 | }, 29 | plugins: [ 30 | json(), 31 | resolve(), 32 | commonjs(), 33 | babel(), 34 | license({ 35 | banner: { 36 | content: { 37 | file: path.join(__dirname, "LICENSE_BANNER.txt") 38 | } 39 | } 40 | }), 41 | visualizer({ 42 | filename: "bundlesize-stats.html" 43 | }) 44 | ] 45 | } 46 | ]; 47 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/src/enums.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/prefer-default-export */ 2 | 3 | export const RequestType = { 4 | MBOX: "mbox", 5 | VIEW: "view", 6 | PAGELOAD: "pageLoad" 7 | }; 8 | 9 | export const OptionType = { 10 | Html: "html", 11 | Json: "json", 12 | Redirect: "redirect", 13 | Dynamic: "dynamic", 14 | Actions: "actions" 15 | }; 16 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/src/events.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/prefer-default-export */ 2 | 3 | export const ARTIFACT_DOWNLOAD_SUCCEEDED = "artifactDownloadSucceeded"; 4 | export const ARTIFACT_DOWNLOAD_FAILED = "artifactDownloadFailed"; 5 | export const GEO_LOCATION_UPDATED = "geoLocationUpdated"; 6 | export const SEND_NOTIFICATION_ERROR = "sendNotificationError"; 7 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/src/filters.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/prefer-default-export */ 2 | import { includes, isUndefined } from "@adobe/target-tools"; 3 | 4 | /** 5 | * 6 | * @param {String} propertyToken 7 | * @return {function(import("../types/DecisioningArtifact").Rule): boolean} 8 | */ 9 | export function byPropertyToken(propertyToken) { 10 | /** 11 | * @param {import("../types/DecisioningArtifact").Rule} rule 12 | * @return {boolean} 13 | */ 14 | function filter(rule) { 15 | const { propertyTokens = [] } = rule; 16 | 17 | return isUndefined(propertyToken) 18 | ? propertyTokens.length === 0 19 | : propertyTokens.length === 0 || includes(propertyToken, propertyTokens); 20 | } 21 | return filter; 22 | } 23 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/src/messages.js: -------------------------------------------------------------------------------- 1 | const Messages = { 2 | ERROR_MAX_RETRY: (numRetries, errString) => 3 | `Unable to retrieve artifact after ${numRetries} retries: ${errString}`, 4 | ARTIFACT_NOT_AVAILABLE: "The decisioning artifact is not available", 5 | ARTIFACT_VERSION_UNSUPPORTED: (artifactVersion, supportedMajorVersion) => 6 | `The decisioning artifact version (${artifactVersion}) is not supported. This library is compatible with this major version: ${supportedMajorVersion}`, 7 | ARTIFACT_FETCH_ERROR: reason => `Failed to retrieve artifact: ${reason}`, 8 | ARTIFACT_INVALID: "Invalid Artifact", 9 | INVALID_ENVIRONMENT: (expectedEnvironment, defaultEnvironment) => 10 | `'${expectedEnvironment}' is not a valid target environment, defaulting to '${defaultEnvironment}'.`, 11 | NOT_APPLICABLE: "Not Applicable", 12 | ARTIFACT_OBFUSCATION_ERROR: "Unable to read artifact JSON", 13 | UNKNOWN: "unknown" 14 | }; 15 | 16 | export default Messages; 17 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/src/obfuscationProvider.spec.js: -------------------------------------------------------------------------------- 1 | import fs from "fs"; 2 | import path from "path"; 3 | import ObfuscationProvider from "./obfuscationProvider"; 4 | import Messages from "./messages"; 5 | 6 | describe("obfuscationProvider", () => { 7 | const testArtifactsDirectory = path.resolve(__dirname, "../test/artifact"); 8 | 9 | const artifact = JSON.parse( 10 | fs.readFileSync(`${testArtifactsDirectory}/rules.json`, "utf-8") 11 | ); 12 | 13 | it("can deobfuscate", () => { 14 | const obfuscationProvider = ObfuscationProvider({ 15 | client: "targettesting", 16 | organizationId: "74F652E95F1B16FE0A495C92@AdobeOrg" 17 | }); 18 | 19 | expect.assertions(1); 20 | return new Promise(done => { 21 | fs.readFile( 22 | `${testArtifactsDirectory}/rules.bin`, 23 | null, 24 | (err, obfuscatedArtifact) => { 25 | const result = obfuscationProvider.deobfuscate( 26 | obfuscatedArtifact.buffer 27 | ); 28 | expect(result).toMatchObject(artifact); 29 | done(); 30 | } 31 | ); 32 | }); 33 | }); 34 | 35 | it("throws an error if cannot deobfuscate (invalid key)", () => { 36 | expect.assertions(1); 37 | const obfuscationProvider = ObfuscationProvider({ 38 | client: "targettesting", 39 | organizationId: "74F652E95F1B16FE0A495C92@InvalidOrg" 40 | }); 41 | 42 | return new Promise(done => { 43 | fs.readFile( 44 | `${testArtifactsDirectory}/rules.bin`, 45 | null, 46 | (err, obfuscatedArtifact) => { 47 | expect(() => 48 | obfuscationProvider.deobfuscate(obfuscatedArtifact.buffer) 49 | ).toThrow(new Error(Messages.ARTIFACT_OBFUSCATION_ERROR)); 50 | done(); 51 | } 52 | ); 53 | }); 54 | }); 55 | }); 56 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/src/timings.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/prefer-default-export */ 2 | 3 | export const TIMING_ARTIFACT_DOWNLOADED_TOTAL = "artifactDownloaded_total"; 4 | export const TIMING_ARTIFACT_DOWNLOADED_FETCH = "artifactDownloaded_fetch"; 5 | export const TIMING_ARTIFACT_GET_INITIAL = "artifactGetInitial"; 6 | export const TIMING_ARTIFACT_READ_JSON = "artifactDownloaded_read_JSON"; 7 | export const TIMING_ARTIFACT_DEOBFUSCATE = "deobfuscate_total"; 8 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/test/schema/artifacts/TEST_ARTIFACT_BLANK.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "globalMbox": "target-global-mbox", 4 | "hasGeoTargeting": false, 5 | "responseTokens": [], 6 | "remoteMboxes": [], 7 | "localMboxes": [], 8 | "remoteViews": [], 9 | "localViews": [], 10 | "meta": {}, 11 | "rules": { 12 | "mboxes": {}, 13 | "views": {} 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/test/schema/artifacts/TEST_ARTIFACT_UNSUPPORTED.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "99.0.0", 3 | "globalMbox": "target-global-mbox", 4 | "hasGeoTargeting": false, 5 | "responseTokens": [], 6 | "remoteMboxes": [], 7 | "localMboxes": [], 8 | "remoteViews": [], 9 | "localViews": [], 10 | "meta": {}, 11 | "rules": { 12 | "mboxes": {}, 13 | "views": {} 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/test/test.utils.spec.js: -------------------------------------------------------------------------------- 1 | import { getTestArtifacts, getTestModels } from "./test.utils"; 2 | 3 | describe("test utils", () => { 4 | it("has artifacts", () => { 5 | const testArtifacts = getTestArtifacts(); 6 | expect(testArtifacts.length).toBeGreaterThan(0); 7 | }); 8 | it("has test models", () => { 9 | const testModels = getTestModels(); 10 | expect(testModels.length).toBeGreaterThan(0); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/types/DecisioningArtifact.d.ts: -------------------------------------------------------------------------------- 1 | import { MboxResponse } from "@adobe/target-tools/delivery-api-client"; 2 | 3 | export interface Consequence extends MboxResponse {} 4 | 5 | export interface Rule { 6 | ruleKey: String; 7 | activityId: number; 8 | propertyTokens: String[]; 9 | seed: String; 10 | condition: Object; 11 | consequence: Consequence; 12 | meta: { 13 | "activity.id": number; 14 | "activity.name": string; 15 | "activity.type": string; 16 | "audience.ids": number[]; 17 | "experience.id": number; 18 | "experience.name": string; 19 | "location.id": number; 20 | "location.name": string; 21 | "location.type": string; 22 | "offer.id": number; 23 | "offer.name": string; 24 | "option.id": number; 25 | "option.name": string; 26 | }; 27 | } 28 | 29 | export interface DecisioningArtifact { 30 | version: string; 31 | globalMbox: string; 32 | geoTargetingEnabled: boolean; 33 | responseTokens: Array; 34 | remoteMboxes: Array; 35 | localMboxes: Array; 36 | remoteViews: Array; 37 | localViews: Array; 38 | meta: { 39 | generatedAt: string; 40 | organizationId: string; 41 | clientCode: string; 42 | workspace: number; 43 | environment: string; 44 | }; 45 | rules: { 46 | mboxes: { [key: string]: Array }; 47 | views: { [key: string]: Array }; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/types/DecisioningContext.d.ts: -------------------------------------------------------------------------------- 1 | export interface GeoContext { 2 | country: string; 3 | region: string; 4 | city: string; 5 | latitude: number; 6 | longitude: number; 7 | } 8 | 9 | export interface UserContext { 10 | browserType: string; 11 | platform: string; 12 | locale: string; 13 | browserVersion: number; 14 | } 15 | 16 | export interface PageContext { 17 | url: string; 18 | url_lc: string; 19 | path: string; 20 | path_lc: string; 21 | domain: string; 22 | domain_lc: string; 23 | subdomain: string; 24 | subdomain_lc: string; 25 | topLevelDomain: string; 26 | topLevelDomain_lc: string; 27 | query: string; 28 | query_lc: string; 29 | fragment: string; 30 | fragment_lc: string; 31 | } 32 | 33 | export interface MboxContext { 34 | [key: string]: any; 35 | } 36 | 37 | export interface DecisioningContext { 38 | allocation: number; 39 | current_timestamp: number; 40 | current_time: string; 41 | current_day: number; 42 | user: UserContext; 43 | page: PageContext; 44 | referring: PageContext; 45 | mbox: MboxContext; 46 | geo: GeoContext; 47 | } 48 | 49 | export interface DomainContext { 50 | subdomain?: string; 51 | domain?: string; 52 | topLevelDomain?: string; 53 | } 54 | 55 | export interface ParseDomainFunc { 56 | (host: string): DomainContext; 57 | } 58 | -------------------------------------------------------------------------------- /packages/target-decisioning-engine/types/TargetDeliveryRequest.d.ts: -------------------------------------------------------------------------------- 1 | import { 2 | CustomerId, 3 | DeliveryRequest, 4 | Trace 5 | } from "@adobe/target-tools/delivery-api-client"; 6 | 7 | export interface TargetDeliveryRequest { 8 | /** 9 | * Target Delivery Request 10 | */ 11 | request: DeliveryRequest; 12 | 13 | /** 14 | * VisitorId cookie value 15 | */ 16 | visitorCookie?: String; 17 | 18 | /** 19 | * Target cookie value 20 | */ 21 | targetCookie?: String; 22 | 23 | /** 24 | * Target location hint value 25 | */ 26 | targetLocationHint?: String; 27 | 28 | /** 29 | * When stitching multiple calls, different consumerIds should be provided, 30 | */ 31 | consumerId?: String; 32 | 33 | /** 34 | * An array of Customer Ids in VisitorId-compatible format 35 | */ 36 | customerIds?: Array; 37 | 38 | /** 39 | * Session Id, used for linking multiple requests 40 | */ 41 | sessionId?: String; 42 | 43 | /** 44 | * Supply an external VisitorId instance 45 | */ 46 | visitor?: Object; 47 | 48 | /** 49 | * Enables the trace. A valid authorizationToken is requried for Delivery API. 50 | */ 51 | trace?: Trace; 52 | } 53 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/.eslintignore: -------------------------------------------------------------------------------- 1 | lib/** 2 | dist/** 3 | sample/** 4 | node_modules/** 5 | coverage/** 6 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require("@adobe/target-tools/.eslintrc.js"); 2 | 3 | const config = { 4 | ...baseConfig 5 | }; 6 | 7 | config.overrides.push({ 8 | files: ["*.js"], 9 | rules: { 10 | "@lwc/lwc/no-async-await": "off", 11 | "no-restricted-properties": "off" 12 | } 13 | }); 14 | 15 | module.exports = config; 16 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/.npmignore: -------------------------------------------------------------------------------- 1 | *.log 2 | /.*/ 3 | /.eslint* 4 | /.editorconfig 5 | /.gitignore 6 | /.npmignore 7 | /webpack.* 8 | *.iws 9 | src/ 10 | sample/ 11 | coverage/ 12 | checkstyle/ 13 | spec/ 14 | test/ 15 | *.spec.js 16 | *.config.js 17 | *.tgz 18 | *.map 19 | 20 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/LICENSE_BANNER.txt: -------------------------------------------------------------------------------- 1 | <%= pkg.name %> v.<%= pkg.version %> 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/babel.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require("@adobe/target-tools/babel.config.js"); 2 | 3 | const config = { 4 | ...baseConfig 5 | }; 6 | 7 | module.exports = config; 8 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/demo/.gitignore: -------------------------------------------------------------------------------- 1 | assets/targetclient.browser* 2 | CNAME 3 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/demo/assets/script.js: -------------------------------------------------------------------------------- 1 | const STORAGE_KEY = "tgtVisitorCookies"; 2 | 3 | function showResult(headingText, resultText) { 4 | const resultEl = document.getElementById("result"); 5 | 6 | const preEl = document.createElement("pre"); 7 | const h3El = document.createElement("h3"); 8 | 9 | h3El.innerText = headingText; 10 | preEl.innerText = resultText; 11 | 12 | resultEl.appendChild(h3El); 13 | resultEl.appendChild(preEl); 14 | } 15 | 16 | function getCookie(name) { 17 | const v = document.cookie.match( 18 | `(^|;) ?${encodeURIComponent(name)}=([^;]*)(;|$)` 19 | ); 20 | return v ? v[2] : null; 21 | } 22 | 23 | function persistVisitorCookies(visitor, targetResponse) { 24 | if (!visitor) throw new Error("visitor is undefined"); 25 | if (!targetResponse) throw new Error("targetResponse is undefined"); 26 | 27 | visitor.getVisitorValues(function (ids) { 28 | const visitorCookie = getCookie(visitor.cookieName); 29 | const storageValue = { 30 | targetCookie: targetResponse.targetCookie.value, 31 | targetLocationHintCookie: 32 | typeof targetResponse.targetLocationHintCookie !== "undefined" 33 | ? targetResponse.targetLocationHintCookie.value 34 | : undefined, 35 | visitorState: targetResponse.visitorState, 36 | visitorCookie 37 | }; 38 | 39 | window.localStorage.setItem(STORAGE_KEY, JSON.stringify(storageValue)); 40 | }); 41 | } 42 | 43 | function getVisitorCookies() { 44 | return JSON.parse(window.localStorage.getItem(STORAGE_KEY) || "{}"); 45 | } 46 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/demo/assets/style.css: -------------------------------------------------------------------------------- 1 | #result { 2 | background-color: lightcyan; 3 | } 4 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/demo/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "agent-base": { 8 | "version": "6.0.0", 9 | "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz", 10 | "integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==", 11 | "requires": { 12 | "debug": "4" 13 | } 14 | }, 15 | "debug": { 16 | "version": "4.1.1", 17 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 18 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 19 | "requires": { 20 | "ms": "^2.1.1" 21 | } 22 | }, 23 | "https-proxy-agent": { 24 | "version": "5.0.0", 25 | "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", 26 | "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", 27 | "requires": { 28 | "agent-base": "6", 29 | "debug": "4" 30 | } 31 | }, 32 | "ms": { 33 | "version": "2.1.2", 34 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 35 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 36 | }, 37 | "node-fetch": { 38 | "version": "2.6.0", 39 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", 40 | "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "target-nodejs-sdk-demo", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "demo.js", 6 | "scripts": { 7 | "start": "node demo.js" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "Apache-2.0", 12 | "dependencies": { 13 | "https-proxy-agent": "^5.0.0", 14 | "node-fetch": "^2.6.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/jest.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require("@adobe/target-tools/jest.config.js"); 2 | 3 | module.exports = { 4 | ...baseConfig, 5 | setupFiles: ["core-js", "./jest.polyfills.js"] 6 | }; 7 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/jest.polyfills.js: -------------------------------------------------------------------------------- 1 | import "fast-text-encoding"; 2 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/packfiles.txt: -------------------------------------------------------------------------------- 1 | CHANGELOG.md CODE_OF_CONDUCT.md LICENSE README.md 2 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/sample/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "client": "adobetargetmobile", 3 | "organizationId": "B8A054D958807F770A495DD6@AdobeOrg", 4 | "timeout": 10000, 5 | "serverDomain": "adobetargetmobile.tt.omtrdc.net" 6 | } 7 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/sample/templates/index.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MCID (Visitor API) with Analytics and at.js Integration Sample 6 | 7 | 10 | 19 | 20 | 21 | 22 |
Default Content
23 |
${content}
24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/src/events.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/prefer-default-export */ 2 | 3 | export const CLIENT_READY = "clientReady"; 4 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/src/index.browser.js: -------------------------------------------------------------------------------- 1 | import { fetch as whatwfFetch } from "whatwg-fetch"; 2 | 3 | import { isDefined } from "@adobe/target-tools"; 4 | import bootstrap from "./index"; 5 | 6 | const TargetClient = bootstrap( 7 | // eslint-disable-next-line no-undef 8 | isDefined(window.fetch) 9 | ? // eslint-disable-next-line no-undef 10 | window.fetch.bind(window) 11 | : whatwfFetch 12 | ); 13 | 14 | export default TargetClient; 15 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/src/index.server.js: -------------------------------------------------------------------------------- 1 | import FormData from "form-data"; 2 | import { URLSearchParams } from "url"; 3 | import "fast-text-encoding"; 4 | 5 | import { getFetchWithTelemetry, isDefined } from "@adobe/target-tools"; 6 | import bootstrap from "./index"; 7 | 8 | global.FormData = FormData; 9 | global.URLSearchParams = URLSearchParams; 10 | 11 | const TargetClient = bootstrap( 12 | // eslint-disable-next-line no-undef 13 | isDefined(global.fetch) ? global.fetch : getFetchWithTelemetry() 14 | ); 15 | 16 | export default TargetClient.default || TargetClient; 17 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/test/mockTelemetryProvider.js: -------------------------------------------------------------------------------- 1 | export default { 2 | ...jest.requireActual("@adobe/target-tools").TelemetryProvider() 3 | }; 4 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/test/proxy.spec.js: -------------------------------------------------------------------------------- 1 | import { Agent } from "https"; 2 | 3 | const { getFetchWithTelemetry } = require("@adobe/target-tools"); 4 | const TargetClient = require("../src/index.server").default; 5 | 6 | describe("Target Client supports proxy configuration", () => { 7 | it("By overriding the fetchApi during client initialization", async () => { 8 | const proxyAgentSpy = jest.spyOn(Agent.prototype, "createConnection"); 9 | 10 | const fetchImpl = (url, options) => { 11 | const fetchOptions = options || {}; 12 | fetchOptions.agent = new Agent({ 13 | keepAlive: true 14 | }); 15 | const telemetryFetch = getFetchWithTelemetry(); 16 | return telemetryFetch(url, fetchOptions); 17 | }; 18 | 19 | const client = TargetClient.create({ 20 | client: "adobesummit2018", 21 | organizationId: "65453EA95A70434F0A495D34@AdobeOrg", 22 | decisioningMethod: "server-side", 23 | fetchApi: fetchImpl 24 | }); 25 | 26 | const TARGET_REQUEST = { 27 | prefetch: { 28 | mboxes: [ 29 | { 30 | name: "mbox-droptop", 31 | index: 1 32 | } 33 | ] 34 | } 35 | }; 36 | 37 | await client.getOffers({ 38 | request: TARGET_REQUEST, 39 | sessionId: "dummy_session" 40 | }); 41 | 42 | const proxyAgentSpyCall = proxyAgentSpy.mock.calls[0][0]; 43 | 44 | expect(proxyAgentSpyCall.keepAlive).toEqual(true); 45 | expect(proxyAgentSpyCall.servername).toEqual( 46 | "adobesummit2018.tt.omtrdc.net" 47 | ); 48 | expect(proxyAgentSpyCall.headers["X-EXC-SDK"]).toEqual("AdobeTargetNode"); 49 | }); 50 | }); 51 | -------------------------------------------------------------------------------- /packages/target-nodejs-sdk/types/SDKResponse.d.ts: -------------------------------------------------------------------------------- 1 | import { 2 | DeliveryRequest, 3 | DeliveryResponse 4 | } from "@adobe/target-tools/delivery-api-client"; 5 | 6 | export interface Cookie { 7 | name: String; 8 | value: String; 9 | maxAge: Number; 10 | } 11 | 12 | export interface ResponseMeta { 13 | decisioningMethod: String; 14 | remoteMboxes: String[]; 15 | remoteViews: String[]; 16 | } 17 | 18 | export interface TargetDeliveryResponse { 19 | request: DeliveryRequest; 20 | response: DeliveryResponse; 21 | visitorState?: Object; 22 | targetCookie?: Cookie; 23 | targetLocationHintCookie?: Cookie; 24 | analyticsDetails?: Array; 25 | responseTokens?: Array; 26 | trace?: Array; 27 | meta?: ResponseMeta; 28 | } 29 | -------------------------------------------------------------------------------- /packages/target-tools/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | lib/** 3 | delivery-api-client/** 4 | node_modules/** 5 | coverage/** 6 | -------------------------------------------------------------------------------- /packages/target-tools/.npmignore: -------------------------------------------------------------------------------- 1 | *.log 2 | /.*/ 3 | /.eslint* 4 | /.editorconfig 5 | /.gitignore 6 | /.npmignore 7 | /webpack.* 8 | *.iws 9 | src/ 10 | coverage/ 11 | checkstyle/ 12 | spec/ 13 | test/ 14 | *.spec.js 15 | *.map 16 | 17 | -------------------------------------------------------------------------------- /packages/target-tools/LICENSE_BANNER.txt: -------------------------------------------------------------------------------- 1 | <%= pkg.name %> v.<%= pkg.version %> 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | -------------------------------------------------------------------------------- /packages/target-tools/README.md: -------------------------------------------------------------------------------- 1 | # Adobe Target Tools 2 | -------------------------------------------------------------------------------- /packages/target-tools/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | inputSourceMap: true, 3 | sourceMaps: true, 4 | ignore: ["node_modules/**"], 5 | env: { 6 | development: { 7 | presets: [ 8 | [ 9 | "@babel/preset-env", 10 | { 11 | targets: { 12 | node: "current" 13 | } 14 | } 15 | ] 16 | ] 17 | }, 18 | production: { 19 | exclude: [/\/core-js\//], 20 | 21 | presets: [ 22 | [ 23 | "@babel/preset-env", 24 | { 25 | useBuiltIns: "usage", 26 | corejs: 3, 27 | modules: false, 28 | targets: { 29 | node: "8", 30 | browsers: [ 31 | "last 2 Chrome versions", 32 | "last 2 Firefox versions", 33 | "last 2 Safari versions" 34 | ] 35 | } 36 | } 37 | ] 38 | ], 39 | plugins: ["@babel/plugin-proposal-object-rest-spread"] 40 | } 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/apis/DeliveryApi.d.ts: -------------------------------------------------------------------------------- 1 | import * as runtime from '../runtime'; 2 | import { DeliveryRequest, DeliveryResponse } from '../models'; 3 | export interface ExecuteDeliveryRequest { 4 | imsOrgId: string; 5 | sessionId: string; 6 | deliveryRequest: DeliveryRequest; 7 | version?: string; 8 | } 9 | export declare class DeliveryApi extends runtime.BaseAPI { 10 | executeRaw(requestParameters: ExecuteDeliveryRequest): Promise>; 11 | execute(imsOrgId: string, sessionId: string, deliveryRequest: DeliveryRequest, version?: string): Promise; 12 | } 13 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/apis/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './DeliveryApi'; 2 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './runtime'; 2 | export * from './apis'; 3 | export * from './models'; 4 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/Action.d.ts: -------------------------------------------------------------------------------- 1 | import { OneOfstringobject } from './'; 2 | export interface Action { 3 | type?: string; 4 | selector?: string; 5 | cssSelector?: string; 6 | content?: OneOfstringobject; 7 | } 8 | export declare function ActionFromJSON(json: any): Action; 9 | export declare function ActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Action; 10 | export declare function ActionToJSON(value?: Action | null): any; 11 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/Address.d.ts: -------------------------------------------------------------------------------- 1 | export interface Address { 2 | url?: string; 3 | referringUrl?: string; 4 | } 5 | export declare function AddressFromJSON(json: any): Address; 6 | export declare function AddressFromJSONTyped(json: any, ignoreDiscriminator: boolean): Address; 7 | export declare function AddressToJSON(value?: Address | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/AnalyticsPayload.d.ts: -------------------------------------------------------------------------------- 1 | export interface AnalyticsPayload { 2 | pe?: string; 3 | tnta?: string; 4 | } 5 | export declare function AnalyticsPayloadFromJSON(json: any): AnalyticsPayload; 6 | export declare function AnalyticsPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnalyticsPayload; 7 | export declare function AnalyticsPayloadToJSON(value?: AnalyticsPayload | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/AnalyticsRequest.d.ts: -------------------------------------------------------------------------------- 1 | import { LoggingType } from './'; 2 | export interface AnalyticsRequest { 3 | supplementalDataId?: string; 4 | logging?: LoggingType; 5 | trackingServer?: string; 6 | trackingServerSecure?: string; 7 | } 8 | export declare function AnalyticsRequestFromJSON(json: any): AnalyticsRequest; 9 | export declare function AnalyticsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnalyticsRequest; 10 | export declare function AnalyticsRequestToJSON(value?: AnalyticsRequest | null): any; 11 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/AnalyticsResponse.d.ts: -------------------------------------------------------------------------------- 1 | import { AnalyticsPayload } from './'; 2 | export interface AnalyticsResponse { 3 | payload?: AnalyticsPayload; 4 | } 5 | export declare function AnalyticsResponseFromJSON(json: any): AnalyticsResponse; 6 | export declare function AnalyticsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnalyticsResponse; 7 | export declare function AnalyticsResponseToJSON(value?: AnalyticsResponse | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/Application.d.ts: -------------------------------------------------------------------------------- 1 | export interface Application { 2 | id?: string; 3 | name?: string; 4 | version?: string; 5 | } 6 | export declare function ApplicationFromJSON(json: any): Application; 7 | export declare function ApplicationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Application; 8 | export declare function ApplicationToJSON(value?: Application | null): any; 9 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/AudienceManager.d.ts: -------------------------------------------------------------------------------- 1 | export interface AudienceManager { 2 | locationHint?: number; 3 | blob?: string; 4 | } 5 | export declare function AudienceManagerFromJSON(json: any): AudienceManager; 6 | export declare function AudienceManagerFromJSONTyped(json: any, ignoreDiscriminator: boolean): AudienceManager; 7 | export declare function AudienceManagerToJSON(value?: AudienceManager | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/AuthenticatedState.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum AuthenticatedState { 2 | Unknown = "unknown", 3 | Authenticated = "authenticated", 4 | LoggedOut = "logged_out" 5 | } 6 | export declare function AuthenticatedStateFromJSON(json: any): AuthenticatedState; 7 | export declare function AuthenticatedStateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticatedState; 8 | export declare function AuthenticatedStateToJSON(value?: AuthenticatedState | null): any; 9 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/Browser.d.ts: -------------------------------------------------------------------------------- 1 | export interface Browser { 2 | host?: string; 3 | language?: string; 4 | webGLRenderer?: string; 5 | } 6 | export declare function BrowserFromJSON(json: any): Browser; 7 | export declare function BrowserFromJSONTyped(json: any, ignoreDiscriminator: boolean): Browser; 8 | export declare function BrowserToJSON(value?: Browser | null): any; 9 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/ChannelType.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum ChannelType { 2 | Mobile = "mobile", 3 | Web = "web" 4 | } 5 | export declare function ChannelTypeFromJSON(json: any): ChannelType; 6 | export declare function ChannelTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChannelType; 7 | export declare function ChannelTypeToJSON(value?: ChannelType | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/ClientHints.d.ts: -------------------------------------------------------------------------------- 1 | export interface ClientHints { 2 | mobile?: boolean; 3 | model?: string; 4 | platform?: string; 5 | platformVersion?: string; 6 | browserUAWithMajorVersion?: string; 7 | browserUAWithFullVersion?: string; 8 | architecture?: string; 9 | bitness?: string; 10 | } 11 | export declare function ClientHintsFromJSON(json: any): ClientHints; 12 | export declare function ClientHintsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientHints; 13 | export declare function ClientHintsToJSON(value?: ClientHints | null): any; 14 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/Context.d.ts: -------------------------------------------------------------------------------- 1 | import { Address, Application, Browser, ChannelType, ClientHints, Geo, MobilePlatform, Screen, Window } from './'; 2 | export interface Context { 3 | channel: ChannelType; 4 | mobilePlatform?: MobilePlatform; 5 | application?: Application; 6 | screen?: Screen; 7 | window?: Window; 8 | browser?: Browser; 9 | address?: Address; 10 | geo?: Geo; 11 | timeOffsetInMinutes?: number; 12 | userAgent?: string; 13 | clientHints?: ClientHints; 14 | beacon?: boolean; 15 | } 16 | export declare function ContextFromJSON(json: any): Context; 17 | export declare function ContextFromJSONTyped(json: any, ignoreDiscriminator: boolean): Context; 18 | export declare function ContextToJSON(value?: Context | null): any; 19 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/CustomerId.d.ts: -------------------------------------------------------------------------------- 1 | import { AuthenticatedState } from './'; 2 | export interface CustomerId { 3 | id: string; 4 | integrationCode: string; 5 | authenticatedState: AuthenticatedState; 6 | } 7 | export declare function CustomerIdFromJSON(json: any): CustomerId; 8 | export declare function CustomerIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerId; 9 | export declare function CustomerIdToJSON(value?: CustomerId | null): any; 10 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/DateTime.d.ts: -------------------------------------------------------------------------------- 1 | export declare type DateTime = Date; 2 | export declare function DateTimeFromJSON(value: any): Date; 3 | export declare function DateTimeFromJSONTyped(value: any, ignoreDiscriminator: boolean): Date; 4 | export declare function DateTimeToJSON(value?: DateTime | null): any; 5 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/DecisioningMethod.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum DecisioningMethod { 2 | ServerSide = "server-side", 3 | OnDevice = "on-device", 4 | Hybrid = "hybrid" 5 | } 6 | export declare function DecisioningMethodFromJSON(json: any): DecisioningMethod; 7 | export declare function DecisioningMethodFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecisioningMethod; 8 | export declare function DecisioningMethodToJSON(value?: DecisioningMethod | null): any; 9 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/DeliveryRequest.d.ts: -------------------------------------------------------------------------------- 1 | import { Context, ExecuteRequest, ExperienceCloud, Notification, PrefetchRequest, Preview, Property, QAMode, Telemetry, Trace, VisitorId } from './'; 2 | export interface DeliveryRequest { 3 | requestId?: string; 4 | impressionId?: string; 5 | id?: VisitorId; 6 | environmentId?: number; 7 | property?: Property; 8 | trace?: Trace; 9 | context: Context; 10 | experienceCloud?: ExperienceCloud; 11 | execute?: ExecuteRequest; 12 | prefetch?: PrefetchRequest; 13 | telemetry?: Telemetry; 14 | notifications?: Array; 15 | qaMode?: QAMode; 16 | preview?: Preview; 17 | } 18 | export declare function DeliveryRequestFromJSON(json: any): DeliveryRequest; 19 | export declare function DeliveryRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeliveryRequest; 20 | export declare function DeliveryRequestToJSON(value?: DeliveryRequest | null): any; 21 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/DeliveryResponse.d.ts: -------------------------------------------------------------------------------- 1 | import { ExecuteResponse, NotificationResponse, PrefetchResponse, VisitorId } from './'; 2 | export interface DeliveryResponse { 3 | status?: number; 4 | requestId?: string; 5 | id?: VisitorId; 6 | client?: string; 7 | edgeHost?: string; 8 | execute?: ExecuteResponse; 9 | prefetch?: PrefetchResponse; 10 | notifications?: Array; 11 | telemetryServerToken?: string; 12 | } 13 | export declare function DeliveryResponseFromJSON(json: any): DeliveryResponse; 14 | export declare function DeliveryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeliveryResponse; 15 | export declare function DeliveryResponseToJSON(value?: DeliveryResponse | null): any; 16 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/DeviceType.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum DeviceType { 2 | Phone = "phone", 3 | Tablet = "tablet" 4 | } 5 | export declare function DeviceTypeFromJSON(json: any): DeviceType; 6 | export declare function DeviceTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeviceType; 7 | export declare function DeviceTypeToJSON(value?: DeviceType | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/ExecuteRequest.d.ts: -------------------------------------------------------------------------------- 1 | import { MboxRequest, RequestDetails } from './'; 2 | export interface ExecuteRequest { 3 | pageLoad?: RequestDetails; 4 | mboxes?: Array; 5 | } 6 | export declare function ExecuteRequestFromJSON(json: any): ExecuteRequest; 7 | export declare function ExecuteRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExecuteRequest; 8 | export declare function ExecuteRequestToJSON(value?: ExecuteRequest | null): any; 9 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/ExecuteResponse.d.ts: -------------------------------------------------------------------------------- 1 | import { MboxResponse, PageLoadResponse } from './'; 2 | export interface ExecuteResponse { 3 | pageLoad?: PageLoadResponse; 4 | mboxes?: Array; 5 | } 6 | export declare function ExecuteResponseFromJSON(json: any): ExecuteResponse; 7 | export declare function ExecuteResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExecuteResponse; 8 | export declare function ExecuteResponseToJSON(value?: ExecuteResponse | null): any; 9 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/ExecutionMode.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum ExecutionMode { 2 | Edge = "edge", 3 | Local = "local" 4 | } 5 | export declare function ExecutionModeFromJSON(json: any): ExecutionMode; 6 | export declare function ExecutionModeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExecutionMode; 7 | export declare function ExecutionModeToJSON(value?: ExecutionMode | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/ExperienceCloud.d.ts: -------------------------------------------------------------------------------- 1 | import { AnalyticsRequest, AudienceManager } from './'; 2 | export interface ExperienceCloud { 3 | audienceManager?: AudienceManager; 4 | analytics?: AnalyticsRequest; 5 | } 6 | export declare function ExperienceCloudFromJSON(json: any): ExperienceCloud; 7 | export declare function ExperienceCloudFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExperienceCloud; 8 | export declare function ExperienceCloudToJSON(value?: ExperienceCloud | null): any; 9 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/Geo.d.ts: -------------------------------------------------------------------------------- 1 | export interface Geo { 2 | ipAddress?: string; 3 | latitude?: number; 4 | longitude?: number; 5 | countryCode?: string; 6 | stateCode?: string; 7 | city?: string; 8 | zip?: string; 9 | } 10 | export declare function GeoFromJSON(json: any): Geo; 11 | export declare function GeoFromJSONTyped(json: any, ignoreDiscriminator: boolean): Geo; 12 | export declare function GeoToJSON(value?: Geo | null): any; 13 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/LoggingType.d.ts: -------------------------------------------------------------------------------- 1 | export declare enum LoggingType { 2 | ServerSide = "server_side", 3 | ClientSide = "client_side" 4 | } 5 | export declare function LoggingTypeFromJSON(json: any): LoggingType; 6 | export declare function LoggingTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): LoggingType; 7 | export declare function LoggingTypeToJSON(value?: LoggingType | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/MboxRequest.d.ts: -------------------------------------------------------------------------------- 1 | import { RequestDetails } from './'; 2 | export interface MboxRequest extends RequestDetails { 3 | index?: number; 4 | name?: string; 5 | } 6 | export declare function MboxRequestFromJSON(json: any): MboxRequest; 7 | export declare function MboxRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MboxRequest; 8 | export declare function MboxRequestToJSON(value?: MboxRequest | null): any; 9 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/MboxRequestAllOf.d.ts: -------------------------------------------------------------------------------- 1 | export interface MboxRequestAllOf { 2 | index?: number; 3 | name?: string; 4 | } 5 | export declare function MboxRequestAllOfFromJSON(json: any): MboxRequestAllOf; 6 | export declare function MboxRequestAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): MboxRequestAllOf; 7 | export declare function MboxRequestAllOfToJSON(value?: MboxRequestAllOf | null): any; 8 | -------------------------------------------------------------------------------- /packages/target-tools/delivery-api-client/models/MboxResponse.d.ts: -------------------------------------------------------------------------------- 1 | import { AnalyticsResponse, Metric, Option } from './'; 2 | export interface MboxResponse { 3 | $type?: string; 4 | index?: number; 5 | name?: string; 6 | options?: Array