@proofchain/sdk 2.3.1 → 2.4.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 +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +8 -6
- package/dist/index.mjs +8 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1816,6 +1816,7 @@ interface Quest {
|
|
|
1816
1816
|
category?: string;
|
|
1817
1817
|
difficulty?: string;
|
|
1818
1818
|
estimated_time?: string;
|
|
1819
|
+
quest_type?: 'epic' | 'quick_hit' | 'challenge';
|
|
1819
1820
|
is_ordered: boolean;
|
|
1820
1821
|
is_repeatable: boolean;
|
|
1821
1822
|
repeat_cooldown_hours?: number;
|
|
@@ -1896,8 +1897,9 @@ interface StepCompletionResult {
|
|
|
1896
1897
|
target_count: number;
|
|
1897
1898
|
points_earned: number;
|
|
1898
1899
|
}
|
|
1899
|
-
interface QuestWithProgress
|
|
1900
|
-
|
|
1900
|
+
interface QuestWithProgress {
|
|
1901
|
+
quest: Quest;
|
|
1902
|
+
progress?: UserQuestProgress;
|
|
1901
1903
|
}
|
|
1902
1904
|
interface CreateQuestRequest {
|
|
1903
1905
|
name: string;
|
|
@@ -1999,10 +2001,12 @@ declare class QuestsClient {
|
|
|
1999
2001
|
archive(questId: string): Promise<Quest>;
|
|
2000
2002
|
/**
|
|
2001
2003
|
* Get quest with user progress
|
|
2004
|
+
* Fetches the quest and user's progress separately and combines them
|
|
2002
2005
|
*/
|
|
2003
2006
|
getWithProgress(questId: string, userId: string): Promise<QuestWithProgress>;
|
|
2004
2007
|
/**
|
|
2005
2008
|
* List quests with progress for a user
|
|
2009
|
+
* @deprecated Use listAvailable() instead - this is an alias
|
|
2006
2010
|
*/
|
|
2007
2011
|
listWithProgress(userId: string, options?: ListQuestsOptions): Promise<QuestWithProgress[]>;
|
|
2008
2012
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1816,6 +1816,7 @@ interface Quest {
|
|
|
1816
1816
|
category?: string;
|
|
1817
1817
|
difficulty?: string;
|
|
1818
1818
|
estimated_time?: string;
|
|
1819
|
+
quest_type?: 'epic' | 'quick_hit' | 'challenge';
|
|
1819
1820
|
is_ordered: boolean;
|
|
1820
1821
|
is_repeatable: boolean;
|
|
1821
1822
|
repeat_cooldown_hours?: number;
|
|
@@ -1896,8 +1897,9 @@ interface StepCompletionResult {
|
|
|
1896
1897
|
target_count: number;
|
|
1897
1898
|
points_earned: number;
|
|
1898
1899
|
}
|
|
1899
|
-
interface QuestWithProgress
|
|
1900
|
-
|
|
1900
|
+
interface QuestWithProgress {
|
|
1901
|
+
quest: Quest;
|
|
1902
|
+
progress?: UserQuestProgress;
|
|
1901
1903
|
}
|
|
1902
1904
|
interface CreateQuestRequest {
|
|
1903
1905
|
name: string;
|
|
@@ -1999,10 +2001,12 @@ declare class QuestsClient {
|
|
|
1999
2001
|
archive(questId: string): Promise<Quest>;
|
|
2000
2002
|
/**
|
|
2001
2003
|
* Get quest with user progress
|
|
2004
|
+
* Fetches the quest and user's progress separately and combines them
|
|
2002
2005
|
*/
|
|
2003
2006
|
getWithProgress(questId: string, userId: string): Promise<QuestWithProgress>;
|
|
2004
2007
|
/**
|
|
2005
2008
|
* List quests with progress for a user
|
|
2009
|
+
* @deprecated Use listAvailable() instead - this is an alias
|
|
2006
2010
|
*/
|
|
2007
2011
|
listWithProgress(userId: string, options?: ListQuestsOptions): Promise<QuestWithProgress[]>;
|
|
2008
2012
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1437,19 +1437,21 @@ var QuestsClient = class {
|
|
|
1437
1437
|
// ---------------------------------------------------------------------------
|
|
1438
1438
|
/**
|
|
1439
1439
|
* Get quest with user progress
|
|
1440
|
+
* Fetches the quest and user's progress separately and combines them
|
|
1440
1441
|
*/
|
|
1441
1442
|
async getWithProgress(questId, userId) {
|
|
1442
|
-
|
|
1443
|
+
const [quest, progress] = await Promise.all([
|
|
1444
|
+
this.get(questId),
|
|
1445
|
+
this.getUserProgress(questId, userId).catch(() => void 0)
|
|
1446
|
+
]);
|
|
1447
|
+
return { quest, progress };
|
|
1443
1448
|
}
|
|
1444
1449
|
/**
|
|
1445
1450
|
* List quests with progress for a user
|
|
1451
|
+
* @deprecated Use listAvailable() instead - this is an alias
|
|
1446
1452
|
*/
|
|
1447
1453
|
async listWithProgress(userId, options = {}) {
|
|
1448
|
-
|
|
1449
|
-
params.append("user_id", userId);
|
|
1450
|
-
if (options.status) params.append("status", options.status);
|
|
1451
|
-
if (options.category) params.append("category", options.category);
|
|
1452
|
-
return this.http.get(`/quests/with-progress?${params.toString()}`);
|
|
1454
|
+
return this.listAvailable(userId, { category: options.category });
|
|
1453
1455
|
}
|
|
1454
1456
|
/**
|
|
1455
1457
|
* Start a quest for a user
|
package/dist/index.mjs
CHANGED
|
@@ -1385,19 +1385,21 @@ var QuestsClient = class {
|
|
|
1385
1385
|
// ---------------------------------------------------------------------------
|
|
1386
1386
|
/**
|
|
1387
1387
|
* Get quest with user progress
|
|
1388
|
+
* Fetches the quest and user's progress separately and combines them
|
|
1388
1389
|
*/
|
|
1389
1390
|
async getWithProgress(questId, userId) {
|
|
1390
|
-
|
|
1391
|
+
const [quest, progress] = await Promise.all([
|
|
1392
|
+
this.get(questId),
|
|
1393
|
+
this.getUserProgress(questId, userId).catch(() => void 0)
|
|
1394
|
+
]);
|
|
1395
|
+
return { quest, progress };
|
|
1391
1396
|
}
|
|
1392
1397
|
/**
|
|
1393
1398
|
* List quests with progress for a user
|
|
1399
|
+
* @deprecated Use listAvailable() instead - this is an alias
|
|
1394
1400
|
*/
|
|
1395
1401
|
async listWithProgress(userId, options = {}) {
|
|
1396
|
-
|
|
1397
|
-
params.append("user_id", userId);
|
|
1398
|
-
if (options.status) params.append("status", options.status);
|
|
1399
|
-
if (options.category) params.append("category", options.category);
|
|
1400
|
-
return this.http.get(`/quests/with-progress?${params.toString()}`);
|
|
1402
|
+
return this.listAvailable(userId, { category: options.category });
|
|
1401
1403
|
}
|
|
1402
1404
|
/**
|
|
1403
1405
|
* Start a quest for a user
|
package/package.json
CHANGED