Skip to content

Commit

Permalink
Merge pull request #57 from adjust/v570
Browse files Browse the repository at this point in the history
Version 5.7.0
  • Loading branch information
YaraMatkova authored Aug 16, 2024
2 parents e088ac9 + 56b99d1 commit b5a48fa
Show file tree
Hide file tree
Showing 111 changed files with 12,437 additions and 26,612 deletions.
6 changes: 1 addition & 5 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
}]
],
"plugins": [
"es6-promise",
"@babel/plugin-transform-flow-comments",
["@babel/plugin-transform-runtime", {"version": "7.18.10"}]
["@babel/plugin-transform-runtime", {"version": "7.24.3"}]
],
"overrides": [
{
Expand All @@ -18,9 +17,6 @@
["@babel/preset-env", {
"targets": ">0.25%, not dead, ie 11"
}]
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
]
Expand Down
38 changes: 22 additions & 16 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@
"eslint:recommended",
"plugin:flowtype/recommended"
],
"plugins": ["flowtype"],
"plugins": [
"flowtype"
],
"globals": {
"Promise": true,
"__ADJUST__NAMESPACE": true,
"__ADJUST__SDK_VERSION": true,
"Utils": true
},
"rules": {
"semi": ["error", "never"],
"space-before-function-paren": ["error", "always"],
"quotes": ["error", "single"],
"quotes": [
"error",
"single"
],
"prefer-arrow-callback": "error",
"prefer-object-spread": "error",
"flowtype/no-types-missing-file-annotation": "off"
Expand All @@ -35,33 +38,36 @@
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"files": ["./src/**/*.ts"],
"files": [
"./src/**/*.ts"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"plugins": [
"@typescript-eslint"
],
"rules": {
"semi": ["error", "never"],
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"eol-last": "error",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-namespace": "warn"
}
},
{
"extends": ["plugin:jest/style"],
"files": ["./src/**/*.spec.*"],
"extends": [
"plugin:jest/style"
],
"files": [
"./src/**/*.spec.*"
],
"env": {
"jest": true
},
"plugins": ["jest"],
"plugins": [
"jest"
],
"rules": {
"jest/prefer-to-have-length": "off",
"jest/no-disabled-tests": "error",
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### Version 5.7.0 (16th August 2024)
#### Added
- Added asynchronous function `waitForWebUUID`, returning a Promise which resolves when `web_uuid` becomes available.
- Added asynchronous function `waitForAttribution`, returning a Promise which resolves when attribution data received from Adjust Backend.

#### Changed
- [UrlStrategy reworked](https://dev.adjust.com/en/sdk/web/features/privacy#url-strategy).
- [Third Party Sharing reworked](https://dev.adjust.com/en/sdk/web/features/privacy).
- Outdated Smart Banners removed.

---

### Version 5.6.0 (30th January 2023)
#### Added
- Added a return of Promise from `trackEvent` method.
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pipeline {
tools {
nodejs 'nodejs_14.20.0'
nodejs 'nodejs_20.11.1'
}
agent {
node {
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.0
5.7.0
2 changes: 1 addition & 1 deletion dist/INTEGRITY
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha384-BqbTn9xyk5DPznti1ZP8ksxKiOFhKufLBFWm5eNMCnZABFSG1eqQfcu5dsiZJHu5
sha384-WE6fJqvcE0mjcC/fPYooIQAOhsHpTDVYjC52i6Asn3LECEpjHyI5zUwD8/5esthg
115 changes: 59 additions & 56 deletions dist/adjust-latest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,33 @@ declare namespace Adjust {
state: string
}

/**
* @deprecated
*/
type UrlStartegyLiterals = 'china' | 'india';

interface UrlStrategyConfig {
/** The country or countries of data residence, or the endpoints to which you want to send SDK traffic. */
domains: Array<string>;

/** Whether the source should prefix a subdomain. */
useSubdomains: boolean;

/** Whether the domain should be used for data residency. */
isDataResidency?: boolean;
}

interface ThirdPartySharingOptions {
isEnabled: boolean;
granularOptions: Record<string, Record<string, string>>;
partnerSharingSettings: Record<string, Record<string, boolean>>;
}

class ThirdPartySharing implements ThirdPartySharingOptions {
public addGranularOption(partnerName: string, key: string, value: string)
public addPartnerSharingSetting(partnerName: string, key: string, value: boolean)
}

interface InitOptions {

/** Required to initialise SDK instance, please make sure to provide valid app token. */
Expand All @@ -122,19 +149,26 @@ declare namespace Adjust {
eventDeduplicationListLimit?: number;

/** Optional. By default all requests go to Adjust's endpoints. You are able to redirect all requests to your custom
* endpoint. */
* endpoint.
*
* @deprecated use {@link urlStrategy} property instead
*/
customUrl?: string;

/** Optional. The data residency feature allows you to choose the country in which Adjust will store your data. This
* is useful if you are operating in a country with strict privacy requirements. When you set up data residency,
* Adjust will store your data in a data center located in the region your have chosen. */
* Adjust will store your data in a data center located in the region your have chosen.
*
* @deprecated use {@link urlStrategy} property instead
*/
dataResidency?: 'EU' | 'TR' | 'US';

/** Optional. The Adjust SDK can use the url strategy setting to prioritise regional endpoints. */
urlStrategy?: 'india' | 'china';
/** Optional. The URL strategy feature allows you to set either:
* - The country in which Adjust stores your data (data residency).
* - The endpoint to which the Adjust SDK sends traffic (URL strategy).*/
urlStrategy?: UrlStartegyLiterals | UrlStrategyConfig;

/**
* Optional. A custom namespace for SDK data storage. If not set then default one is used.
/** Optional. A custom namespace for SDK data storage. If not set then default one is used.
* It's useful when there are multiple applications on the same domain to allow SDK distinguish storages and don't
* mix the data up.
*
Expand Down Expand Up @@ -169,8 +203,7 @@ declare namespace Adjust {
*/
logLevel?: LogLevel;

/**
* Optional. Query selector to define html container if you want to see your logs directly on the screen. This could
/** Optional. Query selector to define html container if you want to see your logs directly on the screen. This could
* be useful when testing on mobile devices.
*
* @example
Expand Down Expand Up @@ -206,19 +239,33 @@ declare namespace Adjust {
*
* @example
* const attribution = Adjust.getAttribution();
*
* @deprecated Use {@link waitForAttribution} instead
*/
function getAttribution(): Attribution | undefined

/**
* Returns a promise which resolves when current attribution information becomes available
*/
function waitForAttribution(): Promise<Attribution>

/**
* Get web_uuid - a unique ID of user generated per subdomain and per browser
*
* @returns `web_uuid` if available or `undefined` otherwise
*
* @example
* const webUuid = Adjust.getWebUUID();
*
* @deprecated Use {@link waitForWebUUID} instead
*/
function getWebUUID(): string | undefined

/**
* Returns a promise which resolves when `web_uuid` becomes available
*/
function waitForWebUUID(): Promise<string>

/**
* Set referrer manually. Please note that `referrer` should be URL-encoded.
*
Expand Down Expand Up @@ -369,59 +416,15 @@ declare namespace Adjust {
*
* Marketing Opt-out, which is disabling third-party sharing ability. This method will notify our backed in the same
* manner as it does for GDPR Forget me.
*
* @deprecated Use {@link trackThirdPartySharing} instead
*/
function disableThirdPartySharing(): void

interface SmartBannerOptions {

/** Web token to initialise Smart Banner */
webToken: string;

/** Optional. Logging level used by SDK instance. By default this param is set to `error`. We highly recommend that
* you use `verbose` when testing in order to see precise logs and to make sure integration is done properly.
* Here are more details about each log level:
* - `verbose` - will print detailed messages in case of certain actions
* - `info` - will print only basic info messages, warnings and errors
* - `warning` - will print only warning and error messages
* - `error` - will print only error message
* - `none` - won't print anything
*/
logLevel?: LogLevel;

/** Optional. The data residency feature allows you to choose the country in which Adjust will store your data. This
* is useful if you are operating in a country with strict privacy requirements. When you set up data residency,
* Adjust will store your data in a data center located in the region your have chosen. */
dataResidency?: 'EU' | 'TR' | 'US';

/** Optional. Callback which is called when SmartBanner view is created and shown. */
onCreated?: () => any;

/** Optional. Callback which is called when SmartBanner is being dismissed with a closing button on it. */
onDismissed?: () => any;
}

/**
* Initiate Smart Banner.
*
* This method gets Smart Banner data and creates Smart Banner UI.
*
* @param {SmartBannerOptions} options Options to initiate Smart Banner.
*
* @example
* Adjust.initSmartBanner({
* webToken: 'YOUR_WEB_TOKEN',
* logLevel: 'verbose'
* });
*
* @example
* Adjust.initSmartBanner({
* webToken: 'YOUR_WEB_TOKEN',
* logLevel: 'error',
* dataResidency: 'EU',
* });
* Track third party sharing
*/
function initSmartBanner(options: SmartBannerOptions): void

function trackThirdPartySharing(adjustThirdPartySharing: ThirdPartySharingOptions): void
}

export default Adjust
Loading

0 comments on commit b5a48fa

Please sign in to comment.