@hosty-sdk/app 0.44.0 → 0.46.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/decisions.d.ts +1 -0
- package/dist/feedback-server.d.ts +6 -1
- package/dist/feedback-server.js +11 -3
- package/dist/feedback-types.d.ts +13 -0
- package/dist/tasks-server.js +2 -0
- package/dist/tasks.d.ts +11 -1
- package/package.json +1 -1
package/dist/decisions.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ export interface DecisionRecord {
|
|
|
106
106
|
resolutionRevision: number;
|
|
107
107
|
receivedAt: string | null;
|
|
108
108
|
} | null;
|
|
109
|
+
notificationPending?: boolean | null;
|
|
109
110
|
continuation: DecisionContinuation | null;
|
|
110
111
|
reason?: string | null;
|
|
111
112
|
contentRemovedAt?: string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProviderServerOptions } from "@hosty-sdk/app/providers/server";
|
|
2
|
-
import { type FeedbackCapabilities, type FeedbackSubmit, type FeedbackReport, type FeedbackCollection, type FeedbackDispatch, type FeedbackDispatchInput, type FeedbackDelivery, type FeedbackOutcome } from "@hosty-sdk/app/feedback";
|
|
2
|
+
import { type FeedbackCapabilities, type FeedbackSubmit, type FeedbackReport, type FeedbackCollection, type FeedbackDispatch, type FeedbackDispatchInput, type FeedbackDelivery, type FeedbackOutcome, type FeedbackEdit, type FeedbackDelete } from "@hosty-sdk/app/feedback";
|
|
3
3
|
export declare class FeedbackServerClient {
|
|
4
4
|
private readonly appId;
|
|
5
5
|
private readonly core;
|
|
@@ -24,6 +24,11 @@ export declare class FeedbackServerClient {
|
|
|
24
24
|
workspaceId: string | null;
|
|
25
25
|
disposition?: string | null;
|
|
26
26
|
}, token: string): Promise<FeedbackReport>;
|
|
27
|
+
edit(id: string, input: FeedbackEdit, token: string): Promise<FeedbackReport>;
|
|
28
|
+
remove(id: string, input: FeedbackDelete, token: string): Promise<{
|
|
29
|
+
id: string;
|
|
30
|
+
status: "deleted";
|
|
31
|
+
}>;
|
|
27
32
|
reserve(input: FeedbackDispatchInput, token: string): Promise<FeedbackDispatch>;
|
|
28
33
|
delivery(id: string, input: FeedbackDelivery, token: string): Promise<FeedbackDispatch>;
|
|
29
34
|
outcomes(id: string, outcomes: FeedbackOutcome[], token: string): Promise<FeedbackDispatch>;
|
package/dist/feedback-server.js
CHANGED
|
@@ -10,7 +10,7 @@ export class FeedbackServerClient {
|
|
|
10
10
|
if (!this.appId || !this.service)
|
|
11
11
|
throw new FeedbackError("hosty_misconfigured", "Hosty app credentials are unavailable.", 503);
|
|
12
12
|
}
|
|
13
|
-
async response(path, token, body, signal) {
|
|
13
|
+
async response(path, token, body, signal, mutation) {
|
|
14
14
|
if (!token)
|
|
15
15
|
throw new FeedbackError("identity_required", "Sign in to use feedback.", 401);
|
|
16
16
|
const response = await fetch(new URL("/api/internal/apps/" + encodeURIComponent(this.appId) + "/" + path, this.core), {
|
|
@@ -21,12 +21,14 @@ export class FeedbackServerClient {
|
|
|
21
21
|
});
|
|
22
22
|
if (!response.ok) {
|
|
23
23
|
const error = await response.json().catch(() => null);
|
|
24
|
+
if (mutation && error === null && (response.status === 404 || response.status === 405))
|
|
25
|
+
throw new FeedbackError("feedback_mutation_unsupported", `This Core does not support ${mutation} feedback. Update Core and retry.`, response.status);
|
|
24
26
|
throw new FeedbackError(error?.code ?? "feedback_unavailable", error?.message ?? "Feedback is unavailable. Your draft is retained.", response.status);
|
|
25
27
|
}
|
|
26
28
|
return response;
|
|
27
29
|
}
|
|
28
|
-
async request(path, token, body, signal) {
|
|
29
|
-
return (await this.response(path, token, body, signal)).json();
|
|
30
|
+
async request(path, token, body, signal, mutation) {
|
|
31
|
+
return (await this.response(path, token, body, signal, mutation)).json();
|
|
30
32
|
}
|
|
31
33
|
capabilities(token, signal) { return this.request("ui/feedback", token, undefined, signal); }
|
|
32
34
|
submit(input, token, signal) { return this.request("ui/feedback", token, input, signal); }
|
|
@@ -35,6 +37,12 @@ export class FeedbackServerClient {
|
|
|
35
37
|
change(id, input, token) {
|
|
36
38
|
return this.request("feedback/" + encodeURIComponent(id), token, input);
|
|
37
39
|
}
|
|
40
|
+
edit(id, input, token) {
|
|
41
|
+
return this.request("feedback/" + encodeURIComponent(id) + "/edit", token, input, undefined, "editing");
|
|
42
|
+
}
|
|
43
|
+
remove(id, input, token) {
|
|
44
|
+
return this.request("feedback/" + encodeURIComponent(id) + "/delete", token, input, undefined, "deleting");
|
|
45
|
+
}
|
|
38
46
|
reserve(input, token) { return this.request("feedback/dispatches", token, input); }
|
|
39
47
|
delivery(id, input, token) {
|
|
40
48
|
return this.request("feedback/dispatches/" + encodeURIComponent(id) + "/delivery", token, input);
|
package/dist/feedback-types.d.ts
CHANGED
|
@@ -76,6 +76,19 @@ export type FeedbackSelection = {
|
|
|
76
76
|
id: string;
|
|
77
77
|
revision: number;
|
|
78
78
|
};
|
|
79
|
+
export type FeedbackEdit = {
|
|
80
|
+
requestId: string;
|
|
81
|
+
expectedRevision: number;
|
|
82
|
+
comment: string;
|
|
83
|
+
annotations: {
|
|
84
|
+
id: string;
|
|
85
|
+
text: string;
|
|
86
|
+
}[];
|
|
87
|
+
};
|
|
88
|
+
export type FeedbackDelete = {
|
|
89
|
+
requestId: string;
|
|
90
|
+
expectedRevision: number;
|
|
91
|
+
};
|
|
79
92
|
export type FeedbackDispatchInput = {
|
|
80
93
|
requestId: string;
|
|
81
94
|
sessionId: string;
|
package/dist/tasks-server.js
CHANGED
|
@@ -30,6 +30,8 @@ export class TaskClient {
|
|
|
30
30
|
query.set("parentTaskRef", taskReferenceKey(options.parentTaskRef));
|
|
31
31
|
if (options.rootTaskRef)
|
|
32
32
|
query.set("rootTaskRef", taskReferenceKey(options.rootTaskRef));
|
|
33
|
+
if (options.removed !== undefined)
|
|
34
|
+
query.set("removed", String(options.removed));
|
|
33
35
|
if (options.rootsOnly !== undefined)
|
|
34
36
|
query.set("rootsOnly", String(options.rootsOnly));
|
|
35
37
|
return this.call(`/tasks?${query}`, "GET", undefined, options.signal);
|
package/dist/tasks.d.ts
CHANGED
|
@@ -129,6 +129,11 @@ export type TaskCoordination = {
|
|
|
129
129
|
executionId: string;
|
|
130
130
|
};
|
|
131
131
|
export type TaskRecord = TaskInput & {
|
|
132
|
+
removed?: {
|
|
133
|
+
batchId: string;
|
|
134
|
+
at: string;
|
|
135
|
+
by: TaskActor;
|
|
136
|
+
};
|
|
132
137
|
coordination?: TaskCoordination;
|
|
133
138
|
ref: TaskRef;
|
|
134
139
|
number: string;
|
|
@@ -172,12 +177,16 @@ export type TaskEdit = TaskMutation & {
|
|
|
172
177
|
expectedGraphRevision?: number;
|
|
173
178
|
};
|
|
174
179
|
export type TaskAction = TaskMutation & {
|
|
175
|
-
action: "ready" | "draft" | "start" | "complete" | "cancel" | "accept" | "request_changes" | "retry" | "disposition";
|
|
180
|
+
action: "ready" | "draft" | "start" | "complete" | "cancel" | "accept" | "request_changes" | "retry" | "disposition" | "remove" | "restore";
|
|
176
181
|
result?: TaskResult;
|
|
177
182
|
resultRef?: TaskOutcomeRef;
|
|
178
183
|
feedback?: string;
|
|
179
184
|
selection?: TaskSelection;
|
|
180
185
|
disposition?: TaskDisposition;
|
|
186
|
+
removalScope?: Array<{
|
|
187
|
+
taskRef: TaskRef;
|
|
188
|
+
revision: number;
|
|
189
|
+
}>;
|
|
181
190
|
};
|
|
182
191
|
export type TaskRequestReceipt = {
|
|
183
192
|
requestId: string;
|
|
@@ -196,6 +205,7 @@ export type TaskListOptions = {
|
|
|
196
205
|
parentTaskRef?: TaskRef;
|
|
197
206
|
rootTaskRef?: TaskRef;
|
|
198
207
|
rootsOnly?: boolean;
|
|
208
|
+
removed?: boolean;
|
|
199
209
|
};
|
|
200
210
|
export type TaskCapabilities = {
|
|
201
211
|
version: 1;
|
package/package.json
CHANGED