@leather.io/analytics 1.0.0 → 2.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/dist/index.d.ts +31 -15
- package/dist/index.js +5 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,10 +13,10 @@ interface HistoricalEvents {
|
|
|
13
13
|
};
|
|
14
14
|
broadcast_transaction: {
|
|
15
15
|
symbol: string;
|
|
16
|
-
amount
|
|
17
|
-
fee
|
|
18
|
-
inputs
|
|
19
|
-
outputs
|
|
16
|
+
amount?: number;
|
|
17
|
+
fee?: number;
|
|
18
|
+
inputs?: number;
|
|
19
|
+
outputs?: number;
|
|
20
20
|
};
|
|
21
21
|
broadcast_btc_error: {
|
|
22
22
|
error: any;
|
|
@@ -41,9 +41,7 @@ interface HistoricalEvents {
|
|
|
41
41
|
request_update_profile_submit: undefined;
|
|
42
42
|
request_update_profile_cancel: undefined;
|
|
43
43
|
request_signature_cancel: undefined;
|
|
44
|
-
requesting_origin_tab_closed_with_pending_action:
|
|
45
|
-
status: 'action_pending';
|
|
46
|
-
};
|
|
44
|
+
requesting_origin_tab_closed_with_pending_action: undefined;
|
|
47
45
|
select_add_new_collectible: undefined;
|
|
48
46
|
select_buy_option: {
|
|
49
47
|
provider: string;
|
|
@@ -67,6 +65,8 @@ interface HistoricalEvents {
|
|
|
67
65
|
origin: string;
|
|
68
66
|
};
|
|
69
67
|
user_clicked_feedback_button: undefined;
|
|
68
|
+
unable_to_read_fee_in_stx_validator: undefined;
|
|
69
|
+
unable_to_read_available_balance_in_stx_validator: undefined;
|
|
70
70
|
view_bitcoin_transaction: undefined;
|
|
71
71
|
view_transaction: undefined;
|
|
72
72
|
view_collectibles: {
|
|
@@ -109,12 +109,16 @@ interface HistoricalEvents {
|
|
|
109
109
|
hash: string;
|
|
110
110
|
error: string;
|
|
111
111
|
};
|
|
112
|
+
request_signature_cannot_sign_message_no_account: undefined;
|
|
113
|
+
request_signature_sign: {
|
|
114
|
+
type: 'software' | 'ledger';
|
|
115
|
+
};
|
|
112
116
|
switch_account: {
|
|
113
117
|
index: number;
|
|
114
118
|
hasStxBalance: boolean;
|
|
115
119
|
};
|
|
116
120
|
non_compliant_entity_detected: {
|
|
117
|
-
address: string;
|
|
121
|
+
address: string | string[];
|
|
118
122
|
};
|
|
119
123
|
ledger_transaction_publish_error: {
|
|
120
124
|
error: {
|
|
@@ -125,12 +129,12 @@ interface HistoricalEvents {
|
|
|
125
129
|
native_segwit_tx_hex_to_ledger_tx: {
|
|
126
130
|
success: boolean;
|
|
127
131
|
};
|
|
128
|
-
|
|
129
|
-
status: 'missing_taproot_internal_key';
|
|
130
|
-
};
|
|
132
|
+
psbt_sign_request_p2tr_missing_taproot_internal_key: undefined;
|
|
131
133
|
ledger_nativesegwit_add_nonwitnessutxo: {
|
|
132
134
|
action: 'add_nonwitness_utxo' | 'skip_add_nonwitness_utxo';
|
|
133
135
|
};
|
|
136
|
+
submit_invalid_secret_key: undefined;
|
|
137
|
+
submit_valid_secret_key: undefined;
|
|
134
138
|
increase_fee_transaction: {
|
|
135
139
|
symbol: string;
|
|
136
140
|
txid: string;
|
|
@@ -149,6 +153,15 @@ interface HistoricalEvents {
|
|
|
149
153
|
ledger_message_signed_approved: undefined;
|
|
150
154
|
ledger_message_signed_rejected: undefined;
|
|
151
155
|
ledger_public_keys_pulled_from_device: undefined;
|
|
156
|
+
user_clicked_requested_by_link: {
|
|
157
|
+
endpoint: string;
|
|
158
|
+
};
|
|
159
|
+
user_approved_get_addresses: {
|
|
160
|
+
origin: string;
|
|
161
|
+
};
|
|
162
|
+
user_approved_message_signing: {
|
|
163
|
+
origin: string;
|
|
164
|
+
};
|
|
152
165
|
}
|
|
153
166
|
type EventName = keyof Events;
|
|
154
167
|
|
|
@@ -159,7 +172,8 @@ interface AnalyticsClientInterface {
|
|
|
159
172
|
screen: (name: string, ...args: any[]) => Promise<any>;
|
|
160
173
|
track: (event: string, ...args: any[]) => Promise<any>;
|
|
161
174
|
group: (groupId: string, traits?: any, ...args: any[]) => Promise<any>;
|
|
162
|
-
identify: (
|
|
175
|
+
identify: (...args: any[]) => Promise<any>;
|
|
176
|
+
page?: (name: string, ...args: any[]) => Promise<any>;
|
|
163
177
|
}
|
|
164
178
|
interface AnalyticsClientConfig<T extends AnalyticsClientInterface> {
|
|
165
179
|
client: T;
|
|
@@ -181,9 +195,11 @@ declare function configureAnalyticsClient<T extends AnalyticsClientInterface>({
|
|
|
181
195
|
}): {
|
|
182
196
|
track<K extends keyof Events>(event: K, ...properties: undefined extends Events[K] ? [] : [param: Events[K]]): Promise<any>;
|
|
183
197
|
untypedTrack(event: string, properties?: JsonMap): Promise<any>;
|
|
184
|
-
screen(name: string,
|
|
185
|
-
group(groupId: string, traits?:
|
|
186
|
-
identify(
|
|
198
|
+
screen: (name: string, ...args: any[]) => Promise<any>;
|
|
199
|
+
group: (groupId: string, traits?: any, ...args: any[]) => Promise<any>;
|
|
200
|
+
identify: (...args: any[]) => Promise<any>;
|
|
201
|
+
page: (name: string, ...args: any[]) => Promise<any>;
|
|
202
|
+
client: T;
|
|
187
203
|
};
|
|
188
204
|
|
|
189
205
|
export { type AnalyticsClientConfig, type AnalyticsClientInterface, type DefaultProperties, type EventName, type Events, type JsonList, type JsonMap, type JsonValue, type OptionalIfUndefined, configureAnalyticsClient };
|
package/dist/index.js
CHANGED
|
@@ -10,15 +10,11 @@ function AnalyticsClient(analyticsClient, options) {
|
|
|
10
10
|
}
|
|
11
11
|
return analyticsClient.track(event, { ...properties, ...options.defaultProperties });
|
|
12
12
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
async identify(userId, traits) {
|
|
20
|
-
return analyticsClient.identify(userId, { ...traits, ...options.defaultTraits });
|
|
21
|
-
}
|
|
13
|
+
screen: analyticsClient.screen,
|
|
14
|
+
group: analyticsClient.group,
|
|
15
|
+
identify: analyticsClient.identify,
|
|
16
|
+
page: analyticsClient.page ? analyticsClient.page : () => Promise.resolve(),
|
|
17
|
+
client: analyticsClient
|
|
22
18
|
};
|
|
23
19
|
}
|
|
24
20
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts","../src/index.ts"],"sourcesContent":["import { AnalyticsClientConfig, AnalyticsClientInterface, Events, JsonMap } from './types';\n\nexport function AnalyticsClient<T extends AnalyticsClientInterface>(\n analyticsClient: T,\n options: Pick<AnalyticsClientConfig<T>, 'defaultProperties' | 'defaultTraits'>\n) {\n return {\n async track<K extends keyof Events>(\n event: K,\n ...properties: undefined extends Events[K] ? [] : [param: Events[K]]\n ) {\n return analyticsClient.track(event, { ...properties, ...options.defaultProperties });\n },\n async untypedTrack(event: string, properties?: JsonMap) {\n if (event.match(/^[a-zA-Z0-9\\s][a-zA-Z0-9\\s]*$/)) {\n throw new Error('Event must be snake_case');\n }\n return analyticsClient.track(event as any, { ...properties, ...options.defaultProperties });\n },\n
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/index.ts"],"sourcesContent":["import { AnalyticsClientConfig, AnalyticsClientInterface, Events, JsonMap } from './types';\n\nexport function AnalyticsClient<T extends AnalyticsClientInterface>(\n analyticsClient: T,\n options: Pick<AnalyticsClientConfig<T>, 'defaultProperties' | 'defaultTraits'>\n) {\n return {\n async track<K extends keyof Events>(\n event: K,\n ...properties: undefined extends Events[K] ? [] : [param: Events[K]]\n ) {\n return analyticsClient.track(event, { ...properties, ...options.defaultProperties });\n },\n async untypedTrack(event: string, properties?: JsonMap) {\n if (event.match(/^[a-zA-Z0-9\\s][a-zA-Z0-9\\s]*$/)) {\n throw new Error('Event must be snake_case');\n }\n return analyticsClient.track(event as any, { ...properties, ...options.defaultProperties });\n },\n screen: analyticsClient.screen,\n group: analyticsClient.group,\n identify: analyticsClient.identify,\n page: analyticsClient.page ? analyticsClient.page : () => Promise.resolve(),\n client: analyticsClient,\n };\n}\n","import { AnalyticsClient } from './client';\nimport { AnalyticsClientInterface, DefaultProperties, JsonMap } from './types';\n\nexport * from './types';\n\nexport function configureAnalyticsClient<T extends AnalyticsClientInterface>({\n client,\n defaultProperties,\n defaultTraits,\n}: {\n client: T;\n defaultProperties: DefaultProperties;\n defaultTraits?: JsonMap;\n}) {\n return AnalyticsClient<T>(client, { defaultProperties, defaultTraits });\n}\n"],"mappings":";AAEO,SAAS,gBACd,iBACA,SACA;AACA,SAAO;AAAA,IACL,MAAM,MACJ,UACG,YACH;AACA,aAAO,gBAAgB,MAAM,OAAO,EAAE,GAAG,YAAY,GAAG,QAAQ,kBAAkB,CAAC;AAAA,IACrF;AAAA,IACA,MAAM,aAAa,OAAe,YAAsB;AACtD,UAAI,MAAM,MAAM,+BAA+B,GAAG;AAChD,cAAM,IAAI,MAAM,0BAA0B;AAAA,MAC5C;AACA,aAAO,gBAAgB,MAAM,OAAc,EAAE,GAAG,YAAY,GAAG,QAAQ,kBAAkB,CAAC;AAAA,IAC5F;AAAA,IACA,QAAQ,gBAAgB;AAAA,IACxB,OAAO,gBAAgB;AAAA,IACvB,UAAU,gBAAgB;AAAA,IAC1B,MAAM,gBAAgB,OAAO,gBAAgB,OAAO,MAAM,QAAQ,QAAQ;AAAA,IAC1E,QAAQ;AAAA,EACV;AACF;;;ACpBO,SAAS,yBAA6D;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SAAO,gBAAmB,QAAQ,EAAE,mBAAmB,cAAc,CAAC;AACxE;","names":[]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@leather.io/analytics",
|
|
3
3
|
"author": "Leather.io contact@leather.io",
|
|
4
4
|
"description": "Analytics package for Leather using Segment",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2.0.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/leather.io/mono/tree/dev/packages/analytics",
|
|
8
8
|
"repository": {
|