@proofchain/sdk 2.6.0 → 2.7.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.mts +14 -26
- package/dist/index.d.ts +14 -26
- package/dist/index.js +24 -39
- package/dist/index.mjs +24 -39
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1582,61 +1582,49 @@ declare class EndUsersClient {
|
|
|
1582
1582
|
*/
|
|
1583
1583
|
list(options?: ListEndUsersOptions): Promise<EndUserListResponse>;
|
|
1584
1584
|
/**
|
|
1585
|
-
* Get an end-user by ID
|
|
1585
|
+
* Get an end-user by external ID
|
|
1586
1586
|
*/
|
|
1587
|
-
get(
|
|
1587
|
+
get(externalId: string): Promise<EndUser>;
|
|
1588
1588
|
/**
|
|
1589
|
-
* Get an end-user by
|
|
1589
|
+
* Get an end-user by internal UUID (admin use)
|
|
1590
1590
|
*/
|
|
1591
|
-
|
|
1591
|
+
getByInternalId(userId: string): Promise<EndUser>;
|
|
1592
1592
|
/**
|
|
1593
1593
|
* Create an end-user manually
|
|
1594
1594
|
*/
|
|
1595
1595
|
create(data: CreateEndUserRequest): Promise<EndUser>;
|
|
1596
1596
|
/**
|
|
1597
|
-
* Update an end-user profile
|
|
1597
|
+
* Update an end-user profile by external ID
|
|
1598
1598
|
*/
|
|
1599
|
-
update(
|
|
1599
|
+
update(externalId: string, data: UpdateEndUserRequest): Promise<EndUser>;
|
|
1600
1600
|
/**
|
|
1601
1601
|
* Delete an end-user
|
|
1602
1602
|
*/
|
|
1603
1603
|
delete(userId: string): Promise<void>;
|
|
1604
1604
|
/**
|
|
1605
|
-
* Link a wallet to an end-user
|
|
1606
|
-
*/
|
|
1607
|
-
linkWallet(userId: string, request: LinkWalletRequest): Promise<EndUser>;
|
|
1608
|
-
/**
|
|
1609
|
-
* Unlink wallet from an end-user
|
|
1605
|
+
* Link a wallet to an end-user by external ID
|
|
1610
1606
|
*/
|
|
1611
|
-
|
|
1607
|
+
linkWallet(externalId: string, request: LinkWalletRequest): Promise<EndUser>;
|
|
1612
1608
|
/**
|
|
1613
|
-
* Get user activity/events
|
|
1609
|
+
* Get user activity/events by external ID
|
|
1614
1610
|
*/
|
|
1615
|
-
getActivity(
|
|
1611
|
+
getActivity(externalId: string, options?: {
|
|
1616
1612
|
page?: number;
|
|
1617
1613
|
page_size?: number;
|
|
1618
1614
|
event_type?: string;
|
|
1619
1615
|
}): Promise<UserActivityResponse>;
|
|
1620
1616
|
/**
|
|
1621
|
-
* Add points to a user
|
|
1622
|
-
*/
|
|
1623
|
-
addPoints(userId: string, points: number, reason?: string): Promise<EndUser>;
|
|
1624
|
-
/**
|
|
1625
|
-
* Add a segment to a user
|
|
1626
|
-
*/
|
|
1627
|
-
addSegment(userId: string, segment: string): Promise<EndUser>;
|
|
1628
|
-
/**
|
|
1629
|
-
* Remove a segment from a user
|
|
1617
|
+
* Add points to a user by external ID
|
|
1630
1618
|
*/
|
|
1631
|
-
|
|
1619
|
+
addPoints(externalId: string, points: number, reason?: string): Promise<EndUser>;
|
|
1632
1620
|
/**
|
|
1633
1621
|
* Merge two users (moves all data from source to target)
|
|
1634
1622
|
*/
|
|
1635
1623
|
merge(request: MergeUsersRequest): Promise<EndUser>;
|
|
1636
1624
|
/**
|
|
1637
|
-
* Update user attributes (convenience method)
|
|
1625
|
+
* Update user attributes (convenience method) by external ID
|
|
1638
1626
|
*/
|
|
1639
|
-
updateAttributes(
|
|
1627
|
+
updateAttributes(externalId: string, attributes: Record<string, any>): Promise<EndUser>;
|
|
1640
1628
|
/**
|
|
1641
1629
|
* Export users as CSV
|
|
1642
1630
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1582,61 +1582,49 @@ declare class EndUsersClient {
|
|
|
1582
1582
|
*/
|
|
1583
1583
|
list(options?: ListEndUsersOptions): Promise<EndUserListResponse>;
|
|
1584
1584
|
/**
|
|
1585
|
-
* Get an end-user by ID
|
|
1585
|
+
* Get an end-user by external ID
|
|
1586
1586
|
*/
|
|
1587
|
-
get(
|
|
1587
|
+
get(externalId: string): Promise<EndUser>;
|
|
1588
1588
|
/**
|
|
1589
|
-
* Get an end-user by
|
|
1589
|
+
* Get an end-user by internal UUID (admin use)
|
|
1590
1590
|
*/
|
|
1591
|
-
|
|
1591
|
+
getByInternalId(userId: string): Promise<EndUser>;
|
|
1592
1592
|
/**
|
|
1593
1593
|
* Create an end-user manually
|
|
1594
1594
|
*/
|
|
1595
1595
|
create(data: CreateEndUserRequest): Promise<EndUser>;
|
|
1596
1596
|
/**
|
|
1597
|
-
* Update an end-user profile
|
|
1597
|
+
* Update an end-user profile by external ID
|
|
1598
1598
|
*/
|
|
1599
|
-
update(
|
|
1599
|
+
update(externalId: string, data: UpdateEndUserRequest): Promise<EndUser>;
|
|
1600
1600
|
/**
|
|
1601
1601
|
* Delete an end-user
|
|
1602
1602
|
*/
|
|
1603
1603
|
delete(userId: string): Promise<void>;
|
|
1604
1604
|
/**
|
|
1605
|
-
* Link a wallet to an end-user
|
|
1606
|
-
*/
|
|
1607
|
-
linkWallet(userId: string, request: LinkWalletRequest): Promise<EndUser>;
|
|
1608
|
-
/**
|
|
1609
|
-
* Unlink wallet from an end-user
|
|
1605
|
+
* Link a wallet to an end-user by external ID
|
|
1610
1606
|
*/
|
|
1611
|
-
|
|
1607
|
+
linkWallet(externalId: string, request: LinkWalletRequest): Promise<EndUser>;
|
|
1612
1608
|
/**
|
|
1613
|
-
* Get user activity/events
|
|
1609
|
+
* Get user activity/events by external ID
|
|
1614
1610
|
*/
|
|
1615
|
-
getActivity(
|
|
1611
|
+
getActivity(externalId: string, options?: {
|
|
1616
1612
|
page?: number;
|
|
1617
1613
|
page_size?: number;
|
|
1618
1614
|
event_type?: string;
|
|
1619
1615
|
}): Promise<UserActivityResponse>;
|
|
1620
1616
|
/**
|
|
1621
|
-
* Add points to a user
|
|
1622
|
-
*/
|
|
1623
|
-
addPoints(userId: string, points: number, reason?: string): Promise<EndUser>;
|
|
1624
|
-
/**
|
|
1625
|
-
* Add a segment to a user
|
|
1626
|
-
*/
|
|
1627
|
-
addSegment(userId: string, segment: string): Promise<EndUser>;
|
|
1628
|
-
/**
|
|
1629
|
-
* Remove a segment from a user
|
|
1617
|
+
* Add points to a user by external ID
|
|
1630
1618
|
*/
|
|
1631
|
-
|
|
1619
|
+
addPoints(externalId: string, points: number, reason?: string): Promise<EndUser>;
|
|
1632
1620
|
/**
|
|
1633
1621
|
* Merge two users (moves all data from source to target)
|
|
1634
1622
|
*/
|
|
1635
1623
|
merge(request: MergeUsersRequest): Promise<EndUser>;
|
|
1636
1624
|
/**
|
|
1637
|
-
* Update user attributes (convenience method)
|
|
1625
|
+
* Update user attributes (convenience method) by external ID
|
|
1638
1626
|
*/
|
|
1639
|
-
updateAttributes(
|
|
1627
|
+
updateAttributes(externalId: string, attributes: Record<string, any>): Promise<EndUser>;
|
|
1640
1628
|
/**
|
|
1641
1629
|
* Export users as CSV
|
|
1642
1630
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1148,16 +1148,16 @@ var EndUsersClient = class {
|
|
|
1148
1148
|
return this.http.get(`/end-users?${params.toString()}`);
|
|
1149
1149
|
}
|
|
1150
1150
|
/**
|
|
1151
|
-
* Get an end-user by ID
|
|
1151
|
+
* Get an end-user by external ID
|
|
1152
1152
|
*/
|
|
1153
|
-
async get(
|
|
1154
|
-
return this.http.get(`/end-users/${
|
|
1153
|
+
async get(externalId) {
|
|
1154
|
+
return this.http.get(`/end-users/by-external/${encodeURIComponent(externalId)}`);
|
|
1155
1155
|
}
|
|
1156
1156
|
/**
|
|
1157
|
-
* Get an end-user by
|
|
1157
|
+
* Get an end-user by internal UUID (admin use)
|
|
1158
1158
|
*/
|
|
1159
|
-
async
|
|
1160
|
-
return this.http.get(`/end-users
|
|
1159
|
+
async getByInternalId(userId) {
|
|
1160
|
+
return this.http.get(`/end-users/${userId}`);
|
|
1161
1161
|
}
|
|
1162
1162
|
/**
|
|
1163
1163
|
* Create an end-user manually
|
|
@@ -1166,10 +1166,10 @@ var EndUsersClient = class {
|
|
|
1166
1166
|
return this.http.post("/end-users", data);
|
|
1167
1167
|
}
|
|
1168
1168
|
/**
|
|
1169
|
-
* Update an end-user profile
|
|
1169
|
+
* Update an end-user profile by external ID
|
|
1170
1170
|
*/
|
|
1171
|
-
async update(
|
|
1172
|
-
return this.http.patch(`/end-users/${
|
|
1171
|
+
async update(externalId, data) {
|
|
1172
|
+
return this.http.patch(`/end-users/by-external/${encodeURIComponent(externalId)}`, data);
|
|
1173
1173
|
}
|
|
1174
1174
|
/**
|
|
1175
1175
|
* Delete an end-user
|
|
@@ -1178,44 +1178,29 @@ var EndUsersClient = class {
|
|
|
1178
1178
|
await this.http.delete(`/end-users/${userId}`);
|
|
1179
1179
|
}
|
|
1180
1180
|
/**
|
|
1181
|
-
* Link a wallet to an end-user
|
|
1181
|
+
* Link a wallet to an end-user by external ID
|
|
1182
1182
|
*/
|
|
1183
|
-
async linkWallet(
|
|
1184
|
-
return this.http.post(`/end-users/${
|
|
1183
|
+
async linkWallet(externalId, request) {
|
|
1184
|
+
return this.http.post(`/end-users/by-external/${encodeURIComponent(externalId)}/link-wallet`, request);
|
|
1185
1185
|
}
|
|
1186
1186
|
/**
|
|
1187
|
-
*
|
|
1187
|
+
* Get user activity/events by external ID
|
|
1188
1188
|
*/
|
|
1189
|
-
async
|
|
1190
|
-
return this.http.delete(`/end-users/${userId}/wallet`);
|
|
1191
|
-
}
|
|
1192
|
-
/**
|
|
1193
|
-
* Get user activity/events
|
|
1194
|
-
*/
|
|
1195
|
-
async getActivity(userId, options = {}) {
|
|
1189
|
+
async getActivity(externalId, options = {}) {
|
|
1196
1190
|
const params = new URLSearchParams();
|
|
1197
1191
|
if (options.page) params.append("page", options.page.toString());
|
|
1198
1192
|
if (options.page_size) params.append("page_size", options.page_size.toString());
|
|
1199
1193
|
if (options.event_type) params.append("event_type", options.event_type);
|
|
1200
|
-
return this.http.get(`/end-users/${
|
|
1201
|
-
}
|
|
1202
|
-
/**
|
|
1203
|
-
* Add points to a user
|
|
1204
|
-
*/
|
|
1205
|
-
async addPoints(userId, points, reason) {
|
|
1206
|
-
return this.http.post(`/end-users/${userId}/points`, { points, reason });
|
|
1194
|
+
return this.http.get(`/end-users/by-external/${encodeURIComponent(externalId)}/activity?${params.toString()}`);
|
|
1207
1195
|
}
|
|
1208
1196
|
/**
|
|
1209
|
-
* Add
|
|
1197
|
+
* Add points to a user by external ID
|
|
1210
1198
|
*/
|
|
1211
|
-
async
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
*/
|
|
1217
|
-
async removeSegment(userId, segment) {
|
|
1218
|
-
return this.http.delete(`/end-users/${userId}/segments/${encodeURIComponent(segment)}`);
|
|
1199
|
+
async addPoints(externalId, points, reason) {
|
|
1200
|
+
const params = new URLSearchParams();
|
|
1201
|
+
params.append("points", points.toString());
|
|
1202
|
+
if (reason) params.append("reason", reason);
|
|
1203
|
+
return this.http.post(`/end-users/by-external/${encodeURIComponent(externalId)}/add-points?${params.toString()}`, {});
|
|
1219
1204
|
}
|
|
1220
1205
|
/**
|
|
1221
1206
|
* Merge two users (moves all data from source to target)
|
|
@@ -1224,10 +1209,10 @@ var EndUsersClient = class {
|
|
|
1224
1209
|
return this.http.post("/end-users/merge", request);
|
|
1225
1210
|
}
|
|
1226
1211
|
/**
|
|
1227
|
-
* Update user attributes (convenience method)
|
|
1212
|
+
* Update user attributes (convenience method) by external ID
|
|
1228
1213
|
*/
|
|
1229
|
-
async updateAttributes(
|
|
1230
|
-
return this.http.patch(`/end-users/${
|
|
1214
|
+
async updateAttributes(externalId, attributes) {
|
|
1215
|
+
return this.http.patch(`/end-users/by-external/${encodeURIComponent(externalId)}`, { attributes });
|
|
1231
1216
|
}
|
|
1232
1217
|
/**
|
|
1233
1218
|
* Export users as CSV
|
package/dist/index.mjs
CHANGED
|
@@ -1094,16 +1094,16 @@ var EndUsersClient = class {
|
|
|
1094
1094
|
return this.http.get(`/end-users?${params.toString()}`);
|
|
1095
1095
|
}
|
|
1096
1096
|
/**
|
|
1097
|
-
* Get an end-user by ID
|
|
1097
|
+
* Get an end-user by external ID
|
|
1098
1098
|
*/
|
|
1099
|
-
async get(
|
|
1100
|
-
return this.http.get(`/end-users/${
|
|
1099
|
+
async get(externalId) {
|
|
1100
|
+
return this.http.get(`/end-users/by-external/${encodeURIComponent(externalId)}`);
|
|
1101
1101
|
}
|
|
1102
1102
|
/**
|
|
1103
|
-
* Get an end-user by
|
|
1103
|
+
* Get an end-user by internal UUID (admin use)
|
|
1104
1104
|
*/
|
|
1105
|
-
async
|
|
1106
|
-
return this.http.get(`/end-users
|
|
1105
|
+
async getByInternalId(userId) {
|
|
1106
|
+
return this.http.get(`/end-users/${userId}`);
|
|
1107
1107
|
}
|
|
1108
1108
|
/**
|
|
1109
1109
|
* Create an end-user manually
|
|
@@ -1112,10 +1112,10 @@ var EndUsersClient = class {
|
|
|
1112
1112
|
return this.http.post("/end-users", data);
|
|
1113
1113
|
}
|
|
1114
1114
|
/**
|
|
1115
|
-
* Update an end-user profile
|
|
1115
|
+
* Update an end-user profile by external ID
|
|
1116
1116
|
*/
|
|
1117
|
-
async update(
|
|
1118
|
-
return this.http.patch(`/end-users/${
|
|
1117
|
+
async update(externalId, data) {
|
|
1118
|
+
return this.http.patch(`/end-users/by-external/${encodeURIComponent(externalId)}`, data);
|
|
1119
1119
|
}
|
|
1120
1120
|
/**
|
|
1121
1121
|
* Delete an end-user
|
|
@@ -1124,44 +1124,29 @@ var EndUsersClient = class {
|
|
|
1124
1124
|
await this.http.delete(`/end-users/${userId}`);
|
|
1125
1125
|
}
|
|
1126
1126
|
/**
|
|
1127
|
-
* Link a wallet to an end-user
|
|
1127
|
+
* Link a wallet to an end-user by external ID
|
|
1128
1128
|
*/
|
|
1129
|
-
async linkWallet(
|
|
1130
|
-
return this.http.post(`/end-users/${
|
|
1129
|
+
async linkWallet(externalId, request) {
|
|
1130
|
+
return this.http.post(`/end-users/by-external/${encodeURIComponent(externalId)}/link-wallet`, request);
|
|
1131
1131
|
}
|
|
1132
1132
|
/**
|
|
1133
|
-
*
|
|
1133
|
+
* Get user activity/events by external ID
|
|
1134
1134
|
*/
|
|
1135
|
-
async
|
|
1136
|
-
return this.http.delete(`/end-users/${userId}/wallet`);
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Get user activity/events
|
|
1140
|
-
*/
|
|
1141
|
-
async getActivity(userId, options = {}) {
|
|
1135
|
+
async getActivity(externalId, options = {}) {
|
|
1142
1136
|
const params = new URLSearchParams();
|
|
1143
1137
|
if (options.page) params.append("page", options.page.toString());
|
|
1144
1138
|
if (options.page_size) params.append("page_size", options.page_size.toString());
|
|
1145
1139
|
if (options.event_type) params.append("event_type", options.event_type);
|
|
1146
|
-
return this.http.get(`/end-users/${
|
|
1147
|
-
}
|
|
1148
|
-
/**
|
|
1149
|
-
* Add points to a user
|
|
1150
|
-
*/
|
|
1151
|
-
async addPoints(userId, points, reason) {
|
|
1152
|
-
return this.http.post(`/end-users/${userId}/points`, { points, reason });
|
|
1140
|
+
return this.http.get(`/end-users/by-external/${encodeURIComponent(externalId)}/activity?${params.toString()}`);
|
|
1153
1141
|
}
|
|
1154
1142
|
/**
|
|
1155
|
-
* Add
|
|
1143
|
+
* Add points to a user by external ID
|
|
1156
1144
|
*/
|
|
1157
|
-
async
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
*/
|
|
1163
|
-
async removeSegment(userId, segment) {
|
|
1164
|
-
return this.http.delete(`/end-users/${userId}/segments/${encodeURIComponent(segment)}`);
|
|
1145
|
+
async addPoints(externalId, points, reason) {
|
|
1146
|
+
const params = new URLSearchParams();
|
|
1147
|
+
params.append("points", points.toString());
|
|
1148
|
+
if (reason) params.append("reason", reason);
|
|
1149
|
+
return this.http.post(`/end-users/by-external/${encodeURIComponent(externalId)}/add-points?${params.toString()}`, {});
|
|
1165
1150
|
}
|
|
1166
1151
|
/**
|
|
1167
1152
|
* Merge two users (moves all data from source to target)
|
|
@@ -1170,10 +1155,10 @@ var EndUsersClient = class {
|
|
|
1170
1155
|
return this.http.post("/end-users/merge", request);
|
|
1171
1156
|
}
|
|
1172
1157
|
/**
|
|
1173
|
-
* Update user attributes (convenience method)
|
|
1158
|
+
* Update user attributes (convenience method) by external ID
|
|
1174
1159
|
*/
|
|
1175
|
-
async updateAttributes(
|
|
1176
|
-
return this.http.patch(`/end-users/${
|
|
1160
|
+
async updateAttributes(externalId, attributes) {
|
|
1161
|
+
return this.http.patch(`/end-users/by-external/${encodeURIComponent(externalId)}`, { attributes });
|
|
1177
1162
|
}
|
|
1178
1163
|
/**
|
|
1179
1164
|
* Export users as CSV
|
package/package.json
CHANGED