react-native-sdk-pianoio 0.3.0 → 0.3.2
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/README.md +3 -3
- package/SdkPianoio.podspec +4 -16
- package/android/build.gradle +12 -19
- package/android/gradle.properties +17 -2
- package/android/src/main/java/com/sdkpianoio/SdkPianoioModule.kt +543 -7
- package/android/src/main/java/com/sdkpianoio/SdkPianoioPackage.kt +3 -3
- package/ios/ComposerPianoImpl.swift +247 -0
- package/ios/MyComposerDelegate.swift +79 -206
- package/ios/SdkPianoio.swift +150 -0
- package/ios/SdkPianoioBridge.m +81 -0
- package/ios/services/TokenService.swift +10 -7
- package/lib/commonjs/NativeSdkPianoio.ts +20 -22
- package/lib/commonjs/PianoComposer.js +36 -97
- package/lib/commonjs/PianoComposer.js.map +1 -1
- package/lib/commonjs/debug.js +23 -0
- package/lib/commonjs/debug.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeSdkPianoio.ts +20 -22
- package/lib/module/PianoComposer.js +36 -97
- package/lib/module/PianoComposer.js.map +1 -1
- package/lib/module/debug.js +18 -0
- package/lib/module/debug.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeSdkPianoio.d.ts +9 -20
- package/lib/typescript/commonjs/src/NativeSdkPianoio.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/PianoComposer.d.ts +25 -28
- package/lib/typescript/commonjs/src/PianoComposer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/debug.d.ts +2 -0
- package/lib/typescript/commonjs/src/debug.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeSdkPianoio.d.ts +9 -20
- package/lib/typescript/module/src/NativeSdkPianoio.d.ts.map +1 -1
- package/lib/typescript/module/src/PianoComposer.d.ts +25 -28
- package/lib/typescript/module/src/PianoComposer.d.ts.map +1 -1
- package/lib/typescript/module/src/debug.d.ts +2 -0
- package/lib/typescript/module/src/debug.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +1 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +30 -15
- package/src/NativeSdkPianoio.ts +20 -22
- package/src/PianoComposer.tsx +36 -116
- package/src/debug.ts +19 -0
- package/src/index.tsx +1 -0
- package/ios/ComposerPiano.swift +0 -304
- package/ios/SdkPianoio.h +0 -4
- package/ios/SdkPianoio.mm +0 -283
- package/ios/services/ComposerService.swift +0 -49
@@ -2,135 +2,75 @@
|
|
2
2
|
|
3
3
|
import SdkPianoio from './NativeSdkPianoio';
|
4
4
|
class PianoComposer {
|
5
|
+
// --- Properties to hold configuration state ---
|
6
|
+
|
5
7
|
tags = [];
|
6
8
|
zoneId = null;
|
7
9
|
referrer = null;
|
8
10
|
customVariables = {};
|
9
11
|
userToken = null;
|
10
12
|
url = null;
|
13
|
+
|
14
|
+
// The constructor is private to force users to use the async `create` method.
|
11
15
|
constructor(aid) {
|
12
16
|
this.aid = aid;
|
13
17
|
}
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Creates and initializes a new PianoComposer instance.
|
21
|
+
* This is the entry point for using the library.
|
22
|
+
* @param aid Your Application ID from Piano.io
|
23
|
+
*/
|
14
24
|
static async create(aid) {
|
15
25
|
await SdkPianoio.initializeComposer(aid);
|
16
26
|
return new PianoComposer(aid);
|
17
27
|
}
|
28
|
+
|
29
|
+
// --- Configuration Methods ---
|
30
|
+
|
18
31
|
async addTag(tag) {
|
19
|
-
this.tags.push(tag);
|
32
|
+
this.tags.push(tag); // Store state locally
|
20
33
|
return SdkPianoio.addComposerTag(tag);
|
21
34
|
}
|
22
35
|
async addTags(tags) {
|
23
|
-
this.tags.push(...tags);
|
36
|
+
this.tags.push(...tags); // Store state locally
|
24
37
|
return SdkPianoio.addComposerTags(tags);
|
25
38
|
}
|
26
39
|
async setZoneId(zoneId) {
|
27
|
-
this.zoneId = zoneId;
|
40
|
+
this.zoneId = zoneId; // Store state locally
|
28
41
|
return SdkPianoio.setComposerZoneId(zoneId);
|
29
42
|
}
|
30
43
|
async setReferrer(referrer) {
|
31
|
-
this.referrer = referrer;
|
44
|
+
this.referrer = referrer; // Store state locally
|
32
45
|
return SdkPianoio.setComposerReferrer(referrer);
|
33
46
|
}
|
34
47
|
async setCustomVariable(name, value) {
|
35
|
-
this.customVariables[name] = value;
|
48
|
+
this.customVariables[name] = value; // Store state locally
|
36
49
|
return SdkPianoio.setComposerCustomVariable(name, value);
|
37
50
|
}
|
38
51
|
async setUserToken(token) {
|
39
|
-
this.userToken = token;
|
52
|
+
this.userToken = token; // Store state locally
|
40
53
|
return SdkPianoio.setComposerUserToken(token);
|
41
54
|
}
|
42
55
|
async setUrl(url) {
|
43
|
-
this.url = url;
|
56
|
+
this.url = url; // Store state locally
|
44
57
|
return SdkPianoio.setComposerUrl(url);
|
45
58
|
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}
|
58
|
-
async composerExecutionCompleted() {
|
59
|
-
try {
|
60
|
-
let r = await SdkPianoio.composerExecutionCompleted();
|
61
|
-
console.log('composerExecutionCompleted triggered');
|
62
|
-
console.log('Composer execution completed:', r);
|
63
|
-
} catch (e) {
|
64
|
-
console.error('Errore nel composerExecutionCompleted:', e);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
async showForm() {
|
68
|
-
return SdkPianoio.showForm();
|
69
|
-
}
|
70
|
-
async showLogin() {
|
71
|
-
try {
|
72
|
-
await SdkPianoio.showLogin();
|
73
|
-
console.log('Login triggered');
|
74
|
-
} catch (e) {
|
75
|
-
console.error('Errore nel login:', e);
|
76
|
-
}
|
77
|
-
}
|
78
|
-
async showTemplate() {
|
79
|
-
try {
|
80
|
-
await SdkPianoio.showTemplate();
|
81
|
-
console.log('Template triggered');
|
82
|
-
} catch (e) {
|
83
|
-
console.error('Errore nel Template:', e);
|
84
|
-
}
|
85
|
-
}
|
86
|
-
async showRecommendations() {
|
87
|
-
try {
|
88
|
-
await SdkPianoio.showRecommendations();
|
89
|
-
console.log('showRecommendations triggered');
|
90
|
-
} catch (e) {
|
91
|
-
console.error('Errore nel Template:', e);
|
92
|
-
}
|
93
|
-
}
|
94
|
-
async nonSite() {
|
95
|
-
try {
|
96
|
-
await SdkPianoio.nonSite();
|
97
|
-
console.log('nonSite triggered');
|
98
|
-
} catch (e) {
|
99
|
-
console.error('Errore nel Template:', e);
|
100
|
-
}
|
101
|
-
}
|
102
|
-
async userSegmentTrue() {
|
103
|
-
try {
|
104
|
-
await SdkPianoio.userSegmentTrue();
|
105
|
-
console.log('userSegmentTrue triggered');
|
106
|
-
} catch (e) {
|
107
|
-
console.error('Errore nel userSegmentTrue:', e);
|
108
|
-
}
|
109
|
-
}
|
110
|
-
async userSegmentFalse() {
|
111
|
-
try {
|
112
|
-
await SdkPianoio.userSegmentFalse();
|
113
|
-
console.log('userSegmentFalse triggered');
|
114
|
-
} catch (e) {
|
115
|
-
console.error('Errore nel userSegmentFalse:', e);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
async meterActive() {
|
119
|
-
try {
|
120
|
-
await SdkPianoio.meterActive();
|
121
|
-
console.log('Template meterActive');
|
122
|
-
} catch (e) {
|
123
|
-
console.error('Errore nel meterActive:', e);
|
124
|
-
}
|
125
|
-
}
|
126
|
-
async meterExpired() {
|
127
|
-
try {
|
128
|
-
await SdkPianoio.meterExpired();
|
129
|
-
console.log('meterExpired triggered');
|
130
|
-
} catch (e) {
|
131
|
-
console.error('Errore nel meterExpired:', e);
|
132
|
-
}
|
59
|
+
|
60
|
+
// --- Core Execution Method ---
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Executes the Piano experience with the current configuration.
|
64
|
+
* This is the primary method to get a decision from the Piano backend.
|
65
|
+
* @returns A promise that resolves with the event data object from the native SDK.
|
66
|
+
*/
|
67
|
+
async executeExperience() {
|
68
|
+
// This now correctly calls the native method AND returns the result.
|
69
|
+
return SdkPianoio.executeExperience();
|
133
70
|
}
|
71
|
+
|
72
|
+
// --- Static Helper Methods ---
|
73
|
+
|
134
74
|
static async isInitialized() {
|
135
75
|
try {
|
136
76
|
const result = await SdkPianoio.getComposer();
|
@@ -140,13 +80,12 @@ class PianoComposer {
|
|
140
80
|
}
|
141
81
|
}
|
142
82
|
static async getComposerFromSdkIOS() {
|
143
|
-
|
144
|
-
return result;
|
83
|
+
return SdkPianoio.getComposer();
|
145
84
|
}
|
146
85
|
async toString() {
|
147
86
|
return `PianoComposer {
|
148
87
|
aid: ${this.aid},
|
149
|
-
tags: ${this.tags},
|
88
|
+
tags: ${this.tags.join(',')},
|
150
89
|
zoneId: ${this.zoneId},
|
151
90
|
referrer: ${this.referrer},
|
152
91
|
customVariables: ${JSON.stringify(this.customVariables)},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["SdkPianoio","PianoComposer","tags","zoneId","referrer","customVariables","userToken","url","constructor","aid","create","initializeComposer","addTag","tag","push","addComposerTag","addTags","addComposerTags","setZoneId","setComposerZoneId","setReferrer","setComposerReferrer","setCustomVariable","name","value","setComposerCustomVariable","setUserToken","token","setComposerUserToken","setUrl","setComposerUrl","
|
1
|
+
{"version":3,"names":["SdkPianoio","PianoComposer","tags","zoneId","referrer","customVariables","userToken","url","constructor","aid","create","initializeComposer","addTag","tag","push","addComposerTag","addTags","addComposerTags","setZoneId","setComposerZoneId","setReferrer","setComposerReferrer","setCustomVariable","name","value","setComposerCustomVariable","setUserToken","token","setComposerUserToken","setUrl","setComposerUrl","executeExperience","isInitialized","result","getComposer","e","getComposerFromSdkIOS","toString","join","JSON","stringify"],"sourceRoot":"../../src","sources":["PianoComposer.tsx"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,oBAAoB;AAE3C,MAAMC,aAAa,CAAC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NativeModules, Platform } from 'react-native';
|
4
|
+
export const debugNativeModule = () => {
|
5
|
+
console.log('🔍 Debugging Native Module...');
|
6
|
+
console.log('Platform:', Platform.OS);
|
7
|
+
console.log('Available Native Modules:', Object.keys(NativeModules));
|
8
|
+
const SdkPianoio = NativeModules.SdkPianoio;
|
9
|
+
console.log('SdkPianoio module:', SdkPianoio);
|
10
|
+
if (SdkPianoio) {
|
11
|
+
console.log('✅ SdkPianoio module found!');
|
12
|
+
console.log('Available methods:', Object.keys(SdkPianoio));
|
13
|
+
} else {
|
14
|
+
console.log('❌ SdkPianoio module NOT found!');
|
15
|
+
}
|
16
|
+
return SdkPianoio;
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=debug.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","debugNativeModule","console","log","OS","Object","keys","SdkPianoio"],"sourceRoot":"../../src","sources":["debug.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACrCC,OAAO,CAACC,GAAG,CAAC,+BAA+B,CAAC;EAC5CD,OAAO,CAACC,GAAG,CAAC,WAAW,EAAEH,QAAQ,CAACI,EAAE,CAAC;EACrCF,OAAO,CAACC,GAAG,CAAC,2BAA2B,EAAEE,MAAM,CAACC,IAAI,CAACP,aAAa,CAAC,CAAC;EAEpE,MAAMQ,UAAU,GAAGR,aAAa,CAACQ,UAAU;EAC3CL,OAAO,CAACC,GAAG,CAAC,oBAAoB,EAAEI,UAAU,CAAC;EAE7C,IAAIA,UAAU,EAAE;IACdL,OAAO,CAACC,GAAG,CAAC,4BAA4B,CAAC;IACzCD,OAAO,CAACC,GAAG,CAAC,oBAAoB,EAAEE,MAAM,CAACC,IAAI,CAACC,UAAU,CAAC,CAAC;EAC5D,CAAC,MAAM;IACLL,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;EAC/C;EAEA,OAAOI,UAAU;AACnB,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["default","PianoComposer"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,SAASA,OAAO,IAAIC,aAAa,QAAQ,oBAAiB;;
|
1
|
+
{"version":3,"names":["default","PianoComposer","debugNativeModule"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,SAASA,OAAO,IAAIC,aAAa,QAAQ,oBAAiB;AAC1D,SAASC,iBAAiB,QAAQ,YAAS;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -1,25 +1,14 @@
|
|
1
1
|
interface SdkPianoioType {
|
2
|
-
initializeComposer(aid: string): Promise<
|
2
|
+
initializeComposer(aid: string): Promise<boolean>;
|
3
|
+
executeExperience(): Promise<any>;
|
3
4
|
getComposer(): Promise<any>;
|
4
|
-
addComposerTag(tag: string): Promise<
|
5
|
-
addComposerTags(tags: string[]): Promise<
|
6
|
-
setComposerZoneId(zoneId: string): Promise<
|
7
|
-
setComposerReferrer(referrer: string): Promise<
|
8
|
-
setComposerUrl(url: string): Promise<
|
9
|
-
setComposerCustomVariable(name: string, value: string): Promise<
|
10
|
-
setComposerUserToken(token: string): Promise<
|
11
|
-
executeComposer(): Promise<void>;
|
12
|
-
experienceExecute(): Promise<boolean>;
|
13
|
-
showLogin(): Promise<boolean>;
|
14
|
-
showTemplate(): Promise<boolean>;
|
15
|
-
showForm(): Promise<boolean>;
|
16
|
-
showRecommendations(): Promise<boolean>;
|
17
|
-
nonSite(): Promise<boolean>;
|
18
|
-
userSegmentTrue(): Promise<boolean>;
|
19
|
-
userSegmentFalse(): Promise<boolean>;
|
20
|
-
meterActive(): Promise<boolean>;
|
21
|
-
meterExpired(): Promise<boolean>;
|
22
|
-
composerExecutionCompleted(): Promise<boolean>;
|
5
|
+
addComposerTag(tag: string): Promise<void>;
|
6
|
+
addComposerTags(tags: string[]): Promise<void>;
|
7
|
+
setComposerZoneId(zoneId: string): Promise<void>;
|
8
|
+
setComposerReferrer(referrer: string): Promise<void>;
|
9
|
+
setComposerUrl(url: string): Promise<void>;
|
10
|
+
setComposerCustomVariable(name: string, value: string): Promise<void>;
|
11
|
+
setComposerUserToken(token: string): Promise<void>;
|
23
12
|
}
|
24
13
|
declare const _default: SdkPianoioType;
|
25
14
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NativeSdkPianoio.d.ts","sourceRoot":"","sources":["../../../../src/NativeSdkPianoio.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"NativeSdkPianoio.d.ts","sourceRoot":"","sources":["../../../../src/NativeSdkPianoio.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAE5B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;wBAW4B,cAAc;AAA3C,wBAA4C"}
|
@@ -1,34 +1,31 @@
|
|
1
1
|
declare class PianoComposer {
|
2
|
-
aid
|
3
|
-
tags
|
4
|
-
zoneId
|
5
|
-
referrer
|
6
|
-
customVariables
|
7
|
-
|
8
|
-
|
9
|
-
userToken: string | null;
|
10
|
-
url: string | null;
|
2
|
+
private aid;
|
3
|
+
private tags;
|
4
|
+
private zoneId;
|
5
|
+
private referrer;
|
6
|
+
private customVariables;
|
7
|
+
private userToken;
|
8
|
+
private url;
|
11
9
|
private constructor();
|
10
|
+
/**
|
11
|
+
* Creates and initializes a new PianoComposer instance.
|
12
|
+
* This is the entry point for using the library.
|
13
|
+
* @param aid Your Application ID from Piano.io
|
14
|
+
*/
|
12
15
|
static create(aid: string): Promise<PianoComposer>;
|
13
|
-
addTag(tag: string): Promise<
|
14
|
-
addTags(tags: string[]): Promise<
|
15
|
-
setZoneId(zoneId: string): Promise<
|
16
|
-
setReferrer(referrer: string): Promise<
|
17
|
-
setCustomVariable(name: string, value: string): Promise<
|
18
|
-
setUserToken(token: string): Promise<
|
19
|
-
setUrl(url: string): Promise<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
showRecommendations(): Promise<void>;
|
27
|
-
nonSite(): Promise<void>;
|
28
|
-
userSegmentTrue(): Promise<void>;
|
29
|
-
userSegmentFalse(): Promise<void>;
|
30
|
-
meterActive(): Promise<void>;
|
31
|
-
meterExpired(): Promise<void>;
|
16
|
+
addTag(tag: string): Promise<void>;
|
17
|
+
addTags(tags: string[]): Promise<void>;
|
18
|
+
setZoneId(zoneId: string): Promise<void>;
|
19
|
+
setReferrer(referrer: string): Promise<void>;
|
20
|
+
setCustomVariable(name: string, value: string): Promise<void>;
|
21
|
+
setUserToken(token: string): Promise<void>;
|
22
|
+
setUrl(url: string): Promise<void>;
|
23
|
+
/**
|
24
|
+
* Executes the Piano experience with the current configuration.
|
25
|
+
* This is the primary method to get a decision from the Piano backend.
|
26
|
+
* @returns A promise that resolves with the event data object from the native SDK.
|
27
|
+
*/
|
28
|
+
executeExperience(): Promise<any>;
|
32
29
|
static isInitialized(): Promise<boolean>;
|
33
30
|
static getComposerFromSdkIOS(): Promise<any>;
|
34
31
|
toString(): Promise<string>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PianoComposer.d.ts","sourceRoot":"","sources":["../../../../src/PianoComposer.tsx"],"names":[],"mappings":"AAEA,cAAM,aAAa;
|
1
|
+
{"version":3,"file":"PianoComposer.d.ts","sourceRoot":"","sources":["../../../../src/PianoComposer.tsx"],"names":[],"mappings":"AAEA,cAAM,aAAa;IAEjB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,eAAe,CAAiC;IACxD,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,GAAG,CAAuB;IAGlC,OAAO;IAIP;;;;OAIG;WACU,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAOlD,MAAM,CAAC,GAAG,EAAE,MAAM;IAKlB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE;IAKtB,SAAS,CAAC,MAAM,EAAE,MAAM;IAKxB,WAAW,CAAC,QAAQ,EAAE,MAAM;IAK5B,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAK7C,YAAY,CAAC,KAAK,EAAE,MAAM;IAK1B,MAAM,CAAC,GAAG,EAAE,MAAM;IAOxB;;;;OAIG;IACG,iBAAiB;WAOV,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;WASjC,qBAAqB;IAI5B,QAAQ;CAWf;AAED,eAAe,aAAa,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../src/debug.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,WAgB7B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
@@ -1,25 +1,14 @@
|
|
1
1
|
interface SdkPianoioType {
|
2
|
-
initializeComposer(aid: string): Promise<
|
2
|
+
initializeComposer(aid: string): Promise<boolean>;
|
3
|
+
executeExperience(): Promise<any>;
|
3
4
|
getComposer(): Promise<any>;
|
4
|
-
addComposerTag(tag: string): Promise<
|
5
|
-
addComposerTags(tags: string[]): Promise<
|
6
|
-
setComposerZoneId(zoneId: string): Promise<
|
7
|
-
setComposerReferrer(referrer: string): Promise<
|
8
|
-
setComposerUrl(url: string): Promise<
|
9
|
-
setComposerCustomVariable(name: string, value: string): Promise<
|
10
|
-
setComposerUserToken(token: string): Promise<
|
11
|
-
executeComposer(): Promise<void>;
|
12
|
-
experienceExecute(): Promise<boolean>;
|
13
|
-
showLogin(): Promise<boolean>;
|
14
|
-
showTemplate(): Promise<boolean>;
|
15
|
-
showForm(): Promise<boolean>;
|
16
|
-
showRecommendations(): Promise<boolean>;
|
17
|
-
nonSite(): Promise<boolean>;
|
18
|
-
userSegmentTrue(): Promise<boolean>;
|
19
|
-
userSegmentFalse(): Promise<boolean>;
|
20
|
-
meterActive(): Promise<boolean>;
|
21
|
-
meterExpired(): Promise<boolean>;
|
22
|
-
composerExecutionCompleted(): Promise<boolean>;
|
5
|
+
addComposerTag(tag: string): Promise<void>;
|
6
|
+
addComposerTags(tags: string[]): Promise<void>;
|
7
|
+
setComposerZoneId(zoneId: string): Promise<void>;
|
8
|
+
setComposerReferrer(referrer: string): Promise<void>;
|
9
|
+
setComposerUrl(url: string): Promise<void>;
|
10
|
+
setComposerCustomVariable(name: string, value: string): Promise<void>;
|
11
|
+
setComposerUserToken(token: string): Promise<void>;
|
23
12
|
}
|
24
13
|
declare const _default: SdkPianoioType;
|
25
14
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NativeSdkPianoio.d.ts","sourceRoot":"","sources":["../../../../src/NativeSdkPianoio.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"NativeSdkPianoio.d.ts","sourceRoot":"","sources":["../../../../src/NativeSdkPianoio.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAE5B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;wBAW4B,cAAc;AAA3C,wBAA4C"}
|
@@ -1,34 +1,31 @@
|
|
1
1
|
declare class PianoComposer {
|
2
|
-
aid
|
3
|
-
tags
|
4
|
-
zoneId
|
5
|
-
referrer
|
6
|
-
customVariables
|
7
|
-
|
8
|
-
|
9
|
-
userToken: string | null;
|
10
|
-
url: string | null;
|
2
|
+
private aid;
|
3
|
+
private tags;
|
4
|
+
private zoneId;
|
5
|
+
private referrer;
|
6
|
+
private customVariables;
|
7
|
+
private userToken;
|
8
|
+
private url;
|
11
9
|
private constructor();
|
10
|
+
/**
|
11
|
+
* Creates and initializes a new PianoComposer instance.
|
12
|
+
* This is the entry point for using the library.
|
13
|
+
* @param aid Your Application ID from Piano.io
|
14
|
+
*/
|
12
15
|
static create(aid: string): Promise<PianoComposer>;
|
13
|
-
addTag(tag: string): Promise<
|
14
|
-
addTags(tags: string[]): Promise<
|
15
|
-
setZoneId(zoneId: string): Promise<
|
16
|
-
setReferrer(referrer: string): Promise<
|
17
|
-
setCustomVariable(name: string, value: string): Promise<
|
18
|
-
setUserToken(token: string): Promise<
|
19
|
-
setUrl(url: string): Promise<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
showRecommendations(): Promise<void>;
|
27
|
-
nonSite(): Promise<void>;
|
28
|
-
userSegmentTrue(): Promise<void>;
|
29
|
-
userSegmentFalse(): Promise<void>;
|
30
|
-
meterActive(): Promise<void>;
|
31
|
-
meterExpired(): Promise<void>;
|
16
|
+
addTag(tag: string): Promise<void>;
|
17
|
+
addTags(tags: string[]): Promise<void>;
|
18
|
+
setZoneId(zoneId: string): Promise<void>;
|
19
|
+
setReferrer(referrer: string): Promise<void>;
|
20
|
+
setCustomVariable(name: string, value: string): Promise<void>;
|
21
|
+
setUserToken(token: string): Promise<void>;
|
22
|
+
setUrl(url: string): Promise<void>;
|
23
|
+
/**
|
24
|
+
* Executes the Piano experience with the current configuration.
|
25
|
+
* This is the primary method to get a decision from the Piano backend.
|
26
|
+
* @returns A promise that resolves with the event data object from the native SDK.
|
27
|
+
*/
|
28
|
+
executeExperience(): Promise<any>;
|
32
29
|
static isInitialized(): Promise<boolean>;
|
33
30
|
static getComposerFromSdkIOS(): Promise<any>;
|
34
31
|
toString(): Promise<string>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PianoComposer.d.ts","sourceRoot":"","sources":["../../../../src/PianoComposer.tsx"],"names":[],"mappings":"AAEA,cAAM,aAAa;
|
1
|
+
{"version":3,"file":"PianoComposer.d.ts","sourceRoot":"","sources":["../../../../src/PianoComposer.tsx"],"names":[],"mappings":"AAEA,cAAM,aAAa;IAEjB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,eAAe,CAAiC;IACxD,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,GAAG,CAAuB;IAGlC,OAAO;IAIP;;;;OAIG;WACU,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAOlD,MAAM,CAAC,GAAG,EAAE,MAAM;IAKlB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE;IAKtB,SAAS,CAAC,MAAM,EAAE,MAAM;IAKxB,WAAW,CAAC,QAAQ,EAAE,MAAM;IAK5B,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAK7C,YAAY,CAAC,KAAK,EAAE,MAAM;IAK1B,MAAM,CAAC,GAAG,EAAE,MAAM;IAOxB;;;;OAIG;IACG,iBAAiB;WAOV,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;WASjC,qBAAqB;IAI5B,QAAQ;CAWf;AAED,eAAe,aAAa,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../src/debug.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,WAgB7B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
@@ -1,23 +1,20 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-sdk-pianoio",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.2",
|
4
4
|
"description": "Piano io sdk integration",
|
5
5
|
"source": "./src/index.tsx",
|
6
6
|
"main": "./lib/commonjs/index.js",
|
7
7
|
"module": "./lib/module/index.js",
|
8
|
-
"
|
8
|
+
"sideEffects": false,
|
9
9
|
"exports": {
|
10
10
|
".": {
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
"require": {
|
16
|
-
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
17
|
-
"default": "./lib/commonjs/index.js"
|
18
|
-
}
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
12
|
+
"import": "./lib/module/index.js",
|
13
|
+
"require": "./lib/commonjs/index.js",
|
14
|
+
"default": "./lib/module/index.js"
|
19
15
|
},
|
20
|
-
"./package.json": "./package.json"
|
16
|
+
"./package.json": "./package.json",
|
17
|
+
"./types": "./lib/typescript/module/src/index.d.ts"
|
21
18
|
},
|
22
19
|
"files": [
|
23
20
|
"src",
|
@@ -41,16 +38,29 @@
|
|
41
38
|
"scripts": {
|
42
39
|
"example": "yarn workspace react-native-sdk-pianoio-example",
|
43
40
|
"test": "jest",
|
41
|
+
"test:watch": "jest --watch",
|
42
|
+
"test:coverage": "jest --coverage",
|
44
43
|
"typecheck": "tsc",
|
45
44
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
45
|
+
"lint:fix": "eslint \"**/*.{js,ts,tsx}\" --fix",
|
46
|
+
"format": "prettier --write \"**/*.{js,ts,tsx,json,md}\"",
|
47
|
+
"format:check": "prettier --check \"**/*.{js,ts,tsx,json,md}\"",
|
46
48
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
47
49
|
"prepare": "bob build",
|
50
|
+
"build": "bob build",
|
51
|
+
"prepack": "bob build",
|
48
52
|
"release": "release-it"
|
49
53
|
},
|
50
54
|
"keywords": [
|
51
55
|
"react-native",
|
52
56
|
"ios",
|
53
|
-
"android"
|
57
|
+
"android",
|
58
|
+
"piano",
|
59
|
+
"piano-io",
|
60
|
+
"paywall",
|
61
|
+
"subscription",
|
62
|
+
"monetization",
|
63
|
+
"sdk"
|
54
64
|
],
|
55
65
|
"repository": {
|
56
66
|
"type": "git",
|
@@ -59,9 +69,9 @@
|
|
59
69
|
"author": "sarakalessia <alessia@hexagonswiss.ch> ",
|
60
70
|
"license": "MIT",
|
61
71
|
"bugs": {
|
62
|
-
"url": ""
|
72
|
+
"url": "https://github.com/HexagonSwiss/hex-react-native-sdk-pianoio/issues"
|
63
73
|
},
|
64
|
-
"homepage": "https://github.com/HexagonSwiss/hex-react-native-sdk-pianoio
|
74
|
+
"homepage": "https://github.com/HexagonSwiss/hex-react-native-sdk-pianoio#readme",
|
65
75
|
"publishConfig": {
|
66
76
|
"registry": "https://registry.npmjs.org/"
|
67
77
|
},
|
@@ -71,7 +81,7 @@
|
|
71
81
|
"@react-native-community/cli": "15.0.1",
|
72
82
|
"@react-native/eslint-config": "^0.73.1",
|
73
83
|
"@release-it/conventional-changelog": "^9.0.2",
|
74
|
-
"@types/jest": "^29.5.
|
84
|
+
"@types/jest": "^29.5.14",
|
75
85
|
"@types/react": "^19.0.0",
|
76
86
|
"commitlint": "^19.6.1",
|
77
87
|
"del-cli": "^5.1.0",
|
@@ -87,6 +97,11 @@
|
|
87
97
|
"turbo": "^1.10.7",
|
88
98
|
"typescript": "^5.2.2"
|
89
99
|
},
|
100
|
+
"engines": {
|
101
|
+
"node": ">=18.0.0",
|
102
|
+
"npm": ">=9.0.0",
|
103
|
+
"yarn": ">=3.0.0"
|
104
|
+
},
|
90
105
|
"peerDependencies": {
|
91
106
|
"react": "*",
|
92
107
|
"react-native": "*"
|