@artisan-commerce/analytics-rn 0.3.0-canary.92 → 0.3.0-canary.94
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/bundle.cjs.js +354 -187
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.d.ts +21 -76
- package/dist/bundle.esm.js +355 -186
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +7 -3
package/dist/bundle.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Account, Vendor, Store, Catalogue, ArtisnPlatform, CurrencyCodes, Product, ShoppingCart, CartProduct, PriceCategoryType, ShippingAddress, BillingData, Order, Category } from '@artisan-commerce/types';
|
|
2
|
+
import { SegmentClient, UserTraits } from '@segment/analytics-react-native';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Analytics providers configurable options.
|
|
@@ -198,6 +199,7 @@ declare namespace Gtag {
|
|
|
198
199
|
*/
|
|
199
200
|
interface SegmentProvider extends Omit<AnalyticsProviderConstructor, "type">, SegmentProviderConfig {
|
|
200
201
|
writeKey: string;
|
|
202
|
+
segmentClient?: SegmentClient;
|
|
201
203
|
}
|
|
202
204
|
/**
|
|
203
205
|
* Segment Provider after instantiated configurable options.
|
|
@@ -206,6 +208,7 @@ interface SegmentProvider extends Omit<AnalyticsProviderConstructor, "type">, Se
|
|
|
206
208
|
* @since 0.1.0
|
|
207
209
|
*/
|
|
208
210
|
interface SegmentProviderConfig {
|
|
211
|
+
/** Currency country codes, see {@link CurrencyCodes} */
|
|
209
212
|
currency?: CurrencyCodes;
|
|
210
213
|
}
|
|
211
214
|
/**
|
|
@@ -226,58 +229,6 @@ interface SegmentCommonEventParams extends EventCommonParams {
|
|
|
226
229
|
interface SegmentCustomEventParams {
|
|
227
230
|
[key: string]: any;
|
|
228
231
|
}
|
|
229
|
-
declare namespace Segment$1 {
|
|
230
|
-
interface Product {
|
|
231
|
-
product_id: string;
|
|
232
|
-
sku?: string;
|
|
233
|
-
category?: string;
|
|
234
|
-
name?: string;
|
|
235
|
-
brand?: string;
|
|
236
|
-
variant?: string;
|
|
237
|
-
price?: number;
|
|
238
|
-
quantity?: number;
|
|
239
|
-
coupon?: string;
|
|
240
|
-
position?: number;
|
|
241
|
-
url?: string;
|
|
242
|
-
image_url?: string;
|
|
243
|
-
}
|
|
244
|
-
interface Address {
|
|
245
|
-
city?: string;
|
|
246
|
-
country?: string;
|
|
247
|
-
postalCode?: string;
|
|
248
|
-
state?: string;
|
|
249
|
-
street?: string;
|
|
250
|
-
[key: string]: any;
|
|
251
|
-
}
|
|
252
|
-
interface Company {
|
|
253
|
-
name?: string;
|
|
254
|
-
id?: string | number;
|
|
255
|
-
industry?: string;
|
|
256
|
-
employee_count?: number;
|
|
257
|
-
plan?: string;
|
|
258
|
-
[key: string]: any;
|
|
259
|
-
}
|
|
260
|
-
interface Traits {
|
|
261
|
-
id: string;
|
|
262
|
-
address?: Address;
|
|
263
|
-
age?: number;
|
|
264
|
-
avatar?: string;
|
|
265
|
-
bithday?: string;
|
|
266
|
-
company?: Company;
|
|
267
|
-
createdAt?: string;
|
|
268
|
-
description?: string;
|
|
269
|
-
email?: string;
|
|
270
|
-
firstName?: string;
|
|
271
|
-
gender?: string;
|
|
272
|
-
lastName?: string;
|
|
273
|
-
name?: string;
|
|
274
|
-
phone?: string;
|
|
275
|
-
title?: string;
|
|
276
|
-
username?: string;
|
|
277
|
-
website?: string;
|
|
278
|
-
[key: string]: any;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
232
|
|
|
282
233
|
/**
|
|
283
234
|
* Shared params across every event.
|
|
@@ -406,8 +357,9 @@ declare class GoogleAnalytics extends AnalyticsProvider {
|
|
|
406
357
|
declare class Segment extends AnalyticsProvider {
|
|
407
358
|
private _writeKey;
|
|
408
359
|
private _currency;
|
|
360
|
+
private _segmentClient?;
|
|
409
361
|
/**
|
|
410
|
-
*
|
|
362
|
+
* Constructs a Segment Provider
|
|
411
363
|
*
|
|
412
364
|
* @constructs
|
|
413
365
|
* @since 0.1.0
|
|
@@ -419,6 +371,7 @@ declare class Segment extends AnalyticsProvider {
|
|
|
419
371
|
* @since 0.1.0
|
|
420
372
|
*/
|
|
421
373
|
init(): Promise<void>;
|
|
374
|
+
get segmentClient(): SegmentClient | undefined;
|
|
422
375
|
/**
|
|
423
376
|
* @override
|
|
424
377
|
* @since 0.1.0
|
|
@@ -753,10 +706,10 @@ interface UpdateUserInfoParams$2 extends FacebookPixelCommonEventParams, Faceboo
|
|
|
753
706
|
* @extends SegmentCommonEventParams
|
|
754
707
|
* @extends SegmentCustomEventParams
|
|
755
708
|
* @extends UpdateUserInfoCommonParams
|
|
756
|
-
* @property {
|
|
709
|
+
* @property {UserTraits} identify Pieces of information you know about a user that are included in an identify call
|
|
757
710
|
*/
|
|
758
711
|
interface UpdateUserInfoParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, UpdateUserInfoCommonParams {
|
|
759
|
-
identify?:
|
|
712
|
+
identify?: UserTraits;
|
|
760
713
|
}
|
|
761
714
|
|
|
762
715
|
/**
|
|
@@ -811,10 +764,10 @@ interface SetUserInfoParams$2 extends FacebookPixelCommonEventParams, FacebookPi
|
|
|
811
764
|
* @extends SegmentCommonEventParams
|
|
812
765
|
* @extends SegmentCustomEventParams
|
|
813
766
|
* @extends SetUserInfoCommonParams
|
|
814
|
-
* @property {
|
|
767
|
+
* @property {UserTraits} identify Pieces of information you know about a user that are included in an identify call
|
|
815
768
|
*/
|
|
816
769
|
interface SetUserInfoParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, SetUserInfoCommonParams {
|
|
817
|
-
identify?:
|
|
770
|
+
identify?: UserTraits;
|
|
818
771
|
}
|
|
819
772
|
|
|
820
773
|
/**
|
|
@@ -1529,10 +1482,10 @@ interface UpdateShippingAddressParams$2 extends FacebookPixelCommonEventParams,
|
|
|
1529
1482
|
* @extends SegmentCommonEventParams
|
|
1530
1483
|
* @extends SegmentCustomEventParams
|
|
1531
1484
|
* @extends UpdateShippingAddressCommonParams
|
|
1532
|
-
* @property {
|
|
1485
|
+
* @property {UserTraits} identify Pieces of information you know about a user that are included in an identify call
|
|
1533
1486
|
*/
|
|
1534
1487
|
interface UpdateShippingAddressParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, UpdateShippingAddressCommonParams {
|
|
1535
|
-
identify?:
|
|
1488
|
+
identify?: UserTraits;
|
|
1536
1489
|
}
|
|
1537
1490
|
|
|
1538
1491
|
/**
|
|
@@ -1589,10 +1542,10 @@ interface SelectShippingAddressParams$2 extends FacebookPixelCommonEventParams,
|
|
|
1589
1542
|
* @extends SegmentCommonEventParams
|
|
1590
1543
|
* @extends SegmentCustomEventParams
|
|
1591
1544
|
* @extends SelectShippingAddressCommonParams
|
|
1592
|
-
* @property {
|
|
1545
|
+
* @property {UserTraits} identify Pieces of information you know about a user that are included in an identify call
|
|
1593
1546
|
*/
|
|
1594
1547
|
interface SelectShippingAddressParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, SelectShippingAddressCommonParams {
|
|
1595
|
-
identify?:
|
|
1548
|
+
identify?: UserTraits;
|
|
1596
1549
|
}
|
|
1597
1550
|
|
|
1598
1551
|
/**
|
|
@@ -1655,10 +1608,10 @@ interface AddShippingAddressParams$2 extends FacebookPixelCommonEventParams, Fac
|
|
|
1655
1608
|
* @extends SegmentCommonEventParams
|
|
1656
1609
|
* @extends SegmentCustomEventParams
|
|
1657
1610
|
* @extends AddShippingAddressCommonParams
|
|
1658
|
-
* @property {
|
|
1611
|
+
* @property {UserTraits} identify Pieces of information you know about a user that are included in an identify call
|
|
1659
1612
|
*/
|
|
1660
1613
|
interface AddShippingAddressParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, AddShippingAddressCommonParams {
|
|
1661
|
-
identify?:
|
|
1614
|
+
identify?: UserTraits;
|
|
1662
1615
|
}
|
|
1663
1616
|
|
|
1664
1617
|
/**
|
|
@@ -4951,12 +4904,12 @@ interface SignUpParams$2 extends FacebookPixelCommonEventParams, FacebookPixelCu
|
|
|
4951
4904
|
* @extends SignUpCommonParams
|
|
4952
4905
|
* @property {string} name The user's name
|
|
4953
4906
|
* @property {string} email The user's email
|
|
4954
|
-
* @property {
|
|
4907
|
+
* @property {UserTraits} identify Pieces of information you know about a user that are included in an identify call
|
|
4955
4908
|
*/
|
|
4956
4909
|
interface SignUpParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, SignUpCommonParams {
|
|
4957
4910
|
name: string;
|
|
4958
4911
|
email: string;
|
|
4959
|
-
identify?:
|
|
4912
|
+
identify?: UserTraits;
|
|
4960
4913
|
}
|
|
4961
4914
|
|
|
4962
4915
|
/**
|
|
@@ -5066,11 +5019,11 @@ interface SignInParams$2 extends FacebookPixelCommonEventParams, FacebookPixelCu
|
|
|
5066
5019
|
* @extends SegmentCustomEventParams
|
|
5067
5020
|
* @extends SignInCommonParams
|
|
5068
5021
|
* @property {string} name The user's name
|
|
5069
|
-
* @property {
|
|
5022
|
+
* @property {UserTraits} identify Pieces of information you know about a user that are included in an identify call
|
|
5070
5023
|
*/
|
|
5071
5024
|
interface SignInParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, SignInCommonParams {
|
|
5072
5025
|
name: string;
|
|
5073
|
-
identify?:
|
|
5026
|
+
identify?: UserTraits;
|
|
5074
5027
|
}
|
|
5075
5028
|
|
|
5076
5029
|
/**
|
|
@@ -5456,12 +5409,4 @@ declare const events: {
|
|
|
5456
5409
|
*/
|
|
5457
5410
|
declare const updateActiveVendor: (vendor: Vendor | Vendor["id"] | -1 | undefined) => void;
|
|
5458
5411
|
|
|
5459
|
-
|
|
5460
|
-
* Utility function to identify a user across Segment destinations.
|
|
5461
|
-
*
|
|
5462
|
-
* @since 0.1.0
|
|
5463
|
-
* @param {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
|
|
5464
|
-
*/
|
|
5465
|
-
declare const identifyUser: (identify: Segment$1.Traits) => void;
|
|
5466
|
-
|
|
5467
|
-
export { AnalyticsMeta, AuthProviderMethods, FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, FacebookPixelProvider, FacebookPixelProviderConfig, GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams, GoogleAnalyticsProvider, GoogleAnalyticsProviderConfig, Gtag, InitAnalyticsConfig, InitAnalyticsConfigMeta, Providers, SupportedProviders, events, identifyUser, initAnalytics, updateActiveVendor };
|
|
5412
|
+
export { AnalyticsMeta, AuthProviderMethods, FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, FacebookPixelProvider, FacebookPixelProviderConfig, GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams, GoogleAnalyticsProvider, GoogleAnalyticsProviderConfig, Gtag, InitAnalyticsConfig, InitAnalyticsConfigMeta, Providers, SupportedProviders, events, initAnalytics, updateActiveVendor };
|