@sprucelabs/spruce-feed-view-controllers 15.0.11 → 15.0.13
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.
|
@@ -12,13 +12,14 @@ export default class FeedCardViewController extends AbstractViewController<Card>
|
|
|
12
12
|
protected feedVc: FeedViewController;
|
|
13
13
|
protected recipientId?: string;
|
|
14
14
|
private locationId?;
|
|
15
|
+
private organizationId?;
|
|
15
16
|
constructor(options: ViewControllerOptions & FeedCardViewControllerOptions);
|
|
16
17
|
private FeedVc;
|
|
17
18
|
private CardVc;
|
|
18
19
|
private handleSubmitForm;
|
|
19
20
|
protected handleDidUpdateFeedItem(item: FeedItem): void;
|
|
20
21
|
protected handleDidUpdateFeed({ payload, }: SpruceSchemas.Feed.v2023_03_04.DidUpdateFeedEmitTargetAndPayload): Promise<void>;
|
|
21
|
-
|
|
22
|
+
protected sendMessage(message: string): Promise<boolean>;
|
|
22
23
|
private removeItem;
|
|
23
24
|
private pushItem;
|
|
24
25
|
private addSentMessage;
|
|
@@ -38,4 +39,5 @@ export interface FeedCardLoadOptions {
|
|
|
38
39
|
authenticator: Authenticator;
|
|
39
40
|
recipientId?: string;
|
|
40
41
|
locationId?: string;
|
|
42
|
+
organizationId?: string;
|
|
41
43
|
}
|
|
@@ -70,6 +70,8 @@ class FeedCardViewController extends AbstractViewController {
|
|
|
70
70
|
yield client.emitAndFlattenResponses('send-message::v2020_12_25', {
|
|
71
71
|
target: {
|
|
72
72
|
personId: this.recipientId,
|
|
73
|
+
organizationId: this.organizationId,
|
|
74
|
+
locationId: this.locationId,
|
|
73
75
|
},
|
|
74
76
|
payload: {
|
|
75
77
|
message: {
|
|
@@ -129,11 +131,12 @@ class FeedCardViewController extends AbstractViewController {
|
|
|
129
131
|
}
|
|
130
132
|
load(options) {
|
|
131
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
const { predicates, authenticator, recipientId, locationId } = assertOptions(options, ['predicates', 'authenticator'], `You have to pass the search predicates and the authenticator to load the feed. They are in the form of { source: {...}, target: {...} }[]. If you wanna find anything to AND from a person, you gotta pass personId to both source AND target.`);
|
|
134
|
+
const { predicates, authenticator, recipientId, locationId, organizationId, } = assertOptions(options, ['predicates', 'authenticator'], `You have to pass the search predicates and the authenticator to load the feed. They are in the form of { source: {...}, target: {...} }[]. If you wanna find anything to AND from a person, you gotta pass personId to both source AND target.`);
|
|
133
135
|
this.recipientId = recipientId;
|
|
134
136
|
this.predicates = predicates;
|
|
135
137
|
this.auth = authenticator;
|
|
136
138
|
this.locationId = locationId;
|
|
139
|
+
this.organizationId = organizationId;
|
|
137
140
|
const client = yield this.connectToApi();
|
|
138
141
|
yield client.on('feed.did-update-feed::v2023_03_04', this.handleDidUpdateFeed);
|
|
139
142
|
if (recipientId) {
|
|
@@ -12,13 +12,14 @@ export default class FeedCardViewController extends AbstractViewController<Card>
|
|
|
12
12
|
protected feedVc: FeedViewController;
|
|
13
13
|
protected recipientId?: string;
|
|
14
14
|
private locationId?;
|
|
15
|
+
private organizationId?;
|
|
15
16
|
constructor(options: ViewControllerOptions & FeedCardViewControllerOptions);
|
|
16
17
|
private FeedVc;
|
|
17
18
|
private CardVc;
|
|
18
19
|
private handleSubmitForm;
|
|
19
20
|
protected handleDidUpdateFeedItem(item: FeedItem): void;
|
|
20
21
|
protected handleDidUpdateFeed({ payload, }: SpruceSchemas.Feed.v2023_03_04.DidUpdateFeedEmitTargetAndPayload): Promise<void>;
|
|
21
|
-
|
|
22
|
+
protected sendMessage(message: string): Promise<boolean>;
|
|
22
23
|
private removeItem;
|
|
23
24
|
private pushItem;
|
|
24
25
|
private addSentMessage;
|
|
@@ -38,4 +39,5 @@ export interface FeedCardLoadOptions {
|
|
|
38
39
|
authenticator: Authenticator;
|
|
39
40
|
recipientId?: string;
|
|
40
41
|
locationId?: string;
|
|
42
|
+
organizationId?: string;
|
|
41
43
|
}
|
|
@@ -56,6 +56,8 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
56
56
|
await client.emitAndFlattenResponses('send-message::v2020_12_25', {
|
|
57
57
|
target: {
|
|
58
58
|
personId: this.recipientId,
|
|
59
|
+
organizationId: this.organizationId,
|
|
60
|
+
locationId: this.locationId,
|
|
59
61
|
},
|
|
60
62
|
payload: {
|
|
61
63
|
message: {
|
|
@@ -113,11 +115,12 @@ class FeedCardViewController extends heartwood_view_controllers_1.AbstractViewCo
|
|
|
113
115
|
return this.isLoaded;
|
|
114
116
|
}
|
|
115
117
|
async load(options) {
|
|
116
|
-
const { predicates, authenticator, recipientId, locationId } = (0, schema_1.assertOptions)(options, ['predicates', 'authenticator'], `You have to pass the search predicates and the authenticator to load the feed. They are in the form of { source: {...}, target: {...} }[]. If you wanna find anything to AND from a person, you gotta pass personId to both source AND target.`);
|
|
118
|
+
const { predicates, authenticator, recipientId, locationId, organizationId, } = (0, schema_1.assertOptions)(options, ['predicates', 'authenticator'], `You have to pass the search predicates and the authenticator to load the feed. They are in the form of { source: {...}, target: {...} }[]. If you wanna find anything to AND from a person, you gotta pass personId to both source AND target.`);
|
|
117
119
|
this.recipientId = recipientId;
|
|
118
120
|
this.predicates = predicates;
|
|
119
121
|
this.auth = authenticator;
|
|
120
122
|
this.locationId = locationId;
|
|
123
|
+
this.organizationId = organizationId;
|
|
121
124
|
const client = await this.connectToApi();
|
|
122
125
|
await client.on('feed.did-update-feed::v2023_03_04', this.handleDidUpdateFeed);
|
|
123
126
|
if (recipientId) {
|