@proofchain/sdk 2.5.1 → 2.6.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 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
  */
@@ -2482,6 +2486,8 @@ interface CohortLeaderboardResponse {
2482
2486
  total_users: number;
2483
2487
  group_stats: CohortGroupStats;
2484
2488
  leaderboard: CohortLeaderboardEntry[];
2489
+ current_user: CohortLeaderboardEntry | null;
2490
+ current_user_in_leaderboard: boolean;
2485
2491
  }
2486
2492
  interface CohortDefinition {
2487
2493
  id: string;
@@ -2519,6 +2525,7 @@ interface CohortLeaderboardOptions {
2519
2525
  limit?: number;
2520
2526
  top_n?: number;
2521
2527
  fresh?: boolean;
2528
+ userId?: string;
2522
2529
  }
2523
2530
  interface ListCohortsOptions {
2524
2531
  status?: 'active' | 'inactive' | 'draft';
@@ -2559,6 +2566,7 @@ interface FanpassLeaderboardEntry {
2559
2566
  rank: number;
2560
2567
  user_id: string;
2561
2568
  fan_score: number;
2569
+ normalized_score: number;
2562
2570
  raw_score: number;
2563
2571
  percentile: number;
2564
2572
  computed_at?: string;
@@ -2576,6 +2584,8 @@ interface FanpassLeaderboardResponse {
2576
2584
  total_users: number;
2577
2585
  group_stats: FanpassGroupStats;
2578
2586
  leaderboard: FanpassLeaderboardEntry[];
2587
+ current_user: FanpassLeaderboardEntry | null;
2588
+ current_user_in_leaderboard: boolean;
2579
2589
  }
2580
2590
  interface FanpassUserComparisonResponse {
2581
2591
  user_id: string;
@@ -2589,6 +2599,7 @@ interface FanpassLeaderboardOptions {
2589
2599
  limit?: number;
2590
2600
  top_n?: number;
2591
2601
  fresh?: boolean;
2602
+ userId?: string;
2592
2603
  }
2593
2604
  declare class FanpassLeaderboardClient {
2594
2605
  private http;
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
  */
@@ -2482,6 +2486,8 @@ interface CohortLeaderboardResponse {
2482
2486
  total_users: number;
2483
2487
  group_stats: CohortGroupStats;
2484
2488
  leaderboard: CohortLeaderboardEntry[];
2489
+ current_user: CohortLeaderboardEntry | null;
2490
+ current_user_in_leaderboard: boolean;
2485
2491
  }
2486
2492
  interface CohortDefinition {
2487
2493
  id: string;
@@ -2519,6 +2525,7 @@ interface CohortLeaderboardOptions {
2519
2525
  limit?: number;
2520
2526
  top_n?: number;
2521
2527
  fresh?: boolean;
2528
+ userId?: string;
2522
2529
  }
2523
2530
  interface ListCohortsOptions {
2524
2531
  status?: 'active' | 'inactive' | 'draft';
@@ -2559,6 +2566,7 @@ interface FanpassLeaderboardEntry {
2559
2566
  rank: number;
2560
2567
  user_id: string;
2561
2568
  fan_score: number;
2569
+ normalized_score: number;
2562
2570
  raw_score: number;
2563
2571
  percentile: number;
2564
2572
  computed_at?: string;
@@ -2576,6 +2584,8 @@ interface FanpassLeaderboardResponse {
2576
2584
  total_users: number;
2577
2585
  group_stats: FanpassGroupStats;
2578
2586
  leaderboard: FanpassLeaderboardEntry[];
2587
+ current_user: FanpassLeaderboardEntry | null;
2588
+ current_user_in_leaderboard: boolean;
2579
2589
  }
2580
2590
  interface FanpassUserComparisonResponse {
2581
2591
  user_id: string;
@@ -2589,6 +2599,7 @@ interface FanpassLeaderboardOptions {
2589
2599
  limit?: number;
2590
2600
  top_n?: number;
2591
2601
  fresh?: boolean;
2602
+ userId?: string;
2592
2603
  }
2593
2604
  declare class FanpassLeaderboardClient {
2594
2605
  private http;
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
  */
@@ -1809,6 +1815,7 @@ var CohortLeaderboardClient = class {
1809
1815
  if (options.limit) params.limit = options.limit;
1810
1816
  if (options.top_n) params.top_n = options.top_n;
1811
1817
  if (options.fresh) params.fresh = "true";
1818
+ if (options.userId) params.user_id = options.userId;
1812
1819
  return this.http.get(
1813
1820
  `/cohorts/definitions/${encodeURIComponent(cohortId)}/leaderboard`,
1814
1821
  params
@@ -1846,6 +1853,7 @@ var FanpassLeaderboardClient = class {
1846
1853
  if (options.limit) params.limit = options.limit;
1847
1854
  if (options.top_n) params.top_n = options.top_n;
1848
1855
  if (options.fresh) params.fresh = "true";
1856
+ if (options.userId) params.user_id = options.userId;
1849
1857
  return this.http.get(
1850
1858
  "/passport-v2/fanpass/leaderboard",
1851
1859
  params
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
  */
@@ -1755,6 +1761,7 @@ var CohortLeaderboardClient = class {
1755
1761
  if (options.limit) params.limit = options.limit;
1756
1762
  if (options.top_n) params.top_n = options.top_n;
1757
1763
  if (options.fresh) params.fresh = "true";
1764
+ if (options.userId) params.user_id = options.userId;
1758
1765
  return this.http.get(
1759
1766
  `/cohorts/definitions/${encodeURIComponent(cohortId)}/leaderboard`,
1760
1767
  params
@@ -1792,6 +1799,7 @@ var FanpassLeaderboardClient = class {
1792
1799
  if (options.limit) params.limit = options.limit;
1793
1800
  if (options.top_n) params.top_n = options.top_n;
1794
1801
  if (options.fresh) params.fresh = "true";
1802
+ if (options.userId) params.user_id = options.userId;
1795
1803
  return this.http.get(
1796
1804
  "/passport-v2/fanpass/leaderboard",
1797
1805
  params
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proofchain/sdk",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
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",