Skip to content

Commit b5a48fa

Browse files
authored
Merge pull request #57 from adjust/v570
Version 5.7.0
2 parents e088ac9 + 56b99d1 commit b5a48fa

111 files changed

Lines changed: 12437 additions & 26612 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.babelrc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
}]
77
],
88
"plugins": [
9-
"es6-promise",
109
"@babel/plugin-transform-flow-comments",
11-
["@babel/plugin-transform-runtime", {"version": "7.18.10"}]
10+
["@babel/plugin-transform-runtime", {"version": "7.24.3"}]
1211
],
1312
"overrides": [
1413
{
@@ -18,9 +17,6 @@
1817
["@babel/preset-env", {
1918
"targets": ">0.25%, not dead, ie 11"
2019
}]
21-
],
22-
"plugins": [
23-
"@babel/plugin-proposal-class-properties"
2420
]
2521
}
2622
]

.eslintrc

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,20 @@
1313
"eslint:recommended",
1414
"plugin:flowtype/recommended"
1515
],
16-
"plugins": ["flowtype"],
16+
"plugins": [
17+
"flowtype"
18+
],
1719
"globals": {
1820
"Promise": true,
1921
"__ADJUST__NAMESPACE": true,
2022
"__ADJUST__SDK_VERSION": true,
2123
"Utils": true
2224
},
2325
"rules": {
24-
"semi": ["error", "never"],
25-
"space-before-function-paren": ["error", "always"],
26-
"quotes": ["error", "single"],
26+
"quotes": [
27+
"error",
28+
"single"
29+
],
2730
"prefer-arrow-callback": "error",
2831
"prefer-object-spread": "error",
2932
"flowtype/no-types-missing-file-annotation": "off"
@@ -35,33 +38,36 @@
3538
"plugin:@typescript-eslint/eslint-recommended",
3639
"plugin:@typescript-eslint/recommended"
3740
],
38-
"files": ["./src/**/*.ts"],
41+
"files": [
42+
"./src/**/*.ts"
43+
],
3944
"parser": "@typescript-eslint/parser",
4045
"parserOptions": {
4146
"project": "./tsconfig.json"
4247
},
43-
"plugins": ["@typescript-eslint"],
48+
"plugins": [
49+
"@typescript-eslint"
50+
],
4451
"rules": {
45-
"semi": ["error", "never"],
46-
"space-before-function-paren": ["error", {
47-
"anonymous": "always",
48-
"named": "never",
49-
"asyncArrow": "always"
50-
}
51-
],
5252
"eol-last": "error",
5353
"@typescript-eslint/ban-types": "warn",
5454
"@typescript-eslint/explicit-module-boundary-types": "off",
5555
"@typescript-eslint/no-namespace": "warn"
5656
}
5757
},
5858
{
59-
"extends": ["plugin:jest/style"],
60-
"files": ["./src/**/*.spec.*"],
59+
"extends": [
60+
"plugin:jest/style"
61+
],
62+
"files": [
63+
"./src/**/*.spec.*"
64+
],
6165
"env": {
6266
"jest": true
6367
},
64-
"plugins": ["jest"],
68+
"plugins": [
69+
"jest"
70+
],
6571
"rules": {
6672
"jest/prefer-to-have-length": "off",
6773
"jest/no-disabled-tests": "error",

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
### Version 5.7.0 (16th August 2024)
2+
#### Added
3+
- Added asynchronous function `waitForWebUUID`, returning a Promise which resolves when `web_uuid` becomes available.
4+
- Added asynchronous function `waitForAttribution`, returning a Promise which resolves when attribution data received from Adjust Backend.
5+
6+
#### Changed
7+
- [UrlStrategy reworked](https://dev.adjust.com/en/sdk/web/features/privacy#url-strategy).
8+
- [Third Party Sharing reworked](https://dev.adjust.com/en/sdk/web/features/privacy).
9+
- Outdated Smart Banners removed.
10+
11+
---
12+
113
### Version 5.6.0 (30th January 2023)
214
#### Added
315
- Added a return of Promise from `trackEvent` method.

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pipeline {
44
tools {
5-
nodejs 'nodejs_14.20.0'
5+
nodejs 'nodejs_20.11.1'
66
}
77
agent {
88
node {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.6.0
1+
5.7.0

dist/INTEGRITY

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sha384-BqbTn9xyk5DPznti1ZP8ksxKiOFhKufLBFWm5eNMCnZABFSG1eqQfcu5dsiZJHu5
1+
sha384-WE6fJqvcE0mjcC/fPYooIQAOhsHpTDVYjC52i6Asn3LECEpjHyI5zUwD8/5esthg

dist/adjust-latest.d.ts

Lines changed: 59 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,33 @@ declare namespace Adjust {
9999
state: string
100100
}
101101

102+
/**
103+
* @deprecated
104+
*/
105+
type UrlStartegyLiterals = 'china' | 'india';
106+
107+
interface UrlStrategyConfig {
108+
/** The country or countries of data residence, or the endpoints to which you want to send SDK traffic. */
109+
domains: Array<string>;
110+
111+
/** Whether the source should prefix a subdomain. */
112+
useSubdomains: boolean;
113+
114+
/** Whether the domain should be used for data residency. */
115+
isDataResidency?: boolean;
116+
}
117+
118+
interface ThirdPartySharingOptions {
119+
isEnabled: boolean;
120+
granularOptions: Record<string, Record<string, string>>;
121+
partnerSharingSettings: Record<string, Record<string, boolean>>;
122+
}
123+
124+
class ThirdPartySharing implements ThirdPartySharingOptions {
125+
public addGranularOption(partnerName: string, key: string, value: string)
126+
public addPartnerSharingSetting(partnerName: string, key: string, value: boolean)
127+
}
128+
102129
interface InitOptions {
103130

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

124151
/** Optional. By default all requests go to Adjust's endpoints. You are able to redirect all requests to your custom
125-
* endpoint. */
152+
* endpoint.
153+
*
154+
* @deprecated use {@link urlStrategy} property instead
155+
*/
126156
customUrl?: string;
127157

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

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

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

172-
/**
173-
* Optional. Query selector to define html container if you want to see your logs directly on the screen. This could
206+
/** Optional. Query selector to define html container if you want to see your logs directly on the screen. This could
174207
* be useful when testing on mobile devices.
175208
*
176209
* @example
@@ -206,19 +239,33 @@ declare namespace Adjust {
206239
*
207240
* @example
208241
* const attribution = Adjust.getAttribution();
242+
*
243+
* @deprecated Use {@link waitForAttribution} instead
209244
*/
210245
function getAttribution(): Attribution | undefined
211246

247+
/**
248+
* Returns a promise which resolves when current attribution information becomes available
249+
*/
250+
function waitForAttribution(): Promise<Attribution>
251+
212252
/**
213253
* Get web_uuid - a unique ID of user generated per subdomain and per browser
214254
*
215255
* @returns `web_uuid` if available or `undefined` otherwise
216256
*
217257
* @example
218258
* const webUuid = Adjust.getWebUUID();
259+
*
260+
* @deprecated Use {@link waitForWebUUID} instead
219261
*/
220262
function getWebUUID(): string | undefined
221263

264+
/**
265+
* Returns a promise which resolves when `web_uuid` becomes available
266+
*/
267+
function waitForWebUUID(): Promise<string>
268+
222269
/**
223270
* Set referrer manually. Please note that `referrer` should be URL-encoded.
224271
*
@@ -369,59 +416,15 @@ declare namespace Adjust {
369416
*
370417
* Marketing Opt-out, which is disabling third-party sharing ability. This method will notify our backed in the same
371418
* manner as it does for GDPR Forget me.
419+
*
420+
* @deprecated Use {@link trackThirdPartySharing} instead
372421
*/
373422
function disableThirdPartySharing(): void
374423

375-
interface SmartBannerOptions {
376-
377-
/** Web token to initialise Smart Banner */
378-
webToken: string;
379-
380-
/** Optional. Logging level used by SDK instance. By default this param is set to `error`. We highly recommend that
381-
* you use `verbose` when testing in order to see precise logs and to make sure integration is done properly.
382-
* Here are more details about each log level:
383-
* - `verbose` - will print detailed messages in case of certain actions
384-
* - `info` - will print only basic info messages, warnings and errors
385-
* - `warning` - will print only warning and error messages
386-
* - `error` - will print only error message
387-
* - `none` - won't print anything
388-
*/
389-
logLevel?: LogLevel;
390-
391-
/** Optional. The data residency feature allows you to choose the country in which Adjust will store your data. This
392-
* is useful if you are operating in a country with strict privacy requirements. When you set up data residency,
393-
* Adjust will store your data in a data center located in the region your have chosen. */
394-
dataResidency?: 'EU' | 'TR' | 'US';
395-
396-
/** Optional. Callback which is called when SmartBanner view is created and shown. */
397-
onCreated?: () => any;
398-
399-
/** Optional. Callback which is called when SmartBanner is being dismissed with a closing button on it. */
400-
onDismissed?: () => any;
401-
}
402-
403424
/**
404-
* Initiate Smart Banner.
405-
*
406-
* This method gets Smart Banner data and creates Smart Banner UI.
407-
*
408-
* @param {SmartBannerOptions} options Options to initiate Smart Banner.
409-
*
410-
* @example
411-
* Adjust.initSmartBanner({
412-
* webToken: 'YOUR_WEB_TOKEN',
413-
* logLevel: 'verbose'
414-
* });
415-
*
416-
* @example
417-
* Adjust.initSmartBanner({
418-
* webToken: 'YOUR_WEB_TOKEN',
419-
* logLevel: 'error',
420-
* dataResidency: 'EU',
421-
* });
425+
* Track third party sharing
422426
*/
423-
function initSmartBanner(options: SmartBannerOptions): void
424-
427+
function trackThirdPartySharing(adjustThirdPartySharing: ThirdPartySharingOptions): void
425428
}
426429

427430
export default Adjust

0 commit comments

Comments
 (0)