@proofchain/sdk 2.5.0 → 2.5.2

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 CHANGED
@@ -1633,6 +1633,10 @@ declare class EndUsersClient {
1633
1633
  * Merge two users (moves all data from source to target)
1634
1634
  */
1635
1635
  merge(request: MergeUsersRequest): Promise<EndUser>;
1636
+ /**
1637
+ * Update user attributes (convenience method)
1638
+ */
1639
+ updateAttributes(userId: string, attributes: Record<string, any>): Promise<EndUser>;
1636
1640
  /**
1637
1641
  * Export users as CSV
1638
1642
  */
@@ -2559,6 +2563,7 @@ interface FanpassLeaderboardEntry {
2559
2563
  rank: number;
2560
2564
  user_id: string;
2561
2565
  fan_score: number;
2566
+ normalized_score: number;
2562
2567
  raw_score: number;
2563
2568
  percentile: number;
2564
2569
  computed_at?: string;
package/dist/index.d.ts CHANGED
@@ -1633,6 +1633,10 @@ declare class EndUsersClient {
1633
1633
  * Merge two users (moves all data from source to target)
1634
1634
  */
1635
1635
  merge(request: MergeUsersRequest): Promise<EndUser>;
1636
+ /**
1637
+ * Update user attributes (convenience method)
1638
+ */
1639
+ updateAttributes(userId: string, attributes: Record<string, any>): Promise<EndUser>;
1636
1640
  /**
1637
1641
  * Export users as CSV
1638
1642
  */
@@ -2559,6 +2563,7 @@ interface FanpassLeaderboardEntry {
2559
2563
  rank: number;
2560
2564
  user_id: string;
2561
2565
  fan_score: number;
2566
+ normalized_score: number;
2562
2567
  raw_score: number;
2563
2568
  percentile: number;
2564
2569
  computed_at?: string;
package/dist/index.js CHANGED
@@ -1157,7 +1157,7 @@ var EndUsersClient = class {
1157
1157
  * Get an end-user by external ID
1158
1158
  */
1159
1159
  async getByExternalId(externalId) {
1160
- return this.http.get(`/end-users/external/${encodeURIComponent(externalId)}`);
1160
+ return this.http.get(`/end-users/by-external/${encodeURIComponent(externalId)}`);
1161
1161
  }
1162
1162
  /**
1163
1163
  * Create an end-user manually
@@ -1223,6 +1223,12 @@ var EndUsersClient = class {
1223
1223
  async merge(request) {
1224
1224
  return this.http.post("/end-users/merge", request);
1225
1225
  }
1226
+ /**
1227
+ * Update user attributes (convenience method)
1228
+ */
1229
+ async updateAttributes(userId, attributes) {
1230
+ return this.http.patch(`/end-users/${userId}`, { attributes });
1231
+ }
1226
1232
  /**
1227
1233
  * Export users as CSV
1228
1234
  */
@@ -1789,7 +1795,7 @@ var CohortLeaderboardClient = class {
1789
1795
  "/cohorts/definitions",
1790
1796
  params
1791
1797
  );
1792
- return response.cohorts || [];
1798
+ return Array.isArray(response) ? response : response.cohorts || [];
1793
1799
  }
1794
1800
  /**
1795
1801
  * Get a cohort definition by ID
package/dist/index.mjs CHANGED
@@ -1103,7 +1103,7 @@ var EndUsersClient = class {
1103
1103
  * Get an end-user by external ID
1104
1104
  */
1105
1105
  async getByExternalId(externalId) {
1106
- return this.http.get(`/end-users/external/${encodeURIComponent(externalId)}`);
1106
+ return this.http.get(`/end-users/by-external/${encodeURIComponent(externalId)}`);
1107
1107
  }
1108
1108
  /**
1109
1109
  * Create an end-user manually
@@ -1169,6 +1169,12 @@ var EndUsersClient = class {
1169
1169
  async merge(request) {
1170
1170
  return this.http.post("/end-users/merge", request);
1171
1171
  }
1172
+ /**
1173
+ * Update user attributes (convenience method)
1174
+ */
1175
+ async updateAttributes(userId, attributes) {
1176
+ return this.http.patch(`/end-users/${userId}`, { attributes });
1177
+ }
1172
1178
  /**
1173
1179
  * Export users as CSV
1174
1180
  */
@@ -1735,7 +1741,7 @@ var CohortLeaderboardClient = class {
1735
1741
  "/cohorts/definitions",
1736
1742
  params
1737
1743
  );
1738
- return response.cohorts || [];
1744
+ return Array.isArray(response) ? response : response.cohorts || [];
1739
1745
  }
1740
1746
  /**
1741
1747
  * Get a cohort definition by ID
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proofchain/sdk",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Official JavaScript/TypeScript SDK for ProofChain - blockchain-anchored document attestation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",