react-native-sdk-pianoio 0.3.2 → 0.3.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/README.md +176 -186
- package/android/build.gradle +29 -42
- package/android/gradle.properties +33 -14
- package/android/src/main/java/com/sdkpianoio/ComposerPianoImpl.kt +366 -0
- package/android/src/main/java/com/sdkpianoio/SdkPianoioModule.kt +281 -507
- package/android/src/main/java/com/sdkpianoio/TokenService.kt +139 -0
- package/android/test.sh +494 -0
- package/ios/ComposerPianoImpl.swift +128 -225
- package/ios/MyComposerDelegate.swift +142 -109
- package/ios/SdkPianoio.swift +69 -143
- package/ios/SdkPianoioBridge.m +18 -46
- package/ios/TokenService.swift +219 -0
- package/lib/commonjs/NativeSdkPianoio.ts +34 -10
- package/lib/commonjs/PianoComposer.js +69 -51
- package/lib/commonjs/PianoComposer.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeSdkPianoio.ts +34 -10
- package/lib/module/PianoComposer.js +70 -51
- package/lib/module/PianoComposer.js.map +1 -1
- package/lib/module/index.js +0 -14
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeSdkPianoio.d.ts +27 -9
- package/lib/typescript/commonjs/src/NativeSdkPianoio.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/PianoComposer.d.ts +45 -18
- package/lib/typescript/commonjs/src/PianoComposer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeSdkPianoio.d.ts +27 -9
- package/lib/typescript/module/src/NativeSdkPianoio.d.ts.map +1 -1
- package/lib/typescript/module/src/PianoComposer.d.ts +45 -18
- package/lib/typescript/module/src/PianoComposer.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/NativeSdkPianoio.ts +34 -10
- package/src/PianoComposer.tsx +76 -59
- package/src/index.tsx +0 -14
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/ios/services/TokenService.swift +0 -70
@@ -6,60 +6,86 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.default = void 0;
|
7
7
|
var _NativeSdkPianoio = _interopRequireDefault(require("./NativeSdkPianoio"));
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
9
|
+
/**
|
10
|
+
* A wrapper class for the native SdkPianoio module that provides a clean,
|
11
|
+
* object-oriented API for interacting with the Piano SDK.
|
12
|
+
*/
|
9
13
|
class PianoComposer {
|
10
|
-
// --- Properties to hold configuration state ---
|
11
|
-
|
12
|
-
tags = [];
|
13
|
-
zoneId = null;
|
14
|
-
referrer = null;
|
15
|
-
customVariables = {};
|
16
|
-
userToken = null;
|
17
|
-
url = null;
|
18
|
-
|
19
14
|
// The constructor is private to force users to use the async `create` method.
|
20
|
-
constructor(
|
21
|
-
|
15
|
+
constructor() {
|
16
|
+
// This constructor is intentionally empty.
|
22
17
|
}
|
23
18
|
|
24
19
|
/**
|
25
20
|
* Creates and initializes a new PianoComposer instance.
|
26
|
-
* This is the entry point for using the library.
|
21
|
+
* This is the main entry point for using the library.
|
27
22
|
* @param aid Your Application ID from Piano.io
|
28
23
|
*/
|
29
24
|
static async create(aid) {
|
30
|
-
|
31
|
-
|
25
|
+
// Call the corrected native initialize method
|
26
|
+
await _NativeSdkPianoio.default.initialize(aid);
|
27
|
+
return new PianoComposer();
|
32
28
|
}
|
33
29
|
|
34
30
|
// --- Configuration Methods ---
|
35
31
|
|
36
32
|
async addTag(tag) {
|
37
|
-
|
38
|
-
return _NativeSdkPianoio.default.addComposerTag(tag);
|
33
|
+
return _NativeSdkPianoio.default.addTag(tag);
|
39
34
|
}
|
40
35
|
async addTags(tags) {
|
41
|
-
|
42
|
-
return _NativeSdkPianoio.default.addComposerTags(tags);
|
36
|
+
return _NativeSdkPianoio.default.addTags(tags);
|
43
37
|
}
|
44
38
|
async setZoneId(zoneId) {
|
45
|
-
|
46
|
-
return _NativeSdkPianoio.default.setComposerZoneId(zoneId);
|
39
|
+
return _NativeSdkPianoio.default.setZoneId(zoneId);
|
47
40
|
}
|
48
41
|
async setReferrer(referrer) {
|
49
|
-
|
50
|
-
return _NativeSdkPianoio.default.setComposerReferrer(referrer);
|
42
|
+
return _NativeSdkPianoio.default.setReferrer(referrer);
|
51
43
|
}
|
52
44
|
async setCustomVariable(name, value) {
|
53
|
-
|
54
|
-
|
45
|
+
return _NativeSdkPianoio.default.addCustomVariable(name, value);
|
46
|
+
}
|
47
|
+
async setCustomVariables(variables) {
|
48
|
+
return _NativeSdkPianoio.default.setCustomVariables(variables);
|
55
49
|
}
|
56
50
|
async setUserToken(token) {
|
57
|
-
|
58
|
-
return _NativeSdkPianoio.default.setComposerUserToken(token);
|
51
|
+
return _NativeSdkPianoio.default.setUserToken(token);
|
59
52
|
}
|
60
53
|
async setUrl(url) {
|
61
|
-
|
62
|
-
|
54
|
+
return _NativeSdkPianoio.default.setUrl(url);
|
55
|
+
}
|
56
|
+
|
57
|
+
// --- Authentication Methods ---
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Signs in the user with Piano.
|
61
|
+
* @returns A promise that resolves with user information.
|
62
|
+
*/
|
63
|
+
async signIn() {
|
64
|
+
return _NativeSdkPianoio.default.signIn();
|
65
|
+
}
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Signs out the current user.
|
69
|
+
* @returns A promise that resolves when sign out is complete.
|
70
|
+
*/
|
71
|
+
async signOut() {
|
72
|
+
return _NativeSdkPianoio.default.signOut();
|
73
|
+
}
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Gets information about the current authenticated user.
|
77
|
+
* @returns A promise that resolves with user information.
|
78
|
+
*/
|
79
|
+
async getCurrentUser() {
|
80
|
+
return _NativeSdkPianoio.default.getCurrentUser();
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Checks if a user is currently authenticated.
|
85
|
+
* @returns A promise that resolves with the authentication status.
|
86
|
+
*/
|
87
|
+
async isAuthenticated() {
|
88
|
+
return _NativeSdkPianoio.default.isAuthenticated();
|
63
89
|
}
|
64
90
|
|
65
91
|
// --- Core Execution Method ---
|
@@ -70,33 +96,25 @@ class PianoComposer {
|
|
70
96
|
* @returns A promise that resolves with the event data object from the native SDK.
|
71
97
|
*/
|
72
98
|
async executeExperience() {
|
73
|
-
// This now correctly calls the native method AND returns the result.
|
74
99
|
return _NativeSdkPianoio.default.executeExperience();
|
75
100
|
}
|
76
101
|
|
77
|
-
// ---
|
102
|
+
// --- Utility and Cleanup Methods ---
|
78
103
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
tags: ${this.tags.join(',')},
|
94
|
-
zoneId: ${this.zoneId},
|
95
|
-
referrer: ${this.referrer},
|
96
|
-
customVariables: ${JSON.stringify(this.customVariables)},
|
97
|
-
userToken: ${this.userToken},
|
98
|
-
url: ${this.url}
|
99
|
-
}`;
|
104
|
+
/**
|
105
|
+
* Gets the current status of the SDK.
|
106
|
+
* @returns A promise that resolves with status information.
|
107
|
+
*/
|
108
|
+
async getStatus() {
|
109
|
+
return _NativeSdkPianoio.default.getStatus();
|
110
|
+
}
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Clears all configured tags and custom variables.
|
114
|
+
* @returns A promise that resolves when the configuration is cleared.
|
115
|
+
*/
|
116
|
+
async clearConfiguration() {
|
117
|
+
return _NativeSdkPianoio.default.clearConfiguration();
|
100
118
|
}
|
101
119
|
}
|
102
120
|
var _default = exports.default = PianoComposer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_NativeSdkPianoio","_interopRequireDefault","require","e","__esModule","default","PianoComposer","
|
1
|
+
{"version":3,"names":["_NativeSdkPianoio","_interopRequireDefault","require","e","__esModule","default","PianoComposer","constructor","create","aid","SdkPianoio","initialize","addTag","tag","addTags","tags","setZoneId","zoneId","setReferrer","referrer","setCustomVariable","name","value","addCustomVariable","setCustomVariables","variables","setUserToken","token","setUrl","url","signIn","signOut","getCurrentUser","isAuthenticated","executeExperience","getStatus","clearConfiguration","_default","exports"],"sourceRoot":"../../src","sources":["PianoComposer.tsx"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5C;AACA;AACA;AACA;AACA,MAAMG,aAAa,CAAC;EAClB;EACQC,WAAWA,CAAA,EAAG;IACpB;EAAA;;EAGF;AACF;AACA;AACA;AACA;EACE,aAAaC,MAAMA,CAACC,GAAW,EAA0B;IACvD;IACA,MAAMC,yBAAU,CAACC,UAAU,CAACF,GAAG,CAAC;IAChC,OAAO,IAAIH,aAAa,CAAC,CAAC;EAC5B;;EAEA;;EAEA,MAAMM,MAAMA,CAACC,GAAW,EAAoB;IAC1C,OAAOH,yBAAU,CAACE,MAAM,CAACC,GAAG,CAAC;EAC/B;EAEA,MAAMC,OAAOA,CAACC,IAAc,EAAoB;IAC9C,OAAOL,yBAAU,CAACI,OAAO,CAACC,IAAI,CAAC;EACjC;EAEA,MAAMC,SAASA,CAACC,MAAc,EAAoB;IAChD,OAAOP,yBAAU,CAACM,SAAS,CAACC,MAAM,CAAC;EACrC;EAEA,MAAMC,WAAWA,CAACC,QAAgB,EAAoB;IACpD,OAAOT,yBAAU,CAACQ,WAAW,CAACC,QAAQ,CAAC;EACzC;EAEA,MAAMC,iBAAiBA,CAACC,IAAY,EAAEC,KAAa,EAAoB;IACrE,OAAOZ,yBAAU,CAACa,iBAAiB,CAACF,IAAI,EAAEC,KAAK,CAAC;EAClD;EAEA,MAAME,kBAAkBA,CAACC,SAAoC,EAAoB;IAC/E,OAAOf,yBAAU,CAACc,kBAAkB,CAACC,SAAS,CAAC;EACjD;EAEA,MAAMC,YAAYA,CAACC,KAAa,EAAoB;IAClD,OAAOjB,yBAAU,CAACgB,YAAY,CAACC,KAAK,CAAC;EACvC;EAEA,MAAMC,MAAMA,CAACC,GAAW,EAAoB;IAC1C,OAAOnB,yBAAU,CAACkB,MAAM,CAACC,GAAG,CAAC;EAC/B;;EAEA;;EAEA;AACF;AACA;AACA;EACE,MAAMC,MAAMA,CAAA,EAAiB;IAC3B,OAAOpB,yBAAU,CAACoB,MAAM,CAAC,CAAC;EAC5B;;EAEA;AACF;AACA;AACA;EACE,MAAMC,OAAOA,CAAA,EAAiB;IAC5B,OAAOrB,yBAAU,CAACqB,OAAO,CAAC,CAAC;EAC7B;;EAEA;AACF;AACA;AACA;EACE,MAAMC,cAAcA,CAAA,EAAiB;IACnC,OAAOtB,yBAAU,CAACsB,cAAc,CAAC,CAAC;EACpC;;EAEA;AACF;AACA;AACA;EACE,MAAMC,eAAeA,CAAA,EAAiB;IACpC,OAAOvB,yBAAU,CAACuB,eAAe,CAAC,CAAC;EACrC;;EAEA;;EAEA;AACF;AACA;AACA;AACA;EACE,MAAMC,iBAAiBA,CAAA,EAAiB;IACtC,OAAOxB,yBAAU,CAACwB,iBAAiB,CAAC,CAAC;EACvC;;EAEA;;EAEA;AACF;AACA;AACA;EACE,MAAMC,SAASA,CAAA,EAAiB;IAC9B,OAAOzB,yBAAU,CAACyB,SAAS,CAAC,CAAC;EAC/B;;EAEA;AACF;AACA;AACA;EACE,MAAMC,kBAAkBA,CAAA,EAAqB;IAC3C,OAAO1B,yBAAU,CAAC0B,kBAAkB,CAAC,CAAC;EACxC;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjC,OAAA,GAEcC,aAAa","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_PianoComposer","_interopRequireDefault","require","_debug","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"names":["_PianoComposer","_interopRequireDefault","require","_debug","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA4C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
@@ -1,17 +1,41 @@
|
|
1
1
|
import { NativeModules, Platform } from 'react-native';
|
2
2
|
|
3
|
+
/**
|
4
|
+
* This interface defines the full API surface of the native module.
|
5
|
+
* It is a complete and accurate representation of the methods exposed
|
6
|
+
* in SdkPianoioModule.kt.
|
7
|
+
*/
|
3
8
|
interface SdkPianoioType {
|
4
|
-
|
9
|
+
// Initialization
|
10
|
+
initialize(aid: string): Promise<boolean>;
|
11
|
+
|
12
|
+
// Configuration
|
13
|
+
addTag(tag: string): Promise<boolean>;
|
14
|
+
addTags(tags: string[]): Promise<boolean>;
|
15
|
+
setZoneId(zoneId: string): Promise<boolean>;
|
16
|
+
setReferrer(referrer: string): Promise<boolean>;
|
17
|
+
setUrl(url: string): Promise<boolean>;
|
18
|
+
setUserToken(token: string): Promise<boolean>;
|
19
|
+
addCustomVariable(key: string, value: string): Promise<boolean>;
|
20
|
+
setCustomVariables(variables: { [key: string]: string }): Promise<boolean>;
|
21
|
+
|
22
|
+
// Execution
|
5
23
|
executeExperience(): Promise<any>;
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
24
|
+
|
25
|
+
// Authentication
|
26
|
+
signIn(): Promise<any>;
|
27
|
+
signOut(): Promise<any>;
|
28
|
+
getCurrentUser(): Promise<any>;
|
29
|
+
isAuthenticated(): Promise<any>;
|
30
|
+
|
31
|
+
// Status & Cleanup
|
32
|
+
getStatus(): Promise<any>;
|
33
|
+
isInitialized(): Promise<boolean>;
|
34
|
+
clearConfiguration(): Promise<boolean>;
|
35
|
+
removeTag(tag: string): Promise<boolean>;
|
36
|
+
removeCustomVariable(key: string): Promise<boolean>;
|
37
|
+
clearTags(): Promise<boolean>;
|
38
|
+
clearCustomVariables(): Promise<boolean>;
|
15
39
|
}
|
16
40
|
|
17
41
|
const SdkPianoio = NativeModules.SdkPianoio;
|
@@ -1,60 +1,87 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
import SdkPianoio from './NativeSdkPianoio';
|
4
|
-
class PianoComposer {
|
5
|
-
// --- Properties to hold configuration state ---
|
6
|
-
|
7
|
-
tags = [];
|
8
|
-
zoneId = null;
|
9
|
-
referrer = null;
|
10
|
-
customVariables = {};
|
11
|
-
userToken = null;
|
12
|
-
url = null;
|
13
4
|
|
5
|
+
/**
|
6
|
+
* A wrapper class for the native SdkPianoio module that provides a clean,
|
7
|
+
* object-oriented API for interacting with the Piano SDK.
|
8
|
+
*/
|
9
|
+
class PianoComposer {
|
14
10
|
// The constructor is private to force users to use the async `create` method.
|
15
|
-
constructor(
|
16
|
-
|
11
|
+
constructor() {
|
12
|
+
// This constructor is intentionally empty.
|
17
13
|
}
|
18
14
|
|
19
15
|
/**
|
20
16
|
* Creates and initializes a new PianoComposer instance.
|
21
|
-
* This is the entry point for using the library.
|
17
|
+
* This is the main entry point for using the library.
|
22
18
|
* @param aid Your Application ID from Piano.io
|
23
19
|
*/
|
24
20
|
static async create(aid) {
|
25
|
-
|
26
|
-
|
21
|
+
// Call the corrected native initialize method
|
22
|
+
await SdkPianoio.initialize(aid);
|
23
|
+
return new PianoComposer();
|
27
24
|
}
|
28
25
|
|
29
26
|
// --- Configuration Methods ---
|
30
27
|
|
31
28
|
async addTag(tag) {
|
32
|
-
|
33
|
-
return SdkPianoio.addComposerTag(tag);
|
29
|
+
return SdkPianoio.addTag(tag);
|
34
30
|
}
|
35
31
|
async addTags(tags) {
|
36
|
-
|
37
|
-
return SdkPianoio.addComposerTags(tags);
|
32
|
+
return SdkPianoio.addTags(tags);
|
38
33
|
}
|
39
34
|
async setZoneId(zoneId) {
|
40
|
-
|
41
|
-
return SdkPianoio.setComposerZoneId(zoneId);
|
35
|
+
return SdkPianoio.setZoneId(zoneId);
|
42
36
|
}
|
43
37
|
async setReferrer(referrer) {
|
44
|
-
|
45
|
-
return SdkPianoio.setComposerReferrer(referrer);
|
38
|
+
return SdkPianoio.setReferrer(referrer);
|
46
39
|
}
|
47
40
|
async setCustomVariable(name, value) {
|
48
|
-
|
49
|
-
|
41
|
+
return SdkPianoio.addCustomVariable(name, value);
|
42
|
+
}
|
43
|
+
async setCustomVariables(variables) {
|
44
|
+
return SdkPianoio.setCustomVariables(variables);
|
50
45
|
}
|
51
46
|
async setUserToken(token) {
|
52
|
-
|
53
|
-
return SdkPianoio.setComposerUserToken(token);
|
47
|
+
return SdkPianoio.setUserToken(token);
|
54
48
|
}
|
55
49
|
async setUrl(url) {
|
56
|
-
|
57
|
-
|
50
|
+
return SdkPianoio.setUrl(url);
|
51
|
+
}
|
52
|
+
|
53
|
+
// --- Authentication Methods ---
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Signs in the user with Piano.
|
57
|
+
* @returns A promise that resolves with user information.
|
58
|
+
*/
|
59
|
+
async signIn() {
|
60
|
+
return SdkPianoio.signIn();
|
61
|
+
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Signs out the current user.
|
65
|
+
* @returns A promise that resolves when sign out is complete.
|
66
|
+
*/
|
67
|
+
async signOut() {
|
68
|
+
return SdkPianoio.signOut();
|
69
|
+
}
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Gets information about the current authenticated user.
|
73
|
+
* @returns A promise that resolves with user information.
|
74
|
+
*/
|
75
|
+
async getCurrentUser() {
|
76
|
+
return SdkPianoio.getCurrentUser();
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Checks if a user is currently authenticated.
|
81
|
+
* @returns A promise that resolves with the authentication status.
|
82
|
+
*/
|
83
|
+
async isAuthenticated() {
|
84
|
+
return SdkPianoio.isAuthenticated();
|
58
85
|
}
|
59
86
|
|
60
87
|
// --- Core Execution Method ---
|
@@ -65,33 +92,25 @@ class PianoComposer {
|
|
65
92
|
* @returns A promise that resolves with the event data object from the native SDK.
|
66
93
|
*/
|
67
94
|
async executeExperience() {
|
68
|
-
// This now correctly calls the native method AND returns the result.
|
69
95
|
return SdkPianoio.executeExperience();
|
70
96
|
}
|
71
97
|
|
72
|
-
// ---
|
98
|
+
// --- Utility and Cleanup Methods ---
|
73
99
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
tags: ${this.tags.join(',')},
|
89
|
-
zoneId: ${this.zoneId},
|
90
|
-
referrer: ${this.referrer},
|
91
|
-
customVariables: ${JSON.stringify(this.customVariables)},
|
92
|
-
userToken: ${this.userToken},
|
93
|
-
url: ${this.url}
|
94
|
-
}`;
|
100
|
+
/**
|
101
|
+
* Gets the current status of the SDK.
|
102
|
+
* @returns A promise that resolves with status information.
|
103
|
+
*/
|
104
|
+
async getStatus() {
|
105
|
+
return SdkPianoio.getStatus();
|
106
|
+
}
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Clears all configured tags and custom variables.
|
110
|
+
* @returns A promise that resolves when the configuration is cleared.
|
111
|
+
*/
|
112
|
+
async clearConfiguration() {
|
113
|
+
return SdkPianoio.clearConfiguration();
|
95
114
|
}
|
96
115
|
}
|
97
116
|
export default PianoComposer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["SdkPianoio","PianoComposer","
|
1
|
+
{"version":3,"names":["SdkPianoio","PianoComposer","constructor","create","aid","initialize","addTag","tag","addTags","tags","setZoneId","zoneId","setReferrer","referrer","setCustomVariable","name","value","addCustomVariable","setCustomVariables","variables","setUserToken","token","setUrl","url","signIn","signOut","getCurrentUser","isAuthenticated","executeExperience","getStatus","clearConfiguration"],"sourceRoot":"../../src","sources":["PianoComposer.tsx"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,oBAAoB;;AAE3C;AACA;AACA;AACA;AACA,MAAMC,aAAa,CAAC;EAClB;EACQC,WAAWA,CAAA,EAAG;IACpB;EAAA;;EAGF;AACF;AACA;AACA;AACA;EACE,aAAaC,MAAMA,CAACC,GAAW,EAA0B;IACvD;IACA,MAAMJ,UAAU,CAACK,UAAU,CAACD,GAAG,CAAC;IAChC,OAAO,IAAIH,aAAa,CAAC,CAAC;EAC5B;;EAEA;;EAEA,MAAMK,MAAMA,CAACC,GAAW,EAAoB;IAC1C,OAAOP,UAAU,CAACM,MAAM,CAACC,GAAG,CAAC;EAC/B;EAEA,MAAMC,OAAOA,CAACC,IAAc,EAAoB;IAC9C,OAAOT,UAAU,CAACQ,OAAO,CAACC,IAAI,CAAC;EACjC;EAEA,MAAMC,SAASA,CAACC,MAAc,EAAoB;IAChD,OAAOX,UAAU,CAACU,SAAS,CAACC,MAAM,CAAC;EACrC;EAEA,MAAMC,WAAWA,CAACC,QAAgB,EAAoB;IACpD,OAAOb,UAAU,CAACY,WAAW,CAACC,QAAQ,CAAC;EACzC;EAEA,MAAMC,iBAAiBA,CAACC,IAAY,EAAEC,KAAa,EAAoB;IACrE,OAAOhB,UAAU,CAACiB,iBAAiB,CAACF,IAAI,EAAEC,KAAK,CAAC;EAClD;EAEA,MAAME,kBAAkBA,CAACC,SAAoC,EAAoB;IAC/E,OAAOnB,UAAU,CAACkB,kBAAkB,CAACC,SAAS,CAAC;EACjD;EAEA,MAAMC,YAAYA,CAACC,KAAa,EAAoB;IAClD,OAAOrB,UAAU,CAACoB,YAAY,CAACC,KAAK,CAAC;EACvC;EAEA,MAAMC,MAAMA,CAACC,GAAW,EAAoB;IAC1C,OAAOvB,UAAU,CAACsB,MAAM,CAACC,GAAG,CAAC;EAC/B;;EAEA;;EAEA;AACF;AACA;AACA;EACE,MAAMC,MAAMA,CAAA,EAAiB;IAC3B,OAAOxB,UAAU,CAACwB,MAAM,CAAC,CAAC;EAC5B;;EAEA;AACF;AACA;AACA;EACE,MAAMC,OAAOA,CAAA,EAAiB;IAC5B,OAAOzB,UAAU,CAACyB,OAAO,CAAC,CAAC;EAC7B;;EAEA;AACF;AACA;AACA;EACE,MAAMC,cAAcA,CAAA,EAAiB;IACnC,OAAO1B,UAAU,CAAC0B,cAAc,CAAC,CAAC;EACpC;;EAEA;AACF;AACA;AACA;EACE,MAAMC,eAAeA,CAAA,EAAiB;IACpC,OAAO3B,UAAU,CAAC2B,eAAe,CAAC,CAAC;EACrC;;EAEA;;EAEA;AACF;AACA;AACA;AACA;EACE,MAAMC,iBAAiBA,CAAA,EAAiB;IACtC,OAAO5B,UAAU,CAAC4B,iBAAiB,CAAC,CAAC;EACvC;;EAEA;;EAEA;AACF;AACA;AACA;EACE,MAAMC,SAASA,CAAA,EAAiB;IAC9B,OAAO7B,UAAU,CAAC6B,SAAS,CAAC,CAAC;EAC/B;;EAEA;AACF;AACA;AACA;EACE,MAAMC,kBAAkBA,CAAA,EAAqB;IAC3C,OAAO9B,UAAU,CAAC8B,kBAAkB,CAAC,CAAC;EACxC;AACF;AAEA,eAAe7B,aAAa","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
@@ -1,19 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
// import SdkPianoio from './NativeSdkPianoio';
|
4
3
|
export { default as PianoComposer } from "./PianoComposer.js";
|
5
4
|
export { debugNativeModule } from "./debug.js";
|
6
|
-
|
7
|
-
// export const {
|
8
|
-
// initializeComposer,
|
9
|
-
// getComposer,
|
10
|
-
// addComposerTag,
|
11
|
-
// addComposerTags,
|
12
|
-
// setComposerZoneId,
|
13
|
-
// setComposerReferrer,
|
14
|
-
// setComposerUrl,
|
15
|
-
// setComposerCustomVariable,
|
16
|
-
// setComposerUserToken,
|
17
|
-
// executeComposer
|
18
|
-
// } = SdkPianoio;
|
19
5
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["default","PianoComposer","debugNativeModule"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA
|
1
|
+
{"version":3,"names":["default","PianoComposer","debugNativeModule"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,aAAa,QAAQ,oBAAiB;AAC1D,SAASC,iBAAiB,QAAQ,YAAS","ignoreList":[]}
|
@@ -1,14 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* This interface defines the full API surface of the native module.
|
3
|
+
* It is a complete and accurate representation of the methods exposed
|
4
|
+
* in SdkPianoioModule.kt.
|
5
|
+
*/
|
1
6
|
interface SdkPianoioType {
|
2
|
-
|
7
|
+
initialize(aid: string): Promise<boolean>;
|
8
|
+
addTag(tag: string): Promise<boolean>;
|
9
|
+
addTags(tags: string[]): Promise<boolean>;
|
10
|
+
setZoneId(zoneId: string): Promise<boolean>;
|
11
|
+
setReferrer(referrer: string): Promise<boolean>;
|
12
|
+
setUrl(url: string): Promise<boolean>;
|
13
|
+
setUserToken(token: string): Promise<boolean>;
|
14
|
+
addCustomVariable(key: string, value: string): Promise<boolean>;
|
15
|
+
setCustomVariables(variables: {
|
16
|
+
[key: string]: string;
|
17
|
+
}): Promise<boolean>;
|
3
18
|
executeExperience(): Promise<any>;
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
19
|
+
signIn(): Promise<any>;
|
20
|
+
signOut(): Promise<any>;
|
21
|
+
getCurrentUser(): Promise<any>;
|
22
|
+
isAuthenticated(): Promise<any>;
|
23
|
+
getStatus(): Promise<any>;
|
24
|
+
isInitialized(): Promise<boolean>;
|
25
|
+
clearConfiguration(): Promise<boolean>;
|
26
|
+
removeTag(tag: string): Promise<boolean>;
|
27
|
+
removeCustomVariable(key: string): Promise<boolean>;
|
28
|
+
clearTags(): Promise<boolean>;
|
29
|
+
clearCustomVariables(): Promise<boolean>;
|
12
30
|
}
|
13
31
|
declare const _default: SdkPianoioType;
|
14
32
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NativeSdkPianoio.d.ts","sourceRoot":"","sources":["../../../../src/NativeSdkPianoio.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;
|
1
|
+
{"version":3,"file":"NativeSdkPianoio.d.ts","sourceRoot":"","sources":["../../../../src/NativeSdkPianoio.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,UAAU,cAAc;IAEtB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAG1C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChE,kBAAkB,CAAC,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAG3E,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAGlC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACxB,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAGhC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1B,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C;wBAW4B,cAAc;AAA3C,wBAA4C"}
|
@@ -1,34 +1,61 @@
|
|
1
|
+
/**
|
2
|
+
* A wrapper class for the native SdkPianoio module that provides a clean,
|
3
|
+
* object-oriented API for interacting with the Piano SDK.
|
4
|
+
*/
|
1
5
|
declare class PianoComposer {
|
2
|
-
private aid;
|
3
|
-
private tags;
|
4
|
-
private zoneId;
|
5
|
-
private referrer;
|
6
|
-
private customVariables;
|
7
|
-
private userToken;
|
8
|
-
private url;
|
9
6
|
private constructor();
|
10
7
|
/**
|
11
8
|
* Creates and initializes a new PianoComposer instance.
|
12
|
-
* This is the entry point for using the library.
|
9
|
+
* This is the main entry point for using the library.
|
13
10
|
* @param aid Your Application ID from Piano.io
|
14
11
|
*/
|
15
12
|
static create(aid: string): Promise<PianoComposer>;
|
16
|
-
addTag(tag: string): Promise<
|
17
|
-
addTags(tags: string[]): Promise<
|
18
|
-
setZoneId(zoneId: string): Promise<
|
19
|
-
setReferrer(referrer: string): Promise<
|
20
|
-
setCustomVariable(name: string, value: string): Promise<
|
21
|
-
|
22
|
-
|
13
|
+
addTag(tag: string): Promise<boolean>;
|
14
|
+
addTags(tags: string[]): Promise<boolean>;
|
15
|
+
setZoneId(zoneId: string): Promise<boolean>;
|
16
|
+
setReferrer(referrer: string): Promise<boolean>;
|
17
|
+
setCustomVariable(name: string, value: string): Promise<boolean>;
|
18
|
+
setCustomVariables(variables: {
|
19
|
+
[key: string]: string;
|
20
|
+
}): Promise<boolean>;
|
21
|
+
setUserToken(token: string): Promise<boolean>;
|
22
|
+
setUrl(url: string): Promise<boolean>;
|
23
|
+
/**
|
24
|
+
* Signs in the user with Piano.
|
25
|
+
* @returns A promise that resolves with user information.
|
26
|
+
*/
|
27
|
+
signIn(): Promise<any>;
|
28
|
+
/**
|
29
|
+
* Signs out the current user.
|
30
|
+
* @returns A promise that resolves when sign out is complete.
|
31
|
+
*/
|
32
|
+
signOut(): Promise<any>;
|
33
|
+
/**
|
34
|
+
* Gets information about the current authenticated user.
|
35
|
+
* @returns A promise that resolves with user information.
|
36
|
+
*/
|
37
|
+
getCurrentUser(): Promise<any>;
|
38
|
+
/**
|
39
|
+
* Checks if a user is currently authenticated.
|
40
|
+
* @returns A promise that resolves with the authentication status.
|
41
|
+
*/
|
42
|
+
isAuthenticated(): Promise<any>;
|
23
43
|
/**
|
24
44
|
* Executes the Piano experience with the current configuration.
|
25
45
|
* This is the primary method to get a decision from the Piano backend.
|
26
46
|
* @returns A promise that resolves with the event data object from the native SDK.
|
27
47
|
*/
|
28
48
|
executeExperience(): Promise<any>;
|
29
|
-
|
30
|
-
|
31
|
-
|
49
|
+
/**
|
50
|
+
* Gets the current status of the SDK.
|
51
|
+
* @returns A promise that resolves with status information.
|
52
|
+
*/
|
53
|
+
getStatus(): Promise<any>;
|
54
|
+
/**
|
55
|
+
* Clears all configured tags and custom variables.
|
56
|
+
* @returns A promise that resolves when the configuration is cleared.
|
57
|
+
*/
|
58
|
+
clearConfiguration(): Promise<boolean>;
|
32
59
|
}
|
33
60
|
export default PianoComposer;
|
34
61
|
//# sourceMappingURL=PianoComposer.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PianoComposer.d.ts","sourceRoot":"","sources":["../../../../src/PianoComposer.tsx"],"names":[],"mappings":"AAEA,cAAM,aAAa;IAEjB,OAAO,CAAC,GAAG,
|
1
|
+
{"version":3,"file":"PianoComposer.d.ts","sourceRoot":"","sources":["../../../../src/PianoComposer.tsx"],"names":[],"mappings":"AAEA;;;GAGG;AACH,cAAM,aAAa;IAEjB,OAAO;IAIP;;;;OAIG;WACU,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAQlD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhE,kBAAkB,CAAC,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1E,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM3C;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC;IAI5B;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;IAI7B;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC;IAIpC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC;IAMrC;;;;OAIG;IACG,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC;IAMvC;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC;IAI/B;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;CAG7C;AAED,eAAe,aAAa,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|