@blux.ai/web-sdk 2.1.2 → 2.1.3
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/dist/package.json +2 -2
- package/dist/src/BluxClient.d.ts +14 -5
- package/dist/src/BluxClient.js +62 -37
- package/dist/src/BluxClient.js.map +1 -1
- package/dist/src/apis/APIs.d.ts +63 -14
- package/dist/src/apis/APIs.js +15 -9
- package/dist/src/apis/APIs.js.map +1 -1
- package/dist/src/apis/notificationsUpdate.d.ts +4 -0
- package/dist/src/apis/notificationsUpdate.js +7 -0
- package/dist/src/apis/notificationsUpdate.js.map +1 -0
- package/dist/src/bridges/Bridge.d.ts +30 -0
- package/dist/src/bridges/Bridge.js +11 -0
- package/dist/src/bridges/Bridge.js.map +1 -0
- package/dist/src/bridges/FlutterBridge.d.ts +11 -0
- package/dist/src/bridges/FlutterBridge.js +45 -0
- package/dist/src/bridges/FlutterBridge.js.map +1 -0
- package/dist/src/bridges/RNBridge.d.ts +11 -0
- package/dist/src/bridges/RNBridge.js +39 -0
- package/dist/src/bridges/RNBridge.js.map +1 -0
- package/dist/src/events/types.d.ts +3 -25
- package/dist/src/events/types.js.map +1 -1
- package/dist/src/utils/zodSchemas.d.ts +27 -0
- package/dist/src/utils/zodSchemas.js +8 -0
- package/dist/src/utils/zodSchemas.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/src/apis/APIs.d.ts
CHANGED
|
@@ -144,8 +144,6 @@ export declare namespace APIs {
|
|
|
144
144
|
events: z.ZodArray<z.ZodObject<{
|
|
145
145
|
device_id: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("bson-objectid").default, string>>;
|
|
146
146
|
event_type: z.ZodString;
|
|
147
|
-
event_value: z.ZodOptional<z.ZodString>;
|
|
148
|
-
item_id: z.ZodOptional<z.ZodString>;
|
|
149
147
|
event_properties: z.ZodOptional<z.ZodObject<{
|
|
150
148
|
section: z.ZodOptional<z.ZodString>;
|
|
151
149
|
prev_section: z.ZodOptional<z.ZodString>;
|
|
@@ -160,12 +158,18 @@ export declare namespace APIs {
|
|
|
160
158
|
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
161
159
|
id: z.ZodString;
|
|
162
160
|
price: z.ZodNumber;
|
|
161
|
+
quantity: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
custom_event_properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, z.ZodUndefined]>>>;
|
|
163
163
|
}, "strip", z.ZodTypeAny, {
|
|
164
164
|
price: number;
|
|
165
165
|
id: string;
|
|
166
|
+
quantity?: number | undefined;
|
|
167
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | Date | {}[] | {} | undefined> | undefined;
|
|
166
168
|
}, {
|
|
167
169
|
price: number;
|
|
168
170
|
id: string;
|
|
171
|
+
quantity?: number | undefined;
|
|
172
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | {}[] | {} | undefined> | undefined;
|
|
169
173
|
}>, "many">>;
|
|
170
174
|
search_query: z.ZodOptional<z.ZodString>;
|
|
171
175
|
order_amount: z.ZodOptional<z.ZodNumber>;
|
|
@@ -180,6 +184,7 @@ export declare namespace APIs {
|
|
|
180
184
|
type: string;
|
|
181
185
|
id: string;
|
|
182
186
|
}>>;
|
|
187
|
+
click_target: z.ZodOptional<z.ZodString>;
|
|
183
188
|
}, "strip", z.ZodTypeAny, {
|
|
184
189
|
section?: string | undefined;
|
|
185
190
|
prev_section?: string | undefined;
|
|
@@ -194,6 +199,8 @@ export declare namespace APIs {
|
|
|
194
199
|
items?: {
|
|
195
200
|
price: number;
|
|
196
201
|
id: string;
|
|
202
|
+
quantity?: number | undefined;
|
|
203
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | Date | {}[] | {} | undefined> | undefined;
|
|
197
204
|
}[] | undefined;
|
|
198
205
|
search_query?: string | undefined;
|
|
199
206
|
order_amount?: number | undefined;
|
|
@@ -202,6 +209,7 @@ export declare namespace APIs {
|
|
|
202
209
|
type: string;
|
|
203
210
|
id: string;
|
|
204
211
|
} | undefined;
|
|
212
|
+
click_target?: string | undefined;
|
|
205
213
|
}, {
|
|
206
214
|
section?: string | undefined;
|
|
207
215
|
prev_section?: string | undefined;
|
|
@@ -216,6 +224,8 @@ export declare namespace APIs {
|
|
|
216
224
|
items?: {
|
|
217
225
|
price: number;
|
|
218
226
|
id: string;
|
|
227
|
+
quantity?: number | undefined;
|
|
228
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | {}[] | {} | undefined> | undefined;
|
|
219
229
|
}[] | undefined;
|
|
220
230
|
search_query?: string | undefined;
|
|
221
231
|
order_amount?: number | undefined;
|
|
@@ -224,15 +234,19 @@ export declare namespace APIs {
|
|
|
224
234
|
type: string;
|
|
225
235
|
id: string;
|
|
226
236
|
} | undefined;
|
|
237
|
+
click_target?: string | undefined;
|
|
227
238
|
}>>;
|
|
228
239
|
custom_event_properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, z.ZodUndefined]>>>;
|
|
229
240
|
internal_event_properties: z.ZodOptional<z.ZodObject<{
|
|
230
241
|
url: z.ZodOptional<z.ZodString>;
|
|
231
242
|
ref: z.ZodOptional<z.ZodString>;
|
|
243
|
+
click_target: z.ZodOptional<z.ZodString>;
|
|
232
244
|
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
click_target?: string | undefined;
|
|
233
246
|
url?: string | undefined;
|
|
234
247
|
ref?: string | undefined;
|
|
235
248
|
}, {
|
|
249
|
+
click_target?: string | undefined;
|
|
236
250
|
url?: string | undefined;
|
|
237
251
|
ref?: string | undefined;
|
|
238
252
|
}>>;
|
|
@@ -240,9 +254,8 @@ export declare namespace APIs {
|
|
|
240
254
|
}, "strip", z.ZodTypeAny, {
|
|
241
255
|
event_type: string;
|
|
242
256
|
captured_at: Date;
|
|
243
|
-
|
|
257
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | Date | {}[] | {} | undefined> | undefined;
|
|
244
258
|
device_id?: import("bson-objectid").default | undefined;
|
|
245
|
-
event_value?: string | undefined;
|
|
246
259
|
event_properties?: {
|
|
247
260
|
section?: string | undefined;
|
|
248
261
|
prev_section?: string | undefined;
|
|
@@ -257,6 +270,8 @@ export declare namespace APIs {
|
|
|
257
270
|
items?: {
|
|
258
271
|
price: number;
|
|
259
272
|
id: string;
|
|
273
|
+
quantity?: number | undefined;
|
|
274
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | Date | {}[] | {} | undefined> | undefined;
|
|
260
275
|
}[] | undefined;
|
|
261
276
|
search_query?: string | undefined;
|
|
262
277
|
order_amount?: number | undefined;
|
|
@@ -265,18 +280,18 @@ export declare namespace APIs {
|
|
|
265
280
|
type: string;
|
|
266
281
|
id: string;
|
|
267
282
|
} | undefined;
|
|
283
|
+
click_target?: string | undefined;
|
|
268
284
|
} | undefined;
|
|
269
|
-
custom_event_properties?: Record<string, string | number | boolean | string[] | Date | {}[] | {} | undefined> | undefined;
|
|
270
285
|
internal_event_properties?: {
|
|
286
|
+
click_target?: string | undefined;
|
|
271
287
|
url?: string | undefined;
|
|
272
288
|
ref?: string | undefined;
|
|
273
289
|
} | undefined;
|
|
274
290
|
}, {
|
|
275
291
|
event_type: string;
|
|
276
292
|
captured_at: string;
|
|
277
|
-
|
|
293
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | {}[] | {} | undefined> | undefined;
|
|
278
294
|
device_id?: string | undefined;
|
|
279
|
-
event_value?: string | undefined;
|
|
280
295
|
event_properties?: {
|
|
281
296
|
section?: string | undefined;
|
|
282
297
|
prev_section?: string | undefined;
|
|
@@ -291,6 +306,8 @@ export declare namespace APIs {
|
|
|
291
306
|
items?: {
|
|
292
307
|
price: number;
|
|
293
308
|
id: string;
|
|
309
|
+
quantity?: number | undefined;
|
|
310
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | {}[] | {} | undefined> | undefined;
|
|
294
311
|
}[] | undefined;
|
|
295
312
|
search_query?: string | undefined;
|
|
296
313
|
order_amount?: number | undefined;
|
|
@@ -299,9 +316,10 @@ export declare namespace APIs {
|
|
|
299
316
|
type: string;
|
|
300
317
|
id: string;
|
|
301
318
|
} | undefined;
|
|
319
|
+
click_target?: string | undefined;
|
|
302
320
|
} | undefined;
|
|
303
|
-
custom_event_properties?: Record<string, string | number | boolean | string[] | {}[] | {} | undefined> | undefined;
|
|
304
321
|
internal_event_properties?: {
|
|
322
|
+
click_target?: string | undefined;
|
|
305
323
|
url?: string | undefined;
|
|
306
324
|
ref?: string | undefined;
|
|
307
325
|
} | undefined;
|
|
@@ -310,9 +328,8 @@ export declare namespace APIs {
|
|
|
310
328
|
events: {
|
|
311
329
|
event_type: string;
|
|
312
330
|
captured_at: Date;
|
|
313
|
-
|
|
331
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | Date | {}[] | {} | undefined> | undefined;
|
|
314
332
|
device_id?: import("bson-objectid").default | undefined;
|
|
315
|
-
event_value?: string | undefined;
|
|
316
333
|
event_properties?: {
|
|
317
334
|
section?: string | undefined;
|
|
318
335
|
prev_section?: string | undefined;
|
|
@@ -327,6 +344,8 @@ export declare namespace APIs {
|
|
|
327
344
|
items?: {
|
|
328
345
|
price: number;
|
|
329
346
|
id: string;
|
|
347
|
+
quantity?: number | undefined;
|
|
348
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | Date | {}[] | {} | undefined> | undefined;
|
|
330
349
|
}[] | undefined;
|
|
331
350
|
search_query?: string | undefined;
|
|
332
351
|
order_amount?: number | undefined;
|
|
@@ -335,9 +354,10 @@ export declare namespace APIs {
|
|
|
335
354
|
type: string;
|
|
336
355
|
id: string;
|
|
337
356
|
} | undefined;
|
|
357
|
+
click_target?: string | undefined;
|
|
338
358
|
} | undefined;
|
|
339
|
-
custom_event_properties?: Record<string, string | number | boolean | string[] | Date | {}[] | {} | undefined> | undefined;
|
|
340
359
|
internal_event_properties?: {
|
|
360
|
+
click_target?: string | undefined;
|
|
341
361
|
url?: string | undefined;
|
|
342
362
|
ref?: string | undefined;
|
|
343
363
|
} | undefined;
|
|
@@ -346,9 +366,8 @@ export declare namespace APIs {
|
|
|
346
366
|
events: {
|
|
347
367
|
event_type: string;
|
|
348
368
|
captured_at: string;
|
|
349
|
-
|
|
369
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | {}[] | {} | undefined> | undefined;
|
|
350
370
|
device_id?: string | undefined;
|
|
351
|
-
event_value?: string | undefined;
|
|
352
371
|
event_properties?: {
|
|
353
372
|
section?: string | undefined;
|
|
354
373
|
prev_section?: string | undefined;
|
|
@@ -363,6 +382,8 @@ export declare namespace APIs {
|
|
|
363
382
|
items?: {
|
|
364
383
|
price: number;
|
|
365
384
|
id: string;
|
|
385
|
+
quantity?: number | undefined;
|
|
386
|
+
custom_event_properties?: Record<string, string | number | boolean | string[] | {}[] | {} | undefined> | undefined;
|
|
366
387
|
}[] | undefined;
|
|
367
388
|
search_query?: string | undefined;
|
|
368
389
|
order_amount?: number | undefined;
|
|
@@ -371,9 +392,10 @@ export declare namespace APIs {
|
|
|
371
392
|
type: string;
|
|
372
393
|
id: string;
|
|
373
394
|
} | undefined;
|
|
395
|
+
click_target?: string | undefined;
|
|
374
396
|
} | undefined;
|
|
375
|
-
custom_event_properties?: Record<string, string | number | boolean | string[] | {}[] | {} | undefined> | undefined;
|
|
376
397
|
internal_event_properties?: {
|
|
398
|
+
click_target?: string | undefined;
|
|
377
399
|
url?: string | undefined;
|
|
378
400
|
ref?: string | undefined;
|
|
379
401
|
} | undefined;
|
|
@@ -609,9 +631,36 @@ export declare namespace APIs {
|
|
|
609
631
|
baseUrl: string;
|
|
610
632
|
} & {
|
|
611
633
|
shouldDisplay: true;
|
|
634
|
+
nextPollDelay: number;
|
|
612
635
|
}) | {
|
|
613
636
|
shouldDisplay: false;
|
|
637
|
+
nextPollDelay: number;
|
|
614
638
|
};
|
|
615
639
|
}
|
|
640
|
+
namespace notificationsUpdate {
|
|
641
|
+
const name = "notificationsUpdate";
|
|
642
|
+
const path = "/applications/{application_id}/notifications/{notification_id}";
|
|
643
|
+
const method = HttpMethod.POST;
|
|
644
|
+
const pathSchema: z.ZodObject<{
|
|
645
|
+
application_id: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("bson-objectid").default, string>;
|
|
646
|
+
notification_id: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("bson-objectid").default, string>;
|
|
647
|
+
}, "strip", z.ZodTypeAny, {
|
|
648
|
+
application_id: import("bson-objectid").default;
|
|
649
|
+
notification_id: import("bson-objectid").default;
|
|
650
|
+
}, {
|
|
651
|
+
application_id: string;
|
|
652
|
+
notification_id: string;
|
|
653
|
+
}>;
|
|
654
|
+
type PathParam = Serialize<z.input<typeof pathSchema>>;
|
|
655
|
+
const bodySchema: z.ZodObject<{
|
|
656
|
+
status: z.ZodLiteral<"received">;
|
|
657
|
+
}, "strip", z.ZodTypeAny, {
|
|
658
|
+
status: "received";
|
|
659
|
+
}, {
|
|
660
|
+
status: "received";
|
|
661
|
+
}>;
|
|
662
|
+
type Body = Serialize<z.input<typeof bodySchema>>;
|
|
663
|
+
type ResponseData = boolean;
|
|
664
|
+
}
|
|
616
665
|
}
|
|
617
666
|
export {};
|
package/dist/src/apis/APIs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { countryCodeWithLowerCaseSchema, customPropertiesRequestSchema, customPropertiesSchema, dateSchema, eventPropertiesSchema, objectIdSchema, recommendationRequestSchema, } from "../utils/zodSchemas";
|
|
3
|
+
import { countryCodeWithLowerCaseSchema, customPropertiesRequestSchema, customPropertiesSchema, dateSchema, eventPropertiesSchema, internalEventPropertiesSchema, objectIdSchema, recommendationRequestSchema, } from "../utils/zodSchemas";
|
|
4
4
|
var HttpMethod;
|
|
5
5
|
(function (HttpMethod) {
|
|
6
6
|
HttpMethod["GET"] = "get";
|
|
@@ -80,16 +80,9 @@ export var APIs;
|
|
|
80
80
|
events: z.array(z.object({
|
|
81
81
|
device_id: objectIdSchema.optional(),
|
|
82
82
|
event_type: z.string(),
|
|
83
|
-
event_value: z.string().optional(),
|
|
84
|
-
item_id: z.string().optional(),
|
|
85
83
|
event_properties: eventPropertiesSchema.optional(),
|
|
86
84
|
custom_event_properties: customPropertiesSchema.optional(),
|
|
87
|
-
internal_event_properties:
|
|
88
|
-
.object({
|
|
89
|
-
url: z.string().optional(),
|
|
90
|
-
ref: z.string().optional(),
|
|
91
|
-
})
|
|
92
|
-
.optional(),
|
|
85
|
+
internal_event_properties: internalEventPropertiesSchema.optional(),
|
|
93
86
|
captured_at: dateSchema,
|
|
94
87
|
})),
|
|
95
88
|
});
|
|
@@ -181,5 +174,18 @@ export var APIs;
|
|
|
181
174
|
]),
|
|
182
175
|
});
|
|
183
176
|
})(inappsDispatcher = APIs.inappsDispatcher || (APIs.inappsDispatcher = {}));
|
|
177
|
+
let notificationsUpdate;
|
|
178
|
+
(function (notificationsUpdate) {
|
|
179
|
+
notificationsUpdate.name = "notificationsUpdate";
|
|
180
|
+
notificationsUpdate.path = `${applicationsRoot}/notifications/{notification_id}`;
|
|
181
|
+
notificationsUpdate.method = HttpMethod.POST;
|
|
182
|
+
notificationsUpdate.pathSchema = z.object({
|
|
183
|
+
application_id: objectIdSchema,
|
|
184
|
+
notification_id: objectIdSchema,
|
|
185
|
+
});
|
|
186
|
+
notificationsUpdate.bodySchema = z.object({
|
|
187
|
+
status: z.literal("received"),
|
|
188
|
+
});
|
|
189
|
+
})(notificationsUpdate = APIs.notificationsUpdate || (APIs.notificationsUpdate = {}));
|
|
184
190
|
})(APIs || (APIs = {}));
|
|
185
191
|
//# sourceMappingURL=APIs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIs.js","sourceRoot":"/","sources":["src/apis/APIs.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,sBAAsB,EACtB,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAK7B,IAAK,UAKJ;AALD,WAAK,UAAU;IACb,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AACnB,CAAC,EALI,UAAU,KAAV,UAAU,QAKd;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACrB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,gBAAgB,GAAG,gCAAgC,CAAC;AAC1D,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAE/D,MAAM,KAAW,IAAI,CA+OpB;AA/OD,WAAiB,IAAI;IACnB,IAAiB,mBAAmB,CA6BnC;IA7BD,WAAiB,mBAAmB;QACrB,wBAAI,GAAG,qBAAqB,CAAC;QAC7B,wBAAI,GAAG,GAAG,gBAAgB,wBAAwB,CAAC;QACnD,0BAAM,GAAG,UAAU,CAAC,IAAI,CAAC;QAEzB,8BAAU,GAAG,CAAC,CAAC,MAAM,CAAC;YACjC,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE;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E,cAAc;YACzB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;gBAChB,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC;gBACjC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC;gBAC7B,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC;aAClC,CAAC;SACH,CAAC,CAAC;IAaL,CAAC,EA/BgB,gBAAgB,GAAhB,qBAAgB,KAAhB,qBAAgB,QA+BhC;AACH,CAAC,EA/OgB,IAAI,KAAJ,IAAI,QA+OpB","sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\nimport { z } from \"zod\";\n\nimport {\n countryCodeWithLowerCaseSchema,\n customPropertiesRequestSchema,\n customPropertiesSchema,\n dateSchema,\n eventPropertiesSchema,\n objectIdSchema,\n recommendationRequestSchema,\n} from \"../utils/zodSchemas\";\n\nimport type { Serialize } from \"../utils/Base\";\nimport type { RecResponse } from \"../utils/zodSchemas\";\n\nenum HttpMethod {\n GET = \"get\",\n POST = \"post\",\n PUT = \"put\",\n DELETE = \"delete\",\n}\n\nexport enum DevicePlatform {\n ios = \"ios\",\n android = \"android\",\n browser = \"browser\",\n}\n\nconst applicationsRoot = \"/applications/{application_id}\";\nconst applicationsRootV2 = \"/v2/applications/{application_id}\";\n\nexport namespace APIs {\n export namespace bluxUsersInitialize {\n export const name = \"bluxUsersInitialize\";\n export const path = `${applicationsRoot}/blux-users/initialize`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = z.object({\n device_id: objectIdSchema.optional(),\n country_code: countryCodeWithLowerCaseSchema.optional(),\n device_model: z.string(),\n language_code: z.string(),\n os_version: z.string(),\n platform: z.nativeEnum(DevicePlatform),\n sdk_type: z.string(),\n sdk_version: z.string(),\n timezone: z.string(),\n isVisitHandlingInSdk: z.boolean().default(false), // sdk 업데이트 후 삭제\n blux_user_id: z.string().optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n device_id?: string;\n };\n }\n\n export namespace bluxUsersSignIn {\n export const name = \"bluxUsersSignIn\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/sign-in`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n user_id: z.string(),\n device_id: z.string().optional(), // TODO: @all sdk update 후 필수로 변경\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersSignOut {\n export const name = \"bluxUsersSignOut\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/sign-out`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n device_id: objectIdSchema.optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(), // TODO: @all objectIdSchema 로 변경\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersCollectEvents {\n export const name = \"bluxUsersCollectEvents\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/collect-events`;\n export const method = HttpMethod.POST;\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n events: z.array(\n z.object({\n device_id: objectIdSchema.optional(),\n event_type: z.string(),\n event_value: z.string().optional(),\n item_id: z.string().optional(),\n event_properties: eventPropertiesSchema.optional(),\n custom_event_properties: customPropertiesSchema.optional(),\n internal_event_properties: z\n .object({\n url: z.string().optional(),\n ref: z.string().optional(),\n })\n .optional(),\n captured_at: dateSchema,\n }),\n ),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export type ResponseData = boolean;\n }\n\n export namespace bluxUsersUpdateUserProperties {\n export const name = \"bluxUsersUpdateUserProperties\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/update-user-properties`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n properties: z.object({\n phone_number: z.string().nullable().optional(),\n email_address: z.string().nullable().optional(),\n nighttime_notification_consent: z.boolean().nullable().optional(),\n marketing_notification_consent: z.boolean().nullable().optional(),\n\n // TODO: @luna 김캐디 연동 수정 이후 삭제\n sms_consent: z.boolean().nullable().optional(),\n email_consent: z.boolean().nullable().optional(),\n\n marketing_notification_sms_consent: z.boolean().nullable().optional(),\n marketing_notification_email_consent: z.boolean().nullable().optional(),\n marketing_notification_kakao_consent: z.boolean().nullable().optional(),\n marketing_notification_push_consent: z.boolean().nullable().optional(),\n }),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersUpdateCustomUserProperties {\n export const name = \"bluxUsersUpdateCustomUserProperties\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/update-custom-user-properties`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n properties: customPropertiesRequestSchema,\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersGetItemRecommendationsV2 {\n export const name = \"bluxUsersGetItemRecommendationsV2\";\n export const path = `${applicationsRootV2}/blux-users/{blux_user_id}/item-recommendations`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = recommendationRequestSchema;\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = RecResponse;\n }\n\n export namespace crmEventsCreate {\n export const name = \"crmEventsCreate\";\n export const path = `${applicationsRoot}/crm-events`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = z.object({\n notification_id: objectIdSchema,\n crm_event_type: z.union([\n z.literal(\"push_opened\"),\n z.literal(\"button_clicked\"),\n z.literal(\"landing_clicked\"),\n z.literal(\"inapp_opened\"),\n ]),\n captured_at: dateSchema,\n item_id: z.string().optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string(),\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = boolean;\n }\n export namespace inappsDispatcher {\n export const name = \"inappsDispatcher\";\n export const path = `${applicationsRoot}/inapps/dispatch`;\n export const method = HttpMethod.POST;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n blux_user_id: objectIdSchema,\n device_id: objectIdSchema,\n platform: z.union([\n z.literal(DevicePlatform.android),\n z.literal(DevicePlatform.ios),\n z.literal(DevicePlatform.browser),\n ]),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export type ResponseData =\n | ({\n notificationId: string;\n inappId: string;\n htmlString: string;\n baseUrl: string;\n } & { shouldDisplay: true })\n | {\n shouldDisplay: false;\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"APIs.js","sourceRoot":"/","sources":["src/apis/APIs.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,sBAAsB,EACtB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;IAGL,CAAC,EAhBgB,mBAAmB,GAAnB,wBAAmB,KAAnB,wBAAmB,QAgBnC;AACH,CAAC,EA3PgB,IAAI,KAAJ,IAAI,QA2PpB","sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\nimport { z } from \"zod\";\n\nimport {\n countryCodeWithLowerCaseSchema,\n customPropertiesRequestSchema,\n customPropertiesSchema,\n dateSchema,\n eventPropertiesSchema,\n internalEventPropertiesSchema,\n objectIdSchema,\n recommendationRequestSchema,\n} from \"../utils/zodSchemas\";\n\nimport type { Serialize } from \"../utils/Base\";\nimport type { RecResponse } from \"../utils/zodSchemas\";\n\nenum HttpMethod {\n GET = \"get\",\n POST = \"post\",\n PUT = \"put\",\n DELETE = \"delete\",\n}\n\nexport enum DevicePlatform {\n ios = \"ios\",\n android = \"android\",\n browser = \"browser\",\n}\n\nconst applicationsRoot = \"/applications/{application_id}\";\nconst applicationsRootV2 = \"/v2/applications/{application_id}\";\n\nexport namespace APIs {\n export namespace bluxUsersInitialize {\n export const name = \"bluxUsersInitialize\";\n export const path = `${applicationsRoot}/blux-users/initialize`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = z.object({\n device_id: objectIdSchema.optional(),\n country_code: countryCodeWithLowerCaseSchema.optional(),\n device_model: z.string(),\n language_code: z.string(),\n os_version: z.string(),\n platform: z.nativeEnum(DevicePlatform),\n sdk_type: z.string(),\n sdk_version: z.string(),\n timezone: z.string(),\n isVisitHandlingInSdk: z.boolean().default(false), // sdk 업데이트 후 삭제\n blux_user_id: z.string().optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n device_id?: string;\n };\n }\n\n export namespace bluxUsersSignIn {\n export const name = \"bluxUsersSignIn\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/sign-in`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n user_id: z.string(),\n device_id: z.string().optional(), // TODO: @all sdk update 후 필수로 변경\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersSignOut {\n export const name = \"bluxUsersSignOut\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/sign-out`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n device_id: objectIdSchema.optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(), // TODO: @all objectIdSchema 로 변경\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersCollectEvents {\n export const name = \"bluxUsersCollectEvents\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/collect-events`;\n export const method = HttpMethod.POST;\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n events: z.array(\n z.object({\n device_id: objectIdSchema.optional(),\n event_type: z.string(),\n event_properties: eventPropertiesSchema.optional(),\n custom_event_properties: customPropertiesSchema.optional(),\n internal_event_properties: internalEventPropertiesSchema.optional(),\n captured_at: dateSchema,\n }),\n ),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export type ResponseData = boolean;\n }\n\n export namespace bluxUsersUpdateUserProperties {\n export const name = \"bluxUsersUpdateUserProperties\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/update-user-properties`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n properties: z.object({\n phone_number: z.string().nullable().optional(),\n email_address: z.string().nullable().optional(),\n nighttime_notification_consent: z.boolean().nullable().optional(),\n marketing_notification_consent: z.boolean().nullable().optional(),\n\n // TODO: @luna 김캐디 연동 수정 이후 삭제\n sms_consent: z.boolean().nullable().optional(),\n email_consent: z.boolean().nullable().optional(),\n\n marketing_notification_sms_consent: z.boolean().nullable().optional(),\n marketing_notification_email_consent: z.boolean().nullable().optional(),\n marketing_notification_kakao_consent: z.boolean().nullable().optional(),\n marketing_notification_push_consent: z.boolean().nullable().optional(),\n }),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersUpdateCustomUserProperties {\n export const name = \"bluxUsersUpdateCustomUserProperties\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/update-custom-user-properties`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n properties: customPropertiesRequestSchema,\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersGetItemRecommendationsV2 {\n export const name = \"bluxUsersGetItemRecommendationsV2\";\n export const path = `${applicationsRootV2}/blux-users/{blux_user_id}/item-recommendations`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = recommendationRequestSchema;\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = RecResponse;\n }\n\n export namespace crmEventsCreate {\n export const name = \"crmEventsCreate\";\n export const path = `${applicationsRoot}/crm-events`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = z.object({\n notification_id: objectIdSchema,\n crm_event_type: z.union([\n z.literal(\"push_opened\"),\n z.literal(\"button_clicked\"),\n z.literal(\"landing_clicked\"),\n z.literal(\"inapp_opened\"),\n ]),\n captured_at: dateSchema,\n item_id: z.string().optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string(),\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = boolean;\n }\n export namespace inappsDispatcher {\n export const name = \"inappsDispatcher\";\n export const path = `${applicationsRoot}/inapps/dispatch`;\n export const method = HttpMethod.POST;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n blux_user_id: objectIdSchema,\n device_id: objectIdSchema,\n platform: z.union([\n z.literal(DevicePlatform.android),\n z.literal(DevicePlatform.ios),\n z.literal(DevicePlatform.browser),\n ]),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export type ResponseData =\n | ({\n notificationId: string;\n inappId: string;\n htmlString: string;\n baseUrl: string;\n } & { shouldDisplay: true; nextPollDelay: number })\n | {\n shouldDisplay: false;\n nextPollDelay: number;\n };\n }\n\n export namespace notificationsUpdate {\n export const name = \"notificationsUpdate\";\n export const path = `${applicationsRoot}/notifications/{notification_id}`;\n export const method = HttpMethod.POST;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n notification_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n status: z.literal(\"received\"),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n export type ResponseData = boolean;\n }\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { APIs } from "./APIs";
|
|
2
|
+
import type { AxiosInstance } from "axios";
|
|
3
|
+
import API = APIs.notificationsUpdate;
|
|
4
|
+
export declare const notificationsUpdate: (instance: AxiosInstance, pathParams: API.PathParam, body: API.Body, headers: Record<string, string>) => Promise<import("axios").AxiosResponse<boolean, any>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { APIs } from "./APIs";
|
|
2
|
+
import { getPath } from "../utils/getPath";
|
|
3
|
+
var API = APIs.notificationsUpdate;
|
|
4
|
+
export const notificationsUpdate = (instance, pathParams, body, headers) => instance[API.method](getPath(API.path, pathParams), body, {
|
|
5
|
+
headers,
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=notificationsUpdate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationsUpdate.js","sourceRoot":"/","sources":["src/apis/notificationsUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,IAAO,GAAG,GAAG,IAAI,CAAC,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,QAAuB,EACvB,UAAyB,EACzB,IAAc,EACd,OAA+B,EAC/B,EAAE,CACF,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAmB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE;IAC1E,OAAO;CACR,CAAC,CAAC","sourcesContent":["import { APIs } from \"./APIs\";\nimport { getPath } from \"../utils/getPath\";\n\nimport type { AxiosInstance } from \"axios\";\n\nimport API = APIs.notificationsUpdate;\n\nexport const notificationsUpdate = (\n instance: AxiosInstance,\n pathParams: API.PathParam,\n body: API.Body,\n headers: Record<string, string>,\n) =>\n instance[API.method]<API.ResponseData>(getPath(API.path, pathParams), body, {\n headers,\n });\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BluxClient } from "../BluxClient";
|
|
2
|
+
import { EventRequest } from "../events/types";
|
|
3
|
+
export type BridgePlatform = "none" | "react-native" | "flutter";
|
|
4
|
+
export type BridgeAction = "initialize" | "signIn" | "signOut" | "setUserProperties" | "setCustomUserProperties" | "sendEvent";
|
|
5
|
+
declare const _bridgePayloadMap: {
|
|
6
|
+
initialize: {
|
|
7
|
+
bluxApplicationId: string;
|
|
8
|
+
bluxAPIKey: string;
|
|
9
|
+
};
|
|
10
|
+
signIn: Parameters<BluxClient["signIn"]>[0];
|
|
11
|
+
signOut: {};
|
|
12
|
+
setUserProperties: Parameters<BluxClient["setUserProperties"]>[0]["userProperties"];
|
|
13
|
+
setCustomUserProperties: Parameters<BluxClient["setCustomUserProperties"]>[0]["customUserProperties"];
|
|
14
|
+
sendEvent: {
|
|
15
|
+
requests: EventRequest[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type BridgePayloadMap = typeof _bridgePayloadMap;
|
|
19
|
+
export type BridgePayload = BridgePayloadMap[keyof BridgePayloadMap];
|
|
20
|
+
export declare abstract class Bridge {
|
|
21
|
+
abstract readonly platform: BridgePlatform;
|
|
22
|
+
protected abstract postMessage(action: BridgeAction, payload?: BridgePayload): void;
|
|
23
|
+
abstract initialize(payload: BridgePayloadMap["initialize"]): void;
|
|
24
|
+
abstract signIn(payload: BridgePayloadMap["signIn"]): void;
|
|
25
|
+
abstract signOut(): void;
|
|
26
|
+
abstract setUserProperties(payload: BridgePayloadMap["setUserProperties"]): void;
|
|
27
|
+
abstract setCustomUserProperties(payload: BridgePayloadMap["setCustomUserProperties"]): void;
|
|
28
|
+
abstract sendEvent(payload: BridgePayloadMap["sendEvent"]): void;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const _bridgePayloadMap = {
|
|
2
|
+
initialize: { bluxApplicationId: "", bluxAPIKey: "" },
|
|
3
|
+
signIn: {},
|
|
4
|
+
signOut: {},
|
|
5
|
+
setUserProperties: {},
|
|
6
|
+
setCustomUserProperties: {},
|
|
7
|
+
sendEvent: { requests: [] },
|
|
8
|
+
};
|
|
9
|
+
export class Bridge {
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=Bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bridge.js","sourceRoot":"/","sources":["src/bridges/Bridge.ts"],"names":[],"mappings":"AAaA,MAAM,iBAAiB,GAAG;IACxB,UAAU,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IACrD,MAAM,EAAE,EAAyC;IACjD,OAAO,EAAE,EAAE;IACX,iBAAiB,EAAE,EAEG;IACtB,uBAAuB,EAAE,EAEG;IAC5B,SAAS,EAAE,EAAE,QAAQ,EAAE,EAAoB,EAAE;CACN,CAAC;AAM1C,MAAM,OAAgB,MAAM;CAuB3B","sourcesContent":["import { BluxClient } from \"../BluxClient\";\nimport { EventRequest } from \"../events/types\";\n\nexport type BridgePlatform = \"none\" | \"react-native\" | \"flutter\";\n\nexport type BridgeAction =\n | \"initialize\"\n | \"signIn\"\n | \"signOut\"\n | \"setUserProperties\"\n | \"setCustomUserProperties\"\n | \"sendEvent\";\n\nconst _bridgePayloadMap = {\n initialize: { bluxApplicationId: \"\", bluxAPIKey: \"\" },\n signIn: {} as Parameters<BluxClient[\"signIn\"]>[0],\n signOut: {},\n setUserProperties: {} as Parameters<\n BluxClient[\"setUserProperties\"]\n >[0][\"userProperties\"],\n setCustomUserProperties: {} as Parameters<\n BluxClient[\"setCustomUserProperties\"]\n >[0][\"customUserProperties\"],\n sendEvent: { requests: [] as EventRequest[] },\n} satisfies Record<BridgeAction, unknown>;\n\nexport type BridgePayloadMap = typeof _bridgePayloadMap;\n\nexport type BridgePayload = BridgePayloadMap[keyof BridgePayloadMap];\n\nexport abstract class Bridge {\n abstract readonly platform: BridgePlatform;\n\n protected abstract postMessage(\n action: BridgeAction,\n payload?: BridgePayload,\n ): void;\n\n abstract initialize(payload: BridgePayloadMap[\"initialize\"]): void;\n\n abstract signIn(payload: BridgePayloadMap[\"signIn\"]): void;\n\n abstract signOut(): void;\n\n abstract setUserProperties(\n payload: BridgePayloadMap[\"setUserProperties\"],\n ): void;\n\n abstract setCustomUserProperties(\n payload: BridgePayloadMap[\"setCustomUserProperties\"],\n ): void;\n\n abstract sendEvent(payload: BridgePayloadMap[\"sendEvent\"]): void;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Bridge, BridgeAction, BridgePayload, BridgePayloadMap } from "./Bridge";
|
|
2
|
+
export declare class FlutterBridge extends Bridge {
|
|
3
|
+
readonly platform = "flutter";
|
|
4
|
+
protected postMessage(action: BridgeAction, payload?: BridgePayload): void;
|
|
5
|
+
initialize(payload: BridgePayloadMap["initialize"]): void;
|
|
6
|
+
signIn(payload: BridgePayloadMap["signIn"]): void;
|
|
7
|
+
signOut(): void;
|
|
8
|
+
setUserProperties(payload: BridgePayloadMap["setUserProperties"]): void;
|
|
9
|
+
setCustomUserProperties(payload: BridgePayloadMap["setCustomUserProperties"]): void;
|
|
10
|
+
sendEvent(payload: BridgePayloadMap["sendEvent"]): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Bridge, } from "./Bridge";
|
|
2
|
+
import { Logger } from "../utils/Logger";
|
|
3
|
+
export class FlutterBridge extends Bridge {
|
|
4
|
+
platform = "flutter";
|
|
5
|
+
postMessage(action, payload) {
|
|
6
|
+
if (typeof window === "undefined") {
|
|
7
|
+
Logger.error("window is undefined", {
|
|
8
|
+
tags: { from: "FlutterBridge.postMessage" },
|
|
9
|
+
});
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (window.Blux?.postMessage) {
|
|
13
|
+
window.Blux.postMessage(JSON.stringify({ action, payload }));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (window.flutter_inappwebview?.callHandler) {
|
|
17
|
+
window.flutter_inappwebview
|
|
18
|
+
.callHandler("Blux", JSON.stringify({ action, payload }))
|
|
19
|
+
.catch((err) => Logger.error(err, { tags: { from: "FlutterBridge.postMessage" } }));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
Logger.error("No Flutter WebView available", {
|
|
23
|
+
tags: { from: "FlutterBridge.postMessage" },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
initialize(payload) {
|
|
27
|
+
this.postMessage("initialize", payload);
|
|
28
|
+
}
|
|
29
|
+
signIn(payload) {
|
|
30
|
+
this.postMessage("signIn", payload);
|
|
31
|
+
}
|
|
32
|
+
signOut() {
|
|
33
|
+
this.postMessage("signOut");
|
|
34
|
+
}
|
|
35
|
+
setUserProperties(payload) {
|
|
36
|
+
this.postMessage("setUserProperties", payload);
|
|
37
|
+
}
|
|
38
|
+
setCustomUserProperties(payload) {
|
|
39
|
+
this.postMessage("setCustomUserProperties", payload);
|
|
40
|
+
}
|
|
41
|
+
sendEvent(payload) {
|
|
42
|
+
this.postMessage("sendEvent", payload);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=FlutterBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlutterBridge.js","sourceRoot":"/","sources":["src/bridges/FlutterBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,GAIP,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,OAAO,aAAc,SAAQ,MAAM;IAC9B,QAAQ,GAAG,SAAS,CAAC;IAEpB,WAAW,CAAC,MAAoB,EAAE,OAAuB;QACjE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE;gBAClC,IAAI,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;aAC5C,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,C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\";\n\nexport class FlutterBridge extends Bridge {\n readonly platform = \"flutter\";\n\n protected postMessage(action: BridgeAction, payload?: BridgePayload) {\n if (typeof window === \"undefined\") {\n Logger.error(\"window is undefined\", {\n tags: { from: \"FlutterBridge.postMessage\" },\n });\n return;\n }\n\n if (window.Blux?.postMessage) {\n window.Blux.postMessage(JSON.stringify({ action, payload }));\n return;\n }\n\n if (window.flutter_inappwebview?.callHandler) {\n window.flutter_inappwebview\n .callHandler(\"Blux\", JSON.stringify({ action, payload }))\n .catch((err) =>\n Logger.error(err, { tags: { from: \"FlutterBridge.postMessage\" } }),\n );\n return;\n }\n\n Logger.error(\"No Flutter WebView available\", {\n tags: { from: \"FlutterBridge.postMessage\" },\n });\n }\n\n initialize(payload: BridgePayloadMap[\"initialize\"]) {\n this.postMessage(\"initialize\", payload);\n }\n\n signIn(payload: BridgePayloadMap[\"signIn\"]) {\n this.postMessage(\"signIn\", payload);\n }\n\n signOut() {\n this.postMessage(\"signOut\");\n }\n\n setUserProperties(payload: BridgePayloadMap[\"setUserProperties\"]) {\n this.postMessage(\"setUserProperties\", payload);\n }\n\n setCustomUserProperties(\n payload: BridgePayloadMap[\"setCustomUserProperties\"],\n ) {\n this.postMessage(\"setCustomUserProperties\", payload);\n }\n\n sendEvent(payload: BridgePayloadMap[\"sendEvent\"]) {\n this.postMessage(\"sendEvent\", payload);\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Bridge, BridgeAction, BridgePayload, BridgePayloadMap } from "./Bridge";
|
|
2
|
+
export declare class RNBridge extends Bridge {
|
|
3
|
+
readonly platform = "react-native";
|
|
4
|
+
protected postMessage(action: BridgeAction, payload?: BridgePayload): void;
|
|
5
|
+
initialize(payload: BridgePayloadMap["initialize"]): void;
|
|
6
|
+
signIn(payload: BridgePayloadMap["signIn"]): void;
|
|
7
|
+
signOut(): void;
|
|
8
|
+
setUserProperties(payload: BridgePayloadMap["setUserProperties"]): void;
|
|
9
|
+
setCustomUserProperties(payload: BridgePayloadMap["setCustomUserProperties"]): void;
|
|
10
|
+
sendEvent(payload: BridgePayloadMap["sendEvent"]): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Bridge, } from "./Bridge";
|
|
2
|
+
import { Logger } from "../utils/Logger";
|
|
3
|
+
export class RNBridge extends Bridge {
|
|
4
|
+
platform = "react-native";
|
|
5
|
+
postMessage(action, payload) {
|
|
6
|
+
if (typeof window === "undefined") {
|
|
7
|
+
Logger.error("window is undefined", {
|
|
8
|
+
tags: { from: "RNBridge.postMessage" },
|
|
9
|
+
});
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (!window.ReactNativeWebView?.postMessage) {
|
|
13
|
+
Logger.error("No React Native WebView available", {
|
|
14
|
+
tags: { from: "RNBridge.postMessage" },
|
|
15
|
+
});
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({ action, payload }));
|
|
19
|
+
}
|
|
20
|
+
initialize(payload) {
|
|
21
|
+
this.postMessage("initialize", payload);
|
|
22
|
+
}
|
|
23
|
+
signIn(payload) {
|
|
24
|
+
this.postMessage("signIn", payload);
|
|
25
|
+
}
|
|
26
|
+
signOut() {
|
|
27
|
+
this.postMessage("signOut");
|
|
28
|
+
}
|
|
29
|
+
setUserProperties(payload) {
|
|
30
|
+
this.postMessage("setUserProperties", payload);
|
|
31
|
+
}
|
|
32
|
+
setCustomUserProperties(payload) {
|
|
33
|
+
this.postMessage("setCustomUserProperties", payload);
|
|
34
|
+
}
|
|
35
|
+
sendEvent(payload) {
|
|
36
|
+
this.postMessage("sendEvent", payload);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=RNBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RNBridge.js","sourceRoot":"/","sources":["src/bridges/RNBridge.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,G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,OAAO,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["import {} from \"../BluxClient\";\nimport {\n Bridge,\n BridgeAction,\n BridgePayload,\n BridgePayloadMap,\n} from \"./Bridge\";\nimport { Logger } from \"../utils/Logger\";\n\nexport class RNBridge extends Bridge {\n readonly platform = \"react-native\";\n\n protected postMessage(action: BridgeAction, payload?: BridgePayload) {\n if (typeof window === \"undefined\") {\n Logger.error(\"window is undefined\", {\n tags: { from: \"RNBridge.postMessage\" },\n });\n\n return;\n }\n\n if (!window.ReactNativeWebView?.postMessage) {\n Logger.error(\"No React Native WebView available\", {\n tags: { from: \"RNBridge.postMessage\" },\n });\n return;\n }\n\n window.ReactNativeWebView.postMessage(JSON.stringify({ action, payload }));\n }\n\n initialize(payload: BridgePayloadMap[\"initialize\"]) {\n this.postMessage(\"initialize\", payload);\n }\n\n signIn(payload: BridgePayloadMap[\"signIn\"]) {\n this.postMessage(\"signIn\", payload);\n }\n\n signOut() {\n this.postMessage(\"signOut\");\n }\n\n setUserProperties(payload: BridgePayloadMap[\"setUserProperties\"]) {\n this.postMessage(\"setUserProperties\", payload);\n }\n\n setCustomUserProperties(\n payload: BridgePayloadMap[\"setCustomUserProperties\"],\n ) {\n this.postMessage(\"setCustomUserProperties\", payload);\n }\n\n sendEvent(payload: BridgePayloadMap[\"sendEvent\"]) {\n this.postMessage(\"sendEvent\", payload);\n }\n}\n"]}
|
|
@@ -1,33 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
item_id?: string;
|
|
3
|
-
page?: string;
|
|
4
|
-
section?: string;
|
|
5
|
-
price?: number;
|
|
6
|
-
order_id?: string;
|
|
7
|
-
rating?: number;
|
|
8
|
-
position?: number;
|
|
9
|
-
search_query?: string;
|
|
10
|
-
order_amount?: number;
|
|
11
|
-
paid_amount?: number;
|
|
12
|
-
tracking?: {
|
|
13
|
-
id: string;
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
items?: {
|
|
17
|
-
id: string;
|
|
18
|
-
price: number;
|
|
19
|
-
quantity?: number;
|
|
20
|
-
}[];
|
|
21
|
-
};
|
|
1
|
+
import { CustomProperties, EventProperties, InternalEventProperties } from "../utils/zodSchemas";
|
|
22
2
|
export interface EventRequest {
|
|
23
3
|
id: string;
|
|
24
4
|
event_type: string;
|
|
25
5
|
event_properties?: EventProperties;
|
|
26
6
|
custom_event_properties?: Record<string, any>;
|
|
27
|
-
internal_event_properties?:
|
|
28
|
-
url?: string;
|
|
29
|
-
ref?: string;
|
|
30
|
-
};
|
|
7
|
+
internal_event_properties?: InternalEventProperties;
|
|
31
8
|
captured_at: string;
|
|
32
9
|
}
|
|
33
10
|
type BaseEvent = {
|
|
@@ -55,6 +32,7 @@ export interface IAddOrderEvent extends BaseEvent {
|
|
|
55
32
|
id: string;
|
|
56
33
|
price: number;
|
|
57
34
|
quantity?: number;
|
|
35
|
+
custom_event_properties?: CustomProperties;
|
|
58
36
|
}[];
|
|
59
37
|
}
|
|
60
38
|
export interface IAddCustomEvent extends BaseEvent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["src/events/types.ts"],"names":[],"mappings":"AAAA,uDAAuD","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["src/events/types.ts"],"names":[],"mappings":"AAAA,uDAAuD","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport {\n CustomProperties,\n EventProperties,\n InternalEventProperties,\n} from \"../utils/zodSchemas\";\n\nexport interface EventRequest {\n id: string;\n event_type: string;\n event_properties?: EventProperties;\n custom_event_properties?: Record<string, any>;\n internal_event_properties?: InternalEventProperties;\n captured_at: string;\n}\n\ntype BaseEvent = {\n customEventProperties?: Record<string, any>;\n tracking?: EventProperties[\"tracking\"];\n};\n\nexport interface IAddProductDetailViewEvent extends BaseEvent {\n itemId: string;\n}\n\nexport interface IAddLikeEvent extends BaseEvent {\n itemId: string;\n}\n\nexport interface IAddCartaddEvent extends BaseEvent {\n itemId: string;\n}\n\nexport interface IAddRateEvent extends BaseEvent {\n itemId: string;\n rating: number;\n}\nexport interface IAddOrderEvent extends BaseEvent {\n orderId: string;\n paidAmount: number;\n orderAmount: number;\n items: {\n id: string;\n price: number;\n quantity?: number;\n custom_event_properties?: CustomProperties;\n }[];\n}\n\nexport interface IAddCustomEvent extends BaseEvent {\n eventType: string;\n eventProperties?: EventProperties;\n}\n\nexport type IVisitEvent = BaseEvent;\n\nexport type IAddPageVisitEvent = BaseEvent;\n\nexport interface IAddPageViewEvent extends BaseEvent {\n page: string;\n}\n\nexport interface IAddSectionViewEvent extends BaseEvent {\n section: string;\n}\n\nexport interface IAddInstantImpressionEvent extends BaseEvent {\n itemId: string;\n page: string;\n section: string;\n position: number;\n}\n\nexport interface IAddPersistentImpressionEvent extends BaseEvent {\n itemId: string;\n page: string;\n section: string;\n position: number;\n}\n\nexport interface IAddSearchEvent extends BaseEvent {\n searchQuery: string;\n}\n\nexport interface IAddClickEvent extends BaseEvent {\n itemId: string;\n}\n"]}
|