@altcraft/react-native-sdk 0.0.4 → 1.0.0
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/LICENSE +48 -20
- package/README.md +21 -120
- package/autolink.js +36 -0
- package/lib/commonjs/altcraft_sdk.js +297 -0
- package/lib/commonjs/altcraft_sdk.js.map +1 -0
- package/lib/commonjs/index.js +192 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/altcraft_sdk.js +292 -0
- package/lib/module/altcraft_sdk.js.map +1 -0
- package/lib/module/index.js +13 -427
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/altcraft_sdk.d.ts +143 -0
- package/lib/typescript/commonjs/src/altcraft_sdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +24 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/altcraft_sdk.d.ts +143 -0
- package/lib/typescript/module/src/altcraft_sdk.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +24 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +49 -95
- package/scripts/postinstall.cjs +195 -0
- package/src/altcraft_sdk.ts +337 -0
- package/src/index.ts +91 -0
- package/Sdk.podspec +0 -48
- package/android/build.gradle +0 -77
- package/android/gradle.properties +0 -5
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/com/altcraft/sdk/SdkEventEmitter.kt +0 -50
- package/android/src/main/java/com/altcraft/sdk/SdkModule.kt +0 -949
- package/android/src/main/java/com/altcraft/sdk/SdkPackage.kt +0 -41
- package/android/src/main/java/com/altcraft/sdk/utilities/Converter.kt +0 -326
- package/android/src/main/java/com/altcraft/sdk/utilities/Extension.kt +0 -72
- package/ios/Converter.swift +0 -640
- package/ios/Sdk.h +0 -20
- package/ios/Sdk.mm +0 -979
- package/ios/SdkModule.swift +0 -778
- package/lib/module/NativeSdk.js +0 -48
- package/lib/module/NativeSdk.js.map +0 -1
- package/lib/module/Utilities.js +0 -178
- package/lib/module/Utilities.js.map +0 -1
- package/lib/typescript/src/NativeSdk.d.ts +0 -215
- package/lib/typescript/src/NativeSdk.d.ts.map +0 -1
- package/lib/typescript/src/Utilities.d.ts +0 -47
- package/lib/typescript/src/Utilities.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -252
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/react-native.config.js +0 -10
- package/src/NativeSdk.ts +0 -313
- package/src/Utilities.ts +0 -180
- package/src/index.tsx +0 -570
- /package/lib/typescript/{package.json → module/package.json} +0 -0
package/lib/module/NativeSdk.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
-
|
|
5
|
-
// ---------------- Data models ----------------
|
|
6
|
-
|
|
7
|
-
/** Subscription category metadata. */
|
|
8
|
-
|
|
9
|
-
/** UTM parameters for event attribution. */
|
|
10
|
-
|
|
11
|
-
// ---------------- Subscription Types ----------------
|
|
12
|
-
|
|
13
|
-
/** Email subscription data. */
|
|
14
|
-
|
|
15
|
-
/** SMS subscription data. */
|
|
16
|
-
|
|
17
|
-
/** Push subscription data. */
|
|
18
|
-
|
|
19
|
-
/** CC-data subscription (Telegram, WhatsApp, Viber, Notify). */
|
|
20
|
-
|
|
21
|
-
/** Union of all supported subscription types. */
|
|
22
|
-
|
|
23
|
-
// ---------------- API models ----------------
|
|
24
|
-
|
|
25
|
-
/** Profile data returned from the API. */
|
|
26
|
-
|
|
27
|
-
/** API response payload. */
|
|
28
|
-
|
|
29
|
-
/** API response with HTTP status code. */
|
|
30
|
-
|
|
31
|
-
// ---------------- Config / SDK models ----------------
|
|
32
|
-
|
|
33
|
-
/** Application metadata. */
|
|
34
|
-
|
|
35
|
-
/** SDK configuration object. */
|
|
36
|
-
|
|
37
|
-
/** Push token data. */
|
|
38
|
-
|
|
39
|
-
/** SDK event emitted from native via NativeEventEmitter ("AltcraftSdkEvent"). */
|
|
40
|
-
|
|
41
|
-
// ---------------- TurboModule Spec ----------------
|
|
42
|
-
|
|
43
|
-
// ---------------- Export ----------------
|
|
44
|
-
|
|
45
|
-
/** Native TurboModule instance. */
|
|
46
|
-
const NativeSDK = TurboModuleRegistry.getEnforcing('Sdk');
|
|
47
|
-
export default NativeSDK;
|
|
48
|
-
//# sourceMappingURL=NativeSdk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","NativeSDK","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSdk.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;;AAEpE;;AAEA;;AAQA;;AAUA;;AAEA;;AAWA;;AAWA;;AAYA;;AAYA;;AAOA;;AAEA;;AAQA;;AAOA;;AAMA;;AAEA;;AAOA;;AAeA;;AAMA;;AASA;;AAyKA;;AAEA;AACA,MAAMC,SAAS,GAAGD,mBAAmB,CAACE,YAAY,CAAO,KAAK,CAAC;AAC/D,eAAeD,SAAS","ignoreList":[]}
|
package/lib/module/Utilities.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/** Supported action types for profile field manipulation. */
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Builder for structured profile field actions.
|
|
7
|
-
*
|
|
8
|
-
* Produces a map entry compatible with the native SDK's ActionFieldBuilder.
|
|
9
|
-
* The resulting map is intended to be merged into `profileFields` before
|
|
10
|
-
* passing to `pushSubscribe`, `updateProfileFields`, or similar APIs.
|
|
11
|
-
*/
|
|
12
|
-
export class ActionFieldBuilder {
|
|
13
|
-
constructor(key) {
|
|
14
|
-
this.key = key;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Set field to a specific value. */
|
|
18
|
-
set(value) {
|
|
19
|
-
return {
|
|
20
|
-
[this.key]: {
|
|
21
|
-
action: 'set',
|
|
22
|
-
value
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Unset (remove) a field value. */
|
|
28
|
-
unset(value) {
|
|
29
|
-
return {
|
|
30
|
-
[this.key]: {
|
|
31
|
-
action: 'unset',
|
|
32
|
-
value
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** Increment a numeric field by the given value. */
|
|
38
|
-
incr(value) {
|
|
39
|
-
return {
|
|
40
|
-
[this.key]: {
|
|
41
|
-
action: 'incr',
|
|
42
|
-
value
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** Add a value to a set/array field. */
|
|
48
|
-
add(value) {
|
|
49
|
-
return {
|
|
50
|
-
[this.key]: {
|
|
51
|
-
action: 'add',
|
|
52
|
-
value
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Delete a value from a set/array field. */
|
|
58
|
-
delete(value) {
|
|
59
|
-
return {
|
|
60
|
-
[this.key]: {
|
|
61
|
-
action: 'delete',
|
|
62
|
-
value
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Upsert: set if missing, update if exists. */
|
|
68
|
-
upsert(value) {
|
|
69
|
-
return {
|
|
70
|
-
[this.key]: {
|
|
71
|
-
action: 'upsert',
|
|
72
|
-
value
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Creates an ActionFieldBuilder for the given field key.
|
|
80
|
-
*
|
|
81
|
-
* @param key Profile field key to operate on.
|
|
82
|
-
* @returns Builder instance with action methods.
|
|
83
|
-
*/
|
|
84
|
-
export function actionField(key) {
|
|
85
|
-
return new ActionFieldBuilder(key);
|
|
86
|
-
}
|
|
87
|
-
export class Utilities {
|
|
88
|
-
/** Converts a JS object to { [key: string]: string }
|
|
89
|
-
* for the RN bridge; drops null/undefined. */
|
|
90
|
-
static toNativeStringMap(input) {
|
|
91
|
-
if (input == null) return null;
|
|
92
|
-
const out = {};
|
|
93
|
-
for (const [key, value] of Object.entries(input)) {
|
|
94
|
-
if (value == null) continue;
|
|
95
|
-
switch (typeof value) {
|
|
96
|
-
case 'string':
|
|
97
|
-
out[key] = value;
|
|
98
|
-
break;
|
|
99
|
-
case 'number':
|
|
100
|
-
case 'boolean':
|
|
101
|
-
case 'bigint':
|
|
102
|
-
out[key] = String(value);
|
|
103
|
-
break;
|
|
104
|
-
default:
|
|
105
|
-
try {
|
|
106
|
-
out[key] = JSON.stringify(value);
|
|
107
|
-
} catch {
|
|
108
|
-
out[key] = String(value);
|
|
109
|
-
}
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return Object.keys(out).length > 0 ? out : null;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* New Arch safe:
|
|
118
|
-
* TurboModule codegen does NOT support `any`.
|
|
119
|
-
* Therefore, we serialize any value for UserDefaults into `string`.
|
|
120
|
-
*/
|
|
121
|
-
static toUserDefaultsString(value) {
|
|
122
|
-
if (value == null) return null;
|
|
123
|
-
const t = typeof value;
|
|
124
|
-
if (t === 'string') return String(value);
|
|
125
|
-
if (t === 'number' || t === 'boolean') return String(value);
|
|
126
|
-
try {
|
|
127
|
-
return JSON.stringify(value);
|
|
128
|
-
} catch {
|
|
129
|
-
return String(value);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** Converts Subscription object to native string map format. */
|
|
134
|
-
static subscriptionToNativeMap(subscription) {
|
|
135
|
-
if (subscription == null) return null;
|
|
136
|
-
const result = {
|
|
137
|
-
type: subscription.type,
|
|
138
|
-
resource_id: String(subscription.resource_id)
|
|
139
|
-
};
|
|
140
|
-
if (subscription.status != null) result.status = subscription.status;
|
|
141
|
-
if (subscription.priority != null) result.priority = String(subscription.priority);
|
|
142
|
-
if (subscription.custom_fields != null) {
|
|
143
|
-
try {
|
|
144
|
-
result.custom_fields = JSON.stringify(subscription.custom_fields);
|
|
145
|
-
} catch {
|
|
146
|
-
result.custom_fields = '{}';
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (subscription.cats != null) {
|
|
150
|
-
try {
|
|
151
|
-
result.cats = JSON.stringify(subscription.cats);
|
|
152
|
-
} catch {
|
|
153
|
-
result.cats = '[]';
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
switch (subscription.type) {
|
|
157
|
-
case 'email':
|
|
158
|
-
result.email = subscription.email;
|
|
159
|
-
break;
|
|
160
|
-
case 'sms':
|
|
161
|
-
result.phone = subscription.phone;
|
|
162
|
-
break;
|
|
163
|
-
case 'push':
|
|
164
|
-
result.provider = subscription.provider;
|
|
165
|
-
result.subscription_id = subscription.subscription_id;
|
|
166
|
-
break;
|
|
167
|
-
case 'cc_data':
|
|
168
|
-
try {
|
|
169
|
-
result.cc_data = JSON.stringify(subscription.cc_data);
|
|
170
|
-
} catch {
|
|
171
|
-
result.cc_data = '{}';
|
|
172
|
-
}
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
return result;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=Utilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ActionFieldBuilder","constructor","key","set","value","action","unset","incr","add","delete","upsert","actionField","Utilities","toNativeStringMap","input","out","Object","entries","String","JSON","stringify","keys","length","toUserDefaultsString","t","subscriptionToNativeMap","subscription","result","type","resource_id","status","priority","custom_fields","cats","email","phone","provider","subscription_id","cc_data"],"sourceRoot":"../../src","sources":["Utilities.ts"],"mappings":";;AAEA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,kBAAkB,CAAC;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,MAAM,CAACW,OAAO,GAAG,IAAI;QACvB;QACA;IACJ;IAEA,OAAOX,MAAM;EACf;AACF","ignoreList":[]}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { type TurboModule } from 'react-native';
|
|
2
|
-
/** Subscription category metadata. */
|
|
3
|
-
export type CategoryData = {
|
|
4
|
-
name?: string | null;
|
|
5
|
-
title?: string | null;
|
|
6
|
-
steady?: boolean | null;
|
|
7
|
-
active?: boolean | null;
|
|
8
|
-
};
|
|
9
|
-
/** UTM parameters for event attribution. */
|
|
10
|
-
export type UTM = {
|
|
11
|
-
campaign?: string | null;
|
|
12
|
-
content?: string | null;
|
|
13
|
-
keyword?: string | null;
|
|
14
|
-
medium?: string | null;
|
|
15
|
-
source?: string | null;
|
|
16
|
-
temp?: string | null;
|
|
17
|
-
};
|
|
18
|
-
/** Email subscription data. */
|
|
19
|
-
export type EmailSubscription = {
|
|
20
|
-
type: 'email';
|
|
21
|
-
resource_id: number;
|
|
22
|
-
email: string;
|
|
23
|
-
status?: string | null;
|
|
24
|
-
priority?: number | null;
|
|
25
|
-
custom_fields?: {
|
|
26
|
-
[key: string]: string;
|
|
27
|
-
} | null;
|
|
28
|
-
cats?: string[] | null;
|
|
29
|
-
};
|
|
30
|
-
/** SMS subscription data. */
|
|
31
|
-
export type SmsSubscription = {
|
|
32
|
-
type: 'sms';
|
|
33
|
-
resource_id: number;
|
|
34
|
-
phone: string;
|
|
35
|
-
status?: string | null;
|
|
36
|
-
priority?: number | null;
|
|
37
|
-
custom_fields?: {
|
|
38
|
-
[key: string]: string;
|
|
39
|
-
} | null;
|
|
40
|
-
cats?: string[] | null;
|
|
41
|
-
};
|
|
42
|
-
/** Push subscription data. */
|
|
43
|
-
export type PushSubscription = {
|
|
44
|
-
type: 'push';
|
|
45
|
-
resource_id: number;
|
|
46
|
-
provider: string;
|
|
47
|
-
subscription_id: string;
|
|
48
|
-
status?: string | null;
|
|
49
|
-
priority?: number | null;
|
|
50
|
-
custom_fields?: {
|
|
51
|
-
[key: string]: string;
|
|
52
|
-
} | null;
|
|
53
|
-
cats?: string[] | null;
|
|
54
|
-
};
|
|
55
|
-
/** CC-data subscription (Telegram, WhatsApp, Viber, Notify). */
|
|
56
|
-
export type CcDataSubscription = {
|
|
57
|
-
type: 'cc_data';
|
|
58
|
-
resource_id: number;
|
|
59
|
-
channel: string;
|
|
60
|
-
cc_data: {
|
|
61
|
-
[key: string]: string;
|
|
62
|
-
};
|
|
63
|
-
status?: string | null;
|
|
64
|
-
priority?: number | null;
|
|
65
|
-
custom_fields?: {
|
|
66
|
-
[key: string]: string;
|
|
67
|
-
} | null;
|
|
68
|
-
cats?: string[] | null;
|
|
69
|
-
};
|
|
70
|
-
/** Union of all supported subscription types. */
|
|
71
|
-
export type Subscription = EmailSubscription | SmsSubscription | PushSubscription | CcDataSubscription;
|
|
72
|
-
/** Profile data returned from the API. */
|
|
73
|
-
export type ProfileData = {
|
|
74
|
-
id?: string | null;
|
|
75
|
-
status?: string | null;
|
|
76
|
-
isTest?: boolean | null;
|
|
77
|
-
subscription?: Subscription | null;
|
|
78
|
-
};
|
|
79
|
-
/** API response payload. */
|
|
80
|
-
export type Response = {
|
|
81
|
-
error?: number | null;
|
|
82
|
-
errorText?: string | null;
|
|
83
|
-
profile?: ProfileData | null;
|
|
84
|
-
};
|
|
85
|
-
/** API response with HTTP status code. */
|
|
86
|
-
export type ResponseWithHttpCode = {
|
|
87
|
-
httpCode: number | null;
|
|
88
|
-
response: Response | null;
|
|
89
|
-
};
|
|
90
|
-
/** Application metadata. */
|
|
91
|
-
export type AppInfo = {
|
|
92
|
-
appID: string;
|
|
93
|
-
appIID: string;
|
|
94
|
-
appVer: string;
|
|
95
|
-
};
|
|
96
|
-
/** SDK configuration object. */
|
|
97
|
-
export type AltcraftConfig = {
|
|
98
|
-
apiUrl: string;
|
|
99
|
-
rToken?: string | null;
|
|
100
|
-
appInfo?: AppInfo | null;
|
|
101
|
-
providerPriorityList?: string[] | null;
|
|
102
|
-
enableLogging?: boolean | null;
|
|
103
|
-
android_icon?: number | null;
|
|
104
|
-
android_pushReceiverModules?: string[] | null;
|
|
105
|
-
android_pushChannelName?: string | null;
|
|
106
|
-
android_pushChannelDescription?: string | null;
|
|
107
|
-
};
|
|
108
|
-
/** Push token data. */
|
|
109
|
-
export type TokenData = {
|
|
110
|
-
provider: string | null;
|
|
111
|
-
token: string | null;
|
|
112
|
-
};
|
|
113
|
-
/** SDK event emitted from native via NativeEventEmitter ("AltcraftSdkEvent"). */
|
|
114
|
-
export type SdkEvent = {
|
|
115
|
-
function: string;
|
|
116
|
-
code: number | null;
|
|
117
|
-
message: string;
|
|
118
|
-
type: 'event' | 'error' | 'retryError';
|
|
119
|
-
value?: Record<string, unknown> | null;
|
|
120
|
-
};
|
|
121
|
-
export interface Spec extends TurboModule {
|
|
122
|
-
/** Initializes SDK with provided configuration. */
|
|
123
|
-
initialize(config: AltcraftConfig): Promise<void>;
|
|
124
|
-
/** Creates or updates push subscription. */
|
|
125
|
-
pushSubscribe(sync: boolean | null, profileFields: {
|
|
126
|
-
[key: string]: string;
|
|
127
|
-
} | null, customFields: {
|
|
128
|
-
[key: string]: string;
|
|
129
|
-
} | null, cats: CategoryData[] | null, replace: boolean | null, skipTriggers: boolean | null): void;
|
|
130
|
-
/** Suspends active push subscription. */
|
|
131
|
-
pushSuspend(sync: boolean | null, profileFields: {
|
|
132
|
-
[key: string]: string;
|
|
133
|
-
} | null, customFields: {
|
|
134
|
-
[key: string]: string;
|
|
135
|
-
} | null, cats: CategoryData[] | null, replace: boolean | null, skipTriggers: boolean | null): void;
|
|
136
|
-
/** Unsubscribes from push notifications. */
|
|
137
|
-
pushUnSubscribe(sync: boolean | null, profileFields: {
|
|
138
|
-
[key: string]: string;
|
|
139
|
-
} | null, customFields: {
|
|
140
|
-
[key: string]: string;
|
|
141
|
-
} | null, cats: CategoryData[] | null, replace: boolean | null, skipTriggers: boolean | null): void;
|
|
142
|
-
/** Unsuspends current push subscription. */
|
|
143
|
-
unSuspendPushSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
144
|
-
/** Returns status of the latest subscription. */
|
|
145
|
-
getStatusOfLatestSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
146
|
-
/** Returns status of current subscription. */
|
|
147
|
-
getStatusForCurrentSubscription(): Promise<ResponseWithHttpCode | null>;
|
|
148
|
-
/** Returns subscription status for specific provider. */
|
|
149
|
-
getStatusOfLatestSubscriptionForProvider(provider: string | null): Promise<ResponseWithHttpCode | null>;
|
|
150
|
-
/** Handles incoming push payload (string-only). */
|
|
151
|
-
takePush(message: {
|
|
152
|
-
[key: string]: string;
|
|
153
|
-
} | null): void;
|
|
154
|
-
/** Subscribes to SDK native events. */
|
|
155
|
-
subscribeToEvents(): void;
|
|
156
|
-
/** Unsubscribes from SDK native events. */
|
|
157
|
-
unsubscribeFromEvent(): void;
|
|
158
|
-
/** Required by NativeEventEmitter. */
|
|
159
|
-
addListener(eventName: string): void;
|
|
160
|
-
/** Required by NativeEventEmitter. */
|
|
161
|
-
removeListeners(count: number): void;
|
|
162
|
-
/** Returns current push token. */
|
|
163
|
-
getPushToken(): Promise<TokenData | null>;
|
|
164
|
-
/** Sets push token for provider. */
|
|
165
|
-
setPushToken(provider: string, token: string | null): Promise<void>;
|
|
166
|
-
/** Clears all SDK state and stored data. */
|
|
167
|
-
clear(): Promise<void>;
|
|
168
|
-
/** Requests notification permission (iOS/Android). */
|
|
169
|
-
requestNotificationPermission(): void;
|
|
170
|
-
/**
|
|
171
|
-
* Sends a mobile event to the server.
|
|
172
|
-
*
|
|
173
|
-
*/
|
|
174
|
-
mobileEvent(sid: string, eventName: string, sendMessageId: string | null, payload: {
|
|
175
|
-
[key: string]: string;
|
|
176
|
-
} | null, matching: {
|
|
177
|
-
[key: string]: string;
|
|
178
|
-
} | null, matchingType: string | null, profileFields: {
|
|
179
|
-
[key: string]: string;
|
|
180
|
-
} | null, subscription: {
|
|
181
|
-
[key: string]: string;
|
|
182
|
-
} | null, utm: UTM | null): void;
|
|
183
|
-
/** Sends push delivery event. */
|
|
184
|
-
deliveryEvent(message: {
|
|
185
|
-
[key: string]: string;
|
|
186
|
-
} | null, messageUID: string | null): void;
|
|
187
|
-
/** Sends push open event. */
|
|
188
|
-
openEvent(message: {
|
|
189
|
-
[key: string]: string;
|
|
190
|
-
} | null, messageUID: string | null): void;
|
|
191
|
-
/** Sets value in UserDefaults / SharedPreferences. */
|
|
192
|
-
setUserDefaultsValue(suiteName: string | null, key: string, value: string | null): void;
|
|
193
|
-
/** Updates profile fields on the server. */
|
|
194
|
-
updateProfileFields(profileFields: {
|
|
195
|
-
[key: string]: string;
|
|
196
|
-
} | null, skipTriggers: boolean | null): void;
|
|
197
|
-
/** Forces a push token refresh (delete + re-register). */
|
|
198
|
-
forcedTokenUpdate(): Promise<void>;
|
|
199
|
-
/** Deletes the device token for a given provider. */
|
|
200
|
-
deleteDeviceToken(provider: string): Promise<void>;
|
|
201
|
-
/** Changes the push provider priority list at runtime. */
|
|
202
|
-
changePushProviderPriorityList(priorityList: string[]): Promise<void>;
|
|
203
|
-
/** Checks whether a push payload belongs to Altcraft. */
|
|
204
|
-
isAltcraftPush(message: {
|
|
205
|
-
[key: string]: string;
|
|
206
|
-
} | null): boolean;
|
|
207
|
-
/** Allows re-running initial operations in this session (Android only). */
|
|
208
|
-
unlockInitialOperationsInThisSession(): void;
|
|
209
|
-
/** Sets the App Group name for shared storage (iOS only). */
|
|
210
|
-
setAppGroup(groupName: string | null): void;
|
|
211
|
-
}
|
|
212
|
-
/** Native TurboModule instance. */
|
|
213
|
-
declare const NativeSDK: Spec;
|
|
214
|
-
export default NativeSDK;
|
|
215
|
-
//# sourceMappingURL=NativeSdk.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeSdk.d.ts","sourceRoot":"","sources":["../../../src/NativeSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC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,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,EAC/C,YAAY,EAAE,OAAO,GAAG,IAAI,GAC3B,IAAI,CAAC;IAIR,0DAA0D;IAC1D,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnC,qDAAqD;IACrD,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD,0DAA0D;IAC1D,8BAA8B,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAItE,yDAAyD;IACzD,cAAc,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,OAAO,CAAC;IAInE,2EAA2E;IAC3E,oCAAoC,IAAI,IAAI,CAAC;IAI7C,6DAA6D;IAC7D,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;CAC7C;AAID,mCAAmC;AACnC,QAAA,MAAM,SAAS,MAAgD,CAAC;AAChE,eAAe,SAAS,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Subscription } from './NativeSdk';
|
|
2
|
-
/** Supported action types for profile field manipulation. */
|
|
3
|
-
export type ActionFieldType = 'set' | 'unset' | 'incr' | 'add' | 'delete' | 'upsert';
|
|
4
|
-
/**
|
|
5
|
-
* Builder for structured profile field actions.
|
|
6
|
-
*
|
|
7
|
-
* Produces a map entry compatible with the native SDK's ActionFieldBuilder.
|
|
8
|
-
* The resulting map is intended to be merged into `profileFields` before
|
|
9
|
-
* passing to `pushSubscribe`, `updateProfileFields`, or similar APIs.
|
|
10
|
-
*/
|
|
11
|
-
export declare class ActionFieldBuilder {
|
|
12
|
-
private key;
|
|
13
|
-
constructor(key: string);
|
|
14
|
-
/** Set field to a specific value. */
|
|
15
|
-
set(value: unknown): Record<string, unknown>;
|
|
16
|
-
/** Unset (remove) a field value. */
|
|
17
|
-
unset(value: unknown): Record<string, unknown>;
|
|
18
|
-
/** Increment a numeric field by the given value. */
|
|
19
|
-
incr(value: unknown): Record<string, unknown>;
|
|
20
|
-
/** Add a value to a set/array field. */
|
|
21
|
-
add(value: unknown): Record<string, unknown>;
|
|
22
|
-
/** Delete a value from a set/array field. */
|
|
23
|
-
delete(value: unknown): Record<string, unknown>;
|
|
24
|
-
/** Upsert: set if missing, update if exists. */
|
|
25
|
-
upsert(value: unknown): Record<string, unknown>;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates an ActionFieldBuilder for the given field key.
|
|
29
|
-
*
|
|
30
|
-
* @param key Profile field key to operate on.
|
|
31
|
-
* @returns Builder instance with action methods.
|
|
32
|
-
*/
|
|
33
|
-
export declare function actionField(key: string): ActionFieldBuilder;
|
|
34
|
-
export declare class Utilities {
|
|
35
|
-
/** Converts a JS object to { [key: string]: string }
|
|
36
|
-
* for the RN bridge; drops null/undefined. */
|
|
37
|
-
static toNativeStringMap(input: Record<string, unknown> | null): Record<string, string> | null;
|
|
38
|
-
/**
|
|
39
|
-
* New Arch safe:
|
|
40
|
-
* TurboModule codegen does NOT support `any`.
|
|
41
|
-
* Therefore, we serialize any value for UserDefaults into `string`.
|
|
42
|
-
*/
|
|
43
|
-
static toUserDefaultsString(value: unknown): string | null;
|
|
44
|
-
/** Converts Subscription object to native string map format. */
|
|
45
|
-
static subscriptionToNativeMap(subscription: Subscription | null): Record<string, string> | null;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=Utilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utilities.d.ts","sourceRoot":"","sources":["../../../src/Utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,6DAA6D;AAC7D,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,OAAO,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