react-native-nami-sdk 3.4.4-rc.202607080215 → 3.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/dist/specs/NativeNamiCampaignManager.d.ts +1 -1
- package/dist/src/types.d.ts +3 -2
- package/dist/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/react-native-nami-sdk.podspec +1 -1
- package/specs/NativeNamiCampaignManager.ts +1 -1
- package/src/__tests__/customAttributeValue.type.test.ts +32 -0
- package/src/types.ts +3 -2
- package/src/version.ts +1 -1
package/android/build.gradle
CHANGED
|
@@ -85,8 +85,8 @@ dependencies {
|
|
|
85
85
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
86
86
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
87
87
|
|
|
88
|
-
playImplementation "com.namiml:sdk-android:3.4.4
|
|
89
|
-
amazonImplementation "com.namiml:sdk-amazon:3.4.4
|
|
88
|
+
playImplementation "com.namiml:sdk-android:3.4.4"
|
|
89
|
+
amazonImplementation "com.namiml:sdk-amazon:3.4.4"
|
|
90
90
|
|
|
91
91
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
92
92
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"
|
|
@@ -3,7 +3,7 @@ export interface Spec extends TurboModule {
|
|
|
3
3
|
launch(label: string | null, withUrl: string | null, context: {
|
|
4
4
|
productGroups?: string[];
|
|
5
5
|
customAttributes?: {
|
|
6
|
-
[key: string]: string | boolean | number;
|
|
6
|
+
[key: string]: string | boolean | number | null;
|
|
7
7
|
};
|
|
8
8
|
customObject?: {
|
|
9
9
|
[key: string]: unknown;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -97,9 +97,10 @@ export type FailureResultObject = {
|
|
|
97
97
|
*
|
|
98
98
|
* Values are matched strictly by type: the string "true" and the boolean true are
|
|
99
99
|
* distinct values that never compare equal. A key present with any non-null value —
|
|
100
|
-
* including false or "false" — is considered "set".
|
|
100
|
+
* including false or "false" — is considered "set". Passing `null` (or omitting the
|
|
101
|
+
* key) means the attribute is not set; the native bridge omits null values entirely.
|
|
101
102
|
*/
|
|
102
|
-
export type CustomAttributeValue = string | boolean | number;
|
|
103
|
+
export type CustomAttributeValue = string | boolean | number | null;
|
|
103
104
|
export type PaywallLaunchContext = {
|
|
104
105
|
productGroups?: string[];
|
|
105
106
|
customAttributes: {
|
package/dist/src/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ export interface Spec extends TurboModule {
|
|
|
7
7
|
withUrl: string | null,
|
|
8
8
|
context: {
|
|
9
9
|
productGroups?: string[];
|
|
10
|
-
customAttributes?: { [key: string]: string | boolean | number };
|
|
10
|
+
customAttributes?: { [key: string]: string | boolean | number | null };
|
|
11
11
|
customObject?: { [key: string]: unknown };
|
|
12
12
|
} | null,
|
|
13
13
|
completion: (
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CustomAttributeValue, PaywallLaunchContext } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* NAM-2544: `null` is a permitted custom-attribute value meaning "attribute not set".
|
|
5
|
+
*
|
|
6
|
+
* This is an executable example of the widened shape and a runtime check that a null
|
|
7
|
+
* attribute round-trips through a PaywallLaunchContext literal. Note: ts-jest runs in
|
|
8
|
+
* transpile-only mode here (tsconfig `isolatedModules: true`), so it does NOT typecheck.
|
|
9
|
+
* The compile-time guard is `npm run build` (tsc), which type-checks the public type
|
|
10
|
+
* against the TurboModule spec at the NamiCampaignManager launch call site — reverting
|
|
11
|
+
* either the type or the spec widening breaks that build.
|
|
12
|
+
*/
|
|
13
|
+
describe('CustomAttributeValue null support (NAM-2544)', () => {
|
|
14
|
+
it('permits null in a PaywallLaunchContext customAttributes literal', () => {
|
|
15
|
+
const context: PaywallLaunchContext = {
|
|
16
|
+
customAttributes: {
|
|
17
|
+
lastSession: null,
|
|
18
|
+
tier: 'premium',
|
|
19
|
+
isTrial: false,
|
|
20
|
+
seatCount: 3,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
expect(context.customAttributes.lastSession).toBeNull();
|
|
25
|
+
expect(context.customAttributes.tier).toBe('premium');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('allows null as a standalone CustomAttributeValue', () => {
|
|
29
|
+
const value: CustomAttributeValue = null;
|
|
30
|
+
expect(value).toBeNull();
|
|
31
|
+
});
|
|
32
|
+
});
|
package/src/types.ts
CHANGED
|
@@ -208,9 +208,10 @@ export type FailureResultObject = {
|
|
|
208
208
|
*
|
|
209
209
|
* Values are matched strictly by type: the string "true" and the boolean true are
|
|
210
210
|
* distinct values that never compare equal. A key present with any non-null value —
|
|
211
|
-
* including false or "false" — is considered "set".
|
|
211
|
+
* including false or "false" — is considered "set". Passing `null` (or omitting the
|
|
212
|
+
* key) means the attribute is not set; the native bridge omits null values entirely.
|
|
212
213
|
*/
|
|
213
|
-
export type CustomAttributeValue = string | boolean | number;
|
|
214
|
+
export type CustomAttributeValue = string | boolean | number | null;
|
|
214
215
|
|
|
215
216
|
export type PaywallLaunchContext = {
|
|
216
217
|
// Can contain multiple product group identifiers
|
package/src/version.ts
CHANGED