Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
82f8cae
feat(core): Rees46Config.appDomain names the host of API v3, app.rees…
Xyzcancer Nov 17, 2026
55e7b37
feat(core): a namespace method asks the new core once and ends in the…
Xyzcancer Nov 17, 2026
cc161cb
feat(cart): bridges read the customer's cart with sdk.cart.get() on t…
Xyzcancer Nov 17, 2026
1209ff5
feat(notifications): bridges report push events, read and send the pu…
Xyzcancer Nov 17, 2026
11e5736
feat(stories): bridges read a stories block as StoriesBlock with sdk.…
Xyzcancer Nov 17, 2026
1037d1c
feat(predict): bridges read the probability to purchase with sdk.pred…
Xyzcancer Nov 17, 2026
100c76f
feat(loyalty): bridges join the loyalty program and read a member's s…
Xyzcancer Nov 17, 2026
e5475dd
feat(sliders): bridges read a banner slider with sdk.sliders.get(code…
Xyzcancer Nov 17, 2026
7ace9d9
feat(core): a namespace method refuses wrong arguments before its req…
Xyzcancer Nov 17, 2026
aefe97c
feat(tracking): bridges report a slider's banner shown or tapped with…
Xyzcancer Nov 17, 2026
286258e
feat(products): bridges read the catalog with sdk.products on the new…
Xyzcancer Nov 17, 2026
b24c5c4
feat(collections): bridges read a collection's products with sdk.coll…
Xyzcancer Nov 17, 2026
66c6f7e
feat(recommendations): bridges read a recommendation block with sdk.r…
Xyzcancer Nov 17, 2026
5b10ce2
feat(search): bridges search the catalog with sdk.search.blank, insta…
Xyzcancer Nov 17, 2026
705f5c1
feat(products): a product's optional text the server sends empty is n…
Xyzcancer Nov 17, 2026
96b232f
feat(search): an instant or a full search answer without products is …
Xyzcancer Nov 17, 2026
774c497
feat(profile): bridges read the customer's profile and last order and…
Xyzcancer Nov 17, 2026
3efe716
feat(subscriptions): bridges manage and check the customer's subscrip…
Xyzcancer Nov 17, 2026
ea72dd1
feat(segments): bridges add the customer to a segment, take them out,…
Xyzcancer Nov 17, 2026
d030b49
feat(reviews): a namespace's request to a path of API v3 goes to Rees…
Xyzcancer Nov 17, 2026
e235722
feat(reviews): bridges send NPS, CSAT and CES ratings and read the po…
Xyzcancer Nov 17, 2026
61e44f2
Merge feat/DEV-4702-notifications into the bridges' namespaces
Xyzcancer Nov 17, 2026
88cbaff
Merge feat/DEV-4706-stories-predict-loyalty-sliders into the bridges'…
Xyzcancer Nov 17, 2026
2138cb2
Merge feat/DEV-4710-reviews into the bridges' namespaces
Xyzcancer Nov 17, 2026
a439321
feat(reviews): a namespace's request to a path of API v3 goes to Rees…
Xyzcancer Nov 17, 2026
935b016
feat(search): bridges talk to the search agent with sdk.search.agentD…
Xyzcancer Nov 17, 2026
3fefe55
Merge feat/DEV-4698-client into the bridges' namespaces
Xyzcancer Nov 17, 2026
0d4b1ba
Merge feat/DEV-4620-agent-search into the bridges' namespaces
Xyzcancer Nov 17, 2026
34106b1
refactor(core): one argument check for the bridges' namespaces: every…
Xyzcancer Nov 17, 2026
3e8cdf0
fix(notifications): a 2xx answer {"status":"error"} to mobile_push_to…
Xyzcancer Nov 17, 2026
c6ce30f
fix(predict): getProbabilityToPurchase asks GET /api/v3/cdp/users/pro…
Xyzcancer Nov 17, 2026
07bd824
fix(profile): set sends an empty externalId, telegramId or birthday a…
Xyzcancer Nov 17, 2026
3eef871
fix(loyalty): join refuses a birthday that is not an existing date, w…
Xyzcancer Nov 17, 2026
6510f82
fix(reviews): the ids of poll reviews, product reviews and client rev…
Xyzcancer Nov 17, 2026
aea8ca4
fix(search): the agent's session and message ids and the sessionId ar…
Xyzcancer Nov 17, 2026
fe5f724
fix(predict): predictManager.getProbabilityToPurchase asks GET api/v3…
Xyzcancer Nov 17, 2026
82bc109
fix(products): getInfo reads the product card's params, which product…
Xyzcancer Nov 17, 2026
1119f19
fix(recommendations): a blank title or link of the block is no value,…
Xyzcancer Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.personalization

import com.personalization.logs.LogCodes
import kotlin.jvm.internal.DefaultConstructorMarker
import com.personalization.logs.LogReasons
import com.personalization.logs.SdkLogs

Expand Down Expand Up @@ -45,6 +46,9 @@ import com.personalization.logs.SdkLogs
* device-level data (A/B group, push token, advertising id) is the app's and has no prefix. Android's
* Auto Backup restores these files on the user's new device, the `did` among them; see
* [SDK.deleteUserCredentials] for the files an app excludes from its backup rules to avoid that.
* @property appDomain the host of API v3, without a scheme: `app.rees46.ru`, unless the shop's cluster has
* its own. The SDK's methods that call API v3 go there. Popups v3 and stories v3 keep their own settings
* of it (`sdk.popups.appHost`, `PersonalizationStories.apiV3Domain`).
*
* Nothing here picks the core: [Rees46.initialize] and [Rees46.register] ask for the legacy one, and
* the new core is for the SDK's Flutter and React Native bridges, which start it with
Expand All @@ -70,8 +74,69 @@ data class Rees46Config @JvmOverloads constructor(
val storageKey: String? = null,
val deviceId: String? = null,
val sendAdvertisingId: Boolean = false,
val appDomain: String = "app.rees46.ru",
) {

/**
* The constructor of 2.52 and earlier, without [appDomain], in the form Kotlin compiles a call that
* leaves parameters to their defaults: [defaults] marks those parameters, one bit each, in order.
* Apps built against those releases call it; [appDomain] takes its default. Its plain form is one of
* the overloads above.
*/
@Deprecated(message = BEFORE_APP_DOMAIN, level = DeprecationLevel.HIDDEN)
@Suppress("UNUSED_PARAMETER")
constructor(
shopId: String,
apiDomain: String?,
stream: String?,
autoSendPushToken: Boolean,
needReInitialization: Boolean,
addTrailingSlash: Boolean,
tag: String?,
enableAutoPopupPresentation: Boolean,
logLevel: LogLevel?,
storageKey: String?,
deviceId: String?,
sendAdvertisingId: Boolean,
defaults: Int,
marker: DefaultConstructorMarker?,
) : this(
shopId = shopId,
apiDomain = apiDomain.takeUnless { defaults.leaves(1) } ?: DEFAULTS.apiDomain,
stream = stream.takeUnless { defaults.leaves(2) } ?: DEFAULTS.stream,
autoSendPushToken = if (defaults.leaves(3)) DEFAULTS.autoSendPushToken else autoSendPushToken,
needReInitialization = if (defaults.leaves(4)) DEFAULTS.needReInitialization else needReInitialization,
addTrailingSlash = if (defaults.leaves(5)) DEFAULTS.addTrailingSlash else addTrailingSlash,
tag = tag.takeUnless { defaults.leaves(6) } ?: DEFAULTS.tag,
enableAutoPopupPresentation = if (defaults.leaves(7)) DEFAULTS.enableAutoPopupPresentation else enableAutoPopupPresentation,
logLevel = logLevel.takeUnless { defaults.leaves(8) } ?: DEFAULTS.logLevel,
storageKey = if (defaults.leaves(9)) DEFAULTS.storageKey else storageKey,
deviceId = if (defaults.leaves(10)) DEFAULTS.deviceId else deviceId,
sendAdvertisingId = if (defaults.leaves(11)) DEFAULTS.sendAdvertisingId else sendAdvertisingId,
)

/** The `copy` of 2.52 and earlier, without [appDomain], for apps built against them: [appDomain] stays as it is. */
@Deprecated(message = BEFORE_APP_DOMAIN, level = DeprecationLevel.HIDDEN)
fun copy(
shopId: String = this.shopId,
apiDomain: String = this.apiDomain,
stream: String = this.stream,
autoSendPushToken: Boolean = this.autoSendPushToken,
needReInitialization: Boolean = this.needReInitialization,
addTrailingSlash: Boolean = this.addTrailingSlash,
tag: String = this.tag,
enableAutoPopupPresentation: Boolean = this.enableAutoPopupPresentation,
logLevel: LogLevel = this.logLevel,
storageKey: String? = this.storageKey,
deviceId: String? = this.deviceId,
sendAdvertisingId: Boolean = this.sendAdvertisingId,
): Rees46Config = copy(
shopId = shopId, apiDomain = apiDomain, stream = stream, autoSendPushToken = autoSendPushToken,
needReInitialization = needReInitialization, addTrailingSlash = addTrailingSlash, tag = tag,
enableAutoPopupPresentation = enableAutoPopupPresentation, logLevel = logLevel, storageKey = storageKey,
deviceId = deviceId, sendAdvertisingId = sendAdvertisingId, appDomain = appDomain,
)

/**
* The constructor of the releases with `coreV2`, for apps built against them: `coreV2` is ignored,
* and `true` is logged as `invalid_config` (`bridge_only`). Source that passes it no longer compiles.
Expand Down Expand Up @@ -123,6 +188,14 @@ data class Rees46Config @JvmOverloads constructor(
}

private companion object {
const val BEFORE_APP_DOMAIN = "The form of Rees46Config before appDomain, for apps built against 2.52 and earlier."

/** The defaults of the primary constructor, for the forms of earlier releases. */
val DEFAULTS = Rees46Config(shopId = "")

/** Whether a call in the compiled form of a default call left parameter [index] to its default. */
fun Int.leaves(index: Int): Boolean = this and (1 shl index) != 0

const val BRIDGE_ONLY_CORE = "Rees46Config.coreV2 is gone: the new core is for the SDK's Flutter and " +
"React Native bridges, which start it with Rees46.initializeBridge."

Expand Down
Loading
Loading