@indexnetwork/protocol 66.0.0-rc.624.1 → 66.0.0-rc.628.1
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/CHANGELOG.md
CHANGED
|
@@ -60,8 +60,9 @@ export declare function presentOpportunityCard(deps: OpportunityCardsDeps, oppor
|
|
|
60
60
|
}): Promise<OpportunityCard | null>;
|
|
61
61
|
/**
|
|
62
62
|
* List the viewer's opportunities in the given statuses as presented cards,
|
|
63
|
-
* newest first, one card per counterpart.
|
|
64
|
-
*
|
|
63
|
+
* newest first, one card per counterpart. A not-a-fit (rejected) row never
|
|
64
|
+
* takes that slot from another status for the same person. Cards whose
|
|
65
|
+
* presentation fails are dropped.
|
|
65
66
|
*
|
|
66
67
|
* @param deps - Database, cache, and presenter.
|
|
67
68
|
* @param input - Viewer, statuses, optional network/intent scope, limit, cache bypass, skeleton mode.
|
|
@@ -113,8 +113,9 @@ export async function presentOpportunityCard(deps, opportunity, viewerId, option
|
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* List the viewer's opportunities in the given statuses as presented cards,
|
|
116
|
-
* newest first, one card per counterpart.
|
|
117
|
-
*
|
|
116
|
+
* newest first, one card per counterpart. A not-a-fit (rejected) row never
|
|
117
|
+
* takes that slot from another status for the same person. Cards whose
|
|
118
|
+
* presentation fails are dropped.
|
|
118
119
|
*
|
|
119
120
|
* @param deps - Database, cache, and presenter.
|
|
120
121
|
* @param input - Viewer, statuses, optional network/intent scope, limit, cache bypass, skeleton mode.
|
|
@@ -131,7 +132,12 @@ export async function listOpportunityCards(deps, input) {
|
|
|
131
132
|
const requested = new Set(input.statuses);
|
|
132
133
|
const visible = raw
|
|
133
134
|
.filter((opp) => requested.has(opp.status) && canUserSeeOpportunity(opp.actors, opp.status, viewerId))
|
|
134
|
-
.sort((a, b) =>
|
|
135
|
+
.sort((a, b) => {
|
|
136
|
+
const failed = Number(a.status === 'rejected') - Number(b.status === 'rejected');
|
|
137
|
+
if (failed !== 0)
|
|
138
|
+
return failed;
|
|
139
|
+
return b.createdAt.getTime() - a.createdAt.getTime();
|
|
140
|
+
});
|
|
135
141
|
const seen = new Set();
|
|
136
142
|
const opportunities = visible.filter((opp) => {
|
|
137
143
|
const ids = counterpartUserIds(opp, viewerId);
|
|
@@ -78,7 +78,7 @@ export interface UserSocial {
|
|
|
78
78
|
}
|
|
79
79
|
/** Detection metadata recorded when an opportunity is created. */
|
|
80
80
|
export interface OpportunityDetection {
|
|
81
|
-
source: 'opportunity_graph' | 'chat' | 'cron' | 'member_added';
|
|
81
|
+
source: 'opportunity_graph' | 'chat' | 'cron' | 'member_added' | 'introducer';
|
|
82
82
|
createdBy?: Id<'users'> | string;
|
|
83
83
|
createdByName?: string;
|
|
84
84
|
triggeredBy?: Id<'intents'>;
|